htt.h 1008 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. * 3.113 Add add rx msdu,mpdu,ppdu fields in rx_ring_selection_cfg_t
  234. * 3.114 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET def.
  235. * 3.115 Add HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP and
  236. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE msg defs.
  237. * 3.116 Add HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE flag.
  238. * 3.117 Add HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND def.
  239. * 3.118 Add HTT_T2H_MSG_TYPE_RX_DATA_IND and _SOFT_UMAC_TX_COMPL_IND defs.
  240. * 3.119 Add RX_PEER_META_DATA V1A and V1B defs.
  241. * 3.120 Add HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND, _RESP defs.
  242. * 3.121 Add HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND def.
  243. * 3.122 Add is_umac_hang flag in H2T UMAC_HANG_RECOVERY_SOC_START_PRE_RESET msg
  244. * 3.123 Add HTT_OPTION_TLV_TCL_METADATA_V21 def.
  245. */
  246. #define HTT_CURRENT_VERSION_MAJOR 3
  247. #define HTT_CURRENT_VERSION_MINOR 123
  248. #define HTT_NUM_TX_FRAG_DESC 1024
  249. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  250. #define HTT_CHECK_SET_VAL(field, val) \
  251. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  252. /* macros to assist in sign-extending fields from HTT messages */
  253. #define HTT_SIGN_BIT_MASK(field) \
  254. ((field ## _M + (1 << field ## _S)) >> 1)
  255. #define HTT_SIGN_BIT(_val, field) \
  256. (_val & HTT_SIGN_BIT_MASK(field))
  257. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  258. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  259. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  260. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  261. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  262. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  263. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  264. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  265. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  266. /*
  267. * TEMPORARY:
  268. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  269. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  270. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  271. * updated.
  272. */
  273. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  274. /*
  275. * TEMPORARY:
  276. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  277. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  278. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  279. * updated.
  280. */
  281. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  282. /**
  283. * htt_dbg_stats_type -
  284. * bit positions for each stats type within a stats type bitmask
  285. * The bitmask contains 24 bits.
  286. */
  287. enum htt_dbg_stats_type {
  288. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  289. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  290. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  291. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  292. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  293. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  294. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  295. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  296. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  297. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  298. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  299. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  300. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  301. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  302. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  303. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  304. /* bits 16-23 currently reserved */
  305. /* keep this last */
  306. HTT_DBG_NUM_STATS
  307. };
  308. /*=== HTT option selection TLVs ===
  309. * Certain HTT messages have alternatives or options.
  310. * For such cases, the host and target need to agree on which option to use.
  311. * Option specification TLVs can be appended to the VERSION_REQ and
  312. * VERSION_CONF messages to select options other than the default.
  313. * These TLVs are entirely optional - if they are not provided, there is a
  314. * well-defined default for each option. If they are provided, they can be
  315. * provided in any order. Each TLV can be present or absent independent of
  316. * the presence / absence of other TLVs.
  317. *
  318. * The HTT option selection TLVs use the following format:
  319. * |31 16|15 8|7 0|
  320. * |---------------------------------+----------------+----------------|
  321. * | value (payload) | length | tag |
  322. * |-------------------------------------------------------------------|
  323. * The value portion need not be only 2 bytes; it can be extended by any
  324. * integer number of 4-byte units. The total length of the TLV, including
  325. * the tag and length fields, must be a multiple of 4 bytes. The length
  326. * field specifies the total TLV size in 4-byte units. Thus, the typical
  327. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  328. * field, would store 0x1 in its length field, to show that the TLV occupies
  329. * a single 4-byte unit.
  330. */
  331. /*--- TLV header format - applies to all HTT option TLVs ---*/
  332. enum HTT_OPTION_TLV_TAGS {
  333. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  334. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  335. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  336. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  337. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  338. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  339. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  340. };
  341. #define HTT_TCL_METADATA_VER_SZ 4
  342. PREPACK struct htt_option_tlv_header_t {
  343. A_UINT8 tag;
  344. A_UINT8 length;
  345. } POSTPACK;
  346. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  347. #define HTT_OPTION_TLV_TAG_S 0
  348. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  349. #define HTT_OPTION_TLV_LENGTH_S 8
  350. /*
  351. * value0 - 16 bit value field stored in word0
  352. * The TLV's value field may be longer than 2 bytes, in which case
  353. * the remainder of the value is stored in word1, word2, etc.
  354. */
  355. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  356. #define HTT_OPTION_TLV_VALUE0_S 16
  357. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  358. do { \
  359. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  360. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  361. } while (0)
  362. #define HTT_OPTION_TLV_TAG_GET(word) \
  363. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  364. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  365. do { \
  366. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  367. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  368. } while (0)
  369. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  370. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  371. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  372. do { \
  373. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  374. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  375. } while (0)
  376. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  377. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  378. /*--- format of specific HTT option TLVs ---*/
  379. /*
  380. * HTT option TLV for specifying LL bus address size
  381. * Some chips require bus addresses used by the target to access buffers
  382. * within the host's memory to be 32 bits; others require bus addresses
  383. * used by the target to access buffers within the host's memory to be
  384. * 64 bits.
  385. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  386. * a suffix to the VERSION_CONF message to specify which bus address format
  387. * the target requires.
  388. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  389. * default to providing bus addresses to the target in 32-bit format.
  390. */
  391. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  392. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  393. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  394. };
  395. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  396. struct htt_option_tlv_header_t hdr;
  397. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  398. } POSTPACK;
  399. /*
  400. * HTT option TLV for specifying whether HL systems should indicate
  401. * over-the-air tx completion for individual frames, or should instead
  402. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  403. * requests an OTA tx completion for a particular tx frame.
  404. * This option does not apply to LL systems, where the TX_COMPL_IND
  405. * is mandatory.
  406. * This option is primarily intended for HL systems in which the tx frame
  407. * downloads over the host --> target bus are as slow as or slower than
  408. * the transmissions over the WLAN PHY. For cases where the bus is faster
  409. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  410. * and consequently will send one TX_COMPL_IND message that covers several
  411. * tx frames. For cases where the WLAN PHY is faster than the bus,
  412. * the target will end up transmitting very short A-MPDUs, and consequently
  413. * sending many TX_COMPL_IND messages, which each cover a very small number
  414. * of tx frames.
  415. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  416. * a suffix to the VERSION_REQ message to request whether the host desires to
  417. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  418. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  419. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  420. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  421. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  422. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  423. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  424. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  425. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  426. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  427. * TLV.
  428. */
  429. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  430. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  431. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  432. };
  433. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  434. struct htt_option_tlv_header_t hdr;
  435. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  436. } POSTPACK;
  437. /*
  438. * HTT option TLV for specifying how many tx queue groups the target
  439. * may establish.
  440. * This TLV specifies the maximum value the target may send in the
  441. * txq_group_id field of any TXQ_GROUP information elements sent by
  442. * the target to the host. This allows the host to pre-allocate an
  443. * appropriate number of tx queue group structs.
  444. *
  445. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  446. * a suffix to the VERSION_REQ message to specify whether the host supports
  447. * tx queue groups at all, and if so if there is any limit on the number of
  448. * tx queue groups that the host supports.
  449. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  450. * a suffix to the VERSION_CONF message. If the host has specified in the
  451. * VER_REQ message a limit on the number of tx queue groups the host can
  452. * support, the target shall limit its specification of the maximum tx groups
  453. * to be no larger than this host-specified limit.
  454. *
  455. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  456. * shall preallocate 4 tx queue group structs, and the target shall not
  457. * specify a txq_group_id larger than 3.
  458. */
  459. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  460. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  461. /*
  462. * values 1 through N specify the max number of tx queue groups
  463. * the sender supports
  464. */
  465. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  466. };
  467. /* TEMPORARY backwards-compatibility alias for a typo fix -
  468. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  469. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  470. * to support the old name (with the typo) until all references to the
  471. * old name are replaced with the new name.
  472. */
  473. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  474. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  475. struct htt_option_tlv_header_t hdr;
  476. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  477. } POSTPACK;
  478. /*
  479. * HTT option TLV for specifying whether the target supports an extended
  480. * version of the HTT tx descriptor. If the target provides this TLV
  481. * and specifies in the TLV that the target supports an extended version
  482. * of the HTT tx descriptor, the target must check the "extension" bit in
  483. * the HTT tx descriptor, and if the extension bit is set, to expect a
  484. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  485. * descriptor. Furthermore, the target must provide room for the HTT
  486. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  487. * This option is intended for systems where the host needs to explicitly
  488. * control the transmission parameters such as tx power for individual
  489. * tx frames.
  490. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  491. * as a suffix to the VERSION_CONF message to explicitly specify whether
  492. * the target supports the HTT tx MSDU extension descriptor.
  493. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  494. * by the host as lack of target support for the HTT tx MSDU extension
  495. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  496. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  497. * the HTT tx MSDU extension descriptor.
  498. * The host is not required to provide the HTT tx MSDU extension descriptor
  499. * just because the target supports it; the target must check the
  500. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  501. * extension descriptor is present.
  502. */
  503. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  504. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  505. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  506. };
  507. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  508. struct htt_option_tlv_header_t hdr;
  509. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  510. } POSTPACK;
  511. /*
  512. * For the tcl data command V2 and higher support added a new
  513. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  514. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  515. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  516. * HTT option TLV for specifying which version of the TCL metadata struct
  517. * should be used:
  518. * V1 -> use htt_tx_tcl_metadata struct
  519. * V2 -> use htt_tx_tcl_metadata_v2 struct
  520. * Old FW will only support V1.
  521. * New FW will support V2. New FW will still support V1, at least during
  522. * a transition period.
  523. * Similarly, old host will only support V1, and new host will support V1 + V2.
  524. *
  525. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  526. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  527. * of TCL metadata the host supports. If the host doesn't provide a
  528. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  529. * is implicitly understood that the host only supports V1.
  530. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  531. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  532. * the host shall use. The target shall only select one of the versions
  533. * supported by the host. If the target doesn't provide a
  534. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  535. * is implicitly understood that the V1 TCL metadata shall be used.
  536. *
  537. * Feb 2023: Added version HTT_OPTION_TLV_TCL_METADATA_V21 = 21
  538. * read as version 2.1. We added support for Dynamic AST Index Allocation
  539. * for Alder+Pine in version 2.1. For HTT_OPTION_TLV_TCL_METADATA_V2 = 2
  540. * we will retain older behavior of making sure the AST Index for SAWF
  541. * in Pine is allocated using wifitool ath2 setUnitTestCmd 0x48 2 536 1
  542. * and the FW will crash in wal_tx_de_fast.c. For version 2.1 and
  543. * above we will use htt_tx_tcl_svc_class_id_metadata.ast_index
  544. * in TCLV2 command and do the dynamic AST allocations.
  545. */
  546. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  547. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  548. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  549. /* values 3-20 reserved */
  550. HTT_OPTION_TLV_TCL_METADATA_V21 = 21,
  551. };
  552. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  553. struct htt_option_tlv_header_t hdr;
  554. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  555. } POSTPACK;
  556. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  557. HTT_OPTION_TLV_VALUE0_SET(word, value)
  558. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  559. HTT_OPTION_TLV_VALUE0_GET(word)
  560. typedef struct {
  561. union {
  562. /* BIT [11 : 0] :- tag
  563. * BIT [23 : 12] :- length
  564. * BIT [31 : 24] :- reserved
  565. */
  566. A_UINT32 tag__length;
  567. /*
  568. * The following struct is not endian-portable.
  569. * It is suitable for use within the target, which is known to be
  570. * little-endian.
  571. * The host should use the above endian-portable macros to access
  572. * the tag and length bitfields in an endian-neutral manner.
  573. */
  574. struct {
  575. A_UINT32 tag : 12, /* BIT [11 : 0] */
  576. length : 12, /* BIT [23 : 12] */
  577. reserved : 8; /* BIT [31 : 24] */
  578. };
  579. };
  580. } htt_tlv_hdr_t;
  581. /** HTT stats TLV tag values */
  582. typedef enum {
  583. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  584. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  585. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  586. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  587. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  588. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  589. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  590. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  591. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  592. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  593. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  594. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  595. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  596. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  597. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  598. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  599. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  600. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  601. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  602. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  603. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  604. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  605. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  606. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  607. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  608. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  609. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  610. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  611. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  612. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  613. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  614. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  615. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  616. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  617. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  618. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  619. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  620. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  621. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  622. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  623. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  624. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  625. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  626. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  627. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  628. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  629. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  630. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  631. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  632. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  633. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  634. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  635. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  636. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  637. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  638. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  639. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  640. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  641. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  642. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  643. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  644. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  645. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  646. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  647. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  648. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  649. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  650. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  651. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  652. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  653. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  654. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  655. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  656. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  657. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  658. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  659. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  660. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  661. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  662. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  663. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  664. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  665. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  666. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  667. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  668. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  669. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  670. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  671. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  672. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  673. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  674. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  675. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  676. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  677. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  678. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  679. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  680. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  681. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  682. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  683. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  684. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  685. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  686. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  687. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  688. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  689. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  690. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  691. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  692. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  693. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  694. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  696. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  697. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  698. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  699. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  700. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  701. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  702. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  703. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  704. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  705. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  706. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  707. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  708. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  709. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  710. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  711. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  712. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  713. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  714. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  715. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  716. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  717. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  718. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  719. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  720. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  721. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  722. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  723. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  724. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  725. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  726. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  727. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  728. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  729. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  730. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  731. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  732. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  733. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  734. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  735. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  736. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  737. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  738. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  739. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  740. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  741. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  742. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  743. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  744. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  745. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  746. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  747. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  748. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  749. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  750. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  751. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  752. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  753. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  754. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  755. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  756. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  757. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  758. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  759. HTT_STATS_PDEV_MBSSID_CTRL_FRAME_STATS_TAG = 176, /* htt_pdev_mbssid_ctrl_frame_stats_tlv */
  760. HTT_STATS_TX_PDEV_MLO_ABORT_TAG = 177, /* htt_tx_pdev_stats_mlo_abort_tlv_v */
  761. HTT_STATS_TX_PDEV_MLO_TXOP_ABORT_TAG = 178, /* htt_tx_pdev_stats_mlo_txop_abort_tlv_v */
  762. HTT_STATS_UMAC_SSR_TAG = 179, /* htt_umac_ssr_stats_tlv */
  763. HTT_STATS_PEER_BE_OFDMA_STATS_TAG = 180, /* htt_peer_be_ofdma_stats_tlv */
  764. HTT_STATS_MLO_UMAC_SSR_TRIGGER_TAG = 181, /* htt_mlo_umac_ssr_trigger_stats_tlv */
  765. HTT_STATS_MLO_UMAC_SSR_CMN_TAG = 182, /* htt_mlo_umac_ssr_common_stats_tlv */
  766. HTT_STATS_MLO_UMAC_SSR_KPI_TSTMP_TAG = 183, /* htt_mlo_umac_ssr_kpi_tstamp_stats_tlv */
  767. HTT_STATS_MLO_UMAC_SSR_DBG_TAG = 184, /* htt_mlo_umac_ssr_dbg_tlv */
  768. HTT_STATS_MLO_UMAC_SSR_HANDSHAKE_TAG = 185, /* htt_mlo_umac_htt_handshake_stats_tlv */
  769. HTT_STATS_MLO_UMAC_SSR_MLO_TAG = 186, /* htt_mlo_umac_ssr_mlo_stats_tlv */
  770. HTT_STATS_MAX_TAG,
  771. } htt_stats_tlv_tag_t;
  772. /* retain deprecated enum name as an alias for the current enum name */
  773. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  774. #define HTT_STATS_TLV_TAG_M 0x00000fff
  775. #define HTT_STATS_TLV_TAG_S 0
  776. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  777. #define HTT_STATS_TLV_LENGTH_S 12
  778. #define HTT_STATS_TLV_TAG_GET(_var) \
  779. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  780. HTT_STATS_TLV_TAG_S)
  781. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  782. do { \
  783. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  784. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  785. } while (0)
  786. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  787. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  788. HTT_STATS_TLV_LENGTH_S)
  789. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  790. do { \
  791. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  792. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  793. } while (0)
  794. /*=== host -> target messages ===============================================*/
  795. enum htt_h2t_msg_type {
  796. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  797. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  798. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  799. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  800. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  801. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  802. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  803. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  804. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  805. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  806. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  807. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  808. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  809. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  810. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  811. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  812. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  813. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  814. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  815. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  816. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  817. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  818. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  819. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  820. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  821. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  822. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  823. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  824. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  825. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  826. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  827. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  828. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  829. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  830. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET = 0x22,
  831. HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP = 0x23,
  832. HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP = 0x24,
  833. /* keep this last */
  834. HTT_H2T_NUM_MSGS
  835. };
  836. /*
  837. * HTT host to target message type -
  838. * stored in bits 7:0 of the first word of the message
  839. */
  840. #define HTT_H2T_MSG_TYPE_M 0xff
  841. #define HTT_H2T_MSG_TYPE_S 0
  842. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  843. do { \
  844. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  845. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  846. } while (0)
  847. #define HTT_H2T_MSG_TYPE_GET(word) \
  848. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  849. /**
  850. * @brief host -> target version number request message definition
  851. *
  852. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  853. *
  854. *
  855. * |31 24|23 16|15 8|7 0|
  856. * |----------------+----------------+----------------+----------------|
  857. * | reserved | msg type |
  858. * |-------------------------------------------------------------------|
  859. * : option request TLV (optional) |
  860. * :...................................................................:
  861. *
  862. * The VER_REQ message may consist of a single 4-byte word, or may be
  863. * extended with TLVs that specify which HTT options the host is requesting
  864. * from the target.
  865. * The following option TLVs may be appended to the VER_REQ message:
  866. * - HL_SUPPRESS_TX_COMPL_IND
  867. * - HL_MAX_TX_QUEUE_GROUPS
  868. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  869. * may be appended to the VER_REQ message (but only one TLV of each type).
  870. *
  871. * Header fields:
  872. * - MSG_TYPE
  873. * Bits 7:0
  874. * Purpose: identifies this as a version number request message
  875. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  876. */
  877. #define HTT_VER_REQ_BYTES 4
  878. /* TBDXXX: figure out a reasonable number */
  879. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  880. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  881. /**
  882. * @brief HTT tx MSDU descriptor
  883. *
  884. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  885. *
  886. * @details
  887. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  888. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  889. * the target firmware needs for the FW's tx processing, particularly
  890. * for creating the HW msdu descriptor.
  891. * The same HTT tx descriptor is used for HL and LL systems, though
  892. * a few fields within the tx descriptor are used only by LL or
  893. * only by HL.
  894. * The HTT tx descriptor is defined in two manners: by a struct with
  895. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  896. * definitions.
  897. * The target should use the struct def, for simplicitly and clarity,
  898. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  899. * neutral. Specifically, the host shall use the get/set macros built
  900. * around the mask + shift defs.
  901. */
  902. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  903. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  904. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  905. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  906. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  907. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  908. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  909. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  910. #define HTT_TX_VDEV_ID_WORD 0
  911. #define HTT_TX_VDEV_ID_MASK 0x3f
  912. #define HTT_TX_VDEV_ID_SHIFT 16
  913. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  914. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  915. #define HTT_TX_MSDU_LEN_DWORD 1
  916. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  917. /*
  918. * HTT_VAR_PADDR macros
  919. * Allow physical / bus addresses to be either a single 32-bit value,
  920. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  921. */
  922. #define HTT_VAR_PADDR32(var_name) \
  923. A_UINT32 var_name
  924. #define HTT_VAR_PADDR64_LE(var_name) \
  925. struct { \
  926. /* little-endian: lo precedes hi */ \
  927. A_UINT32 lo; \
  928. A_UINT32 hi; \
  929. } var_name
  930. /*
  931. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  932. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  933. * addresses are stored in a XXX-bit field.
  934. * This macro is used to define both htt_tx_msdu_desc32_t and
  935. * htt_tx_msdu_desc64_t structs.
  936. */
  937. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  938. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  939. { \
  940. /* DWORD 0: flags and meta-data */ \
  941. A_UINT32 \
  942. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  943. \
  944. /* pkt_subtype - \
  945. * Detailed specification of the tx frame contents, extending the \
  946. * general specification provided by pkt_type. \
  947. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  948. * pkt_type | pkt_subtype \
  949. * ============================================================== \
  950. * 802.3 | bit 0:3 - Reserved \
  951. * | bit 4: 0x0 - Copy-Engine Classification Results \
  952. * | not appended to the HTT message \
  953. * | 0x1 - Copy-Engine Classification Results \
  954. * | appended to the HTT message in the \
  955. * | format: \
  956. * | [HTT tx desc, frame header, \
  957. * | CE classification results] \
  958. * | The CE classification results begin \
  959. * | at the next 4-byte boundary after \
  960. * | the frame header. \
  961. * ------------+------------------------------------------------- \
  962. * Eth2 | bit 0:3 - Reserved \
  963. * | bit 4: 0x0 - Copy-Engine Classification Results \
  964. * | not appended to the HTT message \
  965. * | 0x1 - Copy-Engine Classification Results \
  966. * | appended to the HTT message. \
  967. * | See the above specification of the \
  968. * | CE classification results location. \
  969. * ------------+------------------------------------------------- \
  970. * native WiFi | bit 0:3 - Reserved \
  971. * | bit 4: 0x0 - Copy-Engine Classification Results \
  972. * | not appended to the HTT message \
  973. * | 0x1 - Copy-Engine Classification Results \
  974. * | appended to the HTT message. \
  975. * | See the above specification of the \
  976. * | CE classification results location. \
  977. * ------------+------------------------------------------------- \
  978. * mgmt | 0x0 - 802.11 MAC header absent \
  979. * | 0x1 - 802.11 MAC header present \
  980. * ------------+------------------------------------------------- \
  981. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  982. * | 0x1 - 802.11 MAC header present \
  983. * | bit 1: 0x0 - allow aggregation \
  984. * | 0x1 - don't allow aggregation \
  985. * | bit 2: 0x0 - perform encryption \
  986. * | 0x1 - don't perform encryption \
  987. * | bit 3: 0x0 - perform tx classification / queuing \
  988. * | 0x1 - don't perform tx classification; \
  989. * | insert the frame into the "misc" \
  990. * | tx queue \
  991. * | bit 4: 0x0 - Copy-Engine Classification Results \
  992. * | not appended to the HTT message \
  993. * | 0x1 - Copy-Engine Classification Results \
  994. * | appended to the HTT message. \
  995. * | See the above specification of the \
  996. * | CE classification results location. \
  997. */ \
  998. pkt_subtype: 5, \
  999. \
  1000. /* pkt_type - \
  1001. * General specification of the tx frame contents. \
  1002. * The htt_pkt_type enum should be used to specify and check the \
  1003. * value of this field. \
  1004. */ \
  1005. pkt_type: 3, \
  1006. \
  1007. /* vdev_id - \
  1008. * ID for the vdev that is sending this tx frame. \
  1009. * For certain non-standard packet types, e.g. pkt_type == raw \
  1010. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  1011. * This field is used primarily for determining where to queue \
  1012. * broadcast and multicast frames. \
  1013. */ \
  1014. vdev_id: 6, \
  1015. /* ext_tid - \
  1016. * The extended traffic ID. \
  1017. * If the TID is unknown, the extended TID is set to \
  1018. * HTT_TX_EXT_TID_INVALID. \
  1019. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  1020. * value of the QoS TID. \
  1021. * If the tx frame is non-QoS data, then the extended TID is set to \
  1022. * HTT_TX_EXT_TID_NON_QOS. \
  1023. * If the tx frame is multicast or broadcast, then the extended TID \
  1024. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  1025. */ \
  1026. ext_tid: 5, \
  1027. \
  1028. /* postponed - \
  1029. * This flag indicates whether the tx frame has been downloaded to \
  1030. * the target before but discarded by the target, and now is being \
  1031. * downloaded again; or if this is a new frame that is being \
  1032. * downloaded for the first time. \
  1033. * This flag allows the target to determine the correct order for \
  1034. * transmitting new vs. old frames. \
  1035. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  1036. * This flag only applies to HL systems, since in LL systems, \
  1037. * the tx flow control is handled entirely within the target. \
  1038. */ \
  1039. postponed: 1, \
  1040. \
  1041. /* extension - \
  1042. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1043. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1044. * \
  1045. * 0x0 - no extension MSDU descriptor is present \
  1046. * 0x1 - an extension MSDU descriptor immediately follows the \
  1047. * regular MSDU descriptor \
  1048. */ \
  1049. extension: 1, \
  1050. \
  1051. /* cksum_offload - \
  1052. * This flag indicates whether checksum offload is enabled or not \
  1053. * for this frame. Target FW use this flag to turn on HW checksumming \
  1054. * 0x0 - No checksum offload \
  1055. * 0x1 - L3 header checksum only \
  1056. * 0x2 - L4 checksum only \
  1057. * 0x3 - L3 header checksum + L4 checksum \
  1058. */ \
  1059. cksum_offload: 2, \
  1060. \
  1061. /* tx_comp_req - \
  1062. * This flag indicates whether Tx Completion \
  1063. * from fw is required or not. \
  1064. * This flag is only relevant if tx completion is not \
  1065. * universally enabled. \
  1066. * For all LL systems, tx completion is mandatory, \
  1067. * so this flag will be irrelevant. \
  1068. * For HL systems tx completion is optional, but HL systems in which \
  1069. * the bus throughput exceeds the WLAN throughput will \
  1070. * probably want to always use tx completion, and thus \
  1071. * would not check this flag. \
  1072. * This flag is required when tx completions are not used universally, \
  1073. * but are still required for certain tx frames for which \
  1074. * an OTA delivery acknowledgment is needed by the host. \
  1075. * In practice, this would be for HL systems in which the \
  1076. * bus throughput is less than the WLAN throughput. \
  1077. * \
  1078. * 0x0 - Tx Completion Indication from Fw not required \
  1079. * 0x1 - Tx Completion Indication from Fw is required \
  1080. */ \
  1081. tx_compl_req: 1; \
  1082. \
  1083. \
  1084. /* DWORD 1: MSDU length and ID */ \
  1085. A_UINT32 \
  1086. len: 16, /* MSDU length, in bytes */ \
  1087. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1088. * and this id is used to calculate fragmentation \
  1089. * descriptor pointer inside the target based on \
  1090. * the base address, configured inside the target. \
  1091. */ \
  1092. \
  1093. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1094. /* frags_desc_ptr - \
  1095. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1096. * where the tx frame's fragments reside in memory. \
  1097. * This field only applies to LL systems, since in HL systems the \
  1098. * (degenerate single-fragment) fragmentation descriptor is created \
  1099. * within the target. \
  1100. */ \
  1101. _paddr__frags_desc_ptr_; \
  1102. \
  1103. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1104. /* \
  1105. * Peer ID : Target can use this value to know which peer-id packet \
  1106. * destined to. \
  1107. * It's intended to be specified by host in case of NAWDS. \
  1108. */ \
  1109. A_UINT16 peerid; \
  1110. \
  1111. /* \
  1112. * Channel frequency: This identifies the desired channel \
  1113. * frequency (in mhz) for tx frames. This is used by FW to help \
  1114. * determine when it is safe to transmit or drop frames for \
  1115. * off-channel operation. \
  1116. * The default value of zero indicates to FW that the corresponding \
  1117. * VDEV's home channel (if there is one) is the desired channel \
  1118. * frequency. \
  1119. */ \
  1120. A_UINT16 chanfreq; \
  1121. \
  1122. /* Reason reserved is commented is increasing the htt structure size \
  1123. * leads to some weird issues. \
  1124. * A_UINT32 reserved_dword3_bits0_31; \
  1125. */ \
  1126. } POSTPACK
  1127. /* define a htt_tx_msdu_desc32_t type */
  1128. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1129. /* define a htt_tx_msdu_desc64_t type */
  1130. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1131. /*
  1132. * Make htt_tx_msdu_desc_t be an alias for either
  1133. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1134. */
  1135. #if HTT_PADDR64
  1136. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1137. #else
  1138. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1139. #endif
  1140. /* decriptor information for Management frame*/
  1141. /*
  1142. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1143. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1144. */
  1145. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1146. extern A_UINT32 mgmt_hdr_len;
  1147. PREPACK struct htt_mgmt_tx_desc_t {
  1148. A_UINT32 msg_type;
  1149. #if HTT_PADDR64
  1150. A_UINT64 frag_paddr; /* DMAble address of the data */
  1151. #else
  1152. A_UINT32 frag_paddr; /* DMAble address of the data */
  1153. #endif
  1154. A_UINT32 desc_id; /* returned to host during completion
  1155. * to free the meory*/
  1156. A_UINT32 len; /* Fragment length */
  1157. A_UINT32 vdev_id; /* virtual device ID*/
  1158. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1159. } POSTPACK;
  1160. PREPACK struct htt_mgmt_tx_compl_ind {
  1161. A_UINT32 desc_id;
  1162. A_UINT32 status;
  1163. } POSTPACK;
  1164. /*
  1165. * This SDU header size comes from the summation of the following:
  1166. * 1. Max of:
  1167. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1168. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1169. * b. 802.11 header, for raw frames: 36 bytes
  1170. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1171. * QoS header, HT header)
  1172. * c. 802.3 header, for ethernet frames: 14 bytes
  1173. * (destination address, source address, ethertype / length)
  1174. * 2. Max of:
  1175. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1176. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1177. * 3. 802.1Q VLAN header: 4 bytes
  1178. * 4. LLC/SNAP header: 8 bytes
  1179. */
  1180. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1181. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1182. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1183. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1184. A_COMPILE_TIME_ASSERT(
  1185. htt_encap_hdr_size_max_check_nwifi,
  1186. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1187. A_COMPILE_TIME_ASSERT(
  1188. htt_encap_hdr_size_max_check_enet,
  1189. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1190. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1191. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1192. #define HTT_TX_HDR_SIZE_802_1Q 4
  1193. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1194. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1195. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1196. HTT_TX_HDR_SIZE_802_1Q + \
  1197. HTT_TX_HDR_SIZE_LLC_SNAP)
  1198. #define HTT_HL_TX_FRM_HDR_LEN \
  1199. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1200. #define HTT_LL_TX_FRM_HDR_LEN \
  1201. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1202. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1203. /* dword 0 */
  1204. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1205. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1206. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1207. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1208. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1209. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1210. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1211. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1212. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1213. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1214. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1215. #define HTT_TX_DESC_PKT_TYPE_S 13
  1216. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1217. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1218. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1219. #define HTT_TX_DESC_VDEV_ID_S 16
  1220. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1221. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1222. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1223. #define HTT_TX_DESC_EXT_TID_S 22
  1224. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1225. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1226. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1227. #define HTT_TX_DESC_POSTPONED_S 27
  1228. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1229. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1230. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1231. #define HTT_TX_DESC_EXTENSION_S 28
  1232. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1233. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1234. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1235. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1236. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1237. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1238. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1239. #define HTT_TX_DESC_TX_COMP_S 31
  1240. /* dword 1 */
  1241. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1242. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1243. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1244. #define HTT_TX_DESC_FRM_LEN_S 0
  1245. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1246. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1247. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1248. #define HTT_TX_DESC_FRM_ID_S 16
  1249. /* dword 2 */
  1250. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1251. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1252. /* for systems using 64-bit format for bus addresses */
  1253. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1254. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1255. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1256. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1257. /* for systems using 32-bit format for bus addresses */
  1258. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1259. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1260. /* dword 3 */
  1261. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1262. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1263. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1264. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1265. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1266. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1267. #if HTT_PADDR64
  1268. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1269. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1270. #else
  1271. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1272. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1273. #endif
  1274. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1275. #define HTT_TX_DESC_PEER_ID_S 0
  1276. /*
  1277. * TEMPORARY:
  1278. * The original definitions for the PEER_ID fields contained typos
  1279. * (with _DESC_PADDR appended to this PEER_ID field name).
  1280. * Retain deprecated original names for PEER_ID fields until all code that
  1281. * refers to them has been updated.
  1282. */
  1283. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1284. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1285. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1286. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1287. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1288. HTT_TX_DESC_PEER_ID_M
  1289. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1290. HTT_TX_DESC_PEER_ID_S
  1291. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1292. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1293. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1294. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1295. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1296. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1297. #if HTT_PADDR64
  1298. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1299. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1300. #else
  1301. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1302. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1303. #endif
  1304. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1305. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1306. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1307. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1308. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1312. } while (0)
  1313. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1314. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1315. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1316. do { \
  1317. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1318. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1319. } while (0)
  1320. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1321. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1322. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1323. do { \
  1324. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1325. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1326. } while (0)
  1327. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1328. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1329. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1330. do { \
  1331. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1332. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1333. } while (0)
  1334. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1335. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1336. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1337. do { \
  1338. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1339. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1340. } while (0)
  1341. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1342. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1343. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1344. do { \
  1345. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1346. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1347. } while (0)
  1348. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1349. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1350. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1354. } while (0)
  1355. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1356. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1357. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1360. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1361. } while (0)
  1362. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1363. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1364. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1365. do { \
  1366. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1367. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1368. } while (0)
  1369. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1370. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1371. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1372. do { \
  1373. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1374. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1375. } while (0)
  1376. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1377. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1378. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1381. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1382. } while (0)
  1383. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1384. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1385. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1386. do { \
  1387. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1388. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1389. } while (0)
  1390. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1391. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1392. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1393. do { \
  1394. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1395. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1396. } while (0)
  1397. /* enums used in the HTT tx MSDU extension descriptor */
  1398. enum {
  1399. htt_tx_guard_interval_regular = 0,
  1400. htt_tx_guard_interval_short = 1,
  1401. };
  1402. enum {
  1403. htt_tx_preamble_type_ofdm = 0,
  1404. htt_tx_preamble_type_cck = 1,
  1405. htt_tx_preamble_type_ht = 2,
  1406. htt_tx_preamble_type_vht = 3,
  1407. };
  1408. enum {
  1409. htt_tx_bandwidth_5MHz = 0,
  1410. htt_tx_bandwidth_10MHz = 1,
  1411. htt_tx_bandwidth_20MHz = 2,
  1412. htt_tx_bandwidth_40MHz = 3,
  1413. htt_tx_bandwidth_80MHz = 4,
  1414. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1415. };
  1416. /**
  1417. * @brief HTT tx MSDU extension descriptor
  1418. * @details
  1419. * If the target supports HTT tx MSDU extension descriptors, the host has
  1420. * the option of appending the following struct following the regular
  1421. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1422. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1423. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1424. * tx specs for each frame.
  1425. */
  1426. PREPACK struct htt_tx_msdu_desc_ext_t {
  1427. /* DWORD 0: flags */
  1428. A_UINT32
  1429. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1430. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1431. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1432. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1433. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1434. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1435. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1436. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1437. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1438. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1439. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1440. /* DWORD 1: tx power, tx rate, tx BW */
  1441. A_UINT32
  1442. /* pwr -
  1443. * Specify what power the tx frame needs to be transmitted at.
  1444. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1445. * The value needs to be appropriately sign-extended when extracting
  1446. * the value from the message and storing it in a variable that is
  1447. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1448. * automatically handles this sign-extension.)
  1449. * If the transmission uses multiple tx chains, this power spec is
  1450. * the total transmit power, assuming incoherent combination of
  1451. * per-chain power to produce the total power.
  1452. */
  1453. pwr: 8,
  1454. /* mcs_mask -
  1455. * Specify the allowable values for MCS index (modulation and coding)
  1456. * to use for transmitting the frame.
  1457. *
  1458. * For HT / VHT preamble types, this mask directly corresponds to
  1459. * the HT or VHT MCS indices that are allowed. For each bit N set
  1460. * within the mask, MCS index N is allowed for transmitting the frame.
  1461. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1462. * rates versus OFDM rates, so the host has the option of specifying
  1463. * that the target must transmit the frame with CCK or OFDM rates
  1464. * (not HT or VHT), but leaving the decision to the target whether
  1465. * to use CCK or OFDM.
  1466. *
  1467. * For CCK and OFDM, the bits within this mask are interpreted as
  1468. * follows:
  1469. * bit 0 -> CCK 1 Mbps rate is allowed
  1470. * bit 1 -> CCK 2 Mbps rate is allowed
  1471. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1472. * bit 3 -> CCK 11 Mbps rate is allowed
  1473. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1474. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1475. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1476. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1477. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1478. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1479. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1480. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1481. *
  1482. * The MCS index specification needs to be compatible with the
  1483. * bandwidth mask specification. For example, a MCS index == 9
  1484. * specification is inconsistent with a preamble type == VHT,
  1485. * Nss == 1, and channel bandwidth == 20 MHz.
  1486. *
  1487. * Furthermore, the host has only a limited ability to specify to
  1488. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1489. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1490. */
  1491. mcs_mask: 12,
  1492. /* nss_mask -
  1493. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1494. * Each bit in this mask corresponds to a Nss value:
  1495. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1496. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1497. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1498. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1499. * The values in the Nss mask must be suitable for the recipient, e.g.
  1500. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1501. * recipient which only supports 2x2 MIMO.
  1502. */
  1503. nss_mask: 4,
  1504. /* guard_interval -
  1505. * Specify a htt_tx_guard_interval enum value to indicate whether
  1506. * the transmission should use a regular guard interval or a
  1507. * short guard interval.
  1508. */
  1509. guard_interval: 1,
  1510. /* preamble_type_mask -
  1511. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1512. * may choose from for transmitting this frame.
  1513. * The bits in this mask correspond to the values in the
  1514. * htt_tx_preamble_type enum. For example, to allow the target
  1515. * to transmit the frame as either CCK or OFDM, this field would
  1516. * be set to
  1517. * (1 << htt_tx_preamble_type_ofdm) |
  1518. * (1 << htt_tx_preamble_type_cck)
  1519. */
  1520. preamble_type_mask: 4,
  1521. reserved1_31_29: 3; /* unused, set to 0x0 */
  1522. /* DWORD 2: tx chain mask, tx retries */
  1523. A_UINT32
  1524. /* chain_mask - specify which chains to transmit from */
  1525. chain_mask: 4,
  1526. /* retry_limit -
  1527. * Specify the maximum number of transmissions, including the
  1528. * initial transmission, to attempt before giving up if no ack
  1529. * is received.
  1530. * If the tx rate is specified, then all retries shall use the
  1531. * same rate as the initial transmission.
  1532. * If no tx rate is specified, the target can choose whether to
  1533. * retain the original rate during the retransmissions, or to
  1534. * fall back to a more robust rate.
  1535. */
  1536. retry_limit: 4,
  1537. /* bandwidth_mask -
  1538. * Specify what channel widths may be used for the transmission.
  1539. * A value of zero indicates "don't care" - the target may choose
  1540. * the transmission bandwidth.
  1541. * The bits within this mask correspond to the htt_tx_bandwidth
  1542. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1543. * The bandwidth_mask must be consistent with the preamble_type_mask
  1544. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1545. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1546. */
  1547. bandwidth_mask: 6,
  1548. reserved2_31_14: 18; /* unused, set to 0x0 */
  1549. /* DWORD 3: tx expiry time (TSF) LSBs */
  1550. A_UINT32 expire_tsf_lo;
  1551. /* DWORD 4: tx expiry time (TSF) MSBs */
  1552. A_UINT32 expire_tsf_hi;
  1553. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1554. } POSTPACK;
  1555. /* DWORD 0 */
  1556. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1557. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1559. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1560. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1564. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1565. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1567. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1568. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1573. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1574. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1575. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1576. /* DWORD 1 */
  1577. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1578. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1579. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1580. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1581. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1582. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1583. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1584. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1585. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1586. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1587. /* DWORD 2 */
  1588. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1589. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1590. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1591. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1592. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1593. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1594. /* DWORD 0 */
  1595. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1597. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1598. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1605. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1606. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1613. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1614. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL( \
  1617. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1618. ((_var) |= ((_val) \
  1619. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1620. } while (0)
  1621. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1622. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1623. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1624. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1625. do { \
  1626. HTT_CHECK_SET_VAL( \
  1627. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1628. ((_var) |= ((_val) \
  1629. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1630. } while (0)
  1631. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1633. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1634. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1637. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1638. } while (0)
  1639. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1640. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1641. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1642. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1643. do { \
  1644. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1645. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1646. } while (0)
  1647. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1648. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1649. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1650. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1651. do { \
  1652. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1653. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1654. } while (0)
  1655. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1656. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1657. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1658. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1659. do { \
  1660. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1661. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1662. } while (0)
  1663. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1664. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1665. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1666. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1667. do { \
  1668. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1669. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1670. } while (0)
  1671. /* DWORD 1 */
  1672. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1673. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1674. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1675. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1676. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1677. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1678. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1679. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1680. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1681. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1682. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1683. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1684. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1685. do { \
  1686. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1687. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1688. } while (0)
  1689. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1690. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1691. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1692. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1693. do { \
  1694. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1695. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1696. } while (0)
  1697. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1698. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1699. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1700. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1703. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1704. } while (0)
  1705. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1706. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1707. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1708. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1709. do { \
  1710. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1711. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1712. } while (0)
  1713. /* DWORD 2 */
  1714. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1715. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1716. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1717. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1718. do { \
  1719. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1720. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1721. } while (0)
  1722. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1723. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1724. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1725. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1726. do { \
  1727. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1728. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1729. } while (0)
  1730. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1731. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1732. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1733. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1734. do { \
  1735. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1736. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1737. } while (0)
  1738. typedef enum {
  1739. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1740. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1741. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1742. } htt_11ax_ltf_subtype_t;
  1743. typedef enum {
  1744. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1745. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1746. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1747. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1748. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1749. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1750. } htt_tx_ext2_preamble_type_t;
  1751. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1752. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1753. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1754. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1755. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1756. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1757. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1758. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1759. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1760. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1761. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1762. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1763. /**
  1764. * @brief HTT tx MSDU extension descriptor v2
  1765. * @details
  1766. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1767. * is received as tcl_exit_base->host_meta_info in firmware.
  1768. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1769. * are already part of tcl_exit_base.
  1770. */
  1771. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1772. /* DWORD 0: flags */
  1773. A_UINT32
  1774. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1775. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1776. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1777. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1778. valid_retries : 1, /* if set, tx retries spec is valid */
  1779. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1780. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1781. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1782. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1783. valid_key_flags : 1, /* if set, key flags is valid */
  1784. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1785. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1786. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1787. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1788. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1789. 1 = ENCRYPT,
  1790. 2 ~ 3 - Reserved */
  1791. /* retry_limit -
  1792. * Specify the maximum number of transmissions, including the
  1793. * initial transmission, to attempt before giving up if no ack
  1794. * is received.
  1795. * If the tx rate is specified, then all retries shall use the
  1796. * same rate as the initial transmission.
  1797. * If no tx rate is specified, the target can choose whether to
  1798. * retain the original rate during the retransmissions, or to
  1799. * fall back to a more robust rate.
  1800. */
  1801. retry_limit : 4,
  1802. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1803. * Valid only for 11ax preamble types HE_SU
  1804. * and HE_EXT_SU
  1805. */
  1806. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1807. * Valid only for 11ax preamble types HE_SU
  1808. * and HE_EXT_SU
  1809. */
  1810. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1811. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1812. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1813. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1814. */
  1815. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1816. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1817. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1818. * Use cases:
  1819. * Any time firmware uses TQM-BYPASS for Data
  1820. * TID, firmware expect host to set this bit.
  1821. */
  1822. /* DWORD 1: tx power, tx rate */
  1823. A_UINT32
  1824. power : 8, /* unit of the power field is 0.5 dbm
  1825. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1826. * signed value ranging from -64dbm to 63.5 dbm
  1827. */
  1828. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1829. * Setting more than one MCS isn't currently
  1830. * supported by the target (but is supported
  1831. * in the interface in case in the future
  1832. * the target supports specifications of
  1833. * a limited set of MCS values.
  1834. */
  1835. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1836. * Setting more than one Nss isn't currently
  1837. * supported by the target (but is supported
  1838. * in the interface in case in the future
  1839. * the target supports specifications of
  1840. * a limited set of Nss values.
  1841. */
  1842. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1843. update_peer_cache : 1; /* When set these custom values will be
  1844. * used for all packets, until the next
  1845. * update via this ext header.
  1846. * This is to make sure not all packets
  1847. * need to include this header.
  1848. */
  1849. /* DWORD 2: tx chain mask, tx retries */
  1850. A_UINT32
  1851. /* chain_mask - specify which chains to transmit from */
  1852. chain_mask : 8,
  1853. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1854. * TODO: Update Enum values for key_flags
  1855. */
  1856. /*
  1857. * Channel frequency: This identifies the desired channel
  1858. * frequency (in MHz) for tx frames. This is used by FW to help
  1859. * determine when it is safe to transmit or drop frames for
  1860. * off-channel operation.
  1861. * The default value of zero indicates to FW that the corresponding
  1862. * VDEV's home channel (if there is one) is the desired channel
  1863. * frequency.
  1864. */
  1865. chanfreq : 16;
  1866. /* DWORD 3: tx expiry time (TSF) LSBs */
  1867. A_UINT32 expire_tsf_lo;
  1868. /* DWORD 4: tx expiry time (TSF) MSBs */
  1869. A_UINT32 expire_tsf_hi;
  1870. /* DWORD 5: flags to control routing / processing of the MSDU */
  1871. A_UINT32
  1872. /* learning_frame
  1873. * When this flag is set, this frame will be dropped by FW
  1874. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1875. */
  1876. learning_frame : 1,
  1877. /* send_as_standalone
  1878. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1879. * i.e. with no A-MSDU or A-MPDU aggregation.
  1880. * The scope is extended to other use-cases.
  1881. */
  1882. send_as_standalone : 1,
  1883. /* is_host_opaque_valid
  1884. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1885. * with valid information.
  1886. */
  1887. is_host_opaque_valid : 1,
  1888. traffic_end_indication: 1,
  1889. rsvd0 : 28;
  1890. /* DWORD 6 : Host opaque cookie for special frames */
  1891. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1892. rsvd1 : 16;
  1893. /*
  1894. * This structure can be expanded further up to 40 bytes
  1895. * by adding further DWORDs as needed.
  1896. */
  1897. } POSTPACK;
  1898. /* DWORD 0 */
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1907. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1910. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1921. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1925. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1926. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1927. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1928. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1929. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1930. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1931. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1932. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1933. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1934. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1935. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1936. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1937. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1938. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1939. /* DWORD 1 */
  1940. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1941. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1942. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1943. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1944. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1945. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1946. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1947. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1948. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1949. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1950. /* DWORD 2 */
  1951. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1952. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1953. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1954. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1955. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1956. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1957. /* DWORD 5 */
  1958. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1960. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1963. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1964. /* DWORD 6 */
  1965. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1966. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1967. /* DWORD 0 */
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1969. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1970. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1971. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1972. do { \
  1973. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1974. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1975. } while (0)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1977. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1978. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1979. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1980. do { \
  1981. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1982. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1983. } while (0)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1985. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1986. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1988. do { \
  1989. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1990. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1991. } while (0)
  1992. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1993. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1994. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1996. do { \
  1997. HTT_CHECK_SET_VAL( \
  1998. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1999. ((_var) |= ((_val) \
  2000. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  2001. } while (0)
  2002. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  2003. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  2004. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  2005. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  2008. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  2009. } while (0)
  2010. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  2011. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  2012. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  2013. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  2014. do { \
  2015. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  2016. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  2017. } while (0)
  2018. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  2019. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  2020. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  2021. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  2022. do { \
  2023. HTT_CHECK_SET_VAL( \
  2024. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  2025. ((_var) |= ((_val) \
  2026. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  2027. } while (0)
  2028. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  2029. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  2030. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  2031. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  2035. } while (0)
  2036. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2037. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2038. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2039. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2043. } while (0)
  2044. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2045. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2046. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2047. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2051. } while (0)
  2052. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2053. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2054. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2055. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2058. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2059. } while (0)
  2060. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2061. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2062. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2063. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2064. do { \
  2065. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2066. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2067. } while (0)
  2068. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2069. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2070. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2071. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2074. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2075. } while (0)
  2076. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2077. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2078. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2079. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2082. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2083. } while (0)
  2084. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2085. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2086. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2087. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2091. } while (0)
  2092. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2093. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2094. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2095. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2099. } while (0)
  2100. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2101. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2102. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2103. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2104. do { \
  2105. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2106. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2107. } while (0)
  2108. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2109. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2110. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2111. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2112. do { \
  2113. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2114. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2115. } while (0)
  2116. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2117. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2118. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2119. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2120. do { \
  2121. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2122. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2123. } while (0)
  2124. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2125. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2126. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2127. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2128. do { \
  2129. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2130. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2131. } while (0)
  2132. /* DWORD 1 */
  2133. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2134. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2135. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2136. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2137. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2138. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2139. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2140. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2141. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2142. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2143. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2144. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2145. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2146. do { \
  2147. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2148. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2149. } while (0)
  2150. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2151. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2152. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2153. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2154. do { \
  2155. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2156. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2157. } while (0)
  2158. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2159. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2160. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2161. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2162. do { \
  2163. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2164. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2165. } while (0)
  2166. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2167. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2168. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2169. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2170. do { \
  2171. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2172. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2173. } while (0)
  2174. /* DWORD 2 */
  2175. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2176. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2177. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2178. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2179. do { \
  2180. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2181. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2182. } while (0)
  2183. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2184. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2185. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2186. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2187. do { \
  2188. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2189. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2190. } while (0)
  2191. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2192. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2193. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2194. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2195. do { \
  2196. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2197. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2198. } while (0)
  2199. /* DWORD 5 */
  2200. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2201. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2202. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2203. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2204. do { \
  2205. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2206. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2207. } while (0)
  2208. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2209. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2210. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2211. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2212. do { \
  2213. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2214. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2215. } while (0)
  2216. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2217. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2218. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2219. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2220. do { \
  2221. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2222. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2223. } while (0)
  2224. /* DWORD 6 */
  2225. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2226. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2227. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2228. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2229. do { \
  2230. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2231. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2232. } while (0)
  2233. typedef enum {
  2234. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2235. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2236. } htt_tcl_metadata_type;
  2237. /**
  2238. * @brief HTT TCL command number format
  2239. * @details
  2240. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2241. * available to firmware as tcl_exit_base->tcl_status_number.
  2242. * For regular / multicast packets host will send vdev and mac id and for
  2243. * NAWDS packets, host will send peer id.
  2244. * A_UINT32 is used to avoid endianness conversion problems.
  2245. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2246. */
  2247. typedef struct {
  2248. A_UINT32
  2249. type: 1, /* vdev_id based or peer_id based */
  2250. rsvd: 31;
  2251. } htt_tx_tcl_vdev_or_peer_t;
  2252. typedef struct {
  2253. A_UINT32
  2254. type: 1, /* vdev_id based or peer_id based */
  2255. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2256. vdev_id: 8,
  2257. pdev_id: 2,
  2258. host_inspected:1,
  2259. rsvd: 19;
  2260. } htt_tx_tcl_vdev_metadata;
  2261. typedef struct {
  2262. A_UINT32
  2263. type: 1, /* vdev_id based or peer_id based */
  2264. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2265. peer_id: 14,
  2266. rsvd: 16;
  2267. } htt_tx_tcl_peer_metadata;
  2268. PREPACK struct htt_tx_tcl_metadata {
  2269. union {
  2270. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2271. htt_tx_tcl_vdev_metadata vdev_meta;
  2272. htt_tx_tcl_peer_metadata peer_meta;
  2273. };
  2274. } POSTPACK;
  2275. /* DWORD 0 */
  2276. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2277. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2278. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2279. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2280. /* VDEV metadata */
  2281. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2282. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2283. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2284. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2285. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2286. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2287. /* PEER metadata */
  2288. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2289. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2290. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2291. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2292. HTT_TX_TCL_METADATA_TYPE_S)
  2293. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2294. do { \
  2295. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2296. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2297. } while (0)
  2298. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2299. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2300. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2301. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2302. do { \
  2303. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2304. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2305. } while (0)
  2306. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2307. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2308. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2309. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2310. do { \
  2311. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2312. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2313. } while (0)
  2314. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2315. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2316. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2317. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2318. do { \
  2319. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2320. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2321. } while (0)
  2322. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2323. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2324. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2325. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2326. do { \
  2327. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2328. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2329. } while (0)
  2330. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2331. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2332. HTT_TX_TCL_METADATA_PEER_ID_S)
  2333. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2334. do { \
  2335. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2336. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2337. } while (0)
  2338. /*------------------------------------------------------------------
  2339. * V2 Version of TCL Data Command
  2340. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2341. * MLO global_seq all flavours of TCL Data Cmd.
  2342. *-----------------------------------------------------------------*/
  2343. typedef enum {
  2344. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2345. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2346. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2347. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2348. } htt_tcl_metadata_type_v2;
  2349. /**
  2350. * @brief HTT TCL command number format
  2351. * @details
  2352. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2353. * available to firmware as tcl_exit_base->tcl_status_number.
  2354. * A_UINT32 is used to avoid endianness conversion problems.
  2355. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2356. */
  2357. typedef struct {
  2358. A_UINT32
  2359. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2360. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2361. vdev_id: 8,
  2362. pdev_id: 2,
  2363. host_inspected:1,
  2364. rsvd: 2,
  2365. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2366. } htt_tx_tcl_vdev_metadata_v2;
  2367. typedef struct {
  2368. A_UINT32
  2369. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2370. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2371. peer_id: 13,
  2372. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2373. } htt_tx_tcl_peer_metadata_v2;
  2374. typedef struct {
  2375. A_UINT32
  2376. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2377. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2378. svc_class_id: 8,
  2379. ast_index: 3, /* Indicates to firmware the AST index to be used for Pine for AST Override */
  2380. rsvd: 2,
  2381. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2382. } htt_tx_tcl_svc_class_id_metadata;
  2383. typedef struct {
  2384. A_UINT32
  2385. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2386. host_inspected: 1,
  2387. global_seq_no: 12,
  2388. rsvd: 1,
  2389. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2390. } htt_tx_tcl_global_seq_metadata;
  2391. PREPACK struct htt_tx_tcl_metadata_v2 {
  2392. union {
  2393. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2394. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2395. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2396. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2397. };
  2398. } POSTPACK;
  2399. /* DWORD 0 */
  2400. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2401. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2402. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2403. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2404. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2405. /* VDEV V2 metadata */
  2406. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2407. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2408. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2409. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2410. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2411. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2412. /* PEER V2 metadata */
  2413. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2414. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2415. /* SVC_CLASS_ID metadata */
  2416. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2417. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2418. /* Global Seq no metadata */
  2419. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2420. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2421. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2422. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2423. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2424. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2425. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2426. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2427. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2428. do { \
  2429. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2430. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2431. } while (0)
  2432. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2433. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2434. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2435. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2439. } while (0)
  2440. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2441. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2442. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2443. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2444. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2445. do { \
  2446. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2447. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2448. } while (0)
  2449. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2450. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2451. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2452. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2455. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2456. } while (0)
  2457. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2458. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2459. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2460. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2463. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2464. } while (0)
  2465. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2466. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2467. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2468. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2469. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2470. do { \
  2471. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2472. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2473. } while (0)
  2474. /*----- Get and Set V2 type field in Service Class fields ----*/
  2475. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2476. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2477. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2478. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2479. do { \
  2480. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2481. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2482. } while (0)
  2483. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2484. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2485. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2486. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2487. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2488. do { \
  2489. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2490. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2491. } while (0)
  2492. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2493. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2494. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2495. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2496. do { \
  2497. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2498. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2499. } while (0)
  2500. /*------------------------------------------------------------------
  2501. * End V2 Version of TCL Data Command
  2502. *-----------------------------------------------------------------*/
  2503. typedef enum {
  2504. HTT_TX_FW2WBM_TX_STATUS_OK,
  2505. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2506. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2507. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2508. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2509. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2510. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2511. HTT_TX_FW2WBM_TX_STATUS_MAX
  2512. } htt_tx_fw2wbm_tx_status_t;
  2513. typedef enum {
  2514. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2515. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2516. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2517. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2518. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2519. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2520. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2521. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2522. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2523. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2524. } htt_tx_fw2wbm_reinject_reason_t;
  2525. /**
  2526. * @brief HTT TX WBM Completion from firmware to host
  2527. * @details
  2528. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2529. * DWORD 3 and 4 for software based completions (Exception frames and
  2530. * TQM bypass frames)
  2531. * For software based completions, wbm_release_ring->release_source_module will
  2532. * be set to release_source_fw
  2533. */
  2534. PREPACK struct htt_tx_wbm_completion {
  2535. A_UINT32
  2536. sch_cmd_id: 24,
  2537. exception_frame: 1, /* If set, this packet was queued via exception path */
  2538. rsvd0_31_25: 7;
  2539. A_UINT32
  2540. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2541. * reception of an ACK or BA, this field indicates
  2542. * the RSSI of the received ACK or BA frame.
  2543. * When the frame is removed as result of a direct
  2544. * remove command from the SW, this field is set
  2545. * to 0x0 (which is never a valid value when real
  2546. * RSSI is available).
  2547. * Units: dB w.r.t noise floor
  2548. */
  2549. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2550. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2551. rsvd1_31_16: 16;
  2552. } POSTPACK;
  2553. /* DWORD 0 */
  2554. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2555. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2556. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2557. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2558. /* DWORD 1 */
  2559. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2560. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2561. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2562. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2563. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2564. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2565. /* DWORD 0 */
  2566. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2567. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2568. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2569. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2570. do { \
  2571. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2572. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2573. } while (0)
  2574. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2575. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2576. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2577. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2578. do { \
  2579. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2580. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2581. } while (0)
  2582. /* DWORD 1 */
  2583. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2584. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2585. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2586. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2587. do { \
  2588. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2589. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2590. } while (0)
  2591. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2592. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2593. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2594. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2595. do { \
  2596. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2597. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2598. } while (0)
  2599. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2600. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2601. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2602. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2603. do { \
  2604. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2605. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2606. } while (0)
  2607. /**
  2608. * @brief HTT TX WBM Completion from firmware to host
  2609. * @details
  2610. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2611. * (WBM) offload HW.
  2612. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2613. * For software based completions, release_source_module will
  2614. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2615. * struct wbm_release_ring and then switch to this after looking at
  2616. * release_source_module.
  2617. */
  2618. PREPACK struct htt_tx_wbm_completion_v2 {
  2619. A_UINT32
  2620. used_by_hw0; /* Refer to struct wbm_release_ring */
  2621. A_UINT32
  2622. used_by_hw1; /* Refer to struct wbm_release_ring */
  2623. A_UINT32
  2624. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2625. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2626. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2627. exception_frame: 1,
  2628. rsvd0: 12, /* For future use */
  2629. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2630. rsvd1: 1; /* For future use */
  2631. A_UINT32
  2632. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2633. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2634. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2635. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2636. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2637. */
  2638. A_UINT32
  2639. data1: 32;
  2640. A_UINT32
  2641. data2: 32;
  2642. A_UINT32
  2643. used_by_hw3; /* Refer to struct wbm_release_ring */
  2644. } POSTPACK;
  2645. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2646. /* DWORD 3 */
  2647. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2648. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2649. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2650. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2651. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2652. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2653. /* DWORD 3 */
  2654. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2655. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2656. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2657. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2658. do { \
  2659. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2660. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2661. } while (0)
  2662. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2663. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2664. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2665. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2666. do { \
  2667. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2668. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2669. } while (0)
  2670. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2671. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2672. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2673. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2674. do { \
  2675. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2676. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2677. } while (0)
  2678. /**
  2679. * @brief HTT TX WBM Completion from firmware to host (V3)
  2680. * @details
  2681. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2682. * (WBM) offload HW.
  2683. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2684. * For software based completions, release_source_module will
  2685. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2686. * struct wbm_release_ring and then switch to this after looking at
  2687. * release_source_module.
  2688. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2689. * by new generations of targets.
  2690. */
  2691. PREPACK struct htt_tx_wbm_completion_v3 {
  2692. A_UINT32
  2693. used_by_hw0; /* Refer to struct wbm_release_ring */
  2694. A_UINT32
  2695. used_by_hw1; /* Refer to struct wbm_release_ring */
  2696. A_UINT32
  2697. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2698. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2699. used_by_hw3: 15;
  2700. A_UINT32
  2701. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2702. exception_frame: 1,
  2703. rsvd0: 27; /* For future use */
  2704. A_UINT32
  2705. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2706. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2707. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2708. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2709. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2710. */
  2711. A_UINT32
  2712. data1: 32;
  2713. A_UINT32
  2714. data2: 32;
  2715. A_UINT32
  2716. rsvd1: 20,
  2717. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2718. } POSTPACK;
  2719. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2720. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2721. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2722. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2723. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2724. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2725. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2726. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2727. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2728. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2729. do { \
  2730. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2731. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2732. } while (0)
  2733. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2734. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2735. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2736. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2737. do { \
  2738. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2739. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2740. } while (0)
  2741. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2742. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2743. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2744. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2745. do { \
  2746. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2747. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2748. } while (0)
  2749. typedef enum {
  2750. TX_FRAME_TYPE_UNDEFINED = 0,
  2751. TX_FRAME_TYPE_EAPOL = 1,
  2752. } htt_tx_wbm_status_frame_type;
  2753. /**
  2754. * @brief HTT TX WBM transmit status from firmware to host
  2755. * @details
  2756. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2757. * (WBM) offload HW.
  2758. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2759. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2760. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2761. */
  2762. PREPACK struct htt_tx_wbm_transmit_status {
  2763. A_UINT32
  2764. sch_cmd_id: 24,
  2765. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2766. * reception of an ACK or BA, this field indicates
  2767. * the RSSI of the received ACK or BA frame.
  2768. * When the frame is removed as result of a direct
  2769. * remove command from the SW, this field is set
  2770. * to 0x0 (which is never a valid value when real
  2771. * RSSI is available).
  2772. * Units: dB w.r.t noise floor
  2773. */
  2774. A_UINT32
  2775. sw_peer_id: 16,
  2776. tid_num: 5,
  2777. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2778. * and tid_num fields contain valid data.
  2779. * If this "valid" flag is not set, the
  2780. * sw_peer_id and tid_num fields must be ignored.
  2781. */
  2782. mcast: 1,
  2783. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2784. * contains valid data.
  2785. */
  2786. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2787. reserved: 4;
  2788. A_UINT32
  2789. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2790. * packets in the wbm completion path
  2791. */
  2792. } POSTPACK;
  2793. /* DWORD 4 */
  2794. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2795. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2796. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2797. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2798. /* DWORD 5 */
  2799. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2800. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2801. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2802. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2803. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2804. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2805. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2806. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2807. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2808. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2809. /* DWORD 4 */
  2810. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2811. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2812. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2813. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2814. do { \
  2815. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2816. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2817. } while (0)
  2818. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2819. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2820. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2821. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2822. do { \
  2823. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2824. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2825. } while (0)
  2826. /* DWORD 5 */
  2827. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2828. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2829. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2830. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2833. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2834. } while (0)
  2835. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2836. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2837. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2838. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2841. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2842. } while (0)
  2843. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2844. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2845. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2846. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2847. do { \
  2848. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2849. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2850. } while (0)
  2851. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2852. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2853. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2854. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2855. do { \
  2856. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2857. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2858. } while (0)
  2859. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2860. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2861. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2862. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2865. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2866. } while (0)
  2867. /**
  2868. * @brief HTT TX WBM reinject status from firmware to host
  2869. * @details
  2870. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2871. * (WBM) offload HW.
  2872. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2873. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2874. */
  2875. PREPACK struct htt_tx_wbm_reinject_status {
  2876. A_UINT32
  2877. reserved0: 32;
  2878. A_UINT32
  2879. reserved1: 32;
  2880. A_UINT32
  2881. reserved2: 32;
  2882. } POSTPACK;
  2883. /**
  2884. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2885. * @details
  2886. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2887. * (WBM) offload HW.
  2888. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2889. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2890. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2891. * STA side.
  2892. */
  2893. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2894. A_UINT32
  2895. mec_sa_addr_31_0;
  2896. A_UINT32
  2897. mec_sa_addr_47_32: 16,
  2898. sa_ast_index: 16;
  2899. A_UINT32
  2900. vdev_id: 8,
  2901. reserved0: 24;
  2902. } POSTPACK;
  2903. /* DWORD 4 - mec_sa_addr_31_0 */
  2904. /* DWORD 5 */
  2905. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2906. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2907. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2908. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2909. /* DWORD 6 */
  2910. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2911. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2912. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2913. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2914. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2915. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2918. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2919. } while (0)
  2920. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2921. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2922. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2923. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2926. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2927. } while (0)
  2928. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2929. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2930. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2931. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2934. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2935. } while (0)
  2936. typedef enum {
  2937. TX_FLOW_PRIORITY_BE,
  2938. TX_FLOW_PRIORITY_HIGH,
  2939. TX_FLOW_PRIORITY_LOW,
  2940. } htt_tx_flow_priority_t;
  2941. typedef enum {
  2942. TX_FLOW_LATENCY_SENSITIVE,
  2943. TX_FLOW_LATENCY_INSENSITIVE,
  2944. } htt_tx_flow_latency_t;
  2945. typedef enum {
  2946. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2947. TX_FLOW_INTERACTIVE_TRAFFIC,
  2948. TX_FLOW_PERIODIC_TRAFFIC,
  2949. TX_FLOW_BURSTY_TRAFFIC,
  2950. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2951. } htt_tx_flow_traffic_pattern_t;
  2952. /**
  2953. * @brief HTT TX Flow search metadata format
  2954. * @details
  2955. * Host will set this metadata in flow table's flow search entry along with
  2956. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2957. * firmware and TQM ring if the flow search entry wins.
  2958. * This metadata is available to firmware in that first MSDU's
  2959. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2960. * to one of the available flows for specific tid and returns the tqm flow
  2961. * pointer as part of htt_tx_map_flow_info message.
  2962. */
  2963. PREPACK struct htt_tx_flow_metadata {
  2964. A_UINT32
  2965. rsvd0_1_0: 2,
  2966. tid: 4,
  2967. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2968. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2969. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2970. * Else choose final tid based on latency, priority.
  2971. */
  2972. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2973. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2974. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2975. } POSTPACK;
  2976. /* DWORD 0 */
  2977. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2978. #define HTT_TX_FLOW_METADATA_TID_S 2
  2979. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2980. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2981. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2982. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2983. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2984. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2985. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2986. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2987. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2988. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2989. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2990. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2991. /* DWORD 0 */
  2992. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2993. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2994. HTT_TX_FLOW_METADATA_TID_S)
  2995. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2996. do { \
  2997. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2998. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2999. } while (0)
  3000. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  3001. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  3002. HTT_TX_FLOW_METADATA_PRIORITY_S)
  3003. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  3004. do { \
  3005. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  3006. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  3007. } while (0)
  3008. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  3009. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  3010. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  3011. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  3014. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  3015. } while (0)
  3016. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  3017. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  3018. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  3019. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  3022. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  3023. } while (0)
  3024. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  3025. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  3026. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  3027. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  3028. do { \
  3029. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  3030. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  3031. } while (0)
  3032. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  3033. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  3034. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  3035. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  3036. do { \
  3037. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3038. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3039. } while (0)
  3040. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3041. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3042. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3043. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3044. do { \
  3045. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3046. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3047. } while (0)
  3048. /**
  3049. * @brief host -> target ADD WDS Entry
  3050. *
  3051. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3052. *
  3053. * @brief host -> target DELETE WDS Entry
  3054. *
  3055. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3056. *
  3057. * @details
  3058. * HTT wds entry from source port learning
  3059. * Host will learn wds entries from rx and send this message to firmware
  3060. * to enable firmware to configure/delete AST entries for wds clients.
  3061. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3062. * and when SA's entry is deleted, firmware removes this AST entry
  3063. *
  3064. * The message would appear as follows:
  3065. *
  3066. * |31 30|29 |17 16|15 8|7 0|
  3067. * |----------------+----------------+----------------+----------------|
  3068. * | rsvd0 |PDVID| vdev_id | msg_type |
  3069. * |-------------------------------------------------------------------|
  3070. * | sa_addr_31_0 |
  3071. * |-------------------------------------------------------------------|
  3072. * | | ta_peer_id | sa_addr_47_32 |
  3073. * |-------------------------------------------------------------------|
  3074. * Where PDVID = pdev_id
  3075. *
  3076. * The message is interpreted as follows:
  3077. *
  3078. * dword0 - b'0:7 - msg_type: This will be set to
  3079. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3080. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3081. *
  3082. * dword0 - b'8:15 - vdev_id
  3083. *
  3084. * dword0 - b'16:17 - pdev_id
  3085. *
  3086. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3087. *
  3088. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3089. *
  3090. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3091. *
  3092. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3093. */
  3094. PREPACK struct htt_wds_entry {
  3095. A_UINT32
  3096. msg_type: 8,
  3097. vdev_id: 8,
  3098. pdev_id: 2,
  3099. rsvd0: 14;
  3100. A_UINT32 sa_addr_31_0;
  3101. A_UINT32
  3102. sa_addr_47_32: 16,
  3103. ta_peer_id: 14,
  3104. rsvd2: 2;
  3105. } POSTPACK;
  3106. /* DWORD 0 */
  3107. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3108. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3109. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3110. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3111. /* DWORD 2 */
  3112. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3113. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3114. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3115. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3116. /* DWORD 0 */
  3117. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3118. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3119. HTT_WDS_ENTRY_VDEV_ID_S)
  3120. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3121. do { \
  3122. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3123. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3124. } while (0)
  3125. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3126. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3127. HTT_WDS_ENTRY_PDEV_ID_S)
  3128. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3129. do { \
  3130. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3131. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3132. } while (0)
  3133. /* DWORD 2 */
  3134. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3135. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3136. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3137. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3138. do { \
  3139. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3140. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3141. } while (0)
  3142. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3143. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3144. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3145. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3146. do { \
  3147. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3148. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3149. } while (0)
  3150. /**
  3151. * @brief MAC DMA rx ring setup specification
  3152. *
  3153. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3154. *
  3155. * @details
  3156. * To allow for dynamic rx ring reconfiguration and to avoid race
  3157. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3158. * it uses. Instead, it sends this message to the target, indicating how
  3159. * the rx ring used by the host should be set up and maintained.
  3160. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3161. * specifications.
  3162. *
  3163. * |31 16|15 8|7 0|
  3164. * |---------------------------------------------------------------|
  3165. * header: | reserved | num rings | msg type |
  3166. * |---------------------------------------------------------------|
  3167. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3168. #if HTT_PADDR64
  3169. * | FW_IDX shadow register physical address (bits 63:32) |
  3170. #endif
  3171. * |---------------------------------------------------------------|
  3172. * | rx ring base physical address (bits 31:0) |
  3173. #if HTT_PADDR64
  3174. * | rx ring base physical address (bits 63:32) |
  3175. #endif
  3176. * |---------------------------------------------------------------|
  3177. * | rx ring buffer size | rx ring length |
  3178. * |---------------------------------------------------------------|
  3179. * | FW_IDX initial value | enabled flags |
  3180. * |---------------------------------------------------------------|
  3181. * | MSDU payload offset | 802.11 header offset |
  3182. * |---------------------------------------------------------------|
  3183. * | PPDU end offset | PPDU start offset |
  3184. * |---------------------------------------------------------------|
  3185. * | MPDU end offset | MPDU start offset |
  3186. * |---------------------------------------------------------------|
  3187. * | MSDU end offset | MSDU start offset |
  3188. * |---------------------------------------------------------------|
  3189. * | frag info offset | rx attention offset |
  3190. * |---------------------------------------------------------------|
  3191. * payload 2, if present, has the same format as payload 1
  3192. * Header fields:
  3193. * - MSG_TYPE
  3194. * Bits 7:0
  3195. * Purpose: identifies this as an rx ring configuration message
  3196. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3197. * - NUM_RINGS
  3198. * Bits 15:8
  3199. * Purpose: indicates whether the host is setting up one rx ring or two
  3200. * Value: 1 or 2
  3201. * Payload:
  3202. * for systems using 64-bit format for bus addresses:
  3203. * - IDX_SHADOW_REG_PADDR_LO
  3204. * Bits 31:0
  3205. * Value: lower 4 bytes of physical address of the host's
  3206. * FW_IDX shadow register
  3207. * - IDX_SHADOW_REG_PADDR_HI
  3208. * Bits 31:0
  3209. * Value: upper 4 bytes of physical address of the host's
  3210. * FW_IDX shadow register
  3211. * - RING_BASE_PADDR_LO
  3212. * Bits 31:0
  3213. * Value: lower 4 bytes of physical address of the host's rx ring
  3214. * - RING_BASE_PADDR_HI
  3215. * Bits 31:0
  3216. * Value: uppper 4 bytes of physical address of the host's rx ring
  3217. * for systems using 32-bit format for bus addresses:
  3218. * - IDX_SHADOW_REG_PADDR
  3219. * Bits 31:0
  3220. * Value: physical address of the host's FW_IDX shadow register
  3221. * - RING_BASE_PADDR
  3222. * Bits 31:0
  3223. * Value: physical address of the host's rx ring
  3224. * - RING_LEN
  3225. * Bits 15:0
  3226. * Value: number of elements in the rx ring
  3227. * - RING_BUF_SZ
  3228. * Bits 31:16
  3229. * Value: size of the buffers referenced by the rx ring, in byte units
  3230. * - ENABLED_FLAGS
  3231. * Bits 15:0
  3232. * Value: 1-bit flags to show whether different rx fields are enabled
  3233. * bit 0: 802.11 header enabled (1) or disabled (0)
  3234. * bit 1: MSDU payload enabled (1) or disabled (0)
  3235. * bit 2: PPDU start enabled (1) or disabled (0)
  3236. * bit 3: PPDU end enabled (1) or disabled (0)
  3237. * bit 4: MPDU start enabled (1) or disabled (0)
  3238. * bit 5: MPDU end enabled (1) or disabled (0)
  3239. * bit 6: MSDU start enabled (1) or disabled (0)
  3240. * bit 7: MSDU end enabled (1) or disabled (0)
  3241. * bit 8: rx attention enabled (1) or disabled (0)
  3242. * bit 9: frag info enabled (1) or disabled (0)
  3243. * bit 10: unicast rx enabled (1) or disabled (0)
  3244. * bit 11: multicast rx enabled (1) or disabled (0)
  3245. * bit 12: ctrl rx enabled (1) or disabled (0)
  3246. * bit 13: mgmt rx enabled (1) or disabled (0)
  3247. * bit 14: null rx enabled (1) or disabled (0)
  3248. * bit 15: phy data rx enabled (1) or disabled (0)
  3249. * - IDX_INIT_VAL
  3250. * Bits 31:16
  3251. * Purpose: Specify the initial value for the FW_IDX.
  3252. * Value: the number of buffers initially present in the host's rx ring
  3253. * - OFFSET_802_11_HDR
  3254. * Bits 15:0
  3255. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3256. * - OFFSET_MSDU_PAYLOAD
  3257. * Bits 31:16
  3258. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3259. * - OFFSET_PPDU_START
  3260. * Bits 15:0
  3261. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3262. * - OFFSET_PPDU_END
  3263. * Bits 31:16
  3264. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3265. * - OFFSET_MPDU_START
  3266. * Bits 15:0
  3267. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3268. * - OFFSET_MPDU_END
  3269. * Bits 31:16
  3270. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3271. * - OFFSET_MSDU_START
  3272. * Bits 15:0
  3273. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3274. * - OFFSET_MSDU_END
  3275. * Bits 31:16
  3276. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3277. * - OFFSET_RX_ATTN
  3278. * Bits 15:0
  3279. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3280. * - OFFSET_FRAG_INFO
  3281. * Bits 31:16
  3282. * Value: offset in QUAD-bytes of frag info table
  3283. */
  3284. /* header fields */
  3285. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3286. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3287. /* payload fields */
  3288. /* for systems using a 64-bit format for bus addresses */
  3289. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3290. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3291. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3292. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3293. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3294. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3295. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3296. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3297. /* for systems using a 32-bit format for bus addresses */
  3298. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3299. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3300. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3301. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3302. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3303. #define HTT_RX_RING_CFG_LEN_S 0
  3304. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3305. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3306. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3307. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3308. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3309. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3310. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3311. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3312. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3313. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3314. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3315. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3316. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3317. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3318. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3319. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3320. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3321. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3322. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3323. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3324. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3325. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3326. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3327. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3328. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3329. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3330. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3331. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3332. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3333. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3334. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3335. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3336. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3337. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3338. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3339. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3340. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3341. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3342. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3343. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3344. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3345. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3346. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3347. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3348. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3349. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3350. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3351. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3352. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3353. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3354. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3355. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3356. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3357. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3358. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3359. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3360. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3361. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3362. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3363. #if HTT_PADDR64
  3364. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3365. #else
  3366. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3367. #endif
  3368. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3369. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3370. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3371. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3372. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3373. do { \
  3374. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3375. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3376. } while (0)
  3377. /* degenerate case for 32-bit fields */
  3378. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3379. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3380. ((_var) = (_val))
  3381. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3382. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3383. ((_var) = (_val))
  3384. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3385. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3386. ((_var) = (_val))
  3387. /* degenerate case for 32-bit fields */
  3388. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3389. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3390. ((_var) = (_val))
  3391. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3392. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3393. ((_var) = (_val))
  3394. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3395. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3396. ((_var) = (_val))
  3397. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3398. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3399. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3400. do { \
  3401. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3402. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3403. } while (0)
  3404. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3405. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3406. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3407. do { \
  3408. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3409. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3410. } while (0)
  3411. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3412. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3413. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3414. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3417. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3418. } while (0)
  3419. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3420. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3421. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3422. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3423. do { \
  3424. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3425. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3426. } while (0)
  3427. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3428. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3429. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3430. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3431. do { \
  3432. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3433. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3434. } while (0)
  3435. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3436. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3437. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3438. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3439. do { \
  3440. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3441. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3442. } while (0)
  3443. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3444. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3445. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3446. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3449. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3450. } while (0)
  3451. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3452. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3453. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3454. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3457. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3458. } while (0)
  3459. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3460. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3461. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3462. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3465. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3466. } while (0)
  3467. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3468. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3469. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3470. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3473. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3474. } while (0)
  3475. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3476. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3477. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3478. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3481. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3482. } while (0)
  3483. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3484. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3485. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3486. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3489. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3490. } while (0)
  3491. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3492. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3493. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3494. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3497. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3498. } while (0)
  3499. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3500. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3501. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3502. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3505. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3506. } while (0)
  3507. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3508. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3509. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3510. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3513. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3514. } while (0)
  3515. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3516. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3517. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3518. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3519. do { \
  3520. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3521. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3522. } while (0)
  3523. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3524. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3525. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3526. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3527. do { \
  3528. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3529. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3530. } while (0)
  3531. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3532. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3533. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3534. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3537. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3538. } while (0)
  3539. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3540. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3541. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3542. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3543. do { \
  3544. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3545. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3546. } while (0)
  3547. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3548. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3549. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3550. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3551. do { \
  3552. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3553. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3554. } while (0)
  3555. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3556. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3557. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3558. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3559. do { \
  3560. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3561. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3562. } while (0)
  3563. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3564. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3565. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3566. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3567. do { \
  3568. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3569. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3570. } while (0)
  3571. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3572. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3573. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3574. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3575. do { \
  3576. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3577. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3578. } while (0)
  3579. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3580. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3581. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3582. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3585. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3586. } while (0)
  3587. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3588. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3589. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3590. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3593. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3594. } while (0)
  3595. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3596. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3597. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3598. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3601. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3602. } while (0)
  3603. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3604. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3605. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3606. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3609. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3610. } while (0)
  3611. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3612. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3613. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3614. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3617. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3618. } while (0)
  3619. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3620. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3621. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3622. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3625. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3626. } while (0)
  3627. /**
  3628. * @brief host -> target FW statistics retrieve
  3629. *
  3630. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3631. *
  3632. * @details
  3633. * The following field definitions describe the format of the HTT host
  3634. * to target FW stats retrieve message. The message specifies the type of
  3635. * stats host wants to retrieve.
  3636. *
  3637. * |31 24|23 16|15 8|7 0|
  3638. * |-----------------------------------------------------------|
  3639. * | stats types request bitmask | msg type |
  3640. * |-----------------------------------------------------------|
  3641. * | stats types reset bitmask | reserved |
  3642. * |-----------------------------------------------------------|
  3643. * | stats type | config value |
  3644. * |-----------------------------------------------------------|
  3645. * | cookie LSBs |
  3646. * |-----------------------------------------------------------|
  3647. * | cookie MSBs |
  3648. * |-----------------------------------------------------------|
  3649. * Header fields:
  3650. * - MSG_TYPE
  3651. * Bits 7:0
  3652. * Purpose: identifies this is a stats upload request message
  3653. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3654. * - UPLOAD_TYPES
  3655. * Bits 31:8
  3656. * Purpose: identifies which types of FW statistics to upload
  3657. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3658. * - RESET_TYPES
  3659. * Bits 31:8
  3660. * Purpose: identifies which types of FW statistics to reset
  3661. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3662. * - CFG_VAL
  3663. * Bits 23:0
  3664. * Purpose: give an opaque configuration value to the specified stats type
  3665. * Value: stats-type specific configuration value
  3666. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3667. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3668. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3669. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3670. * - CFG_STAT_TYPE
  3671. * Bits 31:24
  3672. * Purpose: specify which stats type (if any) the config value applies to
  3673. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3674. * a valid configuration specification
  3675. * - COOKIE_LSBS
  3676. * Bits 31:0
  3677. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3678. * message with its preceding host->target stats request message.
  3679. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3680. * - COOKIE_MSBS
  3681. * Bits 31:0
  3682. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3683. * message with its preceding host->target stats request message.
  3684. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3685. */
  3686. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3687. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3688. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3689. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3690. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3691. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3692. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3693. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3694. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3695. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3696. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3697. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3698. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3699. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3700. do { \
  3701. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3702. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3703. } while (0)
  3704. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3705. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3706. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3707. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3708. do { \
  3709. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3710. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3711. } while (0)
  3712. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3713. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3714. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3715. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3716. do { \
  3717. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3718. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3719. } while (0)
  3720. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3721. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3722. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3723. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3724. do { \
  3725. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3726. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3727. } while (0)
  3728. /**
  3729. * @brief host -> target HTT out-of-band sync request
  3730. *
  3731. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3732. *
  3733. * @details
  3734. * The HTT SYNC tells the target to suspend processing of subsequent
  3735. * HTT host-to-target messages until some other target agent locally
  3736. * informs the target HTT FW that the current sync counter is equal to
  3737. * or greater than (in a modulo sense) the sync counter specified in
  3738. * the SYNC message.
  3739. * This allows other host-target components to synchronize their operation
  3740. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3741. * security key has been downloaded to and activated by the target.
  3742. * In the absence of any explicit synchronization counter value
  3743. * specification, the target HTT FW will use zero as the default current
  3744. * sync value.
  3745. *
  3746. * |31 24|23 16|15 8|7 0|
  3747. * |-----------------------------------------------------------|
  3748. * | reserved | sync count | msg type |
  3749. * |-----------------------------------------------------------|
  3750. * Header fields:
  3751. * - MSG_TYPE
  3752. * Bits 7:0
  3753. * Purpose: identifies this as a sync message
  3754. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3755. * - SYNC_COUNT
  3756. * Bits 15:8
  3757. * Purpose: specifies what sync value the HTT FW will wait for from
  3758. * an out-of-band specification to resume its operation
  3759. * Value: in-band sync counter value to compare against the out-of-band
  3760. * counter spec.
  3761. * The HTT target FW will suspend its host->target message processing
  3762. * as long as
  3763. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3764. */
  3765. #define HTT_H2T_SYNC_MSG_SZ 4
  3766. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3767. #define HTT_H2T_SYNC_COUNT_S 8
  3768. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3769. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3770. HTT_H2T_SYNC_COUNT_S)
  3771. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3772. do { \
  3773. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3774. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3775. } while (0)
  3776. /**
  3777. * @brief host -> target HTT aggregation configuration
  3778. *
  3779. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3780. */
  3781. #define HTT_AGGR_CFG_MSG_SZ 4
  3782. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3783. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3784. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3785. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3786. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3787. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3788. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3789. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3792. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3793. } while (0)
  3794. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3795. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3796. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3797. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3798. do { \
  3799. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3800. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3801. } while (0)
  3802. /**
  3803. * @brief host -> target HTT configure max amsdu info per vdev
  3804. *
  3805. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3806. *
  3807. * @details
  3808. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3809. *
  3810. * |31 21|20 16|15 8|7 0|
  3811. * |-----------------------------------------------------------|
  3812. * | reserved | vdev id | max amsdu | msg type |
  3813. * |-----------------------------------------------------------|
  3814. * Header fields:
  3815. * - MSG_TYPE
  3816. * Bits 7:0
  3817. * Purpose: identifies this as a aggr cfg ex message
  3818. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3819. * - MAX_NUM_AMSDU_SUBFRM
  3820. * Bits 15:8
  3821. * Purpose: max MSDUs per A-MSDU
  3822. * - VDEV_ID
  3823. * Bits 20:16
  3824. * Purpose: ID of the vdev to which this limit is applied
  3825. */
  3826. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3827. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3828. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3829. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3830. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3831. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3832. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3833. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3834. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3835. do { \
  3836. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3837. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3838. } while (0)
  3839. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3840. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3841. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3842. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3843. do { \
  3844. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3845. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3846. } while (0)
  3847. /**
  3848. * @brief HTT WDI_IPA Config Message
  3849. *
  3850. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3851. *
  3852. * @details
  3853. * The HTT WDI_IPA config message is created/sent by host at driver
  3854. * init time. It contains information about data structures used on
  3855. * WDI_IPA TX and RX path.
  3856. * TX CE ring is used for pushing packet metadata from IPA uC
  3857. * to WLAN FW
  3858. * TX Completion ring is used for generating TX completions from
  3859. * WLAN FW to IPA uC
  3860. * RX Indication ring is used for indicating RX packets from FW
  3861. * to IPA uC
  3862. * RX Ring2 is used as either completion ring or as second
  3863. * indication ring. when Ring2 is used as completion ring, IPA uC
  3864. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3865. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3866. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3867. * indicated in RX Indication ring. Please see WDI_IPA specification
  3868. * for more details.
  3869. * |31 24|23 16|15 8|7 0|
  3870. * |----------------+----------------+----------------+----------------|
  3871. * | tx pkt pool size | Rsvd | msg_type |
  3872. * |-------------------------------------------------------------------|
  3873. * | tx comp ring base (bits 31:0) |
  3874. #if HTT_PADDR64
  3875. * | tx comp ring base (bits 63:32) |
  3876. #endif
  3877. * |-------------------------------------------------------------------|
  3878. * | tx comp ring size |
  3879. * |-------------------------------------------------------------------|
  3880. * | tx comp WR_IDX physical address (bits 31:0) |
  3881. #if HTT_PADDR64
  3882. * | tx comp WR_IDX physical address (bits 63:32) |
  3883. #endif
  3884. * |-------------------------------------------------------------------|
  3885. * | tx CE WR_IDX physical address (bits 31:0) |
  3886. #if HTT_PADDR64
  3887. * | tx CE WR_IDX physical address (bits 63:32) |
  3888. #endif
  3889. * |-------------------------------------------------------------------|
  3890. * | rx indication ring base (bits 31:0) |
  3891. #if HTT_PADDR64
  3892. * | rx indication ring base (bits 63:32) |
  3893. #endif
  3894. * |-------------------------------------------------------------------|
  3895. * | rx indication ring size |
  3896. * |-------------------------------------------------------------------|
  3897. * | rx ind RD_IDX physical address (bits 31:0) |
  3898. #if HTT_PADDR64
  3899. * | rx ind RD_IDX physical address (bits 63:32) |
  3900. #endif
  3901. * |-------------------------------------------------------------------|
  3902. * | rx ind WR_IDX physical address (bits 31:0) |
  3903. #if HTT_PADDR64
  3904. * | rx ind WR_IDX physical address (bits 63:32) |
  3905. #endif
  3906. * |-------------------------------------------------------------------|
  3907. * |-------------------------------------------------------------------|
  3908. * | rx ring2 base (bits 31:0) |
  3909. #if HTT_PADDR64
  3910. * | rx ring2 base (bits 63:32) |
  3911. #endif
  3912. * |-------------------------------------------------------------------|
  3913. * | rx ring2 size |
  3914. * |-------------------------------------------------------------------|
  3915. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3916. #if HTT_PADDR64
  3917. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3918. #endif
  3919. * |-------------------------------------------------------------------|
  3920. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3921. #if HTT_PADDR64
  3922. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3923. #endif
  3924. * |-------------------------------------------------------------------|
  3925. *
  3926. * Header fields:
  3927. * Header fields:
  3928. * - MSG_TYPE
  3929. * Bits 7:0
  3930. * Purpose: Identifies this as WDI_IPA config message
  3931. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3932. * - TX_PKT_POOL_SIZE
  3933. * Bits 15:0
  3934. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3935. * WDI_IPA TX path
  3936. * For systems using 32-bit format for bus addresses:
  3937. * - TX_COMP_RING_BASE_ADDR
  3938. * Bits 31:0
  3939. * Purpose: TX Completion Ring base address in DDR
  3940. * - TX_COMP_RING_SIZE
  3941. * Bits 31:0
  3942. * Purpose: TX Completion Ring size (must be power of 2)
  3943. * - TX_COMP_WR_IDX_ADDR
  3944. * Bits 31:0
  3945. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3946. * updates the Write Index for WDI_IPA TX completion ring
  3947. * - TX_CE_WR_IDX_ADDR
  3948. * Bits 31:0
  3949. * Purpose: DDR address where IPA uC
  3950. * updates the WR Index for TX CE ring
  3951. * (needed for fusion platforms)
  3952. * - RX_IND_RING_BASE_ADDR
  3953. * Bits 31:0
  3954. * Purpose: RX Indication Ring base address in DDR
  3955. * - RX_IND_RING_SIZE
  3956. * Bits 31:0
  3957. * Purpose: RX Indication Ring size
  3958. * - RX_IND_RD_IDX_ADDR
  3959. * Bits 31:0
  3960. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3961. * RX indication ring
  3962. * - RX_IND_WR_IDX_ADDR
  3963. * Bits 31:0
  3964. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3965. * updates the Write Index for WDI_IPA RX indication ring
  3966. * - RX_RING2_BASE_ADDR
  3967. * Bits 31:0
  3968. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3969. * - RX_RING2_SIZE
  3970. * Bits 31:0
  3971. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3972. * - RX_RING2_RD_IDX_ADDR
  3973. * Bits 31:0
  3974. * Purpose: If Second RX ring is Indication ring, DDR address where
  3975. * IPA uC updates the Read Index for Ring2.
  3976. * If Second RX ring is completion ring, this is NOT used
  3977. * - RX_RING2_WR_IDX_ADDR
  3978. * Bits 31:0
  3979. * Purpose: If Second RX ring is Indication ring, DDR address where
  3980. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3981. * If second RX ring is completion ring, DDR address where
  3982. * IPA uC updates the Write Index for Ring 2.
  3983. * For systems using 64-bit format for bus addresses:
  3984. * - TX_COMP_RING_BASE_ADDR_LO
  3985. * Bits 31:0
  3986. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3987. * - TX_COMP_RING_BASE_ADDR_HI
  3988. * Bits 31:0
  3989. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3990. * - TX_COMP_RING_SIZE
  3991. * Bits 31:0
  3992. * Purpose: TX Completion Ring size (must be power of 2)
  3993. * - TX_COMP_WR_IDX_ADDR_LO
  3994. * Bits 31:0
  3995. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3996. * Lower 4 bytes of DDR address where WIFI FW
  3997. * updates the Write Index for WDI_IPA TX completion ring
  3998. * - TX_COMP_WR_IDX_ADDR_HI
  3999. * Bits 31:0
  4000. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4001. * Higher 4 bytes of DDR address where WIFI FW
  4002. * updates the Write Index for WDI_IPA TX completion ring
  4003. * - TX_CE_WR_IDX_ADDR_LO
  4004. * Bits 31:0
  4005. * Purpose: Lower 4 bytes of DDR address where IPA uC
  4006. * updates the WR Index for TX CE ring
  4007. * (needed for fusion platforms)
  4008. * - TX_CE_WR_IDX_ADDR_HI
  4009. * Bits 31:0
  4010. * Purpose: Higher 4 bytes of DDR address where IPA uC
  4011. * updates the WR Index for TX CE ring
  4012. * (needed for fusion platforms)
  4013. * - RX_IND_RING_BASE_ADDR_LO
  4014. * Bits 31:0
  4015. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  4016. * - RX_IND_RING_BASE_ADDR_HI
  4017. * Bits 31:0
  4018. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  4019. * - RX_IND_RING_SIZE
  4020. * Bits 31:0
  4021. * Purpose: RX Indication Ring size
  4022. * - RX_IND_RD_IDX_ADDR_LO
  4023. * Bits 31:0
  4024. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  4025. * for WDI_IPA RX indication ring
  4026. * - RX_IND_RD_IDX_ADDR_HI
  4027. * Bits 31:0
  4028. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  4029. * for WDI_IPA RX indication ring
  4030. * - RX_IND_WR_IDX_ADDR_LO
  4031. * Bits 31:0
  4032. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  4033. * Lower 4 bytes of DDR address where WIFI FW
  4034. * updates the Write Index for WDI_IPA RX indication ring
  4035. * - RX_IND_WR_IDX_ADDR_HI
  4036. * Bits 31:0
  4037. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4038. * Higher 4 bytes of DDR address where WIFI FW
  4039. * updates the Write Index for WDI_IPA RX indication ring
  4040. * - RX_RING2_BASE_ADDR_LO
  4041. * Bits 31:0
  4042. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4043. * - RX_RING2_BASE_ADDR_HI
  4044. * Bits 31:0
  4045. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4046. * - RX_RING2_SIZE
  4047. * Bits 31:0
  4048. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4049. * - RX_RING2_RD_IDX_ADDR_LO
  4050. * Bits 31:0
  4051. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4052. * DDR address where IPA uC updates the Read Index for Ring2.
  4053. * If Second RX ring is completion ring, this is NOT used
  4054. * - RX_RING2_RD_IDX_ADDR_HI
  4055. * Bits 31:0
  4056. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4057. * DDR address where IPA uC updates the Read Index for Ring2.
  4058. * If Second RX ring is completion ring, this is NOT used
  4059. * - RX_RING2_WR_IDX_ADDR_LO
  4060. * Bits 31:0
  4061. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4062. * DDR address where WIFI FW updates the Write Index
  4063. * for WDI_IPA RX ring2
  4064. * If second RX ring is completion ring, lower 4 bytes of
  4065. * DDR address where IPA uC updates the Write Index for Ring 2.
  4066. * - RX_RING2_WR_IDX_ADDR_HI
  4067. * Bits 31:0
  4068. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4069. * DDR address where WIFI FW updates the Write Index
  4070. * for WDI_IPA RX ring2
  4071. * If second RX ring is completion ring, higher 4 bytes of
  4072. * DDR address where IPA uC updates the Write Index for Ring 2.
  4073. */
  4074. #if HTT_PADDR64
  4075. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4076. #else
  4077. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4078. #endif
  4079. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4080. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4081. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4083. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4085. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4087. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4089. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4091. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4093. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4095. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4097. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4099. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4100. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4101. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4102. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4103. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4104. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4105. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4106. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4107. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4108. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4109. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4110. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4111. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4112. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4113. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4114. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4115. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4116. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4117. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4118. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4119. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4120. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4121. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4122. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4123. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4124. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4125. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4126. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4127. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4128. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4129. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4130. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4131. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4132. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4133. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4134. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4135. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4136. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4137. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4138. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4139. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4140. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4141. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4142. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4143. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4144. do { \
  4145. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4146. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4147. } while (0)
  4148. /* for systems using 32-bit format for bus addr */
  4149. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4150. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4151. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4152. do { \
  4153. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4154. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4155. } while (0)
  4156. /* for systems using 64-bit format for bus addr */
  4157. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4158. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4159. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4162. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4163. } while (0)
  4164. /* for systems using 64-bit format for bus addr */
  4165. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4166. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4167. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4168. do { \
  4169. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4170. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4171. } while (0)
  4172. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4173. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4174. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4177. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4178. } while (0)
  4179. /* for systems using 32-bit format for bus addr */
  4180. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4181. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4182. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4183. do { \
  4184. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4185. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4186. } while (0)
  4187. /* for systems using 64-bit format for bus addr */
  4188. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4189. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4190. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4193. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4194. } while (0)
  4195. /* for systems using 64-bit format for bus addr */
  4196. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4197. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4198. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4199. do { \
  4200. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4201. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4202. } while (0)
  4203. /* for systems using 32-bit format for bus addr */
  4204. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4205. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4206. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4209. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4210. } while (0)
  4211. /* for systems using 64-bit format for bus addr */
  4212. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4213. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4214. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4215. do { \
  4216. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4217. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4218. } while (0)
  4219. /* for systems using 64-bit format for bus addr */
  4220. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4221. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4222. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4223. do { \
  4224. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4225. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4226. } while (0)
  4227. /* for systems using 32-bit format for bus addr */
  4228. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4229. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4230. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4231. do { \
  4232. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4233. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4234. } while (0)
  4235. /* for systems using 64-bit format for bus addr */
  4236. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4237. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4238. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4239. do { \
  4240. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4241. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4242. } while (0)
  4243. /* for systems using 64-bit format for bus addr */
  4244. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4245. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4246. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4247. do { \
  4248. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4249. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4250. } while (0)
  4251. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4252. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4253. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4256. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4257. } while (0)
  4258. /* for systems using 32-bit format for bus addr */
  4259. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4260. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4261. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4262. do { \
  4263. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4264. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4265. } while (0)
  4266. /* for systems using 64-bit format for bus addr */
  4267. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4268. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4269. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4270. do { \
  4271. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4272. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4273. } while (0)
  4274. /* for systems using 64-bit format for bus addr */
  4275. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4276. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4277. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4278. do { \
  4279. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4280. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4281. } while (0)
  4282. /* for systems using 32-bit format for bus addr */
  4283. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4284. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4285. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4288. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4289. } while (0)
  4290. /* for systems using 64-bit format for bus addr */
  4291. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4292. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4293. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4296. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4297. } while (0)
  4298. /* for systems using 64-bit format for bus addr */
  4299. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4300. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4301. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4302. do { \
  4303. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4304. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4305. } while (0)
  4306. /* for systems using 32-bit format for bus addr */
  4307. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4308. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4309. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4310. do { \
  4311. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4312. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4313. } while (0)
  4314. /* for systems using 64-bit format for bus addr */
  4315. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4316. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4317. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4318. do { \
  4319. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4320. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4321. } while (0)
  4322. /* for systems using 64-bit format for bus addr */
  4323. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4324. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4325. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4328. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4329. } while (0)
  4330. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4331. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4332. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4333. do { \
  4334. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4335. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4336. } while (0)
  4337. /* for systems using 32-bit format for bus addr */
  4338. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4339. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4340. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4341. do { \
  4342. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4343. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4344. } while (0)
  4345. /* for systems using 64-bit format for bus addr */
  4346. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4347. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4348. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4349. do { \
  4350. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4351. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4352. } while (0)
  4353. /* for systems using 64-bit format for bus addr */
  4354. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4355. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4356. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4357. do { \
  4358. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4359. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4360. } while (0)
  4361. /* for systems using 32-bit format for bus addr */
  4362. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4363. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4364. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4365. do { \
  4366. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4367. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4368. } while (0)
  4369. /* for systems using 64-bit format for bus addr */
  4370. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4371. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4372. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4373. do { \
  4374. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4375. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4376. } while (0)
  4377. /* for systems using 64-bit format for bus addr */
  4378. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4379. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4380. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4381. do { \
  4382. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4383. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4384. } while (0)
  4385. /*
  4386. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4387. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4388. * addresses are stored in a XXX-bit field.
  4389. * This macro is used to define both htt_wdi_ipa_config32_t and
  4390. * htt_wdi_ipa_config64_t structs.
  4391. */
  4392. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4393. _paddr__tx_comp_ring_base_addr_, \
  4394. _paddr__tx_comp_wr_idx_addr_, \
  4395. _paddr__tx_ce_wr_idx_addr_, \
  4396. _paddr__rx_ind_ring_base_addr_, \
  4397. _paddr__rx_ind_rd_idx_addr_, \
  4398. _paddr__rx_ind_wr_idx_addr_, \
  4399. _paddr__rx_ring2_base_addr_,\
  4400. _paddr__rx_ring2_rd_idx_addr_,\
  4401. _paddr__rx_ring2_wr_idx_addr_) \
  4402. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4403. { \
  4404. /* DWORD 0: flags and meta-data */ \
  4405. A_UINT32 \
  4406. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4407. reserved: 8, \
  4408. tx_pkt_pool_size: 16;\
  4409. /* DWORD 1 */\
  4410. _paddr__tx_comp_ring_base_addr_;\
  4411. /* DWORD 2 (or 3)*/\
  4412. A_UINT32 tx_comp_ring_size;\
  4413. /* DWORD 3 (or 4)*/\
  4414. _paddr__tx_comp_wr_idx_addr_;\
  4415. /* DWORD 4 (or 6)*/\
  4416. _paddr__tx_ce_wr_idx_addr_;\
  4417. /* DWORD 5 (or 8)*/\
  4418. _paddr__rx_ind_ring_base_addr_;\
  4419. /* DWORD 6 (or 10)*/\
  4420. A_UINT32 rx_ind_ring_size;\
  4421. /* DWORD 7 (or 11)*/\
  4422. _paddr__rx_ind_rd_idx_addr_;\
  4423. /* DWORD 8 (or 13)*/\
  4424. _paddr__rx_ind_wr_idx_addr_;\
  4425. /* DWORD 9 (or 15)*/\
  4426. _paddr__rx_ring2_base_addr_;\
  4427. /* DWORD 10 (or 17) */\
  4428. A_UINT32 rx_ring2_size;\
  4429. /* DWORD 11 (or 18) */\
  4430. _paddr__rx_ring2_rd_idx_addr_;\
  4431. /* DWORD 12 (or 20) */\
  4432. _paddr__rx_ring2_wr_idx_addr_;\
  4433. } POSTPACK
  4434. /* define a htt_wdi_ipa_config32_t type */
  4435. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr), HTT_VAR_PADDR32(tx_comp_wr_idx_addr), HTT_VAR_PADDR32(tx_ce_wr_idx_addr), HTT_VAR_PADDR32(rx_ind_ring_base_addr), HTT_VAR_PADDR32(rx_ind_rd_idx_addr),HTT_VAR_PADDR32(rx_ind_wr_idx_addr), HTT_VAR_PADDR32(rx_ring2_base_addr), HTT_VAR_PADDR32(rx_ring2_rd_idx_addr), HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  4436. /* define a htt_wdi_ipa_config64_t type */
  4437. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr), HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr), HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr), HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_base_addr), HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  4438. #if HTT_PADDR64
  4439. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4440. #else
  4441. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4442. #endif
  4443. enum htt_wdi_ipa_op_code {
  4444. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4445. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4446. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4447. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4448. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4449. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4450. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4451. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4452. /* keep this last */
  4453. HTT_WDI_IPA_OPCODE_MAX
  4454. };
  4455. /**
  4456. * @brief HTT WDI_IPA Operation Request Message
  4457. *
  4458. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4459. *
  4460. * @details
  4461. * HTT WDI_IPA Operation Request message is sent by host
  4462. * to either suspend or resume WDI_IPA TX or RX path.
  4463. * |31 24|23 16|15 8|7 0|
  4464. * |----------------+----------------+----------------+----------------|
  4465. * | op_code | Rsvd | msg_type |
  4466. * |-------------------------------------------------------------------|
  4467. *
  4468. * Header fields:
  4469. * - MSG_TYPE
  4470. * Bits 7:0
  4471. * Purpose: Identifies this as WDI_IPA Operation Request message
  4472. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4473. * - OP_CODE
  4474. * Bits 31:16
  4475. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4476. * value: = enum htt_wdi_ipa_op_code
  4477. */
  4478. PREPACK struct htt_wdi_ipa_op_request_t
  4479. {
  4480. /* DWORD 0: flags and meta-data */
  4481. A_UINT32
  4482. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4483. reserved: 8,
  4484. op_code: 16;
  4485. } POSTPACK;
  4486. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4487. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4488. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4489. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4490. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4491. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4492. do { \
  4493. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4494. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4495. } while (0)
  4496. /*
  4497. * @brief host -> target HTT_MSI_SETUP message
  4498. *
  4499. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4500. *
  4501. * @details
  4502. * After target is booted up, host can send MSI setup message so that
  4503. * target sets up HW registers based on setup message.
  4504. *
  4505. * The message would appear as follows:
  4506. * |31 24|23 16|15|14 8|7 0|
  4507. * |---------------+-----------------+-----------------+-----------------|
  4508. * | reserved | msi_type | pdev_id | msg_type |
  4509. * |---------------------------------------------------------------------|
  4510. * | msi_addr_lo |
  4511. * |---------------------------------------------------------------------|
  4512. * | msi_addr_hi |
  4513. * |---------------------------------------------------------------------|
  4514. * | msi_data |
  4515. * |---------------------------------------------------------------------|
  4516. *
  4517. * The message is interpreted as follows:
  4518. * dword0 - b'0:7 - msg_type: This will be set to
  4519. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4520. * b'8:15 - pdev_id:
  4521. * 0 (for rings at SOC/UMAC level),
  4522. * 1/2/3 mac id (for rings at LMAC level)
  4523. * b'16:23 - msi_type: identify which msi registers need to be setup
  4524. * more details can be got from enum htt_msi_setup_type
  4525. * b'24:31 - reserved
  4526. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4527. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4528. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4529. */
  4530. PREPACK struct htt_msi_setup_t {
  4531. A_UINT32 msg_type: 8,
  4532. pdev_id: 8,
  4533. msi_type: 8,
  4534. reserved: 8;
  4535. A_UINT32 msi_addr_lo;
  4536. A_UINT32 msi_addr_hi;
  4537. A_UINT32 msi_data;
  4538. } POSTPACK;
  4539. enum htt_msi_setup_type {
  4540. HTT_PPDU_END_MSI_SETUP_TYPE,
  4541. /* Insert new types here*/
  4542. };
  4543. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4544. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4545. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4546. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4547. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4548. HTT_MSI_SETUP_PDEV_ID_S)
  4549. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4550. do { \
  4551. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4552. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4553. } while (0)
  4554. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4555. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4556. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4557. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4558. HTT_MSI_SETUP_MSI_TYPE_S)
  4559. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4560. do { \
  4561. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4562. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4563. } while (0)
  4564. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4565. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4566. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4567. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4568. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4569. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4570. do { \
  4571. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4572. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4573. } while (0)
  4574. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4575. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4576. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4577. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4578. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4579. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4580. do { \
  4581. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4582. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4583. } while (0)
  4584. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4585. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4586. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4587. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4588. HTT_MSI_SETUP_MSI_DATA_S)
  4589. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4590. do { \
  4591. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4592. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4593. } while (0)
  4594. /*
  4595. * @brief host -> target HTT_SRING_SETUP message
  4596. *
  4597. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4598. *
  4599. * @details
  4600. * After target is booted up, Host can send SRING setup message for
  4601. * each host facing LMAC SRING. Target setups up HW registers based
  4602. * on setup message and confirms back to Host if response_required is set.
  4603. * Host should wait for confirmation message before sending new SRING
  4604. * setup message
  4605. *
  4606. * The message would appear as follows:
  4607. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4608. * |--------------- +-----------------+-----------------+-----------------|
  4609. * | ring_type | ring_id | pdev_id | msg_type |
  4610. * |----------------------------------------------------------------------|
  4611. * | ring_base_addr_lo |
  4612. * |----------------------------------------------------------------------|
  4613. * | ring_base_addr_hi |
  4614. * |----------------------------------------------------------------------|
  4615. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4616. * |----------------------------------------------------------------------|
  4617. * | ring_head_offset32_remote_addr_lo |
  4618. * |----------------------------------------------------------------------|
  4619. * | ring_head_offset32_remote_addr_hi |
  4620. * |----------------------------------------------------------------------|
  4621. * | ring_tail_offset32_remote_addr_lo |
  4622. * |----------------------------------------------------------------------|
  4623. * | ring_tail_offset32_remote_addr_hi |
  4624. * |----------------------------------------------------------------------|
  4625. * | ring_msi_addr_lo |
  4626. * |----------------------------------------------------------------------|
  4627. * | ring_msi_addr_hi |
  4628. * |----------------------------------------------------------------------|
  4629. * | ring_msi_data |
  4630. * |----------------------------------------------------------------------|
  4631. * | intr_timer_th |IM| intr_batch_counter_th |
  4632. * |----------------------------------------------------------------------|
  4633. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4634. * |----------------------------------------------------------------------|
  4635. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4636. * |----------------------------------------------------------------------|
  4637. * Where
  4638. * IM = sw_intr_mode
  4639. * RR = response_required
  4640. * PTCF = prefetch_timer_cfg
  4641. * IP = IPA drop flag
  4642. *
  4643. * The message is interpreted as follows:
  4644. * dword0 - b'0:7 - msg_type: This will be set to
  4645. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4646. * b'8:15 - pdev_id:
  4647. * 0 (for rings at SOC/UMAC level),
  4648. * 1/2/3 mac id (for rings at LMAC level)
  4649. * b'16:23 - ring_id: identify which ring is to setup,
  4650. * more details can be got from enum htt_srng_ring_id
  4651. * b'24:31 - ring_type: identify type of host rings,
  4652. * more details can be got from enum htt_srng_ring_type
  4653. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4654. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4655. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4656. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4657. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4658. * SW_TO_HW_RING.
  4659. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4660. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4661. * Lower 32 bits of memory address of the remote variable
  4662. * storing the 4-byte word offset that identifies the head
  4663. * element within the ring.
  4664. * (The head offset variable has type A_UINT32.)
  4665. * Valid for HW_TO_SW and SW_TO_SW rings.
  4666. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4667. * Upper 32 bits of memory address of the remote variable
  4668. * storing the 4-byte word offset that identifies the head
  4669. * element within the ring.
  4670. * (The head offset variable has type A_UINT32.)
  4671. * Valid for HW_TO_SW and SW_TO_SW rings.
  4672. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4673. * Lower 32 bits of memory address of the remote variable
  4674. * storing the 4-byte word offset that identifies the tail
  4675. * element within the ring.
  4676. * (The tail offset variable has type A_UINT32.)
  4677. * Valid for HW_TO_SW and SW_TO_SW rings.
  4678. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4679. * Upper 32 bits of memory address of the remote variable
  4680. * storing the 4-byte word offset that identifies the tail
  4681. * element within the ring.
  4682. * (The tail offset variable has type A_UINT32.)
  4683. * Valid for HW_TO_SW and SW_TO_SW rings.
  4684. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4685. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4686. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4687. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4688. * dword10 - b'0:31 - ring_msi_data: MSI data
  4689. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4690. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4691. * dword11 - b'0:14 - intr_batch_counter_th:
  4692. * batch counter threshold is in units of 4-byte words.
  4693. * HW internally maintains and increments batch count.
  4694. * (see SRING spec for detail description).
  4695. * When batch count reaches threshold value, an interrupt
  4696. * is generated by HW.
  4697. * b'15 - sw_intr_mode:
  4698. * This configuration shall be static.
  4699. * Only programmed at power up.
  4700. * 0: generate pulse style sw interrupts
  4701. * 1: generate level style sw interrupts
  4702. * b'16:31 - intr_timer_th:
  4703. * The timer init value when timer is idle or is
  4704. * initialized to start downcounting.
  4705. * In 8us units (to cover a range of 0 to 524 ms)
  4706. * dword12 - b'0:15 - intr_low_threshold:
  4707. * Used only by Consumer ring to generate ring_sw_int_p.
  4708. * Ring entries low threshold water mark, that is used
  4709. * in combination with the interrupt timer as well as
  4710. * the the clearing of the level interrupt.
  4711. * b'16:18 - prefetch_timer_cfg:
  4712. * Used only by Consumer ring to set timer mode to
  4713. * support Application prefetch handling.
  4714. * The external tail offset/pointer will be updated
  4715. * at following intervals:
  4716. * 3'b000: (Prefetch feature disabled; used only for debug)
  4717. * 3'b001: 1 usec
  4718. * 3'b010: 4 usec
  4719. * 3'b011: 8 usec (default)
  4720. * 3'b100: 16 usec
  4721. * Others: Reserved
  4722. * b'19 - response_required:
  4723. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4724. * b'20 - ipa_drop_flag:
  4725. Indicates that host will config ipa drop threshold percentage
  4726. * b'21:31 - reserved: reserved for future use
  4727. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4728. * b'8:15 - ipa drop high threshold percentage:
  4729. * b'16:31 - Reserved
  4730. */
  4731. PREPACK struct htt_sring_setup_t {
  4732. A_UINT32 msg_type: 8,
  4733. pdev_id: 8,
  4734. ring_id: 8,
  4735. ring_type: 8;
  4736. A_UINT32 ring_base_addr_lo;
  4737. A_UINT32 ring_base_addr_hi;
  4738. A_UINT32 ring_size: 16,
  4739. ring_entry_size: 8,
  4740. ring_misc_cfg_flag: 8;
  4741. A_UINT32 ring_head_offset32_remote_addr_lo;
  4742. A_UINT32 ring_head_offset32_remote_addr_hi;
  4743. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4744. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4745. A_UINT32 ring_msi_addr_lo;
  4746. A_UINT32 ring_msi_addr_hi;
  4747. A_UINT32 ring_msi_data;
  4748. A_UINT32 intr_batch_counter_th: 15,
  4749. sw_intr_mode: 1,
  4750. intr_timer_th: 16;
  4751. A_UINT32 intr_low_threshold: 16,
  4752. prefetch_timer_cfg: 3,
  4753. response_required: 1,
  4754. ipa_drop_flag: 1,
  4755. reserved1: 11;
  4756. A_UINT32 ipa_drop_low_threshold: 8,
  4757. ipa_drop_high_threshold: 8,
  4758. reserved: 16;
  4759. } POSTPACK;
  4760. enum htt_srng_ring_type {
  4761. HTT_HW_TO_SW_RING = 0,
  4762. HTT_SW_TO_HW_RING,
  4763. HTT_SW_TO_SW_RING,
  4764. /* Insert new ring types above this line */
  4765. };
  4766. enum htt_srng_ring_id {
  4767. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4768. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4769. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4770. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4771. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4772. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4773. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4774. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4775. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4776. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4777. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4778. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4779. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4780. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4781. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4782. /* Add Other SRING which can't be directly configured by host software above this line */
  4783. };
  4784. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4785. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4786. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4787. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4788. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4789. HTT_SRING_SETUP_PDEV_ID_S)
  4790. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4791. do { \
  4792. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4793. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4794. } while (0)
  4795. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4796. #define HTT_SRING_SETUP_RING_ID_S 16
  4797. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4798. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4799. HTT_SRING_SETUP_RING_ID_S)
  4800. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4801. do { \
  4802. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4803. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4804. } while (0)
  4805. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4806. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4807. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4808. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4809. HTT_SRING_SETUP_RING_TYPE_S)
  4810. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4811. do { \
  4812. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4813. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4814. } while (0)
  4815. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4816. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4817. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4818. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4819. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4820. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4821. do { \
  4822. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4823. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4824. } while (0)
  4825. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4826. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4827. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4828. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4829. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4830. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4831. do { \
  4832. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4833. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4834. } while (0)
  4835. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4836. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4837. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4838. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4839. HTT_SRING_SETUP_RING_SIZE_S)
  4840. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4841. do { \
  4842. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4843. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4844. } while (0)
  4845. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4846. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4847. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4848. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4849. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4850. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4851. do { \
  4852. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4853. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4854. } while (0)
  4855. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4856. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4857. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4858. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4859. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4860. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4861. do { \
  4862. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4863. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4864. } while (0)
  4865. /* This control bit is applicable to only Producer, which updates Ring ID field
  4866. * of each descriptor before pushing into the ring.
  4867. * 0: updates ring_id(default)
  4868. * 1: ring_id updating disabled */
  4869. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4872. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4873. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4875. do { \
  4876. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4877. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4878. } while (0)
  4879. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4880. * of each descriptor before pushing into the ring.
  4881. * 0: updates Loopcnt(default)
  4882. * 1: Loopcnt updating disabled */
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4884. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4885. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4886. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4887. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4888. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4889. do { \
  4890. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4891. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4892. } while (0)
  4893. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4894. * into security_id port of GXI/AXI. */
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4896. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4897. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4898. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4899. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4900. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4901. do { \
  4902. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4903. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4904. } while (0)
  4905. /* During MSI write operation, SRNG drives value of this register bit into
  4906. * swap bit of GXI/AXI. */
  4907. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4908. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4909. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4910. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4911. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4912. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4913. do { \
  4914. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4915. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4916. } while (0)
  4917. /* During Pointer write operation, SRNG drives value of this register bit into
  4918. * swap bit of GXI/AXI. */
  4919. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4920. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4921. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4922. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4923. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4924. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4925. do { \
  4926. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4927. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4928. } while (0)
  4929. /* During any data or TLV write operation, SRNG drives value of this register
  4930. * bit into swap bit of GXI/AXI. */
  4931. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4932. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4933. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4934. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4935. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4936. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4937. do { \
  4938. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4939. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4940. } while (0)
  4941. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4942. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4943. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4944. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4945. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4946. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4947. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4948. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4949. do { \
  4950. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4951. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4952. } while (0)
  4953. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4954. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4955. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4956. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4957. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4958. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4959. do { \
  4960. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4961. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4962. } while (0)
  4963. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4964. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4965. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4966. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4967. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4968. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4969. do { \
  4970. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4971. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4972. } while (0)
  4973. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4974. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4975. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4976. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4977. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4978. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4979. do { \
  4980. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4981. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4982. } while (0)
  4983. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4984. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4985. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4986. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4987. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4988. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4989. do { \
  4990. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4991. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4992. } while (0)
  4993. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4994. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4995. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4996. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4997. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4998. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4999. do { \
  5000. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  5001. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  5002. } while (0)
  5003. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  5004. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  5005. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  5006. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  5007. HTT_SRING_SETUP_RING_MSI_DATA_S)
  5008. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  5009. do { \
  5010. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  5011. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  5012. } while (0)
  5013. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  5014. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  5015. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  5016. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  5017. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  5018. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  5019. do { \
  5020. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  5021. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  5022. } while (0)
  5023. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  5024. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  5025. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  5026. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  5027. HTT_SRING_SETUP_SW_INTR_MODE_S)
  5028. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  5029. do { \
  5030. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  5031. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  5032. } while (0)
  5033. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  5034. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  5035. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  5036. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  5037. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5038. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5039. do { \
  5040. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5041. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5042. } while (0)
  5043. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5044. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5045. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5046. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5047. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5048. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5049. do { \
  5050. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5051. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5052. } while (0)
  5053. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5054. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5055. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5056. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5057. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5058. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5059. do { \
  5060. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5061. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5062. } while (0)
  5063. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5064. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5065. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5066. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5067. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5068. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5069. do { \
  5070. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5071. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5072. } while (0)
  5073. /**
  5074. * @brief host -> target RX ring selection config message
  5075. *
  5076. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5077. *
  5078. * @details
  5079. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5080. * configure RXDMA rings.
  5081. * The configuration is per ring based and includes both packet subtypes
  5082. * and PPDU/MPDU TLVs.
  5083. *
  5084. * The message would appear as follows:
  5085. *
  5086. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5087. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5088. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5089. * |-----------------------+-----+-----+--------------------------------|
  5090. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5091. * |--------------------------------------------------------------------|
  5092. * | packet_type_enable_flags_0 |
  5093. * |--------------------------------------------------------------------|
  5094. * | packet_type_enable_flags_1 |
  5095. * |--------------------------------------------------------------------|
  5096. * | packet_type_enable_flags_2 |
  5097. * |--------------------------------------------------------------------|
  5098. * | packet_type_enable_flags_3 |
  5099. * |--------------------------------------------------------------------|
  5100. * | tlv_filter_in_flags |
  5101. * |-----------------------------------+--------------------------------|
  5102. * | rx_header_offset | rx_packet_offset |
  5103. * |-----------------------------------+--------------------------------|
  5104. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5105. * |-----------------------------------+--------------------------------|
  5106. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5107. * |-----------------------------------+--------------------------------|
  5108. * | rsvd3 | rx_attention_offset |
  5109. * |--------------------------------------------------------------------|
  5110. * | rsvd4 | mo| fp| rx_drop_threshold |
  5111. * | |ndp|ndp| |
  5112. * |--------------------------------------------------------------------|
  5113. * Where:
  5114. * PS = pkt_swap
  5115. * SS = status_swap
  5116. * OV = rx_offsets_valid
  5117. * DT = drop_thresh_valid
  5118. * CLM = config_length_mgmt
  5119. * CLC = config_length_ctrl
  5120. * CLD = config_length_data
  5121. * RXHDL = rx_hdr_len
  5122. * RX = rxpcu_filter_enable_flag
  5123. * The message is interpreted as follows:
  5124. * dword0 - b'0:7 - msg_type: This will be set to
  5125. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5126. * b'8:15 - pdev_id:
  5127. * 0 (for rings at SOC/UMAC level),
  5128. * 1/2/3 mac id (for rings at LMAC level)
  5129. * b'16:23 - ring_id : Identify the ring to configure.
  5130. * More details can be got from enum htt_srng_ring_id
  5131. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5132. * BUF_RING_CFG_0 defs within HW .h files,
  5133. * e.g. wmac_top_reg_seq_hwioreg.h
  5134. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5135. * BUF_RING_CFG_0 defs within HW .h files,
  5136. * e.g. wmac_top_reg_seq_hwioreg.h
  5137. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5138. * configuration fields are valid
  5139. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5140. * rx_drop_threshold field is valid
  5141. * b'28 - rx_mon_global_en: Enable/Disable global register
  5142. 8 configuration in Rx monitor module.
  5143. * b'29:31 - rsvd1: reserved for future use
  5144. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5145. * in byte units.
  5146. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5147. * b'16:18 - config_length_mgmt (MGMT):
  5148. * Represents the length of mpdu bytes for mgmt pkt.
  5149. * valid values:
  5150. * 001 - 64bytes
  5151. * 010 - 128bytes
  5152. * 100 - 256bytes
  5153. * 111 - Full mpdu bytes
  5154. * b'19:21 - config_length_ctrl (CTRL):
  5155. * Represents the length of mpdu bytes for ctrl pkt.
  5156. * valid values:
  5157. * 001 - 64bytes
  5158. * 010 - 128bytes
  5159. * 100 - 256bytes
  5160. * 111 - Full mpdu bytes
  5161. * b'22:24 - config_length_data (DATA):
  5162. * Represents the length of mpdu bytes for data pkt.
  5163. * valid values:
  5164. * 001 - 64bytes
  5165. * 010 - 128bytes
  5166. * 100 - 256bytes
  5167. * 111 - Full mpdu bytes
  5168. * b'25:26 - rx_hdr_len:
  5169. * Specifies the number of bytes of recvd packet to copy
  5170. * into the rx_hdr tlv.
  5171. * supported values for now by host:
  5172. * 01 - 64bytes
  5173. * 10 - 128bytes
  5174. * 11 - 256bytes
  5175. * default - 128 bytes
  5176. * b'27 - rxpcu_filter_enable_flag
  5177. * For Scan Radio Host CPU utilization is very high.
  5178. * In order to reduce CPU utilization we need to filter out
  5179. * certain configured MAC frames.
  5180. * To filter out configured MAC address frames, RxPCU should
  5181. * be zero which means allow all frames for MD at RxOLE
  5182. * host wil fiter out frames.
  5183. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5184. * b'28:31 - rsvd2: Reserved for future use
  5185. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5186. * Enable MGMT packet from 0b0000 to 0b1001
  5187. * bits from low to high: FP, MD, MO - 3 bits
  5188. * FP: Filter_Pass
  5189. * MD: Monitor_Direct
  5190. * MO: Monitor_Other
  5191. * 10 mgmt subtypes * 3 bits -> 30 bits
  5192. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5193. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5194. * Enable MGMT packet from 0b1010 to 0b1111
  5195. * bits from low to high: FP, MD, MO - 3 bits
  5196. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5197. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5198. * Enable CTRL packet from 0b0000 to 0b1001
  5199. * bits from low to high: FP, MD, MO - 3 bits
  5200. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5201. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5202. * Enable CTRL packet from 0b1010 to 0b1111,
  5203. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5204. * bits from low to high: FP, MD, MO - 3 bits
  5205. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5206. * dword6 - b'0:31 - tlv_filter_in_flags:
  5207. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5208. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5209. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5210. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5211. * A value of 0 will be considered as ignore this config.
  5212. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5213. * e.g. wmac_top_reg_seq_hwioreg.h
  5214. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5215. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5216. * A value of 0 will be considered as ignore this config.
  5217. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5218. * e.g. wmac_top_reg_seq_hwioreg.h
  5219. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5220. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5221. * A value of 0 will be considered as ignore this config.
  5222. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5223. * e.g. wmac_top_reg_seq_hwioreg.h
  5224. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5225. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5226. * A value of 0 will be considered as ignore this config.
  5227. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5228. * e.g. wmac_top_reg_seq_hwioreg.h
  5229. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5230. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5231. * A value of 0 will be considered as ignore this config.
  5232. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5233. * e.g. wmac_top_reg_seq_hwioreg.h
  5234. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5235. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5236. * A value of 0 will be considered as ignore this config.
  5237. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5238. * e.g. wmac_top_reg_seq_hwioreg.h
  5239. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5240. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5241. * A value of 0 will be considered as ignore this config.
  5242. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5243. * e.g. wmac_top_reg_seq_hwioreg.h
  5244. * - b'16:31 - rsvd3 for future use
  5245. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5246. * to source rings. Consumer drops packets if the available
  5247. * words in the ring falls below the configured threshold
  5248. * value.
  5249. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5250. * by host. 1 -> subscribed
  5251. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5252. * by host. 1 -> subscribed
  5253. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5254. * subscribed by host. 1 -> subscribed
  5255. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5256. * selection for the FP PHY ERR status tlv.
  5257. * 0 - wbm2rxdma_buf_source_ring
  5258. * 1 - fw2rxdma_buf_source_ring
  5259. * 2 - sw2rxdma_buf_source_ring
  5260. * 3 - no_buffer_ring
  5261. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5262. * selection for the FP PHY ERR status tlv.
  5263. * 0 - rxdma_release_ring
  5264. * 1 - rxdma2fw_ring
  5265. * 2 - rxdma2sw_ring
  5266. * 3 - rxdma2reo_ring
  5267. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5268. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5269. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5270. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5271. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5272. * 0: MSDU level logging
  5273. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5274. * 0: MSDU level logging
  5275. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5276. * 0: MSDU level logging
  5277. * - b'23 - word_mask_compaction: enable/disable word mask for
  5278. * mpdu/msdu start/end tlvs
  5279. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5280. * manager override
  5281. * - b'25:28 - rbm_override_val: return buffer manager override value
  5282. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5283. * which have to be posted to host from phy.
  5284. * Corresponding to errors defined in
  5285. * phyrx_abort_request_reason enums 0 to 31.
  5286. * Refer to RXPCU register definition header files for the
  5287. * phyrx_abort_request_reason enum definition.
  5288. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5289. * errors which have to be posted to host from phy.
  5290. * Corresponding to errors defined in
  5291. * phyrx_abort_request_reason enums 32 to 63.
  5292. * Refer to RXPCU register definition header files for the
  5293. * phyrx_abort_request_reason enum definition.
  5294. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5295. * applicable if word mask enabled
  5296. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5297. * applicable if word mask enabled
  5298. * - b'19:31 - rsvd7
  5299. * dword15- b'0:16 - rx_msdu_end_word_mask
  5300. * - b'17:31 - rsvd5
  5301. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5302. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5303. * buffer
  5304. * 1: RX_PKT TLV logging at specified offset for the
  5305. * subsequent buffer
  5306. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5307. */
  5308. PREPACK struct htt_rx_ring_selection_cfg_t {
  5309. A_UINT32 msg_type: 8,
  5310. pdev_id: 8,
  5311. ring_id: 8,
  5312. status_swap: 1,
  5313. pkt_swap: 1,
  5314. rx_offsets_valid: 1,
  5315. drop_thresh_valid: 1,
  5316. rx_mon_global_en: 1,
  5317. rsvd1: 3;
  5318. A_UINT32 ring_buffer_size: 16,
  5319. config_length_mgmt:3,
  5320. config_length_ctrl:3,
  5321. config_length_data:3,
  5322. rx_hdr_len: 2,
  5323. rxpcu_filter_enable_flag:1,
  5324. rsvd2: 4;
  5325. A_UINT32 packet_type_enable_flags_0;
  5326. A_UINT32 packet_type_enable_flags_1;
  5327. A_UINT32 packet_type_enable_flags_2;
  5328. A_UINT32 packet_type_enable_flags_3;
  5329. A_UINT32 tlv_filter_in_flags;
  5330. A_UINT32 rx_packet_offset: 16,
  5331. rx_header_offset: 16;
  5332. A_UINT32 rx_mpdu_end_offset: 16,
  5333. rx_mpdu_start_offset: 16;
  5334. A_UINT32 rx_msdu_end_offset: 16,
  5335. rx_msdu_start_offset: 16;
  5336. A_UINT32 rx_attn_offset: 16,
  5337. rsvd3: 16;
  5338. A_UINT32 rx_drop_threshold: 10,
  5339. fp_ndp: 1,
  5340. mo_ndp: 1,
  5341. fp_phy_err: 1,
  5342. fp_phy_err_buf_src: 2,
  5343. fp_phy_err_buf_dest: 2,
  5344. pkt_type_enable_msdu_or_mpdu_logging:3,
  5345. dma_mpdu_mgmt: 1,
  5346. dma_mpdu_ctrl: 1,
  5347. dma_mpdu_data: 1,
  5348. word_mask_compaction_enable:1,
  5349. rbm_override_enable: 1,
  5350. rbm_override_val: 4,
  5351. rsvd4: 3;
  5352. A_UINT32 phy_err_mask;
  5353. A_UINT32 phy_err_mask_cont;
  5354. A_UINT32 rx_mpdu_start_word_mask:16,
  5355. rx_mpdu_end_word_mask: 3,
  5356. rsvd7: 13;
  5357. A_UINT32 rx_msdu_end_word_mask: 17,
  5358. rsvd5: 15;
  5359. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5360. rx_pkt_tlv_offset: 15,
  5361. rsvd6: 16;
  5362. A_UINT32 rx_mpdu_start_word_mask_v2: 20,
  5363. rx_mpdu_end_word_mask_v2: 8,
  5364. rsvd8: 4;
  5365. A_UINT32 rx_msdu_end_word_mask_v2: 20,
  5366. rsvd9: 12;
  5367. A_UINT32 rx_ppdu_end_usr_stats_word_mask_v2: 20,
  5368. rsvd10: 12;
  5369. A_UINT32 packet_type_enable_fpmo_flags0;
  5370. A_UINT32 packet_type_enable_fpmo_flags1;
  5371. } POSTPACK;
  5372. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5373. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5374. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5375. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5376. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5377. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5378. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5379. do { \
  5380. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5381. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5382. } while (0)
  5383. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5384. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5385. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5386. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5387. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5388. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5389. do { \
  5390. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5391. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5392. } while (0)
  5393. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5394. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5395. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5396. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5397. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5398. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5399. do { \
  5400. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5401. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5402. } while (0)
  5403. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5404. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5405. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5406. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5407. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5408. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5409. do { \
  5410. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5411. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5412. } while (0)
  5413. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5414. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5415. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5416. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5417. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5418. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5421. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5422. } while (0)
  5423. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5424. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5425. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5426. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5427. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5428. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5429. do { \
  5430. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5431. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5432. } while (0)
  5433. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5434. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5435. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5436. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5437. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5438. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5439. do { \
  5440. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5441. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5442. } while (0)
  5443. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5444. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5445. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5446. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5447. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5448. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5449. do { \
  5450. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5451. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5452. } while (0)
  5453. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5454. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5455. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5456. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5457. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5458. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5461. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5462. } while (0)
  5463. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5464. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5465. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5466. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5467. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5468. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5469. do { \
  5470. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5471. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5472. } while (0)
  5473. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5474. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5475. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5476. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5477. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5478. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5481. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5482. } while (0)
  5483. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5484. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5485. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5486. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5487. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5488. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5489. do { \
  5490. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5491. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5492. } while(0)
  5493. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5494. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5495. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5496. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5497. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5498. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5501. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5502. } while(0)
  5503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5504. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5506. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5507. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5511. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5512. } while (0)
  5513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5516. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5517. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5519. do { \
  5520. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5521. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5522. } while (0)
  5523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5526. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5527. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5529. do { \
  5530. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5531. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5532. } while (0)
  5533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5536. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5537. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5539. do { \
  5540. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5541. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5542. } while (0)
  5543. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5544. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5545. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5546. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5547. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5548. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5549. do { \
  5550. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5551. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5552. } while (0)
  5553. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5554. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5555. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5556. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5557. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5558. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5561. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5562. } while (0)
  5563. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5564. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5565. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5566. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5567. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5568. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5571. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5572. } while (0)
  5573. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5574. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5575. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5576. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5577. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5578. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5579. do { \
  5580. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5581. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5582. } while (0)
  5583. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5584. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5585. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5586. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5587. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5588. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5589. do { \
  5590. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5591. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5592. } while (0)
  5593. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5594. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5595. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5596. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5597. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5598. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5599. do { \
  5600. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5601. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5602. } while (0)
  5603. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5604. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5605. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5606. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5607. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5608. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5609. do { \
  5610. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5611. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5612. } while (0)
  5613. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5614. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5615. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5616. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5617. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5618. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5619. do { \
  5620. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5621. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5622. } while (0)
  5623. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5624. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5625. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5626. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5627. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5628. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5629. do { \
  5630. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5631. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5632. } while (0)
  5633. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5634. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5635. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5636. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5637. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5638. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5639. do { \
  5640. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5641. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5642. } while (0)
  5643. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5644. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5645. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5646. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5647. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5648. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5649. do { \
  5650. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5651. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5652. } while (0)
  5653. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5654. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5655. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5656. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5657. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5658. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5659. do { \
  5660. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5661. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5662. } while (0)
  5663. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5664. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5665. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5666. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5667. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5668. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5669. do { \
  5670. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5671. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5672. } while (0)
  5673. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5674. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5675. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5676. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5677. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5678. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5679. do { \
  5680. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5681. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5682. } while (0)
  5683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5686. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5687. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5689. do { \
  5690. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5691. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5692. } while (0)
  5693. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5694. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5695. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5696. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5697. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5698. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5699. do { \
  5700. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5701. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5702. } while (0)
  5703. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5704. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5705. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5706. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5707. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5708. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5709. do { \
  5710. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5711. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5712. } while (0)
  5713. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5714. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5715. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5716. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5717. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5718. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5719. do { \
  5720. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5721. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5722. } while (0)
  5723. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5724. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5725. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5726. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5727. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5728. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5729. do { \
  5730. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5731. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5732. } while (0)
  5733. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5734. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5735. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5736. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5737. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5738. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5739. do { \
  5740. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5741. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5742. } while (0)
  5743. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5744. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5745. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5746. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5747. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5748. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5749. do { \
  5750. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5751. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5752. } while (0)
  5753. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5754. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5755. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5756. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5757. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5758. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5759. do { \
  5760. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5761. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5762. } while (0)
  5763. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5764. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5765. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5766. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5767. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5768. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5769. do { \
  5770. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5771. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5772. } while (0)
  5773. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5774. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5775. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5776. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5777. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5778. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5779. do { \
  5780. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5781. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5782. } while (0)
  5783. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5784. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5785. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5786. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5787. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5788. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5789. do { \
  5790. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5791. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5792. } while (0)
  5793. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5794. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5795. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5796. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5797. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5798. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5799. do { \
  5800. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5801. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5802. } while (0)
  5803. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5804. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5805. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5806. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5807. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5808. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5809. do { \
  5810. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5811. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5812. } while (0)
  5813. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5814. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5815. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5816. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5817. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5818. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5819. do { \
  5820. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5821. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5822. } while (0)
  5823. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M 0x000FFFFF
  5824. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S 0
  5825. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_GET(_var) \
  5826. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_M)>> \
  5827. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)
  5828. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_SET(_var, _val) \
  5829. do { \
  5830. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2, _val);\
  5831. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_V2_S)); \
  5832. } while (0)
  5833. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M 0x0FF00000
  5834. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S 20
  5835. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_GET(_var) \
  5836. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_M)>> \
  5837. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)
  5838. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_SET(_var, _val) \
  5839. do { \
  5840. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2, _val);\
  5841. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_V2_S)); \
  5842. } while (0)
  5843. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M 0x000FFFFF
  5844. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S 0
  5845. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_GET(_var) \
  5846. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_M)>> \
  5847. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)
  5848. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_SET(_var, _val) \
  5849. do { \
  5850. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2, _val);\
  5851. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_V2_S)); \
  5852. } while (0)
  5853. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M 0x000FFFFF
  5854. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S 0
  5855. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_GET(_var) \
  5856. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_M)>> \
  5857. HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)
  5858. #define HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_SET(_var, _val) \
  5859. do { \
  5860. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2, _val);\
  5861. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PPDU_END_USR_STATS_WORD_MASK_V2_S)); \
  5862. } while (0)
  5863. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M 0xFFFFFFFF
  5864. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S 0
  5865. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_GET(_var) \
  5866. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_M)>> \
  5867. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)
  5868. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_SET(_var, _val) \
  5869. do { \
  5870. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0, _val); \
  5871. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS0_S)); \
  5872. } while (0)
  5873. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M 0xFFFFFFFF
  5874. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S 0
  5875. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_GET(_var) \
  5876. (((_var) & HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_M)>> \
  5877. HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)
  5878. #define HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_SET(_var, _val) \
  5879. do { \
  5880. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1, _val); \
  5881. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PACKET_TYPE_ENABLE_FPMO_FLAGS1_S)); \
  5882. } while (0)
  5883. /*
  5884. * Subtype based MGMT frames enable bits.
  5885. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5886. */
  5887. /* association request */
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5894. /* association response */
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5901. /* Reassociation request */
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5908. /* Reassociation response */
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5915. /* Probe request */
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5922. /* Probe response */
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5929. /* Timing Advertisement */
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5936. /* Reserved */
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5943. /* Beacon */
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5950. /* ATIM */
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5957. /* Disassociation */
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5964. /* Authentication */
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5971. /* Deauthentication */
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5978. /* Action */
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5985. /* Action No Ack */
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5992. /* Reserved */
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5999. /*
  6000. * Subtype based CTRL frames enable bits.
  6001. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  6002. */
  6003. /* Reserved */
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  6010. /* Reserved */
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  6017. /* Reserved */
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  6024. /* Reserved */
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  6030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  6031. /* Reserved */
  6032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  6033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  6035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  6036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  6037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  6038. /* Reserved */
  6039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  6040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  6041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  6042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  6043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  6044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  6045. /* Reserved */
  6046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  6047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  6048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  6049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  6050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  6051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  6052. /* Control Wrapper */
  6053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  6054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  6055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  6056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  6057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  6058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  6059. /* Block Ack Request */
  6060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  6061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  6062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  6063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  6064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  6065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  6066. /* Block Ack*/
  6067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  6068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  6069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  6070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  6071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  6072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  6073. /* PS-POLL */
  6074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  6075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  6076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  6077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  6078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  6079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  6080. /* RTS */
  6081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  6082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  6083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  6084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  6085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  6086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  6087. /* CTS */
  6088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  6089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  6090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  6091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  6092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  6093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  6094. /* ACK */
  6095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  6096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  6097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  6098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  6099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  6100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  6101. /* CF-END */
  6102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  6103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  6104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  6105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  6106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6108. /* CF-END + CF-ACK */
  6109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6115. /* Multicast data */
  6116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6122. /* Unicast data */
  6123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6129. /* NULL data */
  6130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6136. /* FPMO mode flags */
  6137. /* MGMT */
  6138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_M 0x00000001
  6139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0000_S 0
  6140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_M 0x00000002
  6141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0001_S 1
  6142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_M 0x00000004
  6143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0010_S 2
  6144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_M 0x00000008
  6145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0011_S 3
  6146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_M 0x00000010
  6147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0100_S 4
  6148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_M 0x00000020
  6149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0101_S 5
  6150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_M 0x00000040
  6151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0110_S 6
  6152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_M 0x00000080
  6153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_0111_S 7
  6154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_M 0x00000100
  6155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1000_S 8
  6156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_M 0x00000200
  6157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1001_S 9
  6158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_M 0x00000400
  6159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1010_S 10
  6160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_M 0x00000800
  6161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1011_S 11
  6162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_M 0x00001000
  6163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1100_S 12
  6164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_M 0x00002000
  6165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1101_S 13
  6166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_M 0x00004000
  6167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1110_S 14
  6168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_M 0x00008000
  6169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_MGMT_1111_S 15
  6170. /* CTRL */
  6171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_M 0x00010000
  6172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0000_S 16
  6173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_M 0x00020000
  6174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0001_S 17
  6175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_M 0x00040000
  6176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0010_S 18
  6177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_M 0x00080000
  6178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0011_S 19
  6179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_M 0x00100000
  6180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0100_S 20
  6181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_M 0x00200000
  6182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0101_S 21
  6183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_M 0x00400000
  6184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0110_S 22
  6185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_M 0x00800000
  6186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_0111_S 23
  6187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_M 0x01000000
  6188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1000_S 24
  6189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_M 0x02000000
  6190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1001_S 25
  6191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_M 0x04000000
  6192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1010_S 26
  6193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_M 0x08000000
  6194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1011_S 27
  6195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_M 0x10000000
  6196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1100_S 28
  6197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_M 0x20000000
  6198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1101_S 29
  6199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_M 0x40000000
  6200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1110_S 30
  6201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_M 0x80000000
  6202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FPMO_CTRL_1111_S 31
  6203. /* DATA */
  6204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_M 0x00000001
  6205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_MCAST_S 0
  6206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_M 0x00000002
  6207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_UCAST_S 1
  6208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_M 0x00000004
  6209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_NULL_S 2
  6210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_M 0x00000008
  6211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_DATA_S 3
  6212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_M 0x00000010
  6213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FPMO_DATA_QOS_NULL_TB_S 4
  6214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6215. do { \
  6216. HTT_CHECK_SET_VAL(httsym, value); \
  6217. (word) |= (value) << httsym##_S; \
  6218. } while (0)
  6219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6220. (((word) & httsym##_M) >> httsym##_S)
  6221. #define htt_rx_ring_pkt_enable_subtype_set( \
  6222. word, flag, mode, type, subtype, val) \
  6223. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6224. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6225. #define htt_rx_ring_pkt_enable_subtype_get( \
  6226. word, flag, mode, type, subtype) \
  6227. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6228. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6229. /* Definition to filter in TLVs */
  6230. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6231. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6232. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6233. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6234. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6235. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6236. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6237. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6238. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6239. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6240. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6241. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6258. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6259. do { \
  6260. HTT_CHECK_SET_VAL(httsym, enable); \
  6261. (word) |= (enable) << httsym##_S; \
  6262. } while (0)
  6263. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6264. (((word) & httsym##_M) >> httsym##_S)
  6265. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6266. HTT_RX_RING_TLV_ENABLE_SET( \
  6267. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6268. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6269. HTT_RX_RING_TLV_ENABLE_GET( \
  6270. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6271. /**
  6272. * @brief host -> target TX monitor config message
  6273. *
  6274. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6275. *
  6276. * @details
  6277. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6278. * configure RXDMA rings.
  6279. * The configuration is per ring based and includes both packet types
  6280. * and PPDU/MPDU TLVs.
  6281. *
  6282. * The message would appear as follows:
  6283. *
  6284. * |31 26|25|24|23 22|21|20|19|18 16|15|14|13|12|11|10|9|8|7|6|5|4|3|2 0|
  6285. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6286. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6287. * |-----------+--------+--------+-----+------------------------------------|
  6288. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6289. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6290. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6291. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6292. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6293. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6294. * |------------------------------------------------------------------------|
  6295. * | tlv_filter_mask_in0 |
  6296. * |------------------------------------------------------------------------|
  6297. * | tlv_filter_mask_in1 |
  6298. * |------------------------------------------------------------------------|
  6299. * | tlv_filter_mask_in2 |
  6300. * |------------------------------------------------------------------------|
  6301. * | tlv_filter_mask_in3 |
  6302. * |-----------------+-----------------+---------------------+--------------|
  6303. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6304. * |------------------------------------------------------------------------|
  6305. * | pcu_ppdu_setup_word_mask |
  6306. * |--------------------+--+--+--+-----+---------------------+--------------|
  6307. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6308. * |------------------------------------------------------------------------|
  6309. *
  6310. * Where:
  6311. * PS = pkt_swap
  6312. * SS = status_swap
  6313. * The message is interpreted as follows:
  6314. * dword0 - b'0:7 - msg_type: This will be set to
  6315. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6316. * b'8:15 - pdev_id:
  6317. * 0 (for rings at SOC level),
  6318. * 1/2/3 mac id (for rings at LMAC level)
  6319. * b'16:23 - ring_id : Identify the ring to configure.
  6320. * More details can be got from enum htt_srng_ring_id
  6321. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6322. * BUF_RING_CFG_0 defs within HW .h files,
  6323. * e.g. wmac_top_reg_seq_hwioreg.h
  6324. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6325. * BUF_RING_CFG_0 defs within HW .h files,
  6326. * e.g. wmac_top_reg_seq_hwioreg.h
  6327. * b'26 - tx_mon_global_en: Enable/Disable global register
  6328. * configuration in Tx monitor module.
  6329. * b'27:31 - rsvd1: reserved for future use
  6330. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6331. * in byte units.
  6332. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6333. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6334. * 64, 128, 256.
  6335. * If all 3 bits are set config length is > 256.
  6336. * if val is '0', then ignore this field.
  6337. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6338. * 64, 128, 256.
  6339. * If all 3 bits are set config length is > 256.
  6340. * if val is '0', then ignore this field.
  6341. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6342. * 64, 128, 256.
  6343. * If all 3 bits are set config length is > 256.
  6344. * If val is '0', then ignore this field.
  6345. * - b'25:31 - rsvd2: Reserved for future use
  6346. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6347. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6348. * If packet_type_enable_flags is '1' for MGMT type,
  6349. * monitor will ignore this bit and allow this TLV.
  6350. * If packet_type_enable_flags is '0' for MGMT type,
  6351. * monitor will use this bit to enable/disable logging
  6352. * of this TLV.
  6353. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6354. * If packet_type_enable_flags is '1' for CTRL type,
  6355. * monitor will ignore this bit and allow this TLV.
  6356. * If packet_type_enable_flags is '0' for CTRL type,
  6357. * monitor will use this bit to enable/disable logging
  6358. * of this TLV.
  6359. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6360. * If packet_type_enable_flags is '1' for DATA type,
  6361. * monitor will ignore this bit and allow this TLV.
  6362. * If packet_type_enable_flags is '0' for DATA type,
  6363. * monitor will use this bit to enable/disable logging
  6364. * of this TLV.
  6365. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6366. * If packet_type_enable_flags is '1' for MGMT type,
  6367. * monitor will ignore this bit and allow this TLV.
  6368. * If packet_type_enable_flags is '0' for MGMT type,
  6369. * monitor will use this bit to enable/disable logging
  6370. * of this TLV.
  6371. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6372. * If packet_type_enable_flags is '1' for CTRL type,
  6373. * monitor will ignore this bit and allow this TLV.
  6374. * If packet_type_enable_flags is '0' for CTRL type,
  6375. * monitor will use this bit to enable/disable logging
  6376. * of this TLV.
  6377. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6378. * If packet_type_enable_flags is '1' for DATA type,
  6379. * monitor will ignore this bit and allow this TLV.
  6380. * If packet_type_enable_flags is '0' for DATA type,
  6381. * monitor will use this bit to enable/disable logging
  6382. * of this TLV.
  6383. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6384. * If packet_type_enable_flags is '1' for MGMT type,
  6385. * monitor will ignore this bit and allow this TLV.
  6386. * If packet_type_enable_flags is '0' for MGMT type,
  6387. * monitor will use this bit to enable/disable logging
  6388. * of this TLV.
  6389. * If filter_in_TX_MPDU_START = 1 it is recommended
  6390. * to set this bit.
  6391. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6392. * If packet_type_enable_flags is '1' for CTRL type,
  6393. * monitor will ignore this bit and allow this TLV.
  6394. * If packet_type_enable_flags is '0' for CTRL type,
  6395. * monitor will use this bit to enable/disable logging
  6396. * of this TLV.
  6397. * If filter_in_TX_MPDU_START = 1 it is recommended
  6398. * to set this bit.
  6399. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6400. * If packet_type_enable_flags is '1' for DATA type,
  6401. * monitor will ignore this bit and allow this TLV.
  6402. * If packet_type_enable_flags is '0' for DATA type,
  6403. * monitor will use this bit to enable/disable logging
  6404. * of this TLV.
  6405. * If filter_in_TX_MPDU_START = 1 it is recommended
  6406. * to set this bit.
  6407. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6408. * If packet_type_enable_flags is '1' for MGMT type,
  6409. * monitor will ignore this bit and allow this TLV.
  6410. * If packet_type_enable_flags is '0' for MGMT type,
  6411. * monitor will use this bit to enable/disable logging
  6412. * of this TLV.
  6413. * If filter_in_TX_MSDU_START = 1 it is recommended
  6414. * to set this bit.
  6415. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6416. * If packet_type_enable_flags is '1' for CTRL type,
  6417. * monitor will ignore this bit and allow this TLV.
  6418. * If packet_type_enable_flags is '0' for CTRL type,
  6419. * monitor will use this bit to enable/disable logging
  6420. * of this TLV.
  6421. * If filter_in_TX_MSDU_START = 1 it is recommended
  6422. * to set this bit.
  6423. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6424. * If packet_type_enable_flags is '1' for DATA type,
  6425. * monitor will ignore this bit and allow this TLV.
  6426. * If packet_type_enable_flags is '0' for DATA type,
  6427. * monitor will use this bit to enable/disable logging
  6428. * of this TLV.
  6429. * If filter_in_TX_MSDU_START = 1 it is recommended
  6430. * to set this bit.
  6431. * b'15:31 - rsvd3: Reserved for future use
  6432. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6433. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6434. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6435. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6436. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6437. * - b'8:15 - tx_peer_entry_word_mask:
  6438. * - b'16:23 - tx_queue_ext_word_mask:
  6439. * - b'24:31 - tx_msdu_start_word_mask:
  6440. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6441. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6442. * - b'8:15 - rxpcu_user_setup_word_mask:
  6443. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6444. * MGMT, CTRL, DATA
  6445. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6446. * 0 -> MSDU level logging is enabled
  6447. * (valid only if bit is set in
  6448. * pkt_type_enable_msdu_or_mpdu_logging)
  6449. * 1 -> MPDU level logging is enabled
  6450. * (valid only if bit is set in
  6451. * pkt_type_enable_msdu_or_mpdu_logging)
  6452. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6453. * 0 -> MSDU level logging is enabled
  6454. * (valid only if bit is set in
  6455. * pkt_type_enable_msdu_or_mpdu_logging)
  6456. * 1 -> MPDU level logging is enabled
  6457. * (valid only if bit is set in
  6458. * pkt_type_enable_msdu_or_mpdu_logging)
  6459. * - b'21 - dma_mpdu_data(D) : For DATA
  6460. * 0 -> MSDU level logging is enabled
  6461. * (valid only if bit is set in
  6462. * pkt_type_enable_msdu_or_mpdu_logging)
  6463. * 1 -> MPDU level logging is enabled
  6464. * (valid only if bit is set in
  6465. * pkt_type_enable_msdu_or_mpdu_logging)
  6466. * - b'22:31 - rsvd4 for future use
  6467. */
  6468. PREPACK struct htt_tx_monitor_cfg_t {
  6469. A_UINT32 msg_type: 8,
  6470. pdev_id: 8,
  6471. ring_id: 8,
  6472. status_swap: 1,
  6473. pkt_swap: 1,
  6474. tx_mon_global_en: 1,
  6475. rsvd1: 5;
  6476. A_UINT32 ring_buffer_size: 16,
  6477. config_length_mgmt: 3,
  6478. config_length_ctrl: 3,
  6479. config_length_data: 3,
  6480. rsvd2: 7;
  6481. A_UINT32 pkt_type_enable_flags: 3,
  6482. filter_in_tx_mpdu_start_mgmt: 1,
  6483. filter_in_tx_mpdu_start_ctrl: 1,
  6484. filter_in_tx_mpdu_start_data: 1,
  6485. filter_in_tx_msdu_start_mgmt: 1,
  6486. filter_in_tx_msdu_start_ctrl: 1,
  6487. filter_in_tx_msdu_start_data: 1,
  6488. filter_in_tx_mpdu_end_mgmt: 1,
  6489. filter_in_tx_mpdu_end_ctrl: 1,
  6490. filter_in_tx_mpdu_end_data: 1,
  6491. filter_in_tx_msdu_end_mgmt: 1,
  6492. filter_in_tx_msdu_end_ctrl: 1,
  6493. filter_in_tx_msdu_end_data: 1,
  6494. word_mask_compaction_enable: 1,
  6495. rsvd3: 16;
  6496. A_UINT32 tlv_filter_mask_in0;
  6497. A_UINT32 tlv_filter_mask_in1;
  6498. A_UINT32 tlv_filter_mask_in2;
  6499. A_UINT32 tlv_filter_mask_in3;
  6500. A_UINT32 tx_fes_setup_word_mask: 8,
  6501. tx_peer_entry_word_mask: 8,
  6502. tx_queue_ext_word_mask: 8,
  6503. tx_msdu_start_word_mask: 8;
  6504. A_UINT32 pcu_ppdu_setup_word_mask;
  6505. A_UINT32 tx_mpdu_start_word_mask: 8,
  6506. rxpcu_user_setup_word_mask: 8,
  6507. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6508. dma_mpdu_mgmt: 1,
  6509. dma_mpdu_ctrl: 1,
  6510. dma_mpdu_data: 1,
  6511. rsvd4: 10;
  6512. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6513. tx_peer_entry_v2_word_mask: 12,
  6514. rsvd5: 8;
  6515. A_UINT32 fes_status_end_word_mask: 16,
  6516. response_end_status_word_mask: 16;
  6517. A_UINT32 fes_status_prot_word_mask: 11,
  6518. rsvd6: 21;
  6519. } POSTPACK;
  6520. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6521. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6522. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6523. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6524. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6525. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6526. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6527. do { \
  6528. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6529. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6530. } while (0)
  6531. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6532. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6533. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6534. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6535. HTT_TX_MONITOR_CFG_RING_ID_S)
  6536. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6539. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6540. } while (0)
  6541. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6542. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6543. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6544. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6545. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6546. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6547. do { \
  6548. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6549. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6550. } while (0)
  6551. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6552. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6553. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6554. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6555. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6556. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6557. do { \
  6558. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6559. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6560. } while (0)
  6561. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6562. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6563. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6564. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6565. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6566. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6567. do { \
  6568. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6569. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6570. } while (0)
  6571. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6572. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6573. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6574. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6575. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6576. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6577. do { \
  6578. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6579. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6580. } while (0)
  6581. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6582. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6583. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6584. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6585. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6586. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6587. do { \
  6588. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6589. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6590. } while (0)
  6591. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6592. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6593. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6594. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6595. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6596. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6597. do { \
  6598. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6599. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6600. } while (0)
  6601. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6602. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6603. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6604. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6605. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6606. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6607. do { \
  6608. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6609. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6610. } while (0)
  6611. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6612. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6613. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6614. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6615. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6616. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6617. do { \
  6618. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6619. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6620. } while (0)
  6621. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6622. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6623. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6624. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6625. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6626. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6627. do { \
  6628. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6629. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6630. } while (0)
  6631. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6632. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6633. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6634. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6635. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6636. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6637. do { \
  6638. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6639. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6640. } while (0)
  6641. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6642. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6643. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6644. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6645. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6646. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6647. do { \
  6648. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6649. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6650. } while (0)
  6651. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6652. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6653. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6654. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6655. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6656. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6657. do { \
  6658. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6659. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6660. } while (0)
  6661. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6662. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6663. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6664. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6665. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6666. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6667. do { \
  6668. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6669. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6670. } while (0)
  6671. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6672. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6673. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6674. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6675. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6676. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6677. do { \
  6678. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6679. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6680. } while (0)
  6681. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6682. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6683. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6684. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6685. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6686. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6687. do { \
  6688. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6689. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6690. } while (0)
  6691. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6692. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6693. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6694. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6695. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6696. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6697. do { \
  6698. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6699. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6700. } while (0)
  6701. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6702. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6703. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6704. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6705. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6706. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6707. do { \
  6708. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6709. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6710. } while (0)
  6711. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6712. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6713. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6714. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6715. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6716. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6717. do { \
  6718. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6719. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6720. } while (0)
  6721. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6722. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6723. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6724. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6725. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6726. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6727. do { \
  6728. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6729. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6730. } while (0)
  6731. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6732. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6733. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6734. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6735. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6736. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6737. do { \
  6738. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6739. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6740. } while (0)
  6741. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00008000
  6742. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S 15
  6743. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  6744. (((_var) & HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  6745. HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  6746. #define HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  6747. do { \
  6748. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  6749. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  6750. } while (0)
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6754. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6755. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6757. do { \
  6758. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6759. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6760. } while (0)
  6761. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6762. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6763. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6764. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6765. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6766. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6767. do { \
  6768. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6769. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6770. } while (0)
  6771. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6772. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6773. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6774. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6775. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6776. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6777. do { \
  6778. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6779. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6780. } while (0)
  6781. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6782. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6783. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6784. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6785. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6786. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6787. do { \
  6788. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6789. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6790. } while (0)
  6791. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6792. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6793. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6794. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6795. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6796. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6797. do { \
  6798. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6799. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6800. } while (0)
  6801. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6802. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6803. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6804. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6805. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6806. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6807. do { \
  6808. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6809. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6810. } while (0)
  6811. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6812. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6813. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6814. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6815. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6816. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6817. do { \
  6818. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6819. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6820. } while (0)
  6821. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6822. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6823. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6824. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6825. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6826. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6827. do { \
  6828. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6829. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6830. } while (0)
  6831. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6832. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6833. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6834. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6835. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6836. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6837. do { \
  6838. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6839. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6840. } while (0)
  6841. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6842. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6843. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6844. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6845. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6846. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6847. do { \
  6848. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6849. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6850. } while (0)
  6851. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6852. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6853. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6854. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6855. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6856. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6857. do { \
  6858. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6859. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6860. } while (0)
  6861. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6862. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6863. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6864. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6865. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6866. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6867. do { \
  6868. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6869. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6870. } while (0)
  6871. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6872. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6873. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6874. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6875. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6876. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6877. do { \
  6878. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6879. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6880. } while (0)
  6881. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6882. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6883. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6884. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6885. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6886. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6887. do { \
  6888. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6889. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6890. } while (0)
  6891. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6892. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6893. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6894. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6895. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6896. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6897. do { \
  6898. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6899. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6900. } while (0)
  6901. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6902. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6903. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6904. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6905. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6906. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6907. do { \
  6908. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6909. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6910. } while (0)
  6911. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6912. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6913. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6914. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6915. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6916. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6917. do { \
  6918. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6919. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6920. } while (0)
  6921. /*
  6922. * pkt_type_enable_flags
  6923. */
  6924. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6925. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6926. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6927. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6928. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6929. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6930. /*
  6931. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6932. */
  6933. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6934. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6935. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6936. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6937. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6938. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6939. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6940. do { \
  6941. HTT_CHECK_SET_VAL(httsym, value); \
  6942. (word) |= (value) << httsym##_S; \
  6943. } while (0)
  6944. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6945. (((word) & httsym##_M) >> httsym##_S)
  6946. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6947. * type -> MGMT, CTRL, DATA*/
  6948. #define htt_tx_ring_pkt_type_set( \
  6949. word, mode, type, val) \
  6950. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6951. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6952. #define htt_tx_ring_pkt_type_get( \
  6953. word, mode, type) \
  6954. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6955. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6956. /* Definition to filter in TLVs */
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6979. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6980. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6981. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6982. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6983. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6984. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6985. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6986. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6987. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6988. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  7021. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  7022. do { \
  7023. HTT_CHECK_SET_VAL(httsym, enable); \
  7024. (word) |= (enable) << httsym##_S; \
  7025. } while (0)
  7026. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  7027. (((word) & httsym##_M) >> httsym##_S)
  7028. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  7029. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  7030. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  7031. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  7032. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  7033. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  7036. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  7037. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  7038. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  7039. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  7040. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  7041. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  7042. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  7043. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  7044. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  7045. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  7046. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  7047. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  7048. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  7049. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  7050. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  7051. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  7052. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  7053. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  7054. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  7055. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  7056. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  7057. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  7058. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  7059. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  7060. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  7061. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  7062. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  7063. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  7064. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  7065. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  7066. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  7067. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  7068. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  7069. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  7070. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  7071. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  7072. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  7073. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  7074. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  7075. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  7076. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  7077. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  7078. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  7079. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  7080. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  7081. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  7082. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  7083. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  7084. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  7085. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  7086. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  7087. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  7088. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  7089. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  7090. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  7091. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  7092. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  7093. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  7094. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  7095. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  7096. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  7097. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  7098. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  7099. do { \
  7100. HTT_CHECK_SET_VAL(httsym, enable); \
  7101. (word) |= (enable) << httsym##_S; \
  7102. } while (0)
  7103. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  7104. (((word) & httsym##_M) >> httsym##_S)
  7105. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  7106. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  7107. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  7108. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  7109. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  7110. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  7111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  7112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  7113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  7114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  7115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  7116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  7117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  7118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  7119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  7120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  7121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  7122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  7123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  7124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  7125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  7126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  7127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  7128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  7129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  7130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  7131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  7132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  7133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  7134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  7135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  7136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  7137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  7138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  7139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  7140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  7141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  7142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  7143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  7144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  7145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  7146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  7147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  7148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  7149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  7150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  7151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  7152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  7153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  7154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  7155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  7156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  7157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  7158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  7159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  7160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  7161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  7162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  7163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  7164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  7165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  7166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  7167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  7168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  7169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  7170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  7171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  7172. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  7173. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  7174. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  7175. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  7176. do { \
  7177. HTT_CHECK_SET_VAL(httsym, enable); \
  7178. (word) |= (enable) << httsym##_S; \
  7179. } while (0)
  7180. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  7181. (((word) & httsym##_M) >> httsym##_S)
  7182. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  7183. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  7184. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  7185. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  7186. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  7187. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  7188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  7189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  7190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  7191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  7192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  7193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  7194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  7195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7206. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7207. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7208. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7209. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7210. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7211. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7212. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7213. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7214. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7215. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7216. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7217. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7218. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7219. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7220. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7221. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7222. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7223. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7224. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7225. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7226. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7227. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7228. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7229. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7230. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7231. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7232. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7233. do { \
  7234. HTT_CHECK_SET_VAL(httsym, enable); \
  7235. (word) |= (enable) << httsym##_S; \
  7236. } while (0)
  7237. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7238. (((word) & httsym##_M) >> httsym##_S)
  7239. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7240. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7241. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7242. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7243. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7244. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7245. /**
  7246. * @brief host --> target Receive Flow Steering configuration message definition
  7247. *
  7248. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7249. *
  7250. * host --> target Receive Flow Steering configuration message definition.
  7251. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7252. * The reason for this is we want RFS to be configured and ready before MAC
  7253. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7254. *
  7255. * |31 24|23 16|15 9|8|7 0|
  7256. * |----------------+----------------+----------------+----------------|
  7257. * | reserved |E| msg type |
  7258. * |-------------------------------------------------------------------|
  7259. * Where E = RFS enable flag
  7260. *
  7261. * The RFS_CONFIG message consists of a single 4-byte word.
  7262. *
  7263. * Header fields:
  7264. * - MSG_TYPE
  7265. * Bits 7:0
  7266. * Purpose: identifies this as a RFS config msg
  7267. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7268. * - RFS_CONFIG
  7269. * Bit 8
  7270. * Purpose: Tells target whether to enable (1) or disable (0)
  7271. * flow steering feature when sending rx indication messages to host
  7272. */
  7273. #define HTT_H2T_RFS_CONFIG_M 0x100
  7274. #define HTT_H2T_RFS_CONFIG_S 8
  7275. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7276. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7277. HTT_H2T_RFS_CONFIG_S)
  7278. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7279. do { \
  7280. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7281. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7282. } while (0)
  7283. #define HTT_RFS_CFG_REQ_BYTES 4
  7284. /**
  7285. * @brief host -> target FW extended statistics request
  7286. *
  7287. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7288. *
  7289. * @details
  7290. * The following field definitions describe the format of the HTT host
  7291. * to target FW extended stats retrieve message.
  7292. * The message specifies the type of stats the host wants to retrieve.
  7293. *
  7294. * |31 24|23 16|15 8|7 0|
  7295. * |-----------------------------------------------------------|
  7296. * | reserved | stats type | pdev_mask | msg type |
  7297. * |-----------------------------------------------------------|
  7298. * | config param [0] |
  7299. * |-----------------------------------------------------------|
  7300. * | config param [1] |
  7301. * |-----------------------------------------------------------|
  7302. * | config param [2] |
  7303. * |-----------------------------------------------------------|
  7304. * | config param [3] |
  7305. * |-----------------------------------------------------------|
  7306. * | reserved |
  7307. * |-----------------------------------------------------------|
  7308. * | cookie LSBs |
  7309. * |-----------------------------------------------------------|
  7310. * | cookie MSBs |
  7311. * |-----------------------------------------------------------|
  7312. * Header fields:
  7313. * - MSG_TYPE
  7314. * Bits 7:0
  7315. * Purpose: identifies this is a extended stats upload request message
  7316. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7317. * - PDEV_MASK
  7318. * Bits 8:15
  7319. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7320. * Value: This is a overloaded field, refer to usage and interpretation of
  7321. * PDEV in interface document.
  7322. * Bit 8 : Reserved for SOC stats
  7323. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7324. * Indicates MACID_MASK in DBS
  7325. * - STATS_TYPE
  7326. * Bits 23:16
  7327. * Purpose: identifies which FW statistics to upload
  7328. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7329. * - Reserved
  7330. * Bits 31:24
  7331. * - CONFIG_PARAM [0]
  7332. * Bits 31:0
  7333. * Purpose: give an opaque configuration value to the specified stats type
  7334. * Value: stats-type specific configuration value
  7335. * Refer to htt_stats.h for interpretation for each stats sub_type
  7336. * - CONFIG_PARAM [1]
  7337. * Bits 31:0
  7338. * Purpose: give an opaque configuration value to the specified stats type
  7339. * Value: stats-type specific configuration value
  7340. * Refer to htt_stats.h for interpretation for each stats sub_type
  7341. * - CONFIG_PARAM [2]
  7342. * Bits 31:0
  7343. * Purpose: give an opaque configuration value to the specified stats type
  7344. * Value: stats-type specific configuration value
  7345. * Refer to htt_stats.h for interpretation for each stats sub_type
  7346. * - CONFIG_PARAM [3]
  7347. * Bits 31:0
  7348. * Purpose: give an opaque configuration value to the specified stats type
  7349. * Value: stats-type specific configuration value
  7350. * Refer to htt_stats.h for interpretation for each stats sub_type
  7351. * - Reserved [31:0] for future use.
  7352. * - COOKIE_LSBS
  7353. * Bits 31:0
  7354. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7355. * message with its preceding host->target stats request message.
  7356. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7357. * - COOKIE_MSBS
  7358. * Bits 31:0
  7359. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7360. * message with its preceding host->target stats request message.
  7361. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7362. */
  7363. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7364. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7365. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7366. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7367. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7368. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7369. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7370. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7371. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7372. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7373. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7374. do { \
  7375. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7376. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7377. } while (0)
  7378. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7379. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7380. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7381. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7382. do { \
  7383. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7384. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7385. } while (0)
  7386. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7387. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7388. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7389. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7390. do { \
  7391. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7392. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7393. } while (0)
  7394. /**
  7395. * @brief host -> target FW streaming statistics request
  7396. *
  7397. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7398. *
  7399. * @details
  7400. * The following field definitions describe the format of the HTT host
  7401. * to target message that requests the target to start or stop producing
  7402. * ongoing stats of the specified type.
  7403. *
  7404. * |31|30 |23 16|15 8|7 0|
  7405. * |-----------------------------------------------------------|
  7406. * |EN| reserved | stats type | reserved | msg type |
  7407. * |-----------------------------------------------------------|
  7408. * | config param [0] |
  7409. * |-----------------------------------------------------------|
  7410. * | config param [1] |
  7411. * |-----------------------------------------------------------|
  7412. * | config param [2] |
  7413. * |-----------------------------------------------------------|
  7414. * | config param [3] |
  7415. * |-----------------------------------------------------------|
  7416. * Where:
  7417. * - EN is an enable/disable flag
  7418. * Header fields:
  7419. * - MSG_TYPE
  7420. * Bits 7:0
  7421. * Purpose: identifies this is a streaming stats upload request message
  7422. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7423. * - STATS_TYPE
  7424. * Bits 23:16
  7425. * Purpose: identifies which FW statistics to upload
  7426. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7427. * Only the htt_dbg_ext_stats_type values identified as streaming
  7428. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7429. * - ENABLE
  7430. * Bit 31
  7431. * Purpose: enable/disable the target's ongoing stats of the specified type
  7432. * Value:
  7433. * 0 - disable ongoing production of the specified stats type
  7434. * 1 - enable ongoing production of the specified stats type
  7435. * - CONFIG_PARAM [0]
  7436. * Bits 31:0
  7437. * Purpose: give an opaque configuration value to the specified stats type
  7438. * Value: stats-type specific configuration value
  7439. * Refer to htt_stats.h for interpretation for each stats sub_type
  7440. * - CONFIG_PARAM [1]
  7441. * Bits 31:0
  7442. * Purpose: give an opaque configuration value to the specified stats type
  7443. * Value: stats-type specific configuration value
  7444. * Refer to htt_stats.h for interpretation for each stats sub_type
  7445. * - CONFIG_PARAM [2]
  7446. * Bits 31:0
  7447. * Purpose: give an opaque configuration value to the specified stats type
  7448. * Value: stats-type specific configuration value
  7449. * Refer to htt_stats.h for interpretation for each stats sub_type
  7450. * - CONFIG_PARAM [3]
  7451. * Bits 31:0
  7452. * Purpose: give an opaque configuration value to the specified stats type
  7453. * Value: stats-type specific configuration value
  7454. * Refer to htt_stats.h for interpretation for each stats sub_type
  7455. */
  7456. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7457. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7458. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7459. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7460. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7461. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7462. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7463. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7464. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7465. do { \
  7466. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7467. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7468. } while (0)
  7469. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7470. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7471. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7472. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7473. do { \
  7474. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7475. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7476. } while (0)
  7477. /**
  7478. * @brief host -> target FW PPDU_STATS request message
  7479. *
  7480. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7481. *
  7482. * @details
  7483. * The following field definitions describe the format of the HTT host
  7484. * to target FW for PPDU_STATS_CFG msg.
  7485. * The message allows the host to configure the PPDU_STATS_IND messages
  7486. * produced by the target.
  7487. *
  7488. * |31 24|23 16|15 8|7 0|
  7489. * |-----------------------------------------------------------|
  7490. * | REQ bit mask | pdev_mask | msg type |
  7491. * |-----------------------------------------------------------|
  7492. * Header fields:
  7493. * - MSG_TYPE
  7494. * Bits 7:0
  7495. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7496. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7497. * - PDEV_MASK
  7498. * Bits 8:15
  7499. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7500. * Value: This is a overloaded field, refer to usage and interpretation of
  7501. * PDEV in interface document.
  7502. * Bit 8 : Reserved for SOC stats
  7503. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7504. * Indicates MACID_MASK in DBS
  7505. * - REQ_TLV_BIT_MASK
  7506. * Bits 16:31
  7507. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7508. * needs to be included in the target's PPDU_STATS_IND messages.
  7509. * Value: refer htt_ppdu_stats_tlv_tag_t
  7510. *
  7511. */
  7512. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7513. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7514. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7515. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7516. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7517. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7518. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7519. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7520. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7521. do { \
  7522. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7523. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7524. } while (0)
  7525. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7526. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7527. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7528. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7529. do { \
  7530. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7531. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7532. } while (0)
  7533. /**
  7534. * @brief Host-->target HTT RX FSE setup message
  7535. *
  7536. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7537. *
  7538. * @details
  7539. * Through this message, the host will provide details of the flow tables
  7540. * in host DDR along with hash keys.
  7541. * This message can be sent per SOC or per PDEV, which is differentiated
  7542. * by pdev id values.
  7543. * The host will allocate flow search table and sends table size,
  7544. * physical DMA address of flow table, and hash keys to firmware to
  7545. * program into the RXOLE FSE HW block.
  7546. *
  7547. * The following field definitions describe the format of the RX FSE setup
  7548. * message sent from the host to target
  7549. *
  7550. * Header fields:
  7551. * dword0 - b'7:0 - msg_type: This will be set to
  7552. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7553. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7554. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7555. * pdev's LMAC ring.
  7556. * b'31:16 - reserved : Reserved for future use
  7557. * dword1 - b'19:0 - number of records: This field indicates the number of
  7558. * entries in the flow table. For example: 8k number of
  7559. * records is equivalent to
  7560. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7561. * b'27:20 - max search: This field specifies the skid length to FSE
  7562. * parser HW module whenever match is not found at the
  7563. * exact index pointed by hash.
  7564. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7565. * Refer htt_ip_da_sa_prefix below for more details.
  7566. * b'31:30 - reserved: Reserved for future use
  7567. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7568. * table allocated by host in DDR
  7569. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7570. * table allocated by host in DDR
  7571. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7572. * entry hashing
  7573. *
  7574. *
  7575. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7576. * |---------------------------------------------------------------|
  7577. * | reserved | pdev_id | MSG_TYPE |
  7578. * |---------------------------------------------------------------|
  7579. * |resvd|IPDSA| max_search | Number of records |
  7580. * |---------------------------------------------------------------|
  7581. * | base address lo |
  7582. * |---------------------------------------------------------------|
  7583. * | base address high |
  7584. * |---------------------------------------------------------------|
  7585. * | toeplitz key 31_0 |
  7586. * |---------------------------------------------------------------|
  7587. * | toeplitz key 63_32 |
  7588. * |---------------------------------------------------------------|
  7589. * | toeplitz key 95_64 |
  7590. * |---------------------------------------------------------------|
  7591. * | toeplitz key 127_96 |
  7592. * |---------------------------------------------------------------|
  7593. * | toeplitz key 159_128 |
  7594. * |---------------------------------------------------------------|
  7595. * | toeplitz key 191_160 |
  7596. * |---------------------------------------------------------------|
  7597. * | toeplitz key 223_192 |
  7598. * |---------------------------------------------------------------|
  7599. * | toeplitz key 255_224 |
  7600. * |---------------------------------------------------------------|
  7601. * | toeplitz key 287_256 |
  7602. * |---------------------------------------------------------------|
  7603. * | reserved | toeplitz key 314_288(26:0 bits) |
  7604. * |---------------------------------------------------------------|
  7605. * where:
  7606. * IPDSA = ip_da_sa
  7607. */
  7608. /**
  7609. * @brief: htt_ip_da_sa_prefix
  7610. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7611. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7612. * documentation per RFC3849
  7613. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7614. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7615. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7616. */
  7617. enum htt_ip_da_sa_prefix {
  7618. HTT_RX_IPV6_20010db8,
  7619. HTT_RX_IPV4_MAPPED_IPV6,
  7620. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7621. HTT_RX_IPV6_64FF9B,
  7622. };
  7623. /**
  7624. * @brief Host-->target HTT RX FISA configure and enable
  7625. *
  7626. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7627. *
  7628. * @details
  7629. * The host will send this command down to configure and enable the FISA
  7630. * operational params.
  7631. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7632. * register.
  7633. * Should configure both the MACs.
  7634. *
  7635. * dword0 - b'7:0 - msg_type:
  7636. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7637. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7638. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7639. * pdev's LMAC ring.
  7640. * b'31:16 - reserved : Reserved for future use
  7641. *
  7642. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7643. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7644. * packets. 1 flow search will be skipped
  7645. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7646. * tcp,udp packets
  7647. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7648. * calculation
  7649. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7650. * calculation
  7651. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7652. * calculation
  7653. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7654. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7655. * length
  7656. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7657. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7658. * length
  7659. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7660. * num jump
  7661. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7662. * num jump
  7663. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7664. * data type switch has happened for MPDU Sequence num jump
  7665. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7666. * for MPDU Sequence num jump
  7667. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7668. * for decrypt errors
  7669. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7670. * while aggregating a msdu
  7671. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7672. * The aggregation is done until (number of MSDUs aggregated
  7673. * < LIMIT + 1)
  7674. * b'31:18 - Reserved
  7675. *
  7676. * fisa_control_value - 32bit value FW can write to register
  7677. *
  7678. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7679. * Threshold value for FISA timeout (units are microseconds).
  7680. * When the global timestamp exceeds this threshold, FISA
  7681. * aggregation will be restarted.
  7682. * A value of 0 means timeout is disabled.
  7683. * Compare the threshold register with timestamp field in
  7684. * flow entry to generate timeout for the flow.
  7685. *
  7686. * |31 18 |17 16|15 8|7 0|
  7687. * |-------------------------------------------------------------|
  7688. * | reserved | pdev_mask | msg type |
  7689. * |-------------------------------------------------------------|
  7690. * | reserved | FISA_CTRL |
  7691. * |-------------------------------------------------------------|
  7692. * | FISA_TIMEOUT_THRESH |
  7693. * |-------------------------------------------------------------|
  7694. */
  7695. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7696. A_UINT32 msg_type:8,
  7697. pdev_id:8,
  7698. reserved0:16;
  7699. /**
  7700. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7701. * [17:0]
  7702. */
  7703. union {
  7704. /*
  7705. * fisa_control_bits structure is deprecated.
  7706. * Please use fisa_control_bits_v2 going forward.
  7707. */
  7708. struct {
  7709. A_UINT32 fisa_enable: 1,
  7710. ipsec_skip_search: 1,
  7711. nontcp_skip_search: 1,
  7712. add_ipv4_fixed_hdr_len: 1,
  7713. add_ipv6_fixed_hdr_len: 1,
  7714. add_tcp_fixed_hdr_len: 1,
  7715. add_udp_hdr_len: 1,
  7716. chksum_cum_ip_len_en: 1,
  7717. disable_tid_check: 1,
  7718. disable_ta_check: 1,
  7719. disable_qos_check: 1,
  7720. disable_raw_check: 1,
  7721. disable_decrypt_err_check: 1,
  7722. disable_msdu_drop_check: 1,
  7723. fisa_aggr_limit: 4,
  7724. reserved: 14;
  7725. } fisa_control_bits;
  7726. struct {
  7727. A_UINT32 fisa_enable: 1,
  7728. fisa_aggr_limit: 4,
  7729. reserved: 27;
  7730. } fisa_control_bits_v2;
  7731. A_UINT32 fisa_control_value;
  7732. } u_fisa_control;
  7733. /**
  7734. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7735. * timeout threshold for aggregation. Unit in usec.
  7736. * [31:0]
  7737. */
  7738. A_UINT32 fisa_timeout_threshold;
  7739. } POSTPACK;
  7740. /* DWord 0: pdev-ID */
  7741. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7742. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7743. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7744. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7745. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7746. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7747. do { \
  7748. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7749. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7750. } while (0)
  7751. /* Dword 1: fisa_control_value fisa config */
  7752. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7753. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7754. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7755. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7756. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7757. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7758. do { \
  7759. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7760. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7761. } while (0)
  7762. /* Dword 1: fisa_control_value ipsec_skip_search */
  7763. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7764. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7765. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7766. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7767. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7768. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7769. do { \
  7770. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7771. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7772. } while (0)
  7773. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7774. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7775. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7776. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7777. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7778. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7779. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7780. do { \
  7781. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7782. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7783. } while (0)
  7784. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7785. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7786. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7787. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7788. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7789. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7790. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7791. do { \
  7792. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7793. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7794. } while (0)
  7795. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7796. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7797. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7798. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7799. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7800. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7801. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7802. do { \
  7803. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7804. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7805. } while (0)
  7806. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7807. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7808. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7809. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7810. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7811. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7812. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7813. do { \
  7814. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7815. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7816. } while (0)
  7817. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7818. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7819. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7820. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7821. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7822. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7823. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7824. do { \
  7825. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7826. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7827. } while (0)
  7828. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7829. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7830. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7831. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7832. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7833. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7834. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7835. do { \
  7836. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7837. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7838. } while (0)
  7839. /* Dword 1: fisa_control_value disable_tid_check */
  7840. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7841. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7842. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7843. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7844. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7845. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7846. do { \
  7847. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7848. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7849. } while (0)
  7850. /* Dword 1: fisa_control_value disable_ta_check */
  7851. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7852. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7853. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7854. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7855. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7856. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7857. do { \
  7858. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7859. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7860. } while (0)
  7861. /* Dword 1: fisa_control_value disable_qos_check */
  7862. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7863. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7864. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7865. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7866. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7867. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7868. do { \
  7869. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7870. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7871. } while (0)
  7872. /* Dword 1: fisa_control_value disable_raw_check */
  7873. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7874. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7875. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7876. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7877. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7878. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7879. do { \
  7880. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7881. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7882. } while (0)
  7883. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7884. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7885. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7886. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7887. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7888. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7889. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7890. do { \
  7891. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7892. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7893. } while (0)
  7894. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7895. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7896. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7897. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7898. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7899. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7900. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7901. do { \
  7902. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7903. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7904. } while (0)
  7905. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7906. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7907. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7908. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7909. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7910. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7911. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7912. do { \
  7913. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7914. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7915. } while (0)
  7916. /* Dword 1: fisa_control_value fisa config */
  7917. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7918. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7919. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7920. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7921. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7922. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7923. do { \
  7924. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7925. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7926. } while (0)
  7927. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7928. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7929. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7930. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7931. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7932. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7933. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7934. do { \
  7935. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7936. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7937. } while (0)
  7938. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7939. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7940. pdev_id:8,
  7941. reserved0:16;
  7942. A_UINT32 num_records:20,
  7943. max_search:8,
  7944. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7945. reserved1:2;
  7946. A_UINT32 base_addr_lo;
  7947. A_UINT32 base_addr_hi;
  7948. A_UINT32 toeplitz31_0;
  7949. A_UINT32 toeplitz63_32;
  7950. A_UINT32 toeplitz95_64;
  7951. A_UINT32 toeplitz127_96;
  7952. A_UINT32 toeplitz159_128;
  7953. A_UINT32 toeplitz191_160;
  7954. A_UINT32 toeplitz223_192;
  7955. A_UINT32 toeplitz255_224;
  7956. A_UINT32 toeplitz287_256;
  7957. A_UINT32 toeplitz314_288:27,
  7958. reserved2:5;
  7959. } POSTPACK;
  7960. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7961. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7962. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7963. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7964. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7965. /* DWORD 0: Pdev ID */
  7966. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7967. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7968. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7969. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7970. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7971. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7972. do { \
  7973. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7974. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7975. } while (0)
  7976. /* DWORD 1:num of records */
  7977. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7978. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7979. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7980. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7981. HTT_RX_FSE_SETUP_NUM_REC_S)
  7982. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7983. do { \
  7984. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7985. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7986. } while (0)
  7987. /* DWORD 1:max_search */
  7988. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7989. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7990. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7991. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7992. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7993. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7994. do { \
  7995. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7996. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7997. } while (0)
  7998. /* DWORD 1:ip_da_sa prefix */
  7999. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  8000. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  8001. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  8002. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  8003. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  8004. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  8005. do { \
  8006. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  8007. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  8008. } while (0)
  8009. /* DWORD 2: Base Address LO */
  8010. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  8011. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  8012. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  8013. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  8014. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  8015. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  8016. do { \
  8017. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  8018. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  8019. } while (0)
  8020. /* DWORD 3: Base Address High */
  8021. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  8022. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  8023. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  8024. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  8025. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  8026. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  8027. do { \
  8028. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  8029. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  8030. } while (0)
  8031. /* DWORD 4-12: Hash Value */
  8032. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  8033. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  8034. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  8035. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  8036. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  8037. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  8038. do { \
  8039. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  8040. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  8041. } while (0)
  8042. /* DWORD 13: Hash Value 314:288 bits */
  8043. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  8044. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  8045. HTT_RX_FSE_SETUP_HASH_314_288_S)
  8046. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  8047. do { \
  8048. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  8049. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  8050. } while (0)
  8051. /**
  8052. * @brief Host-->target HTT RX FSE operation message
  8053. *
  8054. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  8055. *
  8056. * @details
  8057. * The host will send this Flow Search Engine (FSE) operation message for
  8058. * every flow add/delete operation.
  8059. * The FSE operation includes FSE full cache invalidation or individual entry
  8060. * invalidation.
  8061. * This message can be sent per SOC or per PDEV which is differentiated
  8062. * by pdev id values.
  8063. *
  8064. * |31 16|15 8|7 1|0|
  8065. * |-------------------------------------------------------------|
  8066. * | reserved | pdev_id | MSG_TYPE |
  8067. * |-------------------------------------------------------------|
  8068. * | reserved | operation |I|
  8069. * |-------------------------------------------------------------|
  8070. * | ip_src_addr_31_0 |
  8071. * |-------------------------------------------------------------|
  8072. * | ip_src_addr_63_32 |
  8073. * |-------------------------------------------------------------|
  8074. * | ip_src_addr_95_64 |
  8075. * |-------------------------------------------------------------|
  8076. * | ip_src_addr_127_96 |
  8077. * |-------------------------------------------------------------|
  8078. * | ip_dst_addr_31_0 |
  8079. * |-------------------------------------------------------------|
  8080. * | ip_dst_addr_63_32 |
  8081. * |-------------------------------------------------------------|
  8082. * | ip_dst_addr_95_64 |
  8083. * |-------------------------------------------------------------|
  8084. * | ip_dst_addr_127_96 |
  8085. * |-------------------------------------------------------------|
  8086. * | l4_dst_port | l4_src_port |
  8087. * | (32-bit SPI incase of IPsec) |
  8088. * |-------------------------------------------------------------|
  8089. * | reserved | l4_proto |
  8090. * |-------------------------------------------------------------|
  8091. *
  8092. * where I is 1-bit ipsec_valid.
  8093. *
  8094. * The following field definitions describe the format of the RX FSE operation
  8095. * message sent from the host to target for every add/delete flow entry to flow
  8096. * table.
  8097. *
  8098. * Header fields:
  8099. * dword0 - b'7:0 - msg_type: This will be set to
  8100. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  8101. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8102. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8103. * specified pdev's LMAC ring.
  8104. * b'31:16 - reserved : Reserved for future use
  8105. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  8106. * (Internet Protocol Security).
  8107. * IPsec describes the framework for providing security at
  8108. * IP layer. IPsec is defined for both versions of IP:
  8109. * IPV4 and IPV6.
  8110. * Please refer to htt_rx_flow_proto enumeration below for
  8111. * more info.
  8112. * ipsec_valid = 1 for IPSEC packets
  8113. * ipsec_valid = 0 for IP Packets
  8114. * b'7:1 - operation: This indicates types of FSE operation.
  8115. * Refer to htt_rx_fse_operation enumeration:
  8116. * 0 - No Cache Invalidation required
  8117. * 1 - Cache invalidate only one entry given by IP
  8118. * src/dest address at DWORD[2:9]
  8119. * 2 - Complete FSE Cache Invalidation
  8120. * 3 - FSE Disable
  8121. * 4 - FSE Enable
  8122. * b'31:8 - reserved: Reserved for future use
  8123. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  8124. * for per flow addition/deletion
  8125. * For IPV4 src/dest addresses, the first A_UINT32 is used
  8126. * and the subsequent 3 A_UINT32 will be padding bytes.
  8127. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  8128. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  8129. * from 0 to 65535 but only 0 to 1023 are designated as
  8130. * well-known ports. Refer to [RFC1700] for more details.
  8131. * This field is valid only if
  8132. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8133. * - L4 dest port (31:16): 16-bit Destination Port numbers
  8134. * range from 0 to 65535 but only 0 to 1023 are designated
  8135. * as well-known ports. Refer to [RFC1700] for more details.
  8136. * This field is valid only if
  8137. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  8138. * - SPI (31:0): Security Parameters Index is an
  8139. * identification tag added to the header while using IPsec
  8140. * for tunneling the IP traffici.
  8141. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  8142. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  8143. * Assigned Internet Protocol Numbers.
  8144. * l4_proto numbers for standard protocol like UDP/TCP
  8145. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  8146. * l4_proto = 17 for UDP etc.
  8147. * b'31:8 - reserved: Reserved for future use.
  8148. *
  8149. */
  8150. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  8151. A_UINT32 msg_type:8,
  8152. pdev_id:8,
  8153. reserved0:16;
  8154. A_UINT32 ipsec_valid:1,
  8155. operation:7,
  8156. reserved1:24;
  8157. A_UINT32 ip_src_addr_31_0;
  8158. A_UINT32 ip_src_addr_63_32;
  8159. A_UINT32 ip_src_addr_95_64;
  8160. A_UINT32 ip_src_addr_127_96;
  8161. A_UINT32 ip_dest_addr_31_0;
  8162. A_UINT32 ip_dest_addr_63_32;
  8163. A_UINT32 ip_dest_addr_95_64;
  8164. A_UINT32 ip_dest_addr_127_96;
  8165. union {
  8166. A_UINT32 spi;
  8167. struct {
  8168. A_UINT32 l4_src_port:16,
  8169. l4_dest_port:16;
  8170. } ip;
  8171. } u;
  8172. A_UINT32 l4_proto:8,
  8173. reserved:24;
  8174. } POSTPACK;
  8175. /**
  8176. * @brief Host-->target HTT RX Full monitor mode register configuration message
  8177. *
  8178. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  8179. *
  8180. * @details
  8181. * The host will send this Full monitor mode register configuration message.
  8182. * This message can be sent per SOC or per PDEV which is differentiated
  8183. * by pdev id values.
  8184. *
  8185. * |31 16|15 11|10 8|7 3|2|1|0|
  8186. * |-------------------------------------------------------------|
  8187. * | reserved | pdev_id | MSG_TYPE |
  8188. * |-------------------------------------------------------------|
  8189. * | reserved |Release Ring |N|Z|E|
  8190. * |-------------------------------------------------------------|
  8191. *
  8192. * where E is 1-bit full monitor mode enable/disable.
  8193. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  8194. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  8195. *
  8196. * The following field definitions describe the format of the full monitor
  8197. * mode configuration message sent from the host to target for each pdev.
  8198. *
  8199. * Header fields:
  8200. * dword0 - b'7:0 - msg_type: This will be set to
  8201. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8202. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8203. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8204. * specified pdev's LMAC ring.
  8205. * b'31:16 - reserved : Reserved for future use.
  8206. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8207. * monitor mode rxdma register is to be enabled or disabled.
  8208. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8209. * additional descriptors at ppdu end for zero mpdus
  8210. * enabled or disabled.
  8211. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8212. * additional descriptors at ppdu end for non zero mpdus
  8213. * enabled or disabled.
  8214. * b'10:3 - release_ring: This indicates the destination ring
  8215. * selection for the descriptor at the end of PPDU
  8216. * 0 - REO ring select
  8217. * 1 - FW ring select
  8218. * 2 - SW ring select
  8219. * 3 - Release ring select
  8220. * Refer to htt_rx_full_mon_release_ring.
  8221. * b'31:11 - reserved for future use
  8222. */
  8223. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8224. A_UINT32 msg_type:8,
  8225. pdev_id:8,
  8226. reserved0:16;
  8227. A_UINT32 full_monitor_mode_enable:1,
  8228. addnl_descs_zero_mpdus_end:1,
  8229. addnl_descs_non_zero_mpdus_end:1,
  8230. release_ring:8,
  8231. reserved1:21;
  8232. } POSTPACK;
  8233. /**
  8234. * Enumeration for full monitor mode destination ring select
  8235. * 0 - REO destination ring select
  8236. * 1 - FW destination ring select
  8237. * 2 - SW destination ring select
  8238. * 3 - Release destination ring select
  8239. */
  8240. enum htt_rx_full_mon_release_ring {
  8241. HTT_RX_MON_RING_REO,
  8242. HTT_RX_MON_RING_FW,
  8243. HTT_RX_MON_RING_SW,
  8244. HTT_RX_MON_RING_RELEASE,
  8245. };
  8246. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8247. /* DWORD 0: Pdev ID */
  8248. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8249. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8250. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8251. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8252. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8253. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8254. do { \
  8255. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8256. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8257. } while (0)
  8258. /* DWORD 1:ENABLE */
  8259. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8260. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8261. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8262. do { \
  8263. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8264. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8265. } while (0)
  8266. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8267. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8268. /* DWORD 1:ZERO_MPDU */
  8269. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8270. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8271. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8272. do { \
  8273. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8274. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8275. } while (0)
  8276. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8277. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8278. /* DWORD 1:NON_ZERO_MPDU */
  8279. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8280. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8281. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8282. do { \
  8283. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8284. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8285. } while (0)
  8286. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8287. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8288. /* DWORD 1:RELEASE_RINGS */
  8289. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8290. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8291. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8292. do { \
  8293. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8294. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8295. } while (0)
  8296. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8297. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8298. /**
  8299. * Enumeration for IP Protocol or IPSEC Protocol
  8300. * IPsec describes the framework for providing security at IP layer.
  8301. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8302. */
  8303. enum htt_rx_flow_proto {
  8304. HTT_RX_FLOW_IP_PROTO,
  8305. HTT_RX_FLOW_IPSEC_PROTO,
  8306. };
  8307. /**
  8308. * Enumeration for FSE Cache Invalidation
  8309. * 0 - No Cache Invalidation required
  8310. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8311. * 2 - Complete FSE Cache Invalidation
  8312. * 3 - FSE Disable
  8313. * 4 - FSE Enable
  8314. */
  8315. enum htt_rx_fse_operation {
  8316. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8317. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8318. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8319. HTT_RX_FSE_DISABLE,
  8320. HTT_RX_FSE_ENABLE,
  8321. };
  8322. /* DWORD 0: Pdev ID */
  8323. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8324. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8325. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8326. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8327. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8328. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8329. do { \
  8330. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8331. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8332. } while (0)
  8333. /* DWORD 1:IP PROTO or IPSEC */
  8334. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8335. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8336. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8337. do { \
  8338. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8339. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8340. } while (0)
  8341. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8342. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8343. /* DWORD 1:FSE Operation */
  8344. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8345. #define HTT_RX_FSE_OPERATION_S 1
  8346. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8347. do { \
  8348. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8349. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8350. } while (0)
  8351. #define HTT_RX_FSE_OPERATION_GET(word) \
  8352. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8353. /* DWORD 2-9:IP Address */
  8354. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8355. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8356. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8357. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8358. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8359. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8360. do { \
  8361. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8362. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8363. } while (0)
  8364. /* DWORD 10:Source Port Number */
  8365. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8366. #define HTT_RX_FSE_SOURCEPORT_S 0
  8367. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8368. do { \
  8369. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8370. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8371. } while (0)
  8372. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8373. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8374. /* DWORD 11:Destination Port Number */
  8375. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8376. #define HTT_RX_FSE_DESTPORT_S 16
  8377. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8378. do { \
  8379. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8380. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8381. } while (0)
  8382. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8383. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8384. /* DWORD 10-11:SPI (In case of IPSEC) */
  8385. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8386. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8387. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8388. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8389. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8390. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8391. do { \
  8392. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8393. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8394. } while (0)
  8395. /* DWORD 12:L4 PROTO */
  8396. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8397. #define HTT_RX_FSE_L4_PROTO_S 0
  8398. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8399. do { \
  8400. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8401. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8402. } while (0)
  8403. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8404. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8405. /**
  8406. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8407. *
  8408. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8409. *
  8410. * |31 24|23 |15 8|7 2|1|0|
  8411. * |----------------+----------------+----------------+----------------|
  8412. * | reserved | pdev_id | msg_type |
  8413. * |---------------------------------+----------------+----------------|
  8414. * | reserved |E|F|
  8415. * |---------------------------------+----------------+----------------|
  8416. * Where E = Configure the target to provide the 3-tuple hash value in
  8417. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8418. * F = Configure the target to provide the 3-tuple hash value in
  8419. * flow_id_toeplitz field of rx_msdu_start tlv
  8420. *
  8421. * The following field definitions describe the format of the 3 tuple hash value
  8422. * message sent from the host to target as part of initialization sequence.
  8423. *
  8424. * Header fields:
  8425. * dword0 - b'7:0 - msg_type: This will be set to
  8426. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8427. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8428. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8429. * specified pdev's LMAC ring.
  8430. * b'31:16 - reserved : Reserved for future use
  8431. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8432. * b'1 - toeplitz_hash_2_or_4_field_enable
  8433. * b'31:2 - reserved : Reserved for future use
  8434. * ---------+------+----------------------------------------------------------
  8435. * bit1 | bit0 | Functionality
  8436. * ---------+------+----------------------------------------------------------
  8437. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8438. * | | in flow_id_toeplitz field
  8439. * ---------+------+----------------------------------------------------------
  8440. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8441. * | | in toeplitz_hash_2_or_4 field
  8442. * ---------+------+----------------------------------------------------------
  8443. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8444. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8445. * ---------+------+----------------------------------------------------------
  8446. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8447. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8448. * | | toeplitz_hash_2_or_4 field
  8449. *----------------------------------------------------------------------------
  8450. */
  8451. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8452. A_UINT32 msg_type :8,
  8453. pdev_id :8,
  8454. reserved0 :16;
  8455. A_UINT32 flow_id_toeplitz_field_enable :1,
  8456. toeplitz_hash_2_or_4_field_enable :1,
  8457. reserved1 :30;
  8458. } POSTPACK;
  8459. /* DWORD0 : pdev_id configuration Macros */
  8460. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8461. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8462. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8463. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8464. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8465. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8466. do { \
  8467. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8468. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8469. } while (0)
  8470. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8471. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8472. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8473. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8474. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8475. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8476. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8477. do { \
  8478. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8479. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8480. } while (0)
  8481. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8482. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8483. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8484. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8485. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8486. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8487. do { \
  8488. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8489. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8490. } while (0)
  8491. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8492. /**
  8493. * @brief host --> target Host PA Address Size
  8494. *
  8495. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8496. *
  8497. * @details
  8498. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8499. * provide the physical start address and size of each of the memory
  8500. * areas within host DDR that the target FW may need to access.
  8501. *
  8502. * For example, the host can use this message to allow the target FW
  8503. * to set up access to the host's pools of TQM link descriptors.
  8504. * The message would appear as follows:
  8505. *
  8506. * |31 24|23 16|15 8|7 0|
  8507. * |----------------+----------------+----------------+----------------|
  8508. * | reserved | num_entries | msg_type |
  8509. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8510. * | mem area 0 size |
  8511. * |----------------+----------------+----------------+----------------|
  8512. * | mem area 0 physical_address_lo |
  8513. * |----------------+----------------+----------------+----------------|
  8514. * | mem area 0 physical_address_hi |
  8515. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8516. * | mem area 1 size |
  8517. * |----------------+----------------+----------------+----------------|
  8518. * | mem area 1 physical_address_lo |
  8519. * |----------------+----------------+----------------+----------------|
  8520. * | mem area 1 physical_address_hi |
  8521. * |----------------+----------------+----------------+----------------|
  8522. * ...
  8523. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8524. * | mem area N size |
  8525. * |----------------+----------------+----------------+----------------|
  8526. * | mem area N physical_address_lo |
  8527. * |----------------+----------------+----------------+----------------|
  8528. * | mem area N physical_address_hi |
  8529. * |----------------+----------------+----------------+----------------|
  8530. *
  8531. * The message is interpreted as follows:
  8532. * dword0 - b'0:7 - msg_type: This will be set to
  8533. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8534. * b'8:15 - number_entries: Indicated the number of host memory
  8535. * areas specified within the remainder of the message
  8536. * b'16:31 - reserved.
  8537. * dword1 - b'0:31 - memory area 0 size in bytes
  8538. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8539. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8540. * and similar for memory area 1 through memory area N.
  8541. */
  8542. PREPACK struct htt_h2t_host_paddr_size {
  8543. A_UINT32 msg_type: 8,
  8544. num_entries: 8,
  8545. reserved: 16;
  8546. } POSTPACK;
  8547. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8548. A_UINT32 size;
  8549. A_UINT32 physical_address_lo;
  8550. A_UINT32 physical_address_hi;
  8551. } POSTPACK;
  8552. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8553. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8554. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8555. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8556. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8557. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8558. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8559. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8560. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8561. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8562. do { \
  8563. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8564. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8565. } while (0)
  8566. /**
  8567. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8568. *
  8569. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8570. *
  8571. * @details
  8572. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8573. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8574. *
  8575. * The message would appear as follows:
  8576. *
  8577. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8578. * |---------------------------------+---+---+----------+-+-----------|
  8579. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8580. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8581. *
  8582. *
  8583. * The message is interpreted as follows:
  8584. * dword0 - b'0:7 - msg_type: This will be set to
  8585. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8586. * b'8 - override bit to drive MSDUs to PPE ring
  8587. * b'9:13 - REO destination ring indication
  8588. * b'14 - Multi buffer msdu override enable bit
  8589. * b'15 - Intra BSS override
  8590. * b'16 - Decap raw override
  8591. * b'17 - Decap Native wifi override
  8592. * b'18 - IP frag override
  8593. * b'19:31 - reserved
  8594. */
  8595. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8596. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8597. override: 1,
  8598. reo_destination_indication: 5,
  8599. multi_buffer_msdu_override_en: 1,
  8600. intra_bss_override: 1,
  8601. decap_raw_override: 1,
  8602. decap_nwifi_override: 1,
  8603. ip_frag_override: 1,
  8604. reserved: 13;
  8605. } POSTPACK;
  8606. /* DWORD 0: Override */
  8607. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8608. #define HTT_PPE_CFG_OVERRIDE_S 8
  8609. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8610. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8611. HTT_PPE_CFG_OVERRIDE_S)
  8612. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8613. do { \
  8614. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8615. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8616. } while (0)
  8617. /* DWORD 0: REO Destination Indication*/
  8618. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8619. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8620. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8621. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8622. HTT_PPE_CFG_REO_DEST_IND_S)
  8623. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8624. do { \
  8625. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8626. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8627. } while (0)
  8628. /* DWORD 0: Multi buffer MSDU override */
  8629. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8630. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8631. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8632. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8633. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8634. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8635. do { \
  8636. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8637. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8638. } while (0)
  8639. /* DWORD 0: Intra BSS override */
  8640. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8641. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8642. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8643. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8644. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8645. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8646. do { \
  8647. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8648. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8649. } while (0)
  8650. /* DWORD 0: Decap RAW override */
  8651. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8652. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8653. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8654. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8655. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8656. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8657. do { \
  8658. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8659. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8660. } while (0)
  8661. /* DWORD 0: Decap NWIFI override */
  8662. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8663. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8664. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8665. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8666. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8667. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8668. do { \
  8669. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8670. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8671. } while (0)
  8672. /* DWORD 0: IP frag override */
  8673. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8674. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8675. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8676. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8677. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8678. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8679. do { \
  8680. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8681. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8682. } while (0)
  8683. /*
  8684. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8685. *
  8686. * @details
  8687. * The following field definitions describe the format of the HTT host
  8688. * to target FW VDEV TX RX stats retrieve message.
  8689. * The message specifies the type of stats the host wants to retrieve.
  8690. *
  8691. * |31 27|26 25|24 17|16|15 8|7 0|
  8692. * |-----------------------------------------------------------|
  8693. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8694. * |-----------------------------------------------------------|
  8695. * | vdev_id lower bitmask |
  8696. * |-----------------------------------------------------------|
  8697. * | vdev_id upper bitmask |
  8698. * |-----------------------------------------------------------|
  8699. * Header fields:
  8700. * Where:
  8701. * dword0 - b'7:0 - msg_type: This will be set to
  8702. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8703. * b'15:8 - pdev id
  8704. * b'16(E) - Enable/Disable the vdev HW stats
  8705. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8706. * b'25:26(R) - Reset stats bits
  8707. * 0: don't reset stats
  8708. * 1: reset stats once
  8709. * 2: reset stats at the start of each periodic interval
  8710. * b'27:31 - reserved for future use
  8711. * dword1 - b'0:31 - vdev_id lower bitmask
  8712. * dword2 - b'0:31 - vdev_id upper bitmask
  8713. */
  8714. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8715. A_UINT32 msg_type :8,
  8716. pdev_id :8,
  8717. enable :1,
  8718. periodic_interval :8,
  8719. reset_stats_bits :2,
  8720. reserved0 :5;
  8721. A_UINT32 vdev_id_lower_bitmask;
  8722. A_UINT32 vdev_id_upper_bitmask;
  8723. } POSTPACK;
  8724. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8725. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8726. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8727. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8728. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8729. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8730. do { \
  8731. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8732. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8733. } while (0)
  8734. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8735. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8736. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8737. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8738. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8739. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8740. do { \
  8741. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8742. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8743. } while (0)
  8744. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8745. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8746. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8747. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8748. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8749. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8750. do { \
  8751. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8752. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8753. } while (0)
  8754. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8755. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8756. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8757. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8758. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8759. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8760. do { \
  8761. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8762. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8763. } while (0)
  8764. /*
  8765. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8766. *
  8767. * @details
  8768. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8769. * the default MSDU queues for one of the TIDs within the specified peer
  8770. * to the specified service class.
  8771. * The TID is indirectly specified - each service class is associated
  8772. * with a TID. All default MSDU queues for this peer-TID will be
  8773. * linked to the service class in question.
  8774. *
  8775. * |31 16|15 8|7 0|
  8776. * |------------------------------+--------------+--------------|
  8777. * | peer ID | svc class ID | msg type |
  8778. * |------------------------------------------------------------|
  8779. * Header fields:
  8780. * dword0 - b'7:0 - msg_type: This will be set to
  8781. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8782. * b'15:8 - service class ID
  8783. * b'31:16 - peer ID
  8784. */
  8785. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8786. A_UINT32 msg_type :8,
  8787. svc_class_id :8,
  8788. peer_id :16;
  8789. } POSTPACK;
  8790. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8791. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8792. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8793. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8794. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8795. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8796. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8797. do { \
  8798. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8799. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8800. } while (0)
  8801. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8802. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8803. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8804. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8805. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8806. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8807. do { \
  8808. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8809. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8810. } while (0)
  8811. /*
  8812. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8813. *
  8814. * @details
  8815. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8816. * remove the linkage of the specified peer-TID's MSDU queues to
  8817. * service classes.
  8818. *
  8819. * |31 16|15 8|7 0|
  8820. * |------------------------------+--------------+--------------|
  8821. * | peer ID | svc class ID | msg type |
  8822. * |------------------------------------------------------------|
  8823. * Header fields:
  8824. * dword0 - b'7:0 - msg_type: This will be set to
  8825. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8826. * b'15:8 - service class ID
  8827. * b'31:16 - peer ID
  8828. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8829. * value for peer ID indicates that the target should
  8830. * apply the UNMAP_REQ to all peers.
  8831. */
  8832. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8833. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8834. A_UINT32 msg_type :8,
  8835. svc_class_id :8,
  8836. peer_id :16;
  8837. } POSTPACK;
  8838. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8839. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8840. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8841. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8842. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8843. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8844. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8845. do { \
  8846. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8847. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8848. } while (0)
  8849. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8850. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8851. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8852. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8853. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8854. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8855. do { \
  8856. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8857. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8858. } while (0)
  8859. /*
  8860. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8861. *
  8862. * @details
  8863. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8864. * request the target to report what service class the default MSDU queues
  8865. * of the specified TIDs within the peer are linked to.
  8866. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8867. * to report what service class (if any) the default MSDU queues for
  8868. * each of the specified TIDs are linked to.
  8869. *
  8870. * |31 16|15 8|7 1| 0|
  8871. * |------------------------------+--------------+--------------|
  8872. * | peer ID | TID mask | msg type |
  8873. * |------------------------------------------------------------|
  8874. * | reserved |ETO|
  8875. * |------------------------------------------------------------|
  8876. * Header fields:
  8877. * dword0 - b'7:0 - msg_type: This will be set to
  8878. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8879. * b'15:8 - TID mask
  8880. * b'31:16 - peer ID
  8881. * dword1 - b'0 - "Existing Tids Only" flag
  8882. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8883. * message generated by this REQ will only show the
  8884. * mapping for TIDs that actually exist in the target's
  8885. * peer object.
  8886. * Any TIDs that are covered by a MAP_REQ but which
  8887. * do not actually exist will be shown as being
  8888. * unmapped (i.e. svc class ID 0xff).
  8889. * If this flag is cleared, the MAP_REPORT_CONF message
  8890. * will consider not only the mapping of TIDs currently
  8891. * existing in the peer, but also the mapping that will
  8892. * be applied for any TID objects created within this
  8893. * peer in the future.
  8894. * b'31:1 - reserved for future use
  8895. */
  8896. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8897. A_UINT32 msg_type :8,
  8898. tid_mask :8,
  8899. peer_id :16;
  8900. A_UINT32 existing_tids_only:1,
  8901. reserved :31;
  8902. } POSTPACK;
  8903. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8904. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8905. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8906. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8907. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8908. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8909. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8910. do { \
  8911. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8912. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8913. } while (0)
  8914. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8915. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8916. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8917. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8918. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8919. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8920. do { \
  8921. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8922. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8923. } while (0)
  8924. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8925. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8926. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8927. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8928. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8929. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8930. do { \
  8931. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8932. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8933. } while (0)
  8934. /**
  8935. * @brief Format of shared memory between Host and Target
  8936. * for UMAC recovery feature messaging.
  8937. * @details
  8938. * This is shared memory between Host and Target allocated
  8939. * and used in chips where UMAC recovery feature is supported.
  8940. * This shared memory is allocated per SOC level by Host since each
  8941. * SOC's target Q6FW needs to communicate independently to the Host
  8942. * through its own shared memory.
  8943. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8944. * then host interprets it as a new message from target.
  8945. * Host clears that particular read bit in t2h_msg after each read
  8946. * operation. It is vice versa for h2t_msg. At any given point
  8947. * of time there is expected to be only one bit set
  8948. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8949. *
  8950. * The message is interpreted as follows:
  8951. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8952. * added for debuggability purpose.
  8953. * dword1 - b'0 - do_pre_reset
  8954. * b'1 - do_post_reset_start
  8955. * b'2 - do_post_reset_complete
  8956. * b'3 - initiate_umac_recovery
  8957. * b'4 - initiate_target_recovery_sync_using_umac
  8958. * b'5:31 - rsvd_t2h
  8959. * dword2 - b'0 - pre_reset_done
  8960. * b'1 - post_reset_start_done
  8961. * b'2 - post_reset_complete_done
  8962. * b'3 - start_pre_reset (deprecated)
  8963. * b'4:31 - rsvd_h2t
  8964. */
  8965. PREPACK typedef struct {
  8966. /** Magic number added for debuggability. */
  8967. A_UINT32 magic_num;
  8968. union {
  8969. /*
  8970. * BIT [0] :- T2H msg to do pre-reset
  8971. * BIT [1] :- T2H msg to do post-reset start
  8972. * BIT [2] :- T2H msg to do post-reset complete
  8973. * BIT [3] :- T2H msg to indicate to Host that
  8974. * a trigger request for MLO UMAC Recovery
  8975. * is received for UMAC hang.
  8976. * BIT [4] :- T2H msg to indicate to Host that
  8977. * a trigger request for MLO UMAC Recovery
  8978. * is received for Mode-1 Target Recovery.
  8979. * BIT [31 : 5] :- reserved
  8980. */
  8981. A_UINT32 t2h_msg;
  8982. struct {
  8983. A_UINT32
  8984. do_pre_reset: 1, /* BIT [0] */
  8985. do_post_reset_start: 1, /* BIT [1] */
  8986. do_post_reset_complete: 1, /* BIT [2] */
  8987. initiate_umac_recovery: 1, /* BIT [3] */
  8988. initiate_target_recovery_sync_using_umac: 1, /* BIT [4] */
  8989. rsvd_t2h: 27; /* BIT [31:5] */
  8990. };
  8991. };
  8992. union {
  8993. /*
  8994. * BIT [0] :- H2T msg to send pre-reset done
  8995. * BIT [1] :- H2T msg to send post-reset start done
  8996. * BIT [2] :- H2T msg to send post-reset complete done
  8997. * BIT [3] :- H2T msg to start pre-reset. This is deprecated.
  8998. * BIT [31 : 4] :- reserved
  8999. */
  9000. A_UINT32 h2t_msg;
  9001. struct {
  9002. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  9003. post_reset_start_done : 1, /* BIT [1] */
  9004. post_reset_complete_done : 1, /* BIT [2] */
  9005. start_pre_reset : 1, /* BIT [3] */
  9006. rsvd_h2t : 28; /* BIT [31 : 4] */
  9007. };
  9008. };
  9009. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  9010. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  9011. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  9012. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  9013. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  9014. /* dword1 - b'0 - do_pre_reset */
  9015. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  9016. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  9017. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  9018. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  9019. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  9020. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  9021. do { \
  9022. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  9023. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  9024. } while (0)
  9025. /* dword1 - b'1 - do_post_reset_start */
  9026. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  9027. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  9028. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  9029. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  9030. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  9031. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  9032. do { \
  9033. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  9034. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  9035. } while (0)
  9036. /* dword1 - b'2 - do_post_reset_complete */
  9037. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  9038. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  9039. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  9040. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  9041. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  9042. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  9043. do { \
  9044. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  9045. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  9046. } while (0)
  9047. /* dword1 - b'3 - initiate_umac_recovery */
  9048. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M 0x00000008
  9049. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S 3
  9050. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_GET(word1) \
  9051. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_M) >> \
  9052. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S)
  9053. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_SET(word1, _val) \
  9054. do { \
  9055. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY, _val); \
  9056. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_UMAC_RECOVERY_S));\
  9057. } while (0)
  9058. /* dword1 - b'4 - initiate_target_recovery_sync_using_umac */
  9059. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_M 0x00000010
  9060. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S 4
  9061. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_GET(word1) \
  9062. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_M) >> \
  9063. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S)
  9064. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_SET(word1, _val) \
  9065. do { \
  9066. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC, _val); \
  9067. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_INITIATE_TARGET_RECOVERY_SYNC_USING_UMAC_S));\
  9068. } while (0)
  9069. /* dword2 - b'0 - pre_reset_done */
  9070. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  9071. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  9072. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  9073. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  9074. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  9075. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  9076. do { \
  9077. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  9078. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  9079. } while (0)
  9080. /* dword2 - b'1 - post_reset_start_done */
  9081. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  9082. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  9083. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  9084. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  9085. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  9086. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  9087. do { \
  9088. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  9089. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  9090. } while (0)
  9091. /* dword2 - b'2 - post_reset_complete_done */
  9092. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  9093. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  9094. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  9095. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  9096. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  9097. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  9098. do { \
  9099. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  9100. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  9101. } while (0)
  9102. /* dword2 - b'3 - start_pre_reset */
  9103. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M 0x00000008
  9104. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S 3
  9105. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_GET(word2) \
  9106. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_M) >> \
  9107. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S)
  9108. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_SET(word2, _val) \
  9109. do { \
  9110. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET, _val); \
  9111. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_START_PRE_RESET_S));\
  9112. } while (0)
  9113. /**
  9114. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  9115. *
  9116. * @details
  9117. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  9118. * by the host to provide prerequisite info to target for the UMAC hang
  9119. * recovery feature.
  9120. * The info sent in this H2T message are T2H message method, H2T message
  9121. * method, T2H MSI interrupt number and physical start address, size of
  9122. * the shared memory (refers to the shared memory dedicated for messaging
  9123. * between host and target when the DUT is in UMAC hang recovery mode).
  9124. * This H2T message is expected to be only sent if the WMI service bit
  9125. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  9126. *
  9127. * |31 16|15 12|11 8|7 0|
  9128. * |-------------------------------+--------------+--------------+------------|
  9129. * | reserved |h2t msg method|t2h msg method| msg_type |
  9130. * |--------------------------------------------------------------------------|
  9131. * | t2h msi interrupt number |
  9132. * |--------------------------------------------------------------------------|
  9133. * | shared memory area size |
  9134. * |--------------------------------------------------------------------------|
  9135. * | shared memory area physical address low |
  9136. * |--------------------------------------------------------------------------|
  9137. * | shared memory area physical address high |
  9138. * |--------------------------------------------------------------------------|
  9139. *
  9140. * The message is interpreted as follows:
  9141. * dword0 - b'0:7 - msg_type
  9142. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP)
  9143. * b'8:11 - t2h_msg_method: indicates method to be used for
  9144. * T2H communication in UMAC hang recovery mode.
  9145. * Value zero indicates MSI interrupt (default method).
  9146. * Refer to htt_umac_hang_recovery_msg_method enum.
  9147. * b'12:15 - h2t_msg_method: indicates method to be used for
  9148. * H2T communication in UMAC hang recovery mode.
  9149. * Value zero indicates polling by target for this h2t msg
  9150. * during UMAC hang recovery mode.
  9151. * Refer to htt_umac_hang_recovery_msg_method enum.
  9152. * b'16:31 - reserved.
  9153. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  9154. * T2H communication in UMAC hang recovery mode.
  9155. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  9156. * only when in UMAC hang recovery mode.
  9157. * This refers to size in bytes.
  9158. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  9159. * of the shared memory dedicated for messaging only when
  9160. * in UMAC hang recovery mode.
  9161. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  9162. * of the shared memory dedicated for messaging only when
  9163. * in UMAC hang recovery mode.
  9164. */
  9165. /* t2h_msg_method and h2t_msg_method */
  9166. enum htt_umac_hang_recovery_msg_method {
  9167. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  9168. };
  9169. PREPACK typedef struct {
  9170. A_UINT32 msg_type : 8,
  9171. t2h_msg_method : 4,
  9172. h2t_msg_method : 4,
  9173. reserved : 16;
  9174. A_UINT32 t2h_msi_data;
  9175. /* size bytes and physical address of shared memory. */
  9176. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  9177. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  9178. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  9179. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  9180. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  9181. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  9182. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  9183. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  9184. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  9185. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  9186. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  9187. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  9188. do { \
  9189. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  9190. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  9191. } while (0)
  9192. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  9193. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  9194. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  9195. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  9196. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  9197. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  9198. do { \
  9199. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  9200. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  9201. } while (0)
  9202. /**
  9203. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET message
  9204. *
  9205. * @details
  9206. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET is a SOC level
  9207. * HTT message sent by the host to indicate that the target needs to start the
  9208. * UMAC hang recovery feature from the point of pre-reset routine.
  9209. * The purpose of this H2T message is to have host synchronize and trigger
  9210. * UMAC recovery across all targets.
  9211. * The info sent in this H2T message is the flag to indicate whether the
  9212. * target needs to execute UMAC-recovery in context of the Initiator or
  9213. * Non-Initiator.
  9214. * This H2T message is expected to be sent as response to the
  9215. * initiate_umac_recovery indication from the Initiator target attached to
  9216. * this same host.
  9217. * This H2T message is expected to be only sent if the WMI service bit
  9218. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target
  9219. * and HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP was sent
  9220. * beforehand.
  9221. *
  9222. * |31 10|9|8|7 0|
  9223. * |-----------------------------------------------------------|
  9224. * | reserved |U|I| msg_type |
  9225. * |-----------------------------------------------------------|
  9226. * Where:
  9227. * I = is_initiator
  9228. * U = is_umac_hang
  9229. *
  9230. * The message is interpreted as follows:
  9231. * dword0 - b'0:7 - msg_type
  9232. * (HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SOC_START_PRE_RESET)
  9233. * b'8 - is_initiator: indicates whether the target needs to
  9234. * execute the UMAC-recovery in context of the Initiator or
  9235. * Non-Initiator.
  9236. * The value zero indicates this target is Non-Initiator.
  9237. * b'9 - is_umac_hang: indicates whether MLO UMAC recovery
  9238. * executed in context of UMAC hang or Target recovery.
  9239. * b'10:31 - reserved.
  9240. */
  9241. PREPACK typedef struct {
  9242. A_UINT32 msg_type : 8,
  9243. is_initiator : 1,
  9244. is_umac_hang : 1,
  9245. reserved : 22;
  9246. } POSTPACK htt_h2t_umac_hang_recovery_start_pre_reset_t;
  9247. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES \
  9248. (sizeof(htt_h2t_umac_hang_recovery_start_pre_reset_t))
  9249. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_DWORDS \
  9250. (HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_BYTES >> 2)
  9251. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M 0x00000100
  9252. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S 8
  9253. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_GET(word0) \
  9254. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_M) >> \
  9255. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S)
  9256. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_SET(word0, _val) \
  9257. do { \
  9258. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR, _val); \
  9259. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_INITIATOR_S));\
  9260. } while (0)
  9261. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_M 0x00000200
  9262. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S 9
  9263. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_GET(word0) \
  9264. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_M) >> \
  9265. HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S)
  9266. #define HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_SET(word0, _val) \
  9267. do { \
  9268. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG, _val); \
  9269. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_START_PRE_RESET_IS_UMAC_HANG_S));\
  9270. } while (0)
  9271. /*
  9272. * @brief host -> target HTT RX_CCE_SUPER_RULE_SETUP message
  9273. *
  9274. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP
  9275. *
  9276. * @details
  9277. * Host sends RX_CCE_SUPER_RULE setup message to target, in order to request,
  9278. * install or uninstall rx cce super rules to match certain kind of packets
  9279. * with specific parameters. Target sets up HW registers based on setup message
  9280. * and always confirms back to Host.
  9281. *
  9282. * The message would appear as follows:
  9283. * |31 24|23 16|15 8|7 0|
  9284. * |-----------------+-----------------+-----------------+-----------------|
  9285. * | reserved | operation | pdev_id | msg_type |
  9286. * |-----------------------------------------------------------------------|
  9287. * | cce_super_rule_param[0] |
  9288. * |-----------------------------------------------------------------------|
  9289. * | cce_super_rule_param[1] |
  9290. * |-----------------------------------------------------------------------|
  9291. *
  9292. * The message is interpreted as follows:
  9293. * dword0 - b'0:7 - msg_type: This will be set to
  9294. * 0x23 (HTT_H2T_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP)
  9295. * b'8:15 - pdev_id: Identify which pdev RX_CCE_SUPER_RULE is for
  9296. * b'16:23 - operation: Identify operation to be taken,
  9297. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  9298. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL
  9299. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE
  9300. * b'24:31 - reserved
  9301. * dword1~10 - cce_super_rule_param[0]:
  9302. * contains parameters used to setup RX_CCE_SUPER_RULE_0
  9303. * dword11~20 - cce_super_rule_param[1]:
  9304. * contains parameters used to setup RX_CCE_SUPER_RULE_1
  9305. *
  9306. * Each cce_super_rule_param structure would appear as follows:
  9307. * |31 24|23 16|15 8|7 0|
  9308. * |-----------------+-----------------+-----------------+-----------------|
  9309. * |src_ipv6_addr[3] |src_ipv6_addr[2] |src_ipv6_addr[1] |src_ipv6_addr[0] |
  9310. * |/src_ipv4_addr[3]|/src_ipv4_addr[2]|/src_ipv4_addr[1]|/src_ipv4_addr[0]|
  9311. * |-----------------------------------------------------------------------|
  9312. * |src_ipv6_addr[7] |src_ipv6_addr[6] |src_ipv6_addr[5] |src_ipv6_addr[4] |
  9313. * |-----------------------------------------------------------------------|
  9314. * |src_ipv6_addr[11]|src_ipv6_addr[10]|src_ipv6_addr[9] |src_ipv6_addr[8] |
  9315. * |-----------------------------------------------------------------------|
  9316. * |src_ipv6_addr[15]|src_ipv6_addr[14]|src_ipv6_addr[13]|src_ipv6_addr[12]|
  9317. * |-----------------------------------------------------------------------|
  9318. * |dst_ipv6_addr[3] |dst_ipv6_addr[2] |dst_ipv6_addr[1] |dst_ipv6_addr[0] |
  9319. * |/dst_ipv4_addr[3]|/dst_ipv4_addr[2]|/dst_ipv4_addr[1]|/dst_ipv4_addr[0]|
  9320. * |-----------------------------------------------------------------------|
  9321. * |dst_ipv6_addr[7] |dst_ipv6_addr[6] |dst_ipv6_addr[5] |dst_ipv6_addr[4] |
  9322. * |-----------------------------------------------------------------------|
  9323. * |dst_ipv6_addr[11]|dst_ipv6_addr[10]|dst_ipv6_addr[9] |dst_ipv6_addr[8] |
  9324. * |-----------------------------------------------------------------------|
  9325. * |dst_ipv6_addr[15]|dst_ipv6_addr[14]|dst_ipv6_addr[13]|dst_ipv6_addr[12]|
  9326. * |-----------------------------------------------------------------------|
  9327. * | is_valid | l4_type | l3_type |
  9328. * |-----------------------------------------------------------------------|
  9329. * | l4_dst_port | l4_src_port |
  9330. * |-----------------------------------------------------------------------|
  9331. *
  9332. * The cce_super_rule_param[0] structure is interpreted as follows:
  9333. * dword1 - b'0:7 - src_ipv6_addr[0]: b'120:127 of source ipv6 address
  9334. * (or src_ipv4_addr[0]: b'24:31 of source ipv4 address,
  9335. * in case of ipv4)
  9336. * b'8:15 - src_ipv6_addr[1]: b'112:119 of source ipv6 address
  9337. * (or src_ipv4_addr[1]: b'16:23 of source ipv4 address,
  9338. * in case of ipv4)
  9339. * b'16:23 - src_ipv6_addr[2]: b'104:111 of source ipv6 address
  9340. * (or src_ipv4_addr[2]: b'8:15 of source ipv4 address,
  9341. * in case of ipv4)
  9342. * b'24:31 - src_ipv6_addr[3]: b'96:103 of source ipv6 address
  9343. * (or src_ipv4_addr[3]: b'0:7 of source ipv4 address,
  9344. * in case of ipv4)
  9345. * dword2 - b'0:7 - src_ipv6_addr[4]: b'88:95 of source ipv6 address
  9346. * b'8:15 - src_ipv6_addr[5]: b'80:87 of source ipv6 address
  9347. * b'16:23 - src_ipv6_addr[6]: b'72:79 of source ipv6 address
  9348. * b'24:31 - src_ipv6_addr[7]: b'64:71 of source ipv6 address
  9349. * dword3 - b'0:7 - src_ipv6_addr[8]: b'56:63 of source ipv6 address
  9350. * b'8:15 - src_ipv6_addr[9]: b'48:55 of source ipv6 address
  9351. * b'16:23 - src_ipv6_addr[10]: b'40:47 of source ipv6 address
  9352. * b'24:31 - src_ipv6_addr[11]: b'32:39 of source ipv6 address
  9353. * dword4 - b'0:7 - src_ipv6_addr[12]: b'24:31 of source ipv6 address
  9354. * b'8:15 - src_ipv6_addr[13]: b'16:23 of source ipv6 address
  9355. * b'16:23 - src_ipv6_addr[14]: b'8:15 of source ipv6 address
  9356. * b'24:31 - src_ipv6_addr[15]: b'0:7 of source ipv6 address
  9357. * dword5 - b'0:7 - dst_ipv6_addr[0]: b'120:127 of destination ipv6 address
  9358. * (or dst_ipv4_addr[0]: b'24:31 of destination
  9359. * ipv4 address, in case of ipv4)
  9360. * b'8:15 - dst_ipv6_addr[1]: b'112:119 of destination ipv6 address
  9361. * (or dst_ipv4_addr[1]: b'16:23 of destination
  9362. * ipv4 address, in case of ipv4)
  9363. * b'16:23 - dst_ipv6_addr[2]: b'104:111 of destination ipv6 address
  9364. * (or dst_ipv4_addr[2]: b'8:15 of destination
  9365. * ipv4 address, in case of ipv4)
  9366. * b'24:31 - dst_ipv6_addr[3]: b'96:103 of destination ipv6 address
  9367. * (or dst_ipv4_addr[3]: b'0:7 of destination
  9368. * ipv4 address, in case of ipv4)
  9369. * dword6 - b'0:7 - dst_ipv6_addr[4]: b'88:95 of destination ipv6 address
  9370. * b'8:15 - dst_ipv6_addr[5]: b'80:87 of destination ipv6 address
  9371. * b'16:23 - dst_ipv6_addr[6]: b'72:79 of destination ipv6 address
  9372. * b'24:31 - dst_ipv6_addr[7]: b'64:71 of destination ipv6 address
  9373. * dword7 - b'0:7 - dst_ipv6_addr[8]: b'56:63 of destination ipv6 address
  9374. * b'8:15 - dst_ipv6_addr[9]: b'48:55 of destination ipv6 address
  9375. * b'16:23 - dst_ipv6_addr[10]: b'40:47 of destination ipv6 address
  9376. * b'24:31 - dst_ipv6_addr[11]: b'32:39 of destination ipv6 address
  9377. * dword8 - b'0:7 - dst_ipv6_addr[12]: b'24:31 of destination ipv6 address
  9378. * b'8:15 - dst_ipv6_addr[13]: b'16:23 of destination ipv6 address
  9379. * b'16:23 - dst_ipv6_addr[14]: b'8:15 of destination ipv6 address
  9380. * b'24:31 - dst_ipv6_addr[15]: b'0:7 of destination ipv6 address
  9381. * dword9 - b'0:15 - l3_type: type of L3 protocol, indicating L3 protocol used
  9382. * 0x0008: ipv4
  9383. * 0xdd86: ipv6
  9384. * b'16:23 - l4_type: type of L4 protocol, indicating L4 protocol used
  9385. * 6: TCP
  9386. * 17: UDP
  9387. * b'24:31 - is_valid: indicate whether this parameter is valid
  9388. * 0: invalid
  9389. * 1: valid
  9390. * dword10 - b'0:15 - l4_src_port: TCP/UDP source port field
  9391. * b'16:31 - l4_dst_port: TCP/UDP destination port field
  9392. *
  9393. * The cce_super_rule_param[1] structure is similar.
  9394. */
  9395. #define HTT_RX_CCE_SUPER_RULE_SETUP_NUM 2
  9396. enum htt_rx_cce_super_rule_setup_operation {
  9397. HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST = 0,
  9398. HTT_RX_CCE_SUPER_RULE_INSTALL,
  9399. HTT_RX_CCE_SUPER_RULE_RELEASE,
  9400. /* All operation should be before this */
  9401. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_OPERATION,
  9402. };
  9403. typedef struct {
  9404. union {
  9405. A_UINT8 src_ipv4_addr[4];
  9406. A_UINT8 src_ipv6_addr[16];
  9407. };
  9408. union {
  9409. A_UINT8 dst_ipv4_addr[4];
  9410. A_UINT8 dst_ipv6_addr[16];
  9411. };
  9412. A_UINT32 l3_type: 16,
  9413. l4_type: 8,
  9414. is_valid: 8;
  9415. A_UINT32 l4_src_port: 16,
  9416. l4_dst_port: 16;
  9417. } htt_rx_cce_super_rule_param_t;
  9418. PREPACK struct htt_rx_cce_super_rule_setup_t {
  9419. A_UINT32 msg_type: 8,
  9420. pdev_id: 8,
  9421. operation: 8,
  9422. reserved: 8;
  9423. htt_rx_cce_super_rule_param_t
  9424. cce_super_rule_param[HTT_RX_CCE_SUPER_RULE_SETUP_NUM];
  9425. } POSTPACK;
  9426. #define HTT_RX_CCE_SUPER_RULE_SETUP_SZ \
  9427. (sizeof(struct htt_rx_cce_super_rule_setup_t))
  9428. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_M 0x0000ff00
  9429. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S 8
  9430. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_GET(_var) \
  9431. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_M) >> \
  9432. HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S)
  9433. #define HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_SET(_var, _val) \
  9434. do { \
  9435. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID, _val); \
  9436. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_PDEV_ID_S)); \
  9437. } while (0)
  9438. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M 0x00ff0000
  9439. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S 16
  9440. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_GET(_var) \
  9441. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_M) >> \
  9442. HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)
  9443. #define HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_SET(_var, _val) \
  9444. do { \
  9445. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION, _val); \
  9446. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_OPERATION_S)); \
  9447. } while (0)
  9448. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M 0x0000ffff
  9449. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S 0
  9450. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_GET(_var) \
  9451. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_M) >> \
  9452. HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)
  9453. #define HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_SET(_var, _val) \
  9454. do { \
  9455. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE, _val); \
  9456. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L3_TYPE_S)); \
  9457. } while (0)
  9458. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M 0x00ff0000
  9459. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S 16
  9460. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_GET(_var) \
  9461. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_M) >> \
  9462. HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)
  9463. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_SET(_var, _val) \
  9464. do { \
  9465. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE, _val); \
  9466. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_TYPE_S)); \
  9467. } while (0)
  9468. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M 0xff000000
  9469. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S 24
  9470. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_GET(_var) \
  9471. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_M) >> \
  9472. HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)
  9473. #define HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_SET(_var, _val) \
  9474. do { \
  9475. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID, _val); \
  9476. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_IS_VALID_S)); \
  9477. } while (0)
  9478. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M 0x0000ffff
  9479. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S 0
  9480. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_GET(_var) \
  9481. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_M) >> \
  9482. HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)
  9483. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_SET(_var, _val) \
  9484. do { \
  9485. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT, _val); \
  9486. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_SRC_PORT_S)); \
  9487. } while (0)
  9488. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M 0xffff0000
  9489. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S 16
  9490. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_GET(_var) \
  9491. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_M) >> \
  9492. HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)
  9493. #define HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_SET(_var, _val) \
  9494. do { \
  9495. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT, _val); \
  9496. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_L4_DST_PORT_S)); \
  9497. } while (0)
  9498. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_GET(_ptr, _array) \
  9499. do { \
  9500. A_MEMCPY(_array, _ptr, 4); \
  9501. } while (0)
  9502. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV4_ADDR_ARRAY_SET(_ptr, _array) \
  9503. do { \
  9504. A_MEMCPY(_ptr, _array, 4); \
  9505. } while (0)
  9506. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_GET(_ptr, _array) \
  9507. do { \
  9508. A_MEMCPY(_array, _ptr, 16); \
  9509. } while (0)
  9510. #define HTT_RX_CCE_SUPER_RULE_SETUP_IPV6_ADDR_ARRAY_SET(_ptr, _array) \
  9511. do { \
  9512. A_MEMCPY(_ptr, _array, 16); \
  9513. } while (0)
  9514. /**
  9515. * htt_h2t_primary_link_peer_status_type -
  9516. * Unique number for each status or reasons
  9517. * The status reasons can go up to 255 max
  9518. */
  9519. enum htt_h2t_primary_link_peer_status_type {
  9520. /* Host Primary Link Peer migration Success */
  9521. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_OK = 0,
  9522. /* keep this last */
  9523. /* Host Primary Link Peer migration Fail */
  9524. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_FAIL = 254,
  9525. HTT_H2T_PRIMARY_LINK_PEER_MIGRATION_NUM_STATUS = 255
  9526. };
  9527. /**
  9528. * @brief host -> Primary peer migration completion message from host
  9529. *
  9530. * MSG_TYPE => HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP
  9531. *
  9532. * @details
  9533. * HTT_H2T_MSG_TYPE_PRIMARY_PEER_MIGRATE_RESP message is sent by host to
  9534. * target Confirming that primary link peer migration has completed,
  9535. * in response to a HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND
  9536. * message from the target.
  9537. *
  9538. * The message would appear as follows:
  9539. *
  9540. * |31 25|24|23 16|15 12|11 8|7 0|
  9541. * |----------------------------+----------+---------+--------------|
  9542. * | vdev ID | pdev ID | chip ID | msg type |
  9543. * |----------------------------+----------+---------+--------------|
  9544. * | ML peer ID | SW peer ID |
  9545. * |------------+--+------------+--------------------+--------------|
  9546. * | reserved |SV| src_info | status |
  9547. * |------------+--+---------------------------------+--------------|
  9548. * Where:
  9549. * SV = src_info_valid flag
  9550. *
  9551. * The message is interpreted as follows:
  9552. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  9553. * (HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP)
  9554. * b'8:11 - chip_id: Indicate which chip has been chosen as primary
  9555. * b'12:15 - pdev_id: Indicate which pdev in the chip is chosen
  9556. * as primary
  9557. * b'16:31 - vdev_id: Indicate which vdev in the pdev is chosen
  9558. * as primary
  9559. *
  9560. * dword1 - b'0:15 - sw_link_peer_id: Indicate the sw_peer_id of the peer
  9561. * chosen as primary
  9562. * b'16:31 - ml_peer_id: Indicate the ml_peer_id to which the
  9563. * primary peer belongs.
  9564. * dword2 - b'0:7 - status: Indicates the status of Rx/TCL migration
  9565. * b'8:23 - src_info: Indicates New Virtual port number through
  9566. * which Rx Pipe connects to the correct PPE.
  9567. * b'24 - src_info_valid: Indicates src_info is valid.
  9568. */
  9569. typedef struct {
  9570. A_UINT32 msg_type: 8, /* bits 7:0 */
  9571. chip_id: 4, /* bits 11:8 */
  9572. pdev_id: 4, /* bits 15:12 */
  9573. vdev_id: 16; /* bits 31:16 */
  9574. A_UINT32 sw_link_peer_id: 16, /* bits 15:0 */
  9575. ml_peer_id: 16; /* bits 31:16 */
  9576. A_UINT32 status: 8, /* bits 7:0 */
  9577. src_info: 16, /* bits 23:8 */
  9578. src_info_valid: 1, /* bit 24 */
  9579. reserved: 7; /* bits 31:25 */
  9580. } htt_h2t_primary_link_peer_migrate_resp_t;
  9581. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M 0x00000F00
  9582. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S 8
  9583. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_GET(_var) \
  9584. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M) >> \
  9585. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S)
  9586. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_SET(_var, _val) \
  9587. do { \
  9588. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID, _val); \
  9589. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S));\
  9590. } while (0)
  9591. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M 0x0000F000
  9592. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S 12
  9593. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_GET(_var) \
  9594. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M) >> \
  9595. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S)
  9596. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_SET(_var, _val) \
  9597. do { \
  9598. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID, _val); \
  9599. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S));\
  9600. } while (0)
  9601. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M 0xFFFF0000
  9602. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S 16
  9603. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_GET(_var) \
  9604. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M) >> \
  9605. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S)
  9606. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_SET(_var, _val) \
  9607. do { \
  9608. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID, _val); \
  9609. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S));\
  9610. } while (0)
  9611. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M 0x0000FFFF
  9612. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S 0
  9613. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_GET(_var) \
  9614. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M) >> \
  9615. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S)
  9616. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_SET(_var, _val) \
  9617. do { \
  9618. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID, _val); \
  9619. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S));\
  9620. } while (0)
  9621. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M 0xFFFF0000
  9622. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S 16
  9623. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_GET(_var) \
  9624. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M) >> \
  9625. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S)
  9626. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_SET(_var, _val) \
  9627. do { \
  9628. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID, _val); \
  9629. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S));\
  9630. } while (0)
  9631. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_M 0x000000FF
  9632. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S 0
  9633. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_GET(_var) \
  9634. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_M) >> \
  9635. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S)
  9636. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_SET(_var, _val) \
  9637. do { \
  9638. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS, _val); \
  9639. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_S));\
  9640. } while (0)
  9641. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_M 0x00FFFF00
  9642. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S 8
  9643. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_GET(_var) \
  9644. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_M) >> \
  9645. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S)
  9646. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_SET(_var, _val) \
  9647. do { \
  9648. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO, _val); \
  9649. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_S));\
  9650. } while (0)
  9651. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_M 0x01000000
  9652. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S 24
  9653. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_GET(_var) \
  9654. (((_var) & HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_M) >> \
  9655. HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S)
  9656. #define HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_SET(_var, _val) \
  9657. do { \
  9658. HTT_CHECK_SET_VAL(HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID, _val); \
  9659. ((_var) |= ((_val) << HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_VALID_S));\
  9660. } while (0)
  9661. /*=== target -> host messages ===============================================*/
  9662. enum htt_t2h_msg_type {
  9663. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  9664. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  9665. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  9666. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  9667. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  9668. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  9669. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  9670. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  9671. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  9672. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  9673. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  9674. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  9675. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  9676. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  9677. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  9678. /* only used for HL, add HTT MSG for HTT CREDIT update */
  9679. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  9680. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  9681. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  9682. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  9683. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  9684. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  9685. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  9686. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  9687. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  9688. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  9689. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  9690. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  9691. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  9692. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  9693. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  9694. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  9695. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  9696. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  9697. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  9698. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  9699. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  9700. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  9701. /* TX_OFFLOAD_DELIVER_IND:
  9702. * Forward the target's locally-generated packets to the host,
  9703. * to provide to the monitor mode interface.
  9704. */
  9705. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9706. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9707. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9708. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9709. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9710. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9711. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9712. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9713. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9714. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9715. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9716. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9717. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9718. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9719. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9720. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9721. HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE = 0x33,
  9722. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND = 0x34,
  9723. HTT_T2H_MSG_TYPE_RX_DATA_IND = 0x35,
  9724. HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND = 0x36,
  9725. HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND = 0x37,
  9726. HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND = 0x38,
  9727. HTT_T2H_MSG_TYPE_TEST,
  9728. /* keep this last */
  9729. HTT_T2H_NUM_MSGS
  9730. };
  9731. /*
  9732. * HTT target to host message type -
  9733. * stored in bits 7:0 of the first word of the message
  9734. */
  9735. #define HTT_T2H_MSG_TYPE_M 0xff
  9736. #define HTT_T2H_MSG_TYPE_S 0
  9737. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9738. do { \
  9739. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9740. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9741. } while (0)
  9742. #define HTT_T2H_MSG_TYPE_GET(word) \
  9743. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9744. /**
  9745. * @brief target -> host version number confirmation message definition
  9746. *
  9747. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9748. *
  9749. * |31 24|23 16|15 8|7 0|
  9750. * |----------------+----------------+----------------+----------------|
  9751. * | reserved | major number | minor number | msg type |
  9752. * |-------------------------------------------------------------------|
  9753. * : option request TLV (optional) |
  9754. * :...................................................................:
  9755. *
  9756. * The VER_CONF message may consist of a single 4-byte word, or may be
  9757. * extended with TLVs that specify HTT options selected by the target.
  9758. * The following option TLVs may be appended to the VER_CONF message:
  9759. * - LL_BUS_ADDR_SIZE
  9760. * - HL_SUPPRESS_TX_COMPL_IND
  9761. * - MAX_TX_QUEUE_GROUPS
  9762. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9763. * may be appended to the VER_CONF message (but only one TLV of each type).
  9764. *
  9765. * Header fields:
  9766. * - MSG_TYPE
  9767. * Bits 7:0
  9768. * Purpose: identifies this as a version number confirmation message
  9769. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9770. * - VER_MINOR
  9771. * Bits 15:8
  9772. * Purpose: Specify the minor number of the HTT message library version
  9773. * in use by the target firmware.
  9774. * The minor number specifies the specific revision within a range
  9775. * of fundamentally compatible HTT message definition revisions.
  9776. * Compatible revisions involve adding new messages or perhaps
  9777. * adding new fields to existing messages, in a backwards-compatible
  9778. * manner.
  9779. * Incompatible revisions involve changing the message type values,
  9780. * or redefining existing messages.
  9781. * Value: minor number
  9782. * - VER_MAJOR
  9783. * Bits 15:8
  9784. * Purpose: Specify the major number of the HTT message library version
  9785. * in use by the target firmware.
  9786. * The major number specifies the family of minor revisions that are
  9787. * fundamentally compatible with each other, but not with prior or
  9788. * later families.
  9789. * Value: major number
  9790. */
  9791. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9792. #define HTT_VER_CONF_MINOR_S 8
  9793. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9794. #define HTT_VER_CONF_MAJOR_S 16
  9795. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9796. do { \
  9797. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9798. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9799. } while (0)
  9800. #define HTT_VER_CONF_MINOR_GET(word) \
  9801. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9802. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9803. do { \
  9804. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9805. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9806. } while (0)
  9807. #define HTT_VER_CONF_MAJOR_GET(word) \
  9808. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9809. #define HTT_VER_CONF_BYTES 4
  9810. /**
  9811. * @brief - target -> host HTT Rx In order indication message
  9812. *
  9813. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9814. *
  9815. * @details
  9816. *
  9817. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9818. * |----------------+-------------------+---------------------+---------------|
  9819. * | peer ID | P| F| O| ext TID | msg type |
  9820. * |--------------------------------------------------------------------------|
  9821. * | MSDU count | Reserved | vdev id |
  9822. * |--------------------------------------------------------------------------|
  9823. * | MSDU 0 bus address (bits 31:0) |
  9824. #if HTT_PADDR64
  9825. * | MSDU 0 bus address (bits 63:32) |
  9826. #endif
  9827. * |--------------------------------------------------------------------------|
  9828. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9829. * |--------------------------------------------------------------------------|
  9830. * | MSDU 1 bus address (bits 31:0) |
  9831. #if HTT_PADDR64
  9832. * | MSDU 1 bus address (bits 63:32) |
  9833. #endif
  9834. * |--------------------------------------------------------------------------|
  9835. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9836. * |--------------------------------------------------------------------------|
  9837. */
  9838. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9839. *
  9840. * @details
  9841. * bits
  9842. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9843. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9844. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9845. * | | frag | | | | fail |chksum fail|
  9846. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9847. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9848. */
  9849. struct htt_rx_in_ord_paddr_ind_hdr_t
  9850. {
  9851. A_UINT32 /* word 0 */
  9852. msg_type: 8,
  9853. ext_tid: 5,
  9854. offload: 1,
  9855. frag: 1,
  9856. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9857. peer_id: 16;
  9858. A_UINT32 /* word 1 */
  9859. vap_id: 8,
  9860. /* NOTE:
  9861. * This reserved_1 field is not truly reserved - certain targets use
  9862. * this field internally to store debug information, and do not zero
  9863. * out the contents of the field before uploading the message to the
  9864. * host. Thus, any host-target communication supported by this field
  9865. * is limited to using values that are never used by the debug
  9866. * information stored by certain targets in the reserved_1 field.
  9867. * In particular, the targets in question don't use the value 0x3
  9868. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9869. * so this previously-unused value within these bits is available to
  9870. * use as the host / target PKT_CAPTURE_MODE flag.
  9871. */
  9872. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9873. /* if pkt_capture_mode == 0x3, host should
  9874. * send rx frames to monitor mode interface
  9875. */
  9876. msdu_cnt: 16;
  9877. };
  9878. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9879. {
  9880. A_UINT32 dma_addr;
  9881. A_UINT32
  9882. length: 16,
  9883. fw_desc: 8,
  9884. msdu_info:8;
  9885. };
  9886. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9887. {
  9888. A_UINT32 dma_addr_lo;
  9889. A_UINT32 dma_addr_hi;
  9890. A_UINT32
  9891. length: 16,
  9892. fw_desc: 8,
  9893. msdu_info:8;
  9894. };
  9895. #if HTT_PADDR64
  9896. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9897. #else
  9898. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9899. #endif
  9900. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9901. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9902. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9903. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9904. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9905. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9906. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9907. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9908. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9909. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9910. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9911. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9912. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9913. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9914. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9915. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9916. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9917. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9918. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9919. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9920. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9921. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9922. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9923. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9924. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9925. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9926. /* for systems using 64-bit format for bus addresses */
  9927. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9928. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9929. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9930. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9931. /* for systems using 32-bit format for bus addresses */
  9932. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9933. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9934. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9935. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9936. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9937. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9938. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9939. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9940. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9941. do { \
  9942. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9943. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9944. } while (0)
  9945. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9946. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9947. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9948. do { \
  9949. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9950. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9951. } while (0)
  9952. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9953. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9954. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9955. do { \
  9956. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9957. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9958. } while (0)
  9959. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9960. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9961. /*
  9962. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9963. * deliver the rx frames to the monitor mode interface.
  9964. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9965. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9966. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9967. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9968. */
  9969. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9970. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9971. do { \
  9972. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9973. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9974. } while (0)
  9975. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9976. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9977. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9978. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9979. do { \
  9980. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9981. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9982. } while (0)
  9983. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9984. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9985. /* for systems using 64-bit format for bus addresses */
  9986. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9987. do { \
  9988. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9989. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9990. } while (0)
  9991. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9992. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9993. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9994. do { \
  9995. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9996. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9997. } while (0)
  9998. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9999. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  10000. /* for systems using 32-bit format for bus addresses */
  10001. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  10002. do { \
  10003. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  10004. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  10005. } while (0)
  10006. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  10007. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  10008. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  10009. do { \
  10010. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  10011. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  10012. } while (0)
  10013. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  10014. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  10015. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  10016. do { \
  10017. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  10018. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  10019. } while (0)
  10020. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  10021. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  10022. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  10023. do { \
  10024. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  10025. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  10026. } while (0)
  10027. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  10028. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  10029. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  10030. do { \
  10031. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  10032. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  10033. } while (0)
  10034. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  10035. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  10036. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  10037. do { \
  10038. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  10039. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  10040. } while (0)
  10041. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  10042. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  10043. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  10044. do { \
  10045. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  10046. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  10047. } while (0)
  10048. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  10049. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  10050. /* definitions used within target -> host rx indication message */
  10051. PREPACK struct htt_rx_ind_hdr_prefix_t
  10052. {
  10053. A_UINT32 /* word 0 */
  10054. msg_type: 8,
  10055. ext_tid: 5,
  10056. release_valid: 1,
  10057. flush_valid: 1,
  10058. reserved0: 1,
  10059. peer_id: 16;
  10060. A_UINT32 /* word 1 */
  10061. flush_start_seq_num: 6,
  10062. flush_end_seq_num: 6,
  10063. release_start_seq_num: 6,
  10064. release_end_seq_num: 6,
  10065. num_mpdu_ranges: 8;
  10066. } POSTPACK;
  10067. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  10068. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  10069. #define HTT_TGT_RSSI_INVALID 0x80
  10070. PREPACK struct htt_rx_ppdu_desc_t
  10071. {
  10072. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  10073. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  10074. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  10075. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  10076. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  10077. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  10078. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  10079. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  10080. A_UINT32 /* word 0 */
  10081. rssi_cmb: 8,
  10082. timestamp_submicrosec: 8,
  10083. phy_err_code: 8,
  10084. phy_err: 1,
  10085. legacy_rate: 4,
  10086. legacy_rate_sel: 1,
  10087. end_valid: 1,
  10088. start_valid: 1;
  10089. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  10090. union {
  10091. A_UINT32 /* word 1 */
  10092. rssi0_pri20: 8,
  10093. rssi0_ext20: 8,
  10094. rssi0_ext40: 8,
  10095. rssi0_ext80: 8;
  10096. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  10097. } u0;
  10098. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  10099. union {
  10100. A_UINT32 /* word 2 */
  10101. rssi1_pri20: 8,
  10102. rssi1_ext20: 8,
  10103. rssi1_ext40: 8,
  10104. rssi1_ext80: 8;
  10105. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  10106. } u1;
  10107. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  10108. union {
  10109. A_UINT32 /* word 3 */
  10110. rssi2_pri20: 8,
  10111. rssi2_ext20: 8,
  10112. rssi2_ext40: 8,
  10113. rssi2_ext80: 8;
  10114. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  10115. } u2;
  10116. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  10117. union {
  10118. A_UINT32 /* word 4 */
  10119. rssi3_pri20: 8,
  10120. rssi3_ext20: 8,
  10121. rssi3_ext40: 8,
  10122. rssi3_ext80: 8;
  10123. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  10124. } u3;
  10125. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  10126. A_UINT32 tsf32; /* word 5 */
  10127. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  10128. A_UINT32 timestamp_microsec; /* word 6 */
  10129. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  10130. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  10131. A_UINT32 /* word 7 */
  10132. vht_sig_a1: 24,
  10133. preamble_type: 8;
  10134. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  10135. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  10136. A_UINT32 /* word 8 */
  10137. vht_sig_a2: 24,
  10138. /* sa_ant_matrix
  10139. * For cases where a single rx chain has options to be connected to
  10140. * different rx antennas, show which rx antennas were in use during
  10141. * receipt of a given PPDU.
  10142. * This sa_ant_matrix provides a bitmask of the antennas used while
  10143. * receiving this frame.
  10144. */
  10145. sa_ant_matrix: 8;
  10146. } POSTPACK;
  10147. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  10148. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  10149. PREPACK struct htt_rx_ind_hdr_suffix_t
  10150. {
  10151. A_UINT32 /* word 0 */
  10152. fw_rx_desc_bytes: 16,
  10153. reserved0: 16;
  10154. } POSTPACK;
  10155. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  10156. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  10157. PREPACK struct htt_rx_ind_hdr_t
  10158. {
  10159. struct htt_rx_ind_hdr_prefix_t prefix;
  10160. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  10161. struct htt_rx_ind_hdr_suffix_t suffix;
  10162. } POSTPACK;
  10163. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  10164. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  10165. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  10166. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  10167. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  10168. /*
  10169. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  10170. * the offset into the HTT rx indication message at which the
  10171. * FW rx PPDU descriptor resides
  10172. */
  10173. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  10174. /*
  10175. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  10176. * the offset into the HTT rx indication message at which the
  10177. * header suffix (FW rx MSDU byte count) resides
  10178. */
  10179. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  10180. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  10181. /*
  10182. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  10183. * the offset into the HTT rx indication message at which the per-MSDU
  10184. * information starts
  10185. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  10186. * per-MSDU information portion of the message. The per-MSDU info itself
  10187. * starts at byte 12.
  10188. */
  10189. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  10190. /**
  10191. * @brief target -> host rx indication message definition
  10192. *
  10193. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  10194. *
  10195. * @details
  10196. * The following field definitions describe the format of the rx indication
  10197. * message sent from the target to the host.
  10198. * The message consists of three major sections:
  10199. * 1. a fixed-length header
  10200. * 2. a variable-length list of firmware rx MSDU descriptors
  10201. * 3. one or more 4-octet MPDU range information elements
  10202. * The fixed length header itself has two sub-sections
  10203. * 1. the message meta-information, including identification of the
  10204. * sender and type of the received data, and a 4-octet flush/release IE
  10205. * 2. the firmware rx PPDU descriptor
  10206. *
  10207. * The format of the message is depicted below.
  10208. * in this depiction, the following abbreviations are used for information
  10209. * elements within the message:
  10210. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  10211. * elements associated with the PPDU start are valid.
  10212. * Specifically, the following fields are valid only if SV is set:
  10213. * RSSI (all variants), L, legacy rate, preamble type, service,
  10214. * VHT-SIG-A
  10215. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  10216. * elements associated with the PPDU end are valid.
  10217. * Specifically, the following fields are valid only if EV is set:
  10218. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  10219. * - L - Legacy rate selector - if legacy rates are used, this flag
  10220. * indicates whether the rate is from a CCK (L == 1) or OFDM
  10221. * (L == 0) PHY.
  10222. * - P - PHY error flag - boolean indication of whether the rx frame had
  10223. * a PHY error
  10224. *
  10225. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  10226. * |----------------+-------------------+---------------------+---------------|
  10227. * | peer ID | |RV|FV| ext TID | msg type |
  10228. * |--------------------------------------------------------------------------|
  10229. * | num | release | release | flush | flush |
  10230. * | MPDU | end | start | end | start |
  10231. * | ranges | seq num | seq num | seq num | seq num |
  10232. * |==========================================================================|
  10233. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  10234. * |V|V| | rate | | | timestamp | RSSI |
  10235. * |--------------------------------------------------------------------------|
  10236. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  10237. * |--------------------------------------------------------------------------|
  10238. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  10239. * |--------------------------------------------------------------------------|
  10240. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  10241. * |--------------------------------------------------------------------------|
  10242. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  10243. * |--------------------------------------------------------------------------|
  10244. * | TSF LSBs |
  10245. * |--------------------------------------------------------------------------|
  10246. * | microsec timestamp |
  10247. * |--------------------------------------------------------------------------|
  10248. * | preamble type | HT-SIG / VHT-SIG-A1 |
  10249. * |--------------------------------------------------------------------------|
  10250. * | service | HT-SIG / VHT-SIG-A2 |
  10251. * |==========================================================================|
  10252. * | reserved | FW rx desc bytes |
  10253. * |--------------------------------------------------------------------------|
  10254. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  10255. * | desc B3 | desc B2 | desc B1 | desc B0 |
  10256. * |--------------------------------------------------------------------------|
  10257. * : : :
  10258. * |--------------------------------------------------------------------------|
  10259. * | alignment | MSDU Rx |
  10260. * | padding | desc Bn |
  10261. * |--------------------------------------------------------------------------|
  10262. * | reserved | MPDU range status | MPDU count |
  10263. * |--------------------------------------------------------------------------|
  10264. * : reserved : MPDU range status : MPDU count :
  10265. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  10266. *
  10267. * Header fields:
  10268. * - MSG_TYPE
  10269. * Bits 7:0
  10270. * Purpose: identifies this as an rx indication message
  10271. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  10272. * - EXT_TID
  10273. * Bits 12:8
  10274. * Purpose: identify the traffic ID of the rx data, including
  10275. * special "extended" TID values for multicast, broadcast, and
  10276. * non-QoS data frames
  10277. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  10278. * - FLUSH_VALID (FV)
  10279. * Bit 13
  10280. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  10281. * is valid
  10282. * Value:
  10283. * 1 -> flush IE is valid and needs to be processed
  10284. * 0 -> flush IE is not valid and should be ignored
  10285. * - REL_VALID (RV)
  10286. * Bit 13
  10287. * Purpose: indicate whether the release IE (start/end sequence numbers)
  10288. * is valid
  10289. * Value:
  10290. * 1 -> release IE is valid and needs to be processed
  10291. * 0 -> release IE is not valid and should be ignored
  10292. * - PEER_ID
  10293. * Bits 31:16
  10294. * Purpose: Identify, by ID, which peer sent the rx data
  10295. * Value: ID of the peer who sent the rx data
  10296. * - FLUSH_SEQ_NUM_START
  10297. * Bits 5:0
  10298. * Purpose: Indicate the start of a series of MPDUs to flush
  10299. * Not all MPDUs within this series are necessarily valid - the host
  10300. * must check each sequence number within this range to see if the
  10301. * corresponding MPDU is actually present.
  10302. * This field is only valid if the FV bit is set.
  10303. * Value:
  10304. * The sequence number for the first MPDUs to check to flush.
  10305. * The sequence number is masked by 0x3f.
  10306. * - FLUSH_SEQ_NUM_END
  10307. * Bits 11:6
  10308. * Purpose: Indicate the end of a series of MPDUs to flush
  10309. * Value:
  10310. * The sequence number one larger than the sequence number of the
  10311. * last MPDU to check to flush.
  10312. * The sequence number is masked by 0x3f.
  10313. * Not all MPDUs within this series are necessarily valid - the host
  10314. * must check each sequence number within this range to see if the
  10315. * corresponding MPDU is actually present.
  10316. * This field is only valid if the FV bit is set.
  10317. * - REL_SEQ_NUM_START
  10318. * Bits 17:12
  10319. * Purpose: Indicate the start of a series of MPDUs to release.
  10320. * All MPDUs within this series are present and valid - the host
  10321. * need not check each sequence number within this range to see if
  10322. * the corresponding MPDU is actually present.
  10323. * This field is only valid if the RV bit is set.
  10324. * Value:
  10325. * The sequence number for the first MPDUs to check to release.
  10326. * The sequence number is masked by 0x3f.
  10327. * - REL_SEQ_NUM_END
  10328. * Bits 23:18
  10329. * Purpose: Indicate the end of a series of MPDUs to release.
  10330. * Value:
  10331. * The sequence number one larger than the sequence number of the
  10332. * last MPDU to check to release.
  10333. * The sequence number is masked by 0x3f.
  10334. * All MPDUs within this series are present and valid - the host
  10335. * need not check each sequence number within this range to see if
  10336. * the corresponding MPDU is actually present.
  10337. * This field is only valid if the RV bit is set.
  10338. * - NUM_MPDU_RANGES
  10339. * Bits 31:24
  10340. * Purpose: Indicate how many ranges of MPDUs are present.
  10341. * Each MPDU range consists of a series of contiguous MPDUs within the
  10342. * rx frame sequence which all have the same MPDU status.
  10343. * Value: 1-63 (typically a small number, like 1-3)
  10344. *
  10345. * Rx PPDU descriptor fields:
  10346. * - RSSI_CMB
  10347. * Bits 7:0
  10348. * Purpose: Combined RSSI from all active rx chains, across the active
  10349. * bandwidth.
  10350. * Value: RSSI dB units w.r.t. noise floor
  10351. * - TIMESTAMP_SUBMICROSEC
  10352. * Bits 15:8
  10353. * Purpose: high-resolution timestamp
  10354. * Value:
  10355. * Sub-microsecond time of PPDU reception.
  10356. * This timestamp ranges from [0,MAC clock MHz).
  10357. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  10358. * to form a high-resolution, large range rx timestamp.
  10359. * - PHY_ERR_CODE
  10360. * Bits 23:16
  10361. * Purpose:
  10362. * If the rx frame processing resulted in a PHY error, indicate what
  10363. * type of rx PHY error occurred.
  10364. * Value:
  10365. * This field is valid if the "P" (PHY_ERR) flag is set.
  10366. * TBD: document/specify the values for this field
  10367. * - PHY_ERR
  10368. * Bit 24
  10369. * Purpose: indicate whether the rx PPDU had a PHY error
  10370. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  10371. * - LEGACY_RATE
  10372. * Bits 28:25
  10373. * Purpose:
  10374. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  10375. * specify which rate was used.
  10376. * Value:
  10377. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  10378. * flag.
  10379. * If LEGACY_RATE_SEL is 0:
  10380. * 0x8: OFDM 48 Mbps
  10381. * 0x9: OFDM 24 Mbps
  10382. * 0xA: OFDM 12 Mbps
  10383. * 0xB: OFDM 6 Mbps
  10384. * 0xC: OFDM 54 Mbps
  10385. * 0xD: OFDM 36 Mbps
  10386. * 0xE: OFDM 18 Mbps
  10387. * 0xF: OFDM 9 Mbps
  10388. * If LEGACY_RATE_SEL is 1:
  10389. * 0x8: CCK 11 Mbps long preamble
  10390. * 0x9: CCK 5.5 Mbps long preamble
  10391. * 0xA: CCK 2 Mbps long preamble
  10392. * 0xB: CCK 1 Mbps long preamble
  10393. * 0xC: CCK 11 Mbps short preamble
  10394. * 0xD: CCK 5.5 Mbps short preamble
  10395. * 0xE: CCK 2 Mbps short preamble
  10396. * - LEGACY_RATE_SEL
  10397. * Bit 29
  10398. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  10399. * Value:
  10400. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  10401. * used a legacy rate.
  10402. * 0 -> OFDM, 1 -> CCK
  10403. * - END_VALID
  10404. * Bit 30
  10405. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10406. * the start of the PPDU are valid. Specifically, the following
  10407. * fields are only valid if END_VALID is set:
  10408. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  10409. * TIMESTAMP_SUBMICROSEC
  10410. * Value:
  10411. * 0 -> rx PPDU desc end fields are not valid
  10412. * 1 -> rx PPDU desc end fields are valid
  10413. * - START_VALID
  10414. * Bit 31
  10415. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  10416. * the end of the PPDU are valid. Specifically, the following
  10417. * fields are only valid if START_VALID is set:
  10418. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  10419. * VHT-SIG-A
  10420. * Value:
  10421. * 0 -> rx PPDU desc start fields are not valid
  10422. * 1 -> rx PPDU desc start fields are valid
  10423. * - RSSI0_PRI20
  10424. * Bits 7:0
  10425. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  10426. * Value: RSSI dB units w.r.t. noise floor
  10427. *
  10428. * - RSSI0_EXT20
  10429. * Bits 7:0
  10430. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  10431. * (if the rx bandwidth was >= 40 MHz)
  10432. * Value: RSSI dB units w.r.t. noise floor
  10433. * - RSSI0_EXT40
  10434. * Bits 7:0
  10435. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  10436. * (if the rx bandwidth was >= 80 MHz)
  10437. * Value: RSSI dB units w.r.t. noise floor
  10438. * - RSSI0_EXT80
  10439. * Bits 7:0
  10440. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  10441. * (if the rx bandwidth was >= 160 MHz)
  10442. * Value: RSSI dB units w.r.t. noise floor
  10443. *
  10444. * - RSSI1_PRI20
  10445. * Bits 7:0
  10446. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  10447. * Value: RSSI dB units w.r.t. noise floor
  10448. * - RSSI1_EXT20
  10449. * Bits 7:0
  10450. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  10451. * (if the rx bandwidth was >= 40 MHz)
  10452. * Value: RSSI dB units w.r.t. noise floor
  10453. * - RSSI1_EXT40
  10454. * Bits 7:0
  10455. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  10456. * (if the rx bandwidth was >= 80 MHz)
  10457. * Value: RSSI dB units w.r.t. noise floor
  10458. * - RSSI1_EXT80
  10459. * Bits 7:0
  10460. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  10461. * (if the rx bandwidth was >= 160 MHz)
  10462. * Value: RSSI dB units w.r.t. noise floor
  10463. *
  10464. * - RSSI2_PRI20
  10465. * Bits 7:0
  10466. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  10467. * Value: RSSI dB units w.r.t. noise floor
  10468. * - RSSI2_EXT20
  10469. * Bits 7:0
  10470. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  10471. * (if the rx bandwidth was >= 40 MHz)
  10472. * Value: RSSI dB units w.r.t. noise floor
  10473. * - RSSI2_EXT40
  10474. * Bits 7:0
  10475. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  10476. * (if the rx bandwidth was >= 80 MHz)
  10477. * Value: RSSI dB units w.r.t. noise floor
  10478. * - RSSI2_EXT80
  10479. * Bits 7:0
  10480. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  10481. * (if the rx bandwidth was >= 160 MHz)
  10482. * Value: RSSI dB units w.r.t. noise floor
  10483. *
  10484. * - RSSI3_PRI20
  10485. * Bits 7:0
  10486. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  10487. * Value: RSSI dB units w.r.t. noise floor
  10488. * - RSSI3_EXT20
  10489. * Bits 7:0
  10490. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  10491. * (if the rx bandwidth was >= 40 MHz)
  10492. * Value: RSSI dB units w.r.t. noise floor
  10493. * - RSSI3_EXT40
  10494. * Bits 7:0
  10495. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  10496. * (if the rx bandwidth was >= 80 MHz)
  10497. * Value: RSSI dB units w.r.t. noise floor
  10498. * - RSSI3_EXT80
  10499. * Bits 7:0
  10500. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  10501. * (if the rx bandwidth was >= 160 MHz)
  10502. * Value: RSSI dB units w.r.t. noise floor
  10503. *
  10504. * - TSF32
  10505. * Bits 31:0
  10506. * Purpose: specify the time the rx PPDU was received, in TSF units
  10507. * Value: 32 LSBs of the TSF
  10508. * - TIMESTAMP_MICROSEC
  10509. * Bits 31:0
  10510. * Purpose: specify the time the rx PPDU was received, in microsecond units
  10511. * Value: PPDU rx time, in microseconds
  10512. * - VHT_SIG_A1
  10513. * Bits 23:0
  10514. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  10515. * from the rx PPDU
  10516. * Value:
  10517. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10518. * VHT-SIG-A1 data.
  10519. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10520. * first 24 bits of the HT-SIG data.
  10521. * Otherwise, this field is invalid.
  10522. * Refer to the the 802.11 protocol for the definition of the
  10523. * HT-SIG and VHT-SIG-A1 fields
  10524. * - VHT_SIG_A2
  10525. * Bits 23:0
  10526. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  10527. * from the rx PPDU
  10528. * Value:
  10529. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  10530. * VHT-SIG-A2 data.
  10531. * If PREAMBLE_TYPE specifies HT, then this field contains the
  10532. * last 24 bits of the HT-SIG data.
  10533. * Otherwise, this field is invalid.
  10534. * Refer to the the 802.11 protocol for the definition of the
  10535. * HT-SIG and VHT-SIG-A2 fields
  10536. * - PREAMBLE_TYPE
  10537. * Bits 31:24
  10538. * Purpose: indicate the PHY format of the received burst
  10539. * Value:
  10540. * 0x4: Legacy (OFDM/CCK)
  10541. * 0x8: HT
  10542. * 0x9: HT with TxBF
  10543. * 0xC: VHT
  10544. * 0xD: VHT with TxBF
  10545. * - SERVICE
  10546. * Bits 31:24
  10547. * Purpose: TBD
  10548. * Value: TBD
  10549. *
  10550. * Rx MSDU descriptor fields:
  10551. * - FW_RX_DESC_BYTES
  10552. * Bits 15:0
  10553. * Purpose: Indicate how many bytes in the Rx indication are used for
  10554. * FW Rx descriptors
  10555. *
  10556. * Payload fields:
  10557. * - MPDU_COUNT
  10558. * Bits 7:0
  10559. * Purpose: Indicate how many sequential MPDUs share the same status.
  10560. * All MPDUs within the indicated list are from the same RA-TA-TID.
  10561. * - MPDU_STATUS
  10562. * Bits 15:8
  10563. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  10564. * received successfully.
  10565. * Value:
  10566. * 0x1: success
  10567. * 0x2: FCS error
  10568. * 0x3: duplicate error
  10569. * 0x4: replay error
  10570. * 0x5: invalid peer
  10571. */
  10572. /* header fields */
  10573. #define HTT_RX_IND_EXT_TID_M 0x1f00
  10574. #define HTT_RX_IND_EXT_TID_S 8
  10575. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  10576. #define HTT_RX_IND_FLUSH_VALID_S 13
  10577. #define HTT_RX_IND_REL_VALID_M 0x4000
  10578. #define HTT_RX_IND_REL_VALID_S 14
  10579. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  10580. #define HTT_RX_IND_PEER_ID_S 16
  10581. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  10582. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  10583. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  10584. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  10585. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  10586. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  10587. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  10588. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  10589. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  10590. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  10591. /* rx PPDU descriptor fields */
  10592. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  10593. #define HTT_RX_IND_RSSI_CMB_S 0
  10594. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  10595. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  10596. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  10597. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  10598. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  10599. #define HTT_RX_IND_PHY_ERR_S 24
  10600. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  10601. #define HTT_RX_IND_LEGACY_RATE_S 25
  10602. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  10603. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  10604. #define HTT_RX_IND_END_VALID_M 0x40000000
  10605. #define HTT_RX_IND_END_VALID_S 30
  10606. #define HTT_RX_IND_START_VALID_M 0x80000000
  10607. #define HTT_RX_IND_START_VALID_S 31
  10608. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  10609. #define HTT_RX_IND_RSSI_PRI20_S 0
  10610. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  10611. #define HTT_RX_IND_RSSI_EXT20_S 8
  10612. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  10613. #define HTT_RX_IND_RSSI_EXT40_S 16
  10614. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  10615. #define HTT_RX_IND_RSSI_EXT80_S 24
  10616. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  10617. #define HTT_RX_IND_VHT_SIG_A1_S 0
  10618. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  10619. #define HTT_RX_IND_VHT_SIG_A2_S 0
  10620. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  10621. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  10622. #define HTT_RX_IND_SERVICE_M 0xff000000
  10623. #define HTT_RX_IND_SERVICE_S 24
  10624. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  10625. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  10626. /* rx MSDU descriptor fields */
  10627. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  10628. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  10629. /* payload fields */
  10630. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  10631. #define HTT_RX_IND_MPDU_COUNT_S 0
  10632. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  10633. #define HTT_RX_IND_MPDU_STATUS_S 8
  10634. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  10635. do { \
  10636. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  10637. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  10638. } while (0)
  10639. #define HTT_RX_IND_EXT_TID_GET(word) \
  10640. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  10641. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  10642. do { \
  10643. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  10644. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  10645. } while (0)
  10646. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  10647. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  10648. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  10649. do { \
  10650. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  10651. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  10652. } while (0)
  10653. #define HTT_RX_IND_REL_VALID_GET(word) \
  10654. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  10655. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  10656. do { \
  10657. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  10658. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  10659. } while (0)
  10660. #define HTT_RX_IND_PEER_ID_GET(word) \
  10661. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  10662. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  10663. do { \
  10664. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  10665. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  10666. } while (0)
  10667. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  10668. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  10669. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  10670. do { \
  10671. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  10672. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  10673. } while (0)
  10674. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  10675. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  10676. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  10677. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  10678. do { \
  10679. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  10680. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  10681. } while (0)
  10682. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  10683. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  10684. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  10685. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  10686. do { \
  10687. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  10688. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  10689. } while (0)
  10690. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  10691. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  10692. HTT_RX_IND_REL_SEQ_NUM_START_S)
  10693. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  10694. do { \
  10695. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  10696. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  10697. } while (0)
  10698. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  10699. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  10700. HTT_RX_IND_REL_SEQ_NUM_END_S)
  10701. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  10702. do { \
  10703. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  10704. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  10705. } while (0)
  10706. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  10707. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  10708. HTT_RX_IND_NUM_MPDU_RANGES_S)
  10709. /* FW rx PPDU descriptor fields */
  10710. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  10711. do { \
  10712. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10713. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10714. } while (0)
  10715. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10716. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10717. HTT_RX_IND_RSSI_CMB_S)
  10718. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10719. do { \
  10720. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10721. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10722. } while (0)
  10723. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10724. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10725. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10726. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10727. do { \
  10728. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10729. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10730. } while (0)
  10731. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10732. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10733. HTT_RX_IND_PHY_ERR_CODE_S)
  10734. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10735. do { \
  10736. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10737. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10738. } while (0)
  10739. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10740. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10741. HTT_RX_IND_PHY_ERR_S)
  10742. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10743. do { \
  10744. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10745. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10746. } while (0)
  10747. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10748. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10749. HTT_RX_IND_LEGACY_RATE_S)
  10750. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10751. do { \
  10752. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10753. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10754. } while (0)
  10755. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10756. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10757. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10758. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10759. do { \
  10760. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10761. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10762. } while (0)
  10763. #define HTT_RX_IND_END_VALID_GET(word) \
  10764. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10765. HTT_RX_IND_END_VALID_S)
  10766. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10767. do { \
  10768. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10769. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10770. } while (0)
  10771. #define HTT_RX_IND_START_VALID_GET(word) \
  10772. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10773. HTT_RX_IND_START_VALID_S)
  10774. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10775. do { \
  10776. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10777. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10778. } while (0)
  10779. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10780. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10781. HTT_RX_IND_RSSI_PRI20_S)
  10782. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10783. do { \
  10784. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10785. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10786. } while (0)
  10787. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10788. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10789. HTT_RX_IND_RSSI_EXT20_S)
  10790. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10791. do { \
  10792. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10793. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10794. } while (0)
  10795. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10796. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10797. HTT_RX_IND_RSSI_EXT40_S)
  10798. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10799. do { \
  10800. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10801. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10802. } while (0)
  10803. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10804. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10805. HTT_RX_IND_RSSI_EXT80_S)
  10806. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10807. do { \
  10808. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10809. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10810. } while (0)
  10811. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10812. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10813. HTT_RX_IND_VHT_SIG_A1_S)
  10814. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10815. do { \
  10816. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10817. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10818. } while (0)
  10819. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10820. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10821. HTT_RX_IND_VHT_SIG_A2_S)
  10822. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10823. do { \
  10824. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10825. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10826. } while (0)
  10827. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10828. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10829. HTT_RX_IND_PREAMBLE_TYPE_S)
  10830. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10831. do { \
  10832. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10833. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10834. } while (0)
  10835. #define HTT_RX_IND_SERVICE_GET(word) \
  10836. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10837. HTT_RX_IND_SERVICE_S)
  10838. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10839. do { \
  10840. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10841. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10842. } while (0)
  10843. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10844. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10845. HTT_RX_IND_SA_ANT_MATRIX_S)
  10846. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10847. do { \
  10848. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10849. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10850. } while (0)
  10851. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10852. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10853. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10854. do { \
  10855. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10856. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10857. } while (0)
  10858. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10859. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10860. #define HTT_RX_IND_HL_BYTES \
  10861. (HTT_RX_IND_HDR_BYTES + \
  10862. 4 /* single FW rx MSDU descriptor */ + \
  10863. 4 /* single MPDU range information element */)
  10864. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10865. /* Could we use one macro entry? */
  10866. #define HTT_WORD_SET(word, field, value) \
  10867. do { \
  10868. HTT_CHECK_SET_VAL(field, value); \
  10869. (word) |= ((value) << field ## _S); \
  10870. } while (0)
  10871. #define HTT_WORD_GET(word, field) \
  10872. (((word) & field ## _M) >> field ## _S)
  10873. PREPACK struct hl_htt_rx_ind_base {
  10874. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10875. } POSTPACK;
  10876. /*
  10877. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10878. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10879. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10880. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10881. * htt_rx_ind_hl_rx_desc_t.
  10882. */
  10883. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10884. struct htt_rx_ind_hl_rx_desc_t {
  10885. A_UINT8 ver;
  10886. A_UINT8 len;
  10887. struct {
  10888. A_UINT8
  10889. first_msdu: 1,
  10890. last_msdu: 1,
  10891. c3_failed: 1,
  10892. c4_failed: 1,
  10893. ipv6: 1,
  10894. tcp: 1,
  10895. udp: 1,
  10896. reserved: 1;
  10897. } flags;
  10898. /* NOTE: no reserved space - don't append any new fields here */
  10899. };
  10900. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10901. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10902. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10903. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10904. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10905. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10906. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10907. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10908. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10909. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10910. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10911. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10912. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10913. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10914. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10915. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10916. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10917. /* This structure is used in HL, the basic descriptor information
  10918. * used by host. the structure is translated by FW from HW desc
  10919. * or generated by FW. But in HL monitor mode, the host would use
  10920. * the same structure with LL.
  10921. */
  10922. PREPACK struct hl_htt_rx_desc_base {
  10923. A_UINT32
  10924. seq_num:12,
  10925. encrypted:1,
  10926. chan_info_present:1,
  10927. resv0:2,
  10928. mcast_bcast:1,
  10929. fragment:1,
  10930. key_id_oct:8,
  10931. resv1:6;
  10932. A_UINT32
  10933. pn_31_0;
  10934. union {
  10935. struct {
  10936. A_UINT16 pn_47_32;
  10937. A_UINT16 pn_63_48;
  10938. } pn16;
  10939. A_UINT32 pn_63_32;
  10940. } u0;
  10941. A_UINT32
  10942. pn_95_64;
  10943. A_UINT32
  10944. pn_127_96;
  10945. } POSTPACK;
  10946. /*
  10947. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10948. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10949. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10950. * Please see htt_chan_change_t for description of the fields.
  10951. */
  10952. PREPACK struct htt_chan_info_t
  10953. {
  10954. A_UINT32 primary_chan_center_freq_mhz: 16,
  10955. contig_chan1_center_freq_mhz: 16;
  10956. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10957. phy_mode: 8,
  10958. reserved: 8;
  10959. } POSTPACK;
  10960. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10961. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10962. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10963. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10964. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10965. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10966. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10967. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10968. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10969. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10970. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10971. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10972. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10973. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10974. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10975. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10976. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10977. /* Channel information */
  10978. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10979. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10980. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10981. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10982. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10983. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10984. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10985. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10986. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10987. do { \
  10988. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10989. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10990. } while (0)
  10991. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10992. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10993. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10994. do { \
  10995. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10996. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10997. } while (0)
  10998. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10999. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  11000. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  11001. do { \
  11002. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  11003. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  11004. } while (0)
  11005. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  11006. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  11007. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  11008. do { \
  11009. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  11010. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  11011. } while (0)
  11012. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  11013. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  11014. /*
  11015. * @brief target -> host message definition for FW offloaded pkts
  11016. *
  11017. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  11018. *
  11019. * @details
  11020. * The following field definitions describe the format of the firmware
  11021. * offload deliver message sent from the target to the host.
  11022. *
  11023. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  11024. *
  11025. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  11026. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  11027. * | reserved_1 | msg type |
  11028. * |--------------------------------------------------------------------------|
  11029. * | phy_timestamp_l32 |
  11030. * |--------------------------------------------------------------------------|
  11031. * | WORD2 (see below) |
  11032. * |--------------------------------------------------------------------------|
  11033. * | seqno | framectrl |
  11034. * |--------------------------------------------------------------------------|
  11035. * | reserved_3 | vdev_id | tid_num|
  11036. * |--------------------------------------------------------------------------|
  11037. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  11038. * |--------------------------------------------------------------------------|
  11039. *
  11040. * where:
  11041. * STAT = status
  11042. * F = format (802.3 vs. 802.11)
  11043. *
  11044. * definition for word 2
  11045. *
  11046. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  11047. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  11048. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  11049. * |--------------------------------------------------------------------------|
  11050. *
  11051. * where:
  11052. * PR = preamble
  11053. * BF = beamformed
  11054. */
  11055. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  11056. {
  11057. A_UINT32 /* word 0 */
  11058. msg_type:8, /* [ 7: 0] */
  11059. reserved_1:24; /* [31: 8] */
  11060. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  11061. A_UINT32 /* word 2 */
  11062. /* preamble:
  11063. * 0-OFDM,
  11064. * 1-CCk,
  11065. * 2-HT,
  11066. * 3-VHT
  11067. */
  11068. preamble: 2, /* [1:0] */
  11069. /* mcs:
  11070. * In case of HT preamble interpret
  11071. * MCS along with NSS.
  11072. * Valid values for HT are 0 to 7.
  11073. * HT mcs 0 with NSS 2 is mcs 8.
  11074. * Valid values for VHT are 0 to 9.
  11075. */
  11076. mcs: 4, /* [5:2] */
  11077. /* rate:
  11078. * This is applicable only for
  11079. * CCK and OFDM preamble type
  11080. * rate 0: OFDM 48 Mbps,
  11081. * 1: OFDM 24 Mbps,
  11082. * 2: OFDM 12 Mbps
  11083. * 3: OFDM 6 Mbps
  11084. * 4: OFDM 54 Mbps
  11085. * 5: OFDM 36 Mbps
  11086. * 6: OFDM 18 Mbps
  11087. * 7: OFDM 9 Mbps
  11088. * rate 0: CCK 11 Mbps Long
  11089. * 1: CCK 5.5 Mbps Long
  11090. * 2: CCK 2 Mbps Long
  11091. * 3: CCK 1 Mbps Long
  11092. * 4: CCK 11 Mbps Short
  11093. * 5: CCK 5.5 Mbps Short
  11094. * 6: CCK 2 Mbps Short
  11095. */
  11096. rate : 3, /* [ 8: 6] */
  11097. rssi : 8, /* [16: 9] units=dBm */
  11098. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11099. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11100. stbc : 1, /* [22] */
  11101. sgi : 1, /* [23] */
  11102. ldpc : 1, /* [24] */
  11103. beamformed: 1, /* [25] */
  11104. reserved_2: 6; /* [31:26] */
  11105. A_UINT32 /* word 3 */
  11106. framectrl:16, /* [15: 0] */
  11107. seqno:16; /* [31:16] */
  11108. A_UINT32 /* word 4 */
  11109. tid_num:5, /* [ 4: 0] actual TID number */
  11110. vdev_id:8, /* [12: 5] */
  11111. reserved_3:19; /* [31:13] */
  11112. A_UINT32 /* word 5 */
  11113. /* status:
  11114. * 0: tx_ok
  11115. * 1: retry
  11116. * 2: drop
  11117. * 3: filtered
  11118. * 4: abort
  11119. * 5: tid delete
  11120. * 6: sw abort
  11121. * 7: dropped by peer migration
  11122. */
  11123. status:3, /* [2:0] */
  11124. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  11125. tx_mpdu_bytes:16, /* [19:4] */
  11126. /* Indicates retry count of offloaded/local generated Data tx frames */
  11127. tx_retry_cnt:6, /* [25:20] */
  11128. reserved_4:6; /* [31:26] */
  11129. } POSTPACK;
  11130. /* FW offload deliver ind message header fields */
  11131. /* DWORD one */
  11132. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  11133. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  11134. /* DWORD two */
  11135. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  11136. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  11137. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  11138. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  11139. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  11140. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  11141. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  11142. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  11143. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  11144. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  11145. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  11146. #define HTT_FW_OFFLOAD_IND_BW_S 19
  11147. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  11148. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  11149. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  11150. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  11151. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  11152. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  11153. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  11154. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  11155. /* DWORD three*/
  11156. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  11157. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  11158. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  11159. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  11160. /* DWORD four */
  11161. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  11162. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  11163. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  11164. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  11165. /* DWORD five */
  11166. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  11167. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  11168. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  11169. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  11170. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  11171. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  11172. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  11173. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  11174. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  11175. do { \
  11176. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  11177. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  11178. } while (0)
  11179. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  11180. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  11181. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  11182. do { \
  11183. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  11184. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  11185. } while (0)
  11186. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  11187. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  11188. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  11189. do { \
  11190. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  11191. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  11192. } while (0)
  11193. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  11194. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  11195. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  11196. do { \
  11197. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  11198. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  11199. } while (0)
  11200. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  11201. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  11202. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  11203. do { \
  11204. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  11205. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  11206. } while (0)
  11207. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  11208. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  11209. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  11210. do { \
  11211. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  11212. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  11213. } while (0)
  11214. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  11215. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  11216. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  11217. do { \
  11218. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  11219. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  11220. } while (0)
  11221. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  11222. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  11223. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  11224. do { \
  11225. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  11226. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  11227. } while (0)
  11228. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  11229. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  11230. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  11231. do { \
  11232. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  11233. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  11234. } while (0)
  11235. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  11236. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  11237. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  11238. do { \
  11239. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  11240. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  11241. } while (0)
  11242. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  11243. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  11244. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  11245. do { \
  11246. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  11247. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  11248. } while (0)
  11249. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  11250. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  11251. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  11252. do { \
  11253. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  11254. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  11255. } while (0)
  11256. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  11257. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  11258. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  11259. do { \
  11260. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  11261. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  11262. } while (0)
  11263. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  11264. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  11265. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  11266. do { \
  11267. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  11268. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  11269. } while (0)
  11270. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  11271. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  11272. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  11273. do { \
  11274. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  11275. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  11276. } while (0)
  11277. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  11278. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  11279. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  11280. do { \
  11281. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  11282. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  11283. } while (0)
  11284. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  11285. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  11286. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  11287. do { \
  11288. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  11289. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  11290. } while (0)
  11291. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  11292. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  11293. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  11294. do { \
  11295. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  11296. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  11297. } while (0)
  11298. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  11299. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  11300. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  11301. do { \
  11302. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  11303. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  11304. } while (0)
  11305. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  11306. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  11307. /*
  11308. * @brief target -> host rx reorder flush message definition
  11309. *
  11310. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  11311. *
  11312. * @details
  11313. * The following field definitions describe the format of the rx flush
  11314. * message sent from the target to the host.
  11315. * The message consists of a 4-octet header, followed by one or more
  11316. * 4-octet payload information elements.
  11317. *
  11318. * |31 24|23 8|7 0|
  11319. * |--------------------------------------------------------------|
  11320. * | TID | peer ID | msg type |
  11321. * |--------------------------------------------------------------|
  11322. * | seq num end | seq num start | MPDU status | reserved |
  11323. * |--------------------------------------------------------------|
  11324. * First DWORD:
  11325. * - MSG_TYPE
  11326. * Bits 7:0
  11327. * Purpose: identifies this as an rx flush message
  11328. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  11329. * - PEER_ID
  11330. * Bits 23:8 (only bits 18:8 actually used)
  11331. * Purpose: identify which peer's rx data is being flushed
  11332. * Value: (rx) peer ID
  11333. * - TID
  11334. * Bits 31:24 (only bits 27:24 actually used)
  11335. * Purpose: Specifies which traffic identifier's rx data is being flushed
  11336. * Value: traffic identifier
  11337. * Second DWORD:
  11338. * - MPDU_STATUS
  11339. * Bits 15:8
  11340. * Purpose:
  11341. * Indicate whether the flushed MPDUs should be discarded or processed.
  11342. * Value:
  11343. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  11344. * stages of rx processing
  11345. * other: discard the MPDUs
  11346. * It is anticipated that flush messages will always have
  11347. * MPDU status == 1, but the status flag is included for
  11348. * flexibility.
  11349. * - SEQ_NUM_START
  11350. * Bits 23:16
  11351. * Purpose:
  11352. * Indicate the start of a series of consecutive MPDUs being flushed.
  11353. * Not all MPDUs within this range are necessarily valid - the host
  11354. * must check each sequence number within this range to see if the
  11355. * corresponding MPDU is actually present.
  11356. * Value:
  11357. * The sequence number for the first MPDU in the sequence.
  11358. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11359. * - SEQ_NUM_END
  11360. * Bits 30:24
  11361. * Purpose:
  11362. * Indicate the end of a series of consecutive MPDUs being flushed.
  11363. * Value:
  11364. * The sequence number one larger than the sequence number of the
  11365. * last MPDU being flushed.
  11366. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11367. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  11368. * are to be released for further rx processing.
  11369. * Not all MPDUs within this range are necessarily valid - the host
  11370. * must check each sequence number within this range to see if the
  11371. * corresponding MPDU is actually present.
  11372. */
  11373. /* first DWORD */
  11374. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  11375. #define HTT_RX_FLUSH_PEER_ID_S 8
  11376. #define HTT_RX_FLUSH_TID_M 0xff000000
  11377. #define HTT_RX_FLUSH_TID_S 24
  11378. /* second DWORD */
  11379. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  11380. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  11381. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  11382. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  11383. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  11384. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  11385. #define HTT_RX_FLUSH_BYTES 8
  11386. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  11387. do { \
  11388. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  11389. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  11390. } while (0)
  11391. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  11392. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  11393. #define HTT_RX_FLUSH_TID_SET(word, value) \
  11394. do { \
  11395. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  11396. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  11397. } while (0)
  11398. #define HTT_RX_FLUSH_TID_GET(word) \
  11399. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  11400. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  11401. do { \
  11402. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  11403. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  11404. } while (0)
  11405. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  11406. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  11407. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  11408. do { \
  11409. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  11410. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  11411. } while (0)
  11412. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  11413. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  11414. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  11415. do { \
  11416. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  11417. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  11418. } while (0)
  11419. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  11420. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  11421. /*
  11422. * @brief target -> host rx pn check indication message
  11423. *
  11424. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  11425. *
  11426. * @details
  11427. * The following field definitions describe the format of the Rx PN check
  11428. * indication message sent from the target to the host.
  11429. * The message consists of a 4-octet header, followed by the start and
  11430. * end sequence numbers to be released, followed by the PN IEs. Each PN
  11431. * IE is one octet containing the sequence number that failed the PN
  11432. * check.
  11433. *
  11434. * |31 24|23 8|7 0|
  11435. * |--------------------------------------------------------------|
  11436. * | TID | peer ID | msg type |
  11437. * |--------------------------------------------------------------|
  11438. * | Reserved | PN IE count | seq num end | seq num start|
  11439. * |--------------------------------------------------------------|
  11440. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  11441. * |--------------------------------------------------------------|
  11442. * First DWORD:
  11443. * - MSG_TYPE
  11444. * Bits 7:0
  11445. * Purpose: Identifies this as an rx pn check indication message
  11446. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  11447. * - PEER_ID
  11448. * Bits 23:8 (only bits 18:8 actually used)
  11449. * Purpose: identify which peer
  11450. * Value: (rx) peer ID
  11451. * - TID
  11452. * Bits 31:24 (only bits 27:24 actually used)
  11453. * Purpose: identify traffic identifier
  11454. * Value: traffic identifier
  11455. * Second DWORD:
  11456. * - SEQ_NUM_START
  11457. * Bits 7:0
  11458. * Purpose:
  11459. * Indicates the starting sequence number of the MPDU in this
  11460. * series of MPDUs that went though PN check.
  11461. * Value:
  11462. * The sequence number for the first MPDU in the sequence.
  11463. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11464. * - SEQ_NUM_END
  11465. * Bits 15:8
  11466. * Purpose:
  11467. * Indicates the ending sequence number of the MPDU in this
  11468. * series of MPDUs that went though PN check.
  11469. * Value:
  11470. * The sequence number one larger then the sequence number of the last
  11471. * MPDU being flushed.
  11472. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  11473. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  11474. * for invalid PN numbers and are ready to be released for further processing.
  11475. * Not all MPDUs within this range are necessarily valid - the host
  11476. * must check each sequence number within this range to see if the
  11477. * corresponding MPDU is actually present.
  11478. * - PN_IE_COUNT
  11479. * Bits 23:16
  11480. * Purpose:
  11481. * Used to determine the variable number of PN information elements in this
  11482. * message
  11483. *
  11484. * PN information elements:
  11485. * - PN_IE_x-
  11486. * Purpose:
  11487. * Each PN information element contains the sequence number of the MPDU that
  11488. * has failed the target PN check.
  11489. * Value:
  11490. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  11491. * that failed the PN check.
  11492. */
  11493. /* first DWORD */
  11494. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  11495. #define HTT_RX_PN_IND_PEER_ID_S 8
  11496. #define HTT_RX_PN_IND_TID_M 0xff000000
  11497. #define HTT_RX_PN_IND_TID_S 24
  11498. /* second DWORD */
  11499. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  11500. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  11501. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  11502. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  11503. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  11504. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  11505. #define HTT_RX_PN_IND_BYTES 8
  11506. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  11507. do { \
  11508. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  11509. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  11510. } while (0)
  11511. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  11512. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  11513. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  11514. do { \
  11515. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  11516. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  11517. } while (0)
  11518. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  11519. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  11520. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  11521. do { \
  11522. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  11523. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  11524. } while (0)
  11525. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  11526. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  11527. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  11528. do { \
  11529. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  11530. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  11531. } while (0)
  11532. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  11533. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  11534. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  11535. do { \
  11536. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  11537. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  11538. } while (0)
  11539. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  11540. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  11541. /*
  11542. * @brief target -> host rx offload deliver message for LL system
  11543. *
  11544. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  11545. *
  11546. * @details
  11547. * In a low latency system this message is sent whenever the offload
  11548. * manager flushes out the packets it has coalesced in its coalescing buffer.
  11549. * The DMA of the actual packets into host memory is done before sending out
  11550. * this message. This message indicates only how many MSDUs to reap. The
  11551. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  11552. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  11553. * DMA'd by the MAC directly into host memory these packets do not contain
  11554. * the MAC descriptors in the header portion of the packet. Instead they contain
  11555. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  11556. * message, the packets are delivered directly to the NW stack without going
  11557. * through the regular reorder buffering and PN checking path since it has
  11558. * already been done in target.
  11559. *
  11560. * |31 24|23 16|15 8|7 0|
  11561. * |-----------------------------------------------------------------------|
  11562. * | Total MSDU count | reserved | msg type |
  11563. * |-----------------------------------------------------------------------|
  11564. *
  11565. * @brief target -> host rx offload deliver message for HL system
  11566. *
  11567. * @details
  11568. * In a high latency system this message is sent whenever the offload manager
  11569. * flushes out the packets it has coalesced in its coalescing buffer. The
  11570. * actual packets are also carried along with this message. When the host
  11571. * receives this message, it is expected to deliver these packets to the NW
  11572. * stack directly instead of routing them through the reorder buffering and
  11573. * PN checking path since it has already been done in target.
  11574. *
  11575. * |31 24|23 16|15 8|7 0|
  11576. * |-----------------------------------------------------------------------|
  11577. * | Total MSDU count | reserved | msg type |
  11578. * |-----------------------------------------------------------------------|
  11579. * | peer ID | MSDU length |
  11580. * |-----------------------------------------------------------------------|
  11581. * | MSDU payload | FW Desc | tid | vdev ID |
  11582. * |-----------------------------------------------------------------------|
  11583. * | MSDU payload contd. |
  11584. * |-----------------------------------------------------------------------|
  11585. * | peer ID | MSDU length |
  11586. * |-----------------------------------------------------------------------|
  11587. * | MSDU payload | FW Desc | tid | vdev ID |
  11588. * |-----------------------------------------------------------------------|
  11589. * | MSDU payload contd. |
  11590. * |-----------------------------------------------------------------------|
  11591. *
  11592. */
  11593. /* first DWORD */
  11594. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  11595. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  11596. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  11597. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  11598. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  11599. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  11600. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  11601. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  11602. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  11603. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  11604. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  11605. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  11606. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  11607. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  11608. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  11609. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  11610. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  11611. do { \
  11612. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  11613. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  11614. } while (0)
  11615. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  11616. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  11617. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  11618. do { \
  11619. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  11620. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  11621. } while (0)
  11622. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  11623. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  11624. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  11625. do { \
  11626. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  11627. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  11628. } while (0)
  11629. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  11630. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  11631. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  11632. do { \
  11633. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  11634. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  11635. } while (0)
  11636. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  11637. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  11638. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  11639. do { \
  11640. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  11641. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  11642. } while (0)
  11643. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  11644. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  11645. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  11646. do { \
  11647. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  11648. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  11649. } while (0)
  11650. /**
  11651. * @brief target -> host rx peer map/unmap message definition
  11652. *
  11653. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  11654. *
  11655. * @details
  11656. * The following diagram shows the format of the rx peer map message sent
  11657. * from the target to the host. This layout assumes the target operates
  11658. * as little-endian.
  11659. *
  11660. * This message always contains a SW peer ID. The main purpose of the
  11661. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11662. * with, so that the host can use that peer ID to determine which peer
  11663. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11664. * other purposes, such as identifying during tx completions which peer
  11665. * the tx frames in question were transmitted to.
  11666. *
  11667. * In certain generations of chips, the peer map message also contains
  11668. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  11669. * to identify which peer the frame needs to be forwarded to (i.e. the
  11670. * peer associated with the Destination MAC Address within the packet),
  11671. * and particularly which vdev needs to transmit the frame (for cases
  11672. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  11673. * meaning as AST_INDEX_0.
  11674. * This DA-based peer ID that is provided for certain rx frames
  11675. * (the rx frames that need to be re-transmitted as tx frames)
  11676. * is the ID that the HW uses for referring to the peer in question,
  11677. * rather than the peer ID that the SW+FW use to refer to the peer.
  11678. *
  11679. *
  11680. * |31 24|23 16|15 8|7 0|
  11681. * |-----------------------------------------------------------------------|
  11682. * | SW peer ID | VDEV ID | msg type |
  11683. * |-----------------------------------------------------------------------|
  11684. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11685. * |-----------------------------------------------------------------------|
  11686. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11687. * |-----------------------------------------------------------------------|
  11688. *
  11689. *
  11690. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  11691. *
  11692. * The following diagram shows the format of the rx peer unmap message sent
  11693. * from the target to the host.
  11694. *
  11695. * |31 24|23 16|15 8|7 0|
  11696. * |-----------------------------------------------------------------------|
  11697. * | SW peer ID | VDEV ID | msg type |
  11698. * |-----------------------------------------------------------------------|
  11699. *
  11700. * The following field definitions describe the format of the rx peer map
  11701. * and peer unmap messages sent from the target to the host.
  11702. * - MSG_TYPE
  11703. * Bits 7:0
  11704. * Purpose: identifies this as an rx peer map or peer unmap message
  11705. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  11706. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  11707. * - VDEV_ID
  11708. * Bits 15:8
  11709. * Purpose: Indicates which virtual device the peer is associated
  11710. * with.
  11711. * Value: vdev ID (used in the host to look up the vdev object)
  11712. * - PEER_ID (a.k.a. SW_PEER_ID)
  11713. * Bits 31:16
  11714. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11715. * freeing (unmap)
  11716. * Value: (rx) peer ID
  11717. * - MAC_ADDR_L32 (peer map only)
  11718. * Bits 31:0
  11719. * Purpose: Identifies which peer node the peer ID is for.
  11720. * Value: lower 4 bytes of peer node's MAC address
  11721. * - MAC_ADDR_U16 (peer map only)
  11722. * Bits 15:0
  11723. * Purpose: Identifies which peer node the peer ID is for.
  11724. * Value: upper 2 bytes of peer node's MAC address
  11725. * - HW_PEER_ID
  11726. * Bits 31:16
  11727. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11728. * address, so for rx frames marked for rx --> tx forwarding, the
  11729. * host can determine from the HW peer ID provided as meta-data with
  11730. * the rx frame which peer the frame is supposed to be forwarded to.
  11731. * Value: ID used by the MAC HW to identify the peer
  11732. */
  11733. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11734. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11735. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11736. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11737. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11738. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11739. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11740. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11741. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11742. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11743. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11744. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11745. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11746. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11747. do { \
  11748. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11749. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11750. } while (0)
  11751. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11752. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11753. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11754. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11755. do { \
  11756. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11757. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11758. } while (0)
  11759. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11760. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11761. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11762. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11763. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11764. do { \
  11765. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11766. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11767. } while (0)
  11768. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11769. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11770. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11771. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11772. #define HTT_RX_PEER_MAP_BYTES 12
  11773. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11774. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11775. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11776. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11777. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11778. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11779. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11780. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11781. #define HTT_RX_PEER_UNMAP_BYTES 4
  11782. /**
  11783. * @brief target -> host rx peer map V2 message definition
  11784. *
  11785. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11786. *
  11787. * @details
  11788. * The following diagram shows the format of the rx peer map v2 message sent
  11789. * from the target to the host. This layout assumes the target operates
  11790. * as little-endian.
  11791. *
  11792. * This message always contains a SW peer ID. The main purpose of the
  11793. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11794. * with, so that the host can use that peer ID to determine which peer
  11795. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11796. * other purposes, such as identifying during tx completions which peer
  11797. * the tx frames in question were transmitted to.
  11798. *
  11799. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11800. * is used during rx --> tx frame forwarding to identify which peer the
  11801. * frame needs to be forwarded to (i.e. the peer associated with the
  11802. * Destination MAC Address within the packet), and particularly which vdev
  11803. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11804. * This DA-based peer ID that is provided for certain rx frames
  11805. * (the rx frames that need to be re-transmitted as tx frames)
  11806. * is the ID that the HW uses for referring to the peer in question,
  11807. * rather than the peer ID that the SW+FW use to refer to the peer.
  11808. *
  11809. * The HW peer id here is the same meaning as AST_INDEX_0.
  11810. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11811. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11812. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11813. * AST is valid.
  11814. *
  11815. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11816. * |-------------------------------------------------------------------------|
  11817. * | SW peer ID | VDEV ID | msg type |
  11818. * |-------------------------------------------------------------------------|
  11819. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11820. * |-------------------------------------------------------------------------|
  11821. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11822. * |-------------------------------------------------------------------------|
  11823. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11824. * |-------------------------------------------------------------------------|
  11825. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11826. * |-------------------------------------------------------------------------|
  11827. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11828. * |-------------------------------------------------------------------------|
  11829. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11830. * |-------------------------------------------------------------------------|
  11831. * | Reserved_2 |
  11832. * |-------------------------------------------------------------------------|
  11833. * Where:
  11834. * NH = Next Hop
  11835. * ASTVM = AST valid mask
  11836. * OA = on-chip AST valid bit
  11837. * ASTFM = AST flow mask
  11838. *
  11839. * The following field definitions describe the format of the rx peer map v2
  11840. * messages sent from the target to the host.
  11841. * - MSG_TYPE
  11842. * Bits 7:0
  11843. * Purpose: identifies this as an rx peer map v2 message
  11844. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11845. * - VDEV_ID
  11846. * Bits 15:8
  11847. * Purpose: Indicates which virtual device the peer is associated with.
  11848. * Value: vdev ID (used in the host to look up the vdev object)
  11849. * - SW_PEER_ID
  11850. * Bits 31:16
  11851. * Purpose: The peer ID (index) that WAL is allocating
  11852. * Value: (rx) peer ID
  11853. * - MAC_ADDR_L32
  11854. * Bits 31:0
  11855. * Purpose: Identifies which peer node the peer ID is for.
  11856. * Value: lower 4 bytes of peer node's MAC address
  11857. * - MAC_ADDR_U16
  11858. * Bits 15:0
  11859. * Purpose: Identifies which peer node the peer ID is for.
  11860. * Value: upper 2 bytes of peer node's MAC address
  11861. * - HW_PEER_ID / AST_INDEX_0
  11862. * Bits 31:16
  11863. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11864. * address, so for rx frames marked for rx --> tx forwarding, the
  11865. * host can determine from the HW peer ID provided as meta-data with
  11866. * the rx frame which peer the frame is supposed to be forwarded to.
  11867. * Value: ID used by the MAC HW to identify the peer
  11868. * - AST_HASH_VALUE
  11869. * Bits 15:0
  11870. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11871. * override feature.
  11872. * - NEXT_HOP
  11873. * Bit 16
  11874. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11875. * (Wireless Distribution System).
  11876. * - AST_VALID_MASK
  11877. * Bits 19:17
  11878. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11879. * - ONCHIP_AST_VALID_FLAG
  11880. * Bit 20
  11881. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11882. * is valid.
  11883. * - AST_INDEX_1
  11884. * Bits 15:0
  11885. * Purpose: indicate the second AST index for this peer
  11886. * - AST_0_FLOW_MASK
  11887. * Bits 19:16
  11888. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11889. * - AST_1_FLOW_MASK
  11890. * Bits 23:20
  11891. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11892. * - AST_2_FLOW_MASK
  11893. * Bits 27:24
  11894. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11895. * - AST_3_FLOW_MASK
  11896. * Bits 31:28
  11897. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11898. * - AST_INDEX_2
  11899. * Bits 15:0
  11900. * Purpose: indicate the third AST index for this peer
  11901. * - TID_VALID_HI_PRI
  11902. * Bits 23:16
  11903. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11904. * - TID_VALID_LOW_PRI
  11905. * Bits 31:24
  11906. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11907. * - AST_INDEX_3
  11908. * Bits 15:0
  11909. * Purpose: indicate the fourth AST index for this peer
  11910. * - ONCHIP_AST_IDX / RESERVED
  11911. * Bits 31:16
  11912. * Purpose: This field is valid only when split AST feature is enabled.
  11913. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11914. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11915. * address, this ast_idx is used for LMAC modules for RXPCU.
  11916. * Value: ID used by the LMAC HW to identify the peer
  11917. */
  11918. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11919. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11920. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11921. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11922. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11923. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11924. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11925. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11926. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11927. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11928. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11929. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11930. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11931. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11932. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11933. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11934. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11935. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11936. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11937. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11938. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11939. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11940. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11941. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11942. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11943. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11944. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11945. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11946. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11947. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11948. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11949. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11950. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11951. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11952. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11953. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11954. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11955. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11956. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11957. do { \
  11958. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11959. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11960. } while (0)
  11961. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11962. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11963. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11964. do { \
  11965. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11966. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11967. } while (0)
  11968. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11969. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11970. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11971. do { \
  11972. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11973. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11974. } while (0)
  11975. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11976. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11977. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11978. do { \
  11979. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11980. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11981. } while (0)
  11982. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11983. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11984. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11985. do { \
  11986. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11987. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11988. } while (0)
  11989. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11990. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11991. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11992. do { \
  11993. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11994. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11995. } while (0)
  11996. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11997. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11998. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11999. do { \
  12000. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  12001. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  12002. } while (0)
  12003. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  12004. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  12005. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12006. do { \
  12007. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  12008. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  12009. } while (0)
  12010. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  12011. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  12012. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  12013. do { \
  12014. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  12015. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  12016. } while (0)
  12017. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  12018. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  12019. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  12020. do { \
  12021. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  12022. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  12023. } while (0)
  12024. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  12025. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  12026. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  12027. do { \
  12028. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  12029. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  12030. } while (0)
  12031. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  12032. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  12033. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  12034. do { \
  12035. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  12036. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  12037. } while (0)
  12038. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  12039. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  12040. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  12041. do { \
  12042. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  12043. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  12044. } while (0)
  12045. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  12046. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  12047. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  12048. do { \
  12049. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  12050. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  12051. } while (0)
  12052. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  12053. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  12054. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  12055. do { \
  12056. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  12057. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  12058. } while (0)
  12059. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  12060. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  12061. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  12062. do { \
  12063. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  12064. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  12065. } while (0)
  12066. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  12067. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  12068. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  12069. do { \
  12070. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  12071. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  12072. } while (0)
  12073. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  12074. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  12075. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12076. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  12077. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  12078. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  12079. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  12080. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  12081. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  12082. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  12083. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  12084. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  12085. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  12086. #define HTT_RX_PEER_MAP_V2_BYTES 32
  12087. /**
  12088. * @brief target -> host rx peer map V3 message definition
  12089. *
  12090. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  12091. *
  12092. * @details
  12093. * The following diagram shows the format of the rx peer map v3 message sent
  12094. * from the target to the host.
  12095. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  12096. * This layout assumes the target operates as little-endian.
  12097. *
  12098. * |31 24|23 20|19|18|17|16|15 8|7 0|
  12099. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  12100. * | SW peer ID | VDEV ID | msg type |
  12101. * |-----------------+--------------------+-----------------+-----------------|
  12102. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12103. * |-----------------+--------------------+-----------------+-----------------|
  12104. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  12105. * |-----------------+--------+-----------+-----------------+-----------------|
  12106. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  12107. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  12108. * | (8bits) | | (4bits) | |
  12109. * |-----------------+--------+--+--+--+--------------------------------------|
  12110. * | RESERVED |E |O | | |
  12111. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  12112. * | |V |V | | |
  12113. * |-----------------+--------------------+-----------------------------------|
  12114. * | HTT_MSDU_IDX_ | RESERVED | |
  12115. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  12116. * | (8bits) | | |
  12117. * |-----------------+--------------------+-----------------------------------|
  12118. * | Reserved_2 |
  12119. * |--------------------------------------------------------------------------|
  12120. * | Reserved_3 |
  12121. * |--------------------------------------------------------------------------|
  12122. *
  12123. * Where:
  12124. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  12125. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  12126. * NH = Next Hop
  12127. * The following field definitions describe the format of the rx peer map v3
  12128. * messages sent from the target to the host.
  12129. * - MSG_TYPE
  12130. * Bits 7:0
  12131. * Purpose: identifies this as a peer map v3 message
  12132. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  12133. * - VDEV_ID
  12134. * Bits 15:8
  12135. * Purpose: Indicates which virtual device the peer is associated with.
  12136. * - SW_PEER_ID
  12137. * Bits 31:16
  12138. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  12139. * - MAC_ADDR_L32
  12140. * Bits 31:0
  12141. * Purpose: Identifies which peer node the peer ID is for.
  12142. * Value: lower 4 bytes of peer node's MAC address
  12143. * - MAC_ADDR_U16
  12144. * Bits 15:0
  12145. * Purpose: Identifies which peer node the peer ID is for.
  12146. * Value: upper 2 bytes of peer node's MAC address
  12147. * - MULTICAST_SW_PEER_ID
  12148. * Bits 31:16
  12149. * Purpose: The multicast peer ID (index)
  12150. * Value: set to HTT_INVALID_PEER if not valid
  12151. * - HW_PEER_ID / AST_INDEX
  12152. * Bits 15:0
  12153. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  12154. * address, so for rx frames marked for rx --> tx forwarding, the
  12155. * host can determine from the HW peer ID provided as meta-data with
  12156. * the rx frame which peer the frame is supposed to be forwarded to.
  12157. * - CACHE_SET_NUM
  12158. * Bits 19:16
  12159. * Purpose: Cache Set Number for AST_INDEX
  12160. * Cache set number that should be used to cache the index based
  12161. * search results, for address and flow search.
  12162. * This value should be equal to LSB 4 bits of the hash value
  12163. * of match data, in case of search index points to an entry which
  12164. * may be used in content based search also. The value can be
  12165. * anything when the entry pointed by search index will not be
  12166. * used for content based search.
  12167. * - HTT_MSDU_IDX_VALID_MASK
  12168. * Bits 31:24
  12169. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  12170. * - ONCHIP_AST_IDX / RESERVED
  12171. * Bits 15:0
  12172. * Purpose: This field is valid only when split AST feature is enabled.
  12173. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  12174. * If valid, identifies the HW peer ID corresponding to the peer MAC
  12175. * address, this ast_idx is used for LMAC modules for RXPCU.
  12176. * - NEXT_HOP
  12177. * Bits 16
  12178. * Purpose: Flag indicates next_hop AST entry used for WDS
  12179. * (Wireless Distribution System).
  12180. * - ONCHIP_AST_VALID
  12181. * Bits 17
  12182. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  12183. * - EXT_AST_VALID
  12184. * Bits 18
  12185. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  12186. * - EXT_AST_INDEX
  12187. * Bits 15:0
  12188. * Purpose: This field describes Extended AST index
  12189. * Valid if EXT_AST_VALID flag set
  12190. * - HTT_MSDU_IDX_VALID_MASK_EXT
  12191. * Bits 31:24
  12192. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  12193. */
  12194. /* dword 0 */
  12195. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  12196. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  12197. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  12198. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  12199. /* dword 1 */
  12200. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  12201. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  12202. /* dword 2 */
  12203. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  12204. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  12205. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  12206. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  12207. /* dword 3 */
  12208. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  12209. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  12210. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  12211. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  12212. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  12213. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  12214. /* dword 4 */
  12215. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  12216. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  12217. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  12218. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  12219. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  12220. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  12221. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  12222. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  12223. /* dword 5 */
  12224. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  12225. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  12226. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  12227. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  12228. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  12229. do { \
  12230. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  12231. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  12232. } while (0)
  12233. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  12234. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  12235. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  12236. do { \
  12237. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  12238. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  12239. } while (0)
  12240. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  12241. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  12242. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  12243. do { \
  12244. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  12245. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  12246. } while (0)
  12247. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  12248. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  12249. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  12250. do { \
  12251. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  12252. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  12253. } while (0)
  12254. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  12255. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  12256. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  12257. do { \
  12258. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  12259. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  12260. } while (0)
  12261. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  12262. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  12263. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  12264. do { \
  12265. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  12266. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  12267. } while (0)
  12268. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  12269. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  12270. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  12271. do { \
  12272. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  12273. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  12274. } while (0)
  12275. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  12276. (((word) & HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S)
  12277. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  12278. do { \
  12279. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  12280. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  12281. } while (0)
  12282. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  12283. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  12284. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  12285. do { \
  12286. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  12287. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  12288. } while (0)
  12289. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  12290. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  12291. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  12292. do { \
  12293. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  12294. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  12295. } while (0)
  12296. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  12297. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  12298. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  12299. do { \
  12300. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  12301. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  12302. } while (0)
  12303. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  12304. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  12305. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  12306. do { \
  12307. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  12308. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  12309. } while (0)
  12310. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  12311. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  12312. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  12313. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  12314. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  12315. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  12316. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  12317. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  12318. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  12319. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12320. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  12321. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  12322. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  12323. #define HTT_RX_PEER_MAP_V3_BYTES 32
  12324. /**
  12325. * @brief target -> host rx peer unmap V2 message definition
  12326. *
  12327. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  12328. *
  12329. * The following diagram shows the format of the rx peer unmap message sent
  12330. * from the target to the host.
  12331. *
  12332. * |31 24|23 16|15 8|7 0|
  12333. * |-----------------------------------------------------------------------|
  12334. * | SW peer ID | VDEV ID | msg type |
  12335. * |-----------------------------------------------------------------------|
  12336. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12337. * |-----------------------------------------------------------------------|
  12338. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  12339. * |-----------------------------------------------------------------------|
  12340. * | Peer Delete Duration |
  12341. * |-----------------------------------------------------------------------|
  12342. * | Reserved_0 | WDS Free Count |
  12343. * |-----------------------------------------------------------------------|
  12344. * | Reserved_1 |
  12345. * |-----------------------------------------------------------------------|
  12346. * | Reserved_2 |
  12347. * |-----------------------------------------------------------------------|
  12348. *
  12349. *
  12350. * The following field definitions describe the format of the rx peer unmap
  12351. * messages sent from the target to the host.
  12352. * - MSG_TYPE
  12353. * Bits 7:0
  12354. * Purpose: identifies this as an rx peer unmap v2 message
  12355. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  12356. * - VDEV_ID
  12357. * Bits 15:8
  12358. * Purpose: Indicates which virtual device the peer is associated
  12359. * with.
  12360. * Value: vdev ID (used in the host to look up the vdev object)
  12361. * - SW_PEER_ID
  12362. * Bits 31:16
  12363. * Purpose: The peer ID (index) that WAL is freeing
  12364. * Value: (rx) peer ID
  12365. * - MAC_ADDR_L32
  12366. * Bits 31:0
  12367. * Purpose: Identifies which peer node the peer ID is for.
  12368. * Value: lower 4 bytes of peer node's MAC address
  12369. * - MAC_ADDR_U16
  12370. * Bits 15:0
  12371. * Purpose: Identifies which peer node the peer ID is for.
  12372. * Value: upper 2 bytes of peer node's MAC address
  12373. * - NEXT_HOP
  12374. * Bits 16
  12375. * Purpose: Bit indicates next_hop AST entry used for WDS
  12376. * (Wireless Distribution System).
  12377. * - PEER_DELETE_DURATION
  12378. * Bits 31:0
  12379. * Purpose: Time taken to delete peer, in msec,
  12380. * Used for monitoring / debugging PEER delete response delay
  12381. * - PEER_WDS_FREE_COUNT
  12382. * Bits 15:0
  12383. * Purpose: Count of WDS entries deleted associated to peer deleted
  12384. */
  12385. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  12386. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  12387. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  12388. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  12389. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  12390. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  12391. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  12392. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  12393. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  12394. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  12395. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  12396. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  12397. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  12398. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  12399. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  12400. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  12401. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  12402. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  12403. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  12404. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  12405. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  12406. do { \
  12407. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  12408. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  12409. } while (0)
  12410. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  12411. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  12412. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  12413. do { \
  12414. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  12415. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  12416. } while (0)
  12417. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  12418. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  12419. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  12420. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  12421. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  12422. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  12423. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  12424. /**
  12425. * @brief target -> host rx peer mlo map message definition
  12426. *
  12427. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  12428. *
  12429. * @details
  12430. * The following diagram shows the format of the rx mlo peer map message sent
  12431. * from the target to the host. This layout assumes the target operates
  12432. * as little-endian.
  12433. *
  12434. * MCC:
  12435. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  12436. *
  12437. * WIN:
  12438. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  12439. * It will be sent on the Assoc Link.
  12440. *
  12441. * This message always contains a MLO peer ID. The main purpose of the
  12442. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  12443. * with, so that the host can use that MLO peer ID to determine which peer
  12444. * transmitted the rx frame.
  12445. *
  12446. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  12447. * |-------------------------------------------------------------------------|
  12448. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  12449. * |-------------------------------------------------------------------------|
  12450. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12451. * |-------------------------------------------------------------------------|
  12452. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  12453. * |-------------------------------------------------------------------------|
  12454. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  12455. * |-------------------------------------------------------------------------|
  12456. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  12457. * |-------------------------------------------------------------------------|
  12458. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  12459. * |-------------------------------------------------------------------------|
  12460. * |RSVD |
  12461. * |-------------------------------------------------------------------------|
  12462. * |RSVD |
  12463. * |-------------------------------------------------------------------------|
  12464. * | htt_tlv_hdr_t |
  12465. * |-------------------------------------------------------------------------|
  12466. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12467. * |-------------------------------------------------------------------------|
  12468. * | htt_tlv_hdr_t |
  12469. * |-------------------------------------------------------------------------|
  12470. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12471. * |-------------------------------------------------------------------------|
  12472. * | htt_tlv_hdr_t |
  12473. * |-------------------------------------------------------------------------|
  12474. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  12475. * |-------------------------------------------------------------------------|
  12476. *
  12477. * Where:
  12478. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  12479. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  12480. * V (valid) - 1 Bit Bit17
  12481. * CHIPID - 3 Bits
  12482. * TIDMASK - 8 Bits
  12483. * CACHE_SET_NUM - 8 Bits
  12484. *
  12485. * The following field definitions describe the format of the rx MLO peer map
  12486. * messages sent from the target to the host.
  12487. * - MSG_TYPE
  12488. * Bits 7:0
  12489. * Purpose: identifies this as an rx mlo peer map message
  12490. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  12491. *
  12492. * - MLO_PEER_ID
  12493. * Bits 23:8
  12494. * Purpose: The MLO peer ID (index).
  12495. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  12496. * Value: MLO peer ID
  12497. *
  12498. * - NUMLINK
  12499. * Bits: 26:24 (3Bits)
  12500. * Purpose: Indicate the max number of logical links supported per client.
  12501. * Value: number of logical links
  12502. *
  12503. * - PRC
  12504. * Bits: 29:27 (3Bits)
  12505. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  12506. * if there is migration of the primary chip.
  12507. * Value: Primary REO CHIPID
  12508. *
  12509. * - MAC_ADDR_L32
  12510. * Bits 31:0
  12511. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  12512. * Value: lower 4 bytes of peer node's MAC address
  12513. *
  12514. * - MAC_ADDR_U16
  12515. * Bits 15:0
  12516. * Purpose: Identifies which peer node the peer ID is for.
  12517. * Value: upper 2 bytes of peer node's MAC address
  12518. *
  12519. * - PRIMARY_TCL_AST_IDX
  12520. * Bits 15:0
  12521. * Purpose: Primary TCL AST index for this peer.
  12522. *
  12523. * - V
  12524. * 1 Bit Position 16
  12525. * Purpose: If the ast idx is valid.
  12526. *
  12527. * - CHIPID
  12528. * Bits 19:17
  12529. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  12530. *
  12531. * - TIDMASK
  12532. * Bits 27:20
  12533. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  12534. *
  12535. * - CACHE_SET_NUM
  12536. * Bits 31:28
  12537. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  12538. * Cache set number that should be used to cache the index based
  12539. * search results, for address and flow search.
  12540. * This value should be equal to LSB four bits of the hash value
  12541. * of match data, in case of search index points to an entry which
  12542. * may be used in content based search also. The value can be
  12543. * anything when the entry pointed by search index will not be
  12544. * used for content based search.
  12545. *
  12546. * - htt_tlv_hdr_t
  12547. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  12548. *
  12549. * Bits 11:0
  12550. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  12551. *
  12552. * Bits 23:12
  12553. * Purpose: Length, Length of the value that follows the header
  12554. *
  12555. * Bits 31:28
  12556. * Purpose: Reserved.
  12557. *
  12558. *
  12559. * - SW_PEER_ID
  12560. * Bits 15:0
  12561. * Purpose: The peer ID (index) that WAL is allocating
  12562. * Value: (rx) peer ID
  12563. *
  12564. * - VDEV_ID
  12565. * Bits 23:16
  12566. * Purpose: Indicates which virtual device the peer is associated with.
  12567. * Value: vdev ID (used in the host to look up the vdev object)
  12568. *
  12569. * - CHIPID
  12570. * Bits 26:24
  12571. * Purpose: Indicates which Chip id the peer is associated with.
  12572. * Value: chip ID (Provided by Host as part of QMI exchange)
  12573. */
  12574. typedef enum {
  12575. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  12576. } MLO_PEER_MAP_TLV_TAG_ID;
  12577. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  12578. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  12579. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  12580. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  12581. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  12582. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  12583. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  12584. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  12585. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  12586. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  12587. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  12588. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  12589. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  12590. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  12591. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  12592. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  12593. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  12594. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  12595. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  12596. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  12597. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  12598. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  12599. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  12600. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  12601. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  12602. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  12603. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  12604. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  12605. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  12606. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  12607. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  12608. do { \
  12609. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  12610. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  12611. } while (0)
  12612. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  12613. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  12614. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  12615. do { \
  12616. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  12617. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  12618. } while (0)
  12619. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  12620. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  12621. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  12622. do { \
  12623. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  12624. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  12625. } while (0)
  12626. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  12627. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  12628. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  12629. do { \
  12630. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  12631. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  12632. } while (0)
  12633. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  12634. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  12635. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  12636. do { \
  12637. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  12638. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  12639. } while (0)
  12640. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  12641. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  12642. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  12643. do { \
  12644. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  12645. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  12646. } while (0)
  12647. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  12648. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  12649. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  12650. do { \
  12651. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  12652. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  12653. } while (0)
  12654. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  12655. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  12656. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  12657. do { \
  12658. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  12659. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  12660. } while (0)
  12661. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  12662. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  12663. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  12664. do { \
  12665. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  12666. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  12667. } while (0)
  12668. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  12669. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  12670. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  12671. do { \
  12672. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  12673. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  12674. } while (0)
  12675. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  12676. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  12677. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  12678. do { \
  12679. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  12680. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  12681. } while (0)
  12682. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  12683. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  12684. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  12685. do { \
  12686. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  12687. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  12688. } while (0)
  12689. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  12690. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  12691. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  12692. do { \
  12693. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  12694. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  12695. } while (0)
  12696. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  12697. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  12698. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  12699. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  12700. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  12701. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  12702. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  12703. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  12704. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  12705. *
  12706. * The following diagram shows the format of the rx mlo peer unmap message sent
  12707. * from the target to the host.
  12708. *
  12709. * |31 24|23 16|15 8|7 0|
  12710. * |-----------------------------------------------------------------------|
  12711. * | RSVD_24_31 | MLO peer ID | msg type |
  12712. * |-----------------------------------------------------------------------|
  12713. */
  12714. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12715. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12716. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12717. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12718. /**
  12719. * @brief target -> host message specifying security parameters
  12720. *
  12721. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12722. *
  12723. * @details
  12724. * The following diagram shows the format of the security specification
  12725. * message sent from the target to the host.
  12726. * This security specification message tells the host whether a PN check is
  12727. * necessary on rx data frames, and if so, how large the PN counter is.
  12728. * This message also tells the host about the security processing to apply
  12729. * to defragmented rx frames - specifically, whether a Message Integrity
  12730. * Check is required, and the Michael key to use.
  12731. *
  12732. * |31 24|23 16|15|14 8|7 0|
  12733. * |-----------------------------------------------------------------------|
  12734. * | peer ID | U| security type | msg type |
  12735. * |-----------------------------------------------------------------------|
  12736. * | Michael Key K0 |
  12737. * |-----------------------------------------------------------------------|
  12738. * | Michael Key K1 |
  12739. * |-----------------------------------------------------------------------|
  12740. * | WAPI RSC Low0 |
  12741. * |-----------------------------------------------------------------------|
  12742. * | WAPI RSC Low1 |
  12743. * |-----------------------------------------------------------------------|
  12744. * | WAPI RSC Hi0 |
  12745. * |-----------------------------------------------------------------------|
  12746. * | WAPI RSC Hi1 |
  12747. * |-----------------------------------------------------------------------|
  12748. *
  12749. * The following field definitions describe the format of the security
  12750. * indication message sent from the target to the host.
  12751. * - MSG_TYPE
  12752. * Bits 7:0
  12753. * Purpose: identifies this as a security specification message
  12754. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12755. * - SEC_TYPE
  12756. * Bits 14:8
  12757. * Purpose: specifies which type of security applies to the peer
  12758. * Value: htt_sec_type enum value
  12759. * - UNICAST
  12760. * Bit 15
  12761. * Purpose: whether this security is applied to unicast or multicast data
  12762. * Value: 1 -> unicast, 0 -> multicast
  12763. * - PEER_ID
  12764. * Bits 31:16
  12765. * Purpose: The ID number for the peer the security specification is for
  12766. * Value: peer ID
  12767. * - MICHAEL_KEY_K0
  12768. * Bits 31:0
  12769. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12770. * Value: Michael Key K0 (if security type is TKIP)
  12771. * - MICHAEL_KEY_K1
  12772. * Bits 31:0
  12773. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12774. * Value: Michael Key K1 (if security type is TKIP)
  12775. * - WAPI_RSC_LOW0
  12776. * Bits 31:0
  12777. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12778. * Value: WAPI RSC Low0 (if security type is WAPI)
  12779. * - WAPI_RSC_LOW1
  12780. * Bits 31:0
  12781. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12782. * Value: WAPI RSC Low1 (if security type is WAPI)
  12783. * - WAPI_RSC_HI0
  12784. * Bits 31:0
  12785. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12786. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12787. * - WAPI_RSC_HI1
  12788. * Bits 31:0
  12789. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12790. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12791. */
  12792. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12793. #define HTT_SEC_IND_SEC_TYPE_S 8
  12794. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12795. #define HTT_SEC_IND_UNICAST_S 15
  12796. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12797. #define HTT_SEC_IND_PEER_ID_S 16
  12798. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12799. do { \
  12800. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12801. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12802. } while (0)
  12803. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12804. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12805. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12806. do { \
  12807. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12808. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12809. } while (0)
  12810. #define HTT_SEC_IND_UNICAST_GET(word) \
  12811. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12812. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12813. do { \
  12814. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12815. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12816. } while (0)
  12817. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12818. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12819. #define HTT_SEC_IND_BYTES 28
  12820. /**
  12821. * @brief target -> host rx ADDBA / DELBA message definitions
  12822. *
  12823. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12824. *
  12825. * @details
  12826. * The following diagram shows the format of the rx ADDBA message sent
  12827. * from the target to the host:
  12828. *
  12829. * |31 20|19 16|15 8|7 0|
  12830. * |---------------------------------------------------------------------|
  12831. * | peer ID | TID | window size | msg type |
  12832. * |---------------------------------------------------------------------|
  12833. *
  12834. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12835. *
  12836. * The following diagram shows the format of the rx DELBA message sent
  12837. * from the target to the host:
  12838. *
  12839. * |31 20|19 16|15 10|9 8|7 0|
  12840. * |---------------------------------------------------------------------|
  12841. * | peer ID | TID | window size | IR| msg type |
  12842. * |---------------------------------------------------------------------|
  12843. *
  12844. * The following field definitions describe the format of the rx ADDBA
  12845. * and DELBA messages sent from the target to the host.
  12846. * - MSG_TYPE
  12847. * Bits 7:0
  12848. * Purpose: identifies this as an rx ADDBA or DELBA message
  12849. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12850. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12851. * - IR (initiator / recipient)
  12852. * Bits 9:8 (DELBA only)
  12853. * Purpose: specify whether the DELBA handshake was initiated by the
  12854. * local STA/AP, or by the peer STA/AP
  12855. * Value:
  12856. * 0 - unspecified
  12857. * 1 - initiator (a.k.a. originator)
  12858. * 2 - recipient (a.k.a. responder)
  12859. * 3 - unused / reserved
  12860. * - WIN_SIZE
  12861. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12862. * Purpose: Specifies the length of the block ack window (max = 64).
  12863. * Value:
  12864. * block ack window length specified by the received ADDBA/DELBA
  12865. * management message.
  12866. * - TID
  12867. * Bits 19:16
  12868. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12869. * Value:
  12870. * TID specified by the received ADDBA or DELBA management message.
  12871. * - PEER_ID
  12872. * Bits 31:20
  12873. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12874. * Value:
  12875. * ID (hash value) used by the host for fast, direct lookup of
  12876. * host SW peer info, including rx reorder states.
  12877. */
  12878. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12879. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12880. #define HTT_RX_ADDBA_TID_M 0xf0000
  12881. #define HTT_RX_ADDBA_TID_S 16
  12882. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12883. #define HTT_RX_ADDBA_PEER_ID_S 20
  12884. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12885. do { \
  12886. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12887. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12888. } while (0)
  12889. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12890. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12891. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12892. do { \
  12893. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12894. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12895. } while (0)
  12896. #define HTT_RX_ADDBA_TID_GET(word) \
  12897. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12898. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12899. do { \
  12900. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12901. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12902. } while (0)
  12903. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12904. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12905. #define HTT_RX_ADDBA_BYTES 4
  12906. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12907. #define HTT_RX_DELBA_INITIATOR_S 8
  12908. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12909. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12910. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12911. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12912. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12913. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12914. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12915. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12916. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12917. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12918. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12919. do { \
  12920. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12921. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12922. } while (0)
  12923. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12924. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12925. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12926. do { \
  12927. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12928. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12929. } while (0)
  12930. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12931. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12932. #define HTT_RX_DELBA_BYTES 4
  12933. /**
  12934. * @brief target -> host rx ADDBA / DELBA message definitions
  12935. *
  12936. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12937. *
  12938. * @details
  12939. * The following diagram shows the format of the rx ADDBA extn message sent
  12940. * from the target to the host:
  12941. *
  12942. * |31 20|19 16|15 13|12 8|7 0|
  12943. * |---------------------------------------------------------------------|
  12944. * | peer ID | TID | reserved | msg type |
  12945. * |---------------------------------------------------------------------|
  12946. * | reserved | window size |
  12947. * |---------------------------------------------------------------------|
  12948. *
  12949. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12950. *
  12951. * The following diagram shows the format of the rx DELBA message sent
  12952. * from the target to the host:
  12953. *
  12954. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12955. * |---------------------------------------------------------------------|
  12956. * | peer ID | TID | reserved | IR| msg type |
  12957. * |---------------------------------------------------------------------|
  12958. * | reserved | window size |
  12959. * |---------------------------------------------------------------------|
  12960. *
  12961. * The following field definitions describe the format of the rx ADDBA
  12962. * and DELBA messages sent from the target to the host.
  12963. * - MSG_TYPE
  12964. * Bits 7:0
  12965. * Purpose: identifies this as an rx ADDBA or DELBA message
  12966. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12967. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12968. * - IR (initiator / recipient)
  12969. * Bits 9:8 (DELBA only)
  12970. * Purpose: specify whether the DELBA handshake was initiated by the
  12971. * local STA/AP, or by the peer STA/AP
  12972. * Value:
  12973. * 0 - unspecified
  12974. * 1 - initiator (a.k.a. originator)
  12975. * 2 - recipient (a.k.a. responder)
  12976. * 3 - unused / reserved
  12977. * Value:
  12978. * block ack window length specified by the received ADDBA/DELBA
  12979. * management message.
  12980. * - TID
  12981. * Bits 19:16
  12982. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12983. * Value:
  12984. * TID specified by the received ADDBA or DELBA management message.
  12985. * - PEER_ID
  12986. * Bits 31:20
  12987. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12988. * Value:
  12989. * ID (hash value) used by the host for fast, direct lookup of
  12990. * host SW peer info, including rx reorder states.
  12991. * == DWORD 1
  12992. * - WIN_SIZE
  12993. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12994. * Purpose: Specifies the length of the block ack window (max = 8191).
  12995. */
  12996. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12997. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12998. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12999. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  13000. /*--- Dword 0 ---*/
  13001. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  13002. do { \
  13003. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  13004. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  13005. } while (0)
  13006. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  13007. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  13008. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  13009. do { \
  13010. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  13011. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  13012. } while (0)
  13013. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  13014. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  13015. /*--- Dword 1 ---*/
  13016. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  13017. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  13018. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  13019. do { \
  13020. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  13021. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  13022. } while (0)
  13023. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  13024. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  13025. #define HTT_RX_ADDBA_EXTN_BYTES 8
  13026. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  13027. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  13028. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  13029. #define HTT_RX_DELBA_EXTN_TID_S 16
  13030. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  13031. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  13032. /*--- Dword 0 ---*/
  13033. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  13034. do { \
  13035. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  13036. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  13037. } while (0)
  13038. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  13039. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  13040. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  13041. do { \
  13042. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  13043. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  13044. } while (0)
  13045. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  13046. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  13047. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  13048. do { \
  13049. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  13050. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  13051. } while (0)
  13052. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  13053. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  13054. /*--- Dword 1 ---*/
  13055. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  13056. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  13057. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  13058. do { \
  13059. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  13060. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  13061. } while (0)
  13062. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  13063. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  13064. #define HTT_RX_DELBA_EXTN_BYTES 8
  13065. /**
  13066. * @brief tx queue group information element definition
  13067. *
  13068. * @details
  13069. * The following diagram shows the format of the tx queue group
  13070. * information element, which can be included in target --> host
  13071. * messages to specify the number of tx "credits" (tx descriptors
  13072. * for LL, or tx buffers for HL) available to a particular group
  13073. * of host-side tx queues, and which host-side tx queues belong to
  13074. * the group.
  13075. *
  13076. * |31|30 24|23 16|15|14|13 0|
  13077. * |------------------------------------------------------------------------|
  13078. * | X| reserved | tx queue grp ID | A| S| credit count |
  13079. * |------------------------------------------------------------------------|
  13080. * | vdev ID mask | AC mask |
  13081. * |------------------------------------------------------------------------|
  13082. *
  13083. * The following definitions describe the fields within the tx queue group
  13084. * information element:
  13085. * - credit_count
  13086. * Bits 13:1
  13087. * Purpose: specify how many tx credits are available to the tx queue group
  13088. * Value: An absolute or relative, positive or negative credit value
  13089. * The 'A' bit specifies whether the value is absolute or relative.
  13090. * The 'S' bit specifies whether the value is positive or negative.
  13091. * A negative value can only be relative, not absolute.
  13092. * An absolute value replaces any prior credit value the host has for
  13093. * the tx queue group in question.
  13094. * A relative value is added to the prior credit value the host has for
  13095. * the tx queue group in question.
  13096. * - sign
  13097. * Bit 14
  13098. * Purpose: specify whether the credit count is positive or negative
  13099. * Value: 0 -> positive, 1 -> negative
  13100. * - absolute
  13101. * Bit 15
  13102. * Purpose: specify whether the credit count is absolute or relative
  13103. * Value: 0 -> relative, 1 -> absolute
  13104. * - txq_group_id
  13105. * Bits 23:16
  13106. * Purpose: indicate which tx queue group's credit and/or membership are
  13107. * being specified
  13108. * Value: 0 to max_tx_queue_groups-1
  13109. * - reserved
  13110. * Bits 30:16
  13111. * Value: 0x0
  13112. * - eXtension
  13113. * Bit 31
  13114. * Purpose: specify whether another tx queue group info element follows
  13115. * Value: 0 -> no more tx queue group information elements
  13116. * 1 -> another tx queue group information element immediately follows
  13117. * - ac_mask
  13118. * Bits 15:0
  13119. * Purpose: specify which Access Categories belong to the tx queue group
  13120. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  13121. * the tx queue group.
  13122. * The AC bit-mask values are obtained by left-shifting by the
  13123. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  13124. * - vdev_id_mask
  13125. * Bits 31:16
  13126. * Purpose: specify which vdev's tx queues belong to the tx queue group
  13127. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  13128. * belong to the tx queue group.
  13129. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  13130. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  13131. */
  13132. PREPACK struct htt_txq_group {
  13133. A_UINT32
  13134. credit_count: 14,
  13135. sign: 1,
  13136. absolute: 1,
  13137. tx_queue_group_id: 8,
  13138. reserved0: 7,
  13139. extension: 1;
  13140. A_UINT32
  13141. ac_mask: 16,
  13142. vdev_id_mask: 16;
  13143. } POSTPACK;
  13144. /* first word */
  13145. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  13146. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  13147. #define HTT_TXQ_GROUP_SIGN_S 14
  13148. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  13149. #define HTT_TXQ_GROUP_ABS_S 15
  13150. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  13151. #define HTT_TXQ_GROUP_ID_S 16
  13152. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  13153. #define HTT_TXQ_GROUP_EXT_S 31
  13154. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  13155. /* second word */
  13156. #define HTT_TXQ_GROUP_AC_MASK_S 0
  13157. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  13158. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  13159. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  13160. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  13161. do { \
  13162. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  13163. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  13164. } while (0)
  13165. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  13166. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  13167. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  13168. do { \
  13169. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  13170. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  13171. } while (0)
  13172. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  13173. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  13174. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  13175. do { \
  13176. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  13177. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  13178. } while (0)
  13179. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  13180. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  13181. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  13182. do { \
  13183. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  13184. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  13185. } while (0)
  13186. #define HTT_TXQ_GROUP_ID_GET(_info) \
  13187. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  13188. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  13189. do { \
  13190. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  13191. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  13192. } while (0)
  13193. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  13194. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  13195. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  13196. do { \
  13197. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  13198. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  13199. } while (0)
  13200. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  13201. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  13202. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  13203. do { \
  13204. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  13205. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  13206. } while (0)
  13207. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  13208. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  13209. /**
  13210. * @brief target -> host TX completion indication message definition
  13211. *
  13212. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  13213. *
  13214. * @details
  13215. * The following diagram shows the format of the TX completion indication sent
  13216. * from the target to the host
  13217. *
  13218. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  13219. * |-------------------------------------------------------------------|
  13220. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  13221. * |-------------------------------------------------------------------|
  13222. * payload:| MSDU1 ID | MSDU0 ID |
  13223. * |-------------------------------------------------------------------|
  13224. * : MSDU3 ID | MSDU2 ID :
  13225. * |-------------------------------------------------------------------|
  13226. * | struct htt_tx_compl_ind_append_retries |
  13227. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13228. * | struct htt_tx_compl_ind_append_tx_tstamp |
  13229. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13230. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  13231. * |-------------------------------------------------------------------|
  13232. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  13233. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13234. * | MSDU0 tx_tsf64_low |
  13235. * |-------------------------------------------------------------------|
  13236. * | MSDU0 tx_tsf64_high |
  13237. * |-------------------------------------------------------------------|
  13238. * | MSDU1 tx_tsf64_low |
  13239. * |-------------------------------------------------------------------|
  13240. * | MSDU1 tx_tsf64_high |
  13241. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13242. * | phy_timestamp |
  13243. * |-------------------------------------------------------------------|
  13244. * | rate specs (see below) |
  13245. * |-------------------------------------------------------------------|
  13246. * | seqctrl | framectrl |
  13247. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  13248. * Where:
  13249. * A0 = append (a.k.a. append0)
  13250. * A1 = append1
  13251. * TP = MSDU tx power presence
  13252. * A2 = append2
  13253. * A3 = append3
  13254. * A4 = append4
  13255. *
  13256. * The following field definitions describe the format of the TX completion
  13257. * indication sent from the target to the host
  13258. * Header fields:
  13259. * - msg_type
  13260. * Bits 7:0
  13261. * Purpose: identifies this as HTT TX completion indication
  13262. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  13263. * - status
  13264. * Bits 10:8
  13265. * Purpose: the TX completion status of payload fragmentations descriptors
  13266. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  13267. * - tid
  13268. * Bits 14:11
  13269. * Purpose: the tid associated with those fragmentation descriptors. It is
  13270. * valid or not, depending on the tid_invalid bit.
  13271. * Value: 0 to 15
  13272. * - tid_invalid
  13273. * Bits 15:15
  13274. * Purpose: this bit indicates whether the tid field is valid or not
  13275. * Value: 0 indicates valid; 1 indicates invalid
  13276. * - num
  13277. * Bits 23:16
  13278. * Purpose: the number of payload in this indication
  13279. * Value: 1 to 255
  13280. * - append (a.k.a. append0)
  13281. * Bits 24:24
  13282. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  13283. * the number of tx retries for one MSDU at the end of this message
  13284. * Value: 0 indicates no appending; 1 indicates appending
  13285. * - append1
  13286. * Bits 25:25
  13287. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  13288. * contains the timestamp info for each TX msdu id in payload.
  13289. * The order of the timestamps matches the order of the MSDU IDs.
  13290. * Note that a big-endian host needs to account for the reordering
  13291. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13292. * conversion) when determining which tx timestamp corresponds to
  13293. * which MSDU ID.
  13294. * Value: 0 indicates no appending; 1 indicates appending
  13295. * - msdu_tx_power_presence
  13296. * Bits 26:26
  13297. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  13298. * for each MSDU referenced by the TX_COMPL_IND message.
  13299. * The tx power is reported in 0.5 dBm units.
  13300. * The order of the per-MSDU tx power reports matches the order
  13301. * of the MSDU IDs.
  13302. * Note that a big-endian host needs to account for the reordering
  13303. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  13304. * conversion) when determining which Tx Power corresponds to
  13305. * which MSDU ID.
  13306. * Value: 0 indicates MSDU tx power reports are not appended,
  13307. * 1 indicates MSDU tx power reports are appended
  13308. * - append2
  13309. * Bits 27:27
  13310. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  13311. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  13312. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  13313. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  13314. * for each MSDU, for convenience.
  13315. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  13316. * this append2 bit is set).
  13317. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  13318. * dB above the noise floor.
  13319. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  13320. * 1 indicates MSDU ACK RSSI values are appended.
  13321. * - append3
  13322. * Bits 28:28
  13323. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  13324. * contains the tx tsf info based on wlan global TSF for
  13325. * each TX msdu id in payload.
  13326. * The order of the tx tsf matches the order of the MSDU IDs.
  13327. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  13328. * values to indicate the the lower 32 bits and higher 32 bits of
  13329. * the tx tsf.
  13330. * The tx_tsf64 here represents the time MSDU was acked and the
  13331. * tx_tsf64 has microseconds units.
  13332. * Value: 0 indicates no appending; 1 indicates appending
  13333. * - append4
  13334. * Bits 29:29
  13335. * Purpose: Indicate whether data frame control fields and fields required
  13336. * for radio tap header are appended for each MSDU in TX_COMP_IND
  13337. * message. The order of the this message matches the order of
  13338. * the MSDU IDs.
  13339. * Value: 0 indicates frame control fields and fields required for
  13340. * radio tap header values are not appended,
  13341. * 1 indicates frame control fields and fields required for
  13342. * radio tap header values are appended.
  13343. * Payload fields:
  13344. * - hmsdu_id
  13345. * Bits 15:0
  13346. * Purpose: this ID is used to track the Tx buffer in host
  13347. * Value: 0 to "size of host MSDU descriptor pool - 1"
  13348. */
  13349. PREPACK struct htt_tx_data_hdr_information {
  13350. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  13351. A_UINT32 /* word 1 */
  13352. /* preamble:
  13353. * 0-OFDM,
  13354. * 1-CCk,
  13355. * 2-HT,
  13356. * 3-VHT
  13357. */
  13358. preamble: 2, /* [1:0] */
  13359. /* mcs:
  13360. * In case of HT preamble interpret
  13361. * MCS along with NSS.
  13362. * Valid values for HT are 0 to 7.
  13363. * HT mcs 0 with NSS 2 is mcs 8.
  13364. * Valid values for VHT are 0 to 9.
  13365. */
  13366. mcs: 4, /* [5:2] */
  13367. /* rate:
  13368. * This is applicable only for
  13369. * CCK and OFDM preamble type
  13370. * rate 0: OFDM 48 Mbps,
  13371. * 1: OFDM 24 Mbps,
  13372. * 2: OFDM 12 Mbps
  13373. * 3: OFDM 6 Mbps
  13374. * 4: OFDM 54 Mbps
  13375. * 5: OFDM 36 Mbps
  13376. * 6: OFDM 18 Mbps
  13377. * 7: OFDM 9 Mbps
  13378. * rate 0: CCK 11 Mbps Long
  13379. * 1: CCK 5.5 Mbps Long
  13380. * 2: CCK 2 Mbps Long
  13381. * 3: CCK 1 Mbps Long
  13382. * 4: CCK 11 Mbps Short
  13383. * 5: CCK 5.5 Mbps Short
  13384. * 6: CCK 2 Mbps Short
  13385. */
  13386. rate : 3, /* [ 8: 6] */
  13387. rssi : 8, /* [16: 9] units=dBm */
  13388. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  13389. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  13390. stbc : 1, /* [22] */
  13391. sgi : 1, /* [23] */
  13392. ldpc : 1, /* [24] */
  13393. beamformed: 1, /* [25] */
  13394. /* tx_retry_cnt:
  13395. * Indicates retry count of data tx frames provided by the host.
  13396. */
  13397. tx_retry_cnt: 6; /* [31:26] */
  13398. A_UINT32 /* word 2 */
  13399. framectrl:16, /* [15: 0] */
  13400. seqno:16; /* [31:16] */
  13401. } POSTPACK;
  13402. #define HTT_TX_COMPL_IND_STATUS_S 8
  13403. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  13404. #define HTT_TX_COMPL_IND_TID_S 11
  13405. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  13406. #define HTT_TX_COMPL_IND_TID_INV_S 15
  13407. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  13408. #define HTT_TX_COMPL_IND_NUM_S 16
  13409. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  13410. #define HTT_TX_COMPL_IND_APPEND_S 24
  13411. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  13412. #define HTT_TX_COMPL_IND_APPEND1_S 25
  13413. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  13414. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  13415. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  13416. #define HTT_TX_COMPL_IND_APPEND2_S 27
  13417. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  13418. #define HTT_TX_COMPL_IND_APPEND3_S 28
  13419. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  13420. #define HTT_TX_COMPL_IND_APPEND4_S 29
  13421. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  13422. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  13423. do { \
  13424. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  13425. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  13426. } while (0)
  13427. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  13428. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  13429. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  13430. do { \
  13431. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  13432. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  13433. } while (0)
  13434. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  13435. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  13436. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  13437. do { \
  13438. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  13439. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  13440. } while (0)
  13441. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  13442. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  13443. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  13444. do { \
  13445. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  13446. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  13447. } while (0)
  13448. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  13449. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  13450. HTT_TX_COMPL_IND_TID_INV_S)
  13451. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  13452. do { \
  13453. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  13454. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  13455. } while (0)
  13456. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  13457. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  13458. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  13459. do { \
  13460. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  13461. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  13462. } while (0)
  13463. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  13464. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  13465. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  13466. do { \
  13467. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  13468. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  13469. } while (0)
  13470. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  13471. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  13472. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  13473. do { \
  13474. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  13475. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  13476. } while (0)
  13477. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  13478. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  13479. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  13480. do { \
  13481. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  13482. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  13483. } while (0)
  13484. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  13485. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  13486. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  13487. do { \
  13488. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  13489. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  13490. } while (0)
  13491. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  13492. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  13493. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  13494. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  13495. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  13496. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  13497. #define HTT_TX_COMPL_IND_STAT_OK 0
  13498. /* DISCARD:
  13499. * current meaning:
  13500. * MSDUs were queued for transmission but filtered by HW or SW
  13501. * without any over the air attempts
  13502. * legacy meaning (HL Rome):
  13503. * MSDUs were discarded by the target FW without any over the air
  13504. * attempts due to lack of space
  13505. */
  13506. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  13507. /* NO_ACK:
  13508. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  13509. */
  13510. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  13511. /* POSTPONE:
  13512. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  13513. * be downloaded again later (in the appropriate order), when they are
  13514. * deliverable.
  13515. */
  13516. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  13517. /*
  13518. * The PEER_DEL tx completion status is used for HL cases
  13519. * where the peer the frame is for has been deleted.
  13520. * The host has already discarded its copy of the frame, but
  13521. * it still needs the tx completion to restore its credit.
  13522. */
  13523. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  13524. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  13525. #define HTT_TX_COMPL_IND_STAT_DROP 5
  13526. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  13527. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  13528. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  13529. PREPACK struct htt_tx_compl_ind_base {
  13530. A_UINT32 hdr;
  13531. A_UINT16 payload[1/*or more*/];
  13532. } POSTPACK;
  13533. PREPACK struct htt_tx_compl_ind_append_retries {
  13534. A_UINT16 msdu_id;
  13535. A_UINT8 tx_retries;
  13536. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  13537. 0: this is the last append_retries struct */
  13538. } POSTPACK;
  13539. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  13540. A_UINT32 timestamp[1/*or more*/];
  13541. } POSTPACK;
  13542. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  13543. A_UINT32 tx_tsf64_low;
  13544. A_UINT32 tx_tsf64_high;
  13545. } POSTPACK;
  13546. /* htt_tx_data_hdr_information payload extension fields: */
  13547. /* DWORD zero */
  13548. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  13549. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  13550. /* DWORD one */
  13551. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  13552. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  13553. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  13554. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  13555. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  13556. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  13557. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  13558. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  13559. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  13560. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  13561. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  13562. #define HTT_FW_TX_DATA_HDR_BW_S 19
  13563. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  13564. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  13565. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  13566. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  13567. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  13568. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  13569. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  13570. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  13571. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  13572. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  13573. /* DWORD two */
  13574. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  13575. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  13576. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  13577. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  13578. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  13579. do { \
  13580. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  13581. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  13582. } while (0)
  13583. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  13584. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  13585. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  13586. do { \
  13587. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  13588. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  13589. } while (0)
  13590. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  13591. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  13592. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  13593. do { \
  13594. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  13595. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  13596. } while (0)
  13597. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  13598. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  13599. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  13600. do { \
  13601. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  13602. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  13603. } while (0)
  13604. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  13605. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  13606. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  13607. do { \
  13608. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  13609. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  13610. } while (0)
  13611. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  13612. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  13613. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  13614. do { \
  13615. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  13616. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  13617. } while (0)
  13618. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  13619. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  13620. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  13621. do { \
  13622. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  13623. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  13624. } while (0)
  13625. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  13626. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  13627. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  13628. do { \
  13629. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  13630. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  13631. } while (0)
  13632. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  13633. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  13634. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  13635. do { \
  13636. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  13637. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  13638. } while (0)
  13639. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  13640. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  13641. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  13642. do { \
  13643. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  13644. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  13645. } while (0)
  13646. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  13647. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  13648. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  13649. do { \
  13650. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  13651. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  13652. } while (0)
  13653. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  13654. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  13655. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  13656. do { \
  13657. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  13658. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  13659. } while (0)
  13660. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  13661. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  13662. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  13663. do { \
  13664. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  13665. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  13666. } while (0)
  13667. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  13668. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  13669. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  13670. do { \
  13671. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  13672. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  13673. } while (0)
  13674. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  13675. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  13676. /**
  13677. * @brief target -> host software UMAC TX completion indication message
  13678. *
  13679. * MSG_TYPE => HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND
  13680. *
  13681. * @details
  13682. * The following diagram shows the format of the soft UMAC TX completion
  13683. * indication sent from the target to the host
  13684. *
  13685. * |31 30|29|28|27|26 20|19 17|16|15 12|11|10| 9|8|7 4|3 1|0|
  13686. * |-------------------------------------+----------------+------------|
  13687. * hdr: | rsvd | msdu_cnt | msg_type |
  13688. * pyld: |===================================================================|
  13689. * MSDU 0| buf addr low (bits 31:0) |
  13690. * |-----------------------------------------------+------+------------|
  13691. * | SW buffer cookie | RS | buf addr hi|
  13692. * |--------+--+--+-------------+--------+---------+------+------------|
  13693. * | rsvd0 | M| V| tx count | TID | SW peer ID |
  13694. * |--------+--+--+-------------+--------+----------------------+------|
  13695. * | frametype | TQM status number | RELR |
  13696. * |-----+-----+-----------------------------------+--+-+-+-----+------|
  13697. * |rsvd1| buffer timestamp | A|L|F| ACK RSSI |
  13698. * |-----+--+-------------------------+--+------+-----+--+-+-----+---+-|
  13699. * | rsvd2 | tones in RU |OF|tx MCS|txSGI|LC|S|PKTYP|BW |I|
  13700. * |--------+-------------------------+--+------+-----+--+-+-----+---+-|
  13701. * | PPDU transmission TSF |
  13702. * |-------------------------------------------------------------------|
  13703. * | rsvd3 |
  13704. * |===================================================================|
  13705. * MSDU 1| buf addr low (bits 31:0) |
  13706. * : ... :
  13707. * | rsvd3 |
  13708. * |===================================================================|
  13709. * etc.
  13710. *
  13711. * Where:
  13712. * RS = release source
  13713. * V = valid
  13714. * M = multicast
  13715. * RELR = release reason
  13716. * F = first MSDU
  13717. * L = last MSDU
  13718. * A = MSDU is part of A-MSDU
  13719. * I = rate info valid
  13720. * PKTYP = packet type
  13721. * S = STBC
  13722. * LC = LDPC
  13723. * OF = OFDMA transmission
  13724. */
  13725. typedef enum {
  13726. /* 0 (REASON_FRAME_ACKED):
  13727. * Corresponds to tqm_release_reason = <enum 0 tqm_rr_frame_acked>;
  13728. * frame is removed because an ACK of BA for it was received.
  13729. */
  13730. HTT_TX_MSDU_RELEASE_REASON_FRAME_ACKED,
  13731. /* 1 (REASON_REMOVE_CMD_FW):
  13732. * Corresponds to tqm_release_reason = <enum 1 tqm_rr_rem_cmd_rem>;
  13733. * frame is removed because a remove command of type "Remove_mpdus"
  13734. * initiated by SW.
  13735. */
  13736. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_FW,
  13737. /* 2 (REASON_REMOVE_CMD_TX):
  13738. * Corresponds to tqm_release_reason = <enum 2 tqm_rr_rem_cmd_tx>;
  13739. * frame is removed because a remove command of type
  13740. * "Remove_transmitted_mpdus" initiated by SW.
  13741. */
  13742. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_TX,
  13743. /* 3 (REASON_REMOVE_CMD_NOTX):
  13744. * Corresponds to tqm_release_reason = <enum 3 tqm_rr_rem_cmd_notx>;
  13745. * frame is removed because a remove command of type
  13746. * "Remove_untransmitted_mpdus" initiated by SW.
  13747. */
  13748. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_NOTX,
  13749. /* 4 (REASON_REMOVE_CMD_AGED):
  13750. * Corresponds to tqm_release_reason = <enum 4 tqm_rr_rem_cmd_aged>;
  13751. * frame is removed because a remove command of type "Remove_aged_mpdus"
  13752. * or "Remove_aged_msdus" initiated by SW.
  13753. */
  13754. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_AGED,
  13755. /* 5 (RELEASE_FW_REASON1):
  13756. * Corresponds to tqm_release_reason = <enum 5 tqm_fw_reason1>;
  13757. * frame is removed because a remove command where fw indicated that
  13758. * remove reason is fw_reason1.
  13759. */
  13760. HTT_TX_MSDU_RELEASE_FW_REASON1,
  13761. /* 6 (RELEASE_FW_REASON2):
  13762. * Corresponds to tqm_release_reason = <enum 6 tqm_fw_reason2>;
  13763. * frame is removed because a remove command where fw indicated that
  13764. * remove reason is fw_reason1.
  13765. */
  13766. HTT_TX_MSDU_RELEASE_FW_REASON2,
  13767. /* 7 (RELEASE_FW_REASON3):
  13768. * Corresponds to tqm_release_reason = <enum 7 tqm_fw_reason3>;
  13769. * frame is removed because a remove command where fw indicated that
  13770. * remove reason is fw_reason1.
  13771. */
  13772. HTT_TX_MSDU_RELEASE_FW_REASON3,
  13773. /* 8 (REASON_REMOVE_CMD_DISABLEQ):
  13774. * Corresponds to tqm_release_reason = <enum 8 tqm_rr_rem_cmd_disable_queue>
  13775. * frame is removed because a remove command of type
  13776. * "remove_mpdus_and_disable_queue" or "remove_msdus_and_disable_flow"
  13777. * initiated by SW.
  13778. */
  13779. HTT_TX_MSDU_RELEASE_REASON_REMOVE_CMD_DISABLEQ,
  13780. /* 9 (REASON_DROP_MISC):
  13781. * Corresponds to sw_release_reason = Packet dropped by FW due to
  13782. * any discard reason that is not categorized as MSDU TTL expired.
  13783. * Examples: TXDE ENQ layer dropped the packet due to peer delete,
  13784. * tid delete, no resource credit available.
  13785. */
  13786. HTT_TX_MSDU_RELEASE_REASON_DROP_MISC,
  13787. /* 10 (REASON_DROP_TTL):
  13788. * Corresponds to sw_release_reason = Packet dropped by FW due to
  13789. * discard reason that frame is not transmitted due to MSDU TTL expired.
  13790. */
  13791. HTT_TX_MSDU_RELEASE_REASON_DROP_TTL,
  13792. /* 11 - available for use */
  13793. /* 12 - available for use */
  13794. /* 13 - available for use */
  13795. /* 14 - available for use */
  13796. /* 15 - available for use */
  13797. HTT_TX_MSDU_RELEASE_REASON_MAX = 16
  13798. } htt_t2h_tx_msdu_release_reason_e;
  13799. typedef enum {
  13800. /* 0 (RELEASE_SOURCE_FW):
  13801. * MSDU released by FW even before the frame was queued to TQM-L HW.
  13802. */
  13803. HTT_TX_MSDU_RELEASE_SOURCE_FW,
  13804. /* 1 (RELEASE_SOURCE_TQM_LITE):
  13805. * MSDU released by TQM-L HW.
  13806. */
  13807. HTT_TX_MSDU_RELEASE_SOURCE_TQM_LITE,
  13808. HTT_TX_MSDU_RELEASE_SOURCE_MAX = 8
  13809. } htt_t2h_tx_msdu_release_source_e;
  13810. struct htt_t2h_tx_buffer_addr_info { /* 2 words */
  13811. A_UINT32 buffer_addr_31_0 : 32; /* [31:0] */
  13812. A_UINT32 buffer_addr_39_32 : 8, /* [7:0] */
  13813. /* release_source:
  13814. * holds a htt_t2h_tx_msdu_release_source_e enum value
  13815. */
  13816. release_source : 3, /* [10:8] */
  13817. sw_buffer_cookie : 21; /* [31:11] */
  13818. /* NOTE:
  13819. * To preserve backwards compatibility,
  13820. * no new fields can be added in this struct.
  13821. */
  13822. };
  13823. /* member definitions of htt_t2h_tx_buffer_addr_info */
  13824. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M 0xFFFFFFFF
  13825. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S 0
  13826. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_SET(word, value) \
  13827. do { \
  13828. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0, value); \
  13829. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S; \
  13830. } while (0)
  13831. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_GET(word) \
  13832. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_31_0_S)
  13833. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M 0x000000FF
  13834. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S 0
  13835. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_SET(word, value) \
  13836. do { \
  13837. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32, value); \
  13838. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S; \
  13839. } while (0)
  13840. #define HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_GET(word) \
  13841. (((word) & HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_M) >> HTT_TX_BUFFER_ADDR_INFO_ADDR_39_32_S)
  13842. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M 0x00000700
  13843. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S 8
  13844. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_SET(word, value) \
  13845. do { \
  13846. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE, value); \
  13847. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S; \
  13848. } while (0)
  13849. #define HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_GET(word) \
  13850. (((word) & HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_M) >> HTT_TX_BUFFER_ADDR_INFO_RELEASE_SOURCE_S)
  13851. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M 0xFFFFF800
  13852. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S 11
  13853. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  13854. do { \
  13855. HTT_CHECK_SET_VAL(HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE, value); \
  13856. (word) |= (value) << HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S; \
  13857. } while (0)
  13858. #define HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_GET(word) \
  13859. (((word) & HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_M) >> HTT_TX_BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_S)
  13860. struct htt_t2h_tx_rate_stats_info { /* 2 words */
  13861. /* word 0 */
  13862. A_UINT32
  13863. /* tx_rate_stats_info_valid:
  13864. * Indicates if the tx rate stats below are valid.
  13865. */
  13866. tx_rate_stats_info_valid : 1, /* [0] */
  13867. /* transmit_bw:
  13868. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13869. * Indicates the BW of the upcoming transmission that shall likely
  13870. * start in about 3 -4 us on the medium:
  13871. * <enum 0 transmit_bw_20_MHz>
  13872. * <enum 1 transmit_bw_40_MHz>
  13873. * <enum 2 transmit_bw_80_MHz>
  13874. * <enum 3 transmit_bw_160_MHz>
  13875. * <enum 4 transmit_bw_320_MHz>
  13876. */
  13877. transmit_bw : 3, /* [3:1] */
  13878. /* transmit_pkt_type:
  13879. * same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13880. * Field filled in by PDG.
  13881. * Not valid when in SW transmit mode
  13882. * The packet type
  13883. * <enum_type PKT_TYPE_ENUM>
  13884. * Type: enum Definition Name: PKT_TYPE_ENUM
  13885. * enum number enum name Description
  13886. * ------------------------------------
  13887. * 0 dot11a 802.11a PPDU type
  13888. * 1 dot11b 802.11b PPDU type
  13889. * 2 dot11n_mm 802.11n Mixed Mode PPDU type
  13890. * 3 dot11ac 802.11ac PPDU type
  13891. * 4 dot11ax 802.11ax PPDU type
  13892. * 5 dot11ba 802.11ba (WUR) PPDU type
  13893. * 6 dot11be 802.11be PPDU type
  13894. * 7 dot11az 802.11az (ranging) PPDU type
  13895. */
  13896. transmit_pkt_type : 4, /* [7:4] */
  13897. /* transmit_stbc:
  13898. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13899. * Field filled in by PDG.
  13900. * Not valid when in SW transmit mode
  13901. * When set, STBC transmission rate was used.
  13902. */
  13903. transmit_stbc : 1, /* [8] */
  13904. /* transmit_ldpc:
  13905. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13906. * Field filled in by PDG.
  13907. * Not valid when in SW transmit mode
  13908. * When set, use LDPC transmission rates
  13909. */
  13910. transmit_ldpc : 1, /* [9] */
  13911. /* transmit_sgi:
  13912. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13913. * Field filled in by PDG.
  13914. * Not valid when in SW transmit mode
  13915. * <enum 0 0_8_us_sgi > Legacy normal GI. Can also be used for HE
  13916. * <enum 1 0_4_us_sgi > Legacy short GI. Can also be used for HE
  13917. * <enum 2 1_6_us_sgi > HE related GI
  13918. * <enum 3 3_2_us_sgi > HE related GI
  13919. * <legal 0 - 3>
  13920. */
  13921. transmit_sgi : 2, /* [11:10] */
  13922. /* transmit_mcs:
  13923. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  13924. * Field filled in by PDG.
  13925. * Not valid when in SW transmit mode
  13926. *
  13927. * For details, refer to MCS_TYPE description
  13928. * <legal all>
  13929. * Pkt_type Related definition of MCS_TYPE
  13930. * dot11b This field is the rate:
  13931. * 0: CCK 11 Mbps Long
  13932. * 1: CCK 5.5 Mbps Long
  13933. * 2: CCK 2 Mbps Long
  13934. * 3: CCK 1 Mbps Long
  13935. * 4: CCK 11 Mbps Short
  13936. * 5: CCK 5.5 Mbps Short
  13937. * 6: CCK 2 Mbps Short
  13938. * NOTE: The numbering here is NOT the same as the as MAC gives
  13939. * in the "rate" field in the SIG given to the PHY.
  13940. * The MAC will do an internal translation.
  13941. *
  13942. * Dot11a This field is the rate:
  13943. * 0: OFDM 48 Mbps
  13944. * 1: OFDM 24 Mbps
  13945. * 2: OFDM 12 Mbps
  13946. * 3: OFDM 6 Mbps
  13947. * 4: OFDM 54 Mbps
  13948. * 5: OFDM 36 Mbps
  13949. * 6: OFDM 18 Mbps
  13950. * 7: OFDM 9 Mbps
  13951. * NOTE: The numbering here is NOT the same as the as MAC gives
  13952. * in the "rate" field in the SIG given to the PHY.
  13953. * The MAC will do an internal translation.
  13954. *
  13955. * Dot11n_mm (mixed mode) This field represends the MCS.
  13956. * 0: HT MCS 0 (BPSK 1/2)
  13957. * 1: HT MCS 1 (QPSK 1/2)
  13958. * 2: HT MCS 2 (QPSK 3/4)
  13959. * 3: HT MCS 3 (16-QAM 1/2)
  13960. * 4: HT MCS 4 (16-QAM 3/4)
  13961. * 5: HT MCS 5 (64-QAM 2/3)
  13962. * 6: HT MCS 6 (64-QAM 3/4)
  13963. * 7: HT MCS 7 (64-QAM 5/6)
  13964. * NOTE: To get higher MCS's use the nss field to indicate the
  13965. * number of spatial streams.
  13966. *
  13967. * Dot11ac This field represends the MCS.
  13968. * 0: VHT MCS 0 (BPSK 1/2)
  13969. * 1: VHT MCS 1 (QPSK 1/2)
  13970. * 2: VHT MCS 2 (QPSK 3/4)
  13971. * 3: VHT MCS 3 (16-QAM 1/2)
  13972. * 4: VHT MCS 4 (16-QAM 3/4)
  13973. * 5: VHT MCS 5 (64-QAM 2/3)
  13974. * 6: VHT MCS 6 (64-QAM 3/4)
  13975. * 7: VHT MCS 7 (64-QAM 5/6)
  13976. * 8: VHT MCS 8 (256-QAM 3/4)
  13977. * 9: VHT MCS 9 (256-QAM 5/6)
  13978. * 10: VHT MCS 10 (1024-QAM 3/4)
  13979. * 11: VHT MCS 11 (1024-QAM 5/6)
  13980. * NOTE: There are several illegal VHT rates due to fractional
  13981. * number of bits per symbol.
  13982. * Below are the illegal rates for 4 streams and lower:
  13983. * 20 MHz, 1 stream, MCS 9
  13984. * 20 MHz, 2 stream, MCS 9
  13985. * 20 MHz, 4 stream, MCS 9
  13986. * 80 MHz, 3 stream, MCS 6
  13987. * 160 MHz, 3 stream, MCS 9 (Unsupported)
  13988. * 160 MHz, 4 stream, MCS 7 (Unsupported)
  13989. *
  13990. * dot11ax This field represends the MCS.
  13991. * 0: HE MCS 0 (BPSK 1/2)
  13992. * 1: HE MCS 1 (QPSK 1/2)
  13993. * 2: HE MCS 2 (QPSK 3/4)
  13994. * 3: HE MCS 3 (16-QAM 1/2)
  13995. * 4: HE MCS 4 (16-QAM 3/4)
  13996. * 5: HE MCS 5 (64-QAM 2/3)
  13997. * 6: HE MCS 6 (64-QAM 3/4)
  13998. * 7: HE MCS 7 (64-QAM 5/6)
  13999. * 8: HE MCS 8 (256-QAM 3/4)
  14000. * 9: HE MCS 9 (256-QAM 5/6)
  14001. * 10: HE MCS 10 (1024-QAM 3/4)
  14002. * 11: HE MCS 11 (1024-QAM 5/6)
  14003. * 12: HE MCS 12 (4096-QAM 3/4)
  14004. * 13: HE MCS 13 (4096-QAM 5/6)
  14005. *
  14006. * dot11ba This field is the rate:
  14007. * 0: LDR
  14008. * 1: HDR
  14009. * 2: Exclusive rate
  14010. */
  14011. transmit_mcs : 4, /* [15:12] */
  14012. /* ofdma_transmission:
  14013. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14014. * Field filled in by PDG.
  14015. * Set when the transmission was an OFDMA transmission (DL or UL).
  14016. * <legal all>
  14017. */
  14018. ofdma_transmission : 1, /* [16] */
  14019. /* tones_in_ru:
  14020. * Same as TX_RATE_STATS_INFO. Transmit_BW populated by MAC HW.
  14021. * Field filled in by PDG.
  14022. * Not valid when in SW transmit mode
  14023. * The number of tones in the RU used.
  14024. * <legal all>
  14025. */
  14026. tones_in_ru : 12, /* [28:17] */
  14027. rsvd2 : 3; /* [31:29] */
  14028. /* word 1 */
  14029. /* ppdu_transmission_tsf:
  14030. * Based on a HWSCH configuration register setting,
  14031. * this field either contains:
  14032. * Lower 32 bits of the TSF, snapshot of this value when transmission
  14033. * of the PPDU containing the frame finished.
  14034. * OR
  14035. * Lower 32 bits of the TSF, snapshot of this value when transmission
  14036. * of the PPDU containing the frame started.
  14037. * <legal all>
  14038. */
  14039. A_UINT32 ppdu_transmission_tsf;
  14040. /* NOTE:
  14041. * To preserve backwards compatibility,
  14042. * no new fields can be added in this struct.
  14043. */
  14044. };
  14045. /* member definitions of htt_t2h_tx_rate_stats_info */
  14046. #define HTT_TX_RATE_STATS_INFO_VALID_M 0x00000001
  14047. #define HTT_TX_RATE_STATS_INFO_VALID_S 0
  14048. #define HTT_TX_RATE_STATS_INFO_VALID_SET(word, value) \
  14049. do { \
  14050. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_VALID, value); \
  14051. (word) |= (value) << HTT_TX_RATE_STATS_INFO_VALID_S; \
  14052. } while (0)
  14053. #define HTT_TX_RATE_STATS_INFO_VALID_GET(word) \
  14054. (((word) & HTT_TX_RATE_STATS_INFO_VALID_M) >> HTT_TX_RATE_STATS_INFO_VALID_S)
  14055. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M 0x0000000E
  14056. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S 1
  14057. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_SET(word, value) \
  14058. do { \
  14059. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_BW, value); \
  14060. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S; \
  14061. } while (0)
  14062. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_GET(word) \
  14063. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_BW_S)
  14064. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M 0x000000F0
  14065. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S 4
  14066. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_SET(word, value) \
  14067. do { \
  14068. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE, value); \
  14069. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S; \
  14070. } while (0)
  14071. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_GET(word) \
  14072. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_PKT_TYPE_S)
  14073. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M 0x00000100
  14074. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S 8
  14075. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_SET(word, value) \
  14076. do { \
  14077. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC, value); \
  14078. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S; \
  14079. } while (0)
  14080. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_GET(word) \
  14081. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_STBC_S)
  14082. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M 0x00000200
  14083. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S 9
  14084. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_SET(word, value) \
  14085. do { \
  14086. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC, value); \
  14087. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S; \
  14088. } while (0)
  14089. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_GET(word) \
  14090. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_LDPC_S)
  14091. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M 0x00000C00
  14092. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S 10
  14093. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_SET(word, value) \
  14094. do { \
  14095. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI, value); \
  14096. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S; \
  14097. } while (0)
  14098. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_GET(word) \
  14099. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_SGI_S)
  14100. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M 0x0000F000
  14101. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S 12
  14102. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_SET(word, value) \
  14103. do { \
  14104. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS, value); \
  14105. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S; \
  14106. } while (0)
  14107. #define HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_GET(word) \
  14108. (((word) & HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_M) >> HTT_TX_RATE_STATS_INFO_TRANSMIT_MCS_S)
  14109. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M 0x00010000
  14110. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S 16
  14111. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_SET(word, value) \
  14112. do { \
  14113. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION, value); \
  14114. (word) |= (value) << HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S; \
  14115. } while (0)
  14116. #define HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_GET(word) \
  14117. (((word) & HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_M) >> HTT_TX_RATE_STATS_INFO_OFDMA_TRANSMISSION_S)
  14118. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M 0x1FFE0000
  14119. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S 17
  14120. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_SET(word, value) \
  14121. do { \
  14122. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_TONES_IN_RU, value); \
  14123. (word) |= (value) << HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S; \
  14124. } while (0)
  14125. #define HTT_TX_RATE_STATS_INFO_TONES_IN_RU_GET(word) \
  14126. (((word) & HTT_TX_RATE_STATS_INFO_TONES_IN_RU_M) >> HTT_TX_RATE_STATS_INFO_TONES_IN_RU_S)
  14127. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M 0xFFFFFFFF
  14128. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S 0
  14129. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_SET(word, value) \
  14130. do { \
  14131. HTT_CHECK_SET_VAL(HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF, value); \
  14132. (word) |= (value) << HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S; \
  14133. } while (0)
  14134. #define HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_GET(word) \
  14135. (((word) & HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_M) >> HTT_TX_RATE_STATS_INFO_PPDU_TRANSMISSION_TSF_S)
  14136. struct htt_t2h_tx_msdu_info { /* 8 words */
  14137. /* words 0 + 1 */
  14138. struct htt_t2h_tx_buffer_addr_info addr_info;
  14139. /* word 2 */
  14140. A_UINT32
  14141. sw_peer_id : 16,
  14142. tid : 4,
  14143. transmit_cnt : 7,
  14144. valid : 1,
  14145. mcast : 1,
  14146. rsvd0 : 3;
  14147. /* word 3 */
  14148. A_UINT32
  14149. release_reason : 4, /* Refer to htt_t2h_tx_msdu_release_reason_e */
  14150. tqm_status_number : 24,
  14151. frame_type : 4; /* holds htt_tx_wbm_status_frame_type value */
  14152. /* word 4 */
  14153. A_UINT32
  14154. /* ack_frame_rssi:
  14155. * If this frame is removed as the result of the
  14156. * reception of an ACK or BA, this field indicates
  14157. * the RSSI of the received ACK or BA frame.
  14158. * When the frame is removed as result of a direct
  14159. * remove command from the SW, this field is set
  14160. * to 0x0 (which is never a valid value when real
  14161. * RSSI is available).
  14162. * Units: dB w.r.t noise floor
  14163. */
  14164. ack_frame_rssi : 8,
  14165. first_msdu : 1,
  14166. last_msdu : 1,
  14167. msdu_part_of_amsdu : 1,
  14168. buffer_timestamp : 19, /* units = TU = 1024 microseconds */
  14169. rsvd1 : 2;
  14170. /* words 5 + 6 */
  14171. struct htt_t2h_tx_rate_stats_info tx_rate_stats;
  14172. /* word 7 */
  14173. /* rsvd3:
  14174. * backup reserved field to add new parameters if [rsvd0, rsvd1, rsvd2]
  14175. * is not sufficient
  14176. */
  14177. A_UINT32 rsvd3;
  14178. /* NOTE:
  14179. * To preserve backwards compatibility,
  14180. * no new fields can be added in this struct.
  14181. */
  14182. };
  14183. /* member definitions of htt_t2h_tx_msdu_info */
  14184. #define HTT_TX_MSDU_INFO_SW_PEER_ID_M 0x0000FFFF
  14185. #define HTT_TX_MSDU_INFO_SW_PEER_ID_S 0
  14186. #define HTT_TX_MSDU_INFO_SW_PEER_ID_SET(word, value) \
  14187. do { \
  14188. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_SW_PEER_ID, value); \
  14189. (word) |= (value) << HTT_TX_MSDU_INFO_SW_PEER_ID_S; \
  14190. } while (0)
  14191. #define HTT_TX_MSDU_INFO_SW_PEER_ID_GET(word) \
  14192. (((word) & HTT_TX_MSDU_INFO_SW_PEER_ID_M) >> HTT_TX_MSDU_INFO_SW_PEER_ID_S)
  14193. #define HTT_TX_MSDU_INFO_TID_M 0x000F0000
  14194. #define HTT_TX_MSDU_INFO_TID_S 16
  14195. #define HTT_TX_MSDU_INFO_TID_SET(word, value) \
  14196. do { \
  14197. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TID, value); \
  14198. (word) |= (value) << HTT_TX_MSDU_INFO_TID_S; \
  14199. } while (0)
  14200. #define HTT_TX_MSDU_INFO_TID_GET(word) \
  14201. (((word) & HTT_TX_MSDU_INFO_TID_M) >> HTT_TX_MSDU_INFO_TID_S)
  14202. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_M 0x07F00000
  14203. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_S 20
  14204. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_SET(word, value) \
  14205. do { \
  14206. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TRANSMIT_CNT, value); \
  14207. (word) |= (value) << HTT_TX_MSDU_INFO_TRANSMIT_CNT_S; \
  14208. } while (0)
  14209. #define HTT_TX_MSDU_INFO_TRANSMIT_CNT_GET(word) \
  14210. (((word) & HTT_TX_MSDU_INFO_TRANSMIT_CNT_M) >> HTT_TX_MSDU_INFO_TRANSMIT_CNT_S)
  14211. #define HTT_TX_MSDU_INFO_VALID_M 0x08000000
  14212. #define HTT_TX_MSDU_INFO_VALID_S 27
  14213. #define HTT_TX_MSDU_INFO_VALID_SET(word, value) \
  14214. do { \
  14215. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_VALID, value); \
  14216. (word) |= (value) << HTT_TX_MSDU_INFO_VALID_S; \
  14217. } while (0)
  14218. #define HTT_TX_MSDU_INFO_VALID_GET(word) \
  14219. (((word) & HTT_TX_MSDU_INFO_VALID_M) >> HTT_TX_MSDU_INFO_VALID_S)
  14220. #define HTT_TX_MSDU_INFO_MCAST_M 0x10000000
  14221. #define HTT_TX_MSDU_INFO_MCAST_S 28
  14222. #define HTT_TX_MSDU_INFO_MCAST_SET(word, value) \
  14223. do { \
  14224. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MCAST, value); \
  14225. (word) |= (value) << HTT_TX_MSDU_INFO_MCAST_S; \
  14226. } while (0)
  14227. #define HTT_TX_MSDU_INFO_MCAST_GET(word) \
  14228. (((word) & HTT_TX_MSDU_INFO_MCAST_M) >> HTT_TX_MSDU_INFO_MCAST_S)
  14229. #define HTT_TX_MSDU_INFO_RELEASE_REASON_M 0x0000000F
  14230. #define HTT_TX_MSDU_INFO_RELEASE_REASON_S 0
  14231. #define HTT_TX_MSDU_INFO_RELEASE_REASON_SET(word, value) \
  14232. do { \
  14233. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_RELEASE_REASON, value); \
  14234. (word) |= (value) << HTT_TX_MSDU_INFO_RELEASE_REASON_S; \
  14235. } while (0)
  14236. #define HTT_TX_MSDU_INFO_RELEASE_REASON_GET(word) \
  14237. (((word) & HTT_TX_MSDU_INFO_RELEASE_REASON_M) >> HTT_TX_MSDU_INFO_RELEASE_REASON_S)
  14238. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M 0x0FFFFFF0
  14239. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S 4
  14240. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_SET(word, value) \
  14241. do { \
  14242. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER, value); \
  14243. (word) |= (value) << HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S; \
  14244. } while (0)
  14245. #define HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_GET(word) \
  14246. (((word) & HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_M) >> HTT_TX_MSDU_INFO_TQM_STATUS_NUMBER_S)
  14247. #define HTT_TX_MSDU_INFO_FRAME_TYPE_M 0xF0000000
  14248. #define HTT_TX_MSDU_INFO_FRAME_TYPE_S 28
  14249. #define HTT_TX_MSDU_INFO_FRAME_TYPE_SET(word, value) \
  14250. do { \
  14251. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FRAME_TYPE, value); \
  14252. (word) |= (value) << HTT_TX_MSDU_INFO_FRAME_TYPE_S; \
  14253. } while (0)
  14254. #define HTT_TX_MSDU_INFO_FRAME_TYPE_GET(word) \
  14255. (((word) & HTT_TX_MSDU_INFO_FRAME_TYPE_M) >> HTT_TX_MSDU_INFO_FRAME_TYPE_S)
  14256. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M 0x000000FF
  14257. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S 0
  14258. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_SET(word, value) \
  14259. do { \
  14260. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_ACK_FRAME_RSSI, value); \
  14261. (word) |= (value) << HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S; \
  14262. } while (0)
  14263. #define HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_GET(word) \
  14264. (((word) & HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_M) >> HTT_TX_MSDU_INFO_ACK_FRAME_RSSI_S)
  14265. #define HTT_TX_MSDU_INFO_FIRST_MSDU_M 0x00000100
  14266. #define HTT_TX_MSDU_INFO_FIRST_MSDU_S 8
  14267. #define HTT_TX_MSDU_INFO_FIRST_MSDU_SET(word, value) \
  14268. do { \
  14269. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_FIRST_MSDU, value); \
  14270. (word) |= (value) << HTT_TX_MSDU_INFO_FIRST_MSDU_S; \
  14271. } while (0)
  14272. #define HTT_TX_MSDU_INFO_FIRST_MSDU_GET(word) \
  14273. (((word) & HTT_TX_MSDU_INFO_FIRST_MSDU_M) >> HTT_TX_MSDU_INFO_FIRST_MSDU_S)
  14274. #define HTT_TX_MSDU_INFO_LAST_MSDU_M 0x00000200
  14275. #define HTT_TX_MSDU_INFO_LAST_MSDU_S 9
  14276. #define HTT_TX_MSDU_INFO_LAST_MSDU_SET(word, value) \
  14277. do { \
  14278. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_LAST_MSDU, value); \
  14279. (word) |= (value) << HTT_TX_MSDU_INFO_LAST_MSDU_S; \
  14280. } while (0)
  14281. #define HTT_TX_MSDU_INFO_LAST_MSDU_GET(word) \
  14282. (((word) & HTT_TX_MSDU_INFO_LAST_MSDU_M) >> HTT_TX_MSDU_INFO_LAST_MSDU_S)
  14283. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M 0x00000400
  14284. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S 10
  14285. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_SET(word, value) \
  14286. do { \
  14287. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU, value); \
  14288. (word) |= (value) << HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S; \
  14289. } while (0)
  14290. #define HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_GET(word) \
  14291. (((word) & HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_M) >> HTT_TX_MSDU_INFO_MSDU_PART_OF_AMSDU_S)
  14292. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M 0x3FFFF800
  14293. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S 11
  14294. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_SET(word, value) \
  14295. do { \
  14296. HTT_CHECK_SET_VAL(HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP, value); \
  14297. (word) |= (value) << HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S; \
  14298. } while (0)
  14299. #define HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_GET(word) \
  14300. (((word) & HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_M) >> HTT_TX_MSDU_INFO_BUFFER_TIMESTAMP_S)
  14301. struct htt_t2h_soft_umac_tx_compl_ind {
  14302. A_UINT32 msg_type : 8, /* HTT_T2H_MSG_TYPE_SOFT_UMAC_TX_COMPL_IND */
  14303. msdu_cnt : 8, /* min: 0, max: 255 */
  14304. rsvd0 : 16;
  14305. /* NOTE:
  14306. * To preserve backwards compatibility,
  14307. * no new fields can be added in this struct.
  14308. */
  14309. /*
  14310. * append here:
  14311. * struct htt_t2h_tx_msdu_info payload[1(or more)]
  14312. * for all the msdu's that are part of this completion.
  14313. */
  14314. };
  14315. /* member definitions of htt_t2h_soft_umac_tx_compl_ind */
  14316. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M 0x0000FF00
  14317. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S 8
  14318. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_SET(word, value) \
  14319. do { \
  14320. HTT_CHECK_SET_VAL(HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT, value); \
  14321. (word) |= (value) << HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S; \
  14322. } while (0)
  14323. #define HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_GET(word) \
  14324. (((word) & HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_M) >> HTT_SOFT_UMAC_TX_COMP_IND_MSDU_COUNT_S)
  14325. /**
  14326. * @brief target -> host rate-control update indication message
  14327. *
  14328. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  14329. *
  14330. * @details
  14331. * The following diagram shows the format of the RC Update message
  14332. * sent from the target to the host, while processing the tx-completion
  14333. * of a transmitted PPDU.
  14334. *
  14335. * |31 24|23 16|15 8|7 0|
  14336. * |-------------------------------------------------------------|
  14337. * | peer ID | vdev ID | msg_type |
  14338. * |-------------------------------------------------------------|
  14339. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  14340. * |-------------------------------------------------------------|
  14341. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  14342. * |-------------------------------------------------------------|
  14343. * | : |
  14344. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14345. * | : |
  14346. * |-------------------------------------------------------------|
  14347. * | : |
  14348. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  14349. * | : |
  14350. * |-------------------------------------------------------------|
  14351. * : :
  14352. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14353. *
  14354. */
  14355. typedef struct {
  14356. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  14357. A_UINT32 rate_code_flags;
  14358. A_UINT32 flags; /* Encodes information such as excessive
  14359. retransmission, aggregate, some info
  14360. from .11 frame control,
  14361. STBC, LDPC, (SGI and Tx Chain Mask
  14362. are encoded in ptx_rc->flags field),
  14363. AMPDU truncation (BT/time based etc.),
  14364. RTS/CTS attempt */
  14365. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  14366. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  14367. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  14368. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  14369. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  14370. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  14371. } HTT_RC_TX_DONE_PARAMS;
  14372. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  14373. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  14374. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  14375. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  14376. #define HTT_RC_UPDATE_VDEVID_S 8
  14377. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  14378. #define HTT_RC_UPDATE_PEERID_S 16
  14379. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  14380. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  14381. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  14382. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  14383. do { \
  14384. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  14385. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  14386. } while (0)
  14387. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  14388. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  14389. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  14390. do { \
  14391. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  14392. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  14393. } while (0)
  14394. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  14395. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  14396. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  14397. do { \
  14398. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  14399. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  14400. } while (0)
  14401. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  14402. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  14403. /**
  14404. * @brief target -> host rx fragment indication message definition
  14405. *
  14406. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  14407. *
  14408. * @details
  14409. * The following field definitions describe the format of the rx fragment
  14410. * indication message sent from the target to the host.
  14411. * The rx fragment indication message shares the format of the
  14412. * rx indication message, but not all fields from the rx indication message
  14413. * are relevant to the rx fragment indication message.
  14414. *
  14415. *
  14416. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  14417. * |-----------+-------------------+---------------------+-------------|
  14418. * | peer ID | |FV| ext TID | msg type |
  14419. * |-------------------------------------------------------------------|
  14420. * | | flush | flush |
  14421. * | | end | start |
  14422. * | | seq num | seq num |
  14423. * |-------------------------------------------------------------------|
  14424. * | reserved | FW rx desc bytes |
  14425. * |-------------------------------------------------------------------|
  14426. * | | FW MSDU Rx |
  14427. * | | desc B0 |
  14428. * |-------------------------------------------------------------------|
  14429. * Header fields:
  14430. * - MSG_TYPE
  14431. * Bits 7:0
  14432. * Purpose: identifies this as an rx fragment indication message
  14433. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  14434. * - EXT_TID
  14435. * Bits 12:8
  14436. * Purpose: identify the traffic ID of the rx data, including
  14437. * special "extended" TID values for multicast, broadcast, and
  14438. * non-QoS data frames
  14439. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  14440. * - FLUSH_VALID (FV)
  14441. * Bit 13
  14442. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  14443. * is valid
  14444. * Value:
  14445. * 1 -> flush IE is valid and needs to be processed
  14446. * 0 -> flush IE is not valid and should be ignored
  14447. * - PEER_ID
  14448. * Bits 31:16
  14449. * Purpose: Identify, by ID, which peer sent the rx data
  14450. * Value: ID of the peer who sent the rx data
  14451. * - FLUSH_SEQ_NUM_START
  14452. * Bits 5:0
  14453. * Purpose: Indicate the start of a series of MPDUs to flush
  14454. * Not all MPDUs within this series are necessarily valid - the host
  14455. * must check each sequence number within this range to see if the
  14456. * corresponding MPDU is actually present.
  14457. * This field is only valid if the FV bit is set.
  14458. * Value:
  14459. * The sequence number for the first MPDUs to check to flush.
  14460. * The sequence number is masked by 0x3f.
  14461. * - FLUSH_SEQ_NUM_END
  14462. * Bits 11:6
  14463. * Purpose: Indicate the end of a series of MPDUs to flush
  14464. * Value:
  14465. * The sequence number one larger than the sequence number of the
  14466. * last MPDU to check to flush.
  14467. * The sequence number is masked by 0x3f.
  14468. * Not all MPDUs within this series are necessarily valid - the host
  14469. * must check each sequence number within this range to see if the
  14470. * corresponding MPDU is actually present.
  14471. * This field is only valid if the FV bit is set.
  14472. * Rx descriptor fields:
  14473. * - FW_RX_DESC_BYTES
  14474. * Bits 15:0
  14475. * Purpose: Indicate how many bytes in the Rx indication are used for
  14476. * FW Rx descriptors
  14477. * Value: 1
  14478. */
  14479. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  14480. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  14481. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  14482. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  14483. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  14484. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  14485. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  14486. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  14487. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  14488. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  14489. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  14490. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  14491. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  14492. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  14493. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  14494. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  14495. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  14496. #define HTT_RX_FRAG_IND_BYTES \
  14497. (4 /* msg hdr */ + \
  14498. 4 /* flush spec */ + \
  14499. 4 /* (unused) FW rx desc bytes spec */ + \
  14500. 4 /* FW rx desc */)
  14501. /**
  14502. * @brief target -> host test message definition
  14503. *
  14504. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  14505. *
  14506. * @details
  14507. * The following field definitions describe the format of the test
  14508. * message sent from the target to the host.
  14509. * The message consists of a 4-octet header, followed by a variable
  14510. * number of 32-bit integer values, followed by a variable number
  14511. * of 8-bit character values.
  14512. *
  14513. * |31 16|15 8|7 0|
  14514. * |-----------------------------------------------------------|
  14515. * | num chars | num ints | msg type |
  14516. * |-----------------------------------------------------------|
  14517. * | int 0 |
  14518. * |-----------------------------------------------------------|
  14519. * | int 1 |
  14520. * |-----------------------------------------------------------|
  14521. * | ... |
  14522. * |-----------------------------------------------------------|
  14523. * | char 3 | char 2 | char 1 | char 0 |
  14524. * |-----------------------------------------------------------|
  14525. * | | | ... | char 4 |
  14526. * |-----------------------------------------------------------|
  14527. * - MSG_TYPE
  14528. * Bits 7:0
  14529. * Purpose: identifies this as a test message
  14530. * Value: HTT_MSG_TYPE_TEST
  14531. * - NUM_INTS
  14532. * Bits 15:8
  14533. * Purpose: indicate how many 32-bit integers follow the message header
  14534. * - NUM_CHARS
  14535. * Bits 31:16
  14536. * Purpose: indicate how many 8-bit characters follow the series of integers
  14537. */
  14538. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  14539. #define HTT_RX_TEST_NUM_INTS_S 8
  14540. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  14541. #define HTT_RX_TEST_NUM_CHARS_S 16
  14542. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  14543. do { \
  14544. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  14545. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  14546. } while (0)
  14547. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  14548. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  14549. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  14550. do { \
  14551. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  14552. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  14553. } while (0)
  14554. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  14555. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  14556. /**
  14557. * @brief target -> host packet log message
  14558. *
  14559. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  14560. *
  14561. * @details
  14562. * The following field definitions describe the format of the packet log
  14563. * message sent from the target to the host.
  14564. * The message consists of a 4-octet header,followed by a variable number
  14565. * of 32-bit character values.
  14566. *
  14567. * |31 16|15 12|11 10|9 8|7 0|
  14568. * |------------------------------------------------------------------|
  14569. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  14570. * |------------------------------------------------------------------|
  14571. * | payload |
  14572. * |------------------------------------------------------------------|
  14573. * - MSG_TYPE
  14574. * Bits 7:0
  14575. * Purpose: identifies this as a pktlog message
  14576. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  14577. * - mac_id
  14578. * Bits 9:8
  14579. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  14580. * Value: 0-3
  14581. * - pdev_id
  14582. * Bits 11:10
  14583. * Purpose: pdev_id
  14584. * Value: 0-3
  14585. * 0 (for rings at SOC level),
  14586. * 1/2/3 PDEV -> 0/1/2
  14587. * - payload_size
  14588. * Bits 31:16
  14589. * Purpose: explicitly specify the payload size
  14590. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  14591. */
  14592. PREPACK struct htt_pktlog_msg {
  14593. A_UINT32 header;
  14594. A_UINT32 payload[1/* or more */];
  14595. } POSTPACK;
  14596. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  14597. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  14598. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  14599. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  14600. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  14601. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  14602. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  14603. do { \
  14604. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  14605. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  14606. } while (0)
  14607. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  14608. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  14609. HTT_T2H_PKTLOG_MAC_ID_S)
  14610. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  14611. do { \
  14612. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  14613. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  14614. } while (0)
  14615. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  14616. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  14617. HTT_T2H_PKTLOG_PDEV_ID_S)
  14618. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  14619. do { \
  14620. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  14621. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  14622. } while (0)
  14623. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  14624. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  14625. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  14626. /*
  14627. * Rx reorder statistics
  14628. * NB: all the fields must be defined in 4 octets size.
  14629. */
  14630. struct rx_reorder_stats {
  14631. /* Non QoS MPDUs received */
  14632. A_UINT32 deliver_non_qos;
  14633. /* MPDUs received in-order */
  14634. A_UINT32 deliver_in_order;
  14635. /* Flush due to reorder timer expired */
  14636. A_UINT32 deliver_flush_timeout;
  14637. /* Flush due to move out of window */
  14638. A_UINT32 deliver_flush_oow;
  14639. /* Flush due to DELBA */
  14640. A_UINT32 deliver_flush_delba;
  14641. /* MPDUs dropped due to FCS error */
  14642. A_UINT32 fcs_error;
  14643. /* MPDUs dropped due to monitor mode non-data packet */
  14644. A_UINT32 mgmt_ctrl;
  14645. /* Unicast-data MPDUs dropped due to invalid peer */
  14646. A_UINT32 invalid_peer;
  14647. /* MPDUs dropped due to duplication (non aggregation) */
  14648. A_UINT32 dup_non_aggr;
  14649. /* MPDUs dropped due to processed before */
  14650. A_UINT32 dup_past;
  14651. /* MPDUs dropped due to duplicate in reorder queue */
  14652. A_UINT32 dup_in_reorder;
  14653. /* Reorder timeout happened */
  14654. A_UINT32 reorder_timeout;
  14655. /* invalid bar ssn */
  14656. A_UINT32 invalid_bar_ssn;
  14657. /* reorder reset due to bar ssn */
  14658. A_UINT32 ssn_reset;
  14659. /* Flush due to delete peer */
  14660. A_UINT32 deliver_flush_delpeer;
  14661. /* Flush due to offload*/
  14662. A_UINT32 deliver_flush_offload;
  14663. /* Flush due to out of buffer*/
  14664. A_UINT32 deliver_flush_oob;
  14665. /* MPDUs dropped due to PN check fail */
  14666. A_UINT32 pn_fail;
  14667. /* MPDUs dropped due to unable to allocate memory */
  14668. A_UINT32 store_fail;
  14669. /* Number of times the tid pool alloc succeeded */
  14670. A_UINT32 tid_pool_alloc_succ;
  14671. /* Number of times the MPDU pool alloc succeeded */
  14672. A_UINT32 mpdu_pool_alloc_succ;
  14673. /* Number of times the MSDU pool alloc succeeded */
  14674. A_UINT32 msdu_pool_alloc_succ;
  14675. /* Number of times the tid pool alloc failed */
  14676. A_UINT32 tid_pool_alloc_fail;
  14677. /* Number of times the MPDU pool alloc failed */
  14678. A_UINT32 mpdu_pool_alloc_fail;
  14679. /* Number of times the MSDU pool alloc failed */
  14680. A_UINT32 msdu_pool_alloc_fail;
  14681. /* Number of times the tid pool freed */
  14682. A_UINT32 tid_pool_free;
  14683. /* Number of times the MPDU pool freed */
  14684. A_UINT32 mpdu_pool_free;
  14685. /* Number of times the MSDU pool freed */
  14686. A_UINT32 msdu_pool_free;
  14687. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  14688. A_UINT32 msdu_queued;
  14689. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  14690. A_UINT32 msdu_recycled;
  14691. /* Number of MPDUs with invalid peer but A2 found in AST */
  14692. A_UINT32 invalid_peer_a2_in_ast;
  14693. /* Number of MPDUs with invalid peer but A3 found in AST */
  14694. A_UINT32 invalid_peer_a3_in_ast;
  14695. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  14696. A_UINT32 invalid_peer_bmc_mpdus;
  14697. /* Number of MSDUs with err attention word */
  14698. A_UINT32 rxdesc_err_att;
  14699. /* Number of MSDUs with flag of peer_idx_invalid */
  14700. A_UINT32 rxdesc_err_peer_idx_inv;
  14701. /* Number of MSDUs with flag of peer_idx_timeout */
  14702. A_UINT32 rxdesc_err_peer_idx_to;
  14703. /* Number of MSDUs with flag of overflow */
  14704. A_UINT32 rxdesc_err_ov;
  14705. /* Number of MSDUs with flag of msdu_length_err */
  14706. A_UINT32 rxdesc_err_msdu_len;
  14707. /* Number of MSDUs with flag of mpdu_length_err */
  14708. A_UINT32 rxdesc_err_mpdu_len;
  14709. /* Number of MSDUs with flag of tkip_mic_err */
  14710. A_UINT32 rxdesc_err_tkip_mic;
  14711. /* Number of MSDUs with flag of decrypt_err */
  14712. A_UINT32 rxdesc_err_decrypt;
  14713. /* Number of MSDUs with flag of fcs_err */
  14714. A_UINT32 rxdesc_err_fcs;
  14715. /* Number of Unicast (bc_mc bit is not set in attention word)
  14716. * frames with invalid peer handler
  14717. */
  14718. A_UINT32 rxdesc_uc_msdus_inv_peer;
  14719. /* Number of unicast frame directly (direct bit is set in attention word)
  14720. * to DUT with invalid peer handler
  14721. */
  14722. A_UINT32 rxdesc_direct_msdus_inv_peer;
  14723. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  14724. * frames with invalid peer handler
  14725. */
  14726. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  14727. /* Number of MSDUs dropped due to no first MSDU flag */
  14728. A_UINT32 rxdesc_no_1st_msdu;
  14729. /* Number of MSDUs dropped due to ring overflow */
  14730. A_UINT32 msdu_drop_ring_ov;
  14731. /* Number of MSDUs dropped due to FC mismatch */
  14732. A_UINT32 msdu_drop_fc_mismatch;
  14733. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  14734. A_UINT32 msdu_drop_mgmt_remote_ring;
  14735. /* Number of MSDUs dropped due to errors not reported in attention word */
  14736. A_UINT32 msdu_drop_misc;
  14737. /* Number of MSDUs go to offload before reorder */
  14738. A_UINT32 offload_msdu_wal;
  14739. /* Number of data frame dropped by offload after reorder */
  14740. A_UINT32 offload_msdu_reorder;
  14741. /* Number of MPDUs with sequence number in the past and within the BA window */
  14742. A_UINT32 dup_past_within_window;
  14743. /* Number of MPDUs with sequence number in the past and outside the BA window */
  14744. A_UINT32 dup_past_outside_window;
  14745. /* Number of MSDUs with decrypt/MIC error */
  14746. A_UINT32 rxdesc_err_decrypt_mic;
  14747. /* Number of data MSDUs received on both local and remote rings */
  14748. A_UINT32 data_msdus_on_both_rings;
  14749. /* MPDUs never filled */
  14750. A_UINT32 holes_not_filled;
  14751. };
  14752. /*
  14753. * Rx Remote buffer statistics
  14754. * NB: all the fields must be defined in 4 octets size.
  14755. */
  14756. struct rx_remote_buffer_mgmt_stats {
  14757. /* Total number of MSDUs reaped for Rx processing */
  14758. A_UINT32 remote_reaped;
  14759. /* MSDUs recycled within firmware */
  14760. A_UINT32 remote_recycled;
  14761. /* MSDUs stored by Data Rx */
  14762. A_UINT32 data_rx_msdus_stored;
  14763. /* Number of HTT indications from WAL Rx MSDU */
  14764. A_UINT32 wal_rx_ind;
  14765. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  14766. A_UINT32 wal_rx_ind_unconsumed;
  14767. /* Number of HTT indications from Data Rx MSDU */
  14768. A_UINT32 data_rx_ind;
  14769. /* Number of unconsumed HTT indications from Data Rx MSDU */
  14770. A_UINT32 data_rx_ind_unconsumed;
  14771. /* Number of HTT indications from ATHBUF */
  14772. A_UINT32 athbuf_rx_ind;
  14773. /* Number of remote buffers requested for refill */
  14774. A_UINT32 refill_buf_req;
  14775. /* Number of remote buffers filled by the host */
  14776. A_UINT32 refill_buf_rsp;
  14777. /* Number of times MAC hw_index = f/w write_index */
  14778. A_INT32 mac_no_bufs;
  14779. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  14780. A_INT32 fw_indices_equal;
  14781. /* Number of times f/w finds no buffers to post */
  14782. A_INT32 host_no_bufs;
  14783. };
  14784. /*
  14785. * TXBF MU/SU packets and NDPA statistics
  14786. * NB: all the fields must be defined in 4 octets size.
  14787. */
  14788. struct rx_txbf_musu_ndpa_pkts_stats {
  14789. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  14790. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  14791. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  14792. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  14793. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  14794. A_UINT32 reserved[3]; /* must be set to 0x0 */
  14795. };
  14796. /*
  14797. * htt_dbg_stats_status -
  14798. * present - The requested stats have been delivered in full.
  14799. * This indicates that either the stats information was contained
  14800. * in its entirety within this message, or else this message
  14801. * completes the delivery of the requested stats info that was
  14802. * partially delivered through earlier STATS_CONF messages.
  14803. * partial - The requested stats have been delivered in part.
  14804. * One or more subsequent STATS_CONF messages with the same
  14805. * cookie value will be sent to deliver the remainder of the
  14806. * information.
  14807. * error - The requested stats could not be delivered, for example due
  14808. * to a shortage of memory to construct a message holding the
  14809. * requested stats.
  14810. * invalid - The requested stat type is either not recognized, or the
  14811. * target is configured to not gather the stats type in question.
  14812. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  14813. * series_done - This special value indicates that no further stats info
  14814. * elements are present within a series of stats info elems
  14815. * (within a stats upload confirmation message).
  14816. */
  14817. enum htt_dbg_stats_status {
  14818. HTT_DBG_STATS_STATUS_PRESENT = 0,
  14819. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  14820. HTT_DBG_STATS_STATUS_ERROR = 2,
  14821. HTT_DBG_STATS_STATUS_INVALID = 3,
  14822. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  14823. };
  14824. /**
  14825. * @brief target -> host statistics upload
  14826. *
  14827. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  14828. *
  14829. * @details
  14830. * The following field definitions describe the format of the HTT target
  14831. * to host stats upload confirmation message.
  14832. * The message contains a cookie echoed from the HTT host->target stats
  14833. * upload request, which identifies which request the confirmation is
  14834. * for, and a series of tag-length-value stats information elements.
  14835. * The tag-length header for each stats info element also includes a
  14836. * status field, to indicate whether the request for the stat type in
  14837. * question was fully met, partially met, unable to be met, or invalid
  14838. * (if the stat type in question is disabled in the target).
  14839. * A special value of all 1's in this status field is used to indicate
  14840. * the end of the series of stats info elements.
  14841. *
  14842. *
  14843. * |31 16|15 8|7 5|4 0|
  14844. * |------------------------------------------------------------|
  14845. * | reserved | msg type |
  14846. * |------------------------------------------------------------|
  14847. * | cookie LSBs |
  14848. * |------------------------------------------------------------|
  14849. * | cookie MSBs |
  14850. * |------------------------------------------------------------|
  14851. * | stats entry length | reserved | S |stat type|
  14852. * |------------------------------------------------------------|
  14853. * | |
  14854. * | type-specific stats info |
  14855. * | |
  14856. * |------------------------------------------------------------|
  14857. * | stats entry length | reserved | S |stat type|
  14858. * |------------------------------------------------------------|
  14859. * | |
  14860. * | type-specific stats info |
  14861. * | |
  14862. * |------------------------------------------------------------|
  14863. * | n/a | reserved | 111 | n/a |
  14864. * |------------------------------------------------------------|
  14865. * Header fields:
  14866. * - MSG_TYPE
  14867. * Bits 7:0
  14868. * Purpose: identifies this is a statistics upload confirmation message
  14869. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  14870. * - COOKIE_LSBS
  14871. * Bits 31:0
  14872. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14873. * message with its preceding host->target stats request message.
  14874. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14875. * - COOKIE_MSBS
  14876. * Bits 31:0
  14877. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14878. * message with its preceding host->target stats request message.
  14879. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14880. *
  14881. * Stats Information Element tag-length header fields:
  14882. * - STAT_TYPE
  14883. * Bits 4:0
  14884. * Purpose: identifies the type of statistics info held in the
  14885. * following information element
  14886. * Value: htt_dbg_stats_type
  14887. * - STATUS
  14888. * Bits 7:5
  14889. * Purpose: indicate whether the requested stats are present
  14890. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  14891. * the completion of the stats entry series
  14892. * - LENGTH
  14893. * Bits 31:16
  14894. * Purpose: indicate the stats information size
  14895. * Value: This field specifies the number of bytes of stats information
  14896. * that follows the element tag-length header.
  14897. * It is expected but not required that this length is a multiple of
  14898. * 4 bytes. Even if the length is not an integer multiple of 4, the
  14899. * subsequent stats entry header will begin on a 4-byte aligned
  14900. * boundary.
  14901. */
  14902. #define HTT_T2H_STATS_COOKIE_SIZE 8
  14903. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  14904. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  14905. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  14906. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  14907. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  14908. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  14909. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  14910. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14911. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  14912. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  14913. do { \
  14914. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  14915. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  14916. } while (0)
  14917. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  14918. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  14919. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  14920. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  14921. do { \
  14922. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  14923. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  14924. } while (0)
  14925. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  14926. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  14927. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  14928. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14929. do { \
  14930. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  14931. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  14932. } while (0)
  14933. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  14934. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  14935. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  14936. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  14937. #define HTT_MAX_AGGR 64
  14938. #define HTT_HL_MAX_AGGR 18
  14939. /**
  14940. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  14941. *
  14942. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  14943. *
  14944. * @details
  14945. * The following field definitions describe the format of the HTT host
  14946. * to target frag_desc/msdu_ext bank configuration message.
  14947. * The message contains the based address and the min and max id of the
  14948. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  14949. * MSDU_EXT/FRAG_DESC.
  14950. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  14951. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  14952. * the hardware does the mapping/translation.
  14953. *
  14954. * Total banks that can be configured is configured to 16.
  14955. *
  14956. * This should be called before any TX has be initiated by the HTT
  14957. *
  14958. * |31 16|15 8|7 5|4 0|
  14959. * |------------------------------------------------------------|
  14960. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  14961. * |------------------------------------------------------------|
  14962. * | BANK0_BASE_ADDRESS (bits 31:0) |
  14963. #if HTT_PADDR64
  14964. * | BANK0_BASE_ADDRESS (bits 63:32) |
  14965. #endif
  14966. * |------------------------------------------------------------|
  14967. * | ... |
  14968. * |------------------------------------------------------------|
  14969. * | BANK15_BASE_ADDRESS (bits 31:0) |
  14970. #if HTT_PADDR64
  14971. * | BANK15_BASE_ADDRESS (bits 63:32) |
  14972. #endif
  14973. * |------------------------------------------------------------|
  14974. * | BANK0_MAX_ID | BANK0_MIN_ID |
  14975. * |------------------------------------------------------------|
  14976. * | ... |
  14977. * |------------------------------------------------------------|
  14978. * | BANK15_MAX_ID | BANK15_MIN_ID |
  14979. * |------------------------------------------------------------|
  14980. * Header fields:
  14981. * - MSG_TYPE
  14982. * Bits 7:0
  14983. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  14984. * for systems with 64-bit format for bus addresses:
  14985. * - BANKx_BASE_ADDRESS_LO
  14986. * Bits 31:0
  14987. * Purpose: Provide a mechanism to specify the base address of the
  14988. * MSDU_EXT bank physical/bus address.
  14989. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  14990. * - BANKx_BASE_ADDRESS_HI
  14991. * Bits 31:0
  14992. * Purpose: Provide a mechanism to specify the base address of the
  14993. * MSDU_EXT bank physical/bus address.
  14994. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  14995. * for systems with 32-bit format for bus addresses:
  14996. * - BANKx_BASE_ADDRESS
  14997. * Bits 31:0
  14998. * Purpose: Provide a mechanism to specify the base address of the
  14999. * MSDU_EXT bank physical/bus address.
  15000. * Value: MSDU_EXT bank physical / bus address
  15001. * - BANKx_MIN_ID
  15002. * Bits 15:0
  15003. * Purpose: Provide a mechanism to specify the min index that needs to
  15004. * mapped.
  15005. * - BANKx_MAX_ID
  15006. * Bits 31:16
  15007. * Purpose: Provide a mechanism to specify the max index that needs to
  15008. * mapped.
  15009. *
  15010. */
  15011. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  15012. * safe value.
  15013. * @note MAX supported banks is 16.
  15014. */
  15015. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  15016. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  15017. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  15018. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  15019. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  15020. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  15021. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  15022. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  15023. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  15024. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  15025. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  15026. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  15027. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  15028. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  15029. do { \
  15030. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  15031. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  15032. } while (0)
  15033. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  15034. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  15035. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  15036. do { \
  15037. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  15038. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  15039. } while (0)
  15040. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  15041. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  15042. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  15043. do { \
  15044. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  15045. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  15046. } while (0)
  15047. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  15048. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  15049. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  15050. do { \
  15051. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  15052. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  15053. } while (0)
  15054. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  15055. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  15056. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  15057. do { \
  15058. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  15059. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  15060. } while (0)
  15061. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  15062. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  15063. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  15064. do { \
  15065. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  15066. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  15067. } while (0)
  15068. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  15069. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  15070. /*
  15071. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  15072. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  15073. * addresses are stored in a XXX-bit field.
  15074. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  15075. * htt_tx_frag_desc64_bank_cfg_t structs.
  15076. */
  15077. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  15078. _paddr_bits_, \
  15079. _paddr__bank_base_address_) \
  15080. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  15081. /** word 0 \
  15082. * msg_type: 8, \
  15083. * pdev_id: 2, \
  15084. * swap: 1, \
  15085. * reserved0: 5, \
  15086. * num_banks: 8, \
  15087. * desc_size: 8; \
  15088. */ \
  15089. A_UINT32 word0; \
  15090. /* \
  15091. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  15092. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  15093. * the second A_UINT32). \
  15094. */ \
  15095. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  15096. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  15097. } POSTPACK
  15098. /* define htt_tx_frag_desc32_bank_cfg_t */
  15099. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  15100. /* define htt_tx_frag_desc64_bank_cfg_t */
  15101. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  15102. /*
  15103. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  15104. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  15105. */
  15106. #if HTT_PADDR64
  15107. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  15108. #else
  15109. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  15110. #endif
  15111. /**
  15112. * @brief target -> host HTT TX Credit total count update message definition
  15113. *
  15114. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  15115. *
  15116. *|31 16|15|14 9| 8 |7 0 |
  15117. *|---------------------+--+----------+-------+----------|
  15118. *|cur htt credit delta | Q| reserved | sign | msg type |
  15119. *|------------------------------------------------------|
  15120. *
  15121. * Header fields:
  15122. * - MSG_TYPE
  15123. * Bits 7:0
  15124. * Purpose: identifies this as a htt tx credit delta update message
  15125. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  15126. * - SIGN
  15127. * Bits 8
  15128. * identifies whether credit delta is positive or negative
  15129. * Value:
  15130. * - 0x0: credit delta is positive, rebalance in some buffers
  15131. * - 0x1: credit delta is negative, rebalance out some buffers
  15132. * - reserved
  15133. * Bits 14:9
  15134. * Value: 0x0
  15135. * - TXQ_GRP
  15136. * Bit 15
  15137. * Purpose: indicates whether any tx queue group information elements
  15138. * are appended to the tx credit update message
  15139. * Value: 0 -> no tx queue group information element is present
  15140. * 1 -> a tx queue group information element immediately follows
  15141. * - DELTA_COUNT
  15142. * Bits 31:16
  15143. * Purpose: Specify current htt credit delta absolute count
  15144. */
  15145. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  15146. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  15147. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  15148. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  15149. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  15150. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  15151. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  15152. do { \
  15153. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  15154. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  15155. } while (0)
  15156. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  15157. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  15158. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  15159. do { \
  15160. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  15161. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  15162. } while (0)
  15163. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  15164. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  15165. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  15166. do { \
  15167. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  15168. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  15169. } while (0)
  15170. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  15171. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  15172. #define HTT_TX_CREDIT_MSG_BYTES 4
  15173. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  15174. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  15175. /**
  15176. * @brief HTT WDI_IPA Operation Response Message
  15177. *
  15178. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  15179. *
  15180. * @details
  15181. * HTT WDI_IPA Operation Response message is sent by target
  15182. * to host confirming suspend or resume operation.
  15183. * |31 24|23 16|15 8|7 0|
  15184. * |----------------+----------------+----------------+----------------|
  15185. * | op_code | Rsvd | msg_type |
  15186. * |-------------------------------------------------------------------|
  15187. * | Rsvd | Response len |
  15188. * |-------------------------------------------------------------------|
  15189. * | |
  15190. * | Response-type specific info |
  15191. * | |
  15192. * | |
  15193. * |-------------------------------------------------------------------|
  15194. * Header fields:
  15195. * - MSG_TYPE
  15196. * Bits 7:0
  15197. * Purpose: Identifies this as WDI_IPA Operation Response message
  15198. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  15199. * - OP_CODE
  15200. * Bits 31:16
  15201. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  15202. * value: = enum htt_wdi_ipa_op_code
  15203. * - RSP_LEN
  15204. * Bits 16:0
  15205. * Purpose: length for the response-type specific info
  15206. * value: = length in bytes for response-type specific info
  15207. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  15208. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  15209. */
  15210. PREPACK struct htt_wdi_ipa_op_response_t
  15211. {
  15212. /* DWORD 0: flags and meta-data */
  15213. A_UINT32
  15214. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15215. reserved1: 8,
  15216. op_code: 16;
  15217. A_UINT32
  15218. rsp_len: 16,
  15219. reserved2: 16;
  15220. } POSTPACK;
  15221. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  15222. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  15223. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  15224. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  15225. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  15226. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  15227. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  15228. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  15229. do { \
  15230. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  15231. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  15232. } while (0)
  15233. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  15234. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  15235. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  15236. do { \
  15237. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  15238. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  15239. } while (0)
  15240. enum htt_phy_mode {
  15241. htt_phy_mode_11a = 0,
  15242. htt_phy_mode_11g = 1,
  15243. htt_phy_mode_11b = 2,
  15244. htt_phy_mode_11g_only = 3,
  15245. htt_phy_mode_11na_ht20 = 4,
  15246. htt_phy_mode_11ng_ht20 = 5,
  15247. htt_phy_mode_11na_ht40 = 6,
  15248. htt_phy_mode_11ng_ht40 = 7,
  15249. htt_phy_mode_11ac_vht20 = 8,
  15250. htt_phy_mode_11ac_vht40 = 9,
  15251. htt_phy_mode_11ac_vht80 = 10,
  15252. htt_phy_mode_11ac_vht20_2g = 11,
  15253. htt_phy_mode_11ac_vht40_2g = 12,
  15254. htt_phy_mode_11ac_vht80_2g = 13,
  15255. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  15256. htt_phy_mode_11ac_vht160 = 15,
  15257. htt_phy_mode_max,
  15258. };
  15259. /**
  15260. * @brief target -> host HTT channel change indication
  15261. *
  15262. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  15263. *
  15264. * @details
  15265. * Specify when a channel change occurs.
  15266. * This allows the host to precisely determine which rx frames arrived
  15267. * on the old channel and which rx frames arrived on the new channel.
  15268. *
  15269. *|31 |7 0 |
  15270. *|-------------------------------------------+----------|
  15271. *| reserved | msg type |
  15272. *|------------------------------------------------------|
  15273. *| primary_chan_center_freq_mhz |
  15274. *|------------------------------------------------------|
  15275. *| contiguous_chan1_center_freq_mhz |
  15276. *|------------------------------------------------------|
  15277. *| contiguous_chan2_center_freq_mhz |
  15278. *|------------------------------------------------------|
  15279. *| phy_mode |
  15280. *|------------------------------------------------------|
  15281. *
  15282. * Header fields:
  15283. * - MSG_TYPE
  15284. * Bits 7:0
  15285. * Purpose: identifies this as a htt channel change indication message
  15286. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  15287. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  15288. * Bits 31:0
  15289. * Purpose: identify the (center of the) new 20 MHz primary channel
  15290. * Value: center frequency of the 20 MHz primary channel, in MHz units
  15291. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  15292. * Bits 31:0
  15293. * Purpose: identify the (center of the) contiguous frequency range
  15294. * comprising the new channel.
  15295. * For example, if the new channel is a 80 MHz channel extending
  15296. * 60 MHz beyond the primary channel, this field would be 30 larger
  15297. * than the primary channel center frequency field.
  15298. * Value: center frequency of the contiguous frequency range comprising
  15299. * the full channel in MHz units
  15300. * (80+80 channels also use the CONTIG_CHAN2 field)
  15301. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  15302. * Bits 31:0
  15303. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  15304. * within a VHT 80+80 channel.
  15305. * This field is only relevant for VHT 80+80 channels.
  15306. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  15307. * channel (arbitrary value for cases besides VHT 80+80)
  15308. * - PHY_MODE
  15309. * Bits 31:0
  15310. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  15311. * and band
  15312. * Value: htt_phy_mode enum value
  15313. */
  15314. PREPACK struct htt_chan_change_t
  15315. {
  15316. /* DWORD 0: flags and meta-data */
  15317. A_UINT32
  15318. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  15319. reserved1: 24;
  15320. A_UINT32 primary_chan_center_freq_mhz;
  15321. A_UINT32 contig_chan1_center_freq_mhz;
  15322. A_UINT32 contig_chan2_center_freq_mhz;
  15323. A_UINT32 phy_mode;
  15324. } POSTPACK;
  15325. /*
  15326. * Due to historical / backwards-compatibility reasons, maintain the
  15327. * below htt_chan_change_msg struct definition, which needs to be
  15328. * consistent with the above htt_chan_change_t struct definition
  15329. * (aside from the htt_chan_change_t definition including the msg_type
  15330. * dword within the message, and the htt_chan_change_msg only containing
  15331. * the payload of the message that follows the msg_type dword).
  15332. */
  15333. PREPACK struct htt_chan_change_msg {
  15334. A_UINT32 chan_mhz; /* frequency in mhz */
  15335. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  15336. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  15337. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  15338. } POSTPACK;
  15339. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  15340. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  15341. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  15342. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  15343. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  15344. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  15345. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  15346. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  15347. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  15348. do { \
  15349. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  15350. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  15351. } while (0)
  15352. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  15353. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  15354. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  15355. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  15356. do { \
  15357. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  15358. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  15359. } while (0)
  15360. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  15361. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  15362. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  15363. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  15364. do { \
  15365. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  15366. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  15367. } while (0)
  15368. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  15369. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  15370. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  15371. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  15372. do { \
  15373. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  15374. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  15375. } while (0)
  15376. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  15377. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  15378. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  15379. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  15380. /**
  15381. * @brief rx offload packet error message
  15382. *
  15383. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  15384. *
  15385. * @details
  15386. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  15387. * of target payload like mic err.
  15388. *
  15389. * |31 24|23 16|15 8|7 0|
  15390. * |----------------+----------------+----------------+----------------|
  15391. * | tid | vdev_id | msg_sub_type | msg_type |
  15392. * |-------------------------------------------------------------------|
  15393. * : (sub-type dependent content) :
  15394. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15395. * Header fields:
  15396. * - msg_type
  15397. * Bits 7:0
  15398. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  15399. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  15400. * - msg_sub_type
  15401. * Bits 15:8
  15402. * Purpose: Identifies which type of rx error is reported by this message
  15403. * value: htt_rx_ofld_pkt_err_type
  15404. * - vdev_id
  15405. * Bits 23:16
  15406. * Purpose: Identifies which vdev received the erroneous rx frame
  15407. * value:
  15408. * - tid
  15409. * Bits 31:24
  15410. * Purpose: Identifies the traffic type of the rx frame
  15411. * value:
  15412. *
  15413. * - The payload fields used if the sub-type == MIC error are shown below.
  15414. * Note - MIC err is per MSDU, while PN is per MPDU.
  15415. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  15416. * with MIC err in A-MSDU case, so FW will send only one HTT message
  15417. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  15418. * instead of sending separate HTT messages for each wrong MSDU within
  15419. * the MPDU.
  15420. *
  15421. * |31 24|23 16|15 8|7 0|
  15422. * |----------------+----------------+----------------+----------------|
  15423. * | Rsvd | key_id | peer_id |
  15424. * |-------------------------------------------------------------------|
  15425. * | receiver MAC addr 31:0 |
  15426. * |-------------------------------------------------------------------|
  15427. * | Rsvd | receiver MAC addr 47:32 |
  15428. * |-------------------------------------------------------------------|
  15429. * | transmitter MAC addr 31:0 |
  15430. * |-------------------------------------------------------------------|
  15431. * | Rsvd | transmitter MAC addr 47:32 |
  15432. * |-------------------------------------------------------------------|
  15433. * | PN 31:0 |
  15434. * |-------------------------------------------------------------------|
  15435. * | Rsvd | PN 47:32 |
  15436. * |-------------------------------------------------------------------|
  15437. * - peer_id
  15438. * Bits 15:0
  15439. * Purpose: identifies which peer is frame is from
  15440. * value:
  15441. * - key_id
  15442. * Bits 23:16
  15443. * Purpose: identifies key_id of rx frame
  15444. * value:
  15445. * - RA_31_0 (receiver MAC addr 31:0)
  15446. * Bits 31:0
  15447. * Purpose: identifies by MAC address which vdev received the frame
  15448. * value: MAC address lower 4 bytes
  15449. * - RA_47_32 (receiver MAC addr 47:32)
  15450. * Bits 15:0
  15451. * Purpose: identifies by MAC address which vdev received the frame
  15452. * value: MAC address upper 2 bytes
  15453. * - TA_31_0 (transmitter MAC addr 31:0)
  15454. * Bits 31:0
  15455. * Purpose: identifies by MAC address which peer transmitted the frame
  15456. * value: MAC address lower 4 bytes
  15457. * - TA_47_32 (transmitter MAC addr 47:32)
  15458. * Bits 15:0
  15459. * Purpose: identifies by MAC address which peer transmitted the frame
  15460. * value: MAC address upper 2 bytes
  15461. * - PN_31_0
  15462. * Bits 31:0
  15463. * Purpose: Identifies pn of rx frame
  15464. * value: PN lower 4 bytes
  15465. * - PN_47_32
  15466. * Bits 15:0
  15467. * Purpose: Identifies pn of rx frame
  15468. * value:
  15469. * TKIP or CCMP: PN upper 2 bytes
  15470. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  15471. */
  15472. enum htt_rx_ofld_pkt_err_type {
  15473. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  15474. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  15475. };
  15476. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  15477. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  15478. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  15479. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  15480. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  15481. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  15482. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  15483. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  15484. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  15485. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  15486. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  15487. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  15488. do { \
  15489. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  15490. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  15491. } while (0)
  15492. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  15493. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  15494. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  15495. do { \
  15496. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  15497. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  15498. } while (0)
  15499. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  15500. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  15501. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  15502. do { \
  15503. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  15504. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  15505. } while (0)
  15506. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  15507. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  15508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  15509. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  15510. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  15511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  15512. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  15513. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  15514. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  15515. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  15516. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  15517. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  15518. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  15519. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  15520. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  15521. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  15522. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  15523. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  15524. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  15525. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  15526. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  15527. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  15528. do { \
  15529. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  15530. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  15531. } while (0)
  15532. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  15533. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  15534. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  15535. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  15536. do { \
  15537. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  15538. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  15539. } while (0)
  15540. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  15541. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  15542. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  15543. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  15544. do { \
  15545. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  15546. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  15547. } while (0)
  15548. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  15549. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  15550. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  15551. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  15552. do { \
  15553. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  15554. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  15555. } while (0)
  15556. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  15557. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  15558. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  15559. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  15560. do { \
  15561. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  15562. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  15563. } while (0)
  15564. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  15565. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  15566. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  15567. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  15568. do { \
  15569. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  15570. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  15571. } while (0)
  15572. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  15573. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  15574. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  15575. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  15576. do { \
  15577. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  15578. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  15579. } while (0)
  15580. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  15581. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  15582. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  15583. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  15584. do { \
  15585. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  15586. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  15587. } while (0)
  15588. /**
  15589. * @brief target -> host peer rate report message
  15590. *
  15591. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  15592. *
  15593. * @details
  15594. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  15595. * justified rate of all the peers.
  15596. *
  15597. * |31 24|23 16|15 8|7 0|
  15598. * |----------------+----------------+----------------+----------------|
  15599. * | peer_count | | msg_type |
  15600. * |-------------------------------------------------------------------|
  15601. * : Payload (variant number of peer rate report) :
  15602. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  15603. * Header fields:
  15604. * - msg_type
  15605. * Bits 7:0
  15606. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  15607. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  15608. * - reserved
  15609. * Bits 15:8
  15610. * Purpose:
  15611. * value:
  15612. * - peer_count
  15613. * Bits 31:16
  15614. * Purpose: Specify how many peer rate report elements are present in the payload.
  15615. * value:
  15616. *
  15617. * Payload:
  15618. * There are variant number of peer rate report follow the first 32 bits.
  15619. * The peer rate report is defined as follows.
  15620. *
  15621. * |31 20|19 16|15 0|
  15622. * |-----------------------+---------+---------------------------------|-
  15623. * | reserved | phy | peer_id | \
  15624. * |-------------------------------------------------------------------| -> report #0
  15625. * | rate | /
  15626. * |-----------------------+---------+---------------------------------|-
  15627. * | reserved | phy | peer_id | \
  15628. * |-------------------------------------------------------------------| -> report #1
  15629. * | rate | /
  15630. * |-----------------------+---------+---------------------------------|-
  15631. * | reserved | phy | peer_id | \
  15632. * |-------------------------------------------------------------------| -> report #2
  15633. * | rate | /
  15634. * |-------------------------------------------------------------------|-
  15635. * : :
  15636. * : :
  15637. * : :
  15638. * :-------------------------------------------------------------------:
  15639. *
  15640. * - peer_id
  15641. * Bits 15:0
  15642. * Purpose: identify the peer
  15643. * value:
  15644. * - phy
  15645. * Bits 19:16
  15646. * Purpose: identify which phy is in use
  15647. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  15648. * Please see enum htt_peer_report_phy_type for detail.
  15649. * - reserved
  15650. * Bits 31:20
  15651. * Purpose:
  15652. * value:
  15653. * - rate
  15654. * Bits 31:0
  15655. * Purpose: represent the justified rate of the peer specified by peer_id
  15656. * value:
  15657. */
  15658. enum htt_peer_rate_report_phy_type {
  15659. HTT_PEER_RATE_REPORT_11B = 0,
  15660. HTT_PEER_RATE_REPORT_11A_G,
  15661. HTT_PEER_RATE_REPORT_11N,
  15662. HTT_PEER_RATE_REPORT_11AC,
  15663. };
  15664. #define HTT_PEER_RATE_REPORT_SIZE 8
  15665. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  15666. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  15667. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  15668. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  15669. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  15670. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  15671. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  15672. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  15673. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  15674. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  15675. do { \
  15676. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  15677. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  15678. } while (0)
  15679. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  15680. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  15681. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  15682. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  15683. do { \
  15684. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  15685. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  15686. } while (0)
  15687. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  15688. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  15689. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  15690. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  15691. do { \
  15692. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  15693. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  15694. } while (0)
  15695. /**
  15696. * @brief target -> host flow pool map message
  15697. *
  15698. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  15699. *
  15700. * @details
  15701. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  15702. * a flow of descriptors.
  15703. *
  15704. * This message is in TLV format and indicates the parameters to be setup a
  15705. * flow in the host. Each entry indicates that a particular flow ID is ready to
  15706. * receive descriptors from a specified pool.
  15707. *
  15708. * The message would appear as follows:
  15709. *
  15710. * |31 24|23 16|15 8|7 0|
  15711. * |----------------+----------------+----------------+----------------|
  15712. * header | reserved | num_flows | msg_type |
  15713. * |-------------------------------------------------------------------|
  15714. * | |
  15715. * : payload :
  15716. * | |
  15717. * |-------------------------------------------------------------------|
  15718. *
  15719. * The header field is one DWORD long and is interpreted as follows:
  15720. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  15721. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  15722. * this message
  15723. * b'16-31 - reserved: These bits are reserved for future use
  15724. *
  15725. * Payload:
  15726. * The payload would contain multiple objects of the following structure. Each
  15727. * object represents a flow.
  15728. *
  15729. * |31 24|23 16|15 8|7 0|
  15730. * |----------------+----------------+----------------+----------------|
  15731. * header | reserved | num_flows | msg_type |
  15732. * |-------------------------------------------------------------------|
  15733. * payload0| flow_type |
  15734. * |-------------------------------------------------------------------|
  15735. * | flow_id |
  15736. * |-------------------------------------------------------------------|
  15737. * | reserved0 | flow_pool_id |
  15738. * |-------------------------------------------------------------------|
  15739. * | reserved1 | flow_pool_size |
  15740. * |-------------------------------------------------------------------|
  15741. * | reserved2 |
  15742. * |-------------------------------------------------------------------|
  15743. * payload1| flow_type |
  15744. * |-------------------------------------------------------------------|
  15745. * | flow_id |
  15746. * |-------------------------------------------------------------------|
  15747. * | reserved0 | flow_pool_id |
  15748. * |-------------------------------------------------------------------|
  15749. * | reserved1 | flow_pool_size |
  15750. * |-------------------------------------------------------------------|
  15751. * | reserved2 |
  15752. * |-------------------------------------------------------------------|
  15753. * | . |
  15754. * | . |
  15755. * | . |
  15756. * |-------------------------------------------------------------------|
  15757. *
  15758. * Each payload is 5 DWORDS long and is interpreted as follows:
  15759. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  15760. * this flow is associated. It can be VDEV, peer,
  15761. * or tid (AC). Based on enum htt_flow_type.
  15762. *
  15763. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15764. * object. For flow_type vdev it is set to the
  15765. * vdevid, for peer it is peerid and for tid, it is
  15766. * tid_num.
  15767. *
  15768. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  15769. * in the host for this flow
  15770. * b'16:31 - reserved0: This field in reserved for the future. In case
  15771. * we have a hierarchical implementation (HCM) of
  15772. * pools, it can be used to indicate the ID of the
  15773. * parent-pool.
  15774. *
  15775. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  15776. * Descriptors for this flow will be
  15777. * allocated from this pool in the host.
  15778. * b'16:31 - reserved1: This field in reserved for the future. In case
  15779. * we have a hierarchical implementation of pools,
  15780. * it can be used to indicate the max number of
  15781. * descriptors in the pool. The b'0:15 can be used
  15782. * to indicate min number of descriptors in the
  15783. * HCM scheme.
  15784. *
  15785. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  15786. * we have a hierarchical implementation of pools,
  15787. * b'0:15 can be used to indicate the
  15788. * priority-based borrowing (PBB) threshold of
  15789. * the flow's pool. The b'16:31 are still left
  15790. * reserved.
  15791. */
  15792. enum htt_flow_type {
  15793. FLOW_TYPE_VDEV = 0,
  15794. /* Insert new flow types above this line */
  15795. };
  15796. PREPACK struct htt_flow_pool_map_payload_t {
  15797. A_UINT32 flow_type;
  15798. A_UINT32 flow_id;
  15799. A_UINT32 flow_pool_id:16,
  15800. reserved0:16;
  15801. A_UINT32 flow_pool_size:16,
  15802. reserved1:16;
  15803. A_UINT32 reserved2;
  15804. } POSTPACK;
  15805. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  15806. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  15807. (sizeof(struct htt_flow_pool_map_payload_t))
  15808. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  15809. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  15810. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  15811. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  15812. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  15813. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  15814. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  15815. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  15816. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  15817. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  15818. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  15819. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  15820. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  15821. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  15822. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  15823. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  15824. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  15825. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  15826. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  15827. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  15828. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  15829. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  15830. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  15831. do { \
  15832. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  15833. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  15834. } while (0)
  15835. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  15836. do { \
  15837. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  15838. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  15839. } while (0)
  15840. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  15841. do { \
  15842. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  15843. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  15844. } while (0)
  15845. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  15846. do { \
  15847. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  15848. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  15849. } while (0)
  15850. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  15851. do { \
  15852. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  15853. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  15854. } while (0)
  15855. /**
  15856. * @brief target -> host flow pool unmap message
  15857. *
  15858. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  15859. *
  15860. * @details
  15861. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  15862. * down a flow of descriptors.
  15863. * This message indicates that for the flow (whose ID is provided) is wanting
  15864. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  15865. * pool of descriptors from where descriptors are being allocated for this
  15866. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  15867. * be unmapped by the host.
  15868. *
  15869. * The message would appear as follows:
  15870. *
  15871. * |31 24|23 16|15 8|7 0|
  15872. * |----------------+----------------+----------------+----------------|
  15873. * | reserved0 | msg_type |
  15874. * |-------------------------------------------------------------------|
  15875. * | flow_type |
  15876. * |-------------------------------------------------------------------|
  15877. * | flow_id |
  15878. * |-------------------------------------------------------------------|
  15879. * | reserved1 | flow_pool_id |
  15880. * |-------------------------------------------------------------------|
  15881. *
  15882. * The message is interpreted as follows:
  15883. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  15884. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  15885. * b'8:31 - reserved0: Reserved for future use
  15886. *
  15887. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  15888. * this flow is associated. It can be VDEV, peer,
  15889. * or tid (AC). Based on enum htt_flow_type.
  15890. *
  15891. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  15892. * object. For flow_type vdev it is set to the
  15893. * vdevid, for peer it is peerid and for tid, it is
  15894. * tid_num.
  15895. *
  15896. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  15897. * used in the host for this flow
  15898. * b'16:31 - reserved0: This field in reserved for the future.
  15899. *
  15900. */
  15901. PREPACK struct htt_flow_pool_unmap_t {
  15902. A_UINT32 msg_type:8,
  15903. reserved0:24;
  15904. A_UINT32 flow_type;
  15905. A_UINT32 flow_id;
  15906. A_UINT32 flow_pool_id:16,
  15907. reserved1:16;
  15908. } POSTPACK;
  15909. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  15910. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  15911. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  15912. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  15913. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  15914. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  15915. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  15916. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  15917. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  15918. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  15919. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  15920. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  15921. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  15922. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  15923. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  15924. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  15925. do { \
  15926. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  15927. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  15928. } while (0)
  15929. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  15930. do { \
  15931. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  15932. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  15933. } while (0)
  15934. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  15935. do { \
  15936. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  15937. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  15938. } while (0)
  15939. /**
  15940. * @brief target -> host SRING setup done message
  15941. *
  15942. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  15943. *
  15944. * @details
  15945. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  15946. * SRNG ring setup is done
  15947. *
  15948. * This message indicates whether the last setup operation is successful.
  15949. * It will be sent to host when host set respose_required bit in
  15950. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  15951. * The message would appear as follows:
  15952. *
  15953. * |31 24|23 16|15 8|7 0|
  15954. * |--------------- +----------------+----------------+----------------|
  15955. * | setup_status | ring_id | pdev_id | msg_type |
  15956. * |-------------------------------------------------------------------|
  15957. *
  15958. * The message is interpreted as follows:
  15959. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  15960. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  15961. * b'8:15 - pdev_id:
  15962. * 0 (for rings at SOC/UMAC level),
  15963. * 1/2/3 mac id (for rings at LMAC level)
  15964. * b'16:23 - ring_id: Identify the ring which is set up
  15965. * More details can be got from enum htt_srng_ring_id
  15966. * b'24:31 - setup_status: Indicate status of setup operation
  15967. * Refer to htt_ring_setup_status
  15968. */
  15969. PREPACK struct htt_sring_setup_done_t {
  15970. A_UINT32 msg_type: 8,
  15971. pdev_id: 8,
  15972. ring_id: 8,
  15973. setup_status: 8;
  15974. } POSTPACK;
  15975. enum htt_ring_setup_status {
  15976. htt_ring_setup_status_ok = 0,
  15977. htt_ring_setup_status_error,
  15978. };
  15979. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  15980. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  15981. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  15982. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  15983. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  15984. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  15985. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  15986. do { \
  15987. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  15988. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15989. } while (0)
  15990. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  15991. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  15992. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  15993. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  15994. HTT_SRING_SETUP_DONE_RING_ID_S)
  15995. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  15996. do { \
  15997. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  15998. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  15999. } while (0)
  16000. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  16001. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  16002. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  16003. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  16004. HTT_SRING_SETUP_DONE_STATUS_S)
  16005. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  16006. do { \
  16007. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  16008. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  16009. } while (0)
  16010. /**
  16011. * @brief target -> flow map flow info
  16012. *
  16013. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  16014. *
  16015. * @details
  16016. * HTT TX map flow entry with tqm flow pointer
  16017. * Sent from firmware to host to add tqm flow pointer in corresponding
  16018. * flow search entry. Flow metadata is replayed back to host as part of this
  16019. * struct to enable host to find the specific flow search entry
  16020. *
  16021. * The message would appear as follows:
  16022. *
  16023. * |31 28|27 18|17 14|13 8|7 0|
  16024. * |-------+------------------------------------------+----------------|
  16025. * | rsvd0 | fse_hsh_idx | msg_type |
  16026. * |-------------------------------------------------------------------|
  16027. * | rsvd1 | tid | peer_id |
  16028. * |-------------------------------------------------------------------|
  16029. * | tqm_flow_pntr_lo |
  16030. * |-------------------------------------------------------------------|
  16031. * | tqm_flow_pntr_hi |
  16032. * |-------------------------------------------------------------------|
  16033. * | fse_meta_data |
  16034. * |-------------------------------------------------------------------|
  16035. *
  16036. * The message is interpreted as follows:
  16037. *
  16038. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  16039. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  16040. *
  16041. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  16042. * for this flow entry
  16043. *
  16044. * dword0 - b'28:31 - rsvd0: Reserved for future use
  16045. *
  16046. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  16047. *
  16048. * dword1 - b'14:17 - tid
  16049. *
  16050. * dword1 - b'18:31 - rsvd1: Reserved for future use
  16051. *
  16052. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  16053. *
  16054. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  16055. *
  16056. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  16057. * given by host
  16058. */
  16059. PREPACK struct htt_tx_map_flow_info {
  16060. A_UINT32
  16061. msg_type: 8,
  16062. fse_hsh_idx: 20,
  16063. rsvd0: 4;
  16064. A_UINT32
  16065. peer_id: 14,
  16066. tid: 4,
  16067. rsvd1: 14;
  16068. A_UINT32 tqm_flow_pntr_lo;
  16069. A_UINT32 tqm_flow_pntr_hi;
  16070. struct htt_tx_flow_metadata fse_meta_data;
  16071. } POSTPACK;
  16072. /* DWORD 0 */
  16073. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  16074. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  16075. /* DWORD 1 */
  16076. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  16077. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  16078. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  16079. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  16080. /* DWORD 0 */
  16081. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  16082. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  16083. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  16084. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  16085. do { \
  16086. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  16087. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  16088. } while (0)
  16089. /* DWORD 1 */
  16090. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  16091. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  16092. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  16093. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  16094. do { \
  16095. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  16096. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  16097. } while (0)
  16098. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  16099. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  16100. HTT_TX_MAP_FLOW_INFO_TID_S)
  16101. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  16102. do { \
  16103. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  16104. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  16105. } while (0)
  16106. /*
  16107. * htt_dbg_ext_stats_status -
  16108. * present - The requested stats have been delivered in full.
  16109. * This indicates that either the stats information was contained
  16110. * in its entirety within this message, or else this message
  16111. * completes the delivery of the requested stats info that was
  16112. * partially delivered through earlier STATS_CONF messages.
  16113. * partial - The requested stats have been delivered in part.
  16114. * One or more subsequent STATS_CONF messages with the same
  16115. * cookie value will be sent to deliver the remainder of the
  16116. * information.
  16117. * error - The requested stats could not be delivered, for example due
  16118. * to a shortage of memory to construct a message holding the
  16119. * requested stats.
  16120. * invalid - The requested stat type is either not recognized, or the
  16121. * target is configured to not gather the stats type in question.
  16122. */
  16123. enum htt_dbg_ext_stats_status {
  16124. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  16125. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  16126. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  16127. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  16128. };
  16129. /**
  16130. * @brief target -> host ppdu stats upload
  16131. *
  16132. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  16133. *
  16134. * @details
  16135. * The following field definitions describe the format of the HTT target
  16136. * to host ppdu stats indication message.
  16137. *
  16138. *
  16139. * |31 24|23 16|15 12|11 10|9 8|7 0 |
  16140. * |-----------------------------+-------+-------+--------+---------------|
  16141. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  16142. * |-------------+---------------+-------+-------+--------+---------------|
  16143. * | tgt_private | ppdu_id |
  16144. * |-------------+--------------------------------------------------------|
  16145. * | Timestamp in us |
  16146. * |----------------------------------------------------------------------|
  16147. * | reserved |
  16148. * |----------------------------------------------------------------------|
  16149. * | type-specific stats info |
  16150. * | (see htt_ppdu_stats.h) |
  16151. * |----------------------------------------------------------------------|
  16152. * Header fields:
  16153. * - MSG_TYPE
  16154. * Bits 7:0
  16155. * Purpose: Identifies this is a PPDU STATS indication
  16156. * message.
  16157. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  16158. * - mac_id
  16159. * Bits 9:8
  16160. * Purpose: mac_id of this ppdu_id
  16161. * Value: 0-3
  16162. * - pdev_id
  16163. * Bits 11:10
  16164. * Purpose: pdev_id of this ppdu_id
  16165. * Value: 0-3
  16166. * 0 (for rings at SOC level),
  16167. * 1/2/3 PDEV -> 0/1/2
  16168. * - payload_size
  16169. * Bits 31:16
  16170. * Purpose: total tlv size
  16171. * Value: payload_size in bytes
  16172. */
  16173. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  16174. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  16175. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  16176. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  16177. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  16178. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  16179. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  16180. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0x00FFFFFF
  16181. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  16182. /* bits 31:24 are used by the target for internal purposes */
  16183. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  16184. do { \
  16185. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  16186. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  16187. } while (0)
  16188. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  16189. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  16190. HTT_T2H_PPDU_STATS_MAC_ID_S)
  16191. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  16192. do { \
  16193. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  16194. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  16195. } while (0)
  16196. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  16197. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  16198. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  16199. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  16200. do { \
  16201. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  16202. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  16203. } while (0)
  16204. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  16205. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  16206. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  16207. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  16208. do { \
  16209. /*HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value);*/ \
  16210. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  16211. } while (0)
  16212. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  16213. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  16214. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  16215. /* htt_t2h_ppdu_stats_ind_hdr_t
  16216. * This struct contains the fields within the header of the
  16217. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  16218. * stats info.
  16219. * This struct assumes little-endian layout, and thus is only
  16220. * suitable for use within processors known to be little-endian
  16221. * (such as the target).
  16222. * In contrast, the above macros provide endian-portable methods
  16223. * to get and set the bitfields within this PPDU_STATS_IND header.
  16224. */
  16225. typedef struct {
  16226. A_UINT32 msg_type: 8, /* bits 7:0 */
  16227. mac_id: 2, /* bits 9:8 */
  16228. pdev_id: 2, /* bits 11:10 */
  16229. reserved1: 4, /* bits 15:12 */
  16230. payload_size: 16; /* bits 31:16 */
  16231. A_UINT32 ppdu_id;
  16232. A_UINT32 timestamp_us;
  16233. A_UINT32 reserved2;
  16234. } htt_t2h_ppdu_stats_ind_hdr_t;
  16235. /**
  16236. * @brief target -> host extended statistics upload
  16237. *
  16238. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  16239. *
  16240. * @details
  16241. * The following field definitions describe the format of the HTT target
  16242. * to host stats upload confirmation message.
  16243. * The message contains a cookie echoed from the HTT host->target stats
  16244. * upload request, which identifies which request the confirmation is
  16245. * for, and a single stats can span over multiple HTT stats indication
  16246. * due to the HTT message size limitation so every HTT ext stats indication
  16247. * will have tag-length-value stats information elements.
  16248. * The tag-length header for each HTT stats IND message also includes a
  16249. * status field, to indicate whether the request for the stat type in
  16250. * question was fully met, partially met, unable to be met, or invalid
  16251. * (if the stat type in question is disabled in the target).
  16252. * A Done bit 1's indicate the end of the of stats info elements.
  16253. *
  16254. *
  16255. * |31 16|15 12|11|10 8|7 5|4 0|
  16256. * |--------------------------------------------------------------|
  16257. * | reserved | msg type |
  16258. * |--------------------------------------------------------------|
  16259. * | cookie LSBs |
  16260. * |--------------------------------------------------------------|
  16261. * | cookie MSBs |
  16262. * |--------------------------------------------------------------|
  16263. * | stats entry length | rsvd | D| S | stat type |
  16264. * |--------------------------------------------------------------|
  16265. * | type-specific stats info |
  16266. * | (see htt_stats.h) |
  16267. * |--------------------------------------------------------------|
  16268. * Header fields:
  16269. * - MSG_TYPE
  16270. * Bits 7:0
  16271. * Purpose: Identifies this is a extended statistics upload confirmation
  16272. * message.
  16273. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  16274. * - COOKIE_LSBS
  16275. * Bits 31:0
  16276. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16277. * message with its preceding host->target stats request message.
  16278. * Value: LSBs of the opaque cookie specified by the host-side requestor
  16279. * - COOKIE_MSBS
  16280. * Bits 31:0
  16281. * Purpose: Provide a mechanism to match a target->host stats confirmation
  16282. * message with its preceding host->target stats request message.
  16283. * Value: MSBs of the opaque cookie specified by the host-side requestor
  16284. *
  16285. * Stats Information Element tag-length header fields:
  16286. * - STAT_TYPE
  16287. * Bits 7:0
  16288. * Purpose: identifies the type of statistics info held in the
  16289. * following information element
  16290. * Value: htt_dbg_ext_stats_type
  16291. * - STATUS
  16292. * Bits 10:8
  16293. * Purpose: indicate whether the requested stats are present
  16294. * Value: htt_dbg_ext_stats_status
  16295. * - DONE
  16296. * Bits 11
  16297. * Purpose:
  16298. * Indicates the completion of the stats entry, this will be the last
  16299. * stats conf HTT segment for the requested stats type.
  16300. * Value:
  16301. * 0 -> the stats retrieval is ongoing
  16302. * 1 -> the stats retrieval is complete
  16303. * - LENGTH
  16304. * Bits 31:16
  16305. * Purpose: indicate the stats information size
  16306. * Value: This field specifies the number of bytes of stats information
  16307. * that follows the element tag-length header.
  16308. * It is expected but not required that this length is a multiple of
  16309. * 4 bytes.
  16310. */
  16311. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  16312. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  16313. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  16314. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  16315. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  16316. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  16317. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  16318. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  16319. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  16320. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  16321. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  16322. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  16323. do { \
  16324. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  16325. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  16326. } while (0)
  16327. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  16328. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  16329. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  16330. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  16331. do { \
  16332. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  16333. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  16334. } while (0)
  16335. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  16336. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  16337. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  16338. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  16339. do { \
  16340. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  16341. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  16342. } while (0)
  16343. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  16344. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  16345. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  16346. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  16347. do { \
  16348. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  16349. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  16350. } while (0)
  16351. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  16352. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  16353. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  16354. /**
  16355. * @brief target -> host streaming statistics upload
  16356. *
  16357. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  16358. *
  16359. * @details
  16360. * The following field definitions describe the format of the HTT target
  16361. * to host streaming stats upload indication message.
  16362. * The host can use a STREAMING_STATS_REQ message to enable the target to
  16363. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  16364. * use the STREAMING_STATS_REQ message to halt the target's production of
  16365. * STREAMING_STATS_IND messages.
  16366. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  16367. * the stats enabled by the host's STREAMING_STATS_REQ message.
  16368. *
  16369. * |31 8|7 0|
  16370. * |--------------------------------------------------------------|
  16371. * | reserved | msg type |
  16372. * |--------------------------------------------------------------|
  16373. * | type-specific stats info |
  16374. * | (see htt_stats.h) |
  16375. * |--------------------------------------------------------------|
  16376. * Header fields:
  16377. * - MSG_TYPE
  16378. * Bits 7:0
  16379. * Purpose: Identifies this as a streaming statistics upload indication
  16380. * message.
  16381. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  16382. */
  16383. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  16384. typedef enum {
  16385. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  16386. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  16387. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  16388. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  16389. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  16390. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  16391. /* Reserved from 128 - 255 for target internal use.*/
  16392. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  16393. } HTT_PEER_TYPE;
  16394. /** macro to convert MAC address from char array to HTT word format */
  16395. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  16396. (phtt_mac_addr)->mac_addr31to0 = \
  16397. (((c_macaddr)[0] << 0) | \
  16398. ((c_macaddr)[1] << 8) | \
  16399. ((c_macaddr)[2] << 16) | \
  16400. ((c_macaddr)[3] << 24)); \
  16401. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  16402. } while (0)
  16403. /**
  16404. * @brief target -> host monitor mac header indication message
  16405. *
  16406. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  16407. *
  16408. * @details
  16409. * The following diagram shows the format of the monitor mac header message
  16410. * sent from the target to the host.
  16411. * This message is primarily sent when promiscuous rx mode is enabled.
  16412. * One message is sent per rx PPDU.
  16413. *
  16414. * |31 24|23 16|15 8|7 0|
  16415. * |-------------------------------------------------------------|
  16416. * | peer_id | reserved0 | msg_type |
  16417. * |-------------------------------------------------------------|
  16418. * | reserved1 | num_mpdu |
  16419. * |-------------------------------------------------------------|
  16420. * | struct hw_rx_desc |
  16421. * | (see wal_rx_desc.h) |
  16422. * |-------------------------------------------------------------|
  16423. * | struct ieee80211_frame_addr4 |
  16424. * | (see ieee80211_defs.h) |
  16425. * |-------------------------------------------------------------|
  16426. * | struct ieee80211_frame_addr4 |
  16427. * | (see ieee80211_defs.h) |
  16428. * |-------------------------------------------------------------|
  16429. * | ...... |
  16430. * |-------------------------------------------------------------|
  16431. *
  16432. * Header fields:
  16433. * - msg_type
  16434. * Bits 7:0
  16435. * Purpose: Identifies this is a monitor mac header indication message.
  16436. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  16437. * - peer_id
  16438. * Bits 31:16
  16439. * Purpose: Software peer id given by host during association,
  16440. * During promiscuous mode, the peer ID will be invalid (0xFF)
  16441. * for rx PPDUs received from unassociated peers.
  16442. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  16443. * - num_mpdu
  16444. * Bits 15:0
  16445. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  16446. * delivered within the message.
  16447. * Value: 1 to 32
  16448. * num_mpdu is limited to a maximum value of 32, due to buffer
  16449. * size limits. For PPDUs with more than 32 MPDUs, only the
  16450. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  16451. * the PPDU will be provided.
  16452. */
  16453. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  16454. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  16455. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  16456. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  16457. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  16458. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  16459. do { \
  16460. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  16461. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  16462. } while (0)
  16463. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  16464. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  16465. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  16466. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  16467. do { \
  16468. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  16469. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  16470. } while (0)
  16471. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  16472. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  16473. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  16474. /**
  16475. * @brief target -> host flow pool resize Message
  16476. *
  16477. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  16478. *
  16479. * @details
  16480. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  16481. * the flow pool associated with the specified ID is resized
  16482. *
  16483. * The message would appear as follows:
  16484. *
  16485. * |31 16|15 8|7 0|
  16486. * |---------------------------------+----------------+----------------|
  16487. * | reserved0 | Msg type |
  16488. * |-------------------------------------------------------------------|
  16489. * | flow pool new size | flow pool ID |
  16490. * |-------------------------------------------------------------------|
  16491. *
  16492. * The message is interpreted as follows:
  16493. * b'0:7 - msg_type: This will be set to 0x21
  16494. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  16495. *
  16496. * b'0:15 - flow pool ID: Existing flow pool ID
  16497. *
  16498. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  16499. *
  16500. */
  16501. PREPACK struct htt_flow_pool_resize_t {
  16502. A_UINT32 msg_type:8,
  16503. reserved0:24;
  16504. A_UINT32 flow_pool_id:16,
  16505. flow_pool_new_size:16;
  16506. } POSTPACK;
  16507. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  16508. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  16509. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  16510. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  16511. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  16512. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  16513. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  16514. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  16515. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  16516. do { \
  16517. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  16518. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  16519. } while (0)
  16520. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  16521. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  16522. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  16523. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  16524. do { \
  16525. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  16526. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  16527. } while (0)
  16528. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  16529. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  16530. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  16531. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  16532. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  16533. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  16534. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  16535. /*
  16536. * The read and write indices point to the data within the host buffer.
  16537. * Because the first 4 bytes of the host buffer is used for the read index and
  16538. * the next 4 bytes for the write index, the data itself starts at offset 8.
  16539. * The read index and write index are the byte offsets from the base of the
  16540. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  16541. * Refer the ASCII text picture below.
  16542. */
  16543. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  16544. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  16545. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  16546. /*
  16547. ***************************************************************************
  16548. *
  16549. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16550. *
  16551. ***************************************************************************
  16552. *
  16553. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  16554. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  16555. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  16556. * written into the Host memory region mentioned below.
  16557. *
  16558. * Read index is updated by the Host. At any point of time, the read index will
  16559. * indicate the index that will next be read by the Host. The read index is
  16560. * in units of bytes offset from the base of the meta-data buffer.
  16561. *
  16562. * Write index is updated by the FW. At any point of time, the write index will
  16563. * indicate from where the FW can start writing any new data. The write index is
  16564. * in units of bytes offset from the base of the meta-data buffer.
  16565. *
  16566. * If the Host is not fast enough in reading the CFR data, any new capture data
  16567. * would be dropped if there is no space left to write the new captures.
  16568. *
  16569. * The last 4 bytes of the memory region will have the magic pattern
  16570. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  16571. * not overrun the host buffer.
  16572. *
  16573. * ,--------------------. read and write indices store the
  16574. * | | byte offset from the base of the
  16575. * | ,--------+--------. meta-data buffer to the next
  16576. * | | | | location within the data buffer
  16577. * | | v v that will be read / written
  16578. * ************************************************************************
  16579. * * Read * Write * * Magic *
  16580. * * index * index * CFR data1 ...... CFR data N * pattern *
  16581. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  16582. * ************************************************************************
  16583. * |<---------- data buffer ---------->|
  16584. *
  16585. * |<----------------- meta-data buffer allocated in Host ----------------|
  16586. *
  16587. * Note:
  16588. * - Considering the 4 bytes needed to store the Read index (R) and the
  16589. * Write index (W), the initial value is as follows:
  16590. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  16591. * - Buffer empty condition:
  16592. * R = W
  16593. *
  16594. * Regarding CFR data format:
  16595. * --------------------------
  16596. *
  16597. * Each CFR tone is stored in HW as 16-bits with the following format:
  16598. * {bits[15:12], bits[11:6], bits[5:0]} =
  16599. * {unsigned exponent (4 bits),
  16600. * signed mantissa_real (6 bits),
  16601. * signed mantissa_imag (6 bits)}
  16602. *
  16603. * CFR_real = mantissa_real * 2^(exponent-5)
  16604. * CFR_imag = mantissa_imag * 2^(exponent-5)
  16605. *
  16606. *
  16607. * The CFR data is written to the 16-bit unsigned output array (buff) in
  16608. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  16609. *
  16610. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  16611. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  16612. * .
  16613. * .
  16614. * .
  16615. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  16616. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  16617. */
  16618. /* Bandwidth of peer CFR captures */
  16619. typedef enum {
  16620. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  16621. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  16622. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  16623. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  16624. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  16625. HTT_PEER_CFR_CAPTURE_BW_MAX,
  16626. } HTT_PEER_CFR_CAPTURE_BW;
  16627. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  16628. * was captured
  16629. */
  16630. typedef enum {
  16631. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  16632. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  16633. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  16634. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  16635. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  16636. } HTT_PEER_CFR_CAPTURE_MODE;
  16637. typedef enum {
  16638. /* This message type is currently used for the below purpose:
  16639. *
  16640. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  16641. * wmi_peer_cfr_capture_cmd.
  16642. * If payload_present bit is set to 0 then the associated memory region
  16643. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  16644. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  16645. * message; the CFR dump will be present at the end of the message,
  16646. * after the chan_phy_mode.
  16647. */
  16648. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  16649. /* Always keep this last */
  16650. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  16651. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  16652. /**
  16653. * @brief target -> host CFR dump completion indication message definition
  16654. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  16655. *
  16656. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  16657. *
  16658. * @details
  16659. * The following diagram shows the format of the Channel Frequency Response
  16660. * (CFR) dump completion indication. This inidcation is sent to the Host when
  16661. * the channel capture of a peer is copied by Firmware into the Host memory
  16662. *
  16663. * **************************************************************************
  16664. *
  16665. * Message format when the CFR capture message type is
  16666. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  16667. *
  16668. * **************************************************************************
  16669. *
  16670. * |31 16|15 |8|7 0|
  16671. * |----------------------------------------------------------------|
  16672. * header: | reserved |P| msg_type |
  16673. * word 0 | | | |
  16674. * |----------------------------------------------------------------|
  16675. * payload: | cfr_capture_msg_type |
  16676. * word 1 | |
  16677. * |----------------------------------------------------------------|
  16678. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  16679. * word 2 | | | | | | | | |
  16680. * |----------------------------------------------------------------|
  16681. * | mac_addr31to0 |
  16682. * word 3 | |
  16683. * |----------------------------------------------------------------|
  16684. * | unused / reserved | mac_addr47to32 |
  16685. * word 4 | | |
  16686. * |----------------------------------------------------------------|
  16687. * | index |
  16688. * word 5 | |
  16689. * |----------------------------------------------------------------|
  16690. * | length |
  16691. * word 6 | |
  16692. * |----------------------------------------------------------------|
  16693. * | timestamp |
  16694. * word 7 | |
  16695. * |----------------------------------------------------------------|
  16696. * | counter |
  16697. * word 8 | |
  16698. * |----------------------------------------------------------------|
  16699. * | chan_mhz |
  16700. * word 9 | |
  16701. * |----------------------------------------------------------------|
  16702. * | band_center_freq1 |
  16703. * word 10 | |
  16704. * |----------------------------------------------------------------|
  16705. * | band_center_freq2 |
  16706. * word 11 | |
  16707. * |----------------------------------------------------------------|
  16708. * | chan_phy_mode |
  16709. * word 12 | |
  16710. * |----------------------------------------------------------------|
  16711. * where,
  16712. * P - payload present bit (payload_present explained below)
  16713. * req_id - memory request id (mem_req_id explained below)
  16714. * S - status field (status explained below)
  16715. * capbw - capture bandwidth (capture_bw explained below)
  16716. * mode - mode of capture (mode explained below)
  16717. * sts - space time streams (sts_count explained below)
  16718. * chbw - channel bandwidth (channel_bw explained below)
  16719. * captype - capture type (cap_type explained below)
  16720. *
  16721. * The following field definitions describe the format of the CFR dump
  16722. * completion indication sent from the target to the host
  16723. *
  16724. * Header fields:
  16725. *
  16726. * Word 0
  16727. * - msg_type
  16728. * Bits 7:0
  16729. * Purpose: Identifies this as CFR TX completion indication
  16730. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  16731. * - payload_present
  16732. * Bit 8
  16733. * Purpose: Identifies how CFR data is sent to host
  16734. * Value: 0 - If CFR Payload is written to host memory
  16735. * 1 - If CFR Payload is sent as part of HTT message
  16736. * (This is the requirement for SDIO/USB where it is
  16737. * not possible to write CFR data to host memory)
  16738. * - reserved
  16739. * Bits 31:9
  16740. * Purpose: Reserved
  16741. * Value: 0
  16742. *
  16743. * Payload fields:
  16744. *
  16745. * Word 1
  16746. * - cfr_capture_msg_type
  16747. * Bits 31:0
  16748. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  16749. * to specify the format used for the remainder of the message
  16750. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16751. * (currently only MSG_TYPE_1 is defined)
  16752. *
  16753. * Word 2
  16754. * - mem_req_id
  16755. * Bits 6:0
  16756. * Purpose: Contain the mem request id of the region where the CFR capture
  16757. * has been stored - of type WMI_HOST_MEM_REQ_ID
  16758. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  16759. this value is invalid)
  16760. * - status
  16761. * Bit 7
  16762. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  16763. * Value: 1 (True) - Successful; 0 (False) - Not successful
  16764. * - capture_bw
  16765. * Bits 10:8
  16766. * Purpose: Carry the bandwidth of the CFR capture
  16767. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  16768. * - mode
  16769. * Bits 13:11
  16770. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  16771. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  16772. * - sts_count
  16773. * Bits 16:14
  16774. * Purpose: Carry the number of space time streams
  16775. * Value: Number of space time streams
  16776. * - channel_bw
  16777. * Bits 19:17
  16778. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  16779. * measurement
  16780. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  16781. * - cap_type
  16782. * Bits 23:20
  16783. * Purpose: Carry the type of the capture
  16784. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  16785. * - vdev_id
  16786. * Bits 31:24
  16787. * Purpose: Carry the virtual device id
  16788. * Value: vdev ID
  16789. *
  16790. * Word 3
  16791. * - mac_addr31to0
  16792. * Bits 31:0
  16793. * Purpose: Contain the bits 31:0 of the peer MAC address
  16794. * Value: Bits 31:0 of the peer MAC address
  16795. *
  16796. * Word 4
  16797. * - mac_addr47to32
  16798. * Bits 15:0
  16799. * Purpose: Contain the bits 47:32 of the peer MAC address
  16800. * Value: Bits 47:32 of the peer MAC address
  16801. *
  16802. * Word 5
  16803. * - index
  16804. * Bits 31:0
  16805. * Purpose: Contain the index at which this CFR dump was written in the Host
  16806. * allocated memory. This index is the number of bytes from the base address.
  16807. * Value: Index position
  16808. *
  16809. * Word 6
  16810. * - length
  16811. * Bits 31:0
  16812. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  16813. * Value: Length of the CFR capture of the peer
  16814. *
  16815. * Word 7
  16816. * - timestamp
  16817. * Bits 31:0
  16818. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  16819. * clock used for this timestamp is private to the target and not visible to
  16820. * the host i.e., Host can interpret only the relative timestamp deltas from
  16821. * one message to the next, but can't interpret the absolute timestamp from a
  16822. * single message.
  16823. * Value: Timestamp in microseconds
  16824. *
  16825. * Word 8
  16826. * - counter
  16827. * Bits 31:0
  16828. * Purpose: Carry the count of the current CFR capture from FW. This is
  16829. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  16830. * in host memory)
  16831. * Value: Count of the current CFR capture
  16832. *
  16833. * Word 9
  16834. * - chan_mhz
  16835. * Bits 31:0
  16836. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  16837. * Value: Primary 20 channel frequency
  16838. *
  16839. * Word 10
  16840. * - band_center_freq1
  16841. * Bits 31:0
  16842. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  16843. * Value: Center frequency 1 in MHz
  16844. *
  16845. * Word 11
  16846. * - band_center_freq2
  16847. * Bits 31:0
  16848. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  16849. * the VDEV
  16850. * 80plus80 mode
  16851. * Value: Center frequency 2 in MHz
  16852. *
  16853. * Word 12
  16854. * - chan_phy_mode
  16855. * Bits 31:0
  16856. * Purpose: Carry the phy mode of the channel, of the VDEV
  16857. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  16858. */
  16859. PREPACK struct htt_cfr_dump_ind_type_1 {
  16860. A_UINT32 mem_req_id:7,
  16861. status:1,
  16862. capture_bw:3,
  16863. mode:3,
  16864. sts_count:3,
  16865. channel_bw:3,
  16866. cap_type:4,
  16867. vdev_id:8;
  16868. htt_mac_addr addr;
  16869. A_UINT32 index;
  16870. A_UINT32 length;
  16871. A_UINT32 timestamp;
  16872. A_UINT32 counter;
  16873. struct htt_chan_change_msg chan;
  16874. } POSTPACK;
  16875. PREPACK struct htt_cfr_dump_compl_ind {
  16876. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  16877. union {
  16878. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  16879. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  16880. /* If there is a need to change the memory layout and its associated
  16881. * HTT indication format, a new CFR capture message type can be
  16882. * introduced and added into this union.
  16883. */
  16884. };
  16885. } POSTPACK;
  16886. /*
  16887. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  16888. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16889. */
  16890. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  16891. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  16892. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  16893. do { \
  16894. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  16895. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  16896. } while(0)
  16897. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  16898. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  16899. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  16900. /*
  16901. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  16902. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  16903. */
  16904. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  16905. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  16906. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  16907. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  16908. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  16909. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  16910. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  16911. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  16912. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  16913. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  16914. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  16915. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  16916. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  16917. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  16918. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  16919. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  16920. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  16921. do { \
  16922. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  16923. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  16924. } while (0)
  16925. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  16926. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  16927. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  16928. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  16929. do { \
  16930. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  16931. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  16932. } while (0)
  16933. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  16934. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  16935. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  16936. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  16937. do { \
  16938. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  16939. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  16940. } while (0)
  16941. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  16942. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  16943. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  16944. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  16945. do { \
  16946. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  16947. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  16948. } while (0)
  16949. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  16950. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  16951. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  16952. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  16953. do { \
  16954. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  16955. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  16956. } while (0)
  16957. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  16958. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  16959. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  16960. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  16961. do { \
  16962. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  16963. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  16964. } while (0)
  16965. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  16966. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  16967. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  16968. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  16969. do { \
  16970. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  16971. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  16972. } while (0)
  16973. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  16974. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  16975. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  16976. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  16977. do { \
  16978. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  16979. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  16980. } while (0)
  16981. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  16982. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  16983. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  16984. /**
  16985. * @brief target -> host peer (PPDU) stats message
  16986. *
  16987. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  16988. *
  16989. * @details
  16990. * This message is generated by FW when FW is sending stats to host
  16991. * about one or more PPDUs that the FW has transmitted to one or more peers.
  16992. * This message is sent autonomously by the target rather than upon request
  16993. * by the host.
  16994. * The following field definitions describe the format of the HTT target
  16995. * to host peer stats indication message.
  16996. *
  16997. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  16998. * or more PPDU stats records.
  16999. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  17000. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  17001. * then the message would start with the
  17002. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  17003. * below.
  17004. *
  17005. * |31 16|15|14|13 11|10 9|8|7 0|
  17006. * |-------------------------------------------------------------|
  17007. * | reserved |MSG_TYPE |
  17008. * |-------------------------------------------------------------|
  17009. * rec 0 | TLV header |
  17010. * rec 0 |-------------------------------------------------------------|
  17011. * rec 0 | ppdu successful bytes |
  17012. * rec 0 |-------------------------------------------------------------|
  17013. * rec 0 | ppdu retry bytes |
  17014. * rec 0 |-------------------------------------------------------------|
  17015. * rec 0 | ppdu failed bytes |
  17016. * rec 0 |-------------------------------------------------------------|
  17017. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  17018. * rec 0 |-------------------------------------------------------------|
  17019. * rec 0 | retried MSDUs | successful MSDUs |
  17020. * rec 0 |-------------------------------------------------------------|
  17021. * rec 0 | TX duration | failed MSDUs |
  17022. * rec 0 |-------------------------------------------------------------|
  17023. * ...
  17024. * |-------------------------------------------------------------|
  17025. * rec N | TLV header |
  17026. * rec N |-------------------------------------------------------------|
  17027. * rec N | ppdu successful bytes |
  17028. * rec N |-------------------------------------------------------------|
  17029. * rec N | ppdu retry bytes |
  17030. * rec N |-------------------------------------------------------------|
  17031. * rec N | ppdu failed bytes |
  17032. * rec N |-------------------------------------------------------------|
  17033. * rec N | peer id | S|SG| BW | BA |A|rate code|
  17034. * rec N |-------------------------------------------------------------|
  17035. * rec N | retried MSDUs | successful MSDUs |
  17036. * rec N |-------------------------------------------------------------|
  17037. * rec N | TX duration | failed MSDUs |
  17038. * rec N |-------------------------------------------------------------|
  17039. *
  17040. * where:
  17041. * A = is A-MPDU flag
  17042. * BA = block-ack failure flags
  17043. * BW = bandwidth spec
  17044. * SG = SGI enabled spec
  17045. * S = skipped rate ctrl
  17046. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  17047. *
  17048. * Header
  17049. * ------
  17050. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  17051. * dword0 - b'8:31 - reserved : Reserved for future use
  17052. *
  17053. * payload include below peer_stats information
  17054. * --------------------------------------------
  17055. * @TLV : HTT_PPDU_STATS_INFO_TLV
  17056. * @tx_success_bytes : total successful bytes in the PPDU.
  17057. * @tx_retry_bytes : total retried bytes in the PPDU.
  17058. * @tx_failed_bytes : total failed bytes in the PPDU.
  17059. * @tx_ratecode : rate code used for the PPDU.
  17060. * @is_ampdu : Indicates PPDU is AMPDU or not.
  17061. * @ba_ack_failed : BA/ACK failed for this PPDU
  17062. * b00 -> BA received
  17063. * b01 -> BA failed once
  17064. * b10 -> BA failed twice, when HW retry is enabled.
  17065. * @bw : BW
  17066. * b00 -> 20 MHz
  17067. * b01 -> 40 MHz
  17068. * b10 -> 80 MHz
  17069. * b11 -> 160 MHz (or 80+80)
  17070. * @sg : SGI enabled
  17071. * @s : skipped ratectrl
  17072. * @peer_id : peer id
  17073. * @tx_success_msdus : successful MSDUs
  17074. * @tx_retry_msdus : retried MSDUs
  17075. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  17076. * @tx_duration : Tx duration for the PPDU (microsecond units)
  17077. */
  17078. /**
  17079. * @brief target -> host backpressure event
  17080. *
  17081. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  17082. *
  17083. * @details
  17084. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  17085. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  17086. * This message will only be sent if the backpressure condition has existed
  17087. * continuously for an initial period (100 ms).
  17088. * Repeat messages with updated information will be sent after each
  17089. * subsequent period (100 ms) as long as the backpressure remains unabated.
  17090. * This message indicates the ring id along with current head and tail index
  17091. * locations (i.e. write and read indices).
  17092. * The backpressure time indicates the time in ms for which continuous
  17093. * backpressure has been observed in the ring.
  17094. *
  17095. * The message format is as follows:
  17096. *
  17097. * |31 24|23 16|15 8|7 0|
  17098. * |----------------+----------------+----------------+----------------|
  17099. * | ring_id | ring_type | pdev_id | msg_type |
  17100. * |-------------------------------------------------------------------|
  17101. * | tail_idx | head_idx |
  17102. * |-------------------------------------------------------------------|
  17103. * | backpressure_time_ms |
  17104. * |-------------------------------------------------------------------|
  17105. *
  17106. * The message is interpreted as follows:
  17107. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  17108. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  17109. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  17110. * 1, 2, 3 indicates pdev_id 0,1,2 and
  17111. * the msg is for LMAC ring.
  17112. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  17113. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  17114. * htt_backpressure_lmac_ring_id. This represents
  17115. * the ring id for which continuous backpressure
  17116. * is seen
  17117. *
  17118. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  17119. * the ring indicated by the ring_id
  17120. *
  17121. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  17122. * the ring indicated by the ring id
  17123. *
  17124. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  17125. * backpressure has been seen in the ring
  17126. * indicated by the ring_id.
  17127. * Units = milliseconds
  17128. */
  17129. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  17130. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  17131. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  17132. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  17133. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  17134. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  17135. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  17136. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  17137. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  17138. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  17139. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  17140. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  17141. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  17142. do { \
  17143. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  17144. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  17145. } while (0)
  17146. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  17147. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  17148. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  17149. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  17150. do { \
  17151. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  17152. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  17153. } while (0)
  17154. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  17155. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  17156. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  17157. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  17158. do { \
  17159. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  17160. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  17161. } while (0)
  17162. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  17163. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  17164. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  17165. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  17166. do { \
  17167. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  17168. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  17169. } while (0)
  17170. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  17171. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  17172. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  17173. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  17174. do { \
  17175. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  17176. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  17177. } while (0)
  17178. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  17179. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  17180. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  17181. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  17182. do { \
  17183. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  17184. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  17185. } while (0)
  17186. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  17187. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  17188. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  17189. enum htt_backpressure_ring_type {
  17190. HTT_SW_RING_TYPE_UMAC,
  17191. HTT_SW_RING_TYPE_LMAC,
  17192. HTT_SW_RING_TYPE_MAX,
  17193. };
  17194. /* Ring id for which the message is sent to host */
  17195. enum htt_backpressure_umac_ringid {
  17196. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  17197. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  17198. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  17199. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  17200. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  17201. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  17202. HTT_SW_RING_IDX_REO_REO2FW_RING,
  17203. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  17204. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  17205. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  17206. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  17207. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  17208. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  17209. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  17210. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  17211. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  17212. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  17213. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  17214. HTT_SW_UMAC_RING_IDX_MAX,
  17215. };
  17216. enum htt_backpressure_lmac_ringid {
  17217. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  17218. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  17219. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  17220. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  17221. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  17222. HTT_SW_RING_IDX_RXDMA2FW_RING,
  17223. HTT_SW_RING_IDX_RXDMA2SW_RING,
  17224. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  17225. HTT_SW_RING_IDX_RXDMA2REO_RING,
  17226. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  17227. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  17228. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  17229. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  17230. HTT_SW_LMAC_RING_IDX_MAX,
  17231. };
  17232. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  17233. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  17234. pdev_id: 8,
  17235. ring_type: 8, /* htt_backpressure_ring_type */
  17236. /*
  17237. * ring_id holds an enum value from either
  17238. * htt_backpressure_umac_ringid or
  17239. * htt_backpressure_lmac_ringid, based on
  17240. * the ring_type setting.
  17241. */
  17242. ring_id: 8;
  17243. A_UINT16 head_idx;
  17244. A_UINT16 tail_idx;
  17245. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  17246. } POSTPACK;
  17247. /*
  17248. * Defines two 32 bit words that can be used by the target to indicate a per
  17249. * user RU allocation and rate information.
  17250. *
  17251. * This information is currently provided in the "sw_response_reference_ptr"
  17252. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  17253. * "rx_ppdu_end_user_stats" TLV.
  17254. *
  17255. * VALID:
  17256. * The consumer of these words must explicitly check the valid bit,
  17257. * and only attempt interpretation of any of the remaining fields if
  17258. * the valid bit is set to 1.
  17259. *
  17260. * VERSION:
  17261. * The consumer of these words must also explicitly check the version bit,
  17262. * and only use the V0 definition if the VERSION field is set to 0.
  17263. *
  17264. * Version 1 is currently undefined, with the exception of the VALID and
  17265. * VERSION fields.
  17266. *
  17267. * Version 0:
  17268. *
  17269. * The fields below are duplicated per BW.
  17270. *
  17271. * The consumer must determine which BW field to use, based on the UL OFDMA
  17272. * PPDU BW indicated by HW.
  17273. *
  17274. * RU_START: RU26 start index for the user.
  17275. * Note that this is always using the RU26 index, regardless
  17276. * of the actual RU assigned to the user
  17277. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  17278. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  17279. *
  17280. * For example, 20MHz (the value in the top row is RU_START)
  17281. *
  17282. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  17283. * RU Size 1 (52): | | | | | |
  17284. * RU Size 2 (106): | | | |
  17285. * RU Size 3 (242): | |
  17286. *
  17287. * RU_SIZE: Indicates the RU size, as defined by enum
  17288. * htt_ul_ofdma_user_info_ru_size.
  17289. *
  17290. * LDPC: LDPC enabled (if 0, BCC is used)
  17291. *
  17292. * DCM: DCM enabled
  17293. *
  17294. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  17295. * |---------------------------------+--------------------------------|
  17296. * |Ver|Valid| FW internal |
  17297. * |---------------------------------+--------------------------------|
  17298. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  17299. * |---------------------------------+--------------------------------|
  17300. */
  17301. enum htt_ul_ofdma_user_info_ru_size {
  17302. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  17303. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  17304. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  17305. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  17306. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  17307. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  17308. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  17309. };
  17310. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  17311. struct htt_ul_ofdma_user_info_v0 {
  17312. A_UINT32 word0;
  17313. A_UINT32 word1;
  17314. };
  17315. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  17316. A_UINT32 w0_fw_rsvd:29; \
  17317. A_UINT32 w0_manual_ulofdma_trig:1; \
  17318. A_UINT32 w0_valid:1; \
  17319. A_UINT32 w0_version:1;
  17320. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  17321. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17322. };
  17323. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  17324. A_UINT32 w1_nss:3; \
  17325. A_UINT32 w1_mcs:4; \
  17326. A_UINT32 w1_ldpc:1; \
  17327. A_UINT32 w1_dcm:1; \
  17328. A_UINT32 w1_ru_start:7; \
  17329. A_UINT32 w1_ru_size:3; \
  17330. A_UINT32 w1_trig_type:4; \
  17331. A_UINT32 w1_unused:9;
  17332. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  17333. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17334. };
  17335. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  17336. A_UINT32 w0_fw_rsvd:27; \
  17337. A_UINT32 w0_sub_version:3; /* set to a value of "0" on WKK/Beryllium targets (future expansion) */ \
  17338. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  17339. A_UINT32 w0_version:1; /* set to a value of "1" to indicate picking htt_ul_ofdma_user_info_v1_bitmap (field aligns with V0 definition) */
  17340. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  17341. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17342. };
  17343. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  17344. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  17345. A_UINT32 w1_trig_type:4; \
  17346. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  17347. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  17348. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17349. };
  17350. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  17351. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  17352. union {
  17353. A_UINT32 word0;
  17354. struct {
  17355. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  17356. };
  17357. };
  17358. union {
  17359. A_UINT32 word1;
  17360. struct {
  17361. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  17362. };
  17363. };
  17364. } POSTPACK;
  17365. /*
  17366. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  17367. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  17368. * this should be picked.
  17369. */
  17370. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  17371. union {
  17372. A_UINT32 word0;
  17373. struct {
  17374. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  17375. };
  17376. };
  17377. union {
  17378. A_UINT32 word1;
  17379. struct {
  17380. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  17381. };
  17382. };
  17383. } POSTPACK;
  17384. enum HTT_UL_OFDMA_TRIG_TYPE {
  17385. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  17386. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  17387. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  17388. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  17389. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  17390. };
  17391. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  17392. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  17393. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  17394. #define HTT_UL_OFDMA_USER_INFO_V0_W0_MANUAL_ULOFDMA_TRIG_M 0x20000000
  17395. #define HTT_UL_OFDMA_USER_INFO_V0_W0_MANUAL_ULOFDMA_TRIG_S 29
  17396. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  17397. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  17398. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  17399. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  17400. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  17401. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  17402. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  17403. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  17404. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  17405. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  17406. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  17407. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  17408. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  17409. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  17410. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  17411. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  17412. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  17413. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  17414. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  17415. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  17416. /*--- word 0 ---*/
  17417. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  17418. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  17419. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  17420. do { \
  17421. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  17422. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  17423. } while (0)
  17424. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  17425. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  17426. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  17427. do { \
  17428. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  17429. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  17430. } while (0)
  17431. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  17432. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  17433. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  17434. do { \
  17435. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  17436. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  17437. } while (0)
  17438. /*--- word 1 ---*/
  17439. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  17440. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  17441. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  17442. do { \
  17443. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  17444. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  17445. } while (0)
  17446. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  17447. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  17448. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  17449. do { \
  17450. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  17451. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  17452. } while (0)
  17453. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  17454. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  17455. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  17456. do { \
  17457. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  17458. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  17459. } while (0)
  17460. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  17461. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  17462. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  17463. do { \
  17464. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  17465. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  17466. } while (0)
  17467. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  17468. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  17469. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  17470. do { \
  17471. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  17472. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  17473. } while (0)
  17474. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  17475. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  17476. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  17477. do { \
  17478. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  17479. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  17480. } while (0)
  17481. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  17482. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  17483. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  17484. do { \
  17485. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  17486. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  17487. } while (0)
  17488. /**
  17489. * @brief target -> host channel calibration data message
  17490. *
  17491. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  17492. *
  17493. * @brief host -> target channel calibration data message
  17494. *
  17495. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  17496. *
  17497. * @details
  17498. * The following field definitions describe the format of the channel
  17499. * calibration data message sent from the target to the host when
  17500. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  17501. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  17502. * The message is defined as htt_chan_caldata_msg followed by a variable
  17503. * number of 32-bit character values.
  17504. *
  17505. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  17506. * |------------------------------------------------------------------|
  17507. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  17508. * |------------------------------------------------------------------|
  17509. * | payload size | mhz |
  17510. * |------------------------------------------------------------------|
  17511. * | center frequency 2 | center frequency 1 |
  17512. * |------------------------------------------------------------------|
  17513. * | check sum |
  17514. * |------------------------------------------------------------------|
  17515. * | payload |
  17516. * |------------------------------------------------------------------|
  17517. * message info field:
  17518. * - MSG_TYPE
  17519. * Bits 7:0
  17520. * Purpose: identifies this as a channel calibration data message
  17521. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  17522. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  17523. * - SUB_TYPE
  17524. * Bits 11:8
  17525. * Purpose: T2H: indicates whether target is providing chan cal data
  17526. * to the host to store, or requesting that the host
  17527. * download previously-stored data.
  17528. * H2T: indicates whether the host is providing the requested
  17529. * channel cal data, or if it is rejecting the data
  17530. * request because it does not have the requested data.
  17531. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  17532. * - CHKSUM_VALID
  17533. * Bit 12
  17534. * Purpose: indicates if the checksum field is valid
  17535. * value:
  17536. * - FRAG
  17537. * Bit 19:16
  17538. * Purpose: indicates the fragment index for message
  17539. * value: 0 for first fragment, 1 for second fragment, ...
  17540. * - APPEND
  17541. * Bit 20
  17542. * Purpose: indicates if this is the last fragment
  17543. * value: 0 = final fragment, 1 = more fragments will be appended
  17544. *
  17545. * channel and payload size field
  17546. * - MHZ
  17547. * Bits 15:0
  17548. * Purpose: indicates the channel primary frequency
  17549. * Value:
  17550. * - PAYLOAD_SIZE
  17551. * Bits 31:16
  17552. * Purpose: indicates the bytes of calibration data in payload
  17553. * Value:
  17554. *
  17555. * center frequency field
  17556. * - CENTER FREQUENCY 1
  17557. * Bits 15:0
  17558. * Purpose: indicates the channel center frequency
  17559. * Value: channel center frequency, in MHz units
  17560. * - CENTER FREQUENCY 2
  17561. * Bits 31:16
  17562. * Purpose: indicates the secondary channel center frequency,
  17563. * only for 11acvht 80plus80 mode
  17564. * Value: secondary channel center frequency, in MHz units, if applicable
  17565. *
  17566. * checksum field
  17567. * - CHECK_SUM
  17568. * Bits 31:0
  17569. * Purpose: check the payload data, it is just for this fragment.
  17570. * This is intended for the target to check that the channel
  17571. * calibration data returned by the host is the unmodified data
  17572. * that was previously provided to the host by the target.
  17573. * value: checksum of fragment payload
  17574. */
  17575. PREPACK struct htt_chan_caldata_msg {
  17576. /* DWORD 0: message info */
  17577. A_UINT32
  17578. msg_type: 8,
  17579. sub_type: 4 ,
  17580. chksum_valid: 1, /** 1:valid, 0:invalid */
  17581. reserved1: 3,
  17582. frag_idx: 4, /** fragment index for calibration data */
  17583. appending: 1, /** 0: no fragment appending,
  17584. * 1: extra fragment appending */
  17585. reserved2: 11;
  17586. /* DWORD 1: channel and payload size */
  17587. A_UINT32
  17588. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  17589. payload_size: 16; /** unit: bytes */
  17590. /* DWORD 2: center frequency */
  17591. A_UINT32
  17592. band_center_freq1: 16, /** Center frequency 1 in MHz */
  17593. band_center_freq2: 16; /** Center frequency 2 in MHz,
  17594. * valid only for 11acvht 80plus80 mode */
  17595. /* DWORD 3: check sum */
  17596. A_UINT32 chksum;
  17597. /* variable length for calibration data */
  17598. A_UINT32 payload[1/* or more */];
  17599. } POSTPACK;
  17600. /* T2H SUBTYPE */
  17601. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  17602. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  17603. /* H2T SUBTYPE */
  17604. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  17605. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  17606. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  17607. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  17608. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  17609. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  17610. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  17611. do { \
  17612. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  17613. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  17614. } while (0)
  17615. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  17616. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  17617. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  17618. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  17619. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  17620. do { \
  17621. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  17622. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  17623. } while (0)
  17624. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  17625. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  17626. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  17627. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  17628. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  17629. do { \
  17630. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  17631. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  17632. } while (0)
  17633. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  17634. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  17635. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  17636. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  17637. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  17638. do { \
  17639. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  17640. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  17641. } while (0)
  17642. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  17643. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  17644. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  17645. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  17646. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  17647. do { \
  17648. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  17649. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  17650. } while (0)
  17651. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  17652. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  17653. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  17654. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  17655. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  17656. do { \
  17657. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  17658. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  17659. } while (0)
  17660. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  17661. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  17662. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  17663. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  17664. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  17665. do { \
  17666. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  17667. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  17668. } while (0)
  17669. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  17670. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  17671. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  17672. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  17673. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  17674. do { \
  17675. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  17676. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  17677. } while (0)
  17678. /**
  17679. * @brief target -> host FSE CMEM based send
  17680. *
  17681. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  17682. *
  17683. * @details
  17684. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  17685. * FSE placement in CMEM is enabled.
  17686. *
  17687. * This message sends the non-secure CMEM base address.
  17688. * It will be sent to host in response to message
  17689. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  17690. * The message would appear as follows:
  17691. *
  17692. * |31 24|23 16|15 8|7 0|
  17693. * |----------------+----------------+----------------+----------------|
  17694. * | reserved | num_entries | msg_type |
  17695. * |----------------+----------------+----------------+----------------|
  17696. * | base_address_lo |
  17697. * |----------------+----------------+----------------+----------------|
  17698. * | base_address_hi |
  17699. * |-------------------------------------------------------------------|
  17700. *
  17701. * The message is interpreted as follows:
  17702. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  17703. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  17704. * b'8:15 - number_entries: Indicated the number of entries
  17705. * programmed.
  17706. * b'16:31 - reserved.
  17707. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  17708. * CMEM base address
  17709. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  17710. * CMEM base address
  17711. */
  17712. PREPACK struct htt_cmem_base_send_t {
  17713. A_UINT32 msg_type: 8,
  17714. num_entries: 8,
  17715. reserved: 16;
  17716. A_UINT32 base_address_lo;
  17717. A_UINT32 base_address_hi;
  17718. } POSTPACK;
  17719. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  17720. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  17721. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  17722. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  17723. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  17724. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  17725. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  17726. do { \
  17727. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  17728. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  17729. } while (0)
  17730. /**
  17731. * @brief - HTT PPDU ID format
  17732. *
  17733. * @details
  17734. * The following field definitions describe the format of the PPDU ID.
  17735. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  17736. *
  17737. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  17738. * +--------------------------------------------------------------------------
  17739. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  17740. * +--------------------------------------------------------------------------
  17741. *
  17742. * sch id :Schedule command id
  17743. * Bits [11 : 0] : monotonically increasing counter to track the
  17744. * PPDU posted to a specific transmit queue.
  17745. *
  17746. * hwq_id: Hardware Queue ID.
  17747. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  17748. *
  17749. * mac_id: MAC ID
  17750. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  17751. *
  17752. * seq_idx: Sequence index.
  17753. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  17754. * a particular TXOP.
  17755. *
  17756. * tqm_cmd: HWSCH/TQM flag.
  17757. * Bit [23] : Always set to 0.
  17758. *
  17759. * seq_cmd_type: Sequence command type.
  17760. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  17761. * Refer to enum HTT_STATS_FTYPE for values.
  17762. */
  17763. PREPACK struct htt_ppdu_id {
  17764. A_UINT32
  17765. sch_id: 12,
  17766. hwq_id: 5,
  17767. mac_id: 2,
  17768. seq_idx: 2,
  17769. reserved1: 2,
  17770. tqm_cmd: 1,
  17771. seq_cmd_type: 6,
  17772. reserved2: 2;
  17773. } POSTPACK;
  17774. #define HTT_PPDU_ID_SCH_ID_S 0
  17775. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  17776. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  17777. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  17778. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  17779. do { \
  17780. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  17781. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  17782. } while (0)
  17783. #define HTT_PPDU_ID_HWQ_ID_S 12
  17784. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  17785. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  17786. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  17787. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  17788. do { \
  17789. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  17790. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  17791. } while (0)
  17792. #define HTT_PPDU_ID_MAC_ID_S 17
  17793. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  17794. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  17795. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  17796. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  17797. do { \
  17798. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  17799. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  17800. } while (0)
  17801. #define HTT_PPDU_ID_SEQ_IDX_S 19
  17802. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  17803. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  17804. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  17805. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  17806. do { \
  17807. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  17808. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  17809. } while (0)
  17810. #define HTT_PPDU_ID_TQM_CMD_S 23
  17811. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  17812. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  17813. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  17814. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  17815. do { \
  17816. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  17817. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  17818. } while (0)
  17819. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  17820. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  17821. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  17822. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  17823. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  17824. do { \
  17825. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  17826. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  17827. } while (0)
  17828. /**
  17829. * @brief target -> RX PEER METADATA V0 format
  17830. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17831. * message from target, and will confirm to the target which peer metadata
  17832. * version to use in the wmi_init message.
  17833. *
  17834. * The following diagram shows the format of the RX PEER METADATA.
  17835. *
  17836. * |31 24|23 16|15 8|7 0|
  17837. * |-----------------------------------------------------------------------|
  17838. * | Reserved | VDEV ID | PEER ID |
  17839. * |-----------------------------------------------------------------------|
  17840. */
  17841. PREPACK struct htt_rx_peer_metadata_v0 {
  17842. A_UINT32
  17843. peer_id: 16,
  17844. vdev_id: 8,
  17845. reserved1: 8;
  17846. } POSTPACK;
  17847. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  17848. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  17849. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  17850. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  17851. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  17852. do { \
  17853. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  17854. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  17855. } while (0)
  17856. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  17857. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  17858. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  17859. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  17860. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  17861. do { \
  17862. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  17863. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  17864. } while (0)
  17865. /**
  17866. * @brief target -> RX PEER METADATA V1 format
  17867. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17868. * message from target, and will confirm to the target which peer metadata
  17869. * version to use in the wmi_init message.
  17870. *
  17871. * The following diagram shows the format of the RX PEER METADATA V1 format.
  17872. *
  17873. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  17874. * |---------------------------------------------------------------------------|
  17875. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  17876. * |---------------------------------------------------------------------------|
  17877. */
  17878. PREPACK struct htt_rx_peer_metadata_v1 {
  17879. A_UINT32
  17880. peer_id: 13,
  17881. ml_peer_valid: 1,
  17882. logical_link_id: 2,
  17883. vdev_id: 8,
  17884. lmac_id: 2,
  17885. chip_id: 3,
  17886. reserved2: 3;
  17887. } POSTPACK;
  17888. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  17889. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  17890. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  17891. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  17892. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  17893. do { \
  17894. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  17895. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  17896. } while (0)
  17897. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  17898. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  17899. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  17900. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  17901. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  17902. do { \
  17903. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  17904. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  17905. } while (0)
  17906. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  17907. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  17908. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  17909. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  17910. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  17911. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  17912. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  17913. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  17914. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  17915. do { \
  17916. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  17917. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  17918. } while (0)
  17919. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  17920. do { \
  17921. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  17922. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  17923. } while (0)
  17924. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  17925. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  17926. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  17927. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  17928. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  17929. do { \
  17930. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  17931. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  17932. } while (0)
  17933. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  17934. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  17935. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  17936. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  17937. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  17938. do { \
  17939. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  17940. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  17941. } while (0)
  17942. /**
  17943. * @brief target -> RX PEER METADATA V1A format
  17944. * Host will know the peer metadata version from the wmi_service_ready_ext2
  17945. * message from target, WMI_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT WMI service,
  17946. * and will confirm to the target which peer metadata version to use in the
  17947. * wmi_init message.
  17948. *
  17949. * The following diagram shows the format of the RX PEER METADATA V1A format.
  17950. *
  17951. * |31 29|28 26|25 22|21 14| 13 |12 0|
  17952. * |-------------------------------------------------------------------|
  17953. * |Rsvd2|CHIP ID|logical_link_id|VDEV ID|ML PEER|SW PEER ID/ML PEER ID|
  17954. * |-------------------------------------------------------------------|
  17955. */
  17956. PREPACK struct htt_rx_peer_metadata_v1a {
  17957. A_UINT32
  17958. peer_id: 13,
  17959. ml_peer_valid: 1,
  17960. vdev_id: 8,
  17961. logical_link_id: 4,
  17962. chip_id: 3,
  17963. reserved2: 3;
  17964. } POSTPACK;
  17965. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_S 0
  17966. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_M 0x00001fff
  17967. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_GET(_var) \
  17968. (((_var) & HTT_RX_PEER_META_DATA_V1A_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1A_PEER_ID_S)
  17969. #define HTT_RX_PEER_META_DATA_V1A_PEER_ID_SET(_var, _val) \
  17970. do { \
  17971. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_PEER_ID, _val); \
  17972. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_PEER_ID_S)); \
  17973. } while (0)
  17974. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S 13
  17975. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_M 0x00002000
  17976. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_GET(_var) \
  17977. (((_var) & HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S)
  17978. #define HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_SET(_var, _val) \
  17979. do { \
  17980. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID, _val); \
  17981. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_ML_PEER_VALID_S)); \
  17982. } while (0)
  17983. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S 14
  17984. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_M 0x003fc000
  17985. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_GET(_var) \
  17986. (((_var) & HTT_RX_PEER_META_DATA_V1A_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S)
  17987. #define HTT_RX_PEER_META_DATA_V1A_VDEV_ID_SET(_var, _val) \
  17988. do { \
  17989. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_VDEV_ID, _val); \
  17990. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_VDEV_ID_S)); \
  17991. } while (0)
  17992. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S 22
  17993. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_M 0x03C00000
  17994. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_GET(_var) \
  17995. (((_var) & HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S)
  17996. #define HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_SET(_var, _val) \
  17997. do { \
  17998. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID, _val); \
  17999. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_LOGICAL_LINK_ID_S)); \
  18000. } while (0)
  18001. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S 26
  18002. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_M 0x1c000000
  18003. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_GET(_var) \
  18004. (((_var) & HTT_RX_PEER_META_DATA_V1A_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S)
  18005. #define HTT_RX_PEER_META_DATA_V1A_CHIP_ID_SET(_var, _val) \
  18006. do { \
  18007. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1A_CHIP_ID, _val); \
  18008. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1A_CHIP_ID_S)); \
  18009. } while (0)
  18010. /**
  18011. * @brief target -> RX PEER METADATA V1B format
  18012. * Host will know the peer metadata version from the wmi_service_ready_ext2
  18013. * message from target, WMI_SERVICE_PEER_METADATA_V1A_V1B_SUPPORT WMI service,
  18014. * and will confirm to the target which peer metadata version to use in the
  18015. * wmi_init message.
  18016. *
  18017. * The following diagram shows the format of the RX PEER METADATA V1B format.
  18018. *
  18019. * |31 29|28 26|25 22|21 14| 13 |12 0|
  18020. * |--------------------------------------------------------------|
  18021. * |Rsvd2|CHIP ID|hw_link_id|VDEV ID|ML PEER|SW PEER ID/ML PEER ID|
  18022. * |--------------------------------------------------------------|
  18023. */
  18024. PREPACK struct htt_rx_peer_metadata_v1b {
  18025. A_UINT32
  18026. peer_id: 13,
  18027. ml_peer_valid: 1,
  18028. vdev_id: 8,
  18029. hw_link_id: 4,
  18030. chip_id: 3,
  18031. reserved2: 3;
  18032. } POSTPACK;
  18033. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_S 0
  18034. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_M 0x00001fff
  18035. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_GET(_var) \
  18036. (((_var) & HTT_RX_PEER_META_DATA_V1B_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1B_PEER_ID_S)
  18037. #define HTT_RX_PEER_META_DATA_V1B_PEER_ID_SET(_var, _val) \
  18038. do { \
  18039. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_PEER_ID, _val); \
  18040. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_PEER_ID_S)); \
  18041. } while (0)
  18042. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S 13
  18043. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_M 0x00002000
  18044. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_GET(_var) \
  18045. (((_var) & HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S)
  18046. #define HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_SET(_var, _val) \
  18047. do { \
  18048. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID, _val); \
  18049. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_ML_PEER_VALID_S)); \
  18050. } while (0)
  18051. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S 14
  18052. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_M 0x003fc000
  18053. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_GET(_var) \
  18054. (((_var) & HTT_RX_PEER_META_DATA_V1B_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S)
  18055. #define HTT_RX_PEER_META_DATA_V1B_VDEV_ID_SET(_var, _val) \
  18056. do { \
  18057. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_VDEV_ID, _val); \
  18058. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_VDEV_ID_S)); \
  18059. } while (0)
  18060. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S 22
  18061. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_M 0x03C00000
  18062. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_GET(_var) \
  18063. (((_var) & HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S)
  18064. #define HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_SET(_var, _val) \
  18065. do { \
  18066. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID, _val); \
  18067. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_HW_LINK_ID_S)); \
  18068. } while (0)
  18069. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S 26
  18070. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_M 0x1c000000
  18071. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_GET(_var) \
  18072. (((_var) & HTT_RX_PEER_META_DATA_V1B_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S)
  18073. #define HTT_RX_PEER_META_DATA_V1B_CHIP_ID_SET(_var, _val) \
  18074. do { \
  18075. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1B_CHIP_ID, _val); \
  18076. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1B_CHIP_ID_S)); \
  18077. } while (0)
  18078. /* generic variables for masks and shifts for various fields */
  18079. extern A_UINT32 HTT_RX_PEER_META_DATA_PEER_ID_S;
  18080. extern A_UINT32 HTT_RX_PEER_META_DATA_PEER_ID_M;
  18081. extern A_UINT32 HTT_RX_PEER_META_DATA_ML_PEER_VALID_S;
  18082. extern A_UINT32 HTT_RX_PEER_META_DATA_ML_PEER_VALID_M;
  18083. /* generic function pointers to get/set values from rx peer metadata v0/v1/v1a/v1b */
  18084. extern A_UINT32 (*HTT_RX_PEER_META_DATA_PEER_ID_GET) (A_UINT32 var);
  18085. extern void (*HTT_RX_PEER_META_DATA_PEER_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18086. extern A_UINT32 (*HTT_RX_PEER_META_DATA_VDEV_ID_GET) (A_UINT32 var);
  18087. extern void (*HTT_RX_PEER_META_DATA_VDEV_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18088. extern A_UINT32 (*HTT_RX_PEER_META_DATA_ML_PEER_VALID_GET) (A_UINT32 var);
  18089. extern void (*HTT_RX_PEER_META_DATA_ML_PEER_VALID_SET) (A_UINT32 *var, A_UINT32 val);
  18090. extern A_UINT32 (*HTT_RX_PEER_META_DATA_LOGICAL_LINK_ID_GET) (A_UINT32 var);
  18091. extern void (*HTT_RX_PEER_META_DATA_LOGICAL_LINK_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18092. extern A_UINT32 (*HTT_RX_PEER_META_DATA_LMAC_ID_GET) (A_UINT32 var);
  18093. extern void (*HTT_RX_PEER_META_DATA_LMAC_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18094. extern A_UINT32 (*HTT_RX_PEER_META_DATA_CHIP_ID_GET) (A_UINT32 var);
  18095. extern void (*HTT_RX_PEER_META_DATA_CHIP_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18096. extern A_UINT32 (*HTT_RX_PEER_META_DATA_HW_LINK_ID_GET) (A_UINT32 var);
  18097. extern void (*HTT_RX_PEER_META_DATA_HW_LINK_ID_SET) (A_UINT32 *var, A_UINT32 val);
  18098. /*
  18099. * In some systems, the host SW wants to specify priorities between
  18100. * different MSDU / flow queues within the same peer-TID.
  18101. * The below enums are used for the host to identify to the target
  18102. * which MSDU queue's priority it wants to adjust.
  18103. */
  18104. /*
  18105. * The MSDUQ index describe index of TCL HW, where each index is
  18106. * used for queuing particular types of MSDUs.
  18107. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  18108. */
  18109. enum HTT_MSDUQ_INDEX {
  18110. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  18111. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  18112. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  18113. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  18114. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  18115. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  18116. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  18117. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  18118. HTT_MSDUQ_MAX_INDEX,
  18119. };
  18120. /* MSDU qtype definition */
  18121. enum HTT_MSDU_QTYPE {
  18122. /*
  18123. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  18124. * relative priority. Instead, the relative priority of CRIT_0 versus
  18125. * CRIT_1 is controlled by the FW, through the configuration parameters
  18126. * it applies to the queues.
  18127. */
  18128. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  18129. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  18130. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  18131. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  18132. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  18133. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  18134. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  18135. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  18136. /* New MSDU_QTYPE should be added above this line */
  18137. /*
  18138. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  18139. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  18140. * any host/target message definitions. The QTYPE_MAX value can
  18141. * only be used internally within the host or within the target.
  18142. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  18143. * it must regard the unexpected value as a default qtype value,
  18144. * or ignore it.
  18145. */
  18146. HTT_MSDU_QTYPE_MAX,
  18147. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  18148. };
  18149. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  18150. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  18151. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  18152. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  18153. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  18154. };
  18155. /**
  18156. * @brief target -> host mlo timestamp offset indication
  18157. *
  18158. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  18159. *
  18160. * @details
  18161. * The following field definitions describe the format of the HTT target
  18162. * to host mlo timestamp offset indication message.
  18163. *
  18164. *
  18165. * |31 16|15 12|11 10|9 8|7 0 |
  18166. * |----------------------------------------------------------------------|
  18167. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  18168. * |----------------------------------------------------------------------|
  18169. * | Sync time stamp lo in us |
  18170. * |----------------------------------------------------------------------|
  18171. * | Sync time stamp hi in us |
  18172. * |----------------------------------------------------------------------|
  18173. * | mlo time stamp offset lo in us |
  18174. * |----------------------------------------------------------------------|
  18175. * | mlo time stamp offset hi in us |
  18176. * |----------------------------------------------------------------------|
  18177. * | mlo time stamp offset clocks in clock ticks |
  18178. * |----------------------------------------------------------------------|
  18179. * |31 26|25 16|15 0 |
  18180. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  18181. * | | compensation in clks | |
  18182. * |----------------------------------------------------------------------|
  18183. * |31 22|21 0 |
  18184. * | rsvd 3 | mlo time stamp comp timer period |
  18185. * |----------------------------------------------------------------------|
  18186. * The message is interpreted as follows:
  18187. *
  18188. * dword0 - b'0:7 - msg_type: This will be set to
  18189. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  18190. * value: 0x28
  18191. *
  18192. * dword0 - b'9:8 - pdev_id
  18193. *
  18194. * dword0 - b'11:10 - chip_id
  18195. *
  18196. * dword0 - b'15:12 - rsvd1: Reserved for future use
  18197. *
  18198. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  18199. *
  18200. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  18201. * which last sync interrupt was received
  18202. *
  18203. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  18204. * which last sync interrupt was received
  18205. *
  18206. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  18207. *
  18208. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  18209. *
  18210. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  18211. *
  18212. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  18213. *
  18214. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  18215. * for sub us resolution
  18216. *
  18217. * dword6 - b'31:26 - rsvd2: Reserved for future use
  18218. *
  18219. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  18220. * is applied, in us
  18221. *
  18222. * dword7 - b'31:22 - rsvd3: Reserved for future use
  18223. */
  18224. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  18225. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  18226. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  18227. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  18228. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  18229. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  18230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  18231. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  18232. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  18233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  18234. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  18235. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  18236. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  18237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  18238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  18239. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  18240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  18241. do { \
  18242. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  18243. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  18244. } while (0)
  18245. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  18246. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  18247. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  18248. do { \
  18249. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  18250. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  18251. } while (0)
  18252. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  18253. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  18254. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  18255. do { \
  18256. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  18257. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  18258. } while (0)
  18259. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  18260. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  18261. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  18262. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  18263. do { \
  18264. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  18265. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  18266. } while (0)
  18267. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  18268. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  18269. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  18270. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  18271. do { \
  18272. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  18273. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  18274. } while (0)
  18275. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  18276. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  18277. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  18278. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  18279. do { \
  18280. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  18281. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  18282. } while (0)
  18283. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  18284. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  18285. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  18286. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  18287. do { \
  18288. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  18289. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  18290. } while (0)
  18291. typedef struct {
  18292. A_UINT32 msg_type: 8, /* bits 7:0 */
  18293. pdev_id: 2, /* bits 9:8 */
  18294. chip_id: 2, /* bits 11:10 */
  18295. reserved1: 4, /* bits 15:12 */
  18296. mac_clk_freq_mhz: 16; /* bits 31:16 */
  18297. A_UINT32 sync_timestamp_lo_us;
  18298. A_UINT32 sync_timestamp_hi_us;
  18299. A_UINT32 mlo_timestamp_offset_lo_us;
  18300. A_UINT32 mlo_timestamp_offset_hi_us;
  18301. A_UINT32 mlo_timestamp_offset_clks;
  18302. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  18303. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  18304. reserved2: 6; /* bits 31:26 */
  18305. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  18306. reserved3: 10; /* bits 31:22 */
  18307. } htt_t2h_mlo_offset_ind_t;
  18308. /*
  18309. * @brief target -> host VDEV TX RX STATS
  18310. *
  18311. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  18312. *
  18313. * @details
  18314. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  18315. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  18316. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  18317. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  18318. * periodically by target even in the absence of any further HTT request
  18319. * messages from host.
  18320. *
  18321. * The message is formatted as follows:
  18322. *
  18323. * |31 16|15 8|7 0|
  18324. * |---------------------------------+----------------+----------------|
  18325. * | payload_size | pdev_id | msg_type |
  18326. * |---------------------------------+----------------+----------------|
  18327. * | reserved0 |
  18328. * |-------------------------------------------------------------------|
  18329. * | reserved1 |
  18330. * |-------------------------------------------------------------------|
  18331. * | reserved2 |
  18332. * |-------------------------------------------------------------------|
  18333. * | |
  18334. * | VDEV specific Tx Rx stats info |
  18335. * | |
  18336. * |-------------------------------------------------------------------|
  18337. *
  18338. * The message is interpreted as follows:
  18339. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  18340. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  18341. * b'8:15 - pdev_id
  18342. * b'16:31 - size in bytes of the payload that follows the 16-byte
  18343. * message header fields (msg_type through reserved2)
  18344. * dword1 - b'0:31 - reserved0.
  18345. * dword2 - b'0:31 - reserved1.
  18346. * dword3 - b'0:31 - reserved2.
  18347. */
  18348. typedef struct {
  18349. A_UINT32 msg_type: 8,
  18350. pdev_id: 8,
  18351. payload_size: 16;
  18352. A_UINT32 reserved0;
  18353. A_UINT32 reserved1;
  18354. A_UINT32 reserved2;
  18355. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  18356. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  18357. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  18358. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  18359. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  18360. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  18361. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  18362. do { \
  18363. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  18364. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  18365. } while (0)
  18366. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  18367. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  18368. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  18369. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  18370. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  18371. do { \
  18372. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  18373. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  18374. } while (0)
  18375. /* SOC related stats */
  18376. typedef struct {
  18377. htt_tlv_hdr_t tlv_hdr;
  18378. /* When TQM is not able to find the peers during Tx, then it drops the packets
  18379. * This can be due to either the peer is deleted or deletion is ongoing
  18380. * */
  18381. A_UINT32 inv_peers_msdu_drop_count_lo;
  18382. A_UINT32 inv_peers_msdu_drop_count_hi;
  18383. } htt_t2h_soc_txrx_stats_common_tlv;
  18384. /* VDEV HW Tx/Rx stats */
  18385. typedef struct {
  18386. htt_tlv_hdr_t tlv_hdr;
  18387. A_UINT32 vdev_id;
  18388. /* Rx msdu byte cnt */
  18389. A_UINT32 rx_msdu_byte_cnt_lo;
  18390. A_UINT32 rx_msdu_byte_cnt_hi;
  18391. /* Rx msdu cnt */
  18392. A_UINT32 rx_msdu_cnt_lo;
  18393. A_UINT32 rx_msdu_cnt_hi;
  18394. /* tx msdu byte cnt */
  18395. A_UINT32 tx_msdu_byte_cnt_lo;
  18396. A_UINT32 tx_msdu_byte_cnt_hi;
  18397. /* tx msdu cnt */
  18398. A_UINT32 tx_msdu_cnt_lo;
  18399. A_UINT32 tx_msdu_cnt_hi;
  18400. /* tx excessive retry discarded msdu cnt */
  18401. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  18402. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  18403. /* TX congestion ctrl msdu drop cnt */
  18404. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  18405. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  18406. /* discarded tx msdus cnt coz of time to live expiry */
  18407. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  18408. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  18409. /* tx excessive retry discarded msdu byte cnt */
  18410. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  18411. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  18412. /* TX congestion ctrl msdu drop byte cnt */
  18413. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  18414. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  18415. /* discarded tx msdus byte cnt coz of time to live expiry */
  18416. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  18417. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  18418. /* TQM bypass frame cnt */
  18419. A_UINT32 tqm_bypass_frame_cnt_lo;
  18420. A_UINT32 tqm_bypass_frame_cnt_hi;
  18421. /* TQM bypass byte cnt */
  18422. A_UINT32 tqm_bypass_byte_cnt_lo;
  18423. A_UINT32 tqm_bypass_byte_cnt_hi;
  18424. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  18425. /*
  18426. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  18427. *
  18428. * @details
  18429. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  18430. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  18431. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  18432. * the default MSDU queues of each of the specified TIDs for the peer
  18433. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  18434. * If the default MSDU queues of a given TID within the peer are not linked
  18435. * to a service class, the svc_class_id field for that TID will have a
  18436. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  18437. * queues for that TID are not mapped to any service class.
  18438. *
  18439. * |31 16|15 8|7 0|
  18440. * |------------------------------+--------------+--------------|
  18441. * | peer ID | reserved | msg type |
  18442. * |------------------------------+--------------+------+-------|
  18443. * | reserved | svc class ID | TID |
  18444. * |------------------------------------------------------------|
  18445. * ...
  18446. * |------------------------------------------------------------|
  18447. * | reserved | svc class ID | TID |
  18448. * |------------------------------------------------------------|
  18449. * Header fields:
  18450. * dword0 - b'7:0 - msg_type: This will be set to
  18451. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  18452. * b'31:16 - peer ID
  18453. * dword1 - b'7:0 - TID
  18454. * b'15:8 - svc class ID
  18455. * (dword2, etc. same format as dword1)
  18456. */
  18457. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  18458. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  18459. A_UINT32 msg_type :8,
  18460. reserved0 :8,
  18461. peer_id :16;
  18462. struct {
  18463. A_UINT32 tid :8,
  18464. svc_class_id :8,
  18465. reserved1 :16;
  18466. } tid_reports[1/*or more*/];
  18467. } POSTPACK;
  18468. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  18469. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  18470. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  18471. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  18472. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  18473. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  18474. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  18475. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  18476. do { \
  18477. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  18478. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  18479. } while (0)
  18480. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  18481. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  18482. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  18483. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  18484. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  18485. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  18486. do { \
  18487. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  18488. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  18489. } while (0)
  18490. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  18491. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  18492. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  18493. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  18494. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  18495. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  18496. do { \
  18497. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  18498. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  18499. } while (0)
  18500. /*
  18501. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  18502. *
  18503. * @details
  18504. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  18505. * flow if the flow is seen the associated service class is conveyed to the
  18506. * target via TCL Data Command. Target on the other hand internally creates the
  18507. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  18508. * of the newly created MSDUQ and some other identifiers to uniquely identity
  18509. * the newly created MSDUQ
  18510. *
  18511. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  18512. * |------------------------------+------------------------+--------------|
  18513. * | peer ID | HTT qtype | msg type |
  18514. * |---------------------------------+--------------+--+---+-------+------|
  18515. * | reserved |AST list index|FO|WC | HLOS | remap|
  18516. * | | | | | TID | TID |
  18517. * |---------------------+------------------------------------------------|
  18518. * | reserved1 | tgt_opaque_id |
  18519. * |---------------------+------------------------------------------------|
  18520. *
  18521. * Header fields:
  18522. *
  18523. * dword0 - b'7:0 - msg_type: This will be set to
  18524. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  18525. * b'15:8 - HTT qtype
  18526. * b'31:16 - peer ID
  18527. *
  18528. * dword1 - b'3:0 - remap TID, as assigned in firmware
  18529. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  18530. * hlos_tid : Common to Lithium and Beryllium
  18531. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  18532. * TCL Data Command : Beryllium
  18533. * b10 - flow_override (FO), as sent by host in
  18534. * TCL Data Command: Beryllium
  18535. * b11:14 - ast_list_idx
  18536. * Array index into the list of extension AST entries
  18537. * (not the actual AST 16-bit index).
  18538. * The ast_list_idx is one-based, with the following
  18539. * range of values:
  18540. * - legacy targets supporting 16 user-defined
  18541. * MSDU queues: 1-2
  18542. * - legacy targets supporting 48 user-defined
  18543. * MSDU queues: 1-6
  18544. * - new targets: 0 (peer_id is used instead)
  18545. * Note that since ast_list_idx is one-based,
  18546. * the host will need to subtract 1 to use it as an
  18547. * index into a list of extension AST entries.
  18548. * b15:31 - reserved
  18549. *
  18550. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  18551. * unique MSDUQ id in firmware
  18552. * b'24:31 - reserved1
  18553. */
  18554. PREPACK struct htt_t2h_sawf_msduq_event {
  18555. A_UINT32 msg_type : 8,
  18556. htt_qtype : 8,
  18557. peer_id :16;
  18558. A_UINT32 remap_tid : 4,
  18559. hlos_tid : 4,
  18560. who_classify_info_sel : 2,
  18561. flow_override : 1,
  18562. ast_list_idx : 4,
  18563. reserved :17;
  18564. A_UINT32 tgt_opaque_id :24,
  18565. reserved1 : 8;
  18566. } POSTPACK;
  18567. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  18568. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  18569. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  18570. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  18571. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  18572. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  18573. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  18574. do { \
  18575. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  18576. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  18577. } while (0)
  18578. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  18579. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  18580. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  18581. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  18582. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  18583. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  18584. do { \
  18585. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  18586. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  18587. } while (0)
  18588. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  18589. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  18590. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  18591. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  18592. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  18593. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  18594. do { \
  18595. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  18596. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  18597. } while (0)
  18598. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  18599. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  18600. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  18601. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  18602. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  18603. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  18604. do { \
  18605. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  18606. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  18607. } while (0)
  18608. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  18609. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  18610. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  18611. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  18612. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  18613. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  18614. do { \
  18615. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  18616. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  18617. } while (0)
  18618. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  18619. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  18620. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  18621. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  18622. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  18623. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  18624. do { \
  18625. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  18626. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  18627. } while (0)
  18628. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  18629. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  18630. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  18631. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  18632. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  18633. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  18634. do { \
  18635. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  18636. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  18637. } while (0)
  18638. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  18639. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  18640. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  18641. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  18642. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  18643. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  18644. do { \
  18645. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  18646. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  18647. } while (0)
  18648. /**
  18649. * @brief target -> PPDU id format indication
  18650. *
  18651. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  18652. *
  18653. * @details
  18654. * The following field definitions describe the format of the HTT target
  18655. * to host PPDU ID format indication message.
  18656. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  18657. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  18658. * seq_idx :- Sequence control index of this PPDU.
  18659. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  18660. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  18661. * tqm_cmd:-
  18662. *
  18663. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  18664. * |--------------------------------------------------+------------------------|
  18665. * | rsvd0 | msg type |
  18666. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18667. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  18668. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18669. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  18670. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18671. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  18672. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18673. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  18674. * |-----+----------+----------+---------+-----+----------+----------+---------|
  18675. * Where: OF = bit offset, NB = number of bits, V = valid
  18676. * The message is interpreted as follows:
  18677. *
  18678. * dword0 - b'7:0 - msg_type: This will be set to
  18679. * HTT_T2H_PPDU_ID_FMT_IND
  18680. * value: 0x30
  18681. *
  18682. * dword0 - b'31:8 - reserved
  18683. *
  18684. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  18685. *
  18686. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  18687. *
  18688. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  18689. *
  18690. * dword1 - b'15:11 - reserved for future use
  18691. *
  18692. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  18693. *
  18694. * dword1 - b'21:17 - number of bits in ring_id
  18695. *
  18696. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  18697. *
  18698. * dword1 - b'31:27 - reserved for future use
  18699. *
  18700. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  18701. *
  18702. * dword2 - b'5:1 - number of bits in sequence index
  18703. *
  18704. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  18705. *
  18706. * dword2 - b'15:11 - reserved for future use
  18707. *
  18708. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  18709. *
  18710. * dword2 - b'21:17 - number of bits in link_id
  18711. *
  18712. * dword2 - b'26:22 - offset of link_id (in number of bits)
  18713. *
  18714. * dword2 - b'31:27 - reserved for future use
  18715. *
  18716. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  18717. *
  18718. * dword3 - b'5:1 - number of bits in seq_cmd_type
  18719. *
  18720. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  18721. *
  18722. * dword3 - b'15:11 - reserved for future use
  18723. *
  18724. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  18725. *
  18726. * dword3 - b'21:17 - number of bits in tqm_cmd
  18727. *
  18728. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  18729. *
  18730. * dword3 - b'31:27 - reserved for future use
  18731. *
  18732. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  18733. *
  18734. * dword4 - b'5:1 - number of bits in mac_id
  18735. *
  18736. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  18737. *
  18738. * dword4 - b'15:11 - reserved for future use
  18739. *
  18740. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  18741. *
  18742. * dword4 - b'21:17 - number of bits in crc
  18743. *
  18744. * dword4 - b'26:22 - offset of crc (in number of bits)
  18745. *
  18746. * dword4 - b'31:27 - reserved for future use
  18747. *
  18748. */
  18749. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  18750. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  18751. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  18752. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  18753. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  18754. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  18755. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  18756. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  18757. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  18758. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  18759. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  18760. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  18761. /* macros for accessing lower 16 bits in dword */
  18762. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  18763. do { \
  18764. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  18765. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  18766. } while (0)
  18767. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  18768. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  18769. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  18770. do { \
  18771. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  18772. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  18773. } while (0)
  18774. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  18775. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  18776. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  18777. do { \
  18778. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  18779. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  18780. } while (0)
  18781. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  18782. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  18783. /* macros for accessing upper 16 bits in dword */
  18784. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  18785. do { \
  18786. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  18787. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  18788. } while (0)
  18789. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  18790. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  18791. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  18792. do { \
  18793. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  18794. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  18795. } while (0)
  18796. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  18797. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  18798. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  18799. do { \
  18800. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  18801. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  18802. } while (0)
  18803. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  18804. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  18805. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  18806. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18807. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  18808. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18809. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  18810. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18811. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  18812. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18813. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  18814. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18815. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  18816. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18817. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  18818. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18819. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  18820. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18821. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  18822. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18823. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  18824. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18825. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  18826. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18827. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  18828. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18829. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  18830. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18831. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  18832. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18833. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  18834. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18835. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  18836. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18837. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  18838. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18839. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  18840. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18841. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  18842. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  18843. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  18844. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  18845. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  18846. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  18847. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  18848. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  18849. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  18850. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  18851. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  18852. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  18853. /* offsets in number dwords */
  18854. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  18855. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  18856. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  18857. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  18858. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  18859. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  18860. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  18861. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  18862. typedef struct {
  18863. A_UINT32 msg_type: 8, /* bits 7:0 */
  18864. rsvd0: 24;/* bits 31:8 */
  18865. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  18866. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  18867. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  18868. rsvd1: 5, /* bits 15:11 */
  18869. ring_id_valid: 1, /* bits 16:16 */
  18870. ring_id_bits: 5, /* bits 21:17 */
  18871. ring_id_offset: 5, /* bits 26:22 */
  18872. rsvd2: 5; /* bits 31:27 */
  18873. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  18874. seq_idx_bits: 5, /* bits 5:1 */
  18875. seq_idx_offset: 5, /* bits 10:6 */
  18876. rsvd3: 5, /* bits 15:11 */
  18877. link_id_valid: 1, /* bits 16:16 */
  18878. link_id_bits: 5, /* bits 21:17 */
  18879. link_id_offset: 5, /* bits 26:22 */
  18880. rsvd4: 5; /* bits 31:27 */
  18881. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  18882. seq_cmd_type_bits: 5, /* bits 5:1 */
  18883. seq_cmd_type_offset: 5, /* bits 10:6 */
  18884. rsvd5: 5, /* bits 15:11 */
  18885. tqm_cmd_valid: 1, /* bits 16:16 */
  18886. tqm_cmd_bits: 5, /* bits 21:17 */
  18887. tqm_cmd_offset: 5, /* bits 26:12 */
  18888. rsvd6: 5; /* bits 31:27 */
  18889. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  18890. mac_id_bits: 5, /* bits 5:1 */
  18891. mac_id_offset: 5, /* bits 10:6 */
  18892. rsvd8: 5, /* bits 15:11 */
  18893. crc_valid: 1, /* bits 16:16 */
  18894. crc_bits: 5, /* bits 21:17 */
  18895. crc_offset: 5, /* bits 26:12 */
  18896. rsvd9: 5; /* bits 31:27 */
  18897. } htt_t2h_ppdu_id_fmt_ind_t;
  18898. /**
  18899. * @brief target -> host RX_CCE_SUPER_RULE setup done message
  18900. *
  18901. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE
  18902. *
  18903. * @details
  18904. * HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE message is sent by the target
  18905. * when RX_CCE_SUPER_RULE setup is done
  18906. *
  18907. * This message shows the configuration results after the setup operation.
  18908. * It will always be sent to host.
  18909. * The message would appear as follows:
  18910. *
  18911. * |31 24|23 16|15 8|7 0|
  18912. * |-----------------+-----------------+----------------+----------------|
  18913. * | result | response_type | pdev_id | msg_type |
  18914. * |---------------------------------------------------------------------|
  18915. *
  18916. * The message is interpreted as follows:
  18917. * dword0 - b'0:7 - msg_type: This will be set to 0x33
  18918. * (HTT_T2H_MSG_TYPE_RX_CCE_SUPER_RULE_SETUP_DONE)
  18919. * b'8:15 - pdev_id: Identify which pdev RX_CCE_SUPER_RULE is setup on
  18920. * b'16:23 - response_type: Indicate the response type of this setup
  18921. * done msg
  18922. * 0: HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE,
  18923. * response to HTT_RX_CCE_SUPER_RULE_SETUP_REQUEST
  18924. * 1: HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  18925. * response to HTT_RX_CCE_SUPER_RULE_INSTALL
  18926. * 2: HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  18927. * response to HTT_RX_CCE_SUPER_RULE_RELEASE
  18928. * b'24:31 - result: Indicate result of setup operation
  18929. * For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE:
  18930. * b'24 - is_rule_enough: indicate if there are
  18931. * enough free cce rule slots
  18932. * 0: not enough
  18933. * 1: enough
  18934. * b'25:31 - avail_rule_num: indicate the number of
  18935. * remaining free cce rule slots, only makes sense
  18936. * when is_rule_enough = 0
  18937. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE:
  18938. * b'24 - cfg_result_0: indicate the config result
  18939. * of RX_CCE_SUPER_RULE_0
  18940. * 0: Install/Uninstall fails
  18941. * 1: Install/Uninstall succeeds
  18942. * b'25 - cfg_result_1: indicate the config result
  18943. * of RX_CCE_SUPER_RULE_1
  18944. * 0: Install/Uninstall fails
  18945. * 1: Install/Uninstall succeeds
  18946. * b'26:31 - reserved
  18947. * For HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE:
  18948. * b'24 - cfg_result_0: indicate the config result
  18949. * of RX_CCE_SUPER_RULE_0
  18950. * 0: Release fails
  18951. * 1: Release succeeds
  18952. * b'25 - cfg_result_1: indicate the config result
  18953. * of RX_CCE_SUPER_RULE_1
  18954. * 0: Release fails
  18955. * 1: Release succeeds
  18956. * b'26:31 - reserved
  18957. */
  18958. enum htt_rx_cce_super_rule_setup_done_response_type {
  18959. HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE = 0,
  18960. HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE,
  18961. HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE,
  18962. /*All reply type should be before this*/
  18963. HTT_RX_CCE_SUPER_RULE_SETUP_INVALID_RESPONSE,
  18964. };
  18965. PREPACK struct htt_rx_cce_super_rule_setup_done_t {
  18966. A_UINT8 msg_type;
  18967. A_UINT8 pdev_id;
  18968. A_UINT8 response_type;
  18969. union {
  18970. struct {
  18971. /* For HTT_RX_CCE_SUPER_RULE_SETUP_REQ_RESPONSE */
  18972. A_UINT8 is_rule_enough: 1,
  18973. avail_rule_num: 7;
  18974. };
  18975. struct {
  18976. /*
  18977. * For HTT_RX_CCE_SUPER_RULE_INSTALL_RESPONSE and
  18978. * HTT_RX_CCE_SUPER_RULE_RELEASE_RESPONSE
  18979. */
  18980. A_UINT8 cfg_result_0: 1,
  18981. cfg_result_1: 1,
  18982. rsvd: 6;
  18983. };
  18984. } result;
  18985. } POSTPACK;
  18986. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_SZ (sizeof(struct htt_rx_cce_super_rule_setup_done_t))
  18987. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_M 0x0000ff00
  18988. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S 8
  18989. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_GET(_var) \
  18990. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_M) >> \
  18991. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S)
  18992. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  18993. do { \
  18994. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID, _val); \
  18995. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_PDEV_ID_S)); \
  18996. } while (0)
  18997. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M 0x00ff0000
  18998. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S 16
  18999. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_GET(_var) \
  19000. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_M) >> \
  19001. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)
  19002. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_SET(_var, _val) \
  19003. do { \
  19004. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE, _val); \
  19005. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESPONSE_TYPE_S)); \
  19006. } while (0)
  19007. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M 0xff000000
  19008. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S 24
  19009. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_GET(_var) \
  19010. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_M) >> \
  19011. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)
  19012. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_SET(_var, _val) \
  19013. do { \
  19014. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT, _val); \
  19015. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_RESULT_S)); \
  19016. } while (0)
  19017. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M 0x01000000
  19018. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S 24
  19019. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_GET(_var) \
  19020. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_M) >> \
  19021. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)
  19022. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_SET(_var, _val) \
  19023. do { \
  19024. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH, _val); \
  19025. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_IS_RULE_ENOUGH_S)); \
  19026. } while (0)
  19027. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M 0xFE000000
  19028. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S 25
  19029. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_GET(_var) \
  19030. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_M) >> \
  19031. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)
  19032. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_SET(_var, _val) \
  19033. do { \
  19034. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM, _val); \
  19035. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_AVAIL_RULE_NUM_S)); \
  19036. } while (0)
  19037. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M 0x01000000
  19038. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S 24
  19039. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_GET(_var) \
  19040. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_M) >> \
  19041. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)
  19042. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_SET(_var, _val) \
  19043. do { \
  19044. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0, _val); \
  19045. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_0_S)); \
  19046. } while (0)
  19047. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M 0x02000000
  19048. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S 25
  19049. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_GET(_var) \
  19050. (((_var) & HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_M) >> \
  19051. HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)
  19052. #define HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_SET(_var, _val) \
  19053. do { \
  19054. HTT_CHECK_SET_VAL(HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1, _val); \
  19055. ((_var) |= ((_val) << HTT_RX_CCE_SUPER_RULE_SETUP_DONE_CFG_RESULT_1_S)); \
  19056. } while (0)
  19057. /**
  19058. * @brief target -> host CoDel MSDU queue latencies array configuration
  19059. *
  19060. * MSG_TYPE => HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND
  19061. *
  19062. * @details
  19063. * The HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND message is used
  19064. * by the target to inform the host of the location and size of the DDR array of
  19065. * per MSDU queue latency metrics. This array is updated by the host and
  19066. * read by the target. The target uses these metric values to determine
  19067. * which MSDU queues have latencies exceeding their CoDel latency target.
  19068. *
  19069. * |31 16|15 8|7 0|
  19070. * |-------------------------------------------+----------|
  19071. * | number of array elements | reserved | MSG_TYPE |
  19072. * |-------------------------------------------+----------|
  19073. * | array physical address, low bits |
  19074. * |------------------------------------------------------|
  19075. * | array physical address, high bits |
  19076. * |------------------------------------------------------|
  19077. * Header fields:
  19078. * - MSG_TYPE
  19079. * Bits 7:0
  19080. * Purpose: Identifies this as a CoDel MSDU queue latencies
  19081. * array configuration message.
  19082. * Value: (HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_IND)
  19083. * - NUM_ELEM
  19084. * Bits 31:16
  19085. * Purpose: Inform the host of the length of the MSDU queue latencies array.
  19086. * Value: Specifies the number of elements in the MSDU queue latency
  19087. * metrics array. This value is the same as the maximum number of
  19088. * MSDU queues supported by the target.
  19089. * Since each array element is 16 bits, the size in bytes of the
  19090. * MSDU queue latency metrics array is twice the number of elements.
  19091. * - PADDR_LOW
  19092. * Bits 31:0
  19093. * Purpose: Inform the host of the MSDU queue latencies array's location.
  19094. * Value: Lower 32 bits of the physical address of the MSDU queue latency
  19095. * metrics array.
  19096. * - PADDR_HIGH
  19097. * Bits 31:0
  19098. * Purpose: Inform the host of the MSDU queue latencies array's location.
  19099. * Value: Upper 32 bits of the physical address of the MSDU queue latency
  19100. * metrics array.
  19101. */
  19102. typedef struct {
  19103. A_UINT32 msg_type: 8, /* bits 7:0 */
  19104. reserved: 8, /* bits 15:8 */
  19105. num_elem: 16; /* bits 31:16 */
  19106. A_UINT32 paddr_low;
  19107. A_UINT32 paddr_high;
  19108. } htt_t2h_codel_msduq_latencies_array_cfg_int_t;
  19109. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_SIZE 12 /* bytes */
  19110. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M 0xffff0000
  19111. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S 16
  19112. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_GET(_var) \
  19113. (((_var) & HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_M) >> \
  19114. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)
  19115. #define HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_SET(_var, _val) \
  19116. do { \
  19117. HTT_CHECK_SET_VAL( \
  19118. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM, _val); \
  19119. ((_var) |= ((_val) << \
  19120. HTT_T2H_CODEL_MSDUQ_LATENCIES_ARRAY_CFG_INT_NUM_ELEM_S)); \
  19121. } while (0)
  19122. /*
  19123. * This CoDel MSDU queue latencies array whose location and number of
  19124. * elements are specified by this HTT_T2H message consists of 16-bit elements
  19125. * that each specify a statistical summary (min) of a MSDU queue's latency,
  19126. * using milliseconds units.
  19127. */
  19128. #define HTT_CODEL_MSDUQ_LATENCIES_ARRAY_ELEM_BYTES 2
  19129. /**
  19130. * @brief target -> host rx completion indication message definition
  19131. *
  19132. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DATA_IND
  19133. *
  19134. * @details
  19135. * The following diagram shows the format of the Rx completion indication sent
  19136. * from the target to the host
  19137. *
  19138. * |31|29|28 24|23 12|11 9|8| 7|6|5|4|3|2|1|0|
  19139. * |---------------+----------------------------+----------------|
  19140. * | vdev_id | peer_id | msg_type |
  19141. * hdr: |---------------+--------------------------+-+----------------|
  19142. * | rsvd0 |F| msdu_cnt |
  19143. * pyld: |==========================================+=+================|
  19144. * MSDU 0 | buf addr lo (bits 31:0) |
  19145. * |-----+--------------------------------------+----------------|
  19146. * |rsvd1| SW buffer cookie | buf addr hi |
  19147. * |--+--+-----------------------------+--------+--+-+-+-+-+-+-+-|
  19148. * |R2| W| MSDU length | TID |MC|D|S|C|L|F|R|M|
  19149. * |-------------------------------------------------+---------+-|
  19150. * | rsvd3 | err info|E|
  19151. * |=================================================+=========+=|
  19152. * MSDU 1 | buf addr lo (bits 31:0) |
  19153. * : ... :
  19154. * | rsvd3 | err info|E|
  19155. * |-------------------------------------------------------------|
  19156. * Where:
  19157. * F = fragment
  19158. * M = MPDU retry bit
  19159. * R = raw MPDU frame
  19160. * F = first MSDU in MPDU
  19161. * L = last MSDU in MPDU
  19162. * C = MSDU continuation
  19163. * S = Souce Addr is valid
  19164. * D = Dest Addr is valid
  19165. * MC = Dest Addr is multicast / broadcast
  19166. * W = is first MSDU after WoW wakeup
  19167. * R2 = rsvd2
  19168. * E = error valid
  19169. */
  19170. /* htt_t2h_rx_data_msdu_err:
  19171. * To be filled in "htt_t2h_rx_data_msdu_info.error_info" field
  19172. * when FW forwards MSDU to host.
  19173. */
  19174. typedef enum htt_t2h_rx_data_msdu_err {
  19175. /* ERR_DECRYPT:
  19176. * FW sets this when rxdma_error_code = <enum 3 rxdma_decrypt_err>.
  19177. * host maintains error stats, recycles buffer.
  19178. */
  19179. HTT_RXDATA_ERR_DECRYPT = 0,
  19180. /* ERR_TKIP_MIC:
  19181. * FW sets this when rxdma_error_code = <enum 4 rxdma_tkip_mic_err>.
  19182. * Host maintains error stats, recycles buffer, sends notification to
  19183. * middleware.
  19184. */
  19185. HTT_RXDATA_ERR_TKIP_MIC = 1,
  19186. /* ERR_UNENCRYPTED:
  19187. * FW sets this when rxdma_error_code = <enum 5 rxdma_unecrypted_err>.
  19188. * Host maintains error stats, recycles buffer.
  19189. */
  19190. HTT_RXDATA_ERR_UNENCRYPTED = 2,
  19191. /* ERR_MSDU_LIMIT:
  19192. * FW sets this when rxdma_error_code = <enum 7 rxdma_msdu_limit_err>.
  19193. * Host maintains error stats, recycles buffer.
  19194. */
  19195. HTT_RXDATA_ERR_MSDU_LIMIT = 3,
  19196. /* ERR_FLUSH_REQUEST:
  19197. * FW sets this when rxdma_error_code = <enum 13 rxdma_flush_request>.
  19198. * Host maintains error stats, recycles buffer.
  19199. */
  19200. HTT_RXDATA_ERR_FLUSH_REQUEST = 4,
  19201. /* ERR_OOR:
  19202. * FW full reorder layer maps this error to <enum 7 regular_frame_OOR>.
  19203. * Host maintains error stats, recycles buffer mainly for low
  19204. * TCP KPI debugging.
  19205. */
  19206. HTT_RXDATA_ERR_OOR = 5,
  19207. /* ERR_2K_JUMP:
  19208. * FW full reorder layer maps this error to <enum 5 regular_frame_2k_jump>.
  19209. * Host maintains error stats, recycles buffer mainly for low
  19210. * TCP KPI debugging.
  19211. */
  19212. HTT_RXDATA_ERR_2K_JUMP = 6,
  19213. /* ERR_ZERO_LEN_MSDU:
  19214. * FW sets this error flag for a 0 length MSDU.
  19215. * Host maintains error stats, recycles buffer.
  19216. */
  19217. HTT_RXDATA_ERR_ZERO_LEN_MSDU = 7,
  19218. /* add new error codes here */
  19219. HTT_RXDATA_ERR_MAX = 32
  19220. } htt_t2h_rx_data_msdu_err_e;
  19221. struct htt_t2h_rx_data_ind_t
  19222. {
  19223. A_UINT32 /* word 0 */
  19224. /* msg_type:
  19225. * Set to Rx data indication i.e. HTT_T2H_MSG_TYPE_RX_DATA_IND.
  19226. */
  19227. msg_type: 8,
  19228. peer_id: 16, /* This will provide peer data */
  19229. vdev_id: 8; /* This will provide vdev id info */
  19230. A_UINT32 /* word 1 */
  19231. /* msdu_cnt:
  19232. * Total number of MSDUs (htt_t2h_rx_data_msdu_info items) in message.
  19233. */
  19234. msdu_cnt: 8,
  19235. frag: 1, /* this bit will be set for 802.11 frag MPDU */
  19236. rsvd0: 23;
  19237. /* NOTE:
  19238. * To preserve backwards compatibility,
  19239. * no new fields can be added in this struct.
  19240. */
  19241. };
  19242. struct htt_t2h_rx_data_msdu_info
  19243. {
  19244. A_UINT32 /* word 0 */
  19245. buffer_addr_low : 32;
  19246. A_UINT32 /* word 1 */
  19247. buffer_addr_high : 8,
  19248. sw_buffer_cookie : 21,
  19249. rsvd1 : 3;
  19250. A_UINT32 /* word 2 */
  19251. mpdu_retry_bit : 1, /* used for stats maintenance */
  19252. raw_mpdu_frame : 1, /* used for pkt drop and processing */
  19253. first_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  19254. last_msdu_in_mpdu_flag : 1, /* used for MSDU scatter/gather support */
  19255. msdu_continuation : 1, /* used for MSDU scatter/gather support */
  19256. sa_is_valid : 1, /* used for HW issue check in
  19257. * is_sa_da_idx_valid() */
  19258. da_is_valid : 1, /* used for HW issue check and
  19259. * intra-BSS forwarding */
  19260. da_is_mcbc : 1,
  19261. tid_info : 8, /* used for stats maintenance */
  19262. msdu_length : 14,
  19263. is_first_pkt_after_wkp : 1, /* indicates this is the first rx MSDU
  19264. * provided by fw after WoW exit */
  19265. rsvd2 : 1;
  19266. A_UINT32 /* word 3 */
  19267. error_valid : 1, /* Set if the MSDU has any error */
  19268. error_info : 5, /* If error_valid is TRUE, then refer to
  19269. * "htt_t2h_rx_data_msdu_err_e" for
  19270. * checking error reason. */
  19271. rsvd3 : 26;
  19272. /* NOTE:
  19273. * To preserve backwards compatibility,
  19274. * no new fields can be added in this struct.
  19275. */
  19276. };
  19277. /* HTT_RX_DATA_IND_HDR_SIZE: 2 4-byte words
  19278. * This is the size of htt_t2h_rx_data_ind_t alone which is fixed overhead
  19279. * for every Rx DATA IND sent by FW to host.
  19280. */
  19281. #define HTT_RX_DATA_IND_HDR_SIZE (2*4)
  19282. /* HTT_RX_DATA_MSDU_INFO_SIZE: 4 4-bytes words
  19283. * This is the size of each MSDU detail that will be piggybacked with the
  19284. * RX IND header.
  19285. */
  19286. #define HTT_RX_DATA_MSDU_INFO_SIZE (4*4)
  19287. /* member definitions of htt_t2h_rx_data_ind_t */
  19288. #define HTT_RX_DATA_IND_PEER_ID_M 0x00ffff00
  19289. #define HTT_RX_DATA_IND_PEER_ID_S 8
  19290. #define HTT_RX_DATA_IND_PEER_ID_SET(word, value) \
  19291. do { \
  19292. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_PEER_ID, value); \
  19293. (word) |= (value) << HTT_RX_DATA_IND_PEER_ID_S; \
  19294. } while (0)
  19295. #define HTT_RX_DATA_IND_PEER_ID_GET(word) \
  19296. (((word) & HTT_RX_DATA_IND_PEER_ID_M) >> HTT_RX_DATA_IND_PEER_ID_S)
  19297. #define HTT_RX_DATA_IND_VDEV_ID_M 0xff000000
  19298. #define HTT_RX_DATA_IND_VDEV_ID_S 24
  19299. #define HTT_RX_DATA_IND_VDEV_ID_SET(word, value) \
  19300. do { \
  19301. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_VDEV_ID, value); \
  19302. (word) |= (value) << HTT_RX_DATA_IND_VDEV_ID_S; \
  19303. } while (0)
  19304. #define HTT_RX_DATA_IND_VDEV_ID_GET(word) \
  19305. (((word) & HTT_RX_DATA_IND_VDEV_ID_M) >> HTT_RX_DATA_IND_VDEV_ID_S)
  19306. #define HTT_RX_DATA_IND_MSDU_CNT_M 0x000000ff
  19307. #define HTT_RX_DATA_IND_MSDU_CNT_S 0
  19308. #define HTT_RX_DATA_IND_MSDU_CNT_SET(word, value) \
  19309. do { \
  19310. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_MSDU_CNT, value); \
  19311. (word) |= (value) << HTT_RX_DATA_IND_MSDU_CNT_S; \
  19312. } while (0)
  19313. #define HTT_RX_DATA_IND_MSDU_CNT_GET(word) \
  19314. (((word) & HTT_RX_DATA_IND_MSDU_CNT_M) >> HTT_RX_DATA_IND_MSDU_CNT_S)
  19315. #define HTT_RX_DATA_IND_FRAG_M 0x00000100
  19316. #define HTT_RX_DATA_IND_FRAG_S 8
  19317. #define HTT_RX_DATA_IND_FRAG_SET(word, value) \
  19318. do { \
  19319. HTT_CHECK_SET_VAL(HTT_RX_DATA_IND_FRAG, value); \
  19320. (word) |= (value) << HTT_RX_DATA_IND_FRAG_S; \
  19321. } while (0)
  19322. #define HTT_RX_DATA_IND_FRAG_GET(word) \
  19323. (((word) & HTT_RX_DATA_IND_FRAG_M) >> HTT_RX_DATA_IND_FRAG_S)
  19324. /* member definitions of htt_t2h_rx_data_msdu_info */
  19325. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M 0xFFFFFFFF
  19326. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S 0
  19327. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M 0x000000FF
  19328. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S 0
  19329. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_SET(word, value) \
  19330. do { \
  19331. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW, value); \
  19332. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S; \
  19333. } while (0)
  19334. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_GET(word) \
  19335. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_LOW_S)
  19336. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_SET(word, value) \
  19337. do { \
  19338. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH, value); \
  19339. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S; \
  19340. } while (0)
  19341. #define HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_GET(word) \
  19342. (((word) & HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_M) >> HTT_RX_DATA_MSDU_INFO_BUFFER_ADDR_HIGH_S)
  19343. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M 0x1FFFFF00
  19344. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S 8
  19345. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_SET(word, value) \
  19346. do { \
  19347. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE, value); \
  19348. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S; \
  19349. } while (0)
  19350. #define HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_GET(word) \
  19351. (((word) & HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_M) >> HTT_RX_DATA_MSDU_INFO_SW_BUFFER_COOKIE_S)
  19352. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M 0x00000001
  19353. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S 0
  19354. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_SET(word, value) \
  19355. do { \
  19356. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT, value); \
  19357. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S; \
  19358. } while (0)
  19359. #define HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_GET(word) \
  19360. (((word) & HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_M) >> HTT_RX_DATA_MSDU_INFO_MPDU_RETRY_BIT_S)
  19361. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M 0x00000002
  19362. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S 1
  19363. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_SET(word, value) \
  19364. do { \
  19365. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME, value); \
  19366. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S; \
  19367. } while (0)
  19368. #define HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_GET(word) \
  19369. (((word) & HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_M) >> HTT_RX_DATA_MSDU_INFO_RAW_MPDU_FRAME_S)
  19370. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M 0x00000004
  19371. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S 2
  19372. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_SET(word, value) \
  19373. do { \
  19374. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU, value); \
  19375. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S; \
  19376. } while (0)
  19377. #define HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_GET(word) \
  19378. (((word) & HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_FIRST_MSDU_IN_MPDU_S)
  19379. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M 0x00000008
  19380. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S 3
  19381. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_SET(word, value) \
  19382. do { \
  19383. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU, value); \
  19384. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S; \
  19385. } while (0)
  19386. #define HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_GET(word) \
  19387. (((word) & HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_M) >> HTT_RX_DATA_MSDU_INFO_LAST_MSDU_IN_MPDU_S)
  19388. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M 0x00000010
  19389. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S 4
  19390. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_SET(word, value) \
  19391. do { \
  19392. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION, value); \
  19393. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S; \
  19394. } while (0)
  19395. #define HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_GET(word) \
  19396. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_CONTINUATION_S)
  19397. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M 0x00000020
  19398. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S 5
  19399. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_SET(word, value) \
  19400. do { \
  19401. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_SA_IS_VALID, value); \
  19402. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S; \
  19403. } while (0)
  19404. #define HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_GET(word) \
  19405. (((word) & HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_SA_IS_VALID_S)
  19406. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M 0x00000040
  19407. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S 6
  19408. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_SET(word, value) \
  19409. do { \
  19410. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_VALID, value); \
  19411. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S; \
  19412. } while (0)
  19413. #define HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_GET(word) \
  19414. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_VALID_S)
  19415. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M 0x00000080
  19416. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S 7
  19417. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_SET(word, value) \
  19418. do { \
  19419. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC, value); \
  19420. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S; \
  19421. } while (0)
  19422. #define HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_GET(word) \
  19423. (((word) & HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_M) >> HTT_RX_DATA_MSDU_INFO_DA_IS_MCBC_S)
  19424. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_M 0x0000FF00
  19425. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_S 8
  19426. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_SET(word, value) \
  19427. do { \
  19428. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_TID_INFO, value); \
  19429. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_TID_INFO_S; \
  19430. } while (0)
  19431. #define HTT_RX_DATA_MSDU_INFO_TID_INFO_GET(word) \
  19432. (((word) & HTT_RX_DATA_MSDU_INFO_TID_INFO_M) >> HTT_RX_DATA_MSDU_INFO_TID_INFO_S)
  19433. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M 0x3FFF0000
  19434. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S 16
  19435. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_SET(word, value) \
  19436. do { \
  19437. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH, value); \
  19438. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S; \
  19439. } while (0)
  19440. #define HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_GET(word) \
  19441. (((word) & HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_M) >> HTT_RX_DATA_MSDU_INFO_MSDU_LENGTH_S)
  19442. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M 0x40000000
  19443. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S 30
  19444. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_SET(word, value) \
  19445. do { \
  19446. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP, value); \
  19447. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S; \
  19448. } while (0)
  19449. #define HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_GET(word) \
  19450. (((word) & HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_M) >> HTT_RX_DATA_MSDU_INFO_IS_FIRST_PKT_AFTER_WKP_S)
  19451. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M 0x00000001
  19452. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S 0
  19453. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_SET(word, value) \
  19454. do { \
  19455. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_VALID, value); \
  19456. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S; \
  19457. } while (0)
  19458. #define HTT_RX_DATA_MSDU_INFO_ERROR_VALID_GET(word) \
  19459. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_VALID_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_VALID_S)
  19460. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M 0x0000001E
  19461. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S 1
  19462. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_SET(word, value) \
  19463. do { \
  19464. HTT_CHECK_SET_VAL(HTT_RX_DATA_MSDU_INFO_ERROR_INFO, value); \
  19465. (word) |= (value) << HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S; \
  19466. } while (0)
  19467. #define HTT_RX_DATA_MSDU_INFO_ERROR_INFO_GET(word) \
  19468. (((word) & HTT_RX_DATA_MSDU_INFO_ERROR_INFO_M) >> HTT_RX_DATA_MSDU_INFO_ERROR_INFO_S)
  19469. /**
  19470. * @brief target -> Primary peer migration message to host
  19471. *
  19472. * MSG_TYPE => HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND
  19473. *
  19474. * @details
  19475. * HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND message is sent by target
  19476. * to host to flush & set-up the RX rings to new primary peer
  19477. *
  19478. * The message would appear as follows:
  19479. *
  19480. * |31 16|15 12|11 8|7 0|
  19481. * |-------------------------------+---------+---------+--------------|
  19482. * | vdev ID | pdev ID | chip ID | msg type |
  19483. * |-------------------------------+---------+---------+--------------|
  19484. * | ML peer ID | SW peer ID |
  19485. * |-------------------------------+----------------------------------|
  19486. *
  19487. * The message is interpreted as follows:
  19488. * dword0 - b'0:7 - msg_type: This will be set to 0x37
  19489. * (HTT_T2H_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_IND)
  19490. * b'8:11 - chip_id: Indicate which chip has been chosen as primary
  19491. * b'12:15 - pdev_id: Indicate which pdev in the chip is chosen
  19492. * as primary
  19493. * b'16:31 - vdev_id: Indicate which vdev in the pdev is chosen
  19494. * as primary
  19495. *
  19496. * dword1 - b'0:15 - sw_link_peer_id: Indicate the sw_peer_id of the peer
  19497. * chosen as primary
  19498. * b'16:31 - ml_peer_id: Indicate the ml_peer_id to which the
  19499. * primary peer belongs.
  19500. */
  19501. typedef struct {
  19502. A_UINT32 msg_type: 8, /* bits 7:0 */
  19503. chip_id: 4, /* bits 11:8 */
  19504. pdev_id: 4, /* bits 15:12 */
  19505. vdev_id: 16; /* bits 31:16 */
  19506. A_UINT32 sw_link_peer_id: 16, /* bits 15:0 */
  19507. ml_peer_id: 16; /* bits 31:16 */
  19508. } htt_t2h_primary_link_peer_migrate_ind_t;
  19509. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M 0x00000F00
  19510. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S 8
  19511. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_GET(_var) \
  19512. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_M) >> \
  19513. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S)
  19514. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_SET(_var, _val) \
  19515. do { \
  19516. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID, _val); \
  19517. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_CHIP_ID_S));\
  19518. } while (0)
  19519. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M 0x0000F000
  19520. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S 12
  19521. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_GET(_var) \
  19522. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_M) >> \
  19523. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S)
  19524. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_SET(_var, _val) \
  19525. do { \
  19526. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID, _val); \
  19527. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_PDEV_ID_S));\
  19528. } while (0)
  19529. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M 0xFFFF0000
  19530. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S 16
  19531. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_GET(_var) \
  19532. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_M) >> \
  19533. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S)
  19534. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_SET(_var, _val) \
  19535. do { \
  19536. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID, _val); \
  19537. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_VDEV_ID_S));\
  19538. } while (0)
  19539. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M 0x0000FFFF
  19540. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S 0
  19541. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_GET(_var) \
  19542. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_M) >> \
  19543. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S)
  19544. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_SET(_var, _val) \
  19545. do { \
  19546. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID, _val); \
  19547. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_SW_LINK_PEER_ID_S));\
  19548. } while (0)
  19549. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M 0xFFFF0000
  19550. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S 16
  19551. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_GET(_var) \
  19552. (((_var) & HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_M) >> \
  19553. HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S)
  19554. #define HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_SET(_var, _val) \
  19555. do { \
  19556. HTT_CHECK_SET_VAL(HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID, _val); \
  19557. ((_var) |= ((_val) << HTT_T2H_PRIMARY_LINK_PEER_MIGRATE_ML_PEER_ID_S));\
  19558. } while (0)
  19559. /**
  19560. * @brief target -> host rx peer AST override message defenition
  19561. *
  19562. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND
  19563. *
  19564. * @details
  19565. * Format inherits parts of the HTT_T2H_MSG_TYPE_PEER_MAP_V3 published above
  19566. * where in the dummy ast index is provided to the host.
  19567. * This new message below is sent to the host at run time from the TX_DE
  19568. * exception path when a SAWF flow is detected for a peer.
  19569. * This is sent up once per SAWF peer.
  19570. * This layout assumes the target operates as little-endian.
  19571. *
  19572. * |31 24|23 16|15 8|7 0|
  19573. * |--------------------------------------+-----------------+-----------------|
  19574. * | SW peer ID | vdev ID | msg type |
  19575. * |-----------------+--------------------+-----------------+-----------------|
  19576. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  19577. * |-----------------+--------------------+-----------------+-----------------|
  19578. * | dummy AST Index #1 | MAC addr 5 | MAC addr 4 |
  19579. * |--------------------------------------+-----------------+-----------------|
  19580. * | reserved | dummy AST Index #2 |
  19581. * |--------------------------------------+-----------------------------------|
  19582. *
  19583. * The following field definitions describe the format of the peer ast override
  19584. * index messages sent from the target to the host.
  19585. * - MSG_TYPE
  19586. * Bits 7:0
  19587. * Purpose: identifies this as a peer map v3 message
  19588. * Value: 0x38 (HTT_T2H_MSG_TYPE_PEER_AST_OVERRIDE_INDEX_IND)
  19589. * - VDEV_ID
  19590. * Bits 15:8
  19591. * Purpose: Indicates which virtual device the peer is associated with.
  19592. * - SW_PEER_ID
  19593. * Bits 31:16
  19594. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  19595. * - MAC_ADDR_L32
  19596. * Bits 31:0
  19597. * Purpose: Identifies which peer node the peer ID is for.
  19598. * Value: lower 4 bytes of peer node's MAC address
  19599. * - MAC_ADDR_U16
  19600. * Bits 15:0
  19601. * Purpose: Identifies which peer node the peer ID is for.
  19602. * Value: upper 2 bytes of peer node's MAC address
  19603. * - AST_INDEX1
  19604. * Bits 31:16
  19605. * Purpose: The 1st extra AST index used to identify user defined MSDUQ
  19606. * - AST_INDEX2
  19607. * Bits 15:0
  19608. * Purpose: The 2nd extra AST index used to identify user defined MSDUQ
  19609. */
  19610. /* dword 0 */
  19611. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_M 0xffff0000
  19612. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S 16
  19613. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_M 0x0000ff00
  19614. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_S 8
  19615. /* dword 1 */
  19616. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_M 0xffffffff
  19617. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S 0
  19618. /* dword 2 */
  19619. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_M 0x0000ffff
  19620. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S 0
  19621. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_M 0xffff0000
  19622. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_S 16
  19623. /* dword 3 */
  19624. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_M 0x0000ffff
  19625. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_S 0
  19626. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_SET(word, value) \
  19627. do { \
  19628. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_VDEV_ID, value); \
  19629. (word) |= (value) << HTT_PEER_AST_OVERRIDE_VDEV_ID_S; \
  19630. } while (0)
  19631. #define HTT_PEER_AST_OVERRIDE_VDEV_ID_GET(word) \
  19632. (((word) & HTT_PEER_AST_OVERRIDE_VDEV_ID_M) >> HTT_PEER_AST_OVERRIDE_VDEV_ID_S)
  19633. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_SET(word, value) \
  19634. do { \
  19635. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_SW_PEER_ID, value); \
  19636. (word) |= (value) << HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S; \
  19637. } while (0)
  19638. #define HTT_PEER_AST_OVERRIDE_SW_PEER_ID_GET(word) \
  19639. (((word) & HTT_PEER_AST_OVERRIDE_SW_PEER_ID_M) >> HTT_PEER_AST_OVERRIDE_SW_PEER_ID_S)
  19640. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_SET(word, value) \
  19641. do { \
  19642. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32, value); \
  19643. (word) |= (value) << HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S; \
  19644. } while (0)
  19645. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_GET(word) \
  19646. (((word) & HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_M) >> HTT_PEER_AST_OVERRIDE_MAC_ADDR_L32_S)
  19647. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_SET(word, value) \
  19648. do { \
  19649. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16, value); \
  19650. (word) |= (value) << HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S; \
  19651. } while (0)
  19652. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_GET(word) \
  19653. (((word) & HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_M) >> HTT_PEER_AST_OVERRIDE_MAC_ADDR_U16_S)
  19654. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_SET(word, value) \
  19655. do { \
  19656. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_AST_INDEX1, value); \
  19657. (word) |= (value) << HTT_PEER_AST_OVERRIDE_AST_INDEX1_S; \
  19658. } while (0)
  19659. #define HTT_PEER_AST_OVERRIDE_AST_INDEX1_GET(word) \
  19660. (((word) & HTT_PEER_AST_OVERRIDE_AST_INDEX1_M) >> HTT_PEER_AST_OVERRIDE_AST_INDEX1_S)
  19661. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_SET(word, value) \
  19662. do { \
  19663. HTT_CHECK_SET_VAL(HTT_PEER_AST_OVERRIDE_AST_INDEX2, value); \
  19664. (word) |= (value) << HTT_PEER_AST_OVERRIDE_AST_INDEX2_S; \
  19665. } while (0)
  19666. #define HTT_PEER_AST_OVERRIDE_AST_INDEX2_GET(word) \
  19667. (((word) & HTT_PEER_AST_OVERRIDE_AST_INDEX2_M) >> HTT_PEER_AST_OVERRIDE_AST_INDEX2_S)
  19668. #define HTT_PEER_AST_OVERRIDE_MAC_ADDR_WORD_BASE_OFFSET 4 /* bytes */
  19669. #define HTT_PEER_AST_OVERRIDE_DUMMY_AST1_WORD_BASE_OFFSET 8 /* bytes */
  19670. #define HTT_PEER_AST_OVERRIDE_DUMMY_AST2_WORD_BASE_OFFSET 12 /* bytes */
  19671. #define HTT_PEER_AST_OVERRIDE_INDEX_IND_BYTES 16
  19672. #endif