htt.h 526 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615
  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. */
  175. #define HTT_CURRENT_VERSION_MAJOR 3
  176. #define HTT_CURRENT_VERSION_MINOR 63
  177. #define HTT_NUM_TX_FRAG_DESC 1024
  178. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  179. #define HTT_CHECK_SET_VAL(field, val) \
  180. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  181. /* macros to assist in sign-extending fields from HTT messages */
  182. #define HTT_SIGN_BIT_MASK(field) \
  183. ((field ## _M + (1 << field ## _S)) >> 1)
  184. #define HTT_SIGN_BIT(_val, field) \
  185. (_val & HTT_SIGN_BIT_MASK(field))
  186. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  187. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  188. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  189. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  190. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  191. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  192. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  193. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  194. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  195. /*
  196. * TEMPORARY:
  197. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  198. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  199. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  200. * updated.
  201. */
  202. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  203. /*
  204. * TEMPORARY:
  205. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  206. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  207. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  208. * updated.
  209. */
  210. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  211. /* HTT Access Category values */
  212. enum HTT_AC_WMM {
  213. /* WMM Access Categories */
  214. HTT_AC_WMM_BE = 0x0,
  215. HTT_AC_WMM_BK = 0x1,
  216. HTT_AC_WMM_VI = 0x2,
  217. HTT_AC_WMM_VO = 0x3,
  218. /* extension Access Categories */
  219. HTT_AC_EXT_NON_QOS = 0x4,
  220. HTT_AC_EXT_UCAST_MGMT = 0x5,
  221. HTT_AC_EXT_MCAST_DATA = 0x6,
  222. HTT_AC_EXT_MCAST_MGMT = 0x7,
  223. };
  224. enum HTT_AC_WMM_MASK {
  225. /* WMM Access Categories */
  226. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  227. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  228. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  229. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  230. /* extension Access Categories */
  231. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  232. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  233. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  234. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  235. };
  236. #define HTT_AC_MASK_WMM \
  237. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  238. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  239. #define HTT_AC_MASK_EXT \
  240. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  241. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  242. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  243. /*
  244. * htt_dbg_stats_type -
  245. * bit positions for each stats type within a stats type bitmask
  246. * The bitmask contains 24 bits.
  247. */
  248. enum htt_dbg_stats_type {
  249. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  250. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  251. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  252. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  253. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  254. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  255. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  256. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  257. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  258. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  259. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  260. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  261. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  262. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  263. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  264. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  265. /* bits 16-23 currently reserved */
  266. /* keep this last */
  267. HTT_DBG_NUM_STATS
  268. };
  269. /*=== HTT option selection TLVs ===
  270. * Certain HTT messages have alternatives or options.
  271. * For such cases, the host and target need to agree on which option to use.
  272. * Option specification TLVs can be appended to the VERSION_REQ and
  273. * VERSION_CONF messages to select options other than the default.
  274. * These TLVs are entirely optional - if they are not provided, there is a
  275. * well-defined default for each option. If they are provided, they can be
  276. * provided in any order. Each TLV can be present or absent independent of
  277. * the presence / absence of other TLVs.
  278. *
  279. * The HTT option selection TLVs use the following format:
  280. * |31 16|15 8|7 0|
  281. * |---------------------------------+----------------+----------------|
  282. * | value (payload) | length | tag |
  283. * |-------------------------------------------------------------------|
  284. * The value portion need not be only 2 bytes; it can be extended by any
  285. * integer number of 4-byte units. The total length of the TLV, including
  286. * the tag and length fields, must be a multiple of 4 bytes. The length
  287. * field specifies the total TLV size in 4-byte units. Thus, the typical
  288. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  289. * field, would store 0x1 in its length field, to show that the TLV occupies
  290. * a single 4-byte unit.
  291. */
  292. /*--- TLV header format - applies to all HTT option TLVs ---*/
  293. enum HTT_OPTION_TLV_TAGS {
  294. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  295. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  296. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  297. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  298. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  299. };
  300. PREPACK struct htt_option_tlv_header_t {
  301. A_UINT8 tag;
  302. A_UINT8 length;
  303. } POSTPACK;
  304. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  305. #define HTT_OPTION_TLV_TAG_S 0
  306. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  307. #define HTT_OPTION_TLV_LENGTH_S 8
  308. /*
  309. * value0 - 16 bit value field stored in word0
  310. * The TLV's value field may be longer than 2 bytes, in which case
  311. * the remainder of the value is stored in word1, word2, etc.
  312. */
  313. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  314. #define HTT_OPTION_TLV_VALUE0_S 16
  315. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  316. do { \
  317. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  318. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  319. } while (0)
  320. #define HTT_OPTION_TLV_TAG_GET(word) \
  321. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  322. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  323. do { \
  324. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  325. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  326. } while (0)
  327. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  328. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  329. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  330. do { \
  331. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  332. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  333. } while (0)
  334. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  335. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  336. /*--- format of specific HTT option TLVs ---*/
  337. /*
  338. * HTT option TLV for specifying LL bus address size
  339. * Some chips require bus addresses used by the target to access buffers
  340. * within the host's memory to be 32 bits; others require bus addresses
  341. * used by the target to access buffers within the host's memory to be
  342. * 64 bits.
  343. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  344. * a suffix to the VERSION_CONF message to specify which bus address format
  345. * the target requires.
  346. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  347. * default to providing bus addresses to the target in 32-bit format.
  348. */
  349. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  350. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  351. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  352. };
  353. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  354. struct htt_option_tlv_header_t hdr;
  355. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  356. } POSTPACK;
  357. /*
  358. * HTT option TLV for specifying whether HL systems should indicate
  359. * over-the-air tx completion for individual frames, or should instead
  360. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  361. * requests an OTA tx completion for a particular tx frame.
  362. * This option does not apply to LL systems, where the TX_COMPL_IND
  363. * is mandatory.
  364. * This option is primarily intended for HL systems in which the tx frame
  365. * downloads over the host --> target bus are as slow as or slower than
  366. * the transmissions over the WLAN PHY. For cases where the bus is faster
  367. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  368. * and consquently will send one TX_COMPL_IND message that covers several
  369. * tx frames. For cases where the WLAN PHY is faster than the bus,
  370. * the target will end up transmitting very short A-MPDUs, and consequently
  371. * sending many TX_COMPL_IND messages, which each cover a very small number
  372. * of tx frames.
  373. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  374. * a suffix to the VERSION_REQ message to request whether the host desires to
  375. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  376. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  377. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  378. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  379. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  380. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  381. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  382. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  383. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  384. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  385. * TLV.
  386. */
  387. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  388. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  389. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  390. };
  391. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  392. struct htt_option_tlv_header_t hdr;
  393. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  394. } POSTPACK;
  395. /*
  396. * HTT option TLV for specifying how many tx queue groups the target
  397. * may establish.
  398. * This TLV specifies the maximum value the target may send in the
  399. * txq_group_id field of any TXQ_GROUP information elements sent by
  400. * the target to the host. This allows the host to pre-allocate an
  401. * appropriate number of tx queue group structs.
  402. *
  403. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  404. * a suffix to the VERSION_REQ message to specify whether the host supports
  405. * tx queue groups at all, and if so if there is any limit on the number of
  406. * tx queue groups that the host supports.
  407. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  408. * a suffix to the VERSION_CONF message. If the host has specified in the
  409. * VER_REQ message a limit on the number of tx queue groups the host can
  410. * supprt, the target shall limit its specification of the maximum tx groups
  411. * to be no larger than this host-specified limit.
  412. *
  413. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  414. * shall preallocate 4 tx queue group structs, and the target shall not
  415. * specify a txq_group_id larger than 3.
  416. */
  417. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  418. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  419. /*
  420. * values 1 through N specify the max number of tx queue groups
  421. * the sender supports
  422. */
  423. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  424. };
  425. /* TEMPORARY backwards-compatibility alias for a typo fix -
  426. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  427. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  428. * to support the old name (with the typo) until all references to the
  429. * old name are replaced with the new name.
  430. */
  431. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  432. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  433. struct htt_option_tlv_header_t hdr;
  434. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  435. } POSTPACK;
  436. /*
  437. * HTT option TLV for specifying whether the target supports an extended
  438. * version of the HTT tx descriptor. If the target provides this TLV
  439. * and specifies in the TLV that the target supports an extended version
  440. * of the HTT tx descriptor, the target must check the "extension" bit in
  441. * the HTT tx descriptor, and if the extension bit is set, to expect a
  442. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  443. * descriptor. Furthermore, the target must provide room for the HTT
  444. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  445. * This option is intended for systems where the host needs to explicitly
  446. * control the transmission parameters such as tx power for individual
  447. * tx frames.
  448. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  449. * as a suffix to the VERSION_CONF message to explicitly specify whether
  450. * the target supports the HTT tx MSDU extension descriptor.
  451. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  452. * by the host as lack of target support for the HTT tx MSDU extension
  453. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  454. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  455. * the HTT tx MSDU extension descriptor.
  456. * The host is not required to provide the HTT tx MSDU extension descriptor
  457. * just because the target supports it; the target must check the
  458. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  459. * extension descriptor is present.
  460. */
  461. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  462. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  463. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  464. };
  465. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  466. struct htt_option_tlv_header_t hdr;
  467. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  468. } POSTPACK;
  469. /*=== host -> target messages ===============================================*/
  470. enum htt_h2t_msg_type {
  471. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  472. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  473. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  474. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  475. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  476. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  477. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  478. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  479. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  480. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  481. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  482. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  483. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  484. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  485. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  486. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  487. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  488. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  489. /* keep this last */
  490. HTT_H2T_NUM_MSGS
  491. };
  492. /*
  493. * HTT host to target message type -
  494. * stored in bits 7:0 of the first word of the message
  495. */
  496. #define HTT_H2T_MSG_TYPE_M 0xff
  497. #define HTT_H2T_MSG_TYPE_S 0
  498. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  499. do { \
  500. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  501. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  502. } while (0)
  503. #define HTT_H2T_MSG_TYPE_GET(word) \
  504. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  505. /**
  506. * @brief host -> target version number request message definition
  507. *
  508. * |31 24|23 16|15 8|7 0|
  509. * |----------------+----------------+----------------+----------------|
  510. * | reserved | msg type |
  511. * |-------------------------------------------------------------------|
  512. * : option request TLV (optional) |
  513. * :...................................................................:
  514. *
  515. * The VER_REQ message may consist of a single 4-byte word, or may be
  516. * extended with TLVs that specify which HTT options the host is requesting
  517. * from the target.
  518. * The following option TLVs may be appended to the VER_REQ message:
  519. * - HL_SUPPRESS_TX_COMPL_IND
  520. * - HL_MAX_TX_QUEUE_GROUPS
  521. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  522. * may be appended to the VER_REQ message (but only one TLV of each type).
  523. *
  524. * Header fields:
  525. * - MSG_TYPE
  526. * Bits 7:0
  527. * Purpose: identifies this as a version number request message
  528. * Value: 0x0
  529. */
  530. #define HTT_VER_REQ_BYTES 4
  531. /* TBDXXX: figure out a reasonable number */
  532. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  533. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  534. /**
  535. * @brief HTT tx MSDU descriptor
  536. *
  537. * @details
  538. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  539. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  540. * the target firmware needs for the FW's tx processing, particularly
  541. * for creating the HW msdu descriptor.
  542. * The same HTT tx descriptor is used for HL and LL systems, though
  543. * a few fields within the tx descriptor are used only by LL or
  544. * only by HL.
  545. * The HTT tx descriptor is defined in two manners: by a struct with
  546. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  547. * definitions.
  548. * The target should use the struct def, for simplicitly and clarity,
  549. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  550. * neutral. Specifically, the host shall use the get/set macros built
  551. * around the mask + shift defs.
  552. */
  553. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  554. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  555. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  556. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  557. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  558. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  559. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  560. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  561. #define HTT_TX_VDEV_ID_WORD 0
  562. #define HTT_TX_VDEV_ID_MASK 0x3f
  563. #define HTT_TX_VDEV_ID_SHIFT 16
  564. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  565. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  566. #define HTT_TX_MSDU_LEN_DWORD 1
  567. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  568. /*
  569. * HTT_VAR_PADDR macros
  570. * Allow physical / bus addresses to be either a single 32-bit value,
  571. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  572. */
  573. #define HTT_VAR_PADDR32(var_name) \
  574. A_UINT32 var_name
  575. #define HTT_VAR_PADDR64_LE(var_name) \
  576. struct { \
  577. /* little-endian: lo precedes hi */ \
  578. A_UINT32 lo; \
  579. A_UINT32 hi; \
  580. } var_name
  581. /*
  582. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  583. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  584. * addresses are stored in a XXX-bit field.
  585. * This macro is used to define both htt_tx_msdu_desc32_t and
  586. * htt_tx_msdu_desc64_t structs.
  587. */
  588. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  589. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  590. { \
  591. /* DWORD 0: flags and meta-data */ \
  592. A_UINT32 \
  593. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  594. \
  595. /* pkt_subtype - \
  596. * Detailed specification of the tx frame contents, extending the \
  597. * general specification provided by pkt_type. \
  598. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  599. * pkt_type | pkt_subtype \
  600. * ============================================================== \
  601. * 802.3 | bit 0:3 - Reserved \
  602. * | bit 4: 0x0 - Copy-Engine Classification Results \
  603. * | not appended to the HTT message \
  604. * | 0x1 - Copy-Engine Classification Results \
  605. * | appended to the HTT message in the \
  606. * | format: \
  607. * | [HTT tx desc, frame header, \
  608. * | CE classification results] \
  609. * | The CE classification results begin \
  610. * | at the next 4-byte boundary after \
  611. * | the frame header. \
  612. * ------------+------------------------------------------------- \
  613. * Eth2 | bit 0:3 - Reserved \
  614. * | bit 4: 0x0 - Copy-Engine Classification Results \
  615. * | not appended to the HTT message \
  616. * | 0x1 - Copy-Engine Classification Results \
  617. * | appended to the HTT message. \
  618. * | See the above specification of the \
  619. * | CE classification results location. \
  620. * ------------+------------------------------------------------- \
  621. * native WiFi | bit 0:3 - Reserved \
  622. * | bit 4: 0x0 - Copy-Engine Classification Results \
  623. * | not appended to the HTT message \
  624. * | 0x1 - Copy-Engine Classification Results \
  625. * | appended to the HTT message. \
  626. * | See the above specification of the \
  627. * | CE classification results location. \
  628. * ------------+------------------------------------------------- \
  629. * mgmt | 0x0 - 802.11 MAC header absent \
  630. * | 0x1 - 802.11 MAC header present \
  631. * ------------+------------------------------------------------- \
  632. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  633. * | 0x1 - 802.11 MAC header present \
  634. * | bit 1: 0x0 - allow aggregation \
  635. * | 0x1 - don't allow aggregation \
  636. * | bit 2: 0x0 - perform encryption \
  637. * | 0x1 - don't perform encryption \
  638. * | bit 3: 0x0 - perform tx classification / queuing \
  639. * | 0x1 - don't perform tx classification; \
  640. * | insert the frame into the "misc" \
  641. * | tx queue \
  642. * | bit 4: 0x0 - Copy-Engine Classification Results \
  643. * | not appended to the HTT message \
  644. * | 0x1 - Copy-Engine Classification Results \
  645. * | appended to the HTT message. \
  646. * | See the above specification of the \
  647. * | CE classification results location. \
  648. */ \
  649. pkt_subtype: 5, \
  650. \
  651. /* pkt_type - \
  652. * General specification of the tx frame contents. \
  653. * The htt_pkt_type enum should be used to specify and check the \
  654. * value of this field. \
  655. */ \
  656. pkt_type: 3, \
  657. \
  658. /* vdev_id - \
  659. * ID for the vdev that is sending this tx frame. \
  660. * For certain non-standard packet types, e.g. pkt_type == raw \
  661. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  662. * This field is used primarily for determining where to queue \
  663. * broadcast and multicast frames. \
  664. */ \
  665. vdev_id: 6, \
  666. /* ext_tid - \
  667. * The extended traffic ID. \
  668. * If the TID is unknown, the extended TID is set to \
  669. * HTT_TX_EXT_TID_INVALID. \
  670. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  671. * value of the QoS TID. \
  672. * If the tx frame is non-QoS data, then the extended TID is set to \
  673. * HTT_TX_EXT_TID_NON_QOS. \
  674. * If the tx frame is multicast or broadcast, then the extended TID \
  675. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  676. */ \
  677. ext_tid: 5, \
  678. \
  679. /* postponed - \
  680. * This flag indicates whether the tx frame has been downloaded to \
  681. * the target before but discarded by the target, and now is being \
  682. * downloaded again; or if this is a new frame that is being \
  683. * downloaded for the first time. \
  684. * This flag allows the target to determine the correct order for \
  685. * transmitting new vs. old frames. \
  686. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  687. * This flag only applies to HL systems, since in LL systems, \
  688. * the tx flow control is handled entirely within the target. \
  689. */ \
  690. postponed: 1, \
  691. \
  692. /* extension - \
  693. * This flag indicates whether a HTT tx MSDU extension descriptor \
  694. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  695. * \
  696. * 0x0 - no extension MSDU descriptor is present \
  697. * 0x1 - an extension MSDU descriptor immediately follows the \
  698. * regular MSDU descriptor \
  699. */ \
  700. extension: 1, \
  701. \
  702. /* cksum_offload - \
  703. * This flag indicates whether checksum offload is enabled or not \
  704. * for this frame. Target FW use this flag to turn on HW checksumming \
  705. * 0x0 - No checksum offload \
  706. * 0x1 - L3 header checksum only \
  707. * 0x2 - L4 checksum only \
  708. * 0x3 - L3 header checksum + L4 checksum \
  709. */ \
  710. cksum_offload: 2, \
  711. \
  712. /* tx_comp_req - \
  713. * This flag indicates whether Tx Completion \
  714. * from fw is required or not. \
  715. * This flag is only relevant if tx completion is not \
  716. * universally enabled. \
  717. * For all LL systems, tx completion is mandatory, \
  718. * so this flag will be irrelevant. \
  719. * For HL systems tx completion is optional, but HL systems in which \
  720. * the bus throughput exceeds the WLAN throughput will \
  721. * probably want to always use tx completion, and thus \
  722. * would not check this flag. \
  723. * This flag is required when tx completions are not used universally, \
  724. * but are still required for certain tx frames for which \
  725. * an OTA delivery acknowledgment is needed by the host. \
  726. * In practice, this would be for HL systems in which the \
  727. * bus throughput is less than the WLAN throughput. \
  728. * \
  729. * 0x0 - Tx Completion Indication from Fw not required \
  730. * 0x1 - Tx Completion Indication from Fw is required \
  731. */ \
  732. tx_compl_req: 1; \
  733. \
  734. \
  735. /* DWORD 1: MSDU length and ID */ \
  736. A_UINT32 \
  737. len: 16, /* MSDU length, in bytes */ \
  738. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  739. * and this id is used to calculate fragmentation \
  740. * descriptor pointer inside the target based on \
  741. * the base address, configured inside the target. \
  742. */ \
  743. \
  744. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  745. /* frags_desc_ptr - \
  746. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  747. * where the tx frame's fragments reside in memory. \
  748. * This field only applies to LL systems, since in HL systems the \
  749. * (degenerate single-fragment) fragmentation descriptor is created \
  750. * within the target. \
  751. */ \
  752. _paddr__frags_desc_ptr_; \
  753. \
  754. /* DWORD 3 (or 4): peerid, chanfreq */ \
  755. /* \
  756. * Peer ID : Target can use this value to know which peer-id packet \
  757. * destined to. \
  758. * It's intended to be specified by host in case of NAWDS. \
  759. */ \
  760. A_UINT16 peerid; \
  761. \
  762. /* \
  763. * Channel frequency: This identifies the desired channel \
  764. * frequency (in mhz) for tx frames. This is used by FW to help \
  765. * determine when it is safe to transmit or drop frames for \
  766. * off-channel operation. \
  767. * The default value of zero indicates to FW that the corresponding \
  768. * VDEV's home channel (if there is one) is the desired channel \
  769. * frequency. \
  770. */ \
  771. A_UINT16 chanfreq; \
  772. \
  773. /* Reason reserved is commented is increasing the htt structure size \
  774. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  775. * A_UINT32 reserved_dword3_bits0_31; \
  776. */ \
  777. } POSTPACK
  778. /* define a htt_tx_msdu_desc32_t type */
  779. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  780. /* define a htt_tx_msdu_desc64_t type */
  781. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  782. /*
  783. * Make htt_tx_msdu_desc_t be an alias for either
  784. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  785. */
  786. #if HTT_PADDR64
  787. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  788. #else
  789. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  790. #endif
  791. /* decriptor information for Management frame*/
  792. /*
  793. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  794. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  795. */
  796. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  797. extern A_UINT32 mgmt_hdr_len;
  798. PREPACK struct htt_mgmt_tx_desc_t {
  799. A_UINT32 msg_type;
  800. #if HTT_PADDR64
  801. A_UINT64 frag_paddr; /* DMAble address of the data */
  802. #else
  803. A_UINT32 frag_paddr; /* DMAble address of the data */
  804. #endif
  805. A_UINT32 desc_id; /* returned to host during completion
  806. * to free the meory*/
  807. A_UINT32 len; /* Fragment length */
  808. A_UINT32 vdev_id; /* virtual device ID*/
  809. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  810. } POSTPACK;
  811. PREPACK struct htt_mgmt_tx_compl_ind {
  812. A_UINT32 desc_id;
  813. A_UINT32 status;
  814. } POSTPACK;
  815. /*
  816. * This SDU header size comes from the summation of the following:
  817. * 1. Max of:
  818. * a. Native WiFi header, for native WiFi frames: 24 bytes
  819. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  820. * b. 802.11 header, for raw frames: 36 bytes
  821. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  822. * QoS header, HT header)
  823. * c. 802.3 header, for ethernet frames: 14 bytes
  824. * (destination address, source address, ethertype / length)
  825. * 2. Max of:
  826. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  827. * b. IPv6 header, up through the Traffic Class: 2 bytes
  828. * 3. 802.1Q VLAN header: 4 bytes
  829. * 4. LLC/SNAP header: 8 bytes
  830. */
  831. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  832. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  833. #define HTT_TX_HDR_SIZE_ETHERNET 14
  834. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  835. A_COMPILE_TIME_ASSERT(
  836. htt_encap_hdr_size_max_check_nwifi,
  837. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  838. A_COMPILE_TIME_ASSERT(
  839. htt_encap_hdr_size_max_check_enet,
  840. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  841. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  842. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  843. #define HTT_TX_HDR_SIZE_802_1Q 4
  844. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  845. #define HTT_COMMON_TX_FRM_HDR_LEN \
  846. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  847. HTT_TX_HDR_SIZE_802_1Q + \
  848. HTT_TX_HDR_SIZE_LLC_SNAP)
  849. #define HTT_HL_TX_FRM_HDR_LEN \
  850. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  851. #define HTT_LL_TX_FRM_HDR_LEN \
  852. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  853. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  854. /* dword 0 */
  855. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  856. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  857. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  858. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  859. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  860. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  861. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  862. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  863. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  864. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  865. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  866. #define HTT_TX_DESC_PKT_TYPE_S 13
  867. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  868. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  869. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  870. #define HTT_TX_DESC_VDEV_ID_S 16
  871. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  872. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  873. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  874. #define HTT_TX_DESC_EXT_TID_S 22
  875. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  876. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  877. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  878. #define HTT_TX_DESC_POSTPONED_S 27
  879. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  880. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  881. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  882. #define HTT_TX_DESC_EXTENSION_S 28
  883. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  884. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  885. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  886. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  887. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  888. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  889. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  890. #define HTT_TX_DESC_TX_COMP_S 31
  891. /* dword 1 */
  892. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  893. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  894. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  895. #define HTT_TX_DESC_FRM_LEN_S 0
  896. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  897. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  898. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  899. #define HTT_TX_DESC_FRM_ID_S 16
  900. /* dword 2 */
  901. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  902. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  903. /* for systems using 64-bit format for bus addresses */
  904. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  905. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  906. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  907. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  908. /* for systems using 32-bit format for bus addresses */
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  910. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  911. /* dword 3 */
  912. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  913. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  914. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  915. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  916. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  917. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  918. #if HTT_PADDR64
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  920. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  921. #else
  922. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  923. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  924. #endif
  925. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  926. #define HTT_TX_DESC_PEER_ID_S 0
  927. /*
  928. * TEMPORARY:
  929. * The original definitions for the PEER_ID fields contained typos
  930. * (with _DESC_PADDR appended to this PEER_ID field name).
  931. * Retain deprecated original names for PEER_ID fields until all code that
  932. * refers to them has been updated.
  933. */
  934. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  935. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  936. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  937. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  938. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  939. HTT_TX_DESC_PEER_ID_M
  940. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  941. HTT_TX_DESC_PEER_ID_S
  942. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  943. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  944. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  945. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  946. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  947. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  948. #if HTT_PADDR64
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  950. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  951. #else
  952. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  953. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  954. #endif
  955. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  956. #define HTT_TX_DESC_CHAN_FREQ_S 16
  957. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  958. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  959. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  960. do { \
  961. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  962. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  963. } while (0)
  964. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  965. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  966. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  967. do { \
  968. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  969. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  970. } while (0)
  971. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  972. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  973. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  976. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  977. } while (0)
  978. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  979. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  980. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  981. do { \
  982. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  983. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  984. } while (0)
  985. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  986. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  987. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  988. do { \
  989. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  990. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  991. } while (0)
  992. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  993. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  994. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1001. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1008. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1015. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1019. } while (0)
  1020. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1021. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1022. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1023. do { \
  1024. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1025. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1026. } while (0)
  1027. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1028. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1029. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1030. do { \
  1031. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1032. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1033. } while (0)
  1034. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1035. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1036. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1037. do { \
  1038. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1039. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1040. } while (0)
  1041. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1042. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1043. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1044. do { \
  1045. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1046. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1047. } while (0)
  1048. /* enums used in the HTT tx MSDU extension descriptor */
  1049. enum {
  1050. htt_tx_guard_interval_regular = 0,
  1051. htt_tx_guard_interval_short = 1,
  1052. };
  1053. enum {
  1054. htt_tx_preamble_type_ofdm = 0,
  1055. htt_tx_preamble_type_cck = 1,
  1056. htt_tx_preamble_type_ht = 2,
  1057. htt_tx_preamble_type_vht = 3,
  1058. };
  1059. enum {
  1060. htt_tx_bandwidth_5MHz = 0,
  1061. htt_tx_bandwidth_10MHz = 1,
  1062. htt_tx_bandwidth_20MHz = 2,
  1063. htt_tx_bandwidth_40MHz = 3,
  1064. htt_tx_bandwidth_80MHz = 4,
  1065. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1066. };
  1067. /**
  1068. * @brief HTT tx MSDU extension descriptor
  1069. * @details
  1070. * If the target supports HTT tx MSDU extension descriptors, the host has
  1071. * the option of appending the following struct following the regular
  1072. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1073. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1074. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1075. * tx specs for each frame.
  1076. */
  1077. PREPACK struct htt_tx_msdu_desc_ext_t {
  1078. /* DWORD 0: flags */
  1079. A_UINT32
  1080. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1081. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1082. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1083. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1084. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1085. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1086. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1087. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1088. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1089. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1090. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1091. /* DWORD 1: tx power, tx rate, tx BW */
  1092. A_UINT32
  1093. /* pwr -
  1094. * Specify what power the tx frame needs to be transmitted at.
  1095. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1096. * The value needs to be appropriately sign-extended when extracting
  1097. * the value from the message and storing it in a variable that is
  1098. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1099. * automatically handles this sign-extension.)
  1100. * If the transmission uses multiple tx chains, this power spec is
  1101. * the total transmit power, assuming incoherent combination of
  1102. * per-chain power to produce the total power.
  1103. */
  1104. pwr: 8,
  1105. /* mcs_mask -
  1106. * Specify the allowable values for MCS index (modulation and coding)
  1107. * to use for transmitting the frame.
  1108. *
  1109. * For HT / VHT preamble types, this mask directly corresponds to
  1110. * the HT or VHT MCS indices that are allowed. For each bit N set
  1111. * within the mask, MCS index N is allowed for transmitting the frame.
  1112. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1113. * rates versus OFDM rates, so the host has the option of specifying
  1114. * that the target must transmit the frame with CCK or OFDM rates
  1115. * (not HT or VHT), but leaving the decision to the target whether
  1116. * to use CCK or OFDM.
  1117. *
  1118. * For CCK and OFDM, the bits within this mask are interpreted as
  1119. * follows:
  1120. * bit 0 -> CCK 1 Mbps rate is allowed
  1121. * bit 1 -> CCK 2 Mbps rate is allowed
  1122. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1123. * bit 3 -> CCK 11 Mbps rate is allowed
  1124. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1125. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1126. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1127. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1128. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1129. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1130. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1131. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1132. *
  1133. * The MCS index specification needs to be compatible with the
  1134. * bandwidth mask specification. For example, a MCS index == 9
  1135. * specification is inconsistent with a preamble type == VHT,
  1136. * Nss == 1, and channel bandwidth == 20 MHz.
  1137. *
  1138. * Furthermore, the host has only a limited ability to specify to
  1139. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1140. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1141. */
  1142. mcs_mask: 12,
  1143. /* nss_mask -
  1144. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1145. * Each bit in this mask corresponds to a Nss value:
  1146. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1147. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1148. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1149. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1150. * The values in the Nss mask must be suitable for the recipient, e.g.
  1151. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1152. * recipient which only supports 2x2 MIMO.
  1153. */
  1154. nss_mask: 4,
  1155. /* guard_interval -
  1156. * Specify a htt_tx_guard_interval enum value to indicate whether
  1157. * the transmission should use a regular guard interval or a
  1158. * short guard interval.
  1159. */
  1160. guard_interval: 1,
  1161. /* preamble_type_mask -
  1162. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1163. * may choose from for transmitting this frame.
  1164. * The bits in this mask correspond to the values in the
  1165. * htt_tx_preamble_type enum. For example, to allow the target
  1166. * to transmit the frame as either CCK or OFDM, this field would
  1167. * be set to
  1168. * (1 << htt_tx_preamble_type_ofdm) |
  1169. * (1 << htt_tx_preamble_type_cck)
  1170. */
  1171. preamble_type_mask: 4,
  1172. reserved1_31_29: 3; /* unused, set to 0x0 */
  1173. /* DWORD 2: tx chain mask, tx retries */
  1174. A_UINT32
  1175. /* chain_mask - specify which chains to transmit from */
  1176. chain_mask: 4,
  1177. /* retry_limit -
  1178. * Specify the maximum number of transmissions, including the
  1179. * initial transmission, to attempt before giving up if no ack
  1180. * is received.
  1181. * If the tx rate is specified, then all retries shall use the
  1182. * same rate as the initial transmission.
  1183. * If no tx rate is specified, the target can choose whether to
  1184. * retain the original rate during the retransmissions, or to
  1185. * fall back to a more robust rate.
  1186. */
  1187. retry_limit: 4,
  1188. /* bandwidth_mask -
  1189. * Specify what channel widths may be used for the transmission.
  1190. * A value of zero indicates "don't care" - the target may choose
  1191. * the transmission bandwidth.
  1192. * The bits within this mask correspond to the htt_tx_bandwidth
  1193. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1194. * The bandwidth_mask must be consistent with the preamble_type_mask
  1195. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1196. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1197. */
  1198. bandwidth_mask: 6,
  1199. reserved2_31_14: 18; /* unused, set to 0x0 */
  1200. /* DWORD 3: tx expiry time (TSF) LSBs */
  1201. A_UINT32 expire_tsf_lo;
  1202. /* DWORD 4: tx expiry time (TSF) MSBs */
  1203. A_UINT32 expire_tsf_hi;
  1204. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1205. } POSTPACK;
  1206. /* DWORD 0 */
  1207. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1208. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1209. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1210. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1211. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1212. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1213. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1227. /* DWORD 1 */
  1228. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1229. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1230. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1231. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1232. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1233. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1234. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1235. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1236. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1237. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1238. /* DWORD 2 */
  1239. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1240. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1241. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1242. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1243. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1244. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1245. /* DWORD 0 */
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1247. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1248. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1250. do { \
  1251. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1252. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1253. } while (0)
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1255. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1256. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1258. do { \
  1259. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1260. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1261. } while (0)
  1262. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1263. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1264. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1265. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL( \
  1268. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1269. ((_var) |= ((_val) \
  1270. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1271. } while (0)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1273. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1274. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL( \
  1278. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1279. ((_var) |= ((_val) \
  1280. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1281. } while (0)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1283. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1284. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1289. } while (0)
  1290. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1291. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1292. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1297. } while (0)
  1298. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1299. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1300. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1302. do { \
  1303. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1304. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1305. } while (0)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1313. } while (0)
  1314. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1315. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1316. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1317. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1321. } while (0)
  1322. /* DWORD 1 */
  1323. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1324. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1325. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1326. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1327. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1328. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1329. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1330. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1331. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1332. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1333. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1334. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1335. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1336. do { \
  1337. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1338. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1339. } while (0)
  1340. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1341. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1342. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1343. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1344. do { \
  1345. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1346. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1347. } while (0)
  1348. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1349. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1350. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1351. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1355. } while (0)
  1356. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1357. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1358. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1359. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1360. do { \
  1361. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1362. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1363. } while (0)
  1364. /* DWORD 2 */
  1365. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1366. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1367. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1368. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1369. do { \
  1370. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1371. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1372. } while (0)
  1373. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1374. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1375. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1376. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1377. do { \
  1378. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1379. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1380. } while (0)
  1381. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1382. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1383. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1384. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1385. do { \
  1386. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1387. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1388. } while (0)
  1389. typedef enum {
  1390. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1391. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1392. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1393. } htt_11ax_ltf_subtype_t;
  1394. typedef enum {
  1395. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1396. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1397. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1398. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1399. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1400. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1401. } htt_tx_ext2_preamble_type_t;
  1402. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1403. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1404. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1405. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1406. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1407. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1408. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1414. /**
  1415. * @brief HTT tx MSDU extension descriptor v2
  1416. * @details
  1417. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1418. * is received as tcl_exit_base->host_meta_info in firmware.
  1419. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1420. * are already part of tcl_exit_base.
  1421. */
  1422. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1423. /* DWORD 0: flags */
  1424. A_UINT32
  1425. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1426. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1427. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1428. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1429. valid_retries : 1, /* if set, tx retries spec is valid */
  1430. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1431. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1432. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1433. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1434. valid_key_flags : 1, /* if set, key flags is valid */
  1435. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1436. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1437. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1438. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1439. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1440. 1 = ENCRYPT,
  1441. 2 ~ 3 - Reserved */
  1442. /* retry_limit -
  1443. * Specify the maximum number of transmissions, including the
  1444. * initial transmission, to attempt before giving up if no ack
  1445. * is received.
  1446. * If the tx rate is specified, then all retries shall use the
  1447. * same rate as the initial transmission.
  1448. * If no tx rate is specified, the target can choose whether to
  1449. * retain the original rate during the retransmissions, or to
  1450. * fall back to a more robust rate.
  1451. */
  1452. retry_limit : 4,
  1453. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1454. * Valid only for 11ax preamble types HE_SU
  1455. * and HE_EXT_SU
  1456. */
  1457. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1458. * Valid only for 11ax preamble types HE_SU
  1459. * and HE_EXT_SU
  1460. */
  1461. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1462. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1463. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1464. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1465. */
  1466. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1467. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1468. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1469. * Use cases:
  1470. * Any time firmware uses TQM-BYPASS for Data
  1471. * TID, firmware expect host to set this bit.
  1472. */
  1473. /* DWORD 1: tx power, tx rate */
  1474. A_UINT32
  1475. power : 8, /* unit of the power field is 0.5 dbm
  1476. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1477. * signed value ranging from -64dbm to 63.5 dbm
  1478. */
  1479. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1480. * Setting more than one MCS isn't currently
  1481. * supported by the target (but is supported
  1482. * in the interface in case in the future
  1483. * the target supports specifications of
  1484. * a limited set of MCS values.
  1485. */
  1486. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1487. * Setting more than one Nss 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 Nss values.
  1492. */
  1493. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1494. update_peer_cache : 1; /* When set these custom values will be
  1495. * used for all packets, until the next
  1496. * update via this ext header.
  1497. * This is to make sure not all packets
  1498. * need to include this header.
  1499. */
  1500. /* DWORD 2: tx chain mask, tx retries */
  1501. A_UINT32
  1502. /* chain_mask - specify which chains to transmit from */
  1503. chain_mask : 8,
  1504. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1505. * TODO: Update Enum values for key_flags
  1506. */
  1507. /*
  1508. * Channel frequency: This identifies the desired channel
  1509. * frequency (in MHz) for tx frames. This is used by FW to help
  1510. * determine when it is safe to transmit or drop frames for
  1511. * off-channel operation.
  1512. * The default value of zero indicates to FW that the corresponding
  1513. * VDEV's home channel (if there is one) is the desired channel
  1514. * frequency.
  1515. */
  1516. chanfreq : 16;
  1517. /* DWORD 3: tx expiry time (TSF) LSBs */
  1518. A_UINT32 expire_tsf_lo;
  1519. /* DWORD 4: tx expiry time (TSF) MSBs */
  1520. A_UINT32 expire_tsf_hi;
  1521. /* DWORD 5: reserved
  1522. * This structure can be expanded further up to 60 bytes
  1523. * by adding further DWORDs as needed.
  1524. */
  1525. A_UINT32
  1526. /* learning_frame
  1527. * When this flag is set, this frame will be dropped by FW
  1528. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1529. */
  1530. learning_frame : 1,
  1531. rsvd0 : 31;
  1532. } POSTPACK;
  1533. /* DWORD 0 */
  1534. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1535. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1536. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1537. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1538. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1539. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1540. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1541. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1542. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1543. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1544. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1545. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1546. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1547. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1548. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1549. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1550. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1551. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1552. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1554. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1555. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1560. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1561. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1562. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1563. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1564. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1565. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1566. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1567. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1568. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1569. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1570. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1571. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1572. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1573. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1574. /* DWORD 1 */
  1575. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1576. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1577. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1578. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1579. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1580. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1581. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1582. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1583. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1584. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1585. /* DWORD 2 */
  1586. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1587. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1588. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1589. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1590. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1591. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1592. /* DWORD 5 */
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1595. /* DWORD 0 */
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1597. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1598. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1600. do { \
  1601. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1602. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1603. } while (0)
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1605. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1606. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1608. do { \
  1609. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1610. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1611. } while (0)
  1612. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1613. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1614. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1616. do { \
  1617. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1618. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1619. } while (0)
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1621. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1622. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1624. do { \
  1625. HTT_CHECK_SET_VAL( \
  1626. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1627. ((_var) |= ((_val) \
  1628. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1629. } while (0)
  1630. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1631. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1632. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1634. do { \
  1635. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1636. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1637. } while (0)
  1638. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1640. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1642. do { \
  1643. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1644. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1645. } while (0)
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1647. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1648. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1650. do { \
  1651. HTT_CHECK_SET_VAL( \
  1652. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1653. ((_var) |= ((_val) \
  1654. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1655. } while (0)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1657. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1658. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1660. do { \
  1661. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1662. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1663. } while (0)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1665. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1666. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1668. do { \
  1669. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1670. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1671. } while (0)
  1672. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1673. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1674. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1676. do { \
  1677. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1678. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1679. } while (0)
  1680. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1681. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1682. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1683. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1684. do { \
  1685. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1686. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1687. } while (0)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1689. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1690. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1691. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1692. do { \
  1693. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1694. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1695. } while (0)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1697. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1698. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1699. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1700. do { \
  1701. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1702. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1703. } while (0)
  1704. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1705. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1706. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1707. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1708. do { \
  1709. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1710. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1711. } while (0)
  1712. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1713. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1714. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1715. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1716. do { \
  1717. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1718. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1719. } while (0)
  1720. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1721. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1722. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1723. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1724. do { \
  1725. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1726. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1727. } while (0)
  1728. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1729. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1730. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1731. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1732. do { \
  1733. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1734. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1735. } while (0)
  1736. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1737. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1738. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1739. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1740. do { \
  1741. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1742. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1743. } while (0)
  1744. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1745. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1746. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1747. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1748. do { \
  1749. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1750. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1751. } while (0)
  1752. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1753. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1754. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1755. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1756. do { \
  1757. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1758. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1759. } while (0)
  1760. /* DWORD 1 */
  1761. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1762. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1763. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1764. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1765. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1766. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1767. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1768. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1769. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1770. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1771. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1772. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1773. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1774. do { \
  1775. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1776. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1777. } while (0)
  1778. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1779. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1780. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1781. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1782. do { \
  1783. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1784. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1785. } while (0)
  1786. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1787. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1788. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1789. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1790. do { \
  1791. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1792. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1793. } while (0)
  1794. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1795. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1796. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1797. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1798. do { \
  1799. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1800. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1801. } while (0)
  1802. /* DWORD 2 */
  1803. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1804. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1805. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1806. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1807. do { \
  1808. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1809. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1810. } while (0)
  1811. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1812. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1813. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1814. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1815. do { \
  1816. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1817. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1818. } while (0)
  1819. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1820. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1821. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1822. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1823. do { \
  1824. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1825. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1826. } while (0)
  1827. /* DWORD 5 */
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1829. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1830. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1832. do { \
  1833. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1834. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1835. } while (0)
  1836. typedef enum {
  1837. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1838. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1839. } htt_tcl_metadata_type;
  1840. /**
  1841. * @brief HTT TCL command number format
  1842. * @details
  1843. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1844. * available to firmware as tcl_exit_base->tcl_status_number.
  1845. * For regular / multicast packets host will send vdev and mac id and for
  1846. * NAWDS packets, host will send peer id.
  1847. * A_UINT32 is used to avoid endianness conversion problems.
  1848. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1849. */
  1850. typedef struct {
  1851. A_UINT32
  1852. type: 1, /* vdev_id based or peer_id based */
  1853. rsvd: 31;
  1854. } htt_tx_tcl_vdev_or_peer_t;
  1855. typedef struct {
  1856. A_UINT32
  1857. type: 1, /* vdev_id based or peer_id based */
  1858. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1859. vdev_id: 8,
  1860. pdev_id: 2,
  1861. host_inspected:1,
  1862. rsvd: 19;
  1863. } htt_tx_tcl_vdev_metadata;
  1864. typedef struct {
  1865. A_UINT32
  1866. type: 1, /* vdev_id based or peer_id based */
  1867. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1868. peer_id: 14,
  1869. rsvd: 16;
  1870. } htt_tx_tcl_peer_metadata;
  1871. PREPACK struct htt_tx_tcl_metadata {
  1872. union {
  1873. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1874. htt_tx_tcl_vdev_metadata vdev_meta;
  1875. htt_tx_tcl_peer_metadata peer_meta;
  1876. };
  1877. } POSTPACK;
  1878. /* DWORD 0 */
  1879. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1880. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1881. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1882. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1883. /* VDEV metadata */
  1884. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1885. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1886. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1887. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1888. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1889. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1890. /* PEER metadata */
  1891. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1892. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1893. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1894. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1895. HTT_TX_TCL_METADATA_TYPE_S)
  1896. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1900. } while (0)
  1901. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1902. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1903. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1904. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1907. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1908. } while (0)
  1909. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1910. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1911. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1912. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1915. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1916. } while (0)
  1917. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1918. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1919. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1920. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1923. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1924. } while (0)
  1925. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1926. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1927. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1928. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1931. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1932. } while (0)
  1933. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1934. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1935. HTT_TX_TCL_METADATA_PEER_ID_S)
  1936. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1937. do { \
  1938. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1939. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1940. } while (0)
  1941. typedef enum {
  1942. HTT_TX_FW2WBM_TX_STATUS_OK,
  1943. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1944. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1945. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1946. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1947. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  1948. HTT_TX_FW2WBM_TX_STATUS_MAX
  1949. } htt_tx_fw2wbm_tx_status_t;
  1950. typedef enum {
  1951. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  1952. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  1953. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1954. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1955. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1956. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1957. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1958. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1959. } htt_tx_fw2wbm_reinject_reason_t;
  1960. /**
  1961. * @brief HTT TX WBM Completion from firmware to host
  1962. * @details
  1963. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1964. * DWORD 3 and 4 for software based completions (Exception frames and
  1965. * TQM bypass frames)
  1966. * For software based completions, wbm_release_ring->release_source_module will
  1967. * be set to release_source_fw
  1968. */
  1969. PREPACK struct htt_tx_wbm_completion {
  1970. A_UINT32
  1971. sch_cmd_id: 24,
  1972. exception_frame: 1, /* If set, this packet was queued via exception path */
  1973. rsvd0_31_25: 7;
  1974. A_UINT32
  1975. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1976. * reception of an ACK or BA, this field indicates
  1977. * the RSSI of the received ACK or BA frame.
  1978. * When the frame is removed as result of a direct
  1979. * remove command from the SW, this field is set
  1980. * to 0x0 (which is never a valid value when real
  1981. * RSSI is available).
  1982. * Units: dB w.r.t noise floor
  1983. */
  1984. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1985. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1986. rsvd1_31_16: 16;
  1987. } POSTPACK;
  1988. /* DWORD 0 */
  1989. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1990. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1991. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1992. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1993. /* DWORD 1 */
  1994. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1995. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1996. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1997. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1998. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1999. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2000. /* DWORD 0 */
  2001. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2002. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2003. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2004. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2005. do { \
  2006. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2007. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2008. } while (0)
  2009. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2010. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2011. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2012. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2013. do { \
  2014. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2015. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2016. } while (0)
  2017. /* DWORD 1 */
  2018. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2019. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2020. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2021. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2022. do { \
  2023. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2024. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2025. } while (0)
  2026. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2027. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2028. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2029. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2030. do { \
  2031. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2032. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2033. } while (0)
  2034. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2035. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2036. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2037. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2038. do { \
  2039. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2040. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2041. } while (0)
  2042. /**
  2043. * @brief HTT TX WBM Completion from firmware to host
  2044. * @details
  2045. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2046. * (WBM) offload HW.
  2047. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2048. * For software based completions, release_source_module will
  2049. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2050. * struct wbm_release_ring and then switch to this after looking at
  2051. * release_source_module.
  2052. */
  2053. PREPACK struct htt_tx_wbm_completion_v2 {
  2054. A_UINT32
  2055. used_by_hw0; /* Refer to struct wbm_release_ring */
  2056. A_UINT32
  2057. used_by_hw1; /* Refer to struct wbm_release_ring */
  2058. A_UINT32
  2059. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2060. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2061. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2062. exception_frame: 1,
  2063. rsvd0: 12, /* For future use */
  2064. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2065. rsvd1: 1; /* For future use */
  2066. A_UINT32
  2067. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2068. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2069. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2070. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2071. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2072. */
  2073. A_UINT32
  2074. data1: 32;
  2075. A_UINT32
  2076. data2: 32;
  2077. A_UINT32
  2078. used_by_hw3; /* Refer to struct wbm_release_ring */
  2079. } POSTPACK;
  2080. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2081. /* DWORD 3 */
  2082. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2083. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2084. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2085. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2086. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2087. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2088. /* DWORD 3 */
  2089. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2090. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2091. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2092. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2095. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2096. } while (0)
  2097. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2098. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2099. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2100. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2101. do { \
  2102. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2103. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2104. } while (0)
  2105. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2106. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2107. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2108. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2109. do { \
  2110. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2111. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2112. } while (0)
  2113. /**
  2114. * @brief HTT TX WBM transmit status from firmware to host
  2115. * @details
  2116. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2117. * (WBM) offload HW.
  2118. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2119. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2120. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2121. */
  2122. PREPACK struct htt_tx_wbm_transmit_status {
  2123. A_UINT32
  2124. sch_cmd_id: 24,
  2125. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2126. * reception of an ACK or BA, this field indicates
  2127. * the RSSI of the received ACK or BA frame.
  2128. * When the frame is removed as result of a direct
  2129. * remove command from the SW, this field is set
  2130. * to 0x0 (which is never a valid value when real
  2131. * RSSI is available).
  2132. * Units: dB w.r.t noise floor
  2133. */
  2134. A_UINT32
  2135. sw_peer_id: 16,
  2136. tid_num: 5,
  2137. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2138. * and tid_num fields contain valid data.
  2139. * If this "valid" flag is not set, the
  2140. * sw_peer_id and tid_num fields must be ignored.
  2141. */
  2142. mcast: 1,
  2143. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2144. * contains valid data.
  2145. */
  2146. reserved0: 8;
  2147. A_UINT32
  2148. reserved1: 32;
  2149. } POSTPACK;
  2150. /* DWORD 4 */
  2151. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2152. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2153. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2154. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2155. /* DWORD 5 */
  2156. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2157. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2158. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2159. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2160. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2161. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2162. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2163. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2164. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2165. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2166. /* DWORD 4 */
  2167. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2168. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2169. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2170. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2171. do { \
  2172. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2173. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2174. } while (0)
  2175. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2176. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2177. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2178. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2179. do { \
  2180. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2181. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2182. } while (0)
  2183. /* DWORD 5 */
  2184. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2185. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2186. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2187. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2188. do { \
  2189. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2190. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2191. } while (0)
  2192. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2193. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2194. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2195. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2196. do { \
  2197. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2198. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2199. } while (0)
  2200. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2201. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2202. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2203. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2204. do { \
  2205. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2206. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2207. } while (0)
  2208. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2209. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2210. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2211. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2212. do { \
  2213. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2214. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2215. } while (0)
  2216. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2217. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2218. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2219. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2220. do { \
  2221. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2222. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2223. } while (0)
  2224. /**
  2225. * @brief HTT TX WBM reinject status from firmware to host
  2226. * @details
  2227. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2228. * (WBM) offload HW.
  2229. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2230. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2231. */
  2232. PREPACK struct htt_tx_wbm_reinject_status {
  2233. A_UINT32
  2234. reserved0: 32;
  2235. A_UINT32
  2236. reserved1: 32;
  2237. A_UINT32
  2238. reserved2: 32;
  2239. } POSTPACK;
  2240. /**
  2241. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2242. * @details
  2243. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2244. * (WBM) offload HW.
  2245. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2246. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2247. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2248. * STA side.
  2249. */
  2250. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2251. A_UINT32
  2252. mec_sa_addr_31_0;
  2253. A_UINT32
  2254. mec_sa_addr_47_32: 16,
  2255. sa_ast_index: 16;
  2256. A_UINT32
  2257. vdev_id: 8,
  2258. reserved0: 24;
  2259. } POSTPACK;
  2260. /* DWORD 4 - mec_sa_addr_31_0 */
  2261. /* DWORD 5 */
  2262. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2263. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2264. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2265. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2266. /* DWORD 6 */
  2267. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2268. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2269. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2270. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2271. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2272. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2275. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2276. } while (0)
  2277. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2278. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2279. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2280. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2281. do { \
  2282. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2283. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2284. } while (0)
  2285. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2286. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2287. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2288. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2289. do { \
  2290. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2291. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2292. } while (0)
  2293. typedef enum {
  2294. TX_FLOW_PRIORITY_BE,
  2295. TX_FLOW_PRIORITY_HIGH,
  2296. TX_FLOW_PRIORITY_LOW,
  2297. } htt_tx_flow_priority_t;
  2298. typedef enum {
  2299. TX_FLOW_LATENCY_SENSITIVE,
  2300. TX_FLOW_LATENCY_INSENSITIVE,
  2301. } htt_tx_flow_latency_t;
  2302. typedef enum {
  2303. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2304. TX_FLOW_INTERACTIVE_TRAFFIC,
  2305. TX_FLOW_PERIODIC_TRAFFIC,
  2306. TX_FLOW_BURSTY_TRAFFIC,
  2307. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2308. } htt_tx_flow_traffic_pattern_t;
  2309. /**
  2310. * @brief HTT TX Flow search metadata format
  2311. * @details
  2312. * Host will set this metadata in flow table's flow search entry along with
  2313. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2314. * firmware and TQM ring if the flow search entry wins.
  2315. * This metadata is available to firmware in that first MSDU's
  2316. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2317. * to one of the available flows for specific tid and returns the tqm flow
  2318. * pointer as part of htt_tx_map_flow_info message.
  2319. */
  2320. PREPACK struct htt_tx_flow_metadata {
  2321. A_UINT32
  2322. rsvd0_1_0: 2,
  2323. tid: 4,
  2324. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2325. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2326. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2327. * Else choose final tid based on latency, priority.
  2328. */
  2329. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2330. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2331. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2332. } POSTPACK;
  2333. /* DWORD 0 */
  2334. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2335. #define HTT_TX_FLOW_METADATA_TID_S 2
  2336. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2337. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2338. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2339. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2340. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2341. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2342. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2343. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2344. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2345. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2346. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2347. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2348. /* DWORD 0 */
  2349. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2350. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2351. HTT_TX_FLOW_METADATA_TID_S)
  2352. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2353. do { \
  2354. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2355. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2356. } while (0)
  2357. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2358. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2359. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2360. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2361. do { \
  2362. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2363. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2364. } while (0)
  2365. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2366. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2367. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2368. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2369. do { \
  2370. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2371. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2372. } while (0)
  2373. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2374. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2375. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2376. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2377. do { \
  2378. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2379. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2380. } while (0)
  2381. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2382. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2383. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2384. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2385. do { \
  2386. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2387. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2388. } while (0)
  2389. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2390. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2391. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2392. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2393. do { \
  2394. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2395. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2396. } while (0)
  2397. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2398. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2399. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2400. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2401. do { \
  2402. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2403. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2404. } while (0)
  2405. /**
  2406. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2407. *
  2408. * @details
  2409. * HTT wds entry from source port learning
  2410. * Host will learn wds entries from rx and send this message to firmware
  2411. * to enable firmware to configure/delete AST entries for wds clients.
  2412. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2413. * and when SA's entry is deleted, firmware removes this AST entry
  2414. *
  2415. * The message would appear as follows:
  2416. *
  2417. * |31 30|29 |17 16|15 8|7 0|
  2418. * |----------------+----------------+----------------+----------------|
  2419. * | rsvd0 |PDVID| vdev_id | msg_type |
  2420. * |-------------------------------------------------------------------|
  2421. * | sa_addr_31_0 |
  2422. * |-------------------------------------------------------------------|
  2423. * | | ta_peer_id | sa_addr_47_32 |
  2424. * |-------------------------------------------------------------------|
  2425. * Where PDVID = pdev_id
  2426. *
  2427. * The message is interpreted as follows:
  2428. *
  2429. * dword0 - b'0:7 - msg_type: This will be set to
  2430. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2431. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2432. *
  2433. * dword0 - b'8:15 - vdev_id
  2434. *
  2435. * dword0 - b'16:17 - pdev_id
  2436. *
  2437. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2438. *
  2439. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2440. *
  2441. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2442. *
  2443. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2444. */
  2445. PREPACK struct htt_wds_entry {
  2446. A_UINT32
  2447. msg_type: 8,
  2448. vdev_id: 8,
  2449. pdev_id: 2,
  2450. rsvd0: 14;
  2451. A_UINT32 sa_addr_31_0;
  2452. A_UINT32
  2453. sa_addr_47_32: 16,
  2454. ta_peer_id: 14,
  2455. rsvd2: 2;
  2456. } POSTPACK;
  2457. /* DWORD 0 */
  2458. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2459. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2460. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2461. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2462. /* DWORD 2 */
  2463. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2464. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2465. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2466. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2467. /* DWORD 0 */
  2468. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2469. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2470. HTT_WDS_ENTRY_VDEV_ID_S)
  2471. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2472. do { \
  2473. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2474. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2475. } while (0)
  2476. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2477. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2478. HTT_WDS_ENTRY_PDEV_ID_S)
  2479. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2480. do { \
  2481. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2482. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2483. } while (0)
  2484. /* DWORD 2 */
  2485. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2486. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2487. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2488. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2489. do { \
  2490. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2491. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2492. } while (0)
  2493. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2494. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2495. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2496. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2497. do { \
  2498. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2499. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2500. } while (0)
  2501. /**
  2502. * @brief MAC DMA rx ring setup specification
  2503. * @details
  2504. * To allow for dynamic rx ring reconfiguration and to avoid race
  2505. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2506. * it uses. Instead, it sends this message to the target, indicating how
  2507. * the rx ring used by the host should be set up and maintained.
  2508. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2509. * specifications.
  2510. *
  2511. * |31 16|15 8|7 0|
  2512. * |---------------------------------------------------------------|
  2513. * header: | reserved | num rings | msg type |
  2514. * |---------------------------------------------------------------|
  2515. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2516. #if HTT_PADDR64
  2517. * | FW_IDX shadow register physical address (bits 63:32) |
  2518. #endif
  2519. * |---------------------------------------------------------------|
  2520. * | rx ring base physical address (bits 31:0) |
  2521. #if HTT_PADDR64
  2522. * | rx ring base physical address (bits 63:32) |
  2523. #endif
  2524. * |---------------------------------------------------------------|
  2525. * | rx ring buffer size | rx ring length |
  2526. * |---------------------------------------------------------------|
  2527. * | FW_IDX initial value | enabled flags |
  2528. * |---------------------------------------------------------------|
  2529. * | MSDU payload offset | 802.11 header offset |
  2530. * |---------------------------------------------------------------|
  2531. * | PPDU end offset | PPDU start offset |
  2532. * |---------------------------------------------------------------|
  2533. * | MPDU end offset | MPDU start offset |
  2534. * |---------------------------------------------------------------|
  2535. * | MSDU end offset | MSDU start offset |
  2536. * |---------------------------------------------------------------|
  2537. * | frag info offset | rx attention offset |
  2538. * |---------------------------------------------------------------|
  2539. * payload 2, if present, has the same format as payload 1
  2540. * Header fields:
  2541. * - MSG_TYPE
  2542. * Bits 7:0
  2543. * Purpose: identifies this as an rx ring configuration message
  2544. * Value: 0x2
  2545. * - NUM_RINGS
  2546. * Bits 15:8
  2547. * Purpose: indicates whether the host is setting up one rx ring or two
  2548. * Value: 1 or 2
  2549. * Payload:
  2550. * for systems using 64-bit format for bus addresses:
  2551. * - IDX_SHADOW_REG_PADDR_LO
  2552. * Bits 31:0
  2553. * Value: lower 4 bytes of physical address of the host's
  2554. * FW_IDX shadow register
  2555. * - IDX_SHADOW_REG_PADDR_HI
  2556. * Bits 31:0
  2557. * Value: upper 4 bytes of physical address of the host's
  2558. * FW_IDX shadow register
  2559. * - RING_BASE_PADDR_LO
  2560. * Bits 31:0
  2561. * Value: lower 4 bytes of physical address of the host's rx ring
  2562. * - RING_BASE_PADDR_HI
  2563. * Bits 31:0
  2564. * Value: uppper 4 bytes of physical address of the host's rx ring
  2565. * for systems using 32-bit format for bus addresses:
  2566. * - IDX_SHADOW_REG_PADDR
  2567. * Bits 31:0
  2568. * Value: physical address of the host's FW_IDX shadow register
  2569. * - RING_BASE_PADDR
  2570. * Bits 31:0
  2571. * Value: physical address of the host's rx ring
  2572. * - RING_LEN
  2573. * Bits 15:0
  2574. * Value: number of elements in the rx ring
  2575. * - RING_BUF_SZ
  2576. * Bits 31:16
  2577. * Value: size of the buffers referenced by the rx ring, in byte units
  2578. * - ENABLED_FLAGS
  2579. * Bits 15:0
  2580. * Value: 1-bit flags to show whether different rx fields are enabled
  2581. * bit 0: 802.11 header enabled (1) or disabled (0)
  2582. * bit 1: MSDU payload enabled (1) or disabled (0)
  2583. * bit 2: PPDU start enabled (1) or disabled (0)
  2584. * bit 3: PPDU end enabled (1) or disabled (0)
  2585. * bit 4: MPDU start enabled (1) or disabled (0)
  2586. * bit 5: MPDU end enabled (1) or disabled (0)
  2587. * bit 6: MSDU start enabled (1) or disabled (0)
  2588. * bit 7: MSDU end enabled (1) or disabled (0)
  2589. * bit 8: rx attention enabled (1) or disabled (0)
  2590. * bit 9: frag info enabled (1) or disabled (0)
  2591. * bit 10: unicast rx enabled (1) or disabled (0)
  2592. * bit 11: multicast rx enabled (1) or disabled (0)
  2593. * bit 12: ctrl rx enabled (1) or disabled (0)
  2594. * bit 13: mgmt rx enabled (1) or disabled (0)
  2595. * bit 14: null rx enabled (1) or disabled (0)
  2596. * bit 15: phy data rx enabled (1) or disabled (0)
  2597. * - IDX_INIT_VAL
  2598. * Bits 31:16
  2599. * Purpose: Specify the initial value for the FW_IDX.
  2600. * Value: the number of buffers initially present in the host's rx ring
  2601. * - OFFSET_802_11_HDR
  2602. * Bits 15:0
  2603. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2604. * - OFFSET_MSDU_PAYLOAD
  2605. * Bits 31:16
  2606. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2607. * - OFFSET_PPDU_START
  2608. * Bits 15:0
  2609. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2610. * - OFFSET_PPDU_END
  2611. * Bits 31:16
  2612. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2613. * - OFFSET_MPDU_START
  2614. * Bits 15:0
  2615. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2616. * - OFFSET_MPDU_END
  2617. * Bits 31:16
  2618. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2619. * - OFFSET_MSDU_START
  2620. * Bits 15:0
  2621. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2622. * - OFFSET_MSDU_END
  2623. * Bits 31:16
  2624. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2625. * - OFFSET_RX_ATTN
  2626. * Bits 15:0
  2627. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2628. * - OFFSET_FRAG_INFO
  2629. * Bits 31:16
  2630. * Value: offset in QUAD-bytes of frag info table
  2631. */
  2632. /* header fields */
  2633. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2634. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2635. /* payload fields */
  2636. /* for systems using a 64-bit format for bus addresses */
  2637. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2638. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2639. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2640. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2641. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2642. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2643. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2644. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2645. /* for systems using a 32-bit format for bus addresses */
  2646. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2647. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2648. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2649. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2650. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2651. #define HTT_RX_RING_CFG_LEN_S 0
  2652. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2653. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2654. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2655. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2656. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2657. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2658. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2659. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2660. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2661. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2662. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2663. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2664. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2665. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2666. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2667. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2668. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2669. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2670. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2671. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2672. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2673. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2674. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2675. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2676. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2677. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2678. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2679. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2680. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2681. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2682. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2683. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2684. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2685. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2686. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2687. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2688. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2689. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2690. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2691. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2692. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2693. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2694. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2695. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2696. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2697. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2698. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2699. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2700. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2701. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2702. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2703. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2704. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2705. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2706. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2707. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2708. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2709. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2710. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2711. #if HTT_PADDR64
  2712. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2713. #else
  2714. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2715. #endif
  2716. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2717. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2718. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2719. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2720. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2721. do { \
  2722. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2723. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2724. } while (0)
  2725. /* degenerate case for 32-bit fields */
  2726. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2727. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2728. ((_var) = (_val))
  2729. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2730. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2731. ((_var) = (_val))
  2732. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2733. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2734. ((_var) = (_val))
  2735. /* degenerate case for 32-bit fields */
  2736. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2737. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2738. ((_var) = (_val))
  2739. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2740. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2741. ((_var) = (_val))
  2742. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2743. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2744. ((_var) = (_val))
  2745. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2746. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2747. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2748. do { \
  2749. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2750. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2751. } while (0)
  2752. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2753. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2754. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2755. do { \
  2756. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2757. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2758. } while (0)
  2759. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2760. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2761. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2762. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2763. do { \
  2764. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2765. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2766. } while (0)
  2767. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2768. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2769. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2770. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2771. do { \
  2772. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2773. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2774. } while (0)
  2775. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2776. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2777. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2778. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2779. do { \
  2780. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2781. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2782. } while (0)
  2783. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2784. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2785. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2786. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2787. do { \
  2788. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2789. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2790. } while (0)
  2791. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2792. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2793. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2794. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2795. do { \
  2796. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2797. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2798. } while (0)
  2799. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2800. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2801. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2802. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2803. do { \
  2804. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2805. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2806. } while (0)
  2807. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2808. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2809. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2810. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2811. do { \
  2812. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2813. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2814. } while (0)
  2815. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2816. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2817. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2818. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2819. do { \
  2820. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2821. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2822. } while (0)
  2823. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2824. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2825. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2826. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2827. do { \
  2828. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2829. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2830. } while (0)
  2831. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2832. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2833. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2834. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2835. do { \
  2836. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2837. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2838. } while (0)
  2839. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2840. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2841. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2842. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2843. do { \
  2844. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2845. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2846. } while (0)
  2847. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2848. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2849. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2850. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2851. do { \
  2852. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2853. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2854. } while (0)
  2855. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2856. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2857. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2858. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2859. do { \
  2860. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2861. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2862. } while (0)
  2863. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2864. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2865. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2866. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2867. do { \
  2868. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2869. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2870. } while (0)
  2871. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2872. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2873. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2874. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2875. do { \
  2876. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2877. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2878. } while (0)
  2879. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2880. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2881. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2882. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2883. do { \
  2884. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2885. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2886. } while (0)
  2887. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2888. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2889. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2890. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2891. do { \
  2892. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2893. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2894. } while (0)
  2895. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2896. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2897. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2898. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2899. do { \
  2900. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2901. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2902. } while (0)
  2903. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2904. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2905. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2906. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2907. do { \
  2908. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2909. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2910. } while (0)
  2911. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2912. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2913. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2914. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2915. do { \
  2916. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2917. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2918. } while (0)
  2919. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2920. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2921. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2922. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2923. do { \
  2924. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2925. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2926. } while (0)
  2927. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2928. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2929. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2930. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2931. do { \
  2932. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2933. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2934. } while (0)
  2935. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2936. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2937. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2938. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2939. do { \
  2940. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2941. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2942. } while (0)
  2943. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2944. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2945. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2946. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2947. do { \
  2948. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2949. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2950. } while (0)
  2951. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2952. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2953. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2954. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2957. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2958. } while (0)
  2959. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2960. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2961. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2962. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2965. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2966. } while (0)
  2967. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2968. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2969. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2970. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2971. do { \
  2972. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2973. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2974. } while (0)
  2975. /**
  2976. * @brief host -> target FW statistics retrieve
  2977. *
  2978. * @details
  2979. * The following field definitions describe the format of the HTT host
  2980. * to target FW stats retrieve message. The message specifies the type of
  2981. * stats host wants to retrieve.
  2982. *
  2983. * |31 24|23 16|15 8|7 0|
  2984. * |-----------------------------------------------------------|
  2985. * | stats types request bitmask | msg type |
  2986. * |-----------------------------------------------------------|
  2987. * | stats types reset bitmask | reserved |
  2988. * |-----------------------------------------------------------|
  2989. * | stats type | config value |
  2990. * |-----------------------------------------------------------|
  2991. * | cookie LSBs |
  2992. * |-----------------------------------------------------------|
  2993. * | cookie MSBs |
  2994. * |-----------------------------------------------------------|
  2995. * Header fields:
  2996. * - MSG_TYPE
  2997. * Bits 7:0
  2998. * Purpose: identifies this is a stats upload request message
  2999. * Value: 0x3
  3000. * - UPLOAD_TYPES
  3001. * Bits 31:8
  3002. * Purpose: identifies which types of FW statistics to upload
  3003. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3004. * - RESET_TYPES
  3005. * Bits 31:8
  3006. * Purpose: identifies which types of FW statistics to reset
  3007. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3008. * - CFG_VAL
  3009. * Bits 23:0
  3010. * Purpose: give an opaque configuration value to the specified stats type
  3011. * Value: stats-type specific configuration value
  3012. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3013. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3014. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3015. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3016. * - CFG_STAT_TYPE
  3017. * Bits 31:24
  3018. * Purpose: specify which stats type (if any) the config value applies to
  3019. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3020. * a valid configuration specification
  3021. * - COOKIE_LSBS
  3022. * Bits 31:0
  3023. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3024. * message with its preceding host->target stats request message.
  3025. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3026. * - COOKIE_MSBS
  3027. * Bits 31:0
  3028. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3029. * message with its preceding host->target stats request message.
  3030. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3031. */
  3032. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3033. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3034. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3035. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3036. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3037. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3038. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3039. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3040. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3041. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3042. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3043. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3044. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3045. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3046. do { \
  3047. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3048. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3049. } while (0)
  3050. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3051. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3052. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3053. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3054. do { \
  3055. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3056. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3057. } while (0)
  3058. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3059. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3060. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3061. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3062. do { \
  3063. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3064. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3065. } while (0)
  3066. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3067. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3068. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3069. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3070. do { \
  3071. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3072. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3073. } while (0)
  3074. /**
  3075. * @brief host -> target HTT out-of-band sync request
  3076. *
  3077. * @details
  3078. * The HTT SYNC tells the target to suspend processing of subsequent
  3079. * HTT host-to-target messages until some other target agent locally
  3080. * informs the target HTT FW that the current sync counter is equal to
  3081. * or greater than (in a modulo sense) the sync counter specified in
  3082. * the SYNC message.
  3083. * This allows other host-target components to synchronize their operation
  3084. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3085. * security key has been downloaded to and activated by the target.
  3086. * In the absence of any explicit synchronization counter value
  3087. * specification, the target HTT FW will use zero as the default current
  3088. * sync value.
  3089. *
  3090. * |31 24|23 16|15 8|7 0|
  3091. * |-----------------------------------------------------------|
  3092. * | reserved | sync count | msg type |
  3093. * |-----------------------------------------------------------|
  3094. * Header fields:
  3095. * - MSG_TYPE
  3096. * Bits 7:0
  3097. * Purpose: identifies this as a sync message
  3098. * Value: 0x4
  3099. * - SYNC_COUNT
  3100. * Bits 15:8
  3101. * Purpose: specifies what sync value the HTT FW will wait for from
  3102. * an out-of-band specification to resume its operation
  3103. * Value: in-band sync counter value to compare against the out-of-band
  3104. * counter spec.
  3105. * The HTT target FW will suspend its host->target message processing
  3106. * as long as
  3107. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3108. */
  3109. #define HTT_H2T_SYNC_MSG_SZ 4
  3110. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3111. #define HTT_H2T_SYNC_COUNT_S 8
  3112. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3113. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3114. HTT_H2T_SYNC_COUNT_S)
  3115. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3116. do { \
  3117. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3118. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3119. } while (0)
  3120. /**
  3121. * @brief HTT aggregation configuration
  3122. */
  3123. #define HTT_AGGR_CFG_MSG_SZ 4
  3124. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3125. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3126. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3127. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3128. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3129. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3130. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3131. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3134. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3135. } while (0)
  3136. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3137. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3138. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3139. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3142. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3143. } while (0)
  3144. /**
  3145. * @brief host -> target HTT configure max amsdu info per vdev
  3146. *
  3147. * @details
  3148. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3149. *
  3150. * |31 21|20 16|15 8|7 0|
  3151. * |-----------------------------------------------------------|
  3152. * | reserved | vdev id | max amsdu | msg type |
  3153. * |-----------------------------------------------------------|
  3154. * Header fields:
  3155. * - MSG_TYPE
  3156. * Bits 7:0
  3157. * Purpose: identifies this as a aggr cfg ex message
  3158. * Value: 0xa
  3159. * - MAX_NUM_AMSDU_SUBFRM
  3160. * Bits 15:8
  3161. * Purpose: max MSDUs per A-MSDU
  3162. * - VDEV_ID
  3163. * Bits 20:16
  3164. * Purpose: ID of the vdev to which this limit is applied
  3165. */
  3166. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3167. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3168. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3169. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3170. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3171. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3172. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3173. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3174. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3175. do { \
  3176. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3177. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3178. } while (0)
  3179. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3180. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3181. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3182. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3183. do { \
  3184. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3185. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3186. } while (0)
  3187. /**
  3188. * @brief HTT WDI_IPA Config Message
  3189. *
  3190. * @details
  3191. * The HTT WDI_IPA config message is created/sent by host at driver
  3192. * init time. It contains information about data structures used on
  3193. * WDI_IPA TX and RX path.
  3194. * TX CE ring is used for pushing packet metadata from IPA uC
  3195. * to WLAN FW
  3196. * TX Completion ring is used for generating TX completions from
  3197. * WLAN FW to IPA uC
  3198. * RX Indication ring is used for indicating RX packets from FW
  3199. * to IPA uC
  3200. * RX Ring2 is used as either completion ring or as second
  3201. * indication ring. when Ring2 is used as completion ring, IPA uC
  3202. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3203. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3204. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3205. * indicated in RX Indication ring. Please see WDI_IPA specification
  3206. * for more details.
  3207. * |31 24|23 16|15 8|7 0|
  3208. * |----------------+----------------+----------------+----------------|
  3209. * | tx pkt pool size | Rsvd | msg_type |
  3210. * |-------------------------------------------------------------------|
  3211. * | tx comp ring base (bits 31:0) |
  3212. #if HTT_PADDR64
  3213. * | tx comp ring base (bits 63:32) |
  3214. #endif
  3215. * |-------------------------------------------------------------------|
  3216. * | tx comp ring size |
  3217. * |-------------------------------------------------------------------|
  3218. * | tx comp WR_IDX physical address (bits 31:0) |
  3219. #if HTT_PADDR64
  3220. * | tx comp WR_IDX physical address (bits 63:32) |
  3221. #endif
  3222. * |-------------------------------------------------------------------|
  3223. * | tx CE WR_IDX physical address (bits 31:0) |
  3224. #if HTT_PADDR64
  3225. * | tx CE WR_IDX physical address (bits 63:32) |
  3226. #endif
  3227. * |-------------------------------------------------------------------|
  3228. * | rx indication ring base (bits 31:0) |
  3229. #if HTT_PADDR64
  3230. * | rx indication ring base (bits 63:32) |
  3231. #endif
  3232. * |-------------------------------------------------------------------|
  3233. * | rx indication ring size |
  3234. * |-------------------------------------------------------------------|
  3235. * | rx ind RD_IDX physical address (bits 31:0) |
  3236. #if HTT_PADDR64
  3237. * | rx ind RD_IDX physical address (bits 63:32) |
  3238. #endif
  3239. * |-------------------------------------------------------------------|
  3240. * | rx ind WR_IDX physical address (bits 31:0) |
  3241. #if HTT_PADDR64
  3242. * | rx ind WR_IDX physical address (bits 63:32) |
  3243. #endif
  3244. * |-------------------------------------------------------------------|
  3245. * |-------------------------------------------------------------------|
  3246. * | rx ring2 base (bits 31:0) |
  3247. #if HTT_PADDR64
  3248. * | rx ring2 base (bits 63:32) |
  3249. #endif
  3250. * |-------------------------------------------------------------------|
  3251. * | rx ring2 size |
  3252. * |-------------------------------------------------------------------|
  3253. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3254. #if HTT_PADDR64
  3255. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3256. #endif
  3257. * |-------------------------------------------------------------------|
  3258. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3259. #if HTT_PADDR64
  3260. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3261. #endif
  3262. * |-------------------------------------------------------------------|
  3263. *
  3264. * Header fields:
  3265. * Header fields:
  3266. * - MSG_TYPE
  3267. * Bits 7:0
  3268. * Purpose: Identifies this as WDI_IPA config message
  3269. * value: = 0x8
  3270. * - TX_PKT_POOL_SIZE
  3271. * Bits 15:0
  3272. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3273. * WDI_IPA TX path
  3274. * For systems using 32-bit format for bus addresses:
  3275. * - TX_COMP_RING_BASE_ADDR
  3276. * Bits 31:0
  3277. * Purpose: TX Completion Ring base address in DDR
  3278. * - TX_COMP_RING_SIZE
  3279. * Bits 31:0
  3280. * Purpose: TX Completion Ring size (must be power of 2)
  3281. * - TX_COMP_WR_IDX_ADDR
  3282. * Bits 31:0
  3283. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3284. * updates the Write Index for WDI_IPA TX completion ring
  3285. * - TX_CE_WR_IDX_ADDR
  3286. * Bits 31:0
  3287. * Purpose: DDR address where IPA uC
  3288. * updates the WR Index for TX CE ring
  3289. * (needed for fusion platforms)
  3290. * - RX_IND_RING_BASE_ADDR
  3291. * Bits 31:0
  3292. * Purpose: RX Indication Ring base address in DDR
  3293. * - RX_IND_RING_SIZE
  3294. * Bits 31:0
  3295. * Purpose: RX Indication Ring size
  3296. * - RX_IND_RD_IDX_ADDR
  3297. * Bits 31:0
  3298. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3299. * RX indication ring
  3300. * - RX_IND_WR_IDX_ADDR
  3301. * Bits 31:0
  3302. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3303. * updates the Write Index for WDI_IPA RX indication ring
  3304. * - RX_RING2_BASE_ADDR
  3305. * Bits 31:0
  3306. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3307. * - RX_RING2_SIZE
  3308. * Bits 31:0
  3309. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3310. * - RX_RING2_RD_IDX_ADDR
  3311. * Bits 31:0
  3312. * Purpose: If Second RX ring is Indication ring, DDR address where
  3313. * IPA uC updates the Read Index for Ring2.
  3314. * If Second RX ring is completion ring, this is NOT used
  3315. * - RX_RING2_WR_IDX_ADDR
  3316. * Bits 31:0
  3317. * Purpose: If Second RX ring is Indication ring, DDR address where
  3318. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3319. * If second RX ring is completion ring, DDR address where
  3320. * IPA uC updates the Write Index for Ring 2.
  3321. * For systems using 64-bit format for bus addresses:
  3322. * - TX_COMP_RING_BASE_ADDR_LO
  3323. * Bits 31:0
  3324. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3325. * - TX_COMP_RING_BASE_ADDR_HI
  3326. * Bits 31:0
  3327. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3328. * - TX_COMP_RING_SIZE
  3329. * Bits 31:0
  3330. * Purpose: TX Completion Ring size (must be power of 2)
  3331. * - TX_COMP_WR_IDX_ADDR_LO
  3332. * Bits 31:0
  3333. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3334. * Lower 4 bytes of DDR address where WIFI FW
  3335. * updates the Write Index for WDI_IPA TX completion ring
  3336. * - TX_COMP_WR_IDX_ADDR_HI
  3337. * Bits 31:0
  3338. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3339. * Higher 4 bytes of DDR address where WIFI FW
  3340. * updates the Write Index for WDI_IPA TX completion ring
  3341. * - TX_CE_WR_IDX_ADDR_LO
  3342. * Bits 31:0
  3343. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3344. * updates the WR Index for TX CE ring
  3345. * (needed for fusion platforms)
  3346. * - TX_CE_WR_IDX_ADDR_HI
  3347. * Bits 31:0
  3348. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3349. * updates the WR Index for TX CE ring
  3350. * (needed for fusion platforms)
  3351. * - RX_IND_RING_BASE_ADDR_LO
  3352. * Bits 31:0
  3353. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3354. * - RX_IND_RING_BASE_ADDR_HI
  3355. * Bits 31:0
  3356. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3357. * - RX_IND_RING_SIZE
  3358. * Bits 31:0
  3359. * Purpose: RX Indication Ring size
  3360. * - RX_IND_RD_IDX_ADDR_LO
  3361. * Bits 31:0
  3362. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3363. * for WDI_IPA RX indication ring
  3364. * - RX_IND_RD_IDX_ADDR_HI
  3365. * Bits 31:0
  3366. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3367. * for WDI_IPA RX indication ring
  3368. * - RX_IND_WR_IDX_ADDR_LO
  3369. * Bits 31:0
  3370. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3371. * Lower 4 bytes of DDR address where WIFI FW
  3372. * updates the Write Index for WDI_IPA RX indication ring
  3373. * - RX_IND_WR_IDX_ADDR_HI
  3374. * Bits 31:0
  3375. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3376. * Higher 4 bytes of DDR address where WIFI FW
  3377. * updates the Write Index for WDI_IPA RX indication ring
  3378. * - RX_RING2_BASE_ADDR_LO
  3379. * Bits 31:0
  3380. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3381. * - RX_RING2_BASE_ADDR_HI
  3382. * Bits 31:0
  3383. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3384. * - RX_RING2_SIZE
  3385. * Bits 31:0
  3386. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3387. * - RX_RING2_RD_IDX_ADDR_LO
  3388. * Bits 31:0
  3389. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3390. * DDR address where IPA uC updates the Read Index for Ring2.
  3391. * If Second RX ring is completion ring, this is NOT used
  3392. * - RX_RING2_RD_IDX_ADDR_HI
  3393. * Bits 31:0
  3394. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3395. * DDR address where IPA uC updates the Read Index for Ring2.
  3396. * If Second RX ring is completion ring, this is NOT used
  3397. * - RX_RING2_WR_IDX_ADDR_LO
  3398. * Bits 31:0
  3399. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3400. * DDR address where WIFI FW updates the Write Index
  3401. * for WDI_IPA RX ring2
  3402. * If second RX ring is completion ring, lower 4 bytes of
  3403. * DDR address where IPA uC updates the Write Index for Ring 2.
  3404. * - RX_RING2_WR_IDX_ADDR_HI
  3405. * Bits 31:0
  3406. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3407. * DDR address where WIFI FW updates the Write Index
  3408. * for WDI_IPA RX ring2
  3409. * If second RX ring is completion ring, higher 4 bytes of
  3410. * DDR address where IPA uC updates the Write Index for Ring 2.
  3411. */
  3412. #if HTT_PADDR64
  3413. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3414. #else
  3415. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3416. #endif
  3417. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3418. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3419. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3420. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3421. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3422. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3423. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3424. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3425. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3426. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3427. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3428. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3429. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3430. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3431. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3432. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3433. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3434. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3435. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3436. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3437. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3438. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3439. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3440. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3441. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3442. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3443. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3444. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3445. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3446. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3447. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3448. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3449. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3450. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3451. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3452. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3453. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3454. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3455. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3456. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3457. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3458. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3460. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3461. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3462. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3463. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3464. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3465. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3466. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3467. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3468. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3469. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3470. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3471. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3472. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3473. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3474. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3475. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3476. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3477. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3478. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3479. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3480. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3481. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3482. do { \
  3483. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3484. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3485. } while (0)
  3486. /* for systems using 32-bit format for bus addr */
  3487. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3488. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3490. do { \
  3491. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3492. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3493. } while (0)
  3494. /* for systems using 64-bit format for bus addr */
  3495. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3496. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3497. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3498. do { \
  3499. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3500. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3501. } while (0)
  3502. /* for systems using 64-bit format for bus addr */
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3504. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3506. do { \
  3507. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3508. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3509. } while (0)
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3511. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3513. do { \
  3514. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3515. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3516. } while (0)
  3517. /* for systems using 32-bit format for bus addr */
  3518. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3519. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3520. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3521. do { \
  3522. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3523. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3524. } while (0)
  3525. /* for systems using 64-bit format for bus addr */
  3526. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3527. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3528. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3531. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3532. } while (0)
  3533. /* for systems using 64-bit format for bus addr */
  3534. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3535. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3536. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3539. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3540. } while (0)
  3541. /* for systems using 32-bit format for bus addr */
  3542. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3543. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3544. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3547. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3548. } while (0)
  3549. /* for systems using 64-bit format for bus addr */
  3550. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3551. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3552. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3555. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3556. } while (0)
  3557. /* for systems using 64-bit format for bus addr */
  3558. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3559. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3560. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3563. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3564. } while (0)
  3565. /* for systems using 32-bit format for bus addr */
  3566. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3567. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3568. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3569. do { \
  3570. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3571. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3572. } while (0)
  3573. /* for systems using 64-bit format for bus addr */
  3574. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3575. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3576. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3577. do { \
  3578. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3579. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3580. } while (0)
  3581. /* for systems using 64-bit format for bus addr */
  3582. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3583. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3584. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3585. do { \
  3586. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3587. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3588. } while (0)
  3589. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3590. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3591. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3592. do { \
  3593. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3594. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3595. } while (0)
  3596. /* for systems using 32-bit format for bus addr */
  3597. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3598. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3599. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3600. do { \
  3601. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3602. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3603. } while (0)
  3604. /* for systems using 64-bit format for bus addr */
  3605. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3606. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3607. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3608. do { \
  3609. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3610. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3611. } while (0)
  3612. /* for systems using 64-bit format for bus addr */
  3613. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3614. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3615. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3616. do { \
  3617. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3618. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3619. } while (0)
  3620. /* for systems using 32-bit format for bus addr */
  3621. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3622. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3623. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3626. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3627. } while (0)
  3628. /* for systems using 64-bit format for bus addr */
  3629. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3630. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3631. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3632. do { \
  3633. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3634. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3635. } while (0)
  3636. /* for systems using 64-bit format for bus addr */
  3637. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3638. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3639. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3640. do { \
  3641. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3642. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3643. } while (0)
  3644. /* for systems using 32-bit format for bus addr */
  3645. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3646. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3647. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3648. do { \
  3649. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3650. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3651. } while (0)
  3652. /* for systems using 64-bit format for bus addr */
  3653. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3654. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3655. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3656. do { \
  3657. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3658. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3659. } while (0)
  3660. /* for systems using 64-bit format for bus addr */
  3661. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3662. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3663. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3664. do { \
  3665. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3666. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3667. } while (0)
  3668. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3669. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3670. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3673. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3674. } while (0)
  3675. /* for systems using 32-bit format for bus addr */
  3676. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3677. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3678. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3681. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3682. } while (0)
  3683. /* for systems using 64-bit format for bus addr */
  3684. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3685. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3686. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3687. do { \
  3688. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3689. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3690. } while (0)
  3691. /* for systems using 64-bit format for bus addr */
  3692. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3693. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3694. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3695. do { \
  3696. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3697. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3698. } while (0)
  3699. /* for systems using 32-bit format for bus addr */
  3700. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3701. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3702. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3703. do { \
  3704. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3705. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3706. } while (0)
  3707. /* for systems using 64-bit format for bus addr */
  3708. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3709. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3710. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3711. do { \
  3712. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3713. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3714. } while (0)
  3715. /* for systems using 64-bit format for bus addr */
  3716. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3717. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3718. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3719. do { \
  3720. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3721. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3722. } while (0)
  3723. /*
  3724. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3725. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3726. * addresses are stored in a XXX-bit field.
  3727. * This macro is used to define both htt_wdi_ipa_config32_t and
  3728. * htt_wdi_ipa_config64_t structs.
  3729. */
  3730. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3731. _paddr__tx_comp_ring_base_addr_, \
  3732. _paddr__tx_comp_wr_idx_addr_, \
  3733. _paddr__tx_ce_wr_idx_addr_, \
  3734. _paddr__rx_ind_ring_base_addr_, \
  3735. _paddr__rx_ind_rd_idx_addr_, \
  3736. _paddr__rx_ind_wr_idx_addr_, \
  3737. _paddr__rx_ring2_base_addr_,\
  3738. _paddr__rx_ring2_rd_idx_addr_,\
  3739. _paddr__rx_ring2_wr_idx_addr_) \
  3740. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3741. { \
  3742. /* DWORD 0: flags and meta-data */ \
  3743. A_UINT32 \
  3744. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3745. reserved: 8, \
  3746. tx_pkt_pool_size: 16;\
  3747. /* DWORD 1 */\
  3748. _paddr__tx_comp_ring_base_addr_;\
  3749. /* DWORD 2 (or 3)*/\
  3750. A_UINT32 tx_comp_ring_size;\
  3751. /* DWORD 3 (or 4)*/\
  3752. _paddr__tx_comp_wr_idx_addr_;\
  3753. /* DWORD 4 (or 6)*/\
  3754. _paddr__tx_ce_wr_idx_addr_;\
  3755. /* DWORD 5 (or 8)*/\
  3756. _paddr__rx_ind_ring_base_addr_;\
  3757. /* DWORD 6 (or 10)*/\
  3758. A_UINT32 rx_ind_ring_size;\
  3759. /* DWORD 7 (or 11)*/\
  3760. _paddr__rx_ind_rd_idx_addr_;\
  3761. /* DWORD 8 (or 13)*/\
  3762. _paddr__rx_ind_wr_idx_addr_;\
  3763. /* DWORD 9 (or 15)*/\
  3764. _paddr__rx_ring2_base_addr_;\
  3765. /* DWORD 10 (or 17) */\
  3766. A_UINT32 rx_ring2_size;\
  3767. /* DWORD 11 (or 18) */\
  3768. _paddr__rx_ring2_rd_idx_addr_;\
  3769. /* DWORD 12 (or 20) */\
  3770. _paddr__rx_ring2_wr_idx_addr_;\
  3771. } POSTPACK
  3772. /* define a htt_wdi_ipa_config32_t type */
  3773. 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));
  3774. /* define a htt_wdi_ipa_config64_t type */
  3775. 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));
  3776. #if HTT_PADDR64
  3777. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3778. #else
  3779. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3780. #endif
  3781. enum htt_wdi_ipa_op_code {
  3782. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3783. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3784. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3785. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3786. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3787. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3788. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3789. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3790. /* keep this last */
  3791. HTT_WDI_IPA_OPCODE_MAX
  3792. };
  3793. /**
  3794. * @brief HTT WDI_IPA Operation Request Message
  3795. *
  3796. * @details
  3797. * HTT WDI_IPA Operation Request message is sent by host
  3798. * to either suspend or resume WDI_IPA TX or RX path.
  3799. * |31 24|23 16|15 8|7 0|
  3800. * |----------------+----------------+----------------+----------------|
  3801. * | op_code | Rsvd | msg_type |
  3802. * |-------------------------------------------------------------------|
  3803. *
  3804. * Header fields:
  3805. * - MSG_TYPE
  3806. * Bits 7:0
  3807. * Purpose: Identifies this as WDI_IPA Operation Request message
  3808. * value: = 0x9
  3809. * - OP_CODE
  3810. * Bits 31:16
  3811. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3812. * value: = enum htt_wdi_ipa_op_code
  3813. */
  3814. PREPACK struct htt_wdi_ipa_op_request_t
  3815. {
  3816. /* DWORD 0: flags and meta-data */
  3817. A_UINT32
  3818. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3819. reserved: 8,
  3820. op_code: 16;
  3821. } POSTPACK;
  3822. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3823. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3824. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3825. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3826. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3827. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3828. do { \
  3829. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3830. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3831. } while (0)
  3832. /*
  3833. * @brief host -> target HTT_SRING_SETUP message
  3834. *
  3835. * @details
  3836. * After target is booted up, Host can send SRING setup message for
  3837. * each host facing LMAC SRING. Target setups up HW registers based
  3838. * on setup message and confirms back to Host if response_required is set.
  3839. * Host should wait for confirmation message before sending new SRING
  3840. * setup message
  3841. *
  3842. * The message would appear as follows:
  3843. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3844. * |--------------- +-----------------+----------------+------------------|
  3845. * | ring_type | ring_id | pdev_id | msg_type |
  3846. * |----------------------------------------------------------------------|
  3847. * | ring_base_addr_lo |
  3848. * |----------------------------------------------------------------------|
  3849. * | ring_base_addr_hi |
  3850. * |----------------------------------------------------------------------|
  3851. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3852. * |----------------------------------------------------------------------|
  3853. * | ring_head_offset32_remote_addr_lo |
  3854. * |----------------------------------------------------------------------|
  3855. * | ring_head_offset32_remote_addr_hi |
  3856. * |----------------------------------------------------------------------|
  3857. * | ring_tail_offset32_remote_addr_lo |
  3858. * |----------------------------------------------------------------------|
  3859. * | ring_tail_offset32_remote_addr_hi |
  3860. * |----------------------------------------------------------------------|
  3861. * | ring_msi_addr_lo |
  3862. * |----------------------------------------------------------------------|
  3863. * | ring_msi_addr_hi |
  3864. * |----------------------------------------------------------------------|
  3865. * | ring_msi_data |
  3866. * |----------------------------------------------------------------------|
  3867. * | intr_timer_th |IM| intr_batch_counter_th |
  3868. * |----------------------------------------------------------------------|
  3869. * | reserved |RR|PTCF| intr_low_threshold |
  3870. * |----------------------------------------------------------------------|
  3871. * Where
  3872. * IM = sw_intr_mode
  3873. * RR = response_required
  3874. * PTCF = prefetch_timer_cfg
  3875. *
  3876. * The message is interpreted as follows:
  3877. * dword0 - b'0:7 - msg_type: This will be set to
  3878. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3879. * b'8:15 - pdev_id:
  3880. * 0 (for rings at SOC/UMAC level),
  3881. * 1/2/3 mac id (for rings at LMAC level)
  3882. * b'16:23 - ring_id: identify which ring is to setup,
  3883. * more details can be got from enum htt_srng_ring_id
  3884. * b'24:31 - ring_type: identify type of host rings,
  3885. * more details can be got from enum htt_srng_ring_type
  3886. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3887. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3888. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3889. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3890. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3891. * SW_TO_HW_RING.
  3892. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3893. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3894. * Lower 32 bits of memory address of the remote variable
  3895. * storing the 4-byte word offset that identifies the head
  3896. * element within the ring.
  3897. * (The head offset variable has type A_UINT32.)
  3898. * Valid for HW_TO_SW and SW_TO_SW rings.
  3899. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3900. * Upper 32 bits of memory address of the remote variable
  3901. * storing the 4-byte word offset that identifies the head
  3902. * element within the ring.
  3903. * (The head offset variable has type A_UINT32.)
  3904. * Valid for HW_TO_SW and SW_TO_SW rings.
  3905. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3906. * Lower 32 bits of memory address of the remote variable
  3907. * storing the 4-byte word offset that identifies the tail
  3908. * element within the ring.
  3909. * (The tail offset variable has type A_UINT32.)
  3910. * Valid for HW_TO_SW and SW_TO_SW rings.
  3911. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3912. * Upper 32 bits of memory address of the remote variable
  3913. * storing the 4-byte word offset that identifies the tail
  3914. * element within the ring.
  3915. * (The tail offset variable has type A_UINT32.)
  3916. * Valid for HW_TO_SW and SW_TO_SW rings.
  3917. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3918. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3919. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3920. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3921. * dword10 - b'0:31 - ring_msi_data: MSI data
  3922. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3923. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3924. * dword11 - b'0:14 - intr_batch_counter_th:
  3925. * batch counter threshold is in units of 4-byte words.
  3926. * HW internally maintains and increments batch count.
  3927. * (see SRING spec for detail description).
  3928. * When batch count reaches threshold value, an interrupt
  3929. * is generated by HW.
  3930. * b'15 - sw_intr_mode:
  3931. * This configuration shall be static.
  3932. * Only programmed at power up.
  3933. * 0: generate pulse style sw interrupts
  3934. * 1: generate level style sw interrupts
  3935. * b'16:31 - intr_timer_th:
  3936. * The timer init value when timer is idle or is
  3937. * initialized to start downcounting.
  3938. * In 8us units (to cover a range of 0 to 524 ms)
  3939. * dword12 - b'0:15 - intr_low_threshold:
  3940. * Used only by Consumer ring to generate ring_sw_int_p.
  3941. * Ring entries low threshold water mark, that is used
  3942. * in combination with the interrupt timer as well as
  3943. * the the clearing of the level interrupt.
  3944. * b'16:18 - prefetch_timer_cfg:
  3945. * Used only by Consumer ring to set timer mode to
  3946. * support Application prefetch handling.
  3947. * The external tail offset/pointer will be updated
  3948. * at following intervals:
  3949. * 3'b000: (Prefetch feature disabled; used only for debug)
  3950. * 3'b001: 1 usec
  3951. * 3'b010: 4 usec
  3952. * 3'b011: 8 usec (default)
  3953. * 3'b100: 16 usec
  3954. * Others: Reserverd
  3955. * b'19 - response_required:
  3956. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3957. * b'20:31 - reserved: reserved for future use
  3958. */
  3959. PREPACK struct htt_sring_setup_t {
  3960. A_UINT32 msg_type: 8,
  3961. pdev_id: 8,
  3962. ring_id: 8,
  3963. ring_type: 8;
  3964. A_UINT32 ring_base_addr_lo;
  3965. A_UINT32 ring_base_addr_hi;
  3966. A_UINT32 ring_size: 16,
  3967. ring_entry_size: 8,
  3968. ring_misc_cfg_flag: 8;
  3969. A_UINT32 ring_head_offset32_remote_addr_lo;
  3970. A_UINT32 ring_head_offset32_remote_addr_hi;
  3971. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3972. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3973. A_UINT32 ring_msi_addr_lo;
  3974. A_UINT32 ring_msi_addr_hi;
  3975. A_UINT32 ring_msi_data;
  3976. A_UINT32 intr_batch_counter_th: 15,
  3977. sw_intr_mode: 1,
  3978. intr_timer_th: 16;
  3979. A_UINT32 intr_low_threshold: 16,
  3980. prefetch_timer_cfg: 3,
  3981. response_required: 1,
  3982. reserved1: 12;
  3983. } POSTPACK;
  3984. enum htt_srng_ring_type {
  3985. HTT_HW_TO_SW_RING = 0,
  3986. HTT_SW_TO_HW_RING,
  3987. HTT_SW_TO_SW_RING,
  3988. /* Insert new ring types above this line */
  3989. };
  3990. enum htt_srng_ring_id {
  3991. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  3992. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  3993. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3994. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3995. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  3996. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  3997. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  3998. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  3999. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4000. /* Add Other SRING which can't be directly configured by host software above this line */
  4001. };
  4002. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4003. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4004. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4005. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4006. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4007. HTT_SRING_SETUP_PDEV_ID_S)
  4008. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4009. do { \
  4010. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4011. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4012. } while (0)
  4013. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4014. #define HTT_SRING_SETUP_RING_ID_S 16
  4015. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4016. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4017. HTT_SRING_SETUP_RING_ID_S)
  4018. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4019. do { \
  4020. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4021. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4022. } while (0)
  4023. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4024. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4025. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4026. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4027. HTT_SRING_SETUP_RING_TYPE_S)
  4028. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4029. do { \
  4030. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4031. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4032. } while (0)
  4033. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4034. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4035. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4036. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4037. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4038. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4039. do { \
  4040. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4041. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4042. } while (0)
  4043. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4044. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4045. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4046. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4047. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4048. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4049. do { \
  4050. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4051. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4052. } while (0)
  4053. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4054. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4055. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4056. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4057. HTT_SRING_SETUP_RING_SIZE_S)
  4058. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4059. do { \
  4060. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4061. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4062. } while (0)
  4063. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4064. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4065. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4066. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4067. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4068. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4069. do { \
  4070. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4071. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4072. } while (0)
  4073. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4074. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4075. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4076. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4077. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4078. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4079. do { \
  4080. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4081. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4082. } while (0)
  4083. /* This control bit is applicable to only Producer, which updates Ring ID field
  4084. * of each descriptor before pushing into the ring.
  4085. * 0: updates ring_id(default)
  4086. * 1: ring_id updating disabled */
  4087. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4088. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4089. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4090. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4091. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4092. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4093. do { \
  4094. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4095. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4096. } while (0)
  4097. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4098. * of each descriptor before pushing into the ring.
  4099. * 0: updates Loopcnt(default)
  4100. * 1: Loopcnt updating disabled */
  4101. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4102. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4103. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4104. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4105. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4106. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4107. do { \
  4108. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4109. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4110. } while (0)
  4111. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4112. * into security_id port of GXI/AXI. */
  4113. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4114. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4115. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4116. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4117. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4118. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4121. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4122. } while (0)
  4123. /* During MSI write operation, SRNG drives value of this register bit into
  4124. * swap bit of GXI/AXI. */
  4125. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4126. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4127. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4128. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4129. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4130. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4133. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4134. } while (0)
  4135. /* During Pointer write operation, SRNG drives value of this register bit into
  4136. * swap bit of GXI/AXI. */
  4137. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4138. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4139. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4140. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4141. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4142. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4143. do { \
  4144. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4145. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4146. } while (0)
  4147. /* During any data or TLV write operation, SRNG drives value of this register
  4148. * bit into swap bit of GXI/AXI. */
  4149. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4150. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4151. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4152. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4153. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4154. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4155. do { \
  4156. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4157. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4158. } while (0)
  4159. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4160. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4161. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4162. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4163. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4164. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4165. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4166. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4169. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4170. } while (0)
  4171. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4172. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4173. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4174. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4175. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4176. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4179. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4180. } while (0)
  4181. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4182. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4183. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4184. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4185. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4186. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4187. do { \
  4188. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4189. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4190. } while (0)
  4191. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4192. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4193. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4194. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4195. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4196. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4197. do { \
  4198. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4199. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4200. } while (0)
  4201. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4202. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4203. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4204. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4205. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4206. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4209. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4210. } while (0)
  4211. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4212. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4213. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4214. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4215. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4216. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4217. do { \
  4218. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4219. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4220. } while (0)
  4221. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4222. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4223. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4224. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4225. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4226. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4227. do { \
  4228. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4229. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4230. } while (0)
  4231. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4232. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4233. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4234. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4235. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4236. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4239. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4240. } while (0)
  4241. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4242. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4243. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4244. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4245. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4246. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4247. do { \
  4248. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4249. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4250. } while (0)
  4251. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4252. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4253. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4254. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4255. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4256. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4257. do { \
  4258. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4259. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4260. } while (0)
  4261. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4262. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4263. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4264. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4265. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4266. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4267. do { \
  4268. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4269. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4270. } while (0)
  4271. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4272. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4273. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4274. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4275. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4276. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4279. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4280. } while (0)
  4281. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4282. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4283. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4284. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4285. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4286. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4287. do { \
  4288. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4289. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4290. } while (0)
  4291. /**
  4292. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4293. *
  4294. * @details
  4295. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4296. * configure RXDMA rings.
  4297. * The configuration is per ring based and includes both packet subtypes
  4298. * and PPDU/MPDU TLVs.
  4299. *
  4300. * The message would appear as follows:
  4301. *
  4302. * |31 27|26|25|24|23 16|15 8|7 0|
  4303. * |-----------------+----------------+----------------+---------------|
  4304. * | rsvd1 |OV|PS|SS| ring_id | pdev_id | msg_type |
  4305. * |-------------------------------------------------------------------|
  4306. * | rsvd2 | ring_buffer_size |
  4307. * |-------------------------------------------------------------------|
  4308. * | packet_type_enable_flags_0 |
  4309. * |-------------------------------------------------------------------|
  4310. * | packet_type_enable_flags_1 |
  4311. * |-------------------------------------------------------------------|
  4312. * | packet_type_enable_flags_2 |
  4313. * |-------------------------------------------------------------------|
  4314. * | packet_type_enable_flags_3 |
  4315. * |-------------------------------------------------------------------|
  4316. * | tlv_filter_in_flags |
  4317. * |-------------------------------------------------------------------|
  4318. * | rx_header_offset | rx_packet_offset |
  4319. * |-------------------------------------------------------------------|
  4320. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4321. * |-------------------------------------------------------------------|
  4322. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4323. * |-------------------------------------------------------------------|
  4324. * | rsvd3 | rx_attention_offset |
  4325. * |-------------------------------------------------------------------|
  4326. * Where:
  4327. * PS = pkt_swap
  4328. * SS = status_swap
  4329. * OV = rx_offsets_valid
  4330. * The message is interpreted as follows:
  4331. * dword0 - b'0:7 - msg_type: This will be set to
  4332. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4333. * b'8:15 - pdev_id:
  4334. * 0 (for rings at SOC/UMAC level),
  4335. * 1/2/3 mac id (for rings at LMAC level)
  4336. * b'16:23 - ring_id : Identify the ring to configure.
  4337. * More details can be got from enum htt_srng_ring_id
  4338. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4339. * BUF_RING_CFG_0 defs within HW .h files,
  4340. * e.g. wmac_top_reg_seq_hwioreg.h
  4341. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4342. * BUF_RING_CFG_0 defs within HW .h files,
  4343. * e.g. wmac_top_reg_seq_hwioreg.h
  4344. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4345. * configuration fields are valid
  4346. * b'27:31 - rsvd1: reserved for future use
  4347. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4348. * in byte units.
  4349. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4350. * - b'16:31 - rsvd2: Reserved for future use
  4351. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4352. * Enable MGMT packet from 0b0000 to 0b1001
  4353. * bits from low to high: FP, MD, MO - 3 bits
  4354. * FP: Filter_Pass
  4355. * MD: Monitor_Direct
  4356. * MO: Monitor_Other
  4357. * 10 mgmt subtypes * 3 bits -> 30 bits
  4358. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4359. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4360. * Enable MGMT packet from 0b1010 to 0b1111
  4361. * bits from low to high: FP, MD, MO - 3 bits
  4362. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4363. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4364. * Enable CTRL packet from 0b0000 to 0b1001
  4365. * bits from low to high: FP, MD, MO - 3 bits
  4366. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4367. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4368. * Enable CTRL packet from 0b1010 to 0b1111,
  4369. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4370. * bits from low to high: FP, MD, MO - 3 bits
  4371. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4372. * dword6 - b'0:31 - tlv_filter_in_flags:
  4373. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4374. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4375. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4376. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4377. * A value of 0 will be considered as ignore this config.
  4378. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4379. * e.g. wmac_top_reg_seq_hwioreg.h
  4380. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4381. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4382. * A value of 0 will be considered as ignore this config.
  4383. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4384. * e.g. wmac_top_reg_seq_hwioreg.h
  4385. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4386. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4387. * A value of 0 will be considered as ignore this config.
  4388. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4389. * e.g. wmac_top_reg_seq_hwioreg.h
  4390. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4391. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4392. * A value of 0 will be considered as ignore this config.
  4393. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4394. * e.g. wmac_top_reg_seq_hwioreg.h
  4395. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4396. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4397. * A value of 0 will be considered as ignore this config.
  4398. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4399. * e.g. wmac_top_reg_seq_hwioreg.h
  4400. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4401. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4402. * A value of 0 will be considered as ignore this config.
  4403. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4404. * e.g. wmac_top_reg_seq_hwioreg.h
  4405. * dword10 - b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4406. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4407. * A value of 0 will be considered as ignore this config.
  4408. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4409. * e.g. wmac_top_reg_seq_hwioreg.h
  4410. * - b'16-31 - rsvd3 for future use
  4411. */
  4412. PREPACK struct htt_rx_ring_selection_cfg_t {
  4413. A_UINT32 msg_type: 8,
  4414. pdev_id: 8,
  4415. ring_id: 8,
  4416. status_swap: 1,
  4417. pkt_swap: 1,
  4418. rx_offsets_valid: 1,
  4419. rsvd1: 5;
  4420. A_UINT32 ring_buffer_size: 16,
  4421. rsvd2: 16;
  4422. A_UINT32 packet_type_enable_flags_0;
  4423. A_UINT32 packet_type_enable_flags_1;
  4424. A_UINT32 packet_type_enable_flags_2;
  4425. A_UINT32 packet_type_enable_flags_3;
  4426. A_UINT32 tlv_filter_in_flags;
  4427. A_UINT32 rx_packet_offset: 16,
  4428. rx_header_offset: 16;
  4429. A_UINT32 rx_mpdu_end_offset: 16,
  4430. rx_mpdu_start_offset: 16;
  4431. A_UINT32 rx_msdu_end_offset: 16,
  4432. rx_msdu_start_offset: 16;
  4433. A_UINT32 rx_attn_offset: 16,
  4434. rsvd3: 16;
  4435. } POSTPACK;
  4436. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4437. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4438. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4439. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4440. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4441. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4442. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4443. do { \
  4444. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4445. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4446. } while (0)
  4447. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4448. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4449. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4450. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4451. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4452. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4453. do { \
  4454. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4455. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4456. } while (0)
  4457. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4458. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4459. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4460. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4461. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4462. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4463. do { \
  4464. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4465. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4466. } while (0)
  4467. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4469. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4470. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4471. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4473. do { \
  4474. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4475. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4476. } while (0)
  4477. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4478. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4479. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4480. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4481. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4482. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4483. do { \
  4484. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4485. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4486. } while (0)
  4487. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4488. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4489. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4490. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4491. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4492. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4493. do { \
  4494. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4495. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4496. } while (0)
  4497. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4500. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4501. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4503. do { \
  4504. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4505. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4506. } while (0)
  4507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4510. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4511. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4513. do { \
  4514. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4515. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4516. } while (0)
  4517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4520. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4521. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4523. do { \
  4524. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4525. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4526. } while (0)
  4527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4530. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4531. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4533. do { \
  4534. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4535. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4536. } while (0)
  4537. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4538. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4539. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4540. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4541. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4542. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4543. do { \
  4544. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4545. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4546. } while (0)
  4547. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4548. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4549. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4550. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4551. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4552. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4553. do { \
  4554. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4555. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4556. } while (0)
  4557. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4558. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4559. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4560. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4561. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4562. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4563. do { \
  4564. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4565. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4566. } while (0)
  4567. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4568. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4569. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4570. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4571. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4572. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4573. do { \
  4574. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4575. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4576. } while (0)
  4577. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4578. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4579. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4580. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4581. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4582. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4583. do { \
  4584. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4585. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4586. } while (0)
  4587. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4588. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4589. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4590. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4591. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4592. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4593. do { \
  4594. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4595. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4596. } while (0)
  4597. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4598. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4599. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4600. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4601. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4602. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4603. do { \
  4604. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4605. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4606. } while (0)
  4607. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4608. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4609. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4610. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4611. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4612. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4613. do { \
  4614. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4615. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4616. } while (0)
  4617. /*
  4618. * Subtype based MGMT frames enable bits.
  4619. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4620. */
  4621. /* association request */
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4628. /* association response */
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4635. /* Reassociation request */
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4642. /* Reassociation response */
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4648. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4649. /* Probe request */
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4655. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4656. /* Probe response */
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4663. /* Timing Advertisement */
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4670. /* Reserved */
  4671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4677. /* Beacon */
  4678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4684. /* ATIM */
  4685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4691. /* Disassociation */
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4698. /* Authentication */
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4705. /* Deauthentication */
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4712. /* Action */
  4713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4719. /* Action No Ack */
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4726. /* Reserved */
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4733. /*
  4734. * Subtype based CTRL frames enable bits.
  4735. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4736. */
  4737. /* Reserved */
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4744. /* Reserved */
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4751. /* Reserved */
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4758. /* Reserved */
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4765. /* Reserved */
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4772. /* Reserved */
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4779. /* Reserved */
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4786. /* Control Wrapper */
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4793. /* Block Ack Request */
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4800. /* Block Ack*/
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4807. /* PS-POLL */
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4814. /* RTS */
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4821. /* CTS */
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4828. /* ACK */
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4835. /* CF-END */
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4842. /* CF-END + CF-ACK */
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4849. /* Multicast data */
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4856. /* Unicast data */
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4863. /* NULL data */
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4871. do { \
  4872. HTT_CHECK_SET_VAL(httsym, value); \
  4873. (word) |= (value) << httsym##_S; \
  4874. } while (0)
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4876. (((word) & httsym##_M) >> httsym##_S)
  4877. #define htt_rx_ring_pkt_enable_subtype_set( \
  4878. word, flag, mode, type, subtype, val) \
  4879. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4880. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4881. #define htt_rx_ring_pkt_enable_subtype_get( \
  4882. word, flag, mode, type, subtype) \
  4883. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4884. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4885. /* Definition to filter in TLVs */
  4886. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4887. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4888. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4889. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4890. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4891. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4892. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4893. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4894. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4895. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4896. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4897. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4898. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4899. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4900. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4901. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4902. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4903. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4904. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4905. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4906. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  4907. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4908. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4909. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4910. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  4911. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  4912. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4913. do { \
  4914. HTT_CHECK_SET_VAL(httsym, enable); \
  4915. (word) |= (enable) << httsym##_S; \
  4916. } while (0)
  4917. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4918. (((word) & httsym##_M) >> httsym##_S)
  4919. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4920. HTT_RX_RING_TLV_ENABLE_SET( \
  4921. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4922. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4923. HTT_RX_RING_TLV_ENABLE_GET( \
  4924. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4925. /**
  4926. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4927. * host --> target Receive Flow Steering configuration message definition.
  4928. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4929. * The reason for this is we want RFS to be configured and ready before MAC
  4930. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4931. *
  4932. * |31 24|23 16|15 9|8|7 0|
  4933. * |----------------+----------------+----------------+----------------|
  4934. * | reserved |E| msg type |
  4935. * |-------------------------------------------------------------------|
  4936. * Where E = RFS enable flag
  4937. *
  4938. * The RFS_CONFIG message consists of a single 4-byte word.
  4939. *
  4940. * Header fields:
  4941. * - MSG_TYPE
  4942. * Bits 7:0
  4943. * Purpose: identifies this as a RFS config msg
  4944. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4945. * - RFS_CONFIG
  4946. * Bit 8
  4947. * Purpose: Tells target whether to enable (1) or disable (0)
  4948. * flow steering feature when sending rx indication messages to host
  4949. */
  4950. #define HTT_H2T_RFS_CONFIG_M 0x100
  4951. #define HTT_H2T_RFS_CONFIG_S 8
  4952. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4953. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4954. HTT_H2T_RFS_CONFIG_S)
  4955. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4956. do { \
  4957. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4958. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4959. } while (0)
  4960. #define HTT_RFS_CFG_REQ_BYTES 4
  4961. /**
  4962. * @brief host -> target FW extended statistics retrieve
  4963. *
  4964. * @details
  4965. * The following field definitions describe the format of the HTT host
  4966. * to target FW extended stats retrieve message.
  4967. * The message specifies the type of stats the host wants to retrieve.
  4968. *
  4969. * |31 24|23 16|15 8|7 0|
  4970. * |-----------------------------------------------------------|
  4971. * | reserved | stats type | pdev_mask | msg type |
  4972. * |-----------------------------------------------------------|
  4973. * | config param [0] |
  4974. * |-----------------------------------------------------------|
  4975. * | config param [1] |
  4976. * |-----------------------------------------------------------|
  4977. * | config param [2] |
  4978. * |-----------------------------------------------------------|
  4979. * | config param [3] |
  4980. * |-----------------------------------------------------------|
  4981. * | reserved |
  4982. * |-----------------------------------------------------------|
  4983. * | cookie LSBs |
  4984. * |-----------------------------------------------------------|
  4985. * | cookie MSBs |
  4986. * |-----------------------------------------------------------|
  4987. * Header fields:
  4988. * - MSG_TYPE
  4989. * Bits 7:0
  4990. * Purpose: identifies this is a extended stats upload request message
  4991. * Value: 0x10
  4992. * - PDEV_MASK
  4993. * Bits 8:15
  4994. * Purpose: identifies the mask of PDEVs to retrieve stats from
  4995. * Value: This is a overloaded field, refer to usage and interpretation of
  4996. * PDEV in interface document.
  4997. * Bit 8 : Reserved for SOC stats
  4998. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  4999. * Indicates MACID_MASK in DBS
  5000. * - STATS_TYPE
  5001. * Bits 23:16
  5002. * Purpose: identifies which FW statistics to upload
  5003. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5004. * - Reserved
  5005. * Bits 31:24
  5006. * - CONFIG_PARAM [0]
  5007. * Bits 31:0
  5008. * Purpose: give an opaque configuration value to the specified stats type
  5009. * Value: stats-type specific configuration value
  5010. * Refer to htt_stats.h for interpretation for each stats sub_type
  5011. * - CONFIG_PARAM [1]
  5012. * Bits 31:0
  5013. * Purpose: give an opaque configuration value to the specified stats type
  5014. * Value: stats-type specific configuration value
  5015. * Refer to htt_stats.h for interpretation for each stats sub_type
  5016. * - CONFIG_PARAM [2]
  5017. * Bits 31:0
  5018. * Purpose: give an opaque configuration value to the specified stats type
  5019. * Value: stats-type specific configuration value
  5020. * Refer to htt_stats.h for interpretation for each stats sub_type
  5021. * - CONFIG_PARAM [3]
  5022. * Bits 31:0
  5023. * Purpose: give an opaque configuration value to the specified stats type
  5024. * Value: stats-type specific configuration value
  5025. * Refer to htt_stats.h for interpretation for each stats sub_type
  5026. * - Reserved [31:0] for future use.
  5027. * - COOKIE_LSBS
  5028. * Bits 31:0
  5029. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5030. * message with its preceding host->target stats request message.
  5031. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5032. * - COOKIE_MSBS
  5033. * Bits 31:0
  5034. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5035. * message with its preceding host->target stats request message.
  5036. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5037. */
  5038. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5039. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5040. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5041. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5042. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5043. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5044. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5045. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5046. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5047. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5048. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5049. do { \
  5050. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5051. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5052. } while (0)
  5053. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5054. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5055. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5056. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5057. do { \
  5058. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5059. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5060. } while (0)
  5061. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5062. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5063. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5064. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5065. do { \
  5066. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5067. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5068. } while (0)
  5069. /**
  5070. * @brief host -> target FW PPDU_STATS request message
  5071. *
  5072. * @details
  5073. * The following field definitions describe the format of the HTT host
  5074. * to target FW for PPDU_STATS_CFG msg.
  5075. * The message allows the host to configure the PPDU_STATS_IND messages
  5076. * produced by the target.
  5077. *
  5078. * |31 24|23 16|15 8|7 0|
  5079. * |-----------------------------------------------------------|
  5080. * | REQ bit mask | pdev_mask | msg type |
  5081. * |-----------------------------------------------------------|
  5082. * Header fields:
  5083. * - MSG_TYPE
  5084. * Bits 7:0
  5085. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5086. * Value: 0x11
  5087. * - PDEV_MASK
  5088. * Bits 8:15
  5089. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5090. * Value: This is a overloaded field, refer to usage and interpretation of
  5091. * PDEV in interface document.
  5092. * Bit 8 : Reserved for SOC stats
  5093. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5094. * Indicates MACID_MASK in DBS
  5095. * - REQ_TLV_BIT_MASK
  5096. * Bits 16:31
  5097. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5098. * needs to be included in the target's PPDU_STATS_IND messages.
  5099. * Value: refer htt_ppdu_stats_tlv_tag_t
  5100. *
  5101. */
  5102. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5103. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5104. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5105. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5106. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5107. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5108. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5109. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5110. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5111. do { \
  5112. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5113. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5114. } while (0)
  5115. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5116. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5117. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5118. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5119. do { \
  5120. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5121. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5122. } while (0)
  5123. /*=== target -> host messages ===============================================*/
  5124. enum htt_t2h_msg_type {
  5125. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5126. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5127. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5128. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5129. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5130. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5131. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5132. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5133. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5134. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5135. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5136. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5137. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5138. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5139. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5140. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5141. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5142. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5143. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5144. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5145. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5146. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5147. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5148. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5149. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5150. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5151. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5152. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5153. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5154. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5155. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5156. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5157. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5158. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5159. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5160. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5161. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5162. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5163. HTT_T2H_MSG_TYPE_TEST,
  5164. /* keep this last */
  5165. HTT_T2H_NUM_MSGS
  5166. };
  5167. /*
  5168. * HTT target to host message type -
  5169. * stored in bits 7:0 of the first word of the message
  5170. */
  5171. #define HTT_T2H_MSG_TYPE_M 0xff
  5172. #define HTT_T2H_MSG_TYPE_S 0
  5173. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5174. do { \
  5175. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5176. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5177. } while (0)
  5178. #define HTT_T2H_MSG_TYPE_GET(word) \
  5179. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5180. /**
  5181. * @brief target -> host version number confirmation message definition
  5182. *
  5183. * |31 24|23 16|15 8|7 0|
  5184. * |----------------+----------------+----------------+----------------|
  5185. * | reserved | major number | minor number | msg type |
  5186. * |-------------------------------------------------------------------|
  5187. * : option request TLV (optional) |
  5188. * :...................................................................:
  5189. *
  5190. * The VER_CONF message may consist of a single 4-byte word, or may be
  5191. * extended with TLVs that specify HTT options selected by the target.
  5192. * The following option TLVs may be appended to the VER_CONF message:
  5193. * - LL_BUS_ADDR_SIZE
  5194. * - HL_SUPPRESS_TX_COMPL_IND
  5195. * - MAX_TX_QUEUE_GROUPS
  5196. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5197. * may be appended to the VER_CONF message (but only one TLV of each type).
  5198. *
  5199. * Header fields:
  5200. * - MSG_TYPE
  5201. * Bits 7:0
  5202. * Purpose: identifies this as a version number confirmation message
  5203. * Value: 0x0
  5204. * - VER_MINOR
  5205. * Bits 15:8
  5206. * Purpose: Specify the minor number of the HTT message library version
  5207. * in use by the target firmware.
  5208. * The minor number specifies the specific revision within a range
  5209. * of fundamentally compatible HTT message definition revisions.
  5210. * Compatible revisions involve adding new messages or perhaps
  5211. * adding new fields to existing messages, in a backwards-compatible
  5212. * manner.
  5213. * Incompatible revisions involve changing the message type values,
  5214. * or redefining existing messages.
  5215. * Value: minor number
  5216. * - VER_MAJOR
  5217. * Bits 15:8
  5218. * Purpose: Specify the major number of the HTT message library version
  5219. * in use by the target firmware.
  5220. * The major number specifies the family of minor revisions that are
  5221. * fundamentally compatible with each other, but not with prior or
  5222. * later families.
  5223. * Value: major number
  5224. */
  5225. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5226. #define HTT_VER_CONF_MINOR_S 8
  5227. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5228. #define HTT_VER_CONF_MAJOR_S 16
  5229. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5230. do { \
  5231. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5232. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5233. } while (0)
  5234. #define HTT_VER_CONF_MINOR_GET(word) \
  5235. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5236. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5237. do { \
  5238. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5239. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5240. } while (0)
  5241. #define HTT_VER_CONF_MAJOR_GET(word) \
  5242. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5243. #define HTT_VER_CONF_BYTES 4
  5244. /**
  5245. * @brief - target -> host HTT Rx In order indication message
  5246. *
  5247. * @details
  5248. *
  5249. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5250. * |----------------+-------------------+---------------------+---------------|
  5251. * | peer ID | P| F| O| ext TID | msg type |
  5252. * |--------------------------------------------------------------------------|
  5253. * | MSDU count | Reserved | vdev id |
  5254. * |--------------------------------------------------------------------------|
  5255. * | MSDU 0 bus address (bits 31:0) |
  5256. #if HTT_PADDR64
  5257. * | MSDU 0 bus address (bits 63:32) |
  5258. #endif
  5259. * |--------------------------------------------------------------------------|
  5260. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5261. * |--------------------------------------------------------------------------|
  5262. * | MSDU 1 bus address (bits 31:0) |
  5263. #if HTT_PADDR64
  5264. * | MSDU 1 bus address (bits 63:32) |
  5265. #endif
  5266. * |--------------------------------------------------------------------------|
  5267. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5268. * |--------------------------------------------------------------------------|
  5269. */
  5270. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5271. *
  5272. * @details
  5273. * bits
  5274. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5275. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5276. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5277. * | | frag | | | | fail |chksum fail|
  5278. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5279. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5280. */
  5281. struct htt_rx_in_ord_paddr_ind_hdr_t
  5282. {
  5283. A_UINT32 /* word 0 */
  5284. msg_type: 8,
  5285. ext_tid: 5,
  5286. offload: 1,
  5287. frag: 1,
  5288. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5289. peer_id: 16;
  5290. A_UINT32 /* word 1 */
  5291. vap_id: 8,
  5292. reserved_1: 8,
  5293. msdu_cnt: 16;
  5294. };
  5295. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5296. {
  5297. A_UINT32 dma_addr;
  5298. A_UINT32
  5299. length: 16,
  5300. fw_desc: 8,
  5301. msdu_info:8;
  5302. };
  5303. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5304. {
  5305. A_UINT32 dma_addr_lo;
  5306. A_UINT32 dma_addr_hi;
  5307. A_UINT32
  5308. length: 16,
  5309. fw_desc: 8,
  5310. msdu_info:8;
  5311. };
  5312. #if HTT_PADDR64
  5313. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5314. #else
  5315. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5316. #endif
  5317. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5318. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5319. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5320. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5321. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5322. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5323. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5324. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5325. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5326. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5327. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5328. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5329. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5330. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5331. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5332. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5333. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5334. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5335. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5336. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5337. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5338. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5339. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5340. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5341. /* for systems using 64-bit format for bus addresses */
  5342. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5343. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5344. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5345. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5346. /* for systems using 32-bit format for bus addresses */
  5347. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5348. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5349. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5350. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5351. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5352. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5353. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5354. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5355. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5356. do { \
  5357. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5358. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5359. } while (0)
  5360. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5361. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5362. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5363. do { \
  5364. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5365. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5366. } while (0)
  5367. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5368. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5369. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5370. do { \
  5371. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5372. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5373. } while (0)
  5374. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5375. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5376. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5377. do { \
  5378. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5379. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5380. } while (0)
  5381. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5382. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5383. /* for systems using 64-bit format for bus addresses */
  5384. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5385. do { \
  5386. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5387. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5388. } while (0)
  5389. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5390. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5391. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5392. do { \
  5393. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5394. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5395. } while (0)
  5396. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5397. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5398. /* for systems using 32-bit format for bus addresses */
  5399. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5400. do { \
  5401. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5402. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5403. } while (0)
  5404. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5405. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5406. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5407. do { \
  5408. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5409. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5410. } while (0)
  5411. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5412. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5413. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5414. do { \
  5415. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5416. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5417. } while (0)
  5418. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5419. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5420. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5421. do { \
  5422. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5423. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5424. } while (0)
  5425. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5426. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5427. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5428. do { \
  5429. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5430. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5431. } while (0)
  5432. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5433. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5434. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5435. do { \
  5436. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5437. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5438. } while (0)
  5439. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5440. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5441. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5442. do { \
  5443. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5444. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5445. } while (0)
  5446. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5447. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5448. /* definitions used within target -> host rx indication message */
  5449. PREPACK struct htt_rx_ind_hdr_prefix_t
  5450. {
  5451. A_UINT32 /* word 0 */
  5452. msg_type: 8,
  5453. ext_tid: 5,
  5454. release_valid: 1,
  5455. flush_valid: 1,
  5456. reserved0: 1,
  5457. peer_id: 16;
  5458. A_UINT32 /* word 1 */
  5459. flush_start_seq_num: 6,
  5460. flush_end_seq_num: 6,
  5461. release_start_seq_num: 6,
  5462. release_end_seq_num: 6,
  5463. num_mpdu_ranges: 8;
  5464. } POSTPACK;
  5465. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5466. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5467. #define HTT_TGT_RSSI_INVALID 0x80
  5468. PREPACK struct htt_rx_ppdu_desc_t
  5469. {
  5470. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5471. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5472. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5473. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5474. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5475. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5476. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5477. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5478. A_UINT32 /* word 0 */
  5479. rssi_cmb: 8,
  5480. timestamp_submicrosec: 8,
  5481. phy_err_code: 8,
  5482. phy_err: 1,
  5483. legacy_rate: 4,
  5484. legacy_rate_sel: 1,
  5485. end_valid: 1,
  5486. start_valid: 1;
  5487. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5488. union {
  5489. A_UINT32 /* word 1 */
  5490. rssi0_pri20: 8,
  5491. rssi0_ext20: 8,
  5492. rssi0_ext40: 8,
  5493. rssi0_ext80: 8;
  5494. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5495. } u0;
  5496. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5497. union {
  5498. A_UINT32 /* word 2 */
  5499. rssi1_pri20: 8,
  5500. rssi1_ext20: 8,
  5501. rssi1_ext40: 8,
  5502. rssi1_ext80: 8;
  5503. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5504. } u1;
  5505. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5506. union {
  5507. A_UINT32 /* word 3 */
  5508. rssi2_pri20: 8,
  5509. rssi2_ext20: 8,
  5510. rssi2_ext40: 8,
  5511. rssi2_ext80: 8;
  5512. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5513. } u2;
  5514. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5515. union {
  5516. A_UINT32 /* word 4 */
  5517. rssi3_pri20: 8,
  5518. rssi3_ext20: 8,
  5519. rssi3_ext40: 8,
  5520. rssi3_ext80: 8;
  5521. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5522. } u3;
  5523. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5524. A_UINT32 tsf32; /* word 5 */
  5525. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5526. A_UINT32 timestamp_microsec; /* word 6 */
  5527. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5528. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5529. A_UINT32 /* word 7 */
  5530. vht_sig_a1: 24,
  5531. preamble_type: 8;
  5532. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5533. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  5534. A_UINT32 /* word 8 */
  5535. vht_sig_a2: 24,
  5536. /* sa_ant_matrix
  5537. * For cases where a single rx chain has options to be connected to
  5538. * different rx antennas, show which rx antennas were in use during
  5539. * receipt of a given PPDU.
  5540. * This sa_ant_matrix provides a bitmask of the antennas used while
  5541. * receiving this frame.
  5542. */
  5543. sa_ant_matrix: 8;
  5544. } POSTPACK;
  5545. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5546. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5547. PREPACK struct htt_rx_ind_hdr_suffix_t
  5548. {
  5549. A_UINT32 /* word 0 */
  5550. fw_rx_desc_bytes: 16,
  5551. reserved0: 16;
  5552. } POSTPACK;
  5553. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5554. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5555. PREPACK struct htt_rx_ind_hdr_t
  5556. {
  5557. struct htt_rx_ind_hdr_prefix_t prefix;
  5558. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5559. struct htt_rx_ind_hdr_suffix_t suffix;
  5560. } POSTPACK;
  5561. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5562. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5563. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5564. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5565. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5566. /*
  5567. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5568. * the offset into the HTT rx indication message at which the
  5569. * FW rx PPDU descriptor resides
  5570. */
  5571. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5572. /*
  5573. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5574. * the offset into the HTT rx indication message at which the
  5575. * header suffix (FW rx MSDU byte count) resides
  5576. */
  5577. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5578. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5579. /*
  5580. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5581. * the offset into the HTT rx indication message at which the per-MSDU
  5582. * information starts
  5583. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5584. * per-MSDU information portion of the message. The per-MSDU info itself
  5585. * starts at byte 12.
  5586. */
  5587. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5588. /**
  5589. * @brief target -> host rx indication message definition
  5590. *
  5591. * @details
  5592. * The following field definitions describe the format of the rx indication
  5593. * message sent from the target to the host.
  5594. * The message consists of three major sections:
  5595. * 1. a fixed-length header
  5596. * 2. a variable-length list of firmware rx MSDU descriptors
  5597. * 3. one or more 4-octet MPDU range information elements
  5598. * The fixed length header itself has two sub-sections
  5599. * 1. the message meta-information, including identification of the
  5600. * sender and type of the received data, and a 4-octet flush/release IE
  5601. * 2. the firmware rx PPDU descriptor
  5602. *
  5603. * The format of the message is depicted below.
  5604. * in this depiction, the following abbreviations are used for information
  5605. * elements within the message:
  5606. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5607. * elements associated with the PPDU start are valid.
  5608. * Specifically, the following fields are valid only if SV is set:
  5609. * RSSI (all variants), L, legacy rate, preamble type, service,
  5610. * VHT-SIG-A
  5611. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5612. * elements associated with the PPDU end are valid.
  5613. * Specifically, the following fields are valid only if EV is set:
  5614. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5615. * - L - Legacy rate selector - if legacy rates are used, this flag
  5616. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5617. * (L == 0) PHY.
  5618. * - P - PHY error flag - boolean indication of whether the rx frame had
  5619. * a PHY error
  5620. *
  5621. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5622. * |----------------+-------------------+---------------------+---------------|
  5623. * | peer ID | |RV|FV| ext TID | msg type |
  5624. * |--------------------------------------------------------------------------|
  5625. * | num | release | release | flush | flush |
  5626. * | MPDU | end | start | end | start |
  5627. * | ranges | seq num | seq num | seq num | seq num |
  5628. * |==========================================================================|
  5629. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5630. * |V|V| | rate | | | timestamp | RSSI |
  5631. * |--------------------------------------------------------------------------|
  5632. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5633. * |--------------------------------------------------------------------------|
  5634. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5635. * |--------------------------------------------------------------------------|
  5636. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5637. * |--------------------------------------------------------------------------|
  5638. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5639. * |--------------------------------------------------------------------------|
  5640. * | TSF LSBs |
  5641. * |--------------------------------------------------------------------------|
  5642. * | microsec timestamp |
  5643. * |--------------------------------------------------------------------------|
  5644. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5645. * |--------------------------------------------------------------------------|
  5646. * | service | HT-SIG / VHT-SIG-A2 |
  5647. * |==========================================================================|
  5648. * | reserved | FW rx desc bytes |
  5649. * |--------------------------------------------------------------------------|
  5650. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5651. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5652. * |--------------------------------------------------------------------------|
  5653. * : : :
  5654. * |--------------------------------------------------------------------------|
  5655. * | alignment | MSDU Rx |
  5656. * | padding | desc Bn |
  5657. * |--------------------------------------------------------------------------|
  5658. * | reserved | MPDU range status | MPDU count |
  5659. * |--------------------------------------------------------------------------|
  5660. * : reserved : MPDU range status : MPDU count :
  5661. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5662. *
  5663. * Header fields:
  5664. * - MSG_TYPE
  5665. * Bits 7:0
  5666. * Purpose: identifies this as an rx indication message
  5667. * Value: 0x1
  5668. * - EXT_TID
  5669. * Bits 12:8
  5670. * Purpose: identify the traffic ID of the rx data, including
  5671. * special "extended" TID values for multicast, broadcast, and
  5672. * non-QoS data frames
  5673. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5674. * - FLUSH_VALID (FV)
  5675. * Bit 13
  5676. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5677. * is valid
  5678. * Value:
  5679. * 1 -> flush IE is valid and needs to be processed
  5680. * 0 -> flush IE is not valid and should be ignored
  5681. * - REL_VALID (RV)
  5682. * Bit 13
  5683. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5684. * is valid
  5685. * Value:
  5686. * 1 -> release IE is valid and needs to be processed
  5687. * 0 -> release IE is not valid and should be ignored
  5688. * - PEER_ID
  5689. * Bits 31:16
  5690. * Purpose: Identify, by ID, which peer sent the rx data
  5691. * Value: ID of the peer who sent the rx data
  5692. * - FLUSH_SEQ_NUM_START
  5693. * Bits 5:0
  5694. * Purpose: Indicate the start of a series of MPDUs to flush
  5695. * Not all MPDUs within this series are necessarily valid - the host
  5696. * must check each sequence number within this range to see if the
  5697. * corresponding MPDU is actually present.
  5698. * This field is only valid if the FV bit is set.
  5699. * Value:
  5700. * The sequence number for the first MPDUs to check to flush.
  5701. * The sequence number is masked by 0x3f.
  5702. * - FLUSH_SEQ_NUM_END
  5703. * Bits 11:6
  5704. * Purpose: Indicate the end of a series of MPDUs to flush
  5705. * Value:
  5706. * The sequence number one larger than the sequence number of the
  5707. * last MPDU to check to flush.
  5708. * The sequence number is masked by 0x3f.
  5709. * Not all MPDUs within this series are necessarily valid - the host
  5710. * must check each sequence number within this range to see if the
  5711. * corresponding MPDU is actually present.
  5712. * This field is only valid if the FV bit is set.
  5713. * - REL_SEQ_NUM_START
  5714. * Bits 17:12
  5715. * Purpose: Indicate the start of a series of MPDUs to release.
  5716. * All MPDUs within this series are present and valid - the host
  5717. * need not check each sequence number within this range to see if
  5718. * the corresponding MPDU is actually present.
  5719. * This field is only valid if the RV bit is set.
  5720. * Value:
  5721. * The sequence number for the first MPDUs to check to release.
  5722. * The sequence number is masked by 0x3f.
  5723. * - REL_SEQ_NUM_END
  5724. * Bits 23:18
  5725. * Purpose: Indicate the end of a series of MPDUs to release.
  5726. * Value:
  5727. * The sequence number one larger than the sequence number of the
  5728. * last MPDU to check to release.
  5729. * The sequence number is masked by 0x3f.
  5730. * All MPDUs within this series are present and valid - the host
  5731. * need not check each sequence number within this range to see if
  5732. * the corresponding MPDU is actually present.
  5733. * This field is only valid if the RV bit is set.
  5734. * - NUM_MPDU_RANGES
  5735. * Bits 31:24
  5736. * Purpose: Indicate how many ranges of MPDUs are present.
  5737. * Each MPDU range consists of a series of contiguous MPDUs within the
  5738. * rx frame sequence which all have the same MPDU status.
  5739. * Value: 1-63 (typically a small number, like 1-3)
  5740. *
  5741. * Rx PPDU descriptor fields:
  5742. * - RSSI_CMB
  5743. * Bits 7:0
  5744. * Purpose: Combined RSSI from all active rx chains, across the active
  5745. * bandwidth.
  5746. * Value: RSSI dB units w.r.t. noise floor
  5747. * - TIMESTAMP_SUBMICROSEC
  5748. * Bits 15:8
  5749. * Purpose: high-resolution timestamp
  5750. * Value:
  5751. * Sub-microsecond time of PPDU reception.
  5752. * This timestamp ranges from [0,MAC clock MHz).
  5753. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5754. * to form a high-resolution, large range rx timestamp.
  5755. * - PHY_ERR_CODE
  5756. * Bits 23:16
  5757. * Purpose:
  5758. * If the rx frame processing resulted in a PHY error, indicate what
  5759. * type of rx PHY error occurred.
  5760. * Value:
  5761. * This field is valid if the "P" (PHY_ERR) flag is set.
  5762. * TBD: document/specify the values for this field
  5763. * - PHY_ERR
  5764. * Bit 24
  5765. * Purpose: indicate whether the rx PPDU had a PHY error
  5766. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5767. * - LEGACY_RATE
  5768. * Bits 28:25
  5769. * Purpose:
  5770. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5771. * specify which rate was used.
  5772. * Value:
  5773. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5774. * flag.
  5775. * If LEGACY_RATE_SEL is 0:
  5776. * 0x8: OFDM 48 Mbps
  5777. * 0x9: OFDM 24 Mbps
  5778. * 0xA: OFDM 12 Mbps
  5779. * 0xB: OFDM 6 Mbps
  5780. * 0xC: OFDM 54 Mbps
  5781. * 0xD: OFDM 36 Mbps
  5782. * 0xE: OFDM 18 Mbps
  5783. * 0xF: OFDM 9 Mbps
  5784. * If LEGACY_RATE_SEL is 1:
  5785. * 0x8: CCK 11 Mbps long preamble
  5786. * 0x9: CCK 5.5 Mbps long preamble
  5787. * 0xA: CCK 2 Mbps long preamble
  5788. * 0xB: CCK 1 Mbps long preamble
  5789. * 0xC: CCK 11 Mbps short preamble
  5790. * 0xD: CCK 5.5 Mbps short preamble
  5791. * 0xE: CCK 2 Mbps short preamble
  5792. * - LEGACY_RATE_SEL
  5793. * Bit 29
  5794. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5795. * Value:
  5796. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5797. * used a legacy rate.
  5798. * 0 -> OFDM, 1 -> CCK
  5799. * - END_VALID
  5800. * Bit 30
  5801. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5802. * the start of the PPDU are valid. Specifically, the following
  5803. * fields are only valid if END_VALID is set:
  5804. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5805. * TIMESTAMP_SUBMICROSEC
  5806. * Value:
  5807. * 0 -> rx PPDU desc end fields are not valid
  5808. * 1 -> rx PPDU desc end fields are valid
  5809. * - START_VALID
  5810. * Bit 31
  5811. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5812. * the end of the PPDU are valid. Specifically, the following
  5813. * fields are only valid if START_VALID is set:
  5814. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5815. * VHT-SIG-A
  5816. * Value:
  5817. * 0 -> rx PPDU desc start fields are not valid
  5818. * 1 -> rx PPDU desc start fields are valid
  5819. * - RSSI0_PRI20
  5820. * Bits 7:0
  5821. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5822. * Value: RSSI dB units w.r.t. noise floor
  5823. *
  5824. * - RSSI0_EXT20
  5825. * Bits 7:0
  5826. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5827. * (if the rx bandwidth was >= 40 MHz)
  5828. * Value: RSSI dB units w.r.t. noise floor
  5829. * - RSSI0_EXT40
  5830. * Bits 7:0
  5831. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5832. * (if the rx bandwidth was >= 80 MHz)
  5833. * Value: RSSI dB units w.r.t. noise floor
  5834. * - RSSI0_EXT80
  5835. * Bits 7:0
  5836. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5837. * (if the rx bandwidth was >= 160 MHz)
  5838. * Value: RSSI dB units w.r.t. noise floor
  5839. *
  5840. * - RSSI1_PRI20
  5841. * Bits 7:0
  5842. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5843. * Value: RSSI dB units w.r.t. noise floor
  5844. * - RSSI1_EXT20
  5845. * Bits 7:0
  5846. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5847. * (if the rx bandwidth was >= 40 MHz)
  5848. * Value: RSSI dB units w.r.t. noise floor
  5849. * - RSSI1_EXT40
  5850. * Bits 7:0
  5851. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5852. * (if the rx bandwidth was >= 80 MHz)
  5853. * Value: RSSI dB units w.r.t. noise floor
  5854. * - RSSI1_EXT80
  5855. * Bits 7:0
  5856. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5857. * (if the rx bandwidth was >= 160 MHz)
  5858. * Value: RSSI dB units w.r.t. noise floor
  5859. *
  5860. * - RSSI2_PRI20
  5861. * Bits 7:0
  5862. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5863. * Value: RSSI dB units w.r.t. noise floor
  5864. * - RSSI2_EXT20
  5865. * Bits 7:0
  5866. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5867. * (if the rx bandwidth was >= 40 MHz)
  5868. * Value: RSSI dB units w.r.t. noise floor
  5869. * - RSSI2_EXT40
  5870. * Bits 7:0
  5871. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5872. * (if the rx bandwidth was >= 80 MHz)
  5873. * Value: RSSI dB units w.r.t. noise floor
  5874. * - RSSI2_EXT80
  5875. * Bits 7:0
  5876. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5877. * (if the rx bandwidth was >= 160 MHz)
  5878. * Value: RSSI dB units w.r.t. noise floor
  5879. *
  5880. * - RSSI3_PRI20
  5881. * Bits 7:0
  5882. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5883. * Value: RSSI dB units w.r.t. noise floor
  5884. * - RSSI3_EXT20
  5885. * Bits 7:0
  5886. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5887. * (if the rx bandwidth was >= 40 MHz)
  5888. * Value: RSSI dB units w.r.t. noise floor
  5889. * - RSSI3_EXT40
  5890. * Bits 7:0
  5891. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5892. * (if the rx bandwidth was >= 80 MHz)
  5893. * Value: RSSI dB units w.r.t. noise floor
  5894. * - RSSI3_EXT80
  5895. * Bits 7:0
  5896. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5897. * (if the rx bandwidth was >= 160 MHz)
  5898. * Value: RSSI dB units w.r.t. noise floor
  5899. *
  5900. * - TSF32
  5901. * Bits 31:0
  5902. * Purpose: specify the time the rx PPDU was received, in TSF units
  5903. * Value: 32 LSBs of the TSF
  5904. * - TIMESTAMP_MICROSEC
  5905. * Bits 31:0
  5906. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5907. * Value: PPDU rx time, in microseconds
  5908. * - VHT_SIG_A1
  5909. * Bits 23:0
  5910. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5911. * from the rx PPDU
  5912. * Value:
  5913. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5914. * VHT-SIG-A1 data.
  5915. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5916. * first 24 bits of the HT-SIG data.
  5917. * Otherwise, this field is invalid.
  5918. * Refer to the the 802.11 protocol for the definition of the
  5919. * HT-SIG and VHT-SIG-A1 fields
  5920. * - VHT_SIG_A2
  5921. * Bits 23:0
  5922. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5923. * from the rx PPDU
  5924. * Value:
  5925. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5926. * VHT-SIG-A2 data.
  5927. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5928. * last 24 bits of the HT-SIG data.
  5929. * Otherwise, this field is invalid.
  5930. * Refer to the the 802.11 protocol for the definition of the
  5931. * HT-SIG and VHT-SIG-A2 fields
  5932. * - PREAMBLE_TYPE
  5933. * Bits 31:24
  5934. * Purpose: indicate the PHY format of the received burst
  5935. * Value:
  5936. * 0x4: Legacy (OFDM/CCK)
  5937. * 0x8: HT
  5938. * 0x9: HT with TxBF
  5939. * 0xC: VHT
  5940. * 0xD: VHT with TxBF
  5941. * - SERVICE
  5942. * Bits 31:24
  5943. * Purpose: TBD
  5944. * Value: TBD
  5945. *
  5946. * Rx MSDU descriptor fields:
  5947. * - FW_RX_DESC_BYTES
  5948. * Bits 15:0
  5949. * Purpose: Indicate how many bytes in the Rx indication are used for
  5950. * FW Rx descriptors
  5951. *
  5952. * Payload fields:
  5953. * - MPDU_COUNT
  5954. * Bits 7:0
  5955. * Purpose: Indicate how many sequential MPDUs share the same status.
  5956. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5957. * - MPDU_STATUS
  5958. * Bits 15:8
  5959. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5960. * received successfully.
  5961. * Value:
  5962. * 0x1: success
  5963. * 0x2: FCS error
  5964. * 0x3: duplicate error
  5965. * 0x4: replay error
  5966. * 0x5: invalid peer
  5967. */
  5968. /* header fields */
  5969. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5970. #define HTT_RX_IND_EXT_TID_S 8
  5971. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5972. #define HTT_RX_IND_FLUSH_VALID_S 13
  5973. #define HTT_RX_IND_REL_VALID_M 0x4000
  5974. #define HTT_RX_IND_REL_VALID_S 14
  5975. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5976. #define HTT_RX_IND_PEER_ID_S 16
  5977. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5978. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5979. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5980. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5981. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5982. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5983. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5984. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5985. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5986. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5987. /* rx PPDU descriptor fields */
  5988. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5989. #define HTT_RX_IND_RSSI_CMB_S 0
  5990. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5991. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5992. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5993. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5994. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5995. #define HTT_RX_IND_PHY_ERR_S 24
  5996. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5997. #define HTT_RX_IND_LEGACY_RATE_S 25
  5998. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5999. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6000. #define HTT_RX_IND_END_VALID_M 0x40000000
  6001. #define HTT_RX_IND_END_VALID_S 30
  6002. #define HTT_RX_IND_START_VALID_M 0x80000000
  6003. #define HTT_RX_IND_START_VALID_S 31
  6004. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6005. #define HTT_RX_IND_RSSI_PRI20_S 0
  6006. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6007. #define HTT_RX_IND_RSSI_EXT20_S 8
  6008. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6009. #define HTT_RX_IND_RSSI_EXT40_S 16
  6010. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6011. #define HTT_RX_IND_RSSI_EXT80_S 24
  6012. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6013. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6014. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6015. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6016. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6017. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6018. #define HTT_RX_IND_SERVICE_M 0xff000000
  6019. #define HTT_RX_IND_SERVICE_S 24
  6020. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6021. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6022. /* rx MSDU descriptor fields */
  6023. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6024. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6025. /* payload fields */
  6026. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6027. #define HTT_RX_IND_MPDU_COUNT_S 0
  6028. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6029. #define HTT_RX_IND_MPDU_STATUS_S 8
  6030. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6031. do { \
  6032. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6033. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6034. } while (0)
  6035. #define HTT_RX_IND_EXT_TID_GET(word) \
  6036. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6037. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6038. do { \
  6039. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6040. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6041. } while (0)
  6042. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6043. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6044. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6045. do { \
  6046. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6047. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6048. } while (0)
  6049. #define HTT_RX_IND_REL_VALID_GET(word) \
  6050. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6051. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6052. do { \
  6053. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6054. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6055. } while (0)
  6056. #define HTT_RX_IND_PEER_ID_GET(word) \
  6057. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6058. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6059. do { \
  6060. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6061. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6062. } while (0)
  6063. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6064. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6065. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6066. do { \
  6067. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6068. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6069. } while (0)
  6070. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6071. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6072. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6073. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6074. do { \
  6075. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6076. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6077. } while (0)
  6078. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6079. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6080. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6081. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6082. do { \
  6083. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6084. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6085. } while (0)
  6086. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6087. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6088. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6089. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6090. do { \
  6091. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6092. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6093. } while (0)
  6094. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6095. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6096. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6097. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6098. do { \
  6099. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6100. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6101. } while (0)
  6102. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6103. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6104. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6105. /* FW rx PPDU descriptor fields */
  6106. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6107. do { \
  6108. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6109. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6110. } while (0)
  6111. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6112. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6113. HTT_RX_IND_RSSI_CMB_S)
  6114. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6115. do { \
  6116. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6117. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6118. } while (0)
  6119. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6120. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6121. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6122. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6123. do { \
  6124. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6125. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6126. } while (0)
  6127. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6128. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6129. HTT_RX_IND_PHY_ERR_CODE_S)
  6130. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6131. do { \
  6132. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6133. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6134. } while (0)
  6135. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6136. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6137. HTT_RX_IND_PHY_ERR_S)
  6138. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6139. do { \
  6140. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6141. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6142. } while (0)
  6143. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6144. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6145. HTT_RX_IND_LEGACY_RATE_S)
  6146. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6147. do { \
  6148. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6149. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6150. } while (0)
  6151. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6152. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6153. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6154. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6155. do { \
  6156. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6157. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6158. } while (0)
  6159. #define HTT_RX_IND_END_VALID_GET(word) \
  6160. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6161. HTT_RX_IND_END_VALID_S)
  6162. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6163. do { \
  6164. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6165. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6166. } while (0)
  6167. #define HTT_RX_IND_START_VALID_GET(word) \
  6168. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6169. HTT_RX_IND_START_VALID_S)
  6170. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6171. do { \
  6172. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6173. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6174. } while (0)
  6175. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6176. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6177. HTT_RX_IND_RSSI_PRI20_S)
  6178. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6179. do { \
  6180. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6181. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6182. } while (0)
  6183. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6184. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6185. HTT_RX_IND_RSSI_EXT20_S)
  6186. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6187. do { \
  6188. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6189. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6190. } while (0)
  6191. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6192. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6193. HTT_RX_IND_RSSI_EXT40_S)
  6194. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6195. do { \
  6196. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6197. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6198. } while (0)
  6199. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6200. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6201. HTT_RX_IND_RSSI_EXT80_S)
  6202. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6203. do { \
  6204. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6205. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6206. } while (0)
  6207. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6208. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6209. HTT_RX_IND_VHT_SIG_A1_S)
  6210. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6211. do { \
  6212. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6213. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6214. } while (0)
  6215. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6216. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6217. HTT_RX_IND_VHT_SIG_A2_S)
  6218. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6219. do { \
  6220. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6221. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6222. } while (0)
  6223. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6224. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6225. HTT_RX_IND_PREAMBLE_TYPE_S)
  6226. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6227. do { \
  6228. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6229. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6230. } while (0)
  6231. #define HTT_RX_IND_SERVICE_GET(word) \
  6232. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6233. HTT_RX_IND_SERVICE_S)
  6234. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6235. do { \
  6236. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6237. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6238. } while (0)
  6239. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6240. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6241. HTT_RX_IND_SA_ANT_MATRIX_S)
  6242. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6243. do { \
  6244. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6245. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6246. } while (0)
  6247. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6248. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6249. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6250. do { \
  6251. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6252. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6253. } while (0)
  6254. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6255. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6256. #define HTT_RX_IND_HL_BYTES \
  6257. (HTT_RX_IND_HDR_BYTES + \
  6258. 4 /* single FW rx MSDU descriptor */ + \
  6259. 4 /* single MPDU range information element */)
  6260. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6261. /* Could we use one macro entry? */
  6262. #define HTT_WORD_SET(word, field, value) \
  6263. do { \
  6264. HTT_CHECK_SET_VAL(field, value); \
  6265. (word) |= ((value) << field ## _S); \
  6266. } while (0)
  6267. #define HTT_WORD_GET(word, field) \
  6268. (((word) & field ## _M) >> field ## _S)
  6269. PREPACK struct hl_htt_rx_ind_base {
  6270. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6271. } POSTPACK;
  6272. /*
  6273. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6274. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6275. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6276. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6277. * htt_rx_ind_hl_rx_desc_t.
  6278. */
  6279. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6280. struct htt_rx_ind_hl_rx_desc_t {
  6281. A_UINT8 ver;
  6282. A_UINT8 len;
  6283. struct {
  6284. A_UINT8
  6285. first_msdu: 1,
  6286. last_msdu: 1,
  6287. c3_failed: 1,
  6288. c4_failed: 1,
  6289. ipv6: 1,
  6290. tcp: 1,
  6291. udp: 1,
  6292. reserved: 1;
  6293. } flags;
  6294. /* NOTE: no reserved space - don't append any new fields here */
  6295. };
  6296. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6297. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6298. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6299. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6300. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6301. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6302. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6303. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6304. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6305. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6306. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6307. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6308. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6309. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6310. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6311. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6312. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6313. /* This structure is used in HL, the basic descriptor information
  6314. * used by host. the structure is translated by FW from HW desc
  6315. * or generated by FW. But in HL monitor mode, the host would use
  6316. * the same structure with LL.
  6317. */
  6318. PREPACK struct hl_htt_rx_desc_base {
  6319. A_UINT32
  6320. seq_num:12,
  6321. encrypted:1,
  6322. chan_info_present:1,
  6323. resv0:2,
  6324. mcast_bcast:1,
  6325. fragment:1,
  6326. key_id_oct:8,
  6327. resv1:6;
  6328. A_UINT32
  6329. pn_31_0;
  6330. union {
  6331. struct {
  6332. A_UINT16 pn_47_32;
  6333. A_UINT16 pn_63_48;
  6334. } pn16;
  6335. A_UINT32 pn_63_32;
  6336. } u0;
  6337. A_UINT32
  6338. pn_95_64;
  6339. A_UINT32
  6340. pn_127_96;
  6341. } POSTPACK;
  6342. /*
  6343. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6344. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6345. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6346. * Please see htt_chan_change_t for description of the fields.
  6347. */
  6348. PREPACK struct htt_chan_info_t
  6349. {
  6350. A_UINT32 primary_chan_center_freq_mhz: 16,
  6351. contig_chan1_center_freq_mhz: 16;
  6352. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6353. phy_mode: 8,
  6354. reserved: 8;
  6355. } POSTPACK;
  6356. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6357. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6358. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6359. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6360. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6361. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6362. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6363. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6364. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6365. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6366. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6367. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6368. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6369. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6370. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6371. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6372. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6373. /* Channel information */
  6374. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6375. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6376. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6377. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6378. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6379. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6380. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6381. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6382. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6383. do { \
  6384. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6385. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6386. } while (0)
  6387. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6388. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6389. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6390. do { \
  6391. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6392. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6393. } while (0)
  6394. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6395. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6396. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6397. do { \
  6398. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6399. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6400. } while (0)
  6401. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6402. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6403. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6404. do { \
  6405. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6406. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6407. } while (0)
  6408. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6409. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6410. /*
  6411. * @brief target -> host rx reorder flush message definition
  6412. *
  6413. * @details
  6414. * The following field definitions describe the format of the rx flush
  6415. * message sent from the target to the host.
  6416. * The message consists of a 4-octet header, followed by one or more
  6417. * 4-octet payload information elements.
  6418. *
  6419. * |31 24|23 8|7 0|
  6420. * |--------------------------------------------------------------|
  6421. * | TID | peer ID | msg type |
  6422. * |--------------------------------------------------------------|
  6423. * | seq num end | seq num start | MPDU status | reserved |
  6424. * |--------------------------------------------------------------|
  6425. * First DWORD:
  6426. * - MSG_TYPE
  6427. * Bits 7:0
  6428. * Purpose: identifies this as an rx flush message
  6429. * Value: 0x2
  6430. * - PEER_ID
  6431. * Bits 23:8 (only bits 18:8 actually used)
  6432. * Purpose: identify which peer's rx data is being flushed
  6433. * Value: (rx) peer ID
  6434. * - TID
  6435. * Bits 31:24 (only bits 27:24 actually used)
  6436. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6437. * Value: traffic identifier
  6438. * Second DWORD:
  6439. * - MPDU_STATUS
  6440. * Bits 15:8
  6441. * Purpose:
  6442. * Indicate whether the flushed MPDUs should be discarded or processed.
  6443. * Value:
  6444. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6445. * stages of rx processing
  6446. * other: discard the MPDUs
  6447. * It is anticipated that flush messages will always have
  6448. * MPDU status == 1, but the status flag is included for
  6449. * flexibility.
  6450. * - SEQ_NUM_START
  6451. * Bits 23:16
  6452. * Purpose:
  6453. * Indicate the start of a series of consecutive MPDUs being flushed.
  6454. * Not all MPDUs within this range are necessarily valid - the host
  6455. * must check each sequence number within this range to see if the
  6456. * corresponding MPDU is actually present.
  6457. * Value:
  6458. * The sequence number for the first MPDU in the sequence.
  6459. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6460. * - SEQ_NUM_END
  6461. * Bits 30:24
  6462. * Purpose:
  6463. * Indicate the end of a series of consecutive MPDUs being flushed.
  6464. * Value:
  6465. * The sequence number one larger than the sequence number of the
  6466. * last MPDU being flushed.
  6467. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6468. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6469. * are to be released for further rx processing.
  6470. * Not all MPDUs within this range are necessarily valid - the host
  6471. * must check each sequence number within this range to see if the
  6472. * corresponding MPDU is actually present.
  6473. */
  6474. /* first DWORD */
  6475. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6476. #define HTT_RX_FLUSH_PEER_ID_S 8
  6477. #define HTT_RX_FLUSH_TID_M 0xff000000
  6478. #define HTT_RX_FLUSH_TID_S 24
  6479. /* second DWORD */
  6480. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6481. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6482. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6483. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6484. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6485. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6486. #define HTT_RX_FLUSH_BYTES 8
  6487. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6488. do { \
  6489. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6490. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6491. } while (0)
  6492. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6493. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6494. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6495. do { \
  6496. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6497. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6498. } while (0)
  6499. #define HTT_RX_FLUSH_TID_GET(word) \
  6500. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6501. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6504. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6505. } while (0)
  6506. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6507. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6508. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6509. do { \
  6510. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6511. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6512. } while (0)
  6513. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6514. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6515. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6516. do { \
  6517. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6518. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6519. } while (0)
  6520. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6521. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6522. /*
  6523. * @brief target -> host rx pn check indication message
  6524. *
  6525. * @details
  6526. * The following field definitions describe the format of the Rx PN check
  6527. * indication message sent from the target to the host.
  6528. * The message consists of a 4-octet header, followed by the start and
  6529. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6530. * IE is one octet containing the sequence number that failed the PN
  6531. * check.
  6532. *
  6533. * |31 24|23 8|7 0|
  6534. * |--------------------------------------------------------------|
  6535. * | TID | peer ID | msg type |
  6536. * |--------------------------------------------------------------|
  6537. * | Reserved | PN IE count | seq num end | seq num start|
  6538. * |--------------------------------------------------------------|
  6539. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6540. * |--------------------------------------------------------------|
  6541. * First DWORD:
  6542. * - MSG_TYPE
  6543. * Bits 7:0
  6544. * Purpose: Identifies this as an rx pn check indication message
  6545. * Value: 0x2
  6546. * - PEER_ID
  6547. * Bits 23:8 (only bits 18:8 actually used)
  6548. * Purpose: identify which peer
  6549. * Value: (rx) peer ID
  6550. * - TID
  6551. * Bits 31:24 (only bits 27:24 actually used)
  6552. * Purpose: identify traffic identifier
  6553. * Value: traffic identifier
  6554. * Second DWORD:
  6555. * - SEQ_NUM_START
  6556. * Bits 7:0
  6557. * Purpose:
  6558. * Indicates the starting sequence number of the MPDU in this
  6559. * series of MPDUs that went though PN check.
  6560. * Value:
  6561. * The sequence number for the first MPDU in the sequence.
  6562. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6563. * - SEQ_NUM_END
  6564. * Bits 15:8
  6565. * Purpose:
  6566. * Indicates the ending sequence number of the MPDU in this
  6567. * series of MPDUs that went though PN check.
  6568. * Value:
  6569. * The sequence number one larger then the sequence number of the last
  6570. * MPDU being flushed.
  6571. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6572. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6573. * for invalid PN numbers and are ready to be released for further processing.
  6574. * Not all MPDUs within this range are necessarily valid - the host
  6575. * must check each sequence number within this range to see if the
  6576. * corresponding MPDU is actually present.
  6577. * - PN_IE_COUNT
  6578. * Bits 23:16
  6579. * Purpose:
  6580. * Used to determine the variable number of PN information elements in this
  6581. * message
  6582. *
  6583. * PN information elements:
  6584. * - PN_IE_x-
  6585. * Purpose:
  6586. * Each PN information element contains the sequence number of the MPDU that
  6587. * has failed the target PN check.
  6588. * Value:
  6589. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  6590. * that failed the PN check.
  6591. */
  6592. /* first DWORD */
  6593. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6594. #define HTT_RX_PN_IND_PEER_ID_S 8
  6595. #define HTT_RX_PN_IND_TID_M 0xff000000
  6596. #define HTT_RX_PN_IND_TID_S 24
  6597. /* second DWORD */
  6598. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6599. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6600. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6601. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6602. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6603. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6604. #define HTT_RX_PN_IND_BYTES 8
  6605. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6606. do { \
  6607. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6608. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6609. } while (0)
  6610. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6611. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6612. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6613. do { \
  6614. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6615. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6616. } while (0)
  6617. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6618. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6619. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6620. do { \
  6621. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6622. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6623. } while (0)
  6624. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6625. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  6626. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6627. do { \
  6628. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6629. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6630. } while (0)
  6631. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6632. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6633. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6634. do { \
  6635. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6636. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6637. } while (0)
  6638. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6639. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6640. /*
  6641. * @brief target -> host rx offload deliver message for LL system
  6642. *
  6643. * @details
  6644. * In a low latency system this message is sent whenever the offload
  6645. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6646. * The DMA of the actual packets into host memory is done before sending out
  6647. * this message. This message indicates only how many MSDUs to reap. The
  6648. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6649. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6650. * DMA'd by the MAC directly into host memory these packets do not contain
  6651. * the MAC descriptors in the header portion of the packet. Instead they contain
  6652. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6653. * message, the packets are delivered directly to the NW stack without going
  6654. * through the regular reorder buffering and PN checking path since it has
  6655. * already been done in target.
  6656. *
  6657. * |31 24|23 16|15 8|7 0|
  6658. * |-----------------------------------------------------------------------|
  6659. * | Total MSDU count | reserved | msg type |
  6660. * |-----------------------------------------------------------------------|
  6661. *
  6662. * @brief target -> host rx offload deliver message for HL system
  6663. *
  6664. * @details
  6665. * In a high latency system this message is sent whenever the offload manager
  6666. * flushes out the packets it has coalesced in its coalescing buffer. The
  6667. * actual packets are also carried along with this message. When the host
  6668. * receives this message, it is expected to deliver these packets to the NW
  6669. * stack directly instead of routing them through the reorder buffering and
  6670. * PN checking path since it has already been done in target.
  6671. *
  6672. * |31 24|23 16|15 8|7 0|
  6673. * |-----------------------------------------------------------------------|
  6674. * | Total MSDU count | reserved | msg type |
  6675. * |-----------------------------------------------------------------------|
  6676. * | peer ID | MSDU length |
  6677. * |-----------------------------------------------------------------------|
  6678. * | MSDU payload | FW Desc | tid | vdev ID |
  6679. * |-----------------------------------------------------------------------|
  6680. * | MSDU payload contd. |
  6681. * |-----------------------------------------------------------------------|
  6682. * | peer ID | MSDU length |
  6683. * |-----------------------------------------------------------------------|
  6684. * | MSDU payload | FW Desc | tid | vdev ID |
  6685. * |-----------------------------------------------------------------------|
  6686. * | MSDU payload contd. |
  6687. * |-----------------------------------------------------------------------|
  6688. *
  6689. */
  6690. /* first DWORD */
  6691. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6692. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6693. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6694. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6695. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6696. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6697. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6698. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6699. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6700. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6701. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6702. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6703. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6704. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6705. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6706. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6707. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6708. do { \
  6709. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6710. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6711. } while (0)
  6712. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6713. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6714. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6715. do { \
  6716. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6717. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6718. } while (0)
  6719. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6720. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6721. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6722. do { \
  6723. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6724. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6725. } while (0)
  6726. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6727. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6728. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6729. do { \
  6730. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6731. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6732. } while (0)
  6733. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6734. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6735. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6736. do { \
  6737. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6738. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6739. } while (0)
  6740. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6741. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6742. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6743. do { \
  6744. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6745. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6746. } while (0)
  6747. /**
  6748. * @brief target -> host rx peer map/unmap message definition
  6749. *
  6750. * @details
  6751. * The following diagram shows the format of the rx peer map message sent
  6752. * from the target to the host. This layout assumes the target operates
  6753. * as little-endian.
  6754. *
  6755. * This message always contains a SW peer ID. The main purpose of the
  6756. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6757. * with, so that the host can use that peer ID to determine which peer
  6758. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6759. * other purposes, such as identifying during tx completions which peer
  6760. * the tx frames in question were transmitted to.
  6761. *
  6762. * In certain generations of chips, the peer map message also contains
  6763. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  6764. * to identify which peer the frame needs to be forwarded to (i.e. the
  6765. * peer assocated with the Destination MAC Address within the packet),
  6766. * and particularly which vdev needs to transmit the frame (for cases
  6767. * of inter-vdev rx --> tx forwarding).
  6768. * This DA-based peer ID that is provided for certain rx frames
  6769. * (the rx frames that need to be re-transmitted as tx frames)
  6770. * is the ID that the HW uses for referring to the peer in question,
  6771. * rather than the peer ID that the SW+FW use to refer to the peer.
  6772. *
  6773. *
  6774. * |31 24|23 16|15 8|7 0|
  6775. * |-----------------------------------------------------------------------|
  6776. * | SW peer ID | VDEV ID | msg type |
  6777. * |-----------------------------------------------------------------------|
  6778. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6779. * |-----------------------------------------------------------------------|
  6780. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6781. * |-----------------------------------------------------------------------|
  6782. *
  6783. *
  6784. * The following diagram shows the format of the rx peer unmap message sent
  6785. * from the target to the host.
  6786. *
  6787. * |31 24|23 16|15 8|7 0|
  6788. * |-----------------------------------------------------------------------|
  6789. * | SW peer ID | VDEV ID | msg type |
  6790. * |-----------------------------------------------------------------------|
  6791. *
  6792. * The following field definitions describe the format of the rx peer map
  6793. * and peer unmap messages sent from the target to the host.
  6794. * - MSG_TYPE
  6795. * Bits 7:0
  6796. * Purpose: identifies this as an rx peer map or peer unmap message
  6797. * Value: peer map -> 0x3, peer unmap -> 0x4
  6798. * - VDEV_ID
  6799. * Bits 15:8
  6800. * Purpose: Indicates which virtual device the peer is associated
  6801. * with.
  6802. * Value: vdev ID (used in the host to look up the vdev object)
  6803. * - PEER_ID (a.k.a. SW_PEER_ID)
  6804. * Bits 31:16
  6805. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6806. * freeing (unmap)
  6807. * Value: (rx) peer ID
  6808. * - MAC_ADDR_L32 (peer map only)
  6809. * Bits 31:0
  6810. * Purpose: Identifies which peer node the peer ID is for.
  6811. * Value: lower 4 bytes of peer node's MAC address
  6812. * - MAC_ADDR_U16 (peer map only)
  6813. * Bits 15:0
  6814. * Purpose: Identifies which peer node the peer ID is for.
  6815. * Value: upper 2 bytes of peer node's MAC address
  6816. * - HW_PEER_ID
  6817. * Bits 31:16
  6818. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6819. * address, so for rx frames marked for rx --> tx forwarding, the
  6820. * host can determine from the HW peer ID provided as meta-data with
  6821. * the rx frame which peer the frame is supposed to be forwarded to.
  6822. * Value: ID used by the MAC HW to identify the peer
  6823. */
  6824. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6825. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6826. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6827. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6828. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  6829. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  6830. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6831. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6832. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6833. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6834. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  6835. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  6836. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6837. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6838. do { \
  6839. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6840. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6841. } while (0)
  6842. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6843. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6844. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6845. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6846. do { \
  6847. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6848. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6849. } while (0)
  6850. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6851. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6852. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  6853. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  6854. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  6855. do { \
  6856. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  6857. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  6858. } while (0)
  6859. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  6860. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  6861. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6862. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  6863. #define HTT_RX_PEER_MAP_BYTES 12
  6864. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6865. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6866. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  6867. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  6868. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6869. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6870. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6871. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6872. #define HTT_RX_PEER_UNMAP_BYTES 4
  6873. /**
  6874. * @brief target -> host rx peer map V2 message definition
  6875. *
  6876. * @details
  6877. * The following diagram shows the format of the rx peer map v2 message sent
  6878. * from the target to the host. This layout assumes the target operates
  6879. * as little-endian.
  6880. *
  6881. * This message always contains a SW peer ID. The main purpose of the
  6882. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  6883. * with, so that the host can use that peer ID to determine which peer
  6884. * transmitted the rx frame. This SW peer ID is sometimes also used for
  6885. * other purposes, such as identifying during tx completions which peer
  6886. * the tx frames in question were transmitted to.
  6887. *
  6888. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  6889. * is used during rx --> tx frame forwarding to identify which peer the
  6890. * frame needs to be forwarded to (i.e. the peer assocated with the
  6891. * Destination MAC Address within the packet), and particularly which vdev
  6892. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  6893. * This DA-based peer ID that is provided for certain rx frames
  6894. * (the rx frames that need to be re-transmitted as tx frames)
  6895. * is the ID that the HW uses for referring to the peer in question,
  6896. * rather than the peer ID that the SW+FW use to refer to the peer.
  6897. *
  6898. *
  6899. * |31 24|23 16|15 8|7 0|
  6900. * |-----------------------------------------------------------------------|
  6901. * | SW peer ID | VDEV ID | msg type |
  6902. * |-----------------------------------------------------------------------|
  6903. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6904. * |-----------------------------------------------------------------------|
  6905. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  6906. * |-----------------------------------------------------------------------|
  6907. * | Reserved_17_31 | Next Hop | AST Hash Value |
  6908. * |-----------------------------------------------------------------------|
  6909. * | Reserved_0 |
  6910. * |-----------------------------------------------------------------------|
  6911. * | Reserved_1 |
  6912. * |-----------------------------------------------------------------------|
  6913. * | Reserved_2 |
  6914. * |-----------------------------------------------------------------------|
  6915. * | Reserved_3 |
  6916. * |-----------------------------------------------------------------------|
  6917. *
  6918. *
  6919. * The following field definitions describe the format of the rx peer map v2
  6920. * messages sent from the target to the host.
  6921. * - MSG_TYPE
  6922. * Bits 7:0
  6923. * Purpose: identifies this as an rx peer map v2 message
  6924. * Value: peer map v2 -> 0x1e
  6925. * - VDEV_ID
  6926. * Bits 15:8
  6927. * Purpose: Indicates which virtual device the peer is associated with.
  6928. * Value: vdev ID (used in the host to look up the vdev object)
  6929. * - SW_PEER_ID
  6930. * Bits 31:16
  6931. * Purpose: The peer ID (index) that WAL is allocating
  6932. * Value: (rx) peer ID
  6933. * - MAC_ADDR_L32
  6934. * Bits 31:0
  6935. * Purpose: Identifies which peer node the peer ID is for.
  6936. * Value: lower 4 bytes of peer node's MAC address
  6937. * - MAC_ADDR_U16
  6938. * Bits 15:0
  6939. * Purpose: Identifies which peer node the peer ID is for.
  6940. * Value: upper 2 bytes of peer node's MAC address
  6941. * - HW_PEER_ID
  6942. * Bits 31:16
  6943. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  6944. * address, so for rx frames marked for rx --> tx forwarding, the
  6945. * host can determine from the HW peer ID provided as meta-data with
  6946. * the rx frame which peer the frame is supposed to be forwarded to.
  6947. * Value: ID used by the MAC HW to identify the peer
  6948. * - AST_HASH_VALUE
  6949. * Bits 15:0
  6950. * Purpose: Indicates AST Hash value is required for the TCL AST index
  6951. * override feature.
  6952. * - NEXT_HOP
  6953. * Bit 16
  6954. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  6955. * (Wireless Distribution System).
  6956. */
  6957. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  6958. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  6959. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  6960. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  6961. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  6962. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  6963. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  6964. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  6965. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  6966. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  6967. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  6968. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  6969. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  6970. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  6971. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  6972. do { \
  6973. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  6974. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  6975. } while (0)
  6976. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  6977. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  6978. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  6979. do { \
  6980. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  6981. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  6982. } while (0)
  6983. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  6984. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  6985. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  6986. do { \
  6987. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  6988. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  6989. } while (0)
  6990. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  6991. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  6992. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  6993. do { \
  6994. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  6995. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  6996. } while (0)
  6997. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  6998. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  6999. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  7000. do { \
  7001. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7002. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7003. } while (0)
  7004. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7005. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7006. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7007. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7008. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7009. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7010. #define HTT_RX_PEER_MAP_V2_BYTES 32
  7011. /**
  7012. * @brief target -> host rx peer unmap V2 message definition
  7013. *
  7014. *
  7015. * The following diagram shows the format of the rx peer unmap message sent
  7016. * from the target to the host.
  7017. *
  7018. * |31 24|23 16|15 8|7 0|
  7019. * |-----------------------------------------------------------------------|
  7020. * | SW peer ID | VDEV ID | msg type |
  7021. * |-----------------------------------------------------------------------|
  7022. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7023. * |-----------------------------------------------------------------------|
  7024. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7025. * |-----------------------------------------------------------------------|
  7026. * | Peer Delete Duration |
  7027. * |-----------------------------------------------------------------------|
  7028. * | Reserved_0 |
  7029. * |-----------------------------------------------------------------------|
  7030. * | Reserved_1 |
  7031. * |-----------------------------------------------------------------------|
  7032. * | Reserved_2 |
  7033. * |-----------------------------------------------------------------------|
  7034. *
  7035. *
  7036. * The following field definitions describe the format of the rx peer unmap
  7037. * messages sent from the target to the host.
  7038. * - MSG_TYPE
  7039. * Bits 7:0
  7040. * Purpose: identifies this as an rx peer unmap v2 message
  7041. * Value: peer unmap v2 -> 0x1f
  7042. * - VDEV_ID
  7043. * Bits 15:8
  7044. * Purpose: Indicates which virtual device the peer is associated
  7045. * with.
  7046. * Value: vdev ID (used in the host to look up the vdev object)
  7047. * - SW_PEER_ID
  7048. * Bits 31:16
  7049. * Purpose: The peer ID (index) that WAL is freeing
  7050. * Value: (rx) peer ID
  7051. * - MAC_ADDR_L32
  7052. * Bits 31:0
  7053. * Purpose: Identifies which peer node the peer ID is for.
  7054. * Value: lower 4 bytes of peer node's MAC address
  7055. * - MAC_ADDR_U16
  7056. * Bits 15:0
  7057. * Purpose: Identifies which peer node the peer ID is for.
  7058. * Value: upper 2 bytes of peer node's MAC address
  7059. * - NEXT_HOP
  7060. * Bits 16
  7061. * Purpose: Bit indicates next_hop AST entry used for WDS
  7062. * (Wireless Distribution System).
  7063. * - PEER_DELETE_DURATION
  7064. * Bits 31:0
  7065. * Purpose: Time taken to delete peer, in msec,
  7066. * Used for monitoring / debugging PEER delete response delay
  7067. */
  7068. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7069. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7070. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7071. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7072. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7073. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7074. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7075. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7076. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7077. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7078. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7079. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7080. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7081. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7082. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7083. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7084. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7085. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7086. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7087. do { \
  7088. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7089. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7090. } while (0)
  7091. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7092. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7093. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7094. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7095. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7096. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7097. /**
  7098. * @brief target -> host message specifying security parameters
  7099. *
  7100. * @details
  7101. * The following diagram shows the format of the security specification
  7102. * message sent from the target to the host.
  7103. * This security specification message tells the host whether a PN check is
  7104. * necessary on rx data frames, and if so, how large the PN counter is.
  7105. * This message also tells the host about the security processing to apply
  7106. * to defragmented rx frames - specifically, whether a Message Integrity
  7107. * Check is required, and the Michael key to use.
  7108. *
  7109. * |31 24|23 16|15|14 8|7 0|
  7110. * |-----------------------------------------------------------------------|
  7111. * | peer ID | U| security type | msg type |
  7112. * |-----------------------------------------------------------------------|
  7113. * | Michael Key K0 |
  7114. * |-----------------------------------------------------------------------|
  7115. * | Michael Key K1 |
  7116. * |-----------------------------------------------------------------------|
  7117. * | WAPI RSC Low0 |
  7118. * |-----------------------------------------------------------------------|
  7119. * | WAPI RSC Low1 |
  7120. * |-----------------------------------------------------------------------|
  7121. * | WAPI RSC Hi0 |
  7122. * |-----------------------------------------------------------------------|
  7123. * | WAPI RSC Hi1 |
  7124. * |-----------------------------------------------------------------------|
  7125. *
  7126. * The following field definitions describe the format of the security
  7127. * indication message sent from the target to the host.
  7128. * - MSG_TYPE
  7129. * Bits 7:0
  7130. * Purpose: identifies this as a security specification message
  7131. * Value: 0xb
  7132. * - SEC_TYPE
  7133. * Bits 14:8
  7134. * Purpose: specifies which type of security applies to the peer
  7135. * Value: htt_sec_type enum value
  7136. * - UNICAST
  7137. * Bit 15
  7138. * Purpose: whether this security is applied to unicast or multicast data
  7139. * Value: 1 -> unicast, 0 -> multicast
  7140. * - PEER_ID
  7141. * Bits 31:16
  7142. * Purpose: The ID number for the peer the security specification is for
  7143. * Value: peer ID
  7144. * - MICHAEL_KEY_K0
  7145. * Bits 31:0
  7146. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7147. * Value: Michael Key K0 (if security type is TKIP)
  7148. * - MICHAEL_KEY_K1
  7149. * Bits 31:0
  7150. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7151. * Value: Michael Key K1 (if security type is TKIP)
  7152. * - WAPI_RSC_LOW0
  7153. * Bits 31:0
  7154. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7155. * Value: WAPI RSC Low0 (if security type is WAPI)
  7156. * - WAPI_RSC_LOW1
  7157. * Bits 31:0
  7158. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7159. * Value: WAPI RSC Low1 (if security type is WAPI)
  7160. * - WAPI_RSC_HI0
  7161. * Bits 31:0
  7162. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7163. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7164. * - WAPI_RSC_HI1
  7165. * Bits 31:0
  7166. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7167. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7168. */
  7169. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7170. #define HTT_SEC_IND_SEC_TYPE_S 8
  7171. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7172. #define HTT_SEC_IND_UNICAST_S 15
  7173. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7174. #define HTT_SEC_IND_PEER_ID_S 16
  7175. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7176. do { \
  7177. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7178. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7179. } while (0)
  7180. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7181. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7182. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7183. do { \
  7184. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7185. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7186. } while (0)
  7187. #define HTT_SEC_IND_UNICAST_GET(word) \
  7188. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7189. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7190. do { \
  7191. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7192. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7193. } while (0)
  7194. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7195. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7196. #define HTT_SEC_IND_BYTES 28
  7197. /**
  7198. * @brief target -> host rx ADDBA / DELBA message definitions
  7199. *
  7200. * @details
  7201. * The following diagram shows the format of the rx ADDBA message sent
  7202. * from the target to the host:
  7203. *
  7204. * |31 20|19 16|15 8|7 0|
  7205. * |---------------------------------------------------------------------|
  7206. * | peer ID | TID | window size | msg type |
  7207. * |---------------------------------------------------------------------|
  7208. *
  7209. * The following diagram shows the format of the rx DELBA message sent
  7210. * from the target to the host:
  7211. *
  7212. * |31 20|19 16|15 10|9 8|7 0|
  7213. * |---------------------------------------------------------------------|
  7214. * | peer ID | TID | reserved | IR| msg type |
  7215. * |---------------------------------------------------------------------|
  7216. *
  7217. * The following field definitions describe the format of the rx ADDBA
  7218. * and DELBA messages sent from the target to the host.
  7219. * - MSG_TYPE
  7220. * Bits 7:0
  7221. * Purpose: identifies this as an rx ADDBA or DELBA message
  7222. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7223. * - IR (initiator / recipient)
  7224. * Bits 9:8 (DELBA only)
  7225. * Purpose: specify whether the DELBA handshake was initiated by the
  7226. * local STA/AP, or by the peer STA/AP
  7227. * Value:
  7228. * 0 - unspecified
  7229. * 1 - initiator (a.k.a. originator)
  7230. * 2 - recipient (a.k.a. responder)
  7231. * 3 - unused / reserved
  7232. * - WIN_SIZE
  7233. * Bits 15:8 (ADDBA only)
  7234. * Purpose: Specifies the length of the block ack window (max = 64).
  7235. * Value:
  7236. * block ack window length specified by the received ADDBA
  7237. * management message.
  7238. * - TID
  7239. * Bits 19:16
  7240. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7241. * Value:
  7242. * TID specified by the received ADDBA or DELBA management message.
  7243. * - PEER_ID
  7244. * Bits 31:20
  7245. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7246. * Value:
  7247. * ID (hash value) used by the host for fast, direct lookup of
  7248. * host SW peer info, including rx reorder states.
  7249. */
  7250. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7251. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7252. #define HTT_RX_ADDBA_TID_M 0xf0000
  7253. #define HTT_RX_ADDBA_TID_S 16
  7254. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7255. #define HTT_RX_ADDBA_PEER_ID_S 20
  7256. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7257. do { \
  7258. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7259. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7260. } while (0)
  7261. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7262. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7263. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7264. do { \
  7265. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7266. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7267. } while (0)
  7268. #define HTT_RX_ADDBA_TID_GET(word) \
  7269. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7270. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7271. do { \
  7272. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7273. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7274. } while (0)
  7275. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7276. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7277. #define HTT_RX_ADDBA_BYTES 4
  7278. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7279. #define HTT_RX_DELBA_INITIATOR_S 8
  7280. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7281. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7282. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7283. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7284. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7285. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7286. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7287. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7288. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7289. do { \
  7290. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7291. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7292. } while (0)
  7293. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7294. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7295. #define HTT_RX_DELBA_BYTES 4
  7296. /**
  7297. * @brief tx queue group information element definition
  7298. *
  7299. * @details
  7300. * The following diagram shows the format of the tx queue group
  7301. * information element, which can be included in target --> host
  7302. * messages to specify the number of tx "credits" (tx descriptors
  7303. * for LL, or tx buffers for HL) available to a particular group
  7304. * of host-side tx queues, and which host-side tx queues belong to
  7305. * the group.
  7306. *
  7307. * |31|30 24|23 16|15|14|13 0|
  7308. * |------------------------------------------------------------------------|
  7309. * | X| reserved | tx queue grp ID | A| S| credit count |
  7310. * |------------------------------------------------------------------------|
  7311. * | vdev ID mask | AC mask |
  7312. * |------------------------------------------------------------------------|
  7313. *
  7314. * The following definitions describe the fields within the tx queue group
  7315. * information element:
  7316. * - credit_count
  7317. * Bits 13:1
  7318. * Purpose: specify how many tx credits are available to the tx queue group
  7319. * Value: An absolute or relative, positive or negative credit value
  7320. * The 'A' bit specifies whether the value is absolute or relative.
  7321. * The 'S' bit specifies whether the value is positive or negative.
  7322. * A negative value can only be relative, not absolute.
  7323. * An absolute value replaces any prior credit value the host has for
  7324. * the tx queue group in question.
  7325. * A relative value is added to the prior credit value the host has for
  7326. * the tx queue group in question.
  7327. * - sign
  7328. * Bit 14
  7329. * Purpose: specify whether the credit count is positive or negative
  7330. * Value: 0 -> positive, 1 -> negative
  7331. * - absolute
  7332. * Bit 15
  7333. * Purpose: specify whether the credit count is absolute or relative
  7334. * Value: 0 -> relative, 1 -> absolute
  7335. * - txq_group_id
  7336. * Bits 23:16
  7337. * Purpose: indicate which tx queue group's credit and/or membership are
  7338. * being specified
  7339. * Value: 0 to max_tx_queue_groups-1
  7340. * - reserved
  7341. * Bits 30:16
  7342. * Value: 0x0
  7343. * - eXtension
  7344. * Bit 31
  7345. * Purpose: specify whether another tx queue group info element follows
  7346. * Value: 0 -> no more tx queue group information elements
  7347. * 1 -> another tx queue group information element immediately follows
  7348. * - ac_mask
  7349. * Bits 15:0
  7350. * Purpose: specify which Access Categories belong to the tx queue group
  7351. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7352. * the tx queue group.
  7353. * The AC bit-mask values are obtained by left-shifting by the
  7354. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7355. * - vdev_id_mask
  7356. * Bits 31:16
  7357. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7358. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7359. * belong to the tx queue group.
  7360. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7361. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7362. */
  7363. PREPACK struct htt_txq_group {
  7364. A_UINT32
  7365. credit_count: 14,
  7366. sign: 1,
  7367. absolute: 1,
  7368. tx_queue_group_id: 8,
  7369. reserved0: 7,
  7370. extension: 1;
  7371. A_UINT32
  7372. ac_mask: 16,
  7373. vdev_id_mask: 16;
  7374. } POSTPACK;
  7375. /* first word */
  7376. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7377. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7378. #define HTT_TXQ_GROUP_SIGN_S 14
  7379. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7380. #define HTT_TXQ_GROUP_ABS_S 15
  7381. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7382. #define HTT_TXQ_GROUP_ID_S 16
  7383. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7384. #define HTT_TXQ_GROUP_EXT_S 31
  7385. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7386. /* second word */
  7387. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7388. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7389. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7390. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7391. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7392. do { \
  7393. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7394. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7395. } while (0)
  7396. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7397. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7398. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7399. do { \
  7400. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7401. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7402. } while (0)
  7403. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7404. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7405. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7406. do { \
  7407. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7408. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7409. } while (0)
  7410. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7411. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7412. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7413. do { \
  7414. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7415. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7416. } while (0)
  7417. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7418. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7419. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7420. do { \
  7421. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7422. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7423. } while (0)
  7424. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7425. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7426. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7427. do { \
  7428. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7429. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7430. } while (0)
  7431. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7432. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7433. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7434. do { \
  7435. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7436. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7437. } while (0)
  7438. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7439. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7440. /**
  7441. * @brief target -> host TX completion indication message definition
  7442. *
  7443. * @details
  7444. * The following diagram shows the format of the TX completion indication sent
  7445. * from the target to the host
  7446. *
  7447. * |31 28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7448. * |-------------------------------------------------------------|
  7449. * header: |rsvd |A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7450. * |-------------------------------------------------------------|
  7451. * payload: | MSDU1 ID | MSDU0 ID |
  7452. * |-------------------------------------------------------------|
  7453. * : MSDU3 ID : MSDU2 ID :
  7454. * |-------------------------------------------------------------|
  7455. * | struct htt_tx_compl_ind_append_retries |
  7456. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7457. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7458. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7459. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7460. * |-------------------------------------------------------------|
  7461. * : MSDU3 ACK RSSI : MSDU2 ACK RSSI :
  7462. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7463. * Where:
  7464. * A0 = append (a.k.a. append0)
  7465. * A1 = append1
  7466. * TP = MSDU tx power presence
  7467. * A2 = append2
  7468. *
  7469. * The following field definitions describe the format of the TX completion
  7470. * indication sent from the target to the host
  7471. * Header fields:
  7472. * - msg_type
  7473. * Bits 7:0
  7474. * Purpose: identifies this as HTT TX completion indication
  7475. * Value: 0x7
  7476. * - status
  7477. * Bits 10:8
  7478. * Purpose: the TX completion status of payload fragmentations descriptors
  7479. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7480. * - tid
  7481. * Bits 14:11
  7482. * Purpose: the tid associated with those fragmentation descriptors. It is
  7483. * valid or not, depending on the tid_invalid bit.
  7484. * Value: 0 to 15
  7485. * - tid_invalid
  7486. * Bits 15:15
  7487. * Purpose: this bit indicates whether the tid field is valid or not
  7488. * Value: 0 indicates valid; 1 indicates invalid
  7489. * - num
  7490. * Bits 23:16
  7491. * Purpose: the number of payload in this indication
  7492. * Value: 1 to 255
  7493. * - append (a.k.a. append0)
  7494. * Bits 24:24
  7495. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7496. * the number of tx retries for one MSDU at the end of this message
  7497. * Value: 0 indicates no appending; 1 indicates appending
  7498. * - append1
  7499. * Bits 25:25
  7500. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7501. * contains the timestamp info for each TX msdu id in payload.
  7502. * The order of the timestamps matches the order of the MSDU IDs.
  7503. * Note that a big-endian host needs to account for the reordering
  7504. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7505. * conversion) when determining which tx timestamp corresponds to
  7506. * which MSDU ID.
  7507. * Value: 0 indicates no appending; 1 indicates appending
  7508. * - msdu_tx_power_presence
  7509. * Bits 26:26
  7510. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7511. * for each MSDU referenced by the TX_COMPL_IND message.
  7512. * The tx power is reported in 0.5 dBm units.
  7513. * The order of the per-MSDU tx power reports matches the order
  7514. * of the MSDU IDs.
  7515. * Note that a big-endian host needs to account for the reordering
  7516. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7517. * conversion) when determining which Tx Power corresponds to
  7518. * which MSDU ID.
  7519. * Value: 0 indicates MSDU tx power reports are not appended,
  7520. * 1 indicates MSDU tx power reports are appended
  7521. * - append2
  7522. * Bits 27:27
  7523. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7524. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7525. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7526. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7527. * for each MSDU, for convenience.
  7528. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7529. * this append2 bit is set).
  7530. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7531. * dB above the noise floor.
  7532. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7533. * 1 indicates MSDU ACK RSSI values are appended.
  7534. * Payload fields:
  7535. * - hmsdu_id
  7536. * Bits 15:0
  7537. * Purpose: this ID is used to track the Tx buffer in host
  7538. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7539. */
  7540. #define HTT_TX_COMPL_IND_STATUS_S 8
  7541. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  7542. #define HTT_TX_COMPL_IND_TID_S 11
  7543. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  7544. #define HTT_TX_COMPL_IND_TID_INV_S 15
  7545. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  7546. #define HTT_TX_COMPL_IND_NUM_S 16
  7547. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  7548. #define HTT_TX_COMPL_IND_APPEND_S 24
  7549. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  7550. #define HTT_TX_COMPL_IND_APPEND1_S 25
  7551. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  7552. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  7553. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  7554. #define HTT_TX_COMPL_IND_APPEND2_S 27
  7555. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  7556. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  7557. do { \
  7558. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  7559. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  7560. } while (0)
  7561. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  7562. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  7563. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  7564. do { \
  7565. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  7566. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  7567. } while (0)
  7568. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  7569. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  7570. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  7571. do { \
  7572. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  7573. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  7574. } while (0)
  7575. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  7576. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  7577. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  7578. do { \
  7579. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  7580. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  7581. } while (0)
  7582. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  7583. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  7584. HTT_TX_COMPL_IND_TID_INV_S)
  7585. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  7586. do { \
  7587. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  7588. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  7589. } while (0)
  7590. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  7591. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  7592. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  7593. do { \
  7594. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  7595. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  7596. } while (0)
  7597. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  7598. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  7599. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  7600. do { \
  7601. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  7602. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  7603. } while (0)
  7604. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  7605. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  7606. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  7607. do { \
  7608. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  7609. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  7610. } while (0)
  7611. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  7612. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  7613. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  7614. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  7615. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  7616. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  7617. #define HTT_TX_COMPL_IND_STAT_OK 0
  7618. /* DISCARD:
  7619. * current meaning:
  7620. * MSDUs were queued for transmission but filtered by HW or SW
  7621. * without any over the air attempts
  7622. * legacy meaning (HL Rome):
  7623. * MSDUs were discarded by the target FW without any over the air
  7624. * attempts due to lack of space
  7625. */
  7626. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  7627. /* NO_ACK:
  7628. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  7629. */
  7630. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  7631. /* POSTPONE:
  7632. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  7633. * be downloaded again later (in the appropriate order), when they are
  7634. * deliverable.
  7635. */
  7636. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7637. /*
  7638. * The PEER_DEL tx completion status is used for HL cases
  7639. * where the peer the frame is for has been deleted.
  7640. * The host has already discarded its copy of the frame, but
  7641. * it still needs the tx completion to restore its credit.
  7642. */
  7643. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7644. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  7645. #define HTT_TX_COMPL_IND_STAT_DROP 5
  7646. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  7647. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7648. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7649. PREPACK struct htt_tx_compl_ind_base {
  7650. A_UINT32 hdr;
  7651. A_UINT16 payload[1/*or more*/];
  7652. } POSTPACK;
  7653. PREPACK struct htt_tx_compl_ind_append_retries {
  7654. A_UINT16 msdu_id;
  7655. A_UINT8 tx_retries;
  7656. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  7657. 0: this is the last append_retries struct */
  7658. } POSTPACK;
  7659. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  7660. A_UINT32 timestamp[1/*or more*/];
  7661. } POSTPACK;
  7662. /**
  7663. * @brief target -> host rate-control update indication message
  7664. *
  7665. * @details
  7666. * The following diagram shows the format of the RC Update message
  7667. * sent from the target to the host, while processing the tx-completion
  7668. * of a transmitted PPDU.
  7669. *
  7670. * |31 24|23 16|15 8|7 0|
  7671. * |-------------------------------------------------------------|
  7672. * | peer ID | vdev ID | msg_type |
  7673. * |-------------------------------------------------------------|
  7674. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7675. * |-------------------------------------------------------------|
  7676. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7677. * |-------------------------------------------------------------|
  7678. * | : |
  7679. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7680. * | : |
  7681. * |-------------------------------------------------------------|
  7682. * | : |
  7683. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7684. * | : |
  7685. * |-------------------------------------------------------------|
  7686. * : :
  7687. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7688. *
  7689. */
  7690. typedef struct {
  7691. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7692. A_UINT32 rate_code_flags;
  7693. A_UINT32 flags; /* Encodes information such as excessive
  7694. retransmission, aggregate, some info
  7695. from .11 frame control,
  7696. STBC, LDPC, (SGI and Tx Chain Mask
  7697. are encoded in ptx_rc->flags field),
  7698. AMPDU truncation (BT/time based etc.),
  7699. RTS/CTS attempt */
  7700. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  7701. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  7702. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  7703. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7704. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  7705. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7706. } HTT_RC_TX_DONE_PARAMS;
  7707. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  7708. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7709. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7710. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7711. #define HTT_RC_UPDATE_VDEVID_S 8
  7712. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7713. #define HTT_RC_UPDATE_PEERID_S 16
  7714. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7715. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7716. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7717. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7718. do { \
  7719. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7720. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7721. } while (0)
  7722. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7723. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7724. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7725. do { \
  7726. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7727. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7728. } while (0)
  7729. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7730. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7731. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7734. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7735. } while (0)
  7736. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7737. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7738. /**
  7739. * @brief target -> host rx fragment indication message definition
  7740. *
  7741. * @details
  7742. * The following field definitions describe the format of the rx fragment
  7743. * indication message sent from the target to the host.
  7744. * The rx fragment indication message shares the format of the
  7745. * rx indication message, but not all fields from the rx indication message
  7746. * are relevant to the rx fragment indication message.
  7747. *
  7748. *
  7749. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7750. * |-----------+-------------------+---------------------+-------------|
  7751. * | peer ID | |FV| ext TID | msg type |
  7752. * |-------------------------------------------------------------------|
  7753. * | | flush | flush |
  7754. * | | end | start |
  7755. * | | seq num | seq num |
  7756. * |-------------------------------------------------------------------|
  7757. * | reserved | FW rx desc bytes |
  7758. * |-------------------------------------------------------------------|
  7759. * | | FW MSDU Rx |
  7760. * | | desc B0 |
  7761. * |-------------------------------------------------------------------|
  7762. * Header fields:
  7763. * - MSG_TYPE
  7764. * Bits 7:0
  7765. * Purpose: identifies this as an rx fragment indication message
  7766. * Value: 0xa
  7767. * - EXT_TID
  7768. * Bits 12:8
  7769. * Purpose: identify the traffic ID of the rx data, including
  7770. * special "extended" TID values for multicast, broadcast, and
  7771. * non-QoS data frames
  7772. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7773. * - FLUSH_VALID (FV)
  7774. * Bit 13
  7775. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7776. * is valid
  7777. * Value:
  7778. * 1 -> flush IE is valid and needs to be processed
  7779. * 0 -> flush IE is not valid and should be ignored
  7780. * - PEER_ID
  7781. * Bits 31:16
  7782. * Purpose: Identify, by ID, which peer sent the rx data
  7783. * Value: ID of the peer who sent the rx data
  7784. * - FLUSH_SEQ_NUM_START
  7785. * Bits 5:0
  7786. * Purpose: Indicate the start of a series of MPDUs to flush
  7787. * Not all MPDUs within this series are necessarily valid - the host
  7788. * must check each sequence number within this range to see if the
  7789. * corresponding MPDU is actually present.
  7790. * This field is only valid if the FV bit is set.
  7791. * Value:
  7792. * The sequence number for the first MPDUs to check to flush.
  7793. * The sequence number is masked by 0x3f.
  7794. * - FLUSH_SEQ_NUM_END
  7795. * Bits 11:6
  7796. * Purpose: Indicate the end of a series of MPDUs to flush
  7797. * Value:
  7798. * The sequence number one larger than the sequence number of the
  7799. * last MPDU to check to flush.
  7800. * The sequence number is masked by 0x3f.
  7801. * Not all MPDUs within this series are necessarily valid - the host
  7802. * must check each sequence number within this range to see if the
  7803. * corresponding MPDU is actually present.
  7804. * This field is only valid if the FV bit is set.
  7805. * Rx descriptor fields:
  7806. * - FW_RX_DESC_BYTES
  7807. * Bits 15:0
  7808. * Purpose: Indicate how many bytes in the Rx indication are used for
  7809. * FW Rx descriptors
  7810. * Value: 1
  7811. */
  7812. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7813. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7814. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7815. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7816. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7817. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7818. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7819. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7820. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7821. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7822. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7823. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7824. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7825. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7826. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7827. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7828. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7829. #define HTT_RX_FRAG_IND_BYTES \
  7830. (4 /* msg hdr */ + \
  7831. 4 /* flush spec */ + \
  7832. 4 /* (unused) FW rx desc bytes spec */ + \
  7833. 4 /* FW rx desc */)
  7834. /**
  7835. * @brief target -> host test message definition
  7836. *
  7837. * @details
  7838. * The following field definitions describe the format of the test
  7839. * message sent from the target to the host.
  7840. * The message consists of a 4-octet header, followed by a variable
  7841. * number of 32-bit integer values, followed by a variable number
  7842. * of 8-bit character values.
  7843. *
  7844. * |31 16|15 8|7 0|
  7845. * |-----------------------------------------------------------|
  7846. * | num chars | num ints | msg type |
  7847. * |-----------------------------------------------------------|
  7848. * | int 0 |
  7849. * |-----------------------------------------------------------|
  7850. * | int 1 |
  7851. * |-----------------------------------------------------------|
  7852. * | ... |
  7853. * |-----------------------------------------------------------|
  7854. * | char 3 | char 2 | char 1 | char 0 |
  7855. * |-----------------------------------------------------------|
  7856. * | | | ... | char 4 |
  7857. * |-----------------------------------------------------------|
  7858. * - MSG_TYPE
  7859. * Bits 7:0
  7860. * Purpose: identifies this as a test message
  7861. * Value: HTT_MSG_TYPE_TEST
  7862. * - NUM_INTS
  7863. * Bits 15:8
  7864. * Purpose: indicate how many 32-bit integers follow the message header
  7865. * - NUM_CHARS
  7866. * Bits 31:16
  7867. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7868. */
  7869. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7870. #define HTT_RX_TEST_NUM_INTS_S 8
  7871. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7872. #define HTT_RX_TEST_NUM_CHARS_S 16
  7873. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7874. do { \
  7875. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7876. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7877. } while (0)
  7878. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7879. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7880. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7881. do { \
  7882. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7883. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7884. } while (0)
  7885. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7886. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7887. /**
  7888. * @brief target -> host packet log message
  7889. *
  7890. * @details
  7891. * The following field definitions describe the format of the packet log
  7892. * message sent from the target to the host.
  7893. * The message consists of a 4-octet header,followed by a variable number
  7894. * of 32-bit character values.
  7895. *
  7896. * |31 16|15 12|11 10|9 8|7 0|
  7897. * |------------------------------------------------------------------|
  7898. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  7899. * |------------------------------------------------------------------|
  7900. * | payload |
  7901. * |------------------------------------------------------------------|
  7902. * - MSG_TYPE
  7903. * Bits 7:0
  7904. * Purpose: identifies this as a pktlog message
  7905. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  7906. * - mac_id
  7907. * Bits 9:8
  7908. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  7909. * Value: 0-3
  7910. * - pdev_id
  7911. * Bits 11:10
  7912. * Purpose: pdev_id
  7913. * Value: 0-3
  7914. * 0 (for rings at SOC level),
  7915. * 1/2/3 PDEV -> 0/1/2
  7916. * - payload_size
  7917. * Bits 31:16
  7918. * Purpose: explicitly specify the payload size
  7919. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  7920. */
  7921. PREPACK struct htt_pktlog_msg {
  7922. A_UINT32 header;
  7923. A_UINT32 payload[1/* or more */];
  7924. } POSTPACK;
  7925. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  7926. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  7927. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  7928. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  7929. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  7930. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  7931. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  7932. do { \
  7933. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  7934. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  7935. } while (0)
  7936. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  7937. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  7938. HTT_T2H_PKTLOG_MAC_ID_S)
  7939. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  7940. do { \
  7941. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  7942. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  7943. } while (0)
  7944. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  7945. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  7946. HTT_T2H_PKTLOG_PDEV_ID_S)
  7947. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  7948. do { \
  7949. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  7950. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  7951. } while (0)
  7952. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  7953. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  7954. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  7955. /*
  7956. * Rx reorder statistics
  7957. * NB: all the fields must be defined in 4 octets size.
  7958. */
  7959. struct rx_reorder_stats {
  7960. /* Non QoS MPDUs received */
  7961. A_UINT32 deliver_non_qos;
  7962. /* MPDUs received in-order */
  7963. A_UINT32 deliver_in_order;
  7964. /* Flush due to reorder timer expired */
  7965. A_UINT32 deliver_flush_timeout;
  7966. /* Flush due to move out of window */
  7967. A_UINT32 deliver_flush_oow;
  7968. /* Flush due to DELBA */
  7969. A_UINT32 deliver_flush_delba;
  7970. /* MPDUs dropped due to FCS error */
  7971. A_UINT32 fcs_error;
  7972. /* MPDUs dropped due to monitor mode non-data packet */
  7973. A_UINT32 mgmt_ctrl;
  7974. /* Unicast-data MPDUs dropped due to invalid peer */
  7975. A_UINT32 invalid_peer;
  7976. /* MPDUs dropped due to duplication (non aggregation) */
  7977. A_UINT32 dup_non_aggr;
  7978. /* MPDUs dropped due to processed before */
  7979. A_UINT32 dup_past;
  7980. /* MPDUs dropped due to duplicate in reorder queue */
  7981. A_UINT32 dup_in_reorder;
  7982. /* Reorder timeout happened */
  7983. A_UINT32 reorder_timeout;
  7984. /* invalid bar ssn */
  7985. A_UINT32 invalid_bar_ssn;
  7986. /* reorder reset due to bar ssn */
  7987. A_UINT32 ssn_reset;
  7988. /* Flush due to delete peer */
  7989. A_UINT32 deliver_flush_delpeer;
  7990. /* Flush due to offload*/
  7991. A_UINT32 deliver_flush_offload;
  7992. /* Flush due to out of buffer*/
  7993. A_UINT32 deliver_flush_oob;
  7994. /* MPDUs dropped due to PN check fail */
  7995. A_UINT32 pn_fail;
  7996. /* MPDUs dropped due to unable to allocate memory */
  7997. A_UINT32 store_fail;
  7998. /* Number of times the tid pool alloc succeeded */
  7999. A_UINT32 tid_pool_alloc_succ;
  8000. /* Number of times the MPDU pool alloc succeeded */
  8001. A_UINT32 mpdu_pool_alloc_succ;
  8002. /* Number of times the MSDU pool alloc succeeded */
  8003. A_UINT32 msdu_pool_alloc_succ;
  8004. /* Number of times the tid pool alloc failed */
  8005. A_UINT32 tid_pool_alloc_fail;
  8006. /* Number of times the MPDU pool alloc failed */
  8007. A_UINT32 mpdu_pool_alloc_fail;
  8008. /* Number of times the MSDU pool alloc failed */
  8009. A_UINT32 msdu_pool_alloc_fail;
  8010. /* Number of times the tid pool freed */
  8011. A_UINT32 tid_pool_free;
  8012. /* Number of times the MPDU pool freed */
  8013. A_UINT32 mpdu_pool_free;
  8014. /* Number of times the MSDU pool freed */
  8015. A_UINT32 msdu_pool_free;
  8016. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8017. A_UINT32 msdu_queued;
  8018. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8019. A_UINT32 msdu_recycled;
  8020. /* Number of MPDUs with invalid peer but A2 found in AST */
  8021. A_UINT32 invalid_peer_a2_in_ast;
  8022. /* Number of MPDUs with invalid peer but A3 found in AST */
  8023. A_UINT32 invalid_peer_a3_in_ast;
  8024. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8025. A_UINT32 invalid_peer_bmc_mpdus;
  8026. /* Number of MSDUs with err attention word */
  8027. A_UINT32 rxdesc_err_att;
  8028. /* Number of MSDUs with flag of peer_idx_invalid */
  8029. A_UINT32 rxdesc_err_peer_idx_inv;
  8030. /* Number of MSDUs with flag of peer_idx_timeout */
  8031. A_UINT32 rxdesc_err_peer_idx_to;
  8032. /* Number of MSDUs with flag of overflow */
  8033. A_UINT32 rxdesc_err_ov;
  8034. /* Number of MSDUs with flag of msdu_length_err */
  8035. A_UINT32 rxdesc_err_msdu_len;
  8036. /* Number of MSDUs with flag of mpdu_length_err */
  8037. A_UINT32 rxdesc_err_mpdu_len;
  8038. /* Number of MSDUs with flag of tkip_mic_err */
  8039. A_UINT32 rxdesc_err_tkip_mic;
  8040. /* Number of MSDUs with flag of decrypt_err */
  8041. A_UINT32 rxdesc_err_decrypt;
  8042. /* Number of MSDUs with flag of fcs_err */
  8043. A_UINT32 rxdesc_err_fcs;
  8044. /* Number of Unicast (bc_mc bit is not set in attention word)
  8045. * frames with invalid peer handler
  8046. */
  8047. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8048. /* Number of unicast frame directly (direct bit is set in attention word)
  8049. * to DUT with invalid peer handler
  8050. */
  8051. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8052. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8053. * frames with invalid peer handler
  8054. */
  8055. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8056. /* Number of MSDUs dropped due to no first MSDU flag */
  8057. A_UINT32 rxdesc_no_1st_msdu;
  8058. /* Number of MSDUs droped due to ring overflow */
  8059. A_UINT32 msdu_drop_ring_ov;
  8060. /* Number of MSDUs dropped due to FC mismatch */
  8061. A_UINT32 msdu_drop_fc_mismatch;
  8062. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8063. A_UINT32 msdu_drop_mgmt_remote_ring;
  8064. /* Number of MSDUs dropped due to errors not reported in attention word */
  8065. A_UINT32 msdu_drop_misc;
  8066. /* Number of MSDUs go to offload before reorder */
  8067. A_UINT32 offload_msdu_wal;
  8068. /* Number of data frame dropped by offload after reorder */
  8069. A_UINT32 offload_msdu_reorder;
  8070. /* Number of MPDUs with sequence number in the past and within the BA window */
  8071. A_UINT32 dup_past_within_window;
  8072. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8073. A_UINT32 dup_past_outside_window;
  8074. /* Number of MSDUs with decrypt/MIC error */
  8075. A_UINT32 rxdesc_err_decrypt_mic;
  8076. /* Number of data MSDUs received on both local and remote rings */
  8077. A_UINT32 data_msdus_on_both_rings;
  8078. /* MPDUs never filled */
  8079. A_UINT32 holes_not_filled;
  8080. };
  8081. /*
  8082. * Rx Remote buffer statistics
  8083. * NB: all the fields must be defined in 4 octets size.
  8084. */
  8085. struct rx_remote_buffer_mgmt_stats {
  8086. /* Total number of MSDUs reaped for Rx processing */
  8087. A_UINT32 remote_reaped;
  8088. /* MSDUs recycled within firmware */
  8089. A_UINT32 remote_recycled;
  8090. /* MSDUs stored by Data Rx */
  8091. A_UINT32 data_rx_msdus_stored;
  8092. /* Number of HTT indications from WAL Rx MSDU */
  8093. A_UINT32 wal_rx_ind;
  8094. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8095. A_UINT32 wal_rx_ind_unconsumed;
  8096. /* Number of HTT indications from Data Rx MSDU */
  8097. A_UINT32 data_rx_ind;
  8098. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8099. A_UINT32 data_rx_ind_unconsumed;
  8100. /* Number of HTT indications from ATHBUF */
  8101. A_UINT32 athbuf_rx_ind;
  8102. /* Number of remote buffers requested for refill */
  8103. A_UINT32 refill_buf_req;
  8104. /* Number of remote buffers filled by the host */
  8105. A_UINT32 refill_buf_rsp;
  8106. /* Number of times MAC hw_index = f/w write_index */
  8107. A_INT32 mac_no_bufs;
  8108. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8109. A_INT32 fw_indices_equal;
  8110. /* Number of times f/w finds no buffers to post */
  8111. A_INT32 host_no_bufs;
  8112. };
  8113. /*
  8114. * TXBF MU/SU packets and NDPA statistics
  8115. * NB: all the fields must be defined in 4 octets size.
  8116. */
  8117. struct rx_txbf_musu_ndpa_pkts_stats {
  8118. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8119. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8120. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8121. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8122. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8123. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8124. };
  8125. /*
  8126. * htt_dbg_stats_status -
  8127. * present - The requested stats have been delivered in full.
  8128. * This indicates that either the stats information was contained
  8129. * in its entirety within this message, or else this message
  8130. * completes the delivery of the requested stats info that was
  8131. * partially delivered through earlier STATS_CONF messages.
  8132. * partial - The requested stats have been delivered in part.
  8133. * One or more subsequent STATS_CONF messages with the same
  8134. * cookie value will be sent to deliver the remainder of the
  8135. * information.
  8136. * error - The requested stats could not be delivered, for example due
  8137. * to a shortage of memory to construct a message holding the
  8138. * requested stats.
  8139. * invalid - The requested stat type is either not recognized, or the
  8140. * target is configured to not gather the stats type in question.
  8141. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8142. * series_done - This special value indicates that no further stats info
  8143. * elements are present within a series of stats info elems
  8144. * (within a stats upload confirmation message).
  8145. */
  8146. enum htt_dbg_stats_status {
  8147. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8148. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8149. HTT_DBG_STATS_STATUS_ERROR = 2,
  8150. HTT_DBG_STATS_STATUS_INVALID = 3,
  8151. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8152. };
  8153. /**
  8154. * @brief target -> host statistics upload
  8155. *
  8156. * @details
  8157. * The following field definitions describe the format of the HTT target
  8158. * to host stats upload confirmation message.
  8159. * The message contains a cookie echoed from the HTT host->target stats
  8160. * upload request, which identifies which request the confirmation is
  8161. * for, and a series of tag-length-value stats information elements.
  8162. * The tag-length header for each stats info element also includes a
  8163. * status field, to indicate whether the request for the stat type in
  8164. * question was fully met, partially met, unable to be met, or invalid
  8165. * (if the stat type in question is disabled in the target).
  8166. * A special value of all 1's in this status field is used to indicate
  8167. * the end of the series of stats info elements.
  8168. *
  8169. *
  8170. * |31 16|15 8|7 5|4 0|
  8171. * |------------------------------------------------------------|
  8172. * | reserved | msg type |
  8173. * |------------------------------------------------------------|
  8174. * | cookie LSBs |
  8175. * |------------------------------------------------------------|
  8176. * | cookie MSBs |
  8177. * |------------------------------------------------------------|
  8178. * | stats entry length | reserved | S |stat type|
  8179. * |------------------------------------------------------------|
  8180. * | |
  8181. * | type-specific stats info |
  8182. * | |
  8183. * |------------------------------------------------------------|
  8184. * | stats entry length | reserved | S |stat type|
  8185. * |------------------------------------------------------------|
  8186. * | |
  8187. * | type-specific stats info |
  8188. * | |
  8189. * |------------------------------------------------------------|
  8190. * | n/a | reserved | 111 | n/a |
  8191. * |------------------------------------------------------------|
  8192. * Header fields:
  8193. * - MSG_TYPE
  8194. * Bits 7:0
  8195. * Purpose: identifies this is a statistics upload confirmation message
  8196. * Value: 0x9
  8197. * - COOKIE_LSBS
  8198. * Bits 31:0
  8199. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8200. * message with its preceding host->target stats request message.
  8201. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8202. * - COOKIE_MSBS
  8203. * Bits 31:0
  8204. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8205. * message with its preceding host->target stats request message.
  8206. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8207. *
  8208. * Stats Information Element tag-length header fields:
  8209. * - STAT_TYPE
  8210. * Bits 4:0
  8211. * Purpose: identifies the type of statistics info held in the
  8212. * following information element
  8213. * Value: htt_dbg_stats_type
  8214. * - STATUS
  8215. * Bits 7:5
  8216. * Purpose: indicate whether the requested stats are present
  8217. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8218. * the completion of the stats entry series
  8219. * - LENGTH
  8220. * Bits 31:16
  8221. * Purpose: indicate the stats information size
  8222. * Value: This field specifies the number of bytes of stats information
  8223. * that follows the element tag-length header.
  8224. * It is expected but not required that this length is a multiple of
  8225. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8226. * subsequent stats entry header will begin on a 4-byte aligned
  8227. * boundary.
  8228. */
  8229. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8230. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8231. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8232. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8233. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8234. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8235. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8236. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8237. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8238. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8239. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8240. do { \
  8241. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8242. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8243. } while (0)
  8244. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8245. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8246. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8247. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8248. do { \
  8249. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8250. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8251. } while (0)
  8252. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8253. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8254. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8255. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8256. do { \
  8257. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8258. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8259. } while (0)
  8260. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8261. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8262. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8263. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8264. #define HTT_MAX_AGGR 64
  8265. #define HTT_HL_MAX_AGGR 18
  8266. /**
  8267. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8268. *
  8269. * @details
  8270. * The following field definitions describe the format of the HTT host
  8271. * to target frag_desc/msdu_ext bank configuration message.
  8272. * The message contains the based address and the min and max id of the
  8273. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8274. * MSDU_EXT/FRAG_DESC.
  8275. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8276. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8277. * the hardware does the mapping/translation.
  8278. *
  8279. * Total banks that can be configured is configured to 16.
  8280. *
  8281. * This should be called before any TX has be initiated by the HTT
  8282. *
  8283. * |31 16|15 8|7 5|4 0|
  8284. * |------------------------------------------------------------|
  8285. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8286. * |------------------------------------------------------------|
  8287. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8288. #if HTT_PADDR64
  8289. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8290. #endif
  8291. * |------------------------------------------------------------|
  8292. * | ... |
  8293. * |------------------------------------------------------------|
  8294. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8295. #if HTT_PADDR64
  8296. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8297. #endif
  8298. * |------------------------------------------------------------|
  8299. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8300. * |------------------------------------------------------------|
  8301. * | ... |
  8302. * |------------------------------------------------------------|
  8303. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8304. * |------------------------------------------------------------|
  8305. * Header fields:
  8306. * - MSG_TYPE
  8307. * Bits 7:0
  8308. * Value: 0x6
  8309. * for systems with 64-bit format for bus addresses:
  8310. * - BANKx_BASE_ADDRESS_LO
  8311. * Bits 31:0
  8312. * Purpose: Provide a mechanism to specify the base address of the
  8313. * MSDU_EXT bank physical/bus address.
  8314. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8315. * - BANKx_BASE_ADDRESS_HI
  8316. * Bits 31:0
  8317. * Purpose: Provide a mechanism to specify the base address of the
  8318. * MSDU_EXT bank physical/bus address.
  8319. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8320. * for systems with 32-bit format for bus addresses:
  8321. * - BANKx_BASE_ADDRESS
  8322. * Bits 31:0
  8323. * Purpose: Provide a mechanism to specify the base address of the
  8324. * MSDU_EXT bank physical/bus address.
  8325. * Value: MSDU_EXT bank physical / bus address
  8326. * - BANKx_MIN_ID
  8327. * Bits 15:0
  8328. * Purpose: Provide a mechanism to specify the min index that needs to
  8329. * mapped.
  8330. * - BANKx_MAX_ID
  8331. * Bits 31:16
  8332. * Purpose: Provide a mechanism to specify the max index that needs to
  8333. * mapped.
  8334. *
  8335. */
  8336. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8337. * safe value.
  8338. * @note MAX supported banks is 16.
  8339. */
  8340. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8341. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8342. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8343. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8344. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8345. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8346. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8347. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  8348. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  8349. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  8350. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  8351. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  8352. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  8353. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  8354. do { \
  8355. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  8356. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  8357. } while (0)
  8358. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  8359. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  8360. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  8361. do { \
  8362. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  8363. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  8364. } while (0)
  8365. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  8366. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  8367. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  8368. do { \
  8369. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  8370. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  8371. } while (0)
  8372. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  8373. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  8374. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  8375. do { \
  8376. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  8377. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  8378. } while (0)
  8379. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  8380. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  8381. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  8382. do { \
  8383. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  8384. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  8385. } while (0)
  8386. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  8387. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  8388. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  8389. do { \
  8390. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  8391. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  8392. } while (0)
  8393. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  8394. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  8395. /*
  8396. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  8397. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  8398. * addresses are stored in a XXX-bit field.
  8399. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  8400. * htt_tx_frag_desc64_bank_cfg_t structs.
  8401. */
  8402. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  8403. _paddr_bits_, \
  8404. _paddr__bank_base_address_) \
  8405. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  8406. /** word 0 \
  8407. * msg_type: 8, \
  8408. * pdev_id: 2, \
  8409. * swap: 1, \
  8410. * reserved0: 5, \
  8411. * num_banks: 8, \
  8412. * desc_size: 8; \
  8413. */ \
  8414. A_UINT32 word0; \
  8415. /* \
  8416. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  8417. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  8418. * the second A_UINT32). \
  8419. */ \
  8420. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8421. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  8422. } POSTPACK
  8423. /* define htt_tx_frag_desc32_bank_cfg_t */
  8424. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  8425. /* define htt_tx_frag_desc64_bank_cfg_t */
  8426. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  8427. /*
  8428. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  8429. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  8430. */
  8431. #if HTT_PADDR64
  8432. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  8433. #else
  8434. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  8435. #endif
  8436. /**
  8437. * @brief target -> host HTT TX Credit total count update message definition
  8438. *
  8439. *|31 16|15|14 9| 8 |7 0 |
  8440. *|---------------------+--+----------+-------+----------|
  8441. *|cur htt credit delta | Q| reserved | sign | msg type |
  8442. *|------------------------------------------------------|
  8443. *
  8444. * Header fields:
  8445. * - MSG_TYPE
  8446. * Bits 7:0
  8447. * Purpose: identifies this as a htt tx credit delta update message
  8448. * Value: 0xe
  8449. * - SIGN
  8450. * Bits 8
  8451. * identifies whether credit delta is positive or negative
  8452. * Value:
  8453. * - 0x0: credit delta is positive, rebalance in some buffers
  8454. * - 0x1: credit delta is negative, rebalance out some buffers
  8455. * - reserved
  8456. * Bits 14:9
  8457. * Value: 0x0
  8458. * - TXQ_GRP
  8459. * Bit 15
  8460. * Purpose: indicates whether any tx queue group information elements
  8461. * are appended to the tx credit update message
  8462. * Value: 0 -> no tx queue group information element is present
  8463. * 1 -> a tx queue group information element immediately follows
  8464. * - DELTA_COUNT
  8465. * Bits 31:16
  8466. * Purpose: Specify current htt credit delta absolute count
  8467. */
  8468. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  8469. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  8470. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  8471. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  8472. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  8473. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  8474. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  8475. do { \
  8476. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  8477. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  8478. } while (0)
  8479. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  8480. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  8481. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  8482. do { \
  8483. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  8484. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  8485. } while (0)
  8486. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  8487. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  8488. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  8489. do { \
  8490. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  8491. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  8492. } while (0)
  8493. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  8494. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  8495. #define HTT_TX_CREDIT_MSG_BYTES 4
  8496. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  8497. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  8498. /**
  8499. * @brief HTT WDI_IPA Operation Response Message
  8500. *
  8501. * @details
  8502. * HTT WDI_IPA Operation Response message is sent by target
  8503. * to host confirming suspend or resume operation.
  8504. * |31 24|23 16|15 8|7 0|
  8505. * |----------------+----------------+----------------+----------------|
  8506. * | op_code | Rsvd | msg_type |
  8507. * |-------------------------------------------------------------------|
  8508. * | Rsvd | Response len |
  8509. * |-------------------------------------------------------------------|
  8510. * | |
  8511. * | Response-type specific info |
  8512. * | |
  8513. * | |
  8514. * |-------------------------------------------------------------------|
  8515. * Header fields:
  8516. * - MSG_TYPE
  8517. * Bits 7:0
  8518. * Purpose: Identifies this as WDI_IPA Operation Response message
  8519. * value: = 0x13
  8520. * - OP_CODE
  8521. * Bits 31:16
  8522. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  8523. * value: = enum htt_wdi_ipa_op_code
  8524. * - RSP_LEN
  8525. * Bits 16:0
  8526. * Purpose: length for the response-type specific info
  8527. * value: = length in bytes for response-type specific info
  8528. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  8529. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  8530. */
  8531. PREPACK struct htt_wdi_ipa_op_response_t
  8532. {
  8533. /* DWORD 0: flags and meta-data */
  8534. A_UINT32
  8535. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8536. reserved1: 8,
  8537. op_code: 16;
  8538. A_UINT32
  8539. rsp_len: 16,
  8540. reserved2: 16;
  8541. } POSTPACK;
  8542. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  8543. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  8544. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  8545. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  8546. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  8547. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  8548. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  8549. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  8550. do { \
  8551. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  8552. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  8553. } while (0)
  8554. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  8555. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  8556. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  8557. do { \
  8558. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  8559. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  8560. } while (0)
  8561. enum htt_phy_mode {
  8562. htt_phy_mode_11a = 0,
  8563. htt_phy_mode_11g = 1,
  8564. htt_phy_mode_11b = 2,
  8565. htt_phy_mode_11g_only = 3,
  8566. htt_phy_mode_11na_ht20 = 4,
  8567. htt_phy_mode_11ng_ht20 = 5,
  8568. htt_phy_mode_11na_ht40 = 6,
  8569. htt_phy_mode_11ng_ht40 = 7,
  8570. htt_phy_mode_11ac_vht20 = 8,
  8571. htt_phy_mode_11ac_vht40 = 9,
  8572. htt_phy_mode_11ac_vht80 = 10,
  8573. htt_phy_mode_11ac_vht20_2g = 11,
  8574. htt_phy_mode_11ac_vht40_2g = 12,
  8575. htt_phy_mode_11ac_vht80_2g = 13,
  8576. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  8577. htt_phy_mode_11ac_vht160 = 15,
  8578. htt_phy_mode_max,
  8579. };
  8580. /**
  8581. * @brief target -> host HTT channel change indication
  8582. * @details
  8583. * Specify when a channel change occurs.
  8584. * This allows the host to precisely determine which rx frames arrived
  8585. * on the old channel and which rx frames arrived on the new channel.
  8586. *
  8587. *|31 |7 0 |
  8588. *|-------------------------------------------+----------|
  8589. *| reserved | msg type |
  8590. *|------------------------------------------------------|
  8591. *| primary_chan_center_freq_mhz |
  8592. *|------------------------------------------------------|
  8593. *| contiguous_chan1_center_freq_mhz |
  8594. *|------------------------------------------------------|
  8595. *| contiguous_chan2_center_freq_mhz |
  8596. *|------------------------------------------------------|
  8597. *| phy_mode |
  8598. *|------------------------------------------------------|
  8599. *
  8600. * Header fields:
  8601. * - MSG_TYPE
  8602. * Bits 7:0
  8603. * Purpose: identifies this as a htt channel change indication message
  8604. * Value: 0x15
  8605. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  8606. * Bits 31:0
  8607. * Purpose: identify the (center of the) new 20 MHz primary channel
  8608. * Value: center frequency of the 20 MHz primary channel, in MHz units
  8609. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  8610. * Bits 31:0
  8611. * Purpose: identify the (center of the) contiguous frequency range
  8612. * comprising the new channel.
  8613. * For example, if the new channel is a 80 MHz channel extending
  8614. * 60 MHz beyond the primary channel, this field would be 30 larger
  8615. * than the primary channel center frequency field.
  8616. * Value: center frequency of the contiguous frequency range comprising
  8617. * the full channel in MHz units
  8618. * (80+80 channels also use the CONTIG_CHAN2 field)
  8619. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  8620. * Bits 31:0
  8621. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  8622. * within a VHT 80+80 channel.
  8623. * This field is only relevant for VHT 80+80 channels.
  8624. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  8625. * channel (arbitrary value for cases besides VHT 80+80)
  8626. * - PHY_MODE
  8627. * Bits 31:0
  8628. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  8629. * and band
  8630. * Value: htt_phy_mode enum value
  8631. */
  8632. PREPACK struct htt_chan_change_t
  8633. {
  8634. /* DWORD 0: flags and meta-data */
  8635. A_UINT32
  8636. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  8637. reserved1: 24;
  8638. A_UINT32 primary_chan_center_freq_mhz;
  8639. A_UINT32 contig_chan1_center_freq_mhz;
  8640. A_UINT32 contig_chan2_center_freq_mhz;
  8641. A_UINT32 phy_mode;
  8642. } POSTPACK;
  8643. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  8644. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  8645. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  8646. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  8647. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  8648. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  8649. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  8650. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  8651. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  8652. do { \
  8653. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  8654. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  8655. } while (0)
  8656. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  8657. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  8658. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  8659. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  8660. do { \
  8661. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  8662. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  8663. } while (0)
  8664. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  8665. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  8666. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  8667. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  8668. do { \
  8669. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  8670. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8671. } while (0)
  8672. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8673. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8674. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8675. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8676. do { \
  8677. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  8678. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8679. } while (0)
  8680. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8681. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8682. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8683. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8684. /**
  8685. * @brief rx offload packet error message
  8686. *
  8687. * @details
  8688. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8689. * of target payload like mic err.
  8690. *
  8691. * |31 24|23 16|15 8|7 0|
  8692. * |----------------+----------------+----------------+----------------|
  8693. * | tid | vdev_id | msg_sub_type | msg_type |
  8694. * |-------------------------------------------------------------------|
  8695. * : (sub-type dependent content) :
  8696. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8697. * Header fields:
  8698. * - msg_type
  8699. * Bits 7:0
  8700. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8701. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8702. * - msg_sub_type
  8703. * Bits 15:8
  8704. * Purpose: Identifies which type of rx error is reported by this message
  8705. * value: htt_rx_ofld_pkt_err_type
  8706. * - vdev_id
  8707. * Bits 23:16
  8708. * Purpose: Identifies which vdev received the erroneous rx frame
  8709. * value:
  8710. * - tid
  8711. * Bits 31:24
  8712. * Purpose: Identifies the traffic type of the rx frame
  8713. * value:
  8714. *
  8715. * - The payload fields used if the sub-type == MIC error are shown below.
  8716. * Note - MIC err is per MSDU, while PN is per MPDU.
  8717. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8718. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8719. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8720. * instead of sending separate HTT messages for each wrong MSDU within
  8721. * the MPDU.
  8722. *
  8723. * |31 24|23 16|15 8|7 0|
  8724. * |----------------+----------------+----------------+----------------|
  8725. * | Rsvd | key_id | peer_id |
  8726. * |-------------------------------------------------------------------|
  8727. * | receiver MAC addr 31:0 |
  8728. * |-------------------------------------------------------------------|
  8729. * | Rsvd | receiver MAC addr 47:32 |
  8730. * |-------------------------------------------------------------------|
  8731. * | transmitter MAC addr 31:0 |
  8732. * |-------------------------------------------------------------------|
  8733. * | Rsvd | transmitter MAC addr 47:32 |
  8734. * |-------------------------------------------------------------------|
  8735. * | PN 31:0 |
  8736. * |-------------------------------------------------------------------|
  8737. * | Rsvd | PN 47:32 |
  8738. * |-------------------------------------------------------------------|
  8739. * - peer_id
  8740. * Bits 15:0
  8741. * Purpose: identifies which peer is frame is from
  8742. * value:
  8743. * - key_id
  8744. * Bits 23:16
  8745. * Purpose: identifies key_id of rx frame
  8746. * value:
  8747. * - RA_31_0 (receiver MAC addr 31:0)
  8748. * Bits 31:0
  8749. * Purpose: identifies by MAC address which vdev received the frame
  8750. * value: MAC address lower 4 bytes
  8751. * - RA_47_32 (receiver MAC addr 47:32)
  8752. * Bits 15:0
  8753. * Purpose: identifies by MAC address which vdev received the frame
  8754. * value: MAC address upper 2 bytes
  8755. * - TA_31_0 (transmitter MAC addr 31:0)
  8756. * Bits 31:0
  8757. * Purpose: identifies by MAC address which peer transmitted the frame
  8758. * value: MAC address lower 4 bytes
  8759. * - TA_47_32 (transmitter MAC addr 47:32)
  8760. * Bits 15:0
  8761. * Purpose: identifies by MAC address which peer transmitted the frame
  8762. * value: MAC address upper 2 bytes
  8763. * - PN_31_0
  8764. * Bits 31:0
  8765. * Purpose: Identifies pn of rx frame
  8766. * value: PN lower 4 bytes
  8767. * - PN_47_32
  8768. * Bits 15:0
  8769. * Purpose: Identifies pn of rx frame
  8770. * value:
  8771. * TKIP or CCMP: PN upper 2 bytes
  8772. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8773. */
  8774. enum htt_rx_ofld_pkt_err_type {
  8775. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8776. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8777. };
  8778. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8779. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8780. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8781. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8782. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8783. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8784. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8785. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8786. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8787. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8788. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8789. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8790. do { \
  8791. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8792. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8793. } while (0)
  8794. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8795. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8796. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8797. do { \
  8798. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8799. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8800. } while (0)
  8801. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8802. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8803. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8804. do { \
  8805. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8806. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8807. } while (0)
  8808. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8809. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8810. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8811. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8812. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8813. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8814. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8815. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8816. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8817. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8818. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8819. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8820. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8821. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8822. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8823. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8824. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8825. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8826. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8827. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8828. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8829. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8830. do { \
  8831. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8832. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8833. } while (0)
  8834. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8835. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8836. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8837. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8838. do { \
  8839. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8840. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8841. } while (0)
  8842. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8843. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8844. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8845. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8846. do { \
  8847. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8848. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8849. } while (0)
  8850. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8851. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8852. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8853. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8854. do { \
  8855. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8856. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8857. } while (0)
  8858. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8859. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8860. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8861. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8862. do { \
  8863. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8864. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8865. } while (0)
  8866. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8867. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8868. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8869. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8870. do { \
  8871. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8872. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8873. } while (0)
  8874. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8875. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8876. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8877. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8878. do { \
  8879. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8880. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8881. } while (0)
  8882. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8883. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8884. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8885. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8886. do { \
  8887. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8888. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8889. } while (0)
  8890. /**
  8891. * @brief peer rate report message
  8892. *
  8893. * @details
  8894. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8895. * justified rate of all the peers.
  8896. *
  8897. * |31 24|23 16|15 8|7 0|
  8898. * |----------------+----------------+----------------+----------------|
  8899. * | peer_count | | msg_type |
  8900. * |-------------------------------------------------------------------|
  8901. * : Payload (variant number of peer rate report) :
  8902. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8903. * Header fields:
  8904. * - msg_type
  8905. * Bits 7:0
  8906. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8907. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8908. * - reserved
  8909. * Bits 15:8
  8910. * Purpose:
  8911. * value:
  8912. * - peer_count
  8913. * Bits 31:16
  8914. * Purpose: Specify how many peer rate report elements are present in the payload.
  8915. * value:
  8916. *
  8917. * Payload:
  8918. * There are variant number of peer rate report follow the first 32 bits.
  8919. * The peer rate report is defined as follows.
  8920. *
  8921. * |31 20|19 16|15 0|
  8922. * |-----------------------+---------+---------------------------------|-
  8923. * | reserved | phy | peer_id | \
  8924. * |-------------------------------------------------------------------| -> report #0
  8925. * | rate | /
  8926. * |-----------------------+---------+---------------------------------|-
  8927. * | reserved | phy | peer_id | \
  8928. * |-------------------------------------------------------------------| -> report #1
  8929. * | rate | /
  8930. * |-----------------------+---------+---------------------------------|-
  8931. * | reserved | phy | peer_id | \
  8932. * |-------------------------------------------------------------------| -> report #2
  8933. * | rate | /
  8934. * |-------------------------------------------------------------------|-
  8935. * : :
  8936. * : :
  8937. * : :
  8938. * :-------------------------------------------------------------------:
  8939. *
  8940. * - peer_id
  8941. * Bits 15:0
  8942. * Purpose: identify the peer
  8943. * value:
  8944. * - phy
  8945. * Bits 19:16
  8946. * Purpose: identify which phy is in use
  8947. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8948. * Please see enum htt_peer_report_phy_type for detail.
  8949. * - reserved
  8950. * Bits 31:20
  8951. * Purpose:
  8952. * value:
  8953. * - rate
  8954. * Bits 31:0
  8955. * Purpose: represent the justified rate of the peer specified by peer_id
  8956. * value:
  8957. */
  8958. enum htt_peer_rate_report_phy_type {
  8959. HTT_PEER_RATE_REPORT_11B = 0,
  8960. HTT_PEER_RATE_REPORT_11A_G,
  8961. HTT_PEER_RATE_REPORT_11N,
  8962. HTT_PEER_RATE_REPORT_11AC,
  8963. };
  8964. #define HTT_PEER_RATE_REPORT_SIZE 8
  8965. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8966. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8967. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8968. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8969. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8970. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8971. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8972. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8973. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8974. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8975. do { \
  8976. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8977. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8978. } while (0)
  8979. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8980. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8981. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8982. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8983. do { \
  8984. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8985. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8986. } while (0)
  8987. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8988. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8989. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8990. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8991. do { \
  8992. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8993. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8994. } while (0)
  8995. /**
  8996. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8997. *
  8998. * @details
  8999. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  9000. * a flow of descriptors.
  9001. *
  9002. * This message is in TLV format and indicates the parameters to be setup a
  9003. * flow in the host. Each entry indicates that a particular flow ID is ready to
  9004. * receive descriptors from a specified pool.
  9005. *
  9006. * The message would appear as follows:
  9007. *
  9008. * |31 24|23 16|15 8|7 0|
  9009. * |----------------+----------------+----------------+----------------|
  9010. * header | reserved | num_flows | msg_type |
  9011. * |-------------------------------------------------------------------|
  9012. * | |
  9013. * : payload :
  9014. * | |
  9015. * |-------------------------------------------------------------------|
  9016. *
  9017. * The header field is one DWORD long and is interpreted as follows:
  9018. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9019. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9020. * this message
  9021. * b'16-31 - reserved: These bits are reserved for future use
  9022. *
  9023. * Payload:
  9024. * The payload would contain multiple objects of the following structure. Each
  9025. * object represents a flow.
  9026. *
  9027. * |31 24|23 16|15 8|7 0|
  9028. * |----------------+----------------+----------------+----------------|
  9029. * header | reserved | num_flows | msg_type |
  9030. * |-------------------------------------------------------------------|
  9031. * payload0| flow_type |
  9032. * |-------------------------------------------------------------------|
  9033. * | flow_id |
  9034. * |-------------------------------------------------------------------|
  9035. * | reserved0 | flow_pool_id |
  9036. * |-------------------------------------------------------------------|
  9037. * | reserved1 | flow_pool_size |
  9038. * |-------------------------------------------------------------------|
  9039. * | reserved2 |
  9040. * |-------------------------------------------------------------------|
  9041. * payload1| flow_type |
  9042. * |-------------------------------------------------------------------|
  9043. * | flow_id |
  9044. * |-------------------------------------------------------------------|
  9045. * | reserved0 | flow_pool_id |
  9046. * |-------------------------------------------------------------------|
  9047. * | reserved1 | flow_pool_size |
  9048. * |-------------------------------------------------------------------|
  9049. * | reserved2 |
  9050. * |-------------------------------------------------------------------|
  9051. * | . |
  9052. * | . |
  9053. * | . |
  9054. * |-------------------------------------------------------------------|
  9055. *
  9056. * Each payload is 5 DWORDS long and is interpreted as follows:
  9057. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9058. * this flow is associated. It can be VDEV, peer,
  9059. * or tid (AC). Based on enum htt_flow_type.
  9060. *
  9061. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9062. * object. For flow_type vdev it is set to the
  9063. * vdevid, for peer it is peerid and for tid, it is
  9064. * tid_num.
  9065. *
  9066. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9067. * in the host for this flow
  9068. * b'16:31 - reserved0: This field in reserved for the future. In case
  9069. * we have a hierarchical implementation (HCM) of
  9070. * pools, it can be used to indicate the ID of the
  9071. * parent-pool.
  9072. *
  9073. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9074. * Descriptors for this flow will be
  9075. * allocated from this pool in the host.
  9076. * b'16:31 - reserved1: This field in reserved for the future. In case
  9077. * we have a hierarchical implementation of pools,
  9078. * it can be used to indicate the max number of
  9079. * descriptors in the pool. The b'0:15 can be used
  9080. * to indicate min number of descriptors in the
  9081. * HCM scheme.
  9082. *
  9083. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9084. * we have a hierarchical implementation of pools,
  9085. * b'0:15 can be used to indicate the
  9086. * priority-based borrowing (PBB) threshold of
  9087. * the flow's pool. The b'16:31 are still left
  9088. * reserved.
  9089. */
  9090. enum htt_flow_type {
  9091. FLOW_TYPE_VDEV = 0,
  9092. /* Insert new flow types above this line */
  9093. };
  9094. PREPACK struct htt_flow_pool_map_payload_t {
  9095. A_UINT32 flow_type;
  9096. A_UINT32 flow_id;
  9097. A_UINT32 flow_pool_id:16,
  9098. reserved0:16;
  9099. A_UINT32 flow_pool_size:16,
  9100. reserved1:16;
  9101. A_UINT32 reserved2;
  9102. } POSTPACK;
  9103. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9104. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9105. (sizeof(struct htt_flow_pool_map_payload_t))
  9106. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9107. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9108. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9109. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9110. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9111. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9112. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9113. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9114. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9115. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9116. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9117. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9118. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9119. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9120. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9121. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9122. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9123. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9124. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9125. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9126. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9127. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9128. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9129. do { \
  9130. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9131. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9132. } while (0)
  9133. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9136. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9137. } while (0)
  9138. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9139. do { \
  9140. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9141. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9142. } while (0)
  9143. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9144. do { \
  9145. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9146. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9147. } while (0)
  9148. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9149. do { \
  9150. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9151. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9152. } while (0)
  9153. /**
  9154. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9155. *
  9156. * @details
  9157. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9158. * down a flow of descriptors.
  9159. * This message indicates that for the flow (whose ID is provided) is wanting
  9160. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9161. * pool of descriptors from where descriptors are being allocated for this
  9162. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9163. * be unmapped by the host.
  9164. *
  9165. * The message would appear as follows:
  9166. *
  9167. * |31 24|23 16|15 8|7 0|
  9168. * |----------------+----------------+----------------+----------------|
  9169. * | reserved0 | msg_type |
  9170. * |-------------------------------------------------------------------|
  9171. * | flow_type |
  9172. * |-------------------------------------------------------------------|
  9173. * | flow_id |
  9174. * |-------------------------------------------------------------------|
  9175. * | reserved1 | flow_pool_id |
  9176. * |-------------------------------------------------------------------|
  9177. *
  9178. * The message is interpreted as follows:
  9179. * dword0 - b'0:7 - msg_type: This will be set to
  9180. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9181. * b'8:31 - reserved0: Reserved for future use
  9182. *
  9183. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9184. * this flow is associated. It can be VDEV, peer,
  9185. * or tid (AC). Based on enum htt_flow_type.
  9186. *
  9187. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9188. * object. For flow_type vdev it is set to the
  9189. * vdevid, for peer it is peerid and for tid, it is
  9190. * tid_num.
  9191. *
  9192. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9193. * used in the host for this flow
  9194. * b'16:31 - reserved0: This field in reserved for the future.
  9195. *
  9196. */
  9197. PREPACK struct htt_flow_pool_unmap_t {
  9198. A_UINT32 msg_type:8,
  9199. reserved0:24;
  9200. A_UINT32 flow_type;
  9201. A_UINT32 flow_id;
  9202. A_UINT32 flow_pool_id:16,
  9203. reserved1:16;
  9204. } POSTPACK;
  9205. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9206. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9207. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9208. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9209. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9210. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9211. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9212. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9213. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9214. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9215. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9216. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9217. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9218. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9219. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9220. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9221. do { \
  9222. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9223. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9224. } while (0)
  9225. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9226. do { \
  9227. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9228. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9229. } while (0)
  9230. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9231. do { \
  9232. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9233. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9234. } while (0)
  9235. /**
  9236. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9237. *
  9238. * @details
  9239. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9240. * SRNG ring setup is done
  9241. *
  9242. * This message indicates whether the last setup operation is successful.
  9243. * It will be sent to host when host set respose_required bit in
  9244. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9245. * The message would appear as follows:
  9246. *
  9247. * |31 24|23 16|15 8|7 0|
  9248. * |--------------- +----------------+----------------+----------------|
  9249. * | setup_status | ring_id | pdev_id | msg_type |
  9250. * |-------------------------------------------------------------------|
  9251. *
  9252. * The message is interpreted as follows:
  9253. * dword0 - b'0:7 - msg_type: This will be set to
  9254. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9255. * b'8:15 - pdev_id:
  9256. * 0 (for rings at SOC/UMAC level),
  9257. * 1/2/3 mac id (for rings at LMAC level)
  9258. * b'16:23 - ring_id: Identify the ring which is set up
  9259. * More details can be got from enum htt_srng_ring_id
  9260. * b'24:31 - setup_status: Indicate status of setup operation
  9261. * Refer to htt_ring_setup_status
  9262. */
  9263. PREPACK struct htt_sring_setup_done_t {
  9264. A_UINT32 msg_type: 8,
  9265. pdev_id: 8,
  9266. ring_id: 8,
  9267. setup_status: 8;
  9268. } POSTPACK;
  9269. enum htt_ring_setup_status {
  9270. htt_ring_setup_status_ok = 0,
  9271. htt_ring_setup_status_error,
  9272. };
  9273. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9274. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9275. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9276. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9277. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9278. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9279. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9280. do { \
  9281. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9282. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9283. } while (0)
  9284. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9285. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9286. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9287. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9288. HTT_SRING_SETUP_DONE_RING_ID_S)
  9289. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9290. do { \
  9291. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9292. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9293. } while (0)
  9294. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9295. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9296. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9297. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9298. HTT_SRING_SETUP_DONE_STATUS_S)
  9299. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9300. do { \
  9301. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9302. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9303. } while (0)
  9304. /**
  9305. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9306. *
  9307. * @details
  9308. * HTT TX map flow entry with tqm flow pointer
  9309. * Sent from firmware to host to add tqm flow pointer in corresponding
  9310. * flow search entry. Flow metadata is replayed back to host as part of this
  9311. * struct to enable host to find the specific flow search entry
  9312. *
  9313. * The message would appear as follows:
  9314. *
  9315. * |31 28|27 18|17 14|13 8|7 0|
  9316. * |-------+------------------------------------------+----------------|
  9317. * | rsvd0 | fse_hsh_idx | msg_type |
  9318. * |-------------------------------------------------------------------|
  9319. * | rsvd1 | tid | peer_id |
  9320. * |-------------------------------------------------------------------|
  9321. * | tqm_flow_pntr_lo |
  9322. * |-------------------------------------------------------------------|
  9323. * | tqm_flow_pntr_hi |
  9324. * |-------------------------------------------------------------------|
  9325. * | fse_meta_data |
  9326. * |-------------------------------------------------------------------|
  9327. *
  9328. * The message is interpreted as follows:
  9329. *
  9330. * dword0 - b'0:7 - msg_type: This will be set to
  9331. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9332. *
  9333. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9334. * for this flow entry
  9335. *
  9336. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9337. *
  9338. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9339. *
  9340. * dword1 - b'14:17 - tid
  9341. *
  9342. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9343. *
  9344. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9345. *
  9346. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9347. *
  9348. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  9349. * given by host
  9350. */
  9351. PREPACK struct htt_tx_map_flow_info {
  9352. A_UINT32
  9353. msg_type: 8,
  9354. fse_hsh_idx: 20,
  9355. rsvd0: 4;
  9356. A_UINT32
  9357. peer_id: 14,
  9358. tid: 4,
  9359. rsvd1: 14;
  9360. A_UINT32 tqm_flow_pntr_lo;
  9361. A_UINT32 tqm_flow_pntr_hi;
  9362. struct htt_tx_flow_metadata fse_meta_data;
  9363. } POSTPACK;
  9364. /* DWORD 0 */
  9365. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  9366. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  9367. /* DWORD 1 */
  9368. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  9369. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  9370. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  9371. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  9372. /* DWORD 0 */
  9373. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  9374. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  9375. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  9376. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  9377. do { \
  9378. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  9379. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  9380. } while (0)
  9381. /* DWORD 1 */
  9382. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  9383. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  9384. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  9385. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  9386. do { \
  9387. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  9388. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  9389. } while (0)
  9390. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  9391. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  9392. HTT_TX_MAP_FLOW_INFO_TID_S)
  9393. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  9394. do { \
  9395. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  9396. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  9397. } while (0)
  9398. /*
  9399. * htt_dbg_ext_stats_status -
  9400. * present - The requested stats have been delivered in full.
  9401. * This indicates that either the stats information was contained
  9402. * in its entirety within this message, or else this message
  9403. * completes the delivery of the requested stats info that was
  9404. * partially delivered through earlier STATS_CONF messages.
  9405. * partial - The requested stats have been delivered in part.
  9406. * One or more subsequent STATS_CONF messages with the same
  9407. * cookie value will be sent to deliver the remainder of the
  9408. * information.
  9409. * error - The requested stats could not be delivered, for example due
  9410. * to a shortage of memory to construct a message holding the
  9411. * requested stats.
  9412. * invalid - The requested stat type is either not recognized, or the
  9413. * target is configured to not gather the stats type in question.
  9414. */
  9415. enum htt_dbg_ext_stats_status {
  9416. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  9417. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  9418. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  9419. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  9420. };
  9421. /**
  9422. * @brief target -> host ppdu stats upload
  9423. *
  9424. * @details
  9425. * The following field definitions describe the format of the HTT target
  9426. * to host ppdu stats indication message.
  9427. *
  9428. *
  9429. * |31 16|15 12|11 10|9 8|7 0 |
  9430. * |----------------------------------------------------------------------|
  9431. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  9432. * |----------------------------------------------------------------------|
  9433. * | ppdu_id |
  9434. * |----------------------------------------------------------------------|
  9435. * | Timestamp in us |
  9436. * |----------------------------------------------------------------------|
  9437. * | reserved |
  9438. * |----------------------------------------------------------------------|
  9439. * | type-specific stats info |
  9440. * | (see htt_ppdu_stats.h) |
  9441. * |----------------------------------------------------------------------|
  9442. * Header fields:
  9443. * - MSG_TYPE
  9444. * Bits 7:0
  9445. * Purpose: Identifies this is a PPDU STATS indication
  9446. * message.
  9447. * Value: 0x1d
  9448. * - mac_id
  9449. * Bits 9:8
  9450. * Purpose: mac_id of this ppdu_id
  9451. * Value: 0-3
  9452. * - pdev_id
  9453. * Bits 11:10
  9454. * Purpose: pdev_id of this ppdu_id
  9455. * Value: 0-3
  9456. * 0 (for rings at SOC level),
  9457. * 1/2/3 PDEV -> 0/1/2
  9458. * - payload_size
  9459. * Bits 31:16
  9460. * Purpose: total tlv size
  9461. * Value: payload_size in bytes
  9462. */
  9463. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  9464. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  9465. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  9466. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  9467. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  9468. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  9469. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  9470. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  9471. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  9472. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  9473. do { \
  9474. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  9475. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  9476. } while (0)
  9477. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  9478. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  9479. HTT_T2H_PPDU_STATS_MAC_ID_S)
  9480. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  9481. do { \
  9482. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  9483. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  9484. } while (0)
  9485. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  9486. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  9487. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  9488. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  9489. do { \
  9490. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  9491. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  9492. } while (0)
  9493. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  9494. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  9495. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  9496. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  9497. do { \
  9498. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  9499. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  9500. } while (0)
  9501. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  9502. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  9503. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  9504. /* htt_t2h_ppdu_stats_ind_hdr_t
  9505. * This struct contains the fields within the header of the
  9506. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  9507. * stats info.
  9508. * This struct assumes little-endian layout, and thus is only
  9509. * suitable for use within processors known to be little-endian
  9510. * (such as the target).
  9511. * In contrast, the above macros provide endian-portable methods
  9512. * to get and set the bitfields within this PPDU_STATS_IND header.
  9513. */
  9514. typedef struct {
  9515. A_UINT32 msg_type: 8, /* bits 7:0 */
  9516. mac_id: 2, /* bits 9:8 */
  9517. pdev_id: 2, /* bits 11:10 */
  9518. reserved1: 4, /* bits 15:12 */
  9519. payload_size: 16; /* bits 31:16 */
  9520. A_UINT32 ppdu_id;
  9521. A_UINT32 timestamp_us;
  9522. A_UINT32 reserved2;
  9523. } htt_t2h_ppdu_stats_ind_hdr_t;
  9524. /**
  9525. * @brief target -> host extended statistics upload
  9526. *
  9527. * @details
  9528. * The following field definitions describe the format of the HTT target
  9529. * to host stats upload confirmation message.
  9530. * The message contains a cookie echoed from the HTT host->target stats
  9531. * upload request, which identifies which request the confirmation is
  9532. * for, and a single stats can span over multiple HTT stats indication
  9533. * due to the HTT message size limitation so every HTT ext stats indication
  9534. * will have tag-length-value stats information elements.
  9535. * The tag-length header for each HTT stats IND message also includes a
  9536. * status field, to indicate whether the request for the stat type in
  9537. * question was fully met, partially met, unable to be met, or invalid
  9538. * (if the stat type in question is disabled in the target).
  9539. * A Done bit 1's indicate the end of the of stats info elements.
  9540. *
  9541. *
  9542. * |31 16|15 12|11|10 8|7 5|4 0|
  9543. * |--------------------------------------------------------------|
  9544. * | reserved | msg type |
  9545. * |--------------------------------------------------------------|
  9546. * | cookie LSBs |
  9547. * |--------------------------------------------------------------|
  9548. * | cookie MSBs |
  9549. * |--------------------------------------------------------------|
  9550. * | stats entry length | rsvd | D| S | stat type |
  9551. * |--------------------------------------------------------------|
  9552. * | type-specific stats info |
  9553. * | (see htt_stats.h) |
  9554. * |--------------------------------------------------------------|
  9555. * Header fields:
  9556. * - MSG_TYPE
  9557. * Bits 7:0
  9558. * Purpose: Identifies this is a extended statistics upload confirmation
  9559. * message.
  9560. * Value: 0x1c
  9561. * - COOKIE_LSBS
  9562. * Bits 31:0
  9563. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9564. * message with its preceding host->target stats request message.
  9565. * Value: LSBs of the opaque cookie specified by the host-side requestor
  9566. * - COOKIE_MSBS
  9567. * Bits 31:0
  9568. * Purpose: Provide a mechanism to match a target->host stats confirmation
  9569. * message with its preceding host->target stats request message.
  9570. * Value: MSBs of the opaque cookie specified by the host-side requestor
  9571. *
  9572. * Stats Information Element tag-length header fields:
  9573. * - STAT_TYPE
  9574. * Bits 7:0
  9575. * Purpose: identifies the type of statistics info held in the
  9576. * following information element
  9577. * Value: htt_dbg_ext_stats_type
  9578. * - STATUS
  9579. * Bits 10:8
  9580. * Purpose: indicate whether the requested stats are present
  9581. * Value: htt_dbg_ext_stats_status
  9582. * - DONE
  9583. * Bits 11
  9584. * Purpose:
  9585. * Indicates the completion of the stats entry, this will be the last
  9586. * stats conf HTT segment for the requested stats type.
  9587. * Value:
  9588. * 0 -> the stats retrieval is ongoing
  9589. * 1 -> the stats retrieval is complete
  9590. * - LENGTH
  9591. * Bits 31:16
  9592. * Purpose: indicate the stats information size
  9593. * Value: This field specifies the number of bytes of stats information
  9594. * that follows the element tag-length header.
  9595. * It is expected but not required that this length is a multiple of
  9596. * 4 bytes.
  9597. */
  9598. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  9599. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  9600. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  9601. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  9602. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  9603. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  9604. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  9605. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  9606. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  9607. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9608. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  9609. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  9610. do { \
  9611. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  9612. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  9613. } while (0)
  9614. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  9615. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  9616. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  9617. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  9618. do { \
  9619. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  9620. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  9621. } while (0)
  9622. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  9623. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  9624. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  9625. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  9626. do { \
  9627. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  9628. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  9629. } while (0)
  9630. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  9631. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  9632. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  9633. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9634. do { \
  9635. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  9636. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  9637. } while (0)
  9638. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  9639. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  9640. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  9641. typedef enum {
  9642. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  9643. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  9644. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  9645. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  9646. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  9647. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  9648. /* Reserved from 128 - 255 for target internal use.*/
  9649. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  9650. } HTT_PEER_TYPE;
  9651. /** 2 word representation of MAC addr */
  9652. typedef struct {
  9653. /** upper 4 bytes of MAC address */
  9654. A_UINT32 mac_addr31to0;
  9655. /** lower 2 bytes of MAC address */
  9656. A_UINT32 mac_addr47to32;
  9657. } htt_mac_addr;
  9658. /** macro to convert MAC address from char array to HTT word format */
  9659. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  9660. (phtt_mac_addr)->mac_addr31to0 = \
  9661. (((c_macaddr)[0] << 0) | \
  9662. ((c_macaddr)[1] << 8) | \
  9663. ((c_macaddr)[2] << 16) | \
  9664. ((c_macaddr)[3] << 24)); \
  9665. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  9666. } while (0)
  9667. /**
  9668. * @brief target -> host monitor mac header indication message
  9669. *
  9670. * @details
  9671. * The following diagram shows the format of the monitor mac header message
  9672. * sent from the target to the host.
  9673. * This message is primarily sent when promiscuous rx mode is enabled.
  9674. * One message is sent per rx PPDU.
  9675. *
  9676. * |31 24|23 16|15 8|7 0|
  9677. * |-------------------------------------------------------------|
  9678. * | peer_id | reserved0 | msg_type |
  9679. * |-------------------------------------------------------------|
  9680. * | reserved1 | num_mpdu |
  9681. * |-------------------------------------------------------------|
  9682. * | struct hw_rx_desc |
  9683. * | (see wal_rx_desc.h) |
  9684. * |-------------------------------------------------------------|
  9685. * | struct ieee80211_frame_addr4 |
  9686. * | (see ieee80211_defs.h) |
  9687. * |-------------------------------------------------------------|
  9688. * | struct ieee80211_frame_addr4 |
  9689. * | (see ieee80211_defs.h) |
  9690. * |-------------------------------------------------------------|
  9691. * | ...... |
  9692. * |-------------------------------------------------------------|
  9693. *
  9694. * Header fields:
  9695. * - msg_type
  9696. * Bits 7:0
  9697. * Purpose: Identifies this is a monitor mac header indication message.
  9698. * Value: 0x20
  9699. * - peer_id
  9700. * Bits 31:16
  9701. * Purpose: Software peer id given by host during association,
  9702. * During promiscuous mode, the peer ID will be invalid (0xFF)
  9703. * for rx PPDUs received from unassociated peers.
  9704. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  9705. * - num_mpdu
  9706. * Bits 15:0
  9707. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  9708. * delivered within the message.
  9709. * Value: 1 to 32
  9710. * num_mpdu is limited to a maximum value of 32, due to buffer
  9711. * size limits. For PPDUs with more than 32 MPDUs, only the
  9712. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  9713. * the PPDU will be provided.
  9714. */
  9715. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  9716. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  9717. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  9718. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  9719. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  9720. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  9721. do { \
  9722. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  9723. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  9724. } while (0)
  9725. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  9726. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  9727. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  9728. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  9729. do { \
  9730. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  9731. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  9732. } while (0)
  9733. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  9734. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  9735. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  9736. /**
  9737. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  9738. *
  9739. * @details
  9740. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  9741. * the flow pool associated with the specified ID is resized
  9742. *
  9743. * The message would appear as follows:
  9744. *
  9745. * |31 16|15 8|7 0|
  9746. * |---------------------------------+----------------+----------------|
  9747. * | reserved0 | Msg type |
  9748. * |-------------------------------------------------------------------|
  9749. * | flow pool new size | flow pool ID |
  9750. * |-------------------------------------------------------------------|
  9751. *
  9752. * The message is interpreted as follows:
  9753. * b'0:7 - msg_type: This will be set to
  9754. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  9755. *
  9756. * b'0:15 - flow pool ID: Existing flow pool ID
  9757. *
  9758. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  9759. *
  9760. */
  9761. PREPACK struct htt_flow_pool_resize_t {
  9762. A_UINT32 msg_type:8,
  9763. reserved0:24;
  9764. A_UINT32 flow_pool_id:16,
  9765. flow_pool_new_size:16;
  9766. } POSTPACK;
  9767. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  9768. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  9769. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  9770. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  9771. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  9772. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  9773. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  9774. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  9775. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  9776. do { \
  9777. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  9778. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  9779. } while (0)
  9780. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  9781. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  9782. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  9783. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  9784. do { \
  9785. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  9786. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  9787. } while (0)
  9788. /**
  9789. * @brief host -> target channel change message
  9790. *
  9791. * @details
  9792. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  9793. * to associate RX frames to correct channel they were received on.
  9794. * The following field definitions describe the format of the HTT target
  9795. * to host channel change message.
  9796. * |31 16|15 8|7 5|4 0|
  9797. * |------------------------------------------------------------|
  9798. * | reserved | MSG_TYPE |
  9799. * |------------------------------------------------------------|
  9800. * | CHAN_MHZ |
  9801. * |------------------------------------------------------------|
  9802. * | BAND_CENTER_FREQ1 |
  9803. * |------------------------------------------------------------|
  9804. * | BAND_CENTER_FREQ2 |
  9805. * |------------------------------------------------------------|
  9806. * | CHAN_PHY_MODE |
  9807. * |------------------------------------------------------------|
  9808. * Header fields:
  9809. * - MSG_TYPE
  9810. * Bits 7:0
  9811. * Value: 0xf
  9812. * - CHAN_MHZ
  9813. * Bits 31:0
  9814. * Purpose: frequency of the primary 20mhz channel.
  9815. * - BAND_CENTER_FREQ1
  9816. * Bits 31:0
  9817. * Purpose: centre frequency of the full channel.
  9818. * - BAND_CENTER_FREQ2
  9819. * Bits 31:0
  9820. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  9821. * - CHAN_PHY_MODE
  9822. * Bits 31:0
  9823. * Purpose: phy mode of the channel.
  9824. */
  9825. PREPACK struct htt_chan_change_msg {
  9826. A_UINT32 chan_mhz; /* frequency in mhz */
  9827. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  9828. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  9829. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  9830. } POSTPACK;
  9831. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  9832. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  9833. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  9834. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  9835. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  9836. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  9837. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  9838. /*
  9839. * The read and write indices point to the data within the host buffer.
  9840. * Because the first 4 bytes of the host buffer is used for the read index and
  9841. * the next 4 bytes for the write index, the data itself starts at offset 8.
  9842. * The read index and write index are the byte offsets from the base of the
  9843. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  9844. * Refer the ASCII text picture below.
  9845. */
  9846. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  9847. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  9848. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  9849. /*
  9850. ***************************************************************************
  9851. *
  9852. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9853. *
  9854. ***************************************************************************
  9855. *
  9856. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  9857. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  9858. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  9859. * written into the Host memory region mentioned below.
  9860. *
  9861. * Read index is updated by the Host. At any point of time, the read index will
  9862. * indicate the index that will next be read by the Host. The read index is
  9863. * in units of bytes offset from the base of the meta-data buffer.
  9864. *
  9865. * Write index is updated by the FW. At any point of time, the write index will
  9866. * indicate from where the FW can start writing any new data. The write index is
  9867. * in units of bytes offset from the base of the meta-data buffer.
  9868. *
  9869. * If the Host is not fast enough in reading the CFR data, any new capture data
  9870. * would be dropped if there is no space left to write the new captures.
  9871. *
  9872. * The last 4 bytes of the memory region will have the magic pattern
  9873. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  9874. * not overrun the host buffer.
  9875. *
  9876. * ,--------------------. read and write indices store the
  9877. * | | byte offset from the base of the
  9878. * | ,--------+--------. meta-data buffer to the next
  9879. * | | | | location within the data buffer
  9880. * | | v v that will be read / written
  9881. * ************************************************************************
  9882. * * Read * Write * * Magic *
  9883. * * index * index * CFR data1 ...... CFR data N * pattern *
  9884. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  9885. * ************************************************************************
  9886. * |<---------- data buffer ---------->|
  9887. *
  9888. * |<----------------- meta-data buffer allocated in Host ----------------|
  9889. *
  9890. * Note:
  9891. * - Considering the 4 bytes needed to store the Read index (R) and the
  9892. * Write index (W), the initial value is as follows:
  9893. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  9894. * - Buffer empty condition:
  9895. * R = W
  9896. *
  9897. * Regarding CFR data format:
  9898. * --------------------------
  9899. *
  9900. * Each CFR tone is stored in HW as 16-bits with the following format:
  9901. * {bits[15:12], bits[11:6], bits[5:0]} =
  9902. * {unsigned exponent (4 bits),
  9903. * signed mantissa_real (6 bits),
  9904. * signed mantissa_imag (6 bits)}
  9905. *
  9906. * CFR_real = mantissa_real * 2^(exponent-5)
  9907. * CFR_imag = mantissa_imag * 2^(exponent-5)
  9908. *
  9909. *
  9910. * The CFR data is written to the 16-bit unsigned output array (buff) in
  9911. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  9912. *
  9913. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  9914. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  9915. * .
  9916. * .
  9917. * .
  9918. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  9919. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  9920. */
  9921. /* Bandwidth of peer CFR captures */
  9922. typedef enum {
  9923. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  9924. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  9925. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  9926. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  9927. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  9928. HTT_PEER_CFR_CAPTURE_BW_MAX,
  9929. } HTT_PEER_CFR_CAPTURE_BW;
  9930. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  9931. * was captured
  9932. */
  9933. typedef enum {
  9934. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  9935. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  9936. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  9937. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  9938. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  9939. } HTT_PEER_CFR_CAPTURE_MODE;
  9940. typedef enum {
  9941. /* This message type is currently used for the below purpose:
  9942. *
  9943. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  9944. * wmi_peer_cfr_capture_cmd.
  9945. * If payload_present bit is set to 0 then the associated memory region
  9946. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  9947. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  9948. * message; the CFR dump will be present at the end of the message,
  9949. * after the chan_phy_mode.
  9950. */
  9951. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  9952. /* Always keep this last */
  9953. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  9954. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  9955. /**
  9956. * @brief target -> host CFR dump completion indication message definition
  9957. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  9958. *
  9959. * @details
  9960. * The following diagram shows the format of the Channel Frequency Response
  9961. * (CFR) dump completion indication. This inidcation is sent to the Host when
  9962. * the channel capture of a peer is copied by Firmware into the Host memory
  9963. *
  9964. * **************************************************************************
  9965. *
  9966. * Message format when the CFR capture message type is
  9967. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  9968. *
  9969. * **************************************************************************
  9970. *
  9971. * |31 16|15 |8|7 0|
  9972. * |----------------------------------------------------------------|
  9973. * header: | reserved |P| msg_type |
  9974. * word 0 | | | |
  9975. * |----------------------------------------------------------------|
  9976. * payload: | cfr_capture_msg_type |
  9977. * word 1 | |
  9978. * |----------------------------------------------------------------|
  9979. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  9980. * word 2 | | | | | | | | |
  9981. * |----------------------------------------------------------------|
  9982. * | mac_addr31to0 |
  9983. * word 3 | |
  9984. * |----------------------------------------------------------------|
  9985. * | unused / reserved | mac_addr47to32 |
  9986. * word 4 | | |
  9987. * |----------------------------------------------------------------|
  9988. * | index |
  9989. * word 5 | |
  9990. * |----------------------------------------------------------------|
  9991. * | length |
  9992. * word 6 | |
  9993. * |----------------------------------------------------------------|
  9994. * | timestamp |
  9995. * word 7 | |
  9996. * |----------------------------------------------------------------|
  9997. * | counter |
  9998. * word 8 | |
  9999. * |----------------------------------------------------------------|
  10000. * | chan_mhz |
  10001. * word 9 | |
  10002. * |----------------------------------------------------------------|
  10003. * | band_center_freq1 |
  10004. * word 10 | |
  10005. * |----------------------------------------------------------------|
  10006. * | band_center_freq2 |
  10007. * word 11 | |
  10008. * |----------------------------------------------------------------|
  10009. * | chan_phy_mode |
  10010. * word 12 | |
  10011. * |----------------------------------------------------------------|
  10012. * where,
  10013. * P - payload present bit (payload_present explained below)
  10014. * req_id - memory request id (mem_req_id explained below)
  10015. * S - status field (status explained below)
  10016. * capbw - capture bandwidth (capture_bw explained below)
  10017. * mode - mode of capture (mode explained below)
  10018. * sts - space time streams (sts_count explained below)
  10019. * chbw - channel bandwidth (channel_bw explained below)
  10020. * captype - capture type (cap_type explained below)
  10021. *
  10022. * The following field definitions describe the format of the CFR dump
  10023. * completion indication sent from the target to the host
  10024. *
  10025. * Header fields:
  10026. *
  10027. * Word 0
  10028. * - msg_type
  10029. * Bits 7:0
  10030. * Purpose: Identifies this as CFR TX completion indication
  10031. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10032. * - payload_present
  10033. * Bit 8
  10034. * Purpose: Identifies how CFR data is sent to host
  10035. * Value: 0 - If CFR Payload is written to host memory
  10036. * 1 - If CFR Payload is sent as part of HTT message
  10037. * (This is the requirement for SDIO/USB where it is
  10038. * not possible to write CFR data to host memory)
  10039. * - reserved
  10040. * Bits 31:9
  10041. * Purpose: Reserved
  10042. * Value: 0
  10043. *
  10044. * Payload fields:
  10045. *
  10046. * Word 1
  10047. * - cfr_capture_msg_type
  10048. * Bits 31:0
  10049. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10050. * to specify the format used for the remainder of the message
  10051. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10052. * (currently only MSG_TYPE_1 is defined)
  10053. *
  10054. * Word 2
  10055. * - mem_req_id
  10056. * Bits 6:0
  10057. * Purpose: Contain the mem request id of the region where the CFR capture
  10058. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10059. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10060. this value is invalid)
  10061. * - status
  10062. * Bit 7
  10063. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10064. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10065. * - capture_bw
  10066. * Bits 10:8
  10067. * Purpose: Carry the bandwidth of the CFR capture
  10068. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10069. * - mode
  10070. * Bits 13:11
  10071. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10072. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10073. * - sts_count
  10074. * Bits 16:14
  10075. * Purpose: Carry the number of space time streams
  10076. * Value: Number of space time streams
  10077. * - channel_bw
  10078. * Bits 19:17
  10079. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10080. * measurement
  10081. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10082. * - cap_type
  10083. * Bits 23:20
  10084. * Purpose: Carry the type of the capture
  10085. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10086. * - vdev_id
  10087. * Bits 31:24
  10088. * Purpose: Carry the virtual device id
  10089. * Value: vdev ID
  10090. *
  10091. * Word 3
  10092. * - mac_addr31to0
  10093. * Bits 31:0
  10094. * Purpose: Contain the bits 31:0 of the peer MAC address
  10095. * Value: Bits 31:0 of the peer MAC address
  10096. *
  10097. * Word 4
  10098. * - mac_addr47to32
  10099. * Bits 15:0
  10100. * Purpose: Contain the bits 47:32 of the peer MAC address
  10101. * Value: Bits 47:32 of the peer MAC address
  10102. *
  10103. * Word 5
  10104. * - index
  10105. * Bits 31:0
  10106. * Purpose: Contain the index at which this CFR dump was written in the Host
  10107. * allocated memory. This index is the number of bytes from the base address.
  10108. * Value: Index position
  10109. *
  10110. * Word 6
  10111. * - length
  10112. * Bits 31:0
  10113. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10114. * Value: Length of the CFR capture of the peer
  10115. *
  10116. * Word 7
  10117. * - timestamp
  10118. * Bits 31:0
  10119. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10120. * clock used for this timestamp is private to the target and not visible to
  10121. * the host i.e., Host can interpret only the relative timestamp deltas from
  10122. * one message to the next, but can't interpret the absolute timestamp from a
  10123. * single message.
  10124. * Value: Timestamp in microseconds
  10125. *
  10126. * Word 8
  10127. * - counter
  10128. * Bits 31:0
  10129. * Purpose: Carry the count of the current CFR capture from FW. This is
  10130. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10131. * in host memory)
  10132. * Value: Count of the current CFR capture
  10133. *
  10134. * Word 9
  10135. * - chan_mhz
  10136. * Bits 31:0
  10137. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10138. * Value: Primary 20 channel frequency
  10139. *
  10140. * Word 10
  10141. * - band_center_freq1
  10142. * Bits 31:0
  10143. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10144. * Value: Center frequency 1 in MHz
  10145. *
  10146. * Word 11
  10147. * - band_center_freq2
  10148. * Bits 31:0
  10149. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10150. * the VDEV
  10151. * 80plus80 mode
  10152. * Value: Center frequency 2 in MHz
  10153. *
  10154. * Word 12
  10155. * - chan_phy_mode
  10156. * Bits 31:0
  10157. * Purpose: Carry the phy mode of the channel, of the VDEV
  10158. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10159. */
  10160. PREPACK struct htt_cfr_dump_ind_type_1 {
  10161. A_UINT32 mem_req_id:7,
  10162. status:1,
  10163. capture_bw:3,
  10164. mode:3,
  10165. sts_count:3,
  10166. channel_bw:3,
  10167. cap_type:4,
  10168. vdev_id:8;
  10169. htt_mac_addr addr;
  10170. A_UINT32 index;
  10171. A_UINT32 length;
  10172. A_UINT32 timestamp;
  10173. A_UINT32 counter;
  10174. struct htt_chan_change_msg chan;
  10175. } POSTPACK;
  10176. PREPACK struct htt_cfr_dump_compl_ind {
  10177. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10178. union {
  10179. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10180. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10181. /* If there is a need to change the memory layout and its associated
  10182. * HTT indication format, a new CFR capture message type can be
  10183. * introduced and added into this union.
  10184. */
  10185. };
  10186. } POSTPACK;
  10187. /*
  10188. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10189. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10190. */
  10191. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10192. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10193. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10194. do { \
  10195. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10196. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10197. } while(0)
  10198. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10199. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10200. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10201. /*
  10202. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10203. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10204. */
  10205. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10206. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10207. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10208. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10209. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10210. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10211. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10212. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10213. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10214. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10215. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10216. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10217. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10218. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10219. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10220. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10221. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10222. do { \
  10223. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10224. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10225. } while (0)
  10226. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10227. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10228. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10229. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10230. do { \
  10231. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10232. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10233. } while (0)
  10234. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10235. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10236. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10237. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10238. do { \
  10239. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10240. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10241. } while (0)
  10242. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10243. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10244. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10245. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10246. do { \
  10247. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10248. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10249. } while (0)
  10250. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10251. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10252. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10253. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10254. do { \
  10255. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10256. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10257. } while (0)
  10258. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10259. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10260. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10261. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10262. do { \
  10263. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10264. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10265. } while (0)
  10266. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10267. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10268. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10269. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10270. do { \
  10271. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10272. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10273. } while (0)
  10274. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10275. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10276. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10277. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10278. do { \
  10279. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10280. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10281. } while (0)
  10282. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10283. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10284. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10285. /**
  10286. * @brief target -> host peer (PPDU) stats message
  10287. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10288. * @details
  10289. * This message is generated by FW when FW is sending stats to host
  10290. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10291. * This message is sent autonomously by the target rather than upon request
  10292. * by the host.
  10293. * The following field definitions describe the format of the HTT target
  10294. * to host peer stats indication message.
  10295. *
  10296. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10297. * or more PPDU stats records.
  10298. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10299. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10300. * then the message would start with the
  10301. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10302. * below.
  10303. *
  10304. * |31 16|15|14|13 11|10 9|8|7 0|
  10305. * |-------------------------------------------------------------|
  10306. * | reserved |MSG_TYPE |
  10307. * |-------------------------------------------------------------|
  10308. * rec 0 | TLV header |
  10309. * rec 0 |-------------------------------------------------------------|
  10310. * rec 0 | ppdu successful bytes |
  10311. * rec 0 |-------------------------------------------------------------|
  10312. * rec 0 | ppdu retry bytes |
  10313. * rec 0 |-------------------------------------------------------------|
  10314. * rec 0 | ppdu failed bytes |
  10315. * rec 0 |-------------------------------------------------------------|
  10316. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10317. * rec 0 |-------------------------------------------------------------|
  10318. * rec 0 | retried MSDUs | successful MSDUs |
  10319. * rec 0 |-------------------------------------------------------------|
  10320. * rec 0 | TX duration | failed MSDUs |
  10321. * rec 0 |-------------------------------------------------------------|
  10322. * ...
  10323. * |-------------------------------------------------------------|
  10324. * rec N | TLV header |
  10325. * rec N |-------------------------------------------------------------|
  10326. * rec N | ppdu successful bytes |
  10327. * rec N |-------------------------------------------------------------|
  10328. * rec N | ppdu retry bytes |
  10329. * rec N |-------------------------------------------------------------|
  10330. * rec N | ppdu failed bytes |
  10331. * rec N |-------------------------------------------------------------|
  10332. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10333. * rec N |-------------------------------------------------------------|
  10334. * rec N | retried MSDUs | successful MSDUs |
  10335. * rec N |-------------------------------------------------------------|
  10336. * rec N | TX duration | failed MSDUs |
  10337. * rec N |-------------------------------------------------------------|
  10338. *
  10339. * where:
  10340. * A = is A-MPDU flag
  10341. * BA = block-ack failure flags
  10342. * BW = bandwidth spec
  10343. * SG = SGI enabled spec
  10344. * S = skipped rate ctrl
  10345. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10346. *
  10347. * Header
  10348. * ------
  10349. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10350. * dword0 - b'8:31 - reserved : Reserved for future use
  10351. *
  10352. * payload include below peer_stats information
  10353. * --------------------------------------------
  10354. * @TLV : HTT_PPDU_STATS_INFO_TLV
  10355. * @tx_success_bytes : total successful bytes in the PPDU.
  10356. * @tx_retry_bytes : total retried bytes in the PPDU.
  10357. * @tx_failed_bytes : total failed bytes in the PPDU.
  10358. * @tx_ratecode : rate code used for the PPDU.
  10359. * @is_ampdu : Indicates PPDU is AMPDU or not.
  10360. * @ba_ack_failed : BA/ACK failed for this PPDU
  10361. * b00 -> BA received
  10362. * b01 -> BA failed once
  10363. * b10 -> BA failed twice, when HW retry is enabled.
  10364. * @bw : BW
  10365. * b00 -> 20 MHz
  10366. * b01 -> 40 MHz
  10367. * b10 -> 80 MHz
  10368. * b11 -> 160 MHz (or 80+80)
  10369. * @sg : SGI enabled
  10370. * @s : skipped ratectrl
  10371. * @peer_id : peer id
  10372. * @tx_success_msdus : successful MSDUs
  10373. * @tx_retry_msdus : retried MSDUs
  10374. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  10375. * @tx_duration : Tx duration for the PPDU (microsecond units)
  10376. */
  10377. /**
  10378. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  10379. *
  10380. * @details
  10381. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  10382. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  10383. * This message will only be sent if the backpressure condition has existed
  10384. * continuously for an initial period (100 ms).
  10385. * Repeat messages with updated information will be sent after each
  10386. * subsequent period (100 ms) as long as the backpressure remains unabated.
  10387. * This message indicates the ring id along with current head and tail index
  10388. * locations (i.e. write and read indices).
  10389. * The backpressure time indicates the time in ms for which continous
  10390. * backpressure has been observed in the ring.
  10391. *
  10392. * The message format is as follows:
  10393. *
  10394. * |31 24|23 16|15 8|7 0|
  10395. * |----------------+----------------+----------------+----------------|
  10396. * | ring_id | ring_type | pdev_id | msg_type |
  10397. * |-------------------------------------------------------------------|
  10398. * | tail_idx | head_idx |
  10399. * |-------------------------------------------------------------------|
  10400. * | backpressure_time_ms |
  10401. * |-------------------------------------------------------------------|
  10402. *
  10403. * The message is interpreted as follows:
  10404. * dword0 - b'0:7 - msg_type: This will be set to
  10405. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  10406. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  10407. * 1, 2, 3 indicates pdev_id 0,1,2 and
  10408. the msg is for LMAC ring.
  10409. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  10410. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  10411. * htt_backpressure_lmac_ring_id. This represents
  10412. * the ring id for which continous backpressure is seen
  10413. *
  10414. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  10415. * the ring indicated by the ring_id
  10416. *
  10417. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  10418. * the ring indicated by the ring id
  10419. *
  10420. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  10421. * backpressure has been seen in the ring
  10422. * indicated by the ring_id.
  10423. * Units = milliseconds
  10424. */
  10425. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  10426. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  10427. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  10428. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  10429. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  10430. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  10431. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  10432. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  10433. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  10434. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  10435. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  10436. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  10437. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  10438. do { \
  10439. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  10440. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  10441. } while (0)
  10442. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  10443. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  10444. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  10445. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  10446. do { \
  10447. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  10448. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  10449. } while (0)
  10450. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  10451. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  10452. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  10453. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  10454. do { \
  10455. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  10456. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  10457. } while (0)
  10458. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  10459. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  10460. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  10461. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  10462. do { \
  10463. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  10464. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  10465. } while (0)
  10466. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  10467. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  10468. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  10469. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  10470. do { \
  10471. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  10472. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  10473. } while (0)
  10474. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  10475. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  10476. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  10477. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  10478. do { \
  10479. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  10480. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  10481. } while (0)
  10482. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  10483. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  10484. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  10485. enum htt_backpressure_ring_type {
  10486. HTT_SW_RING_TYPE_UMAC,
  10487. HTT_SW_RING_TYPE_LMAC,
  10488. HTT_SW_RING_TYPE_MAX,
  10489. };
  10490. /* Ring id for which the message is sent to host */
  10491. enum htt_backpressure_umac_ringid {
  10492. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  10493. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  10494. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  10495. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  10496. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  10497. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  10498. HTT_SW_RING_IDX_REO_REO2FW_RING,
  10499. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  10500. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  10501. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  10502. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  10503. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  10504. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  10505. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  10506. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  10507. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  10508. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  10509. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  10510. HTT_SW_UMAC_RING_IDX_MAX,
  10511. };
  10512. enum htt_backpressure_lmac_ringid {
  10513. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  10514. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  10515. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  10516. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  10517. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  10518. HTT_SW_RING_IDX_RXDMA2FW_RING,
  10519. HTT_SW_RING_IDX_RXDMA2SW_RING,
  10520. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  10521. HTT_SW_RING_IDX_RXDMA2REO_RING,
  10522. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  10523. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  10524. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  10525. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  10526. HTT_SW_LMAC_RING_IDX_MAX,
  10527. };
  10528. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  10529. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  10530. pdev_id: 8,
  10531. ring_type: 8, /* htt_backpressure_ring_type */
  10532. /*
  10533. * ring_id holds an enum value from either
  10534. * htt_backpressure_umac_ringid or
  10535. * htt_backpressure_lmac_ringid, based on
  10536. * the ring_type setting.
  10537. */
  10538. ring_id: 8;
  10539. A_UINT16 head_idx;
  10540. A_UINT16 tail_idx;
  10541. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  10542. } POSTPACK;
  10543. #endif