htt.h 649 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435
  1. /*
  2. * Copyright (c) 2011-2021 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. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. */
  207. #define HTT_CURRENT_VERSION_MAJOR 3
  208. #define HTT_CURRENT_VERSION_MINOR 88
  209. #define HTT_NUM_TX_FRAG_DESC 1024
  210. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  211. #define HTT_CHECK_SET_VAL(field, val) \
  212. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  213. /* macros to assist in sign-extending fields from HTT messages */
  214. #define HTT_SIGN_BIT_MASK(field) \
  215. ((field ## _M + (1 << field ## _S)) >> 1)
  216. #define HTT_SIGN_BIT(_val, field) \
  217. (_val & HTT_SIGN_BIT_MASK(field))
  218. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  219. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  220. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  221. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  222. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  223. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  224. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  225. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  226. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  227. /*
  228. * TEMPORARY:
  229. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  230. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  231. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  232. * updated.
  233. */
  234. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  235. /*
  236. * TEMPORARY:
  237. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  238. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  239. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  240. * updated.
  241. */
  242. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  243. /*
  244. * htt_dbg_stats_type -
  245. * bit positions for each stats type within a stats type bitmask
  246. * The bitmask contains 24 bits.
  247. */
  248. enum htt_dbg_stats_type {
  249. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  250. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  251. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  252. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  253. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  254. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  255. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  256. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  257. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  258. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  259. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  260. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  261. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  262. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  263. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  264. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  265. /* bits 16-23 currently reserved */
  266. /* keep this last */
  267. HTT_DBG_NUM_STATS
  268. };
  269. /*=== HTT option selection TLVs ===
  270. * Certain HTT messages have alternatives or options.
  271. * For such cases, the host and target need to agree on which option to use.
  272. * Option specification TLVs can be appended to the VERSION_REQ and
  273. * VERSION_CONF messages to select options other than the default.
  274. * These TLVs are entirely optional - if they are not provided, there is a
  275. * well-defined default for each option. If they are provided, they can be
  276. * provided in any order. Each TLV can be present or absent independent of
  277. * the presence / absence of other TLVs.
  278. *
  279. * The HTT option selection TLVs use the following format:
  280. * |31 16|15 8|7 0|
  281. * |---------------------------------+----------------+----------------|
  282. * | value (payload) | length | tag |
  283. * |-------------------------------------------------------------------|
  284. * The value portion need not be only 2 bytes; it can be extended by any
  285. * integer number of 4-byte units. The total length of the TLV, including
  286. * the tag and length fields, must be a multiple of 4 bytes. The length
  287. * field specifies the total TLV size in 4-byte units. Thus, the typical
  288. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  289. * field, would store 0x1 in its length field, to show that the TLV occupies
  290. * a single 4-byte unit.
  291. */
  292. /*--- TLV header format - applies to all HTT option TLVs ---*/
  293. enum HTT_OPTION_TLV_TAGS {
  294. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  295. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  296. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  297. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  298. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  299. };
  300. PREPACK struct htt_option_tlv_header_t {
  301. A_UINT8 tag;
  302. A_UINT8 length;
  303. } POSTPACK;
  304. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  305. #define HTT_OPTION_TLV_TAG_S 0
  306. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  307. #define HTT_OPTION_TLV_LENGTH_S 8
  308. /*
  309. * value0 - 16 bit value field stored in word0
  310. * The TLV's value field may be longer than 2 bytes, in which case
  311. * the remainder of the value is stored in word1, word2, etc.
  312. */
  313. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  314. #define HTT_OPTION_TLV_VALUE0_S 16
  315. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  316. do { \
  317. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  318. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  319. } while (0)
  320. #define HTT_OPTION_TLV_TAG_GET(word) \
  321. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  322. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  323. do { \
  324. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  325. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  326. } while (0)
  327. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  328. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  329. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  330. do { \
  331. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  332. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  333. } while (0)
  334. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  335. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  336. /*--- format of specific HTT option TLVs ---*/
  337. /*
  338. * HTT option TLV for specifying LL bus address size
  339. * Some chips require bus addresses used by the target to access buffers
  340. * within the host's memory to be 32 bits; others require bus addresses
  341. * used by the target to access buffers within the host's memory to be
  342. * 64 bits.
  343. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  344. * a suffix to the VERSION_CONF message to specify which bus address format
  345. * the target requires.
  346. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  347. * default to providing bus addresses to the target in 32-bit format.
  348. */
  349. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  350. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  351. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  352. };
  353. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  354. struct htt_option_tlv_header_t hdr;
  355. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  356. } POSTPACK;
  357. /*
  358. * HTT option TLV for specifying whether HL systems should indicate
  359. * over-the-air tx completion for individual frames, or should instead
  360. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  361. * requests an OTA tx completion for a particular tx frame.
  362. * This option does not apply to LL systems, where the TX_COMPL_IND
  363. * is mandatory.
  364. * This option is primarily intended for HL systems in which the tx frame
  365. * downloads over the host --> target bus are as slow as or slower than
  366. * the transmissions over the WLAN PHY. For cases where the bus is faster
  367. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  368. * and consquently will send one TX_COMPL_IND message that covers several
  369. * tx frames. For cases where the WLAN PHY is faster than the bus,
  370. * the target will end up transmitting very short A-MPDUs, and consequently
  371. * sending many TX_COMPL_IND messages, which each cover a very small number
  372. * of tx frames.
  373. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  374. * a suffix to the VERSION_REQ message to request whether the host desires to
  375. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  376. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  377. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  378. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  379. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  380. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  381. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  382. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  383. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  384. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  385. * TLV.
  386. */
  387. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  388. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  389. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  390. };
  391. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  392. struct htt_option_tlv_header_t hdr;
  393. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  394. } POSTPACK;
  395. /*
  396. * HTT option TLV for specifying how many tx queue groups the target
  397. * may establish.
  398. * This TLV specifies the maximum value the target may send in the
  399. * txq_group_id field of any TXQ_GROUP information elements sent by
  400. * the target to the host. This allows the host to pre-allocate an
  401. * appropriate number of tx queue group structs.
  402. *
  403. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  404. * a suffix to the VERSION_REQ message to specify whether the host supports
  405. * tx queue groups at all, and if so if there is any limit on the number of
  406. * tx queue groups that the host supports.
  407. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  408. * a suffix to the VERSION_CONF message. If the host has specified in the
  409. * VER_REQ message a limit on the number of tx queue groups the host can
  410. * supprt, the target shall limit its specification of the maximum tx groups
  411. * to be no larger than this host-specified limit.
  412. *
  413. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  414. * shall preallocate 4 tx queue group structs, and the target shall not
  415. * specify a txq_group_id larger than 3.
  416. */
  417. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  418. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  419. /*
  420. * values 1 through N specify the max number of tx queue groups
  421. * the sender supports
  422. */
  423. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  424. };
  425. /* TEMPORARY backwards-compatibility alias for a typo fix -
  426. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  427. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  428. * to support the old name (with the typo) until all references to the
  429. * old name are replaced with the new name.
  430. */
  431. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  432. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  433. struct htt_option_tlv_header_t hdr;
  434. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  435. } POSTPACK;
  436. /*
  437. * HTT option TLV for specifying whether the target supports an extended
  438. * version of the HTT tx descriptor. If the target provides this TLV
  439. * and specifies in the TLV that the target supports an extended version
  440. * of the HTT tx descriptor, the target must check the "extension" bit in
  441. * the HTT tx descriptor, and if the extension bit is set, to expect a
  442. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  443. * descriptor. Furthermore, the target must provide room for the HTT
  444. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  445. * This option is intended for systems where the host needs to explicitly
  446. * control the transmission parameters such as tx power for individual
  447. * tx frames.
  448. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  449. * as a suffix to the VERSION_CONF message to explicitly specify whether
  450. * the target supports the HTT tx MSDU extension descriptor.
  451. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  452. * by the host as lack of target support for the HTT tx MSDU extension
  453. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  454. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  455. * the HTT tx MSDU extension descriptor.
  456. * The host is not required to provide the HTT tx MSDU extension descriptor
  457. * just because the target supports it; the target must check the
  458. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  459. * extension descriptor is present.
  460. */
  461. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  462. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  463. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  464. };
  465. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  466. struct htt_option_tlv_header_t hdr;
  467. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  468. } POSTPACK;
  469. /*=== host -> target messages ===============================================*/
  470. enum htt_h2t_msg_type {
  471. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  472. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  473. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  474. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  475. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  476. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  477. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  478. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  479. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  480. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  481. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  482. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  483. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  484. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  485. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  486. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  487. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  488. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  489. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  490. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  491. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  492. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  493. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  494. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  495. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  496. /* keep this last */
  497. HTT_H2T_NUM_MSGS
  498. };
  499. /*
  500. * HTT host to target message type -
  501. * stored in bits 7:0 of the first word of the message
  502. */
  503. #define HTT_H2T_MSG_TYPE_M 0xff
  504. #define HTT_H2T_MSG_TYPE_S 0
  505. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  506. do { \
  507. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  508. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  509. } while (0)
  510. #define HTT_H2T_MSG_TYPE_GET(word) \
  511. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  512. /**
  513. * @brief host -> target version number request message definition
  514. *
  515. * |31 24|23 16|15 8|7 0|
  516. * |----------------+----------------+----------------+----------------|
  517. * | reserved | msg type |
  518. * |-------------------------------------------------------------------|
  519. * : option request TLV (optional) |
  520. * :...................................................................:
  521. *
  522. * The VER_REQ message may consist of a single 4-byte word, or may be
  523. * extended with TLVs that specify which HTT options the host is requesting
  524. * from the target.
  525. * The following option TLVs may be appended to the VER_REQ message:
  526. * - HL_SUPPRESS_TX_COMPL_IND
  527. * - HL_MAX_TX_QUEUE_GROUPS
  528. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  529. * may be appended to the VER_REQ message (but only one TLV of each type).
  530. *
  531. * Header fields:
  532. * - MSG_TYPE
  533. * Bits 7:0
  534. * Purpose: identifies this as a version number request message
  535. * Value: 0x0
  536. */
  537. #define HTT_VER_REQ_BYTES 4
  538. /* TBDXXX: figure out a reasonable number */
  539. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  540. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  541. /**
  542. * @brief HTT tx MSDU descriptor
  543. *
  544. * @details
  545. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  546. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  547. * the target firmware needs for the FW's tx processing, particularly
  548. * for creating the HW msdu descriptor.
  549. * The same HTT tx descriptor is used for HL and LL systems, though
  550. * a few fields within the tx descriptor are used only by LL or
  551. * only by HL.
  552. * The HTT tx descriptor is defined in two manners: by a struct with
  553. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  554. * definitions.
  555. * The target should use the struct def, for simplicitly and clarity,
  556. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  557. * neutral. Specifically, the host shall use the get/set macros built
  558. * around the mask + shift defs.
  559. */
  560. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  561. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  562. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  563. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  564. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  565. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  566. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  567. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  568. #define HTT_TX_VDEV_ID_WORD 0
  569. #define HTT_TX_VDEV_ID_MASK 0x3f
  570. #define HTT_TX_VDEV_ID_SHIFT 16
  571. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  572. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  573. #define HTT_TX_MSDU_LEN_DWORD 1
  574. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  575. /*
  576. * HTT_VAR_PADDR macros
  577. * Allow physical / bus addresses to be either a single 32-bit value,
  578. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  579. */
  580. #define HTT_VAR_PADDR32(var_name) \
  581. A_UINT32 var_name
  582. #define HTT_VAR_PADDR64_LE(var_name) \
  583. struct { \
  584. /* little-endian: lo precedes hi */ \
  585. A_UINT32 lo; \
  586. A_UINT32 hi; \
  587. } var_name
  588. /*
  589. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  590. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  591. * addresses are stored in a XXX-bit field.
  592. * This macro is used to define both htt_tx_msdu_desc32_t and
  593. * htt_tx_msdu_desc64_t structs.
  594. */
  595. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  596. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  597. { \
  598. /* DWORD 0: flags and meta-data */ \
  599. A_UINT32 \
  600. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  601. \
  602. /* pkt_subtype - \
  603. * Detailed specification of the tx frame contents, extending the \
  604. * general specification provided by pkt_type. \
  605. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  606. * pkt_type | pkt_subtype \
  607. * ============================================================== \
  608. * 802.3 | bit 0:3 - Reserved \
  609. * | bit 4: 0x0 - Copy-Engine Classification Results \
  610. * | not appended to the HTT message \
  611. * | 0x1 - Copy-Engine Classification Results \
  612. * | appended to the HTT message in the \
  613. * | format: \
  614. * | [HTT tx desc, frame header, \
  615. * | CE classification results] \
  616. * | The CE classification results begin \
  617. * | at the next 4-byte boundary after \
  618. * | the frame header. \
  619. * ------------+------------------------------------------------- \
  620. * Eth2 | bit 0:3 - Reserved \
  621. * | bit 4: 0x0 - Copy-Engine Classification Results \
  622. * | not appended to the HTT message \
  623. * | 0x1 - Copy-Engine Classification Results \
  624. * | appended to the HTT message. \
  625. * | See the above specification of the \
  626. * | CE classification results location. \
  627. * ------------+------------------------------------------------- \
  628. * native WiFi | bit 0:3 - Reserved \
  629. * | bit 4: 0x0 - Copy-Engine Classification Results \
  630. * | not appended to the HTT message \
  631. * | 0x1 - Copy-Engine Classification Results \
  632. * | appended to the HTT message. \
  633. * | See the above specification of the \
  634. * | CE classification results location. \
  635. * ------------+------------------------------------------------- \
  636. * mgmt | 0x0 - 802.11 MAC header absent \
  637. * | 0x1 - 802.11 MAC header present \
  638. * ------------+------------------------------------------------- \
  639. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  640. * | 0x1 - 802.11 MAC header present \
  641. * | bit 1: 0x0 - allow aggregation \
  642. * | 0x1 - don't allow aggregation \
  643. * | bit 2: 0x0 - perform encryption \
  644. * | 0x1 - don't perform encryption \
  645. * | bit 3: 0x0 - perform tx classification / queuing \
  646. * | 0x1 - don't perform tx classification; \
  647. * | insert the frame into the "misc" \
  648. * | tx queue \
  649. * | bit 4: 0x0 - Copy-Engine Classification Results \
  650. * | not appended to the HTT message \
  651. * | 0x1 - Copy-Engine Classification Results \
  652. * | appended to the HTT message. \
  653. * | See the above specification of the \
  654. * | CE classification results location. \
  655. */ \
  656. pkt_subtype: 5, \
  657. \
  658. /* pkt_type - \
  659. * General specification of the tx frame contents. \
  660. * The htt_pkt_type enum should be used to specify and check the \
  661. * value of this field. \
  662. */ \
  663. pkt_type: 3, \
  664. \
  665. /* vdev_id - \
  666. * ID for the vdev that is sending this tx frame. \
  667. * For certain non-standard packet types, e.g. pkt_type == raw \
  668. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  669. * This field is used primarily for determining where to queue \
  670. * broadcast and multicast frames. \
  671. */ \
  672. vdev_id: 6, \
  673. /* ext_tid - \
  674. * The extended traffic ID. \
  675. * If the TID is unknown, the extended TID is set to \
  676. * HTT_TX_EXT_TID_INVALID. \
  677. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  678. * value of the QoS TID. \
  679. * If the tx frame is non-QoS data, then the extended TID is set to \
  680. * HTT_TX_EXT_TID_NON_QOS. \
  681. * If the tx frame is multicast or broadcast, then the extended TID \
  682. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  683. */ \
  684. ext_tid: 5, \
  685. \
  686. /* postponed - \
  687. * This flag indicates whether the tx frame has been downloaded to \
  688. * the target before but discarded by the target, and now is being \
  689. * downloaded again; or if this is a new frame that is being \
  690. * downloaded for the first time. \
  691. * This flag allows the target to determine the correct order for \
  692. * transmitting new vs. old frames. \
  693. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  694. * This flag only applies to HL systems, since in LL systems, \
  695. * the tx flow control is handled entirely within the target. \
  696. */ \
  697. postponed: 1, \
  698. \
  699. /* extension - \
  700. * This flag indicates whether a HTT tx MSDU extension descriptor \
  701. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  702. * \
  703. * 0x0 - no extension MSDU descriptor is present \
  704. * 0x1 - an extension MSDU descriptor immediately follows the \
  705. * regular MSDU descriptor \
  706. */ \
  707. extension: 1, \
  708. \
  709. /* cksum_offload - \
  710. * This flag indicates whether checksum offload is enabled or not \
  711. * for this frame. Target FW use this flag to turn on HW checksumming \
  712. * 0x0 - No checksum offload \
  713. * 0x1 - L3 header checksum only \
  714. * 0x2 - L4 checksum only \
  715. * 0x3 - L3 header checksum + L4 checksum \
  716. */ \
  717. cksum_offload: 2, \
  718. \
  719. /* tx_comp_req - \
  720. * This flag indicates whether Tx Completion \
  721. * from fw is required or not. \
  722. * This flag is only relevant if tx completion is not \
  723. * universally enabled. \
  724. * For all LL systems, tx completion is mandatory, \
  725. * so this flag will be irrelevant. \
  726. * For HL systems tx completion is optional, but HL systems in which \
  727. * the bus throughput exceeds the WLAN throughput will \
  728. * probably want to always use tx completion, and thus \
  729. * would not check this flag. \
  730. * This flag is required when tx completions are not used universally, \
  731. * but are still required for certain tx frames for which \
  732. * an OTA delivery acknowledgment is needed by the host. \
  733. * In practice, this would be for HL systems in which the \
  734. * bus throughput is less than the WLAN throughput. \
  735. * \
  736. * 0x0 - Tx Completion Indication from Fw not required \
  737. * 0x1 - Tx Completion Indication from Fw is required \
  738. */ \
  739. tx_compl_req: 1; \
  740. \
  741. \
  742. /* DWORD 1: MSDU length and ID */ \
  743. A_UINT32 \
  744. len: 16, /* MSDU length, in bytes */ \
  745. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  746. * and this id is used to calculate fragmentation \
  747. * descriptor pointer inside the target based on \
  748. * the base address, configured inside the target. \
  749. */ \
  750. \
  751. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  752. /* frags_desc_ptr - \
  753. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  754. * where the tx frame's fragments reside in memory. \
  755. * This field only applies to LL systems, since in HL systems the \
  756. * (degenerate single-fragment) fragmentation descriptor is created \
  757. * within the target. \
  758. */ \
  759. _paddr__frags_desc_ptr_; \
  760. \
  761. /* DWORD 3 (or 4): peerid, chanfreq */ \
  762. /* \
  763. * Peer ID : Target can use this value to know which peer-id packet \
  764. * destined to. \
  765. * It's intended to be specified by host in case of NAWDS. \
  766. */ \
  767. A_UINT16 peerid; \
  768. \
  769. /* \
  770. * Channel frequency: This identifies the desired channel \
  771. * frequency (in mhz) for tx frames. This is used by FW to help \
  772. * determine when it is safe to transmit or drop frames for \
  773. * off-channel operation. \
  774. * The default value of zero indicates to FW that the corresponding \
  775. * VDEV's home channel (if there is one) is the desired channel \
  776. * frequency. \
  777. */ \
  778. A_UINT16 chanfreq; \
  779. \
  780. /* Reason reserved is commented is increasing the htt structure size \
  781. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  782. * A_UINT32 reserved_dword3_bits0_31; \
  783. */ \
  784. } POSTPACK
  785. /* define a htt_tx_msdu_desc32_t type */
  786. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  787. /* define a htt_tx_msdu_desc64_t type */
  788. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  789. /*
  790. * Make htt_tx_msdu_desc_t be an alias for either
  791. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  792. */
  793. #if HTT_PADDR64
  794. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  795. #else
  796. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  797. #endif
  798. /* decriptor information for Management frame*/
  799. /*
  800. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  801. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  802. */
  803. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  804. extern A_UINT32 mgmt_hdr_len;
  805. PREPACK struct htt_mgmt_tx_desc_t {
  806. A_UINT32 msg_type;
  807. #if HTT_PADDR64
  808. A_UINT64 frag_paddr; /* DMAble address of the data */
  809. #else
  810. A_UINT32 frag_paddr; /* DMAble address of the data */
  811. #endif
  812. A_UINT32 desc_id; /* returned to host during completion
  813. * to free the meory*/
  814. A_UINT32 len; /* Fragment length */
  815. A_UINT32 vdev_id; /* virtual device ID*/
  816. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  817. } POSTPACK;
  818. PREPACK struct htt_mgmt_tx_compl_ind {
  819. A_UINT32 desc_id;
  820. A_UINT32 status;
  821. } POSTPACK;
  822. /*
  823. * This SDU header size comes from the summation of the following:
  824. * 1. Max of:
  825. * a. Native WiFi header, for native WiFi frames: 24 bytes
  826. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  827. * b. 802.11 header, for raw frames: 36 bytes
  828. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  829. * QoS header, HT header)
  830. * c. 802.3 header, for ethernet frames: 14 bytes
  831. * (destination address, source address, ethertype / length)
  832. * 2. Max of:
  833. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  834. * b. IPv6 header, up through the Traffic Class: 2 bytes
  835. * 3. 802.1Q VLAN header: 4 bytes
  836. * 4. LLC/SNAP header: 8 bytes
  837. */
  838. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  839. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  840. #define HTT_TX_HDR_SIZE_ETHERNET 14
  841. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  842. A_COMPILE_TIME_ASSERT(
  843. htt_encap_hdr_size_max_check_nwifi,
  844. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  845. A_COMPILE_TIME_ASSERT(
  846. htt_encap_hdr_size_max_check_enet,
  847. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  848. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  849. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  850. #define HTT_TX_HDR_SIZE_802_1Q 4
  851. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  852. #define HTT_COMMON_TX_FRM_HDR_LEN \
  853. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  854. HTT_TX_HDR_SIZE_802_1Q + \
  855. HTT_TX_HDR_SIZE_LLC_SNAP)
  856. #define HTT_HL_TX_FRM_HDR_LEN \
  857. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  858. #define HTT_LL_TX_FRM_HDR_LEN \
  859. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  860. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  861. /* dword 0 */
  862. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  863. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  864. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  865. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  866. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  867. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  869. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  870. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  873. #define HTT_TX_DESC_PKT_TYPE_S 13
  874. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  875. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  877. #define HTT_TX_DESC_VDEV_ID_S 16
  878. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  879. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  881. #define HTT_TX_DESC_EXT_TID_S 22
  882. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  885. #define HTT_TX_DESC_POSTPONED_S 27
  886. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  887. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  888. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  889. #define HTT_TX_DESC_EXTENSION_S 28
  890. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  891. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  892. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  893. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  894. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  895. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  896. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  897. #define HTT_TX_DESC_TX_COMP_S 31
  898. /* dword 1 */
  899. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  900. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  901. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  902. #define HTT_TX_DESC_FRM_LEN_S 0
  903. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  904. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  905. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  906. #define HTT_TX_DESC_FRM_ID_S 16
  907. /* dword 2 */
  908. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  909. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  910. /* for systems using 64-bit format for bus addresses */
  911. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  913. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  914. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  915. /* for systems using 32-bit format for bus addresses */
  916. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  917. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  918. /* dword 3 */
  919. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  920. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  921. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  922. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  923. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  924. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  925. #if HTT_PADDR64
  926. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  928. #else
  929. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  931. #endif
  932. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  933. #define HTT_TX_DESC_PEER_ID_S 0
  934. /*
  935. * TEMPORARY:
  936. * The original definitions for the PEER_ID fields contained typos
  937. * (with _DESC_PADDR appended to this PEER_ID field name).
  938. * Retain deprecated original names for PEER_ID fields until all code that
  939. * refers to them has been updated.
  940. */
  941. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  942. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  943. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  944. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  945. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  946. HTT_TX_DESC_PEER_ID_M
  947. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  948. HTT_TX_DESC_PEER_ID_S
  949. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  950. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  951. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  952. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  953. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  954. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  955. #if HTT_PADDR64
  956. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  958. #else
  959. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  961. #endif
  962. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  963. #define HTT_TX_DESC_CHAN_FREQ_S 16
  964. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  965. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  966. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  967. do { \
  968. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  969. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  970. } while (0)
  971. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  972. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  973. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  976. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  977. } while (0)
  978. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  979. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  980. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  981. do { \
  982. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  983. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  984. } while (0)
  985. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  986. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  987. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  988. do { \
  989. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  990. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  991. } while (0)
  992. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  993. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  994. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1001. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1008. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1015. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1019. } while (0)
  1020. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1021. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1022. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1023. do { \
  1024. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1025. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1026. } while (0)
  1027. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1028. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1029. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1030. do { \
  1031. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1032. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1033. } while (0)
  1034. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1035. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1036. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1037. do { \
  1038. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1039. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1040. } while (0)
  1041. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1042. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1043. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1044. do { \
  1045. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1046. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1047. } while (0)
  1048. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1049. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1050. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1051. do { \
  1052. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1053. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1054. } while (0)
  1055. /* enums used in the HTT tx MSDU extension descriptor */
  1056. enum {
  1057. htt_tx_guard_interval_regular = 0,
  1058. htt_tx_guard_interval_short = 1,
  1059. };
  1060. enum {
  1061. htt_tx_preamble_type_ofdm = 0,
  1062. htt_tx_preamble_type_cck = 1,
  1063. htt_tx_preamble_type_ht = 2,
  1064. htt_tx_preamble_type_vht = 3,
  1065. };
  1066. enum {
  1067. htt_tx_bandwidth_5MHz = 0,
  1068. htt_tx_bandwidth_10MHz = 1,
  1069. htt_tx_bandwidth_20MHz = 2,
  1070. htt_tx_bandwidth_40MHz = 3,
  1071. htt_tx_bandwidth_80MHz = 4,
  1072. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1073. };
  1074. /**
  1075. * @brief HTT tx MSDU extension descriptor
  1076. * @details
  1077. * If the target supports HTT tx MSDU extension descriptors, the host has
  1078. * the option of appending the following struct following the regular
  1079. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1080. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1081. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1082. * tx specs for each frame.
  1083. */
  1084. PREPACK struct htt_tx_msdu_desc_ext_t {
  1085. /* DWORD 0: flags */
  1086. A_UINT32
  1087. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1088. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1089. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1090. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1091. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1092. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1093. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1094. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1095. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1096. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1097. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1098. /* DWORD 1: tx power, tx rate, tx BW */
  1099. A_UINT32
  1100. /* pwr -
  1101. * Specify what power the tx frame needs to be transmitted at.
  1102. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1103. * The value needs to be appropriately sign-extended when extracting
  1104. * the value from the message and storing it in a variable that is
  1105. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1106. * automatically handles this sign-extension.)
  1107. * If the transmission uses multiple tx chains, this power spec is
  1108. * the total transmit power, assuming incoherent combination of
  1109. * per-chain power to produce the total power.
  1110. */
  1111. pwr: 8,
  1112. /* mcs_mask -
  1113. * Specify the allowable values for MCS index (modulation and coding)
  1114. * to use for transmitting the frame.
  1115. *
  1116. * For HT / VHT preamble types, this mask directly corresponds to
  1117. * the HT or VHT MCS indices that are allowed. For each bit N set
  1118. * within the mask, MCS index N is allowed for transmitting the frame.
  1119. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1120. * rates versus OFDM rates, so the host has the option of specifying
  1121. * that the target must transmit the frame with CCK or OFDM rates
  1122. * (not HT or VHT), but leaving the decision to the target whether
  1123. * to use CCK or OFDM.
  1124. *
  1125. * For CCK and OFDM, the bits within this mask are interpreted as
  1126. * follows:
  1127. * bit 0 -> CCK 1 Mbps rate is allowed
  1128. * bit 1 -> CCK 2 Mbps rate is allowed
  1129. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1130. * bit 3 -> CCK 11 Mbps rate is allowed
  1131. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1132. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1133. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1134. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1135. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1136. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1137. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1138. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1139. *
  1140. * The MCS index specification needs to be compatible with the
  1141. * bandwidth mask specification. For example, a MCS index == 9
  1142. * specification is inconsistent with a preamble type == VHT,
  1143. * Nss == 1, and channel bandwidth == 20 MHz.
  1144. *
  1145. * Furthermore, the host has only a limited ability to specify to
  1146. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1147. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1148. */
  1149. mcs_mask: 12,
  1150. /* nss_mask -
  1151. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1152. * Each bit in this mask corresponds to a Nss value:
  1153. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1154. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1155. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1156. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1157. * The values in the Nss mask must be suitable for the recipient, e.g.
  1158. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1159. * recipient which only supports 2x2 MIMO.
  1160. */
  1161. nss_mask: 4,
  1162. /* guard_interval -
  1163. * Specify a htt_tx_guard_interval enum value to indicate whether
  1164. * the transmission should use a regular guard interval or a
  1165. * short guard interval.
  1166. */
  1167. guard_interval: 1,
  1168. /* preamble_type_mask -
  1169. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1170. * may choose from for transmitting this frame.
  1171. * The bits in this mask correspond to the values in the
  1172. * htt_tx_preamble_type enum. For example, to allow the target
  1173. * to transmit the frame as either CCK or OFDM, this field would
  1174. * be set to
  1175. * (1 << htt_tx_preamble_type_ofdm) |
  1176. * (1 << htt_tx_preamble_type_cck)
  1177. */
  1178. preamble_type_mask: 4,
  1179. reserved1_31_29: 3; /* unused, set to 0x0 */
  1180. /* DWORD 2: tx chain mask, tx retries */
  1181. A_UINT32
  1182. /* chain_mask - specify which chains to transmit from */
  1183. chain_mask: 4,
  1184. /* retry_limit -
  1185. * Specify the maximum number of transmissions, including the
  1186. * initial transmission, to attempt before giving up if no ack
  1187. * is received.
  1188. * If the tx rate is specified, then all retries shall use the
  1189. * same rate as the initial transmission.
  1190. * If no tx rate is specified, the target can choose whether to
  1191. * retain the original rate during the retransmissions, or to
  1192. * fall back to a more robust rate.
  1193. */
  1194. retry_limit: 4,
  1195. /* bandwidth_mask -
  1196. * Specify what channel widths may be used for the transmission.
  1197. * A value of zero indicates "don't care" - the target may choose
  1198. * the transmission bandwidth.
  1199. * The bits within this mask correspond to the htt_tx_bandwidth
  1200. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1201. * The bandwidth_mask must be consistent with the preamble_type_mask
  1202. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1203. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1204. */
  1205. bandwidth_mask: 6,
  1206. reserved2_31_14: 18; /* unused, set to 0x0 */
  1207. /* DWORD 3: tx expiry time (TSF) LSBs */
  1208. A_UINT32 expire_tsf_lo;
  1209. /* DWORD 4: tx expiry time (TSF) MSBs */
  1210. A_UINT32 expire_tsf_hi;
  1211. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1212. } POSTPACK;
  1213. /* DWORD 0 */
  1214. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1215. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1216. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1217. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1234. /* DWORD 1 */
  1235. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1236. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1237. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1238. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1239. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1240. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1241. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1242. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1243. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1244. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1245. /* DWORD 2 */
  1246. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1247. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1248. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1249. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1250. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1251. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1252. /* DWORD 0 */
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1254. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1255. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1259. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1260. } while (0)
  1261. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1262. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1263. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1268. } while (0)
  1269. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1270. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1271. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL( \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1276. ((_var) |= ((_val) \
  1277. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1278. } while (0)
  1279. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1280. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1281. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1282. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL( \
  1285. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1286. ((_var) |= ((_val) \
  1287. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1288. } while (0)
  1289. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1290. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1291. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1292. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1296. } while (0)
  1297. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1304. } while (0)
  1305. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1306. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1307. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1308. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1312. } while (0)
  1313. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1314. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1315. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1320. } while (0)
  1321. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1322. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1323. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1324. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1328. } while (0)
  1329. /* DWORD 1 */
  1330. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1331. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1332. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1333. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1334. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1335. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1336. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1337. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1338. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1339. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1340. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1341. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1342. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1343. do { \
  1344. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1345. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1346. } while (0)
  1347. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1348. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1349. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1350. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1353. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1354. } while (0)
  1355. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1356. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1357. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1358. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1359. do { \
  1360. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1361. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1362. } while (0)
  1363. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1364. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1365. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1366. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1367. do { \
  1368. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1369. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1370. } while (0)
  1371. /* DWORD 2 */
  1372. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1373. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1374. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1375. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1376. do { \
  1377. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1378. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1379. } while (0)
  1380. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1381. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1382. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1383. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1384. do { \
  1385. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1386. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1387. } while (0)
  1388. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1389. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1390. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1391. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1392. do { \
  1393. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1394. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1395. } while (0)
  1396. typedef enum {
  1397. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1398. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1399. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1400. } htt_11ax_ltf_subtype_t;
  1401. typedef enum {
  1402. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1403. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1404. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1405. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1406. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1407. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1408. } htt_tx_ext2_preamble_type_t;
  1409. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1410. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1411. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1412. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1421. /**
  1422. * @brief HTT tx MSDU extension descriptor v2
  1423. * @details
  1424. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1425. * is received as tcl_exit_base->host_meta_info in firmware.
  1426. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1427. * are already part of tcl_exit_base.
  1428. */
  1429. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1430. /* DWORD 0: flags */
  1431. A_UINT32
  1432. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1433. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1434. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1435. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1436. valid_retries : 1, /* if set, tx retries spec is valid */
  1437. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1438. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1439. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1440. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1441. valid_key_flags : 1, /* if set, key flags is valid */
  1442. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1443. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1444. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1445. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1446. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1447. 1 = ENCRYPT,
  1448. 2 ~ 3 - Reserved */
  1449. /* retry_limit -
  1450. * Specify the maximum number of transmissions, including the
  1451. * initial transmission, to attempt before giving up if no ack
  1452. * is received.
  1453. * If the tx rate is specified, then all retries shall use the
  1454. * same rate as the initial transmission.
  1455. * If no tx rate is specified, the target can choose whether to
  1456. * retain the original rate during the retransmissions, or to
  1457. * fall back to a more robust rate.
  1458. */
  1459. retry_limit : 4,
  1460. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1461. * Valid only for 11ax preamble types HE_SU
  1462. * and HE_EXT_SU
  1463. */
  1464. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1465. * Valid only for 11ax preamble types HE_SU
  1466. * and HE_EXT_SU
  1467. */
  1468. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1469. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1470. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1471. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1472. */
  1473. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1474. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1475. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1476. * Use cases:
  1477. * Any time firmware uses TQM-BYPASS for Data
  1478. * TID, firmware expect host to set this bit.
  1479. */
  1480. /* DWORD 1: tx power, tx rate */
  1481. A_UINT32
  1482. power : 8, /* unit of the power field is 0.5 dbm
  1483. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1484. * signed value ranging from -64dbm to 63.5 dbm
  1485. */
  1486. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1487. * Setting more than one MCS isn't currently
  1488. * supported by the target (but is supported
  1489. * in the interface in case in the future
  1490. * the target supports specifications of
  1491. * a limited set of MCS values.
  1492. */
  1493. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1494. * Setting more than one Nss isn't currently
  1495. * supported by the target (but is supported
  1496. * in the interface in case in the future
  1497. * the target supports specifications of
  1498. * a limited set of Nss values.
  1499. */
  1500. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1501. update_peer_cache : 1; /* When set these custom values will be
  1502. * used for all packets, until the next
  1503. * update via this ext header.
  1504. * This is to make sure not all packets
  1505. * need to include this header.
  1506. */
  1507. /* DWORD 2: tx chain mask, tx retries */
  1508. A_UINT32
  1509. /* chain_mask - specify which chains to transmit from */
  1510. chain_mask : 8,
  1511. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1512. * TODO: Update Enum values for key_flags
  1513. */
  1514. /*
  1515. * Channel frequency: This identifies the desired channel
  1516. * frequency (in MHz) for tx frames. This is used by FW to help
  1517. * determine when it is safe to transmit or drop frames for
  1518. * off-channel operation.
  1519. * The default value of zero indicates to FW that the corresponding
  1520. * VDEV's home channel (if there is one) is the desired channel
  1521. * frequency.
  1522. */
  1523. chanfreq : 16;
  1524. /* DWORD 3: tx expiry time (TSF) LSBs */
  1525. A_UINT32 expire_tsf_lo;
  1526. /* DWORD 4: tx expiry time (TSF) MSBs */
  1527. A_UINT32 expire_tsf_hi;
  1528. /* DWORD 5: flags to control routing / processing of the MSDU */
  1529. A_UINT32
  1530. /* learning_frame
  1531. * When this flag is set, this frame will be dropped by FW
  1532. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1533. */
  1534. learning_frame : 1,
  1535. /* send_as_standalone
  1536. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1537. * i.e. with no A-MSDU or A-MPDU aggregation.
  1538. * The scope is extended to other use-cases.
  1539. */
  1540. send_as_standalone : 1,
  1541. /* is_host_opaque_valid
  1542. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1543. * with valid information.
  1544. */
  1545. is_host_opaque_valid : 1,
  1546. rsvd0 : 29;
  1547. /* DWORD 6 : Host opaque cookie for special frames */
  1548. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1549. rsvd1 : 16;
  1550. /*
  1551. * This structure can be expanded further up to 40 bytes
  1552. * by adding further DWORDs as needed.
  1553. */
  1554. } POSTPACK;
  1555. /* DWORD 0 */
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1557. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1558. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1559. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1582. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1583. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1584. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1585. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1586. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1587. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1588. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1589. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1590. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1591. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1592. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1593. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1594. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1595. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1596. /* DWORD 1 */
  1597. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1598. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1599. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1600. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1601. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1602. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1603. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1604. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1605. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1606. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1607. /* DWORD 2 */
  1608. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1609. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1610. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1611. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1612. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1613. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1614. /* DWORD 5 */
  1615. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1616. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1617. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1618. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1621. /* DWORD 6 */
  1622. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1623. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1624. /* DWORD 0 */
  1625. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1626. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1627. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1628. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1629. do { \
  1630. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1631. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1632. } while (0)
  1633. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1635. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1636. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1651. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL( \
  1655. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1656. ((_var) |= ((_val) \
  1657. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1658. } while (0)
  1659. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1660. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1661. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1662. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1663. do { \
  1664. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1665. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1666. } while (0)
  1667. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1668. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1670. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1671. do { \
  1672. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1673. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1674. } while (0)
  1675. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1676. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1677. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1678. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1679. do { \
  1680. HTT_CHECK_SET_VAL( \
  1681. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1682. ((_var) |= ((_val) \
  1683. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1687. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1688. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1691. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1692. } while (0)
  1693. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1694. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1695. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1696. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1697. do { \
  1698. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1699. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1700. } while (0)
  1701. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1702. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1703. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1704. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1705. do { \
  1706. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1707. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1708. } while (0)
  1709. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1710. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1711. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1712. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1715. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1716. } while (0)
  1717. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1718. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1719. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1720. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1723. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1724. } while (0)
  1725. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1726. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1727. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1728. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1732. } while (0)
  1733. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1734. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1735. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1736. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1737. do { \
  1738. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1739. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1740. } while (0)
  1741. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1742. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1743. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1744. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1745. do { \
  1746. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1747. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1748. } while (0)
  1749. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1750. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1751. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1752. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1753. do { \
  1754. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1755. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1756. } while (0)
  1757. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1758. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1759. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1760. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1761. do { \
  1762. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1763. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1764. } while (0)
  1765. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1766. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1767. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1768. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1769. do { \
  1770. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1771. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1772. } while (0)
  1773. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1774. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1775. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1776. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1777. do { \
  1778. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1779. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1780. } while (0)
  1781. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1782. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1783. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1784. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1787. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1788. } while (0)
  1789. /* DWORD 1 */
  1790. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1791. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1792. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1793. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1794. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1795. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1796. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1797. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1798. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1799. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1800. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1801. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1802. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1803. do { \
  1804. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1805. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1806. } while (0)
  1807. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1808. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1809. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1810. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1811. do { \
  1812. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1813. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1814. } while (0)
  1815. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1816. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1817. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1818. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1819. do { \
  1820. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1821. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1822. } while (0)
  1823. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1824. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1825. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1826. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1827. do { \
  1828. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1829. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1830. } while (0)
  1831. /* DWORD 2 */
  1832. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1833. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1834. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1835. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1836. do { \
  1837. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1838. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1839. } while (0)
  1840. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1841. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1842. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1843. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1844. do { \
  1845. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1846. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1847. } while (0)
  1848. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1849. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1850. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1851. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1852. do { \
  1853. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1854. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1855. } while (0)
  1856. /* DWORD 5 */
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1858. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1859. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1861. do { \
  1862. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1863. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1864. } while (0)
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1866. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1867. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1869. do { \
  1870. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1871. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1872. } while (0)
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1874. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1875. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1877. do { \
  1878. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1879. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1880. } while (0)
  1881. /* DWORD 6 */
  1882. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1883. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1884. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1885. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1888. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1889. } while (0)
  1890. typedef enum {
  1891. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1892. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1893. } htt_tcl_metadata_type;
  1894. /**
  1895. * @brief HTT TCL command number format
  1896. * @details
  1897. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1898. * available to firmware as tcl_exit_base->tcl_status_number.
  1899. * For regular / multicast packets host will send vdev and mac id and for
  1900. * NAWDS packets, host will send peer id.
  1901. * A_UINT32 is used to avoid endianness conversion problems.
  1902. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1903. */
  1904. typedef struct {
  1905. A_UINT32
  1906. type: 1, /* vdev_id based or peer_id based */
  1907. rsvd: 31;
  1908. } htt_tx_tcl_vdev_or_peer_t;
  1909. typedef struct {
  1910. A_UINT32
  1911. type: 1, /* vdev_id based or peer_id based */
  1912. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1913. vdev_id: 8,
  1914. pdev_id: 2,
  1915. host_inspected:1,
  1916. rsvd: 19;
  1917. } htt_tx_tcl_vdev_metadata;
  1918. typedef struct {
  1919. A_UINT32
  1920. type: 1, /* vdev_id based or peer_id based */
  1921. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1922. peer_id: 14,
  1923. rsvd: 16;
  1924. } htt_tx_tcl_peer_metadata;
  1925. PREPACK struct htt_tx_tcl_metadata {
  1926. union {
  1927. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1928. htt_tx_tcl_vdev_metadata vdev_meta;
  1929. htt_tx_tcl_peer_metadata peer_meta;
  1930. };
  1931. } POSTPACK;
  1932. /* DWORD 0 */
  1933. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1934. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1935. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1936. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1937. /* VDEV metadata */
  1938. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1939. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1940. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1941. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1942. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1943. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1944. /* PEER metadata */
  1945. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1946. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1947. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1948. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1949. HTT_TX_TCL_METADATA_TYPE_S)
  1950. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1951. do { \
  1952. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1953. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1954. } while (0)
  1955. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1956. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1957. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1958. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1959. do { \
  1960. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1961. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1962. } while (0)
  1963. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1964. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1965. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1966. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1967. do { \
  1968. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1969. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1970. } while (0)
  1971. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1972. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1973. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1974. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1975. do { \
  1976. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1977. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1978. } while (0)
  1979. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1980. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1981. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1982. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1985. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1986. } while (0)
  1987. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1988. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1989. HTT_TX_TCL_METADATA_PEER_ID_S)
  1990. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1991. do { \
  1992. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1993. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1994. } while (0)
  1995. typedef enum {
  1996. HTT_TX_FW2WBM_TX_STATUS_OK,
  1997. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1998. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1999. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2000. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2001. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2002. HTT_TX_FW2WBM_TX_STATUS_MAX
  2003. } htt_tx_fw2wbm_tx_status_t;
  2004. typedef enum {
  2005. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2006. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2007. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2008. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2009. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2010. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2011. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2012. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2013. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2014. } htt_tx_fw2wbm_reinject_reason_t;
  2015. /**
  2016. * @brief HTT TX WBM Completion from firmware to host
  2017. * @details
  2018. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2019. * DWORD 3 and 4 for software based completions (Exception frames and
  2020. * TQM bypass frames)
  2021. * For software based completions, wbm_release_ring->release_source_module will
  2022. * be set to release_source_fw
  2023. */
  2024. PREPACK struct htt_tx_wbm_completion {
  2025. A_UINT32
  2026. sch_cmd_id: 24,
  2027. exception_frame: 1, /* If set, this packet was queued via exception path */
  2028. rsvd0_31_25: 7;
  2029. A_UINT32
  2030. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2031. * reception of an ACK or BA, this field indicates
  2032. * the RSSI of the received ACK or BA frame.
  2033. * When the frame is removed as result of a direct
  2034. * remove command from the SW, this field is set
  2035. * to 0x0 (which is never a valid value when real
  2036. * RSSI is available).
  2037. * Units: dB w.r.t noise floor
  2038. */
  2039. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2040. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2041. rsvd1_31_16: 16;
  2042. } POSTPACK;
  2043. /* DWORD 0 */
  2044. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2045. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2046. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2047. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2048. /* DWORD 1 */
  2049. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2050. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2051. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2052. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2053. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2054. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2055. /* DWORD 0 */
  2056. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2057. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2058. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2059. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2063. } while (0)
  2064. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2065. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2066. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2067. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2071. } while (0)
  2072. /* DWORD 1 */
  2073. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2074. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2075. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2076. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2080. } while (0)
  2081. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2082. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2083. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2084. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2085. do { \
  2086. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2087. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2088. } while (0)
  2089. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2090. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2091. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2092. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2095. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2096. } while (0)
  2097. /**
  2098. * @brief HTT TX WBM Completion from firmware to host
  2099. * @details
  2100. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2101. * (WBM) offload HW.
  2102. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2103. * For software based completions, release_source_module will
  2104. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2105. * struct wbm_release_ring and then switch to this after looking at
  2106. * release_source_module.
  2107. */
  2108. PREPACK struct htt_tx_wbm_completion_v2 {
  2109. A_UINT32
  2110. used_by_hw0; /* Refer to struct wbm_release_ring */
  2111. A_UINT32
  2112. used_by_hw1; /* Refer to struct wbm_release_ring */
  2113. A_UINT32
  2114. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2115. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2116. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2117. exception_frame: 1,
  2118. rsvd0: 12, /* For future use */
  2119. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2120. rsvd1: 1; /* For future use */
  2121. A_UINT32
  2122. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2123. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2124. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2125. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2126. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2127. */
  2128. A_UINT32
  2129. data1: 32;
  2130. A_UINT32
  2131. data2: 32;
  2132. A_UINT32
  2133. used_by_hw3; /* Refer to struct wbm_release_ring */
  2134. } POSTPACK;
  2135. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2136. /* DWORD 3 */
  2137. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2138. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2139. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2140. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2141. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2142. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2143. /* DWORD 3 */
  2144. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2145. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2146. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2147. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2148. do { \
  2149. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2150. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2151. } while (0)
  2152. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2153. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2154. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2155. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2159. } while (0)
  2160. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2161. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2162. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2163. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2167. } while (0)
  2168. /**
  2169. * @brief HTT TX WBM transmit status from firmware to host
  2170. * @details
  2171. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2172. * (WBM) offload HW.
  2173. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2174. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2175. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2176. */
  2177. PREPACK struct htt_tx_wbm_transmit_status {
  2178. A_UINT32
  2179. sch_cmd_id: 24,
  2180. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2181. * reception of an ACK or BA, this field indicates
  2182. * the RSSI of the received ACK or BA frame.
  2183. * When the frame is removed as result of a direct
  2184. * remove command from the SW, this field is set
  2185. * to 0x0 (which is never a valid value when real
  2186. * RSSI is available).
  2187. * Units: dB w.r.t noise floor
  2188. */
  2189. A_UINT32
  2190. sw_peer_id: 16,
  2191. tid_num: 5,
  2192. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2193. * and tid_num fields contain valid data.
  2194. * If this "valid" flag is not set, the
  2195. * sw_peer_id and tid_num fields must be ignored.
  2196. */
  2197. mcast: 1,
  2198. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2199. * contains valid data.
  2200. */
  2201. reserved0: 8;
  2202. A_UINT32
  2203. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2204. * packets in the wbm completion path
  2205. */
  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 | 11| 10|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 | mo| fp| rx_drop_threshold |
  4396. * | |ndp|ndp| |
  4397. * |-------------------------------------------------------------------|
  4398. * Where:
  4399. * PS = pkt_swap
  4400. * SS = status_swap
  4401. * OV = rx_offsets_valid
  4402. * DT = drop_thresh_valid
  4403. * The message is interpreted as follows:
  4404. * dword0 - b'0:7 - msg_type: This will be set to
  4405. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4406. * b'8:15 - pdev_id:
  4407. * 0 (for rings at SOC/UMAC level),
  4408. * 1/2/3 mac id (for rings at LMAC level)
  4409. * b'16:23 - ring_id : Identify the ring to configure.
  4410. * More details can be got from enum htt_srng_ring_id
  4411. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4412. * BUF_RING_CFG_0 defs within HW .h files,
  4413. * e.g. wmac_top_reg_seq_hwioreg.h
  4414. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4415. * BUF_RING_CFG_0 defs within HW .h files,
  4416. * e.g. wmac_top_reg_seq_hwioreg.h
  4417. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4418. * configuration fields are valid
  4419. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4420. * rx_drop_threshold field is valid
  4421. * b'28:31 - rsvd1: reserved for future use
  4422. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4423. * in byte units.
  4424. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4425. * - b'16:31 - rsvd2: Reserved for future use
  4426. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4427. * Enable MGMT packet from 0b0000 to 0b1001
  4428. * bits from low to high: FP, MD, MO - 3 bits
  4429. * FP: Filter_Pass
  4430. * MD: Monitor_Direct
  4431. * MO: Monitor_Other
  4432. * 10 mgmt subtypes * 3 bits -> 30 bits
  4433. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4434. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4435. * Enable MGMT packet from 0b1010 to 0b1111
  4436. * bits from low to high: FP, MD, MO - 3 bits
  4437. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4438. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4439. * Enable CTRL packet from 0b0000 to 0b1001
  4440. * bits from low to high: FP, MD, MO - 3 bits
  4441. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4442. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4443. * Enable CTRL packet from 0b1010 to 0b1111,
  4444. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4445. * bits from low to high: FP, MD, MO - 3 bits
  4446. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4447. * dword6 - b'0:31 - tlv_filter_in_flags:
  4448. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4449. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4450. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4451. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4452. * A value of 0 will be considered as ignore this config.
  4453. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4454. * e.g. wmac_top_reg_seq_hwioreg.h
  4455. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4456. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4457. * A value of 0 will be considered as ignore this config.
  4458. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4459. * e.g. wmac_top_reg_seq_hwioreg.h
  4460. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4461. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4462. * A value of 0 will be considered as ignore this config.
  4463. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4464. * e.g. wmac_top_reg_seq_hwioreg.h
  4465. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4466. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4467. * A value of 0 will be considered as ignore this config.
  4468. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4469. * e.g. wmac_top_reg_seq_hwioreg.h
  4470. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4471. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4472. * A value of 0 will be considered as ignore this config.
  4473. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4474. * e.g. wmac_top_reg_seq_hwioreg.h
  4475. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4476. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4477. * A value of 0 will be considered as ignore this config.
  4478. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4479. * e.g. wmac_top_reg_seq_hwioreg.h
  4480. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4481. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4482. * A value of 0 will be considered as ignore this config.
  4483. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4484. * e.g. wmac_top_reg_seq_hwioreg.h
  4485. * - b'16:31 - rsvd3 for future use
  4486. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4487. * to source rings. Consumer drops packets if the available
  4488. * words in the ring falls below the configured threshold
  4489. * value.
  4490. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4491. * by host. 1 -> subscribed
  4492. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4493. * by host. 1 -> subscribed
  4494. */
  4495. PREPACK struct htt_rx_ring_selection_cfg_t {
  4496. A_UINT32 msg_type: 8,
  4497. pdev_id: 8,
  4498. ring_id: 8,
  4499. status_swap: 1,
  4500. pkt_swap: 1,
  4501. rx_offsets_valid: 1,
  4502. drop_thresh_valid: 1,
  4503. rsvd1: 4;
  4504. A_UINT32 ring_buffer_size: 16,
  4505. rsvd2: 16;
  4506. A_UINT32 packet_type_enable_flags_0;
  4507. A_UINT32 packet_type_enable_flags_1;
  4508. A_UINT32 packet_type_enable_flags_2;
  4509. A_UINT32 packet_type_enable_flags_3;
  4510. A_UINT32 tlv_filter_in_flags;
  4511. A_UINT32 rx_packet_offset: 16,
  4512. rx_header_offset: 16;
  4513. A_UINT32 rx_mpdu_end_offset: 16,
  4514. rx_mpdu_start_offset: 16;
  4515. A_UINT32 rx_msdu_end_offset: 16,
  4516. rx_msdu_start_offset: 16;
  4517. A_UINT32 rx_attn_offset: 16,
  4518. rsvd3: 16;
  4519. A_UINT32 rx_drop_threshold: 10,
  4520. fp_ndp: 1,
  4521. mo_ndp: 1,
  4522. rsvd4: 20;
  4523. } POSTPACK;
  4524. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4525. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4526. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4527. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4528. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4529. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4530. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4531. do { \
  4532. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4533. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4534. } while (0)
  4535. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4536. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4537. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4538. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4539. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4540. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4541. do { \
  4542. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4543. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4544. } while (0)
  4545. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4546. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4547. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4548. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4549. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4550. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4551. do { \
  4552. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4553. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4554. } while (0)
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4557. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4558. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4559. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4560. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4561. do { \
  4562. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4563. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4564. } while (0)
  4565. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4566. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4567. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4568. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4569. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4570. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4571. do { \
  4572. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4573. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4574. } while (0)
  4575. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4576. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4577. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4578. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4579. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4580. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4581. do { \
  4582. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4583. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4584. } while (0)
  4585. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4586. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4587. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4588. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4589. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4590. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4591. do { \
  4592. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4593. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4594. } while (0)
  4595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4598. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4599. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4601. do { \
  4602. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4603. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4604. } while (0)
  4605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4608. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4609. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4611. do { \
  4612. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4613. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4614. } while (0)
  4615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4618. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4619. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4621. do { \
  4622. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4623. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4624. } while (0)
  4625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4628. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4629. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4631. do { \
  4632. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4633. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4634. } while (0)
  4635. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4636. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4637. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4638. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4639. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4640. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4641. do { \
  4642. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4643. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4644. } while (0)
  4645. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4646. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4647. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4648. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4649. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4650. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4651. do { \
  4652. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4653. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4654. } while (0)
  4655. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4656. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4657. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4658. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4659. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4660. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4661. do { \
  4662. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4663. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4664. } while (0)
  4665. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4666. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4667. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4668. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4669. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4670. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4671. do { \
  4672. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4673. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4674. } while (0)
  4675. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4676. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4677. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4678. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4679. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4680. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4681. do { \
  4682. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4683. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4684. } while (0)
  4685. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4686. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4687. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4688. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4689. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4690. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4691. do { \
  4692. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4693. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4694. } while (0)
  4695. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4696. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4697. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4698. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4699. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4700. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4701. do { \
  4702. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4703. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4704. } while (0)
  4705. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4706. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4707. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4708. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4709. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4710. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4711. do { \
  4712. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4713. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4714. } while (0)
  4715. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4716. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4717. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4718. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4719. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4720. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4721. do { \
  4722. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4723. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4724. } while (0)
  4725. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4726. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4727. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4728. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4729. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4730. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4731. do { \
  4732. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4733. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4734. } while (0)
  4735. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4736. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4737. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4738. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4739. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4740. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4741. do { \
  4742. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4743. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4744. } while (0)
  4745. /*
  4746. * Subtype based MGMT frames enable bits.
  4747. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4748. */
  4749. /* association request */
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4756. /* association response */
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4763. /* Reassociation request */
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4770. /* Reassociation response */
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4777. /* Probe request */
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4784. /* Probe response */
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4791. /* Timing Advertisement */
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4798. /* Reserved */
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4805. /* Beacon */
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4812. /* ATIM */
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4819. /* Disassociation */
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4826. /* Authentication */
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4833. /* Deauthentication */
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4840. /* Action */
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4847. /* Action No Ack */
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4854. /* Reserved */
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4861. /*
  4862. * Subtype based CTRL frames enable bits.
  4863. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4864. */
  4865. /* Reserved */
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4872. /* Reserved */
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4879. /* Reserved */
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4886. /* Reserved */
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4893. /* Reserved */
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4900. /* Reserved */
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4907. /* Reserved */
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4914. /* Control Wrapper */
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4921. /* Block Ack Request */
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4928. /* Block Ack*/
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4935. /* PS-POLL */
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4942. /* RTS */
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4949. /* CTS */
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4956. /* ACK */
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4963. /* CF-END */
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4970. /* CF-END + CF-ACK */
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4977. /* Multicast data */
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4984. /* Unicast data */
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4991. /* NULL data */
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4999. do { \
  5000. HTT_CHECK_SET_VAL(httsym, value); \
  5001. (word) |= (value) << httsym##_S; \
  5002. } while (0)
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5004. (((word) & httsym##_M) >> httsym##_S)
  5005. #define htt_rx_ring_pkt_enable_subtype_set( \
  5006. word, flag, mode, type, subtype, val) \
  5007. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5008. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5009. #define htt_rx_ring_pkt_enable_subtype_get( \
  5010. word, flag, mode, type, subtype) \
  5011. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5012. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5013. /* Definition to filter in TLVs */
  5014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5040. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5041. do { \
  5042. HTT_CHECK_SET_VAL(httsym, enable); \
  5043. (word) |= (enable) << httsym##_S; \
  5044. } while (0)
  5045. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5046. (((word) & httsym##_M) >> httsym##_S)
  5047. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5048. HTT_RX_RING_TLV_ENABLE_SET( \
  5049. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5050. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5051. HTT_RX_RING_TLV_ENABLE_GET( \
  5052. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5053. /**
  5054. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5055. * host --> target Receive Flow Steering configuration message definition.
  5056. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5057. * The reason for this is we want RFS to be configured and ready before MAC
  5058. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5059. *
  5060. * |31 24|23 16|15 9|8|7 0|
  5061. * |----------------+----------------+----------------+----------------|
  5062. * | reserved |E| msg type |
  5063. * |-------------------------------------------------------------------|
  5064. * Where E = RFS enable flag
  5065. *
  5066. * The RFS_CONFIG message consists of a single 4-byte word.
  5067. *
  5068. * Header fields:
  5069. * - MSG_TYPE
  5070. * Bits 7:0
  5071. * Purpose: identifies this as a RFS config msg
  5072. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5073. * - RFS_CONFIG
  5074. * Bit 8
  5075. * Purpose: Tells target whether to enable (1) or disable (0)
  5076. * flow steering feature when sending rx indication messages to host
  5077. */
  5078. #define HTT_H2T_RFS_CONFIG_M 0x100
  5079. #define HTT_H2T_RFS_CONFIG_S 8
  5080. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5081. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5082. HTT_H2T_RFS_CONFIG_S)
  5083. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5084. do { \
  5085. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5086. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5087. } while (0)
  5088. #define HTT_RFS_CFG_REQ_BYTES 4
  5089. /**
  5090. * @brief host -> target FW extended statistics retrieve
  5091. *
  5092. * @details
  5093. * The following field definitions describe the format of the HTT host
  5094. * to target FW extended stats retrieve message.
  5095. * The message specifies the type of stats the host wants to retrieve.
  5096. *
  5097. * |31 24|23 16|15 8|7 0|
  5098. * |-----------------------------------------------------------|
  5099. * | reserved | stats type | pdev_mask | msg type |
  5100. * |-----------------------------------------------------------|
  5101. * | config param [0] |
  5102. * |-----------------------------------------------------------|
  5103. * | config param [1] |
  5104. * |-----------------------------------------------------------|
  5105. * | config param [2] |
  5106. * |-----------------------------------------------------------|
  5107. * | config param [3] |
  5108. * |-----------------------------------------------------------|
  5109. * | reserved |
  5110. * |-----------------------------------------------------------|
  5111. * | cookie LSBs |
  5112. * |-----------------------------------------------------------|
  5113. * | cookie MSBs |
  5114. * |-----------------------------------------------------------|
  5115. * Header fields:
  5116. * - MSG_TYPE
  5117. * Bits 7:0
  5118. * Purpose: identifies this is a extended stats upload request message
  5119. * Value: 0x10
  5120. * - PDEV_MASK
  5121. * Bits 8:15
  5122. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5123. * Value: This is a overloaded field, refer to usage and interpretation of
  5124. * PDEV in interface document.
  5125. * Bit 8 : Reserved for SOC stats
  5126. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5127. * Indicates MACID_MASK in DBS
  5128. * - STATS_TYPE
  5129. * Bits 23:16
  5130. * Purpose: identifies which FW statistics to upload
  5131. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5132. * - Reserved
  5133. * Bits 31:24
  5134. * - CONFIG_PARAM [0]
  5135. * Bits 31:0
  5136. * Purpose: give an opaque configuration value to the specified stats type
  5137. * Value: stats-type specific configuration value
  5138. * Refer to htt_stats.h for interpretation for each stats sub_type
  5139. * - CONFIG_PARAM [1]
  5140. * Bits 31:0
  5141. * Purpose: give an opaque configuration value to the specified stats type
  5142. * Value: stats-type specific configuration value
  5143. * Refer to htt_stats.h for interpretation for each stats sub_type
  5144. * - CONFIG_PARAM [2]
  5145. * Bits 31:0
  5146. * Purpose: give an opaque configuration value to the specified stats type
  5147. * Value: stats-type specific configuration value
  5148. * Refer to htt_stats.h for interpretation for each stats sub_type
  5149. * - CONFIG_PARAM [3]
  5150. * Bits 31:0
  5151. * Purpose: give an opaque configuration value to the specified stats type
  5152. * Value: stats-type specific configuration value
  5153. * Refer to htt_stats.h for interpretation for each stats sub_type
  5154. * - Reserved [31:0] for future use.
  5155. * - COOKIE_LSBS
  5156. * Bits 31:0
  5157. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5158. * message with its preceding host->target stats request message.
  5159. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5160. * - COOKIE_MSBS
  5161. * Bits 31:0
  5162. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5163. * message with its preceding host->target stats request message.
  5164. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5165. */
  5166. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5167. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5168. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5169. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5170. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5171. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5172. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5173. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5174. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5175. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5176. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5177. do { \
  5178. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5179. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5180. } while (0)
  5181. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5182. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5183. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5184. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5185. do { \
  5186. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5187. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5188. } while (0)
  5189. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5190. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5191. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5192. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5193. do { \
  5194. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5195. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5196. } while (0)
  5197. /**
  5198. * @brief host -> target FW PPDU_STATS request message
  5199. *
  5200. * @details
  5201. * The following field definitions describe the format of the HTT host
  5202. * to target FW for PPDU_STATS_CFG msg.
  5203. * The message allows the host to configure the PPDU_STATS_IND messages
  5204. * produced by the target.
  5205. *
  5206. * |31 24|23 16|15 8|7 0|
  5207. * |-----------------------------------------------------------|
  5208. * | REQ bit mask | pdev_mask | msg type |
  5209. * |-----------------------------------------------------------|
  5210. * Header fields:
  5211. * - MSG_TYPE
  5212. * Bits 7:0
  5213. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5214. * Value: 0x11
  5215. * - PDEV_MASK
  5216. * Bits 8:15
  5217. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5218. * Value: This is a overloaded field, refer to usage and interpretation of
  5219. * PDEV in interface document.
  5220. * Bit 8 : Reserved for SOC stats
  5221. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5222. * Indicates MACID_MASK in DBS
  5223. * - REQ_TLV_BIT_MASK
  5224. * Bits 16:31
  5225. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5226. * needs to be included in the target's PPDU_STATS_IND messages.
  5227. * Value: refer htt_ppdu_stats_tlv_tag_t
  5228. *
  5229. */
  5230. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5231. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5232. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5233. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5234. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5235. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5236. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5237. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5238. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5239. do { \
  5240. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5241. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5242. } while (0)
  5243. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5244. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5245. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5246. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5247. do { \
  5248. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5249. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5250. } while (0)
  5251. /**
  5252. * @brief Host-->target HTT RX FSE setup message
  5253. * @details
  5254. * Through this message, the host will provide details of the flow tables
  5255. * in host DDR along with hash keys.
  5256. * This message can be sent per SOC or per PDEV, which is differentiated
  5257. * by pdev id values.
  5258. * The host will allocate flow search table and sends table size,
  5259. * physical DMA address of flow table, and hash keys to firmware to
  5260. * program into the RXOLE FSE HW block.
  5261. *
  5262. * The following field definitions describe the format of the RX FSE setup
  5263. * message sent from the host to target
  5264. *
  5265. * Header fields:
  5266. * dword0 - b'7:0 - msg_type: This will be set to
  5267. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5268. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5269. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5270. * pdev's LMAC ring.
  5271. * b'31:16 - reserved : Reserved for future use
  5272. * dword1 - b'19:0 - number of records: This field indicates the number of
  5273. * entries in the flow table. For example: 8k number of
  5274. * records is equivalent to
  5275. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5276. * b'27:20 - max search: This field specifies the skid length to FSE
  5277. * parser HW module whenever match is not found at the
  5278. * exact index pointed by hash.
  5279. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5280. * Refer htt_ip_da_sa_prefix below for more details.
  5281. * b'31:30 - reserved: Reserved for future use
  5282. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5283. * table allocated by host in DDR
  5284. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5285. * table allocated by host in DDR
  5286. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5287. * entry hashing
  5288. *
  5289. *
  5290. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5291. * |---------------------------------------------------------------|
  5292. * | reserved | pdev_id | MSG_TYPE |
  5293. * |---------------------------------------------------------------|
  5294. * |resvd|IPDSA| max_search | Number of records |
  5295. * |---------------------------------------------------------------|
  5296. * | base address lo |
  5297. * |---------------------------------------------------------------|
  5298. * | base address high |
  5299. * |---------------------------------------------------------------|
  5300. * | toeplitz key 31_0 |
  5301. * |---------------------------------------------------------------|
  5302. * | toeplitz key 63_32 |
  5303. * |---------------------------------------------------------------|
  5304. * | toeplitz key 95_64 |
  5305. * |---------------------------------------------------------------|
  5306. * | toeplitz key 127_96 |
  5307. * |---------------------------------------------------------------|
  5308. * | toeplitz key 159_128 |
  5309. * |---------------------------------------------------------------|
  5310. * | toeplitz key 191_160 |
  5311. * |---------------------------------------------------------------|
  5312. * | toeplitz key 223_192 |
  5313. * |---------------------------------------------------------------|
  5314. * | toeplitz key 255_224 |
  5315. * |---------------------------------------------------------------|
  5316. * | toeplitz key 287_256 |
  5317. * |---------------------------------------------------------------|
  5318. * | reserved | toeplitz key 314_288(26:0 bits) |
  5319. * |---------------------------------------------------------------|
  5320. * where:
  5321. * IPDSA = ip_da_sa
  5322. */
  5323. /**
  5324. * @brief: htt_ip_da_sa_prefix
  5325. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5326. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5327. * documentation per RFC3849
  5328. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5329. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5330. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5331. */
  5332. enum htt_ip_da_sa_prefix {
  5333. HTT_RX_IPV6_20010db8,
  5334. HTT_RX_IPV4_MAPPED_IPV6,
  5335. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5336. HTT_RX_IPV6_64FF9B,
  5337. };
  5338. /**
  5339. * @brief Host-->target HTT RX FISA configure and enable
  5340. * @details
  5341. * The host will send this command down to configure and enable the FISA
  5342. * operational params.
  5343. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5344. * register.
  5345. * Should configure both the MACs.
  5346. *
  5347. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5348. *
  5349. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5350. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5351. * pdev's LMAC ring.
  5352. * b'31:16 - reserved : Reserved for future use
  5353. *
  5354. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5355. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5356. * packets. 1 flow search will be skipped
  5357. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5358. * tcp,udp packets
  5359. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5360. * calculation
  5361. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5362. * calculation
  5363. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5364. * calculation
  5365. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5366. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5367. * length
  5368. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5369. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5370. * length
  5371. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5372. * num jump
  5373. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5374. * num jump
  5375. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5376. * data type switch has happend for MPDU Sequence num jump
  5377. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5378. * for MPDU Sequence num jump
  5379. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5380. * for decrypt errors
  5381. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5382. * while aggregating a msdu
  5383. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5384. * The aggregation is done until (number of MSDUs aggregated
  5385. * < LIMIT + 1)
  5386. * b'31:18 - Reserved
  5387. *
  5388. * fisa_control_value - 32bit value FW can write to register
  5389. *
  5390. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5391. * Threshold value for FISA timeout (units are microseconds).
  5392. * When the global timestamp exceeds this threshold, FISA
  5393. * aggregation will be restarted.
  5394. * A value of 0 means timeout is disabled.
  5395. * Compare the threshold register with timestamp field in
  5396. * flow entry to generate timeout for the flow.
  5397. *
  5398. * |31 18 |17 16|15 8|7 0|
  5399. * |-------------------------------------------------------------|
  5400. * | reserved | pdev_mask | msg type |
  5401. * |-------------------------------------------------------------|
  5402. * | reserved | FISA_CTRL |
  5403. * |-------------------------------------------------------------|
  5404. * | FISA_TIMEOUT_THRESH |
  5405. * |-------------------------------------------------------------|
  5406. */
  5407. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5408. A_UINT32 msg_type:8,
  5409. pdev_id:8,
  5410. reserved0:16;
  5411. /**
  5412. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5413. * [17:0]
  5414. */
  5415. union {
  5416. /*
  5417. * fisa_control_bits structure is deprecated.
  5418. * Please use fisa_control_bits_v2 going forward.
  5419. */
  5420. struct {
  5421. A_UINT32 fisa_enable: 1,
  5422. ipsec_skip_search: 1,
  5423. nontcp_skip_search: 1,
  5424. add_ipv4_fixed_hdr_len: 1,
  5425. add_ipv6_fixed_hdr_len: 1,
  5426. add_tcp_fixed_hdr_len: 1,
  5427. add_udp_hdr_len: 1,
  5428. chksum_cum_ip_len_en: 1,
  5429. disable_tid_check: 1,
  5430. disable_ta_check: 1,
  5431. disable_qos_check: 1,
  5432. disable_raw_check: 1,
  5433. disable_decrypt_err_check: 1,
  5434. disable_msdu_drop_check: 1,
  5435. fisa_aggr_limit: 4,
  5436. reserved: 14;
  5437. } fisa_control_bits;
  5438. struct {
  5439. A_UINT32 fisa_enable: 1,
  5440. fisa_aggr_limit: 4,
  5441. reserved: 27;
  5442. } fisa_control_bits_v2;
  5443. A_UINT32 fisa_control_value;
  5444. } u_fisa_control;
  5445. /**
  5446. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5447. * timeout threshold for aggregation. Unit in usec.
  5448. * [31:0]
  5449. */
  5450. A_UINT32 fisa_timeout_threshold;
  5451. } POSTPACK;
  5452. /* DWord 0: pdev-ID */
  5453. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5454. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5455. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5456. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5457. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5458. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5461. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5462. } while (0)
  5463. /* Dword 1: fisa_control_value fisa config */
  5464. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5465. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5466. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5467. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5468. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5469. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5470. do { \
  5471. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5472. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5473. } while (0)
  5474. /* Dword 1: fisa_control_value ipsec_skip_search */
  5475. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5476. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5477. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5478. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5479. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5480. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5481. do { \
  5482. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5483. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5484. } while (0)
  5485. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5486. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5487. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5488. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5489. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5490. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5491. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5492. do { \
  5493. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5494. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5495. } while (0)
  5496. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5497. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5498. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5499. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5500. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5501. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5502. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5503. do { \
  5504. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5505. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5506. } while (0)
  5507. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5508. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5509. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5510. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5511. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5512. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5513. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5514. do { \
  5515. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5516. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5517. } while (0)
  5518. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5519. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5520. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5521. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5522. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5523. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5524. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5525. do { \
  5526. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5527. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5528. } while (0)
  5529. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5530. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5531. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5532. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5533. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5534. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5535. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5536. do { \
  5537. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5538. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5539. } while (0)
  5540. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5541. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5542. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5543. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5544. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5545. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5546. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5547. do { \
  5548. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5549. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5550. } while (0)
  5551. /* Dword 1: fisa_control_value disable_tid_check */
  5552. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5553. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5554. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5555. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5556. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5557. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5558. do { \
  5559. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5560. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5561. } while (0)
  5562. /* Dword 1: fisa_control_value disable_ta_check */
  5563. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5564. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5565. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5566. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5567. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5568. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5571. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5572. } while (0)
  5573. /* Dword 1: fisa_control_value disable_qos_check */
  5574. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5575. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5576. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5577. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5578. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5579. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5580. do { \
  5581. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5582. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5583. } while (0)
  5584. /* Dword 1: fisa_control_value disable_raw_check */
  5585. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5586. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5587. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5588. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5589. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5590. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5591. do { \
  5592. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5593. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5594. } while (0)
  5595. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5596. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5597. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5598. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5599. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5600. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5601. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5602. do { \
  5603. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5604. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5605. } while (0)
  5606. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5607. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5608. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5609. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5610. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5611. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5612. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5613. do { \
  5614. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5615. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5616. } while (0)
  5617. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5618. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5619. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5620. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5621. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5622. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5623. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5626. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5627. } while (0)
  5628. /* Dword 1: fisa_control_value fisa config */
  5629. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  5630. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  5631. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  5632. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  5633. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  5634. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  5635. do { \
  5636. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  5637. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  5638. } while (0)
  5639. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5640. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  5641. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  5642. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  5643. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  5644. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  5645. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  5646. do { \
  5647. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  5648. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  5649. } while (0)
  5650. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5651. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5652. pdev_id:8,
  5653. reserved0:16;
  5654. A_UINT32 num_records:20,
  5655. max_search:8,
  5656. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5657. reserved1:2;
  5658. A_UINT32 base_addr_lo;
  5659. A_UINT32 base_addr_hi;
  5660. A_UINT32 toeplitz31_0;
  5661. A_UINT32 toeplitz63_32;
  5662. A_UINT32 toeplitz95_64;
  5663. A_UINT32 toeplitz127_96;
  5664. A_UINT32 toeplitz159_128;
  5665. A_UINT32 toeplitz191_160;
  5666. A_UINT32 toeplitz223_192;
  5667. A_UINT32 toeplitz255_224;
  5668. A_UINT32 toeplitz287_256;
  5669. A_UINT32 toeplitz314_288:27,
  5670. reserved2:5;
  5671. } POSTPACK;
  5672. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5673. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5674. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5675. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5676. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5677. /* DWORD 0: Pdev ID */
  5678. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5679. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5680. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5681. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5682. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5683. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5684. do { \
  5685. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5686. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5687. } while (0)
  5688. /* DWORD 1:num of records */
  5689. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5690. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5691. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5692. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5693. HTT_RX_FSE_SETUP_NUM_REC_S)
  5694. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5695. do { \
  5696. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5697. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5698. } while (0)
  5699. /* DWORD 1:max_search */
  5700. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5701. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5702. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5703. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5704. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5705. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5706. do { \
  5707. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5708. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5709. } while (0)
  5710. /* DWORD 1:ip_da_sa prefix */
  5711. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5712. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5713. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5714. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5715. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5716. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5717. do { \
  5718. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5719. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5720. } while (0)
  5721. /* DWORD 2: Base Address LO */
  5722. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5723. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5724. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5725. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5726. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5727. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5728. do { \
  5729. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5730. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5731. } while (0)
  5732. /* DWORD 3: Base Address High */
  5733. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5734. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5735. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5736. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5737. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5738. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5739. do { \
  5740. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5741. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5742. } while (0)
  5743. /* DWORD 4-12: Hash Value */
  5744. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5745. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5746. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5747. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5748. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5749. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5750. do { \
  5751. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5752. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5753. } while (0)
  5754. /* DWORD 13: Hash Value 314:288 bits */
  5755. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5756. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5757. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5758. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5759. do { \
  5760. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5761. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5762. } while (0)
  5763. /**
  5764. * @brief Host-->target HTT RX FSE operation message
  5765. * @details
  5766. * The host will send this Flow Search Engine (FSE) operation message for
  5767. * every flow add/delete operation.
  5768. * The FSE operation includes FSE full cache invalidation or individual entry
  5769. * invalidation.
  5770. * This message can be sent per SOC or per PDEV which is differentiated
  5771. * by pdev id values.
  5772. *
  5773. * |31 16|15 8|7 1|0|
  5774. * |-------------------------------------------------------------|
  5775. * | reserved | pdev_id | MSG_TYPE |
  5776. * |-------------------------------------------------------------|
  5777. * | reserved | operation |I|
  5778. * |-------------------------------------------------------------|
  5779. * | ip_src_addr_31_0 |
  5780. * |-------------------------------------------------------------|
  5781. * | ip_src_addr_63_32 |
  5782. * |-------------------------------------------------------------|
  5783. * | ip_src_addr_95_64 |
  5784. * |-------------------------------------------------------------|
  5785. * | ip_src_addr_127_96 |
  5786. * |-------------------------------------------------------------|
  5787. * | ip_dst_addr_31_0 |
  5788. * |-------------------------------------------------------------|
  5789. * | ip_dst_addr_63_32 |
  5790. * |-------------------------------------------------------------|
  5791. * | ip_dst_addr_95_64 |
  5792. * |-------------------------------------------------------------|
  5793. * | ip_dst_addr_127_96 |
  5794. * |-------------------------------------------------------------|
  5795. * | l4_dst_port | l4_src_port |
  5796. * | (32-bit SPI incase of IPsec) |
  5797. * |-------------------------------------------------------------|
  5798. * | reserved | l4_proto |
  5799. * |-------------------------------------------------------------|
  5800. *
  5801. * where I is 1-bit ipsec_valid.
  5802. *
  5803. * The following field definitions describe the format of the RX FSE operation
  5804. * message sent from the host to target for every add/delete flow entry to flow
  5805. * table.
  5806. *
  5807. * Header fields:
  5808. * dword0 - b'7:0 - msg_type: This will be set to
  5809. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5810. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5811. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5812. * specified pdev's LMAC ring.
  5813. * b'31:16 - reserved : Reserved for future use
  5814. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5815. * (Internet Protocol Security).
  5816. * IPsec describes the framework for providing security at
  5817. * IP layer. IPsec is defined for both versions of IP:
  5818. * IPV4 and IPV6.
  5819. * Please refer to htt_rx_flow_proto enumeration below for
  5820. * more info.
  5821. * ipsec_valid = 1 for IPSEC packets
  5822. * ipsec_valid = 0 for IP Packets
  5823. * b'7:1 - operation: This indicates types of FSE operation.
  5824. * Refer to htt_rx_fse_operation enumeration:
  5825. * 0 - No Cache Invalidation required
  5826. * 1 - Cache invalidate only one entry given by IP
  5827. * src/dest address at DWORD[2:9]
  5828. * 2 - Complete FSE Cache Invalidation
  5829. * 3 - FSE Disable
  5830. * 4 - FSE Enable
  5831. * b'31:8 - reserved: Reserved for future use
  5832. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5833. * for per flow addition/deletion
  5834. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5835. * and the subsequent 3 A_UINT32 will be padding bytes.
  5836. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5837. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5838. * from 0 to 65535 but only 0 to 1023 are designated as
  5839. * well-known ports. Refer to [RFC1700] for more details.
  5840. * This field is valid only if
  5841. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5842. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5843. * range from 0 to 65535 but only 0 to 1023 are designated
  5844. * as well-known ports. Refer to [RFC1700] for more details.
  5845. * This field is valid only if
  5846. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5847. * - SPI (31:0): Security Parameters Index is an
  5848. * identification tag added to the header while using IPsec
  5849. * for tunneling the IP traffici.
  5850. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5851. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5852. * Assigned Internet Protocol Numbers.
  5853. * l4_proto numbers for standard protocol like UDP/TCP
  5854. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5855. * l4_proto = 17 for UDP etc.
  5856. * b'31:8 - reserved: Reserved for future use.
  5857. *
  5858. */
  5859. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5860. A_UINT32 msg_type:8,
  5861. pdev_id:8,
  5862. reserved0:16;
  5863. A_UINT32 ipsec_valid:1,
  5864. operation:7,
  5865. reserved1:24;
  5866. A_UINT32 ip_src_addr_31_0;
  5867. A_UINT32 ip_src_addr_63_32;
  5868. A_UINT32 ip_src_addr_95_64;
  5869. A_UINT32 ip_src_addr_127_96;
  5870. A_UINT32 ip_dest_addr_31_0;
  5871. A_UINT32 ip_dest_addr_63_32;
  5872. A_UINT32 ip_dest_addr_95_64;
  5873. A_UINT32 ip_dest_addr_127_96;
  5874. union {
  5875. A_UINT32 spi;
  5876. struct {
  5877. A_UINT32 l4_src_port:16,
  5878. l4_dest_port:16;
  5879. } ip;
  5880. } u;
  5881. A_UINT32 l4_proto:8,
  5882. reserved:24;
  5883. } POSTPACK;
  5884. /**
  5885. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5886. * @details
  5887. * The host will send this Full monitor mode register configuration message.
  5888. * This message can be sent per SOC or per PDEV which is differentiated
  5889. * by pdev id values.
  5890. *
  5891. * |31 16|15 11|10 8|7 3|2|1|0|
  5892. * |-------------------------------------------------------------|
  5893. * | reserved | pdev_id | MSG_TYPE |
  5894. * |-------------------------------------------------------------|
  5895. * | reserved |Release Ring |N|Z|E|
  5896. * |-------------------------------------------------------------|
  5897. *
  5898. * where E is 1-bit full monitor mode enable/disable.
  5899. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5900. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5901. *
  5902. * The following field definitions describe the format of the full monitor
  5903. * mode configuration message sent from the host to target for each pdev.
  5904. *
  5905. * Header fields:
  5906. * dword0 - b'7:0 - msg_type: This will be set to
  5907. * HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE.
  5908. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5909. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5910. * specified pdev's LMAC ring.
  5911. * b'31:16 - reserved : Reserved for future use.
  5912. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5913. * monitor mode rxdma register is to be enabled or disabled.
  5914. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5915. * additional descriptors at ppdu end for zero mpdus
  5916. * enabled or disabled.
  5917. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5918. * additional descriptors at ppdu end for non zero mpdus
  5919. * enabled or disabled.
  5920. * b'10:3 - release_ring: This indicates the destination ring
  5921. * selection for the descriptor at the end of PPDU
  5922. * 0 - REO ring select
  5923. * 1 - FW ring select
  5924. * 2 - SW ring select
  5925. * 3 - Release ring select
  5926. * Refer to htt_rx_full_mon_release_ring.
  5927. * b'31:11 - reserved for future use
  5928. */
  5929. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5930. A_UINT32 msg_type:8,
  5931. pdev_id:8,
  5932. reserved0:16;
  5933. A_UINT32 full_monitor_mode_enable:1,
  5934. addnl_descs_zero_mpdus_end:1,
  5935. addnl_descs_non_zero_mpdus_end:1,
  5936. release_ring:8,
  5937. reserved1:21;
  5938. } POSTPACK;
  5939. /**
  5940. * Enumeration for full monitor mode destination ring select
  5941. * 0 - REO destination ring select
  5942. * 1 - FW destination ring select
  5943. * 2 - SW destination ring select
  5944. * 3 - Release destination ring select
  5945. */
  5946. enum htt_rx_full_mon_release_ring {
  5947. HTT_RX_MON_RING_REO,
  5948. HTT_RX_MON_RING_FW,
  5949. HTT_RX_MON_RING_SW,
  5950. HTT_RX_MON_RING_RELEASE,
  5951. };
  5952. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  5953. /* DWORD 0: Pdev ID */
  5954. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  5955. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  5956. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  5957. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  5958. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  5959. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  5960. do { \
  5961. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  5962. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  5963. } while (0)
  5964. /* DWORD 1:ENABLE */
  5965. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  5966. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  5967. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  5968. do { \
  5969. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  5970. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  5971. } while (0)
  5972. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  5973. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  5974. /* DWORD 1:ZERO_MPDU */
  5975. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  5976. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  5977. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  5978. do { \
  5979. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  5980. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  5981. } while (0)
  5982. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  5983. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  5984. /* DWORD 1:NON_ZERO_MPDU */
  5985. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  5986. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  5987. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  5988. do { \
  5989. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  5990. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  5991. } while (0)
  5992. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  5993. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  5994. /* DWORD 1:RELEASE_RINGS */
  5995. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  5996. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  5997. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  5998. do { \
  5999. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6000. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6001. } while (0)
  6002. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6003. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6004. /**
  6005. * Enumeration for IP Protocol or IPSEC Protocol
  6006. * IPsec describes the framework for providing security at IP layer.
  6007. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6008. */
  6009. enum htt_rx_flow_proto {
  6010. HTT_RX_FLOW_IP_PROTO,
  6011. HTT_RX_FLOW_IPSEC_PROTO,
  6012. };
  6013. /**
  6014. * Enumeration for FSE Cache Invalidation
  6015. * 0 - No Cache Invalidation required
  6016. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6017. * 2 - Complete FSE Cache Invalidation
  6018. * 3 - FSE Disable
  6019. * 4 - FSE Enable
  6020. */
  6021. enum htt_rx_fse_operation {
  6022. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6023. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6024. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6025. HTT_RX_FSE_DISABLE,
  6026. HTT_RX_FSE_ENABLE,
  6027. };
  6028. /* DWORD 0: Pdev ID */
  6029. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6030. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6031. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6032. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6033. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6034. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6035. do { \
  6036. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6037. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6038. } while (0)
  6039. /* DWORD 1:IP PROTO or IPSEC */
  6040. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6041. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6042. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6043. do { \
  6044. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6045. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6046. } while (0)
  6047. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6048. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6049. /* DWORD 1:FSE Operation */
  6050. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6051. #define HTT_RX_FSE_OPERATION_S 1
  6052. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6053. do { \
  6054. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6055. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6056. } while (0)
  6057. #define HTT_RX_FSE_OPERATION_GET(word) \
  6058. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6059. /* DWORD 2-9:IP Address */
  6060. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6061. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6062. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6063. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6064. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6065. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6066. do { \
  6067. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6068. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6069. } while (0)
  6070. /* DWORD 10:Source Port Number */
  6071. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6072. #define HTT_RX_FSE_SOURCEPORT_S 0
  6073. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6074. do { \
  6075. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6076. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6077. } while (0)
  6078. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6079. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6080. /* DWORD 11:Destination Port Number */
  6081. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6082. #define HTT_RX_FSE_DESTPORT_S 16
  6083. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6084. do { \
  6085. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6086. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6087. } while (0)
  6088. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6089. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6090. /* DWORD 10-11:SPI (In case of IPSEC) */
  6091. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6092. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6093. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6094. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6095. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6096. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6097. do { \
  6098. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6099. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6100. } while (0)
  6101. /* DWORD 12:L4 PROTO */
  6102. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6103. #define HTT_RX_FSE_L4_PROTO_S 0
  6104. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6105. do { \
  6106. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6107. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6108. } while (0)
  6109. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6110. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6111. /**
  6112. * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6113. * host --> target Receive to configure the RxOLE 3-tuple Hash
  6114. *
  6115. * |31 24|23 |15 8|7 2|1|0|
  6116. * |----------------+----------------+----------------+----------------|
  6117. * | reserved | pdev_id | msg_type |
  6118. * |---------------------------------+----------------+----------------|
  6119. * | reserved |E|F|
  6120. * |---------------------------------+----------------+----------------|
  6121. * Where E = Configure the target to provide the 3-tuple hash value in
  6122. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6123. * F = Configure the target to provide the 3-tuple hash value in
  6124. * flow_id_toeplitz field of rx_msdu_start tlv
  6125. *
  6126. * The following field definitions describe the format of the 3 tuple hash value
  6127. * message sent from the host to target as part of initialization sequence.
  6128. *
  6129. * Header fields:
  6130. * dword0 - b'7:0 - msg_type: This will be set to
  6131. * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6132. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6133. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6134. * specified pdev's LMAC ring.
  6135. * b'31:16 - reserved : Reserved for future use
  6136. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6137. * b'1 - toeplitz_hash_2_or_4_field_enable
  6138. * b'31:2 - reserved : Reserved for future use
  6139. * ---------+------+----------------------------------------------------------
  6140. * bit1 | bit0 | Functionality
  6141. * ---------+------+----------------------------------------------------------
  6142. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6143. * | | in flow_id_toeplitz field
  6144. * ---------+------+----------------------------------------------------------
  6145. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6146. * | | in toeplitz_hash_2_or_4 field
  6147. * ---------+------+----------------------------------------------------------
  6148. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6149. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6150. * ---------+------+----------------------------------------------------------
  6151. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6152. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6153. * | | toeplitz_hash_2_or_4 field
  6154. *----------------------------------------------------------------------------
  6155. */
  6156. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6157. A_UINT32 msg_type :8,
  6158. pdev_id :8,
  6159. reserved0 :16;
  6160. A_UINT32 flow_id_toeplitz_field_enable :1,
  6161. toeplitz_hash_2_or_4_field_enable :1,
  6162. reserved1 :30;
  6163. } POSTPACK;
  6164. /* DWORD0 : pdev_id configuration Macros */
  6165. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6166. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6167. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6168. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6169. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6170. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6171. do { \
  6172. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6173. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6174. } while (0)
  6175. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6176. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6177. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6178. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6179. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6180. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6181. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6182. do { \
  6183. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6184. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6185. } while (0)
  6186. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6187. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6188. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6189. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6190. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6191. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6192. do { \
  6193. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6194. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6195. } while (0)
  6196. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6197. /**
  6198. * @brief HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message
  6199. *
  6200. * @details
  6201. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  6202. * provide the physical start address and size of each of the memory
  6203. * areas within host DDR that the target FW may need to access.
  6204. *
  6205. * For example, the host can use this message to allow the target FW
  6206. * to set up access to the host's pools of TQM link descriptors.
  6207. * The message would appear as follows:
  6208. *
  6209. * |31 24|23 16|15 8|7 0|
  6210. * |----------------+----------------+----------------+----------------|
  6211. * | reserved | num_entries | msg_type |
  6212. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6213. * | mem area 0 size |
  6214. * |----------------+----------------+----------------+----------------|
  6215. * | mem area 0 physical_address_lo |
  6216. * |----------------+----------------+----------------+----------------|
  6217. * | mem area 0 physical_address_hi |
  6218. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6219. * | mem area 1 size |
  6220. * |----------------+----------------+----------------+----------------|
  6221. * | mem area 1 physical_address_lo |
  6222. * |----------------+----------------+----------------+----------------|
  6223. * | mem area 1 physical_address_hi |
  6224. * |----------------+----------------+----------------+----------------|
  6225. * ...
  6226. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  6227. * | mem area N size |
  6228. * |----------------+----------------+----------------+----------------|
  6229. * | mem area N physical_address_lo |
  6230. * |----------------+----------------+----------------+----------------|
  6231. * | mem area N physical_address_hi |
  6232. * |----------------+----------------+----------------+----------------|
  6233. *
  6234. * The message is interpreted as follows:
  6235. * dword0 - b'0:7 - msg_type: This will be set to
  6236. * HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  6237. * b'8:15 - number_entries: Indicated the number of host memory
  6238. * areas specified within the remainder of the message
  6239. * b'16:31 - reserved.
  6240. * dword1 - b'0:31 - memory area 0 size in bytes
  6241. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  6242. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  6243. * and similar for memory area 1 through memory area N.
  6244. */
  6245. PREPACK struct htt_h2t_host_paddr_size {
  6246. A_UINT32 msg_type: 8,
  6247. num_entries: 8,
  6248. reserved: 16;
  6249. } POSTPACK;
  6250. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  6251. A_UINT32 size;
  6252. A_UINT32 physical_address_lo;
  6253. A_UINT32 physical_address_hi;
  6254. } POSTPACK;
  6255. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  6256. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  6257. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  6258. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  6259. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  6260. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  6261. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  6262. do { \
  6263. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  6264. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  6265. } while (0)
  6266. /*=== target -> host messages ===============================================*/
  6267. enum htt_t2h_msg_type {
  6268. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6269. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6270. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6271. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6272. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6273. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6274. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6275. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6276. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6277. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6278. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6279. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6280. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6281. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6282. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6283. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6284. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6285. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6286. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6287. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6288. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6289. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6290. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6291. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6292. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6293. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6294. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6295. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6296. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6297. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6298. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6299. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6300. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6301. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6302. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6303. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6304. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6305. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6306. /* TX_OFFLOAD_DELIVER_IND:
  6307. * Forward the target's locally-generated packets to the host,
  6308. * to provide to the monitor mode interface.
  6309. */
  6310. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6311. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6312. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  6313. HTT_T2H_MSG_TYPE_TEST,
  6314. /* keep this last */
  6315. HTT_T2H_NUM_MSGS
  6316. };
  6317. /*
  6318. * HTT target to host message type -
  6319. * stored in bits 7:0 of the first word of the message
  6320. */
  6321. #define HTT_T2H_MSG_TYPE_M 0xff
  6322. #define HTT_T2H_MSG_TYPE_S 0
  6323. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6324. do { \
  6325. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6326. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6327. } while (0)
  6328. #define HTT_T2H_MSG_TYPE_GET(word) \
  6329. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6330. /**
  6331. * @brief target -> host version number confirmation message definition
  6332. *
  6333. * |31 24|23 16|15 8|7 0|
  6334. * |----------------+----------------+----------------+----------------|
  6335. * | reserved | major number | minor number | msg type |
  6336. * |-------------------------------------------------------------------|
  6337. * : option request TLV (optional) |
  6338. * :...................................................................:
  6339. *
  6340. * The VER_CONF message may consist of a single 4-byte word, or may be
  6341. * extended with TLVs that specify HTT options selected by the target.
  6342. * The following option TLVs may be appended to the VER_CONF message:
  6343. * - LL_BUS_ADDR_SIZE
  6344. * - HL_SUPPRESS_TX_COMPL_IND
  6345. * - MAX_TX_QUEUE_GROUPS
  6346. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6347. * may be appended to the VER_CONF message (but only one TLV of each type).
  6348. *
  6349. * Header fields:
  6350. * - MSG_TYPE
  6351. * Bits 7:0
  6352. * Purpose: identifies this as a version number confirmation message
  6353. * Value: 0x0
  6354. * - VER_MINOR
  6355. * Bits 15:8
  6356. * Purpose: Specify the minor number of the HTT message library version
  6357. * in use by the target firmware.
  6358. * The minor number specifies the specific revision within a range
  6359. * of fundamentally compatible HTT message definition revisions.
  6360. * Compatible revisions involve adding new messages or perhaps
  6361. * adding new fields to existing messages, in a backwards-compatible
  6362. * manner.
  6363. * Incompatible revisions involve changing the message type values,
  6364. * or redefining existing messages.
  6365. * Value: minor number
  6366. * - VER_MAJOR
  6367. * Bits 15:8
  6368. * Purpose: Specify the major number of the HTT message library version
  6369. * in use by the target firmware.
  6370. * The major number specifies the family of minor revisions that are
  6371. * fundamentally compatible with each other, but not with prior or
  6372. * later families.
  6373. * Value: major number
  6374. */
  6375. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6376. #define HTT_VER_CONF_MINOR_S 8
  6377. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6378. #define HTT_VER_CONF_MAJOR_S 16
  6379. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6380. do { \
  6381. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6382. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6383. } while (0)
  6384. #define HTT_VER_CONF_MINOR_GET(word) \
  6385. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6386. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6387. do { \
  6388. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6389. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6390. } while (0)
  6391. #define HTT_VER_CONF_MAJOR_GET(word) \
  6392. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6393. #define HTT_VER_CONF_BYTES 4
  6394. /**
  6395. * @brief - target -> host HTT Rx In order indication message
  6396. *
  6397. * @details
  6398. *
  6399. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6400. * |----------------+-------------------+---------------------+---------------|
  6401. * | peer ID | P| F| O| ext TID | msg type |
  6402. * |--------------------------------------------------------------------------|
  6403. * | MSDU count | Reserved | vdev id |
  6404. * |--------------------------------------------------------------------------|
  6405. * | MSDU 0 bus address (bits 31:0) |
  6406. #if HTT_PADDR64
  6407. * | MSDU 0 bus address (bits 63:32) |
  6408. #endif
  6409. * |--------------------------------------------------------------------------|
  6410. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6411. * |--------------------------------------------------------------------------|
  6412. * | MSDU 1 bus address (bits 31:0) |
  6413. #if HTT_PADDR64
  6414. * | MSDU 1 bus address (bits 63:32) |
  6415. #endif
  6416. * |--------------------------------------------------------------------------|
  6417. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6418. * |--------------------------------------------------------------------------|
  6419. */
  6420. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6421. *
  6422. * @details
  6423. * bits
  6424. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6425. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6426. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6427. * | | frag | | | | fail |chksum fail|
  6428. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6429. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6430. */
  6431. struct htt_rx_in_ord_paddr_ind_hdr_t
  6432. {
  6433. A_UINT32 /* word 0 */
  6434. msg_type: 8,
  6435. ext_tid: 5,
  6436. offload: 1,
  6437. frag: 1,
  6438. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6439. peer_id: 16;
  6440. A_UINT32 /* word 1 */
  6441. vap_id: 8,
  6442. /* NOTE:
  6443. * This reserved_1 field is not truly reserved - certain targets use
  6444. * this field internally to store debug information, and do not zero
  6445. * out the contents of the field before uploading the message to the
  6446. * host. Thus, any host-target communication supported by this field
  6447. * is limited to using values that are never used by the debug
  6448. * information stored by certain targets in the reserved_1 field.
  6449. * In particular, the targets in question don't use the value 0x3
  6450. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6451. * so this previously-unused value within these bits is available to
  6452. * use as the host / target PKT_CAPTURE_MODE flag.
  6453. */
  6454. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6455. /* if pkt_capture_mode == 0x3, host should
  6456. * send rx frames to monitor mode interface
  6457. */
  6458. msdu_cnt: 16;
  6459. };
  6460. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6461. {
  6462. A_UINT32 dma_addr;
  6463. A_UINT32
  6464. length: 16,
  6465. fw_desc: 8,
  6466. msdu_info:8;
  6467. };
  6468. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6469. {
  6470. A_UINT32 dma_addr_lo;
  6471. A_UINT32 dma_addr_hi;
  6472. A_UINT32
  6473. length: 16,
  6474. fw_desc: 8,
  6475. msdu_info:8;
  6476. };
  6477. #if HTT_PADDR64
  6478. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6479. #else
  6480. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6481. #endif
  6482. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6483. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6484. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6485. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6486. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6487. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6488. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6489. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6490. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6491. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6492. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6493. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6494. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6495. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6496. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6497. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6498. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6499. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6500. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6501. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6502. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6503. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6504. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6505. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6506. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6507. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6508. /* for systems using 64-bit format for bus addresses */
  6509. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6510. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6511. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6512. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6513. /* for systems using 32-bit format for bus addresses */
  6514. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6515. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6516. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6517. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6518. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6519. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6520. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6521. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6522. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6523. do { \
  6524. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6525. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6526. } while (0)
  6527. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6528. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6529. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6530. do { \
  6531. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6532. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6533. } while (0)
  6534. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6535. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6536. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6539. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6540. } while (0)
  6541. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6542. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6543. /*
  6544. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6545. * deliver the rx frames to the monitor mode interface.
  6546. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6547. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6548. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6549. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6550. */
  6551. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6552. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6553. do { \
  6554. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6555. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6556. } while (0)
  6557. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6558. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6559. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6560. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6563. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6564. } while (0)
  6565. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6566. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6567. /* for systems using 64-bit format for bus addresses */
  6568. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6569. do { \
  6570. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6571. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6572. } while (0)
  6573. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6574. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6575. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6576. do { \
  6577. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6578. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6579. } while (0)
  6580. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6581. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6582. /* for systems using 32-bit format for bus addresses */
  6583. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6584. do { \
  6585. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6586. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6587. } while (0)
  6588. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6589. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6590. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6593. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6594. } while (0)
  6595. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6596. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6597. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6598. do { \
  6599. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6600. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6601. } while (0)
  6602. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6603. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6604. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6605. do { \
  6606. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6607. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6608. } while (0)
  6609. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6610. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6611. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6614. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6615. } while (0)
  6616. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6617. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6618. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6619. do { \
  6620. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6621. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6622. } while (0)
  6623. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6624. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6625. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6626. do { \
  6627. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6628. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6629. } while (0)
  6630. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6631. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6632. /* definitions used within target -> host rx indication message */
  6633. PREPACK struct htt_rx_ind_hdr_prefix_t
  6634. {
  6635. A_UINT32 /* word 0 */
  6636. msg_type: 8,
  6637. ext_tid: 5,
  6638. release_valid: 1,
  6639. flush_valid: 1,
  6640. reserved0: 1,
  6641. peer_id: 16;
  6642. A_UINT32 /* word 1 */
  6643. flush_start_seq_num: 6,
  6644. flush_end_seq_num: 6,
  6645. release_start_seq_num: 6,
  6646. release_end_seq_num: 6,
  6647. num_mpdu_ranges: 8;
  6648. } POSTPACK;
  6649. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6650. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6651. #define HTT_TGT_RSSI_INVALID 0x80
  6652. PREPACK struct htt_rx_ppdu_desc_t
  6653. {
  6654. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6655. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6656. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6657. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6658. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6659. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6660. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6661. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6662. A_UINT32 /* word 0 */
  6663. rssi_cmb: 8,
  6664. timestamp_submicrosec: 8,
  6665. phy_err_code: 8,
  6666. phy_err: 1,
  6667. legacy_rate: 4,
  6668. legacy_rate_sel: 1,
  6669. end_valid: 1,
  6670. start_valid: 1;
  6671. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6672. union {
  6673. A_UINT32 /* word 1 */
  6674. rssi0_pri20: 8,
  6675. rssi0_ext20: 8,
  6676. rssi0_ext40: 8,
  6677. rssi0_ext80: 8;
  6678. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6679. } u0;
  6680. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6681. union {
  6682. A_UINT32 /* word 2 */
  6683. rssi1_pri20: 8,
  6684. rssi1_ext20: 8,
  6685. rssi1_ext40: 8,
  6686. rssi1_ext80: 8;
  6687. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6688. } u1;
  6689. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6690. union {
  6691. A_UINT32 /* word 3 */
  6692. rssi2_pri20: 8,
  6693. rssi2_ext20: 8,
  6694. rssi2_ext40: 8,
  6695. rssi2_ext80: 8;
  6696. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6697. } u2;
  6698. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6699. union {
  6700. A_UINT32 /* word 4 */
  6701. rssi3_pri20: 8,
  6702. rssi3_ext20: 8,
  6703. rssi3_ext40: 8,
  6704. rssi3_ext80: 8;
  6705. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6706. } u3;
  6707. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6708. A_UINT32 tsf32; /* word 5 */
  6709. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6710. A_UINT32 timestamp_microsec; /* word 6 */
  6711. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6712. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6713. A_UINT32 /* word 7 */
  6714. vht_sig_a1: 24,
  6715. preamble_type: 8;
  6716. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6717. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6718. A_UINT32 /* word 8 */
  6719. vht_sig_a2: 24,
  6720. /* sa_ant_matrix
  6721. * For cases where a single rx chain has options to be connected to
  6722. * different rx antennas, show which rx antennas were in use during
  6723. * receipt of a given PPDU.
  6724. * This sa_ant_matrix provides a bitmask of the antennas used while
  6725. * receiving this frame.
  6726. */
  6727. sa_ant_matrix: 8;
  6728. } POSTPACK;
  6729. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6730. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6731. PREPACK struct htt_rx_ind_hdr_suffix_t
  6732. {
  6733. A_UINT32 /* word 0 */
  6734. fw_rx_desc_bytes: 16,
  6735. reserved0: 16;
  6736. } POSTPACK;
  6737. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6738. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6739. PREPACK struct htt_rx_ind_hdr_t
  6740. {
  6741. struct htt_rx_ind_hdr_prefix_t prefix;
  6742. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6743. struct htt_rx_ind_hdr_suffix_t suffix;
  6744. } POSTPACK;
  6745. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6746. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6747. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6748. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6749. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6750. /*
  6751. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6752. * the offset into the HTT rx indication message at which the
  6753. * FW rx PPDU descriptor resides
  6754. */
  6755. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6756. /*
  6757. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6758. * the offset into the HTT rx indication message at which the
  6759. * header suffix (FW rx MSDU byte count) resides
  6760. */
  6761. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6762. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6763. /*
  6764. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6765. * the offset into the HTT rx indication message at which the per-MSDU
  6766. * information starts
  6767. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6768. * per-MSDU information portion of the message. The per-MSDU info itself
  6769. * starts at byte 12.
  6770. */
  6771. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6772. /**
  6773. * @brief target -> host rx indication message definition
  6774. *
  6775. * @details
  6776. * The following field definitions describe the format of the rx indication
  6777. * message sent from the target to the host.
  6778. * The message consists of three major sections:
  6779. * 1. a fixed-length header
  6780. * 2. a variable-length list of firmware rx MSDU descriptors
  6781. * 3. one or more 4-octet MPDU range information elements
  6782. * The fixed length header itself has two sub-sections
  6783. * 1. the message meta-information, including identification of the
  6784. * sender and type of the received data, and a 4-octet flush/release IE
  6785. * 2. the firmware rx PPDU descriptor
  6786. *
  6787. * The format of the message is depicted below.
  6788. * in this depiction, the following abbreviations are used for information
  6789. * elements within the message:
  6790. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6791. * elements associated with the PPDU start are valid.
  6792. * Specifically, the following fields are valid only if SV is set:
  6793. * RSSI (all variants), L, legacy rate, preamble type, service,
  6794. * VHT-SIG-A
  6795. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6796. * elements associated with the PPDU end are valid.
  6797. * Specifically, the following fields are valid only if EV is set:
  6798. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6799. * - L - Legacy rate selector - if legacy rates are used, this flag
  6800. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6801. * (L == 0) PHY.
  6802. * - P - PHY error flag - boolean indication of whether the rx frame had
  6803. * a PHY error
  6804. *
  6805. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6806. * |----------------+-------------------+---------------------+---------------|
  6807. * | peer ID | |RV|FV| ext TID | msg type |
  6808. * |--------------------------------------------------------------------------|
  6809. * | num | release | release | flush | flush |
  6810. * | MPDU | end | start | end | start |
  6811. * | ranges | seq num | seq num | seq num | seq num |
  6812. * |==========================================================================|
  6813. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6814. * |V|V| | rate | | | timestamp | RSSI |
  6815. * |--------------------------------------------------------------------------|
  6816. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6817. * |--------------------------------------------------------------------------|
  6818. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6819. * |--------------------------------------------------------------------------|
  6820. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6821. * |--------------------------------------------------------------------------|
  6822. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6823. * |--------------------------------------------------------------------------|
  6824. * | TSF LSBs |
  6825. * |--------------------------------------------------------------------------|
  6826. * | microsec timestamp |
  6827. * |--------------------------------------------------------------------------|
  6828. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6829. * |--------------------------------------------------------------------------|
  6830. * | service | HT-SIG / VHT-SIG-A2 |
  6831. * |==========================================================================|
  6832. * | reserved | FW rx desc bytes |
  6833. * |--------------------------------------------------------------------------|
  6834. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6835. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6836. * |--------------------------------------------------------------------------|
  6837. * : : :
  6838. * |--------------------------------------------------------------------------|
  6839. * | alignment | MSDU Rx |
  6840. * | padding | desc Bn |
  6841. * |--------------------------------------------------------------------------|
  6842. * | reserved | MPDU range status | MPDU count |
  6843. * |--------------------------------------------------------------------------|
  6844. * : reserved : MPDU range status : MPDU count :
  6845. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6846. *
  6847. * Header fields:
  6848. * - MSG_TYPE
  6849. * Bits 7:0
  6850. * Purpose: identifies this as an rx indication message
  6851. * Value: 0x1
  6852. * - EXT_TID
  6853. * Bits 12:8
  6854. * Purpose: identify the traffic ID of the rx data, including
  6855. * special "extended" TID values for multicast, broadcast, and
  6856. * non-QoS data frames
  6857. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6858. * - FLUSH_VALID (FV)
  6859. * Bit 13
  6860. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6861. * is valid
  6862. * Value:
  6863. * 1 -> flush IE is valid and needs to be processed
  6864. * 0 -> flush IE is not valid and should be ignored
  6865. * - REL_VALID (RV)
  6866. * Bit 13
  6867. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6868. * is valid
  6869. * Value:
  6870. * 1 -> release IE is valid and needs to be processed
  6871. * 0 -> release IE is not valid and should be ignored
  6872. * - PEER_ID
  6873. * Bits 31:16
  6874. * Purpose: Identify, by ID, which peer sent the rx data
  6875. * Value: ID of the peer who sent the rx data
  6876. * - FLUSH_SEQ_NUM_START
  6877. * Bits 5:0
  6878. * Purpose: Indicate the start of a series of MPDUs to flush
  6879. * Not all MPDUs within this series are necessarily valid - the host
  6880. * must check each sequence number within this range to see if the
  6881. * corresponding MPDU is actually present.
  6882. * This field is only valid if the FV bit is set.
  6883. * Value:
  6884. * The sequence number for the first MPDUs to check to flush.
  6885. * The sequence number is masked by 0x3f.
  6886. * - FLUSH_SEQ_NUM_END
  6887. * Bits 11:6
  6888. * Purpose: Indicate the end of a series of MPDUs to flush
  6889. * Value:
  6890. * The sequence number one larger than the sequence number of the
  6891. * last MPDU to check to flush.
  6892. * The sequence number is masked by 0x3f.
  6893. * Not all MPDUs within this series are necessarily valid - the host
  6894. * must check each sequence number within this range to see if the
  6895. * corresponding MPDU is actually present.
  6896. * This field is only valid if the FV bit is set.
  6897. * - REL_SEQ_NUM_START
  6898. * Bits 17:12
  6899. * Purpose: Indicate the start of a series of MPDUs to release.
  6900. * All MPDUs within this series are present and valid - the host
  6901. * need not check each sequence number within this range to see if
  6902. * the corresponding MPDU is actually present.
  6903. * This field is only valid if the RV bit is set.
  6904. * Value:
  6905. * The sequence number for the first MPDUs to check to release.
  6906. * The sequence number is masked by 0x3f.
  6907. * - REL_SEQ_NUM_END
  6908. * Bits 23:18
  6909. * Purpose: Indicate the end of a series of MPDUs to release.
  6910. * Value:
  6911. * The sequence number one larger than the sequence number of the
  6912. * last MPDU to check to release.
  6913. * The sequence number is masked by 0x3f.
  6914. * All MPDUs within this series are present and valid - the host
  6915. * need not check each sequence number within this range to see if
  6916. * the corresponding MPDU is actually present.
  6917. * This field is only valid if the RV bit is set.
  6918. * - NUM_MPDU_RANGES
  6919. * Bits 31:24
  6920. * Purpose: Indicate how many ranges of MPDUs are present.
  6921. * Each MPDU range consists of a series of contiguous MPDUs within the
  6922. * rx frame sequence which all have the same MPDU status.
  6923. * Value: 1-63 (typically a small number, like 1-3)
  6924. *
  6925. * Rx PPDU descriptor fields:
  6926. * - RSSI_CMB
  6927. * Bits 7:0
  6928. * Purpose: Combined RSSI from all active rx chains, across the active
  6929. * bandwidth.
  6930. * Value: RSSI dB units w.r.t. noise floor
  6931. * - TIMESTAMP_SUBMICROSEC
  6932. * Bits 15:8
  6933. * Purpose: high-resolution timestamp
  6934. * Value:
  6935. * Sub-microsecond time of PPDU reception.
  6936. * This timestamp ranges from [0,MAC clock MHz).
  6937. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6938. * to form a high-resolution, large range rx timestamp.
  6939. * - PHY_ERR_CODE
  6940. * Bits 23:16
  6941. * Purpose:
  6942. * If the rx frame processing resulted in a PHY error, indicate what
  6943. * type of rx PHY error occurred.
  6944. * Value:
  6945. * This field is valid if the "P" (PHY_ERR) flag is set.
  6946. * TBD: document/specify the values for this field
  6947. * - PHY_ERR
  6948. * Bit 24
  6949. * Purpose: indicate whether the rx PPDU had a PHY error
  6950. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6951. * - LEGACY_RATE
  6952. * Bits 28:25
  6953. * Purpose:
  6954. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6955. * specify which rate was used.
  6956. * Value:
  6957. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6958. * flag.
  6959. * If LEGACY_RATE_SEL is 0:
  6960. * 0x8: OFDM 48 Mbps
  6961. * 0x9: OFDM 24 Mbps
  6962. * 0xA: OFDM 12 Mbps
  6963. * 0xB: OFDM 6 Mbps
  6964. * 0xC: OFDM 54 Mbps
  6965. * 0xD: OFDM 36 Mbps
  6966. * 0xE: OFDM 18 Mbps
  6967. * 0xF: OFDM 9 Mbps
  6968. * If LEGACY_RATE_SEL is 1:
  6969. * 0x8: CCK 11 Mbps long preamble
  6970. * 0x9: CCK 5.5 Mbps long preamble
  6971. * 0xA: CCK 2 Mbps long preamble
  6972. * 0xB: CCK 1 Mbps long preamble
  6973. * 0xC: CCK 11 Mbps short preamble
  6974. * 0xD: CCK 5.5 Mbps short preamble
  6975. * 0xE: CCK 2 Mbps short preamble
  6976. * - LEGACY_RATE_SEL
  6977. * Bit 29
  6978. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6979. * Value:
  6980. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6981. * used a legacy rate.
  6982. * 0 -> OFDM, 1 -> CCK
  6983. * - END_VALID
  6984. * Bit 30
  6985. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6986. * the start of the PPDU are valid. Specifically, the following
  6987. * fields are only valid if END_VALID is set:
  6988. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6989. * TIMESTAMP_SUBMICROSEC
  6990. * Value:
  6991. * 0 -> rx PPDU desc end fields are not valid
  6992. * 1 -> rx PPDU desc end fields are valid
  6993. * - START_VALID
  6994. * Bit 31
  6995. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6996. * the end of the PPDU are valid. Specifically, the following
  6997. * fields are only valid if START_VALID is set:
  6998. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6999. * VHT-SIG-A
  7000. * Value:
  7001. * 0 -> rx PPDU desc start fields are not valid
  7002. * 1 -> rx PPDU desc start fields are valid
  7003. * - RSSI0_PRI20
  7004. * Bits 7:0
  7005. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  7006. * Value: RSSI dB units w.r.t. noise floor
  7007. *
  7008. * - RSSI0_EXT20
  7009. * Bits 7:0
  7010. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  7011. * (if the rx bandwidth was >= 40 MHz)
  7012. * Value: RSSI dB units w.r.t. noise floor
  7013. * - RSSI0_EXT40
  7014. * Bits 7:0
  7015. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  7016. * (if the rx bandwidth was >= 80 MHz)
  7017. * Value: RSSI dB units w.r.t. noise floor
  7018. * - RSSI0_EXT80
  7019. * Bits 7:0
  7020. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  7021. * (if the rx bandwidth was >= 160 MHz)
  7022. * Value: RSSI dB units w.r.t. noise floor
  7023. *
  7024. * - RSSI1_PRI20
  7025. * Bits 7:0
  7026. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  7027. * Value: RSSI dB units w.r.t. noise floor
  7028. * - RSSI1_EXT20
  7029. * Bits 7:0
  7030. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  7031. * (if the rx bandwidth was >= 40 MHz)
  7032. * Value: RSSI dB units w.r.t. noise floor
  7033. * - RSSI1_EXT40
  7034. * Bits 7:0
  7035. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  7036. * (if the rx bandwidth was >= 80 MHz)
  7037. * Value: RSSI dB units w.r.t. noise floor
  7038. * - RSSI1_EXT80
  7039. * Bits 7:0
  7040. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  7041. * (if the rx bandwidth was >= 160 MHz)
  7042. * Value: RSSI dB units w.r.t. noise floor
  7043. *
  7044. * - RSSI2_PRI20
  7045. * Bits 7:0
  7046. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  7047. * Value: RSSI dB units w.r.t. noise floor
  7048. * - RSSI2_EXT20
  7049. * Bits 7:0
  7050. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  7051. * (if the rx bandwidth was >= 40 MHz)
  7052. * Value: RSSI dB units w.r.t. noise floor
  7053. * - RSSI2_EXT40
  7054. * Bits 7:0
  7055. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  7056. * (if the rx bandwidth was >= 80 MHz)
  7057. * Value: RSSI dB units w.r.t. noise floor
  7058. * - RSSI2_EXT80
  7059. * Bits 7:0
  7060. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  7061. * (if the rx bandwidth was >= 160 MHz)
  7062. * Value: RSSI dB units w.r.t. noise floor
  7063. *
  7064. * - RSSI3_PRI20
  7065. * Bits 7:0
  7066. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  7067. * Value: RSSI dB units w.r.t. noise floor
  7068. * - RSSI3_EXT20
  7069. * Bits 7:0
  7070. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  7071. * (if the rx bandwidth was >= 40 MHz)
  7072. * Value: RSSI dB units w.r.t. noise floor
  7073. * - RSSI3_EXT40
  7074. * Bits 7:0
  7075. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7076. * (if the rx bandwidth was >= 80 MHz)
  7077. * Value: RSSI dB units w.r.t. noise floor
  7078. * - RSSI3_EXT80
  7079. * Bits 7:0
  7080. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7081. * (if the rx bandwidth was >= 160 MHz)
  7082. * Value: RSSI dB units w.r.t. noise floor
  7083. *
  7084. * - TSF32
  7085. * Bits 31:0
  7086. * Purpose: specify the time the rx PPDU was received, in TSF units
  7087. * Value: 32 LSBs of the TSF
  7088. * - TIMESTAMP_MICROSEC
  7089. * Bits 31:0
  7090. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7091. * Value: PPDU rx time, in microseconds
  7092. * - VHT_SIG_A1
  7093. * Bits 23:0
  7094. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7095. * from the rx PPDU
  7096. * Value:
  7097. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7098. * VHT-SIG-A1 data.
  7099. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7100. * first 24 bits of the HT-SIG data.
  7101. * Otherwise, this field is invalid.
  7102. * Refer to the the 802.11 protocol for the definition of the
  7103. * HT-SIG and VHT-SIG-A1 fields
  7104. * - VHT_SIG_A2
  7105. * Bits 23:0
  7106. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7107. * from the rx PPDU
  7108. * Value:
  7109. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7110. * VHT-SIG-A2 data.
  7111. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7112. * last 24 bits of the HT-SIG data.
  7113. * Otherwise, this field is invalid.
  7114. * Refer to the the 802.11 protocol for the definition of the
  7115. * HT-SIG and VHT-SIG-A2 fields
  7116. * - PREAMBLE_TYPE
  7117. * Bits 31:24
  7118. * Purpose: indicate the PHY format of the received burst
  7119. * Value:
  7120. * 0x4: Legacy (OFDM/CCK)
  7121. * 0x8: HT
  7122. * 0x9: HT with TxBF
  7123. * 0xC: VHT
  7124. * 0xD: VHT with TxBF
  7125. * - SERVICE
  7126. * Bits 31:24
  7127. * Purpose: TBD
  7128. * Value: TBD
  7129. *
  7130. * Rx MSDU descriptor fields:
  7131. * - FW_RX_DESC_BYTES
  7132. * Bits 15:0
  7133. * Purpose: Indicate how many bytes in the Rx indication are used for
  7134. * FW Rx descriptors
  7135. *
  7136. * Payload fields:
  7137. * - MPDU_COUNT
  7138. * Bits 7:0
  7139. * Purpose: Indicate how many sequential MPDUs share the same status.
  7140. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7141. * - MPDU_STATUS
  7142. * Bits 15:8
  7143. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7144. * received successfully.
  7145. * Value:
  7146. * 0x1: success
  7147. * 0x2: FCS error
  7148. * 0x3: duplicate error
  7149. * 0x4: replay error
  7150. * 0x5: invalid peer
  7151. */
  7152. /* header fields */
  7153. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7154. #define HTT_RX_IND_EXT_TID_S 8
  7155. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7156. #define HTT_RX_IND_FLUSH_VALID_S 13
  7157. #define HTT_RX_IND_REL_VALID_M 0x4000
  7158. #define HTT_RX_IND_REL_VALID_S 14
  7159. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7160. #define HTT_RX_IND_PEER_ID_S 16
  7161. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7162. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7163. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7164. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7165. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7166. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7167. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7168. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7169. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7170. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7171. /* rx PPDU descriptor fields */
  7172. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7173. #define HTT_RX_IND_RSSI_CMB_S 0
  7174. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7175. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7176. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7177. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7178. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7179. #define HTT_RX_IND_PHY_ERR_S 24
  7180. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7181. #define HTT_RX_IND_LEGACY_RATE_S 25
  7182. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7183. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7184. #define HTT_RX_IND_END_VALID_M 0x40000000
  7185. #define HTT_RX_IND_END_VALID_S 30
  7186. #define HTT_RX_IND_START_VALID_M 0x80000000
  7187. #define HTT_RX_IND_START_VALID_S 31
  7188. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7189. #define HTT_RX_IND_RSSI_PRI20_S 0
  7190. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7191. #define HTT_RX_IND_RSSI_EXT20_S 8
  7192. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7193. #define HTT_RX_IND_RSSI_EXT40_S 16
  7194. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7195. #define HTT_RX_IND_RSSI_EXT80_S 24
  7196. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7197. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7198. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7199. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7200. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7201. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7202. #define HTT_RX_IND_SERVICE_M 0xff000000
  7203. #define HTT_RX_IND_SERVICE_S 24
  7204. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7205. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7206. /* rx MSDU descriptor fields */
  7207. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7208. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7209. /* payload fields */
  7210. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7211. #define HTT_RX_IND_MPDU_COUNT_S 0
  7212. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7213. #define HTT_RX_IND_MPDU_STATUS_S 8
  7214. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7215. do { \
  7216. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7217. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7218. } while (0)
  7219. #define HTT_RX_IND_EXT_TID_GET(word) \
  7220. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7221. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7222. do { \
  7223. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7224. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7225. } while (0)
  7226. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7227. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7228. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7229. do { \
  7230. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7231. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7232. } while (0)
  7233. #define HTT_RX_IND_REL_VALID_GET(word) \
  7234. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7235. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7236. do { \
  7237. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7238. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7239. } while (0)
  7240. #define HTT_RX_IND_PEER_ID_GET(word) \
  7241. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7242. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7243. do { \
  7244. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7245. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7246. } while (0)
  7247. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7248. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7249. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7250. do { \
  7251. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7252. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7253. } while (0)
  7254. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7255. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7256. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7257. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7258. do { \
  7259. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7260. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7261. } while (0)
  7262. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7263. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7264. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7265. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7266. do { \
  7267. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7268. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7269. } while (0)
  7270. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7271. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7272. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7273. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7274. do { \
  7275. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7276. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7277. } while (0)
  7278. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7279. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7280. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7281. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7282. do { \
  7283. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7284. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7285. } while (0)
  7286. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7287. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7288. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7289. /* FW rx PPDU descriptor fields */
  7290. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7291. do { \
  7292. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7293. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7294. } while (0)
  7295. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7296. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7297. HTT_RX_IND_RSSI_CMB_S)
  7298. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7299. do { \
  7300. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7301. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7302. } while (0)
  7303. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7304. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7305. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7306. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7307. do { \
  7308. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7309. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7310. } while (0)
  7311. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7312. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7313. HTT_RX_IND_PHY_ERR_CODE_S)
  7314. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7315. do { \
  7316. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7317. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7318. } while (0)
  7319. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7320. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7321. HTT_RX_IND_PHY_ERR_S)
  7322. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7323. do { \
  7324. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7325. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7326. } while (0)
  7327. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7328. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7329. HTT_RX_IND_LEGACY_RATE_S)
  7330. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7331. do { \
  7332. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7333. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7334. } while (0)
  7335. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7336. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7337. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7338. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7339. do { \
  7340. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7341. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7342. } while (0)
  7343. #define HTT_RX_IND_END_VALID_GET(word) \
  7344. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7345. HTT_RX_IND_END_VALID_S)
  7346. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7347. do { \
  7348. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7349. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7350. } while (0)
  7351. #define HTT_RX_IND_START_VALID_GET(word) \
  7352. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7353. HTT_RX_IND_START_VALID_S)
  7354. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7355. do { \
  7356. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7357. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7358. } while (0)
  7359. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7360. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7361. HTT_RX_IND_RSSI_PRI20_S)
  7362. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7363. do { \
  7364. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7365. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7366. } while (0)
  7367. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7368. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7369. HTT_RX_IND_RSSI_EXT20_S)
  7370. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7371. do { \
  7372. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7373. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7374. } while (0)
  7375. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7376. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7377. HTT_RX_IND_RSSI_EXT40_S)
  7378. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7379. do { \
  7380. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7381. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7382. } while (0)
  7383. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7384. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7385. HTT_RX_IND_RSSI_EXT80_S)
  7386. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7387. do { \
  7388. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7389. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7390. } while (0)
  7391. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7392. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7393. HTT_RX_IND_VHT_SIG_A1_S)
  7394. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7395. do { \
  7396. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7397. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7398. } while (0)
  7399. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7400. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7401. HTT_RX_IND_VHT_SIG_A2_S)
  7402. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7403. do { \
  7404. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7405. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7406. } while (0)
  7407. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7408. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7409. HTT_RX_IND_PREAMBLE_TYPE_S)
  7410. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7411. do { \
  7412. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7413. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7414. } while (0)
  7415. #define HTT_RX_IND_SERVICE_GET(word) \
  7416. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7417. HTT_RX_IND_SERVICE_S)
  7418. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7419. do { \
  7420. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7421. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7422. } while (0)
  7423. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7424. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7425. HTT_RX_IND_SA_ANT_MATRIX_S)
  7426. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7427. do { \
  7428. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7429. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7430. } while (0)
  7431. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7432. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7433. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7434. do { \
  7435. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7436. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7437. } while (0)
  7438. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7439. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7440. #define HTT_RX_IND_HL_BYTES \
  7441. (HTT_RX_IND_HDR_BYTES + \
  7442. 4 /* single FW rx MSDU descriptor */ + \
  7443. 4 /* single MPDU range information element */)
  7444. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7445. /* Could we use one macro entry? */
  7446. #define HTT_WORD_SET(word, field, value) \
  7447. do { \
  7448. HTT_CHECK_SET_VAL(field, value); \
  7449. (word) |= ((value) << field ## _S); \
  7450. } while (0)
  7451. #define HTT_WORD_GET(word, field) \
  7452. (((word) & field ## _M) >> field ## _S)
  7453. PREPACK struct hl_htt_rx_ind_base {
  7454. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7455. } POSTPACK;
  7456. /*
  7457. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7458. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7459. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7460. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7461. * htt_rx_ind_hl_rx_desc_t.
  7462. */
  7463. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7464. struct htt_rx_ind_hl_rx_desc_t {
  7465. A_UINT8 ver;
  7466. A_UINT8 len;
  7467. struct {
  7468. A_UINT8
  7469. first_msdu: 1,
  7470. last_msdu: 1,
  7471. c3_failed: 1,
  7472. c4_failed: 1,
  7473. ipv6: 1,
  7474. tcp: 1,
  7475. udp: 1,
  7476. reserved: 1;
  7477. } flags;
  7478. /* NOTE: no reserved space - don't append any new fields here */
  7479. };
  7480. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7481. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7482. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7483. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7484. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7485. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7486. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7487. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7488. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7489. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7490. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7491. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7492. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7493. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7494. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7495. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7496. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7497. /* This structure is used in HL, the basic descriptor information
  7498. * used by host. the structure is translated by FW from HW desc
  7499. * or generated by FW. But in HL monitor mode, the host would use
  7500. * the same structure with LL.
  7501. */
  7502. PREPACK struct hl_htt_rx_desc_base {
  7503. A_UINT32
  7504. seq_num:12,
  7505. encrypted:1,
  7506. chan_info_present:1,
  7507. resv0:2,
  7508. mcast_bcast:1,
  7509. fragment:1,
  7510. key_id_oct:8,
  7511. resv1:6;
  7512. A_UINT32
  7513. pn_31_0;
  7514. union {
  7515. struct {
  7516. A_UINT16 pn_47_32;
  7517. A_UINT16 pn_63_48;
  7518. } pn16;
  7519. A_UINT32 pn_63_32;
  7520. } u0;
  7521. A_UINT32
  7522. pn_95_64;
  7523. A_UINT32
  7524. pn_127_96;
  7525. } POSTPACK;
  7526. /*
  7527. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7528. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7529. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7530. * Please see htt_chan_change_t for description of the fields.
  7531. */
  7532. PREPACK struct htt_chan_info_t
  7533. {
  7534. A_UINT32 primary_chan_center_freq_mhz: 16,
  7535. contig_chan1_center_freq_mhz: 16;
  7536. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7537. phy_mode: 8,
  7538. reserved: 8;
  7539. } POSTPACK;
  7540. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7541. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7542. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7543. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7544. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7545. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7546. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7547. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7548. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7549. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7550. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7551. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7552. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7553. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7554. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7555. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7556. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7557. /* Channel information */
  7558. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7559. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7560. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7561. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7562. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7563. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7564. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7565. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7566. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7567. do { \
  7568. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7569. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7570. } while (0)
  7571. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7572. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7573. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7574. do { \
  7575. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7576. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7577. } while (0)
  7578. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7579. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7580. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7581. do { \
  7582. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7583. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7584. } while (0)
  7585. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7586. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7587. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7588. do { \
  7589. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7590. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7591. } while (0)
  7592. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7593. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7594. /*
  7595. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7596. * @brief target -> host message definition for FW offloaded pkts
  7597. *
  7598. * @details
  7599. * The following field definitions describe the format of the firmware
  7600. * offload deliver message sent from the target to the host.
  7601. *
  7602. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7603. *
  7604. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7605. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7606. * | reserved_1 | msg type |
  7607. * |--------------------------------------------------------------------------|
  7608. * | phy_timestamp_l32 |
  7609. * |--------------------------------------------------------------------------|
  7610. * | WORD2 (see below) |
  7611. * |--------------------------------------------------------------------------|
  7612. * | seqno | framectrl |
  7613. * |--------------------------------------------------------------------------|
  7614. * | reserved_3 | vdev_id | tid_num|
  7615. * |--------------------------------------------------------------------------|
  7616. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7617. * |--------------------------------------------------------------------------|
  7618. *
  7619. * where:
  7620. * STAT = status
  7621. * F = format (802.3 vs. 802.11)
  7622. *
  7623. * definition for word 2
  7624. *
  7625. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7626. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7627. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7628. * |--------------------------------------------------------------------------|
  7629. *
  7630. * where:
  7631. * PR = preamble
  7632. * BF = beamformed
  7633. */
  7634. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7635. {
  7636. A_UINT32 /* word 0 */
  7637. msg_type:8, /* [ 7: 0] */
  7638. reserved_1:24; /* [31: 8] */
  7639. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7640. A_UINT32 /* word 2 */
  7641. /* preamble:
  7642. * 0-OFDM,
  7643. * 1-CCk,
  7644. * 2-HT,
  7645. * 3-VHT
  7646. */
  7647. preamble: 2, /* [1:0] */
  7648. /* mcs:
  7649. * In case of HT preamble interpret
  7650. * MCS along with NSS.
  7651. * Valid values for HT are 0 to 7.
  7652. * HT mcs 0 with NSS 2 is mcs 8.
  7653. * Valid values for VHT are 0 to 9.
  7654. */
  7655. mcs: 4, /* [5:2] */
  7656. /* rate:
  7657. * This is applicable only for
  7658. * CCK and OFDM preamble type
  7659. * rate 0: OFDM 48 Mbps,
  7660. * 1: OFDM 24 Mbps,
  7661. * 2: OFDM 12 Mbps
  7662. * 3: OFDM 6 Mbps
  7663. * 4: OFDM 54 Mbps
  7664. * 5: OFDM 36 Mbps
  7665. * 6: OFDM 18 Mbps
  7666. * 7: OFDM 9 Mbps
  7667. * rate 0: CCK 11 Mbps Long
  7668. * 1: CCK 5.5 Mbps Long
  7669. * 2: CCK 2 Mbps Long
  7670. * 3: CCK 1 Mbps Long
  7671. * 4: CCK 11 Mbps Short
  7672. * 5: CCK 5.5 Mbps Short
  7673. * 6: CCK 2 Mbps Short
  7674. */
  7675. rate : 3, /* [ 8: 6] */
  7676. rssi : 8, /* [16: 9] units=dBm */
  7677. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7678. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7679. stbc : 1, /* [22] */
  7680. sgi : 1, /* [23] */
  7681. ldpc : 1, /* [24] */
  7682. beamformed: 1, /* [25] */
  7683. reserved_2: 6; /* [31:26] */
  7684. A_UINT32 /* word 3 */
  7685. framectrl:16, /* [15: 0] */
  7686. seqno:16; /* [31:16] */
  7687. A_UINT32 /* word 4 */
  7688. tid_num:5, /* [ 4: 0] actual TID number */
  7689. vdev_id:8, /* [12: 5] */
  7690. reserved_3:19; /* [31:13] */
  7691. A_UINT32 /* word 5 */
  7692. /* status:
  7693. * 0: tx_ok
  7694. * 1: retry
  7695. * 2: drop
  7696. * 3: filtered
  7697. * 4: abort
  7698. * 5: tid delete
  7699. * 6: sw abort
  7700. * 7: dropped by peer migration
  7701. */
  7702. status:3, /* [2:0] */
  7703. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7704. tx_mpdu_bytes:16, /* [19:4] */
  7705. /* Indicates retry count of offloaded/local generated Data tx frames */
  7706. tx_retry_cnt:6, /* [25:20] */
  7707. reserved_4:6; /* [31:26] */
  7708. } POSTPACK;
  7709. /* FW offload deliver ind message header fields */
  7710. /* DWORD one */
  7711. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7712. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7713. /* DWORD two */
  7714. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7715. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7716. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7717. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7718. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7719. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7720. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7721. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7722. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7723. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7724. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7725. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7726. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7727. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7728. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7729. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7730. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7731. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7732. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7733. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7734. /* DWORD three*/
  7735. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7736. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7737. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7738. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7739. /* DWORD four */
  7740. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7741. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7742. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7743. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7744. /* DWORD five */
  7745. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7746. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7747. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7748. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7749. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7750. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7751. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7752. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7753. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7754. do { \
  7755. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7756. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7757. } while (0)
  7758. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7759. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7760. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7761. do { \
  7762. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7763. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7764. } while (0)
  7765. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7766. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7767. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7768. do { \
  7769. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7770. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7771. } while (0)
  7772. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7773. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7774. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7775. do { \
  7776. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7777. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7778. } while (0)
  7779. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7780. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7781. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7782. do { \
  7783. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7784. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7785. } while (0)
  7786. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7787. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7788. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7789. do { \
  7790. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7791. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7792. } while (0)
  7793. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7794. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7795. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7796. do { \
  7797. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7798. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7799. } while (0)
  7800. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7801. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7802. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7803. do { \
  7804. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7805. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7806. } while (0)
  7807. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7808. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7809. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7810. do { \
  7811. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7812. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7813. } while (0)
  7814. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7815. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7816. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7817. do { \
  7818. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7819. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7820. } while (0)
  7821. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7822. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7823. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7824. do { \
  7825. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7826. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7827. } while (0)
  7828. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7829. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7830. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7831. do { \
  7832. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7833. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7834. } while (0)
  7835. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7836. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7837. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7838. do { \
  7839. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7840. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7841. } while (0)
  7842. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7843. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7844. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7845. do { \
  7846. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7847. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7848. } while (0)
  7849. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7850. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7851. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7852. do { \
  7853. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7854. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7855. } while (0)
  7856. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7857. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7858. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7859. do { \
  7860. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7861. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7862. } while (0)
  7863. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7864. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7865. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7866. do { \
  7867. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7868. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7869. } while (0)
  7870. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7871. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7872. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7873. do { \
  7874. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7875. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7876. } while (0)
  7877. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7878. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7879. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7880. do { \
  7881. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7882. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7883. } while (0)
  7884. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7885. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7886. /*
  7887. * @brief target -> host rx reorder flush message definition
  7888. *
  7889. * @details
  7890. * The following field definitions describe the format of the rx flush
  7891. * message sent from the target to the host.
  7892. * The message consists of a 4-octet header, followed by one or more
  7893. * 4-octet payload information elements.
  7894. *
  7895. * |31 24|23 8|7 0|
  7896. * |--------------------------------------------------------------|
  7897. * | TID | peer ID | msg type |
  7898. * |--------------------------------------------------------------|
  7899. * | seq num end | seq num start | MPDU status | reserved |
  7900. * |--------------------------------------------------------------|
  7901. * First DWORD:
  7902. * - MSG_TYPE
  7903. * Bits 7:0
  7904. * Purpose: identifies this as an rx flush message
  7905. * Value: 0x2
  7906. * - PEER_ID
  7907. * Bits 23:8 (only bits 18:8 actually used)
  7908. * Purpose: identify which peer's rx data is being flushed
  7909. * Value: (rx) peer ID
  7910. * - TID
  7911. * Bits 31:24 (only bits 27:24 actually used)
  7912. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7913. * Value: traffic identifier
  7914. * Second DWORD:
  7915. * - MPDU_STATUS
  7916. * Bits 15:8
  7917. * Purpose:
  7918. * Indicate whether the flushed MPDUs should be discarded or processed.
  7919. * Value:
  7920. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7921. * stages of rx processing
  7922. * other: discard the MPDUs
  7923. * It is anticipated that flush messages will always have
  7924. * MPDU status == 1, but the status flag is included for
  7925. * flexibility.
  7926. * - SEQ_NUM_START
  7927. * Bits 23:16
  7928. * Purpose:
  7929. * Indicate the start of a series of consecutive MPDUs being flushed.
  7930. * Not all MPDUs within this range are necessarily valid - the host
  7931. * must check each sequence number within this range to see if the
  7932. * corresponding MPDU is actually present.
  7933. * Value:
  7934. * The sequence number for the first MPDU in the sequence.
  7935. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7936. * - SEQ_NUM_END
  7937. * Bits 30:24
  7938. * Purpose:
  7939. * Indicate the end of a series of consecutive MPDUs being flushed.
  7940. * Value:
  7941. * The sequence number one larger than the sequence number of the
  7942. * last MPDU being flushed.
  7943. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7944. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7945. * are to be released for further rx processing.
  7946. * Not all MPDUs within this range are necessarily valid - the host
  7947. * must check each sequence number within this range to see if the
  7948. * corresponding MPDU is actually present.
  7949. */
  7950. /* first DWORD */
  7951. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7952. #define HTT_RX_FLUSH_PEER_ID_S 8
  7953. #define HTT_RX_FLUSH_TID_M 0xff000000
  7954. #define HTT_RX_FLUSH_TID_S 24
  7955. /* second DWORD */
  7956. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7957. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7958. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7959. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7960. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7961. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7962. #define HTT_RX_FLUSH_BYTES 8
  7963. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7964. do { \
  7965. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7966. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7967. } while (0)
  7968. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7969. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7970. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7971. do { \
  7972. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7973. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7974. } while (0)
  7975. #define HTT_RX_FLUSH_TID_GET(word) \
  7976. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7977. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7978. do { \
  7979. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7980. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7981. } while (0)
  7982. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7983. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7984. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7985. do { \
  7986. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7987. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7988. } while (0)
  7989. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7990. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7991. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7992. do { \
  7993. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7994. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7995. } while (0)
  7996. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7997. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7998. /*
  7999. * @brief target -> host rx pn check indication message
  8000. *
  8001. * @details
  8002. * The following field definitions describe the format of the Rx PN check
  8003. * indication message sent from the target to the host.
  8004. * The message consists of a 4-octet header, followed by the start and
  8005. * end sequence numbers to be released, followed by the PN IEs. Each PN
  8006. * IE is one octet containing the sequence number that failed the PN
  8007. * check.
  8008. *
  8009. * |31 24|23 8|7 0|
  8010. * |--------------------------------------------------------------|
  8011. * | TID | peer ID | msg type |
  8012. * |--------------------------------------------------------------|
  8013. * | Reserved | PN IE count | seq num end | seq num start|
  8014. * |--------------------------------------------------------------|
  8015. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  8016. * |--------------------------------------------------------------|
  8017. * First DWORD:
  8018. * - MSG_TYPE
  8019. * Bits 7:0
  8020. * Purpose: Identifies this as an rx pn check indication message
  8021. * Value: 0x2
  8022. * - PEER_ID
  8023. * Bits 23:8 (only bits 18:8 actually used)
  8024. * Purpose: identify which peer
  8025. * Value: (rx) peer ID
  8026. * - TID
  8027. * Bits 31:24 (only bits 27:24 actually used)
  8028. * Purpose: identify traffic identifier
  8029. * Value: traffic identifier
  8030. * Second DWORD:
  8031. * - SEQ_NUM_START
  8032. * Bits 7:0
  8033. * Purpose:
  8034. * Indicates the starting sequence number of the MPDU in this
  8035. * series of MPDUs that went though PN check.
  8036. * Value:
  8037. * The sequence number for the first MPDU in the sequence.
  8038. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8039. * - SEQ_NUM_END
  8040. * Bits 15:8
  8041. * Purpose:
  8042. * Indicates the ending sequence number of the MPDU in this
  8043. * series of MPDUs that went though PN check.
  8044. * Value:
  8045. * The sequence number one larger then the sequence number of the last
  8046. * MPDU being flushed.
  8047. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  8048. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  8049. * for invalid PN numbers and are ready to be released for further processing.
  8050. * Not all MPDUs within this range are necessarily valid - the host
  8051. * must check each sequence number within this range to see if the
  8052. * corresponding MPDU is actually present.
  8053. * - PN_IE_COUNT
  8054. * Bits 23:16
  8055. * Purpose:
  8056. * Used to determine the variable number of PN information elements in this
  8057. * message
  8058. *
  8059. * PN information elements:
  8060. * - PN_IE_x-
  8061. * Purpose:
  8062. * Each PN information element contains the sequence number of the MPDU that
  8063. * has failed the target PN check.
  8064. * Value:
  8065. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  8066. * that failed the PN check.
  8067. */
  8068. /* first DWORD */
  8069. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  8070. #define HTT_RX_PN_IND_PEER_ID_S 8
  8071. #define HTT_RX_PN_IND_TID_M 0xff000000
  8072. #define HTT_RX_PN_IND_TID_S 24
  8073. /* second DWORD */
  8074. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8075. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8076. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8077. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8078. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8079. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8080. #define HTT_RX_PN_IND_BYTES 8
  8081. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8082. do { \
  8083. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8084. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8085. } while (0)
  8086. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8087. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8088. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8089. do { \
  8090. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8091. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8092. } while (0)
  8093. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8094. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8095. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8096. do { \
  8097. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8098. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8099. } while (0)
  8100. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8101. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8102. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8103. do { \
  8104. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8105. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8106. } while (0)
  8107. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8108. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8109. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8110. do { \
  8111. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8112. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8113. } while (0)
  8114. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8115. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8116. /*
  8117. * @brief target -> host rx offload deliver message for LL system
  8118. *
  8119. * @details
  8120. * In a low latency system this message is sent whenever the offload
  8121. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8122. * The DMA of the actual packets into host memory is done before sending out
  8123. * this message. This message indicates only how many MSDUs to reap. The
  8124. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8125. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8126. * DMA'd by the MAC directly into host memory these packets do not contain
  8127. * the MAC descriptors in the header portion of the packet. Instead they contain
  8128. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8129. * message, the packets are delivered directly to the NW stack without going
  8130. * through the regular reorder buffering and PN checking path since it has
  8131. * already been done in target.
  8132. *
  8133. * |31 24|23 16|15 8|7 0|
  8134. * |-----------------------------------------------------------------------|
  8135. * | Total MSDU count | reserved | msg type |
  8136. * |-----------------------------------------------------------------------|
  8137. *
  8138. * @brief target -> host rx offload deliver message for HL system
  8139. *
  8140. * @details
  8141. * In a high latency system this message is sent whenever the offload manager
  8142. * flushes out the packets it has coalesced in its coalescing buffer. The
  8143. * actual packets are also carried along with this message. When the host
  8144. * receives this message, it is expected to deliver these packets to the NW
  8145. * stack directly instead of routing them through the reorder buffering and
  8146. * PN checking path since it has already been done in target.
  8147. *
  8148. * |31 24|23 16|15 8|7 0|
  8149. * |-----------------------------------------------------------------------|
  8150. * | Total MSDU count | reserved | msg type |
  8151. * |-----------------------------------------------------------------------|
  8152. * | peer ID | MSDU length |
  8153. * |-----------------------------------------------------------------------|
  8154. * | MSDU payload | FW Desc | tid | vdev ID |
  8155. * |-----------------------------------------------------------------------|
  8156. * | MSDU payload contd. |
  8157. * |-----------------------------------------------------------------------|
  8158. * | peer ID | MSDU length |
  8159. * |-----------------------------------------------------------------------|
  8160. * | MSDU payload | FW Desc | tid | vdev ID |
  8161. * |-----------------------------------------------------------------------|
  8162. * | MSDU payload contd. |
  8163. * |-----------------------------------------------------------------------|
  8164. *
  8165. */
  8166. /* first DWORD */
  8167. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8168. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8169. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8170. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8171. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8172. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8173. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8174. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8175. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8176. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8177. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8178. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8179. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8180. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8181. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8182. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8183. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8184. do { \
  8185. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8186. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8187. } while (0)
  8188. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8189. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8190. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8191. do { \
  8192. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8193. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8194. } while (0)
  8195. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8196. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8197. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8198. do { \
  8199. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8200. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8201. } while (0)
  8202. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8203. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8204. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8205. do { \
  8206. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8207. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8208. } while (0)
  8209. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8210. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8211. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8212. do { \
  8213. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8214. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8215. } while (0)
  8216. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8217. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8218. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8219. do { \
  8220. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8221. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8222. } while (0)
  8223. /**
  8224. * @brief target -> host rx peer map/unmap message definition
  8225. *
  8226. * @details
  8227. * The following diagram shows the format of the rx peer map message sent
  8228. * from the target to the host. This layout assumes the target operates
  8229. * as little-endian.
  8230. *
  8231. * This message always contains a SW peer ID. The main purpose of the
  8232. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8233. * with, so that the host can use that peer ID to determine which peer
  8234. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8235. * other purposes, such as identifying during tx completions which peer
  8236. * the tx frames in question were transmitted to.
  8237. *
  8238. * In certain generations of chips, the peer map message also contains
  8239. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8240. * to identify which peer the frame needs to be forwarded to (i.e. the
  8241. * peer assocated with the Destination MAC Address within the packet),
  8242. * and particularly which vdev needs to transmit the frame (for cases
  8243. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8244. * meaning as AST_INDEX_0.
  8245. * This DA-based peer ID that is provided for certain rx frames
  8246. * (the rx frames that need to be re-transmitted as tx frames)
  8247. * is the ID that the HW uses for referring to the peer in question,
  8248. * rather than the peer ID that the SW+FW use to refer to the peer.
  8249. *
  8250. *
  8251. * |31 24|23 16|15 8|7 0|
  8252. * |-----------------------------------------------------------------------|
  8253. * | SW peer ID | VDEV ID | msg type |
  8254. * |-----------------------------------------------------------------------|
  8255. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8256. * |-----------------------------------------------------------------------|
  8257. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8258. * |-----------------------------------------------------------------------|
  8259. *
  8260. *
  8261. * The following diagram shows the format of the rx peer unmap message sent
  8262. * from the target to the host.
  8263. *
  8264. * |31 24|23 16|15 8|7 0|
  8265. * |-----------------------------------------------------------------------|
  8266. * | SW peer ID | VDEV ID | msg type |
  8267. * |-----------------------------------------------------------------------|
  8268. *
  8269. * The following field definitions describe the format of the rx peer map
  8270. * and peer unmap messages sent from the target to the host.
  8271. * - MSG_TYPE
  8272. * Bits 7:0
  8273. * Purpose: identifies this as an rx peer map or peer unmap message
  8274. * Value: peer map -> 0x3, peer unmap -> 0x4
  8275. * - VDEV_ID
  8276. * Bits 15:8
  8277. * Purpose: Indicates which virtual device the peer is associated
  8278. * with.
  8279. * Value: vdev ID (used in the host to look up the vdev object)
  8280. * - PEER_ID (a.k.a. SW_PEER_ID)
  8281. * Bits 31:16
  8282. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8283. * freeing (unmap)
  8284. * Value: (rx) peer ID
  8285. * - MAC_ADDR_L32 (peer map only)
  8286. * Bits 31:0
  8287. * Purpose: Identifies which peer node the peer ID is for.
  8288. * Value: lower 4 bytes of peer node's MAC address
  8289. * - MAC_ADDR_U16 (peer map only)
  8290. * Bits 15:0
  8291. * Purpose: Identifies which peer node the peer ID is for.
  8292. * Value: upper 2 bytes of peer node's MAC address
  8293. * - HW_PEER_ID
  8294. * Bits 31:16
  8295. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8296. * address, so for rx frames marked for rx --> tx forwarding, the
  8297. * host can determine from the HW peer ID provided as meta-data with
  8298. * the rx frame which peer the frame is supposed to be forwarded to.
  8299. * Value: ID used by the MAC HW to identify the peer
  8300. */
  8301. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8302. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8303. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8304. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8305. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8306. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8307. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8308. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8309. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8310. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8311. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8312. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8313. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8314. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8315. do { \
  8316. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8317. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8318. } while (0)
  8319. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8320. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8321. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8322. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8323. do { \
  8324. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8325. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8326. } while (0)
  8327. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8328. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8329. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8330. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8331. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8332. do { \
  8333. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8334. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8335. } while (0)
  8336. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8337. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8338. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8339. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8340. #define HTT_RX_PEER_MAP_BYTES 12
  8341. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8342. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8343. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8344. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8345. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8346. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8347. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8348. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8349. #define HTT_RX_PEER_UNMAP_BYTES 4
  8350. /**
  8351. * @brief target -> host rx peer map V2 message definition
  8352. *
  8353. * @details
  8354. * The following diagram shows the format of the rx peer map v2 message sent
  8355. * from the target to the host. This layout assumes the target operates
  8356. * as little-endian.
  8357. *
  8358. * This message always contains a SW peer ID. The main purpose of the
  8359. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8360. * with, so that the host can use that peer ID to determine which peer
  8361. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8362. * other purposes, such as identifying during tx completions which peer
  8363. * the tx frames in question were transmitted to.
  8364. *
  8365. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8366. * is used during rx --> tx frame forwarding to identify which peer the
  8367. * frame needs to be forwarded to (i.e. the peer assocated with the
  8368. * Destination MAC Address within the packet), and particularly which vdev
  8369. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8370. * This DA-based peer ID that is provided for certain rx frames
  8371. * (the rx frames that need to be re-transmitted as tx frames)
  8372. * is the ID that the HW uses for referring to the peer in question,
  8373. * rather than the peer ID that the SW+FW use to refer to the peer.
  8374. *
  8375. * The HW peer id here is the same meaning as AST_INDEX_0.
  8376. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8377. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8378. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8379. * AST is valid.
  8380. *
  8381. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  8382. * |-------------------------------------------------------------------------|
  8383. * | SW peer ID | VDEV ID | msg type |
  8384. * |-------------------------------------------------------------------------|
  8385. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8386. * |-------------------------------------------------------------------------|
  8387. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8388. * |-------------------------------------------------------------------------|
  8389. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  8390. * |-------------------------------------------------------------------------|
  8391. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8392. * |-------------------------------------------------------------------------|
  8393. * |TID valid low pri| TID valid hi pri | AST index 2 |
  8394. * |-------------------------------------------------------------------------|
  8395. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  8396. * |-------------------------------------------------------------------------|
  8397. * | Reserved_2 |
  8398. * |-------------------------------------------------------------------------|
  8399. * Where:
  8400. * NH = Next Hop
  8401. * ASTVM = AST valid mask
  8402. * OA = on-chip AST valid bit
  8403. * ASTFM = AST flow mask
  8404. *
  8405. * The following field definitions describe the format of the rx peer map v2
  8406. * messages sent from the target to the host.
  8407. * - MSG_TYPE
  8408. * Bits 7:0
  8409. * Purpose: identifies this as an rx peer map v2 message
  8410. * Value: peer map v2 -> 0x1e
  8411. * - VDEV_ID
  8412. * Bits 15:8
  8413. * Purpose: Indicates which virtual device the peer is associated with.
  8414. * Value: vdev ID (used in the host to look up the vdev object)
  8415. * - SW_PEER_ID
  8416. * Bits 31:16
  8417. * Purpose: The peer ID (index) that WAL is allocating
  8418. * Value: (rx) peer ID
  8419. * - MAC_ADDR_L32
  8420. * Bits 31:0
  8421. * Purpose: Identifies which peer node the peer ID is for.
  8422. * Value: lower 4 bytes of peer node's MAC address
  8423. * - MAC_ADDR_U16
  8424. * Bits 15:0
  8425. * Purpose: Identifies which peer node the peer ID is for.
  8426. * Value: upper 2 bytes of peer node's MAC address
  8427. * - HW_PEER_ID / AST_INDEX_0
  8428. * Bits 31:16
  8429. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8430. * address, so for rx frames marked for rx --> tx forwarding, the
  8431. * host can determine from the HW peer ID provided as meta-data with
  8432. * the rx frame which peer the frame is supposed to be forwarded to.
  8433. * Value: ID used by the MAC HW to identify the peer
  8434. * - AST_HASH_VALUE
  8435. * Bits 15:0
  8436. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8437. * override feature.
  8438. * - NEXT_HOP
  8439. * Bit 16
  8440. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8441. * (Wireless Distribution System).
  8442. * - AST_VALID_MASK
  8443. * Bits 19:17
  8444. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8445. * - ONCHIP_AST_VALID_FLAG
  8446. * Bit 20
  8447. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  8448. * is valid.
  8449. * - AST_INDEX_1
  8450. * Bits 15:0
  8451. * Purpose: indicate the second AST index for this peer
  8452. * - AST_0_FLOW_MASK
  8453. * Bits 19:16
  8454. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8455. * - AST_1_FLOW_MASK
  8456. * Bits 23:20
  8457. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8458. * - AST_2_FLOW_MASK
  8459. * Bits 27:24
  8460. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8461. * - AST_3_FLOW_MASK
  8462. * Bits 31:28
  8463. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8464. * - AST_INDEX_2
  8465. * Bits 15:0
  8466. * Purpose: indicate the third AST index for this peer
  8467. * - TID_VALID_HI_PRI
  8468. * Bits 23:16
  8469. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8470. * - TID_VALID_LOW_PRI
  8471. * Bits 31:24
  8472. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8473. * - AST_INDEX_3
  8474. * Bits 15:0
  8475. * Purpose: indicate the fourth AST index for this peer
  8476. * - ONCHIP_AST_IDX / RESERVED
  8477. * Bits 31:16
  8478. * Purpose: This field is valid only when split AST feature is enabled.
  8479. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  8480. * If valid, identifies the HW peer ID corresponding to the peer MAC
  8481. * address, this ast_idx is used for LMAC modules for RXPCU.
  8482. * Value: ID used by the LMAC HW to identify the peer
  8483. */
  8484. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8485. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8486. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8487. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8488. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8489. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8490. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8491. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8492. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8493. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8494. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8495. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8496. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8497. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8498. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8499. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8500. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  8501. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  8502. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8503. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8504. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8505. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8506. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8507. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8508. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8509. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8510. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8511. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8512. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8513. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8514. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8515. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8516. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8517. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8518. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8519. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8520. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  8521. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  8522. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8523. do { \
  8524. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8525. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8526. } while (0)
  8527. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8528. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8529. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8530. do { \
  8531. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8532. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8533. } while (0)
  8534. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8535. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8536. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8537. do { \
  8538. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8539. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8540. } while (0)
  8541. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8542. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8543. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8544. do { \
  8545. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8546. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8547. } while (0)
  8548. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8549. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8550. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  8551. do { \
  8552. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  8553. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  8554. } while (0)
  8555. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  8556. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  8557. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8558. do { \
  8559. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8560. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8561. } while (0)
  8562. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8563. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8564. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8565. do { \
  8566. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8567. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8568. } while (0)
  8569. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8570. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8571. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  8572. do { \
  8573. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  8574. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  8575. } while (0)
  8576. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  8577. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  8578. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8579. do { \
  8580. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8581. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8582. } while (0)
  8583. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8584. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8585. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8586. do { \
  8587. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8588. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8589. } while (0)
  8590. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8591. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8592. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8593. do { \
  8594. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8595. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8596. } while (0)
  8597. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8598. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8599. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8600. do { \
  8601. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8602. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8603. } while (0)
  8604. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8605. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8606. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8607. do { \
  8608. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8609. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8610. } while (0)
  8611. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8612. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8613. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8614. do { \
  8615. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8616. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8617. } while (0)
  8618. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8619. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8620. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8621. do { \
  8622. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8623. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8624. } while (0)
  8625. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8626. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8627. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8628. do { \
  8629. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8630. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8631. } while (0)
  8632. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8633. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8634. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8635. do { \
  8636. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8637. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8638. } while (0)
  8639. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8640. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8641. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8642. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8643. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8644. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8645. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8646. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8647. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8648. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8649. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8650. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8651. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8652. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8653. /**
  8654. * @brief target -> host rx peer unmap V2 message definition
  8655. *
  8656. *
  8657. * The following diagram shows the format of the rx peer unmap message sent
  8658. * from the target to the host.
  8659. *
  8660. * |31 24|23 16|15 8|7 0|
  8661. * |-----------------------------------------------------------------------|
  8662. * | SW peer ID | VDEV ID | msg type |
  8663. * |-----------------------------------------------------------------------|
  8664. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8665. * |-----------------------------------------------------------------------|
  8666. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8667. * |-----------------------------------------------------------------------|
  8668. * | Peer Delete Duration |
  8669. * |-----------------------------------------------------------------------|
  8670. * | Reserved_0 | WDS Free Count |
  8671. * |-----------------------------------------------------------------------|
  8672. * | Reserved_1 |
  8673. * |-----------------------------------------------------------------------|
  8674. * | Reserved_2 |
  8675. * |-----------------------------------------------------------------------|
  8676. *
  8677. *
  8678. * The following field definitions describe the format of the rx peer unmap
  8679. * messages sent from the target to the host.
  8680. * - MSG_TYPE
  8681. * Bits 7:0
  8682. * Purpose: identifies this as an rx peer unmap v2 message
  8683. * Value: peer unmap v2 -> 0x1f
  8684. * - VDEV_ID
  8685. * Bits 15:8
  8686. * Purpose: Indicates which virtual device the peer is associated
  8687. * with.
  8688. * Value: vdev ID (used in the host to look up the vdev object)
  8689. * - SW_PEER_ID
  8690. * Bits 31:16
  8691. * Purpose: The peer ID (index) that WAL is freeing
  8692. * Value: (rx) peer ID
  8693. * - MAC_ADDR_L32
  8694. * Bits 31:0
  8695. * Purpose: Identifies which peer node the peer ID is for.
  8696. * Value: lower 4 bytes of peer node's MAC address
  8697. * - MAC_ADDR_U16
  8698. * Bits 15:0
  8699. * Purpose: Identifies which peer node the peer ID is for.
  8700. * Value: upper 2 bytes of peer node's MAC address
  8701. * - NEXT_HOP
  8702. * Bits 16
  8703. * Purpose: Bit indicates next_hop AST entry used for WDS
  8704. * (Wireless Distribution System).
  8705. * - PEER_DELETE_DURATION
  8706. * Bits 31:0
  8707. * Purpose: Time taken to delete peer, in msec,
  8708. * Used for monitoring / debugging PEER delete response delay
  8709. * - PEER_WDS_FREE_COUNT
  8710. * Bits 15:0
  8711. * Purpose: Count of WDS entries deleted associated to peer deleted
  8712. */
  8713. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8714. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8715. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8716. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8717. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8718. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8719. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8720. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8721. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8722. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8723. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8724. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8725. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8726. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8727. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8728. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8729. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8730. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8731. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8732. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8733. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8734. do { \
  8735. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8736. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8737. } while (0)
  8738. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8739. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8740. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8741. do { \
  8742. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8743. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8744. } while (0)
  8745. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8746. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8747. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8748. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8749. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8750. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8751. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8752. /**
  8753. * @brief target -> host message specifying security parameters
  8754. *
  8755. * @details
  8756. * The following diagram shows the format of the security specification
  8757. * message sent from the target to the host.
  8758. * This security specification message tells the host whether a PN check is
  8759. * necessary on rx data frames, and if so, how large the PN counter is.
  8760. * This message also tells the host about the security processing to apply
  8761. * to defragmented rx frames - specifically, whether a Message Integrity
  8762. * Check is required, and the Michael key to use.
  8763. *
  8764. * |31 24|23 16|15|14 8|7 0|
  8765. * |-----------------------------------------------------------------------|
  8766. * | peer ID | U| security type | msg type |
  8767. * |-----------------------------------------------------------------------|
  8768. * | Michael Key K0 |
  8769. * |-----------------------------------------------------------------------|
  8770. * | Michael Key K1 |
  8771. * |-----------------------------------------------------------------------|
  8772. * | WAPI RSC Low0 |
  8773. * |-----------------------------------------------------------------------|
  8774. * | WAPI RSC Low1 |
  8775. * |-----------------------------------------------------------------------|
  8776. * | WAPI RSC Hi0 |
  8777. * |-----------------------------------------------------------------------|
  8778. * | WAPI RSC Hi1 |
  8779. * |-----------------------------------------------------------------------|
  8780. *
  8781. * The following field definitions describe the format of the security
  8782. * indication message sent from the target to the host.
  8783. * - MSG_TYPE
  8784. * Bits 7:0
  8785. * Purpose: identifies this as a security specification message
  8786. * Value: 0xb
  8787. * - SEC_TYPE
  8788. * Bits 14:8
  8789. * Purpose: specifies which type of security applies to the peer
  8790. * Value: htt_sec_type enum value
  8791. * - UNICAST
  8792. * Bit 15
  8793. * Purpose: whether this security is applied to unicast or multicast data
  8794. * Value: 1 -> unicast, 0 -> multicast
  8795. * - PEER_ID
  8796. * Bits 31:16
  8797. * Purpose: The ID number for the peer the security specification is for
  8798. * Value: peer ID
  8799. * - MICHAEL_KEY_K0
  8800. * Bits 31:0
  8801. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8802. * Value: Michael Key K0 (if security type is TKIP)
  8803. * - MICHAEL_KEY_K1
  8804. * Bits 31:0
  8805. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8806. * Value: Michael Key K1 (if security type is TKIP)
  8807. * - WAPI_RSC_LOW0
  8808. * Bits 31:0
  8809. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8810. * Value: WAPI RSC Low0 (if security type is WAPI)
  8811. * - WAPI_RSC_LOW1
  8812. * Bits 31:0
  8813. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8814. * Value: WAPI RSC Low1 (if security type is WAPI)
  8815. * - WAPI_RSC_HI0
  8816. * Bits 31:0
  8817. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8818. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8819. * - WAPI_RSC_HI1
  8820. * Bits 31:0
  8821. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8822. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8823. */
  8824. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8825. #define HTT_SEC_IND_SEC_TYPE_S 8
  8826. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8827. #define HTT_SEC_IND_UNICAST_S 15
  8828. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8829. #define HTT_SEC_IND_PEER_ID_S 16
  8830. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8831. do { \
  8832. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8833. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8834. } while (0)
  8835. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8836. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8837. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8838. do { \
  8839. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8840. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8841. } while (0)
  8842. #define HTT_SEC_IND_UNICAST_GET(word) \
  8843. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8844. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8845. do { \
  8846. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8847. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8848. } while (0)
  8849. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8850. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8851. #define HTT_SEC_IND_BYTES 28
  8852. /**
  8853. * @brief target -> host rx ADDBA / DELBA message definitions
  8854. *
  8855. * @details
  8856. * The following diagram shows the format of the rx ADDBA message sent
  8857. * from the target to the host:
  8858. *
  8859. * |31 20|19 16|15 8|7 0|
  8860. * |---------------------------------------------------------------------|
  8861. * | peer ID | TID | window size | msg type |
  8862. * |---------------------------------------------------------------------|
  8863. *
  8864. * The following diagram shows the format of the rx DELBA message sent
  8865. * from the target to the host:
  8866. *
  8867. * |31 20|19 16|15 10|9 8|7 0|
  8868. * |---------------------------------------------------------------------|
  8869. * | peer ID | TID | window size | IR| msg type |
  8870. * |---------------------------------------------------------------------|
  8871. *
  8872. * The following field definitions describe the format of the rx ADDBA
  8873. * and DELBA messages sent from the target to the host.
  8874. * - MSG_TYPE
  8875. * Bits 7:0
  8876. * Purpose: identifies this as an rx ADDBA or DELBA message
  8877. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8878. * - IR (initiator / recipient)
  8879. * Bits 9:8 (DELBA only)
  8880. * Purpose: specify whether the DELBA handshake was initiated by the
  8881. * local STA/AP, or by the peer STA/AP
  8882. * Value:
  8883. * 0 - unspecified
  8884. * 1 - initiator (a.k.a. originator)
  8885. * 2 - recipient (a.k.a. responder)
  8886. * 3 - unused / reserved
  8887. * - WIN_SIZE
  8888. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  8889. * Purpose: Specifies the length of the block ack window (max = 64).
  8890. * Value:
  8891. * block ack window length specified by the received ADDBA/DELBA
  8892. * management message.
  8893. * - TID
  8894. * Bits 19:16
  8895. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8896. * Value:
  8897. * TID specified by the received ADDBA or DELBA management message.
  8898. * - PEER_ID
  8899. * Bits 31:20
  8900. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8901. * Value:
  8902. * ID (hash value) used by the host for fast, direct lookup of
  8903. * host SW peer info, including rx reorder states.
  8904. */
  8905. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8906. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8907. #define HTT_RX_ADDBA_TID_M 0xf0000
  8908. #define HTT_RX_ADDBA_TID_S 16
  8909. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8910. #define HTT_RX_ADDBA_PEER_ID_S 20
  8911. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8912. do { \
  8913. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8914. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8915. } while (0)
  8916. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8917. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8918. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8919. do { \
  8920. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8921. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8922. } while (0)
  8923. #define HTT_RX_ADDBA_TID_GET(word) \
  8924. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8925. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8926. do { \
  8927. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8928. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8929. } while (0)
  8930. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8931. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8932. #define HTT_RX_ADDBA_BYTES 4
  8933. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8934. #define HTT_RX_DELBA_INITIATOR_S 8
  8935. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  8936. #define HTT_RX_DELBA_WIN_SIZE_S 10
  8937. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8938. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8939. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8940. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8941. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8942. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8943. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8944. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8945. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8946. do { \
  8947. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8948. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8949. } while (0)
  8950. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8951. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8952. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  8953. do { \
  8954. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  8955. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  8956. } while (0)
  8957. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  8958. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  8959. #define HTT_RX_DELBA_BYTES 4
  8960. /**
  8961. * @brief tx queue group information element definition
  8962. *
  8963. * @details
  8964. * The following diagram shows the format of the tx queue group
  8965. * information element, which can be included in target --> host
  8966. * messages to specify the number of tx "credits" (tx descriptors
  8967. * for LL, or tx buffers for HL) available to a particular group
  8968. * of host-side tx queues, and which host-side tx queues belong to
  8969. * the group.
  8970. *
  8971. * |31|30 24|23 16|15|14|13 0|
  8972. * |------------------------------------------------------------------------|
  8973. * | X| reserved | tx queue grp ID | A| S| credit count |
  8974. * |------------------------------------------------------------------------|
  8975. * | vdev ID mask | AC mask |
  8976. * |------------------------------------------------------------------------|
  8977. *
  8978. * The following definitions describe the fields within the tx queue group
  8979. * information element:
  8980. * - credit_count
  8981. * Bits 13:1
  8982. * Purpose: specify how many tx credits are available to the tx queue group
  8983. * Value: An absolute or relative, positive or negative credit value
  8984. * The 'A' bit specifies whether the value is absolute or relative.
  8985. * The 'S' bit specifies whether the value is positive or negative.
  8986. * A negative value can only be relative, not absolute.
  8987. * An absolute value replaces any prior credit value the host has for
  8988. * the tx queue group in question.
  8989. * A relative value is added to the prior credit value the host has for
  8990. * the tx queue group in question.
  8991. * - sign
  8992. * Bit 14
  8993. * Purpose: specify whether the credit count is positive or negative
  8994. * Value: 0 -> positive, 1 -> negative
  8995. * - absolute
  8996. * Bit 15
  8997. * Purpose: specify whether the credit count is absolute or relative
  8998. * Value: 0 -> relative, 1 -> absolute
  8999. * - txq_group_id
  9000. * Bits 23:16
  9001. * Purpose: indicate which tx queue group's credit and/or membership are
  9002. * being specified
  9003. * Value: 0 to max_tx_queue_groups-1
  9004. * - reserved
  9005. * Bits 30:16
  9006. * Value: 0x0
  9007. * - eXtension
  9008. * Bit 31
  9009. * Purpose: specify whether another tx queue group info element follows
  9010. * Value: 0 -> no more tx queue group information elements
  9011. * 1 -> another tx queue group information element immediately follows
  9012. * - ac_mask
  9013. * Bits 15:0
  9014. * Purpose: specify which Access Categories belong to the tx queue group
  9015. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  9016. * the tx queue group.
  9017. * The AC bit-mask values are obtained by left-shifting by the
  9018. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  9019. * - vdev_id_mask
  9020. * Bits 31:16
  9021. * Purpose: specify which vdev's tx queues belong to the tx queue group
  9022. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  9023. * belong to the tx queue group.
  9024. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  9025. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  9026. */
  9027. PREPACK struct htt_txq_group {
  9028. A_UINT32
  9029. credit_count: 14,
  9030. sign: 1,
  9031. absolute: 1,
  9032. tx_queue_group_id: 8,
  9033. reserved0: 7,
  9034. extension: 1;
  9035. A_UINT32
  9036. ac_mask: 16,
  9037. vdev_id_mask: 16;
  9038. } POSTPACK;
  9039. /* first word */
  9040. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  9041. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  9042. #define HTT_TXQ_GROUP_SIGN_S 14
  9043. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  9044. #define HTT_TXQ_GROUP_ABS_S 15
  9045. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  9046. #define HTT_TXQ_GROUP_ID_S 16
  9047. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  9048. #define HTT_TXQ_GROUP_EXT_S 31
  9049. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  9050. /* second word */
  9051. #define HTT_TXQ_GROUP_AC_MASK_S 0
  9052. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  9053. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  9054. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  9055. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  9056. do { \
  9057. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  9058. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  9059. } while (0)
  9060. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  9061. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  9062. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  9063. do { \
  9064. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  9065. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  9066. } while (0)
  9067. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  9068. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  9069. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  9070. do { \
  9071. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  9072. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  9073. } while (0)
  9074. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  9075. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  9076. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  9077. do { \
  9078. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  9079. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  9080. } while (0)
  9081. #define HTT_TXQ_GROUP_ID_GET(_info) \
  9082. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  9083. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  9084. do { \
  9085. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  9086. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  9087. } while (0)
  9088. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  9089. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  9090. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  9091. do { \
  9092. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  9093. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  9094. } while (0)
  9095. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  9096. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  9097. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  9098. do { \
  9099. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  9100. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  9101. } while (0)
  9102. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  9103. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9104. /**
  9105. * @brief target -> host TX completion indication message definition
  9106. *
  9107. * @details
  9108. * The following diagram shows the format of the TX completion indication sent
  9109. * from the target to the host
  9110. *
  9111. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9112. * |-------------------------------------------------------------------|
  9113. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9114. * |-------------------------------------------------------------------|
  9115. * payload:| MSDU1 ID | MSDU0 ID |
  9116. * |-------------------------------------------------------------------|
  9117. * : MSDU3 ID | MSDU2 ID :
  9118. * |-------------------------------------------------------------------|
  9119. * | struct htt_tx_compl_ind_append_retries |
  9120. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9121. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9122. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9123. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9124. * |-------------------------------------------------------------------|
  9125. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9126. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9127. * | MSDU0 tx_tsf64_low |
  9128. * |-------------------------------------------------------------------|
  9129. * | MSDU0 tx_tsf64_high |
  9130. * |-------------------------------------------------------------------|
  9131. * | MSDU1 tx_tsf64_low |
  9132. * |-------------------------------------------------------------------|
  9133. * | MSDU1 tx_tsf64_high |
  9134. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9135. * | phy_timestamp |
  9136. * |-------------------------------------------------------------------|
  9137. * | rate specs (see below) |
  9138. * |-------------------------------------------------------------------|
  9139. * | seqctrl | framectrl |
  9140. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9141. * Where:
  9142. * A0 = append (a.k.a. append0)
  9143. * A1 = append1
  9144. * TP = MSDU tx power presence
  9145. * A2 = append2
  9146. * A3 = append3
  9147. * A4 = append4
  9148. *
  9149. * The following field definitions describe the format of the TX completion
  9150. * indication sent from the target to the host
  9151. * Header fields:
  9152. * - msg_type
  9153. * Bits 7:0
  9154. * Purpose: identifies this as HTT TX completion indication
  9155. * Value: 0x7
  9156. * - status
  9157. * Bits 10:8
  9158. * Purpose: the TX completion status of payload fragmentations descriptors
  9159. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9160. * - tid
  9161. * Bits 14:11
  9162. * Purpose: the tid associated with those fragmentation descriptors. It is
  9163. * valid or not, depending on the tid_invalid bit.
  9164. * Value: 0 to 15
  9165. * - tid_invalid
  9166. * Bits 15:15
  9167. * Purpose: this bit indicates whether the tid field is valid or not
  9168. * Value: 0 indicates valid; 1 indicates invalid
  9169. * - num
  9170. * Bits 23:16
  9171. * Purpose: the number of payload in this indication
  9172. * Value: 1 to 255
  9173. * - append (a.k.a. append0)
  9174. * Bits 24:24
  9175. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9176. * the number of tx retries for one MSDU at the end of this message
  9177. * Value: 0 indicates no appending; 1 indicates appending
  9178. * - append1
  9179. * Bits 25:25
  9180. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9181. * contains the timestamp info for each TX msdu id in payload.
  9182. * The order of the timestamps matches the order of the MSDU IDs.
  9183. * Note that a big-endian host needs to account for the reordering
  9184. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9185. * conversion) when determining which tx timestamp corresponds to
  9186. * which MSDU ID.
  9187. * Value: 0 indicates no appending; 1 indicates appending
  9188. * - msdu_tx_power_presence
  9189. * Bits 26:26
  9190. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9191. * for each MSDU referenced by the TX_COMPL_IND message.
  9192. * The tx power is reported in 0.5 dBm units.
  9193. * The order of the per-MSDU tx power reports matches the order
  9194. * of the MSDU IDs.
  9195. * Note that a big-endian host needs to account for the reordering
  9196. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9197. * conversion) when determining which Tx Power corresponds to
  9198. * which MSDU ID.
  9199. * Value: 0 indicates MSDU tx power reports are not appended,
  9200. * 1 indicates MSDU tx power reports are appended
  9201. * - append2
  9202. * Bits 27:27
  9203. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9204. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9205. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9206. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9207. * for each MSDU, for convenience.
  9208. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9209. * this append2 bit is set).
  9210. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9211. * dB above the noise floor.
  9212. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9213. * 1 indicates MSDU ACK RSSI values are appended.
  9214. * - append3
  9215. * Bits 28:28
  9216. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9217. * contains the tx tsf info based on wlan global TSF for
  9218. * each TX msdu id in payload.
  9219. * The order of the tx tsf matches the order of the MSDU IDs.
  9220. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9221. * values to indicate the the lower 32 bits and higher 32 bits of
  9222. * the tx tsf.
  9223. * The tx_tsf64 here represents the time MSDU was acked and the
  9224. * tx_tsf64 has microseconds units.
  9225. * Value: 0 indicates no appending; 1 indicates appending
  9226. * - append4
  9227. * Bits 29:29
  9228. * Purpose: Indicate whether data frame control fields and fields required
  9229. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9230. * message. The order of the this message matches the order of
  9231. * the MSDU IDs.
  9232. * Value: 0 indicates frame control fields and fields required for
  9233. * radio tap header values are not appended,
  9234. * 1 indicates frame control fields and fields required for
  9235. * radio tap header values are appended.
  9236. * Payload fields:
  9237. * - hmsdu_id
  9238. * Bits 15:0
  9239. * Purpose: this ID is used to track the Tx buffer in host
  9240. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9241. */
  9242. PREPACK struct htt_tx_data_hdr_information {
  9243. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9244. A_UINT32 /* word 1 */
  9245. /* preamble:
  9246. * 0-OFDM,
  9247. * 1-CCk,
  9248. * 2-HT,
  9249. * 3-VHT
  9250. */
  9251. preamble: 2, /* [1:0] */
  9252. /* mcs:
  9253. * In case of HT preamble interpret
  9254. * MCS along with NSS.
  9255. * Valid values for HT are 0 to 7.
  9256. * HT mcs 0 with NSS 2 is mcs 8.
  9257. * Valid values for VHT are 0 to 9.
  9258. */
  9259. mcs: 4, /* [5:2] */
  9260. /* rate:
  9261. * This is applicable only for
  9262. * CCK and OFDM preamble type
  9263. * rate 0: OFDM 48 Mbps,
  9264. * 1: OFDM 24 Mbps,
  9265. * 2: OFDM 12 Mbps
  9266. * 3: OFDM 6 Mbps
  9267. * 4: OFDM 54 Mbps
  9268. * 5: OFDM 36 Mbps
  9269. * 6: OFDM 18 Mbps
  9270. * 7: OFDM 9 Mbps
  9271. * rate 0: CCK 11 Mbps Long
  9272. * 1: CCK 5.5 Mbps Long
  9273. * 2: CCK 2 Mbps Long
  9274. * 3: CCK 1 Mbps Long
  9275. * 4: CCK 11 Mbps Short
  9276. * 5: CCK 5.5 Mbps Short
  9277. * 6: CCK 2 Mbps Short
  9278. */
  9279. rate : 3, /* [ 8: 6] */
  9280. rssi : 8, /* [16: 9] units=dBm */
  9281. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9282. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9283. stbc : 1, /* [22] */
  9284. sgi : 1, /* [23] */
  9285. ldpc : 1, /* [24] */
  9286. beamformed: 1, /* [25] */
  9287. /* tx_retry_cnt:
  9288. * Indicates retry count of data tx frames provided by the host.
  9289. */
  9290. tx_retry_cnt: 6; /* [31:26] */
  9291. A_UINT32 /* word 2 */
  9292. framectrl:16, /* [15: 0] */
  9293. seqno:16; /* [31:16] */
  9294. } POSTPACK;
  9295. #define HTT_TX_COMPL_IND_STATUS_S 8
  9296. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9297. #define HTT_TX_COMPL_IND_TID_S 11
  9298. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9299. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9300. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9301. #define HTT_TX_COMPL_IND_NUM_S 16
  9302. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9303. #define HTT_TX_COMPL_IND_APPEND_S 24
  9304. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9305. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9306. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9307. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9308. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9309. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9310. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9311. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9312. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9313. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9314. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9315. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9316. do { \
  9317. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9318. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9319. } while (0)
  9320. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9321. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9322. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9323. do { \
  9324. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9325. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9326. } while (0)
  9327. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9328. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9329. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9330. do { \
  9331. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9332. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9333. } while (0)
  9334. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9335. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9336. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9337. do { \
  9338. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9339. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9340. } while (0)
  9341. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9342. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9343. HTT_TX_COMPL_IND_TID_INV_S)
  9344. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9345. do { \
  9346. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9347. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9348. } while (0)
  9349. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9350. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9351. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9352. do { \
  9353. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9354. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9355. } while (0)
  9356. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9357. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9358. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9359. do { \
  9360. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9361. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9362. } while (0)
  9363. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9364. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9365. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9366. do { \
  9367. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9368. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9369. } while (0)
  9370. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9371. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9372. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9373. do { \
  9374. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9375. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9376. } while (0)
  9377. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9378. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9379. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9380. do { \
  9381. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9382. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9383. } while (0)
  9384. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9385. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9386. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9387. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9388. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9389. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9390. #define HTT_TX_COMPL_IND_STAT_OK 0
  9391. /* DISCARD:
  9392. * current meaning:
  9393. * MSDUs were queued for transmission but filtered by HW or SW
  9394. * without any over the air attempts
  9395. * legacy meaning (HL Rome):
  9396. * MSDUs were discarded by the target FW without any over the air
  9397. * attempts due to lack of space
  9398. */
  9399. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9400. /* NO_ACK:
  9401. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9402. */
  9403. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9404. /* POSTPONE:
  9405. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9406. * be downloaded again later (in the appropriate order), when they are
  9407. * deliverable.
  9408. */
  9409. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9410. /*
  9411. * The PEER_DEL tx completion status is used for HL cases
  9412. * where the peer the frame is for has been deleted.
  9413. * The host has already discarded its copy of the frame, but
  9414. * it still needs the tx completion to restore its credit.
  9415. */
  9416. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9417. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9418. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9419. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9420. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9421. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9422. PREPACK struct htt_tx_compl_ind_base {
  9423. A_UINT32 hdr;
  9424. A_UINT16 payload[1/*or more*/];
  9425. } POSTPACK;
  9426. PREPACK struct htt_tx_compl_ind_append_retries {
  9427. A_UINT16 msdu_id;
  9428. A_UINT8 tx_retries;
  9429. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9430. 0: this is the last append_retries struct */
  9431. } POSTPACK;
  9432. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9433. A_UINT32 timestamp[1/*or more*/];
  9434. } POSTPACK;
  9435. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9436. A_UINT32 tx_tsf64_low;
  9437. A_UINT32 tx_tsf64_high;
  9438. } POSTPACK;
  9439. /* htt_tx_data_hdr_information payload extension fields: */
  9440. /* DWORD zero */
  9441. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9442. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9443. /* DWORD one */
  9444. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9445. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9446. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9447. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9448. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9449. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9450. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9451. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9452. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9453. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9454. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9455. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9456. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9457. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9458. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9459. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9460. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9461. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9462. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9463. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9464. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9465. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9466. /* DWORD two */
  9467. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9468. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9469. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9470. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9471. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9472. do { \
  9473. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9474. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9475. } while (0)
  9476. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9477. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9478. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9479. do { \
  9480. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9481. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9482. } while (0)
  9483. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9484. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9485. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9486. do { \
  9487. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9488. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9489. } while (0)
  9490. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9491. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9492. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9493. do { \
  9494. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9495. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9496. } while (0)
  9497. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9498. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9499. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9500. do { \
  9501. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9502. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9503. } while (0)
  9504. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9505. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9506. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9507. do { \
  9508. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9509. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9510. } while (0)
  9511. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9512. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9513. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9514. do { \
  9515. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9516. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9517. } while (0)
  9518. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9519. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9520. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9521. do { \
  9522. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9523. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9524. } while (0)
  9525. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9526. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9527. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9528. do { \
  9529. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9530. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9531. } while (0)
  9532. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9533. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9534. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9535. do { \
  9536. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9537. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9538. } while (0)
  9539. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9540. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9541. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9542. do { \
  9543. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9544. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9545. } while (0)
  9546. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9547. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9548. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9549. do { \
  9550. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9551. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9552. } while (0)
  9553. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9554. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9555. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9556. do { \
  9557. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9558. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9559. } while (0)
  9560. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9561. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9562. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9563. do { \
  9564. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9565. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9566. } while (0)
  9567. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9568. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9569. /**
  9570. * @brief target -> host rate-control update indication message
  9571. *
  9572. * @details
  9573. * The following diagram shows the format of the RC Update message
  9574. * sent from the target to the host, while processing the tx-completion
  9575. * of a transmitted PPDU.
  9576. *
  9577. * |31 24|23 16|15 8|7 0|
  9578. * |-------------------------------------------------------------|
  9579. * | peer ID | vdev ID | msg_type |
  9580. * |-------------------------------------------------------------|
  9581. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9582. * |-------------------------------------------------------------|
  9583. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9584. * |-------------------------------------------------------------|
  9585. * | : |
  9586. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9587. * | : |
  9588. * |-------------------------------------------------------------|
  9589. * | : |
  9590. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9591. * | : |
  9592. * |-------------------------------------------------------------|
  9593. * : :
  9594. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9595. *
  9596. */
  9597. typedef struct {
  9598. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9599. A_UINT32 rate_code_flags;
  9600. A_UINT32 flags; /* Encodes information such as excessive
  9601. retransmission, aggregate, some info
  9602. from .11 frame control,
  9603. STBC, LDPC, (SGI and Tx Chain Mask
  9604. are encoded in ptx_rc->flags field),
  9605. AMPDU truncation (BT/time based etc.),
  9606. RTS/CTS attempt */
  9607. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9608. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9609. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9610. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9611. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9612. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9613. } HTT_RC_TX_DONE_PARAMS;
  9614. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9615. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9616. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9617. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9618. #define HTT_RC_UPDATE_VDEVID_S 8
  9619. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9620. #define HTT_RC_UPDATE_PEERID_S 16
  9621. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9622. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9623. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9624. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9625. do { \
  9626. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9627. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9628. } while (0)
  9629. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9630. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9631. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9632. do { \
  9633. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9634. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9635. } while (0)
  9636. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9637. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9638. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9639. do { \
  9640. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9641. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9642. } while (0)
  9643. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9644. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9645. /**
  9646. * @brief target -> host rx fragment indication message definition
  9647. *
  9648. * @details
  9649. * The following field definitions describe the format of the rx fragment
  9650. * indication message sent from the target to the host.
  9651. * The rx fragment indication message shares the format of the
  9652. * rx indication message, but not all fields from the rx indication message
  9653. * are relevant to the rx fragment indication message.
  9654. *
  9655. *
  9656. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9657. * |-----------+-------------------+---------------------+-------------|
  9658. * | peer ID | |FV| ext TID | msg type |
  9659. * |-------------------------------------------------------------------|
  9660. * | | flush | flush |
  9661. * | | end | start |
  9662. * | | seq num | seq num |
  9663. * |-------------------------------------------------------------------|
  9664. * | reserved | FW rx desc bytes |
  9665. * |-------------------------------------------------------------------|
  9666. * | | FW MSDU Rx |
  9667. * | | desc B0 |
  9668. * |-------------------------------------------------------------------|
  9669. * Header fields:
  9670. * - MSG_TYPE
  9671. * Bits 7:0
  9672. * Purpose: identifies this as an rx fragment indication message
  9673. * Value: 0xa
  9674. * - EXT_TID
  9675. * Bits 12:8
  9676. * Purpose: identify the traffic ID of the rx data, including
  9677. * special "extended" TID values for multicast, broadcast, and
  9678. * non-QoS data frames
  9679. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9680. * - FLUSH_VALID (FV)
  9681. * Bit 13
  9682. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9683. * is valid
  9684. * Value:
  9685. * 1 -> flush IE is valid and needs to be processed
  9686. * 0 -> flush IE is not valid and should be ignored
  9687. * - PEER_ID
  9688. * Bits 31:16
  9689. * Purpose: Identify, by ID, which peer sent the rx data
  9690. * Value: ID of the peer who sent the rx data
  9691. * - FLUSH_SEQ_NUM_START
  9692. * Bits 5:0
  9693. * Purpose: Indicate the start of a series of MPDUs to flush
  9694. * Not all MPDUs within this series are necessarily valid - the host
  9695. * must check each sequence number within this range to see if the
  9696. * corresponding MPDU is actually present.
  9697. * This field is only valid if the FV bit is set.
  9698. * Value:
  9699. * The sequence number for the first MPDUs to check to flush.
  9700. * The sequence number is masked by 0x3f.
  9701. * - FLUSH_SEQ_NUM_END
  9702. * Bits 11:6
  9703. * Purpose: Indicate the end of a series of MPDUs to flush
  9704. * Value:
  9705. * The sequence number one larger than the sequence number of the
  9706. * last MPDU to check to flush.
  9707. * The sequence number is masked by 0x3f.
  9708. * Not all MPDUs within this series are necessarily valid - the host
  9709. * must check each sequence number within this range to see if the
  9710. * corresponding MPDU is actually present.
  9711. * This field is only valid if the FV bit is set.
  9712. * Rx descriptor fields:
  9713. * - FW_RX_DESC_BYTES
  9714. * Bits 15:0
  9715. * Purpose: Indicate how many bytes in the Rx indication are used for
  9716. * FW Rx descriptors
  9717. * Value: 1
  9718. */
  9719. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9720. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9721. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9722. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9723. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9724. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9725. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9726. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9727. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9728. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9729. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9730. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9731. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9732. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9733. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9734. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9735. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9736. #define HTT_RX_FRAG_IND_BYTES \
  9737. (4 /* msg hdr */ + \
  9738. 4 /* flush spec */ + \
  9739. 4 /* (unused) FW rx desc bytes spec */ + \
  9740. 4 /* FW rx desc */)
  9741. /**
  9742. * @brief target -> host test message definition
  9743. *
  9744. * @details
  9745. * The following field definitions describe the format of the test
  9746. * message sent from the target to the host.
  9747. * The message consists of a 4-octet header, followed by a variable
  9748. * number of 32-bit integer values, followed by a variable number
  9749. * of 8-bit character values.
  9750. *
  9751. * |31 16|15 8|7 0|
  9752. * |-----------------------------------------------------------|
  9753. * | num chars | num ints | msg type |
  9754. * |-----------------------------------------------------------|
  9755. * | int 0 |
  9756. * |-----------------------------------------------------------|
  9757. * | int 1 |
  9758. * |-----------------------------------------------------------|
  9759. * | ... |
  9760. * |-----------------------------------------------------------|
  9761. * | char 3 | char 2 | char 1 | char 0 |
  9762. * |-----------------------------------------------------------|
  9763. * | | | ... | char 4 |
  9764. * |-----------------------------------------------------------|
  9765. * - MSG_TYPE
  9766. * Bits 7:0
  9767. * Purpose: identifies this as a test message
  9768. * Value: HTT_MSG_TYPE_TEST
  9769. * - NUM_INTS
  9770. * Bits 15:8
  9771. * Purpose: indicate how many 32-bit integers follow the message header
  9772. * - NUM_CHARS
  9773. * Bits 31:16
  9774. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9775. */
  9776. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9777. #define HTT_RX_TEST_NUM_INTS_S 8
  9778. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9779. #define HTT_RX_TEST_NUM_CHARS_S 16
  9780. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9781. do { \
  9782. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9783. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9784. } while (0)
  9785. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9786. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9787. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9788. do { \
  9789. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9790. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9791. } while (0)
  9792. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9793. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9794. /**
  9795. * @brief target -> host packet log message
  9796. *
  9797. * @details
  9798. * The following field definitions describe the format of the packet log
  9799. * message sent from the target to the host.
  9800. * The message consists of a 4-octet header,followed by a variable number
  9801. * of 32-bit character values.
  9802. *
  9803. * |31 16|15 12|11 10|9 8|7 0|
  9804. * |------------------------------------------------------------------|
  9805. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9806. * |------------------------------------------------------------------|
  9807. * | payload |
  9808. * |------------------------------------------------------------------|
  9809. * - MSG_TYPE
  9810. * Bits 7:0
  9811. * Purpose: identifies this as a pktlog message
  9812. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9813. * - mac_id
  9814. * Bits 9:8
  9815. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9816. * Value: 0-3
  9817. * - pdev_id
  9818. * Bits 11:10
  9819. * Purpose: pdev_id
  9820. * Value: 0-3
  9821. * 0 (for rings at SOC level),
  9822. * 1/2/3 PDEV -> 0/1/2
  9823. * - payload_size
  9824. * Bits 31:16
  9825. * Purpose: explicitly specify the payload size
  9826. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9827. */
  9828. PREPACK struct htt_pktlog_msg {
  9829. A_UINT32 header;
  9830. A_UINT32 payload[1/* or more */];
  9831. } POSTPACK;
  9832. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9833. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9834. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9835. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9836. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9837. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9838. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9839. do { \
  9840. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9841. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9842. } while (0)
  9843. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9844. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9845. HTT_T2H_PKTLOG_MAC_ID_S)
  9846. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9847. do { \
  9848. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9849. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9850. } while (0)
  9851. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9852. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9853. HTT_T2H_PKTLOG_PDEV_ID_S)
  9854. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9855. do { \
  9856. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9857. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9858. } while (0)
  9859. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9860. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9861. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9862. /*
  9863. * Rx reorder statistics
  9864. * NB: all the fields must be defined in 4 octets size.
  9865. */
  9866. struct rx_reorder_stats {
  9867. /* Non QoS MPDUs received */
  9868. A_UINT32 deliver_non_qos;
  9869. /* MPDUs received in-order */
  9870. A_UINT32 deliver_in_order;
  9871. /* Flush due to reorder timer expired */
  9872. A_UINT32 deliver_flush_timeout;
  9873. /* Flush due to move out of window */
  9874. A_UINT32 deliver_flush_oow;
  9875. /* Flush due to DELBA */
  9876. A_UINT32 deliver_flush_delba;
  9877. /* MPDUs dropped due to FCS error */
  9878. A_UINT32 fcs_error;
  9879. /* MPDUs dropped due to monitor mode non-data packet */
  9880. A_UINT32 mgmt_ctrl;
  9881. /* Unicast-data MPDUs dropped due to invalid peer */
  9882. A_UINT32 invalid_peer;
  9883. /* MPDUs dropped due to duplication (non aggregation) */
  9884. A_UINT32 dup_non_aggr;
  9885. /* MPDUs dropped due to processed before */
  9886. A_UINT32 dup_past;
  9887. /* MPDUs dropped due to duplicate in reorder queue */
  9888. A_UINT32 dup_in_reorder;
  9889. /* Reorder timeout happened */
  9890. A_UINT32 reorder_timeout;
  9891. /* invalid bar ssn */
  9892. A_UINT32 invalid_bar_ssn;
  9893. /* reorder reset due to bar ssn */
  9894. A_UINT32 ssn_reset;
  9895. /* Flush due to delete peer */
  9896. A_UINT32 deliver_flush_delpeer;
  9897. /* Flush due to offload*/
  9898. A_UINT32 deliver_flush_offload;
  9899. /* Flush due to out of buffer*/
  9900. A_UINT32 deliver_flush_oob;
  9901. /* MPDUs dropped due to PN check fail */
  9902. A_UINT32 pn_fail;
  9903. /* MPDUs dropped due to unable to allocate memory */
  9904. A_UINT32 store_fail;
  9905. /* Number of times the tid pool alloc succeeded */
  9906. A_UINT32 tid_pool_alloc_succ;
  9907. /* Number of times the MPDU pool alloc succeeded */
  9908. A_UINT32 mpdu_pool_alloc_succ;
  9909. /* Number of times the MSDU pool alloc succeeded */
  9910. A_UINT32 msdu_pool_alloc_succ;
  9911. /* Number of times the tid pool alloc failed */
  9912. A_UINT32 tid_pool_alloc_fail;
  9913. /* Number of times the MPDU pool alloc failed */
  9914. A_UINT32 mpdu_pool_alloc_fail;
  9915. /* Number of times the MSDU pool alloc failed */
  9916. A_UINT32 msdu_pool_alloc_fail;
  9917. /* Number of times the tid pool freed */
  9918. A_UINT32 tid_pool_free;
  9919. /* Number of times the MPDU pool freed */
  9920. A_UINT32 mpdu_pool_free;
  9921. /* Number of times the MSDU pool freed */
  9922. A_UINT32 msdu_pool_free;
  9923. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9924. A_UINT32 msdu_queued;
  9925. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9926. A_UINT32 msdu_recycled;
  9927. /* Number of MPDUs with invalid peer but A2 found in AST */
  9928. A_UINT32 invalid_peer_a2_in_ast;
  9929. /* Number of MPDUs with invalid peer but A3 found in AST */
  9930. A_UINT32 invalid_peer_a3_in_ast;
  9931. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9932. A_UINT32 invalid_peer_bmc_mpdus;
  9933. /* Number of MSDUs with err attention word */
  9934. A_UINT32 rxdesc_err_att;
  9935. /* Number of MSDUs with flag of peer_idx_invalid */
  9936. A_UINT32 rxdesc_err_peer_idx_inv;
  9937. /* Number of MSDUs with flag of peer_idx_timeout */
  9938. A_UINT32 rxdesc_err_peer_idx_to;
  9939. /* Number of MSDUs with flag of overflow */
  9940. A_UINT32 rxdesc_err_ov;
  9941. /* Number of MSDUs with flag of msdu_length_err */
  9942. A_UINT32 rxdesc_err_msdu_len;
  9943. /* Number of MSDUs with flag of mpdu_length_err */
  9944. A_UINT32 rxdesc_err_mpdu_len;
  9945. /* Number of MSDUs with flag of tkip_mic_err */
  9946. A_UINT32 rxdesc_err_tkip_mic;
  9947. /* Number of MSDUs with flag of decrypt_err */
  9948. A_UINT32 rxdesc_err_decrypt;
  9949. /* Number of MSDUs with flag of fcs_err */
  9950. A_UINT32 rxdesc_err_fcs;
  9951. /* Number of Unicast (bc_mc bit is not set in attention word)
  9952. * frames with invalid peer handler
  9953. */
  9954. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9955. /* Number of unicast frame directly (direct bit is set in attention word)
  9956. * to DUT with invalid peer handler
  9957. */
  9958. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9959. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9960. * frames with invalid peer handler
  9961. */
  9962. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9963. /* Number of MSDUs dropped due to no first MSDU flag */
  9964. A_UINT32 rxdesc_no_1st_msdu;
  9965. /* Number of MSDUs droped due to ring overflow */
  9966. A_UINT32 msdu_drop_ring_ov;
  9967. /* Number of MSDUs dropped due to FC mismatch */
  9968. A_UINT32 msdu_drop_fc_mismatch;
  9969. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9970. A_UINT32 msdu_drop_mgmt_remote_ring;
  9971. /* Number of MSDUs dropped due to errors not reported in attention word */
  9972. A_UINT32 msdu_drop_misc;
  9973. /* Number of MSDUs go to offload before reorder */
  9974. A_UINT32 offload_msdu_wal;
  9975. /* Number of data frame dropped by offload after reorder */
  9976. A_UINT32 offload_msdu_reorder;
  9977. /* Number of MPDUs with sequence number in the past and within the BA window */
  9978. A_UINT32 dup_past_within_window;
  9979. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9980. A_UINT32 dup_past_outside_window;
  9981. /* Number of MSDUs with decrypt/MIC error */
  9982. A_UINT32 rxdesc_err_decrypt_mic;
  9983. /* Number of data MSDUs received on both local and remote rings */
  9984. A_UINT32 data_msdus_on_both_rings;
  9985. /* MPDUs never filled */
  9986. A_UINT32 holes_not_filled;
  9987. };
  9988. /*
  9989. * Rx Remote buffer statistics
  9990. * NB: all the fields must be defined in 4 octets size.
  9991. */
  9992. struct rx_remote_buffer_mgmt_stats {
  9993. /* Total number of MSDUs reaped for Rx processing */
  9994. A_UINT32 remote_reaped;
  9995. /* MSDUs recycled within firmware */
  9996. A_UINT32 remote_recycled;
  9997. /* MSDUs stored by Data Rx */
  9998. A_UINT32 data_rx_msdus_stored;
  9999. /* Number of HTT indications from WAL Rx MSDU */
  10000. A_UINT32 wal_rx_ind;
  10001. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  10002. A_UINT32 wal_rx_ind_unconsumed;
  10003. /* Number of HTT indications from Data Rx MSDU */
  10004. A_UINT32 data_rx_ind;
  10005. /* Number of unconsumed HTT indications from Data Rx MSDU */
  10006. A_UINT32 data_rx_ind_unconsumed;
  10007. /* Number of HTT indications from ATHBUF */
  10008. A_UINT32 athbuf_rx_ind;
  10009. /* Number of remote buffers requested for refill */
  10010. A_UINT32 refill_buf_req;
  10011. /* Number of remote buffers filled by the host */
  10012. A_UINT32 refill_buf_rsp;
  10013. /* Number of times MAC hw_index = f/w write_index */
  10014. A_INT32 mac_no_bufs;
  10015. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  10016. A_INT32 fw_indices_equal;
  10017. /* Number of times f/w finds no buffers to post */
  10018. A_INT32 host_no_bufs;
  10019. };
  10020. /*
  10021. * TXBF MU/SU packets and NDPA statistics
  10022. * NB: all the fields must be defined in 4 octets size.
  10023. */
  10024. struct rx_txbf_musu_ndpa_pkts_stats {
  10025. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  10026. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  10027. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  10028. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  10029. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  10030. A_UINT32 reserved[3]; /* must be set to 0x0 */
  10031. };
  10032. /*
  10033. * htt_dbg_stats_status -
  10034. * present - The requested stats have been delivered in full.
  10035. * This indicates that either the stats information was contained
  10036. * in its entirety within this message, or else this message
  10037. * completes the delivery of the requested stats info that was
  10038. * partially delivered through earlier STATS_CONF messages.
  10039. * partial - The requested stats have been delivered in part.
  10040. * One or more subsequent STATS_CONF messages with the same
  10041. * cookie value will be sent to deliver the remainder of the
  10042. * information.
  10043. * error - The requested stats could not be delivered, for example due
  10044. * to a shortage of memory to construct a message holding the
  10045. * requested stats.
  10046. * invalid - The requested stat type is either not recognized, or the
  10047. * target is configured to not gather the stats type in question.
  10048. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10049. * series_done - This special value indicates that no further stats info
  10050. * elements are present within a series of stats info elems
  10051. * (within a stats upload confirmation message).
  10052. */
  10053. enum htt_dbg_stats_status {
  10054. HTT_DBG_STATS_STATUS_PRESENT = 0,
  10055. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  10056. HTT_DBG_STATS_STATUS_ERROR = 2,
  10057. HTT_DBG_STATS_STATUS_INVALID = 3,
  10058. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  10059. };
  10060. /**
  10061. * @brief target -> host statistics upload
  10062. *
  10063. * @details
  10064. * The following field definitions describe the format of the HTT target
  10065. * to host stats upload confirmation message.
  10066. * The message contains a cookie echoed from the HTT host->target stats
  10067. * upload request, which identifies which request the confirmation is
  10068. * for, and a series of tag-length-value stats information elements.
  10069. * The tag-length header for each stats info element also includes a
  10070. * status field, to indicate whether the request for the stat type in
  10071. * question was fully met, partially met, unable to be met, or invalid
  10072. * (if the stat type in question is disabled in the target).
  10073. * A special value of all 1's in this status field is used to indicate
  10074. * the end of the series of stats info elements.
  10075. *
  10076. *
  10077. * |31 16|15 8|7 5|4 0|
  10078. * |------------------------------------------------------------|
  10079. * | reserved | msg type |
  10080. * |------------------------------------------------------------|
  10081. * | cookie LSBs |
  10082. * |------------------------------------------------------------|
  10083. * | cookie MSBs |
  10084. * |------------------------------------------------------------|
  10085. * | stats entry length | reserved | S |stat type|
  10086. * |------------------------------------------------------------|
  10087. * | |
  10088. * | type-specific stats info |
  10089. * | |
  10090. * |------------------------------------------------------------|
  10091. * | stats entry length | reserved | S |stat type|
  10092. * |------------------------------------------------------------|
  10093. * | |
  10094. * | type-specific stats info |
  10095. * | |
  10096. * |------------------------------------------------------------|
  10097. * | n/a | reserved | 111 | n/a |
  10098. * |------------------------------------------------------------|
  10099. * Header fields:
  10100. * - MSG_TYPE
  10101. * Bits 7:0
  10102. * Purpose: identifies this is a statistics upload confirmation message
  10103. * Value: 0x9
  10104. * - COOKIE_LSBS
  10105. * Bits 31:0
  10106. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10107. * message with its preceding host->target stats request message.
  10108. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10109. * - COOKIE_MSBS
  10110. * Bits 31:0
  10111. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10112. * message with its preceding host->target stats request message.
  10113. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10114. *
  10115. * Stats Information Element tag-length header fields:
  10116. * - STAT_TYPE
  10117. * Bits 4:0
  10118. * Purpose: identifies the type of statistics info held in the
  10119. * following information element
  10120. * Value: htt_dbg_stats_type
  10121. * - STATUS
  10122. * Bits 7:5
  10123. * Purpose: indicate whether the requested stats are present
  10124. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10125. * the completion of the stats entry series
  10126. * - LENGTH
  10127. * Bits 31:16
  10128. * Purpose: indicate the stats information size
  10129. * Value: This field specifies the number of bytes of stats information
  10130. * that follows the element tag-length header.
  10131. * It is expected but not required that this length is a multiple of
  10132. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10133. * subsequent stats entry header will begin on a 4-byte aligned
  10134. * boundary.
  10135. */
  10136. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10137. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10138. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10139. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10140. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10141. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10142. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10143. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10144. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10145. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10146. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10147. do { \
  10148. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10149. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10150. } while (0)
  10151. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10152. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10153. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10154. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10155. do { \
  10156. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10157. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10158. } while (0)
  10159. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10160. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10161. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10162. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10163. do { \
  10164. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10165. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10166. } while (0)
  10167. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10168. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10169. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10170. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10171. #define HTT_MAX_AGGR 64
  10172. #define HTT_HL_MAX_AGGR 18
  10173. /**
  10174. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10175. *
  10176. * @details
  10177. * The following field definitions describe the format of the HTT host
  10178. * to target frag_desc/msdu_ext bank configuration message.
  10179. * The message contains the based address and the min and max id of the
  10180. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10181. * MSDU_EXT/FRAG_DESC.
  10182. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10183. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10184. * the hardware does the mapping/translation.
  10185. *
  10186. * Total banks that can be configured is configured to 16.
  10187. *
  10188. * This should be called before any TX has be initiated by the HTT
  10189. *
  10190. * |31 16|15 8|7 5|4 0|
  10191. * |------------------------------------------------------------|
  10192. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10193. * |------------------------------------------------------------|
  10194. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10195. #if HTT_PADDR64
  10196. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10197. #endif
  10198. * |------------------------------------------------------------|
  10199. * | ... |
  10200. * |------------------------------------------------------------|
  10201. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10202. #if HTT_PADDR64
  10203. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10204. #endif
  10205. * |------------------------------------------------------------|
  10206. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10207. * |------------------------------------------------------------|
  10208. * | ... |
  10209. * |------------------------------------------------------------|
  10210. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10211. * |------------------------------------------------------------|
  10212. * Header fields:
  10213. * - MSG_TYPE
  10214. * Bits 7:0
  10215. * Value: 0x6
  10216. * for systems with 64-bit format for bus addresses:
  10217. * - BANKx_BASE_ADDRESS_LO
  10218. * Bits 31:0
  10219. * Purpose: Provide a mechanism to specify the base address of the
  10220. * MSDU_EXT bank physical/bus address.
  10221. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10222. * - BANKx_BASE_ADDRESS_HI
  10223. * Bits 31:0
  10224. * Purpose: Provide a mechanism to specify the base address of the
  10225. * MSDU_EXT bank physical/bus address.
  10226. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10227. * for systems with 32-bit format for bus addresses:
  10228. * - BANKx_BASE_ADDRESS
  10229. * Bits 31:0
  10230. * Purpose: Provide a mechanism to specify the base address of the
  10231. * MSDU_EXT bank physical/bus address.
  10232. * Value: MSDU_EXT bank physical / bus address
  10233. * - BANKx_MIN_ID
  10234. * Bits 15:0
  10235. * Purpose: Provide a mechanism to specify the min index that needs to
  10236. * mapped.
  10237. * - BANKx_MAX_ID
  10238. * Bits 31:16
  10239. * Purpose: Provide a mechanism to specify the max index that needs to
  10240. * mapped.
  10241. *
  10242. */
  10243. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10244. * safe value.
  10245. * @note MAX supported banks is 16.
  10246. */
  10247. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10248. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10249. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10250. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10251. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10252. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10253. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10254. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10255. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10256. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10257. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10258. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10259. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10260. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10261. do { \
  10262. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10263. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10264. } while (0)
  10265. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10266. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10267. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10268. do { \
  10269. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10270. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10271. } while (0)
  10272. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10273. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10274. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10275. do { \
  10276. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10277. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10278. } while (0)
  10279. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10280. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10281. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10282. do { \
  10283. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10284. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10285. } while (0)
  10286. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10287. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10288. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10289. do { \
  10290. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10291. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10292. } while (0)
  10293. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10294. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10295. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10296. do { \
  10297. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10298. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10299. } while (0)
  10300. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10301. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10302. /*
  10303. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10304. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10305. * addresses are stored in a XXX-bit field.
  10306. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10307. * htt_tx_frag_desc64_bank_cfg_t structs.
  10308. */
  10309. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10310. _paddr_bits_, \
  10311. _paddr__bank_base_address_) \
  10312. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10313. /** word 0 \
  10314. * msg_type: 8, \
  10315. * pdev_id: 2, \
  10316. * swap: 1, \
  10317. * reserved0: 5, \
  10318. * num_banks: 8, \
  10319. * desc_size: 8; \
  10320. */ \
  10321. A_UINT32 word0; \
  10322. /* \
  10323. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10324. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10325. * the second A_UINT32). \
  10326. */ \
  10327. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10328. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10329. } POSTPACK
  10330. /* define htt_tx_frag_desc32_bank_cfg_t */
  10331. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10332. /* define htt_tx_frag_desc64_bank_cfg_t */
  10333. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10334. /*
  10335. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10336. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10337. */
  10338. #if HTT_PADDR64
  10339. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10340. #else
  10341. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10342. #endif
  10343. /**
  10344. * @brief target -> host HTT TX Credit total count update message definition
  10345. *
  10346. *|31 16|15|14 9| 8 |7 0 |
  10347. *|---------------------+--+----------+-------+----------|
  10348. *|cur htt credit delta | Q| reserved | sign | msg type |
  10349. *|------------------------------------------------------|
  10350. *
  10351. * Header fields:
  10352. * - MSG_TYPE
  10353. * Bits 7:0
  10354. * Purpose: identifies this as a htt tx credit delta update message
  10355. * Value: 0xe
  10356. * - SIGN
  10357. * Bits 8
  10358. * identifies whether credit delta is positive or negative
  10359. * Value:
  10360. * - 0x0: credit delta is positive, rebalance in some buffers
  10361. * - 0x1: credit delta is negative, rebalance out some buffers
  10362. * - reserved
  10363. * Bits 14:9
  10364. * Value: 0x0
  10365. * - TXQ_GRP
  10366. * Bit 15
  10367. * Purpose: indicates whether any tx queue group information elements
  10368. * are appended to the tx credit update message
  10369. * Value: 0 -> no tx queue group information element is present
  10370. * 1 -> a tx queue group information element immediately follows
  10371. * - DELTA_COUNT
  10372. * Bits 31:16
  10373. * Purpose: Specify current htt credit delta absolute count
  10374. */
  10375. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10376. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10377. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10378. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10379. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10380. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10381. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10382. do { \
  10383. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10384. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10385. } while (0)
  10386. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10387. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10388. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10389. do { \
  10390. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10391. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10392. } while (0)
  10393. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10394. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10395. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10396. do { \
  10397. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10398. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10399. } while (0)
  10400. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10401. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10402. #define HTT_TX_CREDIT_MSG_BYTES 4
  10403. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10404. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10405. /**
  10406. * @brief HTT WDI_IPA Operation Response Message
  10407. *
  10408. * @details
  10409. * HTT WDI_IPA Operation Response message is sent by target
  10410. * to host confirming suspend or resume operation.
  10411. * |31 24|23 16|15 8|7 0|
  10412. * |----------------+----------------+----------------+----------------|
  10413. * | op_code | Rsvd | msg_type |
  10414. * |-------------------------------------------------------------------|
  10415. * | Rsvd | Response len |
  10416. * |-------------------------------------------------------------------|
  10417. * | |
  10418. * | Response-type specific info |
  10419. * | |
  10420. * | |
  10421. * |-------------------------------------------------------------------|
  10422. * Header fields:
  10423. * - MSG_TYPE
  10424. * Bits 7:0
  10425. * Purpose: Identifies this as WDI_IPA Operation Response message
  10426. * value: = 0x13
  10427. * - OP_CODE
  10428. * Bits 31:16
  10429. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10430. * value: = enum htt_wdi_ipa_op_code
  10431. * - RSP_LEN
  10432. * Bits 16:0
  10433. * Purpose: length for the response-type specific info
  10434. * value: = length in bytes for response-type specific info
  10435. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10436. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10437. */
  10438. PREPACK struct htt_wdi_ipa_op_response_t
  10439. {
  10440. /* DWORD 0: flags and meta-data */
  10441. A_UINT32
  10442. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10443. reserved1: 8,
  10444. op_code: 16;
  10445. A_UINT32
  10446. rsp_len: 16,
  10447. reserved2: 16;
  10448. } POSTPACK;
  10449. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10450. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10451. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10452. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10453. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10454. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10455. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10456. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10457. do { \
  10458. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10459. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10460. } while (0)
  10461. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10462. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10463. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10464. do { \
  10465. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10466. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10467. } while (0)
  10468. enum htt_phy_mode {
  10469. htt_phy_mode_11a = 0,
  10470. htt_phy_mode_11g = 1,
  10471. htt_phy_mode_11b = 2,
  10472. htt_phy_mode_11g_only = 3,
  10473. htt_phy_mode_11na_ht20 = 4,
  10474. htt_phy_mode_11ng_ht20 = 5,
  10475. htt_phy_mode_11na_ht40 = 6,
  10476. htt_phy_mode_11ng_ht40 = 7,
  10477. htt_phy_mode_11ac_vht20 = 8,
  10478. htt_phy_mode_11ac_vht40 = 9,
  10479. htt_phy_mode_11ac_vht80 = 10,
  10480. htt_phy_mode_11ac_vht20_2g = 11,
  10481. htt_phy_mode_11ac_vht40_2g = 12,
  10482. htt_phy_mode_11ac_vht80_2g = 13,
  10483. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10484. htt_phy_mode_11ac_vht160 = 15,
  10485. htt_phy_mode_max,
  10486. };
  10487. /**
  10488. * @brief target -> host HTT channel change indication
  10489. * @details
  10490. * Specify when a channel change occurs.
  10491. * This allows the host to precisely determine which rx frames arrived
  10492. * on the old channel and which rx frames arrived on the new channel.
  10493. *
  10494. *|31 |7 0 |
  10495. *|-------------------------------------------+----------|
  10496. *| reserved | msg type |
  10497. *|------------------------------------------------------|
  10498. *| primary_chan_center_freq_mhz |
  10499. *|------------------------------------------------------|
  10500. *| contiguous_chan1_center_freq_mhz |
  10501. *|------------------------------------------------------|
  10502. *| contiguous_chan2_center_freq_mhz |
  10503. *|------------------------------------------------------|
  10504. *| phy_mode |
  10505. *|------------------------------------------------------|
  10506. *
  10507. * Header fields:
  10508. * - MSG_TYPE
  10509. * Bits 7:0
  10510. * Purpose: identifies this as a htt channel change indication message
  10511. * Value: 0x15
  10512. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10513. * Bits 31:0
  10514. * Purpose: identify the (center of the) new 20 MHz primary channel
  10515. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10516. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10517. * Bits 31:0
  10518. * Purpose: identify the (center of the) contiguous frequency range
  10519. * comprising the new channel.
  10520. * For example, if the new channel is a 80 MHz channel extending
  10521. * 60 MHz beyond the primary channel, this field would be 30 larger
  10522. * than the primary channel center frequency field.
  10523. * Value: center frequency of the contiguous frequency range comprising
  10524. * the full channel in MHz units
  10525. * (80+80 channels also use the CONTIG_CHAN2 field)
  10526. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10527. * Bits 31:0
  10528. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10529. * within a VHT 80+80 channel.
  10530. * This field is only relevant for VHT 80+80 channels.
  10531. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10532. * channel (arbitrary value for cases besides VHT 80+80)
  10533. * - PHY_MODE
  10534. * Bits 31:0
  10535. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10536. * and band
  10537. * Value: htt_phy_mode enum value
  10538. */
  10539. PREPACK struct htt_chan_change_t
  10540. {
  10541. /* DWORD 0: flags and meta-data */
  10542. A_UINT32
  10543. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10544. reserved1: 24;
  10545. A_UINT32 primary_chan_center_freq_mhz;
  10546. A_UINT32 contig_chan1_center_freq_mhz;
  10547. A_UINT32 contig_chan2_center_freq_mhz;
  10548. A_UINT32 phy_mode;
  10549. } POSTPACK;
  10550. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10551. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10552. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10553. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10554. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10555. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10556. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10557. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10558. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10559. do { \
  10560. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10561. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10562. } while (0)
  10563. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10564. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10565. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10566. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10567. do { \
  10568. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10569. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10570. } while (0)
  10571. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10572. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10573. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10574. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10575. do { \
  10576. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10577. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10578. } while (0)
  10579. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10580. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10581. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10582. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10583. do { \
  10584. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10585. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10586. } while (0)
  10587. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10588. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10589. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10590. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10591. /**
  10592. * @brief rx offload packet error message
  10593. *
  10594. * @details
  10595. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10596. * of target payload like mic err.
  10597. *
  10598. * |31 24|23 16|15 8|7 0|
  10599. * |----------------+----------------+----------------+----------------|
  10600. * | tid | vdev_id | msg_sub_type | msg_type |
  10601. * |-------------------------------------------------------------------|
  10602. * : (sub-type dependent content) :
  10603. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10604. * Header fields:
  10605. * - msg_type
  10606. * Bits 7:0
  10607. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10608. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10609. * - msg_sub_type
  10610. * Bits 15:8
  10611. * Purpose: Identifies which type of rx error is reported by this message
  10612. * value: htt_rx_ofld_pkt_err_type
  10613. * - vdev_id
  10614. * Bits 23:16
  10615. * Purpose: Identifies which vdev received the erroneous rx frame
  10616. * value:
  10617. * - tid
  10618. * Bits 31:24
  10619. * Purpose: Identifies the traffic type of the rx frame
  10620. * value:
  10621. *
  10622. * - The payload fields used if the sub-type == MIC error are shown below.
  10623. * Note - MIC err is per MSDU, while PN is per MPDU.
  10624. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10625. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10626. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10627. * instead of sending separate HTT messages for each wrong MSDU within
  10628. * the MPDU.
  10629. *
  10630. * |31 24|23 16|15 8|7 0|
  10631. * |----------------+----------------+----------------+----------------|
  10632. * | Rsvd | key_id | peer_id |
  10633. * |-------------------------------------------------------------------|
  10634. * | receiver MAC addr 31:0 |
  10635. * |-------------------------------------------------------------------|
  10636. * | Rsvd | receiver MAC addr 47:32 |
  10637. * |-------------------------------------------------------------------|
  10638. * | transmitter MAC addr 31:0 |
  10639. * |-------------------------------------------------------------------|
  10640. * | Rsvd | transmitter MAC addr 47:32 |
  10641. * |-------------------------------------------------------------------|
  10642. * | PN 31:0 |
  10643. * |-------------------------------------------------------------------|
  10644. * | Rsvd | PN 47:32 |
  10645. * |-------------------------------------------------------------------|
  10646. * - peer_id
  10647. * Bits 15:0
  10648. * Purpose: identifies which peer is frame is from
  10649. * value:
  10650. * - key_id
  10651. * Bits 23:16
  10652. * Purpose: identifies key_id of rx frame
  10653. * value:
  10654. * - RA_31_0 (receiver MAC addr 31:0)
  10655. * Bits 31:0
  10656. * Purpose: identifies by MAC address which vdev received the frame
  10657. * value: MAC address lower 4 bytes
  10658. * - RA_47_32 (receiver MAC addr 47:32)
  10659. * Bits 15:0
  10660. * Purpose: identifies by MAC address which vdev received the frame
  10661. * value: MAC address upper 2 bytes
  10662. * - TA_31_0 (transmitter MAC addr 31:0)
  10663. * Bits 31:0
  10664. * Purpose: identifies by MAC address which peer transmitted the frame
  10665. * value: MAC address lower 4 bytes
  10666. * - TA_47_32 (transmitter MAC addr 47:32)
  10667. * Bits 15:0
  10668. * Purpose: identifies by MAC address which peer transmitted the frame
  10669. * value: MAC address upper 2 bytes
  10670. * - PN_31_0
  10671. * Bits 31:0
  10672. * Purpose: Identifies pn of rx frame
  10673. * value: PN lower 4 bytes
  10674. * - PN_47_32
  10675. * Bits 15:0
  10676. * Purpose: Identifies pn of rx frame
  10677. * value:
  10678. * TKIP or CCMP: PN upper 2 bytes
  10679. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10680. */
  10681. enum htt_rx_ofld_pkt_err_type {
  10682. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10683. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10684. };
  10685. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10686. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10687. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10688. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10689. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10690. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10691. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10692. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10693. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10694. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10695. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10696. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10697. do { \
  10698. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10699. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10700. } while (0)
  10701. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10702. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10703. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10704. do { \
  10705. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10706. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10707. } while (0)
  10708. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10709. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10710. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10711. do { \
  10712. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10713. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10714. } while (0)
  10715. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10716. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10717. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10719. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10720. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10721. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10722. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10723. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10724. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10725. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10726. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10727. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10728. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10729. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10730. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10731. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10732. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10733. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10734. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10735. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10736. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10737. do { \
  10738. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10739. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10740. } while (0)
  10741. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10742. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10743. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10744. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10745. do { \
  10746. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10747. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10748. } while (0)
  10749. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10750. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10751. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10752. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10753. do { \
  10754. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10755. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10756. } while (0)
  10757. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10758. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10759. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10760. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10761. do { \
  10762. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10763. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10764. } while (0)
  10765. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10766. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10767. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10768. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10769. do { \
  10770. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10771. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10772. } while (0)
  10773. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10774. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10775. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10776. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10777. do { \
  10778. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10779. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10780. } while (0)
  10781. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10782. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10783. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10784. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10785. do { \
  10786. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10787. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10788. } while (0)
  10789. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10790. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10791. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10792. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10793. do { \
  10794. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10795. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10796. } while (0)
  10797. /**
  10798. * @brief peer rate report message
  10799. *
  10800. * @details
  10801. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10802. * justified rate of all the peers.
  10803. *
  10804. * |31 24|23 16|15 8|7 0|
  10805. * |----------------+----------------+----------------+----------------|
  10806. * | peer_count | | msg_type |
  10807. * |-------------------------------------------------------------------|
  10808. * : Payload (variant number of peer rate report) :
  10809. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10810. * Header fields:
  10811. * - msg_type
  10812. * Bits 7:0
  10813. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10814. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10815. * - reserved
  10816. * Bits 15:8
  10817. * Purpose:
  10818. * value:
  10819. * - peer_count
  10820. * Bits 31:16
  10821. * Purpose: Specify how many peer rate report elements are present in the payload.
  10822. * value:
  10823. *
  10824. * Payload:
  10825. * There are variant number of peer rate report follow the first 32 bits.
  10826. * The peer rate report is defined as follows.
  10827. *
  10828. * |31 20|19 16|15 0|
  10829. * |-----------------------+---------+---------------------------------|-
  10830. * | reserved | phy | peer_id | \
  10831. * |-------------------------------------------------------------------| -> report #0
  10832. * | rate | /
  10833. * |-----------------------+---------+---------------------------------|-
  10834. * | reserved | phy | peer_id | \
  10835. * |-------------------------------------------------------------------| -> report #1
  10836. * | rate | /
  10837. * |-----------------------+---------+---------------------------------|-
  10838. * | reserved | phy | peer_id | \
  10839. * |-------------------------------------------------------------------| -> report #2
  10840. * | rate | /
  10841. * |-------------------------------------------------------------------|-
  10842. * : :
  10843. * : :
  10844. * : :
  10845. * :-------------------------------------------------------------------:
  10846. *
  10847. * - peer_id
  10848. * Bits 15:0
  10849. * Purpose: identify the peer
  10850. * value:
  10851. * - phy
  10852. * Bits 19:16
  10853. * Purpose: identify which phy is in use
  10854. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10855. * Please see enum htt_peer_report_phy_type for detail.
  10856. * - reserved
  10857. * Bits 31:20
  10858. * Purpose:
  10859. * value:
  10860. * - rate
  10861. * Bits 31:0
  10862. * Purpose: represent the justified rate of the peer specified by peer_id
  10863. * value:
  10864. */
  10865. enum htt_peer_rate_report_phy_type {
  10866. HTT_PEER_RATE_REPORT_11B = 0,
  10867. HTT_PEER_RATE_REPORT_11A_G,
  10868. HTT_PEER_RATE_REPORT_11N,
  10869. HTT_PEER_RATE_REPORT_11AC,
  10870. };
  10871. #define HTT_PEER_RATE_REPORT_SIZE 8
  10872. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10873. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10874. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10875. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10876. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10877. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10878. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10879. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10880. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10881. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10882. do { \
  10883. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10884. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10885. } while (0)
  10886. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10887. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10888. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10889. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10890. do { \
  10891. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10892. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10893. } while (0)
  10894. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10895. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10896. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10897. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10898. do { \
  10899. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10900. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10901. } while (0)
  10902. /**
  10903. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10904. *
  10905. * @details
  10906. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10907. * a flow of descriptors.
  10908. *
  10909. * This message is in TLV format and indicates the parameters to be setup a
  10910. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10911. * receive descriptors from a specified pool.
  10912. *
  10913. * The message would appear as follows:
  10914. *
  10915. * |31 24|23 16|15 8|7 0|
  10916. * |----------------+----------------+----------------+----------------|
  10917. * header | reserved | num_flows | msg_type |
  10918. * |-------------------------------------------------------------------|
  10919. * | |
  10920. * : payload :
  10921. * | |
  10922. * |-------------------------------------------------------------------|
  10923. *
  10924. * The header field is one DWORD long and is interpreted as follows:
  10925. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10926. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10927. * this message
  10928. * b'16-31 - reserved: These bits are reserved for future use
  10929. *
  10930. * Payload:
  10931. * The payload would contain multiple objects of the following structure. Each
  10932. * object represents a flow.
  10933. *
  10934. * |31 24|23 16|15 8|7 0|
  10935. * |----------------+----------------+----------------+----------------|
  10936. * header | reserved | num_flows | msg_type |
  10937. * |-------------------------------------------------------------------|
  10938. * payload0| flow_type |
  10939. * |-------------------------------------------------------------------|
  10940. * | flow_id |
  10941. * |-------------------------------------------------------------------|
  10942. * | reserved0 | flow_pool_id |
  10943. * |-------------------------------------------------------------------|
  10944. * | reserved1 | flow_pool_size |
  10945. * |-------------------------------------------------------------------|
  10946. * | reserved2 |
  10947. * |-------------------------------------------------------------------|
  10948. * payload1| flow_type |
  10949. * |-------------------------------------------------------------------|
  10950. * | flow_id |
  10951. * |-------------------------------------------------------------------|
  10952. * | reserved0 | flow_pool_id |
  10953. * |-------------------------------------------------------------------|
  10954. * | reserved1 | flow_pool_size |
  10955. * |-------------------------------------------------------------------|
  10956. * | reserved2 |
  10957. * |-------------------------------------------------------------------|
  10958. * | . |
  10959. * | . |
  10960. * | . |
  10961. * |-------------------------------------------------------------------|
  10962. *
  10963. * Each payload is 5 DWORDS long and is interpreted as follows:
  10964. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10965. * this flow is associated. It can be VDEV, peer,
  10966. * or tid (AC). Based on enum htt_flow_type.
  10967. *
  10968. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10969. * object. For flow_type vdev it is set to the
  10970. * vdevid, for peer it is peerid and for tid, it is
  10971. * tid_num.
  10972. *
  10973. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10974. * in the host for this flow
  10975. * b'16:31 - reserved0: This field in reserved for the future. In case
  10976. * we have a hierarchical implementation (HCM) of
  10977. * pools, it can be used to indicate the ID of the
  10978. * parent-pool.
  10979. *
  10980. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10981. * Descriptors for this flow will be
  10982. * allocated from this pool in the host.
  10983. * b'16:31 - reserved1: This field in reserved for the future. In case
  10984. * we have a hierarchical implementation of pools,
  10985. * it can be used to indicate the max number of
  10986. * descriptors in the pool. The b'0:15 can be used
  10987. * to indicate min number of descriptors in the
  10988. * HCM scheme.
  10989. *
  10990. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10991. * we have a hierarchical implementation of pools,
  10992. * b'0:15 can be used to indicate the
  10993. * priority-based borrowing (PBB) threshold of
  10994. * the flow's pool. The b'16:31 are still left
  10995. * reserved.
  10996. */
  10997. enum htt_flow_type {
  10998. FLOW_TYPE_VDEV = 0,
  10999. /* Insert new flow types above this line */
  11000. };
  11001. PREPACK struct htt_flow_pool_map_payload_t {
  11002. A_UINT32 flow_type;
  11003. A_UINT32 flow_id;
  11004. A_UINT32 flow_pool_id:16,
  11005. reserved0:16;
  11006. A_UINT32 flow_pool_size:16,
  11007. reserved1:16;
  11008. A_UINT32 reserved2;
  11009. } POSTPACK;
  11010. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  11011. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  11012. (sizeof(struct htt_flow_pool_map_payload_t))
  11013. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  11014. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  11015. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  11016. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  11017. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  11018. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  11019. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  11020. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  11021. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  11022. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  11023. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  11024. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  11025. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  11026. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  11027. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  11028. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  11029. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  11030. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  11031. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  11032. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  11033. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  11034. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  11035. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  11036. do { \
  11037. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  11038. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  11039. } while (0)
  11040. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  11041. do { \
  11042. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  11043. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  11044. } while (0)
  11045. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  11046. do { \
  11047. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  11048. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  11049. } while (0)
  11050. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  11051. do { \
  11052. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  11053. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  11054. } while (0)
  11055. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  11056. do { \
  11057. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  11058. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  11059. } while (0)
  11060. /**
  11061. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  11062. *
  11063. * @details
  11064. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  11065. * down a flow of descriptors.
  11066. * This message indicates that for the flow (whose ID is provided) is wanting
  11067. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  11068. * pool of descriptors from where descriptors are being allocated for this
  11069. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  11070. * be unmapped by the host.
  11071. *
  11072. * The message would appear as follows:
  11073. *
  11074. * |31 24|23 16|15 8|7 0|
  11075. * |----------------+----------------+----------------+----------------|
  11076. * | reserved0 | msg_type |
  11077. * |-------------------------------------------------------------------|
  11078. * | flow_type |
  11079. * |-------------------------------------------------------------------|
  11080. * | flow_id |
  11081. * |-------------------------------------------------------------------|
  11082. * | reserved1 | flow_pool_id |
  11083. * |-------------------------------------------------------------------|
  11084. *
  11085. * The message is interpreted as follows:
  11086. * dword0 - b'0:7 - msg_type: This will be set to
  11087. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  11088. * b'8:31 - reserved0: Reserved for future use
  11089. *
  11090. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  11091. * this flow is associated. It can be VDEV, peer,
  11092. * or tid (AC). Based on enum htt_flow_type.
  11093. *
  11094. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  11095. * object. For flow_type vdev it is set to the
  11096. * vdevid, for peer it is peerid and for tid, it is
  11097. * tid_num.
  11098. *
  11099. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  11100. * used in the host for this flow
  11101. * b'16:31 - reserved0: This field in reserved for the future.
  11102. *
  11103. */
  11104. PREPACK struct htt_flow_pool_unmap_t {
  11105. A_UINT32 msg_type:8,
  11106. reserved0:24;
  11107. A_UINT32 flow_type;
  11108. A_UINT32 flow_id;
  11109. A_UINT32 flow_pool_id:16,
  11110. reserved1:16;
  11111. } POSTPACK;
  11112. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11113. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11114. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11115. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11116. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11117. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11118. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11119. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11120. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11121. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11122. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11123. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11124. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11125. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11126. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11127. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11128. do { \
  11129. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11130. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11131. } while (0)
  11132. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11133. do { \
  11134. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11135. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11136. } while (0)
  11137. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11138. do { \
  11139. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11140. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11141. } while (0)
  11142. /**
  11143. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  11144. *
  11145. * @details
  11146. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11147. * SRNG ring setup is done
  11148. *
  11149. * This message indicates whether the last setup operation is successful.
  11150. * It will be sent to host when host set respose_required bit in
  11151. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11152. * The message would appear as follows:
  11153. *
  11154. * |31 24|23 16|15 8|7 0|
  11155. * |--------------- +----------------+----------------+----------------|
  11156. * | setup_status | ring_id | pdev_id | msg_type |
  11157. * |-------------------------------------------------------------------|
  11158. *
  11159. * The message is interpreted as follows:
  11160. * dword0 - b'0:7 - msg_type: This will be set to
  11161. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11162. * b'8:15 - pdev_id:
  11163. * 0 (for rings at SOC/UMAC level),
  11164. * 1/2/3 mac id (for rings at LMAC level)
  11165. * b'16:23 - ring_id: Identify the ring which is set up
  11166. * More details can be got from enum htt_srng_ring_id
  11167. * b'24:31 - setup_status: Indicate status of setup operation
  11168. * Refer to htt_ring_setup_status
  11169. */
  11170. PREPACK struct htt_sring_setup_done_t {
  11171. A_UINT32 msg_type: 8,
  11172. pdev_id: 8,
  11173. ring_id: 8,
  11174. setup_status: 8;
  11175. } POSTPACK;
  11176. enum htt_ring_setup_status {
  11177. htt_ring_setup_status_ok = 0,
  11178. htt_ring_setup_status_error,
  11179. };
  11180. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11181. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11182. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11183. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11184. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11185. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11186. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11187. do { \
  11188. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11189. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11190. } while (0)
  11191. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11192. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11193. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11194. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11195. HTT_SRING_SETUP_DONE_RING_ID_S)
  11196. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11197. do { \
  11198. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11199. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11200. } while (0)
  11201. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11202. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11203. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11204. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11205. HTT_SRING_SETUP_DONE_STATUS_S)
  11206. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11207. do { \
  11208. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11209. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11210. } while (0)
  11211. /**
  11212. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  11213. *
  11214. * @details
  11215. * HTT TX map flow entry with tqm flow pointer
  11216. * Sent from firmware to host to add tqm flow pointer in corresponding
  11217. * flow search entry. Flow metadata is replayed back to host as part of this
  11218. * struct to enable host to find the specific flow search entry
  11219. *
  11220. * The message would appear as follows:
  11221. *
  11222. * |31 28|27 18|17 14|13 8|7 0|
  11223. * |-------+------------------------------------------+----------------|
  11224. * | rsvd0 | fse_hsh_idx | msg_type |
  11225. * |-------------------------------------------------------------------|
  11226. * | rsvd1 | tid | peer_id |
  11227. * |-------------------------------------------------------------------|
  11228. * | tqm_flow_pntr_lo |
  11229. * |-------------------------------------------------------------------|
  11230. * | tqm_flow_pntr_hi |
  11231. * |-------------------------------------------------------------------|
  11232. * | fse_meta_data |
  11233. * |-------------------------------------------------------------------|
  11234. *
  11235. * The message is interpreted as follows:
  11236. *
  11237. * dword0 - b'0:7 - msg_type: This will be set to
  11238. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11239. *
  11240. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11241. * for this flow entry
  11242. *
  11243. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11244. *
  11245. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11246. *
  11247. * dword1 - b'14:17 - tid
  11248. *
  11249. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11250. *
  11251. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11252. *
  11253. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11254. *
  11255. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11256. * given by host
  11257. */
  11258. PREPACK struct htt_tx_map_flow_info {
  11259. A_UINT32
  11260. msg_type: 8,
  11261. fse_hsh_idx: 20,
  11262. rsvd0: 4;
  11263. A_UINT32
  11264. peer_id: 14,
  11265. tid: 4,
  11266. rsvd1: 14;
  11267. A_UINT32 tqm_flow_pntr_lo;
  11268. A_UINT32 tqm_flow_pntr_hi;
  11269. struct htt_tx_flow_metadata fse_meta_data;
  11270. } POSTPACK;
  11271. /* DWORD 0 */
  11272. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11273. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11274. /* DWORD 1 */
  11275. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11276. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11277. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11278. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11279. /* DWORD 0 */
  11280. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11281. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11282. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11283. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11284. do { \
  11285. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11286. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11287. } while (0)
  11288. /* DWORD 1 */
  11289. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11290. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11291. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11292. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11293. do { \
  11294. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11295. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11296. } while (0)
  11297. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11298. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11299. HTT_TX_MAP_FLOW_INFO_TID_S)
  11300. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11301. do { \
  11302. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11303. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11304. } while (0)
  11305. /*
  11306. * htt_dbg_ext_stats_status -
  11307. * present - The requested stats have been delivered in full.
  11308. * This indicates that either the stats information was contained
  11309. * in its entirety within this message, or else this message
  11310. * completes the delivery of the requested stats info that was
  11311. * partially delivered through earlier STATS_CONF messages.
  11312. * partial - The requested stats have been delivered in part.
  11313. * One or more subsequent STATS_CONF messages with the same
  11314. * cookie value will be sent to deliver the remainder of the
  11315. * information.
  11316. * error - The requested stats could not be delivered, for example due
  11317. * to a shortage of memory to construct a message holding the
  11318. * requested stats.
  11319. * invalid - The requested stat type is either not recognized, or the
  11320. * target is configured to not gather the stats type in question.
  11321. */
  11322. enum htt_dbg_ext_stats_status {
  11323. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11324. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11325. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11326. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11327. };
  11328. /**
  11329. * @brief target -> host ppdu stats upload
  11330. *
  11331. * @details
  11332. * The following field definitions describe the format of the HTT target
  11333. * to host ppdu stats indication message.
  11334. *
  11335. *
  11336. * |31 16|15 12|11 10|9 8|7 0 |
  11337. * |----------------------------------------------------------------------|
  11338. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11339. * |----------------------------------------------------------------------|
  11340. * | ppdu_id |
  11341. * |----------------------------------------------------------------------|
  11342. * | Timestamp in us |
  11343. * |----------------------------------------------------------------------|
  11344. * | reserved |
  11345. * |----------------------------------------------------------------------|
  11346. * | type-specific stats info |
  11347. * | (see htt_ppdu_stats.h) |
  11348. * |----------------------------------------------------------------------|
  11349. * Header fields:
  11350. * - MSG_TYPE
  11351. * Bits 7:0
  11352. * Purpose: Identifies this is a PPDU STATS indication
  11353. * message.
  11354. * Value: 0x1d
  11355. * - mac_id
  11356. * Bits 9:8
  11357. * Purpose: mac_id of this ppdu_id
  11358. * Value: 0-3
  11359. * - pdev_id
  11360. * Bits 11:10
  11361. * Purpose: pdev_id of this ppdu_id
  11362. * Value: 0-3
  11363. * 0 (for rings at SOC level),
  11364. * 1/2/3 PDEV -> 0/1/2
  11365. * - payload_size
  11366. * Bits 31:16
  11367. * Purpose: total tlv size
  11368. * Value: payload_size in bytes
  11369. */
  11370. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11371. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11372. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11373. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11374. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11375. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11376. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11377. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11378. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11379. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11380. do { \
  11381. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11382. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11383. } while (0)
  11384. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11385. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11386. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11387. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11388. do { \
  11389. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11390. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11391. } while (0)
  11392. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11393. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11394. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11395. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11396. do { \
  11397. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11398. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11399. } while (0)
  11400. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11401. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11402. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11403. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11404. do { \
  11405. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11406. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11407. } while (0)
  11408. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11409. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11410. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11411. /* htt_t2h_ppdu_stats_ind_hdr_t
  11412. * This struct contains the fields within the header of the
  11413. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11414. * stats info.
  11415. * This struct assumes little-endian layout, and thus is only
  11416. * suitable for use within processors known to be little-endian
  11417. * (such as the target).
  11418. * In contrast, the above macros provide endian-portable methods
  11419. * to get and set the bitfields within this PPDU_STATS_IND header.
  11420. */
  11421. typedef struct {
  11422. A_UINT32 msg_type: 8, /* bits 7:0 */
  11423. mac_id: 2, /* bits 9:8 */
  11424. pdev_id: 2, /* bits 11:10 */
  11425. reserved1: 4, /* bits 15:12 */
  11426. payload_size: 16; /* bits 31:16 */
  11427. A_UINT32 ppdu_id;
  11428. A_UINT32 timestamp_us;
  11429. A_UINT32 reserved2;
  11430. } htt_t2h_ppdu_stats_ind_hdr_t;
  11431. /**
  11432. * @brief target -> host extended statistics upload
  11433. *
  11434. * @details
  11435. * The following field definitions describe the format of the HTT target
  11436. * to host stats upload confirmation message.
  11437. * The message contains a cookie echoed from the HTT host->target stats
  11438. * upload request, which identifies which request the confirmation is
  11439. * for, and a single stats can span over multiple HTT stats indication
  11440. * due to the HTT message size limitation so every HTT ext stats indication
  11441. * will have tag-length-value stats information elements.
  11442. * The tag-length header for each HTT stats IND message also includes a
  11443. * status field, to indicate whether the request for the stat type in
  11444. * question was fully met, partially met, unable to be met, or invalid
  11445. * (if the stat type in question is disabled in the target).
  11446. * A Done bit 1's indicate the end of the of stats info elements.
  11447. *
  11448. *
  11449. * |31 16|15 12|11|10 8|7 5|4 0|
  11450. * |--------------------------------------------------------------|
  11451. * | reserved | msg type |
  11452. * |--------------------------------------------------------------|
  11453. * | cookie LSBs |
  11454. * |--------------------------------------------------------------|
  11455. * | cookie MSBs |
  11456. * |--------------------------------------------------------------|
  11457. * | stats entry length | rsvd | D| S | stat type |
  11458. * |--------------------------------------------------------------|
  11459. * | type-specific stats info |
  11460. * | (see htt_stats.h) |
  11461. * |--------------------------------------------------------------|
  11462. * Header fields:
  11463. * - MSG_TYPE
  11464. * Bits 7:0
  11465. * Purpose: Identifies this is a extended statistics upload confirmation
  11466. * message.
  11467. * Value: 0x1c
  11468. * - COOKIE_LSBS
  11469. * Bits 31:0
  11470. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11471. * message with its preceding host->target stats request message.
  11472. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11473. * - COOKIE_MSBS
  11474. * Bits 31:0
  11475. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11476. * message with its preceding host->target stats request message.
  11477. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11478. *
  11479. * Stats Information Element tag-length header fields:
  11480. * - STAT_TYPE
  11481. * Bits 7:0
  11482. * Purpose: identifies the type of statistics info held in the
  11483. * following information element
  11484. * Value: htt_dbg_ext_stats_type
  11485. * - STATUS
  11486. * Bits 10:8
  11487. * Purpose: indicate whether the requested stats are present
  11488. * Value: htt_dbg_ext_stats_status
  11489. * - DONE
  11490. * Bits 11
  11491. * Purpose:
  11492. * Indicates the completion of the stats entry, this will be the last
  11493. * stats conf HTT segment for the requested stats type.
  11494. * Value:
  11495. * 0 -> the stats retrieval is ongoing
  11496. * 1 -> the stats retrieval is complete
  11497. * - LENGTH
  11498. * Bits 31:16
  11499. * Purpose: indicate the stats information size
  11500. * Value: This field specifies the number of bytes of stats information
  11501. * that follows the element tag-length header.
  11502. * It is expected but not required that this length is a multiple of
  11503. * 4 bytes.
  11504. */
  11505. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11506. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11507. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11508. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11509. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11510. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11511. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11512. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11513. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11514. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11515. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11516. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11517. do { \
  11518. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11519. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11520. } while (0)
  11521. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11522. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11523. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11524. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11525. do { \
  11526. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11527. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11528. } while (0)
  11529. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11530. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11531. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11532. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11533. do { \
  11534. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11535. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11536. } while (0)
  11537. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11538. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11539. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11540. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11541. do { \
  11542. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11543. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11544. } while (0)
  11545. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11546. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11547. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11548. typedef enum {
  11549. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11550. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11551. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11552. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11553. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11554. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11555. /* Reserved from 128 - 255 for target internal use.*/
  11556. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11557. } HTT_PEER_TYPE;
  11558. /** macro to convert MAC address from char array to HTT word format */
  11559. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11560. (phtt_mac_addr)->mac_addr31to0 = \
  11561. (((c_macaddr)[0] << 0) | \
  11562. ((c_macaddr)[1] << 8) | \
  11563. ((c_macaddr)[2] << 16) | \
  11564. ((c_macaddr)[3] << 24)); \
  11565. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11566. } while (0)
  11567. /**
  11568. * @brief target -> host monitor mac header indication message
  11569. *
  11570. * @details
  11571. * The following diagram shows the format of the monitor mac header message
  11572. * sent from the target to the host.
  11573. * This message is primarily sent when promiscuous rx mode is enabled.
  11574. * One message is sent per rx PPDU.
  11575. *
  11576. * |31 24|23 16|15 8|7 0|
  11577. * |-------------------------------------------------------------|
  11578. * | peer_id | reserved0 | msg_type |
  11579. * |-------------------------------------------------------------|
  11580. * | reserved1 | num_mpdu |
  11581. * |-------------------------------------------------------------|
  11582. * | struct hw_rx_desc |
  11583. * | (see wal_rx_desc.h) |
  11584. * |-------------------------------------------------------------|
  11585. * | struct ieee80211_frame_addr4 |
  11586. * | (see ieee80211_defs.h) |
  11587. * |-------------------------------------------------------------|
  11588. * | struct ieee80211_frame_addr4 |
  11589. * | (see ieee80211_defs.h) |
  11590. * |-------------------------------------------------------------|
  11591. * | ...... |
  11592. * |-------------------------------------------------------------|
  11593. *
  11594. * Header fields:
  11595. * - msg_type
  11596. * Bits 7:0
  11597. * Purpose: Identifies this is a monitor mac header indication message.
  11598. * Value: 0x20
  11599. * - peer_id
  11600. * Bits 31:16
  11601. * Purpose: Software peer id given by host during association,
  11602. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11603. * for rx PPDUs received from unassociated peers.
  11604. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11605. * - num_mpdu
  11606. * Bits 15:0
  11607. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11608. * delivered within the message.
  11609. * Value: 1 to 32
  11610. * num_mpdu is limited to a maximum value of 32, due to buffer
  11611. * size limits. For PPDUs with more than 32 MPDUs, only the
  11612. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11613. * the PPDU will be provided.
  11614. */
  11615. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11616. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11617. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11618. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11619. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11620. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11621. do { \
  11622. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11623. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11624. } while (0)
  11625. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11626. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11627. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11628. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11629. do { \
  11630. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11631. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11632. } while (0)
  11633. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11634. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11635. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11636. /**
  11637. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11638. *
  11639. * @details
  11640. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11641. * the flow pool associated with the specified ID is resized
  11642. *
  11643. * The message would appear as follows:
  11644. *
  11645. * |31 16|15 8|7 0|
  11646. * |---------------------------------+----------------+----------------|
  11647. * | reserved0 | Msg type |
  11648. * |-------------------------------------------------------------------|
  11649. * | flow pool new size | flow pool ID |
  11650. * |-------------------------------------------------------------------|
  11651. *
  11652. * The message is interpreted as follows:
  11653. * b'0:7 - msg_type: This will be set to
  11654. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11655. *
  11656. * b'0:15 - flow pool ID: Existing flow pool ID
  11657. *
  11658. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11659. *
  11660. */
  11661. PREPACK struct htt_flow_pool_resize_t {
  11662. A_UINT32 msg_type:8,
  11663. reserved0:24;
  11664. A_UINT32 flow_pool_id:16,
  11665. flow_pool_new_size:16;
  11666. } POSTPACK;
  11667. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11668. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11669. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11670. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11671. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11672. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11673. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11674. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11675. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11676. do { \
  11677. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11678. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11679. } while (0)
  11680. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11681. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11682. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11683. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11684. do { \
  11685. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11686. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11687. } while (0)
  11688. /**
  11689. * @brief host -> target channel change message
  11690. *
  11691. * @details
  11692. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11693. * to associate RX frames to correct channel they were received on.
  11694. * The following field definitions describe the format of the HTT target
  11695. * to host channel change message.
  11696. * |31 16|15 8|7 5|4 0|
  11697. * |------------------------------------------------------------|
  11698. * | reserved | MSG_TYPE |
  11699. * |------------------------------------------------------------|
  11700. * | CHAN_MHZ |
  11701. * |------------------------------------------------------------|
  11702. * | BAND_CENTER_FREQ1 |
  11703. * |------------------------------------------------------------|
  11704. * | BAND_CENTER_FREQ2 |
  11705. * |------------------------------------------------------------|
  11706. * | CHAN_PHY_MODE |
  11707. * |------------------------------------------------------------|
  11708. * Header fields:
  11709. * - MSG_TYPE
  11710. * Bits 7:0
  11711. * Value: 0xf
  11712. * - CHAN_MHZ
  11713. * Bits 31:0
  11714. * Purpose: frequency of the primary 20mhz channel.
  11715. * - BAND_CENTER_FREQ1
  11716. * Bits 31:0
  11717. * Purpose: centre frequency of the full channel.
  11718. * - BAND_CENTER_FREQ2
  11719. * Bits 31:0
  11720. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11721. * - CHAN_PHY_MODE
  11722. * Bits 31:0
  11723. * Purpose: phy mode of the channel.
  11724. */
  11725. PREPACK struct htt_chan_change_msg {
  11726. A_UINT32 chan_mhz; /* frequency in mhz */
  11727. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11728. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11729. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11730. } POSTPACK;
  11731. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11732. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11733. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11734. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11735. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11736. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11737. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11738. /*
  11739. * The read and write indices point to the data within the host buffer.
  11740. * Because the first 4 bytes of the host buffer is used for the read index and
  11741. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11742. * The read index and write index are the byte offsets from the base of the
  11743. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11744. * Refer the ASCII text picture below.
  11745. */
  11746. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11747. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11748. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11749. /*
  11750. ***************************************************************************
  11751. *
  11752. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11753. *
  11754. ***************************************************************************
  11755. *
  11756. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11757. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11758. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11759. * written into the Host memory region mentioned below.
  11760. *
  11761. * Read index is updated by the Host. At any point of time, the read index will
  11762. * indicate the index that will next be read by the Host. The read index is
  11763. * in units of bytes offset from the base of the meta-data buffer.
  11764. *
  11765. * Write index is updated by the FW. At any point of time, the write index will
  11766. * indicate from where the FW can start writing any new data. The write index is
  11767. * in units of bytes offset from the base of the meta-data buffer.
  11768. *
  11769. * If the Host is not fast enough in reading the CFR data, any new capture data
  11770. * would be dropped if there is no space left to write the new captures.
  11771. *
  11772. * The last 4 bytes of the memory region will have the magic pattern
  11773. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11774. * not overrun the host buffer.
  11775. *
  11776. * ,--------------------. read and write indices store the
  11777. * | | byte offset from the base of the
  11778. * | ,--------+--------. meta-data buffer to the next
  11779. * | | | | location within the data buffer
  11780. * | | v v that will be read / written
  11781. * ************************************************************************
  11782. * * Read * Write * * Magic *
  11783. * * index * index * CFR data1 ...... CFR data N * pattern *
  11784. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11785. * ************************************************************************
  11786. * |<---------- data buffer ---------->|
  11787. *
  11788. * |<----------------- meta-data buffer allocated in Host ----------------|
  11789. *
  11790. * Note:
  11791. * - Considering the 4 bytes needed to store the Read index (R) and the
  11792. * Write index (W), the initial value is as follows:
  11793. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11794. * - Buffer empty condition:
  11795. * R = W
  11796. *
  11797. * Regarding CFR data format:
  11798. * --------------------------
  11799. *
  11800. * Each CFR tone is stored in HW as 16-bits with the following format:
  11801. * {bits[15:12], bits[11:6], bits[5:0]} =
  11802. * {unsigned exponent (4 bits),
  11803. * signed mantissa_real (6 bits),
  11804. * signed mantissa_imag (6 bits)}
  11805. *
  11806. * CFR_real = mantissa_real * 2^(exponent-5)
  11807. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11808. *
  11809. *
  11810. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11811. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11812. *
  11813. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11814. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11815. * .
  11816. * .
  11817. * .
  11818. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11819. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11820. */
  11821. /* Bandwidth of peer CFR captures */
  11822. typedef enum {
  11823. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11824. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11825. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11826. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11827. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11828. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11829. } HTT_PEER_CFR_CAPTURE_BW;
  11830. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11831. * was captured
  11832. */
  11833. typedef enum {
  11834. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11835. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11836. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11837. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11838. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11839. } HTT_PEER_CFR_CAPTURE_MODE;
  11840. typedef enum {
  11841. /* This message type is currently used for the below purpose:
  11842. *
  11843. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11844. * wmi_peer_cfr_capture_cmd.
  11845. * If payload_present bit is set to 0 then the associated memory region
  11846. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11847. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11848. * message; the CFR dump will be present at the end of the message,
  11849. * after the chan_phy_mode.
  11850. */
  11851. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11852. /* Always keep this last */
  11853. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11854. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11855. /**
  11856. * @brief target -> host CFR dump completion indication message definition
  11857. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11858. *
  11859. * @details
  11860. * The following diagram shows the format of the Channel Frequency Response
  11861. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11862. * the channel capture of a peer is copied by Firmware into the Host memory
  11863. *
  11864. * **************************************************************************
  11865. *
  11866. * Message format when the CFR capture message type is
  11867. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11868. *
  11869. * **************************************************************************
  11870. *
  11871. * |31 16|15 |8|7 0|
  11872. * |----------------------------------------------------------------|
  11873. * header: | reserved |P| msg_type |
  11874. * word 0 | | | |
  11875. * |----------------------------------------------------------------|
  11876. * payload: | cfr_capture_msg_type |
  11877. * word 1 | |
  11878. * |----------------------------------------------------------------|
  11879. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11880. * word 2 | | | | | | | | |
  11881. * |----------------------------------------------------------------|
  11882. * | mac_addr31to0 |
  11883. * word 3 | |
  11884. * |----------------------------------------------------------------|
  11885. * | unused / reserved | mac_addr47to32 |
  11886. * word 4 | | |
  11887. * |----------------------------------------------------------------|
  11888. * | index |
  11889. * word 5 | |
  11890. * |----------------------------------------------------------------|
  11891. * | length |
  11892. * word 6 | |
  11893. * |----------------------------------------------------------------|
  11894. * | timestamp |
  11895. * word 7 | |
  11896. * |----------------------------------------------------------------|
  11897. * | counter |
  11898. * word 8 | |
  11899. * |----------------------------------------------------------------|
  11900. * | chan_mhz |
  11901. * word 9 | |
  11902. * |----------------------------------------------------------------|
  11903. * | band_center_freq1 |
  11904. * word 10 | |
  11905. * |----------------------------------------------------------------|
  11906. * | band_center_freq2 |
  11907. * word 11 | |
  11908. * |----------------------------------------------------------------|
  11909. * | chan_phy_mode |
  11910. * word 12 | |
  11911. * |----------------------------------------------------------------|
  11912. * where,
  11913. * P - payload present bit (payload_present explained below)
  11914. * req_id - memory request id (mem_req_id explained below)
  11915. * S - status field (status explained below)
  11916. * capbw - capture bandwidth (capture_bw explained below)
  11917. * mode - mode of capture (mode explained below)
  11918. * sts - space time streams (sts_count explained below)
  11919. * chbw - channel bandwidth (channel_bw explained below)
  11920. * captype - capture type (cap_type explained below)
  11921. *
  11922. * The following field definitions describe the format of the CFR dump
  11923. * completion indication sent from the target to the host
  11924. *
  11925. * Header fields:
  11926. *
  11927. * Word 0
  11928. * - msg_type
  11929. * Bits 7:0
  11930. * Purpose: Identifies this as CFR TX completion indication
  11931. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11932. * - payload_present
  11933. * Bit 8
  11934. * Purpose: Identifies how CFR data is sent to host
  11935. * Value: 0 - If CFR Payload is written to host memory
  11936. * 1 - If CFR Payload is sent as part of HTT message
  11937. * (This is the requirement for SDIO/USB where it is
  11938. * not possible to write CFR data to host memory)
  11939. * - reserved
  11940. * Bits 31:9
  11941. * Purpose: Reserved
  11942. * Value: 0
  11943. *
  11944. * Payload fields:
  11945. *
  11946. * Word 1
  11947. * - cfr_capture_msg_type
  11948. * Bits 31:0
  11949. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11950. * to specify the format used for the remainder of the message
  11951. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11952. * (currently only MSG_TYPE_1 is defined)
  11953. *
  11954. * Word 2
  11955. * - mem_req_id
  11956. * Bits 6:0
  11957. * Purpose: Contain the mem request id of the region where the CFR capture
  11958. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11959. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11960. this value is invalid)
  11961. * - status
  11962. * Bit 7
  11963. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11964. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11965. * - capture_bw
  11966. * Bits 10:8
  11967. * Purpose: Carry the bandwidth of the CFR capture
  11968. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11969. * - mode
  11970. * Bits 13:11
  11971. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11972. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11973. * - sts_count
  11974. * Bits 16:14
  11975. * Purpose: Carry the number of space time streams
  11976. * Value: Number of space time streams
  11977. * - channel_bw
  11978. * Bits 19:17
  11979. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11980. * measurement
  11981. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11982. * - cap_type
  11983. * Bits 23:20
  11984. * Purpose: Carry the type of the capture
  11985. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11986. * - vdev_id
  11987. * Bits 31:24
  11988. * Purpose: Carry the virtual device id
  11989. * Value: vdev ID
  11990. *
  11991. * Word 3
  11992. * - mac_addr31to0
  11993. * Bits 31:0
  11994. * Purpose: Contain the bits 31:0 of the peer MAC address
  11995. * Value: Bits 31:0 of the peer MAC address
  11996. *
  11997. * Word 4
  11998. * - mac_addr47to32
  11999. * Bits 15:0
  12000. * Purpose: Contain the bits 47:32 of the peer MAC address
  12001. * Value: Bits 47:32 of the peer MAC address
  12002. *
  12003. * Word 5
  12004. * - index
  12005. * Bits 31:0
  12006. * Purpose: Contain the index at which this CFR dump was written in the Host
  12007. * allocated memory. This index is the number of bytes from the base address.
  12008. * Value: Index position
  12009. *
  12010. * Word 6
  12011. * - length
  12012. * Bits 31:0
  12013. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  12014. * Value: Length of the CFR capture of the peer
  12015. *
  12016. * Word 7
  12017. * - timestamp
  12018. * Bits 31:0
  12019. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  12020. * clock used for this timestamp is private to the target and not visible to
  12021. * the host i.e., Host can interpret only the relative timestamp deltas from
  12022. * one message to the next, but can't interpret the absolute timestamp from a
  12023. * single message.
  12024. * Value: Timestamp in microseconds
  12025. *
  12026. * Word 8
  12027. * - counter
  12028. * Bits 31:0
  12029. * Purpose: Carry the count of the current CFR capture from FW. This is
  12030. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  12031. * in host memory)
  12032. * Value: Count of the current CFR capture
  12033. *
  12034. * Word 9
  12035. * - chan_mhz
  12036. * Bits 31:0
  12037. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  12038. * Value: Primary 20 channel frequency
  12039. *
  12040. * Word 10
  12041. * - band_center_freq1
  12042. * Bits 31:0
  12043. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  12044. * Value: Center frequency 1 in MHz
  12045. *
  12046. * Word 11
  12047. * - band_center_freq2
  12048. * Bits 31:0
  12049. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  12050. * the VDEV
  12051. * 80plus80 mode
  12052. * Value: Center frequency 2 in MHz
  12053. *
  12054. * Word 12
  12055. * - chan_phy_mode
  12056. * Bits 31:0
  12057. * Purpose: Carry the phy mode of the channel, of the VDEV
  12058. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  12059. */
  12060. PREPACK struct htt_cfr_dump_ind_type_1 {
  12061. A_UINT32 mem_req_id:7,
  12062. status:1,
  12063. capture_bw:3,
  12064. mode:3,
  12065. sts_count:3,
  12066. channel_bw:3,
  12067. cap_type:4,
  12068. vdev_id:8;
  12069. htt_mac_addr addr;
  12070. A_UINT32 index;
  12071. A_UINT32 length;
  12072. A_UINT32 timestamp;
  12073. A_UINT32 counter;
  12074. struct htt_chan_change_msg chan;
  12075. } POSTPACK;
  12076. PREPACK struct htt_cfr_dump_compl_ind {
  12077. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  12078. union {
  12079. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  12080. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  12081. /* If there is a need to change the memory layout and its associated
  12082. * HTT indication format, a new CFR capture message type can be
  12083. * introduced and added into this union.
  12084. */
  12085. };
  12086. } POSTPACK;
  12087. /*
  12088. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  12089. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12090. */
  12091. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  12092. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  12093. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  12094. do { \
  12095. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  12096. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12097. } while(0)
  12098. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12099. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12100. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12101. /*
  12102. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12103. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12104. */
  12105. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12106. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12107. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12108. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12109. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12110. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12111. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12112. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12113. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12114. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12115. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12116. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12117. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12118. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12119. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12120. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12121. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12122. do { \
  12123. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12124. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12125. } while (0)
  12126. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12127. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12128. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12129. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12130. do { \
  12131. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12132. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12133. } while (0)
  12134. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12135. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12136. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12137. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12138. do { \
  12139. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12140. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12141. } while (0)
  12142. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12143. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12144. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12145. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12146. do { \
  12147. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12148. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12149. } while (0)
  12150. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12151. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12152. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12153. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12154. do { \
  12155. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12156. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12157. } while (0)
  12158. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12159. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12160. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12161. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12162. do { \
  12163. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12164. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12165. } while (0)
  12166. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12167. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12168. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12169. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12170. do { \
  12171. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12172. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12173. } while (0)
  12174. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12175. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12176. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12177. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12178. do { \
  12179. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12180. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12181. } while (0)
  12182. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12183. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12184. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12185. /**
  12186. * @brief target -> host peer (PPDU) stats message
  12187. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12188. * @details
  12189. * This message is generated by FW when FW is sending stats to host
  12190. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12191. * This message is sent autonomously by the target rather than upon request
  12192. * by the host.
  12193. * The following field definitions describe the format of the HTT target
  12194. * to host peer stats indication message.
  12195. *
  12196. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12197. * or more PPDU stats records.
  12198. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12199. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12200. * then the message would start with the
  12201. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12202. * below.
  12203. *
  12204. * |31 16|15|14|13 11|10 9|8|7 0|
  12205. * |-------------------------------------------------------------|
  12206. * | reserved |MSG_TYPE |
  12207. * |-------------------------------------------------------------|
  12208. * rec 0 | TLV header |
  12209. * rec 0 |-------------------------------------------------------------|
  12210. * rec 0 | ppdu successful bytes |
  12211. * rec 0 |-------------------------------------------------------------|
  12212. * rec 0 | ppdu retry bytes |
  12213. * rec 0 |-------------------------------------------------------------|
  12214. * rec 0 | ppdu failed bytes |
  12215. * rec 0 |-------------------------------------------------------------|
  12216. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12217. * rec 0 |-------------------------------------------------------------|
  12218. * rec 0 | retried MSDUs | successful MSDUs |
  12219. * rec 0 |-------------------------------------------------------------|
  12220. * rec 0 | TX duration | failed MSDUs |
  12221. * rec 0 |-------------------------------------------------------------|
  12222. * ...
  12223. * |-------------------------------------------------------------|
  12224. * rec N | TLV header |
  12225. * rec N |-------------------------------------------------------------|
  12226. * rec N | ppdu successful bytes |
  12227. * rec N |-------------------------------------------------------------|
  12228. * rec N | ppdu retry bytes |
  12229. * rec N |-------------------------------------------------------------|
  12230. * rec N | ppdu failed bytes |
  12231. * rec N |-------------------------------------------------------------|
  12232. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12233. * rec N |-------------------------------------------------------------|
  12234. * rec N | retried MSDUs | successful MSDUs |
  12235. * rec N |-------------------------------------------------------------|
  12236. * rec N | TX duration | failed MSDUs |
  12237. * rec N |-------------------------------------------------------------|
  12238. *
  12239. * where:
  12240. * A = is A-MPDU flag
  12241. * BA = block-ack failure flags
  12242. * BW = bandwidth spec
  12243. * SG = SGI enabled spec
  12244. * S = skipped rate ctrl
  12245. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12246. *
  12247. * Header
  12248. * ------
  12249. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12250. * dword0 - b'8:31 - reserved : Reserved for future use
  12251. *
  12252. * payload include below peer_stats information
  12253. * --------------------------------------------
  12254. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12255. * @tx_success_bytes : total successful bytes in the PPDU.
  12256. * @tx_retry_bytes : total retried bytes in the PPDU.
  12257. * @tx_failed_bytes : total failed bytes in the PPDU.
  12258. * @tx_ratecode : rate code used for the PPDU.
  12259. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12260. * @ba_ack_failed : BA/ACK failed for this PPDU
  12261. * b00 -> BA received
  12262. * b01 -> BA failed once
  12263. * b10 -> BA failed twice, when HW retry is enabled.
  12264. * @bw : BW
  12265. * b00 -> 20 MHz
  12266. * b01 -> 40 MHz
  12267. * b10 -> 80 MHz
  12268. * b11 -> 160 MHz (or 80+80)
  12269. * @sg : SGI enabled
  12270. * @s : skipped ratectrl
  12271. * @peer_id : peer id
  12272. * @tx_success_msdus : successful MSDUs
  12273. * @tx_retry_msdus : retried MSDUs
  12274. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12275. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12276. */
  12277. /**
  12278. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  12279. *
  12280. * @details
  12281. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12282. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12283. * This message will only be sent if the backpressure condition has existed
  12284. * continuously for an initial period (100 ms).
  12285. * Repeat messages with updated information will be sent after each
  12286. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12287. * This message indicates the ring id along with current head and tail index
  12288. * locations (i.e. write and read indices).
  12289. * The backpressure time indicates the time in ms for which continous
  12290. * backpressure has been observed in the ring.
  12291. *
  12292. * The message format is as follows:
  12293. *
  12294. * |31 24|23 16|15 8|7 0|
  12295. * |----------------+----------------+----------------+----------------|
  12296. * | ring_id | ring_type | pdev_id | msg_type |
  12297. * |-------------------------------------------------------------------|
  12298. * | tail_idx | head_idx |
  12299. * |-------------------------------------------------------------------|
  12300. * | backpressure_time_ms |
  12301. * |-------------------------------------------------------------------|
  12302. *
  12303. * The message is interpreted as follows:
  12304. * dword0 - b'0:7 - msg_type: This will be set to
  12305. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12306. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12307. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12308. the msg is for LMAC ring.
  12309. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12310. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12311. * htt_backpressure_lmac_ring_id. This represents
  12312. * the ring id for which continous backpressure is seen
  12313. *
  12314. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12315. * the ring indicated by the ring_id
  12316. *
  12317. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12318. * the ring indicated by the ring id
  12319. *
  12320. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12321. * backpressure has been seen in the ring
  12322. * indicated by the ring_id.
  12323. * Units = milliseconds
  12324. */
  12325. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12326. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12327. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12328. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12329. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12330. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12331. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12332. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12333. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12334. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12335. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12336. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12337. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12338. do { \
  12339. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12340. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12341. } while (0)
  12342. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12343. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12344. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12345. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12346. do { \
  12347. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12348. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12349. } while (0)
  12350. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12351. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12352. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12353. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12354. do { \
  12355. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12356. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12357. } while (0)
  12358. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12359. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12360. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12361. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12362. do { \
  12363. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12364. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12365. } while (0)
  12366. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12367. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12368. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12369. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12370. do { \
  12371. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12372. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12373. } while (0)
  12374. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12375. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12376. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12377. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12378. do { \
  12379. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12380. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12381. } while (0)
  12382. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12383. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12384. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12385. enum htt_backpressure_ring_type {
  12386. HTT_SW_RING_TYPE_UMAC,
  12387. HTT_SW_RING_TYPE_LMAC,
  12388. HTT_SW_RING_TYPE_MAX,
  12389. };
  12390. /* Ring id for which the message is sent to host */
  12391. enum htt_backpressure_umac_ringid {
  12392. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12393. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12394. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12395. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12396. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12397. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12398. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12399. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12400. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12401. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12402. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12403. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12404. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12405. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12406. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12407. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12408. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12409. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12410. HTT_SW_UMAC_RING_IDX_MAX,
  12411. };
  12412. enum htt_backpressure_lmac_ringid {
  12413. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12414. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12415. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12416. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12417. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12418. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12419. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12420. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12421. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12422. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12423. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12424. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12425. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12426. HTT_SW_LMAC_RING_IDX_MAX,
  12427. };
  12428. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12429. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12430. pdev_id: 8,
  12431. ring_type: 8, /* htt_backpressure_ring_type */
  12432. /*
  12433. * ring_id holds an enum value from either
  12434. * htt_backpressure_umac_ringid or
  12435. * htt_backpressure_lmac_ringid, based on
  12436. * the ring_type setting.
  12437. */
  12438. ring_id: 8;
  12439. A_UINT16 head_idx;
  12440. A_UINT16 tail_idx;
  12441. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12442. } POSTPACK;
  12443. /*
  12444. * Defines two 32 bit words that can be used by the target to indicate a per
  12445. * user RU allocation and rate information.
  12446. *
  12447. * This information is currently provided in the "sw_response_reference_ptr"
  12448. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12449. * "rx_ppdu_end_user_stats" TLV.
  12450. *
  12451. * VALID:
  12452. * The consumer of these words must explicitly check the valid bit,
  12453. * and only attempt interpretation of any of the remaining fields if
  12454. * the valid bit is set to 1.
  12455. *
  12456. * VERSION:
  12457. * The consumer of these words must also explicitly check the version bit,
  12458. * and only use the V0 definition if the VERSION field is set to 0.
  12459. *
  12460. * Version 1 is currently undefined, with the exception of the VALID and
  12461. * VERSION fields.
  12462. *
  12463. * Version 0:
  12464. *
  12465. * The fields below are duplicated per BW.
  12466. *
  12467. * The consumer must determine which BW field to use, based on the UL OFDMA
  12468. * PPDU BW indicated by HW.
  12469. *
  12470. * RU_START: RU26 start index for the user.
  12471. * Note that this is always using the RU26 index, regardless
  12472. * of the actual RU assigned to the user
  12473. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12474. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12475. *
  12476. * For example, 20MHz (the value in the top row is RU_START)
  12477. *
  12478. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12479. * RU Size 1 (52): | | | | | |
  12480. * RU Size 2 (106): | | | |
  12481. * RU Size 3 (242): | |
  12482. *
  12483. * RU_SIZE: Indicates the RU size, as defined by enum
  12484. * htt_ul_ofdma_user_info_ru_size.
  12485. *
  12486. * LDPC: LDPC enabled (if 0, BCC is used)
  12487. *
  12488. * DCM: DCM enabled
  12489. *
  12490. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12491. * |---------------------------------+--------------------------------|
  12492. * |Ver|Valid| FW internal |
  12493. * |---------------------------------+--------------------------------|
  12494. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12495. * |---------------------------------+--------------------------------|
  12496. */
  12497. enum htt_ul_ofdma_user_info_ru_size {
  12498. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12499. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12500. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12501. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12502. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12503. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12504. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12505. };
  12506. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12507. struct htt_ul_ofdma_user_info_v0 {
  12508. A_UINT32 word0;
  12509. A_UINT32 word1;
  12510. };
  12511. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12512. A_UINT32 w0_fw_rsvd:30; \
  12513. A_UINT32 w0_valid:1; \
  12514. A_UINT32 w0_version:1;
  12515. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12516. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12517. };
  12518. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12519. A_UINT32 w1_nss:3; \
  12520. A_UINT32 w1_mcs:4; \
  12521. A_UINT32 w1_ldpc:1; \
  12522. A_UINT32 w1_dcm:1; \
  12523. A_UINT32 w1_ru_start:7; \
  12524. A_UINT32 w1_ru_size:3; \
  12525. A_UINT32 w1_trig_type:4; \
  12526. A_UINT32 w1_unused:9;
  12527. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12528. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12529. };
  12530. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12531. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12532. union {
  12533. A_UINT32 word0;
  12534. struct {
  12535. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12536. };
  12537. };
  12538. union {
  12539. A_UINT32 word1;
  12540. struct {
  12541. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12542. };
  12543. };
  12544. } POSTPACK;
  12545. enum HTT_UL_OFDMA_TRIG_TYPE {
  12546. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12547. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12548. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12549. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12550. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12551. };
  12552. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12553. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12554. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12555. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12556. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12557. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12558. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12559. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12560. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12561. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12562. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12563. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12564. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12565. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12566. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12567. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12568. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12569. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12570. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12571. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12572. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12574. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12575. /*--- word 0 ---*/
  12576. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12577. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12578. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12579. do { \
  12580. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12581. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12582. } while (0)
  12583. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12584. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12585. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12586. do { \
  12587. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12588. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12589. } while (0)
  12590. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12591. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12592. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12593. do { \
  12594. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12595. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12596. } while (0)
  12597. /*--- word 1 ---*/
  12598. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12599. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12600. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12601. do { \
  12602. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12603. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12604. } while (0)
  12605. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12606. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12607. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12608. do { \
  12609. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12610. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12611. } while (0)
  12612. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12613. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12614. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12615. do { \
  12616. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12617. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12618. } while (0)
  12619. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12620. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12621. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12622. do { \
  12623. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12624. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12625. } while (0)
  12626. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12627. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12628. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12629. do { \
  12630. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12631. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12632. } while (0)
  12633. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12634. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12635. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12636. do { \
  12637. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12638. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12639. } while (0)
  12640. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12641. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12642. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12643. do { \
  12644. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12645. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12646. } while (0)
  12647. /**
  12648. * @brief target -> host channel calibration data message
  12649. * @brief host -> target channel calibration data message
  12650. *
  12651. * @details
  12652. * The following field definitions describe the format of the channel
  12653. * calibration data message sent from the target to the host when
  12654. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12655. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12656. * The message is defined as htt_chan_caldata_msg followed by a variable
  12657. * number of 32-bit character values.
  12658. *
  12659. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12660. * |------------------------------------------------------------------|
  12661. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12662. * |------------------------------------------------------------------|
  12663. * | payload size | mhz |
  12664. * |------------------------------------------------------------------|
  12665. * | center frequency 2 | center frequency 1 |
  12666. * |------------------------------------------------------------------|
  12667. * | check sum |
  12668. * |------------------------------------------------------------------|
  12669. * | payload |
  12670. * |------------------------------------------------------------------|
  12671. * message info field:
  12672. * - MSG_TYPE
  12673. * Bits 7:0
  12674. * Purpose: identifies this as a channel calibration data message
  12675. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12676. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12677. * - SUB_TYPE
  12678. * Bits 11:8
  12679. * Purpose: T2H: indicates whether target is providing chan cal data
  12680. * to the host to store, or requesting that the host
  12681. * download previously-stored data.
  12682. * H2T: indicates whether the host is providing the requested
  12683. * channel cal data, or if it is rejecting the data
  12684. * request because it does not have the requested data.
  12685. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12686. * - CHKSUM_VALID
  12687. * Bit 12
  12688. * Purpose: indicates if the checksum field is valid
  12689. * value:
  12690. * - FRAG
  12691. * Bit 19:16
  12692. * Purpose: indicates the fragment index for message
  12693. * value: 0 for first fragment, 1 for second fragment, ...
  12694. * - APPEND
  12695. * Bit 20
  12696. * Purpose: indicates if this is the last fragment
  12697. * value: 0 = final fragment, 1 = more fragments will be appended
  12698. *
  12699. * channel and payload size field
  12700. * - MHZ
  12701. * Bits 15:0
  12702. * Purpose: indicates the channel primary frequency
  12703. * Value:
  12704. * - PAYLOAD_SIZE
  12705. * Bits 31:16
  12706. * Purpose: indicates the bytes of calibration data in payload
  12707. * Value:
  12708. *
  12709. * center frequency field
  12710. * - CENTER FREQUENCY 1
  12711. * Bits 15:0
  12712. * Purpose: indicates the channel center frequency
  12713. * Value: channel center frequency, in MHz units
  12714. * - CENTER FREQUENCY 2
  12715. * Bits 31:16
  12716. * Purpose: indicates the secondary channel center frequency,
  12717. * only for 11acvht 80plus80 mode
  12718. * Value: secondary channel center frequeny, in MHz units, if applicable
  12719. *
  12720. * checksum field
  12721. * - CHECK_SUM
  12722. * Bits 31:0
  12723. * Purpose: check the payload data, it is just for this fragment.
  12724. * This is intended for the target to check that the channel
  12725. * calibration data returned by the host is the unmodified data
  12726. * that was previously provided to the host by the target.
  12727. * value: checksum of fragment payload
  12728. */
  12729. PREPACK struct htt_chan_caldata_msg {
  12730. /* DWORD 0: message info */
  12731. A_UINT32
  12732. msg_type: 8,
  12733. sub_type: 4 ,
  12734. chksum_valid: 1, /** 1:valid, 0:invalid */
  12735. reserved1: 3,
  12736. frag_idx: 4, /** fragment index for calibration data */
  12737. appending: 1, /** 0: no fragment appending,
  12738. * 1: extra fragment appending */
  12739. reserved2: 11;
  12740. /* DWORD 1: channel and payload size */
  12741. A_UINT32
  12742. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12743. payload_size: 16; /** unit: bytes */
  12744. /* DWORD 2: center frequency */
  12745. A_UINT32
  12746. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12747. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12748. * valid only for 11acvht 80plus80 mode */
  12749. /* DWORD 3: check sum */
  12750. A_UINT32 chksum;
  12751. /* variable length for calibration data */
  12752. A_UINT32 payload[1/* or more */];
  12753. } POSTPACK;
  12754. /* T2H SUBTYPE */
  12755. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12756. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12757. /* H2T SUBTYPE */
  12758. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12759. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12760. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12761. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12762. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12763. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12764. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12765. do { \
  12766. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12767. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12768. } while (0)
  12769. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12770. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12771. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12772. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12773. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12774. do { \
  12775. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12776. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12777. } while (0)
  12778. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12779. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12780. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12781. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12782. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12783. do { \
  12784. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12785. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12786. } while (0)
  12787. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12788. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12789. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12790. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12791. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12792. do { \
  12793. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12794. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12795. } while (0)
  12796. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12797. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12798. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12799. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12800. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12801. do { \
  12802. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12803. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12804. } while (0)
  12805. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12806. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12807. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12808. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12809. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12810. do { \
  12811. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12812. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12813. } while (0)
  12814. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12815. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12816. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12817. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12818. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12819. do { \
  12820. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12821. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12822. } while (0)
  12823. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12824. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12825. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12826. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12827. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12828. do { \
  12829. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12830. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12831. } while (0)
  12832. /**
  12833. * @brief HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND Message
  12834. *
  12835. * @details
  12836. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  12837. * FSE placement in CMEM is enabled.
  12838. *
  12839. * This message sends the non-secure CMEM base address.
  12840. * It will be sent to host in response to message
  12841. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  12842. * The message would appear as follows:
  12843. *
  12844. * |31 24|23 16|15 8|7 0|
  12845. * |----------------+----------------+----------------+----------------|
  12846. * | reserved | num_entries | msg_type |
  12847. * |----------------+----------------+----------------+----------------|
  12848. * | base_address_lo |
  12849. * |----------------+----------------+----------------+----------------|
  12850. * | base_address_hi |
  12851. * |-------------------------------------------------------------------|
  12852. *
  12853. * The message is interpreted as follows:
  12854. * dword0 - b'0:7 - msg_type: This will be set to
  12855. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  12856. * b'8:15 - number_entries: Indicated the number of entries
  12857. * programmed.
  12858. * b'16:31 - reserved.
  12859. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  12860. * CMEM base address
  12861. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  12862. * CMEM base address
  12863. */
  12864. PREPACK struct htt_cmem_base_send_t {
  12865. A_UINT32 msg_type: 8,
  12866. num_entries: 8,
  12867. reserved: 16;
  12868. A_UINT32 base_address_lo;
  12869. A_UINT32 base_address_hi;
  12870. } POSTPACK;
  12871. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  12872. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  12873. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  12874. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  12875. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  12876. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  12877. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  12878. do { \
  12879. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  12880. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12881. } while (0)
  12882. /**
  12883. * @brief - HTT PPDU ID format
  12884. *
  12885. * @details
  12886. * The following field definitions describe the format of the PPDU ID.
  12887. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  12888. *
  12889. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  12890. * +--------------------------------------------------------------------------
  12891. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  12892. * +--------------------------------------------------------------------------
  12893. *
  12894. * sch id :Schedule command id
  12895. * Bits [11 : 0] : monotonically increasing counter to track the
  12896. * PPDU posted to a specific transmit queue.
  12897. *
  12898. * hwq_id: Hardware Queue ID.
  12899. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  12900. *
  12901. * mac_id: MAC ID
  12902. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  12903. *
  12904. * seq_idx: Sequence index.
  12905. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  12906. * a particular TXOP.
  12907. *
  12908. * tqm_cmd: HWSCH/TQM flag.
  12909. * Bit [23] : Always set to 0.
  12910. *
  12911. * seq_cmd_type: Sequence command type.
  12912. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  12913. * Refer to enum HTT_STATS_FTYPE for values.
  12914. */
  12915. PREPACK struct htt_ppdu_id {
  12916. A_UINT32
  12917. sch_id: 12,
  12918. hwq_id: 5,
  12919. mac_id: 2,
  12920. seq_idx: 2,
  12921. reserved1: 2,
  12922. tqm_cmd: 1,
  12923. seq_cmd_type: 6,
  12924. reserved2: 2;
  12925. } POSTPACK;
  12926. #define HTT_PPDU_ID_SCH_ID_S 0
  12927. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  12928. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  12929. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  12930. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  12931. do { \
  12932. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  12933. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  12934. } while (0)
  12935. #define HTT_PPDU_ID_HWQ_ID_S 12
  12936. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  12937. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  12938. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  12939. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  12940. do { \
  12941. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  12942. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  12943. } while (0)
  12944. #define HTT_PPDU_ID_MAC_ID_S 17
  12945. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  12946. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  12947. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  12948. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  12949. do { \
  12950. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  12951. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  12952. } while (0)
  12953. #define HTT_PPDU_ID_SEQ_IDX_S 19
  12954. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  12955. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  12956. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  12957. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  12958. do { \
  12959. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  12960. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  12961. } while (0)
  12962. #define HTT_PPDU_ID_TQM_CMD_S 23
  12963. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  12964. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  12965. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  12966. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  12967. do { \
  12968. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  12969. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  12970. } while (0)
  12971. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  12972. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  12973. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  12974. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  12975. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  12976. do { \
  12977. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  12978. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  12979. } while (0)
  12980. /**
  12981. * @brief target -> RX PEER METADATA V0 format
  12982. * Host will know the peer metadata version from the wmi_service_ready_ext2
  12983. * message from target, and will confirm to the target which peer metadata
  12984. * version to use in the wmi_init message.
  12985. *
  12986. * The following diagram shows the format of the RX PEER METADATA.
  12987. *
  12988. * |31 24|23 16|15 8|7 0|
  12989. * |-----------------------------------------------------------------------|
  12990. * | Reserved | VDEV ID | PEER ID |
  12991. * |-----------------------------------------------------------------------|
  12992. */
  12993. PREPACK struct htt_rx_peer_metadata_v0 {
  12994. A_UINT32
  12995. peer_id: 16,
  12996. vdev_id: 8,
  12997. reserved1: 8;
  12998. } POSTPACK;
  12999. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  13000. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  13001. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  13002. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  13003. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  13004. do { \
  13005. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  13006. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  13007. } while (0)
  13008. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  13009. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  13010. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  13011. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  13012. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  13013. do { \
  13014. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  13015. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  13016. } while (0)
  13017. /**
  13018. * @brief target -> RX PEER METADATA V1 format
  13019. * Host will know the peer metadata version from the wmi_service_ready_ext2
  13020. * message from target, and will confirm to the target which peer metadata
  13021. * version to use in the wmi_init message.
  13022. *
  13023. * The following diagram shows the format of the RX PEER METADATA V1 format.
  13024. *
  13025. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  13026. * |-----------------------------------------------------------------------|
  13027. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  13028. * |-----------------------------------------------------------------------|
  13029. */
  13030. PREPACK struct htt_rx_peer_metadata_v1 {
  13031. A_UINT32
  13032. peer_id: 13,
  13033. ml_peer_valid: 1,
  13034. reserved1: 2,
  13035. vdev_id: 8,
  13036. lmac_id: 2,
  13037. chip_id: 3,
  13038. reserved2: 3;
  13039. } POSTPACK;
  13040. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  13041. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  13042. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  13043. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  13044. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  13045. do { \
  13046. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  13047. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  13048. } while (0)
  13049. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  13050. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  13051. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  13052. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  13053. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  13054. do { \
  13055. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  13056. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  13057. } while (0)
  13058. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  13059. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  13060. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  13061. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  13062. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  13063. do { \
  13064. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  13065. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  13066. } while (0)
  13067. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  13068. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  13069. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  13070. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  13071. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  13072. do { \
  13073. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  13074. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  13075. } while (0)
  13076. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  13077. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  13078. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  13079. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  13080. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  13081. do { \
  13082. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  13083. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  13084. } while (0)
  13085. #endif