htt.h 554 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287
  1. /*
  2. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. */
  182. #define HTT_CURRENT_VERSION_MAJOR 3
  183. #define HTT_CURRENT_VERSION_MINOR 66
  184. #define HTT_NUM_TX_FRAG_DESC 1024
  185. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  186. #define HTT_CHECK_SET_VAL(field, val) \
  187. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  188. /* macros to assist in sign-extending fields from HTT messages */
  189. #define HTT_SIGN_BIT_MASK(field) \
  190. ((field ## _M + (1 << field ## _S)) >> 1)
  191. #define HTT_SIGN_BIT(_val, field) \
  192. (_val & HTT_SIGN_BIT_MASK(field))
  193. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  194. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  195. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  196. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  197. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  198. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  199. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  200. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  201. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  202. /*
  203. * TEMPORARY:
  204. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  205. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  206. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  207. * updated.
  208. */
  209. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  210. /*
  211. * TEMPORARY:
  212. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  213. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  214. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  215. * updated.
  216. */
  217. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  218. /* HTT Access Category values */
  219. enum HTT_AC_WMM {
  220. /* WMM Access Categories */
  221. HTT_AC_WMM_BE = 0x0,
  222. HTT_AC_WMM_BK = 0x1,
  223. HTT_AC_WMM_VI = 0x2,
  224. HTT_AC_WMM_VO = 0x3,
  225. /* extension Access Categories */
  226. HTT_AC_EXT_NON_QOS = 0x4,
  227. HTT_AC_EXT_UCAST_MGMT = 0x5,
  228. HTT_AC_EXT_MCAST_DATA = 0x6,
  229. HTT_AC_EXT_MCAST_MGMT = 0x7,
  230. };
  231. enum HTT_AC_WMM_MASK {
  232. /* WMM Access Categories */
  233. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  234. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  235. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  236. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  237. /* extension Access Categories */
  238. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  239. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  240. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  241. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  242. };
  243. #define HTT_AC_MASK_WMM \
  244. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  245. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  246. #define HTT_AC_MASK_EXT \
  247. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  248. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  249. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  250. /*
  251. * htt_dbg_stats_type -
  252. * bit positions for each stats type within a stats type bitmask
  253. * The bitmask contains 24 bits.
  254. */
  255. enum htt_dbg_stats_type {
  256. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  257. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  258. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  259. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  260. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  261. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  262. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  263. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  264. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  265. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  266. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  267. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  268. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  269. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  270. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  271. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  272. /* bits 16-23 currently reserved */
  273. /* keep this last */
  274. HTT_DBG_NUM_STATS
  275. };
  276. /*=== HTT option selection TLVs ===
  277. * Certain HTT messages have alternatives or options.
  278. * For such cases, the host and target need to agree on which option to use.
  279. * Option specification TLVs can be appended to the VERSION_REQ and
  280. * VERSION_CONF messages to select options other than the default.
  281. * These TLVs are entirely optional - if they are not provided, there is a
  282. * well-defined default for each option. If they are provided, they can be
  283. * provided in any order. Each TLV can be present or absent independent of
  284. * the presence / absence of other TLVs.
  285. *
  286. * The HTT option selection TLVs use the following format:
  287. * |31 16|15 8|7 0|
  288. * |---------------------------------+----------------+----------------|
  289. * | value (payload) | length | tag |
  290. * |-------------------------------------------------------------------|
  291. * The value portion need not be only 2 bytes; it can be extended by any
  292. * integer number of 4-byte units. The total length of the TLV, including
  293. * the tag and length fields, must be a multiple of 4 bytes. The length
  294. * field specifies the total TLV size in 4-byte units. Thus, the typical
  295. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  296. * field, would store 0x1 in its length field, to show that the TLV occupies
  297. * a single 4-byte unit.
  298. */
  299. /*--- TLV header format - applies to all HTT option TLVs ---*/
  300. enum HTT_OPTION_TLV_TAGS {
  301. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  302. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  303. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  304. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  305. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  306. };
  307. PREPACK struct htt_option_tlv_header_t {
  308. A_UINT8 tag;
  309. A_UINT8 length;
  310. } POSTPACK;
  311. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  312. #define HTT_OPTION_TLV_TAG_S 0
  313. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  314. #define HTT_OPTION_TLV_LENGTH_S 8
  315. /*
  316. * value0 - 16 bit value field stored in word0
  317. * The TLV's value field may be longer than 2 bytes, in which case
  318. * the remainder of the value is stored in word1, word2, etc.
  319. */
  320. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  321. #define HTT_OPTION_TLV_VALUE0_S 16
  322. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  323. do { \
  324. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  325. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  326. } while (0)
  327. #define HTT_OPTION_TLV_TAG_GET(word) \
  328. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  329. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  330. do { \
  331. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  332. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  333. } while (0)
  334. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  335. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  336. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  337. do { \
  338. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  339. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  340. } while (0)
  341. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  342. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  343. /*--- format of specific HTT option TLVs ---*/
  344. /*
  345. * HTT option TLV for specifying LL bus address size
  346. * Some chips require bus addresses used by the target to access buffers
  347. * within the host's memory to be 32 bits; others require bus addresses
  348. * used by the target to access buffers within the host's memory to be
  349. * 64 bits.
  350. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  351. * a suffix to the VERSION_CONF message to specify which bus address format
  352. * the target requires.
  353. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  354. * default to providing bus addresses to the target in 32-bit format.
  355. */
  356. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  357. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  358. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  359. };
  360. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  361. struct htt_option_tlv_header_t hdr;
  362. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  363. } POSTPACK;
  364. /*
  365. * HTT option TLV for specifying whether HL systems should indicate
  366. * over-the-air tx completion for individual frames, or should instead
  367. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  368. * requests an OTA tx completion for a particular tx frame.
  369. * This option does not apply to LL systems, where the TX_COMPL_IND
  370. * is mandatory.
  371. * This option is primarily intended for HL systems in which the tx frame
  372. * downloads over the host --> target bus are as slow as or slower than
  373. * the transmissions over the WLAN PHY. For cases where the bus is faster
  374. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  375. * and consquently will send one TX_COMPL_IND message that covers several
  376. * tx frames. For cases where the WLAN PHY is faster than the bus,
  377. * the target will end up transmitting very short A-MPDUs, and consequently
  378. * sending many TX_COMPL_IND messages, which each cover a very small number
  379. * of tx frames.
  380. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  381. * a suffix to the VERSION_REQ message to request whether the host desires to
  382. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  383. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  384. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  385. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  386. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  387. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  388. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  389. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  390. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  391. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  392. * TLV.
  393. */
  394. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  395. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  396. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  397. };
  398. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  399. struct htt_option_tlv_header_t hdr;
  400. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  401. } POSTPACK;
  402. /*
  403. * HTT option TLV for specifying how many tx queue groups the target
  404. * may establish.
  405. * This TLV specifies the maximum value the target may send in the
  406. * txq_group_id field of any TXQ_GROUP information elements sent by
  407. * the target to the host. This allows the host to pre-allocate an
  408. * appropriate number of tx queue group structs.
  409. *
  410. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  411. * a suffix to the VERSION_REQ message to specify whether the host supports
  412. * tx queue groups at all, and if so if there is any limit on the number of
  413. * tx queue groups that the host supports.
  414. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  415. * a suffix to the VERSION_CONF message. If the host has specified in the
  416. * VER_REQ message a limit on the number of tx queue groups the host can
  417. * supprt, the target shall limit its specification of the maximum tx groups
  418. * to be no larger than this host-specified limit.
  419. *
  420. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  421. * shall preallocate 4 tx queue group structs, and the target shall not
  422. * specify a txq_group_id larger than 3.
  423. */
  424. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  425. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  426. /*
  427. * values 1 through N specify the max number of tx queue groups
  428. * the sender supports
  429. */
  430. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  431. };
  432. /* TEMPORARY backwards-compatibility alias for a typo fix -
  433. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  434. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  435. * to support the old name (with the typo) until all references to the
  436. * old name are replaced with the new name.
  437. */
  438. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  439. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  440. struct htt_option_tlv_header_t hdr;
  441. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  442. } POSTPACK;
  443. /*
  444. * HTT option TLV for specifying whether the target supports an extended
  445. * version of the HTT tx descriptor. If the target provides this TLV
  446. * and specifies in the TLV that the target supports an extended version
  447. * of the HTT tx descriptor, the target must check the "extension" bit in
  448. * the HTT tx descriptor, and if the extension bit is set, to expect a
  449. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  450. * descriptor. Furthermore, the target must provide room for the HTT
  451. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  452. * This option is intended for systems where the host needs to explicitly
  453. * control the transmission parameters such as tx power for individual
  454. * tx frames.
  455. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  456. * as a suffix to the VERSION_CONF message to explicitly specify whether
  457. * the target supports the HTT tx MSDU extension descriptor.
  458. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  459. * by the host as lack of target support for the HTT tx MSDU extension
  460. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  461. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  462. * the HTT tx MSDU extension descriptor.
  463. * The host is not required to provide the HTT tx MSDU extension descriptor
  464. * just because the target supports it; the target must check the
  465. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  466. * extension descriptor is present.
  467. */
  468. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  469. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  470. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  471. };
  472. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  473. struct htt_option_tlv_header_t hdr;
  474. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  475. } POSTPACK;
  476. /*=== host -> target messages ===============================================*/
  477. enum htt_h2t_msg_type {
  478. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  479. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  480. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  481. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  482. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  483. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  484. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  485. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  486. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  487. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  488. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  489. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  490. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  491. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  492. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  493. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  494. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  495. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  496. /* keep this last */
  497. HTT_H2T_NUM_MSGS
  498. };
  499. /*
  500. * HTT host to target message type -
  501. * stored in bits 7:0 of the first word of the message
  502. */
  503. #define HTT_H2T_MSG_TYPE_M 0xff
  504. #define HTT_H2T_MSG_TYPE_S 0
  505. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  506. do { \
  507. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  508. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  509. } while (0)
  510. #define HTT_H2T_MSG_TYPE_GET(word) \
  511. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  512. /**
  513. * @brief host -> target version number request message definition
  514. *
  515. * |31 24|23 16|15 8|7 0|
  516. * |----------------+----------------+----------------+----------------|
  517. * | reserved | msg type |
  518. * |-------------------------------------------------------------------|
  519. * : option request TLV (optional) |
  520. * :...................................................................:
  521. *
  522. * The VER_REQ message may consist of a single 4-byte word, or may be
  523. * extended with TLVs that specify which HTT options the host is requesting
  524. * from the target.
  525. * The following option TLVs may be appended to the VER_REQ message:
  526. * - HL_SUPPRESS_TX_COMPL_IND
  527. * - HL_MAX_TX_QUEUE_GROUPS
  528. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  529. * may be appended to the VER_REQ message (but only one TLV of each type).
  530. *
  531. * Header fields:
  532. * - MSG_TYPE
  533. * Bits 7:0
  534. * Purpose: identifies this as a version number request message
  535. * Value: 0x0
  536. */
  537. #define HTT_VER_REQ_BYTES 4
  538. /* TBDXXX: figure out a reasonable number */
  539. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  540. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  541. /**
  542. * @brief HTT tx MSDU descriptor
  543. *
  544. * @details
  545. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  546. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  547. * the target firmware needs for the FW's tx processing, particularly
  548. * for creating the HW msdu descriptor.
  549. * The same HTT tx descriptor is used for HL and LL systems, though
  550. * a few fields within the tx descriptor are used only by LL or
  551. * only by HL.
  552. * The HTT tx descriptor is defined in two manners: by a struct with
  553. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  554. * definitions.
  555. * The target should use the struct def, for simplicitly and clarity,
  556. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  557. * neutral. Specifically, the host shall use the get/set macros built
  558. * around the mask + shift defs.
  559. */
  560. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  561. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  562. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  563. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  564. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  565. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  566. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  567. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  568. #define HTT_TX_VDEV_ID_WORD 0
  569. #define HTT_TX_VDEV_ID_MASK 0x3f
  570. #define HTT_TX_VDEV_ID_SHIFT 16
  571. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  572. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  573. #define HTT_TX_MSDU_LEN_DWORD 1
  574. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  575. /*
  576. * HTT_VAR_PADDR macros
  577. * Allow physical / bus addresses to be either a single 32-bit value,
  578. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  579. */
  580. #define HTT_VAR_PADDR32(var_name) \
  581. A_UINT32 var_name
  582. #define HTT_VAR_PADDR64_LE(var_name) \
  583. struct { \
  584. /* little-endian: lo precedes hi */ \
  585. A_UINT32 lo; \
  586. A_UINT32 hi; \
  587. } var_name
  588. /*
  589. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  590. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  591. * addresses are stored in a XXX-bit field.
  592. * This macro is used to define both htt_tx_msdu_desc32_t and
  593. * htt_tx_msdu_desc64_t structs.
  594. */
  595. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  596. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  597. { \
  598. /* DWORD 0: flags and meta-data */ \
  599. A_UINT32 \
  600. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  601. \
  602. /* pkt_subtype - \
  603. * Detailed specification of the tx frame contents, extending the \
  604. * general specification provided by pkt_type. \
  605. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  606. * pkt_type | pkt_subtype \
  607. * ============================================================== \
  608. * 802.3 | bit 0:3 - Reserved \
  609. * | bit 4: 0x0 - Copy-Engine Classification Results \
  610. * | not appended to the HTT message \
  611. * | 0x1 - Copy-Engine Classification Results \
  612. * | appended to the HTT message in the \
  613. * | format: \
  614. * | [HTT tx desc, frame header, \
  615. * | CE classification results] \
  616. * | The CE classification results begin \
  617. * | at the next 4-byte boundary after \
  618. * | the frame header. \
  619. * ------------+------------------------------------------------- \
  620. * Eth2 | bit 0:3 - Reserved \
  621. * | bit 4: 0x0 - Copy-Engine Classification Results \
  622. * | not appended to the HTT message \
  623. * | 0x1 - Copy-Engine Classification Results \
  624. * | appended to the HTT message. \
  625. * | See the above specification of the \
  626. * | CE classification results location. \
  627. * ------------+------------------------------------------------- \
  628. * native WiFi | bit 0:3 - Reserved \
  629. * | bit 4: 0x0 - Copy-Engine Classification Results \
  630. * | not appended to the HTT message \
  631. * | 0x1 - Copy-Engine Classification Results \
  632. * | appended to the HTT message. \
  633. * | See the above specification of the \
  634. * | CE classification results location. \
  635. * ------------+------------------------------------------------- \
  636. * mgmt | 0x0 - 802.11 MAC header absent \
  637. * | 0x1 - 802.11 MAC header present \
  638. * ------------+------------------------------------------------- \
  639. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  640. * | 0x1 - 802.11 MAC header present \
  641. * | bit 1: 0x0 - allow aggregation \
  642. * | 0x1 - don't allow aggregation \
  643. * | bit 2: 0x0 - perform encryption \
  644. * | 0x1 - don't perform encryption \
  645. * | bit 3: 0x0 - perform tx classification / queuing \
  646. * | 0x1 - don't perform tx classification; \
  647. * | insert the frame into the "misc" \
  648. * | tx queue \
  649. * | bit 4: 0x0 - Copy-Engine Classification Results \
  650. * | not appended to the HTT message \
  651. * | 0x1 - Copy-Engine Classification Results \
  652. * | appended to the HTT message. \
  653. * | See the above specification of the \
  654. * | CE classification results location. \
  655. */ \
  656. pkt_subtype: 5, \
  657. \
  658. /* pkt_type - \
  659. * General specification of the tx frame contents. \
  660. * The htt_pkt_type enum should be used to specify and check the \
  661. * value of this field. \
  662. */ \
  663. pkt_type: 3, \
  664. \
  665. /* vdev_id - \
  666. * ID for the vdev that is sending this tx frame. \
  667. * For certain non-standard packet types, e.g. pkt_type == raw \
  668. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  669. * This field is used primarily for determining where to queue \
  670. * broadcast and multicast frames. \
  671. */ \
  672. vdev_id: 6, \
  673. /* ext_tid - \
  674. * The extended traffic ID. \
  675. * If the TID is unknown, the extended TID is set to \
  676. * HTT_TX_EXT_TID_INVALID. \
  677. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  678. * value of the QoS TID. \
  679. * If the tx frame is non-QoS data, then the extended TID is set to \
  680. * HTT_TX_EXT_TID_NON_QOS. \
  681. * If the tx frame is multicast or broadcast, then the extended TID \
  682. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  683. */ \
  684. ext_tid: 5, \
  685. \
  686. /* postponed - \
  687. * This flag indicates whether the tx frame has been downloaded to \
  688. * the target before but discarded by the target, and now is being \
  689. * downloaded again; or if this is a new frame that is being \
  690. * downloaded for the first time. \
  691. * This flag allows the target to determine the correct order for \
  692. * transmitting new vs. old frames. \
  693. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  694. * This flag only applies to HL systems, since in LL systems, \
  695. * the tx flow control is handled entirely within the target. \
  696. */ \
  697. postponed: 1, \
  698. \
  699. /* extension - \
  700. * This flag indicates whether a HTT tx MSDU extension descriptor \
  701. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  702. * \
  703. * 0x0 - no extension MSDU descriptor is present \
  704. * 0x1 - an extension MSDU descriptor immediately follows the \
  705. * regular MSDU descriptor \
  706. */ \
  707. extension: 1, \
  708. \
  709. /* cksum_offload - \
  710. * This flag indicates whether checksum offload is enabled or not \
  711. * for this frame. Target FW use this flag to turn on HW checksumming \
  712. * 0x0 - No checksum offload \
  713. * 0x1 - L3 header checksum only \
  714. * 0x2 - L4 checksum only \
  715. * 0x3 - L3 header checksum + L4 checksum \
  716. */ \
  717. cksum_offload: 2, \
  718. \
  719. /* tx_comp_req - \
  720. * This flag indicates whether Tx Completion \
  721. * from fw is required or not. \
  722. * This flag is only relevant if tx completion is not \
  723. * universally enabled. \
  724. * For all LL systems, tx completion is mandatory, \
  725. * so this flag will be irrelevant. \
  726. * For HL systems tx completion is optional, but HL systems in which \
  727. * the bus throughput exceeds the WLAN throughput will \
  728. * probably want to always use tx completion, and thus \
  729. * would not check this flag. \
  730. * This flag is required when tx completions are not used universally, \
  731. * but are still required for certain tx frames for which \
  732. * an OTA delivery acknowledgment is needed by the host. \
  733. * In practice, this would be for HL systems in which the \
  734. * bus throughput is less than the WLAN throughput. \
  735. * \
  736. * 0x0 - Tx Completion Indication from Fw not required \
  737. * 0x1 - Tx Completion Indication from Fw is required \
  738. */ \
  739. tx_compl_req: 1; \
  740. \
  741. \
  742. /* DWORD 1: MSDU length and ID */ \
  743. A_UINT32 \
  744. len: 16, /* MSDU length, in bytes */ \
  745. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  746. * and this id is used to calculate fragmentation \
  747. * descriptor pointer inside the target based on \
  748. * the base address, configured inside the target. \
  749. */ \
  750. \
  751. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  752. /* frags_desc_ptr - \
  753. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  754. * where the tx frame's fragments reside in memory. \
  755. * This field only applies to LL systems, since in HL systems the \
  756. * (degenerate single-fragment) fragmentation descriptor is created \
  757. * within the target. \
  758. */ \
  759. _paddr__frags_desc_ptr_; \
  760. \
  761. /* DWORD 3 (or 4): peerid, chanfreq */ \
  762. /* \
  763. * Peer ID : Target can use this value to know which peer-id packet \
  764. * destined to. \
  765. * It's intended to be specified by host in case of NAWDS. \
  766. */ \
  767. A_UINT16 peerid; \
  768. \
  769. /* \
  770. * Channel frequency: This identifies the desired channel \
  771. * frequency (in mhz) for tx frames. This is used by FW to help \
  772. * determine when it is safe to transmit or drop frames for \
  773. * off-channel operation. \
  774. * The default value of zero indicates to FW that the corresponding \
  775. * VDEV's home channel (if there is one) is the desired channel \
  776. * frequency. \
  777. */ \
  778. A_UINT16 chanfreq; \
  779. \
  780. /* Reason reserved is commented is increasing the htt structure size \
  781. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  782. * A_UINT32 reserved_dword3_bits0_31; \
  783. */ \
  784. } POSTPACK
  785. /* define a htt_tx_msdu_desc32_t type */
  786. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  787. /* define a htt_tx_msdu_desc64_t type */
  788. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  789. /*
  790. * Make htt_tx_msdu_desc_t be an alias for either
  791. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  792. */
  793. #if HTT_PADDR64
  794. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  795. #else
  796. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  797. #endif
  798. /* decriptor information for Management frame*/
  799. /*
  800. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  801. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  802. */
  803. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  804. extern A_UINT32 mgmt_hdr_len;
  805. PREPACK struct htt_mgmt_tx_desc_t {
  806. A_UINT32 msg_type;
  807. #if HTT_PADDR64
  808. A_UINT64 frag_paddr; /* DMAble address of the data */
  809. #else
  810. A_UINT32 frag_paddr; /* DMAble address of the data */
  811. #endif
  812. A_UINT32 desc_id; /* returned to host during completion
  813. * to free the meory*/
  814. A_UINT32 len; /* Fragment length */
  815. A_UINT32 vdev_id; /* virtual device ID*/
  816. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  817. } POSTPACK;
  818. PREPACK struct htt_mgmt_tx_compl_ind {
  819. A_UINT32 desc_id;
  820. A_UINT32 status;
  821. } POSTPACK;
  822. /*
  823. * This SDU header size comes from the summation of the following:
  824. * 1. Max of:
  825. * a. Native WiFi header, for native WiFi frames: 24 bytes
  826. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  827. * b. 802.11 header, for raw frames: 36 bytes
  828. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  829. * QoS header, HT header)
  830. * c. 802.3 header, for ethernet frames: 14 bytes
  831. * (destination address, source address, ethertype / length)
  832. * 2. Max of:
  833. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  834. * b. IPv6 header, up through the Traffic Class: 2 bytes
  835. * 3. 802.1Q VLAN header: 4 bytes
  836. * 4. LLC/SNAP header: 8 bytes
  837. */
  838. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  839. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  840. #define HTT_TX_HDR_SIZE_ETHERNET 14
  841. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  842. A_COMPILE_TIME_ASSERT(
  843. htt_encap_hdr_size_max_check_nwifi,
  844. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  845. A_COMPILE_TIME_ASSERT(
  846. htt_encap_hdr_size_max_check_enet,
  847. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  848. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  849. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  850. #define HTT_TX_HDR_SIZE_802_1Q 4
  851. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  852. #define HTT_COMMON_TX_FRM_HDR_LEN \
  853. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  854. HTT_TX_HDR_SIZE_802_1Q + \
  855. HTT_TX_HDR_SIZE_LLC_SNAP)
  856. #define HTT_HL_TX_FRM_HDR_LEN \
  857. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  858. #define HTT_LL_TX_FRM_HDR_LEN \
  859. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  860. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  861. /* dword 0 */
  862. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  863. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  864. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  865. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  866. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  867. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  869. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  870. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  873. #define HTT_TX_DESC_PKT_TYPE_S 13
  874. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  875. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  877. #define HTT_TX_DESC_VDEV_ID_S 16
  878. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  879. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  881. #define HTT_TX_DESC_EXT_TID_S 22
  882. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  885. #define HTT_TX_DESC_POSTPONED_S 27
  886. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  887. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  888. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  889. #define HTT_TX_DESC_EXTENSION_S 28
  890. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  891. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  892. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  893. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  894. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  895. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  896. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  897. #define HTT_TX_DESC_TX_COMP_S 31
  898. /* dword 1 */
  899. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  900. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  901. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  902. #define HTT_TX_DESC_FRM_LEN_S 0
  903. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  904. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  905. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  906. #define HTT_TX_DESC_FRM_ID_S 16
  907. /* dword 2 */
  908. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  910. /* for systems using 64-bit format for bus addresses */
  911. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  913. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  914. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  915. /* for systems using 32-bit format for bus addresses */
  916. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  917. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  918. /* dword 3 */
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  920. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  922. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  923. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  924. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  925. #if HTT_PADDR64
  926. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  928. #else
  929. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  931. #endif
  932. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  933. #define HTT_TX_DESC_PEER_ID_S 0
  934. /*
  935. * TEMPORARY:
  936. * The original definitions for the PEER_ID fields contained typos
  937. * (with _DESC_PADDR appended to this PEER_ID field name).
  938. * Retain deprecated original names for PEER_ID fields until all code that
  939. * refers to them has been updated.
  940. */
  941. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  942. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  943. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  944. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  945. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  946. HTT_TX_DESC_PEER_ID_M
  947. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  948. HTT_TX_DESC_PEER_ID_S
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  950. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  952. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  953. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  954. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  955. #if HTT_PADDR64
  956. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  958. #else
  959. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  961. #endif
  962. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  963. #define HTT_TX_DESC_CHAN_FREQ_S 16
  964. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  965. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  966. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  967. do { \
  968. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  969. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  970. } while (0)
  971. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  972. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  973. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  976. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  977. } while (0)
  978. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  979. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  980. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  981. do { \
  982. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  983. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  984. } while (0)
  985. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  986. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  987. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  988. do { \
  989. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  990. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  991. } while (0)
  992. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  993. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  994. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1001. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1008. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1015. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1019. } while (0)
  1020. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1021. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1022. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1023. do { \
  1024. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1025. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1026. } while (0)
  1027. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1028. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1029. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1030. do { \
  1031. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1032. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1033. } while (0)
  1034. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1035. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1036. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1037. do { \
  1038. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1039. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1040. } while (0)
  1041. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1042. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1043. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1044. do { \
  1045. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1046. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1047. } while (0)
  1048. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1049. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1050. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1051. do { \
  1052. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1053. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1054. } while (0)
  1055. /* enums used in the HTT tx MSDU extension descriptor */
  1056. enum {
  1057. htt_tx_guard_interval_regular = 0,
  1058. htt_tx_guard_interval_short = 1,
  1059. };
  1060. enum {
  1061. htt_tx_preamble_type_ofdm = 0,
  1062. htt_tx_preamble_type_cck = 1,
  1063. htt_tx_preamble_type_ht = 2,
  1064. htt_tx_preamble_type_vht = 3,
  1065. };
  1066. enum {
  1067. htt_tx_bandwidth_5MHz = 0,
  1068. htt_tx_bandwidth_10MHz = 1,
  1069. htt_tx_bandwidth_20MHz = 2,
  1070. htt_tx_bandwidth_40MHz = 3,
  1071. htt_tx_bandwidth_80MHz = 4,
  1072. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1073. };
  1074. /**
  1075. * @brief HTT tx MSDU extension descriptor
  1076. * @details
  1077. * If the target supports HTT tx MSDU extension descriptors, the host has
  1078. * the option of appending the following struct following the regular
  1079. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1080. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1081. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1082. * tx specs for each frame.
  1083. */
  1084. PREPACK struct htt_tx_msdu_desc_ext_t {
  1085. /* DWORD 0: flags */
  1086. A_UINT32
  1087. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1088. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1089. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1090. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1091. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1092. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1093. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1094. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1095. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1096. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1097. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1098. /* DWORD 1: tx power, tx rate, tx BW */
  1099. A_UINT32
  1100. /* pwr -
  1101. * Specify what power the tx frame needs to be transmitted at.
  1102. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1103. * The value needs to be appropriately sign-extended when extracting
  1104. * the value from the message and storing it in a variable that is
  1105. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1106. * automatically handles this sign-extension.)
  1107. * If the transmission uses multiple tx chains, this power spec is
  1108. * the total transmit power, assuming incoherent combination of
  1109. * per-chain power to produce the total power.
  1110. */
  1111. pwr: 8,
  1112. /* mcs_mask -
  1113. * Specify the allowable values for MCS index (modulation and coding)
  1114. * to use for transmitting the frame.
  1115. *
  1116. * For HT / VHT preamble types, this mask directly corresponds to
  1117. * the HT or VHT MCS indices that are allowed. For each bit N set
  1118. * within the mask, MCS index N is allowed for transmitting the frame.
  1119. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1120. * rates versus OFDM rates, so the host has the option of specifying
  1121. * that the target must transmit the frame with CCK or OFDM rates
  1122. * (not HT or VHT), but leaving the decision to the target whether
  1123. * to use CCK or OFDM.
  1124. *
  1125. * For CCK and OFDM, the bits within this mask are interpreted as
  1126. * follows:
  1127. * bit 0 -> CCK 1 Mbps rate is allowed
  1128. * bit 1 -> CCK 2 Mbps rate is allowed
  1129. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1130. * bit 3 -> CCK 11 Mbps rate is allowed
  1131. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1132. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1133. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1134. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1135. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1136. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1137. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1138. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1139. *
  1140. * The MCS index specification needs to be compatible with the
  1141. * bandwidth mask specification. For example, a MCS index == 9
  1142. * specification is inconsistent with a preamble type == VHT,
  1143. * Nss == 1, and channel bandwidth == 20 MHz.
  1144. *
  1145. * Furthermore, the host has only a limited ability to specify to
  1146. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1147. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1148. */
  1149. mcs_mask: 12,
  1150. /* nss_mask -
  1151. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1152. * Each bit in this mask corresponds to a Nss value:
  1153. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1154. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1155. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1156. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1157. * The values in the Nss mask must be suitable for the recipient, e.g.
  1158. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1159. * recipient which only supports 2x2 MIMO.
  1160. */
  1161. nss_mask: 4,
  1162. /* guard_interval -
  1163. * Specify a htt_tx_guard_interval enum value to indicate whether
  1164. * the transmission should use a regular guard interval or a
  1165. * short guard interval.
  1166. */
  1167. guard_interval: 1,
  1168. /* preamble_type_mask -
  1169. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1170. * may choose from for transmitting this frame.
  1171. * The bits in this mask correspond to the values in the
  1172. * htt_tx_preamble_type enum. For example, to allow the target
  1173. * to transmit the frame as either CCK or OFDM, this field would
  1174. * be set to
  1175. * (1 << htt_tx_preamble_type_ofdm) |
  1176. * (1 << htt_tx_preamble_type_cck)
  1177. */
  1178. preamble_type_mask: 4,
  1179. reserved1_31_29: 3; /* unused, set to 0x0 */
  1180. /* DWORD 2: tx chain mask, tx retries */
  1181. A_UINT32
  1182. /* chain_mask - specify which chains to transmit from */
  1183. chain_mask: 4,
  1184. /* retry_limit -
  1185. * Specify the maximum number of transmissions, including the
  1186. * initial transmission, to attempt before giving up if no ack
  1187. * is received.
  1188. * If the tx rate is specified, then all retries shall use the
  1189. * same rate as the initial transmission.
  1190. * If no tx rate is specified, the target can choose whether to
  1191. * retain the original rate during the retransmissions, or to
  1192. * fall back to a more robust rate.
  1193. */
  1194. retry_limit: 4,
  1195. /* bandwidth_mask -
  1196. * Specify what channel widths may be used for the transmission.
  1197. * A value of zero indicates "don't care" - the target may choose
  1198. * the transmission bandwidth.
  1199. * The bits within this mask correspond to the htt_tx_bandwidth
  1200. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1201. * The bandwidth_mask must be consistent with the preamble_type_mask
  1202. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1203. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1204. */
  1205. bandwidth_mask: 6,
  1206. reserved2_31_14: 18; /* unused, set to 0x0 */
  1207. /* DWORD 3: tx expiry time (TSF) LSBs */
  1208. A_UINT32 expire_tsf_lo;
  1209. /* DWORD 4: tx expiry time (TSF) MSBs */
  1210. A_UINT32 expire_tsf_hi;
  1211. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1212. } POSTPACK;
  1213. /* DWORD 0 */
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1234. /* DWORD 1 */
  1235. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1236. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1237. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1238. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1239. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1240. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1241. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1242. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1243. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1244. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1245. /* DWORD 2 */
  1246. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1247. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1248. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1249. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1250. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1251. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1252. /* DWORD 0 */
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1254. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1255. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1259. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1260. } while (0)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1262. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1268. } while (0)
  1269. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1270. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1271. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL( \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1276. ((_var) |= ((_val) \
  1277. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1278. } while (0)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1280. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1281. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL( \
  1285. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1286. ((_var) |= ((_val) \
  1287. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1304. } while (0)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1306. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1307. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1312. } while (0)
  1313. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1314. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1315. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1320. } while (0)
  1321. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1322. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1323. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1324. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1328. } while (0)
  1329. /* DWORD 1 */
  1330. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1331. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1332. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1333. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1334. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1335. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1336. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1337. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1338. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1339. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1346. } while (0)
  1347. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1348. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1349. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1350. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1354. } while (0)
  1355. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1356. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1357. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1358. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1362. } while (0)
  1363. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1364. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1365. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1366. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1367. do { \
  1368. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1369. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1370. } while (0)
  1371. /* DWORD 2 */
  1372. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1373. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1374. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1375. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1376. do { \
  1377. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1378. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1379. } while (0)
  1380. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1381. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1382. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1383. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1384. do { \
  1385. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1386. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1387. } while (0)
  1388. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1389. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1390. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1391. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1392. do { \
  1393. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1394. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1395. } while (0)
  1396. typedef enum {
  1397. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1398. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1399. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1400. } htt_11ax_ltf_subtype_t;
  1401. typedef enum {
  1402. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1403. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1404. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1405. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1406. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1407. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1408. } htt_tx_ext2_preamble_type_t;
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1421. /**
  1422. * @brief HTT tx MSDU extension descriptor v2
  1423. * @details
  1424. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1425. * is received as tcl_exit_base->host_meta_info in firmware.
  1426. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1427. * are already part of tcl_exit_base.
  1428. */
  1429. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1430. /* DWORD 0: flags */
  1431. A_UINT32
  1432. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1433. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1434. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1435. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1436. valid_retries : 1, /* if set, tx retries spec is valid */
  1437. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1438. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1439. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1440. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1441. valid_key_flags : 1, /* if set, key flags is valid */
  1442. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1443. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1444. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1445. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1446. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1447. 1 = ENCRYPT,
  1448. 2 ~ 3 - Reserved */
  1449. /* retry_limit -
  1450. * Specify the maximum number of transmissions, including the
  1451. * initial transmission, to attempt before giving up if no ack
  1452. * is received.
  1453. * If the tx rate is specified, then all retries shall use the
  1454. * same rate as the initial transmission.
  1455. * If no tx rate is specified, the target can choose whether to
  1456. * retain the original rate during the retransmissions, or to
  1457. * fall back to a more robust rate.
  1458. */
  1459. retry_limit : 4,
  1460. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1461. * Valid only for 11ax preamble types HE_SU
  1462. * and HE_EXT_SU
  1463. */
  1464. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1465. * Valid only for 11ax preamble types HE_SU
  1466. * and HE_EXT_SU
  1467. */
  1468. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1469. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1470. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1471. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1472. */
  1473. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1474. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1475. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1476. * Use cases:
  1477. * Any time firmware uses TQM-BYPASS for Data
  1478. * TID, firmware expect host to set this bit.
  1479. */
  1480. /* DWORD 1: tx power, tx rate */
  1481. A_UINT32
  1482. power : 8, /* unit of the power field is 0.5 dbm
  1483. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1484. * signed value ranging from -64dbm to 63.5 dbm
  1485. */
  1486. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1487. * Setting more than one MCS isn't currently
  1488. * supported by the target (but is supported
  1489. * in the interface in case in the future
  1490. * the target supports specifications of
  1491. * a limited set of MCS values.
  1492. */
  1493. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1494. * Setting more than one Nss isn't currently
  1495. * supported by the target (but is supported
  1496. * in the interface in case in the future
  1497. * the target supports specifications of
  1498. * a limited set of Nss values.
  1499. */
  1500. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1501. update_peer_cache : 1; /* When set these custom values will be
  1502. * used for all packets, until the next
  1503. * update via this ext header.
  1504. * This is to make sure not all packets
  1505. * need to include this header.
  1506. */
  1507. /* DWORD 2: tx chain mask, tx retries */
  1508. A_UINT32
  1509. /* chain_mask - specify which chains to transmit from */
  1510. chain_mask : 8,
  1511. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1512. * TODO: Update Enum values for key_flags
  1513. */
  1514. /*
  1515. * Channel frequency: This identifies the desired channel
  1516. * frequency (in MHz) for tx frames. This is used by FW to help
  1517. * determine when it is safe to transmit or drop frames for
  1518. * off-channel operation.
  1519. * The default value of zero indicates to FW that the corresponding
  1520. * VDEV's home channel (if there is one) is the desired channel
  1521. * frequency.
  1522. */
  1523. chanfreq : 16;
  1524. /* DWORD 3: tx expiry time (TSF) LSBs */
  1525. A_UINT32 expire_tsf_lo;
  1526. /* DWORD 4: tx expiry time (TSF) MSBs */
  1527. A_UINT32 expire_tsf_hi;
  1528. /* DWORD 5: flags to control routing / processing of the MSDU */
  1529. A_UINT32
  1530. /* learning_frame
  1531. * When this flag is set, this frame will be dropped by FW
  1532. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1533. */
  1534. learning_frame : 1,
  1535. /* send_as_standalone
  1536. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1537. * i.e. with no A-MSDU or A-MPDU aggregation.
  1538. * The scope is extended to other use-cases.
  1539. */
  1540. send_as_standalone : 1,
  1541. /* is_host_opaque_valid
  1542. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1543. * with valid information.
  1544. */
  1545. is_host_opaque_valid : 1,
  1546. rsvd0 : 29;
  1547. /* DWORD 6 : Host opaque cookie for special frames */
  1548. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1549. rsvd1 : 16;
  1550. /*
  1551. * This structure can be expanded further up to 40 bytes
  1552. * by adding further DWORDs as needed.
  1553. */
  1554. } POSTPACK;
  1555. /* DWORD 0 */
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1582. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1583. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1584. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1585. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1586. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1587. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1588. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1589. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1590. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1591. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1592. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1593. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1594. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1595. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1596. /* DWORD 1 */
  1597. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1598. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1599. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1600. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1601. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1602. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1603. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1604. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1605. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1606. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1607. /* DWORD 2 */
  1608. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1609. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1610. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1611. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1612. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1613. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1614. /* DWORD 5 */
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1616. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1621. /* DWORD 6 */
  1622. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1623. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1624. /* DWORD 0 */
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1626. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1627. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1629. do { \
  1630. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1631. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1632. } while (0)
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1635. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1651. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL( \
  1655. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1656. ((_var) |= ((_val) \
  1657. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1661. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1673. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1677. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL( \
  1681. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1682. ((_var) |= ((_val) \
  1683. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1687. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1691. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1692. } while (0)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1694. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1695. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1697. do { \
  1698. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1699. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1700. } while (0)
  1701. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1702. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1703. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1704. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1705. do { \
  1706. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1707. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1708. } while (0)
  1709. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1710. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1711. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1712. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1715. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1716. } while (0)
  1717. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1718. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1719. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1720. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1723. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1724. } while (0)
  1725. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1726. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1727. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1728. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1732. } while (0)
  1733. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1734. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1735. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1736. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1737. do { \
  1738. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1739. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1740. } while (0)
  1741. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1742. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1743. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1744. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1745. do { \
  1746. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1747. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1748. } while (0)
  1749. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1750. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1751. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1752. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1753. do { \
  1754. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1755. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1756. } while (0)
  1757. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1758. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1759. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1760. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1761. do { \
  1762. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1763. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1764. } while (0)
  1765. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1766. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1767. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1768. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1769. do { \
  1770. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1771. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1772. } while (0)
  1773. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1774. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1775. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1776. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1777. do { \
  1778. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1779. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1780. } while (0)
  1781. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1782. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1783. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1784. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1787. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1788. } while (0)
  1789. /* DWORD 1 */
  1790. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1791. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1792. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1793. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1794. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1795. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1796. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1797. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1798. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1799. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1800. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1801. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1802. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1803. do { \
  1804. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1805. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1806. } while (0)
  1807. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1808. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1809. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1810. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1811. do { \
  1812. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1813. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1814. } while (0)
  1815. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1816. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1817. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1818. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1819. do { \
  1820. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1821. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1822. } while (0)
  1823. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1824. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1825. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1826. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1827. do { \
  1828. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1829. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1830. } while (0)
  1831. /* DWORD 2 */
  1832. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1833. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1834. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1835. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1836. do { \
  1837. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1838. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1839. } while (0)
  1840. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1841. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1842. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1843. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1844. do { \
  1845. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1846. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1847. } while (0)
  1848. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1849. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1850. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1851. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1852. do { \
  1853. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1854. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1855. } while (0)
  1856. /* DWORD 5 */
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1858. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1859. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1861. do { \
  1862. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1863. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1864. } while (0)
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1866. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1867. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1869. do { \
  1870. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1871. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1872. } while (0)
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1874. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1875. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1877. do { \
  1878. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1879. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1880. } while (0)
  1881. /* DWORD 6 */
  1882. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1883. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1884. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1885. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1888. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1889. } while (0)
  1890. typedef enum {
  1891. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1892. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1893. } htt_tcl_metadata_type;
  1894. /**
  1895. * @brief HTT TCL command number format
  1896. * @details
  1897. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1898. * available to firmware as tcl_exit_base->tcl_status_number.
  1899. * For regular / multicast packets host will send vdev and mac id and for
  1900. * NAWDS packets, host will send peer id.
  1901. * A_UINT32 is used to avoid endianness conversion problems.
  1902. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1903. */
  1904. typedef struct {
  1905. A_UINT32
  1906. type: 1, /* vdev_id based or peer_id based */
  1907. rsvd: 31;
  1908. } htt_tx_tcl_vdev_or_peer_t;
  1909. typedef struct {
  1910. A_UINT32
  1911. type: 1, /* vdev_id based or peer_id based */
  1912. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1913. vdev_id: 8,
  1914. pdev_id: 2,
  1915. host_inspected:1,
  1916. rsvd: 19;
  1917. } htt_tx_tcl_vdev_metadata;
  1918. typedef struct {
  1919. A_UINT32
  1920. type: 1, /* vdev_id based or peer_id based */
  1921. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1922. peer_id: 14,
  1923. rsvd: 16;
  1924. } htt_tx_tcl_peer_metadata;
  1925. PREPACK struct htt_tx_tcl_metadata {
  1926. union {
  1927. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1928. htt_tx_tcl_vdev_metadata vdev_meta;
  1929. htt_tx_tcl_peer_metadata peer_meta;
  1930. };
  1931. } POSTPACK;
  1932. /* DWORD 0 */
  1933. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1934. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1935. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1936. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1937. /* VDEV metadata */
  1938. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1939. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1940. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1941. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1942. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1943. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1944. /* PEER metadata */
  1945. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1946. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1947. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1948. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1949. HTT_TX_TCL_METADATA_TYPE_S)
  1950. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1951. do { \
  1952. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1953. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1954. } while (0)
  1955. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1956. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1957. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1958. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1959. do { \
  1960. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1961. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1962. } while (0)
  1963. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1964. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1965. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1966. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1967. do { \
  1968. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1969. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1970. } while (0)
  1971. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1972. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1973. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1974. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1975. do { \
  1976. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1977. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1978. } while (0)
  1979. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1980. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1981. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1982. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1985. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1986. } while (0)
  1987. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1988. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1989. HTT_TX_TCL_METADATA_PEER_ID_S)
  1990. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1993. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1994. } while (0)
  1995. typedef enum {
  1996. HTT_TX_FW2WBM_TX_STATUS_OK,
  1997. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1998. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1999. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2000. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2001. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2002. HTT_TX_FW2WBM_TX_STATUS_MAX
  2003. } htt_tx_fw2wbm_tx_status_t;
  2004. typedef enum {
  2005. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2006. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2007. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2008. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2009. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2010. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2011. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2012. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2013. } htt_tx_fw2wbm_reinject_reason_t;
  2014. /**
  2015. * @brief HTT TX WBM Completion from firmware to host
  2016. * @details
  2017. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2018. * DWORD 3 and 4 for software based completions (Exception frames and
  2019. * TQM bypass frames)
  2020. * For software based completions, wbm_release_ring->release_source_module will
  2021. * be set to release_source_fw
  2022. */
  2023. PREPACK struct htt_tx_wbm_completion {
  2024. A_UINT32
  2025. sch_cmd_id: 24,
  2026. exception_frame: 1, /* If set, this packet was queued via exception path */
  2027. rsvd0_31_25: 7;
  2028. A_UINT32
  2029. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2030. * reception of an ACK or BA, this field indicates
  2031. * the RSSI of the received ACK or BA frame.
  2032. * When the frame is removed as result of a direct
  2033. * remove command from the SW, this field is set
  2034. * to 0x0 (which is never a valid value when real
  2035. * RSSI is available).
  2036. * Units: dB w.r.t noise floor
  2037. */
  2038. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2039. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2040. rsvd1_31_16: 16;
  2041. } POSTPACK;
  2042. /* DWORD 0 */
  2043. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2044. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2045. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2046. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2047. /* DWORD 1 */
  2048. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2049. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2050. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2051. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2052. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2053. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2054. /* DWORD 0 */
  2055. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2056. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2057. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2058. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2059. do { \
  2060. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2061. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2062. } while (0)
  2063. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2064. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2065. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2066. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2070. } while (0)
  2071. /* DWORD 1 */
  2072. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2073. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2074. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2075. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2078. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2079. } while (0)
  2080. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2081. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2082. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2083. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2087. } while (0)
  2088. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2089. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2090. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2091. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2095. } while (0)
  2096. /**
  2097. * @brief HTT TX WBM Completion from firmware to host
  2098. * @details
  2099. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2100. * (WBM) offload HW.
  2101. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2102. * For software based completions, release_source_module will
  2103. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2104. * struct wbm_release_ring and then switch to this after looking at
  2105. * release_source_module.
  2106. */
  2107. PREPACK struct htt_tx_wbm_completion_v2 {
  2108. A_UINT32
  2109. used_by_hw0; /* Refer to struct wbm_release_ring */
  2110. A_UINT32
  2111. used_by_hw1; /* Refer to struct wbm_release_ring */
  2112. A_UINT32
  2113. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2114. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2115. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2116. exception_frame: 1,
  2117. rsvd0: 12, /* For future use */
  2118. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2119. rsvd1: 1; /* For future use */
  2120. A_UINT32
  2121. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2122. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2123. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2124. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2125. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2126. */
  2127. A_UINT32
  2128. data1: 32;
  2129. A_UINT32
  2130. data2: 32;
  2131. A_UINT32
  2132. used_by_hw3; /* Refer to struct wbm_release_ring */
  2133. } POSTPACK;
  2134. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2135. /* DWORD 3 */
  2136. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2137. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2138. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2139. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2140. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2141. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2142. /* DWORD 3 */
  2143. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2144. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2145. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2146. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2147. do { \
  2148. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2149. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2150. } while (0)
  2151. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2152. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2153. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2154. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2157. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2158. } while (0)
  2159. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2160. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2161. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2162. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2163. do { \
  2164. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2165. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2166. } while (0)
  2167. /**
  2168. * @brief HTT TX WBM transmit status from firmware to host
  2169. * @details
  2170. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2171. * (WBM) offload HW.
  2172. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2173. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2174. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2175. */
  2176. PREPACK struct htt_tx_wbm_transmit_status {
  2177. A_UINT32
  2178. sch_cmd_id: 24,
  2179. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2180. * reception of an ACK or BA, this field indicates
  2181. * the RSSI of the received ACK or BA frame.
  2182. * When the frame is removed as result of a direct
  2183. * remove command from the SW, this field is set
  2184. * to 0x0 (which is never a valid value when real
  2185. * RSSI is available).
  2186. * Units: dB w.r.t noise floor
  2187. */
  2188. A_UINT32
  2189. sw_peer_id: 16,
  2190. tid_num: 5,
  2191. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2192. * and tid_num fields contain valid data.
  2193. * If this "valid" flag is not set, the
  2194. * sw_peer_id and tid_num fields must be ignored.
  2195. */
  2196. mcast: 1,
  2197. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2198. * contains valid data.
  2199. */
  2200. reserved0: 8;
  2201. A_UINT32
  2202. reserved1: 32;
  2203. } POSTPACK;
  2204. /* DWORD 4 */
  2205. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2206. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2207. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2208. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2209. /* DWORD 5 */
  2210. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2211. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2212. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2213. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2214. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2215. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2216. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2217. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2218. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2219. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2220. /* DWORD 4 */
  2221. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2222. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2223. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2224. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2225. do { \
  2226. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2227. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2228. } while (0)
  2229. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2230. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2231. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2232. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2233. do { \
  2234. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2235. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2236. } while (0)
  2237. /* DWORD 5 */
  2238. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2239. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2240. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2241. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2242. do { \
  2243. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2244. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2245. } while (0)
  2246. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2247. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2248. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2249. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2250. do { \
  2251. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2252. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2253. } while (0)
  2254. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2255. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2256. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2257. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2258. do { \
  2259. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2260. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2261. } while (0)
  2262. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2263. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2264. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2265. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2269. } while (0)
  2270. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2271. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2272. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2273. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2277. } while (0)
  2278. /**
  2279. * @brief HTT TX WBM reinject status from firmware to host
  2280. * @details
  2281. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2282. * (WBM) offload HW.
  2283. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2284. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2285. */
  2286. PREPACK struct htt_tx_wbm_reinject_status {
  2287. A_UINT32
  2288. reserved0: 32;
  2289. A_UINT32
  2290. reserved1: 32;
  2291. A_UINT32
  2292. reserved2: 32;
  2293. } POSTPACK;
  2294. /**
  2295. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2296. * @details
  2297. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2298. * (WBM) offload HW.
  2299. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2300. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2301. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2302. * STA side.
  2303. */
  2304. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2305. A_UINT32
  2306. mec_sa_addr_31_0;
  2307. A_UINT32
  2308. mec_sa_addr_47_32: 16,
  2309. sa_ast_index: 16;
  2310. A_UINT32
  2311. vdev_id: 8,
  2312. reserved0: 24;
  2313. } POSTPACK;
  2314. /* DWORD 4 - mec_sa_addr_31_0 */
  2315. /* DWORD 5 */
  2316. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2317. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2318. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2319. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2320. /* DWORD 6 */
  2321. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2322. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2323. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2324. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2325. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2326. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2327. do { \
  2328. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2329. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2330. } while (0)
  2331. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2332. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2333. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2334. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2335. do { \
  2336. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2337. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2338. } while (0)
  2339. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2340. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2341. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2342. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2343. do { \
  2344. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2345. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2346. } while (0)
  2347. typedef enum {
  2348. TX_FLOW_PRIORITY_BE,
  2349. TX_FLOW_PRIORITY_HIGH,
  2350. TX_FLOW_PRIORITY_LOW,
  2351. } htt_tx_flow_priority_t;
  2352. typedef enum {
  2353. TX_FLOW_LATENCY_SENSITIVE,
  2354. TX_FLOW_LATENCY_INSENSITIVE,
  2355. } htt_tx_flow_latency_t;
  2356. typedef enum {
  2357. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2358. TX_FLOW_INTERACTIVE_TRAFFIC,
  2359. TX_FLOW_PERIODIC_TRAFFIC,
  2360. TX_FLOW_BURSTY_TRAFFIC,
  2361. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2362. } htt_tx_flow_traffic_pattern_t;
  2363. /**
  2364. * @brief HTT TX Flow search metadata format
  2365. * @details
  2366. * Host will set this metadata in flow table's flow search entry along with
  2367. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2368. * firmware and TQM ring if the flow search entry wins.
  2369. * This metadata is available to firmware in that first MSDU's
  2370. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2371. * to one of the available flows for specific tid and returns the tqm flow
  2372. * pointer as part of htt_tx_map_flow_info message.
  2373. */
  2374. PREPACK struct htt_tx_flow_metadata {
  2375. A_UINT32
  2376. rsvd0_1_0: 2,
  2377. tid: 4,
  2378. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2379. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2380. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2381. * Else choose final tid based on latency, priority.
  2382. */
  2383. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2384. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2385. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2386. } POSTPACK;
  2387. /* DWORD 0 */
  2388. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2389. #define HTT_TX_FLOW_METADATA_TID_S 2
  2390. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2391. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2392. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2393. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2394. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2395. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2396. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2397. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2398. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2399. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2400. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2401. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2402. /* DWORD 0 */
  2403. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2404. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2405. HTT_TX_FLOW_METADATA_TID_S)
  2406. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2407. do { \
  2408. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2409. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2410. } while (0)
  2411. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2412. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2413. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2414. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2415. do { \
  2416. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2417. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2418. } while (0)
  2419. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2420. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2421. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2422. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2423. do { \
  2424. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2425. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2426. } while (0)
  2427. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2428. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2429. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2430. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2431. do { \
  2432. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2433. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2434. } while (0)
  2435. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2436. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2437. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2438. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2439. do { \
  2440. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2441. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2442. } while (0)
  2443. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2444. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2445. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2446. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2447. do { \
  2448. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2449. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2450. } while (0)
  2451. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2452. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2453. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2454. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2455. do { \
  2456. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2457. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2458. } while (0)
  2459. /**
  2460. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2461. *
  2462. * @details
  2463. * HTT wds entry from source port learning
  2464. * Host will learn wds entries from rx and send this message to firmware
  2465. * to enable firmware to configure/delete AST entries for wds clients.
  2466. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2467. * and when SA's entry is deleted, firmware removes this AST entry
  2468. *
  2469. * The message would appear as follows:
  2470. *
  2471. * |31 30|29 |17 16|15 8|7 0|
  2472. * |----------------+----------------+----------------+----------------|
  2473. * | rsvd0 |PDVID| vdev_id | msg_type |
  2474. * |-------------------------------------------------------------------|
  2475. * | sa_addr_31_0 |
  2476. * |-------------------------------------------------------------------|
  2477. * | | ta_peer_id | sa_addr_47_32 |
  2478. * |-------------------------------------------------------------------|
  2479. * Where PDVID = pdev_id
  2480. *
  2481. * The message is interpreted as follows:
  2482. *
  2483. * dword0 - b'0:7 - msg_type: This will be set to
  2484. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2485. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2486. *
  2487. * dword0 - b'8:15 - vdev_id
  2488. *
  2489. * dword0 - b'16:17 - pdev_id
  2490. *
  2491. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2492. *
  2493. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2494. *
  2495. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2496. *
  2497. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2498. */
  2499. PREPACK struct htt_wds_entry {
  2500. A_UINT32
  2501. msg_type: 8,
  2502. vdev_id: 8,
  2503. pdev_id: 2,
  2504. rsvd0: 14;
  2505. A_UINT32 sa_addr_31_0;
  2506. A_UINT32
  2507. sa_addr_47_32: 16,
  2508. ta_peer_id: 14,
  2509. rsvd2: 2;
  2510. } POSTPACK;
  2511. /* DWORD 0 */
  2512. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2513. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2514. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2515. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2516. /* DWORD 2 */
  2517. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2518. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2519. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2520. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2521. /* DWORD 0 */
  2522. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2523. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2524. HTT_WDS_ENTRY_VDEV_ID_S)
  2525. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2526. do { \
  2527. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2528. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2529. } while (0)
  2530. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2531. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2532. HTT_WDS_ENTRY_PDEV_ID_S)
  2533. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2534. do { \
  2535. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2536. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2537. } while (0)
  2538. /* DWORD 2 */
  2539. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2540. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2541. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2542. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2543. do { \
  2544. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2545. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2546. } while (0)
  2547. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2548. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2549. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2550. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2551. do { \
  2552. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2553. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2554. } while (0)
  2555. /**
  2556. * @brief MAC DMA rx ring setup specification
  2557. * @details
  2558. * To allow for dynamic rx ring reconfiguration and to avoid race
  2559. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2560. * it uses. Instead, it sends this message to the target, indicating how
  2561. * the rx ring used by the host should be set up and maintained.
  2562. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2563. * specifications.
  2564. *
  2565. * |31 16|15 8|7 0|
  2566. * |---------------------------------------------------------------|
  2567. * header: | reserved | num rings | msg type |
  2568. * |---------------------------------------------------------------|
  2569. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2570. #if HTT_PADDR64
  2571. * | FW_IDX shadow register physical address (bits 63:32) |
  2572. #endif
  2573. * |---------------------------------------------------------------|
  2574. * | rx ring base physical address (bits 31:0) |
  2575. #if HTT_PADDR64
  2576. * | rx ring base physical address (bits 63:32) |
  2577. #endif
  2578. * |---------------------------------------------------------------|
  2579. * | rx ring buffer size | rx ring length |
  2580. * |---------------------------------------------------------------|
  2581. * | FW_IDX initial value | enabled flags |
  2582. * |---------------------------------------------------------------|
  2583. * | MSDU payload offset | 802.11 header offset |
  2584. * |---------------------------------------------------------------|
  2585. * | PPDU end offset | PPDU start offset |
  2586. * |---------------------------------------------------------------|
  2587. * | MPDU end offset | MPDU start offset |
  2588. * |---------------------------------------------------------------|
  2589. * | MSDU end offset | MSDU start offset |
  2590. * |---------------------------------------------------------------|
  2591. * | frag info offset | rx attention offset |
  2592. * |---------------------------------------------------------------|
  2593. * payload 2, if present, has the same format as payload 1
  2594. * Header fields:
  2595. * - MSG_TYPE
  2596. * Bits 7:0
  2597. * Purpose: identifies this as an rx ring configuration message
  2598. * Value: 0x2
  2599. * - NUM_RINGS
  2600. * Bits 15:8
  2601. * Purpose: indicates whether the host is setting up one rx ring or two
  2602. * Value: 1 or 2
  2603. * Payload:
  2604. * for systems using 64-bit format for bus addresses:
  2605. * - IDX_SHADOW_REG_PADDR_LO
  2606. * Bits 31:0
  2607. * Value: lower 4 bytes of physical address of the host's
  2608. * FW_IDX shadow register
  2609. * - IDX_SHADOW_REG_PADDR_HI
  2610. * Bits 31:0
  2611. * Value: upper 4 bytes of physical address of the host's
  2612. * FW_IDX shadow register
  2613. * - RING_BASE_PADDR_LO
  2614. * Bits 31:0
  2615. * Value: lower 4 bytes of physical address of the host's rx ring
  2616. * - RING_BASE_PADDR_HI
  2617. * Bits 31:0
  2618. * Value: uppper 4 bytes of physical address of the host's rx ring
  2619. * for systems using 32-bit format for bus addresses:
  2620. * - IDX_SHADOW_REG_PADDR
  2621. * Bits 31:0
  2622. * Value: physical address of the host's FW_IDX shadow register
  2623. * - RING_BASE_PADDR
  2624. * Bits 31:0
  2625. * Value: physical address of the host's rx ring
  2626. * - RING_LEN
  2627. * Bits 15:0
  2628. * Value: number of elements in the rx ring
  2629. * - RING_BUF_SZ
  2630. * Bits 31:16
  2631. * Value: size of the buffers referenced by the rx ring, in byte units
  2632. * - ENABLED_FLAGS
  2633. * Bits 15:0
  2634. * Value: 1-bit flags to show whether different rx fields are enabled
  2635. * bit 0: 802.11 header enabled (1) or disabled (0)
  2636. * bit 1: MSDU payload enabled (1) or disabled (0)
  2637. * bit 2: PPDU start enabled (1) or disabled (0)
  2638. * bit 3: PPDU end enabled (1) or disabled (0)
  2639. * bit 4: MPDU start enabled (1) or disabled (0)
  2640. * bit 5: MPDU end enabled (1) or disabled (0)
  2641. * bit 6: MSDU start enabled (1) or disabled (0)
  2642. * bit 7: MSDU end enabled (1) or disabled (0)
  2643. * bit 8: rx attention enabled (1) or disabled (0)
  2644. * bit 9: frag info enabled (1) or disabled (0)
  2645. * bit 10: unicast rx enabled (1) or disabled (0)
  2646. * bit 11: multicast rx enabled (1) or disabled (0)
  2647. * bit 12: ctrl rx enabled (1) or disabled (0)
  2648. * bit 13: mgmt rx enabled (1) or disabled (0)
  2649. * bit 14: null rx enabled (1) or disabled (0)
  2650. * bit 15: phy data rx enabled (1) or disabled (0)
  2651. * - IDX_INIT_VAL
  2652. * Bits 31:16
  2653. * Purpose: Specify the initial value for the FW_IDX.
  2654. * Value: the number of buffers initially present in the host's rx ring
  2655. * - OFFSET_802_11_HDR
  2656. * Bits 15:0
  2657. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2658. * - OFFSET_MSDU_PAYLOAD
  2659. * Bits 31:16
  2660. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2661. * - OFFSET_PPDU_START
  2662. * Bits 15:0
  2663. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2664. * - OFFSET_PPDU_END
  2665. * Bits 31:16
  2666. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2667. * - OFFSET_MPDU_START
  2668. * Bits 15:0
  2669. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2670. * - OFFSET_MPDU_END
  2671. * Bits 31:16
  2672. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2673. * - OFFSET_MSDU_START
  2674. * Bits 15:0
  2675. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2676. * - OFFSET_MSDU_END
  2677. * Bits 31:16
  2678. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2679. * - OFFSET_RX_ATTN
  2680. * Bits 15:0
  2681. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2682. * - OFFSET_FRAG_INFO
  2683. * Bits 31:16
  2684. * Value: offset in QUAD-bytes of frag info table
  2685. */
  2686. /* header fields */
  2687. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2688. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2689. /* payload fields */
  2690. /* for systems using a 64-bit format for bus addresses */
  2691. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2692. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2693. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2694. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2695. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2696. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2697. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2698. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2699. /* for systems using a 32-bit format for bus addresses */
  2700. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2701. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2702. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2703. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2704. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2705. #define HTT_RX_RING_CFG_LEN_S 0
  2706. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2707. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2708. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2709. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2710. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2711. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2712. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2713. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2714. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2715. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2716. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2717. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2718. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2719. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2720. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2721. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2722. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2723. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2724. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2725. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2726. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2727. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2728. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2729. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2730. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2731. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2732. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2733. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2734. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2735. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2736. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2737. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2738. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2739. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2740. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2741. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2742. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2743. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2744. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2745. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2746. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2747. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2748. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2749. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2750. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2751. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2752. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2753. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2754. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2755. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2756. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2757. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2758. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2759. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2760. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2761. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2762. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2763. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2764. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2765. #if HTT_PADDR64
  2766. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2767. #else
  2768. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2769. #endif
  2770. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2771. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2772. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2773. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2774. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2777. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2778. } while (0)
  2779. /* degenerate case for 32-bit fields */
  2780. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2781. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2782. ((_var) = (_val))
  2783. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2784. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2785. ((_var) = (_val))
  2786. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2787. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2788. ((_var) = (_val))
  2789. /* degenerate case for 32-bit fields */
  2790. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2791. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2792. ((_var) = (_val))
  2793. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2794. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2795. ((_var) = (_val))
  2796. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2797. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2798. ((_var) = (_val))
  2799. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2800. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2801. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2802. do { \
  2803. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2804. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2805. } while (0)
  2806. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2807. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2808. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2809. do { \
  2810. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2811. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2812. } while (0)
  2813. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2814. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2815. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2816. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2817. do { \
  2818. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2819. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2820. } while (0)
  2821. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2822. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2823. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2824. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2827. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2828. } while (0)
  2829. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2830. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2831. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2832. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2835. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2836. } while (0)
  2837. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2838. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2839. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2840. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2843. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2844. } while (0)
  2845. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2846. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2847. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2848. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2849. do { \
  2850. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2851. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2852. } while (0)
  2853. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2854. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2855. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2856. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2857. do { \
  2858. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2859. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2860. } while (0)
  2861. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2862. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2863. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2864. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2865. do { \
  2866. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2867. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2868. } while (0)
  2869. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2870. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2871. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2872. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2873. do { \
  2874. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2875. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2876. } while (0)
  2877. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2878. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2879. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2880. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2881. do { \
  2882. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2883. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2884. } while (0)
  2885. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2886. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2887. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2888. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2889. do { \
  2890. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2891. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2892. } while (0)
  2893. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2894. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2895. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2896. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2897. do { \
  2898. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2899. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2900. } while (0)
  2901. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2902. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2903. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2904. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2905. do { \
  2906. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2907. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2908. } while (0)
  2909. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2910. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2911. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2912. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2913. do { \
  2914. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2915. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2916. } while (0)
  2917. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2918. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2919. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2920. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2921. do { \
  2922. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2923. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2924. } while (0)
  2925. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2926. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2927. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2928. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2929. do { \
  2930. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2931. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2932. } while (0)
  2933. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2934. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2935. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2936. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2937. do { \
  2938. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2939. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2940. } while (0)
  2941. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2942. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2943. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2944. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2945. do { \
  2946. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2947. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2948. } while (0)
  2949. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2950. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2951. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2952. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2953. do { \
  2954. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2955. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2956. } while (0)
  2957. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2958. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2959. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2960. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2961. do { \
  2962. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2963. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2964. } while (0)
  2965. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2966. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2967. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2968. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2969. do { \
  2970. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2971. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2972. } while (0)
  2973. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2974. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2975. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2976. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2977. do { \
  2978. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2979. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2980. } while (0)
  2981. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2982. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2983. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2984. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2985. do { \
  2986. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2987. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2988. } while (0)
  2989. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2990. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2991. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2992. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2993. do { \
  2994. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2995. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2996. } while (0)
  2997. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2998. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2999. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3000. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3001. do { \
  3002. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3003. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3004. } while (0)
  3005. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3006. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3007. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3008. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3009. do { \
  3010. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3011. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3012. } while (0)
  3013. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3014. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3015. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3016. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3017. do { \
  3018. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3019. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3020. } while (0)
  3021. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3022. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3023. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3024. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3025. do { \
  3026. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3027. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3028. } while (0)
  3029. /**
  3030. * @brief host -> target FW statistics retrieve
  3031. *
  3032. * @details
  3033. * The following field definitions describe the format of the HTT host
  3034. * to target FW stats retrieve message. The message specifies the type of
  3035. * stats host wants to retrieve.
  3036. *
  3037. * |31 24|23 16|15 8|7 0|
  3038. * |-----------------------------------------------------------|
  3039. * | stats types request bitmask | msg type |
  3040. * |-----------------------------------------------------------|
  3041. * | stats types reset bitmask | reserved |
  3042. * |-----------------------------------------------------------|
  3043. * | stats type | config value |
  3044. * |-----------------------------------------------------------|
  3045. * | cookie LSBs |
  3046. * |-----------------------------------------------------------|
  3047. * | cookie MSBs |
  3048. * |-----------------------------------------------------------|
  3049. * Header fields:
  3050. * - MSG_TYPE
  3051. * Bits 7:0
  3052. * Purpose: identifies this is a stats upload request message
  3053. * Value: 0x3
  3054. * - UPLOAD_TYPES
  3055. * Bits 31:8
  3056. * Purpose: identifies which types of FW statistics to upload
  3057. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3058. * - RESET_TYPES
  3059. * Bits 31:8
  3060. * Purpose: identifies which types of FW statistics to reset
  3061. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3062. * - CFG_VAL
  3063. * Bits 23:0
  3064. * Purpose: give an opaque configuration value to the specified stats type
  3065. * Value: stats-type specific configuration value
  3066. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3067. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3068. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3069. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3070. * - CFG_STAT_TYPE
  3071. * Bits 31:24
  3072. * Purpose: specify which stats type (if any) the config value applies to
  3073. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3074. * a valid configuration specification
  3075. * - COOKIE_LSBS
  3076. * Bits 31:0
  3077. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3078. * message with its preceding host->target stats request message.
  3079. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3080. * - COOKIE_MSBS
  3081. * Bits 31:0
  3082. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3083. * message with its preceding host->target stats request message.
  3084. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3085. */
  3086. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3087. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3088. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3089. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3090. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3091. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3092. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3093. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3094. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3095. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3096. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3097. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3098. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3099. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3100. do { \
  3101. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3102. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3103. } while (0)
  3104. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3105. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3106. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3107. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3108. do { \
  3109. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3110. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3111. } while (0)
  3112. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3113. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3114. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3115. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3116. do { \
  3117. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3118. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3119. } while (0)
  3120. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3121. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3122. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3123. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3124. do { \
  3125. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3126. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3127. } while (0)
  3128. /**
  3129. * @brief host -> target HTT out-of-band sync request
  3130. *
  3131. * @details
  3132. * The HTT SYNC tells the target to suspend processing of subsequent
  3133. * HTT host-to-target messages until some other target agent locally
  3134. * informs the target HTT FW that the current sync counter is equal to
  3135. * or greater than (in a modulo sense) the sync counter specified in
  3136. * the SYNC message.
  3137. * This allows other host-target components to synchronize their operation
  3138. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3139. * security key has been downloaded to and activated by the target.
  3140. * In the absence of any explicit synchronization counter value
  3141. * specification, the target HTT FW will use zero as the default current
  3142. * sync value.
  3143. *
  3144. * |31 24|23 16|15 8|7 0|
  3145. * |-----------------------------------------------------------|
  3146. * | reserved | sync count | msg type |
  3147. * |-----------------------------------------------------------|
  3148. * Header fields:
  3149. * - MSG_TYPE
  3150. * Bits 7:0
  3151. * Purpose: identifies this as a sync message
  3152. * Value: 0x4
  3153. * - SYNC_COUNT
  3154. * Bits 15:8
  3155. * Purpose: specifies what sync value the HTT FW will wait for from
  3156. * an out-of-band specification to resume its operation
  3157. * Value: in-band sync counter value to compare against the out-of-band
  3158. * counter spec.
  3159. * The HTT target FW will suspend its host->target message processing
  3160. * as long as
  3161. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3162. */
  3163. #define HTT_H2T_SYNC_MSG_SZ 4
  3164. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3165. #define HTT_H2T_SYNC_COUNT_S 8
  3166. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3167. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3168. HTT_H2T_SYNC_COUNT_S)
  3169. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3170. do { \
  3171. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3172. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3173. } while (0)
  3174. /**
  3175. * @brief HTT aggregation configuration
  3176. */
  3177. #define HTT_AGGR_CFG_MSG_SZ 4
  3178. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3179. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3180. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3181. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3182. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3183. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3184. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3185. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3186. do { \
  3187. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3188. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3189. } while (0)
  3190. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3191. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3192. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3193. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3194. do { \
  3195. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3196. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3197. } while (0)
  3198. /**
  3199. * @brief host -> target HTT configure max amsdu info per vdev
  3200. *
  3201. * @details
  3202. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3203. *
  3204. * |31 21|20 16|15 8|7 0|
  3205. * |-----------------------------------------------------------|
  3206. * | reserved | vdev id | max amsdu | msg type |
  3207. * |-----------------------------------------------------------|
  3208. * Header fields:
  3209. * - MSG_TYPE
  3210. * Bits 7:0
  3211. * Purpose: identifies this as a aggr cfg ex message
  3212. * Value: 0xa
  3213. * - MAX_NUM_AMSDU_SUBFRM
  3214. * Bits 15:8
  3215. * Purpose: max MSDUs per A-MSDU
  3216. * - VDEV_ID
  3217. * Bits 20:16
  3218. * Purpose: ID of the vdev to which this limit is applied
  3219. */
  3220. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3221. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3222. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3223. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3224. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3225. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3226. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3227. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3228. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3229. do { \
  3230. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3231. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3232. } while (0)
  3233. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3234. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3235. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3236. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3237. do { \
  3238. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3239. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3240. } while (0)
  3241. /**
  3242. * @brief HTT WDI_IPA Config Message
  3243. *
  3244. * @details
  3245. * The HTT WDI_IPA config message is created/sent by host at driver
  3246. * init time. It contains information about data structures used on
  3247. * WDI_IPA TX and RX path.
  3248. * TX CE ring is used for pushing packet metadata from IPA uC
  3249. * to WLAN FW
  3250. * TX Completion ring is used for generating TX completions from
  3251. * WLAN FW to IPA uC
  3252. * RX Indication ring is used for indicating RX packets from FW
  3253. * to IPA uC
  3254. * RX Ring2 is used as either completion ring or as second
  3255. * indication ring. when Ring2 is used as completion ring, IPA uC
  3256. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3257. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3258. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3259. * indicated in RX Indication ring. Please see WDI_IPA specification
  3260. * for more details.
  3261. * |31 24|23 16|15 8|7 0|
  3262. * |----------------+----------------+----------------+----------------|
  3263. * | tx pkt pool size | Rsvd | msg_type |
  3264. * |-------------------------------------------------------------------|
  3265. * | tx comp ring base (bits 31:0) |
  3266. #if HTT_PADDR64
  3267. * | tx comp ring base (bits 63:32) |
  3268. #endif
  3269. * |-------------------------------------------------------------------|
  3270. * | tx comp ring size |
  3271. * |-------------------------------------------------------------------|
  3272. * | tx comp WR_IDX physical address (bits 31:0) |
  3273. #if HTT_PADDR64
  3274. * | tx comp WR_IDX physical address (bits 63:32) |
  3275. #endif
  3276. * |-------------------------------------------------------------------|
  3277. * | tx CE WR_IDX physical address (bits 31:0) |
  3278. #if HTT_PADDR64
  3279. * | tx CE WR_IDX physical address (bits 63:32) |
  3280. #endif
  3281. * |-------------------------------------------------------------------|
  3282. * | rx indication ring base (bits 31:0) |
  3283. #if HTT_PADDR64
  3284. * | rx indication ring base (bits 63:32) |
  3285. #endif
  3286. * |-------------------------------------------------------------------|
  3287. * | rx indication ring size |
  3288. * |-------------------------------------------------------------------|
  3289. * | rx ind RD_IDX physical address (bits 31:0) |
  3290. #if HTT_PADDR64
  3291. * | rx ind RD_IDX physical address (bits 63:32) |
  3292. #endif
  3293. * |-------------------------------------------------------------------|
  3294. * | rx ind WR_IDX physical address (bits 31:0) |
  3295. #if HTT_PADDR64
  3296. * | rx ind WR_IDX physical address (bits 63:32) |
  3297. #endif
  3298. * |-------------------------------------------------------------------|
  3299. * |-------------------------------------------------------------------|
  3300. * | rx ring2 base (bits 31:0) |
  3301. #if HTT_PADDR64
  3302. * | rx ring2 base (bits 63:32) |
  3303. #endif
  3304. * |-------------------------------------------------------------------|
  3305. * | rx ring2 size |
  3306. * |-------------------------------------------------------------------|
  3307. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3308. #if HTT_PADDR64
  3309. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3310. #endif
  3311. * |-------------------------------------------------------------------|
  3312. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3313. #if HTT_PADDR64
  3314. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3315. #endif
  3316. * |-------------------------------------------------------------------|
  3317. *
  3318. * Header fields:
  3319. * Header fields:
  3320. * - MSG_TYPE
  3321. * Bits 7:0
  3322. * Purpose: Identifies this as WDI_IPA config message
  3323. * value: = 0x8
  3324. * - TX_PKT_POOL_SIZE
  3325. * Bits 15:0
  3326. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3327. * WDI_IPA TX path
  3328. * For systems using 32-bit format for bus addresses:
  3329. * - TX_COMP_RING_BASE_ADDR
  3330. * Bits 31:0
  3331. * Purpose: TX Completion Ring base address in DDR
  3332. * - TX_COMP_RING_SIZE
  3333. * Bits 31:0
  3334. * Purpose: TX Completion Ring size (must be power of 2)
  3335. * - TX_COMP_WR_IDX_ADDR
  3336. * Bits 31:0
  3337. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3338. * updates the Write Index for WDI_IPA TX completion ring
  3339. * - TX_CE_WR_IDX_ADDR
  3340. * Bits 31:0
  3341. * Purpose: DDR address where IPA uC
  3342. * updates the WR Index for TX CE ring
  3343. * (needed for fusion platforms)
  3344. * - RX_IND_RING_BASE_ADDR
  3345. * Bits 31:0
  3346. * Purpose: RX Indication Ring base address in DDR
  3347. * - RX_IND_RING_SIZE
  3348. * Bits 31:0
  3349. * Purpose: RX Indication Ring size
  3350. * - RX_IND_RD_IDX_ADDR
  3351. * Bits 31:0
  3352. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3353. * RX indication ring
  3354. * - RX_IND_WR_IDX_ADDR
  3355. * Bits 31:0
  3356. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3357. * updates the Write Index for WDI_IPA RX indication ring
  3358. * - RX_RING2_BASE_ADDR
  3359. * Bits 31:0
  3360. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3361. * - RX_RING2_SIZE
  3362. * Bits 31:0
  3363. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3364. * - RX_RING2_RD_IDX_ADDR
  3365. * Bits 31:0
  3366. * Purpose: If Second RX ring is Indication ring, DDR address where
  3367. * IPA uC updates the Read Index for Ring2.
  3368. * If Second RX ring is completion ring, this is NOT used
  3369. * - RX_RING2_WR_IDX_ADDR
  3370. * Bits 31:0
  3371. * Purpose: If Second RX ring is Indication ring, DDR address where
  3372. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3373. * If second RX ring is completion ring, DDR address where
  3374. * IPA uC updates the Write Index for Ring 2.
  3375. * For systems using 64-bit format for bus addresses:
  3376. * - TX_COMP_RING_BASE_ADDR_LO
  3377. * Bits 31:0
  3378. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3379. * - TX_COMP_RING_BASE_ADDR_HI
  3380. * Bits 31:0
  3381. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3382. * - TX_COMP_RING_SIZE
  3383. * Bits 31:0
  3384. * Purpose: TX Completion Ring size (must be power of 2)
  3385. * - TX_COMP_WR_IDX_ADDR_LO
  3386. * Bits 31:0
  3387. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3388. * Lower 4 bytes of DDR address where WIFI FW
  3389. * updates the Write Index for WDI_IPA TX completion ring
  3390. * - TX_COMP_WR_IDX_ADDR_HI
  3391. * Bits 31:0
  3392. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3393. * Higher 4 bytes of DDR address where WIFI FW
  3394. * updates the Write Index for WDI_IPA TX completion ring
  3395. * - TX_CE_WR_IDX_ADDR_LO
  3396. * Bits 31:0
  3397. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3398. * updates the WR Index for TX CE ring
  3399. * (needed for fusion platforms)
  3400. * - TX_CE_WR_IDX_ADDR_HI
  3401. * Bits 31:0
  3402. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3403. * updates the WR Index for TX CE ring
  3404. * (needed for fusion platforms)
  3405. * - RX_IND_RING_BASE_ADDR_LO
  3406. * Bits 31:0
  3407. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3408. * - RX_IND_RING_BASE_ADDR_HI
  3409. * Bits 31:0
  3410. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3411. * - RX_IND_RING_SIZE
  3412. * Bits 31:0
  3413. * Purpose: RX Indication Ring size
  3414. * - RX_IND_RD_IDX_ADDR_LO
  3415. * Bits 31:0
  3416. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3417. * for WDI_IPA RX indication ring
  3418. * - RX_IND_RD_IDX_ADDR_HI
  3419. * Bits 31:0
  3420. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3421. * for WDI_IPA RX indication ring
  3422. * - RX_IND_WR_IDX_ADDR_LO
  3423. * Bits 31:0
  3424. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3425. * Lower 4 bytes of DDR address where WIFI FW
  3426. * updates the Write Index for WDI_IPA RX indication ring
  3427. * - RX_IND_WR_IDX_ADDR_HI
  3428. * Bits 31:0
  3429. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3430. * Higher 4 bytes of DDR address where WIFI FW
  3431. * updates the Write Index for WDI_IPA RX indication ring
  3432. * - RX_RING2_BASE_ADDR_LO
  3433. * Bits 31:0
  3434. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3435. * - RX_RING2_BASE_ADDR_HI
  3436. * Bits 31:0
  3437. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3438. * - RX_RING2_SIZE
  3439. * Bits 31:0
  3440. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3441. * - RX_RING2_RD_IDX_ADDR_LO
  3442. * Bits 31:0
  3443. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3444. * DDR address where IPA uC updates the Read Index for Ring2.
  3445. * If Second RX ring is completion ring, this is NOT used
  3446. * - RX_RING2_RD_IDX_ADDR_HI
  3447. * Bits 31:0
  3448. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3449. * DDR address where IPA uC updates the Read Index for Ring2.
  3450. * If Second RX ring is completion ring, this is NOT used
  3451. * - RX_RING2_WR_IDX_ADDR_LO
  3452. * Bits 31:0
  3453. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3454. * DDR address where WIFI FW updates the Write Index
  3455. * for WDI_IPA RX ring2
  3456. * If second RX ring is completion ring, lower 4 bytes of
  3457. * DDR address where IPA uC updates the Write Index for Ring 2.
  3458. * - RX_RING2_WR_IDX_ADDR_HI
  3459. * Bits 31:0
  3460. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3461. * DDR address where WIFI FW updates the Write Index
  3462. * for WDI_IPA RX ring2
  3463. * If second RX ring is completion ring, higher 4 bytes of
  3464. * DDR address where IPA uC updates the Write Index for Ring 2.
  3465. */
  3466. #if HTT_PADDR64
  3467. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3468. #else
  3469. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3470. #endif
  3471. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3472. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3473. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3474. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3475. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3476. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3477. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3479. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3487. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3488. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3489. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3490. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3491. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3492. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3493. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3494. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3495. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3496. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3497. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3498. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3499. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3500. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3505. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3507. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3509. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3511. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3513. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3515. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3517. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3519. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3521. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3523. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3533. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3534. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3535. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3536. do { \
  3537. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3538. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3539. } while (0)
  3540. /* for systems using 32-bit format for bus addr */
  3541. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3542. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3543. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3544. do { \
  3545. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3546. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3547. } while (0)
  3548. /* for systems using 64-bit format for bus addr */
  3549. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3550. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3551. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3552. do { \
  3553. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3554. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3555. } while (0)
  3556. /* for systems using 64-bit format for bus addr */
  3557. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3558. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3559. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3560. do { \
  3561. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3562. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3563. } while (0)
  3564. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3565. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3566. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3567. do { \
  3568. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3569. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3570. } while (0)
  3571. /* for systems using 32-bit format for bus addr */
  3572. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3573. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3574. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3575. do { \
  3576. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3577. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3578. } while (0)
  3579. /* for systems using 64-bit format for bus addr */
  3580. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3581. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3582. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3583. do { \
  3584. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3585. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3586. } while (0)
  3587. /* for systems using 64-bit format for bus addr */
  3588. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3589. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3590. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3591. do { \
  3592. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3593. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3594. } while (0)
  3595. /* for systems using 32-bit format for bus addr */
  3596. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3597. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3598. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3599. do { \
  3600. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3601. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3602. } while (0)
  3603. /* for systems using 64-bit format for bus addr */
  3604. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3605. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3606. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3609. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3610. } while (0)
  3611. /* for systems using 64-bit format for bus addr */
  3612. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3614. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3615. do { \
  3616. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3617. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3618. } while (0)
  3619. /* for systems using 32-bit format for bus addr */
  3620. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3621. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3622. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3623. do { \
  3624. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3625. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3626. } while (0)
  3627. /* for systems using 64-bit format for bus addr */
  3628. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3629. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3630. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3631. do { \
  3632. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3633. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3634. } while (0)
  3635. /* for systems using 64-bit format for bus addr */
  3636. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3637. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3638. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3639. do { \
  3640. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3641. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3642. } while (0)
  3643. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3644. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3645. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3646. do { \
  3647. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3648. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3649. } while (0)
  3650. /* for systems using 32-bit format for bus addr */
  3651. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3652. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3653. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3654. do { \
  3655. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3656. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3657. } while (0)
  3658. /* for systems using 64-bit format for bus addr */
  3659. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3660. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3661. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3664. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3665. } while (0)
  3666. /* for systems using 64-bit format for bus addr */
  3667. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3668. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3669. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3672. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3673. } while (0)
  3674. /* for systems using 32-bit format for bus addr */
  3675. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3676. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3677. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3680. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3681. } while (0)
  3682. /* for systems using 64-bit format for bus addr */
  3683. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3684. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3685. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3688. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3689. } while (0)
  3690. /* for systems using 64-bit format for bus addr */
  3691. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3692. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3693. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3694. do { \
  3695. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3696. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3697. } while (0)
  3698. /* for systems using 32-bit format for bus addr */
  3699. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3700. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3701. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3704. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3705. } while (0)
  3706. /* for systems using 64-bit format for bus addr */
  3707. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3708. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3709. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3712. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3713. } while (0)
  3714. /* for systems using 64-bit format for bus addr */
  3715. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3716. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3717. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3718. do { \
  3719. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3720. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3721. } while (0)
  3722. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3723. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3724. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3725. do { \
  3726. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3727. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3728. } while (0)
  3729. /* for systems using 32-bit format for bus addr */
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3731. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3733. do { \
  3734. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3735. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3736. } while (0)
  3737. /* for systems using 64-bit format for bus addr */
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3739. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3741. do { \
  3742. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3743. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3744. } while (0)
  3745. /* for systems using 64-bit format for bus addr */
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3747. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3749. do { \
  3750. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3751. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3752. } while (0)
  3753. /* for systems using 32-bit format for bus addr */
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3755. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3756. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3757. do { \
  3758. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3759. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3760. } while (0)
  3761. /* for systems using 64-bit format for bus addr */
  3762. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3763. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3764. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3765. do { \
  3766. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3767. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3768. } while (0)
  3769. /* for systems using 64-bit format for bus addr */
  3770. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3771. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3772. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3773. do { \
  3774. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3775. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3776. } while (0)
  3777. /*
  3778. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3779. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3780. * addresses are stored in a XXX-bit field.
  3781. * This macro is used to define both htt_wdi_ipa_config32_t and
  3782. * htt_wdi_ipa_config64_t structs.
  3783. */
  3784. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3785. _paddr__tx_comp_ring_base_addr_, \
  3786. _paddr__tx_comp_wr_idx_addr_, \
  3787. _paddr__tx_ce_wr_idx_addr_, \
  3788. _paddr__rx_ind_ring_base_addr_, \
  3789. _paddr__rx_ind_rd_idx_addr_, \
  3790. _paddr__rx_ind_wr_idx_addr_, \
  3791. _paddr__rx_ring2_base_addr_,\
  3792. _paddr__rx_ring2_rd_idx_addr_,\
  3793. _paddr__rx_ring2_wr_idx_addr_) \
  3794. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3795. { \
  3796. /* DWORD 0: flags and meta-data */ \
  3797. A_UINT32 \
  3798. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3799. reserved: 8, \
  3800. tx_pkt_pool_size: 16;\
  3801. /* DWORD 1 */\
  3802. _paddr__tx_comp_ring_base_addr_;\
  3803. /* DWORD 2 (or 3)*/\
  3804. A_UINT32 tx_comp_ring_size;\
  3805. /* DWORD 3 (or 4)*/\
  3806. _paddr__tx_comp_wr_idx_addr_;\
  3807. /* DWORD 4 (or 6)*/\
  3808. _paddr__tx_ce_wr_idx_addr_;\
  3809. /* DWORD 5 (or 8)*/\
  3810. _paddr__rx_ind_ring_base_addr_;\
  3811. /* DWORD 6 (or 10)*/\
  3812. A_UINT32 rx_ind_ring_size;\
  3813. /* DWORD 7 (or 11)*/\
  3814. _paddr__rx_ind_rd_idx_addr_;\
  3815. /* DWORD 8 (or 13)*/\
  3816. _paddr__rx_ind_wr_idx_addr_;\
  3817. /* DWORD 9 (or 15)*/\
  3818. _paddr__rx_ring2_base_addr_;\
  3819. /* DWORD 10 (or 17) */\
  3820. A_UINT32 rx_ring2_size;\
  3821. /* DWORD 11 (or 18) */\
  3822. _paddr__rx_ring2_rd_idx_addr_;\
  3823. /* DWORD 12 (or 20) */\
  3824. _paddr__rx_ring2_wr_idx_addr_;\
  3825. } POSTPACK
  3826. /* define a htt_wdi_ipa_config32_t type */
  3827. 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));
  3828. /* define a htt_wdi_ipa_config64_t type */
  3829. 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));
  3830. #if HTT_PADDR64
  3831. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3832. #else
  3833. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3834. #endif
  3835. enum htt_wdi_ipa_op_code {
  3836. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3837. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3838. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3839. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3840. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3841. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3842. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3843. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3844. /* keep this last */
  3845. HTT_WDI_IPA_OPCODE_MAX
  3846. };
  3847. /**
  3848. * @brief HTT WDI_IPA Operation Request Message
  3849. *
  3850. * @details
  3851. * HTT WDI_IPA Operation Request message is sent by host
  3852. * to either suspend or resume WDI_IPA TX or RX path.
  3853. * |31 24|23 16|15 8|7 0|
  3854. * |----------------+----------------+----------------+----------------|
  3855. * | op_code | Rsvd | msg_type |
  3856. * |-------------------------------------------------------------------|
  3857. *
  3858. * Header fields:
  3859. * - MSG_TYPE
  3860. * Bits 7:0
  3861. * Purpose: Identifies this as WDI_IPA Operation Request message
  3862. * value: = 0x9
  3863. * - OP_CODE
  3864. * Bits 31:16
  3865. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3866. * value: = enum htt_wdi_ipa_op_code
  3867. */
  3868. PREPACK struct htt_wdi_ipa_op_request_t
  3869. {
  3870. /* DWORD 0: flags and meta-data */
  3871. A_UINT32
  3872. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3873. reserved: 8,
  3874. op_code: 16;
  3875. } POSTPACK;
  3876. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3877. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3878. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3879. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3880. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3881. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3882. do { \
  3883. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3884. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3885. } while (0)
  3886. /*
  3887. * @brief host -> target HTT_SRING_SETUP message
  3888. *
  3889. * @details
  3890. * After target is booted up, Host can send SRING setup message for
  3891. * each host facing LMAC SRING. Target setups up HW registers based
  3892. * on setup message and confirms back to Host if response_required is set.
  3893. * Host should wait for confirmation message before sending new SRING
  3894. * setup message
  3895. *
  3896. * The message would appear as follows:
  3897. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3898. * |--------------- +-----------------+----------------+------------------|
  3899. * | ring_type | ring_id | pdev_id | msg_type |
  3900. * |----------------------------------------------------------------------|
  3901. * | ring_base_addr_lo |
  3902. * |----------------------------------------------------------------------|
  3903. * | ring_base_addr_hi |
  3904. * |----------------------------------------------------------------------|
  3905. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3906. * |----------------------------------------------------------------------|
  3907. * | ring_head_offset32_remote_addr_lo |
  3908. * |----------------------------------------------------------------------|
  3909. * | ring_head_offset32_remote_addr_hi |
  3910. * |----------------------------------------------------------------------|
  3911. * | ring_tail_offset32_remote_addr_lo |
  3912. * |----------------------------------------------------------------------|
  3913. * | ring_tail_offset32_remote_addr_hi |
  3914. * |----------------------------------------------------------------------|
  3915. * | ring_msi_addr_lo |
  3916. * |----------------------------------------------------------------------|
  3917. * | ring_msi_addr_hi |
  3918. * |----------------------------------------------------------------------|
  3919. * | ring_msi_data |
  3920. * |----------------------------------------------------------------------|
  3921. * | intr_timer_th |IM| intr_batch_counter_th |
  3922. * |----------------------------------------------------------------------|
  3923. * | reserved |RR|PTCF| intr_low_threshold |
  3924. * |----------------------------------------------------------------------|
  3925. * Where
  3926. * IM = sw_intr_mode
  3927. * RR = response_required
  3928. * PTCF = prefetch_timer_cfg
  3929. *
  3930. * The message is interpreted as follows:
  3931. * dword0 - b'0:7 - msg_type: This will be set to
  3932. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3933. * b'8:15 - pdev_id:
  3934. * 0 (for rings at SOC/UMAC level),
  3935. * 1/2/3 mac id (for rings at LMAC level)
  3936. * b'16:23 - ring_id: identify which ring is to setup,
  3937. * more details can be got from enum htt_srng_ring_id
  3938. * b'24:31 - ring_type: identify type of host rings,
  3939. * more details can be got from enum htt_srng_ring_type
  3940. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3941. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3942. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3943. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3944. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3945. * SW_TO_HW_RING.
  3946. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3947. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3948. * Lower 32 bits of memory address of the remote variable
  3949. * storing the 4-byte word offset that identifies the head
  3950. * element within the ring.
  3951. * (The head offset variable has type A_UINT32.)
  3952. * Valid for HW_TO_SW and SW_TO_SW rings.
  3953. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3954. * Upper 32 bits of memory address of the remote variable
  3955. * storing the 4-byte word offset that identifies the head
  3956. * element within the ring.
  3957. * (The head offset variable has type A_UINT32.)
  3958. * Valid for HW_TO_SW and SW_TO_SW rings.
  3959. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3960. * Lower 32 bits of memory address of the remote variable
  3961. * storing the 4-byte word offset that identifies the tail
  3962. * element within the ring.
  3963. * (The tail offset variable has type A_UINT32.)
  3964. * Valid for HW_TO_SW and SW_TO_SW rings.
  3965. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3966. * Upper 32 bits of memory address of the remote variable
  3967. * storing the 4-byte word offset that identifies the tail
  3968. * element within the ring.
  3969. * (The tail offset variable has type A_UINT32.)
  3970. * Valid for HW_TO_SW and SW_TO_SW rings.
  3971. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3972. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3973. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3974. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3975. * dword10 - b'0:31 - ring_msi_data: MSI data
  3976. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3977. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3978. * dword11 - b'0:14 - intr_batch_counter_th:
  3979. * batch counter threshold is in units of 4-byte words.
  3980. * HW internally maintains and increments batch count.
  3981. * (see SRING spec for detail description).
  3982. * When batch count reaches threshold value, an interrupt
  3983. * is generated by HW.
  3984. * b'15 - sw_intr_mode:
  3985. * This configuration shall be static.
  3986. * Only programmed at power up.
  3987. * 0: generate pulse style sw interrupts
  3988. * 1: generate level style sw interrupts
  3989. * b'16:31 - intr_timer_th:
  3990. * The timer init value when timer is idle or is
  3991. * initialized to start downcounting.
  3992. * In 8us units (to cover a range of 0 to 524 ms)
  3993. * dword12 - b'0:15 - intr_low_threshold:
  3994. * Used only by Consumer ring to generate ring_sw_int_p.
  3995. * Ring entries low threshold water mark, that is used
  3996. * in combination with the interrupt timer as well as
  3997. * the the clearing of the level interrupt.
  3998. * b'16:18 - prefetch_timer_cfg:
  3999. * Used only by Consumer ring to set timer mode to
  4000. * support Application prefetch handling.
  4001. * The external tail offset/pointer will be updated
  4002. * at following intervals:
  4003. * 3'b000: (Prefetch feature disabled; used only for debug)
  4004. * 3'b001: 1 usec
  4005. * 3'b010: 4 usec
  4006. * 3'b011: 8 usec (default)
  4007. * 3'b100: 16 usec
  4008. * Others: Reserverd
  4009. * b'19 - response_required:
  4010. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4011. * b'20:31 - reserved: reserved for future use
  4012. */
  4013. PREPACK struct htt_sring_setup_t {
  4014. A_UINT32 msg_type: 8,
  4015. pdev_id: 8,
  4016. ring_id: 8,
  4017. ring_type: 8;
  4018. A_UINT32 ring_base_addr_lo;
  4019. A_UINT32 ring_base_addr_hi;
  4020. A_UINT32 ring_size: 16,
  4021. ring_entry_size: 8,
  4022. ring_misc_cfg_flag: 8;
  4023. A_UINT32 ring_head_offset32_remote_addr_lo;
  4024. A_UINT32 ring_head_offset32_remote_addr_hi;
  4025. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4026. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4027. A_UINT32 ring_msi_addr_lo;
  4028. A_UINT32 ring_msi_addr_hi;
  4029. A_UINT32 ring_msi_data;
  4030. A_UINT32 intr_batch_counter_th: 15,
  4031. sw_intr_mode: 1,
  4032. intr_timer_th: 16;
  4033. A_UINT32 intr_low_threshold: 16,
  4034. prefetch_timer_cfg: 3,
  4035. response_required: 1,
  4036. reserved1: 12;
  4037. } POSTPACK;
  4038. enum htt_srng_ring_type {
  4039. HTT_HW_TO_SW_RING = 0,
  4040. HTT_SW_TO_HW_RING,
  4041. HTT_SW_TO_SW_RING,
  4042. /* Insert new ring types above this line */
  4043. };
  4044. enum htt_srng_ring_id {
  4045. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4046. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4047. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4048. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4049. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4050. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4051. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4052. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4053. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4054. /* Add Other SRING which can't be directly configured by host software above this line */
  4055. };
  4056. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4057. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4058. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4059. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4060. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4061. HTT_SRING_SETUP_PDEV_ID_S)
  4062. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4063. do { \
  4064. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4065. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4066. } while (0)
  4067. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4068. #define HTT_SRING_SETUP_RING_ID_S 16
  4069. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4070. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4071. HTT_SRING_SETUP_RING_ID_S)
  4072. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4073. do { \
  4074. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4075. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4076. } while (0)
  4077. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4078. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4079. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4080. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4081. HTT_SRING_SETUP_RING_TYPE_S)
  4082. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4083. do { \
  4084. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4085. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4086. } while (0)
  4087. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4088. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4089. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4090. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4091. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4092. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4093. do { \
  4094. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4095. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4096. } while (0)
  4097. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4098. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4099. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4100. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4101. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4102. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4105. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4106. } while (0)
  4107. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4108. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4109. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4110. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4111. HTT_SRING_SETUP_RING_SIZE_S)
  4112. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4115. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4116. } while (0)
  4117. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4118. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4119. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4120. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4121. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4122. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4125. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4126. } while (0)
  4127. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4128. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4129. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4130. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4131. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4132. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4133. do { \
  4134. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4135. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4136. } while (0)
  4137. /* This control bit is applicable to only Producer, which updates Ring ID field
  4138. * of each descriptor before pushing into the ring.
  4139. * 0: updates ring_id(default)
  4140. * 1: ring_id updating disabled */
  4141. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4142. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4143. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4144. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4145. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4146. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4147. do { \
  4148. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4149. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4150. } while (0)
  4151. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4152. * of each descriptor before pushing into the ring.
  4153. * 0: updates Loopcnt(default)
  4154. * 1: Loopcnt updating disabled */
  4155. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4156. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4157. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4158. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4159. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4160. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4163. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4164. } while (0)
  4165. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4166. * into security_id port of GXI/AXI. */
  4167. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4168. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4169. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4170. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4171. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4172. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4175. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4176. } while (0)
  4177. /* During MSI write operation, SRNG drives value of this register bit into
  4178. * swap bit of GXI/AXI. */
  4179. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4180. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4181. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4182. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4183. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4185. do { \
  4186. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4187. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4188. } while (0)
  4189. /* During Pointer write operation, SRNG drives value of this register bit into
  4190. * swap bit of GXI/AXI. */
  4191. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4192. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4193. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4194. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4195. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4196. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4197. do { \
  4198. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4199. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4200. } while (0)
  4201. /* During any data or TLV write operation, SRNG drives value of this register
  4202. * bit into swap bit of GXI/AXI. */
  4203. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4204. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4205. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4206. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4207. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4208. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4209. do { \
  4210. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4211. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4212. } while (0)
  4213. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4214. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4215. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4216. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4217. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4218. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4219. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4220. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4223. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4224. } while (0)
  4225. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4226. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4227. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4228. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4229. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4230. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4231. do { \
  4232. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4233. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4234. } while (0)
  4235. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4236. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4237. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4238. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4239. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4240. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4243. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4244. } while (0)
  4245. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4246. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4247. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4248. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4249. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4250. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4251. do { \
  4252. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4253. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4254. } while (0)
  4255. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4256. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4257. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4258. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4259. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4260. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4263. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4264. } while (0)
  4265. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4266. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4267. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4268. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4269. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4270. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4271. do { \
  4272. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4273. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4274. } while (0)
  4275. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4276. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4277. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4278. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4279. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4280. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4281. do { \
  4282. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4283. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4284. } while (0)
  4285. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4286. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4287. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4288. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4289. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4290. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4291. do { \
  4292. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4293. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4294. } while (0)
  4295. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4296. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4297. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4298. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4299. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4300. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4301. do { \
  4302. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4303. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4304. } while (0)
  4305. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4306. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4307. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4308. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4309. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4310. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4311. do { \
  4312. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4313. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4314. } while (0)
  4315. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4316. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4317. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4318. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4319. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4320. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4321. do { \
  4322. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4323. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4324. } while (0)
  4325. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4326. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4327. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4328. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4329. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4330. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4331. do { \
  4332. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4333. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4334. } while (0)
  4335. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4336. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4337. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4338. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4339. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4340. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4341. do { \
  4342. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4343. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4344. } while (0)
  4345. /**
  4346. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4347. *
  4348. * @details
  4349. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4350. * configure RXDMA rings.
  4351. * The configuration is per ring based and includes both packet subtypes
  4352. * and PPDU/MPDU TLVs.
  4353. *
  4354. * The message would appear as follows:
  4355. *
  4356. * |31 27|26|25|24|23 16|15 8|7 0|
  4357. * |-----------------+----------------+----------------+---------------|
  4358. * | rsvd1 |OV|PS|SS| ring_id | pdev_id | msg_type |
  4359. * |-------------------------------------------------------------------|
  4360. * | rsvd2 | ring_buffer_size |
  4361. * |-------------------------------------------------------------------|
  4362. * | packet_type_enable_flags_0 |
  4363. * |-------------------------------------------------------------------|
  4364. * | packet_type_enable_flags_1 |
  4365. * |-------------------------------------------------------------------|
  4366. * | packet_type_enable_flags_2 |
  4367. * |-------------------------------------------------------------------|
  4368. * | packet_type_enable_flags_3 |
  4369. * |-------------------------------------------------------------------|
  4370. * | tlv_filter_in_flags |
  4371. * |-------------------------------------------------------------------|
  4372. * | rx_header_offset | rx_packet_offset |
  4373. * |-------------------------------------------------------------------|
  4374. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4375. * |-------------------------------------------------------------------|
  4376. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4377. * |-------------------------------------------------------------------|
  4378. * | rsvd3 | rx_attention_offset |
  4379. * |-------------------------------------------------------------------|
  4380. * Where:
  4381. * PS = pkt_swap
  4382. * SS = status_swap
  4383. * OV = rx_offsets_valid
  4384. * The message is interpreted as follows:
  4385. * dword0 - b'0:7 - msg_type: This will be set to
  4386. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4387. * b'8:15 - pdev_id:
  4388. * 0 (for rings at SOC/UMAC level),
  4389. * 1/2/3 mac id (for rings at LMAC level)
  4390. * b'16:23 - ring_id : Identify the ring to configure.
  4391. * More details can be got from enum htt_srng_ring_id
  4392. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4393. * BUF_RING_CFG_0 defs within HW .h files,
  4394. * e.g. wmac_top_reg_seq_hwioreg.h
  4395. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4396. * BUF_RING_CFG_0 defs within HW .h files,
  4397. * e.g. wmac_top_reg_seq_hwioreg.h
  4398. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4399. * configuration fields are valid
  4400. * b'27:31 - rsvd1: reserved for future use
  4401. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4402. * in byte units.
  4403. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4404. * - b'16:31 - rsvd2: Reserved for future use
  4405. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4406. * Enable MGMT packet from 0b0000 to 0b1001
  4407. * bits from low to high: FP, MD, MO - 3 bits
  4408. * FP: Filter_Pass
  4409. * MD: Monitor_Direct
  4410. * MO: Monitor_Other
  4411. * 10 mgmt subtypes * 3 bits -> 30 bits
  4412. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4413. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4414. * Enable MGMT packet from 0b1010 to 0b1111
  4415. * bits from low to high: FP, MD, MO - 3 bits
  4416. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4417. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4418. * Enable CTRL packet from 0b0000 to 0b1001
  4419. * bits from low to high: FP, MD, MO - 3 bits
  4420. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4421. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4422. * Enable CTRL packet from 0b1010 to 0b1111,
  4423. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4424. * bits from low to high: FP, MD, MO - 3 bits
  4425. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4426. * dword6 - b'0:31 - tlv_filter_in_flags:
  4427. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4428. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4429. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4430. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4431. * A value of 0 will be considered as ignore this config.
  4432. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4433. * e.g. wmac_top_reg_seq_hwioreg.h
  4434. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4435. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4436. * A value of 0 will be considered as ignore this config.
  4437. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4438. * e.g. wmac_top_reg_seq_hwioreg.h
  4439. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4440. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4441. * A value of 0 will be considered as ignore this config.
  4442. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4443. * e.g. wmac_top_reg_seq_hwioreg.h
  4444. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4445. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4446. * A value of 0 will be considered as ignore this config.
  4447. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4448. * e.g. wmac_top_reg_seq_hwioreg.h
  4449. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4450. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4451. * A value of 0 will be considered as ignore this config.
  4452. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4453. * e.g. wmac_top_reg_seq_hwioreg.h
  4454. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4455. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4456. * A value of 0 will be considered as ignore this config.
  4457. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4458. * e.g. wmac_top_reg_seq_hwioreg.h
  4459. * dword10 - b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4460. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4461. * A value of 0 will be considered as ignore this config.
  4462. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4463. * e.g. wmac_top_reg_seq_hwioreg.h
  4464. * - b'16-31 - rsvd3 for future use
  4465. */
  4466. PREPACK struct htt_rx_ring_selection_cfg_t {
  4467. A_UINT32 msg_type: 8,
  4468. pdev_id: 8,
  4469. ring_id: 8,
  4470. status_swap: 1,
  4471. pkt_swap: 1,
  4472. rx_offsets_valid: 1,
  4473. rsvd1: 5;
  4474. A_UINT32 ring_buffer_size: 16,
  4475. rsvd2: 16;
  4476. A_UINT32 packet_type_enable_flags_0;
  4477. A_UINT32 packet_type_enable_flags_1;
  4478. A_UINT32 packet_type_enable_flags_2;
  4479. A_UINT32 packet_type_enable_flags_3;
  4480. A_UINT32 tlv_filter_in_flags;
  4481. A_UINT32 rx_packet_offset: 16,
  4482. rx_header_offset: 16;
  4483. A_UINT32 rx_mpdu_end_offset: 16,
  4484. rx_mpdu_start_offset: 16;
  4485. A_UINT32 rx_msdu_end_offset: 16,
  4486. rx_msdu_start_offset: 16;
  4487. A_UINT32 rx_attn_offset: 16,
  4488. rsvd3: 16;
  4489. } POSTPACK;
  4490. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4491. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4492. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4493. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4494. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4495. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4496. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4497. do { \
  4498. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4499. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4500. } while (0)
  4501. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4502. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4503. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4504. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4505. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4506. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4507. do { \
  4508. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4509. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4510. } while (0)
  4511. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4512. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4513. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4514. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4515. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4516. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4517. do { \
  4518. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4519. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4520. } while (0)
  4521. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4524. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4525. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4527. do { \
  4528. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4529. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4530. } while (0)
  4531. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4532. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4533. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4534. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4535. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4536. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4537. do { \
  4538. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4539. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4540. } while (0)
  4541. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4542. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4543. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4544. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4545. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4546. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4547. do { \
  4548. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4549. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4550. } while (0)
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4554. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4555. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4557. do { \
  4558. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4559. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4560. } while (0)
  4561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4564. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4565. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4567. do { \
  4568. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4569. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4570. } while (0)
  4571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4574. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4575. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4577. do { \
  4578. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4579. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4580. } while (0)
  4581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4584. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4585. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4587. do { \
  4588. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4589. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4590. } while (0)
  4591. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4592. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4593. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4594. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4595. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4596. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4597. do { \
  4598. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4599. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4600. } while (0)
  4601. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4602. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4603. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4604. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4605. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4606. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4607. do { \
  4608. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4609. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4610. } while (0)
  4611. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4612. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4613. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4614. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4615. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4616. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4617. do { \
  4618. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4619. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4620. } while (0)
  4621. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4622. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4623. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4624. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4625. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4626. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4627. do { \
  4628. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4629. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4630. } while (0)
  4631. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4632. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4633. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4634. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4635. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4636. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4637. do { \
  4638. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4639. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4640. } while (0)
  4641. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4642. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4643. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4644. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4645. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4646. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4647. do { \
  4648. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4649. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4650. } while (0)
  4651. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4652. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4653. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4654. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4655. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4656. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4657. do { \
  4658. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4659. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4660. } while (0)
  4661. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4662. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4663. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4664. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4665. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4666. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4667. do { \
  4668. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4669. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4670. } while (0)
  4671. /*
  4672. * Subtype based MGMT frames enable bits.
  4673. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4674. */
  4675. /* association request */
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4682. /* association response */
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4689. /* Reassociation request */
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4696. /* Reassociation response */
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4703. /* Probe request */
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4705. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4710. /* Probe response */
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4717. /* Timing Advertisement */
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4724. /* Reserved */
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4731. /* Beacon */
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4738. /* ATIM */
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4745. /* Disassociation */
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4752. /* Authentication */
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4759. /* Deauthentication */
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4766. /* Action */
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4773. /* Action No Ack */
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4780. /* Reserved */
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4787. /*
  4788. * Subtype based CTRL frames enable bits.
  4789. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4790. */
  4791. /* Reserved */
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4798. /* Reserved */
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4805. /* Reserved */
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4812. /* Reserved */
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4819. /* Reserved */
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4826. /* Reserved */
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4833. /* Reserved */
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4840. /* Control Wrapper */
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4847. /* Block Ack Request */
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4854. /* Block Ack*/
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4861. /* PS-POLL */
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4868. /* RTS */
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4875. /* CTS */
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4882. /* ACK */
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4889. /* CF-END */
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4896. /* CF-END + CF-ACK */
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4903. /* Multicast data */
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4910. /* Unicast data */
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4917. /* NULL data */
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4925. do { \
  4926. HTT_CHECK_SET_VAL(httsym, value); \
  4927. (word) |= (value) << httsym##_S; \
  4928. } while (0)
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4930. (((word) & httsym##_M) >> httsym##_S)
  4931. #define htt_rx_ring_pkt_enable_subtype_set( \
  4932. word, flag, mode, type, subtype, val) \
  4933. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4934. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4935. #define htt_rx_ring_pkt_enable_subtype_get( \
  4936. word, flag, mode, type, subtype) \
  4937. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4938. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4939. /* Definition to filter in TLVs */
  4940. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4941. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4942. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4943. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4944. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4945. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4946. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4947. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4948. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4949. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4950. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4951. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4952. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4953. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4954. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4955. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4956. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4957. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4958. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4959. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4960. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4961. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4962. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4963. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4964. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4965. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4966. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4967. do { \
  4968. HTT_CHECK_SET_VAL(httsym, enable); \
  4969. (word) |= (enable) << httsym##_S; \
  4970. } while (0)
  4971. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4972. (((word) & httsym##_M) >> httsym##_S)
  4973. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4974. HTT_RX_RING_TLV_ENABLE_SET( \
  4975. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4976. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4977. HTT_RX_RING_TLV_ENABLE_GET( \
  4978. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4979. /**
  4980. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4981. * host --> target Receive Flow Steering configuration message definition.
  4982. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4983. * The reason for this is we want RFS to be configured and ready before MAC
  4984. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4985. *
  4986. * |31 24|23 16|15 9|8|7 0|
  4987. * |----------------+----------------+----------------+----------------|
  4988. * | reserved |E| msg type |
  4989. * |-------------------------------------------------------------------|
  4990. * Where E = RFS enable flag
  4991. *
  4992. * The RFS_CONFIG message consists of a single 4-byte word.
  4993. *
  4994. * Header fields:
  4995. * - MSG_TYPE
  4996. * Bits 7:0
  4997. * Purpose: identifies this as a RFS config msg
  4998. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4999. * - RFS_CONFIG
  5000. * Bit 8
  5001. * Purpose: Tells target whether to enable (1) or disable (0)
  5002. * flow steering feature when sending rx indication messages to host
  5003. */
  5004. #define HTT_H2T_RFS_CONFIG_M 0x100
  5005. #define HTT_H2T_RFS_CONFIG_S 8
  5006. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5007. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5008. HTT_H2T_RFS_CONFIG_S)
  5009. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5010. do { \
  5011. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5012. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5013. } while (0)
  5014. #define HTT_RFS_CFG_REQ_BYTES 4
  5015. /**
  5016. * @brief host -> target FW extended statistics retrieve
  5017. *
  5018. * @details
  5019. * The following field definitions describe the format of the HTT host
  5020. * to target FW extended stats retrieve message.
  5021. * The message specifies the type of stats the host wants to retrieve.
  5022. *
  5023. * |31 24|23 16|15 8|7 0|
  5024. * |-----------------------------------------------------------|
  5025. * | reserved | stats type | pdev_mask | msg type |
  5026. * |-----------------------------------------------------------|
  5027. * | config param [0] |
  5028. * |-----------------------------------------------------------|
  5029. * | config param [1] |
  5030. * |-----------------------------------------------------------|
  5031. * | config param [2] |
  5032. * |-----------------------------------------------------------|
  5033. * | config param [3] |
  5034. * |-----------------------------------------------------------|
  5035. * | reserved |
  5036. * |-----------------------------------------------------------|
  5037. * | cookie LSBs |
  5038. * |-----------------------------------------------------------|
  5039. * | cookie MSBs |
  5040. * |-----------------------------------------------------------|
  5041. * Header fields:
  5042. * - MSG_TYPE
  5043. * Bits 7:0
  5044. * Purpose: identifies this is a extended stats upload request message
  5045. * Value: 0x10
  5046. * - PDEV_MASK
  5047. * Bits 8:15
  5048. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5049. * Value: This is a overloaded field, refer to usage and interpretation of
  5050. * PDEV in interface document.
  5051. * Bit 8 : Reserved for SOC stats
  5052. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5053. * Indicates MACID_MASK in DBS
  5054. * - STATS_TYPE
  5055. * Bits 23:16
  5056. * Purpose: identifies which FW statistics to upload
  5057. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5058. * - Reserved
  5059. * Bits 31:24
  5060. * - CONFIG_PARAM [0]
  5061. * Bits 31:0
  5062. * Purpose: give an opaque configuration value to the specified stats type
  5063. * Value: stats-type specific configuration value
  5064. * Refer to htt_stats.h for interpretation for each stats sub_type
  5065. * - CONFIG_PARAM [1]
  5066. * Bits 31:0
  5067. * Purpose: give an opaque configuration value to the specified stats type
  5068. * Value: stats-type specific configuration value
  5069. * Refer to htt_stats.h for interpretation for each stats sub_type
  5070. * - CONFIG_PARAM [2]
  5071. * Bits 31:0
  5072. * Purpose: give an opaque configuration value to the specified stats type
  5073. * Value: stats-type specific configuration value
  5074. * Refer to htt_stats.h for interpretation for each stats sub_type
  5075. * - CONFIG_PARAM [3]
  5076. * Bits 31:0
  5077. * Purpose: give an opaque configuration value to the specified stats type
  5078. * Value: stats-type specific configuration value
  5079. * Refer to htt_stats.h for interpretation for each stats sub_type
  5080. * - Reserved [31:0] for future use.
  5081. * - COOKIE_LSBS
  5082. * Bits 31:0
  5083. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5084. * message with its preceding host->target stats request message.
  5085. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5086. * - COOKIE_MSBS
  5087. * Bits 31:0
  5088. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5089. * message with its preceding host->target stats request message.
  5090. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5091. */
  5092. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5093. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5094. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5095. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5096. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5097. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5098. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5099. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5100. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5101. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5102. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5103. do { \
  5104. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5105. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5106. } while (0)
  5107. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5108. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5109. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5110. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5111. do { \
  5112. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5113. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5114. } while (0)
  5115. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5116. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5117. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5118. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5119. do { \
  5120. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5121. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5122. } while (0)
  5123. /**
  5124. * @brief host -> target FW PPDU_STATS request message
  5125. *
  5126. * @details
  5127. * The following field definitions describe the format of the HTT host
  5128. * to target FW for PPDU_STATS_CFG msg.
  5129. * The message allows the host to configure the PPDU_STATS_IND messages
  5130. * produced by the target.
  5131. *
  5132. * |31 24|23 16|15 8|7 0|
  5133. * |-----------------------------------------------------------|
  5134. * | REQ bit mask | pdev_mask | msg type |
  5135. * |-----------------------------------------------------------|
  5136. * Header fields:
  5137. * - MSG_TYPE
  5138. * Bits 7:0
  5139. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5140. * Value: 0x11
  5141. * - PDEV_MASK
  5142. * Bits 8:15
  5143. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5144. * Value: This is a overloaded field, refer to usage and interpretation of
  5145. * PDEV in interface document.
  5146. * Bit 8 : Reserved for SOC stats
  5147. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5148. * Indicates MACID_MASK in DBS
  5149. * - REQ_TLV_BIT_MASK
  5150. * Bits 16:31
  5151. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5152. * needs to be included in the target's PPDU_STATS_IND messages.
  5153. * Value: refer htt_ppdu_stats_tlv_tag_t
  5154. *
  5155. */
  5156. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5157. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5158. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5159. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5160. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5161. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5162. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5163. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5164. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5165. do { \
  5166. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5167. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5168. } while (0)
  5169. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5170. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5171. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5172. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5173. do { \
  5174. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5175. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5176. } while (0)
  5177. /*=== target -> host messages ===============================================*/
  5178. enum htt_t2h_msg_type {
  5179. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5180. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5181. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5182. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5183. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5184. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5185. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5186. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5187. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5188. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5189. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5190. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5191. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5192. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5193. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5194. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5195. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5196. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5197. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5198. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5199. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5200. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5201. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5202. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5203. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5204. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5205. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5206. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5207. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5208. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5209. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5210. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5211. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5212. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5213. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5214. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5215. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5216. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5217. /* TX_OFFLOAD_DELIVER_IND:
  5218. * Forward the target's locally-generated packets to the host,
  5219. * to provide to the monitor mode interface.
  5220. */
  5221. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  5222. HTT_T2H_MSG_TYPE_TEST,
  5223. /* keep this last */
  5224. HTT_T2H_NUM_MSGS
  5225. };
  5226. /*
  5227. * HTT target to host message type -
  5228. * stored in bits 7:0 of the first word of the message
  5229. */
  5230. #define HTT_T2H_MSG_TYPE_M 0xff
  5231. #define HTT_T2H_MSG_TYPE_S 0
  5232. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5233. do { \
  5234. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5235. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5236. } while (0)
  5237. #define HTT_T2H_MSG_TYPE_GET(word) \
  5238. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5239. /**
  5240. * @brief target -> host version number confirmation message definition
  5241. *
  5242. * |31 24|23 16|15 8|7 0|
  5243. * |----------------+----------------+----------------+----------------|
  5244. * | reserved | major number | minor number | msg type |
  5245. * |-------------------------------------------------------------------|
  5246. * : option request TLV (optional) |
  5247. * :...................................................................:
  5248. *
  5249. * The VER_CONF message may consist of a single 4-byte word, or may be
  5250. * extended with TLVs that specify HTT options selected by the target.
  5251. * The following option TLVs may be appended to the VER_CONF message:
  5252. * - LL_BUS_ADDR_SIZE
  5253. * - HL_SUPPRESS_TX_COMPL_IND
  5254. * - MAX_TX_QUEUE_GROUPS
  5255. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5256. * may be appended to the VER_CONF message (but only one TLV of each type).
  5257. *
  5258. * Header fields:
  5259. * - MSG_TYPE
  5260. * Bits 7:0
  5261. * Purpose: identifies this as a version number confirmation message
  5262. * Value: 0x0
  5263. * - VER_MINOR
  5264. * Bits 15:8
  5265. * Purpose: Specify the minor number of the HTT message library version
  5266. * in use by the target firmware.
  5267. * The minor number specifies the specific revision within a range
  5268. * of fundamentally compatible HTT message definition revisions.
  5269. * Compatible revisions involve adding new messages or perhaps
  5270. * adding new fields to existing messages, in a backwards-compatible
  5271. * manner.
  5272. * Incompatible revisions involve changing the message type values,
  5273. * or redefining existing messages.
  5274. * Value: minor number
  5275. * - VER_MAJOR
  5276. * Bits 15:8
  5277. * Purpose: Specify the major number of the HTT message library version
  5278. * in use by the target firmware.
  5279. * The major number specifies the family of minor revisions that are
  5280. * fundamentally compatible with each other, but not with prior or
  5281. * later families.
  5282. * Value: major number
  5283. */
  5284. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5285. #define HTT_VER_CONF_MINOR_S 8
  5286. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5287. #define HTT_VER_CONF_MAJOR_S 16
  5288. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5289. do { \
  5290. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5291. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5292. } while (0)
  5293. #define HTT_VER_CONF_MINOR_GET(word) \
  5294. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5295. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5296. do { \
  5297. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5298. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5299. } while (0)
  5300. #define HTT_VER_CONF_MAJOR_GET(word) \
  5301. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5302. #define HTT_VER_CONF_BYTES 4
  5303. /**
  5304. * @brief - target -> host HTT Rx In order indication message
  5305. *
  5306. * @details
  5307. *
  5308. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5309. * |----------------+-------------------+---------------------+---------------|
  5310. * | peer ID | P| F| O| ext TID | msg type |
  5311. * |--------------------------------------------------------------------------|
  5312. * | MSDU count | Reserved | vdev id |
  5313. * |--------------------------------------------------------------------------|
  5314. * | MSDU 0 bus address (bits 31:0) |
  5315. #if HTT_PADDR64
  5316. * | MSDU 0 bus address (bits 63:32) |
  5317. #endif
  5318. * |--------------------------------------------------------------------------|
  5319. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5320. * |--------------------------------------------------------------------------|
  5321. * | MSDU 1 bus address (bits 31:0) |
  5322. #if HTT_PADDR64
  5323. * | MSDU 1 bus address (bits 63:32) |
  5324. #endif
  5325. * |--------------------------------------------------------------------------|
  5326. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5327. * |--------------------------------------------------------------------------|
  5328. */
  5329. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5330. *
  5331. * @details
  5332. * bits
  5333. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5334. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5335. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5336. * | | frag | | | | fail |chksum fail|
  5337. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5338. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5339. */
  5340. struct htt_rx_in_ord_paddr_ind_hdr_t
  5341. {
  5342. A_UINT32 /* word 0 */
  5343. msg_type: 8,
  5344. ext_tid: 5,
  5345. offload: 1,
  5346. frag: 1,
  5347. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5348. peer_id: 16;
  5349. A_UINT32 /* word 1 */
  5350. vap_id: 8,
  5351. /* NOTE:
  5352. * This reserved_1 field is not truly reserved - certain targets use
  5353. * this field internally to store debug information, and do not zero
  5354. * out the contents of the field before uploading the message to the
  5355. * host. Thus, any host-target communication supported by this field
  5356. * is limited to using values that are never used by the debug
  5357. * information stored by certain targets in the reserved_1 field.
  5358. * In particular, the targets in question don't use the value 0x3
  5359. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  5360. * so this previously-unused value within these bits is available to
  5361. * use as the host / target PKT_CAPTURE_MODE flag.
  5362. */
  5363. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  5364. /* if pkt_capture_mode == 0x3, host should
  5365. * send rx frames to monitor mode interface
  5366. */
  5367. msdu_cnt: 16;
  5368. };
  5369. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5370. {
  5371. A_UINT32 dma_addr;
  5372. A_UINT32
  5373. length: 16,
  5374. fw_desc: 8,
  5375. msdu_info:8;
  5376. };
  5377. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5378. {
  5379. A_UINT32 dma_addr_lo;
  5380. A_UINT32 dma_addr_hi;
  5381. A_UINT32
  5382. length: 16,
  5383. fw_desc: 8,
  5384. msdu_info:8;
  5385. };
  5386. #if HTT_PADDR64
  5387. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5388. #else
  5389. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5390. #endif
  5391. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5392. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5393. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5394. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5395. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5396. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5397. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5398. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5399. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5400. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5401. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5402. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5403. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5404. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5405. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5406. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5407. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5408. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5409. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5410. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5411. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5412. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5413. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  5414. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  5415. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5416. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5417. /* for systems using 64-bit format for bus addresses */
  5418. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5419. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5420. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5421. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5422. /* for systems using 32-bit format for bus addresses */
  5423. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5424. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5425. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5426. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5427. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5428. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5429. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5430. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5431. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5432. do { \
  5433. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5434. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5435. } while (0)
  5436. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5437. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5438. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5439. do { \
  5440. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5441. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5442. } while (0)
  5443. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5444. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5445. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5446. do { \
  5447. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5448. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5449. } while (0)
  5450. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5451. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5452. /*
  5453. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  5454. * deliver the rx frames to the monitor mode interface.
  5455. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  5456. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  5457. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  5458. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  5459. */
  5460. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  5461. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  5462. do { \
  5463. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  5464. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  5465. } while (0)
  5466. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  5467. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  5468. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  5469. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5470. do { \
  5471. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5472. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5473. } while (0)
  5474. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5475. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5476. /* for systems using 64-bit format for bus addresses */
  5477. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5478. do { \
  5479. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5480. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5481. } while (0)
  5482. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5483. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5484. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5485. do { \
  5486. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5487. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5488. } while (0)
  5489. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5490. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5491. /* for systems using 32-bit format for bus addresses */
  5492. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5493. do { \
  5494. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5495. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5496. } while (0)
  5497. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5498. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5499. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5500. do { \
  5501. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5502. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5503. } while (0)
  5504. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5505. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5506. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5507. do { \
  5508. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5509. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5510. } while (0)
  5511. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5512. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5513. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5516. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5517. } while (0)
  5518. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5519. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5520. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5521. do { \
  5522. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5523. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5524. } while (0)
  5525. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5526. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5527. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5528. do { \
  5529. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5530. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5531. } while (0)
  5532. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5533. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5534. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5535. do { \
  5536. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5537. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5538. } while (0)
  5539. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5540. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5541. /* definitions used within target -> host rx indication message */
  5542. PREPACK struct htt_rx_ind_hdr_prefix_t
  5543. {
  5544. A_UINT32 /* word 0 */
  5545. msg_type: 8,
  5546. ext_tid: 5,
  5547. release_valid: 1,
  5548. flush_valid: 1,
  5549. reserved0: 1,
  5550. peer_id: 16;
  5551. A_UINT32 /* word 1 */
  5552. flush_start_seq_num: 6,
  5553. flush_end_seq_num: 6,
  5554. release_start_seq_num: 6,
  5555. release_end_seq_num: 6,
  5556. num_mpdu_ranges: 8;
  5557. } POSTPACK;
  5558. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5559. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5560. #define HTT_TGT_RSSI_INVALID 0x80
  5561. PREPACK struct htt_rx_ppdu_desc_t
  5562. {
  5563. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5564. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5565. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5566. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5567. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5568. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5569. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5570. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5571. A_UINT32 /* word 0 */
  5572. rssi_cmb: 8,
  5573. timestamp_submicrosec: 8,
  5574. phy_err_code: 8,
  5575. phy_err: 1,
  5576. legacy_rate: 4,
  5577. legacy_rate_sel: 1,
  5578. end_valid: 1,
  5579. start_valid: 1;
  5580. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5581. union {
  5582. A_UINT32 /* word 1 */
  5583. rssi0_pri20: 8,
  5584. rssi0_ext20: 8,
  5585. rssi0_ext40: 8,
  5586. rssi0_ext80: 8;
  5587. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5588. } u0;
  5589. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5590. union {
  5591. A_UINT32 /* word 2 */
  5592. rssi1_pri20: 8,
  5593. rssi1_ext20: 8,
  5594. rssi1_ext40: 8,
  5595. rssi1_ext80: 8;
  5596. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5597. } u1;
  5598. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5599. union {
  5600. A_UINT32 /* word 3 */
  5601. rssi2_pri20: 8,
  5602. rssi2_ext20: 8,
  5603. rssi2_ext40: 8,
  5604. rssi2_ext80: 8;
  5605. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5606. } u2;
  5607. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5608. union {
  5609. A_UINT32 /* word 4 */
  5610. rssi3_pri20: 8,
  5611. rssi3_ext20: 8,
  5612. rssi3_ext40: 8,
  5613. rssi3_ext80: 8;
  5614. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5615. } u3;
  5616. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5617. A_UINT32 tsf32; /* word 5 */
  5618. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5619. A_UINT32 timestamp_microsec; /* word 6 */
  5620. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5621. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5622. A_UINT32 /* word 7 */
  5623. vht_sig_a1: 24,
  5624. preamble_type: 8;
  5625. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5626. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  5627. A_UINT32 /* word 8 */
  5628. vht_sig_a2: 24,
  5629. /* sa_ant_matrix
  5630. * For cases where a single rx chain has options to be connected to
  5631. * different rx antennas, show which rx antennas were in use during
  5632. * receipt of a given PPDU.
  5633. * This sa_ant_matrix provides a bitmask of the antennas used while
  5634. * receiving this frame.
  5635. */
  5636. sa_ant_matrix: 8;
  5637. } POSTPACK;
  5638. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5639. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5640. PREPACK struct htt_rx_ind_hdr_suffix_t
  5641. {
  5642. A_UINT32 /* word 0 */
  5643. fw_rx_desc_bytes: 16,
  5644. reserved0: 16;
  5645. } POSTPACK;
  5646. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5647. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5648. PREPACK struct htt_rx_ind_hdr_t
  5649. {
  5650. struct htt_rx_ind_hdr_prefix_t prefix;
  5651. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5652. struct htt_rx_ind_hdr_suffix_t suffix;
  5653. } POSTPACK;
  5654. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5655. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5656. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5657. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5658. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5659. /*
  5660. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5661. * the offset into the HTT rx indication message at which the
  5662. * FW rx PPDU descriptor resides
  5663. */
  5664. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5665. /*
  5666. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5667. * the offset into the HTT rx indication message at which the
  5668. * header suffix (FW rx MSDU byte count) resides
  5669. */
  5670. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5671. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5672. /*
  5673. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5674. * the offset into the HTT rx indication message at which the per-MSDU
  5675. * information starts
  5676. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5677. * per-MSDU information portion of the message. The per-MSDU info itself
  5678. * starts at byte 12.
  5679. */
  5680. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5681. /**
  5682. * @brief target -> host rx indication message definition
  5683. *
  5684. * @details
  5685. * The following field definitions describe the format of the rx indication
  5686. * message sent from the target to the host.
  5687. * The message consists of three major sections:
  5688. * 1. a fixed-length header
  5689. * 2. a variable-length list of firmware rx MSDU descriptors
  5690. * 3. one or more 4-octet MPDU range information elements
  5691. * The fixed length header itself has two sub-sections
  5692. * 1. the message meta-information, including identification of the
  5693. * sender and type of the received data, and a 4-octet flush/release IE
  5694. * 2. the firmware rx PPDU descriptor
  5695. *
  5696. * The format of the message is depicted below.
  5697. * in this depiction, the following abbreviations are used for information
  5698. * elements within the message:
  5699. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5700. * elements associated with the PPDU start are valid.
  5701. * Specifically, the following fields are valid only if SV is set:
  5702. * RSSI (all variants), L, legacy rate, preamble type, service,
  5703. * VHT-SIG-A
  5704. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5705. * elements associated with the PPDU end are valid.
  5706. * Specifically, the following fields are valid only if EV is set:
  5707. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5708. * - L - Legacy rate selector - if legacy rates are used, this flag
  5709. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5710. * (L == 0) PHY.
  5711. * - P - PHY error flag - boolean indication of whether the rx frame had
  5712. * a PHY error
  5713. *
  5714. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5715. * |----------------+-------------------+---------------------+---------------|
  5716. * | peer ID | |RV|FV| ext TID | msg type |
  5717. * |--------------------------------------------------------------------------|
  5718. * | num | release | release | flush | flush |
  5719. * | MPDU | end | start | end | start |
  5720. * | ranges | seq num | seq num | seq num | seq num |
  5721. * |==========================================================================|
  5722. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5723. * |V|V| | rate | | | timestamp | RSSI |
  5724. * |--------------------------------------------------------------------------|
  5725. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5726. * |--------------------------------------------------------------------------|
  5727. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5728. * |--------------------------------------------------------------------------|
  5729. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5730. * |--------------------------------------------------------------------------|
  5731. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5732. * |--------------------------------------------------------------------------|
  5733. * | TSF LSBs |
  5734. * |--------------------------------------------------------------------------|
  5735. * | microsec timestamp |
  5736. * |--------------------------------------------------------------------------|
  5737. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5738. * |--------------------------------------------------------------------------|
  5739. * | service | HT-SIG / VHT-SIG-A2 |
  5740. * |==========================================================================|
  5741. * | reserved | FW rx desc bytes |
  5742. * |--------------------------------------------------------------------------|
  5743. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5744. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5745. * |--------------------------------------------------------------------------|
  5746. * : : :
  5747. * |--------------------------------------------------------------------------|
  5748. * | alignment | MSDU Rx |
  5749. * | padding | desc Bn |
  5750. * |--------------------------------------------------------------------------|
  5751. * | reserved | MPDU range status | MPDU count |
  5752. * |--------------------------------------------------------------------------|
  5753. * : reserved : MPDU range status : MPDU count :
  5754. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5755. *
  5756. * Header fields:
  5757. * - MSG_TYPE
  5758. * Bits 7:0
  5759. * Purpose: identifies this as an rx indication message
  5760. * Value: 0x1
  5761. * - EXT_TID
  5762. * Bits 12:8
  5763. * Purpose: identify the traffic ID of the rx data, including
  5764. * special "extended" TID values for multicast, broadcast, and
  5765. * non-QoS data frames
  5766. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5767. * - FLUSH_VALID (FV)
  5768. * Bit 13
  5769. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5770. * is valid
  5771. * Value:
  5772. * 1 -> flush IE is valid and needs to be processed
  5773. * 0 -> flush IE is not valid and should be ignored
  5774. * - REL_VALID (RV)
  5775. * Bit 13
  5776. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5777. * is valid
  5778. * Value:
  5779. * 1 -> release IE is valid and needs to be processed
  5780. * 0 -> release IE is not valid and should be ignored
  5781. * - PEER_ID
  5782. * Bits 31:16
  5783. * Purpose: Identify, by ID, which peer sent the rx data
  5784. * Value: ID of the peer who sent the rx data
  5785. * - FLUSH_SEQ_NUM_START
  5786. * Bits 5:0
  5787. * Purpose: Indicate the start of a series of MPDUs to flush
  5788. * Not all MPDUs within this series are necessarily valid - the host
  5789. * must check each sequence number within this range to see if the
  5790. * corresponding MPDU is actually present.
  5791. * This field is only valid if the FV bit is set.
  5792. * Value:
  5793. * The sequence number for the first MPDUs to check to flush.
  5794. * The sequence number is masked by 0x3f.
  5795. * - FLUSH_SEQ_NUM_END
  5796. * Bits 11:6
  5797. * Purpose: Indicate the end of a series of MPDUs to flush
  5798. * Value:
  5799. * The sequence number one larger than the sequence number of the
  5800. * last MPDU to check to flush.
  5801. * The sequence number is masked by 0x3f.
  5802. * Not all MPDUs within this series are necessarily valid - the host
  5803. * must check each sequence number within this range to see if the
  5804. * corresponding MPDU is actually present.
  5805. * This field is only valid if the FV bit is set.
  5806. * - REL_SEQ_NUM_START
  5807. * Bits 17:12
  5808. * Purpose: Indicate the start of a series of MPDUs to release.
  5809. * All MPDUs within this series are present and valid - the host
  5810. * need not check each sequence number within this range to see if
  5811. * the corresponding MPDU is actually present.
  5812. * This field is only valid if the RV bit is set.
  5813. * Value:
  5814. * The sequence number for the first MPDUs to check to release.
  5815. * The sequence number is masked by 0x3f.
  5816. * - REL_SEQ_NUM_END
  5817. * Bits 23:18
  5818. * Purpose: Indicate the end of a series of MPDUs to release.
  5819. * Value:
  5820. * The sequence number one larger than the sequence number of the
  5821. * last MPDU to check to release.
  5822. * The sequence number is masked by 0x3f.
  5823. * All MPDUs within this series are present and valid - the host
  5824. * need not check each sequence number within this range to see if
  5825. * the corresponding MPDU is actually present.
  5826. * This field is only valid if the RV bit is set.
  5827. * - NUM_MPDU_RANGES
  5828. * Bits 31:24
  5829. * Purpose: Indicate how many ranges of MPDUs are present.
  5830. * Each MPDU range consists of a series of contiguous MPDUs within the
  5831. * rx frame sequence which all have the same MPDU status.
  5832. * Value: 1-63 (typically a small number, like 1-3)
  5833. *
  5834. * Rx PPDU descriptor fields:
  5835. * - RSSI_CMB
  5836. * Bits 7:0
  5837. * Purpose: Combined RSSI from all active rx chains, across the active
  5838. * bandwidth.
  5839. * Value: RSSI dB units w.r.t. noise floor
  5840. * - TIMESTAMP_SUBMICROSEC
  5841. * Bits 15:8
  5842. * Purpose: high-resolution timestamp
  5843. * Value:
  5844. * Sub-microsecond time of PPDU reception.
  5845. * This timestamp ranges from [0,MAC clock MHz).
  5846. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5847. * to form a high-resolution, large range rx timestamp.
  5848. * - PHY_ERR_CODE
  5849. * Bits 23:16
  5850. * Purpose:
  5851. * If the rx frame processing resulted in a PHY error, indicate what
  5852. * type of rx PHY error occurred.
  5853. * Value:
  5854. * This field is valid if the "P" (PHY_ERR) flag is set.
  5855. * TBD: document/specify the values for this field
  5856. * - PHY_ERR
  5857. * Bit 24
  5858. * Purpose: indicate whether the rx PPDU had a PHY error
  5859. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5860. * - LEGACY_RATE
  5861. * Bits 28:25
  5862. * Purpose:
  5863. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5864. * specify which rate was used.
  5865. * Value:
  5866. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5867. * flag.
  5868. * If LEGACY_RATE_SEL is 0:
  5869. * 0x8: OFDM 48 Mbps
  5870. * 0x9: OFDM 24 Mbps
  5871. * 0xA: OFDM 12 Mbps
  5872. * 0xB: OFDM 6 Mbps
  5873. * 0xC: OFDM 54 Mbps
  5874. * 0xD: OFDM 36 Mbps
  5875. * 0xE: OFDM 18 Mbps
  5876. * 0xF: OFDM 9 Mbps
  5877. * If LEGACY_RATE_SEL is 1:
  5878. * 0x8: CCK 11 Mbps long preamble
  5879. * 0x9: CCK 5.5 Mbps long preamble
  5880. * 0xA: CCK 2 Mbps long preamble
  5881. * 0xB: CCK 1 Mbps long preamble
  5882. * 0xC: CCK 11 Mbps short preamble
  5883. * 0xD: CCK 5.5 Mbps short preamble
  5884. * 0xE: CCK 2 Mbps short preamble
  5885. * - LEGACY_RATE_SEL
  5886. * Bit 29
  5887. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5888. * Value:
  5889. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5890. * used a legacy rate.
  5891. * 0 -> OFDM, 1 -> CCK
  5892. * - END_VALID
  5893. * Bit 30
  5894. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5895. * the start of the PPDU are valid. Specifically, the following
  5896. * fields are only valid if END_VALID is set:
  5897. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5898. * TIMESTAMP_SUBMICROSEC
  5899. * Value:
  5900. * 0 -> rx PPDU desc end fields are not valid
  5901. * 1 -> rx PPDU desc end fields are valid
  5902. * - START_VALID
  5903. * Bit 31
  5904. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5905. * the end of the PPDU are valid. Specifically, the following
  5906. * fields are only valid if START_VALID is set:
  5907. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5908. * VHT-SIG-A
  5909. * Value:
  5910. * 0 -> rx PPDU desc start fields are not valid
  5911. * 1 -> rx PPDU desc start fields are valid
  5912. * - RSSI0_PRI20
  5913. * Bits 7:0
  5914. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5915. * Value: RSSI dB units w.r.t. noise floor
  5916. *
  5917. * - RSSI0_EXT20
  5918. * Bits 7:0
  5919. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5920. * (if the rx bandwidth was >= 40 MHz)
  5921. * Value: RSSI dB units w.r.t. noise floor
  5922. * - RSSI0_EXT40
  5923. * Bits 7:0
  5924. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5925. * (if the rx bandwidth was >= 80 MHz)
  5926. * Value: RSSI dB units w.r.t. noise floor
  5927. * - RSSI0_EXT80
  5928. * Bits 7:0
  5929. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5930. * (if the rx bandwidth was >= 160 MHz)
  5931. * Value: RSSI dB units w.r.t. noise floor
  5932. *
  5933. * - RSSI1_PRI20
  5934. * Bits 7:0
  5935. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5936. * Value: RSSI dB units w.r.t. noise floor
  5937. * - RSSI1_EXT20
  5938. * Bits 7:0
  5939. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5940. * (if the rx bandwidth was >= 40 MHz)
  5941. * Value: RSSI dB units w.r.t. noise floor
  5942. * - RSSI1_EXT40
  5943. * Bits 7:0
  5944. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5945. * (if the rx bandwidth was >= 80 MHz)
  5946. * Value: RSSI dB units w.r.t. noise floor
  5947. * - RSSI1_EXT80
  5948. * Bits 7:0
  5949. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5950. * (if the rx bandwidth was >= 160 MHz)
  5951. * Value: RSSI dB units w.r.t. noise floor
  5952. *
  5953. * - RSSI2_PRI20
  5954. * Bits 7:0
  5955. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5956. * Value: RSSI dB units w.r.t. noise floor
  5957. * - RSSI2_EXT20
  5958. * Bits 7:0
  5959. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5960. * (if the rx bandwidth was >= 40 MHz)
  5961. * Value: RSSI dB units w.r.t. noise floor
  5962. * - RSSI2_EXT40
  5963. * Bits 7:0
  5964. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5965. * (if the rx bandwidth was >= 80 MHz)
  5966. * Value: RSSI dB units w.r.t. noise floor
  5967. * - RSSI2_EXT80
  5968. * Bits 7:0
  5969. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5970. * (if the rx bandwidth was >= 160 MHz)
  5971. * Value: RSSI dB units w.r.t. noise floor
  5972. *
  5973. * - RSSI3_PRI20
  5974. * Bits 7:0
  5975. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5976. * Value: RSSI dB units w.r.t. noise floor
  5977. * - RSSI3_EXT20
  5978. * Bits 7:0
  5979. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5980. * (if the rx bandwidth was >= 40 MHz)
  5981. * Value: RSSI dB units w.r.t. noise floor
  5982. * - RSSI3_EXT40
  5983. * Bits 7:0
  5984. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5985. * (if the rx bandwidth was >= 80 MHz)
  5986. * Value: RSSI dB units w.r.t. noise floor
  5987. * - RSSI3_EXT80
  5988. * Bits 7:0
  5989. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5990. * (if the rx bandwidth was >= 160 MHz)
  5991. * Value: RSSI dB units w.r.t. noise floor
  5992. *
  5993. * - TSF32
  5994. * Bits 31:0
  5995. * Purpose: specify the time the rx PPDU was received, in TSF units
  5996. * Value: 32 LSBs of the TSF
  5997. * - TIMESTAMP_MICROSEC
  5998. * Bits 31:0
  5999. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6000. * Value: PPDU rx time, in microseconds
  6001. * - VHT_SIG_A1
  6002. * Bits 23:0
  6003. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6004. * from the rx PPDU
  6005. * Value:
  6006. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6007. * VHT-SIG-A1 data.
  6008. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6009. * first 24 bits of the HT-SIG data.
  6010. * Otherwise, this field is invalid.
  6011. * Refer to the the 802.11 protocol for the definition of the
  6012. * HT-SIG and VHT-SIG-A1 fields
  6013. * - VHT_SIG_A2
  6014. * Bits 23:0
  6015. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6016. * from the rx PPDU
  6017. * Value:
  6018. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6019. * VHT-SIG-A2 data.
  6020. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6021. * last 24 bits of the HT-SIG data.
  6022. * Otherwise, this field is invalid.
  6023. * Refer to the the 802.11 protocol for the definition of the
  6024. * HT-SIG and VHT-SIG-A2 fields
  6025. * - PREAMBLE_TYPE
  6026. * Bits 31:24
  6027. * Purpose: indicate the PHY format of the received burst
  6028. * Value:
  6029. * 0x4: Legacy (OFDM/CCK)
  6030. * 0x8: HT
  6031. * 0x9: HT with TxBF
  6032. * 0xC: VHT
  6033. * 0xD: VHT with TxBF
  6034. * - SERVICE
  6035. * Bits 31:24
  6036. * Purpose: TBD
  6037. * Value: TBD
  6038. *
  6039. * Rx MSDU descriptor fields:
  6040. * - FW_RX_DESC_BYTES
  6041. * Bits 15:0
  6042. * Purpose: Indicate how many bytes in the Rx indication are used for
  6043. * FW Rx descriptors
  6044. *
  6045. * Payload fields:
  6046. * - MPDU_COUNT
  6047. * Bits 7:0
  6048. * Purpose: Indicate how many sequential MPDUs share the same status.
  6049. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6050. * - MPDU_STATUS
  6051. * Bits 15:8
  6052. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6053. * received successfully.
  6054. * Value:
  6055. * 0x1: success
  6056. * 0x2: FCS error
  6057. * 0x3: duplicate error
  6058. * 0x4: replay error
  6059. * 0x5: invalid peer
  6060. */
  6061. /* header fields */
  6062. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6063. #define HTT_RX_IND_EXT_TID_S 8
  6064. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6065. #define HTT_RX_IND_FLUSH_VALID_S 13
  6066. #define HTT_RX_IND_REL_VALID_M 0x4000
  6067. #define HTT_RX_IND_REL_VALID_S 14
  6068. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6069. #define HTT_RX_IND_PEER_ID_S 16
  6070. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6071. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6072. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6073. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6074. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6075. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6076. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6077. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6078. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6079. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6080. /* rx PPDU descriptor fields */
  6081. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6082. #define HTT_RX_IND_RSSI_CMB_S 0
  6083. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6084. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6085. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6086. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6087. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6088. #define HTT_RX_IND_PHY_ERR_S 24
  6089. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6090. #define HTT_RX_IND_LEGACY_RATE_S 25
  6091. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6092. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6093. #define HTT_RX_IND_END_VALID_M 0x40000000
  6094. #define HTT_RX_IND_END_VALID_S 30
  6095. #define HTT_RX_IND_START_VALID_M 0x80000000
  6096. #define HTT_RX_IND_START_VALID_S 31
  6097. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6098. #define HTT_RX_IND_RSSI_PRI20_S 0
  6099. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6100. #define HTT_RX_IND_RSSI_EXT20_S 8
  6101. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6102. #define HTT_RX_IND_RSSI_EXT40_S 16
  6103. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6104. #define HTT_RX_IND_RSSI_EXT80_S 24
  6105. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6106. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6107. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6108. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6109. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6110. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6111. #define HTT_RX_IND_SERVICE_M 0xff000000
  6112. #define HTT_RX_IND_SERVICE_S 24
  6113. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6114. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6115. /* rx MSDU descriptor fields */
  6116. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6117. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6118. /* payload fields */
  6119. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6120. #define HTT_RX_IND_MPDU_COUNT_S 0
  6121. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6122. #define HTT_RX_IND_MPDU_STATUS_S 8
  6123. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6124. do { \
  6125. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6126. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6127. } while (0)
  6128. #define HTT_RX_IND_EXT_TID_GET(word) \
  6129. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6130. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6131. do { \
  6132. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6133. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6134. } while (0)
  6135. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6136. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6137. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6138. do { \
  6139. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6140. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6141. } while (0)
  6142. #define HTT_RX_IND_REL_VALID_GET(word) \
  6143. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6144. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6145. do { \
  6146. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6147. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6148. } while (0)
  6149. #define HTT_RX_IND_PEER_ID_GET(word) \
  6150. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6151. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6152. do { \
  6153. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6154. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6155. } while (0)
  6156. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6157. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6158. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6159. do { \
  6160. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6161. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6162. } while (0)
  6163. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6164. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6165. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6166. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6167. do { \
  6168. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6169. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6170. } while (0)
  6171. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6172. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6173. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6174. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6175. do { \
  6176. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6177. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6178. } while (0)
  6179. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6180. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6181. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6182. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6183. do { \
  6184. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6185. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6186. } while (0)
  6187. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6188. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6189. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6190. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6191. do { \
  6192. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6193. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6194. } while (0)
  6195. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6196. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6197. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6198. /* FW rx PPDU descriptor fields */
  6199. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6200. do { \
  6201. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6202. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6203. } while (0)
  6204. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6205. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6206. HTT_RX_IND_RSSI_CMB_S)
  6207. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6208. do { \
  6209. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6210. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6211. } while (0)
  6212. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6213. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6214. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6215. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6216. do { \
  6217. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6218. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6219. } while (0)
  6220. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6221. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6222. HTT_RX_IND_PHY_ERR_CODE_S)
  6223. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6224. do { \
  6225. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6226. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6227. } while (0)
  6228. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6229. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6230. HTT_RX_IND_PHY_ERR_S)
  6231. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6232. do { \
  6233. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6234. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6235. } while (0)
  6236. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6237. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6238. HTT_RX_IND_LEGACY_RATE_S)
  6239. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6240. do { \
  6241. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6242. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6243. } while (0)
  6244. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6245. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6246. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6247. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6248. do { \
  6249. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6250. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6251. } while (0)
  6252. #define HTT_RX_IND_END_VALID_GET(word) \
  6253. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6254. HTT_RX_IND_END_VALID_S)
  6255. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6256. do { \
  6257. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6258. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6259. } while (0)
  6260. #define HTT_RX_IND_START_VALID_GET(word) \
  6261. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6262. HTT_RX_IND_START_VALID_S)
  6263. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6264. do { \
  6265. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6266. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6267. } while (0)
  6268. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6269. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6270. HTT_RX_IND_RSSI_PRI20_S)
  6271. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6272. do { \
  6273. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6274. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6275. } while (0)
  6276. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6277. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6278. HTT_RX_IND_RSSI_EXT20_S)
  6279. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6280. do { \
  6281. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6282. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6283. } while (0)
  6284. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6285. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6286. HTT_RX_IND_RSSI_EXT40_S)
  6287. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6288. do { \
  6289. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6290. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6291. } while (0)
  6292. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6293. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6294. HTT_RX_IND_RSSI_EXT80_S)
  6295. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6296. do { \
  6297. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6298. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6299. } while (0)
  6300. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6301. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6302. HTT_RX_IND_VHT_SIG_A1_S)
  6303. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6304. do { \
  6305. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6306. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6307. } while (0)
  6308. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6309. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6310. HTT_RX_IND_VHT_SIG_A2_S)
  6311. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6312. do { \
  6313. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6314. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6315. } while (0)
  6316. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6317. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6318. HTT_RX_IND_PREAMBLE_TYPE_S)
  6319. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6320. do { \
  6321. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6322. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6323. } while (0)
  6324. #define HTT_RX_IND_SERVICE_GET(word) \
  6325. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6326. HTT_RX_IND_SERVICE_S)
  6327. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6328. do { \
  6329. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6330. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6331. } while (0)
  6332. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6333. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6334. HTT_RX_IND_SA_ANT_MATRIX_S)
  6335. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6336. do { \
  6337. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6338. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6339. } while (0)
  6340. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6341. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6342. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6343. do { \
  6344. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6345. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6346. } while (0)
  6347. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6348. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6349. #define HTT_RX_IND_HL_BYTES \
  6350. (HTT_RX_IND_HDR_BYTES + \
  6351. 4 /* single FW rx MSDU descriptor */ + \
  6352. 4 /* single MPDU range information element */)
  6353. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6354. /* Could we use one macro entry? */
  6355. #define HTT_WORD_SET(word, field, value) \
  6356. do { \
  6357. HTT_CHECK_SET_VAL(field, value); \
  6358. (word) |= ((value) << field ## _S); \
  6359. } while (0)
  6360. #define HTT_WORD_GET(word, field) \
  6361. (((word) & field ## _M) >> field ## _S)
  6362. PREPACK struct hl_htt_rx_ind_base {
  6363. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6364. } POSTPACK;
  6365. /*
  6366. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6367. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6368. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6369. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6370. * htt_rx_ind_hl_rx_desc_t.
  6371. */
  6372. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6373. struct htt_rx_ind_hl_rx_desc_t {
  6374. A_UINT8 ver;
  6375. A_UINT8 len;
  6376. struct {
  6377. A_UINT8
  6378. first_msdu: 1,
  6379. last_msdu: 1,
  6380. c3_failed: 1,
  6381. c4_failed: 1,
  6382. ipv6: 1,
  6383. tcp: 1,
  6384. udp: 1,
  6385. reserved: 1;
  6386. } flags;
  6387. /* NOTE: no reserved space - don't append any new fields here */
  6388. };
  6389. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6390. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6391. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6392. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6393. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6394. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6395. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6396. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6397. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6398. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6399. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6400. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6401. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6402. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6403. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6404. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6405. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6406. /* This structure is used in HL, the basic descriptor information
  6407. * used by host. the structure is translated by FW from HW desc
  6408. * or generated by FW. But in HL monitor mode, the host would use
  6409. * the same structure with LL.
  6410. */
  6411. PREPACK struct hl_htt_rx_desc_base {
  6412. A_UINT32
  6413. seq_num:12,
  6414. encrypted:1,
  6415. chan_info_present:1,
  6416. resv0:2,
  6417. mcast_bcast:1,
  6418. fragment:1,
  6419. key_id_oct:8,
  6420. resv1:6;
  6421. A_UINT32
  6422. pn_31_0;
  6423. union {
  6424. struct {
  6425. A_UINT16 pn_47_32;
  6426. A_UINT16 pn_63_48;
  6427. } pn16;
  6428. A_UINT32 pn_63_32;
  6429. } u0;
  6430. A_UINT32
  6431. pn_95_64;
  6432. A_UINT32
  6433. pn_127_96;
  6434. } POSTPACK;
  6435. /*
  6436. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6437. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6438. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6439. * Please see htt_chan_change_t for description of the fields.
  6440. */
  6441. PREPACK struct htt_chan_info_t
  6442. {
  6443. A_UINT32 primary_chan_center_freq_mhz: 16,
  6444. contig_chan1_center_freq_mhz: 16;
  6445. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6446. phy_mode: 8,
  6447. reserved: 8;
  6448. } POSTPACK;
  6449. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6450. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6451. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6452. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6453. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6454. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6455. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6456. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6457. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6458. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6459. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6460. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6461. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6462. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6463. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6464. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6465. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6466. /* Channel information */
  6467. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6468. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6469. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6470. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6471. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6472. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6473. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6474. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6475. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6476. do { \
  6477. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6478. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6479. } while (0)
  6480. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6481. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6482. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6483. do { \
  6484. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6485. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6486. } while (0)
  6487. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6488. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6489. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6490. do { \
  6491. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6492. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6493. } while (0)
  6494. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6495. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6496. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6497. do { \
  6498. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6499. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6500. } while (0)
  6501. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6502. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6503. /*
  6504. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  6505. * @brief target -> host message definition for FW offloaded pkts
  6506. *
  6507. * @details
  6508. * The following field definitions describe the format of the firmware
  6509. * offload deliver message sent from the target to the host.
  6510. *
  6511. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  6512. *
  6513. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  6514. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  6515. * | reserved_1 | msg type |
  6516. * |--------------------------------------------------------------------------|
  6517. * | phy_timestamp_l32 |
  6518. * |--------------------------------------------------------------------------|
  6519. * | WORD2 (see below) |
  6520. * |--------------------------------------------------------------------------|
  6521. * | seqno | framectrl |
  6522. * |--------------------------------------------------------------------------|
  6523. * | reserved_3 | vdev_id | tid_num|
  6524. * |--------------------------------------------------------------------------|
  6525. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  6526. * |--------------------------------------------------------------------------|
  6527. *
  6528. * where:
  6529. * STAT = status
  6530. * F = format (802.3 vs. 802.11)
  6531. *
  6532. * definition for word 2
  6533. *
  6534. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  6535. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  6536. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  6537. * |--------------------------------------------------------------------------|
  6538. *
  6539. * where:
  6540. * PR = preamble
  6541. * BF = beamformed
  6542. */
  6543. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  6544. {
  6545. A_UINT32 /* word 0 */
  6546. msg_type:8, /* [ 7: 0] */
  6547. reserved_1:24; /* [31: 8] */
  6548. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  6549. A_UINT32 /* word 2 */
  6550. /* preamble:
  6551. * 0-OFDM,
  6552. * 1-CCk,
  6553. * 2-HT,
  6554. * 3-VHT
  6555. */
  6556. preamble: 2, /* [1:0] */
  6557. /* mcs:
  6558. * In case of HT preamble interpret
  6559. * MCS along with NSS.
  6560. * Valid values for HT are 0 to 7.
  6561. * HT mcs 0 with NSS 2 is mcs 8.
  6562. * Valid values for VHT are 0 to 9.
  6563. */
  6564. mcs: 4, /* [5:2] */
  6565. /* rate:
  6566. * This is applicable only for
  6567. * CCK and OFDM preamble type
  6568. * rate 0: OFDM 48 Mbps,
  6569. * 1: OFDM 24 Mbps,
  6570. * 2: OFDM 12 Mbps
  6571. * 3: OFDM 6 Mbps
  6572. * 4: OFDM 54 Mbps
  6573. * 5: OFDM 36 Mbps
  6574. * 6: OFDM 18 Mbps
  6575. * 7: OFDM 9 Mbps
  6576. * rate 0: CCK 11 Mbps Long
  6577. * 1: CCK 5.5 Mbps Long
  6578. * 2: CCK 2 Mbps Long
  6579. * 3: CCK 1 Mbps Long
  6580. * 4: CCK 11 Mbps Short
  6581. * 5: CCK 5.5 Mbps Short
  6582. * 6: CCK 2 Mbps Short
  6583. */
  6584. rate : 3, /* [ 8: 6] */
  6585. rssi : 8, /* [16: 9] units=dBm */
  6586. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  6587. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  6588. stbc : 1, /* [22] */
  6589. sgi : 1, /* [23] */
  6590. ldpc : 1, /* [24] */
  6591. beamformed: 1, /* [25] */
  6592. reserved_2: 6; /* [31:26] */
  6593. A_UINT32 /* word 3 */
  6594. framectrl:16, /* [15: 0] */
  6595. seqno:16; /* [31:16] */
  6596. A_UINT32 /* word 4 */
  6597. tid_num:5, /* [ 4: 0] actual TID number */
  6598. vdev_id:8, /* [12: 5] */
  6599. reserved_3:19; /* [31:13] */
  6600. A_UINT32 /* word 5 */
  6601. /* status:
  6602. * 0: tx_ok
  6603. * 1: retry
  6604. * 2: drop
  6605. * 3: filtered
  6606. * 4: abort
  6607. * 5: tid delete
  6608. * 6: sw abort
  6609. * 7: dropped by peer migration
  6610. */
  6611. status:3, /* [2:0] */
  6612. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  6613. tx_mpdu_bytes:16, /* [19:4] */
  6614. reserved_4:12; /* [31:20] */
  6615. } POSTPACK;
  6616. /* FW offload deliver ind message header fields */
  6617. /* DWORD one */
  6618. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  6619. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  6620. /* DWORD two */
  6621. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  6622. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  6623. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  6624. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  6625. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  6626. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  6627. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  6628. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  6629. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  6630. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  6631. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  6632. #define HTT_FW_OFFLOAD_IND_BW_S 19
  6633. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  6634. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  6635. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  6636. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  6637. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  6638. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  6639. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  6640. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  6641. /* DWORD three*/
  6642. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  6643. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  6644. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  6645. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  6646. /* DWORD four */
  6647. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  6648. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  6649. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  6650. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  6651. /* DWORD five */
  6652. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  6653. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  6654. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  6655. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  6656. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  6657. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  6658. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  6659. do { \
  6660. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  6661. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  6662. } while (0)
  6663. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  6664. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  6665. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  6666. do { \
  6667. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  6668. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  6669. } while (0)
  6670. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  6671. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  6672. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  6673. do { \
  6674. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  6675. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  6676. } while (0)
  6677. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  6678. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  6679. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  6680. do { \
  6681. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  6682. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  6683. } while (0)
  6684. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  6685. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  6686. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  6687. do { \
  6688. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  6689. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  6690. } while (0)
  6691. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  6692. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  6693. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  6694. do { \
  6695. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  6696. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  6697. } while (0)
  6698. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  6699. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  6700. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  6701. do { \
  6702. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  6703. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  6704. } while (0)
  6705. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  6706. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  6707. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  6708. do { \
  6709. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  6710. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  6711. } while (0)
  6712. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  6713. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  6714. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  6715. do { \
  6716. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  6717. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  6718. } while (0)
  6719. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  6720. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  6721. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  6722. do { \
  6723. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  6724. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  6725. } while (0)
  6726. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  6727. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  6728. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  6729. do { \
  6730. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  6731. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  6732. } while (0)
  6733. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  6734. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  6735. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  6736. do { \
  6737. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  6738. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  6739. } while (0)
  6740. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  6741. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  6742. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  6743. do { \
  6744. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  6745. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  6746. } while (0)
  6747. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  6748. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  6749. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  6750. do { \
  6751. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  6752. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  6753. } while (0)
  6754. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  6755. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  6756. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  6757. do { \
  6758. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  6759. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  6760. } while (0)
  6761. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  6762. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  6763. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  6764. do { \
  6765. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  6766. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  6767. } while (0)
  6768. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  6769. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  6770. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  6771. do { \
  6772. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  6773. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  6774. } while (0)
  6775. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  6776. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  6777. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  6778. do { \
  6779. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  6780. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  6781. } while (0)
  6782. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  6783. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  6784. /*
  6785. * @brief target -> host rx reorder flush message definition
  6786. *
  6787. * @details
  6788. * The following field definitions describe the format of the rx flush
  6789. * message sent from the target to the host.
  6790. * The message consists of a 4-octet header, followed by one or more
  6791. * 4-octet payload information elements.
  6792. *
  6793. * |31 24|23 8|7 0|
  6794. * |--------------------------------------------------------------|
  6795. * | TID | peer ID | msg type |
  6796. * |--------------------------------------------------------------|
  6797. * | seq num end | seq num start | MPDU status | reserved |
  6798. * |--------------------------------------------------------------|
  6799. * First DWORD:
  6800. * - MSG_TYPE
  6801. * Bits 7:0
  6802. * Purpose: identifies this as an rx flush message
  6803. * Value: 0x2
  6804. * - PEER_ID
  6805. * Bits 23:8 (only bits 18:8 actually used)
  6806. * Purpose: identify which peer's rx data is being flushed
  6807. * Value: (rx) peer ID
  6808. * - TID
  6809. * Bits 31:24 (only bits 27:24 actually used)
  6810. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6811. * Value: traffic identifier
  6812. * Second DWORD:
  6813. * - MPDU_STATUS
  6814. * Bits 15:8
  6815. * Purpose:
  6816. * Indicate whether the flushed MPDUs should be discarded or processed.
  6817. * Value:
  6818. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6819. * stages of rx processing
  6820. * other: discard the MPDUs
  6821. * It is anticipated that flush messages will always have
  6822. * MPDU status == 1, but the status flag is included for
  6823. * flexibility.
  6824. * - SEQ_NUM_START
  6825. * Bits 23:16
  6826. * Purpose:
  6827. * Indicate the start of a series of consecutive MPDUs being flushed.
  6828. * Not all MPDUs within this range are necessarily valid - the host
  6829. * must check each sequence number within this range to see if the
  6830. * corresponding MPDU is actually present.
  6831. * Value:
  6832. * The sequence number for the first MPDU in the sequence.
  6833. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6834. * - SEQ_NUM_END
  6835. * Bits 30:24
  6836. * Purpose:
  6837. * Indicate the end of a series of consecutive MPDUs being flushed.
  6838. * Value:
  6839. * The sequence number one larger than the sequence number of the
  6840. * last MPDU being flushed.
  6841. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6842. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6843. * are to be released for further rx processing.
  6844. * Not all MPDUs within this range are necessarily valid - the host
  6845. * must check each sequence number within this range to see if the
  6846. * corresponding MPDU is actually present.
  6847. */
  6848. /* first DWORD */
  6849. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6850. #define HTT_RX_FLUSH_PEER_ID_S 8
  6851. #define HTT_RX_FLUSH_TID_M 0xff000000
  6852. #define HTT_RX_FLUSH_TID_S 24
  6853. /* second DWORD */
  6854. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6855. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6856. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6857. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6858. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6859. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6860. #define HTT_RX_FLUSH_BYTES 8
  6861. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6862. do { \
  6863. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6864. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6865. } while (0)
  6866. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6867. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6868. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6869. do { \
  6870. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6871. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6872. } while (0)
  6873. #define HTT_RX_FLUSH_TID_GET(word) \
  6874. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6875. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6876. do { \
  6877. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6878. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6879. } while (0)
  6880. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6881. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6882. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6883. do { \
  6884. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6885. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6886. } while (0)
  6887. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6888. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6889. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6890. do { \
  6891. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6892. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6893. } while (0)
  6894. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6895. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6896. /*
  6897. * @brief target -> host rx pn check indication message
  6898. *
  6899. * @details
  6900. * The following field definitions describe the format of the Rx PN check
  6901. * indication message sent from the target to the host.
  6902. * The message consists of a 4-octet header, followed by the start and
  6903. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6904. * IE is one octet containing the sequence number that failed the PN
  6905. * check.
  6906. *
  6907. * |31 24|23 8|7 0|
  6908. * |--------------------------------------------------------------|
  6909. * | TID | peer ID | msg type |
  6910. * |--------------------------------------------------------------|
  6911. * | Reserved | PN IE count | seq num end | seq num start|
  6912. * |--------------------------------------------------------------|
  6913. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6914. * |--------------------------------------------------------------|
  6915. * First DWORD:
  6916. * - MSG_TYPE
  6917. * Bits 7:0
  6918. * Purpose: Identifies this as an rx pn check indication message
  6919. * Value: 0x2
  6920. * - PEER_ID
  6921. * Bits 23:8 (only bits 18:8 actually used)
  6922. * Purpose: identify which peer
  6923. * Value: (rx) peer ID
  6924. * - TID
  6925. * Bits 31:24 (only bits 27:24 actually used)
  6926. * Purpose: identify traffic identifier
  6927. * Value: traffic identifier
  6928. * Second DWORD:
  6929. * - SEQ_NUM_START
  6930. * Bits 7:0
  6931. * Purpose:
  6932. * Indicates the starting sequence number of the MPDU in this
  6933. * series of MPDUs that went though PN check.
  6934. * Value:
  6935. * The sequence number for the first MPDU in the sequence.
  6936. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6937. * - SEQ_NUM_END
  6938. * Bits 15:8
  6939. * Purpose:
  6940. * Indicates the ending sequence number of the MPDU in this
  6941. * series of MPDUs that went though PN check.
  6942. * Value:
  6943. * The sequence number one larger then the sequence number of the last
  6944. * MPDU being flushed.
  6945. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6946. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6947. * for invalid PN numbers and are ready to be released for further processing.
  6948. * Not all MPDUs within this range are necessarily valid - the host
  6949. * must check each sequence number within this range to see if the
  6950. * corresponding MPDU is actually present.
  6951. * - PN_IE_COUNT
  6952. * Bits 23:16
  6953. * Purpose:
  6954. * Used to determine the variable number of PN information elements in this
  6955. * message
  6956. *
  6957. * PN information elements:
  6958. * - PN_IE_x-
  6959. * Purpose:
  6960. * Each PN information element contains the sequence number of the MPDU that
  6961. * has failed the target PN check.
  6962. * Value:
  6963. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6964. * that failed the PN check.
  6965. */
  6966. /* first DWORD */
  6967. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6968. #define HTT_RX_PN_IND_PEER_ID_S 8
  6969. #define HTT_RX_PN_IND_TID_M 0xff000000
  6970. #define HTT_RX_PN_IND_TID_S 24
  6971. /* second DWORD */
  6972. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6973. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6974. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6975. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6976. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6977. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6978. #define HTT_RX_PN_IND_BYTES 8
  6979. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6980. do { \
  6981. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6982. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6983. } while (0)
  6984. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6985. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6986. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6987. do { \
  6988. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6989. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6990. } while (0)
  6991. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6992. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6993. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6994. do { \
  6995. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6996. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6997. } while (0)
  6998. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6999. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  7000. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  7001. do { \
  7002. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  7003. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  7004. } while (0)
  7005. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  7006. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  7007. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  7008. do { \
  7009. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  7010. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  7011. } while (0)
  7012. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  7013. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  7014. /*
  7015. * @brief target -> host rx offload deliver message for LL system
  7016. *
  7017. * @details
  7018. * In a low latency system this message is sent whenever the offload
  7019. * manager flushes out the packets it has coalesced in its coalescing buffer.
  7020. * The DMA of the actual packets into host memory is done before sending out
  7021. * this message. This message indicates only how many MSDUs to reap. The
  7022. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  7023. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  7024. * DMA'd by the MAC directly into host memory these packets do not contain
  7025. * the MAC descriptors in the header portion of the packet. Instead they contain
  7026. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  7027. * message, the packets are delivered directly to the NW stack without going
  7028. * through the regular reorder buffering and PN checking path since it has
  7029. * already been done in target.
  7030. *
  7031. * |31 24|23 16|15 8|7 0|
  7032. * |-----------------------------------------------------------------------|
  7033. * | Total MSDU count | reserved | msg type |
  7034. * |-----------------------------------------------------------------------|
  7035. *
  7036. * @brief target -> host rx offload deliver message for HL system
  7037. *
  7038. * @details
  7039. * In a high latency system this message is sent whenever the offload manager
  7040. * flushes out the packets it has coalesced in its coalescing buffer. The
  7041. * actual packets are also carried along with this message. When the host
  7042. * receives this message, it is expected to deliver these packets to the NW
  7043. * stack directly instead of routing them through the reorder buffering and
  7044. * PN checking path since it has already been done in target.
  7045. *
  7046. * |31 24|23 16|15 8|7 0|
  7047. * |-----------------------------------------------------------------------|
  7048. * | Total MSDU count | reserved | msg type |
  7049. * |-----------------------------------------------------------------------|
  7050. * | peer ID | MSDU length |
  7051. * |-----------------------------------------------------------------------|
  7052. * | MSDU payload | FW Desc | tid | vdev ID |
  7053. * |-----------------------------------------------------------------------|
  7054. * | MSDU payload contd. |
  7055. * |-----------------------------------------------------------------------|
  7056. * | peer ID | MSDU length |
  7057. * |-----------------------------------------------------------------------|
  7058. * | MSDU payload | FW Desc | tid | vdev ID |
  7059. * |-----------------------------------------------------------------------|
  7060. * | MSDU payload contd. |
  7061. * |-----------------------------------------------------------------------|
  7062. *
  7063. */
  7064. /* first DWORD */
  7065. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  7066. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  7067. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  7068. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  7069. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  7070. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  7071. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  7072. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  7073. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  7074. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  7075. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  7076. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  7077. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  7078. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  7079. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  7080. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  7081. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  7082. do { \
  7083. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  7084. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  7085. } while (0)
  7086. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  7087. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  7088. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  7089. do { \
  7090. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  7091. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  7092. } while (0)
  7093. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  7094. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  7095. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  7096. do { \
  7097. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  7098. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  7099. } while (0)
  7100. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  7101. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  7102. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  7103. do { \
  7104. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  7105. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  7106. } while (0)
  7107. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  7108. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  7109. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  7110. do { \
  7111. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  7112. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  7113. } while (0)
  7114. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  7115. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  7116. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  7117. do { \
  7118. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  7119. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  7120. } while (0)
  7121. /**
  7122. * @brief target -> host rx peer map/unmap message definition
  7123. *
  7124. * @details
  7125. * The following diagram shows the format of the rx peer map message sent
  7126. * from the target to the host. This layout assumes the target operates
  7127. * as little-endian.
  7128. *
  7129. * This message always contains a SW peer ID. The main purpose of the
  7130. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7131. * with, so that the host can use that peer ID to determine which peer
  7132. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7133. * other purposes, such as identifying during tx completions which peer
  7134. * the tx frames in question were transmitted to.
  7135. *
  7136. * In certain generations of chips, the peer map message also contains
  7137. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  7138. * to identify which peer the frame needs to be forwarded to (i.e. the
  7139. * peer assocated with the Destination MAC Address within the packet),
  7140. * and particularly which vdev needs to transmit the frame (for cases
  7141. * of inter-vdev rx --> tx forwarding).
  7142. * This DA-based peer ID that is provided for certain rx frames
  7143. * (the rx frames that need to be re-transmitted as tx frames)
  7144. * is the ID that the HW uses for referring to the peer in question,
  7145. * rather than the peer ID that the SW+FW use to refer to the peer.
  7146. *
  7147. *
  7148. * |31 24|23 16|15 8|7 0|
  7149. * |-----------------------------------------------------------------------|
  7150. * | SW peer ID | VDEV ID | msg type |
  7151. * |-----------------------------------------------------------------------|
  7152. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7153. * |-----------------------------------------------------------------------|
  7154. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  7155. * |-----------------------------------------------------------------------|
  7156. *
  7157. *
  7158. * The following diagram shows the format of the rx peer unmap message sent
  7159. * from the target to the host.
  7160. *
  7161. * |31 24|23 16|15 8|7 0|
  7162. * |-----------------------------------------------------------------------|
  7163. * | SW peer ID | VDEV ID | msg type |
  7164. * |-----------------------------------------------------------------------|
  7165. *
  7166. * The following field definitions describe the format of the rx peer map
  7167. * and peer unmap messages sent from the target to the host.
  7168. * - MSG_TYPE
  7169. * Bits 7:0
  7170. * Purpose: identifies this as an rx peer map or peer unmap message
  7171. * Value: peer map -> 0x3, peer unmap -> 0x4
  7172. * - VDEV_ID
  7173. * Bits 15:8
  7174. * Purpose: Indicates which virtual device the peer is associated
  7175. * with.
  7176. * Value: vdev ID (used in the host to look up the vdev object)
  7177. * - PEER_ID (a.k.a. SW_PEER_ID)
  7178. * Bits 31:16
  7179. * Purpose: The peer ID (index) that WAL is allocating (map) or
  7180. * freeing (unmap)
  7181. * Value: (rx) peer ID
  7182. * - MAC_ADDR_L32 (peer map only)
  7183. * Bits 31:0
  7184. * Purpose: Identifies which peer node the peer ID is for.
  7185. * Value: lower 4 bytes of peer node's MAC address
  7186. * - MAC_ADDR_U16 (peer map only)
  7187. * Bits 15:0
  7188. * Purpose: Identifies which peer node the peer ID is for.
  7189. * Value: upper 2 bytes of peer node's MAC address
  7190. * - HW_PEER_ID
  7191. * Bits 31:16
  7192. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7193. * address, so for rx frames marked for rx --> tx forwarding, the
  7194. * host can determine from the HW peer ID provided as meta-data with
  7195. * the rx frame which peer the frame is supposed to be forwarded to.
  7196. * Value: ID used by the MAC HW to identify the peer
  7197. */
  7198. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  7199. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  7200. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  7201. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  7202. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  7203. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  7204. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  7205. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  7206. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  7207. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  7208. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  7209. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  7210. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  7211. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  7212. do { \
  7213. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  7214. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  7215. } while (0)
  7216. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  7217. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  7218. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  7219. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  7220. do { \
  7221. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  7222. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  7223. } while (0)
  7224. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  7225. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  7226. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  7227. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  7228. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  7229. do { \
  7230. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  7231. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  7232. } while (0)
  7233. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  7234. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  7235. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  7236. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  7237. #define HTT_RX_PEER_MAP_BYTES 12
  7238. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  7239. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  7240. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  7241. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  7242. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  7243. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  7244. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  7245. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  7246. #define HTT_RX_PEER_UNMAP_BYTES 4
  7247. /**
  7248. * @brief target -> host rx peer map V2 message definition
  7249. *
  7250. * @details
  7251. * The following diagram shows the format of the rx peer map v2 message sent
  7252. * from the target to the host. This layout assumes the target operates
  7253. * as little-endian.
  7254. *
  7255. * This message always contains a SW peer ID. The main purpose of the
  7256. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7257. * with, so that the host can use that peer ID to determine which peer
  7258. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7259. * other purposes, such as identifying during tx completions which peer
  7260. * the tx frames in question were transmitted to.
  7261. *
  7262. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  7263. * is used during rx --> tx frame forwarding to identify which peer the
  7264. * frame needs to be forwarded to (i.e. the peer assocated with the
  7265. * Destination MAC Address within the packet), and particularly which vdev
  7266. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  7267. * This DA-based peer ID that is provided for certain rx frames
  7268. * (the rx frames that need to be re-transmitted as tx frames)
  7269. * is the ID that the HW uses for referring to the peer in question,
  7270. * rather than the peer ID that the SW+FW use to refer to the peer.
  7271. *
  7272. *
  7273. * |31 24|23 16|15 8|7 0|
  7274. * |-----------------------------------------------------------------------|
  7275. * | SW peer ID | VDEV ID | msg type |
  7276. * |-----------------------------------------------------------------------|
  7277. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7278. * |-----------------------------------------------------------------------|
  7279. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  7280. * |-----------------------------------------------------------------------|
  7281. * | Reserved_17_31 | Next Hop | AST Hash Value |
  7282. * |-----------------------------------------------------------------------|
  7283. * | Reserved_0 |
  7284. * |-----------------------------------------------------------------------|
  7285. * | Reserved_1 |
  7286. * |-----------------------------------------------------------------------|
  7287. * | Reserved_2 |
  7288. * |-----------------------------------------------------------------------|
  7289. * | Reserved_3 |
  7290. * |-----------------------------------------------------------------------|
  7291. *
  7292. *
  7293. * The following field definitions describe the format of the rx peer map v2
  7294. * messages sent from the target to the host.
  7295. * - MSG_TYPE
  7296. * Bits 7:0
  7297. * Purpose: identifies this as an rx peer map v2 message
  7298. * Value: peer map v2 -> 0x1e
  7299. * - VDEV_ID
  7300. * Bits 15:8
  7301. * Purpose: Indicates which virtual device the peer is associated with.
  7302. * Value: vdev ID (used in the host to look up the vdev object)
  7303. * - SW_PEER_ID
  7304. * Bits 31:16
  7305. * Purpose: The peer ID (index) that WAL is allocating
  7306. * Value: (rx) peer ID
  7307. * - MAC_ADDR_L32
  7308. * Bits 31:0
  7309. * Purpose: Identifies which peer node the peer ID is for.
  7310. * Value: lower 4 bytes of peer node's MAC address
  7311. * - MAC_ADDR_U16
  7312. * Bits 15:0
  7313. * Purpose: Identifies which peer node the peer ID is for.
  7314. * Value: upper 2 bytes of peer node's MAC address
  7315. * - HW_PEER_ID
  7316. * Bits 31:16
  7317. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7318. * address, so for rx frames marked for rx --> tx forwarding, the
  7319. * host can determine from the HW peer ID provided as meta-data with
  7320. * the rx frame which peer the frame is supposed to be forwarded to.
  7321. * Value: ID used by the MAC HW to identify the peer
  7322. * - AST_HASH_VALUE
  7323. * Bits 15:0
  7324. * Purpose: Indicates AST Hash value is required for the TCL AST index
  7325. * override feature.
  7326. * - NEXT_HOP
  7327. * Bit 16
  7328. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  7329. * (Wireless Distribution System).
  7330. */
  7331. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  7332. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  7333. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  7334. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  7335. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  7336. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  7337. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  7338. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  7339. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  7340. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  7341. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  7342. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  7343. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  7344. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  7345. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  7346. do { \
  7347. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  7348. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  7349. } while (0)
  7350. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  7351. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  7352. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  7353. do { \
  7354. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  7355. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  7356. } while (0)
  7357. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  7358. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  7359. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  7360. do { \
  7361. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  7362. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  7363. } while (0)
  7364. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  7365. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  7366. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  7367. do { \
  7368. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  7369. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  7370. } while (0)
  7371. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  7372. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  7373. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  7374. do { \
  7375. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7376. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7377. } while (0)
  7378. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7379. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7380. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7381. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7382. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7383. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7384. #define HTT_RX_PEER_MAP_V2_BYTES 32
  7385. /**
  7386. * @brief target -> host rx peer unmap V2 message definition
  7387. *
  7388. *
  7389. * The following diagram shows the format of the rx peer unmap message sent
  7390. * from the target to the host.
  7391. *
  7392. * |31 24|23 16|15 8|7 0|
  7393. * |-----------------------------------------------------------------------|
  7394. * | SW peer ID | VDEV ID | msg type |
  7395. * |-----------------------------------------------------------------------|
  7396. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7397. * |-----------------------------------------------------------------------|
  7398. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7399. * |-----------------------------------------------------------------------|
  7400. * | Peer Delete Duration |
  7401. * |-----------------------------------------------------------------------|
  7402. * | Reserved_0 |
  7403. * |-----------------------------------------------------------------------|
  7404. * | Reserved_1 |
  7405. * |-----------------------------------------------------------------------|
  7406. * | Reserved_2 |
  7407. * |-----------------------------------------------------------------------|
  7408. *
  7409. *
  7410. * The following field definitions describe the format of the rx peer unmap
  7411. * messages sent from the target to the host.
  7412. * - MSG_TYPE
  7413. * Bits 7:0
  7414. * Purpose: identifies this as an rx peer unmap v2 message
  7415. * Value: peer unmap v2 -> 0x1f
  7416. * - VDEV_ID
  7417. * Bits 15:8
  7418. * Purpose: Indicates which virtual device the peer is associated
  7419. * with.
  7420. * Value: vdev ID (used in the host to look up the vdev object)
  7421. * - SW_PEER_ID
  7422. * Bits 31:16
  7423. * Purpose: The peer ID (index) that WAL is freeing
  7424. * Value: (rx) peer ID
  7425. * - MAC_ADDR_L32
  7426. * Bits 31:0
  7427. * Purpose: Identifies which peer node the peer ID is for.
  7428. * Value: lower 4 bytes of peer node's MAC address
  7429. * - MAC_ADDR_U16
  7430. * Bits 15:0
  7431. * Purpose: Identifies which peer node the peer ID is for.
  7432. * Value: upper 2 bytes of peer node's MAC address
  7433. * - NEXT_HOP
  7434. * Bits 16
  7435. * Purpose: Bit indicates next_hop AST entry used for WDS
  7436. * (Wireless Distribution System).
  7437. * - PEER_DELETE_DURATION
  7438. * Bits 31:0
  7439. * Purpose: Time taken to delete peer, in msec,
  7440. * Used for monitoring / debugging PEER delete response delay
  7441. */
  7442. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7443. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7444. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7445. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7446. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7447. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7448. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7449. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7450. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7451. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7452. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7453. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7454. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7455. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7456. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7457. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7458. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7459. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7460. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7461. do { \
  7462. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7463. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7464. } while (0)
  7465. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7466. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7467. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7468. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7469. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7470. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7471. /**
  7472. * @brief target -> host message specifying security parameters
  7473. *
  7474. * @details
  7475. * The following diagram shows the format of the security specification
  7476. * message sent from the target to the host.
  7477. * This security specification message tells the host whether a PN check is
  7478. * necessary on rx data frames, and if so, how large the PN counter is.
  7479. * This message also tells the host about the security processing to apply
  7480. * to defragmented rx frames - specifically, whether a Message Integrity
  7481. * Check is required, and the Michael key to use.
  7482. *
  7483. * |31 24|23 16|15|14 8|7 0|
  7484. * |-----------------------------------------------------------------------|
  7485. * | peer ID | U| security type | msg type |
  7486. * |-----------------------------------------------------------------------|
  7487. * | Michael Key K0 |
  7488. * |-----------------------------------------------------------------------|
  7489. * | Michael Key K1 |
  7490. * |-----------------------------------------------------------------------|
  7491. * | WAPI RSC Low0 |
  7492. * |-----------------------------------------------------------------------|
  7493. * | WAPI RSC Low1 |
  7494. * |-----------------------------------------------------------------------|
  7495. * | WAPI RSC Hi0 |
  7496. * |-----------------------------------------------------------------------|
  7497. * | WAPI RSC Hi1 |
  7498. * |-----------------------------------------------------------------------|
  7499. *
  7500. * The following field definitions describe the format of the security
  7501. * indication message sent from the target to the host.
  7502. * - MSG_TYPE
  7503. * Bits 7:0
  7504. * Purpose: identifies this as a security specification message
  7505. * Value: 0xb
  7506. * - SEC_TYPE
  7507. * Bits 14:8
  7508. * Purpose: specifies which type of security applies to the peer
  7509. * Value: htt_sec_type enum value
  7510. * - UNICAST
  7511. * Bit 15
  7512. * Purpose: whether this security is applied to unicast or multicast data
  7513. * Value: 1 -> unicast, 0 -> multicast
  7514. * - PEER_ID
  7515. * Bits 31:16
  7516. * Purpose: The ID number for the peer the security specification is for
  7517. * Value: peer ID
  7518. * - MICHAEL_KEY_K0
  7519. * Bits 31:0
  7520. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7521. * Value: Michael Key K0 (if security type is TKIP)
  7522. * - MICHAEL_KEY_K1
  7523. * Bits 31:0
  7524. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7525. * Value: Michael Key K1 (if security type is TKIP)
  7526. * - WAPI_RSC_LOW0
  7527. * Bits 31:0
  7528. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7529. * Value: WAPI RSC Low0 (if security type is WAPI)
  7530. * - WAPI_RSC_LOW1
  7531. * Bits 31:0
  7532. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7533. * Value: WAPI RSC Low1 (if security type is WAPI)
  7534. * - WAPI_RSC_HI0
  7535. * Bits 31:0
  7536. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7537. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7538. * - WAPI_RSC_HI1
  7539. * Bits 31:0
  7540. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7541. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7542. */
  7543. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7544. #define HTT_SEC_IND_SEC_TYPE_S 8
  7545. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7546. #define HTT_SEC_IND_UNICAST_S 15
  7547. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7548. #define HTT_SEC_IND_PEER_ID_S 16
  7549. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7550. do { \
  7551. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7552. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7553. } while (0)
  7554. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7555. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7556. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7557. do { \
  7558. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7559. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7560. } while (0)
  7561. #define HTT_SEC_IND_UNICAST_GET(word) \
  7562. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7563. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7564. do { \
  7565. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7566. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7567. } while (0)
  7568. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7569. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7570. #define HTT_SEC_IND_BYTES 28
  7571. /**
  7572. * @brief target -> host rx ADDBA / DELBA message definitions
  7573. *
  7574. * @details
  7575. * The following diagram shows the format of the rx ADDBA message sent
  7576. * from the target to the host:
  7577. *
  7578. * |31 20|19 16|15 8|7 0|
  7579. * |---------------------------------------------------------------------|
  7580. * | peer ID | TID | window size | msg type |
  7581. * |---------------------------------------------------------------------|
  7582. *
  7583. * The following diagram shows the format of the rx DELBA message sent
  7584. * from the target to the host:
  7585. *
  7586. * |31 20|19 16|15 10|9 8|7 0|
  7587. * |---------------------------------------------------------------------|
  7588. * | peer ID | TID | reserved | IR| msg type |
  7589. * |---------------------------------------------------------------------|
  7590. *
  7591. * The following field definitions describe the format of the rx ADDBA
  7592. * and DELBA messages sent from the target to the host.
  7593. * - MSG_TYPE
  7594. * Bits 7:0
  7595. * Purpose: identifies this as an rx ADDBA or DELBA message
  7596. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7597. * - IR (initiator / recipient)
  7598. * Bits 9:8 (DELBA only)
  7599. * Purpose: specify whether the DELBA handshake was initiated by the
  7600. * local STA/AP, or by the peer STA/AP
  7601. * Value:
  7602. * 0 - unspecified
  7603. * 1 - initiator (a.k.a. originator)
  7604. * 2 - recipient (a.k.a. responder)
  7605. * 3 - unused / reserved
  7606. * - WIN_SIZE
  7607. * Bits 15:8 (ADDBA only)
  7608. * Purpose: Specifies the length of the block ack window (max = 64).
  7609. * Value:
  7610. * block ack window length specified by the received ADDBA
  7611. * management message.
  7612. * - TID
  7613. * Bits 19:16
  7614. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7615. * Value:
  7616. * TID specified by the received ADDBA or DELBA management message.
  7617. * - PEER_ID
  7618. * Bits 31:20
  7619. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7620. * Value:
  7621. * ID (hash value) used by the host for fast, direct lookup of
  7622. * host SW peer info, including rx reorder states.
  7623. */
  7624. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7625. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7626. #define HTT_RX_ADDBA_TID_M 0xf0000
  7627. #define HTT_RX_ADDBA_TID_S 16
  7628. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7629. #define HTT_RX_ADDBA_PEER_ID_S 20
  7630. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7631. do { \
  7632. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7633. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7634. } while (0)
  7635. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7636. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7637. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7638. do { \
  7639. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7640. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7641. } while (0)
  7642. #define HTT_RX_ADDBA_TID_GET(word) \
  7643. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7644. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7645. do { \
  7646. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7647. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7648. } while (0)
  7649. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7650. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7651. #define HTT_RX_ADDBA_BYTES 4
  7652. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7653. #define HTT_RX_DELBA_INITIATOR_S 8
  7654. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7655. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7656. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7657. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7658. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7659. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7660. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7661. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7662. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7663. do { \
  7664. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7665. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7666. } while (0)
  7667. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7668. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7669. #define HTT_RX_DELBA_BYTES 4
  7670. /**
  7671. * @brief tx queue group information element definition
  7672. *
  7673. * @details
  7674. * The following diagram shows the format of the tx queue group
  7675. * information element, which can be included in target --> host
  7676. * messages to specify the number of tx "credits" (tx descriptors
  7677. * for LL, or tx buffers for HL) available to a particular group
  7678. * of host-side tx queues, and which host-side tx queues belong to
  7679. * the group.
  7680. *
  7681. * |31|30 24|23 16|15|14|13 0|
  7682. * |------------------------------------------------------------------------|
  7683. * | X| reserved | tx queue grp ID | A| S| credit count |
  7684. * |------------------------------------------------------------------------|
  7685. * | vdev ID mask | AC mask |
  7686. * |------------------------------------------------------------------------|
  7687. *
  7688. * The following definitions describe the fields within the tx queue group
  7689. * information element:
  7690. * - credit_count
  7691. * Bits 13:1
  7692. * Purpose: specify how many tx credits are available to the tx queue group
  7693. * Value: An absolute or relative, positive or negative credit value
  7694. * The 'A' bit specifies whether the value is absolute or relative.
  7695. * The 'S' bit specifies whether the value is positive or negative.
  7696. * A negative value can only be relative, not absolute.
  7697. * An absolute value replaces any prior credit value the host has for
  7698. * the tx queue group in question.
  7699. * A relative value is added to the prior credit value the host has for
  7700. * the tx queue group in question.
  7701. * - sign
  7702. * Bit 14
  7703. * Purpose: specify whether the credit count is positive or negative
  7704. * Value: 0 -> positive, 1 -> negative
  7705. * - absolute
  7706. * Bit 15
  7707. * Purpose: specify whether the credit count is absolute or relative
  7708. * Value: 0 -> relative, 1 -> absolute
  7709. * - txq_group_id
  7710. * Bits 23:16
  7711. * Purpose: indicate which tx queue group's credit and/or membership are
  7712. * being specified
  7713. * Value: 0 to max_tx_queue_groups-1
  7714. * - reserved
  7715. * Bits 30:16
  7716. * Value: 0x0
  7717. * - eXtension
  7718. * Bit 31
  7719. * Purpose: specify whether another tx queue group info element follows
  7720. * Value: 0 -> no more tx queue group information elements
  7721. * 1 -> another tx queue group information element immediately follows
  7722. * - ac_mask
  7723. * Bits 15:0
  7724. * Purpose: specify which Access Categories belong to the tx queue group
  7725. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7726. * the tx queue group.
  7727. * The AC bit-mask values are obtained by left-shifting by the
  7728. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7729. * - vdev_id_mask
  7730. * Bits 31:16
  7731. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7732. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7733. * belong to the tx queue group.
  7734. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7735. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7736. */
  7737. PREPACK struct htt_txq_group {
  7738. A_UINT32
  7739. credit_count: 14,
  7740. sign: 1,
  7741. absolute: 1,
  7742. tx_queue_group_id: 8,
  7743. reserved0: 7,
  7744. extension: 1;
  7745. A_UINT32
  7746. ac_mask: 16,
  7747. vdev_id_mask: 16;
  7748. } POSTPACK;
  7749. /* first word */
  7750. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7751. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7752. #define HTT_TXQ_GROUP_SIGN_S 14
  7753. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7754. #define HTT_TXQ_GROUP_ABS_S 15
  7755. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7756. #define HTT_TXQ_GROUP_ID_S 16
  7757. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7758. #define HTT_TXQ_GROUP_EXT_S 31
  7759. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7760. /* second word */
  7761. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7762. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7763. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7764. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7765. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7766. do { \
  7767. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7768. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7769. } while (0)
  7770. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7771. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7772. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7773. do { \
  7774. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7775. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7776. } while (0)
  7777. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7778. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7779. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7780. do { \
  7781. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7782. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7783. } while (0)
  7784. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7785. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7786. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7787. do { \
  7788. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7789. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7790. } while (0)
  7791. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7792. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7793. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7794. do { \
  7795. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7796. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7797. } while (0)
  7798. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7799. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7800. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7801. do { \
  7802. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7803. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7804. } while (0)
  7805. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7806. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7807. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7808. do { \
  7809. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7810. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7811. } while (0)
  7812. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7813. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7814. /**
  7815. * @brief target -> host TX completion indication message definition
  7816. *
  7817. * @details
  7818. * The following diagram shows the format of the TX completion indication sent
  7819. * from the target to the host
  7820. *
  7821. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7822. * |-------------------------------------------------------------------|
  7823. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7824. * |-------------------------------------------------------------------|
  7825. * payload:| MSDU1 ID | MSDU0 ID |
  7826. * |-------------------------------------------------------------------|
  7827. * : MSDU3 ID | MSDU2 ID :
  7828. * |-------------------------------------------------------------------|
  7829. * | struct htt_tx_compl_ind_append_retries |
  7830. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7831. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7832. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7833. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7834. * |-------------------------------------------------------------------|
  7835. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  7836. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7837. * | MSDU0 tx_tsf64_low |
  7838. * |-------------------------------------------------------------------|
  7839. * | MSDU0 tx_tsf64_high |
  7840. * |-------------------------------------------------------------------|
  7841. * | MSDU1 tx_tsf64_low |
  7842. * |-------------------------------------------------------------------|
  7843. * | MSDU1 tx_tsf64_high |
  7844. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7845. * | phy_timestamp |
  7846. * |-------------------------------------------------------------------|
  7847. * | rate specs (see below) |
  7848. * |-------------------------------------------------------------------|
  7849. * | seqctrl | framectrl |
  7850. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7851. * Where:
  7852. * A0 = append (a.k.a. append0)
  7853. * A1 = append1
  7854. * TP = MSDU tx power presence
  7855. * A2 = append2
  7856. * A3 = append3
  7857. * A4 = append4
  7858. *
  7859. * The following field definitions describe the format of the TX completion
  7860. * indication sent from the target to the host
  7861. * Header fields:
  7862. * - msg_type
  7863. * Bits 7:0
  7864. * Purpose: identifies this as HTT TX completion indication
  7865. * Value: 0x7
  7866. * - status
  7867. * Bits 10:8
  7868. * Purpose: the TX completion status of payload fragmentations descriptors
  7869. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7870. * - tid
  7871. * Bits 14:11
  7872. * Purpose: the tid associated with those fragmentation descriptors. It is
  7873. * valid or not, depending on the tid_invalid bit.
  7874. * Value: 0 to 15
  7875. * - tid_invalid
  7876. * Bits 15:15
  7877. * Purpose: this bit indicates whether the tid field is valid or not
  7878. * Value: 0 indicates valid; 1 indicates invalid
  7879. * - num
  7880. * Bits 23:16
  7881. * Purpose: the number of payload in this indication
  7882. * Value: 1 to 255
  7883. * - append (a.k.a. append0)
  7884. * Bits 24:24
  7885. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7886. * the number of tx retries for one MSDU at the end of this message
  7887. * Value: 0 indicates no appending; 1 indicates appending
  7888. * - append1
  7889. * Bits 25:25
  7890. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7891. * contains the timestamp info for each TX msdu id in payload.
  7892. * The order of the timestamps matches the order of the MSDU IDs.
  7893. * Note that a big-endian host needs to account for the reordering
  7894. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7895. * conversion) when determining which tx timestamp corresponds to
  7896. * which MSDU ID.
  7897. * Value: 0 indicates no appending; 1 indicates appending
  7898. * - msdu_tx_power_presence
  7899. * Bits 26:26
  7900. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7901. * for each MSDU referenced by the TX_COMPL_IND message.
  7902. * The tx power is reported in 0.5 dBm units.
  7903. * The order of the per-MSDU tx power reports matches the order
  7904. * of the MSDU IDs.
  7905. * Note that a big-endian host needs to account for the reordering
  7906. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7907. * conversion) when determining which Tx Power corresponds to
  7908. * which MSDU ID.
  7909. * Value: 0 indicates MSDU tx power reports are not appended,
  7910. * 1 indicates MSDU tx power reports are appended
  7911. * - append2
  7912. * Bits 27:27
  7913. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7914. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7915. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7916. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7917. * for each MSDU, for convenience.
  7918. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7919. * this append2 bit is set).
  7920. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7921. * dB above the noise floor.
  7922. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7923. * 1 indicates MSDU ACK RSSI values are appended.
  7924. * - append3
  7925. * Bits 28:28
  7926. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  7927. * contains the tx tsf info based on wlan global TSF for
  7928. * each TX msdu id in payload.
  7929. * The order of the tx tsf matches the order of the MSDU IDs.
  7930. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  7931. * values to indicate the the lower 32 bits and higher 32 bits of
  7932. * the tx tsf.
  7933. * The tx_tsf64 here represents the time MSDU was acked and the
  7934. * tx_tsf64 has microseconds units.
  7935. * Value: 0 indicates no appending; 1 indicates appending
  7936. * - append4
  7937. * Bits 29:29
  7938. * Purpose: Indicate whether data frame control fields and fields required
  7939. * for radio tap header are appended for each MSDU in TX_COMP_IND
  7940. * message. The order of the this message matches the order of
  7941. * the MSDU IDs.
  7942. * Value: 0 indicates frame control fields and fields required for
  7943. * radio tap header values are not appended,
  7944. * 1 indicates frame control fields and fields required for
  7945. * radio tap header values are appended.
  7946. * Payload fields:
  7947. * - hmsdu_id
  7948. * Bits 15:0
  7949. * Purpose: this ID is used to track the Tx buffer in host
  7950. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7951. */
  7952. PREPACK struct htt_tx_data_hdr_information {
  7953. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  7954. A_UINT32 /* word 1 */
  7955. /* preamble:
  7956. * 0-OFDM,
  7957. * 1-CCk,
  7958. * 2-HT,
  7959. * 3-VHT
  7960. */
  7961. preamble: 2, /* [1:0] */
  7962. /* mcs:
  7963. * In case of HT preamble interpret
  7964. * MCS along with NSS.
  7965. * Valid values for HT are 0 to 7.
  7966. * HT mcs 0 with NSS 2 is mcs 8.
  7967. * Valid values for VHT are 0 to 9.
  7968. */
  7969. mcs: 4, /* [5:2] */
  7970. /* rate:
  7971. * This is applicable only for
  7972. * CCK and OFDM preamble type
  7973. * rate 0: OFDM 48 Mbps,
  7974. * 1: OFDM 24 Mbps,
  7975. * 2: OFDM 12 Mbps
  7976. * 3: OFDM 6 Mbps
  7977. * 4: OFDM 54 Mbps
  7978. * 5: OFDM 36 Mbps
  7979. * 6: OFDM 18 Mbps
  7980. * 7: OFDM 9 Mbps
  7981. * rate 0: CCK 11 Mbps Long
  7982. * 1: CCK 5.5 Mbps Long
  7983. * 2: CCK 2 Mbps Long
  7984. * 3: CCK 1 Mbps Long
  7985. * 4: CCK 11 Mbps Short
  7986. * 5: CCK 5.5 Mbps Short
  7987. * 6: CCK 2 Mbps Short
  7988. */
  7989. rate : 3, /* [ 8: 6] */
  7990. rssi : 8, /* [16: 9] units=dBm */
  7991. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7992. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7993. stbc : 1, /* [22] */
  7994. sgi : 1, /* [23] */
  7995. ldpc : 1, /* [24] */
  7996. beamformed: 1, /* [25] */
  7997. reserved_1: 6; /* [31:26] */
  7998. A_UINT32 /* word 2 */
  7999. framectrl:16, /* [15: 0] */
  8000. seqno:16; /* [31:16] */
  8001. } POSTPACK;
  8002. #define HTT_TX_COMPL_IND_STATUS_S 8
  8003. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  8004. #define HTT_TX_COMPL_IND_TID_S 11
  8005. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  8006. #define HTT_TX_COMPL_IND_TID_INV_S 15
  8007. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  8008. #define HTT_TX_COMPL_IND_NUM_S 16
  8009. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  8010. #define HTT_TX_COMPL_IND_APPEND_S 24
  8011. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  8012. #define HTT_TX_COMPL_IND_APPEND1_S 25
  8013. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  8014. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  8015. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  8016. #define HTT_TX_COMPL_IND_APPEND2_S 27
  8017. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  8018. #define HTT_TX_COMPL_IND_APPEND3_S 28
  8019. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  8020. #define HTT_TX_COMPL_IND_APPEND4_S 29
  8021. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  8022. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  8023. do { \
  8024. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  8025. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  8026. } while (0)
  8027. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  8028. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  8029. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  8030. do { \
  8031. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  8032. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  8033. } while (0)
  8034. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  8035. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  8036. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  8037. do { \
  8038. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  8039. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  8040. } while (0)
  8041. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  8042. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  8043. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  8044. do { \
  8045. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  8046. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  8047. } while (0)
  8048. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  8049. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  8050. HTT_TX_COMPL_IND_TID_INV_S)
  8051. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  8052. do { \
  8053. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  8054. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  8055. } while (0)
  8056. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  8057. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  8058. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  8059. do { \
  8060. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  8061. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  8062. } while (0)
  8063. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  8064. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  8065. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  8066. do { \
  8067. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  8068. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  8069. } while (0)
  8070. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  8071. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  8072. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  8073. do { \
  8074. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  8075. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  8076. } while (0)
  8077. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  8078. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  8079. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  8080. do { \
  8081. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  8082. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  8083. } while (0)
  8084. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  8085. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  8086. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  8087. do { \
  8088. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  8089. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  8090. } while (0)
  8091. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  8092. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  8093. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  8094. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  8095. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  8096. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  8097. #define HTT_TX_COMPL_IND_STAT_OK 0
  8098. /* DISCARD:
  8099. * current meaning:
  8100. * MSDUs were queued for transmission but filtered by HW or SW
  8101. * without any over the air attempts
  8102. * legacy meaning (HL Rome):
  8103. * MSDUs were discarded by the target FW without any over the air
  8104. * attempts due to lack of space
  8105. */
  8106. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  8107. /* NO_ACK:
  8108. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  8109. */
  8110. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  8111. /* POSTPONE:
  8112. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  8113. * be downloaded again later (in the appropriate order), when they are
  8114. * deliverable.
  8115. */
  8116. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  8117. /*
  8118. * The PEER_DEL tx completion status is used for HL cases
  8119. * where the peer the frame is for has been deleted.
  8120. * The host has already discarded its copy of the frame, but
  8121. * it still needs the tx completion to restore its credit.
  8122. */
  8123. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  8124. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  8125. #define HTT_TX_COMPL_IND_STAT_DROP 5
  8126. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  8127. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  8128. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  8129. PREPACK struct htt_tx_compl_ind_base {
  8130. A_UINT32 hdr;
  8131. A_UINT16 payload[1/*or more*/];
  8132. } POSTPACK;
  8133. PREPACK struct htt_tx_compl_ind_append_retries {
  8134. A_UINT16 msdu_id;
  8135. A_UINT8 tx_retries;
  8136. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  8137. 0: this is the last append_retries struct */
  8138. } POSTPACK;
  8139. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  8140. A_UINT32 timestamp[1/*or more*/];
  8141. } POSTPACK;
  8142. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  8143. A_UINT32 tx_tsf64_low;
  8144. A_UINT32 tx_tsf64_high;
  8145. } POSTPACK;
  8146. /* htt_tx_data_hdr_information payload extension fields: */
  8147. /* DWORD zero */
  8148. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  8149. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  8150. /* DWORD one */
  8151. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  8152. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  8153. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  8154. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  8155. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  8156. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  8157. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  8158. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  8159. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  8160. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  8161. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  8162. #define HTT_FW_TX_DATA_HDR_BW_S 19
  8163. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  8164. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  8165. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  8166. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  8167. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  8168. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  8169. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  8170. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  8171. /* DWORD two */
  8172. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  8173. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  8174. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  8175. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  8176. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  8177. do { \
  8178. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  8179. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  8180. } while (0)
  8181. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  8182. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  8183. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  8184. do { \
  8185. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  8186. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  8187. } while (0)
  8188. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  8189. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  8190. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  8191. do { \
  8192. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  8193. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  8194. } while (0)
  8195. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  8196. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  8197. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  8198. do { \
  8199. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  8200. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  8201. } while (0)
  8202. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  8203. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  8204. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  8205. do { \
  8206. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  8207. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  8208. } while (0)
  8209. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  8210. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  8211. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  8212. do { \
  8213. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  8214. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  8215. } while (0)
  8216. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  8217. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  8218. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  8219. do { \
  8220. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  8221. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  8222. } while (0)
  8223. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  8224. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  8225. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  8226. do { \
  8227. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  8228. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  8229. } while (0)
  8230. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  8231. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  8232. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  8233. do { \
  8234. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  8235. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  8236. } while (0)
  8237. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  8238. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  8239. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  8240. do { \
  8241. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  8242. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  8243. } while (0)
  8244. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  8245. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  8246. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  8247. do { \
  8248. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  8249. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  8250. } while (0)
  8251. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  8252. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  8253. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  8254. do { \
  8255. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  8256. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  8257. } while (0)
  8258. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  8259. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  8260. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  8261. do { \
  8262. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  8263. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  8264. } while (0)
  8265. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  8266. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  8267. /**
  8268. * @brief target -> host rate-control update indication message
  8269. *
  8270. * @details
  8271. * The following diagram shows the format of the RC Update message
  8272. * sent from the target to the host, while processing the tx-completion
  8273. * of a transmitted PPDU.
  8274. *
  8275. * |31 24|23 16|15 8|7 0|
  8276. * |-------------------------------------------------------------|
  8277. * | peer ID | vdev ID | msg_type |
  8278. * |-------------------------------------------------------------|
  8279. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8280. * |-------------------------------------------------------------|
  8281. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  8282. * |-------------------------------------------------------------|
  8283. * | : |
  8284. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8285. * | : |
  8286. * |-------------------------------------------------------------|
  8287. * | : |
  8288. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8289. * | : |
  8290. * |-------------------------------------------------------------|
  8291. * : :
  8292. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8293. *
  8294. */
  8295. typedef struct {
  8296. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  8297. A_UINT32 rate_code_flags;
  8298. A_UINT32 flags; /* Encodes information such as excessive
  8299. retransmission, aggregate, some info
  8300. from .11 frame control,
  8301. STBC, LDPC, (SGI and Tx Chain Mask
  8302. are encoded in ptx_rc->flags field),
  8303. AMPDU truncation (BT/time based etc.),
  8304. RTS/CTS attempt */
  8305. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  8306. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  8307. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  8308. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  8309. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  8310. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  8311. } HTT_RC_TX_DONE_PARAMS;
  8312. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  8313. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  8314. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  8315. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  8316. #define HTT_RC_UPDATE_VDEVID_S 8
  8317. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  8318. #define HTT_RC_UPDATE_PEERID_S 16
  8319. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  8320. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  8321. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  8322. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  8323. do { \
  8324. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  8325. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  8326. } while (0)
  8327. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  8328. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  8329. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  8330. do { \
  8331. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  8332. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  8333. } while (0)
  8334. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  8335. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  8336. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  8337. do { \
  8338. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  8339. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  8340. } while (0)
  8341. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  8342. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  8343. /**
  8344. * @brief target -> host rx fragment indication message definition
  8345. *
  8346. * @details
  8347. * The following field definitions describe the format of the rx fragment
  8348. * indication message sent from the target to the host.
  8349. * The rx fragment indication message shares the format of the
  8350. * rx indication message, but not all fields from the rx indication message
  8351. * are relevant to the rx fragment indication message.
  8352. *
  8353. *
  8354. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8355. * |-----------+-------------------+---------------------+-------------|
  8356. * | peer ID | |FV| ext TID | msg type |
  8357. * |-------------------------------------------------------------------|
  8358. * | | flush | flush |
  8359. * | | end | start |
  8360. * | | seq num | seq num |
  8361. * |-------------------------------------------------------------------|
  8362. * | reserved | FW rx desc bytes |
  8363. * |-------------------------------------------------------------------|
  8364. * | | FW MSDU Rx |
  8365. * | | desc B0 |
  8366. * |-------------------------------------------------------------------|
  8367. * Header fields:
  8368. * - MSG_TYPE
  8369. * Bits 7:0
  8370. * Purpose: identifies this as an rx fragment indication message
  8371. * Value: 0xa
  8372. * - EXT_TID
  8373. * Bits 12:8
  8374. * Purpose: identify the traffic ID of the rx data, including
  8375. * special "extended" TID values for multicast, broadcast, and
  8376. * non-QoS data frames
  8377. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8378. * - FLUSH_VALID (FV)
  8379. * Bit 13
  8380. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8381. * is valid
  8382. * Value:
  8383. * 1 -> flush IE is valid and needs to be processed
  8384. * 0 -> flush IE is not valid and should be ignored
  8385. * - PEER_ID
  8386. * Bits 31:16
  8387. * Purpose: Identify, by ID, which peer sent the rx data
  8388. * Value: ID of the peer who sent the rx data
  8389. * - FLUSH_SEQ_NUM_START
  8390. * Bits 5:0
  8391. * Purpose: Indicate the start of a series of MPDUs to flush
  8392. * Not all MPDUs within this series are necessarily valid - the host
  8393. * must check each sequence number within this range to see if the
  8394. * corresponding MPDU is actually present.
  8395. * This field is only valid if the FV bit is set.
  8396. * Value:
  8397. * The sequence number for the first MPDUs to check to flush.
  8398. * The sequence number is masked by 0x3f.
  8399. * - FLUSH_SEQ_NUM_END
  8400. * Bits 11:6
  8401. * Purpose: Indicate the end of a series of MPDUs to flush
  8402. * Value:
  8403. * The sequence number one larger than the sequence number of the
  8404. * last MPDU to check to flush.
  8405. * The sequence number is masked by 0x3f.
  8406. * Not all MPDUs within this series are necessarily valid - the host
  8407. * must check each sequence number within this range to see if the
  8408. * corresponding MPDU is actually present.
  8409. * This field is only valid if the FV bit is set.
  8410. * Rx descriptor fields:
  8411. * - FW_RX_DESC_BYTES
  8412. * Bits 15:0
  8413. * Purpose: Indicate how many bytes in the Rx indication are used for
  8414. * FW Rx descriptors
  8415. * Value: 1
  8416. */
  8417. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  8418. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  8419. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  8420. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  8421. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  8422. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  8423. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  8424. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  8425. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  8426. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  8427. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  8428. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  8429. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  8430. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  8431. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  8432. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  8433. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  8434. #define HTT_RX_FRAG_IND_BYTES \
  8435. (4 /* msg hdr */ + \
  8436. 4 /* flush spec */ + \
  8437. 4 /* (unused) FW rx desc bytes spec */ + \
  8438. 4 /* FW rx desc */)
  8439. /**
  8440. * @brief target -> host test message definition
  8441. *
  8442. * @details
  8443. * The following field definitions describe the format of the test
  8444. * message sent from the target to the host.
  8445. * The message consists of a 4-octet header, followed by a variable
  8446. * number of 32-bit integer values, followed by a variable number
  8447. * of 8-bit character values.
  8448. *
  8449. * |31 16|15 8|7 0|
  8450. * |-----------------------------------------------------------|
  8451. * | num chars | num ints | msg type |
  8452. * |-----------------------------------------------------------|
  8453. * | int 0 |
  8454. * |-----------------------------------------------------------|
  8455. * | int 1 |
  8456. * |-----------------------------------------------------------|
  8457. * | ... |
  8458. * |-----------------------------------------------------------|
  8459. * | char 3 | char 2 | char 1 | char 0 |
  8460. * |-----------------------------------------------------------|
  8461. * | | | ... | char 4 |
  8462. * |-----------------------------------------------------------|
  8463. * - MSG_TYPE
  8464. * Bits 7:0
  8465. * Purpose: identifies this as a test message
  8466. * Value: HTT_MSG_TYPE_TEST
  8467. * - NUM_INTS
  8468. * Bits 15:8
  8469. * Purpose: indicate how many 32-bit integers follow the message header
  8470. * - NUM_CHARS
  8471. * Bits 31:16
  8472. * Purpose: indicate how many 8-bit charaters follow the series of integers
  8473. */
  8474. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  8475. #define HTT_RX_TEST_NUM_INTS_S 8
  8476. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  8477. #define HTT_RX_TEST_NUM_CHARS_S 16
  8478. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  8479. do { \
  8480. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  8481. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  8482. } while (0)
  8483. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  8484. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  8485. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  8486. do { \
  8487. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  8488. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  8489. } while (0)
  8490. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  8491. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  8492. /**
  8493. * @brief target -> host packet log message
  8494. *
  8495. * @details
  8496. * The following field definitions describe the format of the packet log
  8497. * message sent from the target to the host.
  8498. * The message consists of a 4-octet header,followed by a variable number
  8499. * of 32-bit character values.
  8500. *
  8501. * |31 16|15 12|11 10|9 8|7 0|
  8502. * |------------------------------------------------------------------|
  8503. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  8504. * |------------------------------------------------------------------|
  8505. * | payload |
  8506. * |------------------------------------------------------------------|
  8507. * - MSG_TYPE
  8508. * Bits 7:0
  8509. * Purpose: identifies this as a pktlog message
  8510. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  8511. * - mac_id
  8512. * Bits 9:8
  8513. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  8514. * Value: 0-3
  8515. * - pdev_id
  8516. * Bits 11:10
  8517. * Purpose: pdev_id
  8518. * Value: 0-3
  8519. * 0 (for rings at SOC level),
  8520. * 1/2/3 PDEV -> 0/1/2
  8521. * - payload_size
  8522. * Bits 31:16
  8523. * Purpose: explicitly specify the payload size
  8524. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  8525. */
  8526. PREPACK struct htt_pktlog_msg {
  8527. A_UINT32 header;
  8528. A_UINT32 payload[1/* or more */];
  8529. } POSTPACK;
  8530. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  8531. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  8532. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  8533. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  8534. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  8535. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  8536. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  8537. do { \
  8538. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  8539. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  8540. } while (0)
  8541. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  8542. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  8543. HTT_T2H_PKTLOG_MAC_ID_S)
  8544. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  8545. do { \
  8546. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  8547. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  8548. } while (0)
  8549. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  8550. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  8551. HTT_T2H_PKTLOG_PDEV_ID_S)
  8552. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  8553. do { \
  8554. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  8555. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  8556. } while (0)
  8557. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  8558. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  8559. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  8560. /*
  8561. * Rx reorder statistics
  8562. * NB: all the fields must be defined in 4 octets size.
  8563. */
  8564. struct rx_reorder_stats {
  8565. /* Non QoS MPDUs received */
  8566. A_UINT32 deliver_non_qos;
  8567. /* MPDUs received in-order */
  8568. A_UINT32 deliver_in_order;
  8569. /* Flush due to reorder timer expired */
  8570. A_UINT32 deliver_flush_timeout;
  8571. /* Flush due to move out of window */
  8572. A_UINT32 deliver_flush_oow;
  8573. /* Flush due to DELBA */
  8574. A_UINT32 deliver_flush_delba;
  8575. /* MPDUs dropped due to FCS error */
  8576. A_UINT32 fcs_error;
  8577. /* MPDUs dropped due to monitor mode non-data packet */
  8578. A_UINT32 mgmt_ctrl;
  8579. /* Unicast-data MPDUs dropped due to invalid peer */
  8580. A_UINT32 invalid_peer;
  8581. /* MPDUs dropped due to duplication (non aggregation) */
  8582. A_UINT32 dup_non_aggr;
  8583. /* MPDUs dropped due to processed before */
  8584. A_UINT32 dup_past;
  8585. /* MPDUs dropped due to duplicate in reorder queue */
  8586. A_UINT32 dup_in_reorder;
  8587. /* Reorder timeout happened */
  8588. A_UINT32 reorder_timeout;
  8589. /* invalid bar ssn */
  8590. A_UINT32 invalid_bar_ssn;
  8591. /* reorder reset due to bar ssn */
  8592. A_UINT32 ssn_reset;
  8593. /* Flush due to delete peer */
  8594. A_UINT32 deliver_flush_delpeer;
  8595. /* Flush due to offload*/
  8596. A_UINT32 deliver_flush_offload;
  8597. /* Flush due to out of buffer*/
  8598. A_UINT32 deliver_flush_oob;
  8599. /* MPDUs dropped due to PN check fail */
  8600. A_UINT32 pn_fail;
  8601. /* MPDUs dropped due to unable to allocate memory */
  8602. A_UINT32 store_fail;
  8603. /* Number of times the tid pool alloc succeeded */
  8604. A_UINT32 tid_pool_alloc_succ;
  8605. /* Number of times the MPDU pool alloc succeeded */
  8606. A_UINT32 mpdu_pool_alloc_succ;
  8607. /* Number of times the MSDU pool alloc succeeded */
  8608. A_UINT32 msdu_pool_alloc_succ;
  8609. /* Number of times the tid pool alloc failed */
  8610. A_UINT32 tid_pool_alloc_fail;
  8611. /* Number of times the MPDU pool alloc failed */
  8612. A_UINT32 mpdu_pool_alloc_fail;
  8613. /* Number of times the MSDU pool alloc failed */
  8614. A_UINT32 msdu_pool_alloc_fail;
  8615. /* Number of times the tid pool freed */
  8616. A_UINT32 tid_pool_free;
  8617. /* Number of times the MPDU pool freed */
  8618. A_UINT32 mpdu_pool_free;
  8619. /* Number of times the MSDU pool freed */
  8620. A_UINT32 msdu_pool_free;
  8621. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8622. A_UINT32 msdu_queued;
  8623. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8624. A_UINT32 msdu_recycled;
  8625. /* Number of MPDUs with invalid peer but A2 found in AST */
  8626. A_UINT32 invalid_peer_a2_in_ast;
  8627. /* Number of MPDUs with invalid peer but A3 found in AST */
  8628. A_UINT32 invalid_peer_a3_in_ast;
  8629. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8630. A_UINT32 invalid_peer_bmc_mpdus;
  8631. /* Number of MSDUs with err attention word */
  8632. A_UINT32 rxdesc_err_att;
  8633. /* Number of MSDUs with flag of peer_idx_invalid */
  8634. A_UINT32 rxdesc_err_peer_idx_inv;
  8635. /* Number of MSDUs with flag of peer_idx_timeout */
  8636. A_UINT32 rxdesc_err_peer_idx_to;
  8637. /* Number of MSDUs with flag of overflow */
  8638. A_UINT32 rxdesc_err_ov;
  8639. /* Number of MSDUs with flag of msdu_length_err */
  8640. A_UINT32 rxdesc_err_msdu_len;
  8641. /* Number of MSDUs with flag of mpdu_length_err */
  8642. A_UINT32 rxdesc_err_mpdu_len;
  8643. /* Number of MSDUs with flag of tkip_mic_err */
  8644. A_UINT32 rxdesc_err_tkip_mic;
  8645. /* Number of MSDUs with flag of decrypt_err */
  8646. A_UINT32 rxdesc_err_decrypt;
  8647. /* Number of MSDUs with flag of fcs_err */
  8648. A_UINT32 rxdesc_err_fcs;
  8649. /* Number of Unicast (bc_mc bit is not set in attention word)
  8650. * frames with invalid peer handler
  8651. */
  8652. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8653. /* Number of unicast frame directly (direct bit is set in attention word)
  8654. * to DUT with invalid peer handler
  8655. */
  8656. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8657. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8658. * frames with invalid peer handler
  8659. */
  8660. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8661. /* Number of MSDUs dropped due to no first MSDU flag */
  8662. A_UINT32 rxdesc_no_1st_msdu;
  8663. /* Number of MSDUs droped due to ring overflow */
  8664. A_UINT32 msdu_drop_ring_ov;
  8665. /* Number of MSDUs dropped due to FC mismatch */
  8666. A_UINT32 msdu_drop_fc_mismatch;
  8667. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8668. A_UINT32 msdu_drop_mgmt_remote_ring;
  8669. /* Number of MSDUs dropped due to errors not reported in attention word */
  8670. A_UINT32 msdu_drop_misc;
  8671. /* Number of MSDUs go to offload before reorder */
  8672. A_UINT32 offload_msdu_wal;
  8673. /* Number of data frame dropped by offload after reorder */
  8674. A_UINT32 offload_msdu_reorder;
  8675. /* Number of MPDUs with sequence number in the past and within the BA window */
  8676. A_UINT32 dup_past_within_window;
  8677. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8678. A_UINT32 dup_past_outside_window;
  8679. /* Number of MSDUs with decrypt/MIC error */
  8680. A_UINT32 rxdesc_err_decrypt_mic;
  8681. /* Number of data MSDUs received on both local and remote rings */
  8682. A_UINT32 data_msdus_on_both_rings;
  8683. /* MPDUs never filled */
  8684. A_UINT32 holes_not_filled;
  8685. };
  8686. /*
  8687. * Rx Remote buffer statistics
  8688. * NB: all the fields must be defined in 4 octets size.
  8689. */
  8690. struct rx_remote_buffer_mgmt_stats {
  8691. /* Total number of MSDUs reaped for Rx processing */
  8692. A_UINT32 remote_reaped;
  8693. /* MSDUs recycled within firmware */
  8694. A_UINT32 remote_recycled;
  8695. /* MSDUs stored by Data Rx */
  8696. A_UINT32 data_rx_msdus_stored;
  8697. /* Number of HTT indications from WAL Rx MSDU */
  8698. A_UINT32 wal_rx_ind;
  8699. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8700. A_UINT32 wal_rx_ind_unconsumed;
  8701. /* Number of HTT indications from Data Rx MSDU */
  8702. A_UINT32 data_rx_ind;
  8703. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8704. A_UINT32 data_rx_ind_unconsumed;
  8705. /* Number of HTT indications from ATHBUF */
  8706. A_UINT32 athbuf_rx_ind;
  8707. /* Number of remote buffers requested for refill */
  8708. A_UINT32 refill_buf_req;
  8709. /* Number of remote buffers filled by the host */
  8710. A_UINT32 refill_buf_rsp;
  8711. /* Number of times MAC hw_index = f/w write_index */
  8712. A_INT32 mac_no_bufs;
  8713. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8714. A_INT32 fw_indices_equal;
  8715. /* Number of times f/w finds no buffers to post */
  8716. A_INT32 host_no_bufs;
  8717. };
  8718. /*
  8719. * TXBF MU/SU packets and NDPA statistics
  8720. * NB: all the fields must be defined in 4 octets size.
  8721. */
  8722. struct rx_txbf_musu_ndpa_pkts_stats {
  8723. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8724. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8725. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8726. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8727. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8728. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8729. };
  8730. /*
  8731. * htt_dbg_stats_status -
  8732. * present - The requested stats have been delivered in full.
  8733. * This indicates that either the stats information was contained
  8734. * in its entirety within this message, or else this message
  8735. * completes the delivery of the requested stats info that was
  8736. * partially delivered through earlier STATS_CONF messages.
  8737. * partial - The requested stats have been delivered in part.
  8738. * One or more subsequent STATS_CONF messages with the same
  8739. * cookie value will be sent to deliver the remainder of the
  8740. * information.
  8741. * error - The requested stats could not be delivered, for example due
  8742. * to a shortage of memory to construct a message holding the
  8743. * requested stats.
  8744. * invalid - The requested stat type is either not recognized, or the
  8745. * target is configured to not gather the stats type in question.
  8746. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8747. * series_done - This special value indicates that no further stats info
  8748. * elements are present within a series of stats info elems
  8749. * (within a stats upload confirmation message).
  8750. */
  8751. enum htt_dbg_stats_status {
  8752. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8753. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8754. HTT_DBG_STATS_STATUS_ERROR = 2,
  8755. HTT_DBG_STATS_STATUS_INVALID = 3,
  8756. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8757. };
  8758. /**
  8759. * @brief target -> host statistics upload
  8760. *
  8761. * @details
  8762. * The following field definitions describe the format of the HTT target
  8763. * to host stats upload confirmation message.
  8764. * The message contains a cookie echoed from the HTT host->target stats
  8765. * upload request, which identifies which request the confirmation is
  8766. * for, and a series of tag-length-value stats information elements.
  8767. * The tag-length header for each stats info element also includes a
  8768. * status field, to indicate whether the request for the stat type in
  8769. * question was fully met, partially met, unable to be met, or invalid
  8770. * (if the stat type in question is disabled in the target).
  8771. * A special value of all 1's in this status field is used to indicate
  8772. * the end of the series of stats info elements.
  8773. *
  8774. *
  8775. * |31 16|15 8|7 5|4 0|
  8776. * |------------------------------------------------------------|
  8777. * | reserved | msg type |
  8778. * |------------------------------------------------------------|
  8779. * | cookie LSBs |
  8780. * |------------------------------------------------------------|
  8781. * | cookie MSBs |
  8782. * |------------------------------------------------------------|
  8783. * | stats entry length | reserved | S |stat type|
  8784. * |------------------------------------------------------------|
  8785. * | |
  8786. * | type-specific stats info |
  8787. * | |
  8788. * |------------------------------------------------------------|
  8789. * | stats entry length | reserved | S |stat type|
  8790. * |------------------------------------------------------------|
  8791. * | |
  8792. * | type-specific stats info |
  8793. * | |
  8794. * |------------------------------------------------------------|
  8795. * | n/a | reserved | 111 | n/a |
  8796. * |------------------------------------------------------------|
  8797. * Header fields:
  8798. * - MSG_TYPE
  8799. * Bits 7:0
  8800. * Purpose: identifies this is a statistics upload confirmation message
  8801. * Value: 0x9
  8802. * - COOKIE_LSBS
  8803. * Bits 31:0
  8804. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8805. * message with its preceding host->target stats request message.
  8806. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8807. * - COOKIE_MSBS
  8808. * Bits 31:0
  8809. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8810. * message with its preceding host->target stats request message.
  8811. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8812. *
  8813. * Stats Information Element tag-length header fields:
  8814. * - STAT_TYPE
  8815. * Bits 4:0
  8816. * Purpose: identifies the type of statistics info held in the
  8817. * following information element
  8818. * Value: htt_dbg_stats_type
  8819. * - STATUS
  8820. * Bits 7:5
  8821. * Purpose: indicate whether the requested stats are present
  8822. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8823. * the completion of the stats entry series
  8824. * - LENGTH
  8825. * Bits 31:16
  8826. * Purpose: indicate the stats information size
  8827. * Value: This field specifies the number of bytes of stats information
  8828. * that follows the element tag-length header.
  8829. * It is expected but not required that this length is a multiple of
  8830. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8831. * subsequent stats entry header will begin on a 4-byte aligned
  8832. * boundary.
  8833. */
  8834. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8835. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8836. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8837. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8838. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8839. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8840. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8841. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8842. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8843. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8844. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8845. do { \
  8846. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8847. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8848. } while (0)
  8849. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8850. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8851. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8852. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8853. do { \
  8854. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8855. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8856. } while (0)
  8857. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8858. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8859. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8860. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8861. do { \
  8862. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8863. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8864. } while (0)
  8865. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8866. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8867. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8868. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8869. #define HTT_MAX_AGGR 64
  8870. #define HTT_HL_MAX_AGGR 18
  8871. /**
  8872. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8873. *
  8874. * @details
  8875. * The following field definitions describe the format of the HTT host
  8876. * to target frag_desc/msdu_ext bank configuration message.
  8877. * The message contains the based address and the min and max id of the
  8878. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8879. * MSDU_EXT/FRAG_DESC.
  8880. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8881. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8882. * the hardware does the mapping/translation.
  8883. *
  8884. * Total banks that can be configured is configured to 16.
  8885. *
  8886. * This should be called before any TX has be initiated by the HTT
  8887. *
  8888. * |31 16|15 8|7 5|4 0|
  8889. * |------------------------------------------------------------|
  8890. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8891. * |------------------------------------------------------------|
  8892. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8893. #if HTT_PADDR64
  8894. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8895. #endif
  8896. * |------------------------------------------------------------|
  8897. * | ... |
  8898. * |------------------------------------------------------------|
  8899. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8900. #if HTT_PADDR64
  8901. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8902. #endif
  8903. * |------------------------------------------------------------|
  8904. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8905. * |------------------------------------------------------------|
  8906. * | ... |
  8907. * |------------------------------------------------------------|
  8908. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8909. * |------------------------------------------------------------|
  8910. * Header fields:
  8911. * - MSG_TYPE
  8912. * Bits 7:0
  8913. * Value: 0x6
  8914. * for systems with 64-bit format for bus addresses:
  8915. * - BANKx_BASE_ADDRESS_LO
  8916. * Bits 31:0
  8917. * Purpose: Provide a mechanism to specify the base address of the
  8918. * MSDU_EXT bank physical/bus address.
  8919. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8920. * - BANKx_BASE_ADDRESS_HI
  8921. * Bits 31:0
  8922. * Purpose: Provide a mechanism to specify the base address of the
  8923. * MSDU_EXT bank physical/bus address.
  8924. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8925. * for systems with 32-bit format for bus addresses:
  8926. * - BANKx_BASE_ADDRESS
  8927. * Bits 31:0
  8928. * Purpose: Provide a mechanism to specify the base address of the
  8929. * MSDU_EXT bank physical/bus address.
  8930. * Value: MSDU_EXT bank physical / bus address
  8931. * - BANKx_MIN_ID
  8932. * Bits 15:0
  8933. * Purpose: Provide a mechanism to specify the min index that needs to
  8934. * mapped.
  8935. * - BANKx_MAX_ID
  8936. * Bits 31:16
  8937. * Purpose: Provide a mechanism to specify the max index that needs to
  8938. * mapped.
  8939. *
  8940. */
  8941. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8942. * safe value.
  8943. * @note MAX supported banks is 16.
  8944. */
  8945. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8946. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8947. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8948. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8949. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8950. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8951. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8952. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8953. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8954. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8955. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8956. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8957. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8958. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8959. do { \
  8960. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8961. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8962. } while (0)
  8963. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8964. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8965. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8966. do { \
  8967. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8968. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8969. } while (0)
  8970. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8971. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8972. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8973. do { \
  8974. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8975. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8976. } while (0)
  8977. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8978. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8979. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8980. do { \
  8981. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8982. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8983. } while (0)
  8984. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8985. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8986. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8987. do { \
  8988. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8989. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8990. } while (0)
  8991. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8992. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8993. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8996. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8997. } while (0)
  8998. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8999. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  9000. /*
  9001. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  9002. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  9003. * addresses are stored in a XXX-bit field.
  9004. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  9005. * htt_tx_frag_desc64_bank_cfg_t structs.
  9006. */
  9007. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  9008. _paddr_bits_, \
  9009. _paddr__bank_base_address_) \
  9010. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  9011. /** word 0 \
  9012. * msg_type: 8, \
  9013. * pdev_id: 2, \
  9014. * swap: 1, \
  9015. * reserved0: 5, \
  9016. * num_banks: 8, \
  9017. * desc_size: 8; \
  9018. */ \
  9019. A_UINT32 word0; \
  9020. /* \
  9021. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  9022. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  9023. * the second A_UINT32). \
  9024. */ \
  9025. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9026. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9027. } POSTPACK
  9028. /* define htt_tx_frag_desc32_bank_cfg_t */
  9029. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  9030. /* define htt_tx_frag_desc64_bank_cfg_t */
  9031. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  9032. /*
  9033. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  9034. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  9035. */
  9036. #if HTT_PADDR64
  9037. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  9038. #else
  9039. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  9040. #endif
  9041. /**
  9042. * @brief target -> host HTT TX Credit total count update message definition
  9043. *
  9044. *|31 16|15|14 9| 8 |7 0 |
  9045. *|---------------------+--+----------+-------+----------|
  9046. *|cur htt credit delta | Q| reserved | sign | msg type |
  9047. *|------------------------------------------------------|
  9048. *
  9049. * Header fields:
  9050. * - MSG_TYPE
  9051. * Bits 7:0
  9052. * Purpose: identifies this as a htt tx credit delta update message
  9053. * Value: 0xe
  9054. * - SIGN
  9055. * Bits 8
  9056. * identifies whether credit delta is positive or negative
  9057. * Value:
  9058. * - 0x0: credit delta is positive, rebalance in some buffers
  9059. * - 0x1: credit delta is negative, rebalance out some buffers
  9060. * - reserved
  9061. * Bits 14:9
  9062. * Value: 0x0
  9063. * - TXQ_GRP
  9064. * Bit 15
  9065. * Purpose: indicates whether any tx queue group information elements
  9066. * are appended to the tx credit update message
  9067. * Value: 0 -> no tx queue group information element is present
  9068. * 1 -> a tx queue group information element immediately follows
  9069. * - DELTA_COUNT
  9070. * Bits 31:16
  9071. * Purpose: Specify current htt credit delta absolute count
  9072. */
  9073. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  9074. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  9075. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  9076. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  9077. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  9078. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  9079. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  9080. do { \
  9081. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  9082. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  9083. } while (0)
  9084. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  9085. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  9086. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  9087. do { \
  9088. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  9089. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  9090. } while (0)
  9091. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  9092. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  9093. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  9094. do { \
  9095. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  9096. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  9097. } while (0)
  9098. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  9099. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  9100. #define HTT_TX_CREDIT_MSG_BYTES 4
  9101. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  9102. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  9103. /**
  9104. * @brief HTT WDI_IPA Operation Response Message
  9105. *
  9106. * @details
  9107. * HTT WDI_IPA Operation Response message is sent by target
  9108. * to host confirming suspend or resume operation.
  9109. * |31 24|23 16|15 8|7 0|
  9110. * |----------------+----------------+----------------+----------------|
  9111. * | op_code | Rsvd | msg_type |
  9112. * |-------------------------------------------------------------------|
  9113. * | Rsvd | Response len |
  9114. * |-------------------------------------------------------------------|
  9115. * | |
  9116. * | Response-type specific info |
  9117. * | |
  9118. * | |
  9119. * |-------------------------------------------------------------------|
  9120. * Header fields:
  9121. * - MSG_TYPE
  9122. * Bits 7:0
  9123. * Purpose: Identifies this as WDI_IPA Operation Response message
  9124. * value: = 0x13
  9125. * - OP_CODE
  9126. * Bits 31:16
  9127. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  9128. * value: = enum htt_wdi_ipa_op_code
  9129. * - RSP_LEN
  9130. * Bits 16:0
  9131. * Purpose: length for the response-type specific info
  9132. * value: = length in bytes for response-type specific info
  9133. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  9134. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  9135. */
  9136. PREPACK struct htt_wdi_ipa_op_response_t
  9137. {
  9138. /* DWORD 0: flags and meta-data */
  9139. A_UINT32
  9140. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9141. reserved1: 8,
  9142. op_code: 16;
  9143. A_UINT32
  9144. rsp_len: 16,
  9145. reserved2: 16;
  9146. } POSTPACK;
  9147. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  9148. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  9149. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  9150. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  9151. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  9152. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  9153. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  9154. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  9155. do { \
  9156. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  9157. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  9158. } while (0)
  9159. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  9160. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  9161. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  9162. do { \
  9163. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  9164. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  9165. } while (0)
  9166. enum htt_phy_mode {
  9167. htt_phy_mode_11a = 0,
  9168. htt_phy_mode_11g = 1,
  9169. htt_phy_mode_11b = 2,
  9170. htt_phy_mode_11g_only = 3,
  9171. htt_phy_mode_11na_ht20 = 4,
  9172. htt_phy_mode_11ng_ht20 = 5,
  9173. htt_phy_mode_11na_ht40 = 6,
  9174. htt_phy_mode_11ng_ht40 = 7,
  9175. htt_phy_mode_11ac_vht20 = 8,
  9176. htt_phy_mode_11ac_vht40 = 9,
  9177. htt_phy_mode_11ac_vht80 = 10,
  9178. htt_phy_mode_11ac_vht20_2g = 11,
  9179. htt_phy_mode_11ac_vht40_2g = 12,
  9180. htt_phy_mode_11ac_vht80_2g = 13,
  9181. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  9182. htt_phy_mode_11ac_vht160 = 15,
  9183. htt_phy_mode_max,
  9184. };
  9185. /**
  9186. * @brief target -> host HTT channel change indication
  9187. * @details
  9188. * Specify when a channel change occurs.
  9189. * This allows the host to precisely determine which rx frames arrived
  9190. * on the old channel and which rx frames arrived on the new channel.
  9191. *
  9192. *|31 |7 0 |
  9193. *|-------------------------------------------+----------|
  9194. *| reserved | msg type |
  9195. *|------------------------------------------------------|
  9196. *| primary_chan_center_freq_mhz |
  9197. *|------------------------------------------------------|
  9198. *| contiguous_chan1_center_freq_mhz |
  9199. *|------------------------------------------------------|
  9200. *| contiguous_chan2_center_freq_mhz |
  9201. *|------------------------------------------------------|
  9202. *| phy_mode |
  9203. *|------------------------------------------------------|
  9204. *
  9205. * Header fields:
  9206. * - MSG_TYPE
  9207. * Bits 7:0
  9208. * Purpose: identifies this as a htt channel change indication message
  9209. * Value: 0x15
  9210. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  9211. * Bits 31:0
  9212. * Purpose: identify the (center of the) new 20 MHz primary channel
  9213. * Value: center frequency of the 20 MHz primary channel, in MHz units
  9214. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  9215. * Bits 31:0
  9216. * Purpose: identify the (center of the) contiguous frequency range
  9217. * comprising the new channel.
  9218. * For example, if the new channel is a 80 MHz channel extending
  9219. * 60 MHz beyond the primary channel, this field would be 30 larger
  9220. * than the primary channel center frequency field.
  9221. * Value: center frequency of the contiguous frequency range comprising
  9222. * the full channel in MHz units
  9223. * (80+80 channels also use the CONTIG_CHAN2 field)
  9224. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  9225. * Bits 31:0
  9226. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  9227. * within a VHT 80+80 channel.
  9228. * This field is only relevant for VHT 80+80 channels.
  9229. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  9230. * channel (arbitrary value for cases besides VHT 80+80)
  9231. * - PHY_MODE
  9232. * Bits 31:0
  9233. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  9234. * and band
  9235. * Value: htt_phy_mode enum value
  9236. */
  9237. PREPACK struct htt_chan_change_t
  9238. {
  9239. /* DWORD 0: flags and meta-data */
  9240. A_UINT32
  9241. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9242. reserved1: 24;
  9243. A_UINT32 primary_chan_center_freq_mhz;
  9244. A_UINT32 contig_chan1_center_freq_mhz;
  9245. A_UINT32 contig_chan2_center_freq_mhz;
  9246. A_UINT32 phy_mode;
  9247. } POSTPACK;
  9248. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  9249. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  9250. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  9251. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  9252. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  9253. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  9254. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  9255. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  9256. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  9257. do { \
  9258. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  9259. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  9260. } while (0)
  9261. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  9262. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  9263. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  9264. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  9265. do { \
  9266. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  9267. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  9268. } while (0)
  9269. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  9270. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  9271. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  9272. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  9273. do { \
  9274. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  9275. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  9276. } while (0)
  9277. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  9278. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  9279. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  9280. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  9281. do { \
  9282. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  9283. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  9284. } while (0)
  9285. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  9286. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  9287. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  9288. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  9289. /**
  9290. * @brief rx offload packet error message
  9291. *
  9292. * @details
  9293. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  9294. * of target payload like mic err.
  9295. *
  9296. * |31 24|23 16|15 8|7 0|
  9297. * |----------------+----------------+----------------+----------------|
  9298. * | tid | vdev_id | msg_sub_type | msg_type |
  9299. * |-------------------------------------------------------------------|
  9300. * : (sub-type dependent content) :
  9301. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9302. * Header fields:
  9303. * - msg_type
  9304. * Bits 7:0
  9305. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  9306. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  9307. * - msg_sub_type
  9308. * Bits 15:8
  9309. * Purpose: Identifies which type of rx error is reported by this message
  9310. * value: htt_rx_ofld_pkt_err_type
  9311. * - vdev_id
  9312. * Bits 23:16
  9313. * Purpose: Identifies which vdev received the erroneous rx frame
  9314. * value:
  9315. * - tid
  9316. * Bits 31:24
  9317. * Purpose: Identifies the traffic type of the rx frame
  9318. * value:
  9319. *
  9320. * - The payload fields used if the sub-type == MIC error are shown below.
  9321. * Note - MIC err is per MSDU, while PN is per MPDU.
  9322. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  9323. * with MIC err in A-MSDU case, so FW will send only one HTT message
  9324. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  9325. * instead of sending separate HTT messages for each wrong MSDU within
  9326. * the MPDU.
  9327. *
  9328. * |31 24|23 16|15 8|7 0|
  9329. * |----------------+----------------+----------------+----------------|
  9330. * | Rsvd | key_id | peer_id |
  9331. * |-------------------------------------------------------------------|
  9332. * | receiver MAC addr 31:0 |
  9333. * |-------------------------------------------------------------------|
  9334. * | Rsvd | receiver MAC addr 47:32 |
  9335. * |-------------------------------------------------------------------|
  9336. * | transmitter MAC addr 31:0 |
  9337. * |-------------------------------------------------------------------|
  9338. * | Rsvd | transmitter MAC addr 47:32 |
  9339. * |-------------------------------------------------------------------|
  9340. * | PN 31:0 |
  9341. * |-------------------------------------------------------------------|
  9342. * | Rsvd | PN 47:32 |
  9343. * |-------------------------------------------------------------------|
  9344. * - peer_id
  9345. * Bits 15:0
  9346. * Purpose: identifies which peer is frame is from
  9347. * value:
  9348. * - key_id
  9349. * Bits 23:16
  9350. * Purpose: identifies key_id of rx frame
  9351. * value:
  9352. * - RA_31_0 (receiver MAC addr 31:0)
  9353. * Bits 31:0
  9354. * Purpose: identifies by MAC address which vdev received the frame
  9355. * value: MAC address lower 4 bytes
  9356. * - RA_47_32 (receiver MAC addr 47:32)
  9357. * Bits 15:0
  9358. * Purpose: identifies by MAC address which vdev received the frame
  9359. * value: MAC address upper 2 bytes
  9360. * - TA_31_0 (transmitter MAC addr 31:0)
  9361. * Bits 31:0
  9362. * Purpose: identifies by MAC address which peer transmitted the frame
  9363. * value: MAC address lower 4 bytes
  9364. * - TA_47_32 (transmitter MAC addr 47:32)
  9365. * Bits 15:0
  9366. * Purpose: identifies by MAC address which peer transmitted the frame
  9367. * value: MAC address upper 2 bytes
  9368. * - PN_31_0
  9369. * Bits 31:0
  9370. * Purpose: Identifies pn of rx frame
  9371. * value: PN lower 4 bytes
  9372. * - PN_47_32
  9373. * Bits 15:0
  9374. * Purpose: Identifies pn of rx frame
  9375. * value:
  9376. * TKIP or CCMP: PN upper 2 bytes
  9377. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  9378. */
  9379. enum htt_rx_ofld_pkt_err_type {
  9380. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  9381. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  9382. };
  9383. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  9384. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  9385. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  9386. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  9387. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  9388. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  9389. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  9390. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  9391. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  9392. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  9393. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  9394. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  9395. do { \
  9396. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  9397. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  9398. } while (0)
  9399. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  9400. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  9401. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  9402. do { \
  9403. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  9404. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  9405. } while (0)
  9406. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  9407. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  9408. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  9409. do { \
  9410. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  9411. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  9412. } while (0)
  9413. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  9414. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  9415. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  9416. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  9417. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  9418. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  9419. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  9420. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  9421. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  9422. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  9423. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  9424. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  9425. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  9426. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  9427. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  9428. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  9429. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  9430. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  9431. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  9432. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  9433. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  9434. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  9435. do { \
  9436. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  9437. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  9438. } while (0)
  9439. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  9440. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  9441. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  9442. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  9443. do { \
  9444. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  9445. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  9446. } while (0)
  9447. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  9448. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  9449. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  9450. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  9451. do { \
  9452. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  9453. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  9454. } while (0)
  9455. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  9456. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  9457. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  9458. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  9459. do { \
  9460. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  9461. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  9462. } while (0)
  9463. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  9464. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  9465. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  9466. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  9467. do { \
  9468. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  9469. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  9470. } while (0)
  9471. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  9472. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  9473. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  9474. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  9475. do { \
  9476. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  9477. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  9478. } while (0)
  9479. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  9480. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  9481. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  9482. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  9483. do { \
  9484. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  9485. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  9486. } while (0)
  9487. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  9488. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  9489. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  9490. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  9491. do { \
  9492. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  9493. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  9494. } while (0)
  9495. /**
  9496. * @brief peer rate report message
  9497. *
  9498. * @details
  9499. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  9500. * justified rate of all the peers.
  9501. *
  9502. * |31 24|23 16|15 8|7 0|
  9503. * |----------------+----------------+----------------+----------------|
  9504. * | peer_count | | msg_type |
  9505. * |-------------------------------------------------------------------|
  9506. * : Payload (variant number of peer rate report) :
  9507. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9508. * Header fields:
  9509. * - msg_type
  9510. * Bits 7:0
  9511. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  9512. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  9513. * - reserved
  9514. * Bits 15:8
  9515. * Purpose:
  9516. * value:
  9517. * - peer_count
  9518. * Bits 31:16
  9519. * Purpose: Specify how many peer rate report elements are present in the payload.
  9520. * value:
  9521. *
  9522. * Payload:
  9523. * There are variant number of peer rate report follow the first 32 bits.
  9524. * The peer rate report is defined as follows.
  9525. *
  9526. * |31 20|19 16|15 0|
  9527. * |-----------------------+---------+---------------------------------|-
  9528. * | reserved | phy | peer_id | \
  9529. * |-------------------------------------------------------------------| -> report #0
  9530. * | rate | /
  9531. * |-----------------------+---------+---------------------------------|-
  9532. * | reserved | phy | peer_id | \
  9533. * |-------------------------------------------------------------------| -> report #1
  9534. * | rate | /
  9535. * |-----------------------+---------+---------------------------------|-
  9536. * | reserved | phy | peer_id | \
  9537. * |-------------------------------------------------------------------| -> report #2
  9538. * | rate | /
  9539. * |-------------------------------------------------------------------|-
  9540. * : :
  9541. * : :
  9542. * : :
  9543. * :-------------------------------------------------------------------:
  9544. *
  9545. * - peer_id
  9546. * Bits 15:0
  9547. * Purpose: identify the peer
  9548. * value:
  9549. * - phy
  9550. * Bits 19:16
  9551. * Purpose: identify which phy is in use
  9552. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  9553. * Please see enum htt_peer_report_phy_type for detail.
  9554. * - reserved
  9555. * Bits 31:20
  9556. * Purpose:
  9557. * value:
  9558. * - rate
  9559. * Bits 31:0
  9560. * Purpose: represent the justified rate of the peer specified by peer_id
  9561. * value:
  9562. */
  9563. enum htt_peer_rate_report_phy_type {
  9564. HTT_PEER_RATE_REPORT_11B = 0,
  9565. HTT_PEER_RATE_REPORT_11A_G,
  9566. HTT_PEER_RATE_REPORT_11N,
  9567. HTT_PEER_RATE_REPORT_11AC,
  9568. };
  9569. #define HTT_PEER_RATE_REPORT_SIZE 8
  9570. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  9571. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  9572. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  9573. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  9574. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  9575. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  9576. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  9577. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  9578. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  9579. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  9580. do { \
  9581. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  9582. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  9583. } while (0)
  9584. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  9585. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  9586. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  9587. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  9588. do { \
  9589. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  9590. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  9591. } while (0)
  9592. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  9593. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  9594. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  9595. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  9596. do { \
  9597. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  9598. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  9599. } while (0)
  9600. /**
  9601. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  9602. *
  9603. * @details
  9604. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  9605. * a flow of descriptors.
  9606. *
  9607. * This message is in TLV format and indicates the parameters to be setup a
  9608. * flow in the host. Each entry indicates that a particular flow ID is ready to
  9609. * receive descriptors from a specified pool.
  9610. *
  9611. * The message would appear as follows:
  9612. *
  9613. * |31 24|23 16|15 8|7 0|
  9614. * |----------------+----------------+----------------+----------------|
  9615. * header | reserved | num_flows | msg_type |
  9616. * |-------------------------------------------------------------------|
  9617. * | |
  9618. * : payload :
  9619. * | |
  9620. * |-------------------------------------------------------------------|
  9621. *
  9622. * The header field is one DWORD long and is interpreted as follows:
  9623. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9624. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9625. * this message
  9626. * b'16-31 - reserved: These bits are reserved for future use
  9627. *
  9628. * Payload:
  9629. * The payload would contain multiple objects of the following structure. Each
  9630. * object represents a flow.
  9631. *
  9632. * |31 24|23 16|15 8|7 0|
  9633. * |----------------+----------------+----------------+----------------|
  9634. * header | reserved | num_flows | msg_type |
  9635. * |-------------------------------------------------------------------|
  9636. * payload0| flow_type |
  9637. * |-------------------------------------------------------------------|
  9638. * | flow_id |
  9639. * |-------------------------------------------------------------------|
  9640. * | reserved0 | flow_pool_id |
  9641. * |-------------------------------------------------------------------|
  9642. * | reserved1 | flow_pool_size |
  9643. * |-------------------------------------------------------------------|
  9644. * | reserved2 |
  9645. * |-------------------------------------------------------------------|
  9646. * payload1| flow_type |
  9647. * |-------------------------------------------------------------------|
  9648. * | flow_id |
  9649. * |-------------------------------------------------------------------|
  9650. * | reserved0 | flow_pool_id |
  9651. * |-------------------------------------------------------------------|
  9652. * | reserved1 | flow_pool_size |
  9653. * |-------------------------------------------------------------------|
  9654. * | reserved2 |
  9655. * |-------------------------------------------------------------------|
  9656. * | . |
  9657. * | . |
  9658. * | . |
  9659. * |-------------------------------------------------------------------|
  9660. *
  9661. * Each payload is 5 DWORDS long and is interpreted as follows:
  9662. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9663. * this flow is associated. It can be VDEV, peer,
  9664. * or tid (AC). Based on enum htt_flow_type.
  9665. *
  9666. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9667. * object. For flow_type vdev it is set to the
  9668. * vdevid, for peer it is peerid and for tid, it is
  9669. * tid_num.
  9670. *
  9671. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9672. * in the host for this flow
  9673. * b'16:31 - reserved0: This field in reserved for the future. In case
  9674. * we have a hierarchical implementation (HCM) of
  9675. * pools, it can be used to indicate the ID of the
  9676. * parent-pool.
  9677. *
  9678. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9679. * Descriptors for this flow will be
  9680. * allocated from this pool in the host.
  9681. * b'16:31 - reserved1: This field in reserved for the future. In case
  9682. * we have a hierarchical implementation of pools,
  9683. * it can be used to indicate the max number of
  9684. * descriptors in the pool. The b'0:15 can be used
  9685. * to indicate min number of descriptors in the
  9686. * HCM scheme.
  9687. *
  9688. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9689. * we have a hierarchical implementation of pools,
  9690. * b'0:15 can be used to indicate the
  9691. * priority-based borrowing (PBB) threshold of
  9692. * the flow's pool. The b'16:31 are still left
  9693. * reserved.
  9694. */
  9695. enum htt_flow_type {
  9696. FLOW_TYPE_VDEV = 0,
  9697. /* Insert new flow types above this line */
  9698. };
  9699. PREPACK struct htt_flow_pool_map_payload_t {
  9700. A_UINT32 flow_type;
  9701. A_UINT32 flow_id;
  9702. A_UINT32 flow_pool_id:16,
  9703. reserved0:16;
  9704. A_UINT32 flow_pool_size:16,
  9705. reserved1:16;
  9706. A_UINT32 reserved2;
  9707. } POSTPACK;
  9708. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9709. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9710. (sizeof(struct htt_flow_pool_map_payload_t))
  9711. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9712. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9713. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9714. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9715. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9716. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9717. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9718. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9719. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9720. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9721. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9722. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9723. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9724. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9725. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9726. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9727. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9728. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9729. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9730. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9731. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9732. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9733. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9734. do { \
  9735. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9736. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9737. } while (0)
  9738. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9739. do { \
  9740. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9741. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9742. } while (0)
  9743. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9744. do { \
  9745. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9746. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9747. } while (0)
  9748. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9749. do { \
  9750. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9751. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9752. } while (0)
  9753. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9754. do { \
  9755. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9756. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9757. } while (0)
  9758. /**
  9759. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9760. *
  9761. * @details
  9762. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9763. * down a flow of descriptors.
  9764. * This message indicates that for the flow (whose ID is provided) is wanting
  9765. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9766. * pool of descriptors from where descriptors are being allocated for this
  9767. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9768. * be unmapped by the host.
  9769. *
  9770. * The message would appear as follows:
  9771. *
  9772. * |31 24|23 16|15 8|7 0|
  9773. * |----------------+----------------+----------------+----------------|
  9774. * | reserved0 | msg_type |
  9775. * |-------------------------------------------------------------------|
  9776. * | flow_type |
  9777. * |-------------------------------------------------------------------|
  9778. * | flow_id |
  9779. * |-------------------------------------------------------------------|
  9780. * | reserved1 | flow_pool_id |
  9781. * |-------------------------------------------------------------------|
  9782. *
  9783. * The message is interpreted as follows:
  9784. * dword0 - b'0:7 - msg_type: This will be set to
  9785. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9786. * b'8:31 - reserved0: Reserved for future use
  9787. *
  9788. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9789. * this flow is associated. It can be VDEV, peer,
  9790. * or tid (AC). Based on enum htt_flow_type.
  9791. *
  9792. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9793. * object. For flow_type vdev it is set to the
  9794. * vdevid, for peer it is peerid and for tid, it is
  9795. * tid_num.
  9796. *
  9797. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9798. * used in the host for this flow
  9799. * b'16:31 - reserved0: This field in reserved for the future.
  9800. *
  9801. */
  9802. PREPACK struct htt_flow_pool_unmap_t {
  9803. A_UINT32 msg_type:8,
  9804. reserved0:24;
  9805. A_UINT32 flow_type;
  9806. A_UINT32 flow_id;
  9807. A_UINT32 flow_pool_id:16,
  9808. reserved1:16;
  9809. } POSTPACK;
  9810. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9811. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9812. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9813. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9814. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9815. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9816. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9817. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9818. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9819. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9820. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9821. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9822. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9823. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9824. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9825. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9826. do { \
  9827. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9828. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9829. } while (0)
  9830. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9831. do { \
  9832. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9833. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9834. } while (0)
  9835. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9836. do { \
  9837. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9838. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9839. } while (0)
  9840. /**
  9841. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9842. *
  9843. * @details
  9844. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9845. * SRNG ring setup is done
  9846. *
  9847. * This message indicates whether the last setup operation is successful.
  9848. * It will be sent to host when host set respose_required bit in
  9849. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9850. * The message would appear as follows:
  9851. *
  9852. * |31 24|23 16|15 8|7 0|
  9853. * |--------------- +----------------+----------------+----------------|
  9854. * | setup_status | ring_id | pdev_id | msg_type |
  9855. * |-------------------------------------------------------------------|
  9856. *
  9857. * The message is interpreted as follows:
  9858. * dword0 - b'0:7 - msg_type: This will be set to
  9859. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9860. * b'8:15 - pdev_id:
  9861. * 0 (for rings at SOC/UMAC level),
  9862. * 1/2/3 mac id (for rings at LMAC level)
  9863. * b'16:23 - ring_id: Identify the ring which is set up
  9864. * More details can be got from enum htt_srng_ring_id
  9865. * b'24:31 - setup_status: Indicate status of setup operation
  9866. * Refer to htt_ring_setup_status
  9867. */
  9868. PREPACK struct htt_sring_setup_done_t {
  9869. A_UINT32 msg_type: 8,
  9870. pdev_id: 8,
  9871. ring_id: 8,
  9872. setup_status: 8;
  9873. } POSTPACK;
  9874. enum htt_ring_setup_status {
  9875. htt_ring_setup_status_ok = 0,
  9876. htt_ring_setup_status_error,
  9877. };
  9878. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9879. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9880. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9881. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9882. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9883. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9884. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9885. do { \
  9886. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9887. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9888. } while (0)
  9889. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9890. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9891. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9892. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9893. HTT_SRING_SETUP_DONE_RING_ID_S)
  9894. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9895. do { \
  9896. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9897. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9898. } while (0)
  9899. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9900. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9901. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9902. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9903. HTT_SRING_SETUP_DONE_STATUS_S)
  9904. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9905. do { \
  9906. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9907. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9908. } while (0)
  9909. /**
  9910. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9911. *
  9912. * @details
  9913. * HTT TX map flow entry with tqm flow pointer
  9914. * Sent from firmware to host to add tqm flow pointer in corresponding
  9915. * flow search entry. Flow metadata is replayed back to host as part of this
  9916. * struct to enable host to find the specific flow search entry
  9917. *
  9918. * The message would appear as follows:
  9919. *
  9920. * |31 28|27 18|17 14|13 8|7 0|
  9921. * |-------+------------------------------------------+----------------|
  9922. * | rsvd0 | fse_hsh_idx | msg_type |
  9923. * |-------------------------------------------------------------------|
  9924. * | rsvd1 | tid | peer_id |
  9925. * |-------------------------------------------------------------------|
  9926. * | tqm_flow_pntr_lo |
  9927. * |-------------------------------------------------------------------|
  9928. * | tqm_flow_pntr_hi |
  9929. * |-------------------------------------------------------------------|
  9930. * | fse_meta_data |
  9931. * |-------------------------------------------------------------------|
  9932. *
  9933. * The message is interpreted as follows:
  9934. *
  9935. * dword0 - b'0:7 - msg_type: This will be set to
  9936. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9937. *
  9938. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9939. * for this flow entry
  9940. *
  9941. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9942. *
  9943. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9944. *
  9945. * dword1 - b'14:17 - tid
  9946. *
  9947. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9948. *
  9949. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9950. *
  9951. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9952. *
  9953. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9954. * given by host
  9955. */
  9956. PREPACK struct htt_tx_map_flow_info {
  9957. A_UINT32
  9958. msg_type: 8,
  9959. fse_hsh_idx: 20,
  9960. rsvd0: 4;
  9961. A_UINT32
  9962. peer_id: 14,
  9963. tid: 4,
  9964. rsvd1: 14;
  9965. A_UINT32 tqm_flow_pntr_lo;
  9966. A_UINT32 tqm_flow_pntr_hi;
  9967. struct htt_tx_flow_metadata fse_meta_data;
  9968. } POSTPACK;
  9969. /* DWORD 0 */
  9970. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9971. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9972. /* DWORD 1 */
  9973. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9974. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9975. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9976. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9977. /* DWORD 0 */
  9978. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9979. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9980. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9981. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9982. do { \
  9983. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9984. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9985. } while (0)
  9986. /* DWORD 1 */
  9987. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9988. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9989. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9990. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9991. do { \
  9992. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9993. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9994. } while (0)
  9995. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9996. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9997. HTT_TX_MAP_FLOW_INFO_TID_S)
  9998. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9999. do { \
  10000. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  10001. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  10002. } while (0)
  10003. /*
  10004. * htt_dbg_ext_stats_status -
  10005. * present - The requested stats have been delivered in full.
  10006. * This indicates that either the stats information was contained
  10007. * in its entirety within this message, or else this message
  10008. * completes the delivery of the requested stats info that was
  10009. * partially delivered through earlier STATS_CONF messages.
  10010. * partial - The requested stats have been delivered in part.
  10011. * One or more subsequent STATS_CONF messages with the same
  10012. * cookie value will be sent to deliver the remainder of the
  10013. * information.
  10014. * error - The requested stats could not be delivered, for example due
  10015. * to a shortage of memory to construct a message holding the
  10016. * requested stats.
  10017. * invalid - The requested stat type is either not recognized, or the
  10018. * target is configured to not gather the stats type in question.
  10019. */
  10020. enum htt_dbg_ext_stats_status {
  10021. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  10022. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  10023. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  10024. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  10025. };
  10026. /**
  10027. * @brief target -> host ppdu stats upload
  10028. *
  10029. * @details
  10030. * The following field definitions describe the format of the HTT target
  10031. * to host ppdu stats indication message.
  10032. *
  10033. *
  10034. * |31 16|15 12|11 10|9 8|7 0 |
  10035. * |----------------------------------------------------------------------|
  10036. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  10037. * |----------------------------------------------------------------------|
  10038. * | ppdu_id |
  10039. * |----------------------------------------------------------------------|
  10040. * | Timestamp in us |
  10041. * |----------------------------------------------------------------------|
  10042. * | reserved |
  10043. * |----------------------------------------------------------------------|
  10044. * | type-specific stats info |
  10045. * | (see htt_ppdu_stats.h) |
  10046. * |----------------------------------------------------------------------|
  10047. * Header fields:
  10048. * - MSG_TYPE
  10049. * Bits 7:0
  10050. * Purpose: Identifies this is a PPDU STATS indication
  10051. * message.
  10052. * Value: 0x1d
  10053. * - mac_id
  10054. * Bits 9:8
  10055. * Purpose: mac_id of this ppdu_id
  10056. * Value: 0-3
  10057. * - pdev_id
  10058. * Bits 11:10
  10059. * Purpose: pdev_id of this ppdu_id
  10060. * Value: 0-3
  10061. * 0 (for rings at SOC level),
  10062. * 1/2/3 PDEV -> 0/1/2
  10063. * - payload_size
  10064. * Bits 31:16
  10065. * Purpose: total tlv size
  10066. * Value: payload_size in bytes
  10067. */
  10068. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  10069. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  10070. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  10071. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  10072. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  10073. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  10074. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  10075. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  10076. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  10077. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  10078. do { \
  10079. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  10080. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  10081. } while (0)
  10082. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  10083. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  10084. HTT_T2H_PPDU_STATS_MAC_ID_S)
  10085. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  10086. do { \
  10087. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  10088. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  10089. } while (0)
  10090. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  10091. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  10092. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  10093. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  10094. do { \
  10095. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  10096. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  10097. } while (0)
  10098. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  10099. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  10100. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  10101. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  10102. do { \
  10103. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  10104. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  10105. } while (0)
  10106. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  10107. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  10108. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  10109. /* htt_t2h_ppdu_stats_ind_hdr_t
  10110. * This struct contains the fields within the header of the
  10111. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  10112. * stats info.
  10113. * This struct assumes little-endian layout, and thus is only
  10114. * suitable for use within processors known to be little-endian
  10115. * (such as the target).
  10116. * In contrast, the above macros provide endian-portable methods
  10117. * to get and set the bitfields within this PPDU_STATS_IND header.
  10118. */
  10119. typedef struct {
  10120. A_UINT32 msg_type: 8, /* bits 7:0 */
  10121. mac_id: 2, /* bits 9:8 */
  10122. pdev_id: 2, /* bits 11:10 */
  10123. reserved1: 4, /* bits 15:12 */
  10124. payload_size: 16; /* bits 31:16 */
  10125. A_UINT32 ppdu_id;
  10126. A_UINT32 timestamp_us;
  10127. A_UINT32 reserved2;
  10128. } htt_t2h_ppdu_stats_ind_hdr_t;
  10129. /**
  10130. * @brief target -> host extended statistics upload
  10131. *
  10132. * @details
  10133. * The following field definitions describe the format of the HTT target
  10134. * to host stats upload confirmation message.
  10135. * The message contains a cookie echoed from the HTT host->target stats
  10136. * upload request, which identifies which request the confirmation is
  10137. * for, and a single stats can span over multiple HTT stats indication
  10138. * due to the HTT message size limitation so every HTT ext stats indication
  10139. * will have tag-length-value stats information elements.
  10140. * The tag-length header for each HTT stats IND message also includes a
  10141. * status field, to indicate whether the request for the stat type in
  10142. * question was fully met, partially met, unable to be met, or invalid
  10143. * (if the stat type in question is disabled in the target).
  10144. * A Done bit 1's indicate the end of the of stats info elements.
  10145. *
  10146. *
  10147. * |31 16|15 12|11|10 8|7 5|4 0|
  10148. * |--------------------------------------------------------------|
  10149. * | reserved | msg type |
  10150. * |--------------------------------------------------------------|
  10151. * | cookie LSBs |
  10152. * |--------------------------------------------------------------|
  10153. * | cookie MSBs |
  10154. * |--------------------------------------------------------------|
  10155. * | stats entry length | rsvd | D| S | stat type |
  10156. * |--------------------------------------------------------------|
  10157. * | type-specific stats info |
  10158. * | (see htt_stats.h) |
  10159. * |--------------------------------------------------------------|
  10160. * Header fields:
  10161. * - MSG_TYPE
  10162. * Bits 7:0
  10163. * Purpose: Identifies this is a extended statistics upload confirmation
  10164. * message.
  10165. * Value: 0x1c
  10166. * - COOKIE_LSBS
  10167. * Bits 31:0
  10168. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10169. * message with its preceding host->target stats request message.
  10170. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10171. * - COOKIE_MSBS
  10172. * Bits 31:0
  10173. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10174. * message with its preceding host->target stats request message.
  10175. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10176. *
  10177. * Stats Information Element tag-length header fields:
  10178. * - STAT_TYPE
  10179. * Bits 7:0
  10180. * Purpose: identifies the type of statistics info held in the
  10181. * following information element
  10182. * Value: htt_dbg_ext_stats_type
  10183. * - STATUS
  10184. * Bits 10:8
  10185. * Purpose: indicate whether the requested stats are present
  10186. * Value: htt_dbg_ext_stats_status
  10187. * - DONE
  10188. * Bits 11
  10189. * Purpose:
  10190. * Indicates the completion of the stats entry, this will be the last
  10191. * stats conf HTT segment for the requested stats type.
  10192. * Value:
  10193. * 0 -> the stats retrieval is ongoing
  10194. * 1 -> the stats retrieval is complete
  10195. * - LENGTH
  10196. * Bits 31:16
  10197. * Purpose: indicate the stats information size
  10198. * Value: This field specifies the number of bytes of stats information
  10199. * that follows the element tag-length header.
  10200. * It is expected but not required that this length is a multiple of
  10201. * 4 bytes.
  10202. */
  10203. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  10204. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  10205. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  10206. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  10207. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  10208. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  10209. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  10210. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  10211. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  10212. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10213. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  10214. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  10215. do { \
  10216. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  10217. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  10218. } while (0)
  10219. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  10220. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  10221. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  10222. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  10223. do { \
  10224. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  10225. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  10226. } while (0)
  10227. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  10228. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  10229. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  10230. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  10231. do { \
  10232. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  10233. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  10234. } while (0)
  10235. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  10236. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  10237. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  10238. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10239. do { \
  10240. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  10241. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  10242. } while (0)
  10243. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  10244. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  10245. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  10246. typedef enum {
  10247. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  10248. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  10249. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  10250. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  10251. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  10252. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  10253. /* Reserved from 128 - 255 for target internal use.*/
  10254. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  10255. } HTT_PEER_TYPE;
  10256. /** 2 word representation of MAC addr */
  10257. typedef struct {
  10258. /** upper 4 bytes of MAC address */
  10259. A_UINT32 mac_addr31to0;
  10260. /** lower 2 bytes of MAC address */
  10261. A_UINT32 mac_addr47to32;
  10262. } htt_mac_addr;
  10263. /** macro to convert MAC address from char array to HTT word format */
  10264. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  10265. (phtt_mac_addr)->mac_addr31to0 = \
  10266. (((c_macaddr)[0] << 0) | \
  10267. ((c_macaddr)[1] << 8) | \
  10268. ((c_macaddr)[2] << 16) | \
  10269. ((c_macaddr)[3] << 24)); \
  10270. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  10271. } while (0)
  10272. /**
  10273. * @brief target -> host monitor mac header indication message
  10274. *
  10275. * @details
  10276. * The following diagram shows the format of the monitor mac header message
  10277. * sent from the target to the host.
  10278. * This message is primarily sent when promiscuous rx mode is enabled.
  10279. * One message is sent per rx PPDU.
  10280. *
  10281. * |31 24|23 16|15 8|7 0|
  10282. * |-------------------------------------------------------------|
  10283. * | peer_id | reserved0 | msg_type |
  10284. * |-------------------------------------------------------------|
  10285. * | reserved1 | num_mpdu |
  10286. * |-------------------------------------------------------------|
  10287. * | struct hw_rx_desc |
  10288. * | (see wal_rx_desc.h) |
  10289. * |-------------------------------------------------------------|
  10290. * | struct ieee80211_frame_addr4 |
  10291. * | (see ieee80211_defs.h) |
  10292. * |-------------------------------------------------------------|
  10293. * | struct ieee80211_frame_addr4 |
  10294. * | (see ieee80211_defs.h) |
  10295. * |-------------------------------------------------------------|
  10296. * | ...... |
  10297. * |-------------------------------------------------------------|
  10298. *
  10299. * Header fields:
  10300. * - msg_type
  10301. * Bits 7:0
  10302. * Purpose: Identifies this is a monitor mac header indication message.
  10303. * Value: 0x20
  10304. * - peer_id
  10305. * Bits 31:16
  10306. * Purpose: Software peer id given by host during association,
  10307. * During promiscuous mode, the peer ID will be invalid (0xFF)
  10308. * for rx PPDUs received from unassociated peers.
  10309. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  10310. * - num_mpdu
  10311. * Bits 15:0
  10312. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  10313. * delivered within the message.
  10314. * Value: 1 to 32
  10315. * num_mpdu is limited to a maximum value of 32, due to buffer
  10316. * size limits. For PPDUs with more than 32 MPDUs, only the
  10317. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  10318. * the PPDU will be provided.
  10319. */
  10320. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  10321. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  10322. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  10323. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  10324. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  10325. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  10326. do { \
  10327. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  10328. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  10329. } while (0)
  10330. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  10331. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  10332. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  10333. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  10334. do { \
  10335. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  10336. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  10337. } while (0)
  10338. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  10339. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  10340. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  10341. /**
  10342. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  10343. *
  10344. * @details
  10345. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  10346. * the flow pool associated with the specified ID is resized
  10347. *
  10348. * The message would appear as follows:
  10349. *
  10350. * |31 16|15 8|7 0|
  10351. * |---------------------------------+----------------+----------------|
  10352. * | reserved0 | Msg type |
  10353. * |-------------------------------------------------------------------|
  10354. * | flow pool new size | flow pool ID |
  10355. * |-------------------------------------------------------------------|
  10356. *
  10357. * The message is interpreted as follows:
  10358. * b'0:7 - msg_type: This will be set to
  10359. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  10360. *
  10361. * b'0:15 - flow pool ID: Existing flow pool ID
  10362. *
  10363. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  10364. *
  10365. */
  10366. PREPACK struct htt_flow_pool_resize_t {
  10367. A_UINT32 msg_type:8,
  10368. reserved0:24;
  10369. A_UINT32 flow_pool_id:16,
  10370. flow_pool_new_size:16;
  10371. } POSTPACK;
  10372. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  10373. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  10374. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  10375. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  10376. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  10377. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  10378. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  10379. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  10380. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  10381. do { \
  10382. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  10383. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  10384. } while (0)
  10385. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  10386. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  10387. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  10388. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  10389. do { \
  10390. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  10391. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  10392. } while (0)
  10393. /**
  10394. * @brief host -> target channel change message
  10395. *
  10396. * @details
  10397. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  10398. * to associate RX frames to correct channel they were received on.
  10399. * The following field definitions describe the format of the HTT target
  10400. * to host channel change message.
  10401. * |31 16|15 8|7 5|4 0|
  10402. * |------------------------------------------------------------|
  10403. * | reserved | MSG_TYPE |
  10404. * |------------------------------------------------------------|
  10405. * | CHAN_MHZ |
  10406. * |------------------------------------------------------------|
  10407. * | BAND_CENTER_FREQ1 |
  10408. * |------------------------------------------------------------|
  10409. * | BAND_CENTER_FREQ2 |
  10410. * |------------------------------------------------------------|
  10411. * | CHAN_PHY_MODE |
  10412. * |------------------------------------------------------------|
  10413. * Header fields:
  10414. * - MSG_TYPE
  10415. * Bits 7:0
  10416. * Value: 0xf
  10417. * - CHAN_MHZ
  10418. * Bits 31:0
  10419. * Purpose: frequency of the primary 20mhz channel.
  10420. * - BAND_CENTER_FREQ1
  10421. * Bits 31:0
  10422. * Purpose: centre frequency of the full channel.
  10423. * - BAND_CENTER_FREQ2
  10424. * Bits 31:0
  10425. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  10426. * - CHAN_PHY_MODE
  10427. * Bits 31:0
  10428. * Purpose: phy mode of the channel.
  10429. */
  10430. PREPACK struct htt_chan_change_msg {
  10431. A_UINT32 chan_mhz; /* frequency in mhz */
  10432. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  10433. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  10434. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  10435. } POSTPACK;
  10436. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  10437. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  10438. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  10439. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  10440. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  10441. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  10442. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  10443. /*
  10444. * The read and write indices point to the data within the host buffer.
  10445. * Because the first 4 bytes of the host buffer is used for the read index and
  10446. * the next 4 bytes for the write index, the data itself starts at offset 8.
  10447. * The read index and write index are the byte offsets from the base of the
  10448. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  10449. * Refer the ASCII text picture below.
  10450. */
  10451. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  10452. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  10453. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  10454. /*
  10455. ***************************************************************************
  10456. *
  10457. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10458. *
  10459. ***************************************************************************
  10460. *
  10461. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  10462. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  10463. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  10464. * written into the Host memory region mentioned below.
  10465. *
  10466. * Read index is updated by the Host. At any point of time, the read index will
  10467. * indicate the index that will next be read by the Host. The read index is
  10468. * in units of bytes offset from the base of the meta-data buffer.
  10469. *
  10470. * Write index is updated by the FW. At any point of time, the write index will
  10471. * indicate from where the FW can start writing any new data. The write index is
  10472. * in units of bytes offset from the base of the meta-data buffer.
  10473. *
  10474. * If the Host is not fast enough in reading the CFR data, any new capture data
  10475. * would be dropped if there is no space left to write the new captures.
  10476. *
  10477. * The last 4 bytes of the memory region will have the magic pattern
  10478. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  10479. * not overrun the host buffer.
  10480. *
  10481. * ,--------------------. read and write indices store the
  10482. * | | byte offset from the base of the
  10483. * | ,--------+--------. meta-data buffer to the next
  10484. * | | | | location within the data buffer
  10485. * | | v v that will be read / written
  10486. * ************************************************************************
  10487. * * Read * Write * * Magic *
  10488. * * index * index * CFR data1 ...... CFR data N * pattern *
  10489. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  10490. * ************************************************************************
  10491. * |<---------- data buffer ---------->|
  10492. *
  10493. * |<----------------- meta-data buffer allocated in Host ----------------|
  10494. *
  10495. * Note:
  10496. * - Considering the 4 bytes needed to store the Read index (R) and the
  10497. * Write index (W), the initial value is as follows:
  10498. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  10499. * - Buffer empty condition:
  10500. * R = W
  10501. *
  10502. * Regarding CFR data format:
  10503. * --------------------------
  10504. *
  10505. * Each CFR tone is stored in HW as 16-bits with the following format:
  10506. * {bits[15:12], bits[11:6], bits[5:0]} =
  10507. * {unsigned exponent (4 bits),
  10508. * signed mantissa_real (6 bits),
  10509. * signed mantissa_imag (6 bits)}
  10510. *
  10511. * CFR_real = mantissa_real * 2^(exponent-5)
  10512. * CFR_imag = mantissa_imag * 2^(exponent-5)
  10513. *
  10514. *
  10515. * The CFR data is written to the 16-bit unsigned output array (buff) in
  10516. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  10517. *
  10518. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  10519. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  10520. * .
  10521. * .
  10522. * .
  10523. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  10524. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  10525. */
  10526. /* Bandwidth of peer CFR captures */
  10527. typedef enum {
  10528. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  10529. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  10530. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  10531. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  10532. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  10533. HTT_PEER_CFR_CAPTURE_BW_MAX,
  10534. } HTT_PEER_CFR_CAPTURE_BW;
  10535. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  10536. * was captured
  10537. */
  10538. typedef enum {
  10539. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  10540. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  10541. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  10542. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  10543. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  10544. } HTT_PEER_CFR_CAPTURE_MODE;
  10545. typedef enum {
  10546. /* This message type is currently used for the below purpose:
  10547. *
  10548. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  10549. * wmi_peer_cfr_capture_cmd.
  10550. * If payload_present bit is set to 0 then the associated memory region
  10551. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  10552. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  10553. * message; the CFR dump will be present at the end of the message,
  10554. * after the chan_phy_mode.
  10555. */
  10556. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  10557. /* Always keep this last */
  10558. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  10559. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  10560. /**
  10561. * @brief target -> host CFR dump completion indication message definition
  10562. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  10563. *
  10564. * @details
  10565. * The following diagram shows the format of the Channel Frequency Response
  10566. * (CFR) dump completion indication. This inidcation is sent to the Host when
  10567. * the channel capture of a peer is copied by Firmware into the Host memory
  10568. *
  10569. * **************************************************************************
  10570. *
  10571. * Message format when the CFR capture message type is
  10572. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10573. *
  10574. * **************************************************************************
  10575. *
  10576. * |31 16|15 |8|7 0|
  10577. * |----------------------------------------------------------------|
  10578. * header: | reserved |P| msg_type |
  10579. * word 0 | | | |
  10580. * |----------------------------------------------------------------|
  10581. * payload: | cfr_capture_msg_type |
  10582. * word 1 | |
  10583. * |----------------------------------------------------------------|
  10584. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  10585. * word 2 | | | | | | | | |
  10586. * |----------------------------------------------------------------|
  10587. * | mac_addr31to0 |
  10588. * word 3 | |
  10589. * |----------------------------------------------------------------|
  10590. * | unused / reserved | mac_addr47to32 |
  10591. * word 4 | | |
  10592. * |----------------------------------------------------------------|
  10593. * | index |
  10594. * word 5 | |
  10595. * |----------------------------------------------------------------|
  10596. * | length |
  10597. * word 6 | |
  10598. * |----------------------------------------------------------------|
  10599. * | timestamp |
  10600. * word 7 | |
  10601. * |----------------------------------------------------------------|
  10602. * | counter |
  10603. * word 8 | |
  10604. * |----------------------------------------------------------------|
  10605. * | chan_mhz |
  10606. * word 9 | |
  10607. * |----------------------------------------------------------------|
  10608. * | band_center_freq1 |
  10609. * word 10 | |
  10610. * |----------------------------------------------------------------|
  10611. * | band_center_freq2 |
  10612. * word 11 | |
  10613. * |----------------------------------------------------------------|
  10614. * | chan_phy_mode |
  10615. * word 12 | |
  10616. * |----------------------------------------------------------------|
  10617. * where,
  10618. * P - payload present bit (payload_present explained below)
  10619. * req_id - memory request id (mem_req_id explained below)
  10620. * S - status field (status explained below)
  10621. * capbw - capture bandwidth (capture_bw explained below)
  10622. * mode - mode of capture (mode explained below)
  10623. * sts - space time streams (sts_count explained below)
  10624. * chbw - channel bandwidth (channel_bw explained below)
  10625. * captype - capture type (cap_type explained below)
  10626. *
  10627. * The following field definitions describe the format of the CFR dump
  10628. * completion indication sent from the target to the host
  10629. *
  10630. * Header fields:
  10631. *
  10632. * Word 0
  10633. * - msg_type
  10634. * Bits 7:0
  10635. * Purpose: Identifies this as CFR TX completion indication
  10636. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10637. * - payload_present
  10638. * Bit 8
  10639. * Purpose: Identifies how CFR data is sent to host
  10640. * Value: 0 - If CFR Payload is written to host memory
  10641. * 1 - If CFR Payload is sent as part of HTT message
  10642. * (This is the requirement for SDIO/USB where it is
  10643. * not possible to write CFR data to host memory)
  10644. * - reserved
  10645. * Bits 31:9
  10646. * Purpose: Reserved
  10647. * Value: 0
  10648. *
  10649. * Payload fields:
  10650. *
  10651. * Word 1
  10652. * - cfr_capture_msg_type
  10653. * Bits 31:0
  10654. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10655. * to specify the format used for the remainder of the message
  10656. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10657. * (currently only MSG_TYPE_1 is defined)
  10658. *
  10659. * Word 2
  10660. * - mem_req_id
  10661. * Bits 6:0
  10662. * Purpose: Contain the mem request id of the region where the CFR capture
  10663. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10664. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10665. this value is invalid)
  10666. * - status
  10667. * Bit 7
  10668. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10669. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10670. * - capture_bw
  10671. * Bits 10:8
  10672. * Purpose: Carry the bandwidth of the CFR capture
  10673. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10674. * - mode
  10675. * Bits 13:11
  10676. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10677. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10678. * - sts_count
  10679. * Bits 16:14
  10680. * Purpose: Carry the number of space time streams
  10681. * Value: Number of space time streams
  10682. * - channel_bw
  10683. * Bits 19:17
  10684. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10685. * measurement
  10686. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10687. * - cap_type
  10688. * Bits 23:20
  10689. * Purpose: Carry the type of the capture
  10690. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10691. * - vdev_id
  10692. * Bits 31:24
  10693. * Purpose: Carry the virtual device id
  10694. * Value: vdev ID
  10695. *
  10696. * Word 3
  10697. * - mac_addr31to0
  10698. * Bits 31:0
  10699. * Purpose: Contain the bits 31:0 of the peer MAC address
  10700. * Value: Bits 31:0 of the peer MAC address
  10701. *
  10702. * Word 4
  10703. * - mac_addr47to32
  10704. * Bits 15:0
  10705. * Purpose: Contain the bits 47:32 of the peer MAC address
  10706. * Value: Bits 47:32 of the peer MAC address
  10707. *
  10708. * Word 5
  10709. * - index
  10710. * Bits 31:0
  10711. * Purpose: Contain the index at which this CFR dump was written in the Host
  10712. * allocated memory. This index is the number of bytes from the base address.
  10713. * Value: Index position
  10714. *
  10715. * Word 6
  10716. * - length
  10717. * Bits 31:0
  10718. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10719. * Value: Length of the CFR capture of the peer
  10720. *
  10721. * Word 7
  10722. * - timestamp
  10723. * Bits 31:0
  10724. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10725. * clock used for this timestamp is private to the target and not visible to
  10726. * the host i.e., Host can interpret only the relative timestamp deltas from
  10727. * one message to the next, but can't interpret the absolute timestamp from a
  10728. * single message.
  10729. * Value: Timestamp in microseconds
  10730. *
  10731. * Word 8
  10732. * - counter
  10733. * Bits 31:0
  10734. * Purpose: Carry the count of the current CFR capture from FW. This is
  10735. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10736. * in host memory)
  10737. * Value: Count of the current CFR capture
  10738. *
  10739. * Word 9
  10740. * - chan_mhz
  10741. * Bits 31:0
  10742. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10743. * Value: Primary 20 channel frequency
  10744. *
  10745. * Word 10
  10746. * - band_center_freq1
  10747. * Bits 31:0
  10748. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10749. * Value: Center frequency 1 in MHz
  10750. *
  10751. * Word 11
  10752. * - band_center_freq2
  10753. * Bits 31:0
  10754. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10755. * the VDEV
  10756. * 80plus80 mode
  10757. * Value: Center frequency 2 in MHz
  10758. *
  10759. * Word 12
  10760. * - chan_phy_mode
  10761. * Bits 31:0
  10762. * Purpose: Carry the phy mode of the channel, of the VDEV
  10763. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10764. */
  10765. PREPACK struct htt_cfr_dump_ind_type_1 {
  10766. A_UINT32 mem_req_id:7,
  10767. status:1,
  10768. capture_bw:3,
  10769. mode:3,
  10770. sts_count:3,
  10771. channel_bw:3,
  10772. cap_type:4,
  10773. vdev_id:8;
  10774. htt_mac_addr addr;
  10775. A_UINT32 index;
  10776. A_UINT32 length;
  10777. A_UINT32 timestamp;
  10778. A_UINT32 counter;
  10779. struct htt_chan_change_msg chan;
  10780. } POSTPACK;
  10781. PREPACK struct htt_cfr_dump_compl_ind {
  10782. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10783. union {
  10784. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10785. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10786. /* If there is a need to change the memory layout and its associated
  10787. * HTT indication format, a new CFR capture message type can be
  10788. * introduced and added into this union.
  10789. */
  10790. };
  10791. } POSTPACK;
  10792. /*
  10793. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10794. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10795. */
  10796. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10797. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10798. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10799. do { \
  10800. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10801. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10802. } while(0)
  10803. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10804. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10805. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10806. /*
  10807. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10808. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10809. */
  10810. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10811. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10812. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10813. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10814. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10815. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10816. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10817. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10818. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10819. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10820. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10821. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10822. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10823. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10824. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10825. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10826. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10827. do { \
  10828. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10829. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10830. } while (0)
  10831. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10832. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10833. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10834. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10835. do { \
  10836. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10837. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10838. } while (0)
  10839. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10840. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10841. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10842. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10843. do { \
  10844. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10845. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10846. } while (0)
  10847. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10848. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10849. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10850. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10851. do { \
  10852. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10853. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10854. } while (0)
  10855. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10856. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10857. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10858. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10859. do { \
  10860. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10861. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10862. } while (0)
  10863. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10864. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10865. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10866. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10867. do { \
  10868. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10869. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10870. } while (0)
  10871. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10872. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10873. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10874. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10875. do { \
  10876. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10877. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10878. } while (0)
  10879. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10880. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10881. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10882. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10883. do { \
  10884. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10885. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10886. } while (0)
  10887. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10888. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10889. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10890. /**
  10891. * @brief target -> host peer (PPDU) stats message
  10892. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10893. * @details
  10894. * This message is generated by FW when FW is sending stats to host
  10895. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10896. * This message is sent autonomously by the target rather than upon request
  10897. * by the host.
  10898. * The following field definitions describe the format of the HTT target
  10899. * to host peer stats indication message.
  10900. *
  10901. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10902. * or more PPDU stats records.
  10903. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10904. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10905. * then the message would start with the
  10906. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10907. * below.
  10908. *
  10909. * |31 16|15|14|13 11|10 9|8|7 0|
  10910. * |-------------------------------------------------------------|
  10911. * | reserved |MSG_TYPE |
  10912. * |-------------------------------------------------------------|
  10913. * rec 0 | TLV header |
  10914. * rec 0 |-------------------------------------------------------------|
  10915. * rec 0 | ppdu successful bytes |
  10916. * rec 0 |-------------------------------------------------------------|
  10917. * rec 0 | ppdu retry bytes |
  10918. * rec 0 |-------------------------------------------------------------|
  10919. * rec 0 | ppdu failed bytes |
  10920. * rec 0 |-------------------------------------------------------------|
  10921. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10922. * rec 0 |-------------------------------------------------------------|
  10923. * rec 0 | retried MSDUs | successful MSDUs |
  10924. * rec 0 |-------------------------------------------------------------|
  10925. * rec 0 | TX duration | failed MSDUs |
  10926. * rec 0 |-------------------------------------------------------------|
  10927. * ...
  10928. * |-------------------------------------------------------------|
  10929. * rec N | TLV header |
  10930. * rec N |-------------------------------------------------------------|
  10931. * rec N | ppdu successful bytes |
  10932. * rec N |-------------------------------------------------------------|
  10933. * rec N | ppdu retry bytes |
  10934. * rec N |-------------------------------------------------------------|
  10935. * rec N | ppdu failed bytes |
  10936. * rec N |-------------------------------------------------------------|
  10937. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10938. * rec N |-------------------------------------------------------------|
  10939. * rec N | retried MSDUs | successful MSDUs |
  10940. * rec N |-------------------------------------------------------------|
  10941. * rec N | TX duration | failed MSDUs |
  10942. * rec N |-------------------------------------------------------------|
  10943. *
  10944. * where:
  10945. * A = is A-MPDU flag
  10946. * BA = block-ack failure flags
  10947. * BW = bandwidth spec
  10948. * SG = SGI enabled spec
  10949. * S = skipped rate ctrl
  10950. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10951. *
  10952. * Header
  10953. * ------
  10954. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10955. * dword0 - b'8:31 - reserved : Reserved for future use
  10956. *
  10957. * payload include below peer_stats information
  10958. * --------------------------------------------
  10959. * @TLV : HTT_PPDU_STATS_INFO_TLV
  10960. * @tx_success_bytes : total successful bytes in the PPDU.
  10961. * @tx_retry_bytes : total retried bytes in the PPDU.
  10962. * @tx_failed_bytes : total failed bytes in the PPDU.
  10963. * @tx_ratecode : rate code used for the PPDU.
  10964. * @is_ampdu : Indicates PPDU is AMPDU or not.
  10965. * @ba_ack_failed : BA/ACK failed for this PPDU
  10966. * b00 -> BA received
  10967. * b01 -> BA failed once
  10968. * b10 -> BA failed twice, when HW retry is enabled.
  10969. * @bw : BW
  10970. * b00 -> 20 MHz
  10971. * b01 -> 40 MHz
  10972. * b10 -> 80 MHz
  10973. * b11 -> 160 MHz (or 80+80)
  10974. * @sg : SGI enabled
  10975. * @s : skipped ratectrl
  10976. * @peer_id : peer id
  10977. * @tx_success_msdus : successful MSDUs
  10978. * @tx_retry_msdus : retried MSDUs
  10979. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  10980. * @tx_duration : Tx duration for the PPDU (microsecond units)
  10981. */
  10982. /**
  10983. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  10984. *
  10985. * @details
  10986. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  10987. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  10988. * This message will only be sent if the backpressure condition has existed
  10989. * continuously for an initial period (100 ms).
  10990. * Repeat messages with updated information will be sent after each
  10991. * subsequent period (100 ms) as long as the backpressure remains unabated.
  10992. * This message indicates the ring id along with current head and tail index
  10993. * locations (i.e. write and read indices).
  10994. * The backpressure time indicates the time in ms for which continous
  10995. * backpressure has been observed in the ring.
  10996. *
  10997. * The message format is as follows:
  10998. *
  10999. * |31 24|23 16|15 8|7 0|
  11000. * |----------------+----------------+----------------+----------------|
  11001. * | ring_id | ring_type | pdev_id | msg_type |
  11002. * |-------------------------------------------------------------------|
  11003. * | tail_idx | head_idx |
  11004. * |-------------------------------------------------------------------|
  11005. * | backpressure_time_ms |
  11006. * |-------------------------------------------------------------------|
  11007. *
  11008. * The message is interpreted as follows:
  11009. * dword0 - b'0:7 - msg_type: This will be set to
  11010. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  11011. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  11012. * 1, 2, 3 indicates pdev_id 0,1,2 and
  11013. the msg is for LMAC ring.
  11014. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  11015. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  11016. * htt_backpressure_lmac_ring_id. This represents
  11017. * the ring id for which continous backpressure is seen
  11018. *
  11019. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  11020. * the ring indicated by the ring_id
  11021. *
  11022. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  11023. * the ring indicated by the ring id
  11024. *
  11025. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  11026. * backpressure has been seen in the ring
  11027. * indicated by the ring_id.
  11028. * Units = milliseconds
  11029. */
  11030. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  11031. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  11032. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  11033. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  11034. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  11035. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  11036. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  11037. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  11038. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  11039. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  11040. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  11041. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  11042. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  11043. do { \
  11044. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  11045. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  11046. } while (0)
  11047. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  11048. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  11049. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  11050. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  11051. do { \
  11052. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  11053. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  11054. } while (0)
  11055. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  11056. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  11057. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  11058. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  11059. do { \
  11060. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  11061. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  11062. } while (0)
  11063. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  11064. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  11065. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  11066. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  11067. do { \
  11068. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  11069. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  11070. } while (0)
  11071. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  11072. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  11073. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  11074. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  11075. do { \
  11076. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  11077. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  11078. } while (0)
  11079. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  11080. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  11081. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  11082. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  11083. do { \
  11084. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  11085. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  11086. } while (0)
  11087. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  11088. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  11089. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  11090. enum htt_backpressure_ring_type {
  11091. HTT_SW_RING_TYPE_UMAC,
  11092. HTT_SW_RING_TYPE_LMAC,
  11093. HTT_SW_RING_TYPE_MAX,
  11094. };
  11095. /* Ring id for which the message is sent to host */
  11096. enum htt_backpressure_umac_ringid {
  11097. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  11098. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  11099. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  11100. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  11101. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  11102. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  11103. HTT_SW_RING_IDX_REO_REO2FW_RING,
  11104. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  11105. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  11106. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  11107. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  11108. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  11109. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  11110. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  11111. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  11112. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  11113. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  11114. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  11115. HTT_SW_UMAC_RING_IDX_MAX,
  11116. };
  11117. enum htt_backpressure_lmac_ringid {
  11118. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  11119. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  11120. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  11121. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  11122. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  11123. HTT_SW_RING_IDX_RXDMA2FW_RING,
  11124. HTT_SW_RING_IDX_RXDMA2SW_RING,
  11125. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  11126. HTT_SW_RING_IDX_RXDMA2REO_RING,
  11127. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  11128. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  11129. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  11130. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  11131. HTT_SW_LMAC_RING_IDX_MAX,
  11132. };
  11133. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  11134. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  11135. pdev_id: 8,
  11136. ring_type: 8, /* htt_backpressure_ring_type */
  11137. /*
  11138. * ring_id holds an enum value from either
  11139. * htt_backpressure_umac_ringid or
  11140. * htt_backpressure_lmac_ringid, based on
  11141. * the ring_type setting.
  11142. */
  11143. ring_id: 8;
  11144. A_UINT16 head_idx;
  11145. A_UINT16 tail_idx;
  11146. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  11147. } POSTPACK;
  11148. #endif