htt.h 565 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581
  1. /*
  2. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. */
  185. #define HTT_CURRENT_VERSION_MAJOR 3
  186. #define HTT_CURRENT_VERSION_MINOR 69
  187. #define HTT_NUM_TX_FRAG_DESC 1024
  188. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  189. #define HTT_CHECK_SET_VAL(field, val) \
  190. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  191. /* macros to assist in sign-extending fields from HTT messages */
  192. #define HTT_SIGN_BIT_MASK(field) \
  193. ((field ## _M + (1 << field ## _S)) >> 1)
  194. #define HTT_SIGN_BIT(_val, field) \
  195. (_val & HTT_SIGN_BIT_MASK(field))
  196. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  197. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  198. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  199. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  200. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  201. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  202. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  203. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  204. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  205. /*
  206. * TEMPORARY:
  207. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  208. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  209. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  210. * updated.
  211. */
  212. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  213. /*
  214. * TEMPORARY:
  215. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  216. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  217. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  218. * updated.
  219. */
  220. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  221. /* HTT Access Category values */
  222. enum HTT_AC_WMM {
  223. /* WMM Access Categories */
  224. HTT_AC_WMM_BE = 0x0,
  225. HTT_AC_WMM_BK = 0x1,
  226. HTT_AC_WMM_VI = 0x2,
  227. HTT_AC_WMM_VO = 0x3,
  228. /* extension Access Categories */
  229. HTT_AC_EXT_NON_QOS = 0x4,
  230. HTT_AC_EXT_UCAST_MGMT = 0x5,
  231. HTT_AC_EXT_MCAST_DATA = 0x6,
  232. HTT_AC_EXT_MCAST_MGMT = 0x7,
  233. };
  234. enum HTT_AC_WMM_MASK {
  235. /* WMM Access Categories */
  236. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  237. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  238. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  239. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  240. /* extension Access Categories */
  241. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  242. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  243. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  244. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  245. };
  246. #define HTT_AC_MASK_WMM \
  247. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  248. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  249. #define HTT_AC_MASK_EXT \
  250. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  251. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  252. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  253. /*
  254. * htt_dbg_stats_type -
  255. * bit positions for each stats type within a stats type bitmask
  256. * The bitmask contains 24 bits.
  257. */
  258. enum htt_dbg_stats_type {
  259. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  260. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  261. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  262. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  263. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  264. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  265. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  266. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  267. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  268. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  269. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  270. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  271. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  272. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  273. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  274. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  275. /* bits 16-23 currently reserved */
  276. /* keep this last */
  277. HTT_DBG_NUM_STATS
  278. };
  279. /*=== HTT option selection TLVs ===
  280. * Certain HTT messages have alternatives or options.
  281. * For such cases, the host and target need to agree on which option to use.
  282. * Option specification TLVs can be appended to the VERSION_REQ and
  283. * VERSION_CONF messages to select options other than the default.
  284. * These TLVs are entirely optional - if they are not provided, there is a
  285. * well-defined default for each option. If they are provided, they can be
  286. * provided in any order. Each TLV can be present or absent independent of
  287. * the presence / absence of other TLVs.
  288. *
  289. * The HTT option selection TLVs use the following format:
  290. * |31 16|15 8|7 0|
  291. * |---------------------------------+----------------+----------------|
  292. * | value (payload) | length | tag |
  293. * |-------------------------------------------------------------------|
  294. * The value portion need not be only 2 bytes; it can be extended by any
  295. * integer number of 4-byte units. The total length of the TLV, including
  296. * the tag and length fields, must be a multiple of 4 bytes. The length
  297. * field specifies the total TLV size in 4-byte units. Thus, the typical
  298. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  299. * field, would store 0x1 in its length field, to show that the TLV occupies
  300. * a single 4-byte unit.
  301. */
  302. /*--- TLV header format - applies to all HTT option TLVs ---*/
  303. enum HTT_OPTION_TLV_TAGS {
  304. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  305. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  306. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  307. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  308. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  309. };
  310. PREPACK struct htt_option_tlv_header_t {
  311. A_UINT8 tag;
  312. A_UINT8 length;
  313. } POSTPACK;
  314. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  315. #define HTT_OPTION_TLV_TAG_S 0
  316. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  317. #define HTT_OPTION_TLV_LENGTH_S 8
  318. /*
  319. * value0 - 16 bit value field stored in word0
  320. * The TLV's value field may be longer than 2 bytes, in which case
  321. * the remainder of the value is stored in word1, word2, etc.
  322. */
  323. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  324. #define HTT_OPTION_TLV_VALUE0_S 16
  325. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  326. do { \
  327. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  328. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  329. } while (0)
  330. #define HTT_OPTION_TLV_TAG_GET(word) \
  331. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  332. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  333. do { \
  334. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  335. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  336. } while (0)
  337. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  338. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  339. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  340. do { \
  341. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  342. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  343. } while (0)
  344. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  345. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  346. /*--- format of specific HTT option TLVs ---*/
  347. /*
  348. * HTT option TLV for specifying LL bus address size
  349. * Some chips require bus addresses used by the target to access buffers
  350. * within the host's memory to be 32 bits; others require bus addresses
  351. * used by the target to access buffers within the host's memory to be
  352. * 64 bits.
  353. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  354. * a suffix to the VERSION_CONF message to specify which bus address format
  355. * the target requires.
  356. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  357. * default to providing bus addresses to the target in 32-bit format.
  358. */
  359. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  360. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  361. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  362. };
  363. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  364. struct htt_option_tlv_header_t hdr;
  365. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  366. } POSTPACK;
  367. /*
  368. * HTT option TLV for specifying whether HL systems should indicate
  369. * over-the-air tx completion for individual frames, or should instead
  370. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  371. * requests an OTA tx completion for a particular tx frame.
  372. * This option does not apply to LL systems, where the TX_COMPL_IND
  373. * is mandatory.
  374. * This option is primarily intended for HL systems in which the tx frame
  375. * downloads over the host --> target bus are as slow as or slower than
  376. * the transmissions over the WLAN PHY. For cases where the bus is faster
  377. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  378. * and consquently will send one TX_COMPL_IND message that covers several
  379. * tx frames. For cases where the WLAN PHY is faster than the bus,
  380. * the target will end up transmitting very short A-MPDUs, and consequently
  381. * sending many TX_COMPL_IND messages, which each cover a very small number
  382. * of tx frames.
  383. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  384. * a suffix to the VERSION_REQ message to request whether the host desires to
  385. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  386. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  387. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  388. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  389. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  390. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  391. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  392. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  393. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  394. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  395. * TLV.
  396. */
  397. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  398. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  399. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  400. };
  401. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  402. struct htt_option_tlv_header_t hdr;
  403. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  404. } POSTPACK;
  405. /*
  406. * HTT option TLV for specifying how many tx queue groups the target
  407. * may establish.
  408. * This TLV specifies the maximum value the target may send in the
  409. * txq_group_id field of any TXQ_GROUP information elements sent by
  410. * the target to the host. This allows the host to pre-allocate an
  411. * appropriate number of tx queue group structs.
  412. *
  413. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  414. * a suffix to the VERSION_REQ message to specify whether the host supports
  415. * tx queue groups at all, and if so if there is any limit on the number of
  416. * tx queue groups that the host supports.
  417. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  418. * a suffix to the VERSION_CONF message. If the host has specified in the
  419. * VER_REQ message a limit on the number of tx queue groups the host can
  420. * supprt, the target shall limit its specification of the maximum tx groups
  421. * to be no larger than this host-specified limit.
  422. *
  423. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  424. * shall preallocate 4 tx queue group structs, and the target shall not
  425. * specify a txq_group_id larger than 3.
  426. */
  427. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  428. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  429. /*
  430. * values 1 through N specify the max number of tx queue groups
  431. * the sender supports
  432. */
  433. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  434. };
  435. /* TEMPORARY backwards-compatibility alias for a typo fix -
  436. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  437. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  438. * to support the old name (with the typo) until all references to the
  439. * old name are replaced with the new name.
  440. */
  441. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  442. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  443. struct htt_option_tlv_header_t hdr;
  444. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  445. } POSTPACK;
  446. /*
  447. * HTT option TLV for specifying whether the target supports an extended
  448. * version of the HTT tx descriptor. If the target provides this TLV
  449. * and specifies in the TLV that the target supports an extended version
  450. * of the HTT tx descriptor, the target must check the "extension" bit in
  451. * the HTT tx descriptor, and if the extension bit is set, to expect a
  452. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  453. * descriptor. Furthermore, the target must provide room for the HTT
  454. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  455. * This option is intended for systems where the host needs to explicitly
  456. * control the transmission parameters such as tx power for individual
  457. * tx frames.
  458. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  459. * as a suffix to the VERSION_CONF message to explicitly specify whether
  460. * the target supports the HTT tx MSDU extension descriptor.
  461. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  462. * by the host as lack of target support for the HTT tx MSDU extension
  463. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  464. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  465. * the HTT tx MSDU extension descriptor.
  466. * The host is not required to provide the HTT tx MSDU extension descriptor
  467. * just because the target supports it; the target must check the
  468. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  469. * extension descriptor is present.
  470. */
  471. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  472. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  473. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  474. };
  475. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  476. struct htt_option_tlv_header_t hdr;
  477. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  478. } POSTPACK;
  479. /*=== host -> target messages ===============================================*/
  480. enum htt_h2t_msg_type {
  481. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  482. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  483. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  484. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  485. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  486. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  487. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  488. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  489. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  490. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  491. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  492. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  493. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  494. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  495. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  496. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  497. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  498. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  499. /* keep this last */
  500. HTT_H2T_NUM_MSGS
  501. };
  502. /*
  503. * HTT host to target message type -
  504. * stored in bits 7:0 of the first word of the message
  505. */
  506. #define HTT_H2T_MSG_TYPE_M 0xff
  507. #define HTT_H2T_MSG_TYPE_S 0
  508. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  509. do { \
  510. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  511. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  512. } while (0)
  513. #define HTT_H2T_MSG_TYPE_GET(word) \
  514. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  515. /**
  516. * @brief host -> target version number request message definition
  517. *
  518. * |31 24|23 16|15 8|7 0|
  519. * |----------------+----------------+----------------+----------------|
  520. * | reserved | msg type |
  521. * |-------------------------------------------------------------------|
  522. * : option request TLV (optional) |
  523. * :...................................................................:
  524. *
  525. * The VER_REQ message may consist of a single 4-byte word, or may be
  526. * extended with TLVs that specify which HTT options the host is requesting
  527. * from the target.
  528. * The following option TLVs may be appended to the VER_REQ message:
  529. * - HL_SUPPRESS_TX_COMPL_IND
  530. * - HL_MAX_TX_QUEUE_GROUPS
  531. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  532. * may be appended to the VER_REQ message (but only one TLV of each type).
  533. *
  534. * Header fields:
  535. * - MSG_TYPE
  536. * Bits 7:0
  537. * Purpose: identifies this as a version number request message
  538. * Value: 0x0
  539. */
  540. #define HTT_VER_REQ_BYTES 4
  541. /* TBDXXX: figure out a reasonable number */
  542. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  543. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  544. /**
  545. * @brief HTT tx MSDU descriptor
  546. *
  547. * @details
  548. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  549. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  550. * the target firmware needs for the FW's tx processing, particularly
  551. * for creating the HW msdu descriptor.
  552. * The same HTT tx descriptor is used for HL and LL systems, though
  553. * a few fields within the tx descriptor are used only by LL or
  554. * only by HL.
  555. * The HTT tx descriptor is defined in two manners: by a struct with
  556. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  557. * definitions.
  558. * The target should use the struct def, for simplicitly and clarity,
  559. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  560. * neutral. Specifically, the host shall use the get/set macros built
  561. * around the mask + shift defs.
  562. */
  563. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  564. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  565. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  566. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  567. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  568. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  569. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  570. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  571. #define HTT_TX_VDEV_ID_WORD 0
  572. #define HTT_TX_VDEV_ID_MASK 0x3f
  573. #define HTT_TX_VDEV_ID_SHIFT 16
  574. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  575. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  576. #define HTT_TX_MSDU_LEN_DWORD 1
  577. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  578. /*
  579. * HTT_VAR_PADDR macros
  580. * Allow physical / bus addresses to be either a single 32-bit value,
  581. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  582. */
  583. #define HTT_VAR_PADDR32(var_name) \
  584. A_UINT32 var_name
  585. #define HTT_VAR_PADDR64_LE(var_name) \
  586. struct { \
  587. /* little-endian: lo precedes hi */ \
  588. A_UINT32 lo; \
  589. A_UINT32 hi; \
  590. } var_name
  591. /*
  592. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  593. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  594. * addresses are stored in a XXX-bit field.
  595. * This macro is used to define both htt_tx_msdu_desc32_t and
  596. * htt_tx_msdu_desc64_t structs.
  597. */
  598. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  599. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  600. { \
  601. /* DWORD 0: flags and meta-data */ \
  602. A_UINT32 \
  603. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  604. \
  605. /* pkt_subtype - \
  606. * Detailed specification of the tx frame contents, extending the \
  607. * general specification provided by pkt_type. \
  608. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  609. * pkt_type | pkt_subtype \
  610. * ============================================================== \
  611. * 802.3 | bit 0:3 - Reserved \
  612. * | bit 4: 0x0 - Copy-Engine Classification Results \
  613. * | not appended to the HTT message \
  614. * | 0x1 - Copy-Engine Classification Results \
  615. * | appended to the HTT message in the \
  616. * | format: \
  617. * | [HTT tx desc, frame header, \
  618. * | CE classification results] \
  619. * | The CE classification results begin \
  620. * | at the next 4-byte boundary after \
  621. * | the frame header. \
  622. * ------------+------------------------------------------------- \
  623. * Eth2 | bit 0:3 - Reserved \
  624. * | bit 4: 0x0 - Copy-Engine Classification Results \
  625. * | not appended to the HTT message \
  626. * | 0x1 - Copy-Engine Classification Results \
  627. * | appended to the HTT message. \
  628. * | See the above specification of the \
  629. * | CE classification results location. \
  630. * ------------+------------------------------------------------- \
  631. * native WiFi | bit 0:3 - Reserved \
  632. * | bit 4: 0x0 - Copy-Engine Classification Results \
  633. * | not appended to the HTT message \
  634. * | 0x1 - Copy-Engine Classification Results \
  635. * | appended to the HTT message. \
  636. * | See the above specification of the \
  637. * | CE classification results location. \
  638. * ------------+------------------------------------------------- \
  639. * mgmt | 0x0 - 802.11 MAC header absent \
  640. * | 0x1 - 802.11 MAC header present \
  641. * ------------+------------------------------------------------- \
  642. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  643. * | 0x1 - 802.11 MAC header present \
  644. * | bit 1: 0x0 - allow aggregation \
  645. * | 0x1 - don't allow aggregation \
  646. * | bit 2: 0x0 - perform encryption \
  647. * | 0x1 - don't perform encryption \
  648. * | bit 3: 0x0 - perform tx classification / queuing \
  649. * | 0x1 - don't perform tx classification; \
  650. * | insert the frame into the "misc" \
  651. * | tx queue \
  652. * | bit 4: 0x0 - Copy-Engine Classification Results \
  653. * | not appended to the HTT message \
  654. * | 0x1 - Copy-Engine Classification Results \
  655. * | appended to the HTT message. \
  656. * | See the above specification of the \
  657. * | CE classification results location. \
  658. */ \
  659. pkt_subtype: 5, \
  660. \
  661. /* pkt_type - \
  662. * General specification of the tx frame contents. \
  663. * The htt_pkt_type enum should be used to specify and check the \
  664. * value of this field. \
  665. */ \
  666. pkt_type: 3, \
  667. \
  668. /* vdev_id - \
  669. * ID for the vdev that is sending this tx frame. \
  670. * For certain non-standard packet types, e.g. pkt_type == raw \
  671. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  672. * This field is used primarily for determining where to queue \
  673. * broadcast and multicast frames. \
  674. */ \
  675. vdev_id: 6, \
  676. /* ext_tid - \
  677. * The extended traffic ID. \
  678. * If the TID is unknown, the extended TID is set to \
  679. * HTT_TX_EXT_TID_INVALID. \
  680. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  681. * value of the QoS TID. \
  682. * If the tx frame is non-QoS data, then the extended TID is set to \
  683. * HTT_TX_EXT_TID_NON_QOS. \
  684. * If the tx frame is multicast or broadcast, then the extended TID \
  685. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  686. */ \
  687. ext_tid: 5, \
  688. \
  689. /* postponed - \
  690. * This flag indicates whether the tx frame has been downloaded to \
  691. * the target before but discarded by the target, and now is being \
  692. * downloaded again; or if this is a new frame that is being \
  693. * downloaded for the first time. \
  694. * This flag allows the target to determine the correct order for \
  695. * transmitting new vs. old frames. \
  696. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  697. * This flag only applies to HL systems, since in LL systems, \
  698. * the tx flow control is handled entirely within the target. \
  699. */ \
  700. postponed: 1, \
  701. \
  702. /* extension - \
  703. * This flag indicates whether a HTT tx MSDU extension descriptor \
  704. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  705. * \
  706. * 0x0 - no extension MSDU descriptor is present \
  707. * 0x1 - an extension MSDU descriptor immediately follows the \
  708. * regular MSDU descriptor \
  709. */ \
  710. extension: 1, \
  711. \
  712. /* cksum_offload - \
  713. * This flag indicates whether checksum offload is enabled or not \
  714. * for this frame. Target FW use this flag to turn on HW checksumming \
  715. * 0x0 - No checksum offload \
  716. * 0x1 - L3 header checksum only \
  717. * 0x2 - L4 checksum only \
  718. * 0x3 - L3 header checksum + L4 checksum \
  719. */ \
  720. cksum_offload: 2, \
  721. \
  722. /* tx_comp_req - \
  723. * This flag indicates whether Tx Completion \
  724. * from fw is required or not. \
  725. * This flag is only relevant if tx completion is not \
  726. * universally enabled. \
  727. * For all LL systems, tx completion is mandatory, \
  728. * so this flag will be irrelevant. \
  729. * For HL systems tx completion is optional, but HL systems in which \
  730. * the bus throughput exceeds the WLAN throughput will \
  731. * probably want to always use tx completion, and thus \
  732. * would not check this flag. \
  733. * This flag is required when tx completions are not used universally, \
  734. * but are still required for certain tx frames for which \
  735. * an OTA delivery acknowledgment is needed by the host. \
  736. * In practice, this would be for HL systems in which the \
  737. * bus throughput is less than the WLAN throughput. \
  738. * \
  739. * 0x0 - Tx Completion Indication from Fw not required \
  740. * 0x1 - Tx Completion Indication from Fw is required \
  741. */ \
  742. tx_compl_req: 1; \
  743. \
  744. \
  745. /* DWORD 1: MSDU length and ID */ \
  746. A_UINT32 \
  747. len: 16, /* MSDU length, in bytes */ \
  748. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  749. * and this id is used to calculate fragmentation \
  750. * descriptor pointer inside the target based on \
  751. * the base address, configured inside the target. \
  752. */ \
  753. \
  754. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  755. /* frags_desc_ptr - \
  756. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  757. * where the tx frame's fragments reside in memory. \
  758. * This field only applies to LL systems, since in HL systems the \
  759. * (degenerate single-fragment) fragmentation descriptor is created \
  760. * within the target. \
  761. */ \
  762. _paddr__frags_desc_ptr_; \
  763. \
  764. /* DWORD 3 (or 4): peerid, chanfreq */ \
  765. /* \
  766. * Peer ID : Target can use this value to know which peer-id packet \
  767. * destined to. \
  768. * It's intended to be specified by host in case of NAWDS. \
  769. */ \
  770. A_UINT16 peerid; \
  771. \
  772. /* \
  773. * Channel frequency: This identifies the desired channel \
  774. * frequency (in mhz) for tx frames. This is used by FW to help \
  775. * determine when it is safe to transmit or drop frames for \
  776. * off-channel operation. \
  777. * The default value of zero indicates to FW that the corresponding \
  778. * VDEV's home channel (if there is one) is the desired channel \
  779. * frequency. \
  780. */ \
  781. A_UINT16 chanfreq; \
  782. \
  783. /* Reason reserved is commented is increasing the htt structure size \
  784. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  785. * A_UINT32 reserved_dword3_bits0_31; \
  786. */ \
  787. } POSTPACK
  788. /* define a htt_tx_msdu_desc32_t type */
  789. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  790. /* define a htt_tx_msdu_desc64_t type */
  791. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  792. /*
  793. * Make htt_tx_msdu_desc_t be an alias for either
  794. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  795. */
  796. #if HTT_PADDR64
  797. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  798. #else
  799. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  800. #endif
  801. /* decriptor information for Management frame*/
  802. /*
  803. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  804. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  805. */
  806. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  807. extern A_UINT32 mgmt_hdr_len;
  808. PREPACK struct htt_mgmt_tx_desc_t {
  809. A_UINT32 msg_type;
  810. #if HTT_PADDR64
  811. A_UINT64 frag_paddr; /* DMAble address of the data */
  812. #else
  813. A_UINT32 frag_paddr; /* DMAble address of the data */
  814. #endif
  815. A_UINT32 desc_id; /* returned to host during completion
  816. * to free the meory*/
  817. A_UINT32 len; /* Fragment length */
  818. A_UINT32 vdev_id; /* virtual device ID*/
  819. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  820. } POSTPACK;
  821. PREPACK struct htt_mgmt_tx_compl_ind {
  822. A_UINT32 desc_id;
  823. A_UINT32 status;
  824. } POSTPACK;
  825. /*
  826. * This SDU header size comes from the summation of the following:
  827. * 1. Max of:
  828. * a. Native WiFi header, for native WiFi frames: 24 bytes
  829. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  830. * b. 802.11 header, for raw frames: 36 bytes
  831. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  832. * QoS header, HT header)
  833. * c. 802.3 header, for ethernet frames: 14 bytes
  834. * (destination address, source address, ethertype / length)
  835. * 2. Max of:
  836. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  837. * b. IPv6 header, up through the Traffic Class: 2 bytes
  838. * 3. 802.1Q VLAN header: 4 bytes
  839. * 4. LLC/SNAP header: 8 bytes
  840. */
  841. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  842. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  843. #define HTT_TX_HDR_SIZE_ETHERNET 14
  844. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  845. A_COMPILE_TIME_ASSERT(
  846. htt_encap_hdr_size_max_check_nwifi,
  847. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  848. A_COMPILE_TIME_ASSERT(
  849. htt_encap_hdr_size_max_check_enet,
  850. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  851. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  852. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  853. #define HTT_TX_HDR_SIZE_802_1Q 4
  854. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  855. #define HTT_COMMON_TX_FRM_HDR_LEN \
  856. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  857. HTT_TX_HDR_SIZE_802_1Q + \
  858. HTT_TX_HDR_SIZE_LLC_SNAP)
  859. #define HTT_HL_TX_FRM_HDR_LEN \
  860. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  861. #define HTT_LL_TX_FRM_HDR_LEN \
  862. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  863. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  864. /* dword 0 */
  865. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  866. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  867. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  868. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  869. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  870. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  871. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  872. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  873. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  874. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  875. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  876. #define HTT_TX_DESC_PKT_TYPE_S 13
  877. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  878. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  879. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  880. #define HTT_TX_DESC_VDEV_ID_S 16
  881. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  882. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  883. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  884. #define HTT_TX_DESC_EXT_TID_S 22
  885. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  886. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  887. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  888. #define HTT_TX_DESC_POSTPONED_S 27
  889. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  890. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  891. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  892. #define HTT_TX_DESC_EXTENSION_S 28
  893. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  894. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  895. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  896. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  897. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  898. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  899. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  900. #define HTT_TX_DESC_TX_COMP_S 31
  901. /* dword 1 */
  902. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  903. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  904. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  905. #define HTT_TX_DESC_FRM_LEN_S 0
  906. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  907. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  908. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  909. #define HTT_TX_DESC_FRM_ID_S 16
  910. /* dword 2 */
  911. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  913. /* for systems using 64-bit format for bus addresses */
  914. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  915. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  916. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  917. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  918. /* for systems using 32-bit format for bus addresses */
  919. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  920. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  921. /* dword 3 */
  922. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  923. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  924. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  925. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  926. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  927. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  928. #if HTT_PADDR64
  929. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  931. #else
  932. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  933. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  934. #endif
  935. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  936. #define HTT_TX_DESC_PEER_ID_S 0
  937. /*
  938. * TEMPORARY:
  939. * The original definitions for the PEER_ID fields contained typos
  940. * (with _DESC_PADDR appended to this PEER_ID field name).
  941. * Retain deprecated original names for PEER_ID fields until all code that
  942. * refers to them has been updated.
  943. */
  944. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  945. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  946. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  947. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  948. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  949. HTT_TX_DESC_PEER_ID_M
  950. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  951. HTT_TX_DESC_PEER_ID_S
  952. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  953. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  954. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  955. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  956. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  957. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  958. #if HTT_PADDR64
  959. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  961. #else
  962. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  963. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  964. #endif
  965. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  966. #define HTT_TX_DESC_CHAN_FREQ_S 16
  967. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  968. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  969. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  970. do { \
  971. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  972. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  973. } while (0)
  974. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  975. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  976. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  977. do { \
  978. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  979. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  980. } while (0)
  981. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  982. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  983. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  984. do { \
  985. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  986. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  987. } while (0)
  988. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  989. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  990. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  991. do { \
  992. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  993. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  994. } while (0)
  995. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  996. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  997. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  998. do { \
  999. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1000. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1001. } while (0)
  1002. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1003. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1004. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1005. do { \
  1006. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1007. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1008. } while (0)
  1009. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1010. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1011. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1012. do { \
  1013. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1014. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1015. } while (0)
  1016. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1017. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1018. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1019. do { \
  1020. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1021. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1022. } while (0)
  1023. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1024. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1025. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1026. do { \
  1027. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1028. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1029. } while (0)
  1030. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1031. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1032. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1033. do { \
  1034. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1035. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1036. } while (0)
  1037. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1038. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1039. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1040. do { \
  1041. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1042. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1043. } while (0)
  1044. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1045. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1046. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1047. do { \
  1048. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1049. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1050. } while (0)
  1051. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1052. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1053. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1054. do { \
  1055. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1056. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1057. } while (0)
  1058. /* enums used in the HTT tx MSDU extension descriptor */
  1059. enum {
  1060. htt_tx_guard_interval_regular = 0,
  1061. htt_tx_guard_interval_short = 1,
  1062. };
  1063. enum {
  1064. htt_tx_preamble_type_ofdm = 0,
  1065. htt_tx_preamble_type_cck = 1,
  1066. htt_tx_preamble_type_ht = 2,
  1067. htt_tx_preamble_type_vht = 3,
  1068. };
  1069. enum {
  1070. htt_tx_bandwidth_5MHz = 0,
  1071. htt_tx_bandwidth_10MHz = 1,
  1072. htt_tx_bandwidth_20MHz = 2,
  1073. htt_tx_bandwidth_40MHz = 3,
  1074. htt_tx_bandwidth_80MHz = 4,
  1075. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1076. };
  1077. /**
  1078. * @brief HTT tx MSDU extension descriptor
  1079. * @details
  1080. * If the target supports HTT tx MSDU extension descriptors, the host has
  1081. * the option of appending the following struct following the regular
  1082. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1083. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1084. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1085. * tx specs for each frame.
  1086. */
  1087. PREPACK struct htt_tx_msdu_desc_ext_t {
  1088. /* DWORD 0: flags */
  1089. A_UINT32
  1090. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1091. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1092. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1093. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1094. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1095. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1096. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1097. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1098. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1099. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1100. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1101. /* DWORD 1: tx power, tx rate, tx BW */
  1102. A_UINT32
  1103. /* pwr -
  1104. * Specify what power the tx frame needs to be transmitted at.
  1105. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1106. * The value needs to be appropriately sign-extended when extracting
  1107. * the value from the message and storing it in a variable that is
  1108. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1109. * automatically handles this sign-extension.)
  1110. * If the transmission uses multiple tx chains, this power spec is
  1111. * the total transmit power, assuming incoherent combination of
  1112. * per-chain power to produce the total power.
  1113. */
  1114. pwr: 8,
  1115. /* mcs_mask -
  1116. * Specify the allowable values for MCS index (modulation and coding)
  1117. * to use for transmitting the frame.
  1118. *
  1119. * For HT / VHT preamble types, this mask directly corresponds to
  1120. * the HT or VHT MCS indices that are allowed. For each bit N set
  1121. * within the mask, MCS index N is allowed for transmitting the frame.
  1122. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1123. * rates versus OFDM rates, so the host has the option of specifying
  1124. * that the target must transmit the frame with CCK or OFDM rates
  1125. * (not HT or VHT), but leaving the decision to the target whether
  1126. * to use CCK or OFDM.
  1127. *
  1128. * For CCK and OFDM, the bits within this mask are interpreted as
  1129. * follows:
  1130. * bit 0 -> CCK 1 Mbps rate is allowed
  1131. * bit 1 -> CCK 2 Mbps rate is allowed
  1132. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1133. * bit 3 -> CCK 11 Mbps rate is allowed
  1134. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1135. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1136. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1137. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1138. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1139. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1140. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1141. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1142. *
  1143. * The MCS index specification needs to be compatible with the
  1144. * bandwidth mask specification. For example, a MCS index == 9
  1145. * specification is inconsistent with a preamble type == VHT,
  1146. * Nss == 1, and channel bandwidth == 20 MHz.
  1147. *
  1148. * Furthermore, the host has only a limited ability to specify to
  1149. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1150. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1151. */
  1152. mcs_mask: 12,
  1153. /* nss_mask -
  1154. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1155. * Each bit in this mask corresponds to a Nss value:
  1156. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1157. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1158. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1159. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1160. * The values in the Nss mask must be suitable for the recipient, e.g.
  1161. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1162. * recipient which only supports 2x2 MIMO.
  1163. */
  1164. nss_mask: 4,
  1165. /* guard_interval -
  1166. * Specify a htt_tx_guard_interval enum value to indicate whether
  1167. * the transmission should use a regular guard interval or a
  1168. * short guard interval.
  1169. */
  1170. guard_interval: 1,
  1171. /* preamble_type_mask -
  1172. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1173. * may choose from for transmitting this frame.
  1174. * The bits in this mask correspond to the values in the
  1175. * htt_tx_preamble_type enum. For example, to allow the target
  1176. * to transmit the frame as either CCK or OFDM, this field would
  1177. * be set to
  1178. * (1 << htt_tx_preamble_type_ofdm) |
  1179. * (1 << htt_tx_preamble_type_cck)
  1180. */
  1181. preamble_type_mask: 4,
  1182. reserved1_31_29: 3; /* unused, set to 0x0 */
  1183. /* DWORD 2: tx chain mask, tx retries */
  1184. A_UINT32
  1185. /* chain_mask - specify which chains to transmit from */
  1186. chain_mask: 4,
  1187. /* retry_limit -
  1188. * Specify the maximum number of transmissions, including the
  1189. * initial transmission, to attempt before giving up if no ack
  1190. * is received.
  1191. * If the tx rate is specified, then all retries shall use the
  1192. * same rate as the initial transmission.
  1193. * If no tx rate is specified, the target can choose whether to
  1194. * retain the original rate during the retransmissions, or to
  1195. * fall back to a more robust rate.
  1196. */
  1197. retry_limit: 4,
  1198. /* bandwidth_mask -
  1199. * Specify what channel widths may be used for the transmission.
  1200. * A value of zero indicates "don't care" - the target may choose
  1201. * the transmission bandwidth.
  1202. * The bits within this mask correspond to the htt_tx_bandwidth
  1203. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1204. * The bandwidth_mask must be consistent with the preamble_type_mask
  1205. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1206. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1207. */
  1208. bandwidth_mask: 6,
  1209. reserved2_31_14: 18; /* unused, set to 0x0 */
  1210. /* DWORD 3: tx expiry time (TSF) LSBs */
  1211. A_UINT32 expire_tsf_lo;
  1212. /* DWORD 4: tx expiry time (TSF) MSBs */
  1213. A_UINT32 expire_tsf_hi;
  1214. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1215. } POSTPACK;
  1216. /* DWORD 0 */
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1237. /* DWORD 1 */
  1238. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1239. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1240. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1241. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1242. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1243. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1244. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1245. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1246. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1247. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1248. /* DWORD 2 */
  1249. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1250. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1251. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1252. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1253. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1254. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1255. /* DWORD 0 */
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1257. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1258. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1260. do { \
  1261. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1262. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1263. } while (0)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1265. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1266. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1271. } while (0)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1273. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1274. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL( \
  1278. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1279. ((_var) |= ((_val) \
  1280. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1281. } while (0)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1283. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1284. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1285. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL( \
  1288. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1289. ((_var) |= ((_val) \
  1290. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1291. } while (0)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1293. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1294. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1295. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1299. } while (0)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1301. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1302. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1303. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1307. } while (0)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1309. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1310. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1311. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1312. do { \
  1313. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1314. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1315. } while (0)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1317. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1318. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1319. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1323. } while (0)
  1324. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1325. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1326. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1327. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1328. do { \
  1329. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1330. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1331. } while (0)
  1332. /* DWORD 1 */
  1333. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1334. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1335. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1336. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1337. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1338. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1339. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1340. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1341. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1342. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1343. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1344. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1345. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1346. do { \
  1347. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1348. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1349. } while (0)
  1350. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1351. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1352. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1353. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1354. do { \
  1355. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1356. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1357. } while (0)
  1358. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1359. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1360. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1361. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1362. do { \
  1363. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1364. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1365. } while (0)
  1366. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1367. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1368. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1369. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1370. do { \
  1371. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1372. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1373. } while (0)
  1374. /* DWORD 2 */
  1375. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1376. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1377. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1378. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1381. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1382. } while (0)
  1383. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1384. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1385. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1386. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1387. do { \
  1388. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1389. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1390. } while (0)
  1391. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1392. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1393. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1394. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1395. do { \
  1396. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1397. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1398. } while (0)
  1399. typedef enum {
  1400. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1401. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1402. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1403. } htt_11ax_ltf_subtype_t;
  1404. typedef enum {
  1405. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1406. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1407. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1408. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1409. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1410. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1411. } htt_tx_ext2_preamble_type_t;
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1422. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1423. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1424. /**
  1425. * @brief HTT tx MSDU extension descriptor v2
  1426. * @details
  1427. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1428. * is received as tcl_exit_base->host_meta_info in firmware.
  1429. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1430. * are already part of tcl_exit_base.
  1431. */
  1432. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1433. /* DWORD 0: flags */
  1434. A_UINT32
  1435. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1436. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1437. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1438. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1439. valid_retries : 1, /* if set, tx retries spec is valid */
  1440. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1441. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1442. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1443. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1444. valid_key_flags : 1, /* if set, key flags is valid */
  1445. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1446. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1447. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1448. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1449. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1450. 1 = ENCRYPT,
  1451. 2 ~ 3 - Reserved */
  1452. /* retry_limit -
  1453. * Specify the maximum number of transmissions, including the
  1454. * initial transmission, to attempt before giving up if no ack
  1455. * is received.
  1456. * If the tx rate is specified, then all retries shall use the
  1457. * same rate as the initial transmission.
  1458. * If no tx rate is specified, the target can choose whether to
  1459. * retain the original rate during the retransmissions, or to
  1460. * fall back to a more robust rate.
  1461. */
  1462. retry_limit : 4,
  1463. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1464. * Valid only for 11ax preamble types HE_SU
  1465. * and HE_EXT_SU
  1466. */
  1467. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1468. * Valid only for 11ax preamble types HE_SU
  1469. * and HE_EXT_SU
  1470. */
  1471. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1472. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1473. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1474. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1475. */
  1476. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1477. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1478. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1479. * Use cases:
  1480. * Any time firmware uses TQM-BYPASS for Data
  1481. * TID, firmware expect host to set this bit.
  1482. */
  1483. /* DWORD 1: tx power, tx rate */
  1484. A_UINT32
  1485. power : 8, /* unit of the power field is 0.5 dbm
  1486. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1487. * signed value ranging from -64dbm to 63.5 dbm
  1488. */
  1489. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1490. * Setting more than one MCS isn't currently
  1491. * supported by the target (but is supported
  1492. * in the interface in case in the future
  1493. * the target supports specifications of
  1494. * a limited set of MCS values.
  1495. */
  1496. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1497. * Setting more than one Nss isn't currently
  1498. * supported by the target (but is supported
  1499. * in the interface in case in the future
  1500. * the target supports specifications of
  1501. * a limited set of Nss values.
  1502. */
  1503. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1504. update_peer_cache : 1; /* When set these custom values will be
  1505. * used for all packets, until the next
  1506. * update via this ext header.
  1507. * This is to make sure not all packets
  1508. * need to include this header.
  1509. */
  1510. /* DWORD 2: tx chain mask, tx retries */
  1511. A_UINT32
  1512. /* chain_mask - specify which chains to transmit from */
  1513. chain_mask : 8,
  1514. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1515. * TODO: Update Enum values for key_flags
  1516. */
  1517. /*
  1518. * Channel frequency: This identifies the desired channel
  1519. * frequency (in MHz) for tx frames. This is used by FW to help
  1520. * determine when it is safe to transmit or drop frames for
  1521. * off-channel operation.
  1522. * The default value of zero indicates to FW that the corresponding
  1523. * VDEV's home channel (if there is one) is the desired channel
  1524. * frequency.
  1525. */
  1526. chanfreq : 16;
  1527. /* DWORD 3: tx expiry time (TSF) LSBs */
  1528. A_UINT32 expire_tsf_lo;
  1529. /* DWORD 4: tx expiry time (TSF) MSBs */
  1530. A_UINT32 expire_tsf_hi;
  1531. /* DWORD 5: flags to control routing / processing of the MSDU */
  1532. A_UINT32
  1533. /* learning_frame
  1534. * When this flag is set, this frame will be dropped by FW
  1535. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1536. */
  1537. learning_frame : 1,
  1538. /* send_as_standalone
  1539. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1540. * i.e. with no A-MSDU or A-MPDU aggregation.
  1541. * The scope is extended to other use-cases.
  1542. */
  1543. send_as_standalone : 1,
  1544. /* is_host_opaque_valid
  1545. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1546. * with valid information.
  1547. */
  1548. is_host_opaque_valid : 1,
  1549. rsvd0 : 29;
  1550. /* DWORD 6 : Host opaque cookie for special frames */
  1551. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1552. rsvd1 : 16;
  1553. /*
  1554. * This structure can be expanded further up to 40 bytes
  1555. * by adding further DWORDs as needed.
  1556. */
  1557. } POSTPACK;
  1558. /* DWORD 0 */
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1585. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1586. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1587. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1588. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1589. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1590. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1591. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1592. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1593. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1594. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1595. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1596. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1597. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1598. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1599. /* DWORD 1 */
  1600. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1601. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1602. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1603. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1604. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1605. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1606. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1607. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1608. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1609. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1610. /* DWORD 2 */
  1611. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1612. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1613. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1614. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1615. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1616. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1617. /* DWORD 5 */
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1624. /* DWORD 6 */
  1625. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1626. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1627. /* DWORD 0 */
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1629. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1630. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1632. do { \
  1633. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1634. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1635. } while (0)
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1638. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1639. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1642. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1646. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1651. } while (0)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1654. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL( \
  1658. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1659. ((_var) |= ((_val) \
  1660. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1661. } while (0)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1663. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1664. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1665. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1666. do { \
  1667. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1668. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1669. } while (0)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1671. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1672. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1673. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1674. do { \
  1675. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1676. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1677. } while (0)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1679. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1680. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1681. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1682. do { \
  1683. HTT_CHECK_SET_VAL( \
  1684. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1685. ((_var) |= ((_val) \
  1686. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1687. } while (0)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1689. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1690. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1691. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1692. do { \
  1693. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1694. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1695. } while (0)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1697. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1698. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1699. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1700. do { \
  1701. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1702. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1703. } while (0)
  1704. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1705. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1706. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1707. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1708. do { \
  1709. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1710. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1711. } while (0)
  1712. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1713. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1714. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1715. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1716. do { \
  1717. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1718. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1719. } while (0)
  1720. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1721. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1722. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1723. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1724. do { \
  1725. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1726. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1727. } while (0)
  1728. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1729. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1730. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1731. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1732. do { \
  1733. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1734. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1735. } while (0)
  1736. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1737. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1738. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1739. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1740. do { \
  1741. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1742. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1743. } while (0)
  1744. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1745. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1746. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1747. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1748. do { \
  1749. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1750. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1751. } while (0)
  1752. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1753. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1754. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1755. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1756. do { \
  1757. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1758. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1759. } while (0)
  1760. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1761. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1762. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1763. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1764. do { \
  1765. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1766. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1767. } while (0)
  1768. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1769. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1770. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1771. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1772. do { \
  1773. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1774. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1775. } while (0)
  1776. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1777. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1778. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1779. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1780. do { \
  1781. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1782. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1783. } while (0)
  1784. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1785. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1786. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1787. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1788. do { \
  1789. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1790. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1791. } while (0)
  1792. /* DWORD 1 */
  1793. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1794. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1795. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1796. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1797. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1798. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1799. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1800. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1801. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1802. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1803. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1804. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1805. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1806. do { \
  1807. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1808. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1809. } while (0)
  1810. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1811. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1812. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1813. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1814. do { \
  1815. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1816. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1817. } while (0)
  1818. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1819. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1820. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1821. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1822. do { \
  1823. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1824. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1825. } while (0)
  1826. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1827. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1828. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1829. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1830. do { \
  1831. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1832. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1833. } while (0)
  1834. /* DWORD 2 */
  1835. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1836. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1837. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1838. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1839. do { \
  1840. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1841. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1842. } while (0)
  1843. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1844. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1845. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1846. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1847. do { \
  1848. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1849. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1850. } while (0)
  1851. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1852. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1853. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1854. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1855. do { \
  1856. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1857. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1858. } while (0)
  1859. /* DWORD 5 */
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1861. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1862. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1864. do { \
  1865. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1866. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1867. } while (0)
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1869. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1870. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1872. do { \
  1873. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1874. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1875. } while (0)
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1877. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1878. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1880. do { \
  1881. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1882. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1883. } while (0)
  1884. /* DWORD 6 */
  1885. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1886. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1887. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1888. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1889. do { \
  1890. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1891. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1892. } while (0)
  1893. typedef enum {
  1894. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1895. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1896. } htt_tcl_metadata_type;
  1897. /**
  1898. * @brief HTT TCL command number format
  1899. * @details
  1900. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1901. * available to firmware as tcl_exit_base->tcl_status_number.
  1902. * For regular / multicast packets host will send vdev and mac id and for
  1903. * NAWDS packets, host will send peer id.
  1904. * A_UINT32 is used to avoid endianness conversion problems.
  1905. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1906. */
  1907. typedef struct {
  1908. A_UINT32
  1909. type: 1, /* vdev_id based or peer_id based */
  1910. rsvd: 31;
  1911. } htt_tx_tcl_vdev_or_peer_t;
  1912. typedef struct {
  1913. A_UINT32
  1914. type: 1, /* vdev_id based or peer_id based */
  1915. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1916. vdev_id: 8,
  1917. pdev_id: 2,
  1918. host_inspected:1,
  1919. rsvd: 19;
  1920. } htt_tx_tcl_vdev_metadata;
  1921. typedef struct {
  1922. A_UINT32
  1923. type: 1, /* vdev_id based or peer_id based */
  1924. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1925. peer_id: 14,
  1926. rsvd: 16;
  1927. } htt_tx_tcl_peer_metadata;
  1928. PREPACK struct htt_tx_tcl_metadata {
  1929. union {
  1930. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1931. htt_tx_tcl_vdev_metadata vdev_meta;
  1932. htt_tx_tcl_peer_metadata peer_meta;
  1933. };
  1934. } POSTPACK;
  1935. /* DWORD 0 */
  1936. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1937. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1938. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1939. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1940. /* VDEV metadata */
  1941. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1942. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1943. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1944. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1945. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1946. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1947. /* PEER metadata */
  1948. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1949. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1950. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1951. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1952. HTT_TX_TCL_METADATA_TYPE_S)
  1953. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1954. do { \
  1955. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1956. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1957. } while (0)
  1958. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1959. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1960. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1961. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1964. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1965. } while (0)
  1966. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1967. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1968. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1969. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1972. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1973. } while (0)
  1974. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1975. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1976. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1977. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1980. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1981. } while (0)
  1982. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1983. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1984. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1985. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1988. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1989. } while (0)
  1990. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1991. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1992. HTT_TX_TCL_METADATA_PEER_ID_S)
  1993. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1994. do { \
  1995. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1996. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1997. } while (0)
  1998. typedef enum {
  1999. HTT_TX_FW2WBM_TX_STATUS_OK,
  2000. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2001. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2002. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2003. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2004. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2005. HTT_TX_FW2WBM_TX_STATUS_MAX
  2006. } htt_tx_fw2wbm_tx_status_t;
  2007. typedef enum {
  2008. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2009. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2010. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2011. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2012. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2013. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2014. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2015. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2016. } htt_tx_fw2wbm_reinject_reason_t;
  2017. /**
  2018. * @brief HTT TX WBM Completion from firmware to host
  2019. * @details
  2020. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2021. * DWORD 3 and 4 for software based completions (Exception frames and
  2022. * TQM bypass frames)
  2023. * For software based completions, wbm_release_ring->release_source_module will
  2024. * be set to release_source_fw
  2025. */
  2026. PREPACK struct htt_tx_wbm_completion {
  2027. A_UINT32
  2028. sch_cmd_id: 24,
  2029. exception_frame: 1, /* If set, this packet was queued via exception path */
  2030. rsvd0_31_25: 7;
  2031. A_UINT32
  2032. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2033. * reception of an ACK or BA, this field indicates
  2034. * the RSSI of the received ACK or BA frame.
  2035. * When the frame is removed as result of a direct
  2036. * remove command from the SW, this field is set
  2037. * to 0x0 (which is never a valid value when real
  2038. * RSSI is available).
  2039. * Units: dB w.r.t noise floor
  2040. */
  2041. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2042. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2043. rsvd1_31_16: 16;
  2044. } POSTPACK;
  2045. /* DWORD 0 */
  2046. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2047. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2048. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2049. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2050. /* DWORD 1 */
  2051. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2052. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2053. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2054. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2055. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2056. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2057. /* DWORD 0 */
  2058. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2059. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2060. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2061. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2062. do { \
  2063. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2064. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2065. } while (0)
  2066. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2067. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2068. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2069. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2070. do { \
  2071. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2072. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2073. } while (0)
  2074. /* DWORD 1 */
  2075. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2076. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2077. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2078. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2079. do { \
  2080. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2081. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2082. } while (0)
  2083. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2084. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2085. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2086. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2090. } while (0)
  2091. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2092. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2093. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2094. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2098. } while (0)
  2099. /**
  2100. * @brief HTT TX WBM Completion from firmware to host
  2101. * @details
  2102. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2103. * (WBM) offload HW.
  2104. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2105. * For software based completions, release_source_module will
  2106. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2107. * struct wbm_release_ring and then switch to this after looking at
  2108. * release_source_module.
  2109. */
  2110. PREPACK struct htt_tx_wbm_completion_v2 {
  2111. A_UINT32
  2112. used_by_hw0; /* Refer to struct wbm_release_ring */
  2113. A_UINT32
  2114. used_by_hw1; /* Refer to struct wbm_release_ring */
  2115. A_UINT32
  2116. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2117. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2118. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2119. exception_frame: 1,
  2120. rsvd0: 12, /* For future use */
  2121. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2122. rsvd1: 1; /* For future use */
  2123. A_UINT32
  2124. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2125. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2126. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2127. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2128. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2129. */
  2130. A_UINT32
  2131. data1: 32;
  2132. A_UINT32
  2133. data2: 32;
  2134. A_UINT32
  2135. used_by_hw3; /* Refer to struct wbm_release_ring */
  2136. } POSTPACK;
  2137. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2138. /* DWORD 3 */
  2139. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2140. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2141. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2142. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2143. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2144. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2145. /* DWORD 3 */
  2146. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2147. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2148. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2149. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2150. do { \
  2151. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2152. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2153. } while (0)
  2154. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2155. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2156. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2157. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2158. do { \
  2159. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2160. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2161. } while (0)
  2162. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2163. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2164. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2165. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2169. } while (0)
  2170. /**
  2171. * @brief HTT TX WBM transmit status from firmware to host
  2172. * @details
  2173. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2174. * (WBM) offload HW.
  2175. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2176. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2177. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2178. */
  2179. PREPACK struct htt_tx_wbm_transmit_status {
  2180. A_UINT32
  2181. sch_cmd_id: 24,
  2182. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2183. * reception of an ACK or BA, this field indicates
  2184. * the RSSI of the received ACK or BA frame.
  2185. * When the frame is removed as result of a direct
  2186. * remove command from the SW, this field is set
  2187. * to 0x0 (which is never a valid value when real
  2188. * RSSI is available).
  2189. * Units: dB w.r.t noise floor
  2190. */
  2191. A_UINT32
  2192. sw_peer_id: 16,
  2193. tid_num: 5,
  2194. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2195. * and tid_num fields contain valid data.
  2196. * If this "valid" flag is not set, the
  2197. * sw_peer_id and tid_num fields must be ignored.
  2198. */
  2199. mcast: 1,
  2200. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2201. * contains valid data.
  2202. */
  2203. reserved0: 8;
  2204. A_UINT32
  2205. reserved1: 32;
  2206. } POSTPACK;
  2207. /* DWORD 4 */
  2208. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2209. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2210. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2211. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2212. /* DWORD 5 */
  2213. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2214. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2215. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2216. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2217. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2218. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2219. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2220. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2221. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2222. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2223. /* DWORD 4 */
  2224. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2225. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2226. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2227. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2228. do { \
  2229. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2230. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2231. } while (0)
  2232. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2233. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2234. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2235. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2236. do { \
  2237. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2238. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2239. } while (0)
  2240. /* DWORD 5 */
  2241. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2242. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2243. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2244. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2245. do { \
  2246. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2247. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2248. } while (0)
  2249. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2250. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2251. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2252. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2253. do { \
  2254. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2255. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2256. } while (0)
  2257. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2258. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2259. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2260. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2261. do { \
  2262. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2263. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2264. } while (0)
  2265. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2266. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2267. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2268. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2272. } while (0)
  2273. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2274. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2275. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2276. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2280. } while (0)
  2281. /**
  2282. * @brief HTT TX WBM reinject status from firmware to host
  2283. * @details
  2284. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2285. * (WBM) offload HW.
  2286. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2287. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2288. */
  2289. PREPACK struct htt_tx_wbm_reinject_status {
  2290. A_UINT32
  2291. reserved0: 32;
  2292. A_UINT32
  2293. reserved1: 32;
  2294. A_UINT32
  2295. reserved2: 32;
  2296. } POSTPACK;
  2297. /**
  2298. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2299. * @details
  2300. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2301. * (WBM) offload HW.
  2302. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2303. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2304. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2305. * STA side.
  2306. */
  2307. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2308. A_UINT32
  2309. mec_sa_addr_31_0;
  2310. A_UINT32
  2311. mec_sa_addr_47_32: 16,
  2312. sa_ast_index: 16;
  2313. A_UINT32
  2314. vdev_id: 8,
  2315. reserved0: 24;
  2316. } POSTPACK;
  2317. /* DWORD 4 - mec_sa_addr_31_0 */
  2318. /* DWORD 5 */
  2319. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2320. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2321. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2322. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2323. /* DWORD 6 */
  2324. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2325. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2326. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2327. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2328. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2329. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2330. do { \
  2331. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2332. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2333. } while (0)
  2334. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2335. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2336. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2337. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2338. do { \
  2339. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2340. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2341. } while (0)
  2342. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2343. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2344. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2345. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2346. do { \
  2347. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2348. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2349. } while (0)
  2350. typedef enum {
  2351. TX_FLOW_PRIORITY_BE,
  2352. TX_FLOW_PRIORITY_HIGH,
  2353. TX_FLOW_PRIORITY_LOW,
  2354. } htt_tx_flow_priority_t;
  2355. typedef enum {
  2356. TX_FLOW_LATENCY_SENSITIVE,
  2357. TX_FLOW_LATENCY_INSENSITIVE,
  2358. } htt_tx_flow_latency_t;
  2359. typedef enum {
  2360. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2361. TX_FLOW_INTERACTIVE_TRAFFIC,
  2362. TX_FLOW_PERIODIC_TRAFFIC,
  2363. TX_FLOW_BURSTY_TRAFFIC,
  2364. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2365. } htt_tx_flow_traffic_pattern_t;
  2366. /**
  2367. * @brief HTT TX Flow search metadata format
  2368. * @details
  2369. * Host will set this metadata in flow table's flow search entry along with
  2370. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2371. * firmware and TQM ring if the flow search entry wins.
  2372. * This metadata is available to firmware in that first MSDU's
  2373. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2374. * to one of the available flows for specific tid and returns the tqm flow
  2375. * pointer as part of htt_tx_map_flow_info message.
  2376. */
  2377. PREPACK struct htt_tx_flow_metadata {
  2378. A_UINT32
  2379. rsvd0_1_0: 2,
  2380. tid: 4,
  2381. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2382. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2383. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2384. * Else choose final tid based on latency, priority.
  2385. */
  2386. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2387. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2388. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2389. } POSTPACK;
  2390. /* DWORD 0 */
  2391. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2392. #define HTT_TX_FLOW_METADATA_TID_S 2
  2393. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2394. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2395. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2396. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2397. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2398. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2399. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2400. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2401. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2402. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2403. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2404. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2405. /* DWORD 0 */
  2406. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2407. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2408. HTT_TX_FLOW_METADATA_TID_S)
  2409. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2410. do { \
  2411. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2412. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2413. } while (0)
  2414. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2415. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2416. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2417. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2418. do { \
  2419. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2420. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2421. } while (0)
  2422. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2423. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2424. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2425. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2428. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2429. } while (0)
  2430. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2431. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2432. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2433. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2436. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2437. } while (0)
  2438. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2439. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2440. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2441. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2444. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2445. } while (0)
  2446. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2447. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2448. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2449. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2452. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2453. } while (0)
  2454. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2455. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2456. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2457. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2458. do { \
  2459. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2460. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2461. } while (0)
  2462. /**
  2463. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2464. *
  2465. * @details
  2466. * HTT wds entry from source port learning
  2467. * Host will learn wds entries from rx and send this message to firmware
  2468. * to enable firmware to configure/delete AST entries for wds clients.
  2469. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2470. * and when SA's entry is deleted, firmware removes this AST entry
  2471. *
  2472. * The message would appear as follows:
  2473. *
  2474. * |31 30|29 |17 16|15 8|7 0|
  2475. * |----------------+----------------+----------------+----------------|
  2476. * | rsvd0 |PDVID| vdev_id | msg_type |
  2477. * |-------------------------------------------------------------------|
  2478. * | sa_addr_31_0 |
  2479. * |-------------------------------------------------------------------|
  2480. * | | ta_peer_id | sa_addr_47_32 |
  2481. * |-------------------------------------------------------------------|
  2482. * Where PDVID = pdev_id
  2483. *
  2484. * The message is interpreted as follows:
  2485. *
  2486. * dword0 - b'0:7 - msg_type: This will be set to
  2487. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2488. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2489. *
  2490. * dword0 - b'8:15 - vdev_id
  2491. *
  2492. * dword0 - b'16:17 - pdev_id
  2493. *
  2494. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2495. *
  2496. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2497. *
  2498. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2499. *
  2500. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2501. */
  2502. PREPACK struct htt_wds_entry {
  2503. A_UINT32
  2504. msg_type: 8,
  2505. vdev_id: 8,
  2506. pdev_id: 2,
  2507. rsvd0: 14;
  2508. A_UINT32 sa_addr_31_0;
  2509. A_UINT32
  2510. sa_addr_47_32: 16,
  2511. ta_peer_id: 14,
  2512. rsvd2: 2;
  2513. } POSTPACK;
  2514. /* DWORD 0 */
  2515. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2516. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2517. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2518. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2519. /* DWORD 2 */
  2520. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2521. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2522. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2523. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2524. /* DWORD 0 */
  2525. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2526. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2527. HTT_WDS_ENTRY_VDEV_ID_S)
  2528. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2529. do { \
  2530. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2531. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2532. } while (0)
  2533. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2534. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2535. HTT_WDS_ENTRY_PDEV_ID_S)
  2536. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2537. do { \
  2538. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2539. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2540. } while (0)
  2541. /* DWORD 2 */
  2542. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2543. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2544. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2545. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2546. do { \
  2547. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2548. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2549. } while (0)
  2550. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2551. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2552. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2553. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2554. do { \
  2555. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2556. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2557. } while (0)
  2558. /**
  2559. * @brief MAC DMA rx ring setup specification
  2560. * @details
  2561. * To allow for dynamic rx ring reconfiguration and to avoid race
  2562. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2563. * it uses. Instead, it sends this message to the target, indicating how
  2564. * the rx ring used by the host should be set up and maintained.
  2565. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2566. * specifications.
  2567. *
  2568. * |31 16|15 8|7 0|
  2569. * |---------------------------------------------------------------|
  2570. * header: | reserved | num rings | msg type |
  2571. * |---------------------------------------------------------------|
  2572. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2573. #if HTT_PADDR64
  2574. * | FW_IDX shadow register physical address (bits 63:32) |
  2575. #endif
  2576. * |---------------------------------------------------------------|
  2577. * | rx ring base physical address (bits 31:0) |
  2578. #if HTT_PADDR64
  2579. * | rx ring base physical address (bits 63:32) |
  2580. #endif
  2581. * |---------------------------------------------------------------|
  2582. * | rx ring buffer size | rx ring length |
  2583. * |---------------------------------------------------------------|
  2584. * | FW_IDX initial value | enabled flags |
  2585. * |---------------------------------------------------------------|
  2586. * | MSDU payload offset | 802.11 header offset |
  2587. * |---------------------------------------------------------------|
  2588. * | PPDU end offset | PPDU start offset |
  2589. * |---------------------------------------------------------------|
  2590. * | MPDU end offset | MPDU start offset |
  2591. * |---------------------------------------------------------------|
  2592. * | MSDU end offset | MSDU start offset |
  2593. * |---------------------------------------------------------------|
  2594. * | frag info offset | rx attention offset |
  2595. * |---------------------------------------------------------------|
  2596. * payload 2, if present, has the same format as payload 1
  2597. * Header fields:
  2598. * - MSG_TYPE
  2599. * Bits 7:0
  2600. * Purpose: identifies this as an rx ring configuration message
  2601. * Value: 0x2
  2602. * - NUM_RINGS
  2603. * Bits 15:8
  2604. * Purpose: indicates whether the host is setting up one rx ring or two
  2605. * Value: 1 or 2
  2606. * Payload:
  2607. * for systems using 64-bit format for bus addresses:
  2608. * - IDX_SHADOW_REG_PADDR_LO
  2609. * Bits 31:0
  2610. * Value: lower 4 bytes of physical address of the host's
  2611. * FW_IDX shadow register
  2612. * - IDX_SHADOW_REG_PADDR_HI
  2613. * Bits 31:0
  2614. * Value: upper 4 bytes of physical address of the host's
  2615. * FW_IDX shadow register
  2616. * - RING_BASE_PADDR_LO
  2617. * Bits 31:0
  2618. * Value: lower 4 bytes of physical address of the host's rx ring
  2619. * - RING_BASE_PADDR_HI
  2620. * Bits 31:0
  2621. * Value: uppper 4 bytes of physical address of the host's rx ring
  2622. * for systems using 32-bit format for bus addresses:
  2623. * - IDX_SHADOW_REG_PADDR
  2624. * Bits 31:0
  2625. * Value: physical address of the host's FW_IDX shadow register
  2626. * - RING_BASE_PADDR
  2627. * Bits 31:0
  2628. * Value: physical address of the host's rx ring
  2629. * - RING_LEN
  2630. * Bits 15:0
  2631. * Value: number of elements in the rx ring
  2632. * - RING_BUF_SZ
  2633. * Bits 31:16
  2634. * Value: size of the buffers referenced by the rx ring, in byte units
  2635. * - ENABLED_FLAGS
  2636. * Bits 15:0
  2637. * Value: 1-bit flags to show whether different rx fields are enabled
  2638. * bit 0: 802.11 header enabled (1) or disabled (0)
  2639. * bit 1: MSDU payload enabled (1) or disabled (0)
  2640. * bit 2: PPDU start enabled (1) or disabled (0)
  2641. * bit 3: PPDU end enabled (1) or disabled (0)
  2642. * bit 4: MPDU start enabled (1) or disabled (0)
  2643. * bit 5: MPDU end enabled (1) or disabled (0)
  2644. * bit 6: MSDU start enabled (1) or disabled (0)
  2645. * bit 7: MSDU end enabled (1) or disabled (0)
  2646. * bit 8: rx attention enabled (1) or disabled (0)
  2647. * bit 9: frag info enabled (1) or disabled (0)
  2648. * bit 10: unicast rx enabled (1) or disabled (0)
  2649. * bit 11: multicast rx enabled (1) or disabled (0)
  2650. * bit 12: ctrl rx enabled (1) or disabled (0)
  2651. * bit 13: mgmt rx enabled (1) or disabled (0)
  2652. * bit 14: null rx enabled (1) or disabled (0)
  2653. * bit 15: phy data rx enabled (1) or disabled (0)
  2654. * - IDX_INIT_VAL
  2655. * Bits 31:16
  2656. * Purpose: Specify the initial value for the FW_IDX.
  2657. * Value: the number of buffers initially present in the host's rx ring
  2658. * - OFFSET_802_11_HDR
  2659. * Bits 15:0
  2660. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2661. * - OFFSET_MSDU_PAYLOAD
  2662. * Bits 31:16
  2663. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2664. * - OFFSET_PPDU_START
  2665. * Bits 15:0
  2666. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2667. * - OFFSET_PPDU_END
  2668. * Bits 31:16
  2669. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2670. * - OFFSET_MPDU_START
  2671. * Bits 15:0
  2672. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2673. * - OFFSET_MPDU_END
  2674. * Bits 31:16
  2675. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2676. * - OFFSET_MSDU_START
  2677. * Bits 15:0
  2678. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2679. * - OFFSET_MSDU_END
  2680. * Bits 31:16
  2681. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2682. * - OFFSET_RX_ATTN
  2683. * Bits 15:0
  2684. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2685. * - OFFSET_FRAG_INFO
  2686. * Bits 31:16
  2687. * Value: offset in QUAD-bytes of frag info table
  2688. */
  2689. /* header fields */
  2690. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2691. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2692. /* payload fields */
  2693. /* for systems using a 64-bit format for bus addresses */
  2694. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2695. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2696. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2697. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2698. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2699. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2700. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2701. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2702. /* for systems using a 32-bit format for bus addresses */
  2703. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2704. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2705. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2706. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2707. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2708. #define HTT_RX_RING_CFG_LEN_S 0
  2709. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2710. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2711. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2712. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2713. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2714. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2715. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2716. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2717. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2718. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2719. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2720. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2721. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2722. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2723. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2724. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2725. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2726. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2727. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2728. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2729. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2730. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2731. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2732. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2733. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2734. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2735. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2736. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2737. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2738. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2739. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2740. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2741. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2742. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2743. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2744. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2745. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2746. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2747. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2748. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2749. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2750. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2751. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2752. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2753. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2754. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2755. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2756. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2757. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2758. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2759. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2760. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2761. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2762. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2763. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2764. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2765. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2766. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2767. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2768. #if HTT_PADDR64
  2769. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2770. #else
  2771. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2772. #endif
  2773. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2774. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2775. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2776. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2777. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2778. do { \
  2779. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2780. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2781. } while (0)
  2782. /* degenerate case for 32-bit fields */
  2783. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2784. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2785. ((_var) = (_val))
  2786. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2787. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2788. ((_var) = (_val))
  2789. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2790. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2791. ((_var) = (_val))
  2792. /* degenerate case for 32-bit fields */
  2793. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2794. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2795. ((_var) = (_val))
  2796. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2797. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2798. ((_var) = (_val))
  2799. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2800. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2801. ((_var) = (_val))
  2802. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2803. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2804. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2805. do { \
  2806. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2807. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2808. } while (0)
  2809. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2810. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2811. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2812. do { \
  2813. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2814. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2815. } while (0)
  2816. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2817. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2818. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2819. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2820. do { \
  2821. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2822. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2823. } while (0)
  2824. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2825. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2826. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2827. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2830. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2831. } while (0)
  2832. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2833. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2834. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2835. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2838. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2839. } while (0)
  2840. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2841. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2842. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2843. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2844. do { \
  2845. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2846. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2847. } while (0)
  2848. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2849. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2850. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2851. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2852. do { \
  2853. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2854. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2855. } while (0)
  2856. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2857. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2858. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2859. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2860. do { \
  2861. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2862. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2863. } while (0)
  2864. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2865. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2866. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2867. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2868. do { \
  2869. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2870. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2871. } while (0)
  2872. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2873. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2874. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2875. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2876. do { \
  2877. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2878. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2879. } while (0)
  2880. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2881. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2882. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2883. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2884. do { \
  2885. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2886. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2887. } while (0)
  2888. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2889. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2890. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2891. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2892. do { \
  2893. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2894. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2895. } while (0)
  2896. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2897. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2898. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2899. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2900. do { \
  2901. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2902. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2903. } while (0)
  2904. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2905. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2906. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2907. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2908. do { \
  2909. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2910. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2911. } while (0)
  2912. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2913. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2914. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2915. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2918. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2919. } while (0)
  2920. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2921. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2922. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2923. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2926. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2927. } while (0)
  2928. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2929. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2930. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2931. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2934. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2935. } while (0)
  2936. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2937. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2938. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2939. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2940. do { \
  2941. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2942. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2943. } while (0)
  2944. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2945. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2946. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2947. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2950. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2951. } while (0)
  2952. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2953. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2954. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2955. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2958. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2959. } while (0)
  2960. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2961. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2962. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2963. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2966. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2967. } while (0)
  2968. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2969. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2970. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2971. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2974. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2975. } while (0)
  2976. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2977. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2978. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2979. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2980. do { \
  2981. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2982. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2983. } while (0)
  2984. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2985. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2986. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2987. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2988. do { \
  2989. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2990. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2991. } while (0)
  2992. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2993. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2994. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2995. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2996. do { \
  2997. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2998. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2999. } while (0)
  3000. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3001. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3002. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3003. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3004. do { \
  3005. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3006. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3007. } while (0)
  3008. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3009. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3010. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3011. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3014. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3015. } while (0)
  3016. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3017. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3018. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3019. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3022. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3023. } while (0)
  3024. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3025. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3026. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3027. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3028. do { \
  3029. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3030. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3031. } while (0)
  3032. /**
  3033. * @brief host -> target FW statistics retrieve
  3034. *
  3035. * @details
  3036. * The following field definitions describe the format of the HTT host
  3037. * to target FW stats retrieve message. The message specifies the type of
  3038. * stats host wants to retrieve.
  3039. *
  3040. * |31 24|23 16|15 8|7 0|
  3041. * |-----------------------------------------------------------|
  3042. * | stats types request bitmask | msg type |
  3043. * |-----------------------------------------------------------|
  3044. * | stats types reset bitmask | reserved |
  3045. * |-----------------------------------------------------------|
  3046. * | stats type | config value |
  3047. * |-----------------------------------------------------------|
  3048. * | cookie LSBs |
  3049. * |-----------------------------------------------------------|
  3050. * | cookie MSBs |
  3051. * |-----------------------------------------------------------|
  3052. * Header fields:
  3053. * - MSG_TYPE
  3054. * Bits 7:0
  3055. * Purpose: identifies this is a stats upload request message
  3056. * Value: 0x3
  3057. * - UPLOAD_TYPES
  3058. * Bits 31:8
  3059. * Purpose: identifies which types of FW statistics to upload
  3060. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3061. * - RESET_TYPES
  3062. * Bits 31:8
  3063. * Purpose: identifies which types of FW statistics to reset
  3064. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3065. * - CFG_VAL
  3066. * Bits 23:0
  3067. * Purpose: give an opaque configuration value to the specified stats type
  3068. * Value: stats-type specific configuration value
  3069. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3070. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3071. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3072. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3073. * - CFG_STAT_TYPE
  3074. * Bits 31:24
  3075. * Purpose: specify which stats type (if any) the config value applies to
  3076. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3077. * a valid configuration specification
  3078. * - COOKIE_LSBS
  3079. * Bits 31:0
  3080. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3081. * message with its preceding host->target stats request message.
  3082. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3083. * - COOKIE_MSBS
  3084. * Bits 31:0
  3085. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3086. * message with its preceding host->target stats request message.
  3087. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3088. */
  3089. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3090. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3091. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3092. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3093. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3094. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3095. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3096. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3097. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3098. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3099. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3100. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3101. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3102. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3103. do { \
  3104. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3105. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3106. } while (0)
  3107. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3108. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3109. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3110. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3111. do { \
  3112. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3113. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3114. } while (0)
  3115. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3116. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3117. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3118. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3119. do { \
  3120. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3121. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3122. } while (0)
  3123. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3124. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3125. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3126. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3127. do { \
  3128. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3129. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3130. } while (0)
  3131. /**
  3132. * @brief host -> target HTT out-of-band sync request
  3133. *
  3134. * @details
  3135. * The HTT SYNC tells the target to suspend processing of subsequent
  3136. * HTT host-to-target messages until some other target agent locally
  3137. * informs the target HTT FW that the current sync counter is equal to
  3138. * or greater than (in a modulo sense) the sync counter specified in
  3139. * the SYNC message.
  3140. * This allows other host-target components to synchronize their operation
  3141. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3142. * security key has been downloaded to and activated by the target.
  3143. * In the absence of any explicit synchronization counter value
  3144. * specification, the target HTT FW will use zero as the default current
  3145. * sync value.
  3146. *
  3147. * |31 24|23 16|15 8|7 0|
  3148. * |-----------------------------------------------------------|
  3149. * | reserved | sync count | msg type |
  3150. * |-----------------------------------------------------------|
  3151. * Header fields:
  3152. * - MSG_TYPE
  3153. * Bits 7:0
  3154. * Purpose: identifies this as a sync message
  3155. * Value: 0x4
  3156. * - SYNC_COUNT
  3157. * Bits 15:8
  3158. * Purpose: specifies what sync value the HTT FW will wait for from
  3159. * an out-of-band specification to resume its operation
  3160. * Value: in-band sync counter value to compare against the out-of-band
  3161. * counter spec.
  3162. * The HTT target FW will suspend its host->target message processing
  3163. * as long as
  3164. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3165. */
  3166. #define HTT_H2T_SYNC_MSG_SZ 4
  3167. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3168. #define HTT_H2T_SYNC_COUNT_S 8
  3169. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3170. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3171. HTT_H2T_SYNC_COUNT_S)
  3172. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3173. do { \
  3174. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3175. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3176. } while (0)
  3177. /**
  3178. * @brief HTT aggregation configuration
  3179. */
  3180. #define HTT_AGGR_CFG_MSG_SZ 4
  3181. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3182. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3183. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3184. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3185. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3186. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3187. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3188. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3189. do { \
  3190. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3191. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3192. } while (0)
  3193. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3194. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3195. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3196. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3197. do { \
  3198. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3199. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3200. } while (0)
  3201. /**
  3202. * @brief host -> target HTT configure max amsdu info per vdev
  3203. *
  3204. * @details
  3205. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3206. *
  3207. * |31 21|20 16|15 8|7 0|
  3208. * |-----------------------------------------------------------|
  3209. * | reserved | vdev id | max amsdu | msg type |
  3210. * |-----------------------------------------------------------|
  3211. * Header fields:
  3212. * - MSG_TYPE
  3213. * Bits 7:0
  3214. * Purpose: identifies this as a aggr cfg ex message
  3215. * Value: 0xa
  3216. * - MAX_NUM_AMSDU_SUBFRM
  3217. * Bits 15:8
  3218. * Purpose: max MSDUs per A-MSDU
  3219. * - VDEV_ID
  3220. * Bits 20:16
  3221. * Purpose: ID of the vdev to which this limit is applied
  3222. */
  3223. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3224. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3225. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3226. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3227. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3228. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3229. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3230. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3231. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3232. do { \
  3233. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3234. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3235. } while (0)
  3236. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3237. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3238. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3239. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3240. do { \
  3241. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3242. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3243. } while (0)
  3244. /**
  3245. * @brief HTT WDI_IPA Config Message
  3246. *
  3247. * @details
  3248. * The HTT WDI_IPA config message is created/sent by host at driver
  3249. * init time. It contains information about data structures used on
  3250. * WDI_IPA TX and RX path.
  3251. * TX CE ring is used for pushing packet metadata from IPA uC
  3252. * to WLAN FW
  3253. * TX Completion ring is used for generating TX completions from
  3254. * WLAN FW to IPA uC
  3255. * RX Indication ring is used for indicating RX packets from FW
  3256. * to IPA uC
  3257. * RX Ring2 is used as either completion ring or as second
  3258. * indication ring. when Ring2 is used as completion ring, IPA uC
  3259. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3260. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3261. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3262. * indicated in RX Indication ring. Please see WDI_IPA specification
  3263. * for more details.
  3264. * |31 24|23 16|15 8|7 0|
  3265. * |----------------+----------------+----------------+----------------|
  3266. * | tx pkt pool size | Rsvd | msg_type |
  3267. * |-------------------------------------------------------------------|
  3268. * | tx comp ring base (bits 31:0) |
  3269. #if HTT_PADDR64
  3270. * | tx comp ring base (bits 63:32) |
  3271. #endif
  3272. * |-------------------------------------------------------------------|
  3273. * | tx comp ring size |
  3274. * |-------------------------------------------------------------------|
  3275. * | tx comp WR_IDX physical address (bits 31:0) |
  3276. #if HTT_PADDR64
  3277. * | tx comp WR_IDX physical address (bits 63:32) |
  3278. #endif
  3279. * |-------------------------------------------------------------------|
  3280. * | tx CE WR_IDX physical address (bits 31:0) |
  3281. #if HTT_PADDR64
  3282. * | tx CE WR_IDX physical address (bits 63:32) |
  3283. #endif
  3284. * |-------------------------------------------------------------------|
  3285. * | rx indication ring base (bits 31:0) |
  3286. #if HTT_PADDR64
  3287. * | rx indication ring base (bits 63:32) |
  3288. #endif
  3289. * |-------------------------------------------------------------------|
  3290. * | rx indication ring size |
  3291. * |-------------------------------------------------------------------|
  3292. * | rx ind RD_IDX physical address (bits 31:0) |
  3293. #if HTT_PADDR64
  3294. * | rx ind RD_IDX physical address (bits 63:32) |
  3295. #endif
  3296. * |-------------------------------------------------------------------|
  3297. * | rx ind WR_IDX physical address (bits 31:0) |
  3298. #if HTT_PADDR64
  3299. * | rx ind WR_IDX physical address (bits 63:32) |
  3300. #endif
  3301. * |-------------------------------------------------------------------|
  3302. * |-------------------------------------------------------------------|
  3303. * | rx ring2 base (bits 31:0) |
  3304. #if HTT_PADDR64
  3305. * | rx ring2 base (bits 63:32) |
  3306. #endif
  3307. * |-------------------------------------------------------------------|
  3308. * | rx ring2 size |
  3309. * |-------------------------------------------------------------------|
  3310. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3311. #if HTT_PADDR64
  3312. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3313. #endif
  3314. * |-------------------------------------------------------------------|
  3315. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3316. #if HTT_PADDR64
  3317. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3318. #endif
  3319. * |-------------------------------------------------------------------|
  3320. *
  3321. * Header fields:
  3322. * Header fields:
  3323. * - MSG_TYPE
  3324. * Bits 7:0
  3325. * Purpose: Identifies this as WDI_IPA config message
  3326. * value: = 0x8
  3327. * - TX_PKT_POOL_SIZE
  3328. * Bits 15:0
  3329. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3330. * WDI_IPA TX path
  3331. * For systems using 32-bit format for bus addresses:
  3332. * - TX_COMP_RING_BASE_ADDR
  3333. * Bits 31:0
  3334. * Purpose: TX Completion Ring base address in DDR
  3335. * - TX_COMP_RING_SIZE
  3336. * Bits 31:0
  3337. * Purpose: TX Completion Ring size (must be power of 2)
  3338. * - TX_COMP_WR_IDX_ADDR
  3339. * Bits 31:0
  3340. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3341. * updates the Write Index for WDI_IPA TX completion ring
  3342. * - TX_CE_WR_IDX_ADDR
  3343. * Bits 31:0
  3344. * Purpose: DDR address where IPA uC
  3345. * updates the WR Index for TX CE ring
  3346. * (needed for fusion platforms)
  3347. * - RX_IND_RING_BASE_ADDR
  3348. * Bits 31:0
  3349. * Purpose: RX Indication Ring base address in DDR
  3350. * - RX_IND_RING_SIZE
  3351. * Bits 31:0
  3352. * Purpose: RX Indication Ring size
  3353. * - RX_IND_RD_IDX_ADDR
  3354. * Bits 31:0
  3355. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3356. * RX indication ring
  3357. * - RX_IND_WR_IDX_ADDR
  3358. * Bits 31:0
  3359. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3360. * updates the Write Index for WDI_IPA RX indication ring
  3361. * - RX_RING2_BASE_ADDR
  3362. * Bits 31:0
  3363. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3364. * - RX_RING2_SIZE
  3365. * Bits 31:0
  3366. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3367. * - RX_RING2_RD_IDX_ADDR
  3368. * Bits 31:0
  3369. * Purpose: If Second RX ring is Indication ring, DDR address where
  3370. * IPA uC updates the Read Index for Ring2.
  3371. * If Second RX ring is completion ring, this is NOT used
  3372. * - RX_RING2_WR_IDX_ADDR
  3373. * Bits 31:0
  3374. * Purpose: If Second RX ring is Indication ring, DDR address where
  3375. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3376. * If second RX ring is completion ring, DDR address where
  3377. * IPA uC updates the Write Index for Ring 2.
  3378. * For systems using 64-bit format for bus addresses:
  3379. * - TX_COMP_RING_BASE_ADDR_LO
  3380. * Bits 31:0
  3381. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3382. * - TX_COMP_RING_BASE_ADDR_HI
  3383. * Bits 31:0
  3384. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3385. * - TX_COMP_RING_SIZE
  3386. * Bits 31:0
  3387. * Purpose: TX Completion Ring size (must be power of 2)
  3388. * - TX_COMP_WR_IDX_ADDR_LO
  3389. * Bits 31:0
  3390. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3391. * Lower 4 bytes of DDR address where WIFI FW
  3392. * updates the Write Index for WDI_IPA TX completion ring
  3393. * - TX_COMP_WR_IDX_ADDR_HI
  3394. * Bits 31:0
  3395. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3396. * Higher 4 bytes of DDR address where WIFI FW
  3397. * updates the Write Index for WDI_IPA TX completion ring
  3398. * - TX_CE_WR_IDX_ADDR_LO
  3399. * Bits 31:0
  3400. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3401. * updates the WR Index for TX CE ring
  3402. * (needed for fusion platforms)
  3403. * - TX_CE_WR_IDX_ADDR_HI
  3404. * Bits 31:0
  3405. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3406. * updates the WR Index for TX CE ring
  3407. * (needed for fusion platforms)
  3408. * - RX_IND_RING_BASE_ADDR_LO
  3409. * Bits 31:0
  3410. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3411. * - RX_IND_RING_BASE_ADDR_HI
  3412. * Bits 31:0
  3413. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3414. * - RX_IND_RING_SIZE
  3415. * Bits 31:0
  3416. * Purpose: RX Indication Ring size
  3417. * - RX_IND_RD_IDX_ADDR_LO
  3418. * Bits 31:0
  3419. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3420. * for WDI_IPA RX indication ring
  3421. * - RX_IND_RD_IDX_ADDR_HI
  3422. * Bits 31:0
  3423. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3424. * for WDI_IPA RX indication ring
  3425. * - RX_IND_WR_IDX_ADDR_LO
  3426. * Bits 31:0
  3427. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3428. * Lower 4 bytes of DDR address where WIFI FW
  3429. * updates the Write Index for WDI_IPA RX indication ring
  3430. * - RX_IND_WR_IDX_ADDR_HI
  3431. * Bits 31:0
  3432. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3433. * Higher 4 bytes of DDR address where WIFI FW
  3434. * updates the Write Index for WDI_IPA RX indication ring
  3435. * - RX_RING2_BASE_ADDR_LO
  3436. * Bits 31:0
  3437. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3438. * - RX_RING2_BASE_ADDR_HI
  3439. * Bits 31:0
  3440. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3441. * - RX_RING2_SIZE
  3442. * Bits 31:0
  3443. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3444. * - RX_RING2_RD_IDX_ADDR_LO
  3445. * Bits 31:0
  3446. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3447. * DDR address where IPA uC updates the Read Index for Ring2.
  3448. * If Second RX ring is completion ring, this is NOT used
  3449. * - RX_RING2_RD_IDX_ADDR_HI
  3450. * Bits 31:0
  3451. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3452. * DDR address where IPA uC updates the Read Index for Ring2.
  3453. * If Second RX ring is completion ring, this is NOT used
  3454. * - RX_RING2_WR_IDX_ADDR_LO
  3455. * Bits 31:0
  3456. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3457. * DDR address where WIFI FW updates the Write Index
  3458. * for WDI_IPA RX ring2
  3459. * If second RX ring is completion ring, lower 4 bytes of
  3460. * DDR address where IPA uC updates the Write Index for Ring 2.
  3461. * - RX_RING2_WR_IDX_ADDR_HI
  3462. * Bits 31:0
  3463. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3464. * DDR address where WIFI FW updates the Write Index
  3465. * for WDI_IPA RX ring2
  3466. * If second RX ring is completion ring, higher 4 bytes of
  3467. * DDR address where IPA uC updates the Write Index for Ring 2.
  3468. */
  3469. #if HTT_PADDR64
  3470. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3471. #else
  3472. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3473. #endif
  3474. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3475. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3476. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3477. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3479. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3487. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3488. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3490. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3491. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3492. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3493. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3494. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3495. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3496. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3497. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3498. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3499. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3500. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3505. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3506. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3507. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3508. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3509. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3510. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3511. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3512. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3513. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3514. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3515. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3516. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3517. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3518. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3519. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3520. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3521. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3522. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3523. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3524. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3525. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3526. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3527. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3528. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3534. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3535. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3536. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3537. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3538. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3539. do { \
  3540. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3541. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3542. } while (0)
  3543. /* for systems using 32-bit format for bus addr */
  3544. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3545. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3546. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3547. do { \
  3548. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3549. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3550. } while (0)
  3551. /* for systems using 64-bit format for bus addr */
  3552. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3553. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3554. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3555. do { \
  3556. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3557. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3558. } while (0)
  3559. /* for systems using 64-bit format for bus addr */
  3560. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3561. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3562. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3563. do { \
  3564. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3565. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3566. } while (0)
  3567. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3568. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3569. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3570. do { \
  3571. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3572. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3573. } while (0)
  3574. /* for systems using 32-bit format for bus addr */
  3575. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3576. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3577. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3578. do { \
  3579. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3580. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3581. } while (0)
  3582. /* for systems using 64-bit format for bus addr */
  3583. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3584. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3585. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3586. do { \
  3587. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3588. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3589. } while (0)
  3590. /* for systems using 64-bit format for bus addr */
  3591. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3592. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3593. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3594. do { \
  3595. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3596. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3597. } while (0)
  3598. /* for systems using 32-bit format for bus addr */
  3599. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3600. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3601. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3602. do { \
  3603. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3604. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3605. } while (0)
  3606. /* for systems using 64-bit format for bus addr */
  3607. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3608. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3609. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3610. do { \
  3611. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3612. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3613. } while (0)
  3614. /* for systems using 64-bit format for bus addr */
  3615. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3616. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3617. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3618. do { \
  3619. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3620. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3621. } while (0)
  3622. /* for systems using 32-bit format for bus addr */
  3623. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3624. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3625. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3626. do { \
  3627. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3628. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3629. } while (0)
  3630. /* for systems using 64-bit format for bus addr */
  3631. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3632. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3633. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3634. do { \
  3635. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3636. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3637. } while (0)
  3638. /* for systems using 64-bit format for bus addr */
  3639. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3640. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3641. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3642. do { \
  3643. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3644. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3645. } while (0)
  3646. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3647. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3648. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3649. do { \
  3650. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3651. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3652. } while (0)
  3653. /* for systems using 32-bit format for bus addr */
  3654. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3655. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3656. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3657. do { \
  3658. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3659. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3660. } while (0)
  3661. /* for systems using 64-bit format for bus addr */
  3662. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3663. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3664. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3665. do { \
  3666. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3667. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3668. } while (0)
  3669. /* for systems using 64-bit format for bus addr */
  3670. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3671. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3672. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3673. do { \
  3674. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3675. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3676. } while (0)
  3677. /* for systems using 32-bit format for bus addr */
  3678. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3679. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3680. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3681. do { \
  3682. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3683. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3684. } while (0)
  3685. /* for systems using 64-bit format for bus addr */
  3686. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3687. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3688. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3691. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3692. } while (0)
  3693. /* for systems using 64-bit format for bus addr */
  3694. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3695. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3696. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3697. do { \
  3698. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3699. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3700. } while (0)
  3701. /* for systems using 32-bit format for bus addr */
  3702. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3703. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3704. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3705. do { \
  3706. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3707. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3708. } while (0)
  3709. /* for systems using 64-bit format for bus addr */
  3710. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3711. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3712. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3713. do { \
  3714. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3715. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3716. } while (0)
  3717. /* for systems using 64-bit format for bus addr */
  3718. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3719. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3720. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3721. do { \
  3722. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3723. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3724. } while (0)
  3725. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3726. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3727. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3728. do { \
  3729. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3730. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3731. } while (0)
  3732. /* for systems using 32-bit format for bus addr */
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3734. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3736. do { \
  3737. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3738. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3739. } while (0)
  3740. /* for systems using 64-bit format for bus addr */
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3742. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3744. do { \
  3745. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3746. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3747. } while (0)
  3748. /* for systems using 64-bit format for bus addr */
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3750. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3752. do { \
  3753. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3754. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3755. } while (0)
  3756. /* for systems using 32-bit format for bus addr */
  3757. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3758. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3759. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3760. do { \
  3761. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3762. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3763. } while (0)
  3764. /* for systems using 64-bit format for bus addr */
  3765. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3766. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3767. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3768. do { \
  3769. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3770. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3771. } while (0)
  3772. /* for systems using 64-bit format for bus addr */
  3773. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3774. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3775. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3776. do { \
  3777. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3778. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3779. } while (0)
  3780. /*
  3781. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3782. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3783. * addresses are stored in a XXX-bit field.
  3784. * This macro is used to define both htt_wdi_ipa_config32_t and
  3785. * htt_wdi_ipa_config64_t structs.
  3786. */
  3787. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3788. _paddr__tx_comp_ring_base_addr_, \
  3789. _paddr__tx_comp_wr_idx_addr_, \
  3790. _paddr__tx_ce_wr_idx_addr_, \
  3791. _paddr__rx_ind_ring_base_addr_, \
  3792. _paddr__rx_ind_rd_idx_addr_, \
  3793. _paddr__rx_ind_wr_idx_addr_, \
  3794. _paddr__rx_ring2_base_addr_,\
  3795. _paddr__rx_ring2_rd_idx_addr_,\
  3796. _paddr__rx_ring2_wr_idx_addr_) \
  3797. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3798. { \
  3799. /* DWORD 0: flags and meta-data */ \
  3800. A_UINT32 \
  3801. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3802. reserved: 8, \
  3803. tx_pkt_pool_size: 16;\
  3804. /* DWORD 1 */\
  3805. _paddr__tx_comp_ring_base_addr_;\
  3806. /* DWORD 2 (or 3)*/\
  3807. A_UINT32 tx_comp_ring_size;\
  3808. /* DWORD 3 (or 4)*/\
  3809. _paddr__tx_comp_wr_idx_addr_;\
  3810. /* DWORD 4 (or 6)*/\
  3811. _paddr__tx_ce_wr_idx_addr_;\
  3812. /* DWORD 5 (or 8)*/\
  3813. _paddr__rx_ind_ring_base_addr_;\
  3814. /* DWORD 6 (or 10)*/\
  3815. A_UINT32 rx_ind_ring_size;\
  3816. /* DWORD 7 (or 11)*/\
  3817. _paddr__rx_ind_rd_idx_addr_;\
  3818. /* DWORD 8 (or 13)*/\
  3819. _paddr__rx_ind_wr_idx_addr_;\
  3820. /* DWORD 9 (or 15)*/\
  3821. _paddr__rx_ring2_base_addr_;\
  3822. /* DWORD 10 (or 17) */\
  3823. A_UINT32 rx_ring2_size;\
  3824. /* DWORD 11 (or 18) */\
  3825. _paddr__rx_ring2_rd_idx_addr_;\
  3826. /* DWORD 12 (or 20) */\
  3827. _paddr__rx_ring2_wr_idx_addr_;\
  3828. } POSTPACK
  3829. /* define a htt_wdi_ipa_config32_t type */
  3830. 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));
  3831. /* define a htt_wdi_ipa_config64_t type */
  3832. 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));
  3833. #if HTT_PADDR64
  3834. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3835. #else
  3836. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3837. #endif
  3838. enum htt_wdi_ipa_op_code {
  3839. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3840. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3841. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3842. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3843. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3844. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3845. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3846. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3847. /* keep this last */
  3848. HTT_WDI_IPA_OPCODE_MAX
  3849. };
  3850. /**
  3851. * @brief HTT WDI_IPA Operation Request Message
  3852. *
  3853. * @details
  3854. * HTT WDI_IPA Operation Request message is sent by host
  3855. * to either suspend or resume WDI_IPA TX or RX path.
  3856. * |31 24|23 16|15 8|7 0|
  3857. * |----------------+----------------+----------------+----------------|
  3858. * | op_code | Rsvd | msg_type |
  3859. * |-------------------------------------------------------------------|
  3860. *
  3861. * Header fields:
  3862. * - MSG_TYPE
  3863. * Bits 7:0
  3864. * Purpose: Identifies this as WDI_IPA Operation Request message
  3865. * value: = 0x9
  3866. * - OP_CODE
  3867. * Bits 31:16
  3868. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3869. * value: = enum htt_wdi_ipa_op_code
  3870. */
  3871. PREPACK struct htt_wdi_ipa_op_request_t
  3872. {
  3873. /* DWORD 0: flags and meta-data */
  3874. A_UINT32
  3875. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3876. reserved: 8,
  3877. op_code: 16;
  3878. } POSTPACK;
  3879. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3880. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3881. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3882. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3883. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3884. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3885. do { \
  3886. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3887. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3888. } while (0)
  3889. /*
  3890. * @brief host -> target HTT_SRING_SETUP message
  3891. *
  3892. * @details
  3893. * After target is booted up, Host can send SRING setup message for
  3894. * each host facing LMAC SRING. Target setups up HW registers based
  3895. * on setup message and confirms back to Host if response_required is set.
  3896. * Host should wait for confirmation message before sending new SRING
  3897. * setup message
  3898. *
  3899. * The message would appear as follows:
  3900. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3901. * |--------------- +-----------------+-----------------+-----------------|
  3902. * | ring_type | ring_id | pdev_id | msg_type |
  3903. * |----------------------------------------------------------------------|
  3904. * | ring_base_addr_lo |
  3905. * |----------------------------------------------------------------------|
  3906. * | ring_base_addr_hi |
  3907. * |----------------------------------------------------------------------|
  3908. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3909. * |----------------------------------------------------------------------|
  3910. * | ring_head_offset32_remote_addr_lo |
  3911. * |----------------------------------------------------------------------|
  3912. * | ring_head_offset32_remote_addr_hi |
  3913. * |----------------------------------------------------------------------|
  3914. * | ring_tail_offset32_remote_addr_lo |
  3915. * |----------------------------------------------------------------------|
  3916. * | ring_tail_offset32_remote_addr_hi |
  3917. * |----------------------------------------------------------------------|
  3918. * | ring_msi_addr_lo |
  3919. * |----------------------------------------------------------------------|
  3920. * | ring_msi_addr_hi |
  3921. * |----------------------------------------------------------------------|
  3922. * | ring_msi_data |
  3923. * |----------------------------------------------------------------------|
  3924. * | intr_timer_th |IM| intr_batch_counter_th |
  3925. * |----------------------------------------------------------------------|
  3926. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3927. * |----------------------------------------------------------------------|
  3928. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3929. * |----------------------------------------------------------------------|
  3930. * Where
  3931. * IM = sw_intr_mode
  3932. * RR = response_required
  3933. * PTCF = prefetch_timer_cfg
  3934. * IP = IPA drop flag
  3935. *
  3936. * The message is interpreted as follows:
  3937. * dword0 - b'0:7 - msg_type: This will be set to
  3938. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3939. * b'8:15 - pdev_id:
  3940. * 0 (for rings at SOC/UMAC level),
  3941. * 1/2/3 mac id (for rings at LMAC level)
  3942. * b'16:23 - ring_id: identify which ring is to setup,
  3943. * more details can be got from enum htt_srng_ring_id
  3944. * b'24:31 - ring_type: identify type of host rings,
  3945. * more details can be got from enum htt_srng_ring_type
  3946. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3947. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3948. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3949. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3950. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3951. * SW_TO_HW_RING.
  3952. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3953. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3954. * Lower 32 bits of memory address of the remote variable
  3955. * storing the 4-byte word offset that identifies the head
  3956. * element within the ring.
  3957. * (The head offset variable has type A_UINT32.)
  3958. * Valid for HW_TO_SW and SW_TO_SW rings.
  3959. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3960. * Upper 32 bits of memory address of the remote variable
  3961. * storing the 4-byte word offset that identifies the head
  3962. * element within the ring.
  3963. * (The head offset variable has type A_UINT32.)
  3964. * Valid for HW_TO_SW and SW_TO_SW rings.
  3965. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3966. * Lower 32 bits of memory address of the remote variable
  3967. * storing the 4-byte word offset that identifies the tail
  3968. * element within the ring.
  3969. * (The tail offset variable has type A_UINT32.)
  3970. * Valid for HW_TO_SW and SW_TO_SW rings.
  3971. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3972. * Upper 32 bits of memory address of the remote variable
  3973. * storing the 4-byte word offset that identifies the tail
  3974. * element within the ring.
  3975. * (The tail offset variable has type A_UINT32.)
  3976. * Valid for HW_TO_SW and SW_TO_SW rings.
  3977. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3978. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3979. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3980. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3981. * dword10 - b'0:31 - ring_msi_data: MSI data
  3982. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3983. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3984. * dword11 - b'0:14 - intr_batch_counter_th:
  3985. * batch counter threshold is in units of 4-byte words.
  3986. * HW internally maintains and increments batch count.
  3987. * (see SRING spec for detail description).
  3988. * When batch count reaches threshold value, an interrupt
  3989. * is generated by HW.
  3990. * b'15 - sw_intr_mode:
  3991. * This configuration shall be static.
  3992. * Only programmed at power up.
  3993. * 0: generate pulse style sw interrupts
  3994. * 1: generate level style sw interrupts
  3995. * b'16:31 - intr_timer_th:
  3996. * The timer init value when timer is idle or is
  3997. * initialized to start downcounting.
  3998. * In 8us units (to cover a range of 0 to 524 ms)
  3999. * dword12 - b'0:15 - intr_low_threshold:
  4000. * Used only by Consumer ring to generate ring_sw_int_p.
  4001. * Ring entries low threshold water mark, that is used
  4002. * in combination with the interrupt timer as well as
  4003. * the the clearing of the level interrupt.
  4004. * b'16:18 - prefetch_timer_cfg:
  4005. * Used only by Consumer ring to set timer mode to
  4006. * support Application prefetch handling.
  4007. * The external tail offset/pointer will be updated
  4008. * at following intervals:
  4009. * 3'b000: (Prefetch feature disabled; used only for debug)
  4010. * 3'b001: 1 usec
  4011. * 3'b010: 4 usec
  4012. * 3'b011: 8 usec (default)
  4013. * 3'b100: 16 usec
  4014. * Others: Reserverd
  4015. * b'19 - response_required:
  4016. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4017. * b'20 - ipa_drop_flag:
  4018. Indicates that host will config ipa drop threshold percentage
  4019. * b'21:31 - reserved: reserved for future use
  4020. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4021. * b'8:15 - ipa drop high threshold percentage:
  4022. * b'16:31 - Reserved
  4023. */
  4024. PREPACK struct htt_sring_setup_t {
  4025. A_UINT32 msg_type: 8,
  4026. pdev_id: 8,
  4027. ring_id: 8,
  4028. ring_type: 8;
  4029. A_UINT32 ring_base_addr_lo;
  4030. A_UINT32 ring_base_addr_hi;
  4031. A_UINT32 ring_size: 16,
  4032. ring_entry_size: 8,
  4033. ring_misc_cfg_flag: 8;
  4034. A_UINT32 ring_head_offset32_remote_addr_lo;
  4035. A_UINT32 ring_head_offset32_remote_addr_hi;
  4036. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4037. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4038. A_UINT32 ring_msi_addr_lo;
  4039. A_UINT32 ring_msi_addr_hi;
  4040. A_UINT32 ring_msi_data;
  4041. A_UINT32 intr_batch_counter_th: 15,
  4042. sw_intr_mode: 1,
  4043. intr_timer_th: 16;
  4044. A_UINT32 intr_low_threshold: 16,
  4045. prefetch_timer_cfg: 3,
  4046. response_required: 1,
  4047. ipa_drop_flag: 1,
  4048. reserved1: 11;
  4049. A_UINT32 ipa_drop_low_threshold: 8,
  4050. ipa_drop_high_threshold: 8,
  4051. reserved: 16;
  4052. } POSTPACK;
  4053. enum htt_srng_ring_type {
  4054. HTT_HW_TO_SW_RING = 0,
  4055. HTT_SW_TO_HW_RING,
  4056. HTT_SW_TO_SW_RING,
  4057. /* Insert new ring types above this line */
  4058. };
  4059. enum htt_srng_ring_id {
  4060. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4061. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4062. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4063. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4064. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4065. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4066. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4067. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4068. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4069. /* Add Other SRING which can't be directly configured by host software above this line */
  4070. };
  4071. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4072. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4073. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4074. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4075. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4076. HTT_SRING_SETUP_PDEV_ID_S)
  4077. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4078. do { \
  4079. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4080. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4081. } while (0)
  4082. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4083. #define HTT_SRING_SETUP_RING_ID_S 16
  4084. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4085. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4086. HTT_SRING_SETUP_RING_ID_S)
  4087. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4088. do { \
  4089. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4090. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4091. } while (0)
  4092. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4093. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4094. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4095. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4096. HTT_SRING_SETUP_RING_TYPE_S)
  4097. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4098. do { \
  4099. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4100. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4101. } while (0)
  4102. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4103. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4104. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4105. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4106. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4107. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4108. do { \
  4109. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4110. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4111. } while (0)
  4112. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4113. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4114. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4115. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4116. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4117. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4120. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4121. } while (0)
  4122. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4123. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4124. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4125. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4126. HTT_SRING_SETUP_RING_SIZE_S)
  4127. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4130. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4131. } while (0)
  4132. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4133. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4134. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4135. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4136. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4137. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4138. do { \
  4139. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4140. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4141. } while (0)
  4142. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4143. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4144. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4145. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4146. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4147. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4148. do { \
  4149. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4150. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4151. } while (0)
  4152. /* This control bit is applicable to only Producer, which updates Ring ID field
  4153. * of each descriptor before pushing into the ring.
  4154. * 0: updates ring_id(default)
  4155. * 1: ring_id updating disabled */
  4156. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4157. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4158. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4159. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4160. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4161. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4164. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4165. } while (0)
  4166. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4167. * of each descriptor before pushing into the ring.
  4168. * 0: updates Loopcnt(default)
  4169. * 1: Loopcnt updating disabled */
  4170. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4171. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4172. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4173. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4174. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4175. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4176. do { \
  4177. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4178. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4179. } while (0)
  4180. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4181. * into security_id port of GXI/AXI. */
  4182. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4183. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4185. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4186. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4187. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4188. do { \
  4189. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4190. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4191. } while (0)
  4192. /* During MSI write operation, SRNG drives value of this register bit into
  4193. * swap bit of GXI/AXI. */
  4194. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4195. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4196. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4197. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4198. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4199. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4200. do { \
  4201. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4202. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4203. } while (0)
  4204. /* During Pointer write operation, SRNG drives value of this register bit into
  4205. * swap bit of GXI/AXI. */
  4206. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4207. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4208. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4209. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4210. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4211. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4212. do { \
  4213. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4214. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4215. } while (0)
  4216. /* During any data or TLV write operation, SRNG drives value of this register
  4217. * bit into swap bit of GXI/AXI. */
  4218. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4219. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4220. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4221. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4222. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4223. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4224. do { \
  4225. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4226. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4227. } while (0)
  4228. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4229. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4230. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4231. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4232. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4233. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4234. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4235. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4236. do { \
  4237. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4238. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4239. } while (0)
  4240. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4241. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4242. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4243. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4244. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4245. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4248. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4249. } while (0)
  4250. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4251. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4252. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4253. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4254. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4255. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4256. do { \
  4257. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4258. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4259. } while (0)
  4260. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4261. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4262. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4263. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4264. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4265. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4266. do { \
  4267. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4268. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4269. } while (0)
  4270. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4271. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4272. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4273. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4274. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4275. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4278. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4279. } while (0)
  4280. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4281. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4282. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4283. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4284. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4285. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4286. do { \
  4287. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4288. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4289. } while (0)
  4290. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4291. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4292. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4293. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4294. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4295. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4296. do { \
  4297. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4298. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4299. } while (0)
  4300. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4301. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4302. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4303. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4304. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4305. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4306. do { \
  4307. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4308. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4309. } while (0)
  4310. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4311. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4312. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4313. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4314. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4315. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4318. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4319. } while (0)
  4320. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4321. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4322. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4323. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4324. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4325. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4328. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4329. } while (0)
  4330. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4331. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4332. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4333. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4334. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4335. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4336. do { \
  4337. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4338. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4339. } while (0)
  4340. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4341. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4342. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4343. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4344. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4345. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4346. do { \
  4347. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4348. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4349. } while (0)
  4350. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4351. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4352. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4353. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4354. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4355. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4356. do { \
  4357. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4358. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4359. } while (0)
  4360. /**
  4361. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4362. *
  4363. * @details
  4364. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4365. * configure RXDMA rings.
  4366. * The configuration is per ring based and includes both packet subtypes
  4367. * and PPDU/MPDU TLVs.
  4368. *
  4369. * The message would appear as follows:
  4370. *
  4371. * |31 28|27|26|25|24|23 16|15 |9 8|7 0|
  4372. * |-----+--+--+--+--+----------------+------------+---+---------------|
  4373. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4374. * |-------------------------------------------------------------------|
  4375. * | rsvd2 | ring_buffer_size |
  4376. * |-------------------------------------------------------------------|
  4377. * | packet_type_enable_flags_0 |
  4378. * |-------------------------------------------------------------------|
  4379. * | packet_type_enable_flags_1 |
  4380. * |-------------------------------------------------------------------|
  4381. * | packet_type_enable_flags_2 |
  4382. * |-------------------------------------------------------------------|
  4383. * | packet_type_enable_flags_3 |
  4384. * |-------------------------------------------------------------------|
  4385. * | tlv_filter_in_flags |
  4386. * |-------------------------------------------------------------------|
  4387. * | rx_header_offset | rx_packet_offset |
  4388. * |-------------------------------------------------------------------|
  4389. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4390. * |-------------------------------------------------------------------|
  4391. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4392. * |-------------------------------------------------------------------|
  4393. * | rsvd3 | rx_attention_offset |
  4394. * |-------------------------------------------------------------------|
  4395. * | rsvd4 | rx_drop_threshold |
  4396. * |-------------------------------------------------------------------|
  4397. * Where:
  4398. * PS = pkt_swap
  4399. * SS = status_swap
  4400. * OV = rx_offsets_valid
  4401. * DT = drop_thresh_valid
  4402. * The message is interpreted as follows:
  4403. * dword0 - b'0:7 - msg_type: This will be set to
  4404. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4405. * b'8:15 - pdev_id:
  4406. * 0 (for rings at SOC/UMAC level),
  4407. * 1/2/3 mac id (for rings at LMAC level)
  4408. * b'16:23 - ring_id : Identify the ring to configure.
  4409. * More details can be got from enum htt_srng_ring_id
  4410. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4411. * BUF_RING_CFG_0 defs within HW .h files,
  4412. * e.g. wmac_top_reg_seq_hwioreg.h
  4413. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4414. * BUF_RING_CFG_0 defs within HW .h files,
  4415. * e.g. wmac_top_reg_seq_hwioreg.h
  4416. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4417. * configuration fields are valid
  4418. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4419. * rx_drop_threshold field is valid
  4420. * b'28:31 - rsvd1: reserved for future use
  4421. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4422. * in byte units.
  4423. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4424. * - b'16:31 - rsvd2: Reserved for future use
  4425. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4426. * Enable MGMT packet from 0b0000 to 0b1001
  4427. * bits from low to high: FP, MD, MO - 3 bits
  4428. * FP: Filter_Pass
  4429. * MD: Monitor_Direct
  4430. * MO: Monitor_Other
  4431. * 10 mgmt subtypes * 3 bits -> 30 bits
  4432. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4433. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4434. * Enable MGMT packet from 0b1010 to 0b1111
  4435. * bits from low to high: FP, MD, MO - 3 bits
  4436. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4437. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4438. * Enable CTRL packet from 0b0000 to 0b1001
  4439. * bits from low to high: FP, MD, MO - 3 bits
  4440. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4441. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4442. * Enable CTRL packet from 0b1010 to 0b1111,
  4443. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4444. * bits from low to high: FP, MD, MO - 3 bits
  4445. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4446. * dword6 - b'0:31 - tlv_filter_in_flags:
  4447. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4448. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4449. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4450. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4451. * A value of 0 will be considered as ignore this config.
  4452. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4453. * e.g. wmac_top_reg_seq_hwioreg.h
  4454. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4455. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4456. * A value of 0 will be considered as ignore this config.
  4457. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4458. * e.g. wmac_top_reg_seq_hwioreg.h
  4459. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4460. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4461. * A value of 0 will be considered as ignore this config.
  4462. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4463. * e.g. wmac_top_reg_seq_hwioreg.h
  4464. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4465. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4466. * A value of 0 will be considered as ignore this config.
  4467. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4468. * e.g. wmac_top_reg_seq_hwioreg.h
  4469. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4470. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4471. * A value of 0 will be considered as ignore this config.
  4472. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4473. * e.g. wmac_top_reg_seq_hwioreg.h
  4474. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4475. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4476. * A value of 0 will be considered as ignore this config.
  4477. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4478. * e.g. wmac_top_reg_seq_hwioreg.h
  4479. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4480. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4481. * A value of 0 will be considered as ignore this config.
  4482. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4483. * e.g. wmac_top_reg_seq_hwioreg.h
  4484. * - b'16:31 - rsvd3 for future use
  4485. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4486. * to source rings. Consumer drops packets if the available
  4487. * words in the ring falls below the configured threshold
  4488. * value.
  4489. */
  4490. PREPACK struct htt_rx_ring_selection_cfg_t {
  4491. A_UINT32 msg_type: 8,
  4492. pdev_id: 8,
  4493. ring_id: 8,
  4494. status_swap: 1,
  4495. pkt_swap: 1,
  4496. rx_offsets_valid: 1,
  4497. drop_thresh_valid: 1,
  4498. rsvd1: 4;
  4499. A_UINT32 ring_buffer_size: 16,
  4500. rsvd2: 16;
  4501. A_UINT32 packet_type_enable_flags_0;
  4502. A_UINT32 packet_type_enable_flags_1;
  4503. A_UINT32 packet_type_enable_flags_2;
  4504. A_UINT32 packet_type_enable_flags_3;
  4505. A_UINT32 tlv_filter_in_flags;
  4506. A_UINT32 rx_packet_offset: 16,
  4507. rx_header_offset: 16;
  4508. A_UINT32 rx_mpdu_end_offset: 16,
  4509. rx_mpdu_start_offset: 16;
  4510. A_UINT32 rx_msdu_end_offset: 16,
  4511. rx_msdu_start_offset: 16;
  4512. A_UINT32 rx_attn_offset: 16,
  4513. rsvd3: 16;
  4514. A_UINT32 rx_drop_threshold: 10,
  4515. rsvd4: 22;
  4516. } POSTPACK;
  4517. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4518. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4519. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4520. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4521. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4522. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4523. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4524. do { \
  4525. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4526. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4527. } while (0)
  4528. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4529. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4530. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4531. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4532. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4533. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4534. do { \
  4535. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4536. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4537. } while (0)
  4538. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4539. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4540. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4541. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4542. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4543. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4544. do { \
  4545. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4546. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4547. } while (0)
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4551. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4552. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4554. do { \
  4555. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4556. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4557. } while (0)
  4558. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4559. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4560. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4561. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4562. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4563. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4564. do { \
  4565. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4566. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4567. } while (0)
  4568. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4569. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4570. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4571. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4572. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4573. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4574. do { \
  4575. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4576. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4577. } while (0)
  4578. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4579. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4580. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4581. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4582. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4583. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4584. do { \
  4585. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4586. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4587. } while (0)
  4588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4591. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4592. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4594. do { \
  4595. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4596. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4597. } while (0)
  4598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4601. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4602. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4604. do { \
  4605. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4606. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4607. } while (0)
  4608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4611. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4612. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4614. do { \
  4615. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4616. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4617. } while (0)
  4618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4621. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4622. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4624. do { \
  4625. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4626. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4627. } while (0)
  4628. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4629. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4630. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4631. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4632. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4633. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4634. do { \
  4635. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4636. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4637. } while (0)
  4638. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4639. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4640. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4641. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4642. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4643. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4644. do { \
  4645. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4646. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4647. } while (0)
  4648. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4649. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4650. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4651. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4652. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4653. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4654. do { \
  4655. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4656. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4657. } while (0)
  4658. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4659. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4660. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4661. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4662. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4663. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4664. do { \
  4665. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4666. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4667. } while (0)
  4668. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4669. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4670. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4671. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4672. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4674. do { \
  4675. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4676. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4677. } while (0)
  4678. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4679. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4680. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4681. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4682. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4684. do { \
  4685. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4686. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4687. } while (0)
  4688. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4689. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4690. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4691. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4692. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4694. do { \
  4695. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4696. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4697. } while (0)
  4698. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4699. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4700. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4701. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4702. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4704. do { \
  4705. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4706. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4707. } while (0)
  4708. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4709. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4710. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4711. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4712. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4714. do { \
  4715. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4716. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4717. } while (0)
  4718. /*
  4719. * Subtype based MGMT frames enable bits.
  4720. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4721. */
  4722. /* association request */
  4723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4729. /* association response */
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4736. /* Reassociation request */
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4743. /* Reassociation response */
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4750. /* Probe request */
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4757. /* Probe response */
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4764. /* Timing Advertisement */
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4771. /* Reserved */
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4778. /* Beacon */
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4785. /* ATIM */
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4792. /* Disassociation */
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4799. /* Authentication */
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4806. /* Deauthentication */
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4813. /* Action */
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4820. /* Action No Ack */
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4827. /* Reserved */
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4834. /*
  4835. * Subtype based CTRL frames enable bits.
  4836. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4837. */
  4838. /* Reserved */
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4845. /* Reserved */
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4852. /* Reserved */
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4859. /* Reserved */
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4866. /* Reserved */
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4873. /* Reserved */
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4880. /* Reserved */
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4887. /* Control Wrapper */
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4894. /* Block Ack Request */
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4901. /* Block Ack*/
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4908. /* PS-POLL */
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4915. /* RTS */
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4922. /* CTS */
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4929. /* ACK */
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4936. /* CF-END */
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4943. /* CF-END + CF-ACK */
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4950. /* Multicast data */
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4957. /* Unicast data */
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4964. /* NULL data */
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4972. do { \
  4973. HTT_CHECK_SET_VAL(httsym, value); \
  4974. (word) |= (value) << httsym##_S; \
  4975. } while (0)
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4977. (((word) & httsym##_M) >> httsym##_S)
  4978. #define htt_rx_ring_pkt_enable_subtype_set( \
  4979. word, flag, mode, type, subtype, val) \
  4980. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4981. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4982. #define htt_rx_ring_pkt_enable_subtype_get( \
  4983. word, flag, mode, type, subtype) \
  4984. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4985. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4986. /* Definition to filter in TLVs */
  4987. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4988. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4989. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4990. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4991. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4992. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4993. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4994. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4995. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4996. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4997. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4998. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4999. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5013. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5014. do { \
  5015. HTT_CHECK_SET_VAL(httsym, enable); \
  5016. (word) |= (enable) << httsym##_S; \
  5017. } while (0)
  5018. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5019. (((word) & httsym##_M) >> httsym##_S)
  5020. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5021. HTT_RX_RING_TLV_ENABLE_SET( \
  5022. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5023. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5024. HTT_RX_RING_TLV_ENABLE_GET( \
  5025. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5026. /**
  5027. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5028. * host --> target Receive Flow Steering configuration message definition.
  5029. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5030. * The reason for this is we want RFS to be configured and ready before MAC
  5031. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5032. *
  5033. * |31 24|23 16|15 9|8|7 0|
  5034. * |----------------+----------------+----------------+----------------|
  5035. * | reserved |E| msg type |
  5036. * |-------------------------------------------------------------------|
  5037. * Where E = RFS enable flag
  5038. *
  5039. * The RFS_CONFIG message consists of a single 4-byte word.
  5040. *
  5041. * Header fields:
  5042. * - MSG_TYPE
  5043. * Bits 7:0
  5044. * Purpose: identifies this as a RFS config msg
  5045. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5046. * - RFS_CONFIG
  5047. * Bit 8
  5048. * Purpose: Tells target whether to enable (1) or disable (0)
  5049. * flow steering feature when sending rx indication messages to host
  5050. */
  5051. #define HTT_H2T_RFS_CONFIG_M 0x100
  5052. #define HTT_H2T_RFS_CONFIG_S 8
  5053. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5054. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5055. HTT_H2T_RFS_CONFIG_S)
  5056. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5057. do { \
  5058. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5059. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5060. } while (0)
  5061. #define HTT_RFS_CFG_REQ_BYTES 4
  5062. /**
  5063. * @brief host -> target FW extended statistics retrieve
  5064. *
  5065. * @details
  5066. * The following field definitions describe the format of the HTT host
  5067. * to target FW extended stats retrieve message.
  5068. * The message specifies the type of stats the host wants to retrieve.
  5069. *
  5070. * |31 24|23 16|15 8|7 0|
  5071. * |-----------------------------------------------------------|
  5072. * | reserved | stats type | pdev_mask | msg type |
  5073. * |-----------------------------------------------------------|
  5074. * | config param [0] |
  5075. * |-----------------------------------------------------------|
  5076. * | config param [1] |
  5077. * |-----------------------------------------------------------|
  5078. * | config param [2] |
  5079. * |-----------------------------------------------------------|
  5080. * | config param [3] |
  5081. * |-----------------------------------------------------------|
  5082. * | reserved |
  5083. * |-----------------------------------------------------------|
  5084. * | cookie LSBs |
  5085. * |-----------------------------------------------------------|
  5086. * | cookie MSBs |
  5087. * |-----------------------------------------------------------|
  5088. * Header fields:
  5089. * - MSG_TYPE
  5090. * Bits 7:0
  5091. * Purpose: identifies this is a extended stats upload request message
  5092. * Value: 0x10
  5093. * - PDEV_MASK
  5094. * Bits 8:15
  5095. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5096. * Value: This is a overloaded field, refer to usage and interpretation of
  5097. * PDEV in interface document.
  5098. * Bit 8 : Reserved for SOC stats
  5099. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5100. * Indicates MACID_MASK in DBS
  5101. * - STATS_TYPE
  5102. * Bits 23:16
  5103. * Purpose: identifies which FW statistics to upload
  5104. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5105. * - Reserved
  5106. * Bits 31:24
  5107. * - CONFIG_PARAM [0]
  5108. * Bits 31:0
  5109. * Purpose: give an opaque configuration value to the specified stats type
  5110. * Value: stats-type specific configuration value
  5111. * Refer to htt_stats.h for interpretation for each stats sub_type
  5112. * - CONFIG_PARAM [1]
  5113. * Bits 31:0
  5114. * Purpose: give an opaque configuration value to the specified stats type
  5115. * Value: stats-type specific configuration value
  5116. * Refer to htt_stats.h for interpretation for each stats sub_type
  5117. * - CONFIG_PARAM [2]
  5118. * Bits 31:0
  5119. * Purpose: give an opaque configuration value to the specified stats type
  5120. * Value: stats-type specific configuration value
  5121. * Refer to htt_stats.h for interpretation for each stats sub_type
  5122. * - CONFIG_PARAM [3]
  5123. * Bits 31:0
  5124. * Purpose: give an opaque configuration value to the specified stats type
  5125. * Value: stats-type specific configuration value
  5126. * Refer to htt_stats.h for interpretation for each stats sub_type
  5127. * - Reserved [31:0] for future use.
  5128. * - COOKIE_LSBS
  5129. * Bits 31:0
  5130. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5131. * message with its preceding host->target stats request message.
  5132. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5133. * - COOKIE_MSBS
  5134. * Bits 31:0
  5135. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5136. * message with its preceding host->target stats request message.
  5137. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5138. */
  5139. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5140. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5141. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5142. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5143. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5144. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5145. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5146. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5147. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5148. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5149. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5150. do { \
  5151. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5152. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5153. } while (0)
  5154. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5155. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5156. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5157. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5158. do { \
  5159. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5160. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5161. } while (0)
  5162. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5163. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5164. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5165. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5166. do { \
  5167. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5168. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5169. } while (0)
  5170. /**
  5171. * @brief host -> target FW PPDU_STATS request message
  5172. *
  5173. * @details
  5174. * The following field definitions describe the format of the HTT host
  5175. * to target FW for PPDU_STATS_CFG msg.
  5176. * The message allows the host to configure the PPDU_STATS_IND messages
  5177. * produced by the target.
  5178. *
  5179. * |31 24|23 16|15 8|7 0|
  5180. * |-----------------------------------------------------------|
  5181. * | REQ bit mask | pdev_mask | msg type |
  5182. * |-----------------------------------------------------------|
  5183. * Header fields:
  5184. * - MSG_TYPE
  5185. * Bits 7:0
  5186. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5187. * Value: 0x11
  5188. * - PDEV_MASK
  5189. * Bits 8:15
  5190. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5191. * Value: This is a overloaded field, refer to usage and interpretation of
  5192. * PDEV in interface document.
  5193. * Bit 8 : Reserved for SOC stats
  5194. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5195. * Indicates MACID_MASK in DBS
  5196. * - REQ_TLV_BIT_MASK
  5197. * Bits 16:31
  5198. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5199. * needs to be included in the target's PPDU_STATS_IND messages.
  5200. * Value: refer htt_ppdu_stats_tlv_tag_t
  5201. *
  5202. */
  5203. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5204. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5205. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5206. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5207. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5208. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5209. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5210. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5211. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5212. do { \
  5213. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5214. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5215. } while (0)
  5216. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5217. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5218. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5219. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5220. do { \
  5221. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5222. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5223. } while (0)
  5224. /*=== target -> host messages ===============================================*/
  5225. enum htt_t2h_msg_type {
  5226. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5227. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5228. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5229. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5230. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5231. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5232. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5233. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5234. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5235. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5236. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5237. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5238. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5239. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5240. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5241. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5242. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5243. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5244. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5245. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5246. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5247. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5248. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5249. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5250. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5251. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5252. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5253. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5254. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5255. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5256. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5257. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5258. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5259. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5260. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5261. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5262. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5263. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5264. /* TX_OFFLOAD_DELIVER_IND:
  5265. * Forward the target's locally-generated packets to the host,
  5266. * to provide to the monitor mode interface.
  5267. */
  5268. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  5269. HTT_T2H_MSG_TYPE_TEST,
  5270. /* keep this last */
  5271. HTT_T2H_NUM_MSGS
  5272. };
  5273. /*
  5274. * HTT target to host message type -
  5275. * stored in bits 7:0 of the first word of the message
  5276. */
  5277. #define HTT_T2H_MSG_TYPE_M 0xff
  5278. #define HTT_T2H_MSG_TYPE_S 0
  5279. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5280. do { \
  5281. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5282. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5283. } while (0)
  5284. #define HTT_T2H_MSG_TYPE_GET(word) \
  5285. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5286. /**
  5287. * @brief target -> host version number confirmation message definition
  5288. *
  5289. * |31 24|23 16|15 8|7 0|
  5290. * |----------------+----------------+----------------+----------------|
  5291. * | reserved | major number | minor number | msg type |
  5292. * |-------------------------------------------------------------------|
  5293. * : option request TLV (optional) |
  5294. * :...................................................................:
  5295. *
  5296. * The VER_CONF message may consist of a single 4-byte word, or may be
  5297. * extended with TLVs that specify HTT options selected by the target.
  5298. * The following option TLVs may be appended to the VER_CONF message:
  5299. * - LL_BUS_ADDR_SIZE
  5300. * - HL_SUPPRESS_TX_COMPL_IND
  5301. * - MAX_TX_QUEUE_GROUPS
  5302. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5303. * may be appended to the VER_CONF message (but only one TLV of each type).
  5304. *
  5305. * Header fields:
  5306. * - MSG_TYPE
  5307. * Bits 7:0
  5308. * Purpose: identifies this as a version number confirmation message
  5309. * Value: 0x0
  5310. * - VER_MINOR
  5311. * Bits 15:8
  5312. * Purpose: Specify the minor number of the HTT message library version
  5313. * in use by the target firmware.
  5314. * The minor number specifies the specific revision within a range
  5315. * of fundamentally compatible HTT message definition revisions.
  5316. * Compatible revisions involve adding new messages or perhaps
  5317. * adding new fields to existing messages, in a backwards-compatible
  5318. * manner.
  5319. * Incompatible revisions involve changing the message type values,
  5320. * or redefining existing messages.
  5321. * Value: minor number
  5322. * - VER_MAJOR
  5323. * Bits 15:8
  5324. * Purpose: Specify the major number of the HTT message library version
  5325. * in use by the target firmware.
  5326. * The major number specifies the family of minor revisions that are
  5327. * fundamentally compatible with each other, but not with prior or
  5328. * later families.
  5329. * Value: major number
  5330. */
  5331. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5332. #define HTT_VER_CONF_MINOR_S 8
  5333. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5334. #define HTT_VER_CONF_MAJOR_S 16
  5335. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5336. do { \
  5337. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5338. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5339. } while (0)
  5340. #define HTT_VER_CONF_MINOR_GET(word) \
  5341. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5342. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5343. do { \
  5344. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5345. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5346. } while (0)
  5347. #define HTT_VER_CONF_MAJOR_GET(word) \
  5348. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5349. #define HTT_VER_CONF_BYTES 4
  5350. /**
  5351. * @brief - target -> host HTT Rx In order indication message
  5352. *
  5353. * @details
  5354. *
  5355. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5356. * |----------------+-------------------+---------------------+---------------|
  5357. * | peer ID | P| F| O| ext TID | msg type |
  5358. * |--------------------------------------------------------------------------|
  5359. * | MSDU count | Reserved | vdev id |
  5360. * |--------------------------------------------------------------------------|
  5361. * | MSDU 0 bus address (bits 31:0) |
  5362. #if HTT_PADDR64
  5363. * | MSDU 0 bus address (bits 63:32) |
  5364. #endif
  5365. * |--------------------------------------------------------------------------|
  5366. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5367. * |--------------------------------------------------------------------------|
  5368. * | MSDU 1 bus address (bits 31:0) |
  5369. #if HTT_PADDR64
  5370. * | MSDU 1 bus address (bits 63:32) |
  5371. #endif
  5372. * |--------------------------------------------------------------------------|
  5373. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5374. * |--------------------------------------------------------------------------|
  5375. */
  5376. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5377. *
  5378. * @details
  5379. * bits
  5380. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5381. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5382. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5383. * | | frag | | | | fail |chksum fail|
  5384. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5385. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5386. */
  5387. struct htt_rx_in_ord_paddr_ind_hdr_t
  5388. {
  5389. A_UINT32 /* word 0 */
  5390. msg_type: 8,
  5391. ext_tid: 5,
  5392. offload: 1,
  5393. frag: 1,
  5394. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5395. peer_id: 16;
  5396. A_UINT32 /* word 1 */
  5397. vap_id: 8,
  5398. /* NOTE:
  5399. * This reserved_1 field is not truly reserved - certain targets use
  5400. * this field internally to store debug information, and do not zero
  5401. * out the contents of the field before uploading the message to the
  5402. * host. Thus, any host-target communication supported by this field
  5403. * is limited to using values that are never used by the debug
  5404. * information stored by certain targets in the reserved_1 field.
  5405. * In particular, the targets in question don't use the value 0x3
  5406. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  5407. * so this previously-unused value within these bits is available to
  5408. * use as the host / target PKT_CAPTURE_MODE flag.
  5409. */
  5410. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  5411. /* if pkt_capture_mode == 0x3, host should
  5412. * send rx frames to monitor mode interface
  5413. */
  5414. msdu_cnt: 16;
  5415. };
  5416. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5417. {
  5418. A_UINT32 dma_addr;
  5419. A_UINT32
  5420. length: 16,
  5421. fw_desc: 8,
  5422. msdu_info:8;
  5423. };
  5424. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5425. {
  5426. A_UINT32 dma_addr_lo;
  5427. A_UINT32 dma_addr_hi;
  5428. A_UINT32
  5429. length: 16,
  5430. fw_desc: 8,
  5431. msdu_info:8;
  5432. };
  5433. #if HTT_PADDR64
  5434. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5435. #else
  5436. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5437. #endif
  5438. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5439. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5440. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5441. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5442. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5443. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5444. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5445. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5446. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5447. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5448. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5449. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5450. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5451. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5452. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5453. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5454. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5455. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5456. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5457. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5458. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5459. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5460. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  5461. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  5462. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5463. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5464. /* for systems using 64-bit format for bus addresses */
  5465. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5466. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5467. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5468. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5469. /* for systems using 32-bit format for bus addresses */
  5470. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5471. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5472. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5473. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5474. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5475. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5476. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5477. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5478. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5481. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5482. } while (0)
  5483. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5484. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5485. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5486. do { \
  5487. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5488. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5489. } while (0)
  5490. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5491. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5492. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5493. do { \
  5494. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5495. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5496. } while (0)
  5497. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5498. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5499. /*
  5500. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  5501. * deliver the rx frames to the monitor mode interface.
  5502. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  5503. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  5504. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  5505. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  5506. */
  5507. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  5508. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  5511. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  5512. } while (0)
  5513. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  5514. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  5515. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  5516. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5517. do { \
  5518. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5519. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5520. } while (0)
  5521. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5522. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5523. /* for systems using 64-bit format for bus addresses */
  5524. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5525. do { \
  5526. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5527. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5528. } while (0)
  5529. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5530. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5531. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5532. do { \
  5533. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5534. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5535. } while (0)
  5536. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5537. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5538. /* for systems using 32-bit format for bus addresses */
  5539. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5540. do { \
  5541. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5542. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5543. } while (0)
  5544. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5545. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5546. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5547. do { \
  5548. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5549. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5550. } while (0)
  5551. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5552. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5553. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5556. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5557. } while (0)
  5558. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5559. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5560. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5561. do { \
  5562. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5563. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5564. } while (0)
  5565. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5566. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5567. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5568. do { \
  5569. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5570. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5571. } while (0)
  5572. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5573. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5574. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5577. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5578. } while (0)
  5579. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5580. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5581. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5582. do { \
  5583. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5584. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5585. } while (0)
  5586. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5587. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5588. /* definitions used within target -> host rx indication message */
  5589. PREPACK struct htt_rx_ind_hdr_prefix_t
  5590. {
  5591. A_UINT32 /* word 0 */
  5592. msg_type: 8,
  5593. ext_tid: 5,
  5594. release_valid: 1,
  5595. flush_valid: 1,
  5596. reserved0: 1,
  5597. peer_id: 16;
  5598. A_UINT32 /* word 1 */
  5599. flush_start_seq_num: 6,
  5600. flush_end_seq_num: 6,
  5601. release_start_seq_num: 6,
  5602. release_end_seq_num: 6,
  5603. num_mpdu_ranges: 8;
  5604. } POSTPACK;
  5605. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5606. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5607. #define HTT_TGT_RSSI_INVALID 0x80
  5608. PREPACK struct htt_rx_ppdu_desc_t
  5609. {
  5610. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5611. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5612. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5613. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5614. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5615. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5616. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5617. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5618. A_UINT32 /* word 0 */
  5619. rssi_cmb: 8,
  5620. timestamp_submicrosec: 8,
  5621. phy_err_code: 8,
  5622. phy_err: 1,
  5623. legacy_rate: 4,
  5624. legacy_rate_sel: 1,
  5625. end_valid: 1,
  5626. start_valid: 1;
  5627. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5628. union {
  5629. A_UINT32 /* word 1 */
  5630. rssi0_pri20: 8,
  5631. rssi0_ext20: 8,
  5632. rssi0_ext40: 8,
  5633. rssi0_ext80: 8;
  5634. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5635. } u0;
  5636. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5637. union {
  5638. A_UINT32 /* word 2 */
  5639. rssi1_pri20: 8,
  5640. rssi1_ext20: 8,
  5641. rssi1_ext40: 8,
  5642. rssi1_ext80: 8;
  5643. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5644. } u1;
  5645. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5646. union {
  5647. A_UINT32 /* word 3 */
  5648. rssi2_pri20: 8,
  5649. rssi2_ext20: 8,
  5650. rssi2_ext40: 8,
  5651. rssi2_ext80: 8;
  5652. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5653. } u2;
  5654. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5655. union {
  5656. A_UINT32 /* word 4 */
  5657. rssi3_pri20: 8,
  5658. rssi3_ext20: 8,
  5659. rssi3_ext40: 8,
  5660. rssi3_ext80: 8;
  5661. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5662. } u3;
  5663. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5664. A_UINT32 tsf32; /* word 5 */
  5665. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5666. A_UINT32 timestamp_microsec; /* word 6 */
  5667. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5668. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5669. A_UINT32 /* word 7 */
  5670. vht_sig_a1: 24,
  5671. preamble_type: 8;
  5672. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5673. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  5674. A_UINT32 /* word 8 */
  5675. vht_sig_a2: 24,
  5676. /* sa_ant_matrix
  5677. * For cases where a single rx chain has options to be connected to
  5678. * different rx antennas, show which rx antennas were in use during
  5679. * receipt of a given PPDU.
  5680. * This sa_ant_matrix provides a bitmask of the antennas used while
  5681. * receiving this frame.
  5682. */
  5683. sa_ant_matrix: 8;
  5684. } POSTPACK;
  5685. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5686. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5687. PREPACK struct htt_rx_ind_hdr_suffix_t
  5688. {
  5689. A_UINT32 /* word 0 */
  5690. fw_rx_desc_bytes: 16,
  5691. reserved0: 16;
  5692. } POSTPACK;
  5693. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5694. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5695. PREPACK struct htt_rx_ind_hdr_t
  5696. {
  5697. struct htt_rx_ind_hdr_prefix_t prefix;
  5698. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5699. struct htt_rx_ind_hdr_suffix_t suffix;
  5700. } POSTPACK;
  5701. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5702. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5703. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5704. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5705. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5706. /*
  5707. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5708. * the offset into the HTT rx indication message at which the
  5709. * FW rx PPDU descriptor resides
  5710. */
  5711. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5712. /*
  5713. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5714. * the offset into the HTT rx indication message at which the
  5715. * header suffix (FW rx MSDU byte count) resides
  5716. */
  5717. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5718. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5719. /*
  5720. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5721. * the offset into the HTT rx indication message at which the per-MSDU
  5722. * information starts
  5723. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5724. * per-MSDU information portion of the message. The per-MSDU info itself
  5725. * starts at byte 12.
  5726. */
  5727. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5728. /**
  5729. * @brief target -> host rx indication message definition
  5730. *
  5731. * @details
  5732. * The following field definitions describe the format of the rx indication
  5733. * message sent from the target to the host.
  5734. * The message consists of three major sections:
  5735. * 1. a fixed-length header
  5736. * 2. a variable-length list of firmware rx MSDU descriptors
  5737. * 3. one or more 4-octet MPDU range information elements
  5738. * The fixed length header itself has two sub-sections
  5739. * 1. the message meta-information, including identification of the
  5740. * sender and type of the received data, and a 4-octet flush/release IE
  5741. * 2. the firmware rx PPDU descriptor
  5742. *
  5743. * The format of the message is depicted below.
  5744. * in this depiction, the following abbreviations are used for information
  5745. * elements within the message:
  5746. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5747. * elements associated with the PPDU start are valid.
  5748. * Specifically, the following fields are valid only if SV is set:
  5749. * RSSI (all variants), L, legacy rate, preamble type, service,
  5750. * VHT-SIG-A
  5751. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5752. * elements associated with the PPDU end are valid.
  5753. * Specifically, the following fields are valid only if EV is set:
  5754. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5755. * - L - Legacy rate selector - if legacy rates are used, this flag
  5756. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5757. * (L == 0) PHY.
  5758. * - P - PHY error flag - boolean indication of whether the rx frame had
  5759. * a PHY error
  5760. *
  5761. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5762. * |----------------+-------------------+---------------------+---------------|
  5763. * | peer ID | |RV|FV| ext TID | msg type |
  5764. * |--------------------------------------------------------------------------|
  5765. * | num | release | release | flush | flush |
  5766. * | MPDU | end | start | end | start |
  5767. * | ranges | seq num | seq num | seq num | seq num |
  5768. * |==========================================================================|
  5769. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5770. * |V|V| | rate | | | timestamp | RSSI |
  5771. * |--------------------------------------------------------------------------|
  5772. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5773. * |--------------------------------------------------------------------------|
  5774. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5775. * |--------------------------------------------------------------------------|
  5776. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5777. * |--------------------------------------------------------------------------|
  5778. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5779. * |--------------------------------------------------------------------------|
  5780. * | TSF LSBs |
  5781. * |--------------------------------------------------------------------------|
  5782. * | microsec timestamp |
  5783. * |--------------------------------------------------------------------------|
  5784. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5785. * |--------------------------------------------------------------------------|
  5786. * | service | HT-SIG / VHT-SIG-A2 |
  5787. * |==========================================================================|
  5788. * | reserved | FW rx desc bytes |
  5789. * |--------------------------------------------------------------------------|
  5790. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5791. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5792. * |--------------------------------------------------------------------------|
  5793. * : : :
  5794. * |--------------------------------------------------------------------------|
  5795. * | alignment | MSDU Rx |
  5796. * | padding | desc Bn |
  5797. * |--------------------------------------------------------------------------|
  5798. * | reserved | MPDU range status | MPDU count |
  5799. * |--------------------------------------------------------------------------|
  5800. * : reserved : MPDU range status : MPDU count :
  5801. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5802. *
  5803. * Header fields:
  5804. * - MSG_TYPE
  5805. * Bits 7:0
  5806. * Purpose: identifies this as an rx indication message
  5807. * Value: 0x1
  5808. * - EXT_TID
  5809. * Bits 12:8
  5810. * Purpose: identify the traffic ID of the rx data, including
  5811. * special "extended" TID values for multicast, broadcast, and
  5812. * non-QoS data frames
  5813. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5814. * - FLUSH_VALID (FV)
  5815. * Bit 13
  5816. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5817. * is valid
  5818. * Value:
  5819. * 1 -> flush IE is valid and needs to be processed
  5820. * 0 -> flush IE is not valid and should be ignored
  5821. * - REL_VALID (RV)
  5822. * Bit 13
  5823. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5824. * is valid
  5825. * Value:
  5826. * 1 -> release IE is valid and needs to be processed
  5827. * 0 -> release IE is not valid and should be ignored
  5828. * - PEER_ID
  5829. * Bits 31:16
  5830. * Purpose: Identify, by ID, which peer sent the rx data
  5831. * Value: ID of the peer who sent the rx data
  5832. * - FLUSH_SEQ_NUM_START
  5833. * Bits 5:0
  5834. * Purpose: Indicate the start of a series of MPDUs to flush
  5835. * Not all MPDUs within this series are necessarily valid - the host
  5836. * must check each sequence number within this range to see if the
  5837. * corresponding MPDU is actually present.
  5838. * This field is only valid if the FV bit is set.
  5839. * Value:
  5840. * The sequence number for the first MPDUs to check to flush.
  5841. * The sequence number is masked by 0x3f.
  5842. * - FLUSH_SEQ_NUM_END
  5843. * Bits 11:6
  5844. * Purpose: Indicate the end of a series of MPDUs to flush
  5845. * Value:
  5846. * The sequence number one larger than the sequence number of the
  5847. * last MPDU to check to flush.
  5848. * The sequence number is masked by 0x3f.
  5849. * Not all MPDUs within this series are necessarily valid - the host
  5850. * must check each sequence number within this range to see if the
  5851. * corresponding MPDU is actually present.
  5852. * This field is only valid if the FV bit is set.
  5853. * - REL_SEQ_NUM_START
  5854. * Bits 17:12
  5855. * Purpose: Indicate the start of a series of MPDUs to release.
  5856. * All MPDUs within this series are present and valid - the host
  5857. * need not check each sequence number within this range to see if
  5858. * the corresponding MPDU is actually present.
  5859. * This field is only valid if the RV bit is set.
  5860. * Value:
  5861. * The sequence number for the first MPDUs to check to release.
  5862. * The sequence number is masked by 0x3f.
  5863. * - REL_SEQ_NUM_END
  5864. * Bits 23:18
  5865. * Purpose: Indicate the end of a series of MPDUs to release.
  5866. * Value:
  5867. * The sequence number one larger than the sequence number of the
  5868. * last MPDU to check to release.
  5869. * The sequence number is masked by 0x3f.
  5870. * All MPDUs within this series are present and valid - the host
  5871. * need not check each sequence number within this range to see if
  5872. * the corresponding MPDU is actually present.
  5873. * This field is only valid if the RV bit is set.
  5874. * - NUM_MPDU_RANGES
  5875. * Bits 31:24
  5876. * Purpose: Indicate how many ranges of MPDUs are present.
  5877. * Each MPDU range consists of a series of contiguous MPDUs within the
  5878. * rx frame sequence which all have the same MPDU status.
  5879. * Value: 1-63 (typically a small number, like 1-3)
  5880. *
  5881. * Rx PPDU descriptor fields:
  5882. * - RSSI_CMB
  5883. * Bits 7:0
  5884. * Purpose: Combined RSSI from all active rx chains, across the active
  5885. * bandwidth.
  5886. * Value: RSSI dB units w.r.t. noise floor
  5887. * - TIMESTAMP_SUBMICROSEC
  5888. * Bits 15:8
  5889. * Purpose: high-resolution timestamp
  5890. * Value:
  5891. * Sub-microsecond time of PPDU reception.
  5892. * This timestamp ranges from [0,MAC clock MHz).
  5893. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5894. * to form a high-resolution, large range rx timestamp.
  5895. * - PHY_ERR_CODE
  5896. * Bits 23:16
  5897. * Purpose:
  5898. * If the rx frame processing resulted in a PHY error, indicate what
  5899. * type of rx PHY error occurred.
  5900. * Value:
  5901. * This field is valid if the "P" (PHY_ERR) flag is set.
  5902. * TBD: document/specify the values for this field
  5903. * - PHY_ERR
  5904. * Bit 24
  5905. * Purpose: indicate whether the rx PPDU had a PHY error
  5906. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5907. * - LEGACY_RATE
  5908. * Bits 28:25
  5909. * Purpose:
  5910. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5911. * specify which rate was used.
  5912. * Value:
  5913. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5914. * flag.
  5915. * If LEGACY_RATE_SEL is 0:
  5916. * 0x8: OFDM 48 Mbps
  5917. * 0x9: OFDM 24 Mbps
  5918. * 0xA: OFDM 12 Mbps
  5919. * 0xB: OFDM 6 Mbps
  5920. * 0xC: OFDM 54 Mbps
  5921. * 0xD: OFDM 36 Mbps
  5922. * 0xE: OFDM 18 Mbps
  5923. * 0xF: OFDM 9 Mbps
  5924. * If LEGACY_RATE_SEL is 1:
  5925. * 0x8: CCK 11 Mbps long preamble
  5926. * 0x9: CCK 5.5 Mbps long preamble
  5927. * 0xA: CCK 2 Mbps long preamble
  5928. * 0xB: CCK 1 Mbps long preamble
  5929. * 0xC: CCK 11 Mbps short preamble
  5930. * 0xD: CCK 5.5 Mbps short preamble
  5931. * 0xE: CCK 2 Mbps short preamble
  5932. * - LEGACY_RATE_SEL
  5933. * Bit 29
  5934. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5935. * Value:
  5936. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5937. * used a legacy rate.
  5938. * 0 -> OFDM, 1 -> CCK
  5939. * - END_VALID
  5940. * Bit 30
  5941. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5942. * the start of the PPDU are valid. Specifically, the following
  5943. * fields are only valid if END_VALID is set:
  5944. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5945. * TIMESTAMP_SUBMICROSEC
  5946. * Value:
  5947. * 0 -> rx PPDU desc end fields are not valid
  5948. * 1 -> rx PPDU desc end fields are valid
  5949. * - START_VALID
  5950. * Bit 31
  5951. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5952. * the end of the PPDU are valid. Specifically, the following
  5953. * fields are only valid if START_VALID is set:
  5954. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5955. * VHT-SIG-A
  5956. * Value:
  5957. * 0 -> rx PPDU desc start fields are not valid
  5958. * 1 -> rx PPDU desc start fields are valid
  5959. * - RSSI0_PRI20
  5960. * Bits 7:0
  5961. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5962. * Value: RSSI dB units w.r.t. noise floor
  5963. *
  5964. * - RSSI0_EXT20
  5965. * Bits 7:0
  5966. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5967. * (if the rx bandwidth was >= 40 MHz)
  5968. * Value: RSSI dB units w.r.t. noise floor
  5969. * - RSSI0_EXT40
  5970. * Bits 7:0
  5971. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5972. * (if the rx bandwidth was >= 80 MHz)
  5973. * Value: RSSI dB units w.r.t. noise floor
  5974. * - RSSI0_EXT80
  5975. * Bits 7:0
  5976. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5977. * (if the rx bandwidth was >= 160 MHz)
  5978. * Value: RSSI dB units w.r.t. noise floor
  5979. *
  5980. * - RSSI1_PRI20
  5981. * Bits 7:0
  5982. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5983. * Value: RSSI dB units w.r.t. noise floor
  5984. * - RSSI1_EXT20
  5985. * Bits 7:0
  5986. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5987. * (if the rx bandwidth was >= 40 MHz)
  5988. * Value: RSSI dB units w.r.t. noise floor
  5989. * - RSSI1_EXT40
  5990. * Bits 7:0
  5991. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5992. * (if the rx bandwidth was >= 80 MHz)
  5993. * Value: RSSI dB units w.r.t. noise floor
  5994. * - RSSI1_EXT80
  5995. * Bits 7:0
  5996. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5997. * (if the rx bandwidth was >= 160 MHz)
  5998. * Value: RSSI dB units w.r.t. noise floor
  5999. *
  6000. * - RSSI2_PRI20
  6001. * Bits 7:0
  6002. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6003. * Value: RSSI dB units w.r.t. noise floor
  6004. * - RSSI2_EXT20
  6005. * Bits 7:0
  6006. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6007. * (if the rx bandwidth was >= 40 MHz)
  6008. * Value: RSSI dB units w.r.t. noise floor
  6009. * - RSSI2_EXT40
  6010. * Bits 7:0
  6011. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6012. * (if the rx bandwidth was >= 80 MHz)
  6013. * Value: RSSI dB units w.r.t. noise floor
  6014. * - RSSI2_EXT80
  6015. * Bits 7:0
  6016. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6017. * (if the rx bandwidth was >= 160 MHz)
  6018. * Value: RSSI dB units w.r.t. noise floor
  6019. *
  6020. * - RSSI3_PRI20
  6021. * Bits 7:0
  6022. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6023. * Value: RSSI dB units w.r.t. noise floor
  6024. * - RSSI3_EXT20
  6025. * Bits 7:0
  6026. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6027. * (if the rx bandwidth was >= 40 MHz)
  6028. * Value: RSSI dB units w.r.t. noise floor
  6029. * - RSSI3_EXT40
  6030. * Bits 7:0
  6031. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6032. * (if the rx bandwidth was >= 80 MHz)
  6033. * Value: RSSI dB units w.r.t. noise floor
  6034. * - RSSI3_EXT80
  6035. * Bits 7:0
  6036. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6037. * (if the rx bandwidth was >= 160 MHz)
  6038. * Value: RSSI dB units w.r.t. noise floor
  6039. *
  6040. * - TSF32
  6041. * Bits 31:0
  6042. * Purpose: specify the time the rx PPDU was received, in TSF units
  6043. * Value: 32 LSBs of the TSF
  6044. * - TIMESTAMP_MICROSEC
  6045. * Bits 31:0
  6046. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6047. * Value: PPDU rx time, in microseconds
  6048. * - VHT_SIG_A1
  6049. * Bits 23:0
  6050. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6051. * from the rx PPDU
  6052. * Value:
  6053. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6054. * VHT-SIG-A1 data.
  6055. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6056. * first 24 bits of the HT-SIG data.
  6057. * Otherwise, this field is invalid.
  6058. * Refer to the the 802.11 protocol for the definition of the
  6059. * HT-SIG and VHT-SIG-A1 fields
  6060. * - VHT_SIG_A2
  6061. * Bits 23:0
  6062. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6063. * from the rx PPDU
  6064. * Value:
  6065. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6066. * VHT-SIG-A2 data.
  6067. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6068. * last 24 bits of the HT-SIG data.
  6069. * Otherwise, this field is invalid.
  6070. * Refer to the the 802.11 protocol for the definition of the
  6071. * HT-SIG and VHT-SIG-A2 fields
  6072. * - PREAMBLE_TYPE
  6073. * Bits 31:24
  6074. * Purpose: indicate the PHY format of the received burst
  6075. * Value:
  6076. * 0x4: Legacy (OFDM/CCK)
  6077. * 0x8: HT
  6078. * 0x9: HT with TxBF
  6079. * 0xC: VHT
  6080. * 0xD: VHT with TxBF
  6081. * - SERVICE
  6082. * Bits 31:24
  6083. * Purpose: TBD
  6084. * Value: TBD
  6085. *
  6086. * Rx MSDU descriptor fields:
  6087. * - FW_RX_DESC_BYTES
  6088. * Bits 15:0
  6089. * Purpose: Indicate how many bytes in the Rx indication are used for
  6090. * FW Rx descriptors
  6091. *
  6092. * Payload fields:
  6093. * - MPDU_COUNT
  6094. * Bits 7:0
  6095. * Purpose: Indicate how many sequential MPDUs share the same status.
  6096. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6097. * - MPDU_STATUS
  6098. * Bits 15:8
  6099. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6100. * received successfully.
  6101. * Value:
  6102. * 0x1: success
  6103. * 0x2: FCS error
  6104. * 0x3: duplicate error
  6105. * 0x4: replay error
  6106. * 0x5: invalid peer
  6107. */
  6108. /* header fields */
  6109. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6110. #define HTT_RX_IND_EXT_TID_S 8
  6111. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6112. #define HTT_RX_IND_FLUSH_VALID_S 13
  6113. #define HTT_RX_IND_REL_VALID_M 0x4000
  6114. #define HTT_RX_IND_REL_VALID_S 14
  6115. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6116. #define HTT_RX_IND_PEER_ID_S 16
  6117. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6118. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6119. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6120. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6121. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6122. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6123. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6124. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6125. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6126. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6127. /* rx PPDU descriptor fields */
  6128. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6129. #define HTT_RX_IND_RSSI_CMB_S 0
  6130. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6131. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6132. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6133. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6134. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6135. #define HTT_RX_IND_PHY_ERR_S 24
  6136. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6137. #define HTT_RX_IND_LEGACY_RATE_S 25
  6138. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6139. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6140. #define HTT_RX_IND_END_VALID_M 0x40000000
  6141. #define HTT_RX_IND_END_VALID_S 30
  6142. #define HTT_RX_IND_START_VALID_M 0x80000000
  6143. #define HTT_RX_IND_START_VALID_S 31
  6144. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6145. #define HTT_RX_IND_RSSI_PRI20_S 0
  6146. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6147. #define HTT_RX_IND_RSSI_EXT20_S 8
  6148. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6149. #define HTT_RX_IND_RSSI_EXT40_S 16
  6150. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6151. #define HTT_RX_IND_RSSI_EXT80_S 24
  6152. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6153. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6154. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6155. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6156. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6157. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6158. #define HTT_RX_IND_SERVICE_M 0xff000000
  6159. #define HTT_RX_IND_SERVICE_S 24
  6160. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6161. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6162. /* rx MSDU descriptor fields */
  6163. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6164. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6165. /* payload fields */
  6166. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6167. #define HTT_RX_IND_MPDU_COUNT_S 0
  6168. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6169. #define HTT_RX_IND_MPDU_STATUS_S 8
  6170. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6171. do { \
  6172. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6173. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6174. } while (0)
  6175. #define HTT_RX_IND_EXT_TID_GET(word) \
  6176. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6177. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6178. do { \
  6179. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6180. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6181. } while (0)
  6182. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6183. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6184. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6185. do { \
  6186. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6187. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6188. } while (0)
  6189. #define HTT_RX_IND_REL_VALID_GET(word) \
  6190. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6191. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6192. do { \
  6193. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6194. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6195. } while (0)
  6196. #define HTT_RX_IND_PEER_ID_GET(word) \
  6197. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6198. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6199. do { \
  6200. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6201. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6202. } while (0)
  6203. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6204. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6205. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6206. do { \
  6207. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6208. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6209. } while (0)
  6210. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6211. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6212. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6213. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6214. do { \
  6215. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6216. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6217. } while (0)
  6218. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6219. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6220. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6221. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6222. do { \
  6223. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6224. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6225. } while (0)
  6226. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6227. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6228. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6229. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6230. do { \
  6231. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6232. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6233. } while (0)
  6234. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6235. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6236. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6237. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6238. do { \
  6239. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6240. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6241. } while (0)
  6242. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6243. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6244. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6245. /* FW rx PPDU descriptor fields */
  6246. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6247. do { \
  6248. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6249. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6250. } while (0)
  6251. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6252. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6253. HTT_RX_IND_RSSI_CMB_S)
  6254. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6255. do { \
  6256. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6257. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6258. } while (0)
  6259. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6260. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6261. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6262. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6263. do { \
  6264. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6265. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6266. } while (0)
  6267. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6268. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6269. HTT_RX_IND_PHY_ERR_CODE_S)
  6270. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6271. do { \
  6272. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6273. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6274. } while (0)
  6275. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6276. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6277. HTT_RX_IND_PHY_ERR_S)
  6278. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6279. do { \
  6280. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6281. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6282. } while (0)
  6283. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6284. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6285. HTT_RX_IND_LEGACY_RATE_S)
  6286. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6287. do { \
  6288. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6289. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6290. } while (0)
  6291. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6292. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6293. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6294. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6295. do { \
  6296. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6297. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6298. } while (0)
  6299. #define HTT_RX_IND_END_VALID_GET(word) \
  6300. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6301. HTT_RX_IND_END_VALID_S)
  6302. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6303. do { \
  6304. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6305. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6306. } while (0)
  6307. #define HTT_RX_IND_START_VALID_GET(word) \
  6308. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6309. HTT_RX_IND_START_VALID_S)
  6310. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6311. do { \
  6312. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6313. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6314. } while (0)
  6315. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6316. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6317. HTT_RX_IND_RSSI_PRI20_S)
  6318. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6319. do { \
  6320. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6321. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6322. } while (0)
  6323. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6324. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6325. HTT_RX_IND_RSSI_EXT20_S)
  6326. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6327. do { \
  6328. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6329. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6330. } while (0)
  6331. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6332. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6333. HTT_RX_IND_RSSI_EXT40_S)
  6334. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6335. do { \
  6336. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6337. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6338. } while (0)
  6339. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6340. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6341. HTT_RX_IND_RSSI_EXT80_S)
  6342. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6343. do { \
  6344. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6345. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6346. } while (0)
  6347. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6348. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6349. HTT_RX_IND_VHT_SIG_A1_S)
  6350. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6351. do { \
  6352. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6353. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6354. } while (0)
  6355. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6356. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6357. HTT_RX_IND_VHT_SIG_A2_S)
  6358. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6359. do { \
  6360. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6361. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6362. } while (0)
  6363. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6364. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6365. HTT_RX_IND_PREAMBLE_TYPE_S)
  6366. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6367. do { \
  6368. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6369. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6370. } while (0)
  6371. #define HTT_RX_IND_SERVICE_GET(word) \
  6372. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6373. HTT_RX_IND_SERVICE_S)
  6374. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6375. do { \
  6376. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6377. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6378. } while (0)
  6379. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6380. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6381. HTT_RX_IND_SA_ANT_MATRIX_S)
  6382. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6383. do { \
  6384. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6385. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6386. } while (0)
  6387. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6388. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6389. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6390. do { \
  6391. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6392. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6393. } while (0)
  6394. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6395. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6396. #define HTT_RX_IND_HL_BYTES \
  6397. (HTT_RX_IND_HDR_BYTES + \
  6398. 4 /* single FW rx MSDU descriptor */ + \
  6399. 4 /* single MPDU range information element */)
  6400. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6401. /* Could we use one macro entry? */
  6402. #define HTT_WORD_SET(word, field, value) \
  6403. do { \
  6404. HTT_CHECK_SET_VAL(field, value); \
  6405. (word) |= ((value) << field ## _S); \
  6406. } while (0)
  6407. #define HTT_WORD_GET(word, field) \
  6408. (((word) & field ## _M) >> field ## _S)
  6409. PREPACK struct hl_htt_rx_ind_base {
  6410. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6411. } POSTPACK;
  6412. /*
  6413. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6414. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6415. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6416. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6417. * htt_rx_ind_hl_rx_desc_t.
  6418. */
  6419. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6420. struct htt_rx_ind_hl_rx_desc_t {
  6421. A_UINT8 ver;
  6422. A_UINT8 len;
  6423. struct {
  6424. A_UINT8
  6425. first_msdu: 1,
  6426. last_msdu: 1,
  6427. c3_failed: 1,
  6428. c4_failed: 1,
  6429. ipv6: 1,
  6430. tcp: 1,
  6431. udp: 1,
  6432. reserved: 1;
  6433. } flags;
  6434. /* NOTE: no reserved space - don't append any new fields here */
  6435. };
  6436. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6437. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6438. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6439. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6440. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6441. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6442. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6443. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6444. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6445. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6446. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6447. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6448. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6449. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6450. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6451. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6452. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6453. /* This structure is used in HL, the basic descriptor information
  6454. * used by host. the structure is translated by FW from HW desc
  6455. * or generated by FW. But in HL monitor mode, the host would use
  6456. * the same structure with LL.
  6457. */
  6458. PREPACK struct hl_htt_rx_desc_base {
  6459. A_UINT32
  6460. seq_num:12,
  6461. encrypted:1,
  6462. chan_info_present:1,
  6463. resv0:2,
  6464. mcast_bcast:1,
  6465. fragment:1,
  6466. key_id_oct:8,
  6467. resv1:6;
  6468. A_UINT32
  6469. pn_31_0;
  6470. union {
  6471. struct {
  6472. A_UINT16 pn_47_32;
  6473. A_UINT16 pn_63_48;
  6474. } pn16;
  6475. A_UINT32 pn_63_32;
  6476. } u0;
  6477. A_UINT32
  6478. pn_95_64;
  6479. A_UINT32
  6480. pn_127_96;
  6481. } POSTPACK;
  6482. /*
  6483. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6484. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6485. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6486. * Please see htt_chan_change_t for description of the fields.
  6487. */
  6488. PREPACK struct htt_chan_info_t
  6489. {
  6490. A_UINT32 primary_chan_center_freq_mhz: 16,
  6491. contig_chan1_center_freq_mhz: 16;
  6492. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6493. phy_mode: 8,
  6494. reserved: 8;
  6495. } POSTPACK;
  6496. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6497. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6498. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6499. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6500. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6501. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6502. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6503. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6504. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6505. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6506. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6507. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6508. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6509. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6510. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6511. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6512. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6513. /* Channel information */
  6514. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6515. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6516. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6517. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6518. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6519. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6520. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6521. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6522. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6523. do { \
  6524. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6525. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6526. } while (0)
  6527. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6528. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6529. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6530. do { \
  6531. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6532. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6533. } while (0)
  6534. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6535. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6536. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6539. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6540. } while (0)
  6541. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6542. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6543. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6546. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6547. } while (0)
  6548. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6549. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6550. /*
  6551. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  6552. * @brief target -> host message definition for FW offloaded pkts
  6553. *
  6554. * @details
  6555. * The following field definitions describe the format of the firmware
  6556. * offload deliver message sent from the target to the host.
  6557. *
  6558. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  6559. *
  6560. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  6561. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  6562. * | reserved_1 | msg type |
  6563. * |--------------------------------------------------------------------------|
  6564. * | phy_timestamp_l32 |
  6565. * |--------------------------------------------------------------------------|
  6566. * | WORD2 (see below) |
  6567. * |--------------------------------------------------------------------------|
  6568. * | seqno | framectrl |
  6569. * |--------------------------------------------------------------------------|
  6570. * | reserved_3 | vdev_id | tid_num|
  6571. * |--------------------------------------------------------------------------|
  6572. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  6573. * |--------------------------------------------------------------------------|
  6574. *
  6575. * where:
  6576. * STAT = status
  6577. * F = format (802.3 vs. 802.11)
  6578. *
  6579. * definition for word 2
  6580. *
  6581. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  6582. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  6583. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  6584. * |--------------------------------------------------------------------------|
  6585. *
  6586. * where:
  6587. * PR = preamble
  6588. * BF = beamformed
  6589. */
  6590. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  6591. {
  6592. A_UINT32 /* word 0 */
  6593. msg_type:8, /* [ 7: 0] */
  6594. reserved_1:24; /* [31: 8] */
  6595. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  6596. A_UINT32 /* word 2 */
  6597. /* preamble:
  6598. * 0-OFDM,
  6599. * 1-CCk,
  6600. * 2-HT,
  6601. * 3-VHT
  6602. */
  6603. preamble: 2, /* [1:0] */
  6604. /* mcs:
  6605. * In case of HT preamble interpret
  6606. * MCS along with NSS.
  6607. * Valid values for HT are 0 to 7.
  6608. * HT mcs 0 with NSS 2 is mcs 8.
  6609. * Valid values for VHT are 0 to 9.
  6610. */
  6611. mcs: 4, /* [5:2] */
  6612. /* rate:
  6613. * This is applicable only for
  6614. * CCK and OFDM preamble type
  6615. * rate 0: OFDM 48 Mbps,
  6616. * 1: OFDM 24 Mbps,
  6617. * 2: OFDM 12 Mbps
  6618. * 3: OFDM 6 Mbps
  6619. * 4: OFDM 54 Mbps
  6620. * 5: OFDM 36 Mbps
  6621. * 6: OFDM 18 Mbps
  6622. * 7: OFDM 9 Mbps
  6623. * rate 0: CCK 11 Mbps Long
  6624. * 1: CCK 5.5 Mbps Long
  6625. * 2: CCK 2 Mbps Long
  6626. * 3: CCK 1 Mbps Long
  6627. * 4: CCK 11 Mbps Short
  6628. * 5: CCK 5.5 Mbps Short
  6629. * 6: CCK 2 Mbps Short
  6630. */
  6631. rate : 3, /* [ 8: 6] */
  6632. rssi : 8, /* [16: 9] units=dBm */
  6633. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  6634. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  6635. stbc : 1, /* [22] */
  6636. sgi : 1, /* [23] */
  6637. ldpc : 1, /* [24] */
  6638. beamformed: 1, /* [25] */
  6639. reserved_2: 6; /* [31:26] */
  6640. A_UINT32 /* word 3 */
  6641. framectrl:16, /* [15: 0] */
  6642. seqno:16; /* [31:16] */
  6643. A_UINT32 /* word 4 */
  6644. tid_num:5, /* [ 4: 0] actual TID number */
  6645. vdev_id:8, /* [12: 5] */
  6646. reserved_3:19; /* [31:13] */
  6647. A_UINT32 /* word 5 */
  6648. /* status:
  6649. * 0: tx_ok
  6650. * 1: retry
  6651. * 2: drop
  6652. * 3: filtered
  6653. * 4: abort
  6654. * 5: tid delete
  6655. * 6: sw abort
  6656. * 7: dropped by peer migration
  6657. */
  6658. status:3, /* [2:0] */
  6659. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  6660. tx_mpdu_bytes:16, /* [19:4] */
  6661. reserved_4:12; /* [31:20] */
  6662. } POSTPACK;
  6663. /* FW offload deliver ind message header fields */
  6664. /* DWORD one */
  6665. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  6666. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  6667. /* DWORD two */
  6668. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  6669. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  6670. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  6671. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  6672. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  6673. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  6674. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  6675. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  6676. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  6677. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  6678. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  6679. #define HTT_FW_OFFLOAD_IND_BW_S 19
  6680. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  6681. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  6682. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  6683. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  6684. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  6685. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  6686. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  6687. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  6688. /* DWORD three*/
  6689. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  6690. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  6691. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  6692. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  6693. /* DWORD four */
  6694. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  6695. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  6696. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  6697. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  6698. /* DWORD five */
  6699. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  6700. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  6701. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  6702. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  6703. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  6704. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  6705. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  6706. do { \
  6707. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  6708. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  6709. } while (0)
  6710. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  6711. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  6712. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  6713. do { \
  6714. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  6715. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  6716. } while (0)
  6717. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  6718. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  6719. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  6720. do { \
  6721. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  6722. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  6723. } while (0)
  6724. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  6725. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  6726. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  6727. do { \
  6728. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  6729. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  6730. } while (0)
  6731. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  6732. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  6733. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  6734. do { \
  6735. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  6736. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  6737. } while (0)
  6738. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  6739. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  6740. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  6741. do { \
  6742. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  6743. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  6744. } while (0)
  6745. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  6746. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  6747. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  6748. do { \
  6749. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  6750. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  6751. } while (0)
  6752. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  6753. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  6754. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  6755. do { \
  6756. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  6757. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  6758. } while (0)
  6759. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  6760. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  6761. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  6762. do { \
  6763. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  6764. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  6765. } while (0)
  6766. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  6767. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  6768. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  6769. do { \
  6770. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  6771. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  6772. } while (0)
  6773. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  6774. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  6775. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  6776. do { \
  6777. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  6778. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  6779. } while (0)
  6780. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  6781. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  6782. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  6783. do { \
  6784. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  6785. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  6786. } while (0)
  6787. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  6788. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  6789. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  6790. do { \
  6791. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  6792. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  6793. } while (0)
  6794. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  6795. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  6796. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  6797. do { \
  6798. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  6799. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  6800. } while (0)
  6801. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  6802. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  6803. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  6804. do { \
  6805. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  6806. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  6807. } while (0)
  6808. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  6809. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  6810. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  6811. do { \
  6812. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  6813. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  6814. } while (0)
  6815. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  6816. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  6817. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  6818. do { \
  6819. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  6820. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  6821. } while (0)
  6822. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  6823. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  6824. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  6825. do { \
  6826. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  6827. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  6828. } while (0)
  6829. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  6830. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  6831. /*
  6832. * @brief target -> host rx reorder flush message definition
  6833. *
  6834. * @details
  6835. * The following field definitions describe the format of the rx flush
  6836. * message sent from the target to the host.
  6837. * The message consists of a 4-octet header, followed by one or more
  6838. * 4-octet payload information elements.
  6839. *
  6840. * |31 24|23 8|7 0|
  6841. * |--------------------------------------------------------------|
  6842. * | TID | peer ID | msg type |
  6843. * |--------------------------------------------------------------|
  6844. * | seq num end | seq num start | MPDU status | reserved |
  6845. * |--------------------------------------------------------------|
  6846. * First DWORD:
  6847. * - MSG_TYPE
  6848. * Bits 7:0
  6849. * Purpose: identifies this as an rx flush message
  6850. * Value: 0x2
  6851. * - PEER_ID
  6852. * Bits 23:8 (only bits 18:8 actually used)
  6853. * Purpose: identify which peer's rx data is being flushed
  6854. * Value: (rx) peer ID
  6855. * - TID
  6856. * Bits 31:24 (only bits 27:24 actually used)
  6857. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6858. * Value: traffic identifier
  6859. * Second DWORD:
  6860. * - MPDU_STATUS
  6861. * Bits 15:8
  6862. * Purpose:
  6863. * Indicate whether the flushed MPDUs should be discarded or processed.
  6864. * Value:
  6865. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6866. * stages of rx processing
  6867. * other: discard the MPDUs
  6868. * It is anticipated that flush messages will always have
  6869. * MPDU status == 1, but the status flag is included for
  6870. * flexibility.
  6871. * - SEQ_NUM_START
  6872. * Bits 23:16
  6873. * Purpose:
  6874. * Indicate the start of a series of consecutive MPDUs being flushed.
  6875. * Not all MPDUs within this range are necessarily valid - the host
  6876. * must check each sequence number within this range to see if the
  6877. * corresponding MPDU is actually present.
  6878. * Value:
  6879. * The sequence number for the first MPDU in the sequence.
  6880. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6881. * - SEQ_NUM_END
  6882. * Bits 30:24
  6883. * Purpose:
  6884. * Indicate the end of a series of consecutive MPDUs being flushed.
  6885. * Value:
  6886. * The sequence number one larger than the sequence number of the
  6887. * last MPDU being flushed.
  6888. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6889. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6890. * are to be released for further rx processing.
  6891. * Not all MPDUs within this range are necessarily valid - the host
  6892. * must check each sequence number within this range to see if the
  6893. * corresponding MPDU is actually present.
  6894. */
  6895. /* first DWORD */
  6896. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6897. #define HTT_RX_FLUSH_PEER_ID_S 8
  6898. #define HTT_RX_FLUSH_TID_M 0xff000000
  6899. #define HTT_RX_FLUSH_TID_S 24
  6900. /* second DWORD */
  6901. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6902. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6903. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6904. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6905. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6906. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6907. #define HTT_RX_FLUSH_BYTES 8
  6908. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6909. do { \
  6910. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6911. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6912. } while (0)
  6913. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6914. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6915. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6916. do { \
  6917. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6918. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6919. } while (0)
  6920. #define HTT_RX_FLUSH_TID_GET(word) \
  6921. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6922. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6923. do { \
  6924. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6925. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6926. } while (0)
  6927. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6928. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6929. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6930. do { \
  6931. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6932. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6933. } while (0)
  6934. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6935. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6936. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6937. do { \
  6938. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6939. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6940. } while (0)
  6941. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6942. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6943. /*
  6944. * @brief target -> host rx pn check indication message
  6945. *
  6946. * @details
  6947. * The following field definitions describe the format of the Rx PN check
  6948. * indication message sent from the target to the host.
  6949. * The message consists of a 4-octet header, followed by the start and
  6950. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6951. * IE is one octet containing the sequence number that failed the PN
  6952. * check.
  6953. *
  6954. * |31 24|23 8|7 0|
  6955. * |--------------------------------------------------------------|
  6956. * | TID | peer ID | msg type |
  6957. * |--------------------------------------------------------------|
  6958. * | Reserved | PN IE count | seq num end | seq num start|
  6959. * |--------------------------------------------------------------|
  6960. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6961. * |--------------------------------------------------------------|
  6962. * First DWORD:
  6963. * - MSG_TYPE
  6964. * Bits 7:0
  6965. * Purpose: Identifies this as an rx pn check indication message
  6966. * Value: 0x2
  6967. * - PEER_ID
  6968. * Bits 23:8 (only bits 18:8 actually used)
  6969. * Purpose: identify which peer
  6970. * Value: (rx) peer ID
  6971. * - TID
  6972. * Bits 31:24 (only bits 27:24 actually used)
  6973. * Purpose: identify traffic identifier
  6974. * Value: traffic identifier
  6975. * Second DWORD:
  6976. * - SEQ_NUM_START
  6977. * Bits 7:0
  6978. * Purpose:
  6979. * Indicates the starting sequence number of the MPDU in this
  6980. * series of MPDUs that went though PN check.
  6981. * Value:
  6982. * The sequence number for the first MPDU in the sequence.
  6983. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6984. * - SEQ_NUM_END
  6985. * Bits 15:8
  6986. * Purpose:
  6987. * Indicates the ending sequence number of the MPDU in this
  6988. * series of MPDUs that went though PN check.
  6989. * Value:
  6990. * The sequence number one larger then the sequence number of the last
  6991. * MPDU being flushed.
  6992. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6993. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6994. * for invalid PN numbers and are ready to be released for further processing.
  6995. * Not all MPDUs within this range are necessarily valid - the host
  6996. * must check each sequence number within this range to see if the
  6997. * corresponding MPDU is actually present.
  6998. * - PN_IE_COUNT
  6999. * Bits 23:16
  7000. * Purpose:
  7001. * Used to determine the variable number of PN information elements in this
  7002. * message
  7003. *
  7004. * PN information elements:
  7005. * - PN_IE_x-
  7006. * Purpose:
  7007. * Each PN information element contains the sequence number of the MPDU that
  7008. * has failed the target PN check.
  7009. * Value:
  7010. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7011. * that failed the PN check.
  7012. */
  7013. /* first DWORD */
  7014. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7015. #define HTT_RX_PN_IND_PEER_ID_S 8
  7016. #define HTT_RX_PN_IND_TID_M 0xff000000
  7017. #define HTT_RX_PN_IND_TID_S 24
  7018. /* second DWORD */
  7019. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  7020. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  7021. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  7022. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  7023. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  7024. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  7025. #define HTT_RX_PN_IND_BYTES 8
  7026. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  7027. do { \
  7028. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  7029. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  7030. } while (0)
  7031. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  7032. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  7033. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  7034. do { \
  7035. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  7036. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  7037. } while (0)
  7038. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  7039. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  7040. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  7041. do { \
  7042. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  7043. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  7044. } while (0)
  7045. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  7046. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  7047. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  7048. do { \
  7049. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  7050. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  7051. } while (0)
  7052. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  7053. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  7054. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  7055. do { \
  7056. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  7057. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  7058. } while (0)
  7059. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  7060. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  7061. /*
  7062. * @brief target -> host rx offload deliver message for LL system
  7063. *
  7064. * @details
  7065. * In a low latency system this message is sent whenever the offload
  7066. * manager flushes out the packets it has coalesced in its coalescing buffer.
  7067. * The DMA of the actual packets into host memory is done before sending out
  7068. * this message. This message indicates only how many MSDUs to reap. The
  7069. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  7070. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  7071. * DMA'd by the MAC directly into host memory these packets do not contain
  7072. * the MAC descriptors in the header portion of the packet. Instead they contain
  7073. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  7074. * message, the packets are delivered directly to the NW stack without going
  7075. * through the regular reorder buffering and PN checking path since it has
  7076. * already been done in target.
  7077. *
  7078. * |31 24|23 16|15 8|7 0|
  7079. * |-----------------------------------------------------------------------|
  7080. * | Total MSDU count | reserved | msg type |
  7081. * |-----------------------------------------------------------------------|
  7082. *
  7083. * @brief target -> host rx offload deliver message for HL system
  7084. *
  7085. * @details
  7086. * In a high latency system this message is sent whenever the offload manager
  7087. * flushes out the packets it has coalesced in its coalescing buffer. The
  7088. * actual packets are also carried along with this message. When the host
  7089. * receives this message, it is expected to deliver these packets to the NW
  7090. * stack directly instead of routing them through the reorder buffering and
  7091. * PN checking path since it has already been done in target.
  7092. *
  7093. * |31 24|23 16|15 8|7 0|
  7094. * |-----------------------------------------------------------------------|
  7095. * | Total MSDU count | reserved | msg type |
  7096. * |-----------------------------------------------------------------------|
  7097. * | peer ID | MSDU length |
  7098. * |-----------------------------------------------------------------------|
  7099. * | MSDU payload | FW Desc | tid | vdev ID |
  7100. * |-----------------------------------------------------------------------|
  7101. * | MSDU payload contd. |
  7102. * |-----------------------------------------------------------------------|
  7103. * | peer ID | MSDU length |
  7104. * |-----------------------------------------------------------------------|
  7105. * | MSDU payload | FW Desc | tid | vdev ID |
  7106. * |-----------------------------------------------------------------------|
  7107. * | MSDU payload contd. |
  7108. * |-----------------------------------------------------------------------|
  7109. *
  7110. */
  7111. /* first DWORD */
  7112. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  7113. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  7114. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  7115. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  7116. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  7117. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  7118. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  7119. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  7120. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  7121. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  7122. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  7123. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  7124. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  7125. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  7126. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  7127. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  7128. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  7129. do { \
  7130. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  7131. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  7132. } while (0)
  7133. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  7134. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  7135. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  7136. do { \
  7137. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  7138. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  7139. } while (0)
  7140. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  7141. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  7142. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  7143. do { \
  7144. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  7145. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  7146. } while (0)
  7147. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  7148. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  7149. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  7150. do { \
  7151. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  7152. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  7153. } while (0)
  7154. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  7155. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  7156. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  7157. do { \
  7158. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  7159. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  7160. } while (0)
  7161. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  7162. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  7163. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  7164. do { \
  7165. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  7166. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  7167. } while (0)
  7168. /**
  7169. * @brief target -> host rx peer map/unmap message definition
  7170. *
  7171. * @details
  7172. * The following diagram shows the format of the rx peer map message sent
  7173. * from the target to the host. This layout assumes the target operates
  7174. * as little-endian.
  7175. *
  7176. * This message always contains a SW peer ID. The main purpose of the
  7177. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7178. * with, so that the host can use that peer ID to determine which peer
  7179. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7180. * other purposes, such as identifying during tx completions which peer
  7181. * the tx frames in question were transmitted to.
  7182. *
  7183. * In certain generations of chips, the peer map message also contains
  7184. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  7185. * to identify which peer the frame needs to be forwarded to (i.e. the
  7186. * peer assocated with the Destination MAC Address within the packet),
  7187. * and particularly which vdev needs to transmit the frame (for cases
  7188. * of inter-vdev rx --> tx forwarding).
  7189. * This DA-based peer ID that is provided for certain rx frames
  7190. * (the rx frames that need to be re-transmitted as tx frames)
  7191. * is the ID that the HW uses for referring to the peer in question,
  7192. * rather than the peer ID that the SW+FW use to refer to the peer.
  7193. *
  7194. *
  7195. * |31 24|23 16|15 8|7 0|
  7196. * |-----------------------------------------------------------------------|
  7197. * | SW peer ID | VDEV ID | msg type |
  7198. * |-----------------------------------------------------------------------|
  7199. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7200. * |-----------------------------------------------------------------------|
  7201. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  7202. * |-----------------------------------------------------------------------|
  7203. *
  7204. *
  7205. * The following diagram shows the format of the rx peer unmap message sent
  7206. * from the target to the host.
  7207. *
  7208. * |31 24|23 16|15 8|7 0|
  7209. * |-----------------------------------------------------------------------|
  7210. * | SW peer ID | VDEV ID | msg type |
  7211. * |-----------------------------------------------------------------------|
  7212. *
  7213. * The following field definitions describe the format of the rx peer map
  7214. * and peer unmap messages sent from the target to the host.
  7215. * - MSG_TYPE
  7216. * Bits 7:0
  7217. * Purpose: identifies this as an rx peer map or peer unmap message
  7218. * Value: peer map -> 0x3, peer unmap -> 0x4
  7219. * - VDEV_ID
  7220. * Bits 15:8
  7221. * Purpose: Indicates which virtual device the peer is associated
  7222. * with.
  7223. * Value: vdev ID (used in the host to look up the vdev object)
  7224. * - PEER_ID (a.k.a. SW_PEER_ID)
  7225. * Bits 31:16
  7226. * Purpose: The peer ID (index) that WAL is allocating (map) or
  7227. * freeing (unmap)
  7228. * Value: (rx) peer ID
  7229. * - MAC_ADDR_L32 (peer map only)
  7230. * Bits 31:0
  7231. * Purpose: Identifies which peer node the peer ID is for.
  7232. * Value: lower 4 bytes of peer node's MAC address
  7233. * - MAC_ADDR_U16 (peer map only)
  7234. * Bits 15:0
  7235. * Purpose: Identifies which peer node the peer ID is for.
  7236. * Value: upper 2 bytes of peer node's MAC address
  7237. * - HW_PEER_ID
  7238. * Bits 31:16
  7239. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7240. * address, so for rx frames marked for rx --> tx forwarding, the
  7241. * host can determine from the HW peer ID provided as meta-data with
  7242. * the rx frame which peer the frame is supposed to be forwarded to.
  7243. * Value: ID used by the MAC HW to identify the peer
  7244. */
  7245. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  7246. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  7247. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  7248. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  7249. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  7250. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  7251. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  7252. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  7253. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  7254. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  7255. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  7256. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  7257. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  7258. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  7259. do { \
  7260. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  7261. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  7262. } while (0)
  7263. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  7264. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  7265. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  7266. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  7267. do { \
  7268. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  7269. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  7270. } while (0)
  7271. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  7272. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  7273. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  7274. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  7275. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  7276. do { \
  7277. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  7278. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  7279. } while (0)
  7280. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  7281. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  7282. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  7283. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  7284. #define HTT_RX_PEER_MAP_BYTES 12
  7285. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  7286. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  7287. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  7288. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  7289. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  7290. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  7291. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  7292. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  7293. #define HTT_RX_PEER_UNMAP_BYTES 4
  7294. /**
  7295. * @brief target -> host rx peer map V2 message definition
  7296. *
  7297. * @details
  7298. * The following diagram shows the format of the rx peer map v2 message sent
  7299. * from the target to the host. This layout assumes the target operates
  7300. * as little-endian.
  7301. *
  7302. * This message always contains a SW peer ID. The main purpose of the
  7303. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7304. * with, so that the host can use that peer ID to determine which peer
  7305. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7306. * other purposes, such as identifying during tx completions which peer
  7307. * the tx frames in question were transmitted to.
  7308. *
  7309. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  7310. * is used during rx --> tx frame forwarding to identify which peer the
  7311. * frame needs to be forwarded to (i.e. the peer assocated with the
  7312. * Destination MAC Address within the packet), and particularly which vdev
  7313. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  7314. * This DA-based peer ID that is provided for certain rx frames
  7315. * (the rx frames that need to be re-transmitted as tx frames)
  7316. * is the ID that the HW uses for referring to the peer in question,
  7317. * rather than the peer ID that the SW+FW use to refer to the peer.
  7318. *
  7319. *
  7320. * |31 24|23 16|15 8|7 0|
  7321. * |-----------------------------------------------------------------------|
  7322. * | SW peer ID | VDEV ID | msg type |
  7323. * |-----------------------------------------------------------------------|
  7324. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7325. * |-----------------------------------------------------------------------|
  7326. * | HW peer ID | MAC addr 5 | MAC addr 4 |
  7327. * |-----------------------------------------------------------------------|
  7328. * | Reserved_17_31 | Next Hop | AST Hash Value |
  7329. * |-----------------------------------------------------------------------|
  7330. * | Reserved_0 |
  7331. * |-----------------------------------------------------------------------|
  7332. * | Reserved_1 |
  7333. * |-----------------------------------------------------------------------|
  7334. * | Reserved_2 |
  7335. * |-----------------------------------------------------------------------|
  7336. * | Reserved_3 |
  7337. * |-----------------------------------------------------------------------|
  7338. *
  7339. *
  7340. * The following field definitions describe the format of the rx peer map v2
  7341. * messages sent from the target to the host.
  7342. * - MSG_TYPE
  7343. * Bits 7:0
  7344. * Purpose: identifies this as an rx peer map v2 message
  7345. * Value: peer map v2 -> 0x1e
  7346. * - VDEV_ID
  7347. * Bits 15:8
  7348. * Purpose: Indicates which virtual device the peer is associated with.
  7349. * Value: vdev ID (used in the host to look up the vdev object)
  7350. * - SW_PEER_ID
  7351. * Bits 31:16
  7352. * Purpose: The peer ID (index) that WAL is allocating
  7353. * Value: (rx) peer ID
  7354. * - MAC_ADDR_L32
  7355. * Bits 31:0
  7356. * Purpose: Identifies which peer node the peer ID is for.
  7357. * Value: lower 4 bytes of peer node's MAC address
  7358. * - MAC_ADDR_U16
  7359. * Bits 15:0
  7360. * Purpose: Identifies which peer node the peer ID is for.
  7361. * Value: upper 2 bytes of peer node's MAC address
  7362. * - HW_PEER_ID
  7363. * Bits 31:16
  7364. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7365. * address, so for rx frames marked for rx --> tx forwarding, the
  7366. * host can determine from the HW peer ID provided as meta-data with
  7367. * the rx frame which peer the frame is supposed to be forwarded to.
  7368. * Value: ID used by the MAC HW to identify the peer
  7369. * - AST_HASH_VALUE
  7370. * Bits 15:0
  7371. * Purpose: Indicates AST Hash value is required for the TCL AST index
  7372. * override feature.
  7373. * - NEXT_HOP
  7374. * Bit 16
  7375. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  7376. * (Wireless Distribution System).
  7377. */
  7378. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  7379. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  7380. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  7381. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  7382. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  7383. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  7384. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  7385. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  7386. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  7387. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  7388. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  7389. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  7390. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  7391. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  7392. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  7393. do { \
  7394. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  7395. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  7396. } while (0)
  7397. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  7398. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  7399. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  7400. do { \
  7401. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  7402. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  7403. } while (0)
  7404. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  7405. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  7406. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  7407. do { \
  7408. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  7409. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  7410. } while (0)
  7411. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  7412. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  7413. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  7414. do { \
  7415. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  7416. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  7417. } while (0)
  7418. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  7419. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  7420. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  7421. do { \
  7422. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7423. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7424. } while (0)
  7425. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7426. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7427. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7428. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7429. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7430. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7431. #define HTT_RX_PEER_MAP_V2_BYTES 32
  7432. /**
  7433. * @brief target -> host rx peer unmap V2 message definition
  7434. *
  7435. *
  7436. * The following diagram shows the format of the rx peer unmap message sent
  7437. * from the target to the host.
  7438. *
  7439. * |31 24|23 16|15 8|7 0|
  7440. * |-----------------------------------------------------------------------|
  7441. * | SW peer ID | VDEV ID | msg type |
  7442. * |-----------------------------------------------------------------------|
  7443. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7444. * |-----------------------------------------------------------------------|
  7445. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7446. * |-----------------------------------------------------------------------|
  7447. * | Peer Delete Duration |
  7448. * |-----------------------------------------------------------------------|
  7449. * | Reserved_0 |
  7450. * |-----------------------------------------------------------------------|
  7451. * | Reserved_1 |
  7452. * |-----------------------------------------------------------------------|
  7453. * | Reserved_2 |
  7454. * |-----------------------------------------------------------------------|
  7455. *
  7456. *
  7457. * The following field definitions describe the format of the rx peer unmap
  7458. * messages sent from the target to the host.
  7459. * - MSG_TYPE
  7460. * Bits 7:0
  7461. * Purpose: identifies this as an rx peer unmap v2 message
  7462. * Value: peer unmap v2 -> 0x1f
  7463. * - VDEV_ID
  7464. * Bits 15:8
  7465. * Purpose: Indicates which virtual device the peer is associated
  7466. * with.
  7467. * Value: vdev ID (used in the host to look up the vdev object)
  7468. * - SW_PEER_ID
  7469. * Bits 31:16
  7470. * Purpose: The peer ID (index) that WAL is freeing
  7471. * Value: (rx) peer ID
  7472. * - MAC_ADDR_L32
  7473. * Bits 31:0
  7474. * Purpose: Identifies which peer node the peer ID is for.
  7475. * Value: lower 4 bytes of peer node's MAC address
  7476. * - MAC_ADDR_U16
  7477. * Bits 15:0
  7478. * Purpose: Identifies which peer node the peer ID is for.
  7479. * Value: upper 2 bytes of peer node's MAC address
  7480. * - NEXT_HOP
  7481. * Bits 16
  7482. * Purpose: Bit indicates next_hop AST entry used for WDS
  7483. * (Wireless Distribution System).
  7484. * - PEER_DELETE_DURATION
  7485. * Bits 31:0
  7486. * Purpose: Time taken to delete peer, in msec,
  7487. * Used for monitoring / debugging PEER delete response delay
  7488. */
  7489. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7490. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7491. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7492. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7493. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7494. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7495. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7496. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7497. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7498. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7499. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7500. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7501. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7502. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7503. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7504. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7505. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7506. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7507. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7508. do { \
  7509. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7510. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7511. } while (0)
  7512. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7513. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7514. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7515. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7516. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7517. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7518. /**
  7519. * @brief target -> host message specifying security parameters
  7520. *
  7521. * @details
  7522. * The following diagram shows the format of the security specification
  7523. * message sent from the target to the host.
  7524. * This security specification message tells the host whether a PN check is
  7525. * necessary on rx data frames, and if so, how large the PN counter is.
  7526. * This message also tells the host about the security processing to apply
  7527. * to defragmented rx frames - specifically, whether a Message Integrity
  7528. * Check is required, and the Michael key to use.
  7529. *
  7530. * |31 24|23 16|15|14 8|7 0|
  7531. * |-----------------------------------------------------------------------|
  7532. * | peer ID | U| security type | msg type |
  7533. * |-----------------------------------------------------------------------|
  7534. * | Michael Key K0 |
  7535. * |-----------------------------------------------------------------------|
  7536. * | Michael Key K1 |
  7537. * |-----------------------------------------------------------------------|
  7538. * | WAPI RSC Low0 |
  7539. * |-----------------------------------------------------------------------|
  7540. * | WAPI RSC Low1 |
  7541. * |-----------------------------------------------------------------------|
  7542. * | WAPI RSC Hi0 |
  7543. * |-----------------------------------------------------------------------|
  7544. * | WAPI RSC Hi1 |
  7545. * |-----------------------------------------------------------------------|
  7546. *
  7547. * The following field definitions describe the format of the security
  7548. * indication message sent from the target to the host.
  7549. * - MSG_TYPE
  7550. * Bits 7:0
  7551. * Purpose: identifies this as a security specification message
  7552. * Value: 0xb
  7553. * - SEC_TYPE
  7554. * Bits 14:8
  7555. * Purpose: specifies which type of security applies to the peer
  7556. * Value: htt_sec_type enum value
  7557. * - UNICAST
  7558. * Bit 15
  7559. * Purpose: whether this security is applied to unicast or multicast data
  7560. * Value: 1 -> unicast, 0 -> multicast
  7561. * - PEER_ID
  7562. * Bits 31:16
  7563. * Purpose: The ID number for the peer the security specification is for
  7564. * Value: peer ID
  7565. * - MICHAEL_KEY_K0
  7566. * Bits 31:0
  7567. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7568. * Value: Michael Key K0 (if security type is TKIP)
  7569. * - MICHAEL_KEY_K1
  7570. * Bits 31:0
  7571. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7572. * Value: Michael Key K1 (if security type is TKIP)
  7573. * - WAPI_RSC_LOW0
  7574. * Bits 31:0
  7575. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7576. * Value: WAPI RSC Low0 (if security type is WAPI)
  7577. * - WAPI_RSC_LOW1
  7578. * Bits 31:0
  7579. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7580. * Value: WAPI RSC Low1 (if security type is WAPI)
  7581. * - WAPI_RSC_HI0
  7582. * Bits 31:0
  7583. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7584. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7585. * - WAPI_RSC_HI1
  7586. * Bits 31:0
  7587. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7588. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7589. */
  7590. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7591. #define HTT_SEC_IND_SEC_TYPE_S 8
  7592. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7593. #define HTT_SEC_IND_UNICAST_S 15
  7594. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7595. #define HTT_SEC_IND_PEER_ID_S 16
  7596. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7597. do { \
  7598. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7599. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7600. } while (0)
  7601. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7602. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7603. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7604. do { \
  7605. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7606. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7607. } while (0)
  7608. #define HTT_SEC_IND_UNICAST_GET(word) \
  7609. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7610. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7611. do { \
  7612. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7613. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7614. } while (0)
  7615. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7616. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7617. #define HTT_SEC_IND_BYTES 28
  7618. /**
  7619. * @brief target -> host rx ADDBA / DELBA message definitions
  7620. *
  7621. * @details
  7622. * The following diagram shows the format of the rx ADDBA message sent
  7623. * from the target to the host:
  7624. *
  7625. * |31 20|19 16|15 8|7 0|
  7626. * |---------------------------------------------------------------------|
  7627. * | peer ID | TID | window size | msg type |
  7628. * |---------------------------------------------------------------------|
  7629. *
  7630. * The following diagram shows the format of the rx DELBA message sent
  7631. * from the target to the host:
  7632. *
  7633. * |31 20|19 16|15 10|9 8|7 0|
  7634. * |---------------------------------------------------------------------|
  7635. * | peer ID | TID | reserved | IR| msg type |
  7636. * |---------------------------------------------------------------------|
  7637. *
  7638. * The following field definitions describe the format of the rx ADDBA
  7639. * and DELBA messages sent from the target to the host.
  7640. * - MSG_TYPE
  7641. * Bits 7:0
  7642. * Purpose: identifies this as an rx ADDBA or DELBA message
  7643. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7644. * - IR (initiator / recipient)
  7645. * Bits 9:8 (DELBA only)
  7646. * Purpose: specify whether the DELBA handshake was initiated by the
  7647. * local STA/AP, or by the peer STA/AP
  7648. * Value:
  7649. * 0 - unspecified
  7650. * 1 - initiator (a.k.a. originator)
  7651. * 2 - recipient (a.k.a. responder)
  7652. * 3 - unused / reserved
  7653. * - WIN_SIZE
  7654. * Bits 15:8 (ADDBA only)
  7655. * Purpose: Specifies the length of the block ack window (max = 64).
  7656. * Value:
  7657. * block ack window length specified by the received ADDBA
  7658. * management message.
  7659. * - TID
  7660. * Bits 19:16
  7661. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7662. * Value:
  7663. * TID specified by the received ADDBA or DELBA management message.
  7664. * - PEER_ID
  7665. * Bits 31:20
  7666. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7667. * Value:
  7668. * ID (hash value) used by the host for fast, direct lookup of
  7669. * host SW peer info, including rx reorder states.
  7670. */
  7671. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7672. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7673. #define HTT_RX_ADDBA_TID_M 0xf0000
  7674. #define HTT_RX_ADDBA_TID_S 16
  7675. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7676. #define HTT_RX_ADDBA_PEER_ID_S 20
  7677. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7680. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7681. } while (0)
  7682. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7683. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7684. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7685. do { \
  7686. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7687. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7688. } while (0)
  7689. #define HTT_RX_ADDBA_TID_GET(word) \
  7690. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7691. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7692. do { \
  7693. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7694. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7695. } while (0)
  7696. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7697. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7698. #define HTT_RX_ADDBA_BYTES 4
  7699. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7700. #define HTT_RX_DELBA_INITIATOR_S 8
  7701. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7702. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7703. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7704. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7705. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7706. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7707. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7708. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7709. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7710. do { \
  7711. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7712. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7713. } while (0)
  7714. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7715. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7716. #define HTT_RX_DELBA_BYTES 4
  7717. /**
  7718. * @brief tx queue group information element definition
  7719. *
  7720. * @details
  7721. * The following diagram shows the format of the tx queue group
  7722. * information element, which can be included in target --> host
  7723. * messages to specify the number of tx "credits" (tx descriptors
  7724. * for LL, or tx buffers for HL) available to a particular group
  7725. * of host-side tx queues, and which host-side tx queues belong to
  7726. * the group.
  7727. *
  7728. * |31|30 24|23 16|15|14|13 0|
  7729. * |------------------------------------------------------------------------|
  7730. * | X| reserved | tx queue grp ID | A| S| credit count |
  7731. * |------------------------------------------------------------------------|
  7732. * | vdev ID mask | AC mask |
  7733. * |------------------------------------------------------------------------|
  7734. *
  7735. * The following definitions describe the fields within the tx queue group
  7736. * information element:
  7737. * - credit_count
  7738. * Bits 13:1
  7739. * Purpose: specify how many tx credits are available to the tx queue group
  7740. * Value: An absolute or relative, positive or negative credit value
  7741. * The 'A' bit specifies whether the value is absolute or relative.
  7742. * The 'S' bit specifies whether the value is positive or negative.
  7743. * A negative value can only be relative, not absolute.
  7744. * An absolute value replaces any prior credit value the host has for
  7745. * the tx queue group in question.
  7746. * A relative value is added to the prior credit value the host has for
  7747. * the tx queue group in question.
  7748. * - sign
  7749. * Bit 14
  7750. * Purpose: specify whether the credit count is positive or negative
  7751. * Value: 0 -> positive, 1 -> negative
  7752. * - absolute
  7753. * Bit 15
  7754. * Purpose: specify whether the credit count is absolute or relative
  7755. * Value: 0 -> relative, 1 -> absolute
  7756. * - txq_group_id
  7757. * Bits 23:16
  7758. * Purpose: indicate which tx queue group's credit and/or membership are
  7759. * being specified
  7760. * Value: 0 to max_tx_queue_groups-1
  7761. * - reserved
  7762. * Bits 30:16
  7763. * Value: 0x0
  7764. * - eXtension
  7765. * Bit 31
  7766. * Purpose: specify whether another tx queue group info element follows
  7767. * Value: 0 -> no more tx queue group information elements
  7768. * 1 -> another tx queue group information element immediately follows
  7769. * - ac_mask
  7770. * Bits 15:0
  7771. * Purpose: specify which Access Categories belong to the tx queue group
  7772. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7773. * the tx queue group.
  7774. * The AC bit-mask values are obtained by left-shifting by the
  7775. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7776. * - vdev_id_mask
  7777. * Bits 31:16
  7778. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7779. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7780. * belong to the tx queue group.
  7781. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7782. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7783. */
  7784. PREPACK struct htt_txq_group {
  7785. A_UINT32
  7786. credit_count: 14,
  7787. sign: 1,
  7788. absolute: 1,
  7789. tx_queue_group_id: 8,
  7790. reserved0: 7,
  7791. extension: 1;
  7792. A_UINT32
  7793. ac_mask: 16,
  7794. vdev_id_mask: 16;
  7795. } POSTPACK;
  7796. /* first word */
  7797. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7798. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7799. #define HTT_TXQ_GROUP_SIGN_S 14
  7800. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7801. #define HTT_TXQ_GROUP_ABS_S 15
  7802. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7803. #define HTT_TXQ_GROUP_ID_S 16
  7804. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7805. #define HTT_TXQ_GROUP_EXT_S 31
  7806. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7807. /* second word */
  7808. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7809. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7810. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7811. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7812. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7813. do { \
  7814. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7815. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7816. } while (0)
  7817. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7818. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7819. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7820. do { \
  7821. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7822. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7823. } while (0)
  7824. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7825. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7826. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7827. do { \
  7828. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7829. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7830. } while (0)
  7831. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7832. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7833. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7834. do { \
  7835. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7836. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7837. } while (0)
  7838. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7839. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7840. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7841. do { \
  7842. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7843. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7844. } while (0)
  7845. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7846. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7847. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7848. do { \
  7849. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7850. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7851. } while (0)
  7852. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7853. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7854. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7855. do { \
  7856. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7857. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7858. } while (0)
  7859. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7860. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7861. /**
  7862. * @brief target -> host TX completion indication message definition
  7863. *
  7864. * @details
  7865. * The following diagram shows the format of the TX completion indication sent
  7866. * from the target to the host
  7867. *
  7868. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  7869. * |-------------------------------------------------------------------|
  7870. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  7871. * |-------------------------------------------------------------------|
  7872. * payload:| MSDU1 ID | MSDU0 ID |
  7873. * |-------------------------------------------------------------------|
  7874. * : MSDU3 ID | MSDU2 ID :
  7875. * |-------------------------------------------------------------------|
  7876. * | struct htt_tx_compl_ind_append_retries |
  7877. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7878. * | struct htt_tx_compl_ind_append_tx_tstamp |
  7879. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7880. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  7881. * |-------------------------------------------------------------------|
  7882. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  7883. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7884. * | MSDU0 tx_tsf64_low |
  7885. * |-------------------------------------------------------------------|
  7886. * | MSDU0 tx_tsf64_high |
  7887. * |-------------------------------------------------------------------|
  7888. * | MSDU1 tx_tsf64_low |
  7889. * |-------------------------------------------------------------------|
  7890. * | MSDU1 tx_tsf64_high |
  7891. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7892. * | phy_timestamp |
  7893. * |-------------------------------------------------------------------|
  7894. * | rate specs (see below) |
  7895. * |-------------------------------------------------------------------|
  7896. * | seqctrl | framectrl |
  7897. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  7898. * Where:
  7899. * A0 = append (a.k.a. append0)
  7900. * A1 = append1
  7901. * TP = MSDU tx power presence
  7902. * A2 = append2
  7903. * A3 = append3
  7904. * A4 = append4
  7905. *
  7906. * The following field definitions describe the format of the TX completion
  7907. * indication sent from the target to the host
  7908. * Header fields:
  7909. * - msg_type
  7910. * Bits 7:0
  7911. * Purpose: identifies this as HTT TX completion indication
  7912. * Value: 0x7
  7913. * - status
  7914. * Bits 10:8
  7915. * Purpose: the TX completion status of payload fragmentations descriptors
  7916. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  7917. * - tid
  7918. * Bits 14:11
  7919. * Purpose: the tid associated with those fragmentation descriptors. It is
  7920. * valid or not, depending on the tid_invalid bit.
  7921. * Value: 0 to 15
  7922. * - tid_invalid
  7923. * Bits 15:15
  7924. * Purpose: this bit indicates whether the tid field is valid or not
  7925. * Value: 0 indicates valid; 1 indicates invalid
  7926. * - num
  7927. * Bits 23:16
  7928. * Purpose: the number of payload in this indication
  7929. * Value: 1 to 255
  7930. * - append (a.k.a. append0)
  7931. * Bits 24:24
  7932. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  7933. * the number of tx retries for one MSDU at the end of this message
  7934. * Value: 0 indicates no appending; 1 indicates appending
  7935. * - append1
  7936. * Bits 25:25
  7937. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  7938. * contains the timestamp info for each TX msdu id in payload.
  7939. * The order of the timestamps matches the order of the MSDU IDs.
  7940. * Note that a big-endian host needs to account for the reordering
  7941. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7942. * conversion) when determining which tx timestamp corresponds to
  7943. * which MSDU ID.
  7944. * Value: 0 indicates no appending; 1 indicates appending
  7945. * - msdu_tx_power_presence
  7946. * Bits 26:26
  7947. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  7948. * for each MSDU referenced by the TX_COMPL_IND message.
  7949. * The tx power is reported in 0.5 dBm units.
  7950. * The order of the per-MSDU tx power reports matches the order
  7951. * of the MSDU IDs.
  7952. * Note that a big-endian host needs to account for the reordering
  7953. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  7954. * conversion) when determining which Tx Power corresponds to
  7955. * which MSDU ID.
  7956. * Value: 0 indicates MSDU tx power reports are not appended,
  7957. * 1 indicates MSDU tx power reports are appended
  7958. * - append2
  7959. * Bits 27:27
  7960. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  7961. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  7962. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  7963. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  7964. * for each MSDU, for convenience.
  7965. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  7966. * this append2 bit is set).
  7967. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  7968. * dB above the noise floor.
  7969. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  7970. * 1 indicates MSDU ACK RSSI values are appended.
  7971. * - append3
  7972. * Bits 28:28
  7973. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  7974. * contains the tx tsf info based on wlan global TSF for
  7975. * each TX msdu id in payload.
  7976. * The order of the tx tsf matches the order of the MSDU IDs.
  7977. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  7978. * values to indicate the the lower 32 bits and higher 32 bits of
  7979. * the tx tsf.
  7980. * The tx_tsf64 here represents the time MSDU was acked and the
  7981. * tx_tsf64 has microseconds units.
  7982. * Value: 0 indicates no appending; 1 indicates appending
  7983. * - append4
  7984. * Bits 29:29
  7985. * Purpose: Indicate whether data frame control fields and fields required
  7986. * for radio tap header are appended for each MSDU in TX_COMP_IND
  7987. * message. The order of the this message matches the order of
  7988. * the MSDU IDs.
  7989. * Value: 0 indicates frame control fields and fields required for
  7990. * radio tap header values are not appended,
  7991. * 1 indicates frame control fields and fields required for
  7992. * radio tap header values are appended.
  7993. * Payload fields:
  7994. * - hmsdu_id
  7995. * Bits 15:0
  7996. * Purpose: this ID is used to track the Tx buffer in host
  7997. * Value: 0 to "size of host MSDU descriptor pool - 1"
  7998. */
  7999. PREPACK struct htt_tx_data_hdr_information {
  8000. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  8001. A_UINT32 /* word 1 */
  8002. /* preamble:
  8003. * 0-OFDM,
  8004. * 1-CCk,
  8005. * 2-HT,
  8006. * 3-VHT
  8007. */
  8008. preamble: 2, /* [1:0] */
  8009. /* mcs:
  8010. * In case of HT preamble interpret
  8011. * MCS along with NSS.
  8012. * Valid values for HT are 0 to 7.
  8013. * HT mcs 0 with NSS 2 is mcs 8.
  8014. * Valid values for VHT are 0 to 9.
  8015. */
  8016. mcs: 4, /* [5:2] */
  8017. /* rate:
  8018. * This is applicable only for
  8019. * CCK and OFDM preamble type
  8020. * rate 0: OFDM 48 Mbps,
  8021. * 1: OFDM 24 Mbps,
  8022. * 2: OFDM 12 Mbps
  8023. * 3: OFDM 6 Mbps
  8024. * 4: OFDM 54 Mbps
  8025. * 5: OFDM 36 Mbps
  8026. * 6: OFDM 18 Mbps
  8027. * 7: OFDM 9 Mbps
  8028. * rate 0: CCK 11 Mbps Long
  8029. * 1: CCK 5.5 Mbps Long
  8030. * 2: CCK 2 Mbps Long
  8031. * 3: CCK 1 Mbps Long
  8032. * 4: CCK 11 Mbps Short
  8033. * 5: CCK 5.5 Mbps Short
  8034. * 6: CCK 2 Mbps Short
  8035. */
  8036. rate : 3, /* [ 8: 6] */
  8037. rssi : 8, /* [16: 9] units=dBm */
  8038. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8039. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8040. stbc : 1, /* [22] */
  8041. sgi : 1, /* [23] */
  8042. ldpc : 1, /* [24] */
  8043. beamformed: 1, /* [25] */
  8044. reserved_1: 6; /* [31:26] */
  8045. A_UINT32 /* word 2 */
  8046. framectrl:16, /* [15: 0] */
  8047. seqno:16; /* [31:16] */
  8048. } POSTPACK;
  8049. #define HTT_TX_COMPL_IND_STATUS_S 8
  8050. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  8051. #define HTT_TX_COMPL_IND_TID_S 11
  8052. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  8053. #define HTT_TX_COMPL_IND_TID_INV_S 15
  8054. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  8055. #define HTT_TX_COMPL_IND_NUM_S 16
  8056. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  8057. #define HTT_TX_COMPL_IND_APPEND_S 24
  8058. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  8059. #define HTT_TX_COMPL_IND_APPEND1_S 25
  8060. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  8061. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  8062. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  8063. #define HTT_TX_COMPL_IND_APPEND2_S 27
  8064. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  8065. #define HTT_TX_COMPL_IND_APPEND3_S 28
  8066. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  8067. #define HTT_TX_COMPL_IND_APPEND4_S 29
  8068. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  8069. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  8070. do { \
  8071. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  8072. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  8073. } while (0)
  8074. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  8075. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  8076. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  8077. do { \
  8078. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  8079. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  8080. } while (0)
  8081. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  8082. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  8083. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  8084. do { \
  8085. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  8086. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  8087. } while (0)
  8088. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  8089. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  8090. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  8091. do { \
  8092. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  8093. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  8094. } while (0)
  8095. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  8096. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  8097. HTT_TX_COMPL_IND_TID_INV_S)
  8098. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  8099. do { \
  8100. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  8101. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  8102. } while (0)
  8103. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  8104. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  8105. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  8106. do { \
  8107. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  8108. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  8109. } while (0)
  8110. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  8111. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  8112. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  8113. do { \
  8114. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  8115. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  8116. } while (0)
  8117. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  8118. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  8119. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  8120. do { \
  8121. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  8122. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  8123. } while (0)
  8124. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  8125. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  8126. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  8127. do { \
  8128. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  8129. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  8130. } while (0)
  8131. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  8132. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  8133. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  8134. do { \
  8135. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  8136. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  8137. } while (0)
  8138. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  8139. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  8140. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  8141. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  8142. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  8143. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  8144. #define HTT_TX_COMPL_IND_STAT_OK 0
  8145. /* DISCARD:
  8146. * current meaning:
  8147. * MSDUs were queued for transmission but filtered by HW or SW
  8148. * without any over the air attempts
  8149. * legacy meaning (HL Rome):
  8150. * MSDUs were discarded by the target FW without any over the air
  8151. * attempts due to lack of space
  8152. */
  8153. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  8154. /* NO_ACK:
  8155. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  8156. */
  8157. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  8158. /* POSTPONE:
  8159. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  8160. * be downloaded again later (in the appropriate order), when they are
  8161. * deliverable.
  8162. */
  8163. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  8164. /*
  8165. * The PEER_DEL tx completion status is used for HL cases
  8166. * where the peer the frame is for has been deleted.
  8167. * The host has already discarded its copy of the frame, but
  8168. * it still needs the tx completion to restore its credit.
  8169. */
  8170. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  8171. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  8172. #define HTT_TX_COMPL_IND_STAT_DROP 5
  8173. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  8174. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  8175. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  8176. PREPACK struct htt_tx_compl_ind_base {
  8177. A_UINT32 hdr;
  8178. A_UINT16 payload[1/*or more*/];
  8179. } POSTPACK;
  8180. PREPACK struct htt_tx_compl_ind_append_retries {
  8181. A_UINT16 msdu_id;
  8182. A_UINT8 tx_retries;
  8183. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  8184. 0: this is the last append_retries struct */
  8185. } POSTPACK;
  8186. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  8187. A_UINT32 timestamp[1/*or more*/];
  8188. } POSTPACK;
  8189. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  8190. A_UINT32 tx_tsf64_low;
  8191. A_UINT32 tx_tsf64_high;
  8192. } POSTPACK;
  8193. /* htt_tx_data_hdr_information payload extension fields: */
  8194. /* DWORD zero */
  8195. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  8196. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  8197. /* DWORD one */
  8198. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  8199. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  8200. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  8201. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  8202. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  8203. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  8204. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  8205. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  8206. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  8207. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  8208. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  8209. #define HTT_FW_TX_DATA_HDR_BW_S 19
  8210. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  8211. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  8212. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  8213. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  8214. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  8215. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  8216. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  8217. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  8218. /* DWORD two */
  8219. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  8220. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  8221. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  8222. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  8223. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  8224. do { \
  8225. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  8226. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  8227. } while (0)
  8228. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  8229. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  8230. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  8231. do { \
  8232. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  8233. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  8234. } while (0)
  8235. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  8236. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  8237. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  8238. do { \
  8239. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  8240. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  8241. } while (0)
  8242. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  8243. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  8244. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  8245. do { \
  8246. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  8247. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  8248. } while (0)
  8249. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  8250. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  8251. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  8252. do { \
  8253. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  8254. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  8255. } while (0)
  8256. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  8257. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  8258. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  8259. do { \
  8260. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  8261. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  8262. } while (0)
  8263. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  8264. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  8265. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  8266. do { \
  8267. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  8268. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  8269. } while (0)
  8270. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  8271. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  8272. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  8273. do { \
  8274. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  8275. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  8276. } while (0)
  8277. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  8278. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  8279. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  8280. do { \
  8281. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  8282. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  8283. } while (0)
  8284. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  8285. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  8286. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  8287. do { \
  8288. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  8289. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  8290. } while (0)
  8291. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  8292. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  8293. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  8294. do { \
  8295. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  8296. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  8297. } while (0)
  8298. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  8299. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  8300. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  8301. do { \
  8302. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  8303. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  8304. } while (0)
  8305. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  8306. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  8307. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  8308. do { \
  8309. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  8310. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  8311. } while (0)
  8312. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  8313. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  8314. /**
  8315. * @brief target -> host rate-control update indication message
  8316. *
  8317. * @details
  8318. * The following diagram shows the format of the RC Update message
  8319. * sent from the target to the host, while processing the tx-completion
  8320. * of a transmitted PPDU.
  8321. *
  8322. * |31 24|23 16|15 8|7 0|
  8323. * |-------------------------------------------------------------|
  8324. * | peer ID | vdev ID | msg_type |
  8325. * |-------------------------------------------------------------|
  8326. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8327. * |-------------------------------------------------------------|
  8328. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  8329. * |-------------------------------------------------------------|
  8330. * | : |
  8331. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8332. * | : |
  8333. * |-------------------------------------------------------------|
  8334. * | : |
  8335. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8336. * | : |
  8337. * |-------------------------------------------------------------|
  8338. * : :
  8339. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8340. *
  8341. */
  8342. typedef struct {
  8343. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  8344. A_UINT32 rate_code_flags;
  8345. A_UINT32 flags; /* Encodes information such as excessive
  8346. retransmission, aggregate, some info
  8347. from .11 frame control,
  8348. STBC, LDPC, (SGI and Tx Chain Mask
  8349. are encoded in ptx_rc->flags field),
  8350. AMPDU truncation (BT/time based etc.),
  8351. RTS/CTS attempt */
  8352. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  8353. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  8354. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  8355. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  8356. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  8357. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  8358. } HTT_RC_TX_DONE_PARAMS;
  8359. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  8360. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  8361. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  8362. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  8363. #define HTT_RC_UPDATE_VDEVID_S 8
  8364. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  8365. #define HTT_RC_UPDATE_PEERID_S 16
  8366. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  8367. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  8368. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  8369. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  8370. do { \
  8371. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  8372. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  8373. } while (0)
  8374. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  8375. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  8376. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  8377. do { \
  8378. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  8379. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  8380. } while (0)
  8381. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  8382. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  8383. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  8384. do { \
  8385. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  8386. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  8387. } while (0)
  8388. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  8389. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  8390. /**
  8391. * @brief target -> host rx fragment indication message definition
  8392. *
  8393. * @details
  8394. * The following field definitions describe the format of the rx fragment
  8395. * indication message sent from the target to the host.
  8396. * The rx fragment indication message shares the format of the
  8397. * rx indication message, but not all fields from the rx indication message
  8398. * are relevant to the rx fragment indication message.
  8399. *
  8400. *
  8401. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8402. * |-----------+-------------------+---------------------+-------------|
  8403. * | peer ID | |FV| ext TID | msg type |
  8404. * |-------------------------------------------------------------------|
  8405. * | | flush | flush |
  8406. * | | end | start |
  8407. * | | seq num | seq num |
  8408. * |-------------------------------------------------------------------|
  8409. * | reserved | FW rx desc bytes |
  8410. * |-------------------------------------------------------------------|
  8411. * | | FW MSDU Rx |
  8412. * | | desc B0 |
  8413. * |-------------------------------------------------------------------|
  8414. * Header fields:
  8415. * - MSG_TYPE
  8416. * Bits 7:0
  8417. * Purpose: identifies this as an rx fragment indication message
  8418. * Value: 0xa
  8419. * - EXT_TID
  8420. * Bits 12:8
  8421. * Purpose: identify the traffic ID of the rx data, including
  8422. * special "extended" TID values for multicast, broadcast, and
  8423. * non-QoS data frames
  8424. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8425. * - FLUSH_VALID (FV)
  8426. * Bit 13
  8427. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8428. * is valid
  8429. * Value:
  8430. * 1 -> flush IE is valid and needs to be processed
  8431. * 0 -> flush IE is not valid and should be ignored
  8432. * - PEER_ID
  8433. * Bits 31:16
  8434. * Purpose: Identify, by ID, which peer sent the rx data
  8435. * Value: ID of the peer who sent the rx data
  8436. * - FLUSH_SEQ_NUM_START
  8437. * Bits 5:0
  8438. * Purpose: Indicate the start of a series of MPDUs to flush
  8439. * Not all MPDUs within this series are necessarily valid - the host
  8440. * must check each sequence number within this range to see if the
  8441. * corresponding MPDU is actually present.
  8442. * This field is only valid if the FV bit is set.
  8443. * Value:
  8444. * The sequence number for the first MPDUs to check to flush.
  8445. * The sequence number is masked by 0x3f.
  8446. * - FLUSH_SEQ_NUM_END
  8447. * Bits 11:6
  8448. * Purpose: Indicate the end of a series of MPDUs to flush
  8449. * Value:
  8450. * The sequence number one larger than the sequence number of the
  8451. * last MPDU to check to flush.
  8452. * The sequence number is masked by 0x3f.
  8453. * Not all MPDUs within this series are necessarily valid - the host
  8454. * must check each sequence number within this range to see if the
  8455. * corresponding MPDU is actually present.
  8456. * This field is only valid if the FV bit is set.
  8457. * Rx descriptor fields:
  8458. * - FW_RX_DESC_BYTES
  8459. * Bits 15:0
  8460. * Purpose: Indicate how many bytes in the Rx indication are used for
  8461. * FW Rx descriptors
  8462. * Value: 1
  8463. */
  8464. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  8465. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  8466. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  8467. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  8468. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  8469. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  8470. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  8471. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  8472. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  8473. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  8474. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  8475. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  8476. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  8477. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  8478. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  8479. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  8480. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  8481. #define HTT_RX_FRAG_IND_BYTES \
  8482. (4 /* msg hdr */ + \
  8483. 4 /* flush spec */ + \
  8484. 4 /* (unused) FW rx desc bytes spec */ + \
  8485. 4 /* FW rx desc */)
  8486. /**
  8487. * @brief target -> host test message definition
  8488. *
  8489. * @details
  8490. * The following field definitions describe the format of the test
  8491. * message sent from the target to the host.
  8492. * The message consists of a 4-octet header, followed by a variable
  8493. * number of 32-bit integer values, followed by a variable number
  8494. * of 8-bit character values.
  8495. *
  8496. * |31 16|15 8|7 0|
  8497. * |-----------------------------------------------------------|
  8498. * | num chars | num ints | msg type |
  8499. * |-----------------------------------------------------------|
  8500. * | int 0 |
  8501. * |-----------------------------------------------------------|
  8502. * | int 1 |
  8503. * |-----------------------------------------------------------|
  8504. * | ... |
  8505. * |-----------------------------------------------------------|
  8506. * | char 3 | char 2 | char 1 | char 0 |
  8507. * |-----------------------------------------------------------|
  8508. * | | | ... | char 4 |
  8509. * |-----------------------------------------------------------|
  8510. * - MSG_TYPE
  8511. * Bits 7:0
  8512. * Purpose: identifies this as a test message
  8513. * Value: HTT_MSG_TYPE_TEST
  8514. * - NUM_INTS
  8515. * Bits 15:8
  8516. * Purpose: indicate how many 32-bit integers follow the message header
  8517. * - NUM_CHARS
  8518. * Bits 31:16
  8519. * Purpose: indicate how many 8-bit charaters follow the series of integers
  8520. */
  8521. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  8522. #define HTT_RX_TEST_NUM_INTS_S 8
  8523. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  8524. #define HTT_RX_TEST_NUM_CHARS_S 16
  8525. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  8526. do { \
  8527. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  8528. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  8529. } while (0)
  8530. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  8531. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  8532. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  8533. do { \
  8534. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  8535. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  8536. } while (0)
  8537. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  8538. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  8539. /**
  8540. * @brief target -> host packet log message
  8541. *
  8542. * @details
  8543. * The following field definitions describe the format of the packet log
  8544. * message sent from the target to the host.
  8545. * The message consists of a 4-octet header,followed by a variable number
  8546. * of 32-bit character values.
  8547. *
  8548. * |31 16|15 12|11 10|9 8|7 0|
  8549. * |------------------------------------------------------------------|
  8550. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  8551. * |------------------------------------------------------------------|
  8552. * | payload |
  8553. * |------------------------------------------------------------------|
  8554. * - MSG_TYPE
  8555. * Bits 7:0
  8556. * Purpose: identifies this as a pktlog message
  8557. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  8558. * - mac_id
  8559. * Bits 9:8
  8560. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  8561. * Value: 0-3
  8562. * - pdev_id
  8563. * Bits 11:10
  8564. * Purpose: pdev_id
  8565. * Value: 0-3
  8566. * 0 (for rings at SOC level),
  8567. * 1/2/3 PDEV -> 0/1/2
  8568. * - payload_size
  8569. * Bits 31:16
  8570. * Purpose: explicitly specify the payload size
  8571. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  8572. */
  8573. PREPACK struct htt_pktlog_msg {
  8574. A_UINT32 header;
  8575. A_UINT32 payload[1/* or more */];
  8576. } POSTPACK;
  8577. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  8578. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  8579. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  8580. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  8581. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  8582. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  8583. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  8584. do { \
  8585. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  8586. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  8587. } while (0)
  8588. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  8589. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  8590. HTT_T2H_PKTLOG_MAC_ID_S)
  8591. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  8592. do { \
  8593. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  8594. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  8595. } while (0)
  8596. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  8597. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  8598. HTT_T2H_PKTLOG_PDEV_ID_S)
  8599. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  8600. do { \
  8601. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  8602. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  8603. } while (0)
  8604. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  8605. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  8606. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  8607. /*
  8608. * Rx reorder statistics
  8609. * NB: all the fields must be defined in 4 octets size.
  8610. */
  8611. struct rx_reorder_stats {
  8612. /* Non QoS MPDUs received */
  8613. A_UINT32 deliver_non_qos;
  8614. /* MPDUs received in-order */
  8615. A_UINT32 deliver_in_order;
  8616. /* Flush due to reorder timer expired */
  8617. A_UINT32 deliver_flush_timeout;
  8618. /* Flush due to move out of window */
  8619. A_UINT32 deliver_flush_oow;
  8620. /* Flush due to DELBA */
  8621. A_UINT32 deliver_flush_delba;
  8622. /* MPDUs dropped due to FCS error */
  8623. A_UINT32 fcs_error;
  8624. /* MPDUs dropped due to monitor mode non-data packet */
  8625. A_UINT32 mgmt_ctrl;
  8626. /* Unicast-data MPDUs dropped due to invalid peer */
  8627. A_UINT32 invalid_peer;
  8628. /* MPDUs dropped due to duplication (non aggregation) */
  8629. A_UINT32 dup_non_aggr;
  8630. /* MPDUs dropped due to processed before */
  8631. A_UINT32 dup_past;
  8632. /* MPDUs dropped due to duplicate in reorder queue */
  8633. A_UINT32 dup_in_reorder;
  8634. /* Reorder timeout happened */
  8635. A_UINT32 reorder_timeout;
  8636. /* invalid bar ssn */
  8637. A_UINT32 invalid_bar_ssn;
  8638. /* reorder reset due to bar ssn */
  8639. A_UINT32 ssn_reset;
  8640. /* Flush due to delete peer */
  8641. A_UINT32 deliver_flush_delpeer;
  8642. /* Flush due to offload*/
  8643. A_UINT32 deliver_flush_offload;
  8644. /* Flush due to out of buffer*/
  8645. A_UINT32 deliver_flush_oob;
  8646. /* MPDUs dropped due to PN check fail */
  8647. A_UINT32 pn_fail;
  8648. /* MPDUs dropped due to unable to allocate memory */
  8649. A_UINT32 store_fail;
  8650. /* Number of times the tid pool alloc succeeded */
  8651. A_UINT32 tid_pool_alloc_succ;
  8652. /* Number of times the MPDU pool alloc succeeded */
  8653. A_UINT32 mpdu_pool_alloc_succ;
  8654. /* Number of times the MSDU pool alloc succeeded */
  8655. A_UINT32 msdu_pool_alloc_succ;
  8656. /* Number of times the tid pool alloc failed */
  8657. A_UINT32 tid_pool_alloc_fail;
  8658. /* Number of times the MPDU pool alloc failed */
  8659. A_UINT32 mpdu_pool_alloc_fail;
  8660. /* Number of times the MSDU pool alloc failed */
  8661. A_UINT32 msdu_pool_alloc_fail;
  8662. /* Number of times the tid pool freed */
  8663. A_UINT32 tid_pool_free;
  8664. /* Number of times the MPDU pool freed */
  8665. A_UINT32 mpdu_pool_free;
  8666. /* Number of times the MSDU pool freed */
  8667. A_UINT32 msdu_pool_free;
  8668. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8669. A_UINT32 msdu_queued;
  8670. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8671. A_UINT32 msdu_recycled;
  8672. /* Number of MPDUs with invalid peer but A2 found in AST */
  8673. A_UINT32 invalid_peer_a2_in_ast;
  8674. /* Number of MPDUs with invalid peer but A3 found in AST */
  8675. A_UINT32 invalid_peer_a3_in_ast;
  8676. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8677. A_UINT32 invalid_peer_bmc_mpdus;
  8678. /* Number of MSDUs with err attention word */
  8679. A_UINT32 rxdesc_err_att;
  8680. /* Number of MSDUs with flag of peer_idx_invalid */
  8681. A_UINT32 rxdesc_err_peer_idx_inv;
  8682. /* Number of MSDUs with flag of peer_idx_timeout */
  8683. A_UINT32 rxdesc_err_peer_idx_to;
  8684. /* Number of MSDUs with flag of overflow */
  8685. A_UINT32 rxdesc_err_ov;
  8686. /* Number of MSDUs with flag of msdu_length_err */
  8687. A_UINT32 rxdesc_err_msdu_len;
  8688. /* Number of MSDUs with flag of mpdu_length_err */
  8689. A_UINT32 rxdesc_err_mpdu_len;
  8690. /* Number of MSDUs with flag of tkip_mic_err */
  8691. A_UINT32 rxdesc_err_tkip_mic;
  8692. /* Number of MSDUs with flag of decrypt_err */
  8693. A_UINT32 rxdesc_err_decrypt;
  8694. /* Number of MSDUs with flag of fcs_err */
  8695. A_UINT32 rxdesc_err_fcs;
  8696. /* Number of Unicast (bc_mc bit is not set in attention word)
  8697. * frames with invalid peer handler
  8698. */
  8699. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8700. /* Number of unicast frame directly (direct bit is set in attention word)
  8701. * to DUT with invalid peer handler
  8702. */
  8703. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8704. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8705. * frames with invalid peer handler
  8706. */
  8707. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8708. /* Number of MSDUs dropped due to no first MSDU flag */
  8709. A_UINT32 rxdesc_no_1st_msdu;
  8710. /* Number of MSDUs droped due to ring overflow */
  8711. A_UINT32 msdu_drop_ring_ov;
  8712. /* Number of MSDUs dropped due to FC mismatch */
  8713. A_UINT32 msdu_drop_fc_mismatch;
  8714. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8715. A_UINT32 msdu_drop_mgmt_remote_ring;
  8716. /* Number of MSDUs dropped due to errors not reported in attention word */
  8717. A_UINT32 msdu_drop_misc;
  8718. /* Number of MSDUs go to offload before reorder */
  8719. A_UINT32 offload_msdu_wal;
  8720. /* Number of data frame dropped by offload after reorder */
  8721. A_UINT32 offload_msdu_reorder;
  8722. /* Number of MPDUs with sequence number in the past and within the BA window */
  8723. A_UINT32 dup_past_within_window;
  8724. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8725. A_UINT32 dup_past_outside_window;
  8726. /* Number of MSDUs with decrypt/MIC error */
  8727. A_UINT32 rxdesc_err_decrypt_mic;
  8728. /* Number of data MSDUs received on both local and remote rings */
  8729. A_UINT32 data_msdus_on_both_rings;
  8730. /* MPDUs never filled */
  8731. A_UINT32 holes_not_filled;
  8732. };
  8733. /*
  8734. * Rx Remote buffer statistics
  8735. * NB: all the fields must be defined in 4 octets size.
  8736. */
  8737. struct rx_remote_buffer_mgmt_stats {
  8738. /* Total number of MSDUs reaped for Rx processing */
  8739. A_UINT32 remote_reaped;
  8740. /* MSDUs recycled within firmware */
  8741. A_UINT32 remote_recycled;
  8742. /* MSDUs stored by Data Rx */
  8743. A_UINT32 data_rx_msdus_stored;
  8744. /* Number of HTT indications from WAL Rx MSDU */
  8745. A_UINT32 wal_rx_ind;
  8746. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8747. A_UINT32 wal_rx_ind_unconsumed;
  8748. /* Number of HTT indications from Data Rx MSDU */
  8749. A_UINT32 data_rx_ind;
  8750. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8751. A_UINT32 data_rx_ind_unconsumed;
  8752. /* Number of HTT indications from ATHBUF */
  8753. A_UINT32 athbuf_rx_ind;
  8754. /* Number of remote buffers requested for refill */
  8755. A_UINT32 refill_buf_req;
  8756. /* Number of remote buffers filled by the host */
  8757. A_UINT32 refill_buf_rsp;
  8758. /* Number of times MAC hw_index = f/w write_index */
  8759. A_INT32 mac_no_bufs;
  8760. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8761. A_INT32 fw_indices_equal;
  8762. /* Number of times f/w finds no buffers to post */
  8763. A_INT32 host_no_bufs;
  8764. };
  8765. /*
  8766. * TXBF MU/SU packets and NDPA statistics
  8767. * NB: all the fields must be defined in 4 octets size.
  8768. */
  8769. struct rx_txbf_musu_ndpa_pkts_stats {
  8770. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8771. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8772. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8773. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8774. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8775. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8776. };
  8777. /*
  8778. * htt_dbg_stats_status -
  8779. * present - The requested stats have been delivered in full.
  8780. * This indicates that either the stats information was contained
  8781. * in its entirety within this message, or else this message
  8782. * completes the delivery of the requested stats info that was
  8783. * partially delivered through earlier STATS_CONF messages.
  8784. * partial - The requested stats have been delivered in part.
  8785. * One or more subsequent STATS_CONF messages with the same
  8786. * cookie value will be sent to deliver the remainder of the
  8787. * information.
  8788. * error - The requested stats could not be delivered, for example due
  8789. * to a shortage of memory to construct a message holding the
  8790. * requested stats.
  8791. * invalid - The requested stat type is either not recognized, or the
  8792. * target is configured to not gather the stats type in question.
  8793. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8794. * series_done - This special value indicates that no further stats info
  8795. * elements are present within a series of stats info elems
  8796. * (within a stats upload confirmation message).
  8797. */
  8798. enum htt_dbg_stats_status {
  8799. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8800. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8801. HTT_DBG_STATS_STATUS_ERROR = 2,
  8802. HTT_DBG_STATS_STATUS_INVALID = 3,
  8803. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8804. };
  8805. /**
  8806. * @brief target -> host statistics upload
  8807. *
  8808. * @details
  8809. * The following field definitions describe the format of the HTT target
  8810. * to host stats upload confirmation message.
  8811. * The message contains a cookie echoed from the HTT host->target stats
  8812. * upload request, which identifies which request the confirmation is
  8813. * for, and a series of tag-length-value stats information elements.
  8814. * The tag-length header for each stats info element also includes a
  8815. * status field, to indicate whether the request for the stat type in
  8816. * question was fully met, partially met, unable to be met, or invalid
  8817. * (if the stat type in question is disabled in the target).
  8818. * A special value of all 1's in this status field is used to indicate
  8819. * the end of the series of stats info elements.
  8820. *
  8821. *
  8822. * |31 16|15 8|7 5|4 0|
  8823. * |------------------------------------------------------------|
  8824. * | reserved | msg type |
  8825. * |------------------------------------------------------------|
  8826. * | cookie LSBs |
  8827. * |------------------------------------------------------------|
  8828. * | cookie MSBs |
  8829. * |------------------------------------------------------------|
  8830. * | stats entry length | reserved | S |stat type|
  8831. * |------------------------------------------------------------|
  8832. * | |
  8833. * | type-specific stats info |
  8834. * | |
  8835. * |------------------------------------------------------------|
  8836. * | stats entry length | reserved | S |stat type|
  8837. * |------------------------------------------------------------|
  8838. * | |
  8839. * | type-specific stats info |
  8840. * | |
  8841. * |------------------------------------------------------------|
  8842. * | n/a | reserved | 111 | n/a |
  8843. * |------------------------------------------------------------|
  8844. * Header fields:
  8845. * - MSG_TYPE
  8846. * Bits 7:0
  8847. * Purpose: identifies this is a statistics upload confirmation message
  8848. * Value: 0x9
  8849. * - COOKIE_LSBS
  8850. * Bits 31:0
  8851. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8852. * message with its preceding host->target stats request message.
  8853. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8854. * - COOKIE_MSBS
  8855. * Bits 31:0
  8856. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8857. * message with its preceding host->target stats request message.
  8858. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8859. *
  8860. * Stats Information Element tag-length header fields:
  8861. * - STAT_TYPE
  8862. * Bits 4:0
  8863. * Purpose: identifies the type of statistics info held in the
  8864. * following information element
  8865. * Value: htt_dbg_stats_type
  8866. * - STATUS
  8867. * Bits 7:5
  8868. * Purpose: indicate whether the requested stats are present
  8869. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  8870. * the completion of the stats entry series
  8871. * - LENGTH
  8872. * Bits 31:16
  8873. * Purpose: indicate the stats information size
  8874. * Value: This field specifies the number of bytes of stats information
  8875. * that follows the element tag-length header.
  8876. * It is expected but not required that this length is a multiple of
  8877. * 4 bytes. Even if the length is not an integer multiple of 4, the
  8878. * subsequent stats entry header will begin on a 4-byte aligned
  8879. * boundary.
  8880. */
  8881. #define HTT_T2H_STATS_COOKIE_SIZE 8
  8882. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  8883. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  8884. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  8885. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  8886. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  8887. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  8888. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  8889. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  8890. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  8891. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  8892. do { \
  8893. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  8894. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  8895. } while (0)
  8896. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  8897. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  8898. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  8899. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  8900. do { \
  8901. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  8902. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  8903. } while (0)
  8904. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  8905. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  8906. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  8907. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  8908. do { \
  8909. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  8910. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  8911. } while (0)
  8912. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  8913. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  8914. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  8915. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  8916. #define HTT_MAX_AGGR 64
  8917. #define HTT_HL_MAX_AGGR 18
  8918. /**
  8919. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  8920. *
  8921. * @details
  8922. * The following field definitions describe the format of the HTT host
  8923. * to target frag_desc/msdu_ext bank configuration message.
  8924. * The message contains the based address and the min and max id of the
  8925. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  8926. * MSDU_EXT/FRAG_DESC.
  8927. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  8928. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  8929. * the hardware does the mapping/translation.
  8930. *
  8931. * Total banks that can be configured is configured to 16.
  8932. *
  8933. * This should be called before any TX has be initiated by the HTT
  8934. *
  8935. * |31 16|15 8|7 5|4 0|
  8936. * |------------------------------------------------------------|
  8937. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  8938. * |------------------------------------------------------------|
  8939. * | BANK0_BASE_ADDRESS (bits 31:0) |
  8940. #if HTT_PADDR64
  8941. * | BANK0_BASE_ADDRESS (bits 63:32) |
  8942. #endif
  8943. * |------------------------------------------------------------|
  8944. * | ... |
  8945. * |------------------------------------------------------------|
  8946. * | BANK15_BASE_ADDRESS (bits 31:0) |
  8947. #if HTT_PADDR64
  8948. * | BANK15_BASE_ADDRESS (bits 63:32) |
  8949. #endif
  8950. * |------------------------------------------------------------|
  8951. * | BANK0_MAX_ID | BANK0_MIN_ID |
  8952. * |------------------------------------------------------------|
  8953. * | ... |
  8954. * |------------------------------------------------------------|
  8955. * | BANK15_MAX_ID | BANK15_MIN_ID |
  8956. * |------------------------------------------------------------|
  8957. * Header fields:
  8958. * - MSG_TYPE
  8959. * Bits 7:0
  8960. * Value: 0x6
  8961. * for systems with 64-bit format for bus addresses:
  8962. * - BANKx_BASE_ADDRESS_LO
  8963. * Bits 31:0
  8964. * Purpose: Provide a mechanism to specify the base address of the
  8965. * MSDU_EXT bank physical/bus address.
  8966. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  8967. * - BANKx_BASE_ADDRESS_HI
  8968. * Bits 31:0
  8969. * Purpose: Provide a mechanism to specify the base address of the
  8970. * MSDU_EXT bank physical/bus address.
  8971. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  8972. * for systems with 32-bit format for bus addresses:
  8973. * - BANKx_BASE_ADDRESS
  8974. * Bits 31:0
  8975. * Purpose: Provide a mechanism to specify the base address of the
  8976. * MSDU_EXT bank physical/bus address.
  8977. * Value: MSDU_EXT bank physical / bus address
  8978. * - BANKx_MIN_ID
  8979. * Bits 15:0
  8980. * Purpose: Provide a mechanism to specify the min index that needs to
  8981. * mapped.
  8982. * - BANKx_MAX_ID
  8983. * Bits 31:16
  8984. * Purpose: Provide a mechanism to specify the max index that needs to
  8985. * mapped.
  8986. *
  8987. */
  8988. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  8989. * safe value.
  8990. * @note MAX supported banks is 16.
  8991. */
  8992. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  8993. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  8994. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  8995. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  8996. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  8997. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  8998. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  8999. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  9000. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  9001. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  9002. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  9003. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  9004. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  9005. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  9006. do { \
  9007. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  9008. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  9009. } while (0)
  9010. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  9011. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  9012. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  9013. do { \
  9014. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  9015. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  9016. } while (0)
  9017. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  9018. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  9019. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  9020. do { \
  9021. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  9022. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  9023. } while (0)
  9024. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  9025. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  9026. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  9027. do { \
  9028. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  9029. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  9030. } while (0)
  9031. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  9032. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  9033. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  9034. do { \
  9035. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  9036. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  9037. } while (0)
  9038. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  9039. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  9040. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  9041. do { \
  9042. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  9043. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  9044. } while (0)
  9045. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  9046. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  9047. /*
  9048. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  9049. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  9050. * addresses are stored in a XXX-bit field.
  9051. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  9052. * htt_tx_frag_desc64_bank_cfg_t structs.
  9053. */
  9054. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  9055. _paddr_bits_, \
  9056. _paddr__bank_base_address_) \
  9057. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  9058. /** word 0 \
  9059. * msg_type: 8, \
  9060. * pdev_id: 2, \
  9061. * swap: 1, \
  9062. * reserved0: 5, \
  9063. * num_banks: 8, \
  9064. * desc_size: 8; \
  9065. */ \
  9066. A_UINT32 word0; \
  9067. /* \
  9068. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  9069. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  9070. * the second A_UINT32). \
  9071. */ \
  9072. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9073. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9074. } POSTPACK
  9075. /* define htt_tx_frag_desc32_bank_cfg_t */
  9076. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  9077. /* define htt_tx_frag_desc64_bank_cfg_t */
  9078. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  9079. /*
  9080. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  9081. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  9082. */
  9083. #if HTT_PADDR64
  9084. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  9085. #else
  9086. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  9087. #endif
  9088. /**
  9089. * @brief target -> host HTT TX Credit total count update message definition
  9090. *
  9091. *|31 16|15|14 9| 8 |7 0 |
  9092. *|---------------------+--+----------+-------+----------|
  9093. *|cur htt credit delta | Q| reserved | sign | msg type |
  9094. *|------------------------------------------------------|
  9095. *
  9096. * Header fields:
  9097. * - MSG_TYPE
  9098. * Bits 7:0
  9099. * Purpose: identifies this as a htt tx credit delta update message
  9100. * Value: 0xe
  9101. * - SIGN
  9102. * Bits 8
  9103. * identifies whether credit delta is positive or negative
  9104. * Value:
  9105. * - 0x0: credit delta is positive, rebalance in some buffers
  9106. * - 0x1: credit delta is negative, rebalance out some buffers
  9107. * - reserved
  9108. * Bits 14:9
  9109. * Value: 0x0
  9110. * - TXQ_GRP
  9111. * Bit 15
  9112. * Purpose: indicates whether any tx queue group information elements
  9113. * are appended to the tx credit update message
  9114. * Value: 0 -> no tx queue group information element is present
  9115. * 1 -> a tx queue group information element immediately follows
  9116. * - DELTA_COUNT
  9117. * Bits 31:16
  9118. * Purpose: Specify current htt credit delta absolute count
  9119. */
  9120. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  9121. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  9122. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  9123. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  9124. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  9125. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  9126. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  9127. do { \
  9128. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  9129. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  9130. } while (0)
  9131. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  9132. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  9133. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  9136. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  9137. } while (0)
  9138. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  9139. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  9140. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  9143. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  9144. } while (0)
  9145. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  9146. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  9147. #define HTT_TX_CREDIT_MSG_BYTES 4
  9148. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  9149. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  9150. /**
  9151. * @brief HTT WDI_IPA Operation Response Message
  9152. *
  9153. * @details
  9154. * HTT WDI_IPA Operation Response message is sent by target
  9155. * to host confirming suspend or resume operation.
  9156. * |31 24|23 16|15 8|7 0|
  9157. * |----------------+----------------+----------------+----------------|
  9158. * | op_code | Rsvd | msg_type |
  9159. * |-------------------------------------------------------------------|
  9160. * | Rsvd | Response len |
  9161. * |-------------------------------------------------------------------|
  9162. * | |
  9163. * | Response-type specific info |
  9164. * | |
  9165. * | |
  9166. * |-------------------------------------------------------------------|
  9167. * Header fields:
  9168. * - MSG_TYPE
  9169. * Bits 7:0
  9170. * Purpose: Identifies this as WDI_IPA Operation Response message
  9171. * value: = 0x13
  9172. * - OP_CODE
  9173. * Bits 31:16
  9174. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  9175. * value: = enum htt_wdi_ipa_op_code
  9176. * - RSP_LEN
  9177. * Bits 16:0
  9178. * Purpose: length for the response-type specific info
  9179. * value: = length in bytes for response-type specific info
  9180. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  9181. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  9182. */
  9183. PREPACK struct htt_wdi_ipa_op_response_t
  9184. {
  9185. /* DWORD 0: flags and meta-data */
  9186. A_UINT32
  9187. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9188. reserved1: 8,
  9189. op_code: 16;
  9190. A_UINT32
  9191. rsp_len: 16,
  9192. reserved2: 16;
  9193. } POSTPACK;
  9194. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  9195. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  9196. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  9197. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  9198. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  9199. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  9200. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  9201. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  9202. do { \
  9203. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  9204. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  9205. } while (0)
  9206. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  9207. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  9208. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  9209. do { \
  9210. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  9211. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  9212. } while (0)
  9213. enum htt_phy_mode {
  9214. htt_phy_mode_11a = 0,
  9215. htt_phy_mode_11g = 1,
  9216. htt_phy_mode_11b = 2,
  9217. htt_phy_mode_11g_only = 3,
  9218. htt_phy_mode_11na_ht20 = 4,
  9219. htt_phy_mode_11ng_ht20 = 5,
  9220. htt_phy_mode_11na_ht40 = 6,
  9221. htt_phy_mode_11ng_ht40 = 7,
  9222. htt_phy_mode_11ac_vht20 = 8,
  9223. htt_phy_mode_11ac_vht40 = 9,
  9224. htt_phy_mode_11ac_vht80 = 10,
  9225. htt_phy_mode_11ac_vht20_2g = 11,
  9226. htt_phy_mode_11ac_vht40_2g = 12,
  9227. htt_phy_mode_11ac_vht80_2g = 13,
  9228. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  9229. htt_phy_mode_11ac_vht160 = 15,
  9230. htt_phy_mode_max,
  9231. };
  9232. /**
  9233. * @brief target -> host HTT channel change indication
  9234. * @details
  9235. * Specify when a channel change occurs.
  9236. * This allows the host to precisely determine which rx frames arrived
  9237. * on the old channel and which rx frames arrived on the new channel.
  9238. *
  9239. *|31 |7 0 |
  9240. *|-------------------------------------------+----------|
  9241. *| reserved | msg type |
  9242. *|------------------------------------------------------|
  9243. *| primary_chan_center_freq_mhz |
  9244. *|------------------------------------------------------|
  9245. *| contiguous_chan1_center_freq_mhz |
  9246. *|------------------------------------------------------|
  9247. *| contiguous_chan2_center_freq_mhz |
  9248. *|------------------------------------------------------|
  9249. *| phy_mode |
  9250. *|------------------------------------------------------|
  9251. *
  9252. * Header fields:
  9253. * - MSG_TYPE
  9254. * Bits 7:0
  9255. * Purpose: identifies this as a htt channel change indication message
  9256. * Value: 0x15
  9257. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  9258. * Bits 31:0
  9259. * Purpose: identify the (center of the) new 20 MHz primary channel
  9260. * Value: center frequency of the 20 MHz primary channel, in MHz units
  9261. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  9262. * Bits 31:0
  9263. * Purpose: identify the (center of the) contiguous frequency range
  9264. * comprising the new channel.
  9265. * For example, if the new channel is a 80 MHz channel extending
  9266. * 60 MHz beyond the primary channel, this field would be 30 larger
  9267. * than the primary channel center frequency field.
  9268. * Value: center frequency of the contiguous frequency range comprising
  9269. * the full channel in MHz units
  9270. * (80+80 channels also use the CONTIG_CHAN2 field)
  9271. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  9272. * Bits 31:0
  9273. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  9274. * within a VHT 80+80 channel.
  9275. * This field is only relevant for VHT 80+80 channels.
  9276. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  9277. * channel (arbitrary value for cases besides VHT 80+80)
  9278. * - PHY_MODE
  9279. * Bits 31:0
  9280. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  9281. * and band
  9282. * Value: htt_phy_mode enum value
  9283. */
  9284. PREPACK struct htt_chan_change_t
  9285. {
  9286. /* DWORD 0: flags and meta-data */
  9287. A_UINT32
  9288. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9289. reserved1: 24;
  9290. A_UINT32 primary_chan_center_freq_mhz;
  9291. A_UINT32 contig_chan1_center_freq_mhz;
  9292. A_UINT32 contig_chan2_center_freq_mhz;
  9293. A_UINT32 phy_mode;
  9294. } POSTPACK;
  9295. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  9296. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  9297. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  9298. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  9299. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  9300. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  9301. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  9302. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  9303. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  9304. do { \
  9305. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  9306. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  9307. } while (0)
  9308. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  9309. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  9310. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  9311. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  9312. do { \
  9313. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  9314. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  9315. } while (0)
  9316. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  9317. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  9318. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  9319. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  9320. do { \
  9321. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  9322. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  9323. } while (0)
  9324. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  9325. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  9326. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  9327. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  9328. do { \
  9329. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  9330. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  9331. } while (0)
  9332. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  9333. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  9334. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  9335. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  9336. /**
  9337. * @brief rx offload packet error message
  9338. *
  9339. * @details
  9340. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  9341. * of target payload like mic err.
  9342. *
  9343. * |31 24|23 16|15 8|7 0|
  9344. * |----------------+----------------+----------------+----------------|
  9345. * | tid | vdev_id | msg_sub_type | msg_type |
  9346. * |-------------------------------------------------------------------|
  9347. * : (sub-type dependent content) :
  9348. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9349. * Header fields:
  9350. * - msg_type
  9351. * Bits 7:0
  9352. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  9353. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  9354. * - msg_sub_type
  9355. * Bits 15:8
  9356. * Purpose: Identifies which type of rx error is reported by this message
  9357. * value: htt_rx_ofld_pkt_err_type
  9358. * - vdev_id
  9359. * Bits 23:16
  9360. * Purpose: Identifies which vdev received the erroneous rx frame
  9361. * value:
  9362. * - tid
  9363. * Bits 31:24
  9364. * Purpose: Identifies the traffic type of the rx frame
  9365. * value:
  9366. *
  9367. * - The payload fields used if the sub-type == MIC error are shown below.
  9368. * Note - MIC err is per MSDU, while PN is per MPDU.
  9369. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  9370. * with MIC err in A-MSDU case, so FW will send only one HTT message
  9371. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  9372. * instead of sending separate HTT messages for each wrong MSDU within
  9373. * the MPDU.
  9374. *
  9375. * |31 24|23 16|15 8|7 0|
  9376. * |----------------+----------------+----------------+----------------|
  9377. * | Rsvd | key_id | peer_id |
  9378. * |-------------------------------------------------------------------|
  9379. * | receiver MAC addr 31:0 |
  9380. * |-------------------------------------------------------------------|
  9381. * | Rsvd | receiver MAC addr 47:32 |
  9382. * |-------------------------------------------------------------------|
  9383. * | transmitter MAC addr 31:0 |
  9384. * |-------------------------------------------------------------------|
  9385. * | Rsvd | transmitter MAC addr 47:32 |
  9386. * |-------------------------------------------------------------------|
  9387. * | PN 31:0 |
  9388. * |-------------------------------------------------------------------|
  9389. * | Rsvd | PN 47:32 |
  9390. * |-------------------------------------------------------------------|
  9391. * - peer_id
  9392. * Bits 15:0
  9393. * Purpose: identifies which peer is frame is from
  9394. * value:
  9395. * - key_id
  9396. * Bits 23:16
  9397. * Purpose: identifies key_id of rx frame
  9398. * value:
  9399. * - RA_31_0 (receiver MAC addr 31:0)
  9400. * Bits 31:0
  9401. * Purpose: identifies by MAC address which vdev received the frame
  9402. * value: MAC address lower 4 bytes
  9403. * - RA_47_32 (receiver MAC addr 47:32)
  9404. * Bits 15:0
  9405. * Purpose: identifies by MAC address which vdev received the frame
  9406. * value: MAC address upper 2 bytes
  9407. * - TA_31_0 (transmitter MAC addr 31:0)
  9408. * Bits 31:0
  9409. * Purpose: identifies by MAC address which peer transmitted the frame
  9410. * value: MAC address lower 4 bytes
  9411. * - TA_47_32 (transmitter MAC addr 47:32)
  9412. * Bits 15:0
  9413. * Purpose: identifies by MAC address which peer transmitted the frame
  9414. * value: MAC address upper 2 bytes
  9415. * - PN_31_0
  9416. * Bits 31:0
  9417. * Purpose: Identifies pn of rx frame
  9418. * value: PN lower 4 bytes
  9419. * - PN_47_32
  9420. * Bits 15:0
  9421. * Purpose: Identifies pn of rx frame
  9422. * value:
  9423. * TKIP or CCMP: PN upper 2 bytes
  9424. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  9425. */
  9426. enum htt_rx_ofld_pkt_err_type {
  9427. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  9428. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  9429. };
  9430. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  9431. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  9432. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  9433. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  9434. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  9435. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  9436. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  9437. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  9438. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  9439. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  9440. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  9441. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  9442. do { \
  9443. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  9444. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  9445. } while (0)
  9446. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  9447. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  9448. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  9449. do { \
  9450. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  9451. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  9452. } while (0)
  9453. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  9454. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  9455. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  9456. do { \
  9457. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  9458. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  9459. } while (0)
  9460. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  9461. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  9462. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  9463. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  9464. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  9465. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  9466. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  9467. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  9468. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  9469. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  9470. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  9471. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  9472. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  9473. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  9474. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  9475. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  9476. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  9477. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  9478. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  9479. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  9480. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  9481. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  9482. do { \
  9483. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  9484. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  9485. } while (0)
  9486. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  9487. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  9488. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  9489. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  9490. do { \
  9491. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  9492. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  9493. } while (0)
  9494. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  9495. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  9496. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  9497. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  9498. do { \
  9499. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  9500. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  9501. } while (0)
  9502. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  9503. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  9504. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  9505. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  9506. do { \
  9507. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  9508. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  9509. } while (0)
  9510. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  9511. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  9512. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  9513. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  9514. do { \
  9515. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  9516. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  9517. } while (0)
  9518. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  9519. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  9520. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  9521. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  9522. do { \
  9523. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  9524. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  9525. } while (0)
  9526. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  9527. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  9528. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  9529. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  9530. do { \
  9531. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  9532. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  9533. } while (0)
  9534. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  9535. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  9536. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  9537. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  9538. do { \
  9539. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  9540. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  9541. } while (0)
  9542. /**
  9543. * @brief peer rate report message
  9544. *
  9545. * @details
  9546. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  9547. * justified rate of all the peers.
  9548. *
  9549. * |31 24|23 16|15 8|7 0|
  9550. * |----------------+----------------+----------------+----------------|
  9551. * | peer_count | | msg_type |
  9552. * |-------------------------------------------------------------------|
  9553. * : Payload (variant number of peer rate report) :
  9554. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9555. * Header fields:
  9556. * - msg_type
  9557. * Bits 7:0
  9558. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  9559. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  9560. * - reserved
  9561. * Bits 15:8
  9562. * Purpose:
  9563. * value:
  9564. * - peer_count
  9565. * Bits 31:16
  9566. * Purpose: Specify how many peer rate report elements are present in the payload.
  9567. * value:
  9568. *
  9569. * Payload:
  9570. * There are variant number of peer rate report follow the first 32 bits.
  9571. * The peer rate report is defined as follows.
  9572. *
  9573. * |31 20|19 16|15 0|
  9574. * |-----------------------+---------+---------------------------------|-
  9575. * | reserved | phy | peer_id | \
  9576. * |-------------------------------------------------------------------| -> report #0
  9577. * | rate | /
  9578. * |-----------------------+---------+---------------------------------|-
  9579. * | reserved | phy | peer_id | \
  9580. * |-------------------------------------------------------------------| -> report #1
  9581. * | rate | /
  9582. * |-----------------------+---------+---------------------------------|-
  9583. * | reserved | phy | peer_id | \
  9584. * |-------------------------------------------------------------------| -> report #2
  9585. * | rate | /
  9586. * |-------------------------------------------------------------------|-
  9587. * : :
  9588. * : :
  9589. * : :
  9590. * :-------------------------------------------------------------------:
  9591. *
  9592. * - peer_id
  9593. * Bits 15:0
  9594. * Purpose: identify the peer
  9595. * value:
  9596. * - phy
  9597. * Bits 19:16
  9598. * Purpose: identify which phy is in use
  9599. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  9600. * Please see enum htt_peer_report_phy_type for detail.
  9601. * - reserved
  9602. * Bits 31:20
  9603. * Purpose:
  9604. * value:
  9605. * - rate
  9606. * Bits 31:0
  9607. * Purpose: represent the justified rate of the peer specified by peer_id
  9608. * value:
  9609. */
  9610. enum htt_peer_rate_report_phy_type {
  9611. HTT_PEER_RATE_REPORT_11B = 0,
  9612. HTT_PEER_RATE_REPORT_11A_G,
  9613. HTT_PEER_RATE_REPORT_11N,
  9614. HTT_PEER_RATE_REPORT_11AC,
  9615. };
  9616. #define HTT_PEER_RATE_REPORT_SIZE 8
  9617. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  9618. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  9619. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  9620. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  9621. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  9622. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  9623. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  9624. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  9625. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  9626. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  9627. do { \
  9628. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  9629. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  9630. } while (0)
  9631. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  9632. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  9633. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  9634. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  9635. do { \
  9636. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  9637. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  9638. } while (0)
  9639. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  9640. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  9641. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  9642. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  9643. do { \
  9644. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  9645. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  9646. } while (0)
  9647. /**
  9648. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  9649. *
  9650. * @details
  9651. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  9652. * a flow of descriptors.
  9653. *
  9654. * This message is in TLV format and indicates the parameters to be setup a
  9655. * flow in the host. Each entry indicates that a particular flow ID is ready to
  9656. * receive descriptors from a specified pool.
  9657. *
  9658. * The message would appear as follows:
  9659. *
  9660. * |31 24|23 16|15 8|7 0|
  9661. * |----------------+----------------+----------------+----------------|
  9662. * header | reserved | num_flows | msg_type |
  9663. * |-------------------------------------------------------------------|
  9664. * | |
  9665. * : payload :
  9666. * | |
  9667. * |-------------------------------------------------------------------|
  9668. *
  9669. * The header field is one DWORD long and is interpreted as follows:
  9670. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9671. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9672. * this message
  9673. * b'16-31 - reserved: These bits are reserved for future use
  9674. *
  9675. * Payload:
  9676. * The payload would contain multiple objects of the following structure. Each
  9677. * object represents a flow.
  9678. *
  9679. * |31 24|23 16|15 8|7 0|
  9680. * |----------------+----------------+----------------+----------------|
  9681. * header | reserved | num_flows | msg_type |
  9682. * |-------------------------------------------------------------------|
  9683. * payload0| flow_type |
  9684. * |-------------------------------------------------------------------|
  9685. * | flow_id |
  9686. * |-------------------------------------------------------------------|
  9687. * | reserved0 | flow_pool_id |
  9688. * |-------------------------------------------------------------------|
  9689. * | reserved1 | flow_pool_size |
  9690. * |-------------------------------------------------------------------|
  9691. * | reserved2 |
  9692. * |-------------------------------------------------------------------|
  9693. * payload1| flow_type |
  9694. * |-------------------------------------------------------------------|
  9695. * | flow_id |
  9696. * |-------------------------------------------------------------------|
  9697. * | reserved0 | flow_pool_id |
  9698. * |-------------------------------------------------------------------|
  9699. * | reserved1 | flow_pool_size |
  9700. * |-------------------------------------------------------------------|
  9701. * | reserved2 |
  9702. * |-------------------------------------------------------------------|
  9703. * | . |
  9704. * | . |
  9705. * | . |
  9706. * |-------------------------------------------------------------------|
  9707. *
  9708. * Each payload is 5 DWORDS long and is interpreted as follows:
  9709. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9710. * this flow is associated. It can be VDEV, peer,
  9711. * or tid (AC). Based on enum htt_flow_type.
  9712. *
  9713. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9714. * object. For flow_type vdev it is set to the
  9715. * vdevid, for peer it is peerid and for tid, it is
  9716. * tid_num.
  9717. *
  9718. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9719. * in the host for this flow
  9720. * b'16:31 - reserved0: This field in reserved for the future. In case
  9721. * we have a hierarchical implementation (HCM) of
  9722. * pools, it can be used to indicate the ID of the
  9723. * parent-pool.
  9724. *
  9725. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9726. * Descriptors for this flow will be
  9727. * allocated from this pool in the host.
  9728. * b'16:31 - reserved1: This field in reserved for the future. In case
  9729. * we have a hierarchical implementation of pools,
  9730. * it can be used to indicate the max number of
  9731. * descriptors in the pool. The b'0:15 can be used
  9732. * to indicate min number of descriptors in the
  9733. * HCM scheme.
  9734. *
  9735. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9736. * we have a hierarchical implementation of pools,
  9737. * b'0:15 can be used to indicate the
  9738. * priority-based borrowing (PBB) threshold of
  9739. * the flow's pool. The b'16:31 are still left
  9740. * reserved.
  9741. */
  9742. enum htt_flow_type {
  9743. FLOW_TYPE_VDEV = 0,
  9744. /* Insert new flow types above this line */
  9745. };
  9746. PREPACK struct htt_flow_pool_map_payload_t {
  9747. A_UINT32 flow_type;
  9748. A_UINT32 flow_id;
  9749. A_UINT32 flow_pool_id:16,
  9750. reserved0:16;
  9751. A_UINT32 flow_pool_size:16,
  9752. reserved1:16;
  9753. A_UINT32 reserved2;
  9754. } POSTPACK;
  9755. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9756. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9757. (sizeof(struct htt_flow_pool_map_payload_t))
  9758. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9759. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9760. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9761. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9762. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9763. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9764. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9765. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9766. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9767. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9768. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9769. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9770. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9771. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9772. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9773. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9774. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9775. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9776. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9777. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9778. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9779. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9780. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9781. do { \
  9782. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9783. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9784. } while (0)
  9785. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9786. do { \
  9787. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9788. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9789. } while (0)
  9790. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9791. do { \
  9792. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9793. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9794. } while (0)
  9795. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9796. do { \
  9797. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9798. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9799. } while (0)
  9800. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9801. do { \
  9802. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9803. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9804. } while (0)
  9805. /**
  9806. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9807. *
  9808. * @details
  9809. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9810. * down a flow of descriptors.
  9811. * This message indicates that for the flow (whose ID is provided) is wanting
  9812. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9813. * pool of descriptors from where descriptors are being allocated for this
  9814. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9815. * be unmapped by the host.
  9816. *
  9817. * The message would appear as follows:
  9818. *
  9819. * |31 24|23 16|15 8|7 0|
  9820. * |----------------+----------------+----------------+----------------|
  9821. * | reserved0 | msg_type |
  9822. * |-------------------------------------------------------------------|
  9823. * | flow_type |
  9824. * |-------------------------------------------------------------------|
  9825. * | flow_id |
  9826. * |-------------------------------------------------------------------|
  9827. * | reserved1 | flow_pool_id |
  9828. * |-------------------------------------------------------------------|
  9829. *
  9830. * The message is interpreted as follows:
  9831. * dword0 - b'0:7 - msg_type: This will be set to
  9832. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9833. * b'8:31 - reserved0: Reserved for future use
  9834. *
  9835. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9836. * this flow is associated. It can be VDEV, peer,
  9837. * or tid (AC). Based on enum htt_flow_type.
  9838. *
  9839. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9840. * object. For flow_type vdev it is set to the
  9841. * vdevid, for peer it is peerid and for tid, it is
  9842. * tid_num.
  9843. *
  9844. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9845. * used in the host for this flow
  9846. * b'16:31 - reserved0: This field in reserved for the future.
  9847. *
  9848. */
  9849. PREPACK struct htt_flow_pool_unmap_t {
  9850. A_UINT32 msg_type:8,
  9851. reserved0:24;
  9852. A_UINT32 flow_type;
  9853. A_UINT32 flow_id;
  9854. A_UINT32 flow_pool_id:16,
  9855. reserved1:16;
  9856. } POSTPACK;
  9857. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9858. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9859. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9860. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9861. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9862. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  9863. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  9864. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  9865. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  9866. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  9867. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  9868. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  9869. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  9870. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  9871. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  9872. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  9873. do { \
  9874. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  9875. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  9876. } while (0)
  9877. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  9878. do { \
  9879. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  9880. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  9881. } while (0)
  9882. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  9883. do { \
  9884. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  9885. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  9886. } while (0)
  9887. /**
  9888. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  9889. *
  9890. * @details
  9891. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  9892. * SRNG ring setup is done
  9893. *
  9894. * This message indicates whether the last setup operation is successful.
  9895. * It will be sent to host when host set respose_required bit in
  9896. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  9897. * The message would appear as follows:
  9898. *
  9899. * |31 24|23 16|15 8|7 0|
  9900. * |--------------- +----------------+----------------+----------------|
  9901. * | setup_status | ring_id | pdev_id | msg_type |
  9902. * |-------------------------------------------------------------------|
  9903. *
  9904. * The message is interpreted as follows:
  9905. * dword0 - b'0:7 - msg_type: This will be set to
  9906. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  9907. * b'8:15 - pdev_id:
  9908. * 0 (for rings at SOC/UMAC level),
  9909. * 1/2/3 mac id (for rings at LMAC level)
  9910. * b'16:23 - ring_id: Identify the ring which is set up
  9911. * More details can be got from enum htt_srng_ring_id
  9912. * b'24:31 - setup_status: Indicate status of setup operation
  9913. * Refer to htt_ring_setup_status
  9914. */
  9915. PREPACK struct htt_sring_setup_done_t {
  9916. A_UINT32 msg_type: 8,
  9917. pdev_id: 8,
  9918. ring_id: 8,
  9919. setup_status: 8;
  9920. } POSTPACK;
  9921. enum htt_ring_setup_status {
  9922. htt_ring_setup_status_ok = 0,
  9923. htt_ring_setup_status_error,
  9924. };
  9925. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  9926. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  9927. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  9928. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  9929. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  9930. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  9931. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  9932. do { \
  9933. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  9934. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  9935. } while (0)
  9936. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  9937. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  9938. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  9939. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  9940. HTT_SRING_SETUP_DONE_RING_ID_S)
  9941. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  9942. do { \
  9943. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  9944. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  9945. } while (0)
  9946. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  9947. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  9948. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  9949. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  9950. HTT_SRING_SETUP_DONE_STATUS_S)
  9951. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  9952. do { \
  9953. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  9954. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  9955. } while (0)
  9956. /**
  9957. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  9958. *
  9959. * @details
  9960. * HTT TX map flow entry with tqm flow pointer
  9961. * Sent from firmware to host to add tqm flow pointer in corresponding
  9962. * flow search entry. Flow metadata is replayed back to host as part of this
  9963. * struct to enable host to find the specific flow search entry
  9964. *
  9965. * The message would appear as follows:
  9966. *
  9967. * |31 28|27 18|17 14|13 8|7 0|
  9968. * |-------+------------------------------------------+----------------|
  9969. * | rsvd0 | fse_hsh_idx | msg_type |
  9970. * |-------------------------------------------------------------------|
  9971. * | rsvd1 | tid | peer_id |
  9972. * |-------------------------------------------------------------------|
  9973. * | tqm_flow_pntr_lo |
  9974. * |-------------------------------------------------------------------|
  9975. * | tqm_flow_pntr_hi |
  9976. * |-------------------------------------------------------------------|
  9977. * | fse_meta_data |
  9978. * |-------------------------------------------------------------------|
  9979. *
  9980. * The message is interpreted as follows:
  9981. *
  9982. * dword0 - b'0:7 - msg_type: This will be set to
  9983. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  9984. *
  9985. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  9986. * for this flow entry
  9987. *
  9988. * dword0 - b'28:31 - rsvd0: Reserved for future use
  9989. *
  9990. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  9991. *
  9992. * dword1 - b'14:17 - tid
  9993. *
  9994. * dword1 - b'18:31 - rsvd1: Reserved for future use
  9995. *
  9996. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  9997. *
  9998. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  9999. *
  10000. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  10001. * given by host
  10002. */
  10003. PREPACK struct htt_tx_map_flow_info {
  10004. A_UINT32
  10005. msg_type: 8,
  10006. fse_hsh_idx: 20,
  10007. rsvd0: 4;
  10008. A_UINT32
  10009. peer_id: 14,
  10010. tid: 4,
  10011. rsvd1: 14;
  10012. A_UINT32 tqm_flow_pntr_lo;
  10013. A_UINT32 tqm_flow_pntr_hi;
  10014. struct htt_tx_flow_metadata fse_meta_data;
  10015. } POSTPACK;
  10016. /* DWORD 0 */
  10017. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  10018. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  10019. /* DWORD 1 */
  10020. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  10021. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  10022. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  10023. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  10024. /* DWORD 0 */
  10025. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  10026. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  10027. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  10028. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  10029. do { \
  10030. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  10031. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  10032. } while (0)
  10033. /* DWORD 1 */
  10034. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  10035. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  10036. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  10037. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  10038. do { \
  10039. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  10040. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  10041. } while (0)
  10042. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  10043. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  10044. HTT_TX_MAP_FLOW_INFO_TID_S)
  10045. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  10046. do { \
  10047. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  10048. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  10049. } while (0)
  10050. /*
  10051. * htt_dbg_ext_stats_status -
  10052. * present - The requested stats have been delivered in full.
  10053. * This indicates that either the stats information was contained
  10054. * in its entirety within this message, or else this message
  10055. * completes the delivery of the requested stats info that was
  10056. * partially delivered through earlier STATS_CONF messages.
  10057. * partial - The requested stats have been delivered in part.
  10058. * One or more subsequent STATS_CONF messages with the same
  10059. * cookie value will be sent to deliver the remainder of the
  10060. * information.
  10061. * error - The requested stats could not be delivered, for example due
  10062. * to a shortage of memory to construct a message holding the
  10063. * requested stats.
  10064. * invalid - The requested stat type is either not recognized, or the
  10065. * target is configured to not gather the stats type in question.
  10066. */
  10067. enum htt_dbg_ext_stats_status {
  10068. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  10069. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  10070. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  10071. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  10072. };
  10073. /**
  10074. * @brief target -> host ppdu stats upload
  10075. *
  10076. * @details
  10077. * The following field definitions describe the format of the HTT target
  10078. * to host ppdu stats indication message.
  10079. *
  10080. *
  10081. * |31 16|15 12|11 10|9 8|7 0 |
  10082. * |----------------------------------------------------------------------|
  10083. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  10084. * |----------------------------------------------------------------------|
  10085. * | ppdu_id |
  10086. * |----------------------------------------------------------------------|
  10087. * | Timestamp in us |
  10088. * |----------------------------------------------------------------------|
  10089. * | reserved |
  10090. * |----------------------------------------------------------------------|
  10091. * | type-specific stats info |
  10092. * | (see htt_ppdu_stats.h) |
  10093. * |----------------------------------------------------------------------|
  10094. * Header fields:
  10095. * - MSG_TYPE
  10096. * Bits 7:0
  10097. * Purpose: Identifies this is a PPDU STATS indication
  10098. * message.
  10099. * Value: 0x1d
  10100. * - mac_id
  10101. * Bits 9:8
  10102. * Purpose: mac_id of this ppdu_id
  10103. * Value: 0-3
  10104. * - pdev_id
  10105. * Bits 11:10
  10106. * Purpose: pdev_id of this ppdu_id
  10107. * Value: 0-3
  10108. * 0 (for rings at SOC level),
  10109. * 1/2/3 PDEV -> 0/1/2
  10110. * - payload_size
  10111. * Bits 31:16
  10112. * Purpose: total tlv size
  10113. * Value: payload_size in bytes
  10114. */
  10115. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  10116. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  10117. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  10118. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  10119. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  10120. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  10121. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  10122. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  10123. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  10124. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  10125. do { \
  10126. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  10127. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  10128. } while (0)
  10129. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  10130. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  10131. HTT_T2H_PPDU_STATS_MAC_ID_S)
  10132. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  10133. do { \
  10134. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  10135. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  10136. } while (0)
  10137. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  10138. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  10139. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  10140. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  10141. do { \
  10142. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  10143. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  10144. } while (0)
  10145. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  10146. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  10147. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  10148. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  10149. do { \
  10150. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  10151. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  10152. } while (0)
  10153. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  10154. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  10155. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  10156. /* htt_t2h_ppdu_stats_ind_hdr_t
  10157. * This struct contains the fields within the header of the
  10158. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  10159. * stats info.
  10160. * This struct assumes little-endian layout, and thus is only
  10161. * suitable for use within processors known to be little-endian
  10162. * (such as the target).
  10163. * In contrast, the above macros provide endian-portable methods
  10164. * to get and set the bitfields within this PPDU_STATS_IND header.
  10165. */
  10166. typedef struct {
  10167. A_UINT32 msg_type: 8, /* bits 7:0 */
  10168. mac_id: 2, /* bits 9:8 */
  10169. pdev_id: 2, /* bits 11:10 */
  10170. reserved1: 4, /* bits 15:12 */
  10171. payload_size: 16; /* bits 31:16 */
  10172. A_UINT32 ppdu_id;
  10173. A_UINT32 timestamp_us;
  10174. A_UINT32 reserved2;
  10175. } htt_t2h_ppdu_stats_ind_hdr_t;
  10176. /**
  10177. * @brief target -> host extended statistics upload
  10178. *
  10179. * @details
  10180. * The following field definitions describe the format of the HTT target
  10181. * to host stats upload confirmation message.
  10182. * The message contains a cookie echoed from the HTT host->target stats
  10183. * upload request, which identifies which request the confirmation is
  10184. * for, and a single stats can span over multiple HTT stats indication
  10185. * due to the HTT message size limitation so every HTT ext stats indication
  10186. * will have tag-length-value stats information elements.
  10187. * The tag-length header for each HTT stats IND message also includes a
  10188. * status field, to indicate whether the request for the stat type in
  10189. * question was fully met, partially met, unable to be met, or invalid
  10190. * (if the stat type in question is disabled in the target).
  10191. * A Done bit 1's indicate the end of the of stats info elements.
  10192. *
  10193. *
  10194. * |31 16|15 12|11|10 8|7 5|4 0|
  10195. * |--------------------------------------------------------------|
  10196. * | reserved | msg type |
  10197. * |--------------------------------------------------------------|
  10198. * | cookie LSBs |
  10199. * |--------------------------------------------------------------|
  10200. * | cookie MSBs |
  10201. * |--------------------------------------------------------------|
  10202. * | stats entry length | rsvd | D| S | stat type |
  10203. * |--------------------------------------------------------------|
  10204. * | type-specific stats info |
  10205. * | (see htt_stats.h) |
  10206. * |--------------------------------------------------------------|
  10207. * Header fields:
  10208. * - MSG_TYPE
  10209. * Bits 7:0
  10210. * Purpose: Identifies this is a extended statistics upload confirmation
  10211. * message.
  10212. * Value: 0x1c
  10213. * - COOKIE_LSBS
  10214. * Bits 31:0
  10215. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10216. * message with its preceding host->target stats request message.
  10217. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10218. * - COOKIE_MSBS
  10219. * Bits 31:0
  10220. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10221. * message with its preceding host->target stats request message.
  10222. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10223. *
  10224. * Stats Information Element tag-length header fields:
  10225. * - STAT_TYPE
  10226. * Bits 7:0
  10227. * Purpose: identifies the type of statistics info held in the
  10228. * following information element
  10229. * Value: htt_dbg_ext_stats_type
  10230. * - STATUS
  10231. * Bits 10:8
  10232. * Purpose: indicate whether the requested stats are present
  10233. * Value: htt_dbg_ext_stats_status
  10234. * - DONE
  10235. * Bits 11
  10236. * Purpose:
  10237. * Indicates the completion of the stats entry, this will be the last
  10238. * stats conf HTT segment for the requested stats type.
  10239. * Value:
  10240. * 0 -> the stats retrieval is ongoing
  10241. * 1 -> the stats retrieval is complete
  10242. * - LENGTH
  10243. * Bits 31:16
  10244. * Purpose: indicate the stats information size
  10245. * Value: This field specifies the number of bytes of stats information
  10246. * that follows the element tag-length header.
  10247. * It is expected but not required that this length is a multiple of
  10248. * 4 bytes.
  10249. */
  10250. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  10251. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  10252. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  10253. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  10254. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  10255. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  10256. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  10257. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  10258. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  10259. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10260. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  10261. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  10262. do { \
  10263. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  10264. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  10265. } while (0)
  10266. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  10267. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  10268. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  10269. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  10270. do { \
  10271. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  10272. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  10273. } while (0)
  10274. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  10275. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  10276. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  10277. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  10278. do { \
  10279. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  10280. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  10281. } while (0)
  10282. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  10283. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  10284. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  10285. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10286. do { \
  10287. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  10288. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  10289. } while (0)
  10290. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  10291. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  10292. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  10293. typedef enum {
  10294. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  10295. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  10296. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  10297. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  10298. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  10299. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  10300. /* Reserved from 128 - 255 for target internal use.*/
  10301. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  10302. } HTT_PEER_TYPE;
  10303. /** 2 word representation of MAC addr */
  10304. typedef struct {
  10305. /** upper 4 bytes of MAC address */
  10306. A_UINT32 mac_addr31to0;
  10307. /** lower 2 bytes of MAC address */
  10308. A_UINT32 mac_addr47to32;
  10309. } htt_mac_addr;
  10310. /** macro to convert MAC address from char array to HTT word format */
  10311. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  10312. (phtt_mac_addr)->mac_addr31to0 = \
  10313. (((c_macaddr)[0] << 0) | \
  10314. ((c_macaddr)[1] << 8) | \
  10315. ((c_macaddr)[2] << 16) | \
  10316. ((c_macaddr)[3] << 24)); \
  10317. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  10318. } while (0)
  10319. /**
  10320. * @brief target -> host monitor mac header indication message
  10321. *
  10322. * @details
  10323. * The following diagram shows the format of the monitor mac header message
  10324. * sent from the target to the host.
  10325. * This message is primarily sent when promiscuous rx mode is enabled.
  10326. * One message is sent per rx PPDU.
  10327. *
  10328. * |31 24|23 16|15 8|7 0|
  10329. * |-------------------------------------------------------------|
  10330. * | peer_id | reserved0 | msg_type |
  10331. * |-------------------------------------------------------------|
  10332. * | reserved1 | num_mpdu |
  10333. * |-------------------------------------------------------------|
  10334. * | struct hw_rx_desc |
  10335. * | (see wal_rx_desc.h) |
  10336. * |-------------------------------------------------------------|
  10337. * | struct ieee80211_frame_addr4 |
  10338. * | (see ieee80211_defs.h) |
  10339. * |-------------------------------------------------------------|
  10340. * | struct ieee80211_frame_addr4 |
  10341. * | (see ieee80211_defs.h) |
  10342. * |-------------------------------------------------------------|
  10343. * | ...... |
  10344. * |-------------------------------------------------------------|
  10345. *
  10346. * Header fields:
  10347. * - msg_type
  10348. * Bits 7:0
  10349. * Purpose: Identifies this is a monitor mac header indication message.
  10350. * Value: 0x20
  10351. * - peer_id
  10352. * Bits 31:16
  10353. * Purpose: Software peer id given by host during association,
  10354. * During promiscuous mode, the peer ID will be invalid (0xFF)
  10355. * for rx PPDUs received from unassociated peers.
  10356. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  10357. * - num_mpdu
  10358. * Bits 15:0
  10359. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  10360. * delivered within the message.
  10361. * Value: 1 to 32
  10362. * num_mpdu is limited to a maximum value of 32, due to buffer
  10363. * size limits. For PPDUs with more than 32 MPDUs, only the
  10364. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  10365. * the PPDU will be provided.
  10366. */
  10367. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  10368. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  10369. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  10370. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  10371. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  10372. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  10373. do { \
  10374. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  10375. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  10376. } while (0)
  10377. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  10378. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  10379. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  10380. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  10381. do { \
  10382. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  10383. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  10384. } while (0)
  10385. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  10386. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  10387. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  10388. /**
  10389. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  10390. *
  10391. * @details
  10392. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  10393. * the flow pool associated with the specified ID is resized
  10394. *
  10395. * The message would appear as follows:
  10396. *
  10397. * |31 16|15 8|7 0|
  10398. * |---------------------------------+----------------+----------------|
  10399. * | reserved0 | Msg type |
  10400. * |-------------------------------------------------------------------|
  10401. * | flow pool new size | flow pool ID |
  10402. * |-------------------------------------------------------------------|
  10403. *
  10404. * The message is interpreted as follows:
  10405. * b'0:7 - msg_type: This will be set to
  10406. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  10407. *
  10408. * b'0:15 - flow pool ID: Existing flow pool ID
  10409. *
  10410. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  10411. *
  10412. */
  10413. PREPACK struct htt_flow_pool_resize_t {
  10414. A_UINT32 msg_type:8,
  10415. reserved0:24;
  10416. A_UINT32 flow_pool_id:16,
  10417. flow_pool_new_size:16;
  10418. } POSTPACK;
  10419. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  10420. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  10421. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  10422. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  10423. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  10424. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  10425. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  10426. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  10427. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  10428. do { \
  10429. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  10430. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  10431. } while (0)
  10432. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  10433. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  10434. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  10435. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  10436. do { \
  10437. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  10438. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  10439. } while (0)
  10440. /**
  10441. * @brief host -> target channel change message
  10442. *
  10443. * @details
  10444. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  10445. * to associate RX frames to correct channel they were received on.
  10446. * The following field definitions describe the format of the HTT target
  10447. * to host channel change message.
  10448. * |31 16|15 8|7 5|4 0|
  10449. * |------------------------------------------------------------|
  10450. * | reserved | MSG_TYPE |
  10451. * |------------------------------------------------------------|
  10452. * | CHAN_MHZ |
  10453. * |------------------------------------------------------------|
  10454. * | BAND_CENTER_FREQ1 |
  10455. * |------------------------------------------------------------|
  10456. * | BAND_CENTER_FREQ2 |
  10457. * |------------------------------------------------------------|
  10458. * | CHAN_PHY_MODE |
  10459. * |------------------------------------------------------------|
  10460. * Header fields:
  10461. * - MSG_TYPE
  10462. * Bits 7:0
  10463. * Value: 0xf
  10464. * - CHAN_MHZ
  10465. * Bits 31:0
  10466. * Purpose: frequency of the primary 20mhz channel.
  10467. * - BAND_CENTER_FREQ1
  10468. * Bits 31:0
  10469. * Purpose: centre frequency of the full channel.
  10470. * - BAND_CENTER_FREQ2
  10471. * Bits 31:0
  10472. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  10473. * - CHAN_PHY_MODE
  10474. * Bits 31:0
  10475. * Purpose: phy mode of the channel.
  10476. */
  10477. PREPACK struct htt_chan_change_msg {
  10478. A_UINT32 chan_mhz; /* frequency in mhz */
  10479. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  10480. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  10481. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  10482. } POSTPACK;
  10483. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  10484. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  10485. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  10486. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  10487. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  10488. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  10489. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  10490. /*
  10491. * The read and write indices point to the data within the host buffer.
  10492. * Because the first 4 bytes of the host buffer is used for the read index and
  10493. * the next 4 bytes for the write index, the data itself starts at offset 8.
  10494. * The read index and write index are the byte offsets from the base of the
  10495. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  10496. * Refer the ASCII text picture below.
  10497. */
  10498. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  10499. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  10500. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  10501. /*
  10502. ***************************************************************************
  10503. *
  10504. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10505. *
  10506. ***************************************************************************
  10507. *
  10508. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  10509. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  10510. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  10511. * written into the Host memory region mentioned below.
  10512. *
  10513. * Read index is updated by the Host. At any point of time, the read index will
  10514. * indicate the index that will next be read by the Host. The read index is
  10515. * in units of bytes offset from the base of the meta-data buffer.
  10516. *
  10517. * Write index is updated by the FW. At any point of time, the write index will
  10518. * indicate from where the FW can start writing any new data. The write index is
  10519. * in units of bytes offset from the base of the meta-data buffer.
  10520. *
  10521. * If the Host is not fast enough in reading the CFR data, any new capture data
  10522. * would be dropped if there is no space left to write the new captures.
  10523. *
  10524. * The last 4 bytes of the memory region will have the magic pattern
  10525. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  10526. * not overrun the host buffer.
  10527. *
  10528. * ,--------------------. read and write indices store the
  10529. * | | byte offset from the base of the
  10530. * | ,--------+--------. meta-data buffer to the next
  10531. * | | | | location within the data buffer
  10532. * | | v v that will be read / written
  10533. * ************************************************************************
  10534. * * Read * Write * * Magic *
  10535. * * index * index * CFR data1 ...... CFR data N * pattern *
  10536. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  10537. * ************************************************************************
  10538. * |<---------- data buffer ---------->|
  10539. *
  10540. * |<----------------- meta-data buffer allocated in Host ----------------|
  10541. *
  10542. * Note:
  10543. * - Considering the 4 bytes needed to store the Read index (R) and the
  10544. * Write index (W), the initial value is as follows:
  10545. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  10546. * - Buffer empty condition:
  10547. * R = W
  10548. *
  10549. * Regarding CFR data format:
  10550. * --------------------------
  10551. *
  10552. * Each CFR tone is stored in HW as 16-bits with the following format:
  10553. * {bits[15:12], bits[11:6], bits[5:0]} =
  10554. * {unsigned exponent (4 bits),
  10555. * signed mantissa_real (6 bits),
  10556. * signed mantissa_imag (6 bits)}
  10557. *
  10558. * CFR_real = mantissa_real * 2^(exponent-5)
  10559. * CFR_imag = mantissa_imag * 2^(exponent-5)
  10560. *
  10561. *
  10562. * The CFR data is written to the 16-bit unsigned output array (buff) in
  10563. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  10564. *
  10565. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  10566. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  10567. * .
  10568. * .
  10569. * .
  10570. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  10571. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  10572. */
  10573. /* Bandwidth of peer CFR captures */
  10574. typedef enum {
  10575. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  10576. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  10577. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  10578. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  10579. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  10580. HTT_PEER_CFR_CAPTURE_BW_MAX,
  10581. } HTT_PEER_CFR_CAPTURE_BW;
  10582. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  10583. * was captured
  10584. */
  10585. typedef enum {
  10586. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  10587. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  10588. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  10589. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  10590. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  10591. } HTT_PEER_CFR_CAPTURE_MODE;
  10592. typedef enum {
  10593. /* This message type is currently used for the below purpose:
  10594. *
  10595. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  10596. * wmi_peer_cfr_capture_cmd.
  10597. * If payload_present bit is set to 0 then the associated memory region
  10598. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  10599. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  10600. * message; the CFR dump will be present at the end of the message,
  10601. * after the chan_phy_mode.
  10602. */
  10603. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  10604. /* Always keep this last */
  10605. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  10606. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  10607. /**
  10608. * @brief target -> host CFR dump completion indication message definition
  10609. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  10610. *
  10611. * @details
  10612. * The following diagram shows the format of the Channel Frequency Response
  10613. * (CFR) dump completion indication. This inidcation is sent to the Host when
  10614. * the channel capture of a peer is copied by Firmware into the Host memory
  10615. *
  10616. * **************************************************************************
  10617. *
  10618. * Message format when the CFR capture message type is
  10619. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10620. *
  10621. * **************************************************************************
  10622. *
  10623. * |31 16|15 |8|7 0|
  10624. * |----------------------------------------------------------------|
  10625. * header: | reserved |P| msg_type |
  10626. * word 0 | | | |
  10627. * |----------------------------------------------------------------|
  10628. * payload: | cfr_capture_msg_type |
  10629. * word 1 | |
  10630. * |----------------------------------------------------------------|
  10631. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  10632. * word 2 | | | | | | | | |
  10633. * |----------------------------------------------------------------|
  10634. * | mac_addr31to0 |
  10635. * word 3 | |
  10636. * |----------------------------------------------------------------|
  10637. * | unused / reserved | mac_addr47to32 |
  10638. * word 4 | | |
  10639. * |----------------------------------------------------------------|
  10640. * | index |
  10641. * word 5 | |
  10642. * |----------------------------------------------------------------|
  10643. * | length |
  10644. * word 6 | |
  10645. * |----------------------------------------------------------------|
  10646. * | timestamp |
  10647. * word 7 | |
  10648. * |----------------------------------------------------------------|
  10649. * | counter |
  10650. * word 8 | |
  10651. * |----------------------------------------------------------------|
  10652. * | chan_mhz |
  10653. * word 9 | |
  10654. * |----------------------------------------------------------------|
  10655. * | band_center_freq1 |
  10656. * word 10 | |
  10657. * |----------------------------------------------------------------|
  10658. * | band_center_freq2 |
  10659. * word 11 | |
  10660. * |----------------------------------------------------------------|
  10661. * | chan_phy_mode |
  10662. * word 12 | |
  10663. * |----------------------------------------------------------------|
  10664. * where,
  10665. * P - payload present bit (payload_present explained below)
  10666. * req_id - memory request id (mem_req_id explained below)
  10667. * S - status field (status explained below)
  10668. * capbw - capture bandwidth (capture_bw explained below)
  10669. * mode - mode of capture (mode explained below)
  10670. * sts - space time streams (sts_count explained below)
  10671. * chbw - channel bandwidth (channel_bw explained below)
  10672. * captype - capture type (cap_type explained below)
  10673. *
  10674. * The following field definitions describe the format of the CFR dump
  10675. * completion indication sent from the target to the host
  10676. *
  10677. * Header fields:
  10678. *
  10679. * Word 0
  10680. * - msg_type
  10681. * Bits 7:0
  10682. * Purpose: Identifies this as CFR TX completion indication
  10683. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10684. * - payload_present
  10685. * Bit 8
  10686. * Purpose: Identifies how CFR data is sent to host
  10687. * Value: 0 - If CFR Payload is written to host memory
  10688. * 1 - If CFR Payload is sent as part of HTT message
  10689. * (This is the requirement for SDIO/USB where it is
  10690. * not possible to write CFR data to host memory)
  10691. * - reserved
  10692. * Bits 31:9
  10693. * Purpose: Reserved
  10694. * Value: 0
  10695. *
  10696. * Payload fields:
  10697. *
  10698. * Word 1
  10699. * - cfr_capture_msg_type
  10700. * Bits 31:0
  10701. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10702. * to specify the format used for the remainder of the message
  10703. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10704. * (currently only MSG_TYPE_1 is defined)
  10705. *
  10706. * Word 2
  10707. * - mem_req_id
  10708. * Bits 6:0
  10709. * Purpose: Contain the mem request id of the region where the CFR capture
  10710. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10711. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10712. this value is invalid)
  10713. * - status
  10714. * Bit 7
  10715. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10716. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10717. * - capture_bw
  10718. * Bits 10:8
  10719. * Purpose: Carry the bandwidth of the CFR capture
  10720. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10721. * - mode
  10722. * Bits 13:11
  10723. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10724. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10725. * - sts_count
  10726. * Bits 16:14
  10727. * Purpose: Carry the number of space time streams
  10728. * Value: Number of space time streams
  10729. * - channel_bw
  10730. * Bits 19:17
  10731. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10732. * measurement
  10733. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10734. * - cap_type
  10735. * Bits 23:20
  10736. * Purpose: Carry the type of the capture
  10737. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10738. * - vdev_id
  10739. * Bits 31:24
  10740. * Purpose: Carry the virtual device id
  10741. * Value: vdev ID
  10742. *
  10743. * Word 3
  10744. * - mac_addr31to0
  10745. * Bits 31:0
  10746. * Purpose: Contain the bits 31:0 of the peer MAC address
  10747. * Value: Bits 31:0 of the peer MAC address
  10748. *
  10749. * Word 4
  10750. * - mac_addr47to32
  10751. * Bits 15:0
  10752. * Purpose: Contain the bits 47:32 of the peer MAC address
  10753. * Value: Bits 47:32 of the peer MAC address
  10754. *
  10755. * Word 5
  10756. * - index
  10757. * Bits 31:0
  10758. * Purpose: Contain the index at which this CFR dump was written in the Host
  10759. * allocated memory. This index is the number of bytes from the base address.
  10760. * Value: Index position
  10761. *
  10762. * Word 6
  10763. * - length
  10764. * Bits 31:0
  10765. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10766. * Value: Length of the CFR capture of the peer
  10767. *
  10768. * Word 7
  10769. * - timestamp
  10770. * Bits 31:0
  10771. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10772. * clock used for this timestamp is private to the target and not visible to
  10773. * the host i.e., Host can interpret only the relative timestamp deltas from
  10774. * one message to the next, but can't interpret the absolute timestamp from a
  10775. * single message.
  10776. * Value: Timestamp in microseconds
  10777. *
  10778. * Word 8
  10779. * - counter
  10780. * Bits 31:0
  10781. * Purpose: Carry the count of the current CFR capture from FW. This is
  10782. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10783. * in host memory)
  10784. * Value: Count of the current CFR capture
  10785. *
  10786. * Word 9
  10787. * - chan_mhz
  10788. * Bits 31:0
  10789. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10790. * Value: Primary 20 channel frequency
  10791. *
  10792. * Word 10
  10793. * - band_center_freq1
  10794. * Bits 31:0
  10795. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10796. * Value: Center frequency 1 in MHz
  10797. *
  10798. * Word 11
  10799. * - band_center_freq2
  10800. * Bits 31:0
  10801. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10802. * the VDEV
  10803. * 80plus80 mode
  10804. * Value: Center frequency 2 in MHz
  10805. *
  10806. * Word 12
  10807. * - chan_phy_mode
  10808. * Bits 31:0
  10809. * Purpose: Carry the phy mode of the channel, of the VDEV
  10810. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10811. */
  10812. PREPACK struct htt_cfr_dump_ind_type_1 {
  10813. A_UINT32 mem_req_id:7,
  10814. status:1,
  10815. capture_bw:3,
  10816. mode:3,
  10817. sts_count:3,
  10818. channel_bw:3,
  10819. cap_type:4,
  10820. vdev_id:8;
  10821. htt_mac_addr addr;
  10822. A_UINT32 index;
  10823. A_UINT32 length;
  10824. A_UINT32 timestamp;
  10825. A_UINT32 counter;
  10826. struct htt_chan_change_msg chan;
  10827. } POSTPACK;
  10828. PREPACK struct htt_cfr_dump_compl_ind {
  10829. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10830. union {
  10831. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10832. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10833. /* If there is a need to change the memory layout and its associated
  10834. * HTT indication format, a new CFR capture message type can be
  10835. * introduced and added into this union.
  10836. */
  10837. };
  10838. } POSTPACK;
  10839. /*
  10840. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10841. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10842. */
  10843. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10844. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10845. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10846. do { \
  10847. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10848. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10849. } while(0)
  10850. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10851. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10852. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10853. /*
  10854. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10855. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10856. */
  10857. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10858. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10859. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10860. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10861. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10862. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  10863. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  10864. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  10865. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  10866. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  10867. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  10868. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  10869. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  10870. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  10871. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  10872. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  10873. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  10874. do { \
  10875. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  10876. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  10877. } while (0)
  10878. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  10879. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  10880. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  10881. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  10882. do { \
  10883. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  10884. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  10885. } while (0)
  10886. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  10887. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  10888. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  10889. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  10890. do { \
  10891. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  10892. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  10893. } while (0)
  10894. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  10895. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  10896. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  10897. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  10898. do { \
  10899. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  10900. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  10901. } while (0)
  10902. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  10903. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  10904. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  10905. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  10906. do { \
  10907. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  10908. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  10909. } while (0)
  10910. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  10911. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  10912. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  10913. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  10914. do { \
  10915. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  10916. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  10917. } while (0)
  10918. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  10919. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  10920. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  10921. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  10922. do { \
  10923. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  10924. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  10925. } while (0)
  10926. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  10927. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  10928. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  10929. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  10930. do { \
  10931. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  10932. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  10933. } while (0)
  10934. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  10935. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  10936. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  10937. /**
  10938. * @brief target -> host peer (PPDU) stats message
  10939. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  10940. * @details
  10941. * This message is generated by FW when FW is sending stats to host
  10942. * about one or more PPDUs that the FW has transmitted to one or more peers.
  10943. * This message is sent autonomously by the target rather than upon request
  10944. * by the host.
  10945. * The following field definitions describe the format of the HTT target
  10946. * to host peer stats indication message.
  10947. *
  10948. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  10949. * or more PPDU stats records.
  10950. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  10951. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  10952. * then the message would start with the
  10953. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  10954. * below.
  10955. *
  10956. * |31 16|15|14|13 11|10 9|8|7 0|
  10957. * |-------------------------------------------------------------|
  10958. * | reserved |MSG_TYPE |
  10959. * |-------------------------------------------------------------|
  10960. * rec 0 | TLV header |
  10961. * rec 0 |-------------------------------------------------------------|
  10962. * rec 0 | ppdu successful bytes |
  10963. * rec 0 |-------------------------------------------------------------|
  10964. * rec 0 | ppdu retry bytes |
  10965. * rec 0 |-------------------------------------------------------------|
  10966. * rec 0 | ppdu failed bytes |
  10967. * rec 0 |-------------------------------------------------------------|
  10968. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  10969. * rec 0 |-------------------------------------------------------------|
  10970. * rec 0 | retried MSDUs | successful MSDUs |
  10971. * rec 0 |-------------------------------------------------------------|
  10972. * rec 0 | TX duration | failed MSDUs |
  10973. * rec 0 |-------------------------------------------------------------|
  10974. * ...
  10975. * |-------------------------------------------------------------|
  10976. * rec N | TLV header |
  10977. * rec N |-------------------------------------------------------------|
  10978. * rec N | ppdu successful bytes |
  10979. * rec N |-------------------------------------------------------------|
  10980. * rec N | ppdu retry bytes |
  10981. * rec N |-------------------------------------------------------------|
  10982. * rec N | ppdu failed bytes |
  10983. * rec N |-------------------------------------------------------------|
  10984. * rec N | peer id | S|SG| BW | BA |A|rate code|
  10985. * rec N |-------------------------------------------------------------|
  10986. * rec N | retried MSDUs | successful MSDUs |
  10987. * rec N |-------------------------------------------------------------|
  10988. * rec N | TX duration | failed MSDUs |
  10989. * rec N |-------------------------------------------------------------|
  10990. *
  10991. * where:
  10992. * A = is A-MPDU flag
  10993. * BA = block-ack failure flags
  10994. * BW = bandwidth spec
  10995. * SG = SGI enabled spec
  10996. * S = skipped rate ctrl
  10997. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  10998. *
  10999. * Header
  11000. * ------
  11001. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11002. * dword0 - b'8:31 - reserved : Reserved for future use
  11003. *
  11004. * payload include below peer_stats information
  11005. * --------------------------------------------
  11006. * @TLV : HTT_PPDU_STATS_INFO_TLV
  11007. * @tx_success_bytes : total successful bytes in the PPDU.
  11008. * @tx_retry_bytes : total retried bytes in the PPDU.
  11009. * @tx_failed_bytes : total failed bytes in the PPDU.
  11010. * @tx_ratecode : rate code used for the PPDU.
  11011. * @is_ampdu : Indicates PPDU is AMPDU or not.
  11012. * @ba_ack_failed : BA/ACK failed for this PPDU
  11013. * b00 -> BA received
  11014. * b01 -> BA failed once
  11015. * b10 -> BA failed twice, when HW retry is enabled.
  11016. * @bw : BW
  11017. * b00 -> 20 MHz
  11018. * b01 -> 40 MHz
  11019. * b10 -> 80 MHz
  11020. * b11 -> 160 MHz (or 80+80)
  11021. * @sg : SGI enabled
  11022. * @s : skipped ratectrl
  11023. * @peer_id : peer id
  11024. * @tx_success_msdus : successful MSDUs
  11025. * @tx_retry_msdus : retried MSDUs
  11026. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  11027. * @tx_duration : Tx duration for the PPDU (microsecond units)
  11028. */
  11029. /**
  11030. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  11031. *
  11032. * @details
  11033. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  11034. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  11035. * This message will only be sent if the backpressure condition has existed
  11036. * continuously for an initial period (100 ms).
  11037. * Repeat messages with updated information will be sent after each
  11038. * subsequent period (100 ms) as long as the backpressure remains unabated.
  11039. * This message indicates the ring id along with current head and tail index
  11040. * locations (i.e. write and read indices).
  11041. * The backpressure time indicates the time in ms for which continous
  11042. * backpressure has been observed in the ring.
  11043. *
  11044. * The message format is as follows:
  11045. *
  11046. * |31 24|23 16|15 8|7 0|
  11047. * |----------------+----------------+----------------+----------------|
  11048. * | ring_id | ring_type | pdev_id | msg_type |
  11049. * |-------------------------------------------------------------------|
  11050. * | tail_idx | head_idx |
  11051. * |-------------------------------------------------------------------|
  11052. * | backpressure_time_ms |
  11053. * |-------------------------------------------------------------------|
  11054. *
  11055. * The message is interpreted as follows:
  11056. * dword0 - b'0:7 - msg_type: This will be set to
  11057. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  11058. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  11059. * 1, 2, 3 indicates pdev_id 0,1,2 and
  11060. the msg is for LMAC ring.
  11061. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  11062. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  11063. * htt_backpressure_lmac_ring_id. This represents
  11064. * the ring id for which continous backpressure is seen
  11065. *
  11066. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  11067. * the ring indicated by the ring_id
  11068. *
  11069. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  11070. * the ring indicated by the ring id
  11071. *
  11072. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  11073. * backpressure has been seen in the ring
  11074. * indicated by the ring_id.
  11075. * Units = milliseconds
  11076. */
  11077. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  11078. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  11079. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  11080. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  11081. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  11082. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  11083. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  11084. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  11085. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  11086. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  11087. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  11088. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  11089. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  11090. do { \
  11091. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  11092. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  11093. } while (0)
  11094. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  11095. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  11096. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  11097. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  11098. do { \
  11099. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  11100. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  11101. } while (0)
  11102. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  11103. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  11104. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  11105. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  11106. do { \
  11107. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  11108. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  11109. } while (0)
  11110. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  11111. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  11112. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  11113. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  11114. do { \
  11115. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  11116. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  11117. } while (0)
  11118. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  11119. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  11120. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  11121. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  11122. do { \
  11123. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  11124. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  11125. } while (0)
  11126. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  11127. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  11128. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  11129. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  11130. do { \
  11131. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  11132. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  11133. } while (0)
  11134. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  11135. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  11136. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  11137. enum htt_backpressure_ring_type {
  11138. HTT_SW_RING_TYPE_UMAC,
  11139. HTT_SW_RING_TYPE_LMAC,
  11140. HTT_SW_RING_TYPE_MAX,
  11141. };
  11142. /* Ring id for which the message is sent to host */
  11143. enum htt_backpressure_umac_ringid {
  11144. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  11145. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  11146. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  11147. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  11148. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  11149. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  11150. HTT_SW_RING_IDX_REO_REO2FW_RING,
  11151. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  11152. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  11153. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  11154. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  11155. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  11156. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  11157. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  11158. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  11159. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  11160. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  11161. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  11162. HTT_SW_UMAC_RING_IDX_MAX,
  11163. };
  11164. enum htt_backpressure_lmac_ringid {
  11165. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  11166. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  11167. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  11168. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  11169. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  11170. HTT_SW_RING_IDX_RXDMA2FW_RING,
  11171. HTT_SW_RING_IDX_RXDMA2SW_RING,
  11172. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  11173. HTT_SW_RING_IDX_RXDMA2REO_RING,
  11174. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  11175. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  11176. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  11177. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  11178. HTT_SW_LMAC_RING_IDX_MAX,
  11179. };
  11180. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  11181. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  11182. pdev_id: 8,
  11183. ring_type: 8, /* htt_backpressure_ring_type */
  11184. /*
  11185. * ring_id holds an enum value from either
  11186. * htt_backpressure_umac_ringid or
  11187. * htt_backpressure_lmac_ringid, based on
  11188. * the ring_type setting.
  11189. */
  11190. ring_id: 8;
  11191. A_UINT16 head_idx;
  11192. A_UINT16 tail_idx;
  11193. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  11194. } POSTPACK;
  11195. /*
  11196. * Defines two 32 bit words that can be used by the target to indicate a per
  11197. * user RU allocation and rate information.
  11198. *
  11199. * This information is currently provided in the "sw_response_reference_ptr"
  11200. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  11201. * "rx_ppdu_end_user_stats" TLV.
  11202. *
  11203. * VALID:
  11204. * The consumer of these words must explicitly check the valid bit,
  11205. * and only attempt interpretation of any of the remaining fields if
  11206. * the valid bit is set to 1.
  11207. *
  11208. * VERSION:
  11209. * The consumer of these words must also explicitly check the version bit,
  11210. * and only use the V0 definition if the VERSION field is set to 0.
  11211. *
  11212. * Version 1 is currently undefined, with the exception of the VALID and
  11213. * VERSION fields.
  11214. *
  11215. * Version 0:
  11216. *
  11217. * The fields below are duplicated per BW.
  11218. *
  11219. * The consumer must determine which BW field to use, based on the UL OFDMA
  11220. * PPDU BW indicated by HW.
  11221. *
  11222. * RU_START: RU26 start index for the user.
  11223. * Note that this is always using the RU26 index, regardless
  11224. * of the actual RU assigned to the user
  11225. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  11226. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  11227. *
  11228. * For example, 20MHz (the value in the top row is RU_START)
  11229. *
  11230. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  11231. * RU Size 1 (52): | | | | | |
  11232. * RU Size 2 (106): | | | |
  11233. * RU Size 3 (242): | |
  11234. *
  11235. * RU_SIZE: Indicates the RU size, as defined by enum
  11236. * htt_ul_ofdma_user_info_ru_size.
  11237. *
  11238. * LDPC: LDPC enabled (if 0, BCC is used)
  11239. *
  11240. * DCM: DCM enabled
  11241. *
  11242. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  11243. * |---------------------------------+--------------------------------|
  11244. * |Ver|Valid| FW internal |
  11245. * |---------------------------------+--------------------------------|
  11246. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  11247. * |---------------------------------+--------------------------------|
  11248. */
  11249. enum htt_ul_ofdma_user_info_ru_size {
  11250. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  11251. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  11252. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  11253. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  11254. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  11255. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  11256. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  11257. };
  11258. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  11259. struct htt_ul_ofdma_user_info_v0 {
  11260. A_UINT32 word0;
  11261. A_UINT32 word1;
  11262. };
  11263. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  11264. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  11265. union {
  11266. A_UINT32 word0;
  11267. struct {
  11268. A_UINT32 w0_fw_rsvd:30;
  11269. A_UINT32 w0_valid:1;
  11270. A_UINT32 w0_version:1;
  11271. };
  11272. };
  11273. union {
  11274. A_UINT32 word1;
  11275. struct {
  11276. A_UINT32 w1_nss:3;
  11277. A_UINT32 w1_mcs:4;
  11278. A_UINT32 w1_ldpc:1;
  11279. A_UINT32 w1_dcm:1;
  11280. A_UINT32 w1_ru_start:7;
  11281. A_UINT32 w1_ru_size:3;
  11282. A_UINT32 w1_trig_type:4;
  11283. A_UINT32 w1_unused:9;
  11284. };
  11285. };
  11286. } POSTPACK;
  11287. enum HTT_UL_OFDMA_TRIG_TYPE {
  11288. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  11289. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  11290. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  11291. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  11292. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  11293. };
  11294. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  11295. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  11296. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  11297. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  11298. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  11299. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  11300. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  11301. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  11302. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  11303. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  11304. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  11305. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  11306. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  11307. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  11308. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  11309. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  11310. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  11311. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  11312. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  11313. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  11314. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  11315. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  11316. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  11317. /*--- word 0 ---*/
  11318. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  11319. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  11320. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  11321. do { \
  11322. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  11323. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  11324. } while (0)
  11325. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  11326. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  11327. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  11328. do { \
  11329. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  11330. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  11331. } while (0)
  11332. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  11333. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  11334. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  11335. do { \
  11336. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  11337. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  11338. } while (0)
  11339. /*--- word 1 ---*/
  11340. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  11341. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  11342. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  11343. do { \
  11344. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  11345. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  11346. } while (0)
  11347. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  11348. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  11349. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  11350. do { \
  11351. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  11352. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  11353. } while (0)
  11354. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  11355. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  11356. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  11357. do { \
  11358. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  11359. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  11360. } while (0)
  11361. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  11362. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  11363. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  11364. do { \
  11365. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  11366. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  11367. } while (0)
  11368. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  11369. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  11370. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  11371. do { \
  11372. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  11373. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  11374. } while (0)
  11375. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  11376. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  11377. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  11378. do { \
  11379. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  11380. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  11381. } while (0)
  11382. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  11383. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  11384. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  11385. do { \
  11386. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  11387. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  11388. } while (0)
  11389. #endif