htt.h 572 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731
  1. /*
  2. * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. */
  186. #define HTT_CURRENT_VERSION_MAJOR 3
  187. #define HTT_CURRENT_VERSION_MINOR 70
  188. #define HTT_NUM_TX_FRAG_DESC 1024
  189. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  190. #define HTT_CHECK_SET_VAL(field, val) \
  191. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  192. /* macros to assist in sign-extending fields from HTT messages */
  193. #define HTT_SIGN_BIT_MASK(field) \
  194. ((field ## _M + (1 << field ## _S)) >> 1)
  195. #define HTT_SIGN_BIT(_val, field) \
  196. (_val & HTT_SIGN_BIT_MASK(field))
  197. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  198. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  199. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  200. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  201. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  202. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  203. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  204. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  205. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  206. /*
  207. * TEMPORARY:
  208. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  209. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  210. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  211. * updated.
  212. */
  213. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  214. /*
  215. * TEMPORARY:
  216. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  217. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  218. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  219. * updated.
  220. */
  221. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  222. /* HTT Access Category values */
  223. enum HTT_AC_WMM {
  224. /* WMM Access Categories */
  225. HTT_AC_WMM_BE = 0x0,
  226. HTT_AC_WMM_BK = 0x1,
  227. HTT_AC_WMM_VI = 0x2,
  228. HTT_AC_WMM_VO = 0x3,
  229. /* extension Access Categories */
  230. HTT_AC_EXT_NON_QOS = 0x4,
  231. HTT_AC_EXT_UCAST_MGMT = 0x5,
  232. HTT_AC_EXT_MCAST_DATA = 0x6,
  233. HTT_AC_EXT_MCAST_MGMT = 0x7,
  234. };
  235. enum HTT_AC_WMM_MASK {
  236. /* WMM Access Categories */
  237. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  238. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  239. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  240. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  241. /* extension Access Categories */
  242. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  243. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  244. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  245. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  246. };
  247. #define HTT_AC_MASK_WMM \
  248. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  249. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  250. #define HTT_AC_MASK_EXT \
  251. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  252. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  253. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  254. /*
  255. * htt_dbg_stats_type -
  256. * bit positions for each stats type within a stats type bitmask
  257. * The bitmask contains 24 bits.
  258. */
  259. enum htt_dbg_stats_type {
  260. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  261. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  262. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  263. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  264. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  265. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  266. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  267. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  268. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  269. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  270. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  271. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  272. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  273. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  274. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  275. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  276. /* bits 16-23 currently reserved */
  277. /* keep this last */
  278. HTT_DBG_NUM_STATS
  279. };
  280. /*=== HTT option selection TLVs ===
  281. * Certain HTT messages have alternatives or options.
  282. * For such cases, the host and target need to agree on which option to use.
  283. * Option specification TLVs can be appended to the VERSION_REQ and
  284. * VERSION_CONF messages to select options other than the default.
  285. * These TLVs are entirely optional - if they are not provided, there is a
  286. * well-defined default for each option. If they are provided, they can be
  287. * provided in any order. Each TLV can be present or absent independent of
  288. * the presence / absence of other TLVs.
  289. *
  290. * The HTT option selection TLVs use the following format:
  291. * |31 16|15 8|7 0|
  292. * |---------------------------------+----------------+----------------|
  293. * | value (payload) | length | tag |
  294. * |-------------------------------------------------------------------|
  295. * The value portion need not be only 2 bytes; it can be extended by any
  296. * integer number of 4-byte units. The total length of the TLV, including
  297. * the tag and length fields, must be a multiple of 4 bytes. The length
  298. * field specifies the total TLV size in 4-byte units. Thus, the typical
  299. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  300. * field, would store 0x1 in its length field, to show that the TLV occupies
  301. * a single 4-byte unit.
  302. */
  303. /*--- TLV header format - applies to all HTT option TLVs ---*/
  304. enum HTT_OPTION_TLV_TAGS {
  305. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  306. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  307. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  308. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  309. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  310. };
  311. PREPACK struct htt_option_tlv_header_t {
  312. A_UINT8 tag;
  313. A_UINT8 length;
  314. } POSTPACK;
  315. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  316. #define HTT_OPTION_TLV_TAG_S 0
  317. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  318. #define HTT_OPTION_TLV_LENGTH_S 8
  319. /*
  320. * value0 - 16 bit value field stored in word0
  321. * The TLV's value field may be longer than 2 bytes, in which case
  322. * the remainder of the value is stored in word1, word2, etc.
  323. */
  324. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  325. #define HTT_OPTION_TLV_VALUE0_S 16
  326. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  327. do { \
  328. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  329. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  330. } while (0)
  331. #define HTT_OPTION_TLV_TAG_GET(word) \
  332. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  333. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  334. do { \
  335. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  336. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  337. } while (0)
  338. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  339. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  340. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  341. do { \
  342. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  343. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  344. } while (0)
  345. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  346. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  347. /*--- format of specific HTT option TLVs ---*/
  348. /*
  349. * HTT option TLV for specifying LL bus address size
  350. * Some chips require bus addresses used by the target to access buffers
  351. * within the host's memory to be 32 bits; others require bus addresses
  352. * used by the target to access buffers within the host's memory to be
  353. * 64 bits.
  354. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  355. * a suffix to the VERSION_CONF message to specify which bus address format
  356. * the target requires.
  357. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  358. * default to providing bus addresses to the target in 32-bit format.
  359. */
  360. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  361. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  362. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  363. };
  364. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  365. struct htt_option_tlv_header_t hdr;
  366. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  367. } POSTPACK;
  368. /*
  369. * HTT option TLV for specifying whether HL systems should indicate
  370. * over-the-air tx completion for individual frames, or should instead
  371. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  372. * requests an OTA tx completion for a particular tx frame.
  373. * This option does not apply to LL systems, where the TX_COMPL_IND
  374. * is mandatory.
  375. * This option is primarily intended for HL systems in which the tx frame
  376. * downloads over the host --> target bus are as slow as or slower than
  377. * the transmissions over the WLAN PHY. For cases where the bus is faster
  378. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  379. * and consquently will send one TX_COMPL_IND message that covers several
  380. * tx frames. For cases where the WLAN PHY is faster than the bus,
  381. * the target will end up transmitting very short A-MPDUs, and consequently
  382. * sending many TX_COMPL_IND messages, which each cover a very small number
  383. * of tx frames.
  384. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  385. * a suffix to the VERSION_REQ message to request whether the host desires to
  386. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  387. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  388. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  389. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  390. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  391. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  392. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  393. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  394. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  395. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  396. * TLV.
  397. */
  398. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  399. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  400. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  401. };
  402. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  403. struct htt_option_tlv_header_t hdr;
  404. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  405. } POSTPACK;
  406. /*
  407. * HTT option TLV for specifying how many tx queue groups the target
  408. * may establish.
  409. * This TLV specifies the maximum value the target may send in the
  410. * txq_group_id field of any TXQ_GROUP information elements sent by
  411. * the target to the host. This allows the host to pre-allocate an
  412. * appropriate number of tx queue group structs.
  413. *
  414. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  415. * a suffix to the VERSION_REQ message to specify whether the host supports
  416. * tx queue groups at all, and if so if there is any limit on the number of
  417. * tx queue groups that the host supports.
  418. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  419. * a suffix to the VERSION_CONF message. If the host has specified in the
  420. * VER_REQ message a limit on the number of tx queue groups the host can
  421. * supprt, the target shall limit its specification of the maximum tx groups
  422. * to be no larger than this host-specified limit.
  423. *
  424. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  425. * shall preallocate 4 tx queue group structs, and the target shall not
  426. * specify a txq_group_id larger than 3.
  427. */
  428. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  429. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  430. /*
  431. * values 1 through N specify the max number of tx queue groups
  432. * the sender supports
  433. */
  434. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  435. };
  436. /* TEMPORARY backwards-compatibility alias for a typo fix -
  437. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  438. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  439. * to support the old name (with the typo) until all references to the
  440. * old name are replaced with the new name.
  441. */
  442. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  443. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  444. struct htt_option_tlv_header_t hdr;
  445. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  446. } POSTPACK;
  447. /*
  448. * HTT option TLV for specifying whether the target supports an extended
  449. * version of the HTT tx descriptor. If the target provides this TLV
  450. * and specifies in the TLV that the target supports an extended version
  451. * of the HTT tx descriptor, the target must check the "extension" bit in
  452. * the HTT tx descriptor, and if the extension bit is set, to expect a
  453. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  454. * descriptor. Furthermore, the target must provide room for the HTT
  455. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  456. * This option is intended for systems where the host needs to explicitly
  457. * control the transmission parameters such as tx power for individual
  458. * tx frames.
  459. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  460. * as a suffix to the VERSION_CONF message to explicitly specify whether
  461. * the target supports the HTT tx MSDU extension descriptor.
  462. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  463. * by the host as lack of target support for the HTT tx MSDU extension
  464. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  465. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  466. * the HTT tx MSDU extension descriptor.
  467. * The host is not required to provide the HTT tx MSDU extension descriptor
  468. * just because the target supports it; the target must check the
  469. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  470. * extension descriptor is present.
  471. */
  472. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  473. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  474. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  475. };
  476. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  477. struct htt_option_tlv_header_t hdr;
  478. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  479. } POSTPACK;
  480. /*=== host -> target messages ===============================================*/
  481. enum htt_h2t_msg_type {
  482. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  483. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  484. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  485. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  486. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  487. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  488. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  489. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  490. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  491. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  492. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  493. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  494. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  495. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  496. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  497. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  498. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  499. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  500. /* keep this last */
  501. HTT_H2T_NUM_MSGS
  502. };
  503. /*
  504. * HTT host to target message type -
  505. * stored in bits 7:0 of the first word of the message
  506. */
  507. #define HTT_H2T_MSG_TYPE_M 0xff
  508. #define HTT_H2T_MSG_TYPE_S 0
  509. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  510. do { \
  511. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  512. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  513. } while (0)
  514. #define HTT_H2T_MSG_TYPE_GET(word) \
  515. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  516. /**
  517. * @brief host -> target version number request message definition
  518. *
  519. * |31 24|23 16|15 8|7 0|
  520. * |----------------+----------------+----------------+----------------|
  521. * | reserved | msg type |
  522. * |-------------------------------------------------------------------|
  523. * : option request TLV (optional) |
  524. * :...................................................................:
  525. *
  526. * The VER_REQ message may consist of a single 4-byte word, or may be
  527. * extended with TLVs that specify which HTT options the host is requesting
  528. * from the target.
  529. * The following option TLVs may be appended to the VER_REQ message:
  530. * - HL_SUPPRESS_TX_COMPL_IND
  531. * - HL_MAX_TX_QUEUE_GROUPS
  532. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  533. * may be appended to the VER_REQ message (but only one TLV of each type).
  534. *
  535. * Header fields:
  536. * - MSG_TYPE
  537. * Bits 7:0
  538. * Purpose: identifies this as a version number request message
  539. * Value: 0x0
  540. */
  541. #define HTT_VER_REQ_BYTES 4
  542. /* TBDXXX: figure out a reasonable number */
  543. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  544. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  545. /**
  546. * @brief HTT tx MSDU descriptor
  547. *
  548. * @details
  549. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  550. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  551. * the target firmware needs for the FW's tx processing, particularly
  552. * for creating the HW msdu descriptor.
  553. * The same HTT tx descriptor is used for HL and LL systems, though
  554. * a few fields within the tx descriptor are used only by LL or
  555. * only by HL.
  556. * The HTT tx descriptor is defined in two manners: by a struct with
  557. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  558. * definitions.
  559. * The target should use the struct def, for simplicitly and clarity,
  560. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  561. * neutral. Specifically, the host shall use the get/set macros built
  562. * around the mask + shift defs.
  563. */
  564. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  565. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  566. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  567. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  568. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  569. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  570. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  571. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  572. #define HTT_TX_VDEV_ID_WORD 0
  573. #define HTT_TX_VDEV_ID_MASK 0x3f
  574. #define HTT_TX_VDEV_ID_SHIFT 16
  575. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  576. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  577. #define HTT_TX_MSDU_LEN_DWORD 1
  578. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  579. /*
  580. * HTT_VAR_PADDR macros
  581. * Allow physical / bus addresses to be either a single 32-bit value,
  582. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  583. */
  584. #define HTT_VAR_PADDR32(var_name) \
  585. A_UINT32 var_name
  586. #define HTT_VAR_PADDR64_LE(var_name) \
  587. struct { \
  588. /* little-endian: lo precedes hi */ \
  589. A_UINT32 lo; \
  590. A_UINT32 hi; \
  591. } var_name
  592. /*
  593. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  594. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  595. * addresses are stored in a XXX-bit field.
  596. * This macro is used to define both htt_tx_msdu_desc32_t and
  597. * htt_tx_msdu_desc64_t structs.
  598. */
  599. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  600. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  601. { \
  602. /* DWORD 0: flags and meta-data */ \
  603. A_UINT32 \
  604. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  605. \
  606. /* pkt_subtype - \
  607. * Detailed specification of the tx frame contents, extending the \
  608. * general specification provided by pkt_type. \
  609. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  610. * pkt_type | pkt_subtype \
  611. * ============================================================== \
  612. * 802.3 | bit 0:3 - Reserved \
  613. * | bit 4: 0x0 - Copy-Engine Classification Results \
  614. * | not appended to the HTT message \
  615. * | 0x1 - Copy-Engine Classification Results \
  616. * | appended to the HTT message in the \
  617. * | format: \
  618. * | [HTT tx desc, frame header, \
  619. * | CE classification results] \
  620. * | The CE classification results begin \
  621. * | at the next 4-byte boundary after \
  622. * | the frame header. \
  623. * ------------+------------------------------------------------- \
  624. * Eth2 | bit 0:3 - Reserved \
  625. * | bit 4: 0x0 - Copy-Engine Classification Results \
  626. * | not appended to the HTT message \
  627. * | 0x1 - Copy-Engine Classification Results \
  628. * | appended to the HTT message. \
  629. * | See the above specification of the \
  630. * | CE classification results location. \
  631. * ------------+------------------------------------------------- \
  632. * native WiFi | bit 0:3 - Reserved \
  633. * | bit 4: 0x0 - Copy-Engine Classification Results \
  634. * | not appended to the HTT message \
  635. * | 0x1 - Copy-Engine Classification Results \
  636. * | appended to the HTT message. \
  637. * | See the above specification of the \
  638. * | CE classification results location. \
  639. * ------------+------------------------------------------------- \
  640. * mgmt | 0x0 - 802.11 MAC header absent \
  641. * | 0x1 - 802.11 MAC header present \
  642. * ------------+------------------------------------------------- \
  643. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  644. * | 0x1 - 802.11 MAC header present \
  645. * | bit 1: 0x0 - allow aggregation \
  646. * | 0x1 - don't allow aggregation \
  647. * | bit 2: 0x0 - perform encryption \
  648. * | 0x1 - don't perform encryption \
  649. * | bit 3: 0x0 - perform tx classification / queuing \
  650. * | 0x1 - don't perform tx classification; \
  651. * | insert the frame into the "misc" \
  652. * | tx queue \
  653. * | bit 4: 0x0 - Copy-Engine Classification Results \
  654. * | not appended to the HTT message \
  655. * | 0x1 - Copy-Engine Classification Results \
  656. * | appended to the HTT message. \
  657. * | See the above specification of the \
  658. * | CE classification results location. \
  659. */ \
  660. pkt_subtype: 5, \
  661. \
  662. /* pkt_type - \
  663. * General specification of the tx frame contents. \
  664. * The htt_pkt_type enum should be used to specify and check the \
  665. * value of this field. \
  666. */ \
  667. pkt_type: 3, \
  668. \
  669. /* vdev_id - \
  670. * ID for the vdev that is sending this tx frame. \
  671. * For certain non-standard packet types, e.g. pkt_type == raw \
  672. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  673. * This field is used primarily for determining where to queue \
  674. * broadcast and multicast frames. \
  675. */ \
  676. vdev_id: 6, \
  677. /* ext_tid - \
  678. * The extended traffic ID. \
  679. * If the TID is unknown, the extended TID is set to \
  680. * HTT_TX_EXT_TID_INVALID. \
  681. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  682. * value of the QoS TID. \
  683. * If the tx frame is non-QoS data, then the extended TID is set to \
  684. * HTT_TX_EXT_TID_NON_QOS. \
  685. * If the tx frame is multicast or broadcast, then the extended TID \
  686. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  687. */ \
  688. ext_tid: 5, \
  689. \
  690. /* postponed - \
  691. * This flag indicates whether the tx frame has been downloaded to \
  692. * the target before but discarded by the target, and now is being \
  693. * downloaded again; or if this is a new frame that is being \
  694. * downloaded for the first time. \
  695. * This flag allows the target to determine the correct order for \
  696. * transmitting new vs. old frames. \
  697. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  698. * This flag only applies to HL systems, since in LL systems, \
  699. * the tx flow control is handled entirely within the target. \
  700. */ \
  701. postponed: 1, \
  702. \
  703. /* extension - \
  704. * This flag indicates whether a HTT tx MSDU extension descriptor \
  705. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  706. * \
  707. * 0x0 - no extension MSDU descriptor is present \
  708. * 0x1 - an extension MSDU descriptor immediately follows the \
  709. * regular MSDU descriptor \
  710. */ \
  711. extension: 1, \
  712. \
  713. /* cksum_offload - \
  714. * This flag indicates whether checksum offload is enabled or not \
  715. * for this frame. Target FW use this flag to turn on HW checksumming \
  716. * 0x0 - No checksum offload \
  717. * 0x1 - L3 header checksum only \
  718. * 0x2 - L4 checksum only \
  719. * 0x3 - L3 header checksum + L4 checksum \
  720. */ \
  721. cksum_offload: 2, \
  722. \
  723. /* tx_comp_req - \
  724. * This flag indicates whether Tx Completion \
  725. * from fw is required or not. \
  726. * This flag is only relevant if tx completion is not \
  727. * universally enabled. \
  728. * For all LL systems, tx completion is mandatory, \
  729. * so this flag will be irrelevant. \
  730. * For HL systems tx completion is optional, but HL systems in which \
  731. * the bus throughput exceeds the WLAN throughput will \
  732. * probably want to always use tx completion, and thus \
  733. * would not check this flag. \
  734. * This flag is required when tx completions are not used universally, \
  735. * but are still required for certain tx frames for which \
  736. * an OTA delivery acknowledgment is needed by the host. \
  737. * In practice, this would be for HL systems in which the \
  738. * bus throughput is less than the WLAN throughput. \
  739. * \
  740. * 0x0 - Tx Completion Indication from Fw not required \
  741. * 0x1 - Tx Completion Indication from Fw is required \
  742. */ \
  743. tx_compl_req: 1; \
  744. \
  745. \
  746. /* DWORD 1: MSDU length and ID */ \
  747. A_UINT32 \
  748. len: 16, /* MSDU length, in bytes */ \
  749. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  750. * and this id is used to calculate fragmentation \
  751. * descriptor pointer inside the target based on \
  752. * the base address, configured inside the target. \
  753. */ \
  754. \
  755. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  756. /* frags_desc_ptr - \
  757. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  758. * where the tx frame's fragments reside in memory. \
  759. * This field only applies to LL systems, since in HL systems the \
  760. * (degenerate single-fragment) fragmentation descriptor is created \
  761. * within the target. \
  762. */ \
  763. _paddr__frags_desc_ptr_; \
  764. \
  765. /* DWORD 3 (or 4): peerid, chanfreq */ \
  766. /* \
  767. * Peer ID : Target can use this value to know which peer-id packet \
  768. * destined to. \
  769. * It's intended to be specified by host in case of NAWDS. \
  770. */ \
  771. A_UINT16 peerid; \
  772. \
  773. /* \
  774. * Channel frequency: This identifies the desired channel \
  775. * frequency (in mhz) for tx frames. This is used by FW to help \
  776. * determine when it is safe to transmit or drop frames for \
  777. * off-channel operation. \
  778. * The default value of zero indicates to FW that the corresponding \
  779. * VDEV's home channel (if there is one) is the desired channel \
  780. * frequency. \
  781. */ \
  782. A_UINT16 chanfreq; \
  783. \
  784. /* Reason reserved is commented is increasing the htt structure size \
  785. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  786. * A_UINT32 reserved_dword3_bits0_31; \
  787. */ \
  788. } POSTPACK
  789. /* define a htt_tx_msdu_desc32_t type */
  790. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  791. /* define a htt_tx_msdu_desc64_t type */
  792. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  793. /*
  794. * Make htt_tx_msdu_desc_t be an alias for either
  795. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  796. */
  797. #if HTT_PADDR64
  798. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  799. #else
  800. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  801. #endif
  802. /* decriptor information for Management frame*/
  803. /*
  804. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  805. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  806. */
  807. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  808. extern A_UINT32 mgmt_hdr_len;
  809. PREPACK struct htt_mgmt_tx_desc_t {
  810. A_UINT32 msg_type;
  811. #if HTT_PADDR64
  812. A_UINT64 frag_paddr; /* DMAble address of the data */
  813. #else
  814. A_UINT32 frag_paddr; /* DMAble address of the data */
  815. #endif
  816. A_UINT32 desc_id; /* returned to host during completion
  817. * to free the meory*/
  818. A_UINT32 len; /* Fragment length */
  819. A_UINT32 vdev_id; /* virtual device ID*/
  820. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  821. } POSTPACK;
  822. PREPACK struct htt_mgmt_tx_compl_ind {
  823. A_UINT32 desc_id;
  824. A_UINT32 status;
  825. } POSTPACK;
  826. /*
  827. * This SDU header size comes from the summation of the following:
  828. * 1. Max of:
  829. * a. Native WiFi header, for native WiFi frames: 24 bytes
  830. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  831. * b. 802.11 header, for raw frames: 36 bytes
  832. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  833. * QoS header, HT header)
  834. * c. 802.3 header, for ethernet frames: 14 bytes
  835. * (destination address, source address, ethertype / length)
  836. * 2. Max of:
  837. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  838. * b. IPv6 header, up through the Traffic Class: 2 bytes
  839. * 3. 802.1Q VLAN header: 4 bytes
  840. * 4. LLC/SNAP header: 8 bytes
  841. */
  842. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  843. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  844. #define HTT_TX_HDR_SIZE_ETHERNET 14
  845. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  846. A_COMPILE_TIME_ASSERT(
  847. htt_encap_hdr_size_max_check_nwifi,
  848. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  849. A_COMPILE_TIME_ASSERT(
  850. htt_encap_hdr_size_max_check_enet,
  851. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  852. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  853. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  854. #define HTT_TX_HDR_SIZE_802_1Q 4
  855. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  856. #define HTT_COMMON_TX_FRM_HDR_LEN \
  857. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  858. HTT_TX_HDR_SIZE_802_1Q + \
  859. HTT_TX_HDR_SIZE_LLC_SNAP)
  860. #define HTT_HL_TX_FRM_HDR_LEN \
  861. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  862. #define HTT_LL_TX_FRM_HDR_LEN \
  863. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  864. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  865. /* dword 0 */
  866. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  867. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  868. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  869. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  870. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  871. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  872. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  873. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  874. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  875. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  876. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  877. #define HTT_TX_DESC_PKT_TYPE_S 13
  878. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  879. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  880. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  881. #define HTT_TX_DESC_VDEV_ID_S 16
  882. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  883. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  884. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  885. #define HTT_TX_DESC_EXT_TID_S 22
  886. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  887. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  888. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  889. #define HTT_TX_DESC_POSTPONED_S 27
  890. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  891. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  892. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  893. #define HTT_TX_DESC_EXTENSION_S 28
  894. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  895. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  896. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  897. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  898. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  899. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  900. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  901. #define HTT_TX_DESC_TX_COMP_S 31
  902. /* dword 1 */
  903. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  904. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  905. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  906. #define HTT_TX_DESC_FRM_LEN_S 0
  907. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  908. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  909. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  910. #define HTT_TX_DESC_FRM_ID_S 16
  911. /* dword 2 */
  912. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  913. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  914. /* for systems using 64-bit format for bus addresses */
  915. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  916. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  917. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  918. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  919. /* for systems using 32-bit format for bus addresses */
  920. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  921. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  922. /* dword 3 */
  923. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  924. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  925. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  926. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  927. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  928. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  929. #if HTT_PADDR64
  930. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  931. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  932. #else
  933. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  934. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  935. #endif
  936. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  937. #define HTT_TX_DESC_PEER_ID_S 0
  938. /*
  939. * TEMPORARY:
  940. * The original definitions for the PEER_ID fields contained typos
  941. * (with _DESC_PADDR appended to this PEER_ID field name).
  942. * Retain deprecated original names for PEER_ID fields until all code that
  943. * refers to them has been updated.
  944. */
  945. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  946. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  947. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  948. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  949. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  950. HTT_TX_DESC_PEER_ID_M
  951. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  952. HTT_TX_DESC_PEER_ID_S
  953. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  954. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  955. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  956. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  957. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  958. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  959. #if HTT_PADDR64
  960. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  961. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  962. #else
  963. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  964. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  965. #endif
  966. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  967. #define HTT_TX_DESC_CHAN_FREQ_S 16
  968. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  969. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  970. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  971. do { \
  972. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  973. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  974. } while (0)
  975. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  976. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  977. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  978. do { \
  979. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  980. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  981. } while (0)
  982. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  983. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  984. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  985. do { \
  986. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  987. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  988. } while (0)
  989. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  990. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  991. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  992. do { \
  993. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  994. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  995. } while (0)
  996. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  997. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  998. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  999. do { \
  1000. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1001. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1002. } while (0)
  1003. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1004. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1005. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1006. do { \
  1007. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1008. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1009. } while (0)
  1010. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1011. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1012. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1013. do { \
  1014. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1015. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1016. } while (0)
  1017. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1018. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1019. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1020. do { \
  1021. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1022. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1023. } while (0)
  1024. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1025. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1026. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1027. do { \
  1028. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1029. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1030. } while (0)
  1031. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1032. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1033. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1034. do { \
  1035. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1036. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1037. } while (0)
  1038. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1039. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1040. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1041. do { \
  1042. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1043. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1044. } while (0)
  1045. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1046. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1047. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1048. do { \
  1049. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1050. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1051. } while (0)
  1052. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1053. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1054. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1055. do { \
  1056. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1057. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1058. } while (0)
  1059. /* enums used in the HTT tx MSDU extension descriptor */
  1060. enum {
  1061. htt_tx_guard_interval_regular = 0,
  1062. htt_tx_guard_interval_short = 1,
  1063. };
  1064. enum {
  1065. htt_tx_preamble_type_ofdm = 0,
  1066. htt_tx_preamble_type_cck = 1,
  1067. htt_tx_preamble_type_ht = 2,
  1068. htt_tx_preamble_type_vht = 3,
  1069. };
  1070. enum {
  1071. htt_tx_bandwidth_5MHz = 0,
  1072. htt_tx_bandwidth_10MHz = 1,
  1073. htt_tx_bandwidth_20MHz = 2,
  1074. htt_tx_bandwidth_40MHz = 3,
  1075. htt_tx_bandwidth_80MHz = 4,
  1076. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1077. };
  1078. /**
  1079. * @brief HTT tx MSDU extension descriptor
  1080. * @details
  1081. * If the target supports HTT tx MSDU extension descriptors, the host has
  1082. * the option of appending the following struct following the regular
  1083. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1084. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1085. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1086. * tx specs for each frame.
  1087. */
  1088. PREPACK struct htt_tx_msdu_desc_ext_t {
  1089. /* DWORD 0: flags */
  1090. A_UINT32
  1091. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1092. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1093. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1094. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1095. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1096. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1097. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1098. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1099. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1100. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1101. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1102. /* DWORD 1: tx power, tx rate, tx BW */
  1103. A_UINT32
  1104. /* pwr -
  1105. * Specify what power the tx frame needs to be transmitted at.
  1106. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1107. * The value needs to be appropriately sign-extended when extracting
  1108. * the value from the message and storing it in a variable that is
  1109. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1110. * automatically handles this sign-extension.)
  1111. * If the transmission uses multiple tx chains, this power spec is
  1112. * the total transmit power, assuming incoherent combination of
  1113. * per-chain power to produce the total power.
  1114. */
  1115. pwr: 8,
  1116. /* mcs_mask -
  1117. * Specify the allowable values for MCS index (modulation and coding)
  1118. * to use for transmitting the frame.
  1119. *
  1120. * For HT / VHT preamble types, this mask directly corresponds to
  1121. * the HT or VHT MCS indices that are allowed. For each bit N set
  1122. * within the mask, MCS index N is allowed for transmitting the frame.
  1123. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1124. * rates versus OFDM rates, so the host has the option of specifying
  1125. * that the target must transmit the frame with CCK or OFDM rates
  1126. * (not HT or VHT), but leaving the decision to the target whether
  1127. * to use CCK or OFDM.
  1128. *
  1129. * For CCK and OFDM, the bits within this mask are interpreted as
  1130. * follows:
  1131. * bit 0 -> CCK 1 Mbps rate is allowed
  1132. * bit 1 -> CCK 2 Mbps rate is allowed
  1133. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1134. * bit 3 -> CCK 11 Mbps rate is allowed
  1135. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1136. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1137. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1138. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1139. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1140. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1141. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1142. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1143. *
  1144. * The MCS index specification needs to be compatible with the
  1145. * bandwidth mask specification. For example, a MCS index == 9
  1146. * specification is inconsistent with a preamble type == VHT,
  1147. * Nss == 1, and channel bandwidth == 20 MHz.
  1148. *
  1149. * Furthermore, the host has only a limited ability to specify to
  1150. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1151. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1152. */
  1153. mcs_mask: 12,
  1154. /* nss_mask -
  1155. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1156. * Each bit in this mask corresponds to a Nss value:
  1157. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1158. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1159. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1160. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1161. * The values in the Nss mask must be suitable for the recipient, e.g.
  1162. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1163. * recipient which only supports 2x2 MIMO.
  1164. */
  1165. nss_mask: 4,
  1166. /* guard_interval -
  1167. * Specify a htt_tx_guard_interval enum value to indicate whether
  1168. * the transmission should use a regular guard interval or a
  1169. * short guard interval.
  1170. */
  1171. guard_interval: 1,
  1172. /* preamble_type_mask -
  1173. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1174. * may choose from for transmitting this frame.
  1175. * The bits in this mask correspond to the values in the
  1176. * htt_tx_preamble_type enum. For example, to allow the target
  1177. * to transmit the frame as either CCK or OFDM, this field would
  1178. * be set to
  1179. * (1 << htt_tx_preamble_type_ofdm) |
  1180. * (1 << htt_tx_preamble_type_cck)
  1181. */
  1182. preamble_type_mask: 4,
  1183. reserved1_31_29: 3; /* unused, set to 0x0 */
  1184. /* DWORD 2: tx chain mask, tx retries */
  1185. A_UINT32
  1186. /* chain_mask - specify which chains to transmit from */
  1187. chain_mask: 4,
  1188. /* retry_limit -
  1189. * Specify the maximum number of transmissions, including the
  1190. * initial transmission, to attempt before giving up if no ack
  1191. * is received.
  1192. * If the tx rate is specified, then all retries shall use the
  1193. * same rate as the initial transmission.
  1194. * If no tx rate is specified, the target can choose whether to
  1195. * retain the original rate during the retransmissions, or to
  1196. * fall back to a more robust rate.
  1197. */
  1198. retry_limit: 4,
  1199. /* bandwidth_mask -
  1200. * Specify what channel widths may be used for the transmission.
  1201. * A value of zero indicates "don't care" - the target may choose
  1202. * the transmission bandwidth.
  1203. * The bits within this mask correspond to the htt_tx_bandwidth
  1204. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1205. * The bandwidth_mask must be consistent with the preamble_type_mask
  1206. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1207. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1208. */
  1209. bandwidth_mask: 6,
  1210. reserved2_31_14: 18; /* unused, set to 0x0 */
  1211. /* DWORD 3: tx expiry time (TSF) LSBs */
  1212. A_UINT32 expire_tsf_lo;
  1213. /* DWORD 4: tx expiry time (TSF) MSBs */
  1214. A_UINT32 expire_tsf_hi;
  1215. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1216. } POSTPACK;
  1217. /* DWORD 0 */
  1218. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1220. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1221. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1223. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1224. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1225. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1226. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1228. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1229. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1231. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1232. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1233. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1234. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1236. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1237. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1238. /* DWORD 1 */
  1239. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1240. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1241. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1242. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1243. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1244. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1245. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1246. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1247. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1248. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1249. /* DWORD 2 */
  1250. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1251. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1252. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1253. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1254. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1255. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1256. /* DWORD 0 */
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1258. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1259. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1260. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1261. do { \
  1262. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1263. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1264. } while (0)
  1265. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1266. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1267. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1268. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1269. do { \
  1270. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1271. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1272. } while (0)
  1273. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1274. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1275. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1276. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL( \
  1279. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1280. ((_var) |= ((_val) \
  1281. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1282. } while (0)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1284. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1285. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1286. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL( \
  1289. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1290. ((_var) |= ((_val) \
  1291. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1292. } while (0)
  1293. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1294. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1295. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1296. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1299. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1300. } while (0)
  1301. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1302. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1303. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1304. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1305. do { \
  1306. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1307. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1308. } while (0)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1310. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1311. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1312. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1313. do { \
  1314. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1315. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1316. } while (0)
  1317. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1318. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1319. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1320. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1321. do { \
  1322. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1323. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1324. } while (0)
  1325. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1326. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1327. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1328. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1329. do { \
  1330. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1331. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1332. } while (0)
  1333. /* DWORD 1 */
  1334. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1335. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1336. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1337. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1338. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1339. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1340. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1341. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1342. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1343. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1344. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1345. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1346. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1347. do { \
  1348. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1349. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1350. } while (0)
  1351. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1352. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1353. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1354. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1355. do { \
  1356. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1357. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1358. } while (0)
  1359. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1360. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1361. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1362. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1363. do { \
  1364. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1365. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1366. } while (0)
  1367. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1368. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1369. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1370. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1371. do { \
  1372. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1373. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1374. } while (0)
  1375. /* DWORD 2 */
  1376. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1377. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1378. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1379. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1380. do { \
  1381. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1382. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1383. } while (0)
  1384. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1385. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1386. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1387. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1388. do { \
  1389. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1390. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1391. } while (0)
  1392. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1393. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1394. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1395. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1396. do { \
  1397. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1398. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1399. } while (0)
  1400. typedef enum {
  1401. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1402. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1403. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1404. } htt_11ax_ltf_subtype_t;
  1405. typedef enum {
  1406. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1407. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1408. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1409. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1410. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1411. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1412. } htt_tx_ext2_preamble_type_t;
  1413. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1414. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1415. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1416. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1417. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1418. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1419. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1420. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1421. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1422. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1423. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1424. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1425. /**
  1426. * @brief HTT tx MSDU extension descriptor v2
  1427. * @details
  1428. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1429. * is received as tcl_exit_base->host_meta_info in firmware.
  1430. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1431. * are already part of tcl_exit_base.
  1432. */
  1433. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1434. /* DWORD 0: flags */
  1435. A_UINT32
  1436. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1437. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1438. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1439. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1440. valid_retries : 1, /* if set, tx retries spec is valid */
  1441. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1442. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1443. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1444. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1445. valid_key_flags : 1, /* if set, key flags is valid */
  1446. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1447. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1448. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1449. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1450. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1451. 1 = ENCRYPT,
  1452. 2 ~ 3 - Reserved */
  1453. /* retry_limit -
  1454. * Specify the maximum number of transmissions, including the
  1455. * initial transmission, to attempt before giving up if no ack
  1456. * is received.
  1457. * If the tx rate is specified, then all retries shall use the
  1458. * same rate as the initial transmission.
  1459. * If no tx rate is specified, the target can choose whether to
  1460. * retain the original rate during the retransmissions, or to
  1461. * fall back to a more robust rate.
  1462. */
  1463. retry_limit : 4,
  1464. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1465. * Valid only for 11ax preamble types HE_SU
  1466. * and HE_EXT_SU
  1467. */
  1468. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1469. * Valid only for 11ax preamble types HE_SU
  1470. * and HE_EXT_SU
  1471. */
  1472. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1473. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1474. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1475. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1476. */
  1477. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1478. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1479. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1480. * Use cases:
  1481. * Any time firmware uses TQM-BYPASS for Data
  1482. * TID, firmware expect host to set this bit.
  1483. */
  1484. /* DWORD 1: tx power, tx rate */
  1485. A_UINT32
  1486. power : 8, /* unit of the power field is 0.5 dbm
  1487. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1488. * signed value ranging from -64dbm to 63.5 dbm
  1489. */
  1490. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1491. * Setting more than one MCS isn't currently
  1492. * supported by the target (but is supported
  1493. * in the interface in case in the future
  1494. * the target supports specifications of
  1495. * a limited set of MCS values.
  1496. */
  1497. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1498. * Setting more than one Nss isn't currently
  1499. * supported by the target (but is supported
  1500. * in the interface in case in the future
  1501. * the target supports specifications of
  1502. * a limited set of Nss values.
  1503. */
  1504. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1505. update_peer_cache : 1; /* When set these custom values will be
  1506. * used for all packets, until the next
  1507. * update via this ext header.
  1508. * This is to make sure not all packets
  1509. * need to include this header.
  1510. */
  1511. /* DWORD 2: tx chain mask, tx retries */
  1512. A_UINT32
  1513. /* chain_mask - specify which chains to transmit from */
  1514. chain_mask : 8,
  1515. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1516. * TODO: Update Enum values for key_flags
  1517. */
  1518. /*
  1519. * Channel frequency: This identifies the desired channel
  1520. * frequency (in MHz) for tx frames. This is used by FW to help
  1521. * determine when it is safe to transmit or drop frames for
  1522. * off-channel operation.
  1523. * The default value of zero indicates to FW that the corresponding
  1524. * VDEV's home channel (if there is one) is the desired channel
  1525. * frequency.
  1526. */
  1527. chanfreq : 16;
  1528. /* DWORD 3: tx expiry time (TSF) LSBs */
  1529. A_UINT32 expire_tsf_lo;
  1530. /* DWORD 4: tx expiry time (TSF) MSBs */
  1531. A_UINT32 expire_tsf_hi;
  1532. /* DWORD 5: flags to control routing / processing of the MSDU */
  1533. A_UINT32
  1534. /* learning_frame
  1535. * When this flag is set, this frame will be dropped by FW
  1536. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1537. */
  1538. learning_frame : 1,
  1539. /* send_as_standalone
  1540. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1541. * i.e. with no A-MSDU or A-MPDU aggregation.
  1542. * The scope is extended to other use-cases.
  1543. */
  1544. send_as_standalone : 1,
  1545. /* is_host_opaque_valid
  1546. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1547. * with valid information.
  1548. */
  1549. is_host_opaque_valid : 1,
  1550. rsvd0 : 29;
  1551. /* DWORD 6 : Host opaque cookie for special frames */
  1552. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1553. rsvd1 : 16;
  1554. /*
  1555. * This structure can be expanded further up to 40 bytes
  1556. * by adding further DWORDs as needed.
  1557. */
  1558. } POSTPACK;
  1559. /* DWORD 0 */
  1560. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1562. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1563. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1565. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1566. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1567. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1568. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1569. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1570. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1572. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1573. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1575. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1576. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1577. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1578. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1579. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1580. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1582. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1586. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1587. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1588. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1589. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1590. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1591. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1592. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1593. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1594. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1595. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1596. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1597. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1598. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1599. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1600. /* DWORD 1 */
  1601. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1602. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1603. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1604. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1605. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1606. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1607. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1608. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1609. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1610. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1611. /* DWORD 2 */
  1612. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1613. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1614. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1615. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1616. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1617. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1618. /* DWORD 5 */
  1619. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1620. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1622. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1623. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1625. /* DWORD 6 */
  1626. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1627. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1628. /* DWORD 0 */
  1629. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1630. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1631. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1632. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1633. do { \
  1634. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1635. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1636. } while (0)
  1637. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1638. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1639. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1640. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1641. do { \
  1642. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1643. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1644. } while (0)
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1647. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1648. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1649. do { \
  1650. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1651. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1652. } while (0)
  1653. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1655. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1656. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL( \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1660. ((_var) |= ((_val) \
  1661. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1662. } while (0)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1664. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1665. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1666. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1667. do { \
  1668. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1669. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1673. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1681. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1682. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL( \
  1685. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1686. ((_var) |= ((_val) \
  1687. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1688. } while (0)
  1689. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1690. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1691. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1692. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1693. do { \
  1694. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1695. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1696. } while (0)
  1697. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1698. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1699. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1700. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1703. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1704. } while (0)
  1705. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1706. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1707. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1708. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1709. do { \
  1710. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1711. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1712. } while (0)
  1713. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1714. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1715. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1716. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1717. do { \
  1718. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1719. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1720. } while (0)
  1721. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1722. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1723. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1724. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1727. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1728. } while (0)
  1729. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1730. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1731. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1732. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1733. do { \
  1734. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1735. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1736. } while (0)
  1737. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1738. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1739. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1740. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1741. do { \
  1742. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1743. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1744. } while (0)
  1745. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1746. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1747. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1748. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1749. do { \
  1750. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1751. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1752. } while (0)
  1753. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1754. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1755. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1756. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1757. do { \
  1758. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1759. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1760. } while (0)
  1761. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1762. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1763. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1764. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1765. do { \
  1766. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1767. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1768. } while (0)
  1769. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1770. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1771. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1772. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1773. do { \
  1774. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1775. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1776. } while (0)
  1777. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1778. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1779. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1780. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1781. do { \
  1782. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1783. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1784. } while (0)
  1785. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1786. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1787. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1788. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1789. do { \
  1790. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1791. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1792. } while (0)
  1793. /* DWORD 1 */
  1794. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1795. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1796. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1797. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1798. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1799. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1800. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1801. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1802. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1803. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1804. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1805. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1806. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1807. do { \
  1808. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1809. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1810. } while (0)
  1811. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1812. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1813. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1814. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1815. do { \
  1816. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1817. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1818. } while (0)
  1819. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1820. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1821. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1822. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1823. do { \
  1824. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1825. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1826. } while (0)
  1827. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1828. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1829. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1830. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1831. do { \
  1832. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1833. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1834. } while (0)
  1835. /* DWORD 2 */
  1836. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1837. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1838. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1839. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1840. do { \
  1841. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1842. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1843. } while (0)
  1844. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1845. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1846. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1847. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1848. do { \
  1849. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1850. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1851. } while (0)
  1852. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1853. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1854. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1855. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1856. do { \
  1857. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1858. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1859. } while (0)
  1860. /* DWORD 5 */
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1862. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1863. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1865. do { \
  1866. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1867. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1868. } while (0)
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1870. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1871. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1873. do { \
  1874. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1875. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1876. } while (0)
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1878. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1879. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1881. do { \
  1882. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1883. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1884. } while (0)
  1885. /* DWORD 6 */
  1886. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1887. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1888. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1889. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1890. do { \
  1891. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1892. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1893. } while (0)
  1894. typedef enum {
  1895. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1896. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1897. } htt_tcl_metadata_type;
  1898. /**
  1899. * @brief HTT TCL command number format
  1900. * @details
  1901. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1902. * available to firmware as tcl_exit_base->tcl_status_number.
  1903. * For regular / multicast packets host will send vdev and mac id and for
  1904. * NAWDS packets, host will send peer id.
  1905. * A_UINT32 is used to avoid endianness conversion problems.
  1906. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1907. */
  1908. typedef struct {
  1909. A_UINT32
  1910. type: 1, /* vdev_id based or peer_id based */
  1911. rsvd: 31;
  1912. } htt_tx_tcl_vdev_or_peer_t;
  1913. typedef struct {
  1914. A_UINT32
  1915. type: 1, /* vdev_id based or peer_id based */
  1916. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1917. vdev_id: 8,
  1918. pdev_id: 2,
  1919. host_inspected:1,
  1920. rsvd: 19;
  1921. } htt_tx_tcl_vdev_metadata;
  1922. typedef struct {
  1923. A_UINT32
  1924. type: 1, /* vdev_id based or peer_id based */
  1925. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1926. peer_id: 14,
  1927. rsvd: 16;
  1928. } htt_tx_tcl_peer_metadata;
  1929. PREPACK struct htt_tx_tcl_metadata {
  1930. union {
  1931. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1932. htt_tx_tcl_vdev_metadata vdev_meta;
  1933. htt_tx_tcl_peer_metadata peer_meta;
  1934. };
  1935. } POSTPACK;
  1936. /* DWORD 0 */
  1937. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1938. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1939. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1940. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1941. /* VDEV metadata */
  1942. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1943. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1944. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1945. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1946. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1947. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1948. /* PEER metadata */
  1949. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1950. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1951. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1952. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1953. HTT_TX_TCL_METADATA_TYPE_S)
  1954. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1957. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1958. } while (0)
  1959. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1960. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1961. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1962. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1965. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1966. } while (0)
  1967. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1968. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1969. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1970. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1973. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1974. } while (0)
  1975. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1976. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1977. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1978. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  1981. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  1982. } while (0)
  1983. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  1984. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  1985. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  1986. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  1990. } while (0)
  1991. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1992. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1993. HTT_TX_TCL_METADATA_PEER_ID_S)
  1994. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  1998. } while (0)
  1999. typedef enum {
  2000. HTT_TX_FW2WBM_TX_STATUS_OK,
  2001. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2002. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2003. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2004. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2005. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2006. HTT_TX_FW2WBM_TX_STATUS_MAX
  2007. } htt_tx_fw2wbm_tx_status_t;
  2008. typedef enum {
  2009. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2010. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2011. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2012. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2013. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2014. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2015. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2016. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2017. } htt_tx_fw2wbm_reinject_reason_t;
  2018. /**
  2019. * @brief HTT TX WBM Completion from firmware to host
  2020. * @details
  2021. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2022. * DWORD 3 and 4 for software based completions (Exception frames and
  2023. * TQM bypass frames)
  2024. * For software based completions, wbm_release_ring->release_source_module will
  2025. * be set to release_source_fw
  2026. */
  2027. PREPACK struct htt_tx_wbm_completion {
  2028. A_UINT32
  2029. sch_cmd_id: 24,
  2030. exception_frame: 1, /* If set, this packet was queued via exception path */
  2031. rsvd0_31_25: 7;
  2032. A_UINT32
  2033. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2034. * reception of an ACK or BA, this field indicates
  2035. * the RSSI of the received ACK or BA frame.
  2036. * When the frame is removed as result of a direct
  2037. * remove command from the SW, this field is set
  2038. * to 0x0 (which is never a valid value when real
  2039. * RSSI is available).
  2040. * Units: dB w.r.t noise floor
  2041. */
  2042. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2043. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2044. rsvd1_31_16: 16;
  2045. } POSTPACK;
  2046. /* DWORD 0 */
  2047. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2048. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2049. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2050. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2051. /* DWORD 1 */
  2052. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2053. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2054. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2055. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2056. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2057. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2058. /* DWORD 0 */
  2059. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2060. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2061. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2062. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2063. do { \
  2064. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2065. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2066. } while (0)
  2067. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2068. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2069. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2070. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2071. do { \
  2072. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2073. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2074. } while (0)
  2075. /* DWORD 1 */
  2076. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2077. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2078. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2079. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2082. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2083. } while (0)
  2084. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2085. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2086. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2087. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2091. } while (0)
  2092. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2093. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2094. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2095. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2099. } while (0)
  2100. /**
  2101. * @brief HTT TX WBM Completion from firmware to host
  2102. * @details
  2103. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2104. * (WBM) offload HW.
  2105. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2106. * For software based completions, release_source_module will
  2107. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2108. * struct wbm_release_ring and then switch to this after looking at
  2109. * release_source_module.
  2110. */
  2111. PREPACK struct htt_tx_wbm_completion_v2 {
  2112. A_UINT32
  2113. used_by_hw0; /* Refer to struct wbm_release_ring */
  2114. A_UINT32
  2115. used_by_hw1; /* Refer to struct wbm_release_ring */
  2116. A_UINT32
  2117. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2118. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2119. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2120. exception_frame: 1,
  2121. rsvd0: 12, /* For future use */
  2122. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2123. rsvd1: 1; /* For future use */
  2124. A_UINT32
  2125. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2126. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2127. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2128. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2129. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2130. */
  2131. A_UINT32
  2132. data1: 32;
  2133. A_UINT32
  2134. data2: 32;
  2135. A_UINT32
  2136. used_by_hw3; /* Refer to struct wbm_release_ring */
  2137. } POSTPACK;
  2138. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2139. /* DWORD 3 */
  2140. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2141. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2142. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2143. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2144. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2145. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2146. /* DWORD 3 */
  2147. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2148. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2149. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2150. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2151. do { \
  2152. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2153. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2154. } while (0)
  2155. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2156. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2157. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2158. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2162. } while (0)
  2163. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2164. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2165. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2166. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2170. } while (0)
  2171. /**
  2172. * @brief HTT TX WBM transmit status from firmware to host
  2173. * @details
  2174. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2175. * (WBM) offload HW.
  2176. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2177. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2178. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2179. */
  2180. PREPACK struct htt_tx_wbm_transmit_status {
  2181. A_UINT32
  2182. sch_cmd_id: 24,
  2183. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2184. * reception of an ACK or BA, this field indicates
  2185. * the RSSI of the received ACK or BA frame.
  2186. * When the frame is removed as result of a direct
  2187. * remove command from the SW, this field is set
  2188. * to 0x0 (which is never a valid value when real
  2189. * RSSI is available).
  2190. * Units: dB w.r.t noise floor
  2191. */
  2192. A_UINT32
  2193. sw_peer_id: 16,
  2194. tid_num: 5,
  2195. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2196. * and tid_num fields contain valid data.
  2197. * If this "valid" flag is not set, the
  2198. * sw_peer_id and tid_num fields must be ignored.
  2199. */
  2200. mcast: 1,
  2201. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2202. * contains valid data.
  2203. */
  2204. reserved0: 8;
  2205. A_UINT32
  2206. reserved1: 32;
  2207. } POSTPACK;
  2208. /* DWORD 4 */
  2209. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2210. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2211. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2212. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2213. /* DWORD 5 */
  2214. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2215. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2216. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2217. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2218. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2219. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2220. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2221. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2222. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2223. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2224. /* DWORD 4 */
  2225. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2226. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2227. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2228. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2229. do { \
  2230. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2231. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2232. } while (0)
  2233. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2234. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2235. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2236. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2237. do { \
  2238. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2239. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2240. } while (0)
  2241. /* DWORD 5 */
  2242. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2243. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2244. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2245. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2249. } while (0)
  2250. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2251. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2252. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2253. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2257. } while (0)
  2258. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2259. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2260. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2261. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2262. do { \
  2263. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2264. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2265. } while (0)
  2266. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2267. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2268. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2269. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2270. do { \
  2271. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2272. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2273. } while (0)
  2274. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2275. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2276. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2277. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2281. } while (0)
  2282. /**
  2283. * @brief HTT TX WBM reinject status from firmware to host
  2284. * @details
  2285. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2286. * (WBM) offload HW.
  2287. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2288. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2289. */
  2290. PREPACK struct htt_tx_wbm_reinject_status {
  2291. A_UINT32
  2292. reserved0: 32;
  2293. A_UINT32
  2294. reserved1: 32;
  2295. A_UINT32
  2296. reserved2: 32;
  2297. } POSTPACK;
  2298. /**
  2299. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2300. * @details
  2301. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2302. * (WBM) offload HW.
  2303. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2304. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2305. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2306. * STA side.
  2307. */
  2308. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2309. A_UINT32
  2310. mec_sa_addr_31_0;
  2311. A_UINT32
  2312. mec_sa_addr_47_32: 16,
  2313. sa_ast_index: 16;
  2314. A_UINT32
  2315. vdev_id: 8,
  2316. reserved0: 24;
  2317. } POSTPACK;
  2318. /* DWORD 4 - mec_sa_addr_31_0 */
  2319. /* DWORD 5 */
  2320. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2321. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2322. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2323. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2324. /* DWORD 6 */
  2325. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2326. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2327. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2328. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2329. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2330. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2331. do { \
  2332. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2333. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2334. } while (0)
  2335. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2336. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2337. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2338. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2339. do { \
  2340. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2341. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2342. } while (0)
  2343. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2344. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2345. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2346. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2347. do { \
  2348. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2349. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2350. } while (0)
  2351. typedef enum {
  2352. TX_FLOW_PRIORITY_BE,
  2353. TX_FLOW_PRIORITY_HIGH,
  2354. TX_FLOW_PRIORITY_LOW,
  2355. } htt_tx_flow_priority_t;
  2356. typedef enum {
  2357. TX_FLOW_LATENCY_SENSITIVE,
  2358. TX_FLOW_LATENCY_INSENSITIVE,
  2359. } htt_tx_flow_latency_t;
  2360. typedef enum {
  2361. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2362. TX_FLOW_INTERACTIVE_TRAFFIC,
  2363. TX_FLOW_PERIODIC_TRAFFIC,
  2364. TX_FLOW_BURSTY_TRAFFIC,
  2365. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2366. } htt_tx_flow_traffic_pattern_t;
  2367. /**
  2368. * @brief HTT TX Flow search metadata format
  2369. * @details
  2370. * Host will set this metadata in flow table's flow search entry along with
  2371. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2372. * firmware and TQM ring if the flow search entry wins.
  2373. * This metadata is available to firmware in that first MSDU's
  2374. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2375. * to one of the available flows for specific tid and returns the tqm flow
  2376. * pointer as part of htt_tx_map_flow_info message.
  2377. */
  2378. PREPACK struct htt_tx_flow_metadata {
  2379. A_UINT32
  2380. rsvd0_1_0: 2,
  2381. tid: 4,
  2382. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2383. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2384. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2385. * Else choose final tid based on latency, priority.
  2386. */
  2387. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2388. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2389. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2390. } POSTPACK;
  2391. /* DWORD 0 */
  2392. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2393. #define HTT_TX_FLOW_METADATA_TID_S 2
  2394. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2395. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2396. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2397. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2398. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2399. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2400. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2401. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2402. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2403. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2404. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2405. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2406. /* DWORD 0 */
  2407. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2408. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2409. HTT_TX_FLOW_METADATA_TID_S)
  2410. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2411. do { \
  2412. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2413. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2414. } while (0)
  2415. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2416. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2417. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2418. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2419. do { \
  2420. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2421. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2422. } while (0)
  2423. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2424. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2425. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2426. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2427. do { \
  2428. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2429. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2430. } while (0)
  2431. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2432. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2433. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2434. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2435. do { \
  2436. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2437. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2438. } while (0)
  2439. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2440. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2441. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2442. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2443. do { \
  2444. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2445. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2446. } while (0)
  2447. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2448. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2449. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2450. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2451. do { \
  2452. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2453. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2454. } while (0)
  2455. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2456. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2457. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2458. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2459. do { \
  2460. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2461. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2462. } while (0)
  2463. /**
  2464. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2465. *
  2466. * @details
  2467. * HTT wds entry from source port learning
  2468. * Host will learn wds entries from rx and send this message to firmware
  2469. * to enable firmware to configure/delete AST entries for wds clients.
  2470. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2471. * and when SA's entry is deleted, firmware removes this AST entry
  2472. *
  2473. * The message would appear as follows:
  2474. *
  2475. * |31 30|29 |17 16|15 8|7 0|
  2476. * |----------------+----------------+----------------+----------------|
  2477. * | rsvd0 |PDVID| vdev_id | msg_type |
  2478. * |-------------------------------------------------------------------|
  2479. * | sa_addr_31_0 |
  2480. * |-------------------------------------------------------------------|
  2481. * | | ta_peer_id | sa_addr_47_32 |
  2482. * |-------------------------------------------------------------------|
  2483. * Where PDVID = pdev_id
  2484. *
  2485. * The message is interpreted as follows:
  2486. *
  2487. * dword0 - b'0:7 - msg_type: This will be set to
  2488. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2489. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2490. *
  2491. * dword0 - b'8:15 - vdev_id
  2492. *
  2493. * dword0 - b'16:17 - pdev_id
  2494. *
  2495. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2496. *
  2497. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2498. *
  2499. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2500. *
  2501. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2502. */
  2503. PREPACK struct htt_wds_entry {
  2504. A_UINT32
  2505. msg_type: 8,
  2506. vdev_id: 8,
  2507. pdev_id: 2,
  2508. rsvd0: 14;
  2509. A_UINT32 sa_addr_31_0;
  2510. A_UINT32
  2511. sa_addr_47_32: 16,
  2512. ta_peer_id: 14,
  2513. rsvd2: 2;
  2514. } POSTPACK;
  2515. /* DWORD 0 */
  2516. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2517. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2518. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2519. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2520. /* DWORD 2 */
  2521. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2522. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2523. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2524. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2525. /* DWORD 0 */
  2526. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2527. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2528. HTT_WDS_ENTRY_VDEV_ID_S)
  2529. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2530. do { \
  2531. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2532. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2533. } while (0)
  2534. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2535. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2536. HTT_WDS_ENTRY_PDEV_ID_S)
  2537. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2538. do { \
  2539. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2540. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2541. } while (0)
  2542. /* DWORD 2 */
  2543. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2544. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2545. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2546. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2547. do { \
  2548. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2549. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2550. } while (0)
  2551. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2552. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2553. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2554. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2555. do { \
  2556. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2557. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2558. } while (0)
  2559. /**
  2560. * @brief MAC DMA rx ring setup specification
  2561. * @details
  2562. * To allow for dynamic rx ring reconfiguration and to avoid race
  2563. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2564. * it uses. Instead, it sends this message to the target, indicating how
  2565. * the rx ring used by the host should be set up and maintained.
  2566. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2567. * specifications.
  2568. *
  2569. * |31 16|15 8|7 0|
  2570. * |---------------------------------------------------------------|
  2571. * header: | reserved | num rings | msg type |
  2572. * |---------------------------------------------------------------|
  2573. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2574. #if HTT_PADDR64
  2575. * | FW_IDX shadow register physical address (bits 63:32) |
  2576. #endif
  2577. * |---------------------------------------------------------------|
  2578. * | rx ring base physical address (bits 31:0) |
  2579. #if HTT_PADDR64
  2580. * | rx ring base physical address (bits 63:32) |
  2581. #endif
  2582. * |---------------------------------------------------------------|
  2583. * | rx ring buffer size | rx ring length |
  2584. * |---------------------------------------------------------------|
  2585. * | FW_IDX initial value | enabled flags |
  2586. * |---------------------------------------------------------------|
  2587. * | MSDU payload offset | 802.11 header offset |
  2588. * |---------------------------------------------------------------|
  2589. * | PPDU end offset | PPDU start offset |
  2590. * |---------------------------------------------------------------|
  2591. * | MPDU end offset | MPDU start offset |
  2592. * |---------------------------------------------------------------|
  2593. * | MSDU end offset | MSDU start offset |
  2594. * |---------------------------------------------------------------|
  2595. * | frag info offset | rx attention offset |
  2596. * |---------------------------------------------------------------|
  2597. * payload 2, if present, has the same format as payload 1
  2598. * Header fields:
  2599. * - MSG_TYPE
  2600. * Bits 7:0
  2601. * Purpose: identifies this as an rx ring configuration message
  2602. * Value: 0x2
  2603. * - NUM_RINGS
  2604. * Bits 15:8
  2605. * Purpose: indicates whether the host is setting up one rx ring or two
  2606. * Value: 1 or 2
  2607. * Payload:
  2608. * for systems using 64-bit format for bus addresses:
  2609. * - IDX_SHADOW_REG_PADDR_LO
  2610. * Bits 31:0
  2611. * Value: lower 4 bytes of physical address of the host's
  2612. * FW_IDX shadow register
  2613. * - IDX_SHADOW_REG_PADDR_HI
  2614. * Bits 31:0
  2615. * Value: upper 4 bytes of physical address of the host's
  2616. * FW_IDX shadow register
  2617. * - RING_BASE_PADDR_LO
  2618. * Bits 31:0
  2619. * Value: lower 4 bytes of physical address of the host's rx ring
  2620. * - RING_BASE_PADDR_HI
  2621. * Bits 31:0
  2622. * Value: uppper 4 bytes of physical address of the host's rx ring
  2623. * for systems using 32-bit format for bus addresses:
  2624. * - IDX_SHADOW_REG_PADDR
  2625. * Bits 31:0
  2626. * Value: physical address of the host's FW_IDX shadow register
  2627. * - RING_BASE_PADDR
  2628. * Bits 31:0
  2629. * Value: physical address of the host's rx ring
  2630. * - RING_LEN
  2631. * Bits 15:0
  2632. * Value: number of elements in the rx ring
  2633. * - RING_BUF_SZ
  2634. * Bits 31:16
  2635. * Value: size of the buffers referenced by the rx ring, in byte units
  2636. * - ENABLED_FLAGS
  2637. * Bits 15:0
  2638. * Value: 1-bit flags to show whether different rx fields are enabled
  2639. * bit 0: 802.11 header enabled (1) or disabled (0)
  2640. * bit 1: MSDU payload enabled (1) or disabled (0)
  2641. * bit 2: PPDU start enabled (1) or disabled (0)
  2642. * bit 3: PPDU end enabled (1) or disabled (0)
  2643. * bit 4: MPDU start enabled (1) or disabled (0)
  2644. * bit 5: MPDU end enabled (1) or disabled (0)
  2645. * bit 6: MSDU start enabled (1) or disabled (0)
  2646. * bit 7: MSDU end enabled (1) or disabled (0)
  2647. * bit 8: rx attention enabled (1) or disabled (0)
  2648. * bit 9: frag info enabled (1) or disabled (0)
  2649. * bit 10: unicast rx enabled (1) or disabled (0)
  2650. * bit 11: multicast rx enabled (1) or disabled (0)
  2651. * bit 12: ctrl rx enabled (1) or disabled (0)
  2652. * bit 13: mgmt rx enabled (1) or disabled (0)
  2653. * bit 14: null rx enabled (1) or disabled (0)
  2654. * bit 15: phy data rx enabled (1) or disabled (0)
  2655. * - IDX_INIT_VAL
  2656. * Bits 31:16
  2657. * Purpose: Specify the initial value for the FW_IDX.
  2658. * Value: the number of buffers initially present in the host's rx ring
  2659. * - OFFSET_802_11_HDR
  2660. * Bits 15:0
  2661. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2662. * - OFFSET_MSDU_PAYLOAD
  2663. * Bits 31:16
  2664. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2665. * - OFFSET_PPDU_START
  2666. * Bits 15:0
  2667. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2668. * - OFFSET_PPDU_END
  2669. * Bits 31:16
  2670. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2671. * - OFFSET_MPDU_START
  2672. * Bits 15:0
  2673. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2674. * - OFFSET_MPDU_END
  2675. * Bits 31:16
  2676. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2677. * - OFFSET_MSDU_START
  2678. * Bits 15:0
  2679. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2680. * - OFFSET_MSDU_END
  2681. * Bits 31:16
  2682. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2683. * - OFFSET_RX_ATTN
  2684. * Bits 15:0
  2685. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2686. * - OFFSET_FRAG_INFO
  2687. * Bits 31:16
  2688. * Value: offset in QUAD-bytes of frag info table
  2689. */
  2690. /* header fields */
  2691. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2692. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2693. /* payload fields */
  2694. /* for systems using a 64-bit format for bus addresses */
  2695. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2696. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2697. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2698. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2699. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2700. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2701. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2702. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2703. /* for systems using a 32-bit format for bus addresses */
  2704. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2705. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2706. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2707. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2708. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2709. #define HTT_RX_RING_CFG_LEN_S 0
  2710. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2711. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2712. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2713. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2714. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2715. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2716. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2717. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2718. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2719. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2720. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2721. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2722. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2723. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2724. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2725. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2726. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2727. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2728. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2729. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2730. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2731. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2732. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2733. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2734. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2735. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2736. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2737. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2738. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2739. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2740. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2741. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2742. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2743. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2744. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2745. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2746. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2747. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2748. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2749. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2750. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2751. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2752. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2753. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2754. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2755. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2756. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2757. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2758. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2759. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2760. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2761. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2762. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2763. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2764. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2765. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2766. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2767. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2768. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2769. #if HTT_PADDR64
  2770. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2771. #else
  2772. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2773. #endif
  2774. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2775. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2776. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2777. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2778. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2779. do { \
  2780. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2781. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2782. } while (0)
  2783. /* degenerate case for 32-bit fields */
  2784. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2785. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2786. ((_var) = (_val))
  2787. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2788. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2789. ((_var) = (_val))
  2790. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2791. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2792. ((_var) = (_val))
  2793. /* degenerate case for 32-bit fields */
  2794. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2795. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2796. ((_var) = (_val))
  2797. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2798. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2799. ((_var) = (_val))
  2800. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2801. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2802. ((_var) = (_val))
  2803. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2804. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2805. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2806. do { \
  2807. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2808. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2809. } while (0)
  2810. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2811. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2812. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2813. do { \
  2814. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2815. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2816. } while (0)
  2817. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2818. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2819. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2820. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2821. do { \
  2822. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2823. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2824. } while (0)
  2825. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2826. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2827. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2828. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2829. do { \
  2830. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2831. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2832. } while (0)
  2833. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2834. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2835. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2836. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2837. do { \
  2838. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2839. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2840. } while (0)
  2841. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2842. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2843. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2844. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2845. do { \
  2846. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2847. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2848. } while (0)
  2849. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2850. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2851. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2852. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2853. do { \
  2854. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2855. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2856. } while (0)
  2857. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2858. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2859. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2860. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2861. do { \
  2862. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2863. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2864. } while (0)
  2865. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2866. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2867. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2868. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2869. do { \
  2870. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2871. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2872. } while (0)
  2873. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2874. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2875. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2876. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2877. do { \
  2878. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2879. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2880. } while (0)
  2881. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2882. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2883. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2884. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2885. do { \
  2886. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2887. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2888. } while (0)
  2889. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2890. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2891. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2892. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2893. do { \
  2894. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2895. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2896. } while (0)
  2897. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2898. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2899. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2900. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2901. do { \
  2902. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2903. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2904. } while (0)
  2905. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2906. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2907. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2908. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2909. do { \
  2910. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2911. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2912. } while (0)
  2913. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2914. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2915. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2916. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2917. do { \
  2918. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2919. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2920. } while (0)
  2921. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2922. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2923. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2924. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2925. do { \
  2926. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2927. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2928. } while (0)
  2929. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2930. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2931. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2932. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2933. do { \
  2934. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2935. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2936. } while (0)
  2937. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2938. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2939. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2940. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2941. do { \
  2942. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2943. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2944. } while (0)
  2945. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2946. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2947. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2948. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2949. do { \
  2950. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2951. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2952. } while (0)
  2953. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2954. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2955. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2956. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2957. do { \
  2958. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2959. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2960. } while (0)
  2961. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2962. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2963. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2964. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2965. do { \
  2966. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2967. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2968. } while (0)
  2969. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2970. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2971. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2972. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2973. do { \
  2974. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2975. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2976. } while (0)
  2977. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2978. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2979. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2980. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2981. do { \
  2982. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2983. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2984. } while (0)
  2985. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2986. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2987. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2988. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2989. do { \
  2990. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2991. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2992. } while (0)
  2993. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2994. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2995. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2996. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2997. do { \
  2998. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2999. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3000. } while (0)
  3001. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3002. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3003. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3004. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3005. do { \
  3006. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3007. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3008. } while (0)
  3009. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3010. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3011. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3012. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3013. do { \
  3014. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3015. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3016. } while (0)
  3017. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3018. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3019. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3020. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3021. do { \
  3022. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3023. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3024. } while (0)
  3025. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3026. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3027. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3028. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3029. do { \
  3030. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3031. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3032. } while (0)
  3033. /**
  3034. * @brief host -> target FW statistics retrieve
  3035. *
  3036. * @details
  3037. * The following field definitions describe the format of the HTT host
  3038. * to target FW stats retrieve message. The message specifies the type of
  3039. * stats host wants to retrieve.
  3040. *
  3041. * |31 24|23 16|15 8|7 0|
  3042. * |-----------------------------------------------------------|
  3043. * | stats types request bitmask | msg type |
  3044. * |-----------------------------------------------------------|
  3045. * | stats types reset bitmask | reserved |
  3046. * |-----------------------------------------------------------|
  3047. * | stats type | config value |
  3048. * |-----------------------------------------------------------|
  3049. * | cookie LSBs |
  3050. * |-----------------------------------------------------------|
  3051. * | cookie MSBs |
  3052. * |-----------------------------------------------------------|
  3053. * Header fields:
  3054. * - MSG_TYPE
  3055. * Bits 7:0
  3056. * Purpose: identifies this is a stats upload request message
  3057. * Value: 0x3
  3058. * - UPLOAD_TYPES
  3059. * Bits 31:8
  3060. * Purpose: identifies which types of FW statistics to upload
  3061. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3062. * - RESET_TYPES
  3063. * Bits 31:8
  3064. * Purpose: identifies which types of FW statistics to reset
  3065. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3066. * - CFG_VAL
  3067. * Bits 23:0
  3068. * Purpose: give an opaque configuration value to the specified stats type
  3069. * Value: stats-type specific configuration value
  3070. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3071. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3072. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3073. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3074. * - CFG_STAT_TYPE
  3075. * Bits 31:24
  3076. * Purpose: specify which stats type (if any) the config value applies to
  3077. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3078. * a valid configuration specification
  3079. * - COOKIE_LSBS
  3080. * Bits 31:0
  3081. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3082. * message with its preceding host->target stats request message.
  3083. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3084. * - COOKIE_MSBS
  3085. * Bits 31:0
  3086. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3087. * message with its preceding host->target stats request message.
  3088. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3089. */
  3090. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3091. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3092. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3093. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3094. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3095. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3096. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3097. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3098. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3099. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3100. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3101. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3102. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3103. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3104. do { \
  3105. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3106. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3107. } while (0)
  3108. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3109. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3110. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3111. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3112. do { \
  3113. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3114. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3115. } while (0)
  3116. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3117. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3118. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3119. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3120. do { \
  3121. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3122. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3123. } while (0)
  3124. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3125. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3126. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3127. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3128. do { \
  3129. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3130. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3131. } while (0)
  3132. /**
  3133. * @brief host -> target HTT out-of-band sync request
  3134. *
  3135. * @details
  3136. * The HTT SYNC tells the target to suspend processing of subsequent
  3137. * HTT host-to-target messages until some other target agent locally
  3138. * informs the target HTT FW that the current sync counter is equal to
  3139. * or greater than (in a modulo sense) the sync counter specified in
  3140. * the SYNC message.
  3141. * This allows other host-target components to synchronize their operation
  3142. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3143. * security key has been downloaded to and activated by the target.
  3144. * In the absence of any explicit synchronization counter value
  3145. * specification, the target HTT FW will use zero as the default current
  3146. * sync value.
  3147. *
  3148. * |31 24|23 16|15 8|7 0|
  3149. * |-----------------------------------------------------------|
  3150. * | reserved | sync count | msg type |
  3151. * |-----------------------------------------------------------|
  3152. * Header fields:
  3153. * - MSG_TYPE
  3154. * Bits 7:0
  3155. * Purpose: identifies this as a sync message
  3156. * Value: 0x4
  3157. * - SYNC_COUNT
  3158. * Bits 15:8
  3159. * Purpose: specifies what sync value the HTT FW will wait for from
  3160. * an out-of-band specification to resume its operation
  3161. * Value: in-band sync counter value to compare against the out-of-band
  3162. * counter spec.
  3163. * The HTT target FW will suspend its host->target message processing
  3164. * as long as
  3165. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3166. */
  3167. #define HTT_H2T_SYNC_MSG_SZ 4
  3168. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3169. #define HTT_H2T_SYNC_COUNT_S 8
  3170. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3171. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3172. HTT_H2T_SYNC_COUNT_S)
  3173. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3174. do { \
  3175. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3176. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3177. } while (0)
  3178. /**
  3179. * @brief HTT aggregation configuration
  3180. */
  3181. #define HTT_AGGR_CFG_MSG_SZ 4
  3182. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3183. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3184. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3185. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3186. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3187. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3188. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3189. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3190. do { \
  3191. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3192. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3193. } while (0)
  3194. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3195. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3196. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3197. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3198. do { \
  3199. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3200. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3201. } while (0)
  3202. /**
  3203. * @brief host -> target HTT configure max amsdu info per vdev
  3204. *
  3205. * @details
  3206. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3207. *
  3208. * |31 21|20 16|15 8|7 0|
  3209. * |-----------------------------------------------------------|
  3210. * | reserved | vdev id | max amsdu | msg type |
  3211. * |-----------------------------------------------------------|
  3212. * Header fields:
  3213. * - MSG_TYPE
  3214. * Bits 7:0
  3215. * Purpose: identifies this as a aggr cfg ex message
  3216. * Value: 0xa
  3217. * - MAX_NUM_AMSDU_SUBFRM
  3218. * Bits 15:8
  3219. * Purpose: max MSDUs per A-MSDU
  3220. * - VDEV_ID
  3221. * Bits 20:16
  3222. * Purpose: ID of the vdev to which this limit is applied
  3223. */
  3224. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3225. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3226. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3227. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3228. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3229. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3230. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3231. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3232. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3233. do { \
  3234. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3235. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3236. } while (0)
  3237. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3238. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3239. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3240. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3241. do { \
  3242. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3243. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3244. } while (0)
  3245. /**
  3246. * @brief HTT WDI_IPA Config Message
  3247. *
  3248. * @details
  3249. * The HTT WDI_IPA config message is created/sent by host at driver
  3250. * init time. It contains information about data structures used on
  3251. * WDI_IPA TX and RX path.
  3252. * TX CE ring is used for pushing packet metadata from IPA uC
  3253. * to WLAN FW
  3254. * TX Completion ring is used for generating TX completions from
  3255. * WLAN FW to IPA uC
  3256. * RX Indication ring is used for indicating RX packets from FW
  3257. * to IPA uC
  3258. * RX Ring2 is used as either completion ring or as second
  3259. * indication ring. when Ring2 is used as completion ring, IPA uC
  3260. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3261. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3262. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3263. * indicated in RX Indication ring. Please see WDI_IPA specification
  3264. * for more details.
  3265. * |31 24|23 16|15 8|7 0|
  3266. * |----------------+----------------+----------------+----------------|
  3267. * | tx pkt pool size | Rsvd | msg_type |
  3268. * |-------------------------------------------------------------------|
  3269. * | tx comp ring base (bits 31:0) |
  3270. #if HTT_PADDR64
  3271. * | tx comp ring base (bits 63:32) |
  3272. #endif
  3273. * |-------------------------------------------------------------------|
  3274. * | tx comp ring size |
  3275. * |-------------------------------------------------------------------|
  3276. * | tx comp WR_IDX physical address (bits 31:0) |
  3277. #if HTT_PADDR64
  3278. * | tx comp WR_IDX physical address (bits 63:32) |
  3279. #endif
  3280. * |-------------------------------------------------------------------|
  3281. * | tx CE WR_IDX physical address (bits 31:0) |
  3282. #if HTT_PADDR64
  3283. * | tx CE WR_IDX physical address (bits 63:32) |
  3284. #endif
  3285. * |-------------------------------------------------------------------|
  3286. * | rx indication ring base (bits 31:0) |
  3287. #if HTT_PADDR64
  3288. * | rx indication ring base (bits 63:32) |
  3289. #endif
  3290. * |-------------------------------------------------------------------|
  3291. * | rx indication ring size |
  3292. * |-------------------------------------------------------------------|
  3293. * | rx ind RD_IDX physical address (bits 31:0) |
  3294. #if HTT_PADDR64
  3295. * | rx ind RD_IDX physical address (bits 63:32) |
  3296. #endif
  3297. * |-------------------------------------------------------------------|
  3298. * | rx ind WR_IDX physical address (bits 31:0) |
  3299. #if HTT_PADDR64
  3300. * | rx ind WR_IDX physical address (bits 63:32) |
  3301. #endif
  3302. * |-------------------------------------------------------------------|
  3303. * |-------------------------------------------------------------------|
  3304. * | rx ring2 base (bits 31:0) |
  3305. #if HTT_PADDR64
  3306. * | rx ring2 base (bits 63:32) |
  3307. #endif
  3308. * |-------------------------------------------------------------------|
  3309. * | rx ring2 size |
  3310. * |-------------------------------------------------------------------|
  3311. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3312. #if HTT_PADDR64
  3313. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3314. #endif
  3315. * |-------------------------------------------------------------------|
  3316. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3317. #if HTT_PADDR64
  3318. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3319. #endif
  3320. * |-------------------------------------------------------------------|
  3321. *
  3322. * Header fields:
  3323. * Header fields:
  3324. * - MSG_TYPE
  3325. * Bits 7:0
  3326. * Purpose: Identifies this as WDI_IPA config message
  3327. * value: = 0x8
  3328. * - TX_PKT_POOL_SIZE
  3329. * Bits 15:0
  3330. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3331. * WDI_IPA TX path
  3332. * For systems using 32-bit format for bus addresses:
  3333. * - TX_COMP_RING_BASE_ADDR
  3334. * Bits 31:0
  3335. * Purpose: TX Completion Ring base address in DDR
  3336. * - TX_COMP_RING_SIZE
  3337. * Bits 31:0
  3338. * Purpose: TX Completion Ring size (must be power of 2)
  3339. * - TX_COMP_WR_IDX_ADDR
  3340. * Bits 31:0
  3341. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3342. * updates the Write Index for WDI_IPA TX completion ring
  3343. * - TX_CE_WR_IDX_ADDR
  3344. * Bits 31:0
  3345. * Purpose: DDR address where IPA uC
  3346. * updates the WR Index for TX CE ring
  3347. * (needed for fusion platforms)
  3348. * - RX_IND_RING_BASE_ADDR
  3349. * Bits 31:0
  3350. * Purpose: RX Indication Ring base address in DDR
  3351. * - RX_IND_RING_SIZE
  3352. * Bits 31:0
  3353. * Purpose: RX Indication Ring size
  3354. * - RX_IND_RD_IDX_ADDR
  3355. * Bits 31:0
  3356. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3357. * RX indication ring
  3358. * - RX_IND_WR_IDX_ADDR
  3359. * Bits 31:0
  3360. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3361. * updates the Write Index for WDI_IPA RX indication ring
  3362. * - RX_RING2_BASE_ADDR
  3363. * Bits 31:0
  3364. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3365. * - RX_RING2_SIZE
  3366. * Bits 31:0
  3367. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3368. * - RX_RING2_RD_IDX_ADDR
  3369. * Bits 31:0
  3370. * Purpose: If Second RX ring is Indication ring, DDR address where
  3371. * IPA uC updates the Read Index for Ring2.
  3372. * If Second RX ring is completion ring, this is NOT used
  3373. * - RX_RING2_WR_IDX_ADDR
  3374. * Bits 31:0
  3375. * Purpose: If Second RX ring is Indication ring, DDR address where
  3376. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3377. * If second RX ring is completion ring, DDR address where
  3378. * IPA uC updates the Write Index for Ring 2.
  3379. * For systems using 64-bit format for bus addresses:
  3380. * - TX_COMP_RING_BASE_ADDR_LO
  3381. * Bits 31:0
  3382. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3383. * - TX_COMP_RING_BASE_ADDR_HI
  3384. * Bits 31:0
  3385. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3386. * - TX_COMP_RING_SIZE
  3387. * Bits 31:0
  3388. * Purpose: TX Completion Ring size (must be power of 2)
  3389. * - TX_COMP_WR_IDX_ADDR_LO
  3390. * Bits 31:0
  3391. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3392. * Lower 4 bytes of DDR address where WIFI FW
  3393. * updates the Write Index for WDI_IPA TX completion ring
  3394. * - TX_COMP_WR_IDX_ADDR_HI
  3395. * Bits 31:0
  3396. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3397. * Higher 4 bytes of DDR address where WIFI FW
  3398. * updates the Write Index for WDI_IPA TX completion ring
  3399. * - TX_CE_WR_IDX_ADDR_LO
  3400. * Bits 31:0
  3401. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3402. * updates the WR Index for TX CE ring
  3403. * (needed for fusion platforms)
  3404. * - TX_CE_WR_IDX_ADDR_HI
  3405. * Bits 31:0
  3406. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3407. * updates the WR Index for TX CE ring
  3408. * (needed for fusion platforms)
  3409. * - RX_IND_RING_BASE_ADDR_LO
  3410. * Bits 31:0
  3411. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3412. * - RX_IND_RING_BASE_ADDR_HI
  3413. * Bits 31:0
  3414. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3415. * - RX_IND_RING_SIZE
  3416. * Bits 31:0
  3417. * Purpose: RX Indication Ring size
  3418. * - RX_IND_RD_IDX_ADDR_LO
  3419. * Bits 31:0
  3420. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3421. * for WDI_IPA RX indication ring
  3422. * - RX_IND_RD_IDX_ADDR_HI
  3423. * Bits 31:0
  3424. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3425. * for WDI_IPA RX indication ring
  3426. * - RX_IND_WR_IDX_ADDR_LO
  3427. * Bits 31:0
  3428. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3429. * Lower 4 bytes of DDR address where WIFI FW
  3430. * updates the Write Index for WDI_IPA RX indication ring
  3431. * - RX_IND_WR_IDX_ADDR_HI
  3432. * Bits 31:0
  3433. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3434. * Higher 4 bytes of DDR address where WIFI FW
  3435. * updates the Write Index for WDI_IPA RX indication ring
  3436. * - RX_RING2_BASE_ADDR_LO
  3437. * Bits 31:0
  3438. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3439. * - RX_RING2_BASE_ADDR_HI
  3440. * Bits 31:0
  3441. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3442. * - RX_RING2_SIZE
  3443. * Bits 31:0
  3444. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3445. * - RX_RING2_RD_IDX_ADDR_LO
  3446. * Bits 31:0
  3447. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3448. * DDR address where IPA uC updates the Read Index for Ring2.
  3449. * If Second RX ring is completion ring, this is NOT used
  3450. * - RX_RING2_RD_IDX_ADDR_HI
  3451. * Bits 31:0
  3452. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3453. * DDR address where IPA uC updates the Read Index for Ring2.
  3454. * If Second RX ring is completion ring, this is NOT used
  3455. * - RX_RING2_WR_IDX_ADDR_LO
  3456. * Bits 31:0
  3457. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3458. * DDR address where WIFI FW updates the Write Index
  3459. * for WDI_IPA RX ring2
  3460. * If second RX ring is completion ring, lower 4 bytes of
  3461. * DDR address where IPA uC updates the Write Index for Ring 2.
  3462. * - RX_RING2_WR_IDX_ADDR_HI
  3463. * Bits 31:0
  3464. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3465. * DDR address where WIFI FW updates the Write Index
  3466. * for WDI_IPA RX ring2
  3467. * If second RX ring is completion ring, higher 4 bytes of
  3468. * DDR address where IPA uC updates the Write Index for Ring 2.
  3469. */
  3470. #if HTT_PADDR64
  3471. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3472. #else
  3473. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3474. #endif
  3475. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3476. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3477. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3478. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3479. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3480. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3481. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3482. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3483. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3484. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3485. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3486. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3487. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3488. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3489. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3490. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3491. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3492. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3493. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3494. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3495. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3496. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3497. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3498. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3499. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3500. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3501. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3502. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3503. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3504. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3505. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3507. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3509. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3511. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3513. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3515. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3517. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3519. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3521. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3523. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3531. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3532. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3533. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3534. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3535. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3536. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3537. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3538. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3539. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3540. do { \
  3541. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3542. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3543. } while (0)
  3544. /* for systems using 32-bit format for bus addr */
  3545. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3546. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3547. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3548. do { \
  3549. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3550. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3551. } while (0)
  3552. /* for systems using 64-bit format for bus addr */
  3553. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3554. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3555. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3556. do { \
  3557. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3558. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3559. } while (0)
  3560. /* for systems using 64-bit format for bus addr */
  3561. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3562. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3563. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3564. do { \
  3565. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3566. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3567. } while (0)
  3568. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3569. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3570. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3571. do { \
  3572. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3573. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3574. } while (0)
  3575. /* for systems using 32-bit format for bus addr */
  3576. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3577. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3578. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3579. do { \
  3580. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3581. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3582. } while (0)
  3583. /* for systems using 64-bit format for bus addr */
  3584. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3585. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3586. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3587. do { \
  3588. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3589. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3590. } while (0)
  3591. /* for systems using 64-bit format for bus addr */
  3592. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3593. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3594. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3595. do { \
  3596. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3597. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3598. } while (0)
  3599. /* for systems using 32-bit format for bus addr */
  3600. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3601. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3602. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3603. do { \
  3604. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3605. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3606. } while (0)
  3607. /* for systems using 64-bit format for bus addr */
  3608. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3609. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3610. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3611. do { \
  3612. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3613. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3614. } while (0)
  3615. /* for systems using 64-bit format for bus addr */
  3616. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3617. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3618. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3621. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3622. } while (0)
  3623. /* for systems using 32-bit format for bus addr */
  3624. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3625. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3626. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3629. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3630. } while (0)
  3631. /* for systems using 64-bit format for bus addr */
  3632. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3633. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3634. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3635. do { \
  3636. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3637. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3638. } while (0)
  3639. /* for systems using 64-bit format for bus addr */
  3640. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3641. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3642. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3643. do { \
  3644. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3645. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3646. } while (0)
  3647. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3648. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3649. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3650. do { \
  3651. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3652. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3653. } while (0)
  3654. /* for systems using 32-bit format for bus addr */
  3655. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3656. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3657. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3658. do { \
  3659. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3660. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3661. } while (0)
  3662. /* for systems using 64-bit format for bus addr */
  3663. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3664. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3665. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3666. do { \
  3667. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3668. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3669. } while (0)
  3670. /* for systems using 64-bit format for bus addr */
  3671. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3672. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3673. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3674. do { \
  3675. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3676. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3677. } while (0)
  3678. /* for systems using 32-bit format for bus addr */
  3679. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3680. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3681. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3682. do { \
  3683. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3684. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3685. } while (0)
  3686. /* for systems using 64-bit format for bus addr */
  3687. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3688. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3689. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3690. do { \
  3691. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3692. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3693. } while (0)
  3694. /* for systems using 64-bit format for bus addr */
  3695. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3696. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3697. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3698. do { \
  3699. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3700. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3701. } while (0)
  3702. /* for systems using 32-bit format for bus addr */
  3703. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3704. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3705. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3706. do { \
  3707. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3708. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3709. } while (0)
  3710. /* for systems using 64-bit format for bus addr */
  3711. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3712. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3713. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3714. do { \
  3715. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3716. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3717. } while (0)
  3718. /* for systems using 64-bit format for bus addr */
  3719. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3720. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3721. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3722. do { \
  3723. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3724. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3725. } while (0)
  3726. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3727. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3729. do { \
  3730. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3731. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3732. } while (0)
  3733. /* for systems using 32-bit format for bus addr */
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3735. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3737. do { \
  3738. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3739. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3740. } while (0)
  3741. /* for systems using 64-bit format for bus addr */
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3743. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3745. do { \
  3746. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3747. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3748. } while (0)
  3749. /* for systems using 64-bit format for bus addr */
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3751. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3753. do { \
  3754. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3755. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3756. } while (0)
  3757. /* for systems using 32-bit format for bus addr */
  3758. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3759. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3760. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3761. do { \
  3762. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3763. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3764. } while (0)
  3765. /* for systems using 64-bit format for bus addr */
  3766. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3767. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3768. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3769. do { \
  3770. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3771. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3772. } while (0)
  3773. /* for systems using 64-bit format for bus addr */
  3774. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3775. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3776. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3777. do { \
  3778. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3779. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3780. } while (0)
  3781. /*
  3782. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3783. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3784. * addresses are stored in a XXX-bit field.
  3785. * This macro is used to define both htt_wdi_ipa_config32_t and
  3786. * htt_wdi_ipa_config64_t structs.
  3787. */
  3788. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3789. _paddr__tx_comp_ring_base_addr_, \
  3790. _paddr__tx_comp_wr_idx_addr_, \
  3791. _paddr__tx_ce_wr_idx_addr_, \
  3792. _paddr__rx_ind_ring_base_addr_, \
  3793. _paddr__rx_ind_rd_idx_addr_, \
  3794. _paddr__rx_ind_wr_idx_addr_, \
  3795. _paddr__rx_ring2_base_addr_,\
  3796. _paddr__rx_ring2_rd_idx_addr_,\
  3797. _paddr__rx_ring2_wr_idx_addr_) \
  3798. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3799. { \
  3800. /* DWORD 0: flags and meta-data */ \
  3801. A_UINT32 \
  3802. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3803. reserved: 8, \
  3804. tx_pkt_pool_size: 16;\
  3805. /* DWORD 1 */\
  3806. _paddr__tx_comp_ring_base_addr_;\
  3807. /* DWORD 2 (or 3)*/\
  3808. A_UINT32 tx_comp_ring_size;\
  3809. /* DWORD 3 (or 4)*/\
  3810. _paddr__tx_comp_wr_idx_addr_;\
  3811. /* DWORD 4 (or 6)*/\
  3812. _paddr__tx_ce_wr_idx_addr_;\
  3813. /* DWORD 5 (or 8)*/\
  3814. _paddr__rx_ind_ring_base_addr_;\
  3815. /* DWORD 6 (or 10)*/\
  3816. A_UINT32 rx_ind_ring_size;\
  3817. /* DWORD 7 (or 11)*/\
  3818. _paddr__rx_ind_rd_idx_addr_;\
  3819. /* DWORD 8 (or 13)*/\
  3820. _paddr__rx_ind_wr_idx_addr_;\
  3821. /* DWORD 9 (or 15)*/\
  3822. _paddr__rx_ring2_base_addr_;\
  3823. /* DWORD 10 (or 17) */\
  3824. A_UINT32 rx_ring2_size;\
  3825. /* DWORD 11 (or 18) */\
  3826. _paddr__rx_ring2_rd_idx_addr_;\
  3827. /* DWORD 12 (or 20) */\
  3828. _paddr__rx_ring2_wr_idx_addr_;\
  3829. } POSTPACK
  3830. /* define a htt_wdi_ipa_config32_t type */
  3831. 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));
  3832. /* define a htt_wdi_ipa_config64_t type */
  3833. 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));
  3834. #if HTT_PADDR64
  3835. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3836. #else
  3837. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3838. #endif
  3839. enum htt_wdi_ipa_op_code {
  3840. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3841. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3842. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3843. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3844. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3845. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3846. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3847. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3848. /* keep this last */
  3849. HTT_WDI_IPA_OPCODE_MAX
  3850. };
  3851. /**
  3852. * @brief HTT WDI_IPA Operation Request Message
  3853. *
  3854. * @details
  3855. * HTT WDI_IPA Operation Request message is sent by host
  3856. * to either suspend or resume WDI_IPA TX or RX path.
  3857. * |31 24|23 16|15 8|7 0|
  3858. * |----------------+----------------+----------------+----------------|
  3859. * | op_code | Rsvd | msg_type |
  3860. * |-------------------------------------------------------------------|
  3861. *
  3862. * Header fields:
  3863. * - MSG_TYPE
  3864. * Bits 7:0
  3865. * Purpose: Identifies this as WDI_IPA Operation Request message
  3866. * value: = 0x9
  3867. * - OP_CODE
  3868. * Bits 31:16
  3869. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3870. * value: = enum htt_wdi_ipa_op_code
  3871. */
  3872. PREPACK struct htt_wdi_ipa_op_request_t
  3873. {
  3874. /* DWORD 0: flags and meta-data */
  3875. A_UINT32
  3876. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3877. reserved: 8,
  3878. op_code: 16;
  3879. } POSTPACK;
  3880. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3881. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3882. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3883. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3884. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3885. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3886. do { \
  3887. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3888. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3889. } while (0)
  3890. /*
  3891. * @brief host -> target HTT_SRING_SETUP message
  3892. *
  3893. * @details
  3894. * After target is booted up, Host can send SRING setup message for
  3895. * each host facing LMAC SRING. Target setups up HW registers based
  3896. * on setup message and confirms back to Host if response_required is set.
  3897. * Host should wait for confirmation message before sending new SRING
  3898. * setup message
  3899. *
  3900. * The message would appear as follows:
  3901. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3902. * |--------------- +-----------------+-----------------+-----------------|
  3903. * | ring_type | ring_id | pdev_id | msg_type |
  3904. * |----------------------------------------------------------------------|
  3905. * | ring_base_addr_lo |
  3906. * |----------------------------------------------------------------------|
  3907. * | ring_base_addr_hi |
  3908. * |----------------------------------------------------------------------|
  3909. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3910. * |----------------------------------------------------------------------|
  3911. * | ring_head_offset32_remote_addr_lo |
  3912. * |----------------------------------------------------------------------|
  3913. * | ring_head_offset32_remote_addr_hi |
  3914. * |----------------------------------------------------------------------|
  3915. * | ring_tail_offset32_remote_addr_lo |
  3916. * |----------------------------------------------------------------------|
  3917. * | ring_tail_offset32_remote_addr_hi |
  3918. * |----------------------------------------------------------------------|
  3919. * | ring_msi_addr_lo |
  3920. * |----------------------------------------------------------------------|
  3921. * | ring_msi_addr_hi |
  3922. * |----------------------------------------------------------------------|
  3923. * | ring_msi_data |
  3924. * |----------------------------------------------------------------------|
  3925. * | intr_timer_th |IM| intr_batch_counter_th |
  3926. * |----------------------------------------------------------------------|
  3927. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3928. * |----------------------------------------------------------------------|
  3929. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3930. * |----------------------------------------------------------------------|
  3931. * Where
  3932. * IM = sw_intr_mode
  3933. * RR = response_required
  3934. * PTCF = prefetch_timer_cfg
  3935. * IP = IPA drop flag
  3936. *
  3937. * The message is interpreted as follows:
  3938. * dword0 - b'0:7 - msg_type: This will be set to
  3939. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3940. * b'8:15 - pdev_id:
  3941. * 0 (for rings at SOC/UMAC level),
  3942. * 1/2/3 mac id (for rings at LMAC level)
  3943. * b'16:23 - ring_id: identify which ring is to setup,
  3944. * more details can be got from enum htt_srng_ring_id
  3945. * b'24:31 - ring_type: identify type of host rings,
  3946. * more details can be got from enum htt_srng_ring_type
  3947. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3948. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3949. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3950. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3951. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3952. * SW_TO_HW_RING.
  3953. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3954. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3955. * Lower 32 bits of memory address of the remote variable
  3956. * storing the 4-byte word offset that identifies the head
  3957. * element within the ring.
  3958. * (The head offset variable has type A_UINT32.)
  3959. * Valid for HW_TO_SW and SW_TO_SW rings.
  3960. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3961. * Upper 32 bits of memory address of the remote variable
  3962. * storing the 4-byte word offset that identifies the head
  3963. * element within the ring.
  3964. * (The head offset variable has type A_UINT32.)
  3965. * Valid for HW_TO_SW and SW_TO_SW rings.
  3966. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3967. * Lower 32 bits of memory address of the remote variable
  3968. * storing the 4-byte word offset that identifies the tail
  3969. * element within the ring.
  3970. * (The tail offset variable has type A_UINT32.)
  3971. * Valid for HW_TO_SW and SW_TO_SW rings.
  3972. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3973. * Upper 32 bits of memory address of the remote variable
  3974. * storing the 4-byte word offset that identifies the tail
  3975. * element within the ring.
  3976. * (The tail offset variable has type A_UINT32.)
  3977. * Valid for HW_TO_SW and SW_TO_SW rings.
  3978. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3979. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3980. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3981. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3982. * dword10 - b'0:31 - ring_msi_data: MSI data
  3983. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3984. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3985. * dword11 - b'0:14 - intr_batch_counter_th:
  3986. * batch counter threshold is in units of 4-byte words.
  3987. * HW internally maintains and increments batch count.
  3988. * (see SRING spec for detail description).
  3989. * When batch count reaches threshold value, an interrupt
  3990. * is generated by HW.
  3991. * b'15 - sw_intr_mode:
  3992. * This configuration shall be static.
  3993. * Only programmed at power up.
  3994. * 0: generate pulse style sw interrupts
  3995. * 1: generate level style sw interrupts
  3996. * b'16:31 - intr_timer_th:
  3997. * The timer init value when timer is idle or is
  3998. * initialized to start downcounting.
  3999. * In 8us units (to cover a range of 0 to 524 ms)
  4000. * dword12 - b'0:15 - intr_low_threshold:
  4001. * Used only by Consumer ring to generate ring_sw_int_p.
  4002. * Ring entries low threshold water mark, that is used
  4003. * in combination with the interrupt timer as well as
  4004. * the the clearing of the level interrupt.
  4005. * b'16:18 - prefetch_timer_cfg:
  4006. * Used only by Consumer ring to set timer mode to
  4007. * support Application prefetch handling.
  4008. * The external tail offset/pointer will be updated
  4009. * at following intervals:
  4010. * 3'b000: (Prefetch feature disabled; used only for debug)
  4011. * 3'b001: 1 usec
  4012. * 3'b010: 4 usec
  4013. * 3'b011: 8 usec (default)
  4014. * 3'b100: 16 usec
  4015. * Others: Reserverd
  4016. * b'19 - response_required:
  4017. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4018. * b'20 - ipa_drop_flag:
  4019. Indicates that host will config ipa drop threshold percentage
  4020. * b'21:31 - reserved: reserved for future use
  4021. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4022. * b'8:15 - ipa drop high threshold percentage:
  4023. * b'16:31 - Reserved
  4024. */
  4025. PREPACK struct htt_sring_setup_t {
  4026. A_UINT32 msg_type: 8,
  4027. pdev_id: 8,
  4028. ring_id: 8,
  4029. ring_type: 8;
  4030. A_UINT32 ring_base_addr_lo;
  4031. A_UINT32 ring_base_addr_hi;
  4032. A_UINT32 ring_size: 16,
  4033. ring_entry_size: 8,
  4034. ring_misc_cfg_flag: 8;
  4035. A_UINT32 ring_head_offset32_remote_addr_lo;
  4036. A_UINT32 ring_head_offset32_remote_addr_hi;
  4037. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4038. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4039. A_UINT32 ring_msi_addr_lo;
  4040. A_UINT32 ring_msi_addr_hi;
  4041. A_UINT32 ring_msi_data;
  4042. A_UINT32 intr_batch_counter_th: 15,
  4043. sw_intr_mode: 1,
  4044. intr_timer_th: 16;
  4045. A_UINT32 intr_low_threshold: 16,
  4046. prefetch_timer_cfg: 3,
  4047. response_required: 1,
  4048. ipa_drop_flag: 1,
  4049. reserved1: 11;
  4050. A_UINT32 ipa_drop_low_threshold: 8,
  4051. ipa_drop_high_threshold: 8,
  4052. reserved: 16;
  4053. } POSTPACK;
  4054. enum htt_srng_ring_type {
  4055. HTT_HW_TO_SW_RING = 0,
  4056. HTT_SW_TO_HW_RING,
  4057. HTT_SW_TO_SW_RING,
  4058. /* Insert new ring types above this line */
  4059. };
  4060. enum htt_srng_ring_id {
  4061. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4062. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4063. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4064. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4065. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4066. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4067. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4068. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4069. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4070. /* Add Other SRING which can't be directly configured by host software above this line */
  4071. };
  4072. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4073. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4074. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4075. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4076. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4077. HTT_SRING_SETUP_PDEV_ID_S)
  4078. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4079. do { \
  4080. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4081. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4082. } while (0)
  4083. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4084. #define HTT_SRING_SETUP_RING_ID_S 16
  4085. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4086. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4087. HTT_SRING_SETUP_RING_ID_S)
  4088. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4089. do { \
  4090. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4091. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4092. } while (0)
  4093. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4094. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4095. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4096. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4097. HTT_SRING_SETUP_RING_TYPE_S)
  4098. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4099. do { \
  4100. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4101. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4102. } while (0)
  4103. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4104. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4105. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4106. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4107. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4108. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4109. do { \
  4110. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4111. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4112. } while (0)
  4113. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4114. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4115. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4116. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4117. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4118. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4121. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4122. } while (0)
  4123. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4124. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4125. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4126. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4127. HTT_SRING_SETUP_RING_SIZE_S)
  4128. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4129. do { \
  4130. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4131. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4132. } while (0)
  4133. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4134. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4135. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4136. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4137. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4138. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4139. do { \
  4140. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4141. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4142. } while (0)
  4143. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4144. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4145. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4146. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4147. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4148. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4149. do { \
  4150. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4151. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4152. } while (0)
  4153. /* This control bit is applicable to only Producer, which updates Ring ID field
  4154. * of each descriptor before pushing into the ring.
  4155. * 0: updates ring_id(default)
  4156. * 1: ring_id updating disabled */
  4157. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4158. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4159. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4160. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4161. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4162. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4163. do { \
  4164. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4165. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4166. } while (0)
  4167. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4168. * of each descriptor before pushing into the ring.
  4169. * 0: updates Loopcnt(default)
  4170. * 1: Loopcnt updating disabled */
  4171. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4172. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4173. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4174. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4175. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4176. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4179. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4180. } while (0)
  4181. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4182. * into security_id port of GXI/AXI. */
  4183. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4186. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4187. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4188. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4191. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4192. } while (0)
  4193. /* During MSI write operation, SRNG drives value of this register bit into
  4194. * swap bit of GXI/AXI. */
  4195. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4196. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4197. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4198. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4199. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4200. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4203. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4204. } while (0)
  4205. /* During Pointer write operation, SRNG drives value of this register bit into
  4206. * swap bit of GXI/AXI. */
  4207. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4208. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4210. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4211. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4212. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4215. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4216. } while (0)
  4217. /* During any data or TLV write operation, SRNG drives value of this register
  4218. * bit into swap bit of GXI/AXI. */
  4219. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4220. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4222. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4223. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4224. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4225. do { \
  4226. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4227. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4228. } while (0)
  4229. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4230. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4231. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4232. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4233. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4234. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4235. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4236. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4239. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4240. } while (0)
  4241. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4242. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4243. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4244. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4245. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4246. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4247. do { \
  4248. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4249. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4250. } while (0)
  4251. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4252. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4253. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4254. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4255. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4256. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4257. do { \
  4258. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4259. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4260. } while (0)
  4261. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4262. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4263. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4264. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4265. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4266. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4267. do { \
  4268. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4269. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4270. } while (0)
  4271. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4272. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4273. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4274. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4275. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4276. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4279. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4280. } while (0)
  4281. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4282. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4283. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4284. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4285. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4286. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4287. do { \
  4288. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4289. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4290. } while (0)
  4291. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4292. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4293. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4294. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4295. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4296. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4297. do { \
  4298. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4299. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4300. } while (0)
  4301. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4302. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4303. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4304. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4305. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4306. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4307. do { \
  4308. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4309. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4310. } while (0)
  4311. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4312. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4313. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4314. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4315. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4316. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4319. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4320. } while (0)
  4321. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4322. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4323. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4324. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4325. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4326. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4327. do { \
  4328. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4329. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4330. } while (0)
  4331. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4332. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4333. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4334. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4335. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4336. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4337. do { \
  4338. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4339. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4340. } while (0)
  4341. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4342. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4343. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4344. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4345. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4346. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4347. do { \
  4348. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4349. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4350. } while (0)
  4351. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4352. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4353. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4354. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4355. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4356. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4357. do { \
  4358. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4359. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4360. } while (0)
  4361. /**
  4362. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4363. *
  4364. * @details
  4365. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4366. * configure RXDMA rings.
  4367. * The configuration is per ring based and includes both packet subtypes
  4368. * and PPDU/MPDU TLVs.
  4369. *
  4370. * The message would appear as follows:
  4371. *
  4372. * |31 28|27|26|25|24|23 16|15 |9 8|7 0|
  4373. * |-----+--+--+--+--+----------------+------------+---+---------------|
  4374. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4375. * |-------------------------------------------------------------------|
  4376. * | rsvd2 | ring_buffer_size |
  4377. * |-------------------------------------------------------------------|
  4378. * | packet_type_enable_flags_0 |
  4379. * |-------------------------------------------------------------------|
  4380. * | packet_type_enable_flags_1 |
  4381. * |-------------------------------------------------------------------|
  4382. * | packet_type_enable_flags_2 |
  4383. * |-------------------------------------------------------------------|
  4384. * | packet_type_enable_flags_3 |
  4385. * |-------------------------------------------------------------------|
  4386. * | tlv_filter_in_flags |
  4387. * |-------------------------------------------------------------------|
  4388. * | rx_header_offset | rx_packet_offset |
  4389. * |-------------------------------------------------------------------|
  4390. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4391. * |-------------------------------------------------------------------|
  4392. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4393. * |-------------------------------------------------------------------|
  4394. * | rsvd3 | rx_attention_offset |
  4395. * |-------------------------------------------------------------------|
  4396. * | rsvd4 | rx_drop_threshold |
  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. */
  4491. PREPACK struct htt_rx_ring_selection_cfg_t {
  4492. A_UINT32 msg_type: 8,
  4493. pdev_id: 8,
  4494. ring_id: 8,
  4495. status_swap: 1,
  4496. pkt_swap: 1,
  4497. rx_offsets_valid: 1,
  4498. drop_thresh_valid: 1,
  4499. rsvd1: 4;
  4500. A_UINT32 ring_buffer_size: 16,
  4501. rsvd2: 16;
  4502. A_UINT32 packet_type_enable_flags_0;
  4503. A_UINT32 packet_type_enable_flags_1;
  4504. A_UINT32 packet_type_enable_flags_2;
  4505. A_UINT32 packet_type_enable_flags_3;
  4506. A_UINT32 tlv_filter_in_flags;
  4507. A_UINT32 rx_packet_offset: 16,
  4508. rx_header_offset: 16;
  4509. A_UINT32 rx_mpdu_end_offset: 16,
  4510. rx_mpdu_start_offset: 16;
  4511. A_UINT32 rx_msdu_end_offset: 16,
  4512. rx_msdu_start_offset: 16;
  4513. A_UINT32 rx_attn_offset: 16,
  4514. rsvd3: 16;
  4515. A_UINT32 rx_drop_threshold: 10,
  4516. rsvd4: 22;
  4517. } POSTPACK;
  4518. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4519. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4520. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4521. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4522. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4523. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4524. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4525. do { \
  4526. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4527. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4528. } while (0)
  4529. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4530. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4531. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4532. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4533. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4534. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4535. do { \
  4536. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4537. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4538. } while (0)
  4539. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4540. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4541. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4542. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4543. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4544. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4547. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4548. } while (0)
  4549. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4551. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4552. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4553. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4554. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4555. do { \
  4556. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4557. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4558. } while (0)
  4559. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4560. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4561. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4562. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4563. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4564. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4565. do { \
  4566. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4567. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4568. } while (0)
  4569. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4570. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4571. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4572. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4573. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4574. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4575. do { \
  4576. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4577. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4578. } while (0)
  4579. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4580. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4581. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4582. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4583. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4584. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4585. do { \
  4586. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4587. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4588. } while (0)
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4592. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4593. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4595. do { \
  4596. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4597. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4598. } while (0)
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4602. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4603. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4605. do { \
  4606. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4607. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4608. } while (0)
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4612. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4613. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4615. do { \
  4616. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4617. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4618. } while (0)
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4622. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4623. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4625. do { \
  4626. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4627. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4628. } while (0)
  4629. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4630. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4631. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4632. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4633. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4634. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4635. do { \
  4636. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4637. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4638. } while (0)
  4639. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4640. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4641. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4642. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4643. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4644. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4645. do { \
  4646. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4647. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4648. } while (0)
  4649. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4650. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4651. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4652. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4653. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4654. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4655. do { \
  4656. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4657. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4658. } while (0)
  4659. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4660. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4661. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4662. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4663. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4664. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4665. do { \
  4666. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4667. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4668. } while (0)
  4669. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4670. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4671. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4672. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4673. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4674. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4675. do { \
  4676. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4677. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4678. } while (0)
  4679. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4680. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4681. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4682. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4683. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4684. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4685. do { \
  4686. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4687. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4688. } while (0)
  4689. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4690. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4691. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4692. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4693. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4694. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4695. do { \
  4696. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4697. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4698. } while (0)
  4699. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4700. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4701. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4702. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4703. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4704. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4705. do { \
  4706. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4707. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4708. } while (0)
  4709. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4710. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4711. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4712. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4713. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4714. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4715. do { \
  4716. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4717. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4718. } while (0)
  4719. /*
  4720. * Subtype based MGMT frames enable bits.
  4721. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4722. */
  4723. /* association request */
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4730. /* association response */
  4731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4737. /* Reassociation request */
  4738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4744. /* Reassociation response */
  4745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4751. /* Probe request */
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4758. /* Probe response */
  4759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4765. /* Timing Advertisement */
  4766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4772. /* Reserved */
  4773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4779. /* Beacon */
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4786. /* ATIM */
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4793. /* Disassociation */
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4800. /* Authentication */
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4807. /* Deauthentication */
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4814. /* Action */
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4821. /* Action No Ack */
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4828. /* Reserved */
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4835. /*
  4836. * Subtype based CTRL frames enable bits.
  4837. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4838. */
  4839. /* Reserved */
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4846. /* Reserved */
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4853. /* Reserved */
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4860. /* Reserved */
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4867. /* Reserved */
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4874. /* Reserved */
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4881. /* Reserved */
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4888. /* Control Wrapper */
  4889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4895. /* Block Ack Request */
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4902. /* Block Ack*/
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4909. /* PS-POLL */
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4916. /* RTS */
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4923. /* CTS */
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4930. /* ACK */
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4937. /* CF-END */
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4944. /* CF-END + CF-ACK */
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  4948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4951. /* Multicast data */
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  4955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4958. /* Unicast data */
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  4962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4965. /* NULL data */
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  4969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4973. do { \
  4974. HTT_CHECK_SET_VAL(httsym, value); \
  4975. (word) |= (value) << httsym##_S; \
  4976. } while (0)
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4978. (((word) & httsym##_M) >> httsym##_S)
  4979. #define htt_rx_ring_pkt_enable_subtype_set( \
  4980. word, flag, mode, type, subtype, val) \
  4981. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  4982. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  4983. #define htt_rx_ring_pkt_enable_subtype_get( \
  4984. word, flag, mode, type, subtype) \
  4985. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  4986. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4987. /* Definition to filter in TLVs */
  4988. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4989. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4990. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4991. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4992. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4993. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4994. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4995. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4996. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4997. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4998. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  4999. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5014. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5015. do { \
  5016. HTT_CHECK_SET_VAL(httsym, enable); \
  5017. (word) |= (enable) << httsym##_S; \
  5018. } while (0)
  5019. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5020. (((word) & httsym##_M) >> httsym##_S)
  5021. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5022. HTT_RX_RING_TLV_ENABLE_SET( \
  5023. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5024. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5025. HTT_RX_RING_TLV_ENABLE_GET( \
  5026. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5027. /**
  5028. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5029. * host --> target Receive Flow Steering configuration message definition.
  5030. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5031. * The reason for this is we want RFS to be configured and ready before MAC
  5032. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5033. *
  5034. * |31 24|23 16|15 9|8|7 0|
  5035. * |----------------+----------------+----------------+----------------|
  5036. * | reserved |E| msg type |
  5037. * |-------------------------------------------------------------------|
  5038. * Where E = RFS enable flag
  5039. *
  5040. * The RFS_CONFIG message consists of a single 4-byte word.
  5041. *
  5042. * Header fields:
  5043. * - MSG_TYPE
  5044. * Bits 7:0
  5045. * Purpose: identifies this as a RFS config msg
  5046. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5047. * - RFS_CONFIG
  5048. * Bit 8
  5049. * Purpose: Tells target whether to enable (1) or disable (0)
  5050. * flow steering feature when sending rx indication messages to host
  5051. */
  5052. #define HTT_H2T_RFS_CONFIG_M 0x100
  5053. #define HTT_H2T_RFS_CONFIG_S 8
  5054. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5055. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5056. HTT_H2T_RFS_CONFIG_S)
  5057. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5058. do { \
  5059. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5060. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5061. } while (0)
  5062. #define HTT_RFS_CFG_REQ_BYTES 4
  5063. /**
  5064. * @brief host -> target FW extended statistics retrieve
  5065. *
  5066. * @details
  5067. * The following field definitions describe the format of the HTT host
  5068. * to target FW extended stats retrieve message.
  5069. * The message specifies the type of stats the host wants to retrieve.
  5070. *
  5071. * |31 24|23 16|15 8|7 0|
  5072. * |-----------------------------------------------------------|
  5073. * | reserved | stats type | pdev_mask | msg type |
  5074. * |-----------------------------------------------------------|
  5075. * | config param [0] |
  5076. * |-----------------------------------------------------------|
  5077. * | config param [1] |
  5078. * |-----------------------------------------------------------|
  5079. * | config param [2] |
  5080. * |-----------------------------------------------------------|
  5081. * | config param [3] |
  5082. * |-----------------------------------------------------------|
  5083. * | reserved |
  5084. * |-----------------------------------------------------------|
  5085. * | cookie LSBs |
  5086. * |-----------------------------------------------------------|
  5087. * | cookie MSBs |
  5088. * |-----------------------------------------------------------|
  5089. * Header fields:
  5090. * - MSG_TYPE
  5091. * Bits 7:0
  5092. * Purpose: identifies this is a extended stats upload request message
  5093. * Value: 0x10
  5094. * - PDEV_MASK
  5095. * Bits 8:15
  5096. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5097. * Value: This is a overloaded field, refer to usage and interpretation of
  5098. * PDEV in interface document.
  5099. * Bit 8 : Reserved for SOC stats
  5100. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5101. * Indicates MACID_MASK in DBS
  5102. * - STATS_TYPE
  5103. * Bits 23:16
  5104. * Purpose: identifies which FW statistics to upload
  5105. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5106. * - Reserved
  5107. * Bits 31:24
  5108. * - CONFIG_PARAM [0]
  5109. * Bits 31:0
  5110. * Purpose: give an opaque configuration value to the specified stats type
  5111. * Value: stats-type specific configuration value
  5112. * Refer to htt_stats.h for interpretation for each stats sub_type
  5113. * - CONFIG_PARAM [1]
  5114. * Bits 31:0
  5115. * Purpose: give an opaque configuration value to the specified stats type
  5116. * Value: stats-type specific configuration value
  5117. * Refer to htt_stats.h for interpretation for each stats sub_type
  5118. * - CONFIG_PARAM [2]
  5119. * Bits 31:0
  5120. * Purpose: give an opaque configuration value to the specified stats type
  5121. * Value: stats-type specific configuration value
  5122. * Refer to htt_stats.h for interpretation for each stats sub_type
  5123. * - CONFIG_PARAM [3]
  5124. * Bits 31:0
  5125. * Purpose: give an opaque configuration value to the specified stats type
  5126. * Value: stats-type specific configuration value
  5127. * Refer to htt_stats.h for interpretation for each stats sub_type
  5128. * - Reserved [31:0] for future use.
  5129. * - COOKIE_LSBS
  5130. * Bits 31:0
  5131. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5132. * message with its preceding host->target stats request message.
  5133. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5134. * - COOKIE_MSBS
  5135. * Bits 31:0
  5136. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5137. * message with its preceding host->target stats request message.
  5138. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5139. */
  5140. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5141. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5142. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5143. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5144. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5145. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5146. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5147. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5148. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5149. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5150. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5151. do { \
  5152. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5153. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5154. } while (0)
  5155. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5156. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5157. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5158. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5159. do { \
  5160. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5161. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5162. } while (0)
  5163. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5164. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5165. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5166. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5167. do { \
  5168. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5169. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5170. } while (0)
  5171. /**
  5172. * @brief host -> target FW PPDU_STATS request message
  5173. *
  5174. * @details
  5175. * The following field definitions describe the format of the HTT host
  5176. * to target FW for PPDU_STATS_CFG msg.
  5177. * The message allows the host to configure the PPDU_STATS_IND messages
  5178. * produced by the target.
  5179. *
  5180. * |31 24|23 16|15 8|7 0|
  5181. * |-----------------------------------------------------------|
  5182. * | REQ bit mask | pdev_mask | msg type |
  5183. * |-----------------------------------------------------------|
  5184. * Header fields:
  5185. * - MSG_TYPE
  5186. * Bits 7:0
  5187. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5188. * Value: 0x11
  5189. * - PDEV_MASK
  5190. * Bits 8:15
  5191. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5192. * Value: This is a overloaded field, refer to usage and interpretation of
  5193. * PDEV in interface document.
  5194. * Bit 8 : Reserved for SOC stats
  5195. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5196. * Indicates MACID_MASK in DBS
  5197. * - REQ_TLV_BIT_MASK
  5198. * Bits 16:31
  5199. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5200. * needs to be included in the target's PPDU_STATS_IND messages.
  5201. * Value: refer htt_ppdu_stats_tlv_tag_t
  5202. *
  5203. */
  5204. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5205. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5206. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5207. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5208. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5209. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5210. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5211. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5212. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5213. do { \
  5214. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5215. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5216. } while (0)
  5217. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5218. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5219. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5220. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5221. do { \
  5222. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5223. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5224. } while (0)
  5225. /*=== target -> host messages ===============================================*/
  5226. enum htt_t2h_msg_type {
  5227. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  5228. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  5229. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  5230. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  5231. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  5232. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  5233. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  5234. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  5235. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  5236. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  5237. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  5238. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  5239. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  5240. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  5241. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  5242. /* only used for HL, add HTT MSG for HTT CREDIT update */
  5243. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  5244. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  5245. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  5246. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  5247. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  5248. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  5249. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  5250. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  5251. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  5252. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  5253. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  5254. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  5255. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  5256. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  5257. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  5258. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  5259. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  5260. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  5261. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  5262. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  5263. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  5264. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  5265. /* TX_OFFLOAD_DELIVER_IND:
  5266. * Forward the target's locally-generated packets to the host,
  5267. * to provide to the monitor mode interface.
  5268. */
  5269. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  5270. HTT_T2H_MSG_TYPE_TEST,
  5271. /* keep this last */
  5272. HTT_T2H_NUM_MSGS
  5273. };
  5274. /*
  5275. * HTT target to host message type -
  5276. * stored in bits 7:0 of the first word of the message
  5277. */
  5278. #define HTT_T2H_MSG_TYPE_M 0xff
  5279. #define HTT_T2H_MSG_TYPE_S 0
  5280. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  5281. do { \
  5282. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  5283. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  5284. } while (0)
  5285. #define HTT_T2H_MSG_TYPE_GET(word) \
  5286. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  5287. /**
  5288. * @brief target -> host version number confirmation message definition
  5289. *
  5290. * |31 24|23 16|15 8|7 0|
  5291. * |----------------+----------------+----------------+----------------|
  5292. * | reserved | major number | minor number | msg type |
  5293. * |-------------------------------------------------------------------|
  5294. * : option request TLV (optional) |
  5295. * :...................................................................:
  5296. *
  5297. * The VER_CONF message may consist of a single 4-byte word, or may be
  5298. * extended with TLVs that specify HTT options selected by the target.
  5299. * The following option TLVs may be appended to the VER_CONF message:
  5300. * - LL_BUS_ADDR_SIZE
  5301. * - HL_SUPPRESS_TX_COMPL_IND
  5302. * - MAX_TX_QUEUE_GROUPS
  5303. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  5304. * may be appended to the VER_CONF message (but only one TLV of each type).
  5305. *
  5306. * Header fields:
  5307. * - MSG_TYPE
  5308. * Bits 7:0
  5309. * Purpose: identifies this as a version number confirmation message
  5310. * Value: 0x0
  5311. * - VER_MINOR
  5312. * Bits 15:8
  5313. * Purpose: Specify the minor number of the HTT message library version
  5314. * in use by the target firmware.
  5315. * The minor number specifies the specific revision within a range
  5316. * of fundamentally compatible HTT message definition revisions.
  5317. * Compatible revisions involve adding new messages or perhaps
  5318. * adding new fields to existing messages, in a backwards-compatible
  5319. * manner.
  5320. * Incompatible revisions involve changing the message type values,
  5321. * or redefining existing messages.
  5322. * Value: minor number
  5323. * - VER_MAJOR
  5324. * Bits 15:8
  5325. * Purpose: Specify the major number of the HTT message library version
  5326. * in use by the target firmware.
  5327. * The major number specifies the family of minor revisions that are
  5328. * fundamentally compatible with each other, but not with prior or
  5329. * later families.
  5330. * Value: major number
  5331. */
  5332. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  5333. #define HTT_VER_CONF_MINOR_S 8
  5334. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  5335. #define HTT_VER_CONF_MAJOR_S 16
  5336. #define HTT_VER_CONF_MINOR_SET(word, value) \
  5337. do { \
  5338. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  5339. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  5340. } while (0)
  5341. #define HTT_VER_CONF_MINOR_GET(word) \
  5342. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  5343. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  5344. do { \
  5345. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  5346. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  5347. } while (0)
  5348. #define HTT_VER_CONF_MAJOR_GET(word) \
  5349. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  5350. #define HTT_VER_CONF_BYTES 4
  5351. /**
  5352. * @brief - target -> host HTT Rx In order indication message
  5353. *
  5354. * @details
  5355. *
  5356. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  5357. * |----------------+-------------------+---------------------+---------------|
  5358. * | peer ID | P| F| O| ext TID | msg type |
  5359. * |--------------------------------------------------------------------------|
  5360. * | MSDU count | Reserved | vdev id |
  5361. * |--------------------------------------------------------------------------|
  5362. * | MSDU 0 bus address (bits 31:0) |
  5363. #if HTT_PADDR64
  5364. * | MSDU 0 bus address (bits 63:32) |
  5365. #endif
  5366. * |--------------------------------------------------------------------------|
  5367. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  5368. * |--------------------------------------------------------------------------|
  5369. * | MSDU 1 bus address (bits 31:0) |
  5370. #if HTT_PADDR64
  5371. * | MSDU 1 bus address (bits 63:32) |
  5372. #endif
  5373. * |--------------------------------------------------------------------------|
  5374. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  5375. * |--------------------------------------------------------------------------|
  5376. */
  5377. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  5378. *
  5379. * @details
  5380. * bits
  5381. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  5382. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5383. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  5384. * | | frag | | | | fail |chksum fail|
  5385. * |-----+----+-------+--------+--------+---------+---------+-----------|
  5386. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  5387. */
  5388. struct htt_rx_in_ord_paddr_ind_hdr_t
  5389. {
  5390. A_UINT32 /* word 0 */
  5391. msg_type: 8,
  5392. ext_tid: 5,
  5393. offload: 1,
  5394. frag: 1,
  5395. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  5396. peer_id: 16;
  5397. A_UINT32 /* word 1 */
  5398. vap_id: 8,
  5399. /* NOTE:
  5400. * This reserved_1 field is not truly reserved - certain targets use
  5401. * this field internally to store debug information, and do not zero
  5402. * out the contents of the field before uploading the message to the
  5403. * host. Thus, any host-target communication supported by this field
  5404. * is limited to using values that are never used by the debug
  5405. * information stored by certain targets in the reserved_1 field.
  5406. * In particular, the targets in question don't use the value 0x3
  5407. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  5408. * so this previously-unused value within these bits is available to
  5409. * use as the host / target PKT_CAPTURE_MODE flag.
  5410. */
  5411. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  5412. /* if pkt_capture_mode == 0x3, host should
  5413. * send rx frames to monitor mode interface
  5414. */
  5415. msdu_cnt: 16;
  5416. };
  5417. struct htt_rx_in_ord_paddr_ind_msdu32_t
  5418. {
  5419. A_UINT32 dma_addr;
  5420. A_UINT32
  5421. length: 16,
  5422. fw_desc: 8,
  5423. msdu_info:8;
  5424. };
  5425. struct htt_rx_in_ord_paddr_ind_msdu64_t
  5426. {
  5427. A_UINT32 dma_addr_lo;
  5428. A_UINT32 dma_addr_hi;
  5429. A_UINT32
  5430. length: 16,
  5431. fw_desc: 8,
  5432. msdu_info:8;
  5433. };
  5434. #if HTT_PADDR64
  5435. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5436. #else
  5437. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5438. #endif
  5439. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5440. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5441. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5442. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5443. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5444. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5445. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5446. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5447. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5448. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5449. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5450. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5451. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5452. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5453. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5454. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5455. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5456. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5457. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5458. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5459. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5460. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5461. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  5462. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  5463. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5464. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5465. /* for systems using 64-bit format for bus addresses */
  5466. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5467. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5468. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5469. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5470. /* for systems using 32-bit format for bus addresses */
  5471. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5472. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5473. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5474. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5475. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5476. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5477. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5478. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5479. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5480. do { \
  5481. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5482. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5483. } while (0)
  5484. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5485. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5486. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5487. do { \
  5488. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5489. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5490. } while (0)
  5491. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5492. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5493. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5494. do { \
  5495. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5496. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5497. } while (0)
  5498. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5499. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5500. /*
  5501. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  5502. * deliver the rx frames to the monitor mode interface.
  5503. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  5504. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  5505. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  5506. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  5507. */
  5508. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  5509. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  5510. do { \
  5511. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  5512. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  5513. } while (0)
  5514. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  5515. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  5516. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  5517. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5518. do { \
  5519. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5520. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5521. } while (0)
  5522. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5523. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5524. /* for systems using 64-bit format for bus addresses */
  5525. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5526. do { \
  5527. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5528. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5529. } while (0)
  5530. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5531. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5532. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5533. do { \
  5534. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5535. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5536. } while (0)
  5537. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5538. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5539. /* for systems using 32-bit format for bus addresses */
  5540. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5541. do { \
  5542. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5543. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5544. } while (0)
  5545. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5546. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5547. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5548. do { \
  5549. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  5550. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5551. } while (0)
  5552. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5553. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5554. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5555. do { \
  5556. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5557. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5558. } while (0)
  5559. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5560. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5561. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5562. do { \
  5563. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  5564. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  5565. } while (0)
  5566. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5567. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5568. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  5571. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5572. } while (0)
  5573. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5574. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5575. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5576. do { \
  5577. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5578. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5579. } while (0)
  5580. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5581. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5582. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5583. do { \
  5584. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5585. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5586. } while (0)
  5587. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5588. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5589. /* definitions used within target -> host rx indication message */
  5590. PREPACK struct htt_rx_ind_hdr_prefix_t
  5591. {
  5592. A_UINT32 /* word 0 */
  5593. msg_type: 8,
  5594. ext_tid: 5,
  5595. release_valid: 1,
  5596. flush_valid: 1,
  5597. reserved0: 1,
  5598. peer_id: 16;
  5599. A_UINT32 /* word 1 */
  5600. flush_start_seq_num: 6,
  5601. flush_end_seq_num: 6,
  5602. release_start_seq_num: 6,
  5603. release_end_seq_num: 6,
  5604. num_mpdu_ranges: 8;
  5605. } POSTPACK;
  5606. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5607. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5608. #define HTT_TGT_RSSI_INVALID 0x80
  5609. PREPACK struct htt_rx_ppdu_desc_t
  5610. {
  5611. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5612. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5613. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5614. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5615. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5616. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5617. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5618. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5619. A_UINT32 /* word 0 */
  5620. rssi_cmb: 8,
  5621. timestamp_submicrosec: 8,
  5622. phy_err_code: 8,
  5623. phy_err: 1,
  5624. legacy_rate: 4,
  5625. legacy_rate_sel: 1,
  5626. end_valid: 1,
  5627. start_valid: 1;
  5628. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5629. union {
  5630. A_UINT32 /* word 1 */
  5631. rssi0_pri20: 8,
  5632. rssi0_ext20: 8,
  5633. rssi0_ext40: 8,
  5634. rssi0_ext80: 8;
  5635. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  5636. } u0;
  5637. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5638. union {
  5639. A_UINT32 /* word 2 */
  5640. rssi1_pri20: 8,
  5641. rssi1_ext20: 8,
  5642. rssi1_ext40: 8,
  5643. rssi1_ext80: 8;
  5644. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  5645. } u1;
  5646. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5647. union {
  5648. A_UINT32 /* word 3 */
  5649. rssi2_pri20: 8,
  5650. rssi2_ext20: 8,
  5651. rssi2_ext40: 8,
  5652. rssi2_ext80: 8;
  5653. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  5654. } u2;
  5655. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5656. union {
  5657. A_UINT32 /* word 4 */
  5658. rssi3_pri20: 8,
  5659. rssi3_ext20: 8,
  5660. rssi3_ext40: 8,
  5661. rssi3_ext80: 8;
  5662. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  5663. } u3;
  5664. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5665. A_UINT32 tsf32; /* word 5 */
  5666. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5667. A_UINT32 timestamp_microsec; /* word 6 */
  5668. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5669. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5670. A_UINT32 /* word 7 */
  5671. vht_sig_a1: 24,
  5672. preamble_type: 8;
  5673. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5674. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  5675. A_UINT32 /* word 8 */
  5676. vht_sig_a2: 24,
  5677. /* sa_ant_matrix
  5678. * For cases where a single rx chain has options to be connected to
  5679. * different rx antennas, show which rx antennas were in use during
  5680. * receipt of a given PPDU.
  5681. * This sa_ant_matrix provides a bitmask of the antennas used while
  5682. * receiving this frame.
  5683. */
  5684. sa_ant_matrix: 8;
  5685. } POSTPACK;
  5686. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5687. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5688. PREPACK struct htt_rx_ind_hdr_suffix_t
  5689. {
  5690. A_UINT32 /* word 0 */
  5691. fw_rx_desc_bytes: 16,
  5692. reserved0: 16;
  5693. } POSTPACK;
  5694. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5695. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5696. PREPACK struct htt_rx_ind_hdr_t
  5697. {
  5698. struct htt_rx_ind_hdr_prefix_t prefix;
  5699. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5700. struct htt_rx_ind_hdr_suffix_t suffix;
  5701. } POSTPACK;
  5702. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5703. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5704. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5705. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5706. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5707. /*
  5708. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5709. * the offset into the HTT rx indication message at which the
  5710. * FW rx PPDU descriptor resides
  5711. */
  5712. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5713. /*
  5714. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5715. * the offset into the HTT rx indication message at which the
  5716. * header suffix (FW rx MSDU byte count) resides
  5717. */
  5718. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5719. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5720. /*
  5721. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5722. * the offset into the HTT rx indication message at which the per-MSDU
  5723. * information starts
  5724. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5725. * per-MSDU information portion of the message. The per-MSDU info itself
  5726. * starts at byte 12.
  5727. */
  5728. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5729. /**
  5730. * @brief target -> host rx indication message definition
  5731. *
  5732. * @details
  5733. * The following field definitions describe the format of the rx indication
  5734. * message sent from the target to the host.
  5735. * The message consists of three major sections:
  5736. * 1. a fixed-length header
  5737. * 2. a variable-length list of firmware rx MSDU descriptors
  5738. * 3. one or more 4-octet MPDU range information elements
  5739. * The fixed length header itself has two sub-sections
  5740. * 1. the message meta-information, including identification of the
  5741. * sender and type of the received data, and a 4-octet flush/release IE
  5742. * 2. the firmware rx PPDU descriptor
  5743. *
  5744. * The format of the message is depicted below.
  5745. * in this depiction, the following abbreviations are used for information
  5746. * elements within the message:
  5747. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5748. * elements associated with the PPDU start are valid.
  5749. * Specifically, the following fields are valid only if SV is set:
  5750. * RSSI (all variants), L, legacy rate, preamble type, service,
  5751. * VHT-SIG-A
  5752. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5753. * elements associated with the PPDU end are valid.
  5754. * Specifically, the following fields are valid only if EV is set:
  5755. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5756. * - L - Legacy rate selector - if legacy rates are used, this flag
  5757. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5758. * (L == 0) PHY.
  5759. * - P - PHY error flag - boolean indication of whether the rx frame had
  5760. * a PHY error
  5761. *
  5762. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5763. * |----------------+-------------------+---------------------+---------------|
  5764. * | peer ID | |RV|FV| ext TID | msg type |
  5765. * |--------------------------------------------------------------------------|
  5766. * | num | release | release | flush | flush |
  5767. * | MPDU | end | start | end | start |
  5768. * | ranges | seq num | seq num | seq num | seq num |
  5769. * |==========================================================================|
  5770. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5771. * |V|V| | rate | | | timestamp | RSSI |
  5772. * |--------------------------------------------------------------------------|
  5773. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5774. * |--------------------------------------------------------------------------|
  5775. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5776. * |--------------------------------------------------------------------------|
  5777. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5778. * |--------------------------------------------------------------------------|
  5779. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5780. * |--------------------------------------------------------------------------|
  5781. * | TSF LSBs |
  5782. * |--------------------------------------------------------------------------|
  5783. * | microsec timestamp |
  5784. * |--------------------------------------------------------------------------|
  5785. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5786. * |--------------------------------------------------------------------------|
  5787. * | service | HT-SIG / VHT-SIG-A2 |
  5788. * |==========================================================================|
  5789. * | reserved | FW rx desc bytes |
  5790. * |--------------------------------------------------------------------------|
  5791. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5792. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5793. * |--------------------------------------------------------------------------|
  5794. * : : :
  5795. * |--------------------------------------------------------------------------|
  5796. * | alignment | MSDU Rx |
  5797. * | padding | desc Bn |
  5798. * |--------------------------------------------------------------------------|
  5799. * | reserved | MPDU range status | MPDU count |
  5800. * |--------------------------------------------------------------------------|
  5801. * : reserved : MPDU range status : MPDU count :
  5802. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5803. *
  5804. * Header fields:
  5805. * - MSG_TYPE
  5806. * Bits 7:0
  5807. * Purpose: identifies this as an rx indication message
  5808. * Value: 0x1
  5809. * - EXT_TID
  5810. * Bits 12:8
  5811. * Purpose: identify the traffic ID of the rx data, including
  5812. * special "extended" TID values for multicast, broadcast, and
  5813. * non-QoS data frames
  5814. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5815. * - FLUSH_VALID (FV)
  5816. * Bit 13
  5817. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5818. * is valid
  5819. * Value:
  5820. * 1 -> flush IE is valid and needs to be processed
  5821. * 0 -> flush IE is not valid and should be ignored
  5822. * - REL_VALID (RV)
  5823. * Bit 13
  5824. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5825. * is valid
  5826. * Value:
  5827. * 1 -> release IE is valid and needs to be processed
  5828. * 0 -> release IE is not valid and should be ignored
  5829. * - PEER_ID
  5830. * Bits 31:16
  5831. * Purpose: Identify, by ID, which peer sent the rx data
  5832. * Value: ID of the peer who sent the rx data
  5833. * - FLUSH_SEQ_NUM_START
  5834. * Bits 5:0
  5835. * Purpose: Indicate the start of a series of MPDUs to flush
  5836. * Not all MPDUs within this series are necessarily valid - the host
  5837. * must check each sequence number within this range to see if the
  5838. * corresponding MPDU is actually present.
  5839. * This field is only valid if the FV bit is set.
  5840. * Value:
  5841. * The sequence number for the first MPDUs to check to flush.
  5842. * The sequence number is masked by 0x3f.
  5843. * - FLUSH_SEQ_NUM_END
  5844. * Bits 11:6
  5845. * Purpose: Indicate the end of a series of MPDUs to flush
  5846. * Value:
  5847. * The sequence number one larger than the sequence number of the
  5848. * last MPDU to check to flush.
  5849. * The sequence number is masked by 0x3f.
  5850. * Not all MPDUs within this series are necessarily valid - the host
  5851. * must check each sequence number within this range to see if the
  5852. * corresponding MPDU is actually present.
  5853. * This field is only valid if the FV bit is set.
  5854. * - REL_SEQ_NUM_START
  5855. * Bits 17:12
  5856. * Purpose: Indicate the start of a series of MPDUs to release.
  5857. * All MPDUs within this series are present and valid - the host
  5858. * need not check each sequence number within this range to see if
  5859. * the corresponding MPDU is actually present.
  5860. * This field is only valid if the RV bit is set.
  5861. * Value:
  5862. * The sequence number for the first MPDUs to check to release.
  5863. * The sequence number is masked by 0x3f.
  5864. * - REL_SEQ_NUM_END
  5865. * Bits 23:18
  5866. * Purpose: Indicate the end of a series of MPDUs to release.
  5867. * Value:
  5868. * The sequence number one larger than the sequence number of the
  5869. * last MPDU to check to release.
  5870. * The sequence number is masked by 0x3f.
  5871. * All MPDUs within this series are present and valid - the host
  5872. * need not check each sequence number within this range to see if
  5873. * the corresponding MPDU is actually present.
  5874. * This field is only valid if the RV bit is set.
  5875. * - NUM_MPDU_RANGES
  5876. * Bits 31:24
  5877. * Purpose: Indicate how many ranges of MPDUs are present.
  5878. * Each MPDU range consists of a series of contiguous MPDUs within the
  5879. * rx frame sequence which all have the same MPDU status.
  5880. * Value: 1-63 (typically a small number, like 1-3)
  5881. *
  5882. * Rx PPDU descriptor fields:
  5883. * - RSSI_CMB
  5884. * Bits 7:0
  5885. * Purpose: Combined RSSI from all active rx chains, across the active
  5886. * bandwidth.
  5887. * Value: RSSI dB units w.r.t. noise floor
  5888. * - TIMESTAMP_SUBMICROSEC
  5889. * Bits 15:8
  5890. * Purpose: high-resolution timestamp
  5891. * Value:
  5892. * Sub-microsecond time of PPDU reception.
  5893. * This timestamp ranges from [0,MAC clock MHz).
  5894. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5895. * to form a high-resolution, large range rx timestamp.
  5896. * - PHY_ERR_CODE
  5897. * Bits 23:16
  5898. * Purpose:
  5899. * If the rx frame processing resulted in a PHY error, indicate what
  5900. * type of rx PHY error occurred.
  5901. * Value:
  5902. * This field is valid if the "P" (PHY_ERR) flag is set.
  5903. * TBD: document/specify the values for this field
  5904. * - PHY_ERR
  5905. * Bit 24
  5906. * Purpose: indicate whether the rx PPDU had a PHY error
  5907. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5908. * - LEGACY_RATE
  5909. * Bits 28:25
  5910. * Purpose:
  5911. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5912. * specify which rate was used.
  5913. * Value:
  5914. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5915. * flag.
  5916. * If LEGACY_RATE_SEL is 0:
  5917. * 0x8: OFDM 48 Mbps
  5918. * 0x9: OFDM 24 Mbps
  5919. * 0xA: OFDM 12 Mbps
  5920. * 0xB: OFDM 6 Mbps
  5921. * 0xC: OFDM 54 Mbps
  5922. * 0xD: OFDM 36 Mbps
  5923. * 0xE: OFDM 18 Mbps
  5924. * 0xF: OFDM 9 Mbps
  5925. * If LEGACY_RATE_SEL is 1:
  5926. * 0x8: CCK 11 Mbps long preamble
  5927. * 0x9: CCK 5.5 Mbps long preamble
  5928. * 0xA: CCK 2 Mbps long preamble
  5929. * 0xB: CCK 1 Mbps long preamble
  5930. * 0xC: CCK 11 Mbps short preamble
  5931. * 0xD: CCK 5.5 Mbps short preamble
  5932. * 0xE: CCK 2 Mbps short preamble
  5933. * - LEGACY_RATE_SEL
  5934. * Bit 29
  5935. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5936. * Value:
  5937. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5938. * used a legacy rate.
  5939. * 0 -> OFDM, 1 -> CCK
  5940. * - END_VALID
  5941. * Bit 30
  5942. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5943. * the start of the PPDU are valid. Specifically, the following
  5944. * fields are only valid if END_VALID is set:
  5945. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5946. * TIMESTAMP_SUBMICROSEC
  5947. * Value:
  5948. * 0 -> rx PPDU desc end fields are not valid
  5949. * 1 -> rx PPDU desc end fields are valid
  5950. * - START_VALID
  5951. * Bit 31
  5952. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5953. * the end of the PPDU are valid. Specifically, the following
  5954. * fields are only valid if START_VALID is set:
  5955. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5956. * VHT-SIG-A
  5957. * Value:
  5958. * 0 -> rx PPDU desc start fields are not valid
  5959. * 1 -> rx PPDU desc start fields are valid
  5960. * - RSSI0_PRI20
  5961. * Bits 7:0
  5962. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5963. * Value: RSSI dB units w.r.t. noise floor
  5964. *
  5965. * - RSSI0_EXT20
  5966. * Bits 7:0
  5967. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5968. * (if the rx bandwidth was >= 40 MHz)
  5969. * Value: RSSI dB units w.r.t. noise floor
  5970. * - RSSI0_EXT40
  5971. * Bits 7:0
  5972. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5973. * (if the rx bandwidth was >= 80 MHz)
  5974. * Value: RSSI dB units w.r.t. noise floor
  5975. * - RSSI0_EXT80
  5976. * Bits 7:0
  5977. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5978. * (if the rx bandwidth was >= 160 MHz)
  5979. * Value: RSSI dB units w.r.t. noise floor
  5980. *
  5981. * - RSSI1_PRI20
  5982. * Bits 7:0
  5983. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5984. * Value: RSSI dB units w.r.t. noise floor
  5985. * - RSSI1_EXT20
  5986. * Bits 7:0
  5987. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5988. * (if the rx bandwidth was >= 40 MHz)
  5989. * Value: RSSI dB units w.r.t. noise floor
  5990. * - RSSI1_EXT40
  5991. * Bits 7:0
  5992. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5993. * (if the rx bandwidth was >= 80 MHz)
  5994. * Value: RSSI dB units w.r.t. noise floor
  5995. * - RSSI1_EXT80
  5996. * Bits 7:0
  5997. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5998. * (if the rx bandwidth was >= 160 MHz)
  5999. * Value: RSSI dB units w.r.t. noise floor
  6000. *
  6001. * - RSSI2_PRI20
  6002. * Bits 7:0
  6003. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6004. * Value: RSSI dB units w.r.t. noise floor
  6005. * - RSSI2_EXT20
  6006. * Bits 7:0
  6007. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6008. * (if the rx bandwidth was >= 40 MHz)
  6009. * Value: RSSI dB units w.r.t. noise floor
  6010. * - RSSI2_EXT40
  6011. * Bits 7:0
  6012. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6013. * (if the rx bandwidth was >= 80 MHz)
  6014. * Value: RSSI dB units w.r.t. noise floor
  6015. * - RSSI2_EXT80
  6016. * Bits 7:0
  6017. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6018. * (if the rx bandwidth was >= 160 MHz)
  6019. * Value: RSSI dB units w.r.t. noise floor
  6020. *
  6021. * - RSSI3_PRI20
  6022. * Bits 7:0
  6023. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6024. * Value: RSSI dB units w.r.t. noise floor
  6025. * - RSSI3_EXT20
  6026. * Bits 7:0
  6027. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6028. * (if the rx bandwidth was >= 40 MHz)
  6029. * Value: RSSI dB units w.r.t. noise floor
  6030. * - RSSI3_EXT40
  6031. * Bits 7:0
  6032. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  6033. * (if the rx bandwidth was >= 80 MHz)
  6034. * Value: RSSI dB units w.r.t. noise floor
  6035. * - RSSI3_EXT80
  6036. * Bits 7:0
  6037. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  6038. * (if the rx bandwidth was >= 160 MHz)
  6039. * Value: RSSI dB units w.r.t. noise floor
  6040. *
  6041. * - TSF32
  6042. * Bits 31:0
  6043. * Purpose: specify the time the rx PPDU was received, in TSF units
  6044. * Value: 32 LSBs of the TSF
  6045. * - TIMESTAMP_MICROSEC
  6046. * Bits 31:0
  6047. * Purpose: specify the time the rx PPDU was received, in microsecond units
  6048. * Value: PPDU rx time, in microseconds
  6049. * - VHT_SIG_A1
  6050. * Bits 23:0
  6051. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  6052. * from the rx PPDU
  6053. * Value:
  6054. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6055. * VHT-SIG-A1 data.
  6056. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6057. * first 24 bits of the HT-SIG data.
  6058. * Otherwise, this field is invalid.
  6059. * Refer to the the 802.11 protocol for the definition of the
  6060. * HT-SIG and VHT-SIG-A1 fields
  6061. * - VHT_SIG_A2
  6062. * Bits 23:0
  6063. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  6064. * from the rx PPDU
  6065. * Value:
  6066. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  6067. * VHT-SIG-A2 data.
  6068. * If PREAMBLE_TYPE specifies HT, then this field contains the
  6069. * last 24 bits of the HT-SIG data.
  6070. * Otherwise, this field is invalid.
  6071. * Refer to the the 802.11 protocol for the definition of the
  6072. * HT-SIG and VHT-SIG-A2 fields
  6073. * - PREAMBLE_TYPE
  6074. * Bits 31:24
  6075. * Purpose: indicate the PHY format of the received burst
  6076. * Value:
  6077. * 0x4: Legacy (OFDM/CCK)
  6078. * 0x8: HT
  6079. * 0x9: HT with TxBF
  6080. * 0xC: VHT
  6081. * 0xD: VHT with TxBF
  6082. * - SERVICE
  6083. * Bits 31:24
  6084. * Purpose: TBD
  6085. * Value: TBD
  6086. *
  6087. * Rx MSDU descriptor fields:
  6088. * - FW_RX_DESC_BYTES
  6089. * Bits 15:0
  6090. * Purpose: Indicate how many bytes in the Rx indication are used for
  6091. * FW Rx descriptors
  6092. *
  6093. * Payload fields:
  6094. * - MPDU_COUNT
  6095. * Bits 7:0
  6096. * Purpose: Indicate how many sequential MPDUs share the same status.
  6097. * All MPDUs within the indicated list are from the same RA-TA-TID.
  6098. * - MPDU_STATUS
  6099. * Bits 15:8
  6100. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  6101. * received successfully.
  6102. * Value:
  6103. * 0x1: success
  6104. * 0x2: FCS error
  6105. * 0x3: duplicate error
  6106. * 0x4: replay error
  6107. * 0x5: invalid peer
  6108. */
  6109. /* header fields */
  6110. #define HTT_RX_IND_EXT_TID_M 0x1f00
  6111. #define HTT_RX_IND_EXT_TID_S 8
  6112. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  6113. #define HTT_RX_IND_FLUSH_VALID_S 13
  6114. #define HTT_RX_IND_REL_VALID_M 0x4000
  6115. #define HTT_RX_IND_REL_VALID_S 14
  6116. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  6117. #define HTT_RX_IND_PEER_ID_S 16
  6118. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  6119. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  6120. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  6121. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  6122. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  6123. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  6124. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  6125. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  6126. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  6127. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  6128. /* rx PPDU descriptor fields */
  6129. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  6130. #define HTT_RX_IND_RSSI_CMB_S 0
  6131. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  6132. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  6133. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  6134. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  6135. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  6136. #define HTT_RX_IND_PHY_ERR_S 24
  6137. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  6138. #define HTT_RX_IND_LEGACY_RATE_S 25
  6139. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  6140. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  6141. #define HTT_RX_IND_END_VALID_M 0x40000000
  6142. #define HTT_RX_IND_END_VALID_S 30
  6143. #define HTT_RX_IND_START_VALID_M 0x80000000
  6144. #define HTT_RX_IND_START_VALID_S 31
  6145. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  6146. #define HTT_RX_IND_RSSI_PRI20_S 0
  6147. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  6148. #define HTT_RX_IND_RSSI_EXT20_S 8
  6149. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  6150. #define HTT_RX_IND_RSSI_EXT40_S 16
  6151. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  6152. #define HTT_RX_IND_RSSI_EXT80_S 24
  6153. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  6154. #define HTT_RX_IND_VHT_SIG_A1_S 0
  6155. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  6156. #define HTT_RX_IND_VHT_SIG_A2_S 0
  6157. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  6158. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  6159. #define HTT_RX_IND_SERVICE_M 0xff000000
  6160. #define HTT_RX_IND_SERVICE_S 24
  6161. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  6162. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  6163. /* rx MSDU descriptor fields */
  6164. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  6165. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  6166. /* payload fields */
  6167. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  6168. #define HTT_RX_IND_MPDU_COUNT_S 0
  6169. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  6170. #define HTT_RX_IND_MPDU_STATUS_S 8
  6171. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  6172. do { \
  6173. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  6174. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  6175. } while (0)
  6176. #define HTT_RX_IND_EXT_TID_GET(word) \
  6177. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  6178. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  6179. do { \
  6180. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  6181. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  6182. } while (0)
  6183. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  6184. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  6185. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  6186. do { \
  6187. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  6188. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  6189. } while (0)
  6190. #define HTT_RX_IND_REL_VALID_GET(word) \
  6191. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  6192. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  6193. do { \
  6194. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  6195. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  6196. } while (0)
  6197. #define HTT_RX_IND_PEER_ID_GET(word) \
  6198. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  6199. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  6200. do { \
  6201. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  6202. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  6203. } while (0)
  6204. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  6205. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  6206. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  6207. do { \
  6208. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  6209. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  6210. } while (0)
  6211. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  6212. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  6213. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  6214. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  6215. do { \
  6216. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  6217. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  6218. } while (0)
  6219. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  6220. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  6221. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  6222. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  6223. do { \
  6224. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  6225. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  6226. } while (0)
  6227. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  6228. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  6229. HTT_RX_IND_REL_SEQ_NUM_START_S)
  6230. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  6231. do { \
  6232. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  6233. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  6234. } while (0)
  6235. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  6236. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  6237. HTT_RX_IND_REL_SEQ_NUM_END_S)
  6238. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  6239. do { \
  6240. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  6241. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  6242. } while (0)
  6243. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  6244. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  6245. HTT_RX_IND_NUM_MPDU_RANGES_S)
  6246. /* FW rx PPDU descriptor fields */
  6247. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  6248. do { \
  6249. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  6250. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  6251. } while (0)
  6252. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  6253. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  6254. HTT_RX_IND_RSSI_CMB_S)
  6255. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  6256. do { \
  6257. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  6258. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  6259. } while (0)
  6260. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  6261. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  6262. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  6263. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  6264. do { \
  6265. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  6266. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  6267. } while (0)
  6268. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  6269. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  6270. HTT_RX_IND_PHY_ERR_CODE_S)
  6271. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  6272. do { \
  6273. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  6274. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  6275. } while (0)
  6276. #define HTT_RX_IND_PHY_ERR_GET(word) \
  6277. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  6278. HTT_RX_IND_PHY_ERR_S)
  6279. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  6280. do { \
  6281. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  6282. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  6283. } while (0)
  6284. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  6285. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  6286. HTT_RX_IND_LEGACY_RATE_S)
  6287. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  6288. do { \
  6289. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  6290. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  6291. } while (0)
  6292. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  6293. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  6294. HTT_RX_IND_LEGACY_RATE_SEL_S)
  6295. #define HTT_RX_IND_END_VALID_SET(word, value) \
  6296. do { \
  6297. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  6298. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  6299. } while (0)
  6300. #define HTT_RX_IND_END_VALID_GET(word) \
  6301. (((word) & HTT_RX_IND_END_VALID_M) >> \
  6302. HTT_RX_IND_END_VALID_S)
  6303. #define HTT_RX_IND_START_VALID_SET(word, value) \
  6304. do { \
  6305. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  6306. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  6307. } while (0)
  6308. #define HTT_RX_IND_START_VALID_GET(word) \
  6309. (((word) & HTT_RX_IND_START_VALID_M) >> \
  6310. HTT_RX_IND_START_VALID_S)
  6311. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  6312. do { \
  6313. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  6314. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  6315. } while (0)
  6316. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  6317. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  6318. HTT_RX_IND_RSSI_PRI20_S)
  6319. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  6320. do { \
  6321. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  6322. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  6323. } while (0)
  6324. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  6325. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  6326. HTT_RX_IND_RSSI_EXT20_S)
  6327. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  6328. do { \
  6329. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  6330. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  6331. } while (0)
  6332. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  6333. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  6334. HTT_RX_IND_RSSI_EXT40_S)
  6335. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  6336. do { \
  6337. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  6338. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  6339. } while (0)
  6340. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  6341. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  6342. HTT_RX_IND_RSSI_EXT80_S)
  6343. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  6344. do { \
  6345. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  6346. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  6347. } while (0)
  6348. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  6349. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  6350. HTT_RX_IND_VHT_SIG_A1_S)
  6351. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  6352. do { \
  6353. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  6354. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  6355. } while (0)
  6356. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  6357. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  6358. HTT_RX_IND_VHT_SIG_A2_S)
  6359. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  6360. do { \
  6361. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  6362. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  6363. } while (0)
  6364. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  6365. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  6366. HTT_RX_IND_PREAMBLE_TYPE_S)
  6367. #define HTT_RX_IND_SERVICE_SET(word, value) \
  6368. do { \
  6369. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  6370. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  6371. } while (0)
  6372. #define HTT_RX_IND_SERVICE_GET(word) \
  6373. (((word) & HTT_RX_IND_SERVICE_M) >> \
  6374. HTT_RX_IND_SERVICE_S)
  6375. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  6376. do { \
  6377. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  6378. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  6379. } while (0)
  6380. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  6381. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  6382. HTT_RX_IND_SA_ANT_MATRIX_S)
  6383. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  6384. do { \
  6385. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  6386. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  6387. } while (0)
  6388. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  6389. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  6390. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  6391. do { \
  6392. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  6393. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  6394. } while (0)
  6395. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  6396. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  6397. #define HTT_RX_IND_HL_BYTES \
  6398. (HTT_RX_IND_HDR_BYTES + \
  6399. 4 /* single FW rx MSDU descriptor */ + \
  6400. 4 /* single MPDU range information element */)
  6401. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  6402. /* Could we use one macro entry? */
  6403. #define HTT_WORD_SET(word, field, value) \
  6404. do { \
  6405. HTT_CHECK_SET_VAL(field, value); \
  6406. (word) |= ((value) << field ## _S); \
  6407. } while (0)
  6408. #define HTT_WORD_GET(word, field) \
  6409. (((word) & field ## _M) >> field ## _S)
  6410. PREPACK struct hl_htt_rx_ind_base {
  6411. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  6412. } POSTPACK;
  6413. /*
  6414. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  6415. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  6416. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  6417. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  6418. * htt_rx_ind_hl_rx_desc_t.
  6419. */
  6420. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6421. struct htt_rx_ind_hl_rx_desc_t {
  6422. A_UINT8 ver;
  6423. A_UINT8 len;
  6424. struct {
  6425. A_UINT8
  6426. first_msdu: 1,
  6427. last_msdu: 1,
  6428. c3_failed: 1,
  6429. c4_failed: 1,
  6430. ipv6: 1,
  6431. tcp: 1,
  6432. udp: 1,
  6433. reserved: 1;
  6434. } flags;
  6435. /* NOTE: no reserved space - don't append any new fields here */
  6436. };
  6437. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6438. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6439. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6440. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6441. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6442. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6443. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6444. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6445. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6446. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6447. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6448. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6449. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6450. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6451. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  6452. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6453. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6454. /* This structure is used in HL, the basic descriptor information
  6455. * used by host. the structure is translated by FW from HW desc
  6456. * or generated by FW. But in HL monitor mode, the host would use
  6457. * the same structure with LL.
  6458. */
  6459. PREPACK struct hl_htt_rx_desc_base {
  6460. A_UINT32
  6461. seq_num:12,
  6462. encrypted:1,
  6463. chan_info_present:1,
  6464. resv0:2,
  6465. mcast_bcast:1,
  6466. fragment:1,
  6467. key_id_oct:8,
  6468. resv1:6;
  6469. A_UINT32
  6470. pn_31_0;
  6471. union {
  6472. struct {
  6473. A_UINT16 pn_47_32;
  6474. A_UINT16 pn_63_48;
  6475. } pn16;
  6476. A_UINT32 pn_63_32;
  6477. } u0;
  6478. A_UINT32
  6479. pn_95_64;
  6480. A_UINT32
  6481. pn_127_96;
  6482. } POSTPACK;
  6483. /*
  6484. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6485. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6486. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6487. * Please see htt_chan_change_t for description of the fields.
  6488. */
  6489. PREPACK struct htt_chan_info_t
  6490. {
  6491. A_UINT32 primary_chan_center_freq_mhz: 16,
  6492. contig_chan1_center_freq_mhz: 16;
  6493. A_UINT32 contig_chan2_center_freq_mhz: 16,
  6494. phy_mode: 8,
  6495. reserved: 8;
  6496. } POSTPACK;
  6497. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6498. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6499. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6500. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6501. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6502. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6503. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6504. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6505. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6506. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6507. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6508. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6509. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6510. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6511. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6512. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6513. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6514. /* Channel information */
  6515. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6516. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6517. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6518. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6519. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6520. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6521. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6522. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6523. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6524. do { \
  6525. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6526. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6527. } while (0)
  6528. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6529. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6530. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6533. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6534. } while (0)
  6535. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6536. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6537. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6538. do { \
  6539. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6540. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6541. } while (0)
  6542. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6543. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6544. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6545. do { \
  6546. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6547. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6548. } while (0)
  6549. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6550. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  6551. /*
  6552. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  6553. * @brief target -> host message definition for FW offloaded pkts
  6554. *
  6555. * @details
  6556. * The following field definitions describe the format of the firmware
  6557. * offload deliver message sent from the target to the host.
  6558. *
  6559. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  6560. *
  6561. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  6562. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  6563. * | reserved_1 | msg type |
  6564. * |--------------------------------------------------------------------------|
  6565. * | phy_timestamp_l32 |
  6566. * |--------------------------------------------------------------------------|
  6567. * | WORD2 (see below) |
  6568. * |--------------------------------------------------------------------------|
  6569. * | seqno | framectrl |
  6570. * |--------------------------------------------------------------------------|
  6571. * | reserved_3 | vdev_id | tid_num|
  6572. * |--------------------------------------------------------------------------|
  6573. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  6574. * |--------------------------------------------------------------------------|
  6575. *
  6576. * where:
  6577. * STAT = status
  6578. * F = format (802.3 vs. 802.11)
  6579. *
  6580. * definition for word 2
  6581. *
  6582. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  6583. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  6584. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  6585. * |--------------------------------------------------------------------------|
  6586. *
  6587. * where:
  6588. * PR = preamble
  6589. * BF = beamformed
  6590. */
  6591. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  6592. {
  6593. A_UINT32 /* word 0 */
  6594. msg_type:8, /* [ 7: 0] */
  6595. reserved_1:24; /* [31: 8] */
  6596. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  6597. A_UINT32 /* word 2 */
  6598. /* preamble:
  6599. * 0-OFDM,
  6600. * 1-CCk,
  6601. * 2-HT,
  6602. * 3-VHT
  6603. */
  6604. preamble: 2, /* [1:0] */
  6605. /* mcs:
  6606. * In case of HT preamble interpret
  6607. * MCS along with NSS.
  6608. * Valid values for HT are 0 to 7.
  6609. * HT mcs 0 with NSS 2 is mcs 8.
  6610. * Valid values for VHT are 0 to 9.
  6611. */
  6612. mcs: 4, /* [5:2] */
  6613. /* rate:
  6614. * This is applicable only for
  6615. * CCK and OFDM preamble type
  6616. * rate 0: OFDM 48 Mbps,
  6617. * 1: OFDM 24 Mbps,
  6618. * 2: OFDM 12 Mbps
  6619. * 3: OFDM 6 Mbps
  6620. * 4: OFDM 54 Mbps
  6621. * 5: OFDM 36 Mbps
  6622. * 6: OFDM 18 Mbps
  6623. * 7: OFDM 9 Mbps
  6624. * rate 0: CCK 11 Mbps Long
  6625. * 1: CCK 5.5 Mbps Long
  6626. * 2: CCK 2 Mbps Long
  6627. * 3: CCK 1 Mbps Long
  6628. * 4: CCK 11 Mbps Short
  6629. * 5: CCK 5.5 Mbps Short
  6630. * 6: CCK 2 Mbps Short
  6631. */
  6632. rate : 3, /* [ 8: 6] */
  6633. rssi : 8, /* [16: 9] units=dBm */
  6634. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  6635. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  6636. stbc : 1, /* [22] */
  6637. sgi : 1, /* [23] */
  6638. ldpc : 1, /* [24] */
  6639. beamformed: 1, /* [25] */
  6640. reserved_2: 6; /* [31:26] */
  6641. A_UINT32 /* word 3 */
  6642. framectrl:16, /* [15: 0] */
  6643. seqno:16; /* [31:16] */
  6644. A_UINT32 /* word 4 */
  6645. tid_num:5, /* [ 4: 0] actual TID number */
  6646. vdev_id:8, /* [12: 5] */
  6647. reserved_3:19; /* [31:13] */
  6648. A_UINT32 /* word 5 */
  6649. /* status:
  6650. * 0: tx_ok
  6651. * 1: retry
  6652. * 2: drop
  6653. * 3: filtered
  6654. * 4: abort
  6655. * 5: tid delete
  6656. * 6: sw abort
  6657. * 7: dropped by peer migration
  6658. */
  6659. status:3, /* [2:0] */
  6660. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  6661. tx_mpdu_bytes:16, /* [19:4] */
  6662. reserved_4:12; /* [31:20] */
  6663. } POSTPACK;
  6664. /* FW offload deliver ind message header fields */
  6665. /* DWORD one */
  6666. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  6667. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  6668. /* DWORD two */
  6669. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  6670. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  6671. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  6672. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  6673. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  6674. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  6675. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  6676. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  6677. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  6678. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  6679. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  6680. #define HTT_FW_OFFLOAD_IND_BW_S 19
  6681. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  6682. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  6683. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  6684. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  6685. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  6686. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  6687. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  6688. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  6689. /* DWORD three*/
  6690. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  6691. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  6692. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  6693. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  6694. /* DWORD four */
  6695. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  6696. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  6697. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  6698. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  6699. /* DWORD five */
  6700. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  6701. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  6702. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  6703. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  6704. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  6705. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  6706. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  6707. do { \
  6708. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  6709. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  6710. } while (0)
  6711. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  6712. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  6713. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  6714. do { \
  6715. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  6716. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  6717. } while (0)
  6718. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  6719. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  6720. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  6721. do { \
  6722. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  6723. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  6724. } while (0)
  6725. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  6726. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  6727. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  6728. do { \
  6729. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  6730. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  6731. } while (0)
  6732. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  6733. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  6734. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  6735. do { \
  6736. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  6737. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  6738. } while (0)
  6739. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  6740. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  6741. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  6742. do { \
  6743. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  6744. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  6745. } while (0)
  6746. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  6747. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  6748. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  6749. do { \
  6750. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  6751. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  6752. } while (0)
  6753. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  6754. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  6755. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  6756. do { \
  6757. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  6758. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  6759. } while (0)
  6760. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  6761. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  6762. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  6763. do { \
  6764. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  6765. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  6766. } while (0)
  6767. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  6768. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  6769. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  6770. do { \
  6771. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  6772. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  6773. } while (0)
  6774. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  6775. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  6776. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  6777. do { \
  6778. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  6779. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  6780. } while (0)
  6781. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  6782. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  6783. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  6784. do { \
  6785. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  6786. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  6787. } while (0)
  6788. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  6789. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  6790. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  6791. do { \
  6792. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  6793. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  6794. } while (0)
  6795. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  6796. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  6797. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  6798. do { \
  6799. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  6800. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  6801. } while (0)
  6802. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  6803. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  6804. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  6805. do { \
  6806. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  6807. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  6808. } while (0)
  6809. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  6810. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  6811. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  6812. do { \
  6813. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  6814. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  6815. } while (0)
  6816. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  6817. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  6818. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  6819. do { \
  6820. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  6821. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  6822. } while (0)
  6823. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  6824. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  6825. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  6826. do { \
  6827. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  6828. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  6829. } while (0)
  6830. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  6831. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  6832. /*
  6833. * @brief target -> host rx reorder flush message definition
  6834. *
  6835. * @details
  6836. * The following field definitions describe the format of the rx flush
  6837. * message sent from the target to the host.
  6838. * The message consists of a 4-octet header, followed by one or more
  6839. * 4-octet payload information elements.
  6840. *
  6841. * |31 24|23 8|7 0|
  6842. * |--------------------------------------------------------------|
  6843. * | TID | peer ID | msg type |
  6844. * |--------------------------------------------------------------|
  6845. * | seq num end | seq num start | MPDU status | reserved |
  6846. * |--------------------------------------------------------------|
  6847. * First DWORD:
  6848. * - MSG_TYPE
  6849. * Bits 7:0
  6850. * Purpose: identifies this as an rx flush message
  6851. * Value: 0x2
  6852. * - PEER_ID
  6853. * Bits 23:8 (only bits 18:8 actually used)
  6854. * Purpose: identify which peer's rx data is being flushed
  6855. * Value: (rx) peer ID
  6856. * - TID
  6857. * Bits 31:24 (only bits 27:24 actually used)
  6858. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6859. * Value: traffic identifier
  6860. * Second DWORD:
  6861. * - MPDU_STATUS
  6862. * Bits 15:8
  6863. * Purpose:
  6864. * Indicate whether the flushed MPDUs should be discarded or processed.
  6865. * Value:
  6866. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6867. * stages of rx processing
  6868. * other: discard the MPDUs
  6869. * It is anticipated that flush messages will always have
  6870. * MPDU status == 1, but the status flag is included for
  6871. * flexibility.
  6872. * - SEQ_NUM_START
  6873. * Bits 23:16
  6874. * Purpose:
  6875. * Indicate the start of a series of consecutive MPDUs being flushed.
  6876. * Not all MPDUs within this range are necessarily valid - the host
  6877. * must check each sequence number within this range to see if the
  6878. * corresponding MPDU is actually present.
  6879. * Value:
  6880. * The sequence number for the first MPDU in the sequence.
  6881. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6882. * - SEQ_NUM_END
  6883. * Bits 30:24
  6884. * Purpose:
  6885. * Indicate the end of a series of consecutive MPDUs being flushed.
  6886. * Value:
  6887. * The sequence number one larger than the sequence number of the
  6888. * last MPDU being flushed.
  6889. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6890. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6891. * are to be released for further rx processing.
  6892. * Not all MPDUs within this range are necessarily valid - the host
  6893. * must check each sequence number within this range to see if the
  6894. * corresponding MPDU is actually present.
  6895. */
  6896. /* first DWORD */
  6897. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6898. #define HTT_RX_FLUSH_PEER_ID_S 8
  6899. #define HTT_RX_FLUSH_TID_M 0xff000000
  6900. #define HTT_RX_FLUSH_TID_S 24
  6901. /* second DWORD */
  6902. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6903. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6904. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6905. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6906. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6907. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6908. #define HTT_RX_FLUSH_BYTES 8
  6909. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6910. do { \
  6911. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6912. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6913. } while (0)
  6914. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6915. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6916. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6917. do { \
  6918. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6919. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6920. } while (0)
  6921. #define HTT_RX_FLUSH_TID_GET(word) \
  6922. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6923. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6924. do { \
  6925. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6926. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6927. } while (0)
  6928. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6929. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6930. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6931. do { \
  6932. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6933. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6934. } while (0)
  6935. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6936. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  6937. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6938. do { \
  6939. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6940. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6941. } while (0)
  6942. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6943. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6944. /*
  6945. * @brief target -> host rx pn check indication message
  6946. *
  6947. * @details
  6948. * The following field definitions describe the format of the Rx PN check
  6949. * indication message sent from the target to the host.
  6950. * The message consists of a 4-octet header, followed by the start and
  6951. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6952. * IE is one octet containing the sequence number that failed the PN
  6953. * check.
  6954. *
  6955. * |31 24|23 8|7 0|
  6956. * |--------------------------------------------------------------|
  6957. * | TID | peer ID | msg type |
  6958. * |--------------------------------------------------------------|
  6959. * | Reserved | PN IE count | seq num end | seq num start|
  6960. * |--------------------------------------------------------------|
  6961. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6962. * |--------------------------------------------------------------|
  6963. * First DWORD:
  6964. * - MSG_TYPE
  6965. * Bits 7:0
  6966. * Purpose: Identifies this as an rx pn check indication message
  6967. * Value: 0x2
  6968. * - PEER_ID
  6969. * Bits 23:8 (only bits 18:8 actually used)
  6970. * Purpose: identify which peer
  6971. * Value: (rx) peer ID
  6972. * - TID
  6973. * Bits 31:24 (only bits 27:24 actually used)
  6974. * Purpose: identify traffic identifier
  6975. * Value: traffic identifier
  6976. * Second DWORD:
  6977. * - SEQ_NUM_START
  6978. * Bits 7:0
  6979. * Purpose:
  6980. * Indicates the starting sequence number of the MPDU in this
  6981. * series of MPDUs that went though PN check.
  6982. * Value:
  6983. * The sequence number for the first MPDU in the sequence.
  6984. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6985. * - SEQ_NUM_END
  6986. * Bits 15:8
  6987. * Purpose:
  6988. * Indicates the ending sequence number of the MPDU in this
  6989. * series of MPDUs that went though PN check.
  6990. * Value:
  6991. * The sequence number one larger then the sequence number of the last
  6992. * MPDU being flushed.
  6993. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6994. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  6995. * for invalid PN numbers and are ready to be released for further processing.
  6996. * Not all MPDUs within this range are necessarily valid - the host
  6997. * must check each sequence number within this range to see if the
  6998. * corresponding MPDU is actually present.
  6999. * - PN_IE_COUNT
  7000. * Bits 23:16
  7001. * Purpose:
  7002. * Used to determine the variable number of PN information elements in this
  7003. * message
  7004. *
  7005. * PN information elements:
  7006. * - PN_IE_x-
  7007. * Purpose:
  7008. * Each PN information element contains the sequence number of the MPDU that
  7009. * has failed the target PN check.
  7010. * Value:
  7011. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7012. * that failed the PN check.
  7013. */
  7014. /* first DWORD */
  7015. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7016. #define HTT_RX_PN_IND_PEER_ID_S 8
  7017. #define HTT_RX_PN_IND_TID_M 0xff000000
  7018. #define HTT_RX_PN_IND_TID_S 24
  7019. /* second DWORD */
  7020. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  7021. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  7022. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  7023. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  7024. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  7025. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  7026. #define HTT_RX_PN_IND_BYTES 8
  7027. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  7028. do { \
  7029. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  7030. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  7031. } while (0)
  7032. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  7033. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  7034. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  7035. do { \
  7036. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  7037. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  7038. } while (0)
  7039. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  7040. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  7041. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  7042. do { \
  7043. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  7044. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  7045. } while (0)
  7046. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  7047. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  7048. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  7049. do { \
  7050. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  7051. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  7052. } while (0)
  7053. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  7054. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  7055. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  7056. do { \
  7057. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  7058. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  7059. } while (0)
  7060. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  7061. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  7062. /*
  7063. * @brief target -> host rx offload deliver message for LL system
  7064. *
  7065. * @details
  7066. * In a low latency system this message is sent whenever the offload
  7067. * manager flushes out the packets it has coalesced in its coalescing buffer.
  7068. * The DMA of the actual packets into host memory is done before sending out
  7069. * this message. This message indicates only how many MSDUs to reap. The
  7070. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  7071. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  7072. * DMA'd by the MAC directly into host memory these packets do not contain
  7073. * the MAC descriptors in the header portion of the packet. Instead they contain
  7074. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  7075. * message, the packets are delivered directly to the NW stack without going
  7076. * through the regular reorder buffering and PN checking path since it has
  7077. * already been done in target.
  7078. *
  7079. * |31 24|23 16|15 8|7 0|
  7080. * |-----------------------------------------------------------------------|
  7081. * | Total MSDU count | reserved | msg type |
  7082. * |-----------------------------------------------------------------------|
  7083. *
  7084. * @brief target -> host rx offload deliver message for HL system
  7085. *
  7086. * @details
  7087. * In a high latency system this message is sent whenever the offload manager
  7088. * flushes out the packets it has coalesced in its coalescing buffer. The
  7089. * actual packets are also carried along with this message. When the host
  7090. * receives this message, it is expected to deliver these packets to the NW
  7091. * stack directly instead of routing them through the reorder buffering and
  7092. * PN checking path since it has already been done in target.
  7093. *
  7094. * |31 24|23 16|15 8|7 0|
  7095. * |-----------------------------------------------------------------------|
  7096. * | Total MSDU count | reserved | msg type |
  7097. * |-----------------------------------------------------------------------|
  7098. * | peer ID | MSDU length |
  7099. * |-----------------------------------------------------------------------|
  7100. * | MSDU payload | FW Desc | tid | vdev ID |
  7101. * |-----------------------------------------------------------------------|
  7102. * | MSDU payload contd. |
  7103. * |-----------------------------------------------------------------------|
  7104. * | peer ID | MSDU length |
  7105. * |-----------------------------------------------------------------------|
  7106. * | MSDU payload | FW Desc | tid | vdev ID |
  7107. * |-----------------------------------------------------------------------|
  7108. * | MSDU payload contd. |
  7109. * |-----------------------------------------------------------------------|
  7110. *
  7111. */
  7112. /* first DWORD */
  7113. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  7114. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  7115. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  7116. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  7117. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  7118. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  7119. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  7120. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  7121. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  7122. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  7123. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  7124. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  7125. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  7126. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  7127. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  7128. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  7129. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  7130. do { \
  7131. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  7132. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  7133. } while (0)
  7134. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  7135. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  7136. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  7137. do { \
  7138. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  7139. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  7140. } while (0)
  7141. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  7142. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  7143. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  7144. do { \
  7145. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  7146. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  7147. } while (0)
  7148. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  7149. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  7150. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  7151. do { \
  7152. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  7153. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  7154. } while (0)
  7155. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  7156. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  7157. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  7158. do { \
  7159. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  7160. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  7161. } while (0)
  7162. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  7163. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  7164. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  7165. do { \
  7166. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  7167. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  7168. } while (0)
  7169. /**
  7170. * @brief target -> host rx peer map/unmap message definition
  7171. *
  7172. * @details
  7173. * The following diagram shows the format of the rx peer map message sent
  7174. * from the target to the host. This layout assumes the target operates
  7175. * as little-endian.
  7176. *
  7177. * This message always contains a SW peer ID. The main purpose of the
  7178. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7179. * with, so that the host can use that peer ID to determine which peer
  7180. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7181. * other purposes, such as identifying during tx completions which peer
  7182. * the tx frames in question were transmitted to.
  7183. *
  7184. * In certain generations of chips, the peer map message also contains
  7185. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  7186. * to identify which peer the frame needs to be forwarded to (i.e. the
  7187. * peer assocated with the Destination MAC Address within the packet),
  7188. * and particularly which vdev needs to transmit the frame (for cases
  7189. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  7190. * meaning as AST_INDEX_0.
  7191. * This DA-based peer ID that is provided for certain rx frames
  7192. * (the rx frames that need to be re-transmitted as tx frames)
  7193. * is the ID that the HW uses for referring to the peer in question,
  7194. * rather than the peer ID that the SW+FW use to refer to the peer.
  7195. *
  7196. *
  7197. * |31 24|23 16|15 8|7 0|
  7198. * |-----------------------------------------------------------------------|
  7199. * | SW peer ID | VDEV ID | msg type |
  7200. * |-----------------------------------------------------------------------|
  7201. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7202. * |-----------------------------------------------------------------------|
  7203. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  7204. * |-----------------------------------------------------------------------|
  7205. *
  7206. *
  7207. * The following diagram shows the format of the rx peer unmap message sent
  7208. * from the target to the host.
  7209. *
  7210. * |31 24|23 16|15 8|7 0|
  7211. * |-----------------------------------------------------------------------|
  7212. * | SW peer ID | VDEV ID | msg type |
  7213. * |-----------------------------------------------------------------------|
  7214. *
  7215. * The following field definitions describe the format of the rx peer map
  7216. * and peer unmap messages sent from the target to the host.
  7217. * - MSG_TYPE
  7218. * Bits 7:0
  7219. * Purpose: identifies this as an rx peer map or peer unmap message
  7220. * Value: peer map -> 0x3, peer unmap -> 0x4
  7221. * - VDEV_ID
  7222. * Bits 15:8
  7223. * Purpose: Indicates which virtual device the peer is associated
  7224. * with.
  7225. * Value: vdev ID (used in the host to look up the vdev object)
  7226. * - PEER_ID (a.k.a. SW_PEER_ID)
  7227. * Bits 31:16
  7228. * Purpose: The peer ID (index) that WAL is allocating (map) or
  7229. * freeing (unmap)
  7230. * Value: (rx) peer ID
  7231. * - MAC_ADDR_L32 (peer map only)
  7232. * Bits 31:0
  7233. * Purpose: Identifies which peer node the peer ID is for.
  7234. * Value: lower 4 bytes of peer node's MAC address
  7235. * - MAC_ADDR_U16 (peer map only)
  7236. * Bits 15:0
  7237. * Purpose: Identifies which peer node the peer ID is for.
  7238. * Value: upper 2 bytes of peer node's MAC address
  7239. * - HW_PEER_ID
  7240. * Bits 31:16
  7241. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7242. * address, so for rx frames marked for rx --> tx forwarding, the
  7243. * host can determine from the HW peer ID provided as meta-data with
  7244. * the rx frame which peer the frame is supposed to be forwarded to.
  7245. * Value: ID used by the MAC HW to identify the peer
  7246. */
  7247. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  7248. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  7249. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  7250. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  7251. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  7252. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  7253. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  7254. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  7255. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  7256. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  7257. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  7258. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  7259. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  7260. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  7261. do { \
  7262. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  7263. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  7264. } while (0)
  7265. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  7266. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  7267. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  7268. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  7269. do { \
  7270. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  7271. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  7272. } while (0)
  7273. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  7274. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  7275. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  7276. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  7277. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  7278. do { \
  7279. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  7280. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  7281. } while (0)
  7282. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  7283. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  7284. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  7285. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  7286. #define HTT_RX_PEER_MAP_BYTES 12
  7287. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  7288. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  7289. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  7290. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  7291. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  7292. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  7293. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  7294. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  7295. #define HTT_RX_PEER_UNMAP_BYTES 4
  7296. /**
  7297. * @brief target -> host rx peer map V2 message definition
  7298. *
  7299. * @details
  7300. * The following diagram shows the format of the rx peer map v2 message sent
  7301. * from the target to the host. This layout assumes the target operates
  7302. * as little-endian.
  7303. *
  7304. * This message always contains a SW peer ID. The main purpose of the
  7305. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  7306. * with, so that the host can use that peer ID to determine which peer
  7307. * transmitted the rx frame. This SW peer ID is sometimes also used for
  7308. * other purposes, such as identifying during tx completions which peer
  7309. * the tx frames in question were transmitted to.
  7310. *
  7311. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  7312. * is used during rx --> tx frame forwarding to identify which peer the
  7313. * frame needs to be forwarded to (i.e. the peer assocated with the
  7314. * Destination MAC Address within the packet), and particularly which vdev
  7315. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  7316. * This DA-based peer ID that is provided for certain rx frames
  7317. * (the rx frames that need to be re-transmitted as tx frames)
  7318. * is the ID that the HW uses for referring to the peer in question,
  7319. * rather than the peer ID that the SW+FW use to refer to the peer.
  7320. *
  7321. * The HW peer id here is the same meaning as AST_INDEX_0.
  7322. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  7323. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  7324. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  7325. * AST is valid.
  7326. *
  7327. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  7328. * |-----------------------------------------------------------------------|
  7329. * | SW peer ID | VDEV ID | msg type |
  7330. * |-----------------------------------------------------------------------|
  7331. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7332. * |-----------------------------------------------------------------------|
  7333. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  7334. * |-----------------------------------------------------------------------|
  7335. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  7336. * |-----------------------------------------------------------------------|
  7337. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  7338. * |-----------------------------------------------------------------------|
  7339. * |TID valid low pri| TID valid hi pri| AST index 2 |
  7340. * |-----------------------------------------------------------------------|
  7341. * | Reserved_1 | AST index 3 |
  7342. * |-----------------------------------------------------------------------|
  7343. * | Reserved_2 |
  7344. * |-----------------------------------------------------------------------|
  7345. * Where:
  7346. * NH = Next Hop
  7347. * ASTVM = AST valid mask
  7348. * ASTFM = AST flow mask
  7349. *
  7350. * The following field definitions describe the format of the rx peer map v2
  7351. * messages sent from the target to the host.
  7352. * - MSG_TYPE
  7353. * Bits 7:0
  7354. * Purpose: identifies this as an rx peer map v2 message
  7355. * Value: peer map v2 -> 0x1e
  7356. * - VDEV_ID
  7357. * Bits 15:8
  7358. * Purpose: Indicates which virtual device the peer is associated with.
  7359. * Value: vdev ID (used in the host to look up the vdev object)
  7360. * - SW_PEER_ID
  7361. * Bits 31:16
  7362. * Purpose: The peer ID (index) that WAL is allocating
  7363. * Value: (rx) peer ID
  7364. * - MAC_ADDR_L32
  7365. * Bits 31:0
  7366. * Purpose: Identifies which peer node the peer ID is for.
  7367. * Value: lower 4 bytes of peer node's MAC address
  7368. * - MAC_ADDR_U16
  7369. * Bits 15:0
  7370. * Purpose: Identifies which peer node the peer ID is for.
  7371. * Value: upper 2 bytes of peer node's MAC address
  7372. * - HW_PEER_ID / AST_INDEX_0
  7373. * Bits 31:16
  7374. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  7375. * address, so for rx frames marked for rx --> tx forwarding, the
  7376. * host can determine from the HW peer ID provided as meta-data with
  7377. * the rx frame which peer the frame is supposed to be forwarded to.
  7378. * Value: ID used by the MAC HW to identify the peer
  7379. * - AST_HASH_VALUE
  7380. * Bits 15:0
  7381. * Purpose: Indicates AST Hash value is required for the TCL AST index
  7382. * override feature.
  7383. * - NEXT_HOP
  7384. * Bit 16
  7385. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  7386. * (Wireless Distribution System).
  7387. * - AST_VALID_MASK
  7388. * Bits 19:17
  7389. * Purpose: Indicate if the AST 1 through AST 3 are valid
  7390. * - AST_INDEX_1
  7391. * Bits 15:0
  7392. * Purpose: indicate the second AST index for this peer
  7393. * - AST_0_FLOW_MASK
  7394. * Bits 19:16
  7395. * Purpose: identify the which flow the AST 0 entry corresponds to.
  7396. * - AST_1_FLOW_MASK
  7397. * Bits 23:20
  7398. * Purpose: identify the which flow the AST 1 entry corresponds to.
  7399. * - AST_2_FLOW_MASK
  7400. * Bits 27:24
  7401. * Purpose: identify the which flow the AST 2 entry corresponds to.
  7402. * - AST_3_FLOW_MASK
  7403. * Bits 31:28
  7404. * Purpose: identify the which flow the AST 3 entry corresponds to.
  7405. * - AST_INDEX_2
  7406. * Bits 15:0
  7407. * Purpose: indicate the third AST index for this peer
  7408. * - TID_VALID_HI_PRI
  7409. * Bits 23:16
  7410. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  7411. * - TID_VALID_LOW_PRI
  7412. * Bits 31:24
  7413. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  7414. * - AST_INDEX_3
  7415. * Bits 15:0
  7416. * Purpose: indicate the fourth AST index for this peer
  7417. */
  7418. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  7419. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  7420. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  7421. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  7422. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  7423. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  7424. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  7425. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  7426. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  7427. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  7428. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  7429. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  7430. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  7431. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  7432. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  7433. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  7434. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  7435. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  7436. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  7437. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  7438. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  7439. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  7440. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  7441. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  7442. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  7443. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  7444. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  7445. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  7446. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  7447. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  7448. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  7449. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  7450. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  7451. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  7452. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  7453. do { \
  7454. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  7455. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  7456. } while (0)
  7457. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  7458. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  7459. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  7460. do { \
  7461. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  7462. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  7463. } while (0)
  7464. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  7465. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  7466. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  7467. do { \
  7468. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  7469. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  7470. } while (0)
  7471. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  7472. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  7473. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  7474. do { \
  7475. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  7476. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  7477. } while (0)
  7478. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  7479. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  7480. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  7481. do { \
  7482. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  7483. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  7484. } while (0)
  7485. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  7486. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  7487. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  7488. do { \
  7489. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  7490. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  7491. } while (0)
  7492. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  7493. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  7494. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  7495. do { \
  7496. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  7497. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  7498. } while (0)
  7499. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  7500. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  7501. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  7502. do { \
  7503. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  7504. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  7505. } while (0)
  7506. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  7507. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  7508. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  7509. do { \
  7510. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  7511. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  7512. } while (0)
  7513. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  7514. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  7515. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  7516. do { \
  7517. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  7518. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  7519. } while (0)
  7520. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  7521. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  7522. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  7523. do { \
  7524. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  7525. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  7526. } while (0)
  7527. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  7528. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  7529. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  7530. do { \
  7531. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  7532. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  7533. } while (0)
  7534. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  7535. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  7536. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  7537. do { \
  7538. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  7539. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  7540. } while (0)
  7541. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  7542. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  7543. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  7544. do { \
  7545. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  7546. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  7547. } while (0)
  7548. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  7549. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  7550. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  7551. do { \
  7552. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  7553. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  7554. } while (0)
  7555. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  7556. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  7557. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7558. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  7559. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  7560. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  7561. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  7562. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  7563. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  7564. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  7565. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  7566. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  7567. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  7568. #define HTT_RX_PEER_MAP_V2_BYTES 32
  7569. /**
  7570. * @brief target -> host rx peer unmap V2 message definition
  7571. *
  7572. *
  7573. * The following diagram shows the format of the rx peer unmap message sent
  7574. * from the target to the host.
  7575. *
  7576. * |31 24|23 16|15 8|7 0|
  7577. * |-----------------------------------------------------------------------|
  7578. * | SW peer ID | VDEV ID | msg type |
  7579. * |-----------------------------------------------------------------------|
  7580. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7581. * |-----------------------------------------------------------------------|
  7582. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  7583. * |-----------------------------------------------------------------------|
  7584. * | Peer Delete Duration |
  7585. * |-----------------------------------------------------------------------|
  7586. * | Reserved_0 |
  7587. * |-----------------------------------------------------------------------|
  7588. * | Reserved_1 |
  7589. * |-----------------------------------------------------------------------|
  7590. * | Reserved_2 |
  7591. * |-----------------------------------------------------------------------|
  7592. *
  7593. *
  7594. * The following field definitions describe the format of the rx peer unmap
  7595. * messages sent from the target to the host.
  7596. * - MSG_TYPE
  7597. * Bits 7:0
  7598. * Purpose: identifies this as an rx peer unmap v2 message
  7599. * Value: peer unmap v2 -> 0x1f
  7600. * - VDEV_ID
  7601. * Bits 15:8
  7602. * Purpose: Indicates which virtual device the peer is associated
  7603. * with.
  7604. * Value: vdev ID (used in the host to look up the vdev object)
  7605. * - SW_PEER_ID
  7606. * Bits 31:16
  7607. * Purpose: The peer ID (index) that WAL is freeing
  7608. * Value: (rx) peer ID
  7609. * - MAC_ADDR_L32
  7610. * Bits 31:0
  7611. * Purpose: Identifies which peer node the peer ID is for.
  7612. * Value: lower 4 bytes of peer node's MAC address
  7613. * - MAC_ADDR_U16
  7614. * Bits 15:0
  7615. * Purpose: Identifies which peer node the peer ID is for.
  7616. * Value: upper 2 bytes of peer node's MAC address
  7617. * - NEXT_HOP
  7618. * Bits 16
  7619. * Purpose: Bit indicates next_hop AST entry used for WDS
  7620. * (Wireless Distribution System).
  7621. * - PEER_DELETE_DURATION
  7622. * Bits 31:0
  7623. * Purpose: Time taken to delete peer, in msec,
  7624. * Used for monitoring / debugging PEER delete response delay
  7625. */
  7626. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  7627. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  7628. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  7629. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  7630. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  7631. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  7632. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  7633. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  7634. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  7635. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  7636. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  7637. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  7638. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  7639. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  7640. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  7641. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  7642. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  7643. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  7644. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  7645. do { \
  7646. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  7647. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  7648. } while (0)
  7649. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  7650. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  7651. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  7652. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  7653. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  7654. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  7655. /**
  7656. * @brief target -> host message specifying security parameters
  7657. *
  7658. * @details
  7659. * The following diagram shows the format of the security specification
  7660. * message sent from the target to the host.
  7661. * This security specification message tells the host whether a PN check is
  7662. * necessary on rx data frames, and if so, how large the PN counter is.
  7663. * This message also tells the host about the security processing to apply
  7664. * to defragmented rx frames - specifically, whether a Message Integrity
  7665. * Check is required, and the Michael key to use.
  7666. *
  7667. * |31 24|23 16|15|14 8|7 0|
  7668. * |-----------------------------------------------------------------------|
  7669. * | peer ID | U| security type | msg type |
  7670. * |-----------------------------------------------------------------------|
  7671. * | Michael Key K0 |
  7672. * |-----------------------------------------------------------------------|
  7673. * | Michael Key K1 |
  7674. * |-----------------------------------------------------------------------|
  7675. * | WAPI RSC Low0 |
  7676. * |-----------------------------------------------------------------------|
  7677. * | WAPI RSC Low1 |
  7678. * |-----------------------------------------------------------------------|
  7679. * | WAPI RSC Hi0 |
  7680. * |-----------------------------------------------------------------------|
  7681. * | WAPI RSC Hi1 |
  7682. * |-----------------------------------------------------------------------|
  7683. *
  7684. * The following field definitions describe the format of the security
  7685. * indication message sent from the target to the host.
  7686. * - MSG_TYPE
  7687. * Bits 7:0
  7688. * Purpose: identifies this as a security specification message
  7689. * Value: 0xb
  7690. * - SEC_TYPE
  7691. * Bits 14:8
  7692. * Purpose: specifies which type of security applies to the peer
  7693. * Value: htt_sec_type enum value
  7694. * - UNICAST
  7695. * Bit 15
  7696. * Purpose: whether this security is applied to unicast or multicast data
  7697. * Value: 1 -> unicast, 0 -> multicast
  7698. * - PEER_ID
  7699. * Bits 31:16
  7700. * Purpose: The ID number for the peer the security specification is for
  7701. * Value: peer ID
  7702. * - MICHAEL_KEY_K0
  7703. * Bits 31:0
  7704. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  7705. * Value: Michael Key K0 (if security type is TKIP)
  7706. * - MICHAEL_KEY_K1
  7707. * Bits 31:0
  7708. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  7709. * Value: Michael Key K1 (if security type is TKIP)
  7710. * - WAPI_RSC_LOW0
  7711. * Bits 31:0
  7712. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  7713. * Value: WAPI RSC Low0 (if security type is WAPI)
  7714. * - WAPI_RSC_LOW1
  7715. * Bits 31:0
  7716. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  7717. * Value: WAPI RSC Low1 (if security type is WAPI)
  7718. * - WAPI_RSC_HI0
  7719. * Bits 31:0
  7720. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  7721. * Value: WAPI RSC Hi0 (if security type is WAPI)
  7722. * - WAPI_RSC_HI1
  7723. * Bits 31:0
  7724. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  7725. * Value: WAPI RSC Hi1 (if security type is WAPI)
  7726. */
  7727. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  7728. #define HTT_SEC_IND_SEC_TYPE_S 8
  7729. #define HTT_SEC_IND_UNICAST_M 0x00008000
  7730. #define HTT_SEC_IND_UNICAST_S 15
  7731. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  7732. #define HTT_SEC_IND_PEER_ID_S 16
  7733. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  7734. do { \
  7735. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  7736. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  7737. } while (0)
  7738. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  7739. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  7740. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  7741. do { \
  7742. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  7743. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  7744. } while (0)
  7745. #define HTT_SEC_IND_UNICAST_GET(word) \
  7746. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  7747. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  7748. do { \
  7749. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  7750. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  7751. } while (0)
  7752. #define HTT_SEC_IND_PEER_ID_GET(word) \
  7753. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  7754. #define HTT_SEC_IND_BYTES 28
  7755. /**
  7756. * @brief target -> host rx ADDBA / DELBA message definitions
  7757. *
  7758. * @details
  7759. * The following diagram shows the format of the rx ADDBA message sent
  7760. * from the target to the host:
  7761. *
  7762. * |31 20|19 16|15 8|7 0|
  7763. * |---------------------------------------------------------------------|
  7764. * | peer ID | TID | window size | msg type |
  7765. * |---------------------------------------------------------------------|
  7766. *
  7767. * The following diagram shows the format of the rx DELBA message sent
  7768. * from the target to the host:
  7769. *
  7770. * |31 20|19 16|15 10|9 8|7 0|
  7771. * |---------------------------------------------------------------------|
  7772. * | peer ID | TID | reserved | IR| msg type |
  7773. * |---------------------------------------------------------------------|
  7774. *
  7775. * The following field definitions describe the format of the rx ADDBA
  7776. * and DELBA messages sent from the target to the host.
  7777. * - MSG_TYPE
  7778. * Bits 7:0
  7779. * Purpose: identifies this as an rx ADDBA or DELBA message
  7780. * Value: ADDBA -> 0x5, DELBA -> 0x6
  7781. * - IR (initiator / recipient)
  7782. * Bits 9:8 (DELBA only)
  7783. * Purpose: specify whether the DELBA handshake was initiated by the
  7784. * local STA/AP, or by the peer STA/AP
  7785. * Value:
  7786. * 0 - unspecified
  7787. * 1 - initiator (a.k.a. originator)
  7788. * 2 - recipient (a.k.a. responder)
  7789. * 3 - unused / reserved
  7790. * - WIN_SIZE
  7791. * Bits 15:8 (ADDBA only)
  7792. * Purpose: Specifies the length of the block ack window (max = 64).
  7793. * Value:
  7794. * block ack window length specified by the received ADDBA
  7795. * management message.
  7796. * - TID
  7797. * Bits 19:16
  7798. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  7799. * Value:
  7800. * TID specified by the received ADDBA or DELBA management message.
  7801. * - PEER_ID
  7802. * Bits 31:20
  7803. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  7804. * Value:
  7805. * ID (hash value) used by the host for fast, direct lookup of
  7806. * host SW peer info, including rx reorder states.
  7807. */
  7808. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  7809. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  7810. #define HTT_RX_ADDBA_TID_M 0xf0000
  7811. #define HTT_RX_ADDBA_TID_S 16
  7812. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  7813. #define HTT_RX_ADDBA_PEER_ID_S 20
  7814. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  7815. do { \
  7816. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  7817. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  7818. } while (0)
  7819. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  7820. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  7821. #define HTT_RX_ADDBA_TID_SET(word, value) \
  7822. do { \
  7823. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  7824. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  7825. } while (0)
  7826. #define HTT_RX_ADDBA_TID_GET(word) \
  7827. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  7828. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  7829. do { \
  7830. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  7831. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  7832. } while (0)
  7833. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  7834. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  7835. #define HTT_RX_ADDBA_BYTES 4
  7836. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  7837. #define HTT_RX_DELBA_INITIATOR_S 8
  7838. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  7839. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  7840. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  7841. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  7842. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  7843. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  7844. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  7845. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  7846. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  7847. do { \
  7848. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  7849. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  7850. } while (0)
  7851. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  7852. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  7853. #define HTT_RX_DELBA_BYTES 4
  7854. /**
  7855. * @brief tx queue group information element definition
  7856. *
  7857. * @details
  7858. * The following diagram shows the format of the tx queue group
  7859. * information element, which can be included in target --> host
  7860. * messages to specify the number of tx "credits" (tx descriptors
  7861. * for LL, or tx buffers for HL) available to a particular group
  7862. * of host-side tx queues, and which host-side tx queues belong to
  7863. * the group.
  7864. *
  7865. * |31|30 24|23 16|15|14|13 0|
  7866. * |------------------------------------------------------------------------|
  7867. * | X| reserved | tx queue grp ID | A| S| credit count |
  7868. * |------------------------------------------------------------------------|
  7869. * | vdev ID mask | AC mask |
  7870. * |------------------------------------------------------------------------|
  7871. *
  7872. * The following definitions describe the fields within the tx queue group
  7873. * information element:
  7874. * - credit_count
  7875. * Bits 13:1
  7876. * Purpose: specify how many tx credits are available to the tx queue group
  7877. * Value: An absolute or relative, positive or negative credit value
  7878. * The 'A' bit specifies whether the value is absolute or relative.
  7879. * The 'S' bit specifies whether the value is positive or negative.
  7880. * A negative value can only be relative, not absolute.
  7881. * An absolute value replaces any prior credit value the host has for
  7882. * the tx queue group in question.
  7883. * A relative value is added to the prior credit value the host has for
  7884. * the tx queue group in question.
  7885. * - sign
  7886. * Bit 14
  7887. * Purpose: specify whether the credit count is positive or negative
  7888. * Value: 0 -> positive, 1 -> negative
  7889. * - absolute
  7890. * Bit 15
  7891. * Purpose: specify whether the credit count is absolute or relative
  7892. * Value: 0 -> relative, 1 -> absolute
  7893. * - txq_group_id
  7894. * Bits 23:16
  7895. * Purpose: indicate which tx queue group's credit and/or membership are
  7896. * being specified
  7897. * Value: 0 to max_tx_queue_groups-1
  7898. * - reserved
  7899. * Bits 30:16
  7900. * Value: 0x0
  7901. * - eXtension
  7902. * Bit 31
  7903. * Purpose: specify whether another tx queue group info element follows
  7904. * Value: 0 -> no more tx queue group information elements
  7905. * 1 -> another tx queue group information element immediately follows
  7906. * - ac_mask
  7907. * Bits 15:0
  7908. * Purpose: specify which Access Categories belong to the tx queue group
  7909. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  7910. * the tx queue group.
  7911. * The AC bit-mask values are obtained by left-shifting by the
  7912. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  7913. * - vdev_id_mask
  7914. * Bits 31:16
  7915. * Purpose: specify which vdev's tx queues belong to the tx queue group
  7916. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  7917. * belong to the tx queue group.
  7918. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  7919. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  7920. */
  7921. PREPACK struct htt_txq_group {
  7922. A_UINT32
  7923. credit_count: 14,
  7924. sign: 1,
  7925. absolute: 1,
  7926. tx_queue_group_id: 8,
  7927. reserved0: 7,
  7928. extension: 1;
  7929. A_UINT32
  7930. ac_mask: 16,
  7931. vdev_id_mask: 16;
  7932. } POSTPACK;
  7933. /* first word */
  7934. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  7935. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  7936. #define HTT_TXQ_GROUP_SIGN_S 14
  7937. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  7938. #define HTT_TXQ_GROUP_ABS_S 15
  7939. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  7940. #define HTT_TXQ_GROUP_ID_S 16
  7941. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  7942. #define HTT_TXQ_GROUP_EXT_S 31
  7943. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  7944. /* second word */
  7945. #define HTT_TXQ_GROUP_AC_MASK_S 0
  7946. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  7947. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  7948. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  7949. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  7950. do { \
  7951. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  7952. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  7953. } while (0)
  7954. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  7955. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  7956. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  7957. do { \
  7958. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  7959. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  7960. } while (0)
  7961. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  7962. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  7963. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  7964. do { \
  7965. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  7966. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  7967. } while (0)
  7968. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  7969. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  7970. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  7971. do { \
  7972. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  7973. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  7974. } while (0)
  7975. #define HTT_TXQ_GROUP_ID_GET(_info) \
  7976. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  7977. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  7978. do { \
  7979. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  7980. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  7981. } while (0)
  7982. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  7983. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  7984. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  7985. do { \
  7986. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  7987. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  7988. } while (0)
  7989. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  7990. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  7991. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  7992. do { \
  7993. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  7994. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  7995. } while (0)
  7996. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  7997. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  7998. /**
  7999. * @brief target -> host TX completion indication message definition
  8000. *
  8001. * @details
  8002. * The following diagram shows the format of the TX completion indication sent
  8003. * from the target to the host
  8004. *
  8005. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  8006. * |-------------------------------------------------------------------|
  8007. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  8008. * |-------------------------------------------------------------------|
  8009. * payload:| MSDU1 ID | MSDU0 ID |
  8010. * |-------------------------------------------------------------------|
  8011. * : MSDU3 ID | MSDU2 ID :
  8012. * |-------------------------------------------------------------------|
  8013. * | struct htt_tx_compl_ind_append_retries |
  8014. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8015. * | struct htt_tx_compl_ind_append_tx_tstamp |
  8016. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8017. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  8018. * |-------------------------------------------------------------------|
  8019. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  8020. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8021. * | MSDU0 tx_tsf64_low |
  8022. * |-------------------------------------------------------------------|
  8023. * | MSDU0 tx_tsf64_high |
  8024. * |-------------------------------------------------------------------|
  8025. * | MSDU1 tx_tsf64_low |
  8026. * |-------------------------------------------------------------------|
  8027. * | MSDU1 tx_tsf64_high |
  8028. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8029. * | phy_timestamp |
  8030. * |-------------------------------------------------------------------|
  8031. * | rate specs (see below) |
  8032. * |-------------------------------------------------------------------|
  8033. * | seqctrl | framectrl |
  8034. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  8035. * Where:
  8036. * A0 = append (a.k.a. append0)
  8037. * A1 = append1
  8038. * TP = MSDU tx power presence
  8039. * A2 = append2
  8040. * A3 = append3
  8041. * A4 = append4
  8042. *
  8043. * The following field definitions describe the format of the TX completion
  8044. * indication sent from the target to the host
  8045. * Header fields:
  8046. * - msg_type
  8047. * Bits 7:0
  8048. * Purpose: identifies this as HTT TX completion indication
  8049. * Value: 0x7
  8050. * - status
  8051. * Bits 10:8
  8052. * Purpose: the TX completion status of payload fragmentations descriptors
  8053. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  8054. * - tid
  8055. * Bits 14:11
  8056. * Purpose: the tid associated with those fragmentation descriptors. It is
  8057. * valid or not, depending on the tid_invalid bit.
  8058. * Value: 0 to 15
  8059. * - tid_invalid
  8060. * Bits 15:15
  8061. * Purpose: this bit indicates whether the tid field is valid or not
  8062. * Value: 0 indicates valid; 1 indicates invalid
  8063. * - num
  8064. * Bits 23:16
  8065. * Purpose: the number of payload in this indication
  8066. * Value: 1 to 255
  8067. * - append (a.k.a. append0)
  8068. * Bits 24:24
  8069. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  8070. * the number of tx retries for one MSDU at the end of this message
  8071. * Value: 0 indicates no appending; 1 indicates appending
  8072. * - append1
  8073. * Bits 25:25
  8074. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  8075. * contains the timestamp info for each TX msdu id in payload.
  8076. * The order of the timestamps matches the order of the MSDU IDs.
  8077. * Note that a big-endian host needs to account for the reordering
  8078. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8079. * conversion) when determining which tx timestamp corresponds to
  8080. * which MSDU ID.
  8081. * Value: 0 indicates no appending; 1 indicates appending
  8082. * - msdu_tx_power_presence
  8083. * Bits 26:26
  8084. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  8085. * for each MSDU referenced by the TX_COMPL_IND message.
  8086. * The tx power is reported in 0.5 dBm units.
  8087. * The order of the per-MSDU tx power reports matches the order
  8088. * of the MSDU IDs.
  8089. * Note that a big-endian host needs to account for the reordering
  8090. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  8091. * conversion) when determining which Tx Power corresponds to
  8092. * which MSDU ID.
  8093. * Value: 0 indicates MSDU tx power reports are not appended,
  8094. * 1 indicates MSDU tx power reports are appended
  8095. * - append2
  8096. * Bits 27:27
  8097. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  8098. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  8099. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  8100. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  8101. * for each MSDU, for convenience.
  8102. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  8103. * this append2 bit is set).
  8104. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  8105. * dB above the noise floor.
  8106. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  8107. * 1 indicates MSDU ACK RSSI values are appended.
  8108. * - append3
  8109. * Bits 28:28
  8110. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  8111. * contains the tx tsf info based on wlan global TSF for
  8112. * each TX msdu id in payload.
  8113. * The order of the tx tsf matches the order of the MSDU IDs.
  8114. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  8115. * values to indicate the the lower 32 bits and higher 32 bits of
  8116. * the tx tsf.
  8117. * The tx_tsf64 here represents the time MSDU was acked and the
  8118. * tx_tsf64 has microseconds units.
  8119. * Value: 0 indicates no appending; 1 indicates appending
  8120. * - append4
  8121. * Bits 29:29
  8122. * Purpose: Indicate whether data frame control fields and fields required
  8123. * for radio tap header are appended for each MSDU in TX_COMP_IND
  8124. * message. The order of the this message matches the order of
  8125. * the MSDU IDs.
  8126. * Value: 0 indicates frame control fields and fields required for
  8127. * radio tap header values are not appended,
  8128. * 1 indicates frame control fields and fields required for
  8129. * radio tap header values are appended.
  8130. * Payload fields:
  8131. * - hmsdu_id
  8132. * Bits 15:0
  8133. * Purpose: this ID is used to track the Tx buffer in host
  8134. * Value: 0 to "size of host MSDU descriptor pool - 1"
  8135. */
  8136. PREPACK struct htt_tx_data_hdr_information {
  8137. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  8138. A_UINT32 /* word 1 */
  8139. /* preamble:
  8140. * 0-OFDM,
  8141. * 1-CCk,
  8142. * 2-HT,
  8143. * 3-VHT
  8144. */
  8145. preamble: 2, /* [1:0] */
  8146. /* mcs:
  8147. * In case of HT preamble interpret
  8148. * MCS along with NSS.
  8149. * Valid values for HT are 0 to 7.
  8150. * HT mcs 0 with NSS 2 is mcs 8.
  8151. * Valid values for VHT are 0 to 9.
  8152. */
  8153. mcs: 4, /* [5:2] */
  8154. /* rate:
  8155. * This is applicable only for
  8156. * CCK and OFDM preamble type
  8157. * rate 0: OFDM 48 Mbps,
  8158. * 1: OFDM 24 Mbps,
  8159. * 2: OFDM 12 Mbps
  8160. * 3: OFDM 6 Mbps
  8161. * 4: OFDM 54 Mbps
  8162. * 5: OFDM 36 Mbps
  8163. * 6: OFDM 18 Mbps
  8164. * 7: OFDM 9 Mbps
  8165. * rate 0: CCK 11 Mbps Long
  8166. * 1: CCK 5.5 Mbps Long
  8167. * 2: CCK 2 Mbps Long
  8168. * 3: CCK 1 Mbps Long
  8169. * 4: CCK 11 Mbps Short
  8170. * 5: CCK 5.5 Mbps Short
  8171. * 6: CCK 2 Mbps Short
  8172. */
  8173. rate : 3, /* [ 8: 6] */
  8174. rssi : 8, /* [16: 9] units=dBm */
  8175. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8176. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8177. stbc : 1, /* [22] */
  8178. sgi : 1, /* [23] */
  8179. ldpc : 1, /* [24] */
  8180. beamformed: 1, /* [25] */
  8181. reserved_1: 6; /* [31:26] */
  8182. A_UINT32 /* word 2 */
  8183. framectrl:16, /* [15: 0] */
  8184. seqno:16; /* [31:16] */
  8185. } POSTPACK;
  8186. #define HTT_TX_COMPL_IND_STATUS_S 8
  8187. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  8188. #define HTT_TX_COMPL_IND_TID_S 11
  8189. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  8190. #define HTT_TX_COMPL_IND_TID_INV_S 15
  8191. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  8192. #define HTT_TX_COMPL_IND_NUM_S 16
  8193. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  8194. #define HTT_TX_COMPL_IND_APPEND_S 24
  8195. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  8196. #define HTT_TX_COMPL_IND_APPEND1_S 25
  8197. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  8198. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  8199. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  8200. #define HTT_TX_COMPL_IND_APPEND2_S 27
  8201. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  8202. #define HTT_TX_COMPL_IND_APPEND3_S 28
  8203. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  8204. #define HTT_TX_COMPL_IND_APPEND4_S 29
  8205. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  8206. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  8207. do { \
  8208. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  8209. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  8210. } while (0)
  8211. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  8212. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  8213. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  8214. do { \
  8215. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  8216. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  8217. } while (0)
  8218. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  8219. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  8220. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  8221. do { \
  8222. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  8223. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  8224. } while (0)
  8225. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  8226. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  8227. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  8228. do { \
  8229. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  8230. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  8231. } while (0)
  8232. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  8233. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  8234. HTT_TX_COMPL_IND_TID_INV_S)
  8235. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  8236. do { \
  8237. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  8238. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  8239. } while (0)
  8240. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  8241. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  8242. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  8243. do { \
  8244. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  8245. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  8246. } while (0)
  8247. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  8248. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  8249. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  8250. do { \
  8251. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  8252. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  8253. } while (0)
  8254. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  8255. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  8256. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  8257. do { \
  8258. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  8259. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  8260. } while (0)
  8261. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  8262. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  8263. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  8264. do { \
  8265. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  8266. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  8267. } while (0)
  8268. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  8269. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  8270. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  8271. do { \
  8272. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  8273. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  8274. } while (0)
  8275. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  8276. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  8277. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  8278. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  8279. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  8280. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  8281. #define HTT_TX_COMPL_IND_STAT_OK 0
  8282. /* DISCARD:
  8283. * current meaning:
  8284. * MSDUs were queued for transmission but filtered by HW or SW
  8285. * without any over the air attempts
  8286. * legacy meaning (HL Rome):
  8287. * MSDUs were discarded by the target FW without any over the air
  8288. * attempts due to lack of space
  8289. */
  8290. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  8291. /* NO_ACK:
  8292. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  8293. */
  8294. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  8295. /* POSTPONE:
  8296. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  8297. * be downloaded again later (in the appropriate order), when they are
  8298. * deliverable.
  8299. */
  8300. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  8301. /*
  8302. * The PEER_DEL tx completion status is used for HL cases
  8303. * where the peer the frame is for has been deleted.
  8304. * The host has already discarded its copy of the frame, but
  8305. * it still needs the tx completion to restore its credit.
  8306. */
  8307. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  8308. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  8309. #define HTT_TX_COMPL_IND_STAT_DROP 5
  8310. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  8311. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  8312. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  8313. PREPACK struct htt_tx_compl_ind_base {
  8314. A_UINT32 hdr;
  8315. A_UINT16 payload[1/*or more*/];
  8316. } POSTPACK;
  8317. PREPACK struct htt_tx_compl_ind_append_retries {
  8318. A_UINT16 msdu_id;
  8319. A_UINT8 tx_retries;
  8320. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  8321. 0: this is the last append_retries struct */
  8322. } POSTPACK;
  8323. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  8324. A_UINT32 timestamp[1/*or more*/];
  8325. } POSTPACK;
  8326. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  8327. A_UINT32 tx_tsf64_low;
  8328. A_UINT32 tx_tsf64_high;
  8329. } POSTPACK;
  8330. /* htt_tx_data_hdr_information payload extension fields: */
  8331. /* DWORD zero */
  8332. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  8333. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  8334. /* DWORD one */
  8335. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  8336. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  8337. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  8338. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  8339. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  8340. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  8341. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  8342. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  8343. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  8344. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  8345. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  8346. #define HTT_FW_TX_DATA_HDR_BW_S 19
  8347. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  8348. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  8349. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  8350. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  8351. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  8352. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  8353. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  8354. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  8355. /* DWORD two */
  8356. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  8357. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  8358. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  8359. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  8360. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  8361. do { \
  8362. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  8363. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  8364. } while (0)
  8365. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  8366. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  8367. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  8368. do { \
  8369. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  8370. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  8371. } while (0)
  8372. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  8373. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  8374. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  8375. do { \
  8376. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  8377. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  8378. } while (0)
  8379. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  8380. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  8381. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  8382. do { \
  8383. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  8384. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  8385. } while (0)
  8386. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  8387. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  8388. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  8389. do { \
  8390. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  8391. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  8392. } while (0)
  8393. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  8394. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  8395. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  8396. do { \
  8397. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  8398. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  8399. } while (0)
  8400. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  8401. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  8402. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  8403. do { \
  8404. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  8405. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  8406. } while (0)
  8407. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  8408. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  8409. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  8410. do { \
  8411. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  8412. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  8413. } while (0)
  8414. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  8415. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  8416. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  8417. do { \
  8418. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  8419. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  8420. } while (0)
  8421. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  8422. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  8423. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  8424. do { \
  8425. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  8426. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  8427. } while (0)
  8428. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  8429. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  8430. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  8431. do { \
  8432. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  8433. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  8434. } while (0)
  8435. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  8436. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  8437. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  8438. do { \
  8439. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  8440. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  8441. } while (0)
  8442. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  8443. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  8444. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  8445. do { \
  8446. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  8447. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  8448. } while (0)
  8449. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  8450. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  8451. /**
  8452. * @brief target -> host rate-control update indication message
  8453. *
  8454. * @details
  8455. * The following diagram shows the format of the RC Update message
  8456. * sent from the target to the host, while processing the tx-completion
  8457. * of a transmitted PPDU.
  8458. *
  8459. * |31 24|23 16|15 8|7 0|
  8460. * |-------------------------------------------------------------|
  8461. * | peer ID | vdev ID | msg_type |
  8462. * |-------------------------------------------------------------|
  8463. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8464. * |-------------------------------------------------------------|
  8465. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  8466. * |-------------------------------------------------------------|
  8467. * | : |
  8468. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8469. * | : |
  8470. * |-------------------------------------------------------------|
  8471. * | : |
  8472. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  8473. * | : |
  8474. * |-------------------------------------------------------------|
  8475. * : :
  8476. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8477. *
  8478. */
  8479. typedef struct {
  8480. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  8481. A_UINT32 rate_code_flags;
  8482. A_UINT32 flags; /* Encodes information such as excessive
  8483. retransmission, aggregate, some info
  8484. from .11 frame control,
  8485. STBC, LDPC, (SGI and Tx Chain Mask
  8486. are encoded in ptx_rc->flags field),
  8487. AMPDU truncation (BT/time based etc.),
  8488. RTS/CTS attempt */
  8489. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  8490. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  8491. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  8492. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  8493. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  8494. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  8495. } HTT_RC_TX_DONE_PARAMS;
  8496. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  8497. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  8498. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  8499. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  8500. #define HTT_RC_UPDATE_VDEVID_S 8
  8501. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  8502. #define HTT_RC_UPDATE_PEERID_S 16
  8503. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  8504. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  8505. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  8506. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  8507. do { \
  8508. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  8509. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  8510. } while (0)
  8511. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  8512. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  8513. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  8514. do { \
  8515. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  8516. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  8517. } while (0)
  8518. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  8519. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  8520. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  8521. do { \
  8522. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  8523. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  8524. } while (0)
  8525. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  8526. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  8527. /**
  8528. * @brief target -> host rx fragment indication message definition
  8529. *
  8530. * @details
  8531. * The following field definitions describe the format of the rx fragment
  8532. * indication message sent from the target to the host.
  8533. * The rx fragment indication message shares the format of the
  8534. * rx indication message, but not all fields from the rx indication message
  8535. * are relevant to the rx fragment indication message.
  8536. *
  8537. *
  8538. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8539. * |-----------+-------------------+---------------------+-------------|
  8540. * | peer ID | |FV| ext TID | msg type |
  8541. * |-------------------------------------------------------------------|
  8542. * | | flush | flush |
  8543. * | | end | start |
  8544. * | | seq num | seq num |
  8545. * |-------------------------------------------------------------------|
  8546. * | reserved | FW rx desc bytes |
  8547. * |-------------------------------------------------------------------|
  8548. * | | FW MSDU Rx |
  8549. * | | desc B0 |
  8550. * |-------------------------------------------------------------------|
  8551. * Header fields:
  8552. * - MSG_TYPE
  8553. * Bits 7:0
  8554. * Purpose: identifies this as an rx fragment indication message
  8555. * Value: 0xa
  8556. * - EXT_TID
  8557. * Bits 12:8
  8558. * Purpose: identify the traffic ID of the rx data, including
  8559. * special "extended" TID values for multicast, broadcast, and
  8560. * non-QoS data frames
  8561. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8562. * - FLUSH_VALID (FV)
  8563. * Bit 13
  8564. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8565. * is valid
  8566. * Value:
  8567. * 1 -> flush IE is valid and needs to be processed
  8568. * 0 -> flush IE is not valid and should be ignored
  8569. * - PEER_ID
  8570. * Bits 31:16
  8571. * Purpose: Identify, by ID, which peer sent the rx data
  8572. * Value: ID of the peer who sent the rx data
  8573. * - FLUSH_SEQ_NUM_START
  8574. * Bits 5:0
  8575. * Purpose: Indicate the start of a series of MPDUs to flush
  8576. * Not all MPDUs within this series are necessarily valid - the host
  8577. * must check each sequence number within this range to see if the
  8578. * corresponding MPDU is actually present.
  8579. * This field is only valid if the FV bit is set.
  8580. * Value:
  8581. * The sequence number for the first MPDUs to check to flush.
  8582. * The sequence number is masked by 0x3f.
  8583. * - FLUSH_SEQ_NUM_END
  8584. * Bits 11:6
  8585. * Purpose: Indicate the end of a series of MPDUs to flush
  8586. * Value:
  8587. * The sequence number one larger than the sequence number of the
  8588. * last MPDU to check to flush.
  8589. * The sequence number is masked by 0x3f.
  8590. * Not all MPDUs within this series are necessarily valid - the host
  8591. * must check each sequence number within this range to see if the
  8592. * corresponding MPDU is actually present.
  8593. * This field is only valid if the FV bit is set.
  8594. * Rx descriptor fields:
  8595. * - FW_RX_DESC_BYTES
  8596. * Bits 15:0
  8597. * Purpose: Indicate how many bytes in the Rx indication are used for
  8598. * FW Rx descriptors
  8599. * Value: 1
  8600. */
  8601. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  8602. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  8603. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  8604. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  8605. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  8606. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  8607. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  8608. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  8609. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  8610. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  8611. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  8612. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  8613. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  8614. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  8615. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  8616. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  8617. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  8618. #define HTT_RX_FRAG_IND_BYTES \
  8619. (4 /* msg hdr */ + \
  8620. 4 /* flush spec */ + \
  8621. 4 /* (unused) FW rx desc bytes spec */ + \
  8622. 4 /* FW rx desc */)
  8623. /**
  8624. * @brief target -> host test message definition
  8625. *
  8626. * @details
  8627. * The following field definitions describe the format of the test
  8628. * message sent from the target to the host.
  8629. * The message consists of a 4-octet header, followed by a variable
  8630. * number of 32-bit integer values, followed by a variable number
  8631. * of 8-bit character values.
  8632. *
  8633. * |31 16|15 8|7 0|
  8634. * |-----------------------------------------------------------|
  8635. * | num chars | num ints | msg type |
  8636. * |-----------------------------------------------------------|
  8637. * | int 0 |
  8638. * |-----------------------------------------------------------|
  8639. * | int 1 |
  8640. * |-----------------------------------------------------------|
  8641. * | ... |
  8642. * |-----------------------------------------------------------|
  8643. * | char 3 | char 2 | char 1 | char 0 |
  8644. * |-----------------------------------------------------------|
  8645. * | | | ... | char 4 |
  8646. * |-----------------------------------------------------------|
  8647. * - MSG_TYPE
  8648. * Bits 7:0
  8649. * Purpose: identifies this as a test message
  8650. * Value: HTT_MSG_TYPE_TEST
  8651. * - NUM_INTS
  8652. * Bits 15:8
  8653. * Purpose: indicate how many 32-bit integers follow the message header
  8654. * - NUM_CHARS
  8655. * Bits 31:16
  8656. * Purpose: indicate how many 8-bit charaters follow the series of integers
  8657. */
  8658. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  8659. #define HTT_RX_TEST_NUM_INTS_S 8
  8660. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  8661. #define HTT_RX_TEST_NUM_CHARS_S 16
  8662. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  8663. do { \
  8664. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  8665. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  8666. } while (0)
  8667. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  8668. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  8669. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  8670. do { \
  8671. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  8672. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  8673. } while (0)
  8674. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  8675. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  8676. /**
  8677. * @brief target -> host packet log message
  8678. *
  8679. * @details
  8680. * The following field definitions describe the format of the packet log
  8681. * message sent from the target to the host.
  8682. * The message consists of a 4-octet header,followed by a variable number
  8683. * of 32-bit character values.
  8684. *
  8685. * |31 16|15 12|11 10|9 8|7 0|
  8686. * |------------------------------------------------------------------|
  8687. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  8688. * |------------------------------------------------------------------|
  8689. * | payload |
  8690. * |------------------------------------------------------------------|
  8691. * - MSG_TYPE
  8692. * Bits 7:0
  8693. * Purpose: identifies this as a pktlog message
  8694. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  8695. * - mac_id
  8696. * Bits 9:8
  8697. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  8698. * Value: 0-3
  8699. * - pdev_id
  8700. * Bits 11:10
  8701. * Purpose: pdev_id
  8702. * Value: 0-3
  8703. * 0 (for rings at SOC level),
  8704. * 1/2/3 PDEV -> 0/1/2
  8705. * - payload_size
  8706. * Bits 31:16
  8707. * Purpose: explicitly specify the payload size
  8708. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  8709. */
  8710. PREPACK struct htt_pktlog_msg {
  8711. A_UINT32 header;
  8712. A_UINT32 payload[1/* or more */];
  8713. } POSTPACK;
  8714. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  8715. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  8716. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  8717. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  8718. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  8719. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  8720. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  8721. do { \
  8722. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  8723. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  8724. } while (0)
  8725. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  8726. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  8727. HTT_T2H_PKTLOG_MAC_ID_S)
  8728. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  8729. do { \
  8730. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  8731. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  8732. } while (0)
  8733. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  8734. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  8735. HTT_T2H_PKTLOG_PDEV_ID_S)
  8736. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  8737. do { \
  8738. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  8739. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  8740. } while (0)
  8741. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  8742. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  8743. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  8744. /*
  8745. * Rx reorder statistics
  8746. * NB: all the fields must be defined in 4 octets size.
  8747. */
  8748. struct rx_reorder_stats {
  8749. /* Non QoS MPDUs received */
  8750. A_UINT32 deliver_non_qos;
  8751. /* MPDUs received in-order */
  8752. A_UINT32 deliver_in_order;
  8753. /* Flush due to reorder timer expired */
  8754. A_UINT32 deliver_flush_timeout;
  8755. /* Flush due to move out of window */
  8756. A_UINT32 deliver_flush_oow;
  8757. /* Flush due to DELBA */
  8758. A_UINT32 deliver_flush_delba;
  8759. /* MPDUs dropped due to FCS error */
  8760. A_UINT32 fcs_error;
  8761. /* MPDUs dropped due to monitor mode non-data packet */
  8762. A_UINT32 mgmt_ctrl;
  8763. /* Unicast-data MPDUs dropped due to invalid peer */
  8764. A_UINT32 invalid_peer;
  8765. /* MPDUs dropped due to duplication (non aggregation) */
  8766. A_UINT32 dup_non_aggr;
  8767. /* MPDUs dropped due to processed before */
  8768. A_UINT32 dup_past;
  8769. /* MPDUs dropped due to duplicate in reorder queue */
  8770. A_UINT32 dup_in_reorder;
  8771. /* Reorder timeout happened */
  8772. A_UINT32 reorder_timeout;
  8773. /* invalid bar ssn */
  8774. A_UINT32 invalid_bar_ssn;
  8775. /* reorder reset due to bar ssn */
  8776. A_UINT32 ssn_reset;
  8777. /* Flush due to delete peer */
  8778. A_UINT32 deliver_flush_delpeer;
  8779. /* Flush due to offload*/
  8780. A_UINT32 deliver_flush_offload;
  8781. /* Flush due to out of buffer*/
  8782. A_UINT32 deliver_flush_oob;
  8783. /* MPDUs dropped due to PN check fail */
  8784. A_UINT32 pn_fail;
  8785. /* MPDUs dropped due to unable to allocate memory */
  8786. A_UINT32 store_fail;
  8787. /* Number of times the tid pool alloc succeeded */
  8788. A_UINT32 tid_pool_alloc_succ;
  8789. /* Number of times the MPDU pool alloc succeeded */
  8790. A_UINT32 mpdu_pool_alloc_succ;
  8791. /* Number of times the MSDU pool alloc succeeded */
  8792. A_UINT32 msdu_pool_alloc_succ;
  8793. /* Number of times the tid pool alloc failed */
  8794. A_UINT32 tid_pool_alloc_fail;
  8795. /* Number of times the MPDU pool alloc failed */
  8796. A_UINT32 mpdu_pool_alloc_fail;
  8797. /* Number of times the MSDU pool alloc failed */
  8798. A_UINT32 msdu_pool_alloc_fail;
  8799. /* Number of times the tid pool freed */
  8800. A_UINT32 tid_pool_free;
  8801. /* Number of times the MPDU pool freed */
  8802. A_UINT32 mpdu_pool_free;
  8803. /* Number of times the MSDU pool freed */
  8804. A_UINT32 msdu_pool_free;
  8805. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  8806. A_UINT32 msdu_queued;
  8807. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  8808. A_UINT32 msdu_recycled;
  8809. /* Number of MPDUs with invalid peer but A2 found in AST */
  8810. A_UINT32 invalid_peer_a2_in_ast;
  8811. /* Number of MPDUs with invalid peer but A3 found in AST */
  8812. A_UINT32 invalid_peer_a3_in_ast;
  8813. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  8814. A_UINT32 invalid_peer_bmc_mpdus;
  8815. /* Number of MSDUs with err attention word */
  8816. A_UINT32 rxdesc_err_att;
  8817. /* Number of MSDUs with flag of peer_idx_invalid */
  8818. A_UINT32 rxdesc_err_peer_idx_inv;
  8819. /* Number of MSDUs with flag of peer_idx_timeout */
  8820. A_UINT32 rxdesc_err_peer_idx_to;
  8821. /* Number of MSDUs with flag of overflow */
  8822. A_UINT32 rxdesc_err_ov;
  8823. /* Number of MSDUs with flag of msdu_length_err */
  8824. A_UINT32 rxdesc_err_msdu_len;
  8825. /* Number of MSDUs with flag of mpdu_length_err */
  8826. A_UINT32 rxdesc_err_mpdu_len;
  8827. /* Number of MSDUs with flag of tkip_mic_err */
  8828. A_UINT32 rxdesc_err_tkip_mic;
  8829. /* Number of MSDUs with flag of decrypt_err */
  8830. A_UINT32 rxdesc_err_decrypt;
  8831. /* Number of MSDUs with flag of fcs_err */
  8832. A_UINT32 rxdesc_err_fcs;
  8833. /* Number of Unicast (bc_mc bit is not set in attention word)
  8834. * frames with invalid peer handler
  8835. */
  8836. A_UINT32 rxdesc_uc_msdus_inv_peer;
  8837. /* Number of unicast frame directly (direct bit is set in attention word)
  8838. * to DUT with invalid peer handler
  8839. */
  8840. A_UINT32 rxdesc_direct_msdus_inv_peer;
  8841. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  8842. * frames with invalid peer handler
  8843. */
  8844. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  8845. /* Number of MSDUs dropped due to no first MSDU flag */
  8846. A_UINT32 rxdesc_no_1st_msdu;
  8847. /* Number of MSDUs droped due to ring overflow */
  8848. A_UINT32 msdu_drop_ring_ov;
  8849. /* Number of MSDUs dropped due to FC mismatch */
  8850. A_UINT32 msdu_drop_fc_mismatch;
  8851. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  8852. A_UINT32 msdu_drop_mgmt_remote_ring;
  8853. /* Number of MSDUs dropped due to errors not reported in attention word */
  8854. A_UINT32 msdu_drop_misc;
  8855. /* Number of MSDUs go to offload before reorder */
  8856. A_UINT32 offload_msdu_wal;
  8857. /* Number of data frame dropped by offload after reorder */
  8858. A_UINT32 offload_msdu_reorder;
  8859. /* Number of MPDUs with sequence number in the past and within the BA window */
  8860. A_UINT32 dup_past_within_window;
  8861. /* Number of MPDUs with sequence number in the past and outside the BA window */
  8862. A_UINT32 dup_past_outside_window;
  8863. /* Number of MSDUs with decrypt/MIC error */
  8864. A_UINT32 rxdesc_err_decrypt_mic;
  8865. /* Number of data MSDUs received on both local and remote rings */
  8866. A_UINT32 data_msdus_on_both_rings;
  8867. /* MPDUs never filled */
  8868. A_UINT32 holes_not_filled;
  8869. };
  8870. /*
  8871. * Rx Remote buffer statistics
  8872. * NB: all the fields must be defined in 4 octets size.
  8873. */
  8874. struct rx_remote_buffer_mgmt_stats {
  8875. /* Total number of MSDUs reaped for Rx processing */
  8876. A_UINT32 remote_reaped;
  8877. /* MSDUs recycled within firmware */
  8878. A_UINT32 remote_recycled;
  8879. /* MSDUs stored by Data Rx */
  8880. A_UINT32 data_rx_msdus_stored;
  8881. /* Number of HTT indications from WAL Rx MSDU */
  8882. A_UINT32 wal_rx_ind;
  8883. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  8884. A_UINT32 wal_rx_ind_unconsumed;
  8885. /* Number of HTT indications from Data Rx MSDU */
  8886. A_UINT32 data_rx_ind;
  8887. /* Number of unconsumed HTT indications from Data Rx MSDU */
  8888. A_UINT32 data_rx_ind_unconsumed;
  8889. /* Number of HTT indications from ATHBUF */
  8890. A_UINT32 athbuf_rx_ind;
  8891. /* Number of remote buffers requested for refill */
  8892. A_UINT32 refill_buf_req;
  8893. /* Number of remote buffers filled by the host */
  8894. A_UINT32 refill_buf_rsp;
  8895. /* Number of times MAC hw_index = f/w write_index */
  8896. A_INT32 mac_no_bufs;
  8897. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  8898. A_INT32 fw_indices_equal;
  8899. /* Number of times f/w finds no buffers to post */
  8900. A_INT32 host_no_bufs;
  8901. };
  8902. /*
  8903. * TXBF MU/SU packets and NDPA statistics
  8904. * NB: all the fields must be defined in 4 octets size.
  8905. */
  8906. struct rx_txbf_musu_ndpa_pkts_stats {
  8907. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  8908. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  8909. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  8910. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  8911. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  8912. A_UINT32 reserved[3]; /* must be set to 0x0 */
  8913. };
  8914. /*
  8915. * htt_dbg_stats_status -
  8916. * present - The requested stats have been delivered in full.
  8917. * This indicates that either the stats information was contained
  8918. * in its entirety within this message, or else this message
  8919. * completes the delivery of the requested stats info that was
  8920. * partially delivered through earlier STATS_CONF messages.
  8921. * partial - The requested stats have been delivered in part.
  8922. * One or more subsequent STATS_CONF messages with the same
  8923. * cookie value will be sent to deliver the remainder of the
  8924. * information.
  8925. * error - The requested stats could not be delivered, for example due
  8926. * to a shortage of memory to construct a message holding the
  8927. * requested stats.
  8928. * invalid - The requested stat type is either not recognized, or the
  8929. * target is configured to not gather the stats type in question.
  8930. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8931. * series_done - This special value indicates that no further stats info
  8932. * elements are present within a series of stats info elems
  8933. * (within a stats upload confirmation message).
  8934. */
  8935. enum htt_dbg_stats_status {
  8936. HTT_DBG_STATS_STATUS_PRESENT = 0,
  8937. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  8938. HTT_DBG_STATS_STATUS_ERROR = 2,
  8939. HTT_DBG_STATS_STATUS_INVALID = 3,
  8940. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  8941. };
  8942. /**
  8943. * @brief target -> host statistics upload
  8944. *
  8945. * @details
  8946. * The following field definitions describe the format of the HTT target
  8947. * to host stats upload confirmation message.
  8948. * The message contains a cookie echoed from the HTT host->target stats
  8949. * upload request, which identifies which request the confirmation is
  8950. * for, and a series of tag-length-value stats information elements.
  8951. * The tag-length header for each stats info element also includes a
  8952. * status field, to indicate whether the request for the stat type in
  8953. * question was fully met, partially met, unable to be met, or invalid
  8954. * (if the stat type in question is disabled in the target).
  8955. * A special value of all 1's in this status field is used to indicate
  8956. * the end of the series of stats info elements.
  8957. *
  8958. *
  8959. * |31 16|15 8|7 5|4 0|
  8960. * |------------------------------------------------------------|
  8961. * | reserved | msg type |
  8962. * |------------------------------------------------------------|
  8963. * | cookie LSBs |
  8964. * |------------------------------------------------------------|
  8965. * | cookie MSBs |
  8966. * |------------------------------------------------------------|
  8967. * | stats entry length | reserved | S |stat type|
  8968. * |------------------------------------------------------------|
  8969. * | |
  8970. * | type-specific stats info |
  8971. * | |
  8972. * |------------------------------------------------------------|
  8973. * | stats entry length | reserved | S |stat type|
  8974. * |------------------------------------------------------------|
  8975. * | |
  8976. * | type-specific stats info |
  8977. * | |
  8978. * |------------------------------------------------------------|
  8979. * | n/a | reserved | 111 | n/a |
  8980. * |------------------------------------------------------------|
  8981. * Header fields:
  8982. * - MSG_TYPE
  8983. * Bits 7:0
  8984. * Purpose: identifies this is a statistics upload confirmation message
  8985. * Value: 0x9
  8986. * - COOKIE_LSBS
  8987. * Bits 31:0
  8988. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8989. * message with its preceding host->target stats request message.
  8990. * Value: LSBs of the opaque cookie specified by the host-side requestor
  8991. * - COOKIE_MSBS
  8992. * Bits 31:0
  8993. * Purpose: Provide a mechanism to match a target->host stats confirmation
  8994. * message with its preceding host->target stats request message.
  8995. * Value: MSBs of the opaque cookie specified by the host-side requestor
  8996. *
  8997. * Stats Information Element tag-length header fields:
  8998. * - STAT_TYPE
  8999. * Bits 4:0
  9000. * Purpose: identifies the type of statistics info held in the
  9001. * following information element
  9002. * Value: htt_dbg_stats_type
  9003. * - STATUS
  9004. * Bits 7:5
  9005. * Purpose: indicate whether the requested stats are present
  9006. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  9007. * the completion of the stats entry series
  9008. * - LENGTH
  9009. * Bits 31:16
  9010. * Purpose: indicate the stats information size
  9011. * Value: This field specifies the number of bytes of stats information
  9012. * that follows the element tag-length header.
  9013. * It is expected but not required that this length is a multiple of
  9014. * 4 bytes. Even if the length is not an integer multiple of 4, the
  9015. * subsequent stats entry header will begin on a 4-byte aligned
  9016. * boundary.
  9017. */
  9018. #define HTT_T2H_STATS_COOKIE_SIZE 8
  9019. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  9020. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  9021. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  9022. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  9023. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  9024. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  9025. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  9026. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  9027. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  9028. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  9029. do { \
  9030. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  9031. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  9032. } while (0)
  9033. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  9034. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  9035. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  9036. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  9037. do { \
  9038. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  9039. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  9040. } while (0)
  9041. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  9042. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  9043. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  9044. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  9045. do { \
  9046. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  9047. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  9048. } while (0)
  9049. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  9050. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  9051. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  9052. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  9053. #define HTT_MAX_AGGR 64
  9054. #define HTT_HL_MAX_AGGR 18
  9055. /**
  9056. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  9057. *
  9058. * @details
  9059. * The following field definitions describe the format of the HTT host
  9060. * to target frag_desc/msdu_ext bank configuration message.
  9061. * The message contains the based address and the min and max id of the
  9062. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  9063. * MSDU_EXT/FRAG_DESC.
  9064. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  9065. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  9066. * the hardware does the mapping/translation.
  9067. *
  9068. * Total banks that can be configured is configured to 16.
  9069. *
  9070. * This should be called before any TX has be initiated by the HTT
  9071. *
  9072. * |31 16|15 8|7 5|4 0|
  9073. * |------------------------------------------------------------|
  9074. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  9075. * |------------------------------------------------------------|
  9076. * | BANK0_BASE_ADDRESS (bits 31:0) |
  9077. #if HTT_PADDR64
  9078. * | BANK0_BASE_ADDRESS (bits 63:32) |
  9079. #endif
  9080. * |------------------------------------------------------------|
  9081. * | ... |
  9082. * |------------------------------------------------------------|
  9083. * | BANK15_BASE_ADDRESS (bits 31:0) |
  9084. #if HTT_PADDR64
  9085. * | BANK15_BASE_ADDRESS (bits 63:32) |
  9086. #endif
  9087. * |------------------------------------------------------------|
  9088. * | BANK0_MAX_ID | BANK0_MIN_ID |
  9089. * |------------------------------------------------------------|
  9090. * | ... |
  9091. * |------------------------------------------------------------|
  9092. * | BANK15_MAX_ID | BANK15_MIN_ID |
  9093. * |------------------------------------------------------------|
  9094. * Header fields:
  9095. * - MSG_TYPE
  9096. * Bits 7:0
  9097. * Value: 0x6
  9098. * for systems with 64-bit format for bus addresses:
  9099. * - BANKx_BASE_ADDRESS_LO
  9100. * Bits 31:0
  9101. * Purpose: Provide a mechanism to specify the base address of the
  9102. * MSDU_EXT bank physical/bus address.
  9103. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  9104. * - BANKx_BASE_ADDRESS_HI
  9105. * Bits 31:0
  9106. * Purpose: Provide a mechanism to specify the base address of the
  9107. * MSDU_EXT bank physical/bus address.
  9108. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  9109. * for systems with 32-bit format for bus addresses:
  9110. * - BANKx_BASE_ADDRESS
  9111. * Bits 31:0
  9112. * Purpose: Provide a mechanism to specify the base address of the
  9113. * MSDU_EXT bank physical/bus address.
  9114. * Value: MSDU_EXT bank physical / bus address
  9115. * - BANKx_MIN_ID
  9116. * Bits 15:0
  9117. * Purpose: Provide a mechanism to specify the min index that needs to
  9118. * mapped.
  9119. * - BANKx_MAX_ID
  9120. * Bits 31:16
  9121. * Purpose: Provide a mechanism to specify the max index that needs to
  9122. * mapped.
  9123. *
  9124. */
  9125. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  9126. * safe value.
  9127. * @note MAX supported banks is 16.
  9128. */
  9129. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  9130. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  9131. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  9132. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  9133. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  9134. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  9135. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  9136. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  9137. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  9138. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  9139. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  9140. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  9141. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  9142. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  9143. do { \
  9144. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  9145. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  9146. } while (0)
  9147. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  9148. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  9149. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  9150. do { \
  9151. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  9152. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  9153. } while (0)
  9154. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  9155. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  9156. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  9157. do { \
  9158. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  9159. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  9160. } while (0)
  9161. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  9162. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  9163. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  9164. do { \
  9165. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  9166. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  9167. } while (0)
  9168. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  9169. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  9170. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  9171. do { \
  9172. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  9173. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  9174. } while (0)
  9175. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  9176. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  9177. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  9178. do { \
  9179. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  9180. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  9181. } while (0)
  9182. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  9183. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  9184. /*
  9185. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  9186. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  9187. * addresses are stored in a XXX-bit field.
  9188. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  9189. * htt_tx_frag_desc64_bank_cfg_t structs.
  9190. */
  9191. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  9192. _paddr_bits_, \
  9193. _paddr__bank_base_address_) \
  9194. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  9195. /** word 0 \
  9196. * msg_type: 8, \
  9197. * pdev_id: 2, \
  9198. * swap: 1, \
  9199. * reserved0: 5, \
  9200. * num_banks: 8, \
  9201. * desc_size: 8; \
  9202. */ \
  9203. A_UINT32 word0; \
  9204. /* \
  9205. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  9206. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  9207. * the second A_UINT32). \
  9208. */ \
  9209. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9210. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  9211. } POSTPACK
  9212. /* define htt_tx_frag_desc32_bank_cfg_t */
  9213. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  9214. /* define htt_tx_frag_desc64_bank_cfg_t */
  9215. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  9216. /*
  9217. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  9218. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  9219. */
  9220. #if HTT_PADDR64
  9221. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  9222. #else
  9223. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  9224. #endif
  9225. /**
  9226. * @brief target -> host HTT TX Credit total count update message definition
  9227. *
  9228. *|31 16|15|14 9| 8 |7 0 |
  9229. *|---------------------+--+----------+-------+----------|
  9230. *|cur htt credit delta | Q| reserved | sign | msg type |
  9231. *|------------------------------------------------------|
  9232. *
  9233. * Header fields:
  9234. * - MSG_TYPE
  9235. * Bits 7:0
  9236. * Purpose: identifies this as a htt tx credit delta update message
  9237. * Value: 0xe
  9238. * - SIGN
  9239. * Bits 8
  9240. * identifies whether credit delta is positive or negative
  9241. * Value:
  9242. * - 0x0: credit delta is positive, rebalance in some buffers
  9243. * - 0x1: credit delta is negative, rebalance out some buffers
  9244. * - reserved
  9245. * Bits 14:9
  9246. * Value: 0x0
  9247. * - TXQ_GRP
  9248. * Bit 15
  9249. * Purpose: indicates whether any tx queue group information elements
  9250. * are appended to the tx credit update message
  9251. * Value: 0 -> no tx queue group information element is present
  9252. * 1 -> a tx queue group information element immediately follows
  9253. * - DELTA_COUNT
  9254. * Bits 31:16
  9255. * Purpose: Specify current htt credit delta absolute count
  9256. */
  9257. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  9258. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  9259. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  9260. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  9261. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  9262. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  9263. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  9264. do { \
  9265. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  9266. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  9267. } while (0)
  9268. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  9269. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  9270. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  9271. do { \
  9272. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  9273. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  9274. } while (0)
  9275. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  9276. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  9277. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  9278. do { \
  9279. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  9280. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  9281. } while (0)
  9282. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  9283. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  9284. #define HTT_TX_CREDIT_MSG_BYTES 4
  9285. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  9286. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  9287. /**
  9288. * @brief HTT WDI_IPA Operation Response Message
  9289. *
  9290. * @details
  9291. * HTT WDI_IPA Operation Response message is sent by target
  9292. * to host confirming suspend or resume operation.
  9293. * |31 24|23 16|15 8|7 0|
  9294. * |----------------+----------------+----------------+----------------|
  9295. * | op_code | Rsvd | msg_type |
  9296. * |-------------------------------------------------------------------|
  9297. * | Rsvd | Response len |
  9298. * |-------------------------------------------------------------------|
  9299. * | |
  9300. * | Response-type specific info |
  9301. * | |
  9302. * | |
  9303. * |-------------------------------------------------------------------|
  9304. * Header fields:
  9305. * - MSG_TYPE
  9306. * Bits 7:0
  9307. * Purpose: Identifies this as WDI_IPA Operation Response message
  9308. * value: = 0x13
  9309. * - OP_CODE
  9310. * Bits 31:16
  9311. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  9312. * value: = enum htt_wdi_ipa_op_code
  9313. * - RSP_LEN
  9314. * Bits 16:0
  9315. * Purpose: length for the response-type specific info
  9316. * value: = length in bytes for response-type specific info
  9317. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  9318. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  9319. */
  9320. PREPACK struct htt_wdi_ipa_op_response_t
  9321. {
  9322. /* DWORD 0: flags and meta-data */
  9323. A_UINT32
  9324. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9325. reserved1: 8,
  9326. op_code: 16;
  9327. A_UINT32
  9328. rsp_len: 16,
  9329. reserved2: 16;
  9330. } POSTPACK;
  9331. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  9332. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  9333. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  9334. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  9335. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  9336. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  9337. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  9338. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  9339. do { \
  9340. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  9341. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  9342. } while (0)
  9343. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  9344. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  9345. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  9346. do { \
  9347. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  9348. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  9349. } while (0)
  9350. enum htt_phy_mode {
  9351. htt_phy_mode_11a = 0,
  9352. htt_phy_mode_11g = 1,
  9353. htt_phy_mode_11b = 2,
  9354. htt_phy_mode_11g_only = 3,
  9355. htt_phy_mode_11na_ht20 = 4,
  9356. htt_phy_mode_11ng_ht20 = 5,
  9357. htt_phy_mode_11na_ht40 = 6,
  9358. htt_phy_mode_11ng_ht40 = 7,
  9359. htt_phy_mode_11ac_vht20 = 8,
  9360. htt_phy_mode_11ac_vht40 = 9,
  9361. htt_phy_mode_11ac_vht80 = 10,
  9362. htt_phy_mode_11ac_vht20_2g = 11,
  9363. htt_phy_mode_11ac_vht40_2g = 12,
  9364. htt_phy_mode_11ac_vht80_2g = 13,
  9365. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  9366. htt_phy_mode_11ac_vht160 = 15,
  9367. htt_phy_mode_max,
  9368. };
  9369. /**
  9370. * @brief target -> host HTT channel change indication
  9371. * @details
  9372. * Specify when a channel change occurs.
  9373. * This allows the host to precisely determine which rx frames arrived
  9374. * on the old channel and which rx frames arrived on the new channel.
  9375. *
  9376. *|31 |7 0 |
  9377. *|-------------------------------------------+----------|
  9378. *| reserved | msg type |
  9379. *|------------------------------------------------------|
  9380. *| primary_chan_center_freq_mhz |
  9381. *|------------------------------------------------------|
  9382. *| contiguous_chan1_center_freq_mhz |
  9383. *|------------------------------------------------------|
  9384. *| contiguous_chan2_center_freq_mhz |
  9385. *|------------------------------------------------------|
  9386. *| phy_mode |
  9387. *|------------------------------------------------------|
  9388. *
  9389. * Header fields:
  9390. * - MSG_TYPE
  9391. * Bits 7:0
  9392. * Purpose: identifies this as a htt channel change indication message
  9393. * Value: 0x15
  9394. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  9395. * Bits 31:0
  9396. * Purpose: identify the (center of the) new 20 MHz primary channel
  9397. * Value: center frequency of the 20 MHz primary channel, in MHz units
  9398. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  9399. * Bits 31:0
  9400. * Purpose: identify the (center of the) contiguous frequency range
  9401. * comprising the new channel.
  9402. * For example, if the new channel is a 80 MHz channel extending
  9403. * 60 MHz beyond the primary channel, this field would be 30 larger
  9404. * than the primary channel center frequency field.
  9405. * Value: center frequency of the contiguous frequency range comprising
  9406. * the full channel in MHz units
  9407. * (80+80 channels also use the CONTIG_CHAN2 field)
  9408. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  9409. * Bits 31:0
  9410. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  9411. * within a VHT 80+80 channel.
  9412. * This field is only relevant for VHT 80+80 channels.
  9413. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  9414. * channel (arbitrary value for cases besides VHT 80+80)
  9415. * - PHY_MODE
  9416. * Bits 31:0
  9417. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  9418. * and band
  9419. * Value: htt_phy_mode enum value
  9420. */
  9421. PREPACK struct htt_chan_change_t
  9422. {
  9423. /* DWORD 0: flags and meta-data */
  9424. A_UINT32
  9425. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  9426. reserved1: 24;
  9427. A_UINT32 primary_chan_center_freq_mhz;
  9428. A_UINT32 contig_chan1_center_freq_mhz;
  9429. A_UINT32 contig_chan2_center_freq_mhz;
  9430. A_UINT32 phy_mode;
  9431. } POSTPACK;
  9432. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  9433. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  9434. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  9435. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  9436. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  9437. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  9438. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  9439. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  9440. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  9441. do { \
  9442. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  9443. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  9444. } while (0)
  9445. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  9446. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  9447. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  9448. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  9449. do { \
  9450. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  9451. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  9452. } while (0)
  9453. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  9454. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  9455. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  9456. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  9457. do { \
  9458. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  9459. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  9460. } while (0)
  9461. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  9462. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  9463. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  9464. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  9465. do { \
  9466. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  9467. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  9468. } while (0)
  9469. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  9470. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  9471. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  9472. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  9473. /**
  9474. * @brief rx offload packet error message
  9475. *
  9476. * @details
  9477. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  9478. * of target payload like mic err.
  9479. *
  9480. * |31 24|23 16|15 8|7 0|
  9481. * |----------------+----------------+----------------+----------------|
  9482. * | tid | vdev_id | msg_sub_type | msg_type |
  9483. * |-------------------------------------------------------------------|
  9484. * : (sub-type dependent content) :
  9485. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9486. * Header fields:
  9487. * - msg_type
  9488. * Bits 7:0
  9489. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  9490. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  9491. * - msg_sub_type
  9492. * Bits 15:8
  9493. * Purpose: Identifies which type of rx error is reported by this message
  9494. * value: htt_rx_ofld_pkt_err_type
  9495. * - vdev_id
  9496. * Bits 23:16
  9497. * Purpose: Identifies which vdev received the erroneous rx frame
  9498. * value:
  9499. * - tid
  9500. * Bits 31:24
  9501. * Purpose: Identifies the traffic type of the rx frame
  9502. * value:
  9503. *
  9504. * - The payload fields used if the sub-type == MIC error are shown below.
  9505. * Note - MIC err is per MSDU, while PN is per MPDU.
  9506. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  9507. * with MIC err in A-MSDU case, so FW will send only one HTT message
  9508. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  9509. * instead of sending separate HTT messages for each wrong MSDU within
  9510. * the MPDU.
  9511. *
  9512. * |31 24|23 16|15 8|7 0|
  9513. * |----------------+----------------+----------------+----------------|
  9514. * | Rsvd | key_id | peer_id |
  9515. * |-------------------------------------------------------------------|
  9516. * | receiver MAC addr 31:0 |
  9517. * |-------------------------------------------------------------------|
  9518. * | Rsvd | receiver MAC addr 47:32 |
  9519. * |-------------------------------------------------------------------|
  9520. * | transmitter MAC addr 31:0 |
  9521. * |-------------------------------------------------------------------|
  9522. * | Rsvd | transmitter MAC addr 47:32 |
  9523. * |-------------------------------------------------------------------|
  9524. * | PN 31:0 |
  9525. * |-------------------------------------------------------------------|
  9526. * | Rsvd | PN 47:32 |
  9527. * |-------------------------------------------------------------------|
  9528. * - peer_id
  9529. * Bits 15:0
  9530. * Purpose: identifies which peer is frame is from
  9531. * value:
  9532. * - key_id
  9533. * Bits 23:16
  9534. * Purpose: identifies key_id of rx frame
  9535. * value:
  9536. * - RA_31_0 (receiver MAC addr 31:0)
  9537. * Bits 31:0
  9538. * Purpose: identifies by MAC address which vdev received the frame
  9539. * value: MAC address lower 4 bytes
  9540. * - RA_47_32 (receiver MAC addr 47:32)
  9541. * Bits 15:0
  9542. * Purpose: identifies by MAC address which vdev received the frame
  9543. * value: MAC address upper 2 bytes
  9544. * - TA_31_0 (transmitter MAC addr 31:0)
  9545. * Bits 31:0
  9546. * Purpose: identifies by MAC address which peer transmitted the frame
  9547. * value: MAC address lower 4 bytes
  9548. * - TA_47_32 (transmitter MAC addr 47:32)
  9549. * Bits 15:0
  9550. * Purpose: identifies by MAC address which peer transmitted the frame
  9551. * value: MAC address upper 2 bytes
  9552. * - PN_31_0
  9553. * Bits 31:0
  9554. * Purpose: Identifies pn of rx frame
  9555. * value: PN lower 4 bytes
  9556. * - PN_47_32
  9557. * Bits 15:0
  9558. * Purpose: Identifies pn of rx frame
  9559. * value:
  9560. * TKIP or CCMP: PN upper 2 bytes
  9561. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  9562. */
  9563. enum htt_rx_ofld_pkt_err_type {
  9564. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  9565. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  9566. };
  9567. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  9568. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  9569. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  9570. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  9571. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  9572. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  9573. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  9574. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  9575. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  9576. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  9577. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  9578. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  9579. do { \
  9580. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  9581. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  9582. } while (0)
  9583. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  9584. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  9585. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  9586. do { \
  9587. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  9588. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  9589. } while (0)
  9590. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  9591. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  9592. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  9593. do { \
  9594. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  9595. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  9596. } while (0)
  9597. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  9598. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  9599. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  9600. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  9601. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  9602. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  9603. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  9604. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  9605. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  9606. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  9607. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  9608. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  9609. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  9610. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  9611. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  9612. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  9613. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  9614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  9615. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  9616. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  9617. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  9618. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  9619. do { \
  9620. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  9621. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  9622. } while (0)
  9623. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  9624. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  9625. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  9626. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  9627. do { \
  9628. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  9629. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  9630. } while (0)
  9631. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  9632. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  9633. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  9634. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  9635. do { \
  9636. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  9637. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  9638. } while (0)
  9639. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  9640. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  9641. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  9642. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  9643. do { \
  9644. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  9645. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  9646. } while (0)
  9647. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  9648. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  9649. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  9650. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  9651. do { \
  9652. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  9653. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  9654. } while (0)
  9655. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  9656. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  9657. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  9658. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  9659. do { \
  9660. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  9661. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  9662. } while (0)
  9663. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  9664. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  9665. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  9666. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  9667. do { \
  9668. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  9669. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  9670. } while (0)
  9671. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  9672. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  9673. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  9674. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  9675. do { \
  9676. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  9677. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  9678. } while (0)
  9679. /**
  9680. * @brief peer rate report message
  9681. *
  9682. * @details
  9683. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  9684. * justified rate of all the peers.
  9685. *
  9686. * |31 24|23 16|15 8|7 0|
  9687. * |----------------+----------------+----------------+----------------|
  9688. * | peer_count | | msg_type |
  9689. * |-------------------------------------------------------------------|
  9690. * : Payload (variant number of peer rate report) :
  9691. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  9692. * Header fields:
  9693. * - msg_type
  9694. * Bits 7:0
  9695. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  9696. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  9697. * - reserved
  9698. * Bits 15:8
  9699. * Purpose:
  9700. * value:
  9701. * - peer_count
  9702. * Bits 31:16
  9703. * Purpose: Specify how many peer rate report elements are present in the payload.
  9704. * value:
  9705. *
  9706. * Payload:
  9707. * There are variant number of peer rate report follow the first 32 bits.
  9708. * The peer rate report is defined as follows.
  9709. *
  9710. * |31 20|19 16|15 0|
  9711. * |-----------------------+---------+---------------------------------|-
  9712. * | reserved | phy | peer_id | \
  9713. * |-------------------------------------------------------------------| -> report #0
  9714. * | rate | /
  9715. * |-----------------------+---------+---------------------------------|-
  9716. * | reserved | phy | peer_id | \
  9717. * |-------------------------------------------------------------------| -> report #1
  9718. * | rate | /
  9719. * |-----------------------+---------+---------------------------------|-
  9720. * | reserved | phy | peer_id | \
  9721. * |-------------------------------------------------------------------| -> report #2
  9722. * | rate | /
  9723. * |-------------------------------------------------------------------|-
  9724. * : :
  9725. * : :
  9726. * : :
  9727. * :-------------------------------------------------------------------:
  9728. *
  9729. * - peer_id
  9730. * Bits 15:0
  9731. * Purpose: identify the peer
  9732. * value:
  9733. * - phy
  9734. * Bits 19:16
  9735. * Purpose: identify which phy is in use
  9736. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  9737. * Please see enum htt_peer_report_phy_type for detail.
  9738. * - reserved
  9739. * Bits 31:20
  9740. * Purpose:
  9741. * value:
  9742. * - rate
  9743. * Bits 31:0
  9744. * Purpose: represent the justified rate of the peer specified by peer_id
  9745. * value:
  9746. */
  9747. enum htt_peer_rate_report_phy_type {
  9748. HTT_PEER_RATE_REPORT_11B = 0,
  9749. HTT_PEER_RATE_REPORT_11A_G,
  9750. HTT_PEER_RATE_REPORT_11N,
  9751. HTT_PEER_RATE_REPORT_11AC,
  9752. };
  9753. #define HTT_PEER_RATE_REPORT_SIZE 8
  9754. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  9755. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  9756. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  9757. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  9758. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  9759. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  9760. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  9761. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  9762. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  9763. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  9764. do { \
  9765. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  9766. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  9767. } while (0)
  9768. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  9769. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  9770. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  9771. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  9772. do { \
  9773. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  9774. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  9775. } while (0)
  9776. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  9777. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  9778. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  9779. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  9780. do { \
  9781. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  9782. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  9783. } while (0)
  9784. /**
  9785. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  9786. *
  9787. * @details
  9788. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  9789. * a flow of descriptors.
  9790. *
  9791. * This message is in TLV format and indicates the parameters to be setup a
  9792. * flow in the host. Each entry indicates that a particular flow ID is ready to
  9793. * receive descriptors from a specified pool.
  9794. *
  9795. * The message would appear as follows:
  9796. *
  9797. * |31 24|23 16|15 8|7 0|
  9798. * |----------------+----------------+----------------+----------------|
  9799. * header | reserved | num_flows | msg_type |
  9800. * |-------------------------------------------------------------------|
  9801. * | |
  9802. * : payload :
  9803. * | |
  9804. * |-------------------------------------------------------------------|
  9805. *
  9806. * The header field is one DWORD long and is interpreted as follows:
  9807. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  9808. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  9809. * this message
  9810. * b'16-31 - reserved: These bits are reserved for future use
  9811. *
  9812. * Payload:
  9813. * The payload would contain multiple objects of the following structure. Each
  9814. * object represents a flow.
  9815. *
  9816. * |31 24|23 16|15 8|7 0|
  9817. * |----------------+----------------+----------------+----------------|
  9818. * header | reserved | num_flows | msg_type |
  9819. * |-------------------------------------------------------------------|
  9820. * payload0| flow_type |
  9821. * |-------------------------------------------------------------------|
  9822. * | flow_id |
  9823. * |-------------------------------------------------------------------|
  9824. * | reserved0 | flow_pool_id |
  9825. * |-------------------------------------------------------------------|
  9826. * | reserved1 | flow_pool_size |
  9827. * |-------------------------------------------------------------------|
  9828. * | reserved2 |
  9829. * |-------------------------------------------------------------------|
  9830. * payload1| flow_type |
  9831. * |-------------------------------------------------------------------|
  9832. * | flow_id |
  9833. * |-------------------------------------------------------------------|
  9834. * | reserved0 | flow_pool_id |
  9835. * |-------------------------------------------------------------------|
  9836. * | reserved1 | flow_pool_size |
  9837. * |-------------------------------------------------------------------|
  9838. * | reserved2 |
  9839. * |-------------------------------------------------------------------|
  9840. * | . |
  9841. * | . |
  9842. * | . |
  9843. * |-------------------------------------------------------------------|
  9844. *
  9845. * Each payload is 5 DWORDS long and is interpreted as follows:
  9846. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  9847. * this flow is associated. It can be VDEV, peer,
  9848. * or tid (AC). Based on enum htt_flow_type.
  9849. *
  9850. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9851. * object. For flow_type vdev it is set to the
  9852. * vdevid, for peer it is peerid and for tid, it is
  9853. * tid_num.
  9854. *
  9855. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  9856. * in the host for this flow
  9857. * b'16:31 - reserved0: This field in reserved for the future. In case
  9858. * we have a hierarchical implementation (HCM) of
  9859. * pools, it can be used to indicate the ID of the
  9860. * parent-pool.
  9861. *
  9862. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  9863. * Descriptors for this flow will be
  9864. * allocated from this pool in the host.
  9865. * b'16:31 - reserved1: This field in reserved for the future. In case
  9866. * we have a hierarchical implementation of pools,
  9867. * it can be used to indicate the max number of
  9868. * descriptors in the pool. The b'0:15 can be used
  9869. * to indicate min number of descriptors in the
  9870. * HCM scheme.
  9871. *
  9872. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  9873. * we have a hierarchical implementation of pools,
  9874. * b'0:15 can be used to indicate the
  9875. * priority-based borrowing (PBB) threshold of
  9876. * the flow's pool. The b'16:31 are still left
  9877. * reserved.
  9878. */
  9879. enum htt_flow_type {
  9880. FLOW_TYPE_VDEV = 0,
  9881. /* Insert new flow types above this line */
  9882. };
  9883. PREPACK struct htt_flow_pool_map_payload_t {
  9884. A_UINT32 flow_type;
  9885. A_UINT32 flow_id;
  9886. A_UINT32 flow_pool_id:16,
  9887. reserved0:16;
  9888. A_UINT32 flow_pool_size:16,
  9889. reserved1:16;
  9890. A_UINT32 reserved2;
  9891. } POSTPACK;
  9892. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  9893. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  9894. (sizeof(struct htt_flow_pool_map_payload_t))
  9895. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  9896. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  9897. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  9898. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  9899. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  9900. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  9901. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  9902. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  9903. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  9904. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  9905. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  9906. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  9907. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  9908. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  9909. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  9910. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  9911. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  9912. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  9913. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  9914. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  9915. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  9916. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  9917. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  9918. do { \
  9919. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  9920. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  9921. } while (0)
  9922. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  9923. do { \
  9924. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  9925. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  9926. } while (0)
  9927. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  9928. do { \
  9929. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  9930. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  9931. } while (0)
  9932. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  9933. do { \
  9934. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  9935. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  9936. } while (0)
  9937. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  9938. do { \
  9939. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  9940. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  9941. } while (0)
  9942. /**
  9943. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  9944. *
  9945. * @details
  9946. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  9947. * down a flow of descriptors.
  9948. * This message indicates that for the flow (whose ID is provided) is wanting
  9949. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  9950. * pool of descriptors from where descriptors are being allocated for this
  9951. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  9952. * be unmapped by the host.
  9953. *
  9954. * The message would appear as follows:
  9955. *
  9956. * |31 24|23 16|15 8|7 0|
  9957. * |----------------+----------------+----------------+----------------|
  9958. * | reserved0 | msg_type |
  9959. * |-------------------------------------------------------------------|
  9960. * | flow_type |
  9961. * |-------------------------------------------------------------------|
  9962. * | flow_id |
  9963. * |-------------------------------------------------------------------|
  9964. * | reserved1 | flow_pool_id |
  9965. * |-------------------------------------------------------------------|
  9966. *
  9967. * The message is interpreted as follows:
  9968. * dword0 - b'0:7 - msg_type: This will be set to
  9969. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  9970. * b'8:31 - reserved0: Reserved for future use
  9971. *
  9972. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  9973. * this flow is associated. It can be VDEV, peer,
  9974. * or tid (AC). Based on enum htt_flow_type.
  9975. *
  9976. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  9977. * object. For flow_type vdev it is set to the
  9978. * vdevid, for peer it is peerid and for tid, it is
  9979. * tid_num.
  9980. *
  9981. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  9982. * used in the host for this flow
  9983. * b'16:31 - reserved0: This field in reserved for the future.
  9984. *
  9985. */
  9986. PREPACK struct htt_flow_pool_unmap_t {
  9987. A_UINT32 msg_type:8,
  9988. reserved0:24;
  9989. A_UINT32 flow_type;
  9990. A_UINT32 flow_id;
  9991. A_UINT32 flow_pool_id:16,
  9992. reserved1:16;
  9993. } POSTPACK;
  9994. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  9995. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  9996. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  9997. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  9998. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  9999. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  10000. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  10001. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  10002. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  10003. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  10004. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  10005. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  10006. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  10007. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  10008. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  10009. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  10010. do { \
  10011. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  10012. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  10013. } while (0)
  10014. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  10015. do { \
  10016. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  10017. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  10018. } while (0)
  10019. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  10020. do { \
  10021. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  10022. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  10023. } while (0)
  10024. /**
  10025. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  10026. *
  10027. * @details
  10028. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  10029. * SRNG ring setup is done
  10030. *
  10031. * This message indicates whether the last setup operation is successful.
  10032. * It will be sent to host when host set respose_required bit in
  10033. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  10034. * The message would appear as follows:
  10035. *
  10036. * |31 24|23 16|15 8|7 0|
  10037. * |--------------- +----------------+----------------+----------------|
  10038. * | setup_status | ring_id | pdev_id | msg_type |
  10039. * |-------------------------------------------------------------------|
  10040. *
  10041. * The message is interpreted as follows:
  10042. * dword0 - b'0:7 - msg_type: This will be set to
  10043. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  10044. * b'8:15 - pdev_id:
  10045. * 0 (for rings at SOC/UMAC level),
  10046. * 1/2/3 mac id (for rings at LMAC level)
  10047. * b'16:23 - ring_id: Identify the ring which is set up
  10048. * More details can be got from enum htt_srng_ring_id
  10049. * b'24:31 - setup_status: Indicate status of setup operation
  10050. * Refer to htt_ring_setup_status
  10051. */
  10052. PREPACK struct htt_sring_setup_done_t {
  10053. A_UINT32 msg_type: 8,
  10054. pdev_id: 8,
  10055. ring_id: 8,
  10056. setup_status: 8;
  10057. } POSTPACK;
  10058. enum htt_ring_setup_status {
  10059. htt_ring_setup_status_ok = 0,
  10060. htt_ring_setup_status_error,
  10061. };
  10062. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  10063. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  10064. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  10065. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  10066. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  10067. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  10068. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  10069. do { \
  10070. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  10071. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  10072. } while (0)
  10073. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  10074. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  10075. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  10076. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  10077. HTT_SRING_SETUP_DONE_RING_ID_S)
  10078. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  10079. do { \
  10080. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  10081. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  10082. } while (0)
  10083. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  10084. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  10085. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  10086. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  10087. HTT_SRING_SETUP_DONE_STATUS_S)
  10088. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  10089. do { \
  10090. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  10091. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  10092. } while (0)
  10093. /**
  10094. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  10095. *
  10096. * @details
  10097. * HTT TX map flow entry with tqm flow pointer
  10098. * Sent from firmware to host to add tqm flow pointer in corresponding
  10099. * flow search entry. Flow metadata is replayed back to host as part of this
  10100. * struct to enable host to find the specific flow search entry
  10101. *
  10102. * The message would appear as follows:
  10103. *
  10104. * |31 28|27 18|17 14|13 8|7 0|
  10105. * |-------+------------------------------------------+----------------|
  10106. * | rsvd0 | fse_hsh_idx | msg_type |
  10107. * |-------------------------------------------------------------------|
  10108. * | rsvd1 | tid | peer_id |
  10109. * |-------------------------------------------------------------------|
  10110. * | tqm_flow_pntr_lo |
  10111. * |-------------------------------------------------------------------|
  10112. * | tqm_flow_pntr_hi |
  10113. * |-------------------------------------------------------------------|
  10114. * | fse_meta_data |
  10115. * |-------------------------------------------------------------------|
  10116. *
  10117. * The message is interpreted as follows:
  10118. *
  10119. * dword0 - b'0:7 - msg_type: This will be set to
  10120. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  10121. *
  10122. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  10123. * for this flow entry
  10124. *
  10125. * dword0 - b'28:31 - rsvd0: Reserved for future use
  10126. *
  10127. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  10128. *
  10129. * dword1 - b'14:17 - tid
  10130. *
  10131. * dword1 - b'18:31 - rsvd1: Reserved for future use
  10132. *
  10133. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  10134. *
  10135. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  10136. *
  10137. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  10138. * given by host
  10139. */
  10140. PREPACK struct htt_tx_map_flow_info {
  10141. A_UINT32
  10142. msg_type: 8,
  10143. fse_hsh_idx: 20,
  10144. rsvd0: 4;
  10145. A_UINT32
  10146. peer_id: 14,
  10147. tid: 4,
  10148. rsvd1: 14;
  10149. A_UINT32 tqm_flow_pntr_lo;
  10150. A_UINT32 tqm_flow_pntr_hi;
  10151. struct htt_tx_flow_metadata fse_meta_data;
  10152. } POSTPACK;
  10153. /* DWORD 0 */
  10154. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  10155. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  10156. /* DWORD 1 */
  10157. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  10158. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  10159. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  10160. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  10161. /* DWORD 0 */
  10162. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  10163. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  10164. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  10165. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  10166. do { \
  10167. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  10168. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  10169. } while (0)
  10170. /* DWORD 1 */
  10171. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  10172. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  10173. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  10174. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  10175. do { \
  10176. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  10177. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  10178. } while (0)
  10179. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  10180. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  10181. HTT_TX_MAP_FLOW_INFO_TID_S)
  10182. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  10183. do { \
  10184. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  10185. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  10186. } while (0)
  10187. /*
  10188. * htt_dbg_ext_stats_status -
  10189. * present - The requested stats have been delivered in full.
  10190. * This indicates that either the stats information was contained
  10191. * in its entirety within this message, or else this message
  10192. * completes the delivery of the requested stats info that was
  10193. * partially delivered through earlier STATS_CONF messages.
  10194. * partial - The requested stats have been delivered in part.
  10195. * One or more subsequent STATS_CONF messages with the same
  10196. * cookie value will be sent to deliver the remainder of the
  10197. * information.
  10198. * error - The requested stats could not be delivered, for example due
  10199. * to a shortage of memory to construct a message holding the
  10200. * requested stats.
  10201. * invalid - The requested stat type is either not recognized, or the
  10202. * target is configured to not gather the stats type in question.
  10203. */
  10204. enum htt_dbg_ext_stats_status {
  10205. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  10206. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  10207. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  10208. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  10209. };
  10210. /**
  10211. * @brief target -> host ppdu stats upload
  10212. *
  10213. * @details
  10214. * The following field definitions describe the format of the HTT target
  10215. * to host ppdu stats indication message.
  10216. *
  10217. *
  10218. * |31 16|15 12|11 10|9 8|7 0 |
  10219. * |----------------------------------------------------------------------|
  10220. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  10221. * |----------------------------------------------------------------------|
  10222. * | ppdu_id |
  10223. * |----------------------------------------------------------------------|
  10224. * | Timestamp in us |
  10225. * |----------------------------------------------------------------------|
  10226. * | reserved |
  10227. * |----------------------------------------------------------------------|
  10228. * | type-specific stats info |
  10229. * | (see htt_ppdu_stats.h) |
  10230. * |----------------------------------------------------------------------|
  10231. * Header fields:
  10232. * - MSG_TYPE
  10233. * Bits 7:0
  10234. * Purpose: Identifies this is a PPDU STATS indication
  10235. * message.
  10236. * Value: 0x1d
  10237. * - mac_id
  10238. * Bits 9:8
  10239. * Purpose: mac_id of this ppdu_id
  10240. * Value: 0-3
  10241. * - pdev_id
  10242. * Bits 11:10
  10243. * Purpose: pdev_id of this ppdu_id
  10244. * Value: 0-3
  10245. * 0 (for rings at SOC level),
  10246. * 1/2/3 PDEV -> 0/1/2
  10247. * - payload_size
  10248. * Bits 31:16
  10249. * Purpose: total tlv size
  10250. * Value: payload_size in bytes
  10251. */
  10252. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  10253. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  10254. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  10255. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  10256. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  10257. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  10258. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  10259. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  10260. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  10261. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  10262. do { \
  10263. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  10264. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  10265. } while (0)
  10266. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  10267. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  10268. HTT_T2H_PPDU_STATS_MAC_ID_S)
  10269. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  10270. do { \
  10271. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  10272. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  10273. } while (0)
  10274. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  10275. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  10276. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  10277. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  10278. do { \
  10279. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  10280. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  10281. } while (0)
  10282. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  10283. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  10284. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  10285. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  10286. do { \
  10287. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  10288. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  10289. } while (0)
  10290. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  10291. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  10292. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  10293. /* htt_t2h_ppdu_stats_ind_hdr_t
  10294. * This struct contains the fields within the header of the
  10295. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  10296. * stats info.
  10297. * This struct assumes little-endian layout, and thus is only
  10298. * suitable for use within processors known to be little-endian
  10299. * (such as the target).
  10300. * In contrast, the above macros provide endian-portable methods
  10301. * to get and set the bitfields within this PPDU_STATS_IND header.
  10302. */
  10303. typedef struct {
  10304. A_UINT32 msg_type: 8, /* bits 7:0 */
  10305. mac_id: 2, /* bits 9:8 */
  10306. pdev_id: 2, /* bits 11:10 */
  10307. reserved1: 4, /* bits 15:12 */
  10308. payload_size: 16; /* bits 31:16 */
  10309. A_UINT32 ppdu_id;
  10310. A_UINT32 timestamp_us;
  10311. A_UINT32 reserved2;
  10312. } htt_t2h_ppdu_stats_ind_hdr_t;
  10313. /**
  10314. * @brief target -> host extended statistics upload
  10315. *
  10316. * @details
  10317. * The following field definitions describe the format of the HTT target
  10318. * to host stats upload confirmation message.
  10319. * The message contains a cookie echoed from the HTT host->target stats
  10320. * upload request, which identifies which request the confirmation is
  10321. * for, and a single stats can span over multiple HTT stats indication
  10322. * due to the HTT message size limitation so every HTT ext stats indication
  10323. * will have tag-length-value stats information elements.
  10324. * The tag-length header for each HTT stats IND message also includes a
  10325. * status field, to indicate whether the request for the stat type in
  10326. * question was fully met, partially met, unable to be met, or invalid
  10327. * (if the stat type in question is disabled in the target).
  10328. * A Done bit 1's indicate the end of the of stats info elements.
  10329. *
  10330. *
  10331. * |31 16|15 12|11|10 8|7 5|4 0|
  10332. * |--------------------------------------------------------------|
  10333. * | reserved | msg type |
  10334. * |--------------------------------------------------------------|
  10335. * | cookie LSBs |
  10336. * |--------------------------------------------------------------|
  10337. * | cookie MSBs |
  10338. * |--------------------------------------------------------------|
  10339. * | stats entry length | rsvd | D| S | stat type |
  10340. * |--------------------------------------------------------------|
  10341. * | type-specific stats info |
  10342. * | (see htt_stats.h) |
  10343. * |--------------------------------------------------------------|
  10344. * Header fields:
  10345. * - MSG_TYPE
  10346. * Bits 7:0
  10347. * Purpose: Identifies this is a extended statistics upload confirmation
  10348. * message.
  10349. * Value: 0x1c
  10350. * - COOKIE_LSBS
  10351. * Bits 31:0
  10352. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10353. * message with its preceding host->target stats request message.
  10354. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10355. * - COOKIE_MSBS
  10356. * Bits 31:0
  10357. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10358. * message with its preceding host->target stats request message.
  10359. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10360. *
  10361. * Stats Information Element tag-length header fields:
  10362. * - STAT_TYPE
  10363. * Bits 7:0
  10364. * Purpose: identifies the type of statistics info held in the
  10365. * following information element
  10366. * Value: htt_dbg_ext_stats_type
  10367. * - STATUS
  10368. * Bits 10:8
  10369. * Purpose: indicate whether the requested stats are present
  10370. * Value: htt_dbg_ext_stats_status
  10371. * - DONE
  10372. * Bits 11
  10373. * Purpose:
  10374. * Indicates the completion of the stats entry, this will be the last
  10375. * stats conf HTT segment for the requested stats type.
  10376. * Value:
  10377. * 0 -> the stats retrieval is ongoing
  10378. * 1 -> the stats retrieval is complete
  10379. * - LENGTH
  10380. * Bits 31:16
  10381. * Purpose: indicate the stats information size
  10382. * Value: This field specifies the number of bytes of stats information
  10383. * that follows the element tag-length header.
  10384. * It is expected but not required that this length is a multiple of
  10385. * 4 bytes.
  10386. */
  10387. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  10388. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  10389. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  10390. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  10391. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  10392. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  10393. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  10394. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  10395. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  10396. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10397. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  10398. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  10399. do { \
  10400. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  10401. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  10402. } while (0)
  10403. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  10404. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  10405. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  10406. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  10407. do { \
  10408. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  10409. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  10410. } while (0)
  10411. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  10412. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  10413. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  10414. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  10415. do { \
  10416. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  10417. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  10418. } while (0)
  10419. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  10420. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  10421. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  10422. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10423. do { \
  10424. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  10425. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  10426. } while (0)
  10427. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  10428. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  10429. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  10430. typedef enum {
  10431. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  10432. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  10433. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  10434. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  10435. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  10436. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  10437. /* Reserved from 128 - 255 for target internal use.*/
  10438. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  10439. } HTT_PEER_TYPE;
  10440. /** 2 word representation of MAC addr */
  10441. typedef struct {
  10442. /** upper 4 bytes of MAC address */
  10443. A_UINT32 mac_addr31to0;
  10444. /** lower 2 bytes of MAC address */
  10445. A_UINT32 mac_addr47to32;
  10446. } htt_mac_addr;
  10447. /** macro to convert MAC address from char array to HTT word format */
  10448. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  10449. (phtt_mac_addr)->mac_addr31to0 = \
  10450. (((c_macaddr)[0] << 0) | \
  10451. ((c_macaddr)[1] << 8) | \
  10452. ((c_macaddr)[2] << 16) | \
  10453. ((c_macaddr)[3] << 24)); \
  10454. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  10455. } while (0)
  10456. /**
  10457. * @brief target -> host monitor mac header indication message
  10458. *
  10459. * @details
  10460. * The following diagram shows the format of the monitor mac header message
  10461. * sent from the target to the host.
  10462. * This message is primarily sent when promiscuous rx mode is enabled.
  10463. * One message is sent per rx PPDU.
  10464. *
  10465. * |31 24|23 16|15 8|7 0|
  10466. * |-------------------------------------------------------------|
  10467. * | peer_id | reserved0 | msg_type |
  10468. * |-------------------------------------------------------------|
  10469. * | reserved1 | num_mpdu |
  10470. * |-------------------------------------------------------------|
  10471. * | struct hw_rx_desc |
  10472. * | (see wal_rx_desc.h) |
  10473. * |-------------------------------------------------------------|
  10474. * | struct ieee80211_frame_addr4 |
  10475. * | (see ieee80211_defs.h) |
  10476. * |-------------------------------------------------------------|
  10477. * | struct ieee80211_frame_addr4 |
  10478. * | (see ieee80211_defs.h) |
  10479. * |-------------------------------------------------------------|
  10480. * | ...... |
  10481. * |-------------------------------------------------------------|
  10482. *
  10483. * Header fields:
  10484. * - msg_type
  10485. * Bits 7:0
  10486. * Purpose: Identifies this is a monitor mac header indication message.
  10487. * Value: 0x20
  10488. * - peer_id
  10489. * Bits 31:16
  10490. * Purpose: Software peer id given by host during association,
  10491. * During promiscuous mode, the peer ID will be invalid (0xFF)
  10492. * for rx PPDUs received from unassociated peers.
  10493. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  10494. * - num_mpdu
  10495. * Bits 15:0
  10496. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  10497. * delivered within the message.
  10498. * Value: 1 to 32
  10499. * num_mpdu is limited to a maximum value of 32, due to buffer
  10500. * size limits. For PPDUs with more than 32 MPDUs, only the
  10501. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  10502. * the PPDU will be provided.
  10503. */
  10504. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  10505. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  10506. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  10507. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  10508. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  10509. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  10510. do { \
  10511. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  10512. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  10513. } while (0)
  10514. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  10515. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  10516. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  10517. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  10518. do { \
  10519. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  10520. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  10521. } while (0)
  10522. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  10523. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  10524. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  10525. /**
  10526. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  10527. *
  10528. * @details
  10529. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  10530. * the flow pool associated with the specified ID is resized
  10531. *
  10532. * The message would appear as follows:
  10533. *
  10534. * |31 16|15 8|7 0|
  10535. * |---------------------------------+----------------+----------------|
  10536. * | reserved0 | Msg type |
  10537. * |-------------------------------------------------------------------|
  10538. * | flow pool new size | flow pool ID |
  10539. * |-------------------------------------------------------------------|
  10540. *
  10541. * The message is interpreted as follows:
  10542. * b'0:7 - msg_type: This will be set to
  10543. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  10544. *
  10545. * b'0:15 - flow pool ID: Existing flow pool ID
  10546. *
  10547. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  10548. *
  10549. */
  10550. PREPACK struct htt_flow_pool_resize_t {
  10551. A_UINT32 msg_type:8,
  10552. reserved0:24;
  10553. A_UINT32 flow_pool_id:16,
  10554. flow_pool_new_size:16;
  10555. } POSTPACK;
  10556. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  10557. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  10558. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  10559. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  10560. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  10561. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  10562. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  10563. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  10564. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  10565. do { \
  10566. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  10567. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  10568. } while (0)
  10569. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  10570. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  10571. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  10572. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  10573. do { \
  10574. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  10575. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  10576. } while (0)
  10577. /**
  10578. * @brief host -> target channel change message
  10579. *
  10580. * @details
  10581. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  10582. * to associate RX frames to correct channel they were received on.
  10583. * The following field definitions describe the format of the HTT target
  10584. * to host channel change message.
  10585. * |31 16|15 8|7 5|4 0|
  10586. * |------------------------------------------------------------|
  10587. * | reserved | MSG_TYPE |
  10588. * |------------------------------------------------------------|
  10589. * | CHAN_MHZ |
  10590. * |------------------------------------------------------------|
  10591. * | BAND_CENTER_FREQ1 |
  10592. * |------------------------------------------------------------|
  10593. * | BAND_CENTER_FREQ2 |
  10594. * |------------------------------------------------------------|
  10595. * | CHAN_PHY_MODE |
  10596. * |------------------------------------------------------------|
  10597. * Header fields:
  10598. * - MSG_TYPE
  10599. * Bits 7:0
  10600. * Value: 0xf
  10601. * - CHAN_MHZ
  10602. * Bits 31:0
  10603. * Purpose: frequency of the primary 20mhz channel.
  10604. * - BAND_CENTER_FREQ1
  10605. * Bits 31:0
  10606. * Purpose: centre frequency of the full channel.
  10607. * - BAND_CENTER_FREQ2
  10608. * Bits 31:0
  10609. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  10610. * - CHAN_PHY_MODE
  10611. * Bits 31:0
  10612. * Purpose: phy mode of the channel.
  10613. */
  10614. PREPACK struct htt_chan_change_msg {
  10615. A_UINT32 chan_mhz; /* frequency in mhz */
  10616. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  10617. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  10618. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  10619. } POSTPACK;
  10620. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  10621. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  10622. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  10623. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  10624. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  10625. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  10626. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  10627. /*
  10628. * The read and write indices point to the data within the host buffer.
  10629. * Because the first 4 bytes of the host buffer is used for the read index and
  10630. * the next 4 bytes for the write index, the data itself starts at offset 8.
  10631. * The read index and write index are the byte offsets from the base of the
  10632. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  10633. * Refer the ASCII text picture below.
  10634. */
  10635. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  10636. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  10637. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  10638. /*
  10639. ***************************************************************************
  10640. *
  10641. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10642. *
  10643. ***************************************************************************
  10644. *
  10645. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  10646. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  10647. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  10648. * written into the Host memory region mentioned below.
  10649. *
  10650. * Read index is updated by the Host. At any point of time, the read index will
  10651. * indicate the index that will next be read by the Host. The read index is
  10652. * in units of bytes offset from the base of the meta-data buffer.
  10653. *
  10654. * Write index is updated by the FW. At any point of time, the write index will
  10655. * indicate from where the FW can start writing any new data. The write index is
  10656. * in units of bytes offset from the base of the meta-data buffer.
  10657. *
  10658. * If the Host is not fast enough in reading the CFR data, any new capture data
  10659. * would be dropped if there is no space left to write the new captures.
  10660. *
  10661. * The last 4 bytes of the memory region will have the magic pattern
  10662. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  10663. * not overrun the host buffer.
  10664. *
  10665. * ,--------------------. read and write indices store the
  10666. * | | byte offset from the base of the
  10667. * | ,--------+--------. meta-data buffer to the next
  10668. * | | | | location within the data buffer
  10669. * | | v v that will be read / written
  10670. * ************************************************************************
  10671. * * Read * Write * * Magic *
  10672. * * index * index * CFR data1 ...... CFR data N * pattern *
  10673. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  10674. * ************************************************************************
  10675. * |<---------- data buffer ---------->|
  10676. *
  10677. * |<----------------- meta-data buffer allocated in Host ----------------|
  10678. *
  10679. * Note:
  10680. * - Considering the 4 bytes needed to store the Read index (R) and the
  10681. * Write index (W), the initial value is as follows:
  10682. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  10683. * - Buffer empty condition:
  10684. * R = W
  10685. *
  10686. * Regarding CFR data format:
  10687. * --------------------------
  10688. *
  10689. * Each CFR tone is stored in HW as 16-bits with the following format:
  10690. * {bits[15:12], bits[11:6], bits[5:0]} =
  10691. * {unsigned exponent (4 bits),
  10692. * signed mantissa_real (6 bits),
  10693. * signed mantissa_imag (6 bits)}
  10694. *
  10695. * CFR_real = mantissa_real * 2^(exponent-5)
  10696. * CFR_imag = mantissa_imag * 2^(exponent-5)
  10697. *
  10698. *
  10699. * The CFR data is written to the 16-bit unsigned output array (buff) in
  10700. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  10701. *
  10702. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  10703. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  10704. * .
  10705. * .
  10706. * .
  10707. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  10708. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  10709. */
  10710. /* Bandwidth of peer CFR captures */
  10711. typedef enum {
  10712. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  10713. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  10714. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  10715. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  10716. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  10717. HTT_PEER_CFR_CAPTURE_BW_MAX,
  10718. } HTT_PEER_CFR_CAPTURE_BW;
  10719. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  10720. * was captured
  10721. */
  10722. typedef enum {
  10723. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  10724. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  10725. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  10726. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  10727. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  10728. } HTT_PEER_CFR_CAPTURE_MODE;
  10729. typedef enum {
  10730. /* This message type is currently used for the below purpose:
  10731. *
  10732. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  10733. * wmi_peer_cfr_capture_cmd.
  10734. * If payload_present bit is set to 0 then the associated memory region
  10735. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  10736. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  10737. * message; the CFR dump will be present at the end of the message,
  10738. * after the chan_phy_mode.
  10739. */
  10740. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  10741. /* Always keep this last */
  10742. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  10743. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  10744. /**
  10745. * @brief target -> host CFR dump completion indication message definition
  10746. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  10747. *
  10748. * @details
  10749. * The following diagram shows the format of the Channel Frequency Response
  10750. * (CFR) dump completion indication. This inidcation is sent to the Host when
  10751. * the channel capture of a peer is copied by Firmware into the Host memory
  10752. *
  10753. * **************************************************************************
  10754. *
  10755. * Message format when the CFR capture message type is
  10756. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  10757. *
  10758. * **************************************************************************
  10759. *
  10760. * |31 16|15 |8|7 0|
  10761. * |----------------------------------------------------------------|
  10762. * header: | reserved |P| msg_type |
  10763. * word 0 | | | |
  10764. * |----------------------------------------------------------------|
  10765. * payload: | cfr_capture_msg_type |
  10766. * word 1 | |
  10767. * |----------------------------------------------------------------|
  10768. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  10769. * word 2 | | | | | | | | |
  10770. * |----------------------------------------------------------------|
  10771. * | mac_addr31to0 |
  10772. * word 3 | |
  10773. * |----------------------------------------------------------------|
  10774. * | unused / reserved | mac_addr47to32 |
  10775. * word 4 | | |
  10776. * |----------------------------------------------------------------|
  10777. * | index |
  10778. * word 5 | |
  10779. * |----------------------------------------------------------------|
  10780. * | length |
  10781. * word 6 | |
  10782. * |----------------------------------------------------------------|
  10783. * | timestamp |
  10784. * word 7 | |
  10785. * |----------------------------------------------------------------|
  10786. * | counter |
  10787. * word 8 | |
  10788. * |----------------------------------------------------------------|
  10789. * | chan_mhz |
  10790. * word 9 | |
  10791. * |----------------------------------------------------------------|
  10792. * | band_center_freq1 |
  10793. * word 10 | |
  10794. * |----------------------------------------------------------------|
  10795. * | band_center_freq2 |
  10796. * word 11 | |
  10797. * |----------------------------------------------------------------|
  10798. * | chan_phy_mode |
  10799. * word 12 | |
  10800. * |----------------------------------------------------------------|
  10801. * where,
  10802. * P - payload present bit (payload_present explained below)
  10803. * req_id - memory request id (mem_req_id explained below)
  10804. * S - status field (status explained below)
  10805. * capbw - capture bandwidth (capture_bw explained below)
  10806. * mode - mode of capture (mode explained below)
  10807. * sts - space time streams (sts_count explained below)
  10808. * chbw - channel bandwidth (channel_bw explained below)
  10809. * captype - capture type (cap_type explained below)
  10810. *
  10811. * The following field definitions describe the format of the CFR dump
  10812. * completion indication sent from the target to the host
  10813. *
  10814. * Header fields:
  10815. *
  10816. * Word 0
  10817. * - msg_type
  10818. * Bits 7:0
  10819. * Purpose: Identifies this as CFR TX completion indication
  10820. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  10821. * - payload_present
  10822. * Bit 8
  10823. * Purpose: Identifies how CFR data is sent to host
  10824. * Value: 0 - If CFR Payload is written to host memory
  10825. * 1 - If CFR Payload is sent as part of HTT message
  10826. * (This is the requirement for SDIO/USB where it is
  10827. * not possible to write CFR data to host memory)
  10828. * - reserved
  10829. * Bits 31:9
  10830. * Purpose: Reserved
  10831. * Value: 0
  10832. *
  10833. * Payload fields:
  10834. *
  10835. * Word 1
  10836. * - cfr_capture_msg_type
  10837. * Bits 31:0
  10838. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  10839. * to specify the format used for the remainder of the message
  10840. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10841. * (currently only MSG_TYPE_1 is defined)
  10842. *
  10843. * Word 2
  10844. * - mem_req_id
  10845. * Bits 6:0
  10846. * Purpose: Contain the mem request id of the region where the CFR capture
  10847. * has been stored - of type WMI_HOST_MEM_REQ_ID
  10848. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  10849. this value is invalid)
  10850. * - status
  10851. * Bit 7
  10852. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  10853. * Value: 1 (True) - Successful; 0 (False) - Not successful
  10854. * - capture_bw
  10855. * Bits 10:8
  10856. * Purpose: Carry the bandwidth of the CFR capture
  10857. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  10858. * - mode
  10859. * Bits 13:11
  10860. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  10861. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  10862. * - sts_count
  10863. * Bits 16:14
  10864. * Purpose: Carry the number of space time streams
  10865. * Value: Number of space time streams
  10866. * - channel_bw
  10867. * Bits 19:17
  10868. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  10869. * measurement
  10870. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  10871. * - cap_type
  10872. * Bits 23:20
  10873. * Purpose: Carry the type of the capture
  10874. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  10875. * - vdev_id
  10876. * Bits 31:24
  10877. * Purpose: Carry the virtual device id
  10878. * Value: vdev ID
  10879. *
  10880. * Word 3
  10881. * - mac_addr31to0
  10882. * Bits 31:0
  10883. * Purpose: Contain the bits 31:0 of the peer MAC address
  10884. * Value: Bits 31:0 of the peer MAC address
  10885. *
  10886. * Word 4
  10887. * - mac_addr47to32
  10888. * Bits 15:0
  10889. * Purpose: Contain the bits 47:32 of the peer MAC address
  10890. * Value: Bits 47:32 of the peer MAC address
  10891. *
  10892. * Word 5
  10893. * - index
  10894. * Bits 31:0
  10895. * Purpose: Contain the index at which this CFR dump was written in the Host
  10896. * allocated memory. This index is the number of bytes from the base address.
  10897. * Value: Index position
  10898. *
  10899. * Word 6
  10900. * - length
  10901. * Bits 31:0
  10902. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  10903. * Value: Length of the CFR capture of the peer
  10904. *
  10905. * Word 7
  10906. * - timestamp
  10907. * Bits 31:0
  10908. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  10909. * clock used for this timestamp is private to the target and not visible to
  10910. * the host i.e., Host can interpret only the relative timestamp deltas from
  10911. * one message to the next, but can't interpret the absolute timestamp from a
  10912. * single message.
  10913. * Value: Timestamp in microseconds
  10914. *
  10915. * Word 8
  10916. * - counter
  10917. * Bits 31:0
  10918. * Purpose: Carry the count of the current CFR capture from FW. This is
  10919. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  10920. * in host memory)
  10921. * Value: Count of the current CFR capture
  10922. *
  10923. * Word 9
  10924. * - chan_mhz
  10925. * Bits 31:0
  10926. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  10927. * Value: Primary 20 channel frequency
  10928. *
  10929. * Word 10
  10930. * - band_center_freq1
  10931. * Bits 31:0
  10932. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  10933. * Value: Center frequency 1 in MHz
  10934. *
  10935. * Word 11
  10936. * - band_center_freq2
  10937. * Bits 31:0
  10938. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  10939. * the VDEV
  10940. * 80plus80 mode
  10941. * Value: Center frequency 2 in MHz
  10942. *
  10943. * Word 12
  10944. * - chan_phy_mode
  10945. * Bits 31:0
  10946. * Purpose: Carry the phy mode of the channel, of the VDEV
  10947. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  10948. */
  10949. PREPACK struct htt_cfr_dump_ind_type_1 {
  10950. A_UINT32 mem_req_id:7,
  10951. status:1,
  10952. capture_bw:3,
  10953. mode:3,
  10954. sts_count:3,
  10955. channel_bw:3,
  10956. cap_type:4,
  10957. vdev_id:8;
  10958. htt_mac_addr addr;
  10959. A_UINT32 index;
  10960. A_UINT32 length;
  10961. A_UINT32 timestamp;
  10962. A_UINT32 counter;
  10963. struct htt_chan_change_msg chan;
  10964. } POSTPACK;
  10965. PREPACK struct htt_cfr_dump_compl_ind {
  10966. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  10967. union {
  10968. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  10969. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  10970. /* If there is a need to change the memory layout and its associated
  10971. * HTT indication format, a new CFR capture message type can be
  10972. * introduced and added into this union.
  10973. */
  10974. };
  10975. } POSTPACK;
  10976. /*
  10977. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  10978. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10979. */
  10980. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  10981. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  10982. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  10983. do { \
  10984. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  10985. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  10986. } while(0)
  10987. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  10988. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  10989. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  10990. /*
  10991. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  10992. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  10993. */
  10994. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  10995. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  10996. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  10997. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  10998. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  10999. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  11000. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  11001. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  11002. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  11003. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  11004. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  11005. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  11006. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  11007. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  11008. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  11009. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  11010. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  11011. do { \
  11012. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  11013. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  11014. } while (0)
  11015. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  11016. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  11017. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  11018. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  11019. do { \
  11020. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  11021. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  11022. } while (0)
  11023. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  11024. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  11025. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  11026. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  11027. do { \
  11028. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  11029. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  11030. } while (0)
  11031. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  11032. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  11033. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  11034. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  11035. do { \
  11036. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  11037. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  11038. } while (0)
  11039. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  11040. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  11041. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  11042. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  11043. do { \
  11044. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  11045. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  11046. } while (0)
  11047. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  11048. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  11049. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  11050. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  11051. do { \
  11052. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  11053. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  11054. } while (0)
  11055. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  11056. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  11057. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  11058. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  11059. do { \
  11060. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  11061. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  11062. } while (0)
  11063. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  11064. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  11065. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  11066. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  11067. do { \
  11068. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  11069. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  11070. } while (0)
  11071. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  11072. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  11073. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  11074. /**
  11075. * @brief target -> host peer (PPDU) stats message
  11076. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11077. * @details
  11078. * This message is generated by FW when FW is sending stats to host
  11079. * about one or more PPDUs that the FW has transmitted to one or more peers.
  11080. * This message is sent autonomously by the target rather than upon request
  11081. * by the host.
  11082. * The following field definitions describe the format of the HTT target
  11083. * to host peer stats indication message.
  11084. *
  11085. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  11086. * or more PPDU stats records.
  11087. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  11088. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  11089. * then the message would start with the
  11090. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  11091. * below.
  11092. *
  11093. * |31 16|15|14|13 11|10 9|8|7 0|
  11094. * |-------------------------------------------------------------|
  11095. * | reserved |MSG_TYPE |
  11096. * |-------------------------------------------------------------|
  11097. * rec 0 | TLV header |
  11098. * rec 0 |-------------------------------------------------------------|
  11099. * rec 0 | ppdu successful bytes |
  11100. * rec 0 |-------------------------------------------------------------|
  11101. * rec 0 | ppdu retry bytes |
  11102. * rec 0 |-------------------------------------------------------------|
  11103. * rec 0 | ppdu failed bytes |
  11104. * rec 0 |-------------------------------------------------------------|
  11105. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  11106. * rec 0 |-------------------------------------------------------------|
  11107. * rec 0 | retried MSDUs | successful MSDUs |
  11108. * rec 0 |-------------------------------------------------------------|
  11109. * rec 0 | TX duration | failed MSDUs |
  11110. * rec 0 |-------------------------------------------------------------|
  11111. * ...
  11112. * |-------------------------------------------------------------|
  11113. * rec N | TLV header |
  11114. * rec N |-------------------------------------------------------------|
  11115. * rec N | ppdu successful bytes |
  11116. * rec N |-------------------------------------------------------------|
  11117. * rec N | ppdu retry bytes |
  11118. * rec N |-------------------------------------------------------------|
  11119. * rec N | ppdu failed bytes |
  11120. * rec N |-------------------------------------------------------------|
  11121. * rec N | peer id | S|SG| BW | BA |A|rate code|
  11122. * rec N |-------------------------------------------------------------|
  11123. * rec N | retried MSDUs | successful MSDUs |
  11124. * rec N |-------------------------------------------------------------|
  11125. * rec N | TX duration | failed MSDUs |
  11126. * rec N |-------------------------------------------------------------|
  11127. *
  11128. * where:
  11129. * A = is A-MPDU flag
  11130. * BA = block-ack failure flags
  11131. * BW = bandwidth spec
  11132. * SG = SGI enabled spec
  11133. * S = skipped rate ctrl
  11134. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  11135. *
  11136. * Header
  11137. * ------
  11138. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  11139. * dword0 - b'8:31 - reserved : Reserved for future use
  11140. *
  11141. * payload include below peer_stats information
  11142. * --------------------------------------------
  11143. * @TLV : HTT_PPDU_STATS_INFO_TLV
  11144. * @tx_success_bytes : total successful bytes in the PPDU.
  11145. * @tx_retry_bytes : total retried bytes in the PPDU.
  11146. * @tx_failed_bytes : total failed bytes in the PPDU.
  11147. * @tx_ratecode : rate code used for the PPDU.
  11148. * @is_ampdu : Indicates PPDU is AMPDU or not.
  11149. * @ba_ack_failed : BA/ACK failed for this PPDU
  11150. * b00 -> BA received
  11151. * b01 -> BA failed once
  11152. * b10 -> BA failed twice, when HW retry is enabled.
  11153. * @bw : BW
  11154. * b00 -> 20 MHz
  11155. * b01 -> 40 MHz
  11156. * b10 -> 80 MHz
  11157. * b11 -> 160 MHz (or 80+80)
  11158. * @sg : SGI enabled
  11159. * @s : skipped ratectrl
  11160. * @peer_id : peer id
  11161. * @tx_success_msdus : successful MSDUs
  11162. * @tx_retry_msdus : retried MSDUs
  11163. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  11164. * @tx_duration : Tx duration for the PPDU (microsecond units)
  11165. */
  11166. /**
  11167. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  11168. *
  11169. * @details
  11170. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  11171. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  11172. * This message will only be sent if the backpressure condition has existed
  11173. * continuously for an initial period (100 ms).
  11174. * Repeat messages with updated information will be sent after each
  11175. * subsequent period (100 ms) as long as the backpressure remains unabated.
  11176. * This message indicates the ring id along with current head and tail index
  11177. * locations (i.e. write and read indices).
  11178. * The backpressure time indicates the time in ms for which continous
  11179. * backpressure has been observed in the ring.
  11180. *
  11181. * The message format is as follows:
  11182. *
  11183. * |31 24|23 16|15 8|7 0|
  11184. * |----------------+----------------+----------------+----------------|
  11185. * | ring_id | ring_type | pdev_id | msg_type |
  11186. * |-------------------------------------------------------------------|
  11187. * | tail_idx | head_idx |
  11188. * |-------------------------------------------------------------------|
  11189. * | backpressure_time_ms |
  11190. * |-------------------------------------------------------------------|
  11191. *
  11192. * The message is interpreted as follows:
  11193. * dword0 - b'0:7 - msg_type: This will be set to
  11194. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  11195. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  11196. * 1, 2, 3 indicates pdev_id 0,1,2 and
  11197. the msg is for LMAC ring.
  11198. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  11199. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  11200. * htt_backpressure_lmac_ring_id. This represents
  11201. * the ring id for which continous backpressure is seen
  11202. *
  11203. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  11204. * the ring indicated by the ring_id
  11205. *
  11206. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  11207. * the ring indicated by the ring id
  11208. *
  11209. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  11210. * backpressure has been seen in the ring
  11211. * indicated by the ring_id.
  11212. * Units = milliseconds
  11213. */
  11214. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  11215. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  11216. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  11217. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  11218. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  11219. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  11220. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  11221. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  11222. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  11223. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  11224. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  11225. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  11226. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  11227. do { \
  11228. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  11229. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  11230. } while (0)
  11231. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  11232. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  11233. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  11234. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  11235. do { \
  11236. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  11237. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  11238. } while (0)
  11239. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  11240. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  11241. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  11242. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  11243. do { \
  11244. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  11245. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  11246. } while (0)
  11247. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  11248. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  11249. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  11250. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  11251. do { \
  11252. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  11253. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  11254. } while (0)
  11255. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  11256. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  11257. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  11258. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  11259. do { \
  11260. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  11261. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  11262. } while (0)
  11263. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  11264. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  11265. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  11266. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  11267. do { \
  11268. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  11269. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  11270. } while (0)
  11271. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  11272. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  11273. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  11274. enum htt_backpressure_ring_type {
  11275. HTT_SW_RING_TYPE_UMAC,
  11276. HTT_SW_RING_TYPE_LMAC,
  11277. HTT_SW_RING_TYPE_MAX,
  11278. };
  11279. /* Ring id for which the message is sent to host */
  11280. enum htt_backpressure_umac_ringid {
  11281. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  11282. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  11283. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  11284. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  11285. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  11286. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  11287. HTT_SW_RING_IDX_REO_REO2FW_RING,
  11288. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  11289. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  11290. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  11291. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  11292. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  11293. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  11294. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  11295. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  11296. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  11297. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  11298. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  11299. HTT_SW_UMAC_RING_IDX_MAX,
  11300. };
  11301. enum htt_backpressure_lmac_ringid {
  11302. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  11303. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  11304. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  11305. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  11306. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  11307. HTT_SW_RING_IDX_RXDMA2FW_RING,
  11308. HTT_SW_RING_IDX_RXDMA2SW_RING,
  11309. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  11310. HTT_SW_RING_IDX_RXDMA2REO_RING,
  11311. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  11312. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  11313. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  11314. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  11315. HTT_SW_LMAC_RING_IDX_MAX,
  11316. };
  11317. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  11318. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  11319. pdev_id: 8,
  11320. ring_type: 8, /* htt_backpressure_ring_type */
  11321. /*
  11322. * ring_id holds an enum value from either
  11323. * htt_backpressure_umac_ringid or
  11324. * htt_backpressure_lmac_ringid, based on
  11325. * the ring_type setting.
  11326. */
  11327. ring_id: 8;
  11328. A_UINT16 head_idx;
  11329. A_UINT16 tail_idx;
  11330. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  11331. } POSTPACK;
  11332. /*
  11333. * Defines two 32 bit words that can be used by the target to indicate a per
  11334. * user RU allocation and rate information.
  11335. *
  11336. * This information is currently provided in the "sw_response_reference_ptr"
  11337. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  11338. * "rx_ppdu_end_user_stats" TLV.
  11339. *
  11340. * VALID:
  11341. * The consumer of these words must explicitly check the valid bit,
  11342. * and only attempt interpretation of any of the remaining fields if
  11343. * the valid bit is set to 1.
  11344. *
  11345. * VERSION:
  11346. * The consumer of these words must also explicitly check the version bit,
  11347. * and only use the V0 definition if the VERSION field is set to 0.
  11348. *
  11349. * Version 1 is currently undefined, with the exception of the VALID and
  11350. * VERSION fields.
  11351. *
  11352. * Version 0:
  11353. *
  11354. * The fields below are duplicated per BW.
  11355. *
  11356. * The consumer must determine which BW field to use, based on the UL OFDMA
  11357. * PPDU BW indicated by HW.
  11358. *
  11359. * RU_START: RU26 start index for the user.
  11360. * Note that this is always using the RU26 index, regardless
  11361. * of the actual RU assigned to the user
  11362. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  11363. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  11364. *
  11365. * For example, 20MHz (the value in the top row is RU_START)
  11366. *
  11367. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  11368. * RU Size 1 (52): | | | | | |
  11369. * RU Size 2 (106): | | | |
  11370. * RU Size 3 (242): | |
  11371. *
  11372. * RU_SIZE: Indicates the RU size, as defined by enum
  11373. * htt_ul_ofdma_user_info_ru_size.
  11374. *
  11375. * LDPC: LDPC enabled (if 0, BCC is used)
  11376. *
  11377. * DCM: DCM enabled
  11378. *
  11379. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  11380. * |---------------------------------+--------------------------------|
  11381. * |Ver|Valid| FW internal |
  11382. * |---------------------------------+--------------------------------|
  11383. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  11384. * |---------------------------------+--------------------------------|
  11385. */
  11386. enum htt_ul_ofdma_user_info_ru_size {
  11387. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  11388. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  11389. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  11390. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  11391. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  11392. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  11393. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  11394. };
  11395. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  11396. struct htt_ul_ofdma_user_info_v0 {
  11397. A_UINT32 word0;
  11398. A_UINT32 word1;
  11399. };
  11400. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  11401. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  11402. union {
  11403. A_UINT32 word0;
  11404. struct {
  11405. A_UINT32 w0_fw_rsvd:30;
  11406. A_UINT32 w0_valid:1;
  11407. A_UINT32 w0_version:1;
  11408. };
  11409. };
  11410. union {
  11411. A_UINT32 word1;
  11412. struct {
  11413. A_UINT32 w1_nss:3;
  11414. A_UINT32 w1_mcs:4;
  11415. A_UINT32 w1_ldpc:1;
  11416. A_UINT32 w1_dcm:1;
  11417. A_UINT32 w1_ru_start:7;
  11418. A_UINT32 w1_ru_size:3;
  11419. A_UINT32 w1_trig_type:4;
  11420. A_UINT32 w1_unused:9;
  11421. };
  11422. };
  11423. } POSTPACK;
  11424. enum HTT_UL_OFDMA_TRIG_TYPE {
  11425. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  11426. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  11427. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  11428. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  11429. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  11430. };
  11431. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  11432. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  11433. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  11434. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  11435. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  11436. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  11437. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  11438. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  11439. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  11440. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  11441. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  11442. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  11443. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  11444. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  11445. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  11446. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  11447. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  11448. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  11449. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  11450. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  11451. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  11452. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  11453. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  11454. /*--- word 0 ---*/
  11455. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  11456. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  11457. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  11458. do { \
  11459. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  11460. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  11461. } while (0)
  11462. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  11463. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  11464. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  11465. do { \
  11466. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  11467. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  11468. } while (0)
  11469. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  11470. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  11471. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  11472. do { \
  11473. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  11474. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  11475. } while (0)
  11476. /*--- word 1 ---*/
  11477. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  11478. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  11479. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  11480. do { \
  11481. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  11482. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  11483. } while (0)
  11484. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  11485. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  11486. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  11487. do { \
  11488. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  11489. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  11490. } while (0)
  11491. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  11492. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  11493. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  11494. do { \
  11495. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  11496. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  11497. } while (0)
  11498. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  11499. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  11500. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  11501. do { \
  11502. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  11503. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  11504. } while (0)
  11505. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  11506. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  11507. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  11508. do { \
  11509. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  11510. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  11511. } while (0)
  11512. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  11513. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  11514. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  11515. do { \
  11516. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  11517. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  11518. } while (0)
  11519. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  11520. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  11521. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  11522. do { \
  11523. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  11524. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  11525. } while (0)
  11526. #endif