htt.h 635 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153
  1. /*
  2. * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. */
  202. #define HTT_CURRENT_VERSION_MAJOR 3
  203. #define HTT_CURRENT_VERSION_MINOR 83
  204. #define HTT_NUM_TX_FRAG_DESC 1024
  205. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  206. #define HTT_CHECK_SET_VAL(field, val) \
  207. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  208. /* macros to assist in sign-extending fields from HTT messages */
  209. #define HTT_SIGN_BIT_MASK(field) \
  210. ((field ## _M + (1 << field ## _S)) >> 1)
  211. #define HTT_SIGN_BIT(_val, field) \
  212. (_val & HTT_SIGN_BIT_MASK(field))
  213. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  214. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  215. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  216. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  217. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  218. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  219. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  220. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  221. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  222. /*
  223. * TEMPORARY:
  224. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  225. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  226. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  227. * updated.
  228. */
  229. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  230. /*
  231. * TEMPORARY:
  232. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  233. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  234. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  235. * updated.
  236. */
  237. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  238. /* HTT Access Category values */
  239. enum HTT_AC_WMM {
  240. /* WMM Access Categories */
  241. HTT_AC_WMM_BE = 0x0,
  242. HTT_AC_WMM_BK = 0x1,
  243. HTT_AC_WMM_VI = 0x2,
  244. HTT_AC_WMM_VO = 0x3,
  245. HTT_NUM_AC_WMM = 0x4,
  246. /* extension Access Categories */
  247. HTT_AC_EXT_NON_QOS = 0x4,
  248. HTT_AC_EXT_UCAST_MGMT = 0x5,
  249. HTT_AC_EXT_MCAST_DATA = 0x6,
  250. HTT_AC_EXT_MCAST_MGMT = 0x7,
  251. };
  252. enum HTT_AC_WMM_MASK {
  253. /* WMM Access Categories */
  254. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  255. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  256. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  257. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  258. /* extension Access Categories */
  259. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  260. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  261. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  262. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  263. };
  264. #define HTT_AC_MASK_WMM \
  265. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  266. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  267. #define HTT_AC_MASK_EXT \
  268. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  269. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  270. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  271. /*
  272. * htt_dbg_stats_type -
  273. * bit positions for each stats type within a stats type bitmask
  274. * The bitmask contains 24 bits.
  275. */
  276. enum htt_dbg_stats_type {
  277. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  278. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  279. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  280. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  281. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  282. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  283. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  284. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  285. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  286. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  287. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  288. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  289. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  290. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  291. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  292. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  293. /* bits 16-23 currently reserved */
  294. /* keep this last */
  295. HTT_DBG_NUM_STATS
  296. };
  297. /*=== HTT option selection TLVs ===
  298. * Certain HTT messages have alternatives or options.
  299. * For such cases, the host and target need to agree on which option to use.
  300. * Option specification TLVs can be appended to the VERSION_REQ and
  301. * VERSION_CONF messages to select options other than the default.
  302. * These TLVs are entirely optional - if they are not provided, there is a
  303. * well-defined default for each option. If they are provided, they can be
  304. * provided in any order. Each TLV can be present or absent independent of
  305. * the presence / absence of other TLVs.
  306. *
  307. * The HTT option selection TLVs use the following format:
  308. * |31 16|15 8|7 0|
  309. * |---------------------------------+----------------+----------------|
  310. * | value (payload) | length | tag |
  311. * |-------------------------------------------------------------------|
  312. * The value portion need not be only 2 bytes; it can be extended by any
  313. * integer number of 4-byte units. The total length of the TLV, including
  314. * the tag and length fields, must be a multiple of 4 bytes. The length
  315. * field specifies the total TLV size in 4-byte units. Thus, the typical
  316. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  317. * field, would store 0x1 in its length field, to show that the TLV occupies
  318. * a single 4-byte unit.
  319. */
  320. /*--- TLV header format - applies to all HTT option TLVs ---*/
  321. enum HTT_OPTION_TLV_TAGS {
  322. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  323. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  324. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  325. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  326. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  327. };
  328. PREPACK struct htt_option_tlv_header_t {
  329. A_UINT8 tag;
  330. A_UINT8 length;
  331. } POSTPACK;
  332. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  333. #define HTT_OPTION_TLV_TAG_S 0
  334. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  335. #define HTT_OPTION_TLV_LENGTH_S 8
  336. /*
  337. * value0 - 16 bit value field stored in word0
  338. * The TLV's value field may be longer than 2 bytes, in which case
  339. * the remainder of the value is stored in word1, word2, etc.
  340. */
  341. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  342. #define HTT_OPTION_TLV_VALUE0_S 16
  343. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  344. do { \
  345. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  346. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  347. } while (0)
  348. #define HTT_OPTION_TLV_TAG_GET(word) \
  349. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  350. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  351. do { \
  352. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  353. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  354. } while (0)
  355. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  356. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  357. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  358. do { \
  359. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  360. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  361. } while (0)
  362. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  363. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  364. /*--- format of specific HTT option TLVs ---*/
  365. /*
  366. * HTT option TLV for specifying LL bus address size
  367. * Some chips require bus addresses used by the target to access buffers
  368. * within the host's memory to be 32 bits; others require bus addresses
  369. * used by the target to access buffers within the host's memory to be
  370. * 64 bits.
  371. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  372. * a suffix to the VERSION_CONF message to specify which bus address format
  373. * the target requires.
  374. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  375. * default to providing bus addresses to the target in 32-bit format.
  376. */
  377. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  378. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  379. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  380. };
  381. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  382. struct htt_option_tlv_header_t hdr;
  383. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  384. } POSTPACK;
  385. /*
  386. * HTT option TLV for specifying whether HL systems should indicate
  387. * over-the-air tx completion for individual frames, or should instead
  388. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  389. * requests an OTA tx completion for a particular tx frame.
  390. * This option does not apply to LL systems, where the TX_COMPL_IND
  391. * is mandatory.
  392. * This option is primarily intended for HL systems in which the tx frame
  393. * downloads over the host --> target bus are as slow as or slower than
  394. * the transmissions over the WLAN PHY. For cases where the bus is faster
  395. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  396. * and consquently will send one TX_COMPL_IND message that covers several
  397. * tx frames. For cases where the WLAN PHY is faster than the bus,
  398. * the target will end up transmitting very short A-MPDUs, and consequently
  399. * sending many TX_COMPL_IND messages, which each cover a very small number
  400. * of tx frames.
  401. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  402. * a suffix to the VERSION_REQ message to request whether the host desires to
  403. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  404. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  405. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  406. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  407. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  408. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  409. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  410. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  411. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  412. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  413. * TLV.
  414. */
  415. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  416. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  417. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  418. };
  419. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  420. struct htt_option_tlv_header_t hdr;
  421. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  422. } POSTPACK;
  423. /*
  424. * HTT option TLV for specifying how many tx queue groups the target
  425. * may establish.
  426. * This TLV specifies the maximum value the target may send in the
  427. * txq_group_id field of any TXQ_GROUP information elements sent by
  428. * the target to the host. This allows the host to pre-allocate an
  429. * appropriate number of tx queue group structs.
  430. *
  431. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  432. * a suffix to the VERSION_REQ message to specify whether the host supports
  433. * tx queue groups at all, and if so if there is any limit on the number of
  434. * tx queue groups that the host supports.
  435. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  436. * a suffix to the VERSION_CONF message. If the host has specified in the
  437. * VER_REQ message a limit on the number of tx queue groups the host can
  438. * supprt, the target shall limit its specification of the maximum tx groups
  439. * to be no larger than this host-specified limit.
  440. *
  441. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  442. * shall preallocate 4 tx queue group structs, and the target shall not
  443. * specify a txq_group_id larger than 3.
  444. */
  445. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  446. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  447. /*
  448. * values 1 through N specify the max number of tx queue groups
  449. * the sender supports
  450. */
  451. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  452. };
  453. /* TEMPORARY backwards-compatibility alias for a typo fix -
  454. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  455. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  456. * to support the old name (with the typo) until all references to the
  457. * old name are replaced with the new name.
  458. */
  459. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  460. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  461. struct htt_option_tlv_header_t hdr;
  462. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  463. } POSTPACK;
  464. /*
  465. * HTT option TLV for specifying whether the target supports an extended
  466. * version of the HTT tx descriptor. If the target provides this TLV
  467. * and specifies in the TLV that the target supports an extended version
  468. * of the HTT tx descriptor, the target must check the "extension" bit in
  469. * the HTT tx descriptor, and if the extension bit is set, to expect a
  470. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  471. * descriptor. Furthermore, the target must provide room for the HTT
  472. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  473. * This option is intended for systems where the host needs to explicitly
  474. * control the transmission parameters such as tx power for individual
  475. * tx frames.
  476. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  477. * as a suffix to the VERSION_CONF message to explicitly specify whether
  478. * the target supports the HTT tx MSDU extension descriptor.
  479. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  480. * by the host as lack of target support for the HTT tx MSDU extension
  481. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  482. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  483. * the HTT tx MSDU extension descriptor.
  484. * The host is not required to provide the HTT tx MSDU extension descriptor
  485. * just because the target supports it; the target must check the
  486. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  487. * extension descriptor is present.
  488. */
  489. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  490. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  491. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  492. };
  493. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  494. struct htt_option_tlv_header_t hdr;
  495. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  496. } POSTPACK;
  497. /*=== host -> target messages ===============================================*/
  498. enum htt_h2t_msg_type {
  499. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  500. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  501. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  502. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  503. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  504. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  505. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  506. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  507. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  508. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  509. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  510. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  511. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  512. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  513. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  514. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  515. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  516. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  517. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  518. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  519. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  520. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  521. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  522. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  523. /* keep this last */
  524. HTT_H2T_NUM_MSGS
  525. };
  526. /*
  527. * HTT host to target message type -
  528. * stored in bits 7:0 of the first word of the message
  529. */
  530. #define HTT_H2T_MSG_TYPE_M 0xff
  531. #define HTT_H2T_MSG_TYPE_S 0
  532. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  533. do { \
  534. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  535. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  536. } while (0)
  537. #define HTT_H2T_MSG_TYPE_GET(word) \
  538. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  539. /**
  540. * @brief host -> target version number request message definition
  541. *
  542. * |31 24|23 16|15 8|7 0|
  543. * |----------------+----------------+----------------+----------------|
  544. * | reserved | msg type |
  545. * |-------------------------------------------------------------------|
  546. * : option request TLV (optional) |
  547. * :...................................................................:
  548. *
  549. * The VER_REQ message may consist of a single 4-byte word, or may be
  550. * extended with TLVs that specify which HTT options the host is requesting
  551. * from the target.
  552. * The following option TLVs may be appended to the VER_REQ message:
  553. * - HL_SUPPRESS_TX_COMPL_IND
  554. * - HL_MAX_TX_QUEUE_GROUPS
  555. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  556. * may be appended to the VER_REQ message (but only one TLV of each type).
  557. *
  558. * Header fields:
  559. * - MSG_TYPE
  560. * Bits 7:0
  561. * Purpose: identifies this as a version number request message
  562. * Value: 0x0
  563. */
  564. #define HTT_VER_REQ_BYTES 4
  565. /* TBDXXX: figure out a reasonable number */
  566. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  567. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  568. /**
  569. * @brief HTT tx MSDU descriptor
  570. *
  571. * @details
  572. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  573. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  574. * the target firmware needs for the FW's tx processing, particularly
  575. * for creating the HW msdu descriptor.
  576. * The same HTT tx descriptor is used for HL and LL systems, though
  577. * a few fields within the tx descriptor are used only by LL or
  578. * only by HL.
  579. * The HTT tx descriptor is defined in two manners: by a struct with
  580. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  581. * definitions.
  582. * The target should use the struct def, for simplicitly and clarity,
  583. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  584. * neutral. Specifically, the host shall use the get/set macros built
  585. * around the mask + shift defs.
  586. */
  587. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  588. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  589. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  590. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  591. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  592. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  593. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  594. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  595. #define HTT_TX_VDEV_ID_WORD 0
  596. #define HTT_TX_VDEV_ID_MASK 0x3f
  597. #define HTT_TX_VDEV_ID_SHIFT 16
  598. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  599. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  600. #define HTT_TX_MSDU_LEN_DWORD 1
  601. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  602. /*
  603. * HTT_VAR_PADDR macros
  604. * Allow physical / bus addresses to be either a single 32-bit value,
  605. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  606. */
  607. #define HTT_VAR_PADDR32(var_name) \
  608. A_UINT32 var_name
  609. #define HTT_VAR_PADDR64_LE(var_name) \
  610. struct { \
  611. /* little-endian: lo precedes hi */ \
  612. A_UINT32 lo; \
  613. A_UINT32 hi; \
  614. } var_name
  615. /*
  616. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  617. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  618. * addresses are stored in a XXX-bit field.
  619. * This macro is used to define both htt_tx_msdu_desc32_t and
  620. * htt_tx_msdu_desc64_t structs.
  621. */
  622. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  623. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  624. { \
  625. /* DWORD 0: flags and meta-data */ \
  626. A_UINT32 \
  627. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  628. \
  629. /* pkt_subtype - \
  630. * Detailed specification of the tx frame contents, extending the \
  631. * general specification provided by pkt_type. \
  632. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  633. * pkt_type | pkt_subtype \
  634. * ============================================================== \
  635. * 802.3 | bit 0:3 - Reserved \
  636. * | bit 4: 0x0 - Copy-Engine Classification Results \
  637. * | not appended to the HTT message \
  638. * | 0x1 - Copy-Engine Classification Results \
  639. * | appended to the HTT message in the \
  640. * | format: \
  641. * | [HTT tx desc, frame header, \
  642. * | CE classification results] \
  643. * | The CE classification results begin \
  644. * | at the next 4-byte boundary after \
  645. * | the frame header. \
  646. * ------------+------------------------------------------------- \
  647. * Eth2 | bit 0:3 - Reserved \
  648. * | bit 4: 0x0 - Copy-Engine Classification Results \
  649. * | not appended to the HTT message \
  650. * | 0x1 - Copy-Engine Classification Results \
  651. * | appended to the HTT message. \
  652. * | See the above specification of the \
  653. * | CE classification results location. \
  654. * ------------+------------------------------------------------- \
  655. * native WiFi | bit 0:3 - Reserved \
  656. * | bit 4: 0x0 - Copy-Engine Classification Results \
  657. * | not appended to the HTT message \
  658. * | 0x1 - Copy-Engine Classification Results \
  659. * | appended to the HTT message. \
  660. * | See the above specification of the \
  661. * | CE classification results location. \
  662. * ------------+------------------------------------------------- \
  663. * mgmt | 0x0 - 802.11 MAC header absent \
  664. * | 0x1 - 802.11 MAC header present \
  665. * ------------+------------------------------------------------- \
  666. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  667. * | 0x1 - 802.11 MAC header present \
  668. * | bit 1: 0x0 - allow aggregation \
  669. * | 0x1 - don't allow aggregation \
  670. * | bit 2: 0x0 - perform encryption \
  671. * | 0x1 - don't perform encryption \
  672. * | bit 3: 0x0 - perform tx classification / queuing \
  673. * | 0x1 - don't perform tx classification; \
  674. * | insert the frame into the "misc" \
  675. * | tx queue \
  676. * | bit 4: 0x0 - Copy-Engine Classification Results \
  677. * | not appended to the HTT message \
  678. * | 0x1 - Copy-Engine Classification Results \
  679. * | appended to the HTT message. \
  680. * | See the above specification of the \
  681. * | CE classification results location. \
  682. */ \
  683. pkt_subtype: 5, \
  684. \
  685. /* pkt_type - \
  686. * General specification of the tx frame contents. \
  687. * The htt_pkt_type enum should be used to specify and check the \
  688. * value of this field. \
  689. */ \
  690. pkt_type: 3, \
  691. \
  692. /* vdev_id - \
  693. * ID for the vdev that is sending this tx frame. \
  694. * For certain non-standard packet types, e.g. pkt_type == raw \
  695. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  696. * This field is used primarily for determining where to queue \
  697. * broadcast and multicast frames. \
  698. */ \
  699. vdev_id: 6, \
  700. /* ext_tid - \
  701. * The extended traffic ID. \
  702. * If the TID is unknown, the extended TID is set to \
  703. * HTT_TX_EXT_TID_INVALID. \
  704. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  705. * value of the QoS TID. \
  706. * If the tx frame is non-QoS data, then the extended TID is set to \
  707. * HTT_TX_EXT_TID_NON_QOS. \
  708. * If the tx frame is multicast or broadcast, then the extended TID \
  709. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  710. */ \
  711. ext_tid: 5, \
  712. \
  713. /* postponed - \
  714. * This flag indicates whether the tx frame has been downloaded to \
  715. * the target before but discarded by the target, and now is being \
  716. * downloaded again; or if this is a new frame that is being \
  717. * downloaded for the first time. \
  718. * This flag allows the target to determine the correct order for \
  719. * transmitting new vs. old frames. \
  720. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  721. * This flag only applies to HL systems, since in LL systems, \
  722. * the tx flow control is handled entirely within the target. \
  723. */ \
  724. postponed: 1, \
  725. \
  726. /* extension - \
  727. * This flag indicates whether a HTT tx MSDU extension descriptor \
  728. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  729. * \
  730. * 0x0 - no extension MSDU descriptor is present \
  731. * 0x1 - an extension MSDU descriptor immediately follows the \
  732. * regular MSDU descriptor \
  733. */ \
  734. extension: 1, \
  735. \
  736. /* cksum_offload - \
  737. * This flag indicates whether checksum offload is enabled or not \
  738. * for this frame. Target FW use this flag to turn on HW checksumming \
  739. * 0x0 - No checksum offload \
  740. * 0x1 - L3 header checksum only \
  741. * 0x2 - L4 checksum only \
  742. * 0x3 - L3 header checksum + L4 checksum \
  743. */ \
  744. cksum_offload: 2, \
  745. \
  746. /* tx_comp_req - \
  747. * This flag indicates whether Tx Completion \
  748. * from fw is required or not. \
  749. * This flag is only relevant if tx completion is not \
  750. * universally enabled. \
  751. * For all LL systems, tx completion is mandatory, \
  752. * so this flag will be irrelevant. \
  753. * For HL systems tx completion is optional, but HL systems in which \
  754. * the bus throughput exceeds the WLAN throughput will \
  755. * probably want to always use tx completion, and thus \
  756. * would not check this flag. \
  757. * This flag is required when tx completions are not used universally, \
  758. * but are still required for certain tx frames for which \
  759. * an OTA delivery acknowledgment is needed by the host. \
  760. * In practice, this would be for HL systems in which the \
  761. * bus throughput is less than the WLAN throughput. \
  762. * \
  763. * 0x0 - Tx Completion Indication from Fw not required \
  764. * 0x1 - Tx Completion Indication from Fw is required \
  765. */ \
  766. tx_compl_req: 1; \
  767. \
  768. \
  769. /* DWORD 1: MSDU length and ID */ \
  770. A_UINT32 \
  771. len: 16, /* MSDU length, in bytes */ \
  772. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  773. * and this id is used to calculate fragmentation \
  774. * descriptor pointer inside the target based on \
  775. * the base address, configured inside the target. \
  776. */ \
  777. \
  778. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  779. /* frags_desc_ptr - \
  780. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  781. * where the tx frame's fragments reside in memory. \
  782. * This field only applies to LL systems, since in HL systems the \
  783. * (degenerate single-fragment) fragmentation descriptor is created \
  784. * within the target. \
  785. */ \
  786. _paddr__frags_desc_ptr_; \
  787. \
  788. /* DWORD 3 (or 4): peerid, chanfreq */ \
  789. /* \
  790. * Peer ID : Target can use this value to know which peer-id packet \
  791. * destined to. \
  792. * It's intended to be specified by host in case of NAWDS. \
  793. */ \
  794. A_UINT16 peerid; \
  795. \
  796. /* \
  797. * Channel frequency: This identifies the desired channel \
  798. * frequency (in mhz) for tx frames. This is used by FW to help \
  799. * determine when it is safe to transmit or drop frames for \
  800. * off-channel operation. \
  801. * The default value of zero indicates to FW that the corresponding \
  802. * VDEV's home channel (if there is one) is the desired channel \
  803. * frequency. \
  804. */ \
  805. A_UINT16 chanfreq; \
  806. \
  807. /* Reason reserved is commented is increasing the htt structure size \
  808. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  809. * A_UINT32 reserved_dword3_bits0_31; \
  810. */ \
  811. } POSTPACK
  812. /* define a htt_tx_msdu_desc32_t type */
  813. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  814. /* define a htt_tx_msdu_desc64_t type */
  815. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  816. /*
  817. * Make htt_tx_msdu_desc_t be an alias for either
  818. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  819. */
  820. #if HTT_PADDR64
  821. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  822. #else
  823. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  824. #endif
  825. /* decriptor information for Management frame*/
  826. /*
  827. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  828. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  829. */
  830. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  831. extern A_UINT32 mgmt_hdr_len;
  832. PREPACK struct htt_mgmt_tx_desc_t {
  833. A_UINT32 msg_type;
  834. #if HTT_PADDR64
  835. A_UINT64 frag_paddr; /* DMAble address of the data */
  836. #else
  837. A_UINT32 frag_paddr; /* DMAble address of the data */
  838. #endif
  839. A_UINT32 desc_id; /* returned to host during completion
  840. * to free the meory*/
  841. A_UINT32 len; /* Fragment length */
  842. A_UINT32 vdev_id; /* virtual device ID*/
  843. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  844. } POSTPACK;
  845. PREPACK struct htt_mgmt_tx_compl_ind {
  846. A_UINT32 desc_id;
  847. A_UINT32 status;
  848. } POSTPACK;
  849. /*
  850. * This SDU header size comes from the summation of the following:
  851. * 1. Max of:
  852. * a. Native WiFi header, for native WiFi frames: 24 bytes
  853. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  854. * b. 802.11 header, for raw frames: 36 bytes
  855. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  856. * QoS header, HT header)
  857. * c. 802.3 header, for ethernet frames: 14 bytes
  858. * (destination address, source address, ethertype / length)
  859. * 2. Max of:
  860. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  861. * b. IPv6 header, up through the Traffic Class: 2 bytes
  862. * 3. 802.1Q VLAN header: 4 bytes
  863. * 4. LLC/SNAP header: 8 bytes
  864. */
  865. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  866. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  867. #define HTT_TX_HDR_SIZE_ETHERNET 14
  868. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  869. A_COMPILE_TIME_ASSERT(
  870. htt_encap_hdr_size_max_check_nwifi,
  871. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  872. A_COMPILE_TIME_ASSERT(
  873. htt_encap_hdr_size_max_check_enet,
  874. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  875. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  876. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  877. #define HTT_TX_HDR_SIZE_802_1Q 4
  878. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  879. #define HTT_COMMON_TX_FRM_HDR_LEN \
  880. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  881. HTT_TX_HDR_SIZE_802_1Q + \
  882. HTT_TX_HDR_SIZE_LLC_SNAP)
  883. #define HTT_HL_TX_FRM_HDR_LEN \
  884. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  885. #define HTT_LL_TX_FRM_HDR_LEN \
  886. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  887. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  888. /* dword 0 */
  889. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  890. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  891. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  892. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  893. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  894. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  895. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  896. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  897. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  898. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  899. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  900. #define HTT_TX_DESC_PKT_TYPE_S 13
  901. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  902. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  903. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  904. #define HTT_TX_DESC_VDEV_ID_S 16
  905. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  906. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  907. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  908. #define HTT_TX_DESC_EXT_TID_S 22
  909. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  910. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  911. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  912. #define HTT_TX_DESC_POSTPONED_S 27
  913. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  914. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  915. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  916. #define HTT_TX_DESC_EXTENSION_S 28
  917. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  918. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  919. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  920. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  921. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  922. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  923. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  924. #define HTT_TX_DESC_TX_COMP_S 31
  925. /* dword 1 */
  926. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  927. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  928. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  929. #define HTT_TX_DESC_FRM_LEN_S 0
  930. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  931. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  932. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  933. #define HTT_TX_DESC_FRM_ID_S 16
  934. /* dword 2 */
  935. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  936. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  937. /* for systems using 64-bit format for bus addresses */
  938. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  939. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  940. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  941. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  942. /* for systems using 32-bit format for bus addresses */
  943. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  944. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  945. /* dword 3 */
  946. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  947. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  948. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  949. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  950. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  951. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  952. #if HTT_PADDR64
  953. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  954. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  955. #else
  956. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  957. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  958. #endif
  959. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  960. #define HTT_TX_DESC_PEER_ID_S 0
  961. /*
  962. * TEMPORARY:
  963. * The original definitions for the PEER_ID fields contained typos
  964. * (with _DESC_PADDR appended to this PEER_ID field name).
  965. * Retain deprecated original names for PEER_ID fields until all code that
  966. * refers to them has been updated.
  967. */
  968. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  969. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  970. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  971. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  972. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  973. HTT_TX_DESC_PEER_ID_M
  974. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  975. HTT_TX_DESC_PEER_ID_S
  976. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  977. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  978. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  979. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  980. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  981. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  982. #if HTT_PADDR64
  983. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  984. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  985. #else
  986. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  987. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  988. #endif
  989. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  990. #define HTT_TX_DESC_CHAN_FREQ_S 16
  991. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  992. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  993. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  994. do { \
  995. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  996. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  997. } while (0)
  998. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  999. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1000. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1003. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1004. } while (0)
  1005. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1006. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1007. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1008. do { \
  1009. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1010. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1011. } while (0)
  1012. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1013. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1014. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1017. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1018. } while (0)
  1019. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1020. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1021. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1022. do { \
  1023. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1024. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1025. } while (0)
  1026. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1027. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1028. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1032. } while (0)
  1033. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1034. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1035. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1036. do { \
  1037. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1038. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1039. } while (0)
  1040. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1041. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1042. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1043. do { \
  1044. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1045. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1046. } while (0)
  1047. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1048. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1049. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1050. do { \
  1051. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1052. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1053. } while (0)
  1054. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1055. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1056. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1057. do { \
  1058. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1059. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1060. } while (0)
  1061. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1062. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1063. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1064. do { \
  1065. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1066. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1067. } while (0)
  1068. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1069. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1070. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1071. do { \
  1072. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1073. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1074. } while (0)
  1075. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1076. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1077. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1078. do { \
  1079. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1080. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1081. } while (0)
  1082. /* enums used in the HTT tx MSDU extension descriptor */
  1083. enum {
  1084. htt_tx_guard_interval_regular = 0,
  1085. htt_tx_guard_interval_short = 1,
  1086. };
  1087. enum {
  1088. htt_tx_preamble_type_ofdm = 0,
  1089. htt_tx_preamble_type_cck = 1,
  1090. htt_tx_preamble_type_ht = 2,
  1091. htt_tx_preamble_type_vht = 3,
  1092. };
  1093. enum {
  1094. htt_tx_bandwidth_5MHz = 0,
  1095. htt_tx_bandwidth_10MHz = 1,
  1096. htt_tx_bandwidth_20MHz = 2,
  1097. htt_tx_bandwidth_40MHz = 3,
  1098. htt_tx_bandwidth_80MHz = 4,
  1099. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1100. };
  1101. /**
  1102. * @brief HTT tx MSDU extension descriptor
  1103. * @details
  1104. * If the target supports HTT tx MSDU extension descriptors, the host has
  1105. * the option of appending the following struct following the regular
  1106. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1107. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1108. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1109. * tx specs for each frame.
  1110. */
  1111. PREPACK struct htt_tx_msdu_desc_ext_t {
  1112. /* DWORD 0: flags */
  1113. A_UINT32
  1114. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1115. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1116. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1117. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1118. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1119. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1120. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1121. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1122. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1123. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1124. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1125. /* DWORD 1: tx power, tx rate, tx BW */
  1126. A_UINT32
  1127. /* pwr -
  1128. * Specify what power the tx frame needs to be transmitted at.
  1129. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1130. * The value needs to be appropriately sign-extended when extracting
  1131. * the value from the message and storing it in a variable that is
  1132. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1133. * automatically handles this sign-extension.)
  1134. * If the transmission uses multiple tx chains, this power spec is
  1135. * the total transmit power, assuming incoherent combination of
  1136. * per-chain power to produce the total power.
  1137. */
  1138. pwr: 8,
  1139. /* mcs_mask -
  1140. * Specify the allowable values for MCS index (modulation and coding)
  1141. * to use for transmitting the frame.
  1142. *
  1143. * For HT / VHT preamble types, this mask directly corresponds to
  1144. * the HT or VHT MCS indices that are allowed. For each bit N set
  1145. * within the mask, MCS index N is allowed for transmitting the frame.
  1146. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1147. * rates versus OFDM rates, so the host has the option of specifying
  1148. * that the target must transmit the frame with CCK or OFDM rates
  1149. * (not HT or VHT), but leaving the decision to the target whether
  1150. * to use CCK or OFDM.
  1151. *
  1152. * For CCK and OFDM, the bits within this mask are interpreted as
  1153. * follows:
  1154. * bit 0 -> CCK 1 Mbps rate is allowed
  1155. * bit 1 -> CCK 2 Mbps rate is allowed
  1156. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1157. * bit 3 -> CCK 11 Mbps rate is allowed
  1158. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1159. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1160. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1161. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1162. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1163. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1164. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1165. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1166. *
  1167. * The MCS index specification needs to be compatible with the
  1168. * bandwidth mask specification. For example, a MCS index == 9
  1169. * specification is inconsistent with a preamble type == VHT,
  1170. * Nss == 1, and channel bandwidth == 20 MHz.
  1171. *
  1172. * Furthermore, the host has only a limited ability to specify to
  1173. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1174. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1175. */
  1176. mcs_mask: 12,
  1177. /* nss_mask -
  1178. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1179. * Each bit in this mask corresponds to a Nss value:
  1180. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1181. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1182. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1183. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1184. * The values in the Nss mask must be suitable for the recipient, e.g.
  1185. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1186. * recipient which only supports 2x2 MIMO.
  1187. */
  1188. nss_mask: 4,
  1189. /* guard_interval -
  1190. * Specify a htt_tx_guard_interval enum value to indicate whether
  1191. * the transmission should use a regular guard interval or a
  1192. * short guard interval.
  1193. */
  1194. guard_interval: 1,
  1195. /* preamble_type_mask -
  1196. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1197. * may choose from for transmitting this frame.
  1198. * The bits in this mask correspond to the values in the
  1199. * htt_tx_preamble_type enum. For example, to allow the target
  1200. * to transmit the frame as either CCK or OFDM, this field would
  1201. * be set to
  1202. * (1 << htt_tx_preamble_type_ofdm) |
  1203. * (1 << htt_tx_preamble_type_cck)
  1204. */
  1205. preamble_type_mask: 4,
  1206. reserved1_31_29: 3; /* unused, set to 0x0 */
  1207. /* DWORD 2: tx chain mask, tx retries */
  1208. A_UINT32
  1209. /* chain_mask - specify which chains to transmit from */
  1210. chain_mask: 4,
  1211. /* retry_limit -
  1212. * Specify the maximum number of transmissions, including the
  1213. * initial transmission, to attempt before giving up if no ack
  1214. * is received.
  1215. * If the tx rate is specified, then all retries shall use the
  1216. * same rate as the initial transmission.
  1217. * If no tx rate is specified, the target can choose whether to
  1218. * retain the original rate during the retransmissions, or to
  1219. * fall back to a more robust rate.
  1220. */
  1221. retry_limit: 4,
  1222. /* bandwidth_mask -
  1223. * Specify what channel widths may be used for the transmission.
  1224. * A value of zero indicates "don't care" - the target may choose
  1225. * the transmission bandwidth.
  1226. * The bits within this mask correspond to the htt_tx_bandwidth
  1227. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1228. * The bandwidth_mask must be consistent with the preamble_type_mask
  1229. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1230. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1231. */
  1232. bandwidth_mask: 6,
  1233. reserved2_31_14: 18; /* unused, set to 0x0 */
  1234. /* DWORD 3: tx expiry time (TSF) LSBs */
  1235. A_UINT32 expire_tsf_lo;
  1236. /* DWORD 4: tx expiry time (TSF) MSBs */
  1237. A_UINT32 expire_tsf_hi;
  1238. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1239. } POSTPACK;
  1240. /* DWORD 0 */
  1241. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1242. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1243. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1244. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1246. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1247. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1249. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1250. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1251. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1252. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1253. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1254. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1255. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1256. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1257. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1259. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1260. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1261. /* DWORD 1 */
  1262. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1263. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1264. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1265. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1266. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1267. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1268. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1269. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1270. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1271. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1272. /* DWORD 2 */
  1273. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1274. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1275. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1276. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1277. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1278. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1279. /* DWORD 0 */
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1281. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1286. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1287. } while (0)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1289. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1290. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1291. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1295. } while (0)
  1296. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1297. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1298. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1299. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL( \
  1302. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1303. ((_var) |= ((_val) \
  1304. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1305. } while (0)
  1306. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL( \
  1312. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1313. ((_var) |= ((_val) \
  1314. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1315. } while (0)
  1316. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1317. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1318. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1319. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1320. do { \
  1321. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1322. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1323. } while (0)
  1324. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1325. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1326. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1327. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1328. do { \
  1329. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1330. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1331. } while (0)
  1332. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1333. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1334. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1335. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1336. do { \
  1337. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1338. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1339. } while (0)
  1340. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1341. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1342. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1343. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1344. do { \
  1345. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1346. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1347. } while (0)
  1348. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1349. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1350. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1351. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1354. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1355. } while (0)
  1356. /* DWORD 1 */
  1357. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1358. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1359. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1360. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1361. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1362. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1363. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1364. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1365. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1366. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1367. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1368. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1369. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1370. do { \
  1371. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1372. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1373. } while (0)
  1374. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1375. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1376. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1377. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1378. do { \
  1379. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1380. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1381. } while (0)
  1382. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1383. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1384. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1385. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1386. do { \
  1387. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1388. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1389. } while (0)
  1390. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1391. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1392. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1393. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1394. do { \
  1395. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1396. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1397. } while (0)
  1398. /* DWORD 2 */
  1399. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1400. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1401. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1402. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1403. do { \
  1404. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1405. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1406. } while (0)
  1407. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1408. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1409. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1410. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1411. do { \
  1412. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1413. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1414. } while (0)
  1415. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1416. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1417. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1418. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1419. do { \
  1420. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1421. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1422. } while (0)
  1423. typedef enum {
  1424. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1425. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1426. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1427. } htt_11ax_ltf_subtype_t;
  1428. typedef enum {
  1429. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1430. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1431. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1432. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1433. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1434. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1435. } htt_tx_ext2_preamble_type_t;
  1436. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1437. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1438. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1439. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1440. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1441. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1442. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1443. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1444. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1445. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1446. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1447. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1448. /**
  1449. * @brief HTT tx MSDU extension descriptor v2
  1450. * @details
  1451. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1452. * is received as tcl_exit_base->host_meta_info in firmware.
  1453. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1454. * are already part of tcl_exit_base.
  1455. */
  1456. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1457. /* DWORD 0: flags */
  1458. A_UINT32
  1459. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1460. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1461. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1462. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1463. valid_retries : 1, /* if set, tx retries spec is valid */
  1464. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1465. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1466. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1467. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1468. valid_key_flags : 1, /* if set, key flags is valid */
  1469. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1470. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1471. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1472. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1473. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1474. 1 = ENCRYPT,
  1475. 2 ~ 3 - Reserved */
  1476. /* retry_limit -
  1477. * Specify the maximum number of transmissions, including the
  1478. * initial transmission, to attempt before giving up if no ack
  1479. * is received.
  1480. * If the tx rate is specified, then all retries shall use the
  1481. * same rate as the initial transmission.
  1482. * If no tx rate is specified, the target can choose whether to
  1483. * retain the original rate during the retransmissions, or to
  1484. * fall back to a more robust rate.
  1485. */
  1486. retry_limit : 4,
  1487. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1488. * Valid only for 11ax preamble types HE_SU
  1489. * and HE_EXT_SU
  1490. */
  1491. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1492. * Valid only for 11ax preamble types HE_SU
  1493. * and HE_EXT_SU
  1494. */
  1495. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1496. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1497. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1498. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1499. */
  1500. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1501. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1502. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1503. * Use cases:
  1504. * Any time firmware uses TQM-BYPASS for Data
  1505. * TID, firmware expect host to set this bit.
  1506. */
  1507. /* DWORD 1: tx power, tx rate */
  1508. A_UINT32
  1509. power : 8, /* unit of the power field is 0.5 dbm
  1510. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1511. * signed value ranging from -64dbm to 63.5 dbm
  1512. */
  1513. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1514. * Setting more than one MCS isn't currently
  1515. * supported by the target (but is supported
  1516. * in the interface in case in the future
  1517. * the target supports specifications of
  1518. * a limited set of MCS values.
  1519. */
  1520. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1521. * Setting more than one Nss isn't currently
  1522. * supported by the target (but is supported
  1523. * in the interface in case in the future
  1524. * the target supports specifications of
  1525. * a limited set of Nss values.
  1526. */
  1527. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1528. update_peer_cache : 1; /* When set these custom values will be
  1529. * used for all packets, until the next
  1530. * update via this ext header.
  1531. * This is to make sure not all packets
  1532. * need to include this header.
  1533. */
  1534. /* DWORD 2: tx chain mask, tx retries */
  1535. A_UINT32
  1536. /* chain_mask - specify which chains to transmit from */
  1537. chain_mask : 8,
  1538. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1539. * TODO: Update Enum values for key_flags
  1540. */
  1541. /*
  1542. * Channel frequency: This identifies the desired channel
  1543. * frequency (in MHz) for tx frames. This is used by FW to help
  1544. * determine when it is safe to transmit or drop frames for
  1545. * off-channel operation.
  1546. * The default value of zero indicates to FW that the corresponding
  1547. * VDEV's home channel (if there is one) is the desired channel
  1548. * frequency.
  1549. */
  1550. chanfreq : 16;
  1551. /* DWORD 3: tx expiry time (TSF) LSBs */
  1552. A_UINT32 expire_tsf_lo;
  1553. /* DWORD 4: tx expiry time (TSF) MSBs */
  1554. A_UINT32 expire_tsf_hi;
  1555. /* DWORD 5: flags to control routing / processing of the MSDU */
  1556. A_UINT32
  1557. /* learning_frame
  1558. * When this flag is set, this frame will be dropped by FW
  1559. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1560. */
  1561. learning_frame : 1,
  1562. /* send_as_standalone
  1563. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1564. * i.e. with no A-MSDU or A-MPDU aggregation.
  1565. * The scope is extended to other use-cases.
  1566. */
  1567. send_as_standalone : 1,
  1568. /* is_host_opaque_valid
  1569. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1570. * with valid information.
  1571. */
  1572. is_host_opaque_valid : 1,
  1573. rsvd0 : 29;
  1574. /* DWORD 6 : Host opaque cookie for special frames */
  1575. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1576. rsvd1 : 16;
  1577. /*
  1578. * This structure can be expanded further up to 40 bytes
  1579. * by adding further DWORDs as needed.
  1580. */
  1581. } POSTPACK;
  1582. /* DWORD 0 */
  1583. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1585. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1586. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1587. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1588. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1589. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1590. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1592. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1593. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1595. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1596. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1597. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1598. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1599. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1600. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1602. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1603. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1605. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1606. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1607. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1608. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1609. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1610. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1611. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1612. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1613. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1614. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1615. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1616. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1617. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1618. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1619. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1620. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1621. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1622. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1623. /* DWORD 1 */
  1624. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1625. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1626. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1627. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1628. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1629. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1630. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1631. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1632. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1633. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1634. /* DWORD 2 */
  1635. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1636. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1637. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1638. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1639. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1640. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1641. /* DWORD 5 */
  1642. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1643. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1645. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1646. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1647. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1648. /* DWORD 6 */
  1649. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1650. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1651. /* DWORD 0 */
  1652. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1654. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1655. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1658. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1662. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1663. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1666. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1667. } while (0)
  1668. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1669. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1670. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1672. do { \
  1673. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1674. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1675. } while (0)
  1676. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1677. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1678. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1679. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1680. do { \
  1681. HTT_CHECK_SET_VAL( \
  1682. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1683. ((_var) |= ((_val) \
  1684. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1685. } while (0)
  1686. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1687. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1688. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1689. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1690. do { \
  1691. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1692. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1693. } while (0)
  1694. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1695. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1696. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1697. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1698. do { \
  1699. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1700. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1701. } while (0)
  1702. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1703. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1704. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1705. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1706. do { \
  1707. HTT_CHECK_SET_VAL( \
  1708. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1709. ((_var) |= ((_val) \
  1710. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1711. } while (0)
  1712. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1713. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1714. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1715. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1716. do { \
  1717. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1718. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1719. } while (0)
  1720. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1721. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1722. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1723. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1724. do { \
  1725. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1726. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1727. } while (0)
  1728. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1729. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1730. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1731. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1732. do { \
  1733. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1734. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1735. } while (0)
  1736. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1737. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1738. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1739. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1740. do { \
  1741. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1742. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1743. } while (0)
  1744. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1745. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1746. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1747. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1748. do { \
  1749. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1750. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1751. } while (0)
  1752. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1753. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1754. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1756. do { \
  1757. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1758. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1759. } while (0)
  1760. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1761. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1762. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1763. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1764. do { \
  1765. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1766. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1767. } while (0)
  1768. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1769. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1770. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1771. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1772. do { \
  1773. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1774. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1775. } while (0)
  1776. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1777. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1778. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1779. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1780. do { \
  1781. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1782. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1783. } while (0)
  1784. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1785. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1786. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1787. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1788. do { \
  1789. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1790. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1791. } while (0)
  1792. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1793. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1794. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1795. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1796. do { \
  1797. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1798. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1799. } while (0)
  1800. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1801. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1802. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1803. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1804. do { \
  1805. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1806. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1807. } while (0)
  1808. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1809. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1810. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1811. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1812. do { \
  1813. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1814. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1815. } while (0)
  1816. /* DWORD 1 */
  1817. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1818. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1819. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1820. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1821. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1822. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1823. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1824. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1825. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1826. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1827. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1828. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1829. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1830. do { \
  1831. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1832. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1833. } while (0)
  1834. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1835. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1836. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1837. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1838. do { \
  1839. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  1840. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  1841. } while (0)
  1842. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1843. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1844. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1845. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1846. do { \
  1847. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  1848. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  1849. } while (0)
  1850. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  1851. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  1852. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  1853. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  1854. do { \
  1855. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  1856. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  1857. } while (0)
  1858. /* DWORD 2 */
  1859. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1860. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1861. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1862. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1863. do { \
  1864. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  1865. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  1866. } while (0)
  1867. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1868. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1869. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1870. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1871. do { \
  1872. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  1873. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  1874. } while (0)
  1875. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1876. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1877. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1878. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1879. do { \
  1880. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  1881. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  1882. } while (0)
  1883. /* DWORD 5 */
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  1885. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  1886. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  1888. do { \
  1889. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  1890. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  1891. } while (0)
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  1893. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  1894. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  1898. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  1899. } while (0)
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  1901. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  1902. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  1904. do { \
  1905. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  1906. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  1907. } while (0)
  1908. /* DWORD 6 */
  1909. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  1910. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  1911. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  1912. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  1915. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  1916. } while (0)
  1917. typedef enum {
  1918. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1919. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1920. } htt_tcl_metadata_type;
  1921. /**
  1922. * @brief HTT TCL command number format
  1923. * @details
  1924. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1925. * available to firmware as tcl_exit_base->tcl_status_number.
  1926. * For regular / multicast packets host will send vdev and mac id and for
  1927. * NAWDS packets, host will send peer id.
  1928. * A_UINT32 is used to avoid endianness conversion problems.
  1929. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1930. */
  1931. typedef struct {
  1932. A_UINT32
  1933. type: 1, /* vdev_id based or peer_id based */
  1934. rsvd: 31;
  1935. } htt_tx_tcl_vdev_or_peer_t;
  1936. typedef struct {
  1937. A_UINT32
  1938. type: 1, /* vdev_id based or peer_id based */
  1939. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1940. vdev_id: 8,
  1941. pdev_id: 2,
  1942. host_inspected:1,
  1943. rsvd: 19;
  1944. } htt_tx_tcl_vdev_metadata;
  1945. typedef struct {
  1946. A_UINT32
  1947. type: 1, /* vdev_id based or peer_id based */
  1948. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1949. peer_id: 14,
  1950. rsvd: 16;
  1951. } htt_tx_tcl_peer_metadata;
  1952. PREPACK struct htt_tx_tcl_metadata {
  1953. union {
  1954. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1955. htt_tx_tcl_vdev_metadata vdev_meta;
  1956. htt_tx_tcl_peer_metadata peer_meta;
  1957. };
  1958. } POSTPACK;
  1959. /* DWORD 0 */
  1960. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1961. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1962. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1963. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1964. /* VDEV metadata */
  1965. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1966. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1967. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1968. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1969. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  1970. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  1971. /* PEER metadata */
  1972. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1973. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1974. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1975. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1976. HTT_TX_TCL_METADATA_TYPE_S)
  1977. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  1980. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  1981. } while (0)
  1982. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1983. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1984. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1985. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  1988. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  1989. } while (0)
  1990. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1991. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1992. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1993. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1994. do { \
  1995. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  1996. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  1997. } while (0)
  1998. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1999. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2000. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2001. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2002. do { \
  2003. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2004. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2005. } while (0)
  2006. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2007. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2008. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2009. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2010. do { \
  2011. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2012. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2013. } while (0)
  2014. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2015. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2016. HTT_TX_TCL_METADATA_PEER_ID_S)
  2017. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2018. do { \
  2019. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2020. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2021. } while (0)
  2022. typedef enum {
  2023. HTT_TX_FW2WBM_TX_STATUS_OK,
  2024. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2025. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2026. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2027. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2028. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2029. HTT_TX_FW2WBM_TX_STATUS_MAX
  2030. } htt_tx_fw2wbm_tx_status_t;
  2031. typedef enum {
  2032. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2033. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2034. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2035. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2036. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2037. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2038. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2039. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2040. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2041. } htt_tx_fw2wbm_reinject_reason_t;
  2042. /**
  2043. * @brief HTT TX WBM Completion from firmware to host
  2044. * @details
  2045. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2046. * DWORD 3 and 4 for software based completions (Exception frames and
  2047. * TQM bypass frames)
  2048. * For software based completions, wbm_release_ring->release_source_module will
  2049. * be set to release_source_fw
  2050. */
  2051. PREPACK struct htt_tx_wbm_completion {
  2052. A_UINT32
  2053. sch_cmd_id: 24,
  2054. exception_frame: 1, /* If set, this packet was queued via exception path */
  2055. rsvd0_31_25: 7;
  2056. A_UINT32
  2057. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2058. * reception of an ACK or BA, this field indicates
  2059. * the RSSI of the received ACK or BA frame.
  2060. * When the frame is removed as result of a direct
  2061. * remove command from the SW, this field is set
  2062. * to 0x0 (which is never a valid value when real
  2063. * RSSI is available).
  2064. * Units: dB w.r.t noise floor
  2065. */
  2066. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2067. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2068. rsvd1_31_16: 16;
  2069. } POSTPACK;
  2070. /* DWORD 0 */
  2071. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2072. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2073. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2074. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2075. /* DWORD 1 */
  2076. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2077. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2078. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2079. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2080. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2081. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2082. /* DWORD 0 */
  2083. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2084. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2085. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2086. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2087. do { \
  2088. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2089. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2090. } while (0)
  2091. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2092. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2093. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2094. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2095. do { \
  2096. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2097. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2098. } while (0)
  2099. /* DWORD 1 */
  2100. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2101. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2102. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2103. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2104. do { \
  2105. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2106. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2107. } while (0)
  2108. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2109. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2110. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2111. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2112. do { \
  2113. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2114. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2115. } while (0)
  2116. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2117. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2118. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2119. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2120. do { \
  2121. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2122. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2123. } while (0)
  2124. /**
  2125. * @brief HTT TX WBM Completion from firmware to host
  2126. * @details
  2127. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2128. * (WBM) offload HW.
  2129. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2130. * For software based completions, release_source_module will
  2131. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2132. * struct wbm_release_ring and then switch to this after looking at
  2133. * release_source_module.
  2134. */
  2135. PREPACK struct htt_tx_wbm_completion_v2 {
  2136. A_UINT32
  2137. used_by_hw0; /* Refer to struct wbm_release_ring */
  2138. A_UINT32
  2139. used_by_hw1; /* Refer to struct wbm_release_ring */
  2140. A_UINT32
  2141. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2142. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2143. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2144. exception_frame: 1,
  2145. rsvd0: 12, /* For future use */
  2146. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2147. rsvd1: 1; /* For future use */
  2148. A_UINT32
  2149. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2150. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2151. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2152. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2153. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2154. */
  2155. A_UINT32
  2156. data1: 32;
  2157. A_UINT32
  2158. data2: 32;
  2159. A_UINT32
  2160. used_by_hw3; /* Refer to struct wbm_release_ring */
  2161. } POSTPACK;
  2162. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2163. /* DWORD 3 */
  2164. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2165. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2166. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2167. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2168. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2169. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2170. /* DWORD 3 */
  2171. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2172. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2173. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2174. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2178. } while (0)
  2179. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2180. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2181. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2182. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2183. do { \
  2184. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2185. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2186. } while (0)
  2187. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2188. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2189. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2190. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2191. do { \
  2192. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2193. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2194. } while (0)
  2195. /**
  2196. * @brief HTT TX WBM transmit status from firmware to host
  2197. * @details
  2198. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2199. * (WBM) offload HW.
  2200. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2201. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2202. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2203. */
  2204. PREPACK struct htt_tx_wbm_transmit_status {
  2205. A_UINT32
  2206. sch_cmd_id: 24,
  2207. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2208. * reception of an ACK or BA, this field indicates
  2209. * the RSSI of the received ACK or BA frame.
  2210. * When the frame is removed as result of a direct
  2211. * remove command from the SW, this field is set
  2212. * to 0x0 (which is never a valid value when real
  2213. * RSSI is available).
  2214. * Units: dB w.r.t noise floor
  2215. */
  2216. A_UINT32
  2217. sw_peer_id: 16,
  2218. tid_num: 5,
  2219. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2220. * and tid_num fields contain valid data.
  2221. * If this "valid" flag is not set, the
  2222. * sw_peer_id and tid_num fields must be ignored.
  2223. */
  2224. mcast: 1,
  2225. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2226. * contains valid data.
  2227. */
  2228. reserved0: 8;
  2229. A_UINT32
  2230. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2231. * packets in the wbm completion path
  2232. */
  2233. } POSTPACK;
  2234. /* DWORD 4 */
  2235. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2236. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2237. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2238. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2239. /* DWORD 5 */
  2240. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2241. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2242. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2243. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2244. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2245. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2246. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2247. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2248. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2249. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2250. /* DWORD 4 */
  2251. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2252. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2253. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2254. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2255. do { \
  2256. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2257. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2258. } while (0)
  2259. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2260. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2261. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2262. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2265. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2266. } while (0)
  2267. /* DWORD 5 */
  2268. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2269. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2270. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2271. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2272. do { \
  2273. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2274. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2275. } while (0)
  2276. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2277. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2278. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2279. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2280. do { \
  2281. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2282. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2283. } while (0)
  2284. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2285. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2286. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2287. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2288. do { \
  2289. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2290. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2291. } while (0)
  2292. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2293. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2294. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2295. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2296. do { \
  2297. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2298. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2299. } while (0)
  2300. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2301. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2302. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2303. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2304. do { \
  2305. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2306. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2307. } while (0)
  2308. /**
  2309. * @brief HTT TX WBM reinject status from firmware to host
  2310. * @details
  2311. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2312. * (WBM) offload HW.
  2313. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2314. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2315. */
  2316. PREPACK struct htt_tx_wbm_reinject_status {
  2317. A_UINT32
  2318. reserved0: 32;
  2319. A_UINT32
  2320. reserved1: 32;
  2321. A_UINT32
  2322. reserved2: 32;
  2323. } POSTPACK;
  2324. /**
  2325. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2326. * @details
  2327. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2328. * (WBM) offload HW.
  2329. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2330. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2331. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2332. * STA side.
  2333. */
  2334. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2335. A_UINT32
  2336. mec_sa_addr_31_0;
  2337. A_UINT32
  2338. mec_sa_addr_47_32: 16,
  2339. sa_ast_index: 16;
  2340. A_UINT32
  2341. vdev_id: 8,
  2342. reserved0: 24;
  2343. } POSTPACK;
  2344. /* DWORD 4 - mec_sa_addr_31_0 */
  2345. /* DWORD 5 */
  2346. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2347. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2348. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2349. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2350. /* DWORD 6 */
  2351. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2352. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2353. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2354. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2355. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2356. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2357. do { \
  2358. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2359. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2360. } while (0)
  2361. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2362. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2363. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2364. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2365. do { \
  2366. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2367. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2368. } while (0)
  2369. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2370. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2371. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2372. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2373. do { \
  2374. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2375. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2376. } while (0)
  2377. typedef enum {
  2378. TX_FLOW_PRIORITY_BE,
  2379. TX_FLOW_PRIORITY_HIGH,
  2380. TX_FLOW_PRIORITY_LOW,
  2381. } htt_tx_flow_priority_t;
  2382. typedef enum {
  2383. TX_FLOW_LATENCY_SENSITIVE,
  2384. TX_FLOW_LATENCY_INSENSITIVE,
  2385. } htt_tx_flow_latency_t;
  2386. typedef enum {
  2387. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2388. TX_FLOW_INTERACTIVE_TRAFFIC,
  2389. TX_FLOW_PERIODIC_TRAFFIC,
  2390. TX_FLOW_BURSTY_TRAFFIC,
  2391. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2392. } htt_tx_flow_traffic_pattern_t;
  2393. /**
  2394. * @brief HTT TX Flow search metadata format
  2395. * @details
  2396. * Host will set this metadata in flow table's flow search entry along with
  2397. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2398. * firmware and TQM ring if the flow search entry wins.
  2399. * This metadata is available to firmware in that first MSDU's
  2400. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2401. * to one of the available flows for specific tid and returns the tqm flow
  2402. * pointer as part of htt_tx_map_flow_info message.
  2403. */
  2404. PREPACK struct htt_tx_flow_metadata {
  2405. A_UINT32
  2406. rsvd0_1_0: 2,
  2407. tid: 4,
  2408. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2409. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2410. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2411. * Else choose final tid based on latency, priority.
  2412. */
  2413. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2414. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2415. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2416. } POSTPACK;
  2417. /* DWORD 0 */
  2418. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2419. #define HTT_TX_FLOW_METADATA_TID_S 2
  2420. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2421. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2422. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2423. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2424. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2425. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2426. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2427. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2428. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2429. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2430. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2431. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2432. /* DWORD 0 */
  2433. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2434. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2435. HTT_TX_FLOW_METADATA_TID_S)
  2436. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2437. do { \
  2438. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2439. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2440. } while (0)
  2441. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2442. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2443. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2444. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2445. do { \
  2446. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2447. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2448. } while (0)
  2449. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2450. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2451. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2452. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2455. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2456. } while (0)
  2457. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2458. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2459. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2460. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2463. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2464. } while (0)
  2465. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2466. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2467. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2468. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2469. do { \
  2470. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2471. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2472. } while (0)
  2473. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2474. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2475. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2476. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2477. do { \
  2478. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2479. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2480. } while (0)
  2481. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2482. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2483. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2484. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2485. do { \
  2486. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2487. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2488. } while (0)
  2489. /**
  2490. * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2491. *
  2492. * @details
  2493. * HTT wds entry from source port learning
  2494. * Host will learn wds entries from rx and send this message to firmware
  2495. * to enable firmware to configure/delete AST entries for wds clients.
  2496. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2497. * and when SA's entry is deleted, firmware removes this AST entry
  2498. *
  2499. * The message would appear as follows:
  2500. *
  2501. * |31 30|29 |17 16|15 8|7 0|
  2502. * |----------------+----------------+----------------+----------------|
  2503. * | rsvd0 |PDVID| vdev_id | msg_type |
  2504. * |-------------------------------------------------------------------|
  2505. * | sa_addr_31_0 |
  2506. * |-------------------------------------------------------------------|
  2507. * | | ta_peer_id | sa_addr_47_32 |
  2508. * |-------------------------------------------------------------------|
  2509. * Where PDVID = pdev_id
  2510. *
  2511. * The message is interpreted as follows:
  2512. *
  2513. * dword0 - b'0:7 - msg_type: This will be set to
  2514. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2515. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2516. *
  2517. * dword0 - b'8:15 - vdev_id
  2518. *
  2519. * dword0 - b'16:17 - pdev_id
  2520. *
  2521. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2522. *
  2523. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2524. *
  2525. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2526. *
  2527. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2528. */
  2529. PREPACK struct htt_wds_entry {
  2530. A_UINT32
  2531. msg_type: 8,
  2532. vdev_id: 8,
  2533. pdev_id: 2,
  2534. rsvd0: 14;
  2535. A_UINT32 sa_addr_31_0;
  2536. A_UINT32
  2537. sa_addr_47_32: 16,
  2538. ta_peer_id: 14,
  2539. rsvd2: 2;
  2540. } POSTPACK;
  2541. /* DWORD 0 */
  2542. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2543. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2544. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2545. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2546. /* DWORD 2 */
  2547. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2548. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2549. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2550. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2551. /* DWORD 0 */
  2552. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2553. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2554. HTT_WDS_ENTRY_VDEV_ID_S)
  2555. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2556. do { \
  2557. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2558. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2559. } while (0)
  2560. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2561. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2562. HTT_WDS_ENTRY_PDEV_ID_S)
  2563. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2564. do { \
  2565. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2566. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2567. } while (0)
  2568. /* DWORD 2 */
  2569. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2570. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2571. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2572. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2573. do { \
  2574. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2575. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2576. } while (0)
  2577. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2578. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2579. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2580. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2581. do { \
  2582. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2583. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2584. } while (0)
  2585. /**
  2586. * @brief MAC DMA rx ring setup specification
  2587. * @details
  2588. * To allow for dynamic rx ring reconfiguration and to avoid race
  2589. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2590. * it uses. Instead, it sends this message to the target, indicating how
  2591. * the rx ring used by the host should be set up and maintained.
  2592. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2593. * specifications.
  2594. *
  2595. * |31 16|15 8|7 0|
  2596. * |---------------------------------------------------------------|
  2597. * header: | reserved | num rings | msg type |
  2598. * |---------------------------------------------------------------|
  2599. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2600. #if HTT_PADDR64
  2601. * | FW_IDX shadow register physical address (bits 63:32) |
  2602. #endif
  2603. * |---------------------------------------------------------------|
  2604. * | rx ring base physical address (bits 31:0) |
  2605. #if HTT_PADDR64
  2606. * | rx ring base physical address (bits 63:32) |
  2607. #endif
  2608. * |---------------------------------------------------------------|
  2609. * | rx ring buffer size | rx ring length |
  2610. * |---------------------------------------------------------------|
  2611. * | FW_IDX initial value | enabled flags |
  2612. * |---------------------------------------------------------------|
  2613. * | MSDU payload offset | 802.11 header offset |
  2614. * |---------------------------------------------------------------|
  2615. * | PPDU end offset | PPDU start offset |
  2616. * |---------------------------------------------------------------|
  2617. * | MPDU end offset | MPDU start offset |
  2618. * |---------------------------------------------------------------|
  2619. * | MSDU end offset | MSDU start offset |
  2620. * |---------------------------------------------------------------|
  2621. * | frag info offset | rx attention offset |
  2622. * |---------------------------------------------------------------|
  2623. * payload 2, if present, has the same format as payload 1
  2624. * Header fields:
  2625. * - MSG_TYPE
  2626. * Bits 7:0
  2627. * Purpose: identifies this as an rx ring configuration message
  2628. * Value: 0x2
  2629. * - NUM_RINGS
  2630. * Bits 15:8
  2631. * Purpose: indicates whether the host is setting up one rx ring or two
  2632. * Value: 1 or 2
  2633. * Payload:
  2634. * for systems using 64-bit format for bus addresses:
  2635. * - IDX_SHADOW_REG_PADDR_LO
  2636. * Bits 31:0
  2637. * Value: lower 4 bytes of physical address of the host's
  2638. * FW_IDX shadow register
  2639. * - IDX_SHADOW_REG_PADDR_HI
  2640. * Bits 31:0
  2641. * Value: upper 4 bytes of physical address of the host's
  2642. * FW_IDX shadow register
  2643. * - RING_BASE_PADDR_LO
  2644. * Bits 31:0
  2645. * Value: lower 4 bytes of physical address of the host's rx ring
  2646. * - RING_BASE_PADDR_HI
  2647. * Bits 31:0
  2648. * Value: uppper 4 bytes of physical address of the host's rx ring
  2649. * for systems using 32-bit format for bus addresses:
  2650. * - IDX_SHADOW_REG_PADDR
  2651. * Bits 31:0
  2652. * Value: physical address of the host's FW_IDX shadow register
  2653. * - RING_BASE_PADDR
  2654. * Bits 31:0
  2655. * Value: physical address of the host's rx ring
  2656. * - RING_LEN
  2657. * Bits 15:0
  2658. * Value: number of elements in the rx ring
  2659. * - RING_BUF_SZ
  2660. * Bits 31:16
  2661. * Value: size of the buffers referenced by the rx ring, in byte units
  2662. * - ENABLED_FLAGS
  2663. * Bits 15:0
  2664. * Value: 1-bit flags to show whether different rx fields are enabled
  2665. * bit 0: 802.11 header enabled (1) or disabled (0)
  2666. * bit 1: MSDU payload enabled (1) or disabled (0)
  2667. * bit 2: PPDU start enabled (1) or disabled (0)
  2668. * bit 3: PPDU end enabled (1) or disabled (0)
  2669. * bit 4: MPDU start enabled (1) or disabled (0)
  2670. * bit 5: MPDU end enabled (1) or disabled (0)
  2671. * bit 6: MSDU start enabled (1) or disabled (0)
  2672. * bit 7: MSDU end enabled (1) or disabled (0)
  2673. * bit 8: rx attention enabled (1) or disabled (0)
  2674. * bit 9: frag info enabled (1) or disabled (0)
  2675. * bit 10: unicast rx enabled (1) or disabled (0)
  2676. * bit 11: multicast rx enabled (1) or disabled (0)
  2677. * bit 12: ctrl rx enabled (1) or disabled (0)
  2678. * bit 13: mgmt rx enabled (1) or disabled (0)
  2679. * bit 14: null rx enabled (1) or disabled (0)
  2680. * bit 15: phy data rx enabled (1) or disabled (0)
  2681. * - IDX_INIT_VAL
  2682. * Bits 31:16
  2683. * Purpose: Specify the initial value for the FW_IDX.
  2684. * Value: the number of buffers initially present in the host's rx ring
  2685. * - OFFSET_802_11_HDR
  2686. * Bits 15:0
  2687. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2688. * - OFFSET_MSDU_PAYLOAD
  2689. * Bits 31:16
  2690. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2691. * - OFFSET_PPDU_START
  2692. * Bits 15:0
  2693. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2694. * - OFFSET_PPDU_END
  2695. * Bits 31:16
  2696. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2697. * - OFFSET_MPDU_START
  2698. * Bits 15:0
  2699. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2700. * - OFFSET_MPDU_END
  2701. * Bits 31:16
  2702. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2703. * - OFFSET_MSDU_START
  2704. * Bits 15:0
  2705. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2706. * - OFFSET_MSDU_END
  2707. * Bits 31:16
  2708. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2709. * - OFFSET_RX_ATTN
  2710. * Bits 15:0
  2711. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2712. * - OFFSET_FRAG_INFO
  2713. * Bits 31:16
  2714. * Value: offset in QUAD-bytes of frag info table
  2715. */
  2716. /* header fields */
  2717. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2718. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2719. /* payload fields */
  2720. /* for systems using a 64-bit format for bus addresses */
  2721. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2722. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2723. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2724. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2725. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2726. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2727. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2728. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2729. /* for systems using a 32-bit format for bus addresses */
  2730. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2731. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2732. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2733. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2734. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2735. #define HTT_RX_RING_CFG_LEN_S 0
  2736. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2737. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2738. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2739. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2740. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2741. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2742. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2743. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2744. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2745. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2746. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2747. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2748. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2749. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2750. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2751. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2752. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2753. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2754. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2755. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2756. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2757. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2758. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2759. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2760. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2761. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2762. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2763. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2764. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2765. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2766. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2767. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2768. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2769. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2770. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2771. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2772. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2773. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2774. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2775. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2776. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2777. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2778. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2779. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2780. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2781. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2782. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2783. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2784. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2785. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2786. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2787. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2788. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2789. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2790. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2791. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2792. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2793. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2794. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2795. #if HTT_PADDR64
  2796. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2797. #else
  2798. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2799. #endif
  2800. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2801. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2802. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2803. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2804. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2805. do { \
  2806. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2807. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2808. } while (0)
  2809. /* degenerate case for 32-bit fields */
  2810. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2811. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2812. ((_var) = (_val))
  2813. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2814. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2815. ((_var) = (_val))
  2816. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2817. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2818. ((_var) = (_val))
  2819. /* degenerate case for 32-bit fields */
  2820. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2821. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2822. ((_var) = (_val))
  2823. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2824. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2825. ((_var) = (_val))
  2826. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2827. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  2828. ((_var) = (_val))
  2829. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2830. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2831. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2832. do { \
  2833. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2834. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2835. } while (0)
  2836. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2837. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2838. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2841. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2842. } while (0)
  2843. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2844. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2845. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2846. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2847. do { \
  2848. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2849. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2850. } while (0)
  2851. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2852. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2853. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2854. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2855. do { \
  2856. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2857. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2858. } while (0)
  2859. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2860. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2861. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2862. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2865. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2866. } while (0)
  2867. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2868. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2869. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2870. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2873. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2874. } while (0)
  2875. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2876. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2877. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2878. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2881. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2882. } while (0)
  2883. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2884. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2885. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2886. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2887. do { \
  2888. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2889. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2890. } while (0)
  2891. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2892. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2893. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2894. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2895. do { \
  2896. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2897. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2898. } while (0)
  2899. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2900. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2901. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2902. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2903. do { \
  2904. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2905. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2906. } while (0)
  2907. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2908. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2909. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2910. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2911. do { \
  2912. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2913. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2914. } while (0)
  2915. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2916. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2917. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2918. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2919. do { \
  2920. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2921. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2922. } while (0)
  2923. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2924. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2925. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2926. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2927. do { \
  2928. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2929. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2930. } while (0)
  2931. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2932. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2933. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2934. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2935. do { \
  2936. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2937. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2938. } while (0)
  2939. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2940. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2941. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2942. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2943. do { \
  2944. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2945. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2946. } while (0)
  2947. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2948. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2949. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2950. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2951. do { \
  2952. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2953. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2954. } while (0)
  2955. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2956. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2957. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2958. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2959. do { \
  2960. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2961. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2962. } while (0)
  2963. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2964. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2965. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2966. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2969. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2970. } while (0)
  2971. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2972. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2973. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2974. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2975. do { \
  2976. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2977. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2978. } while (0)
  2979. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2980. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2981. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2982. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2983. do { \
  2984. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2985. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2986. } while (0)
  2987. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2988. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2989. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2990. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2991. do { \
  2992. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2993. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2994. } while (0)
  2995. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2996. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2997. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2998. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2999. do { \
  3000. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3001. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3002. } while (0)
  3003. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3004. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3005. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3006. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3007. do { \
  3008. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3009. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3010. } while (0)
  3011. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3012. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3013. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3014. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3015. do { \
  3016. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3017. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3018. } while (0)
  3019. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3020. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3021. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3022. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3023. do { \
  3024. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3025. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3026. } while (0)
  3027. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3028. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3029. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3030. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3031. do { \
  3032. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3033. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3034. } while (0)
  3035. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3036. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3037. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3038. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3039. do { \
  3040. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3041. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3042. } while (0)
  3043. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3044. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3045. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3046. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3047. do { \
  3048. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3049. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3050. } while (0)
  3051. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3052. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3053. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3054. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3055. do { \
  3056. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3057. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3058. } while (0)
  3059. /**
  3060. * @brief host -> target FW statistics retrieve
  3061. *
  3062. * @details
  3063. * The following field definitions describe the format of the HTT host
  3064. * to target FW stats retrieve message. The message specifies the type of
  3065. * stats host wants to retrieve.
  3066. *
  3067. * |31 24|23 16|15 8|7 0|
  3068. * |-----------------------------------------------------------|
  3069. * | stats types request bitmask | msg type |
  3070. * |-----------------------------------------------------------|
  3071. * | stats types reset bitmask | reserved |
  3072. * |-----------------------------------------------------------|
  3073. * | stats type | config value |
  3074. * |-----------------------------------------------------------|
  3075. * | cookie LSBs |
  3076. * |-----------------------------------------------------------|
  3077. * | cookie MSBs |
  3078. * |-----------------------------------------------------------|
  3079. * Header fields:
  3080. * - MSG_TYPE
  3081. * Bits 7:0
  3082. * Purpose: identifies this is a stats upload request message
  3083. * Value: 0x3
  3084. * - UPLOAD_TYPES
  3085. * Bits 31:8
  3086. * Purpose: identifies which types of FW statistics to upload
  3087. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3088. * - RESET_TYPES
  3089. * Bits 31:8
  3090. * Purpose: identifies which types of FW statistics to reset
  3091. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3092. * - CFG_VAL
  3093. * Bits 23:0
  3094. * Purpose: give an opaque configuration value to the specified stats type
  3095. * Value: stats-type specific configuration value
  3096. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3097. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3098. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3099. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3100. * - CFG_STAT_TYPE
  3101. * Bits 31:24
  3102. * Purpose: specify which stats type (if any) the config value applies to
  3103. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3104. * a valid configuration specification
  3105. * - COOKIE_LSBS
  3106. * Bits 31:0
  3107. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3108. * message with its preceding host->target stats request message.
  3109. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3110. * - COOKIE_MSBS
  3111. * Bits 31:0
  3112. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3113. * message with its preceding host->target stats request message.
  3114. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3115. */
  3116. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3117. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3118. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3119. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3120. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3121. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3122. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3123. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3124. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3125. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3126. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3127. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3128. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3129. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3130. do { \
  3131. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3132. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3133. } while (0)
  3134. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3135. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3136. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3137. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3138. do { \
  3139. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3140. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3141. } while (0)
  3142. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3143. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3144. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3145. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3146. do { \
  3147. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3148. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3149. } while (0)
  3150. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3151. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3152. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3153. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3154. do { \
  3155. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3156. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3157. } while (0)
  3158. /**
  3159. * @brief host -> target HTT out-of-band sync request
  3160. *
  3161. * @details
  3162. * The HTT SYNC tells the target to suspend processing of subsequent
  3163. * HTT host-to-target messages until some other target agent locally
  3164. * informs the target HTT FW that the current sync counter is equal to
  3165. * or greater than (in a modulo sense) the sync counter specified in
  3166. * the SYNC message.
  3167. * This allows other host-target components to synchronize their operation
  3168. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3169. * security key has been downloaded to and activated by the target.
  3170. * In the absence of any explicit synchronization counter value
  3171. * specification, the target HTT FW will use zero as the default current
  3172. * sync value.
  3173. *
  3174. * |31 24|23 16|15 8|7 0|
  3175. * |-----------------------------------------------------------|
  3176. * | reserved | sync count | msg type |
  3177. * |-----------------------------------------------------------|
  3178. * Header fields:
  3179. * - MSG_TYPE
  3180. * Bits 7:0
  3181. * Purpose: identifies this as a sync message
  3182. * Value: 0x4
  3183. * - SYNC_COUNT
  3184. * Bits 15:8
  3185. * Purpose: specifies what sync value the HTT FW will wait for from
  3186. * an out-of-band specification to resume its operation
  3187. * Value: in-band sync counter value to compare against the out-of-band
  3188. * counter spec.
  3189. * The HTT target FW will suspend its host->target message processing
  3190. * as long as
  3191. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3192. */
  3193. #define HTT_H2T_SYNC_MSG_SZ 4
  3194. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3195. #define HTT_H2T_SYNC_COUNT_S 8
  3196. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3197. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3198. HTT_H2T_SYNC_COUNT_S)
  3199. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3200. do { \
  3201. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3202. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3203. } while (0)
  3204. /**
  3205. * @brief HTT aggregation configuration
  3206. */
  3207. #define HTT_AGGR_CFG_MSG_SZ 4
  3208. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3209. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3210. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3211. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3212. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3213. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3214. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3215. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3216. do { \
  3217. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3218. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3219. } while (0)
  3220. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3221. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3222. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3223. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3224. do { \
  3225. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3226. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3227. } while (0)
  3228. /**
  3229. * @brief host -> target HTT configure max amsdu info per vdev
  3230. *
  3231. * @details
  3232. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3233. *
  3234. * |31 21|20 16|15 8|7 0|
  3235. * |-----------------------------------------------------------|
  3236. * | reserved | vdev id | max amsdu | msg type |
  3237. * |-----------------------------------------------------------|
  3238. * Header fields:
  3239. * - MSG_TYPE
  3240. * Bits 7:0
  3241. * Purpose: identifies this as a aggr cfg ex message
  3242. * Value: 0xa
  3243. * - MAX_NUM_AMSDU_SUBFRM
  3244. * Bits 15:8
  3245. * Purpose: max MSDUs per A-MSDU
  3246. * - VDEV_ID
  3247. * Bits 20:16
  3248. * Purpose: ID of the vdev to which this limit is applied
  3249. */
  3250. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3251. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3252. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3253. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3254. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3255. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3256. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3257. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3258. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3259. do { \
  3260. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3261. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3262. } while (0)
  3263. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3264. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3265. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3266. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3267. do { \
  3268. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3269. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3270. } while (0)
  3271. /**
  3272. * @brief HTT WDI_IPA Config Message
  3273. *
  3274. * @details
  3275. * The HTT WDI_IPA config message is created/sent by host at driver
  3276. * init time. It contains information about data structures used on
  3277. * WDI_IPA TX and RX path.
  3278. * TX CE ring is used for pushing packet metadata from IPA uC
  3279. * to WLAN FW
  3280. * TX Completion ring is used for generating TX completions from
  3281. * WLAN FW to IPA uC
  3282. * RX Indication ring is used for indicating RX packets from FW
  3283. * to IPA uC
  3284. * RX Ring2 is used as either completion ring or as second
  3285. * indication ring. when Ring2 is used as completion ring, IPA uC
  3286. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3287. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3288. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3289. * indicated in RX Indication ring. Please see WDI_IPA specification
  3290. * for more details.
  3291. * |31 24|23 16|15 8|7 0|
  3292. * |----------------+----------------+----------------+----------------|
  3293. * | tx pkt pool size | Rsvd | msg_type |
  3294. * |-------------------------------------------------------------------|
  3295. * | tx comp ring base (bits 31:0) |
  3296. #if HTT_PADDR64
  3297. * | tx comp ring base (bits 63:32) |
  3298. #endif
  3299. * |-------------------------------------------------------------------|
  3300. * | tx comp ring size |
  3301. * |-------------------------------------------------------------------|
  3302. * | tx comp WR_IDX physical address (bits 31:0) |
  3303. #if HTT_PADDR64
  3304. * | tx comp WR_IDX physical address (bits 63:32) |
  3305. #endif
  3306. * |-------------------------------------------------------------------|
  3307. * | tx CE WR_IDX physical address (bits 31:0) |
  3308. #if HTT_PADDR64
  3309. * | tx CE WR_IDX physical address (bits 63:32) |
  3310. #endif
  3311. * |-------------------------------------------------------------------|
  3312. * | rx indication ring base (bits 31:0) |
  3313. #if HTT_PADDR64
  3314. * | rx indication ring base (bits 63:32) |
  3315. #endif
  3316. * |-------------------------------------------------------------------|
  3317. * | rx indication ring size |
  3318. * |-------------------------------------------------------------------|
  3319. * | rx ind RD_IDX physical address (bits 31:0) |
  3320. #if HTT_PADDR64
  3321. * | rx ind RD_IDX physical address (bits 63:32) |
  3322. #endif
  3323. * |-------------------------------------------------------------------|
  3324. * | rx ind WR_IDX physical address (bits 31:0) |
  3325. #if HTT_PADDR64
  3326. * | rx ind WR_IDX physical address (bits 63:32) |
  3327. #endif
  3328. * |-------------------------------------------------------------------|
  3329. * |-------------------------------------------------------------------|
  3330. * | rx ring2 base (bits 31:0) |
  3331. #if HTT_PADDR64
  3332. * | rx ring2 base (bits 63:32) |
  3333. #endif
  3334. * |-------------------------------------------------------------------|
  3335. * | rx ring2 size |
  3336. * |-------------------------------------------------------------------|
  3337. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3338. #if HTT_PADDR64
  3339. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3340. #endif
  3341. * |-------------------------------------------------------------------|
  3342. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3343. #if HTT_PADDR64
  3344. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3345. #endif
  3346. * |-------------------------------------------------------------------|
  3347. *
  3348. * Header fields:
  3349. * Header fields:
  3350. * - MSG_TYPE
  3351. * Bits 7:0
  3352. * Purpose: Identifies this as WDI_IPA config message
  3353. * value: = 0x8
  3354. * - TX_PKT_POOL_SIZE
  3355. * Bits 15:0
  3356. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3357. * WDI_IPA TX path
  3358. * For systems using 32-bit format for bus addresses:
  3359. * - TX_COMP_RING_BASE_ADDR
  3360. * Bits 31:0
  3361. * Purpose: TX Completion Ring base address in DDR
  3362. * - TX_COMP_RING_SIZE
  3363. * Bits 31:0
  3364. * Purpose: TX Completion Ring size (must be power of 2)
  3365. * - TX_COMP_WR_IDX_ADDR
  3366. * Bits 31:0
  3367. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3368. * updates the Write Index for WDI_IPA TX completion ring
  3369. * - TX_CE_WR_IDX_ADDR
  3370. * Bits 31:0
  3371. * Purpose: DDR address where IPA uC
  3372. * updates the WR Index for TX CE ring
  3373. * (needed for fusion platforms)
  3374. * - RX_IND_RING_BASE_ADDR
  3375. * Bits 31:0
  3376. * Purpose: RX Indication Ring base address in DDR
  3377. * - RX_IND_RING_SIZE
  3378. * Bits 31:0
  3379. * Purpose: RX Indication Ring size
  3380. * - RX_IND_RD_IDX_ADDR
  3381. * Bits 31:0
  3382. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3383. * RX indication ring
  3384. * - RX_IND_WR_IDX_ADDR
  3385. * Bits 31:0
  3386. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3387. * updates the Write Index for WDI_IPA RX indication ring
  3388. * - RX_RING2_BASE_ADDR
  3389. * Bits 31:0
  3390. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3391. * - RX_RING2_SIZE
  3392. * Bits 31:0
  3393. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3394. * - RX_RING2_RD_IDX_ADDR
  3395. * Bits 31:0
  3396. * Purpose: If Second RX ring is Indication ring, DDR address where
  3397. * IPA uC updates the Read Index for Ring2.
  3398. * If Second RX ring is completion ring, this is NOT used
  3399. * - RX_RING2_WR_IDX_ADDR
  3400. * Bits 31:0
  3401. * Purpose: If Second RX ring is Indication ring, DDR address where
  3402. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3403. * If second RX ring is completion ring, DDR address where
  3404. * IPA uC updates the Write Index for Ring 2.
  3405. * For systems using 64-bit format for bus addresses:
  3406. * - TX_COMP_RING_BASE_ADDR_LO
  3407. * Bits 31:0
  3408. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3409. * - TX_COMP_RING_BASE_ADDR_HI
  3410. * Bits 31:0
  3411. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3412. * - TX_COMP_RING_SIZE
  3413. * Bits 31:0
  3414. * Purpose: TX Completion Ring size (must be power of 2)
  3415. * - TX_COMP_WR_IDX_ADDR_LO
  3416. * Bits 31:0
  3417. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3418. * Lower 4 bytes of DDR address where WIFI FW
  3419. * updates the Write Index for WDI_IPA TX completion ring
  3420. * - TX_COMP_WR_IDX_ADDR_HI
  3421. * Bits 31:0
  3422. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3423. * Higher 4 bytes of DDR address where WIFI FW
  3424. * updates the Write Index for WDI_IPA TX completion ring
  3425. * - TX_CE_WR_IDX_ADDR_LO
  3426. * Bits 31:0
  3427. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3428. * updates the WR Index for TX CE ring
  3429. * (needed for fusion platforms)
  3430. * - TX_CE_WR_IDX_ADDR_HI
  3431. * Bits 31:0
  3432. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3433. * updates the WR Index for TX CE ring
  3434. * (needed for fusion platforms)
  3435. * - RX_IND_RING_BASE_ADDR_LO
  3436. * Bits 31:0
  3437. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3438. * - RX_IND_RING_BASE_ADDR_HI
  3439. * Bits 31:0
  3440. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3441. * - RX_IND_RING_SIZE
  3442. * Bits 31:0
  3443. * Purpose: RX Indication Ring size
  3444. * - RX_IND_RD_IDX_ADDR_LO
  3445. * Bits 31:0
  3446. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3447. * for WDI_IPA RX indication ring
  3448. * - RX_IND_RD_IDX_ADDR_HI
  3449. * Bits 31:0
  3450. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3451. * for WDI_IPA RX indication ring
  3452. * - RX_IND_WR_IDX_ADDR_LO
  3453. * Bits 31:0
  3454. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3455. * Lower 4 bytes of DDR address where WIFI FW
  3456. * updates the Write Index for WDI_IPA RX indication ring
  3457. * - RX_IND_WR_IDX_ADDR_HI
  3458. * Bits 31:0
  3459. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3460. * Higher 4 bytes of DDR address where WIFI FW
  3461. * updates the Write Index for WDI_IPA RX indication ring
  3462. * - RX_RING2_BASE_ADDR_LO
  3463. * Bits 31:0
  3464. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3465. * - RX_RING2_BASE_ADDR_HI
  3466. * Bits 31:0
  3467. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3468. * - RX_RING2_SIZE
  3469. * Bits 31:0
  3470. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3471. * - RX_RING2_RD_IDX_ADDR_LO
  3472. * Bits 31:0
  3473. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3474. * DDR address where IPA uC updates the Read Index for Ring2.
  3475. * If Second RX ring is completion ring, this is NOT used
  3476. * - RX_RING2_RD_IDX_ADDR_HI
  3477. * Bits 31:0
  3478. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3479. * DDR address where IPA uC updates the Read Index for Ring2.
  3480. * If Second RX ring is completion ring, this is NOT used
  3481. * - RX_RING2_WR_IDX_ADDR_LO
  3482. * Bits 31:0
  3483. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3484. * DDR address where WIFI FW updates the Write Index
  3485. * for WDI_IPA RX ring2
  3486. * If second RX ring is completion ring, lower 4 bytes of
  3487. * DDR address where IPA uC updates the Write Index for Ring 2.
  3488. * - RX_RING2_WR_IDX_ADDR_HI
  3489. * Bits 31:0
  3490. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3491. * DDR address where WIFI FW updates the Write Index
  3492. * for WDI_IPA RX ring2
  3493. * If second RX ring is completion ring, higher 4 bytes of
  3494. * DDR address where IPA uC updates the Write Index for Ring 2.
  3495. */
  3496. #if HTT_PADDR64
  3497. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3498. #else
  3499. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3500. #endif
  3501. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3502. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3503. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3504. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3505. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3506. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3507. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3508. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3509. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3510. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3511. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3512. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3513. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3514. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3515. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3516. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3517. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3518. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3519. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3520. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3521. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3522. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3523. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3524. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3525. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3526. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3527. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3528. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3529. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3530. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3531. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3532. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3533. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3534. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3535. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3536. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3537. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3538. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3539. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3540. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3541. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3542. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3543. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3544. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3545. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3546. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3547. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3548. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3549. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3550. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3551. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3552. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3553. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3554. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3555. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3556. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3557. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3558. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3559. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3560. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3561. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3562. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3563. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3564. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3565. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3566. do { \
  3567. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3568. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3569. } while (0)
  3570. /* for systems using 32-bit format for bus addr */
  3571. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3572. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3573. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3574. do { \
  3575. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3576. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3577. } while (0)
  3578. /* for systems using 64-bit format for bus addr */
  3579. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3580. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3581. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3582. do { \
  3583. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3584. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3585. } while (0)
  3586. /* for systems using 64-bit format for bus addr */
  3587. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3588. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3589. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3590. do { \
  3591. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3592. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3593. } while (0)
  3594. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3595. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3596. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3597. do { \
  3598. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3599. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3600. } while (0)
  3601. /* for systems using 32-bit format for bus addr */
  3602. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3603. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3604. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3605. do { \
  3606. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3607. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3608. } while (0)
  3609. /* for systems using 64-bit format for bus addr */
  3610. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3611. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3612. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3613. do { \
  3614. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3615. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3616. } while (0)
  3617. /* for systems using 64-bit format for bus addr */
  3618. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3619. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3620. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3621. do { \
  3622. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3623. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3624. } while (0)
  3625. /* for systems using 32-bit format for bus addr */
  3626. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3627. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3628. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3629. do { \
  3630. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3631. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3632. } while (0)
  3633. /* for systems using 64-bit format for bus addr */
  3634. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3635. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3636. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3637. do { \
  3638. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3639. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3640. } while (0)
  3641. /* for systems using 64-bit format for bus addr */
  3642. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3643. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3644. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3645. do { \
  3646. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3647. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3648. } while (0)
  3649. /* for systems using 32-bit format for bus addr */
  3650. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3651. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3652. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3653. do { \
  3654. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3655. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3656. } while (0)
  3657. /* for systems using 64-bit format for bus addr */
  3658. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3659. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3660. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3661. do { \
  3662. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3663. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3664. } while (0)
  3665. /* for systems using 64-bit format for bus addr */
  3666. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3667. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3668. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3669. do { \
  3670. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3671. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3672. } while (0)
  3673. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3674. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3675. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3676. do { \
  3677. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3678. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3679. } while (0)
  3680. /* for systems using 32-bit format for bus addr */
  3681. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3682. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3683. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3684. do { \
  3685. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3686. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3687. } while (0)
  3688. /* for systems using 64-bit format for bus addr */
  3689. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3690. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3691. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3692. do { \
  3693. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3694. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3695. } while (0)
  3696. /* for systems using 64-bit format for bus addr */
  3697. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3698. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3699. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3700. do { \
  3701. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3702. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3703. } while (0)
  3704. /* for systems using 32-bit format for bus addr */
  3705. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3706. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3707. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3708. do { \
  3709. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3710. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3711. } while (0)
  3712. /* for systems using 64-bit format for bus addr */
  3713. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3714. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3715. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3716. do { \
  3717. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3718. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3719. } while (0)
  3720. /* for systems using 64-bit format for bus addr */
  3721. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3722. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3723. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3724. do { \
  3725. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3726. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3727. } while (0)
  3728. /* for systems using 32-bit format for bus addr */
  3729. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3730. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3732. do { \
  3733. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3734. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3735. } while (0)
  3736. /* for systems using 64-bit format for bus addr */
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3738. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3740. do { \
  3741. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3742. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3743. } while (0)
  3744. /* for systems using 64-bit format for bus addr */
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3746. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3748. do { \
  3749. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3750. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3751. } while (0)
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3753. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3755. do { \
  3756. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3757. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3758. } while (0)
  3759. /* for systems using 32-bit format for bus addr */
  3760. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3761. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3762. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3763. do { \
  3764. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3765. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3766. } while (0)
  3767. /* for systems using 64-bit format for bus addr */
  3768. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3769. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3770. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3771. do { \
  3772. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3773. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3774. } while (0)
  3775. /* for systems using 64-bit format for bus addr */
  3776. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3777. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3778. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3779. do { \
  3780. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3781. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3782. } while (0)
  3783. /* for systems using 32-bit format for bus addr */
  3784. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3785. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3786. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3787. do { \
  3788. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3789. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3790. } while (0)
  3791. /* for systems using 64-bit format for bus addr */
  3792. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3793. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3794. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3795. do { \
  3796. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3797. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3798. } while (0)
  3799. /* for systems using 64-bit format for bus addr */
  3800. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3801. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3802. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3803. do { \
  3804. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3805. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3806. } while (0)
  3807. /*
  3808. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3809. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3810. * addresses are stored in a XXX-bit field.
  3811. * This macro is used to define both htt_wdi_ipa_config32_t and
  3812. * htt_wdi_ipa_config64_t structs.
  3813. */
  3814. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3815. _paddr__tx_comp_ring_base_addr_, \
  3816. _paddr__tx_comp_wr_idx_addr_, \
  3817. _paddr__tx_ce_wr_idx_addr_, \
  3818. _paddr__rx_ind_ring_base_addr_, \
  3819. _paddr__rx_ind_rd_idx_addr_, \
  3820. _paddr__rx_ind_wr_idx_addr_, \
  3821. _paddr__rx_ring2_base_addr_,\
  3822. _paddr__rx_ring2_rd_idx_addr_,\
  3823. _paddr__rx_ring2_wr_idx_addr_) \
  3824. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3825. { \
  3826. /* DWORD 0: flags and meta-data */ \
  3827. A_UINT32 \
  3828. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3829. reserved: 8, \
  3830. tx_pkt_pool_size: 16;\
  3831. /* DWORD 1 */\
  3832. _paddr__tx_comp_ring_base_addr_;\
  3833. /* DWORD 2 (or 3)*/\
  3834. A_UINT32 tx_comp_ring_size;\
  3835. /* DWORD 3 (or 4)*/\
  3836. _paddr__tx_comp_wr_idx_addr_;\
  3837. /* DWORD 4 (or 6)*/\
  3838. _paddr__tx_ce_wr_idx_addr_;\
  3839. /* DWORD 5 (or 8)*/\
  3840. _paddr__rx_ind_ring_base_addr_;\
  3841. /* DWORD 6 (or 10)*/\
  3842. A_UINT32 rx_ind_ring_size;\
  3843. /* DWORD 7 (or 11)*/\
  3844. _paddr__rx_ind_rd_idx_addr_;\
  3845. /* DWORD 8 (or 13)*/\
  3846. _paddr__rx_ind_wr_idx_addr_;\
  3847. /* DWORD 9 (or 15)*/\
  3848. _paddr__rx_ring2_base_addr_;\
  3849. /* DWORD 10 (or 17) */\
  3850. A_UINT32 rx_ring2_size;\
  3851. /* DWORD 11 (or 18) */\
  3852. _paddr__rx_ring2_rd_idx_addr_;\
  3853. /* DWORD 12 (or 20) */\
  3854. _paddr__rx_ring2_wr_idx_addr_;\
  3855. } POSTPACK
  3856. /* define a htt_wdi_ipa_config32_t type */
  3857. 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));
  3858. /* define a htt_wdi_ipa_config64_t type */
  3859. 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));
  3860. #if HTT_PADDR64
  3861. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3862. #else
  3863. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3864. #endif
  3865. enum htt_wdi_ipa_op_code {
  3866. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3867. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3868. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3869. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3870. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3871. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3872. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3873. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3874. /* keep this last */
  3875. HTT_WDI_IPA_OPCODE_MAX
  3876. };
  3877. /**
  3878. * @brief HTT WDI_IPA Operation Request Message
  3879. *
  3880. * @details
  3881. * HTT WDI_IPA Operation Request message is sent by host
  3882. * to either suspend or resume WDI_IPA TX or RX path.
  3883. * |31 24|23 16|15 8|7 0|
  3884. * |----------------+----------------+----------------+----------------|
  3885. * | op_code | Rsvd | msg_type |
  3886. * |-------------------------------------------------------------------|
  3887. *
  3888. * Header fields:
  3889. * - MSG_TYPE
  3890. * Bits 7:0
  3891. * Purpose: Identifies this as WDI_IPA Operation Request message
  3892. * value: = 0x9
  3893. * - OP_CODE
  3894. * Bits 31:16
  3895. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3896. * value: = enum htt_wdi_ipa_op_code
  3897. */
  3898. PREPACK struct htt_wdi_ipa_op_request_t
  3899. {
  3900. /* DWORD 0: flags and meta-data */
  3901. A_UINT32
  3902. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  3903. reserved: 8,
  3904. op_code: 16;
  3905. } POSTPACK;
  3906. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  3907. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3908. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3909. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3910. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3911. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3912. do { \
  3913. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3914. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3915. } while (0)
  3916. /*
  3917. * @brief host -> target HTT_SRING_SETUP message
  3918. *
  3919. * @details
  3920. * After target is booted up, Host can send SRING setup message for
  3921. * each host facing LMAC SRING. Target setups up HW registers based
  3922. * on setup message and confirms back to Host if response_required is set.
  3923. * Host should wait for confirmation message before sending new SRING
  3924. * setup message
  3925. *
  3926. * The message would appear as follows:
  3927. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  3928. * |--------------- +-----------------+-----------------+-----------------|
  3929. * | ring_type | ring_id | pdev_id | msg_type |
  3930. * |----------------------------------------------------------------------|
  3931. * | ring_base_addr_lo |
  3932. * |----------------------------------------------------------------------|
  3933. * | ring_base_addr_hi |
  3934. * |----------------------------------------------------------------------|
  3935. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3936. * |----------------------------------------------------------------------|
  3937. * | ring_head_offset32_remote_addr_lo |
  3938. * |----------------------------------------------------------------------|
  3939. * | ring_head_offset32_remote_addr_hi |
  3940. * |----------------------------------------------------------------------|
  3941. * | ring_tail_offset32_remote_addr_lo |
  3942. * |----------------------------------------------------------------------|
  3943. * | ring_tail_offset32_remote_addr_hi |
  3944. * |----------------------------------------------------------------------|
  3945. * | ring_msi_addr_lo |
  3946. * |----------------------------------------------------------------------|
  3947. * | ring_msi_addr_hi |
  3948. * |----------------------------------------------------------------------|
  3949. * | ring_msi_data |
  3950. * |----------------------------------------------------------------------|
  3951. * | intr_timer_th |IM| intr_batch_counter_th |
  3952. * |----------------------------------------------------------------------|
  3953. * | reserved |ID|RR| PTCF| intr_low_threshold |
  3954. * |----------------------------------------------------------------------|
  3955. * | reserved |IPA drop thres hi|IPA drop thres lo|
  3956. * |----------------------------------------------------------------------|
  3957. * Where
  3958. * IM = sw_intr_mode
  3959. * RR = response_required
  3960. * PTCF = prefetch_timer_cfg
  3961. * IP = IPA drop flag
  3962. *
  3963. * The message is interpreted as follows:
  3964. * dword0 - b'0:7 - msg_type: This will be set to
  3965. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3966. * b'8:15 - pdev_id:
  3967. * 0 (for rings at SOC/UMAC level),
  3968. * 1/2/3 mac id (for rings at LMAC level)
  3969. * b'16:23 - ring_id: identify which ring is to setup,
  3970. * more details can be got from enum htt_srng_ring_id
  3971. * b'24:31 - ring_type: identify type of host rings,
  3972. * more details can be got from enum htt_srng_ring_type
  3973. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3974. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3975. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3976. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3977. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3978. * SW_TO_HW_RING.
  3979. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3980. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3981. * Lower 32 bits of memory address of the remote variable
  3982. * storing the 4-byte word offset that identifies the head
  3983. * element within the ring.
  3984. * (The head offset variable has type A_UINT32.)
  3985. * Valid for HW_TO_SW and SW_TO_SW rings.
  3986. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3987. * Upper 32 bits of memory address of the remote variable
  3988. * storing the 4-byte word offset that identifies the head
  3989. * element within the ring.
  3990. * (The head offset variable has type A_UINT32.)
  3991. * Valid for HW_TO_SW and SW_TO_SW rings.
  3992. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3993. * Lower 32 bits of memory address of the remote variable
  3994. * storing the 4-byte word offset that identifies the tail
  3995. * element within the ring.
  3996. * (The tail offset variable has type A_UINT32.)
  3997. * Valid for HW_TO_SW and SW_TO_SW rings.
  3998. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3999. * Upper 32 bits of memory address of the remote variable
  4000. * storing the 4-byte word offset that identifies the tail
  4001. * element within the ring.
  4002. * (The tail offset variable has type A_UINT32.)
  4003. * Valid for HW_TO_SW and SW_TO_SW rings.
  4004. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4005. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4006. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4007. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4008. * dword10 - b'0:31 - ring_msi_data: MSI data
  4009. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4010. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4011. * dword11 - b'0:14 - intr_batch_counter_th:
  4012. * batch counter threshold is in units of 4-byte words.
  4013. * HW internally maintains and increments batch count.
  4014. * (see SRING spec for detail description).
  4015. * When batch count reaches threshold value, an interrupt
  4016. * is generated by HW.
  4017. * b'15 - sw_intr_mode:
  4018. * This configuration shall be static.
  4019. * Only programmed at power up.
  4020. * 0: generate pulse style sw interrupts
  4021. * 1: generate level style sw interrupts
  4022. * b'16:31 - intr_timer_th:
  4023. * The timer init value when timer is idle or is
  4024. * initialized to start downcounting.
  4025. * In 8us units (to cover a range of 0 to 524 ms)
  4026. * dword12 - b'0:15 - intr_low_threshold:
  4027. * Used only by Consumer ring to generate ring_sw_int_p.
  4028. * Ring entries low threshold water mark, that is used
  4029. * in combination with the interrupt timer as well as
  4030. * the the clearing of the level interrupt.
  4031. * b'16:18 - prefetch_timer_cfg:
  4032. * Used only by Consumer ring to set timer mode to
  4033. * support Application prefetch handling.
  4034. * The external tail offset/pointer will be updated
  4035. * at following intervals:
  4036. * 3'b000: (Prefetch feature disabled; used only for debug)
  4037. * 3'b001: 1 usec
  4038. * 3'b010: 4 usec
  4039. * 3'b011: 8 usec (default)
  4040. * 3'b100: 16 usec
  4041. * Others: Reserverd
  4042. * b'19 - response_required:
  4043. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4044. * b'20 - ipa_drop_flag:
  4045. Indicates that host will config ipa drop threshold percentage
  4046. * b'21:31 - reserved: reserved for future use
  4047. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4048. * b'8:15 - ipa drop high threshold percentage:
  4049. * b'16:31 - Reserved
  4050. */
  4051. PREPACK struct htt_sring_setup_t {
  4052. A_UINT32 msg_type: 8,
  4053. pdev_id: 8,
  4054. ring_id: 8,
  4055. ring_type: 8;
  4056. A_UINT32 ring_base_addr_lo;
  4057. A_UINT32 ring_base_addr_hi;
  4058. A_UINT32 ring_size: 16,
  4059. ring_entry_size: 8,
  4060. ring_misc_cfg_flag: 8;
  4061. A_UINT32 ring_head_offset32_remote_addr_lo;
  4062. A_UINT32 ring_head_offset32_remote_addr_hi;
  4063. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4064. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4065. A_UINT32 ring_msi_addr_lo;
  4066. A_UINT32 ring_msi_addr_hi;
  4067. A_UINT32 ring_msi_data;
  4068. A_UINT32 intr_batch_counter_th: 15,
  4069. sw_intr_mode: 1,
  4070. intr_timer_th: 16;
  4071. A_UINT32 intr_low_threshold: 16,
  4072. prefetch_timer_cfg: 3,
  4073. response_required: 1,
  4074. ipa_drop_flag: 1,
  4075. reserved1: 11;
  4076. A_UINT32 ipa_drop_low_threshold: 8,
  4077. ipa_drop_high_threshold: 8,
  4078. reserved: 16;
  4079. } POSTPACK;
  4080. enum htt_srng_ring_type {
  4081. HTT_HW_TO_SW_RING = 0,
  4082. HTT_SW_TO_HW_RING,
  4083. HTT_SW_TO_SW_RING,
  4084. /* Insert new ring types above this line */
  4085. };
  4086. enum htt_srng_ring_id {
  4087. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4088. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4089. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4090. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4091. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4092. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4093. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4094. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4095. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4096. /* Add Other SRING which can't be directly configured by host software above this line */
  4097. };
  4098. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4099. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4100. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4101. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4102. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4103. HTT_SRING_SETUP_PDEV_ID_S)
  4104. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4105. do { \
  4106. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4107. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4108. } while (0)
  4109. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4110. #define HTT_SRING_SETUP_RING_ID_S 16
  4111. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4112. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4113. HTT_SRING_SETUP_RING_ID_S)
  4114. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4115. do { \
  4116. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4117. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4118. } while (0)
  4119. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4120. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4121. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4122. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4123. HTT_SRING_SETUP_RING_TYPE_S)
  4124. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4125. do { \
  4126. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4127. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4128. } while (0)
  4129. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4130. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4131. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4132. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4133. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4134. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4135. do { \
  4136. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4137. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4138. } while (0)
  4139. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4140. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4141. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4142. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4143. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4144. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4147. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4148. } while (0)
  4149. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4150. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4151. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4152. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4153. HTT_SRING_SETUP_RING_SIZE_S)
  4154. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4155. do { \
  4156. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4157. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4158. } while (0)
  4159. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4160. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4161. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4162. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4163. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4164. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4165. do { \
  4166. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4167. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4168. } while (0)
  4169. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4170. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4171. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4172. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4173. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4174. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4177. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4178. } while (0)
  4179. /* This control bit is applicable to only Producer, which updates Ring ID field
  4180. * of each descriptor before pushing into the ring.
  4181. * 0: updates ring_id(default)
  4182. * 1: ring_id updating disabled */
  4183. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4184. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4185. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4186. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4187. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4188. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4191. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4192. } while (0)
  4193. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4194. * of each descriptor before pushing into the ring.
  4195. * 0: updates Loopcnt(default)
  4196. * 1: Loopcnt updating disabled */
  4197. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4198. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4199. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4200. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4201. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4202. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4203. do { \
  4204. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4205. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4206. } while (0)
  4207. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4208. * into security_id port of GXI/AXI. */
  4209. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4210. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4211. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4212. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4213. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4214. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4215. do { \
  4216. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4217. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4218. } while (0)
  4219. /* During MSI write operation, SRNG drives value of this register bit into
  4220. * swap bit of GXI/AXI. */
  4221. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4222. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4223. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4224. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4225. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4226. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4227. do { \
  4228. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4229. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4230. } while (0)
  4231. /* During Pointer write operation, SRNG drives value of this register bit into
  4232. * swap bit of GXI/AXI. */
  4233. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4234. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4235. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4236. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4237. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4238. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4239. do { \
  4240. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4241. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4242. } while (0)
  4243. /* During any data or TLV write operation, SRNG drives value of this register
  4244. * bit into swap bit of GXI/AXI. */
  4245. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4246. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4247. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4248. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4249. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4250. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4251. do { \
  4252. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4253. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4254. } while (0)
  4255. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4256. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4257. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4258. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4259. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4260. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4261. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4262. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4263. do { \
  4264. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4265. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4266. } while (0)
  4267. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4268. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4269. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4270. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4271. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4272. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4273. do { \
  4274. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4275. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4276. } while (0)
  4277. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4278. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4279. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4280. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4281. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4282. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4283. do { \
  4284. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4285. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4286. } while (0)
  4287. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4288. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4289. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4290. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4291. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4292. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4293. do { \
  4294. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4295. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4296. } while (0)
  4297. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4298. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4299. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4300. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4301. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4302. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4303. do { \
  4304. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4305. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4306. } while (0)
  4307. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4308. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4309. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4310. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4311. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4312. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4313. do { \
  4314. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4315. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4316. } while (0)
  4317. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4318. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4319. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4320. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4321. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4322. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4323. do { \
  4324. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4325. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4326. } while (0)
  4327. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4328. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4329. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4330. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4331. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4332. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4333. do { \
  4334. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4335. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4336. } while (0)
  4337. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4338. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4339. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4340. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4341. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4342. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4343. do { \
  4344. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4345. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4346. } while (0)
  4347. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4348. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4349. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4350. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4351. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4352. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4353. do { \
  4354. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4355. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4356. } while (0)
  4357. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4358. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4359. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4360. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4361. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4362. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4363. do { \
  4364. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4365. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4366. } while (0)
  4367. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4368. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4369. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4370. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4371. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4372. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4373. do { \
  4374. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4375. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4376. } while (0)
  4377. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4378. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4379. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4380. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4381. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4382. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4383. do { \
  4384. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4385. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4386. } while (0)
  4387. /**
  4388. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4389. *
  4390. * @details
  4391. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4392. * configure RXDMA rings.
  4393. * The configuration is per ring based and includes both packet subtypes
  4394. * and PPDU/MPDU TLVs.
  4395. *
  4396. * The message would appear as follows:
  4397. *
  4398. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4399. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4400. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4401. * |-------------------------------------------------------------------|
  4402. * | rsvd2 | ring_buffer_size |
  4403. * |-------------------------------------------------------------------|
  4404. * | packet_type_enable_flags_0 |
  4405. * |-------------------------------------------------------------------|
  4406. * | packet_type_enable_flags_1 |
  4407. * |-------------------------------------------------------------------|
  4408. * | packet_type_enable_flags_2 |
  4409. * |-------------------------------------------------------------------|
  4410. * | packet_type_enable_flags_3 |
  4411. * |-------------------------------------------------------------------|
  4412. * | tlv_filter_in_flags |
  4413. * |-------------------------------------------------------------------|
  4414. * | rx_header_offset | rx_packet_offset |
  4415. * |-------------------------------------------------------------------|
  4416. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4417. * |-------------------------------------------------------------------|
  4418. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4419. * |-------------------------------------------------------------------|
  4420. * | rsvd3 | rx_attention_offset |
  4421. * |-------------------------------------------------------------------|
  4422. * | rsvd4 | mo| fp| rx_drop_threshold |
  4423. * | |ndp|ndp| |
  4424. * |-------------------------------------------------------------------|
  4425. * Where:
  4426. * PS = pkt_swap
  4427. * SS = status_swap
  4428. * OV = rx_offsets_valid
  4429. * DT = drop_thresh_valid
  4430. * The message is interpreted as follows:
  4431. * dword0 - b'0:7 - msg_type: This will be set to
  4432. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4433. * b'8:15 - pdev_id:
  4434. * 0 (for rings at SOC/UMAC level),
  4435. * 1/2/3 mac id (for rings at LMAC level)
  4436. * b'16:23 - ring_id : Identify the ring to configure.
  4437. * More details can be got from enum htt_srng_ring_id
  4438. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4439. * BUF_RING_CFG_0 defs within HW .h files,
  4440. * e.g. wmac_top_reg_seq_hwioreg.h
  4441. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4442. * BUF_RING_CFG_0 defs within HW .h files,
  4443. * e.g. wmac_top_reg_seq_hwioreg.h
  4444. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4445. * configuration fields are valid
  4446. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4447. * rx_drop_threshold field is valid
  4448. * b'28:31 - rsvd1: reserved for future use
  4449. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4450. * in byte units.
  4451. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4452. * - b'16:31 - rsvd2: Reserved for future use
  4453. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4454. * Enable MGMT packet from 0b0000 to 0b1001
  4455. * bits from low to high: FP, MD, MO - 3 bits
  4456. * FP: Filter_Pass
  4457. * MD: Monitor_Direct
  4458. * MO: Monitor_Other
  4459. * 10 mgmt subtypes * 3 bits -> 30 bits
  4460. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4461. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4462. * Enable MGMT packet from 0b1010 to 0b1111
  4463. * bits from low to high: FP, MD, MO - 3 bits
  4464. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4465. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4466. * Enable CTRL packet from 0b0000 to 0b1001
  4467. * bits from low to high: FP, MD, MO - 3 bits
  4468. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4469. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4470. * Enable CTRL packet from 0b1010 to 0b1111,
  4471. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4472. * bits from low to high: FP, MD, MO - 3 bits
  4473. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4474. * dword6 - b'0:31 - tlv_filter_in_flags:
  4475. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4476. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4477. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4478. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4479. * A value of 0 will be considered as ignore this config.
  4480. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4481. * e.g. wmac_top_reg_seq_hwioreg.h
  4482. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4483. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4484. * A value of 0 will be considered as ignore this config.
  4485. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4486. * e.g. wmac_top_reg_seq_hwioreg.h
  4487. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4488. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4489. * A value of 0 will be considered as ignore this config.
  4490. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4491. * e.g. wmac_top_reg_seq_hwioreg.h
  4492. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4493. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4494. * A value of 0 will be considered as ignore this config.
  4495. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4496. * e.g. wmac_top_reg_seq_hwioreg.h
  4497. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4498. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4499. * A value of 0 will be considered as ignore this config.
  4500. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4501. * e.g. wmac_top_reg_seq_hwioreg.h
  4502. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4503. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4504. * A value of 0 will be considered as ignore this config.
  4505. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4506. * e.g. wmac_top_reg_seq_hwioreg.h
  4507. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4508. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4509. * A value of 0 will be considered as ignore this config.
  4510. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4511. * e.g. wmac_top_reg_seq_hwioreg.h
  4512. * - b'16:31 - rsvd3 for future use
  4513. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4514. * to source rings. Consumer drops packets if the available
  4515. * words in the ring falls below the configured threshold
  4516. * value.
  4517. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4518. * by host. 1 -> subscribed
  4519. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4520. * by host. 1 -> subscribed
  4521. */
  4522. PREPACK struct htt_rx_ring_selection_cfg_t {
  4523. A_UINT32 msg_type: 8,
  4524. pdev_id: 8,
  4525. ring_id: 8,
  4526. status_swap: 1,
  4527. pkt_swap: 1,
  4528. rx_offsets_valid: 1,
  4529. drop_thresh_valid: 1,
  4530. rsvd1: 4;
  4531. A_UINT32 ring_buffer_size: 16,
  4532. rsvd2: 16;
  4533. A_UINT32 packet_type_enable_flags_0;
  4534. A_UINT32 packet_type_enable_flags_1;
  4535. A_UINT32 packet_type_enable_flags_2;
  4536. A_UINT32 packet_type_enable_flags_3;
  4537. A_UINT32 tlv_filter_in_flags;
  4538. A_UINT32 rx_packet_offset: 16,
  4539. rx_header_offset: 16;
  4540. A_UINT32 rx_mpdu_end_offset: 16,
  4541. rx_mpdu_start_offset: 16;
  4542. A_UINT32 rx_msdu_end_offset: 16,
  4543. rx_msdu_start_offset: 16;
  4544. A_UINT32 rx_attn_offset: 16,
  4545. rsvd3: 16;
  4546. A_UINT32 rx_drop_threshold: 10,
  4547. fp_ndp: 1,
  4548. mo_ndp: 1,
  4549. rsvd4: 20;
  4550. } POSTPACK;
  4551. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4552. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4553. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4554. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4555. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4556. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4557. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4558. do { \
  4559. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4560. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4561. } while (0)
  4562. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4563. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4564. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4565. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4566. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4567. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4568. do { \
  4569. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4570. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4571. } while (0)
  4572. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4573. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4574. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4575. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4576. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4577. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4578. do { \
  4579. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4580. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4581. } while (0)
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4583. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4585. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4586. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4588. do { \
  4589. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4590. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4591. } while (0)
  4592. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4593. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4594. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4595. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4596. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4597. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4598. do { \
  4599. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4600. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4601. } while (0)
  4602. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4603. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4604. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4605. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4606. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4607. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4608. do { \
  4609. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4610. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4611. } while (0)
  4612. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4613. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4614. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4615. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4616. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4617. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4618. do { \
  4619. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4620. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4621. } while (0)
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4625. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4626. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4628. do { \
  4629. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4630. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4631. } while (0)
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4635. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4636. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4638. do { \
  4639. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4640. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4641. } while (0)
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4645. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4646. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4648. do { \
  4649. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4650. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4651. } while (0)
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4655. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4656. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4658. do { \
  4659. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4660. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4661. } while (0)
  4662. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4663. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4664. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4665. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4666. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4667. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4668. do { \
  4669. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4670. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4671. } while (0)
  4672. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4673. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4674. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4675. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4676. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4677. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4678. do { \
  4679. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4680. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4681. } while (0)
  4682. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4683. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4684. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4685. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4686. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4687. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4688. do { \
  4689. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4690. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4691. } while (0)
  4692. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4694. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4695. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4696. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4697. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4698. do { \
  4699. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4700. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4701. } while (0)
  4702. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4703. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4704. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4705. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4706. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4707. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4708. do { \
  4709. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4710. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4711. } while (0)
  4712. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4713. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4714. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4715. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4716. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4717. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4718. do { \
  4719. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4720. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4721. } while (0)
  4722. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4723. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4724. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4725. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4726. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4727. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4728. do { \
  4729. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4730. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4731. } while (0)
  4732. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4733. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4734. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4735. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4736. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4737. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4738. do { \
  4739. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4740. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4741. } while (0)
  4742. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4743. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4744. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4745. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4746. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4747. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4748. do { \
  4749. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4750. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4751. } while (0)
  4752. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4753. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4754. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4755. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4756. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4757. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4758. do { \
  4759. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4760. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4761. } while (0)
  4762. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4763. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4764. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4765. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4766. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4767. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4768. do { \
  4769. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4770. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4771. } while (0)
  4772. /*
  4773. * Subtype based MGMT frames enable bits.
  4774. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4775. */
  4776. /* association request */
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4783. /* association response */
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4790. /* Reassociation request */
  4791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4797. /* Reassociation response */
  4798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4804. /* Probe request */
  4805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  4806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  4808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  4810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4811. /* Probe response */
  4812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  4813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  4815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4818. /* Timing Advertisement */
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4825. /* Reserved */
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  4831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4832. /* Beacon */
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4839. /* ATIM */
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  4841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4846. /* Disassociation */
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4853. /* Authentication */
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4860. /* Deauthentication */
  4861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  4864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  4866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4867. /* Action */
  4868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  4869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  4871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  4873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4874. /* Action No Ack */
  4875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  4876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  4878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  4880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4881. /* Reserved */
  4882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  4883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  4885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  4887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4888. /*
  4889. * Subtype based CTRL frames enable bits.
  4890. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4891. */
  4892. /* Reserved */
  4893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  4894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  4896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  4898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4899. /* Reserved */
  4900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  4901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  4903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  4905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4906. /* Reserved */
  4907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  4908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  4910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  4912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4913. /* Reserved */
  4914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  4915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  4917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  4919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4920. /* Reserved */
  4921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  4922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  4924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  4926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4927. /* Reserved */
  4928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  4929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  4931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  4933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4934. /* Reserved */
  4935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  4936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  4938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  4940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4941. /* Control Wrapper */
  4942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  4943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  4945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  4947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4948. /* Block Ack Request */
  4949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  4950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  4952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  4954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4955. /* Block Ack*/
  4956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  4957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  4959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  4961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4962. /* PS-POLL */
  4963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  4964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  4966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  4968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4969. /* RTS */
  4970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  4971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4976. /* CTS */
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4983. /* ACK */
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4990. /* CF-END */
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4997. /* CF-END + CF-ACK */
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5004. /* Multicast data */
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5011. /* Unicast data */
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5018. /* NULL data */
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5026. do { \
  5027. HTT_CHECK_SET_VAL(httsym, value); \
  5028. (word) |= (value) << httsym##_S; \
  5029. } while (0)
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5031. (((word) & httsym##_M) >> httsym##_S)
  5032. #define htt_rx_ring_pkt_enable_subtype_set( \
  5033. word, flag, mode, type, subtype, val) \
  5034. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5035. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5036. #define htt_rx_ring_pkt_enable_subtype_get( \
  5037. word, flag, mode, type, subtype) \
  5038. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5039. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5040. /* Definition to filter in TLVs */
  5041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5066. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5067. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5068. do { \
  5069. HTT_CHECK_SET_VAL(httsym, enable); \
  5070. (word) |= (enable) << httsym##_S; \
  5071. } while (0)
  5072. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5073. (((word) & httsym##_M) >> httsym##_S)
  5074. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5075. HTT_RX_RING_TLV_ENABLE_SET( \
  5076. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5077. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5078. HTT_RX_RING_TLV_ENABLE_GET( \
  5079. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5080. /**
  5081. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  5082. * host --> target Receive Flow Steering configuration message definition.
  5083. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5084. * The reason for this is we want RFS to be configured and ready before MAC
  5085. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5086. *
  5087. * |31 24|23 16|15 9|8|7 0|
  5088. * |----------------+----------------+----------------+----------------|
  5089. * | reserved |E| msg type |
  5090. * |-------------------------------------------------------------------|
  5091. * Where E = RFS enable flag
  5092. *
  5093. * The RFS_CONFIG message consists of a single 4-byte word.
  5094. *
  5095. * Header fields:
  5096. * - MSG_TYPE
  5097. * Bits 7:0
  5098. * Purpose: identifies this as a RFS config msg
  5099. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5100. * - RFS_CONFIG
  5101. * Bit 8
  5102. * Purpose: Tells target whether to enable (1) or disable (0)
  5103. * flow steering feature when sending rx indication messages to host
  5104. */
  5105. #define HTT_H2T_RFS_CONFIG_M 0x100
  5106. #define HTT_H2T_RFS_CONFIG_S 8
  5107. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5108. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5109. HTT_H2T_RFS_CONFIG_S)
  5110. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5111. do { \
  5112. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5113. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5114. } while (0)
  5115. #define HTT_RFS_CFG_REQ_BYTES 4
  5116. /**
  5117. * @brief host -> target FW extended statistics retrieve
  5118. *
  5119. * @details
  5120. * The following field definitions describe the format of the HTT host
  5121. * to target FW extended stats retrieve message.
  5122. * The message specifies the type of stats the host wants to retrieve.
  5123. *
  5124. * |31 24|23 16|15 8|7 0|
  5125. * |-----------------------------------------------------------|
  5126. * | reserved | stats type | pdev_mask | msg type |
  5127. * |-----------------------------------------------------------|
  5128. * | config param [0] |
  5129. * |-----------------------------------------------------------|
  5130. * | config param [1] |
  5131. * |-----------------------------------------------------------|
  5132. * | config param [2] |
  5133. * |-----------------------------------------------------------|
  5134. * | config param [3] |
  5135. * |-----------------------------------------------------------|
  5136. * | reserved |
  5137. * |-----------------------------------------------------------|
  5138. * | cookie LSBs |
  5139. * |-----------------------------------------------------------|
  5140. * | cookie MSBs |
  5141. * |-----------------------------------------------------------|
  5142. * Header fields:
  5143. * - MSG_TYPE
  5144. * Bits 7:0
  5145. * Purpose: identifies this is a extended stats upload request message
  5146. * Value: 0x10
  5147. * - PDEV_MASK
  5148. * Bits 8:15
  5149. * Purpose: identifies the mask of PDEVs to retrieve stats from
  5150. * Value: This is a overloaded field, refer to usage and interpretation of
  5151. * PDEV in interface document.
  5152. * Bit 8 : Reserved for SOC stats
  5153. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5154. * Indicates MACID_MASK in DBS
  5155. * - STATS_TYPE
  5156. * Bits 23:16
  5157. * Purpose: identifies which FW statistics to upload
  5158. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  5159. * - Reserved
  5160. * Bits 31:24
  5161. * - CONFIG_PARAM [0]
  5162. * Bits 31:0
  5163. * Purpose: give an opaque configuration value to the specified stats type
  5164. * Value: stats-type specific configuration value
  5165. * Refer to htt_stats.h for interpretation for each stats sub_type
  5166. * - CONFIG_PARAM [1]
  5167. * Bits 31:0
  5168. * Purpose: give an opaque configuration value to the specified stats type
  5169. * Value: stats-type specific configuration value
  5170. * Refer to htt_stats.h for interpretation for each stats sub_type
  5171. * - CONFIG_PARAM [2]
  5172. * Bits 31:0
  5173. * Purpose: give an opaque configuration value to the specified stats type
  5174. * Value: stats-type specific configuration value
  5175. * Refer to htt_stats.h for interpretation for each stats sub_type
  5176. * - CONFIG_PARAM [3]
  5177. * Bits 31:0
  5178. * Purpose: give an opaque configuration value to the specified stats type
  5179. * Value: stats-type specific configuration value
  5180. * Refer to htt_stats.h for interpretation for each stats sub_type
  5181. * - Reserved [31:0] for future use.
  5182. * - COOKIE_LSBS
  5183. * Bits 31:0
  5184. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5185. * message with its preceding host->target stats request message.
  5186. * Value: LSBs of the opaque cookie specified by the host-side requestor
  5187. * - COOKIE_MSBS
  5188. * Bits 31:0
  5189. * Purpose: Provide a mechanism to match a target->host stats confirmation
  5190. * message with its preceding host->target stats request message.
  5191. * Value: MSBs of the opaque cookie specified by the host-side requestor
  5192. */
  5193. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  5194. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  5195. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  5196. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  5197. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  5198. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  5199. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  5200. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  5201. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  5202. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  5203. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  5204. do { \
  5205. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  5206. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  5207. } while (0)
  5208. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  5209. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  5210. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  5211. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  5212. do { \
  5213. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  5214. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  5215. } while (0)
  5216. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  5217. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  5218. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  5219. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  5220. do { \
  5221. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  5222. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  5223. } while (0)
  5224. /**
  5225. * @brief host -> target FW PPDU_STATS request message
  5226. *
  5227. * @details
  5228. * The following field definitions describe the format of the HTT host
  5229. * to target FW for PPDU_STATS_CFG msg.
  5230. * The message allows the host to configure the PPDU_STATS_IND messages
  5231. * produced by the target.
  5232. *
  5233. * |31 24|23 16|15 8|7 0|
  5234. * |-----------------------------------------------------------|
  5235. * | REQ bit mask | pdev_mask | msg type |
  5236. * |-----------------------------------------------------------|
  5237. * Header fields:
  5238. * - MSG_TYPE
  5239. * Bits 7:0
  5240. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  5241. * Value: 0x11
  5242. * - PDEV_MASK
  5243. * Bits 8:15
  5244. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  5245. * Value: This is a overloaded field, refer to usage and interpretation of
  5246. * PDEV in interface document.
  5247. * Bit 8 : Reserved for SOC stats
  5248. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  5249. * Indicates MACID_MASK in DBS
  5250. * - REQ_TLV_BIT_MASK
  5251. * Bits 16:31
  5252. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  5253. * needs to be included in the target's PPDU_STATS_IND messages.
  5254. * Value: refer htt_ppdu_stats_tlv_tag_t
  5255. *
  5256. */
  5257. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  5258. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  5259. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  5260. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  5261. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  5262. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  5263. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  5264. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  5265. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  5266. do { \
  5267. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  5268. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  5269. } while (0)
  5270. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  5271. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  5272. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  5273. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  5274. do { \
  5275. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  5276. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  5277. } while (0)
  5278. /**
  5279. * @brief Host-->target HTT RX FSE setup message
  5280. * @details
  5281. * Through this message, the host will provide details of the flow tables
  5282. * in host DDR along with hash keys.
  5283. * This message can be sent per SOC or per PDEV, which is differentiated
  5284. * by pdev id values.
  5285. * The host will allocate flow search table and sends table size,
  5286. * physical DMA address of flow table, and hash keys to firmware to
  5287. * program into the RXOLE FSE HW block.
  5288. *
  5289. * The following field definitions describe the format of the RX FSE setup
  5290. * message sent from the host to target
  5291. *
  5292. * Header fields:
  5293. * dword0 - b'7:0 - msg_type: This will be set to
  5294. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  5295. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5296. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5297. * pdev's LMAC ring.
  5298. * b'31:16 - reserved : Reserved for future use
  5299. * dword1 - b'19:0 - number of records: This field indicates the number of
  5300. * entries in the flow table. For example: 8k number of
  5301. * records is equivalent to
  5302. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  5303. * b'27:20 - max search: This field specifies the skid length to FSE
  5304. * parser HW module whenever match is not found at the
  5305. * exact index pointed by hash.
  5306. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  5307. * Refer htt_ip_da_sa_prefix below for more details.
  5308. * b'31:30 - reserved: Reserved for future use
  5309. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  5310. * table allocated by host in DDR
  5311. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  5312. * table allocated by host in DDR
  5313. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  5314. * entry hashing
  5315. *
  5316. *
  5317. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  5318. * |---------------------------------------------------------------|
  5319. * | reserved | pdev_id | MSG_TYPE |
  5320. * |---------------------------------------------------------------|
  5321. * |resvd|IPDSA| max_search | Number of records |
  5322. * |---------------------------------------------------------------|
  5323. * | base address lo |
  5324. * |---------------------------------------------------------------|
  5325. * | base address high |
  5326. * |---------------------------------------------------------------|
  5327. * | toeplitz key 31_0 |
  5328. * |---------------------------------------------------------------|
  5329. * | toeplitz key 63_32 |
  5330. * |---------------------------------------------------------------|
  5331. * | toeplitz key 95_64 |
  5332. * |---------------------------------------------------------------|
  5333. * | toeplitz key 127_96 |
  5334. * |---------------------------------------------------------------|
  5335. * | toeplitz key 159_128 |
  5336. * |---------------------------------------------------------------|
  5337. * | toeplitz key 191_160 |
  5338. * |---------------------------------------------------------------|
  5339. * | toeplitz key 223_192 |
  5340. * |---------------------------------------------------------------|
  5341. * | toeplitz key 255_224 |
  5342. * |---------------------------------------------------------------|
  5343. * | toeplitz key 287_256 |
  5344. * |---------------------------------------------------------------|
  5345. * | reserved | toeplitz key 314_288(26:0 bits) |
  5346. * |---------------------------------------------------------------|
  5347. * where:
  5348. * IPDSA = ip_da_sa
  5349. */
  5350. /**
  5351. * @brief: htt_ip_da_sa_prefix
  5352. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  5353. * IPv6 addresses beginning with 0x20010db8 are reserved for
  5354. * documentation per RFC3849
  5355. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  5356. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  5357. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  5358. */
  5359. enum htt_ip_da_sa_prefix {
  5360. HTT_RX_IPV6_20010db8,
  5361. HTT_RX_IPV4_MAPPED_IPV6,
  5362. HTT_RX_IPV4_COMPATIBLE_IPV6,
  5363. HTT_RX_IPV6_64FF9B,
  5364. };
  5365. /**
  5366. * @brief Host-->target HTT RX FISA configure and enable
  5367. * @details
  5368. * The host will send this command down to configure and enable the FISA
  5369. * operational params.
  5370. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  5371. * register.
  5372. * Should configure both the MACs.
  5373. *
  5374. * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
  5375. *
  5376. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5377. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  5378. * pdev's LMAC ring.
  5379. * b'31:16 - reserved : Reserved for future use
  5380. *
  5381. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  5382. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  5383. * packets. 1 flow search will be skipped
  5384. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  5385. * tcp,udp packets
  5386. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  5387. * calculation
  5388. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  5389. * calculation
  5390. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  5391. * calculation
  5392. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  5393. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  5394. * length
  5395. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  5396. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  5397. * length
  5398. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  5399. * num jump
  5400. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  5401. * num jump
  5402. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  5403. * data type switch has happend for MPDU Sequence num jump
  5404. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  5405. * for MPDU Sequence num jump
  5406. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  5407. * for decrypt errors
  5408. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  5409. * while aggregating a msdu
  5410. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  5411. * The aggregation is done until (number of MSDUs aggregated
  5412. * < LIMIT + 1)
  5413. * b'31:18 - Reserved
  5414. *
  5415. * fisa_control_value - 32bit value FW can write to register
  5416. *
  5417. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  5418. * Threshold value for FISA timeout (units are microseconds).
  5419. * When the global timestamp exceeds this threshold, FISA
  5420. * aggregation will be restarted.
  5421. * A value of 0 means timeout is disabled.
  5422. * Compare the threshold register with timestamp field in
  5423. * flow entry to generate timeout for the flow.
  5424. *
  5425. * |31 18 |17 16|15 8|7 0|
  5426. * |-------------------------------------------------------------|
  5427. * | reserved | pdev_mask | msg type |
  5428. * |-------------------------------------------------------------|
  5429. * | reserved | FISA_CTRL |
  5430. * |-------------------------------------------------------------|
  5431. * | FISA_TIMEOUT_THRESH |
  5432. * |-------------------------------------------------------------|
  5433. */
  5434. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  5435. A_UINT32 msg_type:8,
  5436. pdev_id:8,
  5437. reserved0:16;
  5438. /**
  5439. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  5440. * [17:0]
  5441. */
  5442. union {
  5443. struct {
  5444. A_UINT32 fisa_enable: 1,
  5445. ipsec_skip_search: 1,
  5446. nontcp_skip_search: 1,
  5447. add_ipv4_fixed_hdr_len: 1,
  5448. add_ipv6_fixed_hdr_len: 1,
  5449. add_tcp_fixed_hdr_len: 1,
  5450. add_udp_hdr_len: 1,
  5451. chksum_cum_ip_len_en: 1,
  5452. disable_tid_check: 1,
  5453. disable_ta_check: 1,
  5454. disable_qos_check: 1,
  5455. disable_raw_check: 1,
  5456. disable_decrypt_err_check: 1,
  5457. disable_msdu_drop_check: 1,
  5458. fisa_aggr_limit: 4,
  5459. reserved: 14;
  5460. } fisa_control_bits;
  5461. A_UINT32 fisa_control_value;
  5462. } u_fisa_control;
  5463. /**
  5464. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  5465. * timeout threshold for aggregation. Unit in usec.
  5466. * [31:0]
  5467. */
  5468. A_UINT32 fisa_timeout_threshold;
  5469. } POSTPACK;
  5470. /* DWord 0: pdev-ID */
  5471. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  5472. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  5473. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  5474. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  5475. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  5476. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  5477. do { \
  5478. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  5479. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  5480. } while (0)
  5481. /* Dword 1: fisa_control_value fisa config */
  5482. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  5483. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  5484. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  5485. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  5486. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  5487. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  5488. do { \
  5489. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  5490. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  5491. } while (0)
  5492. /* Dword 1: fisa_control_value ipsec_skip_search */
  5493. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  5494. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  5495. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  5496. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  5497. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  5498. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  5501. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  5502. } while (0)
  5503. /* Dword 1: fisa_control_value non_tcp_skip_search */
  5504. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  5505. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  5506. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  5507. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  5508. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  5509. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  5510. do { \
  5511. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  5512. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  5513. } while (0)
  5514. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  5515. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  5516. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  5517. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  5518. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  5519. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  5520. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  5521. do { \
  5522. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  5523. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  5524. } while (0)
  5525. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  5526. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  5527. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  5528. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  5529. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  5530. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  5531. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  5532. do { \
  5533. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  5534. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  5535. } while (0)
  5536. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  5537. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  5538. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  5539. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  5540. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  5541. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  5542. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  5543. do { \
  5544. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  5545. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  5546. } while (0)
  5547. /* Dword 1: fisa_control_value add_udp_hdr_len */
  5548. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  5549. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  5550. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  5551. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  5552. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  5553. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  5554. do { \
  5555. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  5556. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  5557. } while (0)
  5558. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  5559. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  5560. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  5561. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  5562. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  5563. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  5564. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  5565. do { \
  5566. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  5567. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  5568. } while (0)
  5569. /* Dword 1: fisa_control_value disable_tid_check */
  5570. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  5571. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  5572. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  5573. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  5574. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  5575. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  5576. do { \
  5577. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  5578. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  5579. } while (0)
  5580. /* Dword 1: fisa_control_value disable_ta_check */
  5581. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  5582. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  5583. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  5584. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  5585. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  5586. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  5587. do { \
  5588. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  5589. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  5590. } while (0)
  5591. /* Dword 1: fisa_control_value disable_qos_check */
  5592. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  5593. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  5594. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  5595. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  5596. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  5597. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  5598. do { \
  5599. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  5600. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  5601. } while (0)
  5602. /* Dword 1: fisa_control_value disable_raw_check */
  5603. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  5604. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  5605. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  5606. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  5607. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  5608. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  5609. do { \
  5610. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  5611. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  5612. } while (0)
  5613. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  5614. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  5615. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  5616. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  5617. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  5618. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  5619. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  5620. do { \
  5621. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  5622. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  5623. } while (0)
  5624. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  5625. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  5626. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  5627. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  5628. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  5629. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  5630. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  5631. do { \
  5632. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  5633. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  5634. } while (0)
  5635. /* Dword 1: fisa_control_value fisa_aggr_limit */
  5636. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  5637. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  5638. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  5639. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  5640. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  5641. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  5642. do { \
  5643. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  5644. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  5645. } while (0)
  5646. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  5647. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  5648. pdev_id:8,
  5649. reserved0:16;
  5650. A_UINT32 num_records:20,
  5651. max_search:8,
  5652. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  5653. reserved1:2;
  5654. A_UINT32 base_addr_lo;
  5655. A_UINT32 base_addr_hi;
  5656. A_UINT32 toeplitz31_0;
  5657. A_UINT32 toeplitz63_32;
  5658. A_UINT32 toeplitz95_64;
  5659. A_UINT32 toeplitz127_96;
  5660. A_UINT32 toeplitz159_128;
  5661. A_UINT32 toeplitz191_160;
  5662. A_UINT32 toeplitz223_192;
  5663. A_UINT32 toeplitz255_224;
  5664. A_UINT32 toeplitz287_256;
  5665. A_UINT32 toeplitz314_288:27,
  5666. reserved2:5;
  5667. } POSTPACK;
  5668. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  5669. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  5670. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  5671. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  5672. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  5673. /* DWORD 0: Pdev ID */
  5674. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  5675. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  5676. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  5677. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  5678. HTT_RX_FSE_SETUP_PDEV_ID_S)
  5679. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  5680. do { \
  5681. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  5682. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  5683. } while (0)
  5684. /* DWORD 1:num of records */
  5685. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  5686. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  5687. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  5688. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  5689. HTT_RX_FSE_SETUP_NUM_REC_S)
  5690. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  5691. do { \
  5692. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  5693. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  5694. } while (0)
  5695. /* DWORD 1:max_search */
  5696. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  5697. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  5698. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  5699. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  5700. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  5701. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  5702. do { \
  5703. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  5704. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  5705. } while (0)
  5706. /* DWORD 1:ip_da_sa prefix */
  5707. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  5708. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  5709. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  5710. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  5711. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  5712. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  5713. do { \
  5714. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  5715. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  5716. } while (0)
  5717. /* DWORD 2: Base Address LO */
  5718. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  5719. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  5720. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  5721. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  5722. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  5723. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  5724. do { \
  5725. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  5726. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  5727. } while (0)
  5728. /* DWORD 3: Base Address High */
  5729. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  5730. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  5731. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  5732. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  5733. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  5734. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  5735. do { \
  5736. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  5737. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  5738. } while (0)
  5739. /* DWORD 4-12: Hash Value */
  5740. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  5741. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  5742. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  5743. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  5744. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  5745. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  5746. do { \
  5747. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  5748. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  5749. } while (0)
  5750. /* DWORD 13: Hash Value 314:288 bits */
  5751. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  5752. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  5753. HTT_RX_FSE_SETUP_HASH_314_288_S)
  5754. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  5755. do { \
  5756. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  5757. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  5758. } while (0)
  5759. /**
  5760. * @brief Host-->target HTT RX FSE operation message
  5761. * @details
  5762. * The host will send this Flow Search Engine (FSE) operation message for
  5763. * every flow add/delete operation.
  5764. * The FSE operation includes FSE full cache invalidation or individual entry
  5765. * invalidation.
  5766. * This message can be sent per SOC or per PDEV which is differentiated
  5767. * by pdev id values.
  5768. *
  5769. * |31 16|15 8|7 1|0|
  5770. * |-------------------------------------------------------------|
  5771. * | reserved | pdev_id | MSG_TYPE |
  5772. * |-------------------------------------------------------------|
  5773. * | reserved | operation |I|
  5774. * |-------------------------------------------------------------|
  5775. * | ip_src_addr_31_0 |
  5776. * |-------------------------------------------------------------|
  5777. * | ip_src_addr_63_32 |
  5778. * |-------------------------------------------------------------|
  5779. * | ip_src_addr_95_64 |
  5780. * |-------------------------------------------------------------|
  5781. * | ip_src_addr_127_96 |
  5782. * |-------------------------------------------------------------|
  5783. * | ip_dst_addr_31_0 |
  5784. * |-------------------------------------------------------------|
  5785. * | ip_dst_addr_63_32 |
  5786. * |-------------------------------------------------------------|
  5787. * | ip_dst_addr_95_64 |
  5788. * |-------------------------------------------------------------|
  5789. * | ip_dst_addr_127_96 |
  5790. * |-------------------------------------------------------------|
  5791. * | l4_dst_port | l4_src_port |
  5792. * | (32-bit SPI incase of IPsec) |
  5793. * |-------------------------------------------------------------|
  5794. * | reserved | l4_proto |
  5795. * |-------------------------------------------------------------|
  5796. *
  5797. * where I is 1-bit ipsec_valid.
  5798. *
  5799. * The following field definitions describe the format of the RX FSE operation
  5800. * message sent from the host to target for every add/delete flow entry to flow
  5801. * table.
  5802. *
  5803. * Header fields:
  5804. * dword0 - b'7:0 - msg_type: This will be set to
  5805. * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  5806. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5807. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5808. * specified pdev's LMAC ring.
  5809. * b'31:16 - reserved : Reserved for future use
  5810. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  5811. * (Internet Protocol Security).
  5812. * IPsec describes the framework for providing security at
  5813. * IP layer. IPsec is defined for both versions of IP:
  5814. * IPV4 and IPV6.
  5815. * Please refer to htt_rx_flow_proto enumeration below for
  5816. * more info.
  5817. * ipsec_valid = 1 for IPSEC packets
  5818. * ipsec_valid = 0 for IP Packets
  5819. * b'7:1 - operation: This indicates types of FSE operation.
  5820. * Refer to htt_rx_fse_operation enumeration:
  5821. * 0 - No Cache Invalidation required
  5822. * 1 - Cache invalidate only one entry given by IP
  5823. * src/dest address at DWORD[2:9]
  5824. * 2 - Complete FSE Cache Invalidation
  5825. * 3 - FSE Disable
  5826. * 4 - FSE Enable
  5827. * b'31:8 - reserved: Reserved for future use
  5828. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  5829. * for per flow addition/deletion
  5830. * For IPV4 src/dest addresses, the first A_UINT32 is used
  5831. * and the subsequent 3 A_UINT32 will be padding bytes.
  5832. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  5833. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  5834. * from 0 to 65535 but only 0 to 1023 are designated as
  5835. * well-known ports. Refer to [RFC1700] for more details.
  5836. * This field is valid only if
  5837. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5838. * - L4 dest port (31:16): 16-bit Destination Port numbers
  5839. * range from 0 to 65535 but only 0 to 1023 are designated
  5840. * as well-known ports. Refer to [RFC1700] for more details.
  5841. * This field is valid only if
  5842. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  5843. * - SPI (31:0): Security Parameters Index is an
  5844. * identification tag added to the header while using IPsec
  5845. * for tunneling the IP traffici.
  5846. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  5847. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  5848. * Assigned Internet Protocol Numbers.
  5849. * l4_proto numbers for standard protocol like UDP/TCP
  5850. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  5851. * l4_proto = 17 for UDP etc.
  5852. * b'31:8 - reserved: Reserved for future use.
  5853. *
  5854. */
  5855. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  5856. A_UINT32 msg_type:8,
  5857. pdev_id:8,
  5858. reserved0:16;
  5859. A_UINT32 ipsec_valid:1,
  5860. operation:7,
  5861. reserved1:24;
  5862. A_UINT32 ip_src_addr_31_0;
  5863. A_UINT32 ip_src_addr_63_32;
  5864. A_UINT32 ip_src_addr_95_64;
  5865. A_UINT32 ip_src_addr_127_96;
  5866. A_UINT32 ip_dest_addr_31_0;
  5867. A_UINT32 ip_dest_addr_63_32;
  5868. A_UINT32 ip_dest_addr_95_64;
  5869. A_UINT32 ip_dest_addr_127_96;
  5870. union {
  5871. A_UINT32 spi;
  5872. struct {
  5873. A_UINT32 l4_src_port:16,
  5874. l4_dest_port:16;
  5875. } ip;
  5876. } u;
  5877. A_UINT32 l4_proto:8,
  5878. reserved:24;
  5879. } POSTPACK;
  5880. /**
  5881. * @brief Host-->target HTT RX Full monitor mode register configuration message
  5882. * @details
  5883. * The host will send this Full monitor mode register configuration message.
  5884. * This message can be sent per SOC or per PDEV which is differentiated
  5885. * by pdev id values.
  5886. *
  5887. * |31 16|15 11|10 8|7 3|2|1|0|
  5888. * |-------------------------------------------------------------|
  5889. * | reserved | pdev_id | MSG_TYPE |
  5890. * |-------------------------------------------------------------|
  5891. * | reserved |Release Ring |N|Z|E|
  5892. * |-------------------------------------------------------------|
  5893. *
  5894. * where E is 1-bit full monitor mode enable/disable.
  5895. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  5896. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  5897. *
  5898. * The following field definitions describe the format of the full monitor
  5899. * mode configuration message sent from the host to target for each pdev.
  5900. *
  5901. * Header fields:
  5902. * dword0 - b'7:0 - msg_type: This will be set to
  5903. * HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE.
  5904. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  5905. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  5906. * specified pdev's LMAC ring.
  5907. * b'31:16 - reserved : Reserved for future use.
  5908. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  5909. * monitor mode rxdma register is to be enabled or disabled.
  5910. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  5911. * additional descriptors at ppdu end for zero mpdus
  5912. * enabled or disabled.
  5913. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  5914. * additional descriptors at ppdu end for non zero mpdus
  5915. * enabled or disabled.
  5916. * b'10:3 - release_ring: This indicates the destination ring
  5917. * selection for the descriptor at the end of PPDU
  5918. * 0 - REO ring select
  5919. * 1 - FW ring select
  5920. * 2 - SW ring select
  5921. * 3 - Release ring select
  5922. * Refer to htt_rx_full_mon_release_ring.
  5923. * b'31:11 - reserved for future use
  5924. */
  5925. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  5926. A_UINT32 msg_type:8,
  5927. pdev_id:8,
  5928. reserved0:16;
  5929. A_UINT32 full_monitor_mode_enable:1,
  5930. addnl_descs_zero_mpdus_end:1,
  5931. addnl_descs_non_zero_mpdus_end:1,
  5932. release_ring:8,
  5933. reserved1:21;
  5934. } POSTPACK;
  5935. /**
  5936. * Enumeration for full monitor mode destination ring select
  5937. * 0 - REO destination ring select
  5938. * 1 - FW destination ring select
  5939. * 2 - SW destination ring select
  5940. * 3 - Release destination ring select
  5941. */
  5942. enum htt_rx_full_mon_release_ring {
  5943. HTT_RX_MON_RING_REO,
  5944. HTT_RX_MON_RING_FW,
  5945. HTT_RX_MON_RING_SW,
  5946. HTT_RX_MON_RING_RELEASE,
  5947. };
  5948. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  5949. /* DWORD 0: Pdev ID */
  5950. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  5951. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  5952. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  5953. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  5954. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  5955. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  5956. do { \
  5957. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  5958. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  5959. } while (0)
  5960. /* DWORD 1:ENABLE */
  5961. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  5962. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  5963. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  5964. do { \
  5965. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  5966. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  5967. } while (0)
  5968. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  5969. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  5970. /* DWORD 1:ZERO_MPDU */
  5971. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  5972. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  5973. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  5974. do { \
  5975. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  5976. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  5977. } while (0)
  5978. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  5979. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  5980. /* DWORD 1:NON_ZERO_MPDU */
  5981. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  5982. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  5983. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  5984. do { \
  5985. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  5986. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  5987. } while (0)
  5988. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  5989. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  5990. /* DWORD 1:RELEASE_RINGS */
  5991. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  5992. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  5993. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  5994. do { \
  5995. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  5996. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  5997. } while (0)
  5998. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  5999. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6000. /**
  6001. * Enumeration for IP Protocol or IPSEC Protocol
  6002. * IPsec describes the framework for providing security at IP layer.
  6003. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6004. */
  6005. enum htt_rx_flow_proto {
  6006. HTT_RX_FLOW_IP_PROTO,
  6007. HTT_RX_FLOW_IPSEC_PROTO,
  6008. };
  6009. /**
  6010. * Enumeration for FSE Cache Invalidation
  6011. * 0 - No Cache Invalidation required
  6012. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6013. * 2 - Complete FSE Cache Invalidation
  6014. * 3 - FSE Disable
  6015. * 4 - FSE Enable
  6016. */
  6017. enum htt_rx_fse_operation {
  6018. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6019. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6020. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6021. HTT_RX_FSE_DISABLE,
  6022. HTT_RX_FSE_ENABLE,
  6023. };
  6024. /* DWORD 0: Pdev ID */
  6025. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6026. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6027. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6028. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6029. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6030. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6031. do { \
  6032. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6033. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6034. } while (0)
  6035. /* DWORD 1:IP PROTO or IPSEC */
  6036. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6037. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6038. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6039. do { \
  6040. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6041. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6042. } while (0)
  6043. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6044. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6045. /* DWORD 1:FSE Operation */
  6046. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6047. #define HTT_RX_FSE_OPERATION_S 1
  6048. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6049. do { \
  6050. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6051. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6052. } while (0)
  6053. #define HTT_RX_FSE_OPERATION_GET(word) \
  6054. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6055. /* DWORD 2-9:IP Address */
  6056. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6057. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6058. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6059. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6060. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6061. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6062. do { \
  6063. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6064. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6065. } while (0)
  6066. /* DWORD 10:Source Port Number */
  6067. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6068. #define HTT_RX_FSE_SOURCEPORT_S 0
  6069. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6070. do { \
  6071. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6072. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6073. } while (0)
  6074. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6075. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6076. /* DWORD 11:Destination Port Number */
  6077. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6078. #define HTT_RX_FSE_DESTPORT_S 16
  6079. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6080. do { \
  6081. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6082. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6083. } while (0)
  6084. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6085. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6086. /* DWORD 10-11:SPI (In case of IPSEC) */
  6087. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6088. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6089. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6090. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6091. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6092. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6093. do { \
  6094. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  6095. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  6096. } while (0)
  6097. /* DWORD 12:L4 PROTO */
  6098. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  6099. #define HTT_RX_FSE_L4_PROTO_S 0
  6100. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  6101. do { \
  6102. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  6103. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  6104. } while (0)
  6105. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  6106. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  6107. /**
  6108. * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6109. * host --> target Receive to configure the RxOLE 3-tuple Hash
  6110. *
  6111. * |31 24|23 |15 8|7 2|1|0|
  6112. * |----------------+----------------+----------------+----------------|
  6113. * | reserved | pdev_id | msg_type |
  6114. * |---------------------------------+----------------+----------------|
  6115. * | reserved |E|F|
  6116. * |---------------------------------+----------------+----------------|
  6117. * Where E = Configure the target to provide the 3-tuple hash value in
  6118. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  6119. * F = Configure the target to provide the 3-tuple hash value in
  6120. * flow_id_toeplitz field of rx_msdu_start tlv
  6121. *
  6122. * The following field definitions describe the format of the 3 tuple hash value
  6123. * message sent from the host to target as part of initialization sequence.
  6124. *
  6125. * Header fields:
  6126. * dword0 - b'7:0 - msg_type: This will be set to
  6127. * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  6128. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6129. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6130. * specified pdev's LMAC ring.
  6131. * b'31:16 - reserved : Reserved for future use
  6132. * dword1 - b'0 - flow_id_toeplitz_field_enable
  6133. * b'1 - toeplitz_hash_2_or_4_field_enable
  6134. * b'31:2 - reserved : Reserved for future use
  6135. * ---------+------+----------------------------------------------------------
  6136. * bit1 | bit0 | Functionality
  6137. * ---------+------+----------------------------------------------------------
  6138. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  6139. * | | in flow_id_toeplitz field
  6140. * ---------+------+----------------------------------------------------------
  6141. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  6142. * | | in toeplitz_hash_2_or_4 field
  6143. * ---------+------+----------------------------------------------------------
  6144. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  6145. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  6146. * ---------+------+----------------------------------------------------------
  6147. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  6148. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  6149. * | | toeplitz_hash_2_or_4 field
  6150. *----------------------------------------------------------------------------
  6151. */
  6152. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  6153. A_UINT32 msg_type :8,
  6154. pdev_id :8,
  6155. reserved0 :16;
  6156. A_UINT32 flow_id_toeplitz_field_enable :1,
  6157. toeplitz_hash_2_or_4_field_enable :1,
  6158. reserved1 :30;
  6159. } POSTPACK;
  6160. /* DWORD0 : pdev_id configuration Macros */
  6161. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  6162. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  6163. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  6164. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  6165. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  6166. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  6167. do { \
  6168. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  6169. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  6170. } while (0)
  6171. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  6172. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  6173. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  6174. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  6175. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  6176. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  6177. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  6178. do { \
  6179. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  6180. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  6181. } while (0)
  6182. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  6183. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  6184. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  6185. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  6186. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  6187. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  6188. do { \
  6189. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  6190. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  6191. } while (0)
  6192. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  6193. /*=== target -> host messages ===============================================*/
  6194. enum htt_t2h_msg_type {
  6195. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  6196. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  6197. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  6198. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  6199. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  6200. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  6201. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  6202. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  6203. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  6204. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  6205. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  6206. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  6207. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  6208. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  6209. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  6210. /* only used for HL, add HTT MSG for HTT CREDIT update */
  6211. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  6212. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  6213. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  6214. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  6215. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  6216. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  6217. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  6218. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  6219. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  6220. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  6221. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  6222. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  6223. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  6224. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  6225. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  6226. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  6227. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  6228. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  6229. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  6230. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  6231. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  6232. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  6233. /* TX_OFFLOAD_DELIVER_IND:
  6234. * Forward the target's locally-generated packets to the host,
  6235. * to provide to the monitor mode interface.
  6236. */
  6237. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  6238. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  6239. HTT_T2H_MSG_TYPE_TEST,
  6240. /* keep this last */
  6241. HTT_T2H_NUM_MSGS
  6242. };
  6243. /*
  6244. * HTT target to host message type -
  6245. * stored in bits 7:0 of the first word of the message
  6246. */
  6247. #define HTT_T2H_MSG_TYPE_M 0xff
  6248. #define HTT_T2H_MSG_TYPE_S 0
  6249. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  6250. do { \
  6251. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  6252. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  6253. } while (0)
  6254. #define HTT_T2H_MSG_TYPE_GET(word) \
  6255. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  6256. /**
  6257. * @brief target -> host version number confirmation message definition
  6258. *
  6259. * |31 24|23 16|15 8|7 0|
  6260. * |----------------+----------------+----------------+----------------|
  6261. * | reserved | major number | minor number | msg type |
  6262. * |-------------------------------------------------------------------|
  6263. * : option request TLV (optional) |
  6264. * :...................................................................:
  6265. *
  6266. * The VER_CONF message may consist of a single 4-byte word, or may be
  6267. * extended with TLVs that specify HTT options selected by the target.
  6268. * The following option TLVs may be appended to the VER_CONF message:
  6269. * - LL_BUS_ADDR_SIZE
  6270. * - HL_SUPPRESS_TX_COMPL_IND
  6271. * - MAX_TX_QUEUE_GROUPS
  6272. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  6273. * may be appended to the VER_CONF message (but only one TLV of each type).
  6274. *
  6275. * Header fields:
  6276. * - MSG_TYPE
  6277. * Bits 7:0
  6278. * Purpose: identifies this as a version number confirmation message
  6279. * Value: 0x0
  6280. * - VER_MINOR
  6281. * Bits 15:8
  6282. * Purpose: Specify the minor number of the HTT message library version
  6283. * in use by the target firmware.
  6284. * The minor number specifies the specific revision within a range
  6285. * of fundamentally compatible HTT message definition revisions.
  6286. * Compatible revisions involve adding new messages or perhaps
  6287. * adding new fields to existing messages, in a backwards-compatible
  6288. * manner.
  6289. * Incompatible revisions involve changing the message type values,
  6290. * or redefining existing messages.
  6291. * Value: minor number
  6292. * - VER_MAJOR
  6293. * Bits 15:8
  6294. * Purpose: Specify the major number of the HTT message library version
  6295. * in use by the target firmware.
  6296. * The major number specifies the family of minor revisions that are
  6297. * fundamentally compatible with each other, but not with prior or
  6298. * later families.
  6299. * Value: major number
  6300. */
  6301. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  6302. #define HTT_VER_CONF_MINOR_S 8
  6303. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  6304. #define HTT_VER_CONF_MAJOR_S 16
  6305. #define HTT_VER_CONF_MINOR_SET(word, value) \
  6306. do { \
  6307. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  6308. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  6309. } while (0)
  6310. #define HTT_VER_CONF_MINOR_GET(word) \
  6311. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  6312. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  6313. do { \
  6314. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  6315. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  6316. } while (0)
  6317. #define HTT_VER_CONF_MAJOR_GET(word) \
  6318. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  6319. #define HTT_VER_CONF_BYTES 4
  6320. /**
  6321. * @brief - target -> host HTT Rx In order indication message
  6322. *
  6323. * @details
  6324. *
  6325. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  6326. * |----------------+-------------------+---------------------+---------------|
  6327. * | peer ID | P| F| O| ext TID | msg type |
  6328. * |--------------------------------------------------------------------------|
  6329. * | MSDU count | Reserved | vdev id |
  6330. * |--------------------------------------------------------------------------|
  6331. * | MSDU 0 bus address (bits 31:0) |
  6332. #if HTT_PADDR64
  6333. * | MSDU 0 bus address (bits 63:32) |
  6334. #endif
  6335. * |--------------------------------------------------------------------------|
  6336. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  6337. * |--------------------------------------------------------------------------|
  6338. * | MSDU 1 bus address (bits 31:0) |
  6339. #if HTT_PADDR64
  6340. * | MSDU 1 bus address (bits 63:32) |
  6341. #endif
  6342. * |--------------------------------------------------------------------------|
  6343. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  6344. * |--------------------------------------------------------------------------|
  6345. */
  6346. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  6347. *
  6348. * @details
  6349. * bits
  6350. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  6351. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6352. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  6353. * | | frag | | | | fail |chksum fail|
  6354. * |-----+----+-------+--------+--------+---------+---------+-----------|
  6355. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  6356. */
  6357. struct htt_rx_in_ord_paddr_ind_hdr_t
  6358. {
  6359. A_UINT32 /* word 0 */
  6360. msg_type: 8,
  6361. ext_tid: 5,
  6362. offload: 1,
  6363. frag: 1,
  6364. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  6365. peer_id: 16;
  6366. A_UINT32 /* word 1 */
  6367. vap_id: 8,
  6368. /* NOTE:
  6369. * This reserved_1 field is not truly reserved - certain targets use
  6370. * this field internally to store debug information, and do not zero
  6371. * out the contents of the field before uploading the message to the
  6372. * host. Thus, any host-target communication supported by this field
  6373. * is limited to using values that are never used by the debug
  6374. * information stored by certain targets in the reserved_1 field.
  6375. * In particular, the targets in question don't use the value 0x3
  6376. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  6377. * so this previously-unused value within these bits is available to
  6378. * use as the host / target PKT_CAPTURE_MODE flag.
  6379. */
  6380. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  6381. /* if pkt_capture_mode == 0x3, host should
  6382. * send rx frames to monitor mode interface
  6383. */
  6384. msdu_cnt: 16;
  6385. };
  6386. struct htt_rx_in_ord_paddr_ind_msdu32_t
  6387. {
  6388. A_UINT32 dma_addr;
  6389. A_UINT32
  6390. length: 16,
  6391. fw_desc: 8,
  6392. msdu_info:8;
  6393. };
  6394. struct htt_rx_in_ord_paddr_ind_msdu64_t
  6395. {
  6396. A_UINT32 dma_addr_lo;
  6397. A_UINT32 dma_addr_hi;
  6398. A_UINT32
  6399. length: 16,
  6400. fw_desc: 8,
  6401. msdu_info:8;
  6402. };
  6403. #if HTT_PADDR64
  6404. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  6405. #else
  6406. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  6407. #endif
  6408. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  6409. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  6410. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  6411. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  6412. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  6413. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  6414. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  6415. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  6416. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  6417. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  6418. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  6419. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  6420. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  6421. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  6422. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  6423. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  6424. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  6425. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  6426. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  6427. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  6428. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  6429. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  6430. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  6431. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  6432. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  6433. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  6434. /* for systems using 64-bit format for bus addresses */
  6435. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  6436. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  6437. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  6438. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  6439. /* for systems using 32-bit format for bus addresses */
  6440. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  6441. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  6442. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  6443. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  6444. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  6445. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  6446. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  6447. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  6448. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  6449. do { \
  6450. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  6451. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  6452. } while (0)
  6453. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  6454. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  6455. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  6456. do { \
  6457. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  6458. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  6459. } while (0)
  6460. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  6461. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  6462. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  6463. do { \
  6464. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  6465. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  6466. } while (0)
  6467. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  6468. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  6469. /*
  6470. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  6471. * deliver the rx frames to the monitor mode interface.
  6472. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  6473. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  6474. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  6475. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  6476. */
  6477. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  6478. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  6479. do { \
  6480. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  6481. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  6482. } while (0)
  6483. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  6484. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  6485. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  6486. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  6487. do { \
  6488. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  6489. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  6490. } while (0)
  6491. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  6492. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  6493. /* for systems using 64-bit format for bus addresses */
  6494. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  6495. do { \
  6496. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  6497. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  6498. } while (0)
  6499. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  6500. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  6501. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  6504. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  6505. } while (0)
  6506. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  6507. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  6508. /* for systems using 32-bit format for bus addresses */
  6509. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  6510. do { \
  6511. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  6512. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  6513. } while (0)
  6514. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  6515. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  6516. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  6517. do { \
  6518. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  6519. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  6520. } while (0)
  6521. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  6522. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  6523. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  6524. do { \
  6525. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  6526. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  6527. } while (0)
  6528. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  6529. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  6530. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  6533. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  6534. } while (0)
  6535. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  6536. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  6537. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  6538. do { \
  6539. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  6540. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  6541. } while (0)
  6542. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  6543. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  6544. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  6545. do { \
  6546. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  6547. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  6548. } while (0)
  6549. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  6550. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  6551. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  6554. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  6555. } while (0)
  6556. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  6557. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  6558. /* definitions used within target -> host rx indication message */
  6559. PREPACK struct htt_rx_ind_hdr_prefix_t
  6560. {
  6561. A_UINT32 /* word 0 */
  6562. msg_type: 8,
  6563. ext_tid: 5,
  6564. release_valid: 1,
  6565. flush_valid: 1,
  6566. reserved0: 1,
  6567. peer_id: 16;
  6568. A_UINT32 /* word 1 */
  6569. flush_start_seq_num: 6,
  6570. flush_end_seq_num: 6,
  6571. release_start_seq_num: 6,
  6572. release_end_seq_num: 6,
  6573. num_mpdu_ranges: 8;
  6574. } POSTPACK;
  6575. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  6576. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  6577. #define HTT_TGT_RSSI_INVALID 0x80
  6578. PREPACK struct htt_rx_ppdu_desc_t
  6579. {
  6580. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  6581. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  6582. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  6583. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  6584. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  6585. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  6586. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  6587. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  6588. A_UINT32 /* word 0 */
  6589. rssi_cmb: 8,
  6590. timestamp_submicrosec: 8,
  6591. phy_err_code: 8,
  6592. phy_err: 1,
  6593. legacy_rate: 4,
  6594. legacy_rate_sel: 1,
  6595. end_valid: 1,
  6596. start_valid: 1;
  6597. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  6598. union {
  6599. A_UINT32 /* word 1 */
  6600. rssi0_pri20: 8,
  6601. rssi0_ext20: 8,
  6602. rssi0_ext40: 8,
  6603. rssi0_ext80: 8;
  6604. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  6605. } u0;
  6606. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  6607. union {
  6608. A_UINT32 /* word 2 */
  6609. rssi1_pri20: 8,
  6610. rssi1_ext20: 8,
  6611. rssi1_ext40: 8,
  6612. rssi1_ext80: 8;
  6613. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  6614. } u1;
  6615. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  6616. union {
  6617. A_UINT32 /* word 3 */
  6618. rssi2_pri20: 8,
  6619. rssi2_ext20: 8,
  6620. rssi2_ext40: 8,
  6621. rssi2_ext80: 8;
  6622. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  6623. } u2;
  6624. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  6625. union {
  6626. A_UINT32 /* word 4 */
  6627. rssi3_pri20: 8,
  6628. rssi3_ext20: 8,
  6629. rssi3_ext40: 8,
  6630. rssi3_ext80: 8;
  6631. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  6632. } u3;
  6633. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  6634. A_UINT32 tsf32; /* word 5 */
  6635. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  6636. A_UINT32 timestamp_microsec; /* word 6 */
  6637. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  6638. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  6639. A_UINT32 /* word 7 */
  6640. vht_sig_a1: 24,
  6641. preamble_type: 8;
  6642. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  6643. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  6644. A_UINT32 /* word 8 */
  6645. vht_sig_a2: 24,
  6646. /* sa_ant_matrix
  6647. * For cases where a single rx chain has options to be connected to
  6648. * different rx antennas, show which rx antennas were in use during
  6649. * receipt of a given PPDU.
  6650. * This sa_ant_matrix provides a bitmask of the antennas used while
  6651. * receiving this frame.
  6652. */
  6653. sa_ant_matrix: 8;
  6654. } POSTPACK;
  6655. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  6656. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  6657. PREPACK struct htt_rx_ind_hdr_suffix_t
  6658. {
  6659. A_UINT32 /* word 0 */
  6660. fw_rx_desc_bytes: 16,
  6661. reserved0: 16;
  6662. } POSTPACK;
  6663. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  6664. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  6665. PREPACK struct htt_rx_ind_hdr_t
  6666. {
  6667. struct htt_rx_ind_hdr_prefix_t prefix;
  6668. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  6669. struct htt_rx_ind_hdr_suffix_t suffix;
  6670. } POSTPACK;
  6671. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  6672. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  6673. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  6674. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  6675. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  6676. /*
  6677. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  6678. * the offset into the HTT rx indication message at which the
  6679. * FW rx PPDU descriptor resides
  6680. */
  6681. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  6682. /*
  6683. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  6684. * the offset into the HTT rx indication message at which the
  6685. * header suffix (FW rx MSDU byte count) resides
  6686. */
  6687. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  6688. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  6689. /*
  6690. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  6691. * the offset into the HTT rx indication message at which the per-MSDU
  6692. * information starts
  6693. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  6694. * per-MSDU information portion of the message. The per-MSDU info itself
  6695. * starts at byte 12.
  6696. */
  6697. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  6698. /**
  6699. * @brief target -> host rx indication message definition
  6700. *
  6701. * @details
  6702. * The following field definitions describe the format of the rx indication
  6703. * message sent from the target to the host.
  6704. * The message consists of three major sections:
  6705. * 1. a fixed-length header
  6706. * 2. a variable-length list of firmware rx MSDU descriptors
  6707. * 3. one or more 4-octet MPDU range information elements
  6708. * The fixed length header itself has two sub-sections
  6709. * 1. the message meta-information, including identification of the
  6710. * sender and type of the received data, and a 4-octet flush/release IE
  6711. * 2. the firmware rx PPDU descriptor
  6712. *
  6713. * The format of the message is depicted below.
  6714. * in this depiction, the following abbreviations are used for information
  6715. * elements within the message:
  6716. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  6717. * elements associated with the PPDU start are valid.
  6718. * Specifically, the following fields are valid only if SV is set:
  6719. * RSSI (all variants), L, legacy rate, preamble type, service,
  6720. * VHT-SIG-A
  6721. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  6722. * elements associated with the PPDU end are valid.
  6723. * Specifically, the following fields are valid only if EV is set:
  6724. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  6725. * - L - Legacy rate selector - if legacy rates are used, this flag
  6726. * indicates whether the rate is from a CCK (L == 1) or OFDM
  6727. * (L == 0) PHY.
  6728. * - P - PHY error flag - boolean indication of whether the rx frame had
  6729. * a PHY error
  6730. *
  6731. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  6732. * |----------------+-------------------+---------------------+---------------|
  6733. * | peer ID | |RV|FV| ext TID | msg type |
  6734. * |--------------------------------------------------------------------------|
  6735. * | num | release | release | flush | flush |
  6736. * | MPDU | end | start | end | start |
  6737. * | ranges | seq num | seq num | seq num | seq num |
  6738. * |==========================================================================|
  6739. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  6740. * |V|V| | rate | | | timestamp | RSSI |
  6741. * |--------------------------------------------------------------------------|
  6742. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  6743. * |--------------------------------------------------------------------------|
  6744. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  6745. * |--------------------------------------------------------------------------|
  6746. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  6747. * |--------------------------------------------------------------------------|
  6748. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  6749. * |--------------------------------------------------------------------------|
  6750. * | TSF LSBs |
  6751. * |--------------------------------------------------------------------------|
  6752. * | microsec timestamp |
  6753. * |--------------------------------------------------------------------------|
  6754. * | preamble type | HT-SIG / VHT-SIG-A1 |
  6755. * |--------------------------------------------------------------------------|
  6756. * | service | HT-SIG / VHT-SIG-A2 |
  6757. * |==========================================================================|
  6758. * | reserved | FW rx desc bytes |
  6759. * |--------------------------------------------------------------------------|
  6760. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  6761. * | desc B3 | desc B2 | desc B1 | desc B0 |
  6762. * |--------------------------------------------------------------------------|
  6763. * : : :
  6764. * |--------------------------------------------------------------------------|
  6765. * | alignment | MSDU Rx |
  6766. * | padding | desc Bn |
  6767. * |--------------------------------------------------------------------------|
  6768. * | reserved | MPDU range status | MPDU count |
  6769. * |--------------------------------------------------------------------------|
  6770. * : reserved : MPDU range status : MPDU count :
  6771. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  6772. *
  6773. * Header fields:
  6774. * - MSG_TYPE
  6775. * Bits 7:0
  6776. * Purpose: identifies this as an rx indication message
  6777. * Value: 0x1
  6778. * - EXT_TID
  6779. * Bits 12:8
  6780. * Purpose: identify the traffic ID of the rx data, including
  6781. * special "extended" TID values for multicast, broadcast, and
  6782. * non-QoS data frames
  6783. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  6784. * - FLUSH_VALID (FV)
  6785. * Bit 13
  6786. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  6787. * is valid
  6788. * Value:
  6789. * 1 -> flush IE is valid and needs to be processed
  6790. * 0 -> flush IE is not valid and should be ignored
  6791. * - REL_VALID (RV)
  6792. * Bit 13
  6793. * Purpose: indicate whether the release IE (start/end sequence numbers)
  6794. * is valid
  6795. * Value:
  6796. * 1 -> release IE is valid and needs to be processed
  6797. * 0 -> release IE is not valid and should be ignored
  6798. * - PEER_ID
  6799. * Bits 31:16
  6800. * Purpose: Identify, by ID, which peer sent the rx data
  6801. * Value: ID of the peer who sent the rx data
  6802. * - FLUSH_SEQ_NUM_START
  6803. * Bits 5:0
  6804. * Purpose: Indicate the start of a series of MPDUs to flush
  6805. * Not all MPDUs within this series are necessarily valid - the host
  6806. * must check each sequence number within this range to see if the
  6807. * corresponding MPDU is actually present.
  6808. * This field is only valid if the FV bit is set.
  6809. * Value:
  6810. * The sequence number for the first MPDUs to check to flush.
  6811. * The sequence number is masked by 0x3f.
  6812. * - FLUSH_SEQ_NUM_END
  6813. * Bits 11:6
  6814. * Purpose: Indicate the end of a series of MPDUs to flush
  6815. * Value:
  6816. * The sequence number one larger than the sequence number of the
  6817. * last MPDU to check to flush.
  6818. * The sequence number is masked by 0x3f.
  6819. * Not all MPDUs within this series are necessarily valid - the host
  6820. * must check each sequence number within this range to see if the
  6821. * corresponding MPDU is actually present.
  6822. * This field is only valid if the FV bit is set.
  6823. * - REL_SEQ_NUM_START
  6824. * Bits 17:12
  6825. * Purpose: Indicate the start of a series of MPDUs to release.
  6826. * All MPDUs within this series are present and valid - the host
  6827. * need not check each sequence number within this range to see if
  6828. * the corresponding MPDU is actually present.
  6829. * This field is only valid if the RV bit is set.
  6830. * Value:
  6831. * The sequence number for the first MPDUs to check to release.
  6832. * The sequence number is masked by 0x3f.
  6833. * - REL_SEQ_NUM_END
  6834. * Bits 23:18
  6835. * Purpose: Indicate the end of a series of MPDUs to release.
  6836. * Value:
  6837. * The sequence number one larger than the sequence number of the
  6838. * last MPDU to check to release.
  6839. * The sequence number is masked by 0x3f.
  6840. * All MPDUs within this series are present and valid - the host
  6841. * need not check each sequence number within this range to see if
  6842. * the corresponding MPDU is actually present.
  6843. * This field is only valid if the RV bit is set.
  6844. * - NUM_MPDU_RANGES
  6845. * Bits 31:24
  6846. * Purpose: Indicate how many ranges of MPDUs are present.
  6847. * Each MPDU range consists of a series of contiguous MPDUs within the
  6848. * rx frame sequence which all have the same MPDU status.
  6849. * Value: 1-63 (typically a small number, like 1-3)
  6850. *
  6851. * Rx PPDU descriptor fields:
  6852. * - RSSI_CMB
  6853. * Bits 7:0
  6854. * Purpose: Combined RSSI from all active rx chains, across the active
  6855. * bandwidth.
  6856. * Value: RSSI dB units w.r.t. noise floor
  6857. * - TIMESTAMP_SUBMICROSEC
  6858. * Bits 15:8
  6859. * Purpose: high-resolution timestamp
  6860. * Value:
  6861. * Sub-microsecond time of PPDU reception.
  6862. * This timestamp ranges from [0,MAC clock MHz).
  6863. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  6864. * to form a high-resolution, large range rx timestamp.
  6865. * - PHY_ERR_CODE
  6866. * Bits 23:16
  6867. * Purpose:
  6868. * If the rx frame processing resulted in a PHY error, indicate what
  6869. * type of rx PHY error occurred.
  6870. * Value:
  6871. * This field is valid if the "P" (PHY_ERR) flag is set.
  6872. * TBD: document/specify the values for this field
  6873. * - PHY_ERR
  6874. * Bit 24
  6875. * Purpose: indicate whether the rx PPDU had a PHY error
  6876. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  6877. * - LEGACY_RATE
  6878. * Bits 28:25
  6879. * Purpose:
  6880. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  6881. * specify which rate was used.
  6882. * Value:
  6883. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  6884. * flag.
  6885. * If LEGACY_RATE_SEL is 0:
  6886. * 0x8: OFDM 48 Mbps
  6887. * 0x9: OFDM 24 Mbps
  6888. * 0xA: OFDM 12 Mbps
  6889. * 0xB: OFDM 6 Mbps
  6890. * 0xC: OFDM 54 Mbps
  6891. * 0xD: OFDM 36 Mbps
  6892. * 0xE: OFDM 18 Mbps
  6893. * 0xF: OFDM 9 Mbps
  6894. * If LEGACY_RATE_SEL is 1:
  6895. * 0x8: CCK 11 Mbps long preamble
  6896. * 0x9: CCK 5.5 Mbps long preamble
  6897. * 0xA: CCK 2 Mbps long preamble
  6898. * 0xB: CCK 1 Mbps long preamble
  6899. * 0xC: CCK 11 Mbps short preamble
  6900. * 0xD: CCK 5.5 Mbps short preamble
  6901. * 0xE: CCK 2 Mbps short preamble
  6902. * - LEGACY_RATE_SEL
  6903. * Bit 29
  6904. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  6905. * Value:
  6906. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  6907. * used a legacy rate.
  6908. * 0 -> OFDM, 1 -> CCK
  6909. * - END_VALID
  6910. * Bit 30
  6911. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6912. * the start of the PPDU are valid. Specifically, the following
  6913. * fields are only valid if END_VALID is set:
  6914. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  6915. * TIMESTAMP_SUBMICROSEC
  6916. * Value:
  6917. * 0 -> rx PPDU desc end fields are not valid
  6918. * 1 -> rx PPDU desc end fields are valid
  6919. * - START_VALID
  6920. * Bit 31
  6921. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  6922. * the end of the PPDU are valid. Specifically, the following
  6923. * fields are only valid if START_VALID is set:
  6924. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  6925. * VHT-SIG-A
  6926. * Value:
  6927. * 0 -> rx PPDU desc start fields are not valid
  6928. * 1 -> rx PPDU desc start fields are valid
  6929. * - RSSI0_PRI20
  6930. * Bits 7:0
  6931. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  6932. * Value: RSSI dB units w.r.t. noise floor
  6933. *
  6934. * - RSSI0_EXT20
  6935. * Bits 7:0
  6936. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  6937. * (if the rx bandwidth was >= 40 MHz)
  6938. * Value: RSSI dB units w.r.t. noise floor
  6939. * - RSSI0_EXT40
  6940. * Bits 7:0
  6941. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  6942. * (if the rx bandwidth was >= 80 MHz)
  6943. * Value: RSSI dB units w.r.t. noise floor
  6944. * - RSSI0_EXT80
  6945. * Bits 7:0
  6946. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  6947. * (if the rx bandwidth was >= 160 MHz)
  6948. * Value: RSSI dB units w.r.t. noise floor
  6949. *
  6950. * - RSSI1_PRI20
  6951. * Bits 7:0
  6952. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  6953. * Value: RSSI dB units w.r.t. noise floor
  6954. * - RSSI1_EXT20
  6955. * Bits 7:0
  6956. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  6957. * (if the rx bandwidth was >= 40 MHz)
  6958. * Value: RSSI dB units w.r.t. noise floor
  6959. * - RSSI1_EXT40
  6960. * Bits 7:0
  6961. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  6962. * (if the rx bandwidth was >= 80 MHz)
  6963. * Value: RSSI dB units w.r.t. noise floor
  6964. * - RSSI1_EXT80
  6965. * Bits 7:0
  6966. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  6967. * (if the rx bandwidth was >= 160 MHz)
  6968. * Value: RSSI dB units w.r.t. noise floor
  6969. *
  6970. * - RSSI2_PRI20
  6971. * Bits 7:0
  6972. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  6973. * Value: RSSI dB units w.r.t. noise floor
  6974. * - RSSI2_EXT20
  6975. * Bits 7:0
  6976. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  6977. * (if the rx bandwidth was >= 40 MHz)
  6978. * Value: RSSI dB units w.r.t. noise floor
  6979. * - RSSI2_EXT40
  6980. * Bits 7:0
  6981. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  6982. * (if the rx bandwidth was >= 80 MHz)
  6983. * Value: RSSI dB units w.r.t. noise floor
  6984. * - RSSI2_EXT80
  6985. * Bits 7:0
  6986. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  6987. * (if the rx bandwidth was >= 160 MHz)
  6988. * Value: RSSI dB units w.r.t. noise floor
  6989. *
  6990. * - RSSI3_PRI20
  6991. * Bits 7:0
  6992. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  6993. * Value: RSSI dB units w.r.t. noise floor
  6994. * - RSSI3_EXT20
  6995. * Bits 7:0
  6996. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  6997. * (if the rx bandwidth was >= 40 MHz)
  6998. * Value: RSSI dB units w.r.t. noise floor
  6999. * - RSSI3_EXT40
  7000. * Bits 7:0
  7001. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  7002. * (if the rx bandwidth was >= 80 MHz)
  7003. * Value: RSSI dB units w.r.t. noise floor
  7004. * - RSSI3_EXT80
  7005. * Bits 7:0
  7006. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  7007. * (if the rx bandwidth was >= 160 MHz)
  7008. * Value: RSSI dB units w.r.t. noise floor
  7009. *
  7010. * - TSF32
  7011. * Bits 31:0
  7012. * Purpose: specify the time the rx PPDU was received, in TSF units
  7013. * Value: 32 LSBs of the TSF
  7014. * - TIMESTAMP_MICROSEC
  7015. * Bits 31:0
  7016. * Purpose: specify the time the rx PPDU was received, in microsecond units
  7017. * Value: PPDU rx time, in microseconds
  7018. * - VHT_SIG_A1
  7019. * Bits 23:0
  7020. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  7021. * from the rx PPDU
  7022. * Value:
  7023. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7024. * VHT-SIG-A1 data.
  7025. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7026. * first 24 bits of the HT-SIG data.
  7027. * Otherwise, this field is invalid.
  7028. * Refer to the the 802.11 protocol for the definition of the
  7029. * HT-SIG and VHT-SIG-A1 fields
  7030. * - VHT_SIG_A2
  7031. * Bits 23:0
  7032. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  7033. * from the rx PPDU
  7034. * Value:
  7035. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  7036. * VHT-SIG-A2 data.
  7037. * If PREAMBLE_TYPE specifies HT, then this field contains the
  7038. * last 24 bits of the HT-SIG data.
  7039. * Otherwise, this field is invalid.
  7040. * Refer to the the 802.11 protocol for the definition of the
  7041. * HT-SIG and VHT-SIG-A2 fields
  7042. * - PREAMBLE_TYPE
  7043. * Bits 31:24
  7044. * Purpose: indicate the PHY format of the received burst
  7045. * Value:
  7046. * 0x4: Legacy (OFDM/CCK)
  7047. * 0x8: HT
  7048. * 0x9: HT with TxBF
  7049. * 0xC: VHT
  7050. * 0xD: VHT with TxBF
  7051. * - SERVICE
  7052. * Bits 31:24
  7053. * Purpose: TBD
  7054. * Value: TBD
  7055. *
  7056. * Rx MSDU descriptor fields:
  7057. * - FW_RX_DESC_BYTES
  7058. * Bits 15:0
  7059. * Purpose: Indicate how many bytes in the Rx indication are used for
  7060. * FW Rx descriptors
  7061. *
  7062. * Payload fields:
  7063. * - MPDU_COUNT
  7064. * Bits 7:0
  7065. * Purpose: Indicate how many sequential MPDUs share the same status.
  7066. * All MPDUs within the indicated list are from the same RA-TA-TID.
  7067. * - MPDU_STATUS
  7068. * Bits 15:8
  7069. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  7070. * received successfully.
  7071. * Value:
  7072. * 0x1: success
  7073. * 0x2: FCS error
  7074. * 0x3: duplicate error
  7075. * 0x4: replay error
  7076. * 0x5: invalid peer
  7077. */
  7078. /* header fields */
  7079. #define HTT_RX_IND_EXT_TID_M 0x1f00
  7080. #define HTT_RX_IND_EXT_TID_S 8
  7081. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  7082. #define HTT_RX_IND_FLUSH_VALID_S 13
  7083. #define HTT_RX_IND_REL_VALID_M 0x4000
  7084. #define HTT_RX_IND_REL_VALID_S 14
  7085. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  7086. #define HTT_RX_IND_PEER_ID_S 16
  7087. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  7088. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  7089. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  7090. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  7091. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  7092. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  7093. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  7094. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  7095. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  7096. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  7097. /* rx PPDU descriptor fields */
  7098. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  7099. #define HTT_RX_IND_RSSI_CMB_S 0
  7100. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  7101. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  7102. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  7103. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  7104. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  7105. #define HTT_RX_IND_PHY_ERR_S 24
  7106. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  7107. #define HTT_RX_IND_LEGACY_RATE_S 25
  7108. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  7109. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  7110. #define HTT_RX_IND_END_VALID_M 0x40000000
  7111. #define HTT_RX_IND_END_VALID_S 30
  7112. #define HTT_RX_IND_START_VALID_M 0x80000000
  7113. #define HTT_RX_IND_START_VALID_S 31
  7114. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  7115. #define HTT_RX_IND_RSSI_PRI20_S 0
  7116. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  7117. #define HTT_RX_IND_RSSI_EXT20_S 8
  7118. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  7119. #define HTT_RX_IND_RSSI_EXT40_S 16
  7120. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  7121. #define HTT_RX_IND_RSSI_EXT80_S 24
  7122. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  7123. #define HTT_RX_IND_VHT_SIG_A1_S 0
  7124. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  7125. #define HTT_RX_IND_VHT_SIG_A2_S 0
  7126. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  7127. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  7128. #define HTT_RX_IND_SERVICE_M 0xff000000
  7129. #define HTT_RX_IND_SERVICE_S 24
  7130. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  7131. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  7132. /* rx MSDU descriptor fields */
  7133. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  7134. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  7135. /* payload fields */
  7136. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  7137. #define HTT_RX_IND_MPDU_COUNT_S 0
  7138. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  7139. #define HTT_RX_IND_MPDU_STATUS_S 8
  7140. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  7141. do { \
  7142. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  7143. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  7144. } while (0)
  7145. #define HTT_RX_IND_EXT_TID_GET(word) \
  7146. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  7147. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  7148. do { \
  7149. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  7150. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  7151. } while (0)
  7152. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  7153. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  7154. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  7155. do { \
  7156. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  7157. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  7158. } while (0)
  7159. #define HTT_RX_IND_REL_VALID_GET(word) \
  7160. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  7161. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  7162. do { \
  7163. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  7164. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  7165. } while (0)
  7166. #define HTT_RX_IND_PEER_ID_GET(word) \
  7167. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  7168. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  7169. do { \
  7170. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  7171. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  7172. } while (0)
  7173. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  7174. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  7175. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  7176. do { \
  7177. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  7178. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  7179. } while (0)
  7180. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  7181. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  7182. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  7183. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  7184. do { \
  7185. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  7186. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  7187. } while (0)
  7188. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  7189. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  7190. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  7191. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  7192. do { \
  7193. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  7194. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  7195. } while (0)
  7196. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  7197. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  7198. HTT_RX_IND_REL_SEQ_NUM_START_S)
  7199. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  7200. do { \
  7201. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  7202. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  7203. } while (0)
  7204. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  7205. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  7206. HTT_RX_IND_REL_SEQ_NUM_END_S)
  7207. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  7208. do { \
  7209. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  7210. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  7211. } while (0)
  7212. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  7213. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  7214. HTT_RX_IND_NUM_MPDU_RANGES_S)
  7215. /* FW rx PPDU descriptor fields */
  7216. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  7217. do { \
  7218. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  7219. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  7220. } while (0)
  7221. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  7222. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  7223. HTT_RX_IND_RSSI_CMB_S)
  7224. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  7225. do { \
  7226. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  7227. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  7228. } while (0)
  7229. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  7230. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  7231. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  7232. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  7233. do { \
  7234. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  7235. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  7236. } while (0)
  7237. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  7238. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  7239. HTT_RX_IND_PHY_ERR_CODE_S)
  7240. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  7241. do { \
  7242. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  7243. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  7244. } while (0)
  7245. #define HTT_RX_IND_PHY_ERR_GET(word) \
  7246. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  7247. HTT_RX_IND_PHY_ERR_S)
  7248. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  7249. do { \
  7250. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  7251. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  7252. } while (0)
  7253. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  7254. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  7255. HTT_RX_IND_LEGACY_RATE_S)
  7256. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  7257. do { \
  7258. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  7259. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  7260. } while (0)
  7261. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  7262. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  7263. HTT_RX_IND_LEGACY_RATE_SEL_S)
  7264. #define HTT_RX_IND_END_VALID_SET(word, value) \
  7265. do { \
  7266. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  7267. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  7268. } while (0)
  7269. #define HTT_RX_IND_END_VALID_GET(word) \
  7270. (((word) & HTT_RX_IND_END_VALID_M) >> \
  7271. HTT_RX_IND_END_VALID_S)
  7272. #define HTT_RX_IND_START_VALID_SET(word, value) \
  7273. do { \
  7274. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  7275. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  7276. } while (0)
  7277. #define HTT_RX_IND_START_VALID_GET(word) \
  7278. (((word) & HTT_RX_IND_START_VALID_M) >> \
  7279. HTT_RX_IND_START_VALID_S)
  7280. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  7281. do { \
  7282. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  7283. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  7284. } while (0)
  7285. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  7286. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  7287. HTT_RX_IND_RSSI_PRI20_S)
  7288. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  7289. do { \
  7290. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  7291. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  7292. } while (0)
  7293. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  7294. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  7295. HTT_RX_IND_RSSI_EXT20_S)
  7296. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  7297. do { \
  7298. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  7299. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  7300. } while (0)
  7301. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  7302. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  7303. HTT_RX_IND_RSSI_EXT40_S)
  7304. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  7305. do { \
  7306. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  7307. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  7308. } while (0)
  7309. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  7310. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  7311. HTT_RX_IND_RSSI_EXT80_S)
  7312. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  7313. do { \
  7314. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  7315. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  7316. } while (0)
  7317. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  7318. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  7319. HTT_RX_IND_VHT_SIG_A1_S)
  7320. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  7321. do { \
  7322. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  7323. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  7324. } while (0)
  7325. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  7326. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  7327. HTT_RX_IND_VHT_SIG_A2_S)
  7328. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  7329. do { \
  7330. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  7331. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  7332. } while (0)
  7333. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  7334. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  7335. HTT_RX_IND_PREAMBLE_TYPE_S)
  7336. #define HTT_RX_IND_SERVICE_SET(word, value) \
  7337. do { \
  7338. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  7339. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  7340. } while (0)
  7341. #define HTT_RX_IND_SERVICE_GET(word) \
  7342. (((word) & HTT_RX_IND_SERVICE_M) >> \
  7343. HTT_RX_IND_SERVICE_S)
  7344. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  7345. do { \
  7346. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  7347. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  7348. } while (0)
  7349. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  7350. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  7351. HTT_RX_IND_SA_ANT_MATRIX_S)
  7352. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  7353. do { \
  7354. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  7355. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  7356. } while (0)
  7357. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  7358. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  7359. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  7360. do { \
  7361. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  7362. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  7363. } while (0)
  7364. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  7365. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  7366. #define HTT_RX_IND_HL_BYTES \
  7367. (HTT_RX_IND_HDR_BYTES + \
  7368. 4 /* single FW rx MSDU descriptor */ + \
  7369. 4 /* single MPDU range information element */)
  7370. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  7371. /* Could we use one macro entry? */
  7372. #define HTT_WORD_SET(word, field, value) \
  7373. do { \
  7374. HTT_CHECK_SET_VAL(field, value); \
  7375. (word) |= ((value) << field ## _S); \
  7376. } while (0)
  7377. #define HTT_WORD_GET(word, field) \
  7378. (((word) & field ## _M) >> field ## _S)
  7379. PREPACK struct hl_htt_rx_ind_base {
  7380. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  7381. } POSTPACK;
  7382. /*
  7383. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  7384. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  7385. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  7386. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  7387. * htt_rx_ind_hl_rx_desc_t.
  7388. */
  7389. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  7390. struct htt_rx_ind_hl_rx_desc_t {
  7391. A_UINT8 ver;
  7392. A_UINT8 len;
  7393. struct {
  7394. A_UINT8
  7395. first_msdu: 1,
  7396. last_msdu: 1,
  7397. c3_failed: 1,
  7398. c4_failed: 1,
  7399. ipv6: 1,
  7400. tcp: 1,
  7401. udp: 1,
  7402. reserved: 1;
  7403. } flags;
  7404. /* NOTE: no reserved space - don't append any new fields here */
  7405. };
  7406. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  7407. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7408. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  7409. #define HTT_RX_IND_HL_RX_DESC_VER 0
  7410. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  7411. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7412. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  7413. #define HTT_RX_IND_HL_FLAG_OFFSET \
  7414. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  7415. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  7416. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  7417. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  7418. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  7419. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  7420. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  7421. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  7422. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  7423. /* This structure is used in HL, the basic descriptor information
  7424. * used by host. the structure is translated by FW from HW desc
  7425. * or generated by FW. But in HL monitor mode, the host would use
  7426. * the same structure with LL.
  7427. */
  7428. PREPACK struct hl_htt_rx_desc_base {
  7429. A_UINT32
  7430. seq_num:12,
  7431. encrypted:1,
  7432. chan_info_present:1,
  7433. resv0:2,
  7434. mcast_bcast:1,
  7435. fragment:1,
  7436. key_id_oct:8,
  7437. resv1:6;
  7438. A_UINT32
  7439. pn_31_0;
  7440. union {
  7441. struct {
  7442. A_UINT16 pn_47_32;
  7443. A_UINT16 pn_63_48;
  7444. } pn16;
  7445. A_UINT32 pn_63_32;
  7446. } u0;
  7447. A_UINT32
  7448. pn_95_64;
  7449. A_UINT32
  7450. pn_127_96;
  7451. } POSTPACK;
  7452. /*
  7453. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  7454. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  7455. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  7456. * Please see htt_chan_change_t for description of the fields.
  7457. */
  7458. PREPACK struct htt_chan_info_t
  7459. {
  7460. A_UINT32 primary_chan_center_freq_mhz: 16,
  7461. contig_chan1_center_freq_mhz: 16;
  7462. A_UINT32 contig_chan2_center_freq_mhz: 16,
  7463. phy_mode: 8,
  7464. reserved: 8;
  7465. } POSTPACK;
  7466. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  7467. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  7468. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  7469. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  7470. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  7471. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  7472. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  7473. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  7474. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  7475. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  7476. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  7477. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  7478. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  7479. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  7480. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  7481. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  7482. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  7483. /* Channel information */
  7484. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  7485. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  7486. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  7487. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  7488. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  7489. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  7490. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  7491. #define HTT_CHAN_INFO_PHY_MODE_S 16
  7492. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  7493. do { \
  7494. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  7495. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  7496. } while (0)
  7497. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  7498. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  7499. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  7500. do { \
  7501. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  7502. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  7503. } while (0)
  7504. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  7505. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  7506. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  7507. do { \
  7508. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  7509. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  7510. } while (0)
  7511. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  7512. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  7513. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  7514. do { \
  7515. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  7516. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  7517. } while (0)
  7518. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  7519. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  7520. /*
  7521. * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  7522. * @brief target -> host message definition for FW offloaded pkts
  7523. *
  7524. * @details
  7525. * The following field definitions describe the format of the firmware
  7526. * offload deliver message sent from the target to the host.
  7527. *
  7528. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  7529. *
  7530. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  7531. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  7532. * | reserved_1 | msg type |
  7533. * |--------------------------------------------------------------------------|
  7534. * | phy_timestamp_l32 |
  7535. * |--------------------------------------------------------------------------|
  7536. * | WORD2 (see below) |
  7537. * |--------------------------------------------------------------------------|
  7538. * | seqno | framectrl |
  7539. * |--------------------------------------------------------------------------|
  7540. * | reserved_3 | vdev_id | tid_num|
  7541. * |--------------------------------------------------------------------------|
  7542. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  7543. * |--------------------------------------------------------------------------|
  7544. *
  7545. * where:
  7546. * STAT = status
  7547. * F = format (802.3 vs. 802.11)
  7548. *
  7549. * definition for word 2
  7550. *
  7551. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  7552. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  7553. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  7554. * |--------------------------------------------------------------------------|
  7555. *
  7556. * where:
  7557. * PR = preamble
  7558. * BF = beamformed
  7559. */
  7560. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  7561. {
  7562. A_UINT32 /* word 0 */
  7563. msg_type:8, /* [ 7: 0] */
  7564. reserved_1:24; /* [31: 8] */
  7565. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  7566. A_UINT32 /* word 2 */
  7567. /* preamble:
  7568. * 0-OFDM,
  7569. * 1-CCk,
  7570. * 2-HT,
  7571. * 3-VHT
  7572. */
  7573. preamble: 2, /* [1:0] */
  7574. /* mcs:
  7575. * In case of HT preamble interpret
  7576. * MCS along with NSS.
  7577. * Valid values for HT are 0 to 7.
  7578. * HT mcs 0 with NSS 2 is mcs 8.
  7579. * Valid values for VHT are 0 to 9.
  7580. */
  7581. mcs: 4, /* [5:2] */
  7582. /* rate:
  7583. * This is applicable only for
  7584. * CCK and OFDM preamble type
  7585. * rate 0: OFDM 48 Mbps,
  7586. * 1: OFDM 24 Mbps,
  7587. * 2: OFDM 12 Mbps
  7588. * 3: OFDM 6 Mbps
  7589. * 4: OFDM 54 Mbps
  7590. * 5: OFDM 36 Mbps
  7591. * 6: OFDM 18 Mbps
  7592. * 7: OFDM 9 Mbps
  7593. * rate 0: CCK 11 Mbps Long
  7594. * 1: CCK 5.5 Mbps Long
  7595. * 2: CCK 2 Mbps Long
  7596. * 3: CCK 1 Mbps Long
  7597. * 4: CCK 11 Mbps Short
  7598. * 5: CCK 5.5 Mbps Short
  7599. * 6: CCK 2 Mbps Short
  7600. */
  7601. rate : 3, /* [ 8: 6] */
  7602. rssi : 8, /* [16: 9] units=dBm */
  7603. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  7604. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  7605. stbc : 1, /* [22] */
  7606. sgi : 1, /* [23] */
  7607. ldpc : 1, /* [24] */
  7608. beamformed: 1, /* [25] */
  7609. reserved_2: 6; /* [31:26] */
  7610. A_UINT32 /* word 3 */
  7611. framectrl:16, /* [15: 0] */
  7612. seqno:16; /* [31:16] */
  7613. A_UINT32 /* word 4 */
  7614. tid_num:5, /* [ 4: 0] actual TID number */
  7615. vdev_id:8, /* [12: 5] */
  7616. reserved_3:19; /* [31:13] */
  7617. A_UINT32 /* word 5 */
  7618. /* status:
  7619. * 0: tx_ok
  7620. * 1: retry
  7621. * 2: drop
  7622. * 3: filtered
  7623. * 4: abort
  7624. * 5: tid delete
  7625. * 6: sw abort
  7626. * 7: dropped by peer migration
  7627. */
  7628. status:3, /* [2:0] */
  7629. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  7630. tx_mpdu_bytes:16, /* [19:4] */
  7631. /* Indicates retry count of offloaded/local generated Data tx frames */
  7632. tx_retry_cnt:6, /* [25:20] */
  7633. reserved_4:6; /* [31:26] */
  7634. } POSTPACK;
  7635. /* FW offload deliver ind message header fields */
  7636. /* DWORD one */
  7637. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  7638. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  7639. /* DWORD two */
  7640. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  7641. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  7642. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  7643. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  7644. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  7645. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  7646. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  7647. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  7648. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  7649. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  7650. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  7651. #define HTT_FW_OFFLOAD_IND_BW_S 19
  7652. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  7653. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  7654. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  7655. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  7656. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  7657. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  7658. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  7659. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  7660. /* DWORD three*/
  7661. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  7662. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  7663. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  7664. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  7665. /* DWORD four */
  7666. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  7667. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  7668. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  7669. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  7670. /* DWORD five */
  7671. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  7672. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  7673. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  7674. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  7675. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  7676. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  7677. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  7678. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  7679. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  7680. do { \
  7681. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  7682. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  7683. } while (0)
  7684. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  7685. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  7686. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  7687. do { \
  7688. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  7689. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  7690. } while (0)
  7691. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  7692. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  7693. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  7694. do { \
  7695. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  7696. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  7697. } while (0)
  7698. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  7699. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  7700. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  7701. do { \
  7702. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  7703. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  7704. } while (0)
  7705. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  7706. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  7707. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  7708. do { \
  7709. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  7710. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  7711. } while (0)
  7712. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  7713. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  7714. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  7715. do { \
  7716. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  7717. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  7718. } while (0)
  7719. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  7720. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  7721. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  7722. do { \
  7723. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  7724. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  7725. } while (0)
  7726. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  7727. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  7728. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  7729. do { \
  7730. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  7731. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  7732. } while (0)
  7733. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  7734. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  7735. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  7736. do { \
  7737. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  7738. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  7739. } while (0)
  7740. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  7741. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  7742. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  7743. do { \
  7744. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  7745. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  7746. } while (0)
  7747. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  7748. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  7749. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  7750. do { \
  7751. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  7752. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  7753. } while (0)
  7754. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  7755. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  7756. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  7757. do { \
  7758. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  7759. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  7760. } while (0)
  7761. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  7762. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  7763. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  7764. do { \
  7765. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  7766. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  7767. } while (0)
  7768. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  7769. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  7770. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  7771. do { \
  7772. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  7773. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  7774. } while (0)
  7775. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  7776. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  7777. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  7778. do { \
  7779. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  7780. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  7781. } while (0)
  7782. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  7783. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  7784. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  7785. do { \
  7786. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  7787. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  7788. } while (0)
  7789. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  7790. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  7791. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  7792. do { \
  7793. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  7794. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  7795. } while (0)
  7796. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  7797. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  7798. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  7799. do { \
  7800. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  7801. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  7802. } while (0)
  7803. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  7804. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  7805. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  7806. do { \
  7807. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  7808. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  7809. } while (0)
  7810. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  7811. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  7812. /*
  7813. * @brief target -> host rx reorder flush message definition
  7814. *
  7815. * @details
  7816. * The following field definitions describe the format of the rx flush
  7817. * message sent from the target to the host.
  7818. * The message consists of a 4-octet header, followed by one or more
  7819. * 4-octet payload information elements.
  7820. *
  7821. * |31 24|23 8|7 0|
  7822. * |--------------------------------------------------------------|
  7823. * | TID | peer ID | msg type |
  7824. * |--------------------------------------------------------------|
  7825. * | seq num end | seq num start | MPDU status | reserved |
  7826. * |--------------------------------------------------------------|
  7827. * First DWORD:
  7828. * - MSG_TYPE
  7829. * Bits 7:0
  7830. * Purpose: identifies this as an rx flush message
  7831. * Value: 0x2
  7832. * - PEER_ID
  7833. * Bits 23:8 (only bits 18:8 actually used)
  7834. * Purpose: identify which peer's rx data is being flushed
  7835. * Value: (rx) peer ID
  7836. * - TID
  7837. * Bits 31:24 (only bits 27:24 actually used)
  7838. * Purpose: Specifies which traffic identifier's rx data is being flushed
  7839. * Value: traffic identifier
  7840. * Second DWORD:
  7841. * - MPDU_STATUS
  7842. * Bits 15:8
  7843. * Purpose:
  7844. * Indicate whether the flushed MPDUs should be discarded or processed.
  7845. * Value:
  7846. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  7847. * stages of rx processing
  7848. * other: discard the MPDUs
  7849. * It is anticipated that flush messages will always have
  7850. * MPDU status == 1, but the status flag is included for
  7851. * flexibility.
  7852. * - SEQ_NUM_START
  7853. * Bits 23:16
  7854. * Purpose:
  7855. * Indicate the start of a series of consecutive MPDUs being flushed.
  7856. * Not all MPDUs within this range are necessarily valid - the host
  7857. * must check each sequence number within this range to see if the
  7858. * corresponding MPDU is actually present.
  7859. * Value:
  7860. * The sequence number for the first MPDU in the sequence.
  7861. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7862. * - SEQ_NUM_END
  7863. * Bits 30:24
  7864. * Purpose:
  7865. * Indicate the end of a series of consecutive MPDUs being flushed.
  7866. * Value:
  7867. * The sequence number one larger than the sequence number of the
  7868. * last MPDU being flushed.
  7869. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7870. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  7871. * are to be released for further rx processing.
  7872. * Not all MPDUs within this range are necessarily valid - the host
  7873. * must check each sequence number within this range to see if the
  7874. * corresponding MPDU is actually present.
  7875. */
  7876. /* first DWORD */
  7877. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  7878. #define HTT_RX_FLUSH_PEER_ID_S 8
  7879. #define HTT_RX_FLUSH_TID_M 0xff000000
  7880. #define HTT_RX_FLUSH_TID_S 24
  7881. /* second DWORD */
  7882. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  7883. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  7884. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  7885. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  7886. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  7887. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  7888. #define HTT_RX_FLUSH_BYTES 8
  7889. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  7890. do { \
  7891. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  7892. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  7893. } while (0)
  7894. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  7895. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  7896. #define HTT_RX_FLUSH_TID_SET(word, value) \
  7897. do { \
  7898. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  7899. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  7900. } while (0)
  7901. #define HTT_RX_FLUSH_TID_GET(word) \
  7902. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  7903. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  7904. do { \
  7905. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  7906. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  7907. } while (0)
  7908. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  7909. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  7910. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  7911. do { \
  7912. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  7913. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  7914. } while (0)
  7915. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  7916. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  7917. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  7918. do { \
  7919. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  7920. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  7921. } while (0)
  7922. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  7923. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  7924. /*
  7925. * @brief target -> host rx pn check indication message
  7926. *
  7927. * @details
  7928. * The following field definitions describe the format of the Rx PN check
  7929. * indication message sent from the target to the host.
  7930. * The message consists of a 4-octet header, followed by the start and
  7931. * end sequence numbers to be released, followed by the PN IEs. Each PN
  7932. * IE is one octet containing the sequence number that failed the PN
  7933. * check.
  7934. *
  7935. * |31 24|23 8|7 0|
  7936. * |--------------------------------------------------------------|
  7937. * | TID | peer ID | msg type |
  7938. * |--------------------------------------------------------------|
  7939. * | Reserved | PN IE count | seq num end | seq num start|
  7940. * |--------------------------------------------------------------|
  7941. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  7942. * |--------------------------------------------------------------|
  7943. * First DWORD:
  7944. * - MSG_TYPE
  7945. * Bits 7:0
  7946. * Purpose: Identifies this as an rx pn check indication message
  7947. * Value: 0x2
  7948. * - PEER_ID
  7949. * Bits 23:8 (only bits 18:8 actually used)
  7950. * Purpose: identify which peer
  7951. * Value: (rx) peer ID
  7952. * - TID
  7953. * Bits 31:24 (only bits 27:24 actually used)
  7954. * Purpose: identify traffic identifier
  7955. * Value: traffic identifier
  7956. * Second DWORD:
  7957. * - SEQ_NUM_START
  7958. * Bits 7:0
  7959. * Purpose:
  7960. * Indicates the starting sequence number of the MPDU in this
  7961. * series of MPDUs that went though PN check.
  7962. * Value:
  7963. * The sequence number for the first MPDU in the sequence.
  7964. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7965. * - SEQ_NUM_END
  7966. * Bits 15:8
  7967. * Purpose:
  7968. * Indicates the ending sequence number of the MPDU in this
  7969. * series of MPDUs that went though PN check.
  7970. * Value:
  7971. * The sequence number one larger then the sequence number of the last
  7972. * MPDU being flushed.
  7973. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  7974. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  7975. * for invalid PN numbers and are ready to be released for further processing.
  7976. * Not all MPDUs within this range are necessarily valid - the host
  7977. * must check each sequence number within this range to see if the
  7978. * corresponding MPDU is actually present.
  7979. * - PN_IE_COUNT
  7980. * Bits 23:16
  7981. * Purpose:
  7982. * Used to determine the variable number of PN information elements in this
  7983. * message
  7984. *
  7985. * PN information elements:
  7986. * - PN_IE_x-
  7987. * Purpose:
  7988. * Each PN information element contains the sequence number of the MPDU that
  7989. * has failed the target PN check.
  7990. * Value:
  7991. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  7992. * that failed the PN check.
  7993. */
  7994. /* first DWORD */
  7995. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  7996. #define HTT_RX_PN_IND_PEER_ID_S 8
  7997. #define HTT_RX_PN_IND_TID_M 0xff000000
  7998. #define HTT_RX_PN_IND_TID_S 24
  7999. /* second DWORD */
  8000. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  8001. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  8002. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  8003. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  8004. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  8005. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  8006. #define HTT_RX_PN_IND_BYTES 8
  8007. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  8008. do { \
  8009. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  8010. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  8011. } while (0)
  8012. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  8013. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  8014. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  8015. do { \
  8016. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  8017. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  8018. } while (0)
  8019. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  8020. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  8021. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  8022. do { \
  8023. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  8024. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  8025. } while (0)
  8026. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  8027. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  8028. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  8029. do { \
  8030. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  8031. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  8032. } while (0)
  8033. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  8034. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  8035. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  8036. do { \
  8037. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  8038. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  8039. } while (0)
  8040. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  8041. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  8042. /*
  8043. * @brief target -> host rx offload deliver message for LL system
  8044. *
  8045. * @details
  8046. * In a low latency system this message is sent whenever the offload
  8047. * manager flushes out the packets it has coalesced in its coalescing buffer.
  8048. * The DMA of the actual packets into host memory is done before sending out
  8049. * this message. This message indicates only how many MSDUs to reap. The
  8050. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  8051. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  8052. * DMA'd by the MAC directly into host memory these packets do not contain
  8053. * the MAC descriptors in the header portion of the packet. Instead they contain
  8054. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  8055. * message, the packets are delivered directly to the NW stack without going
  8056. * through the regular reorder buffering and PN checking path since it has
  8057. * already been done in target.
  8058. *
  8059. * |31 24|23 16|15 8|7 0|
  8060. * |-----------------------------------------------------------------------|
  8061. * | Total MSDU count | reserved | msg type |
  8062. * |-----------------------------------------------------------------------|
  8063. *
  8064. * @brief target -> host rx offload deliver message for HL system
  8065. *
  8066. * @details
  8067. * In a high latency system this message is sent whenever the offload manager
  8068. * flushes out the packets it has coalesced in its coalescing buffer. The
  8069. * actual packets are also carried along with this message. When the host
  8070. * receives this message, it is expected to deliver these packets to the NW
  8071. * stack directly instead of routing them through the reorder buffering and
  8072. * PN checking path since it has already been done in target.
  8073. *
  8074. * |31 24|23 16|15 8|7 0|
  8075. * |-----------------------------------------------------------------------|
  8076. * | Total MSDU count | reserved | msg type |
  8077. * |-----------------------------------------------------------------------|
  8078. * | peer ID | MSDU length |
  8079. * |-----------------------------------------------------------------------|
  8080. * | MSDU payload | FW Desc | tid | vdev ID |
  8081. * |-----------------------------------------------------------------------|
  8082. * | MSDU payload contd. |
  8083. * |-----------------------------------------------------------------------|
  8084. * | peer ID | MSDU length |
  8085. * |-----------------------------------------------------------------------|
  8086. * | MSDU payload | FW Desc | tid | vdev ID |
  8087. * |-----------------------------------------------------------------------|
  8088. * | MSDU payload contd. |
  8089. * |-----------------------------------------------------------------------|
  8090. *
  8091. */
  8092. /* first DWORD */
  8093. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  8094. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  8095. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  8096. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  8097. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  8098. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  8099. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  8100. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  8101. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  8102. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  8103. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  8104. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  8105. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  8106. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  8107. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  8108. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  8109. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  8110. do { \
  8111. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  8112. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  8113. } while (0)
  8114. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  8115. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  8116. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  8117. do { \
  8118. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  8119. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  8120. } while (0)
  8121. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  8122. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  8123. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  8124. do { \
  8125. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  8126. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  8127. } while (0)
  8128. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  8129. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  8130. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  8131. do { \
  8132. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  8133. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  8134. } while (0)
  8135. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  8136. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  8137. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  8138. do { \
  8139. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  8140. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  8141. } while (0)
  8142. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  8143. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  8144. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  8145. do { \
  8146. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  8147. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  8148. } while (0)
  8149. /**
  8150. * @brief target -> host rx peer map/unmap message definition
  8151. *
  8152. * @details
  8153. * The following diagram shows the format of the rx peer map message sent
  8154. * from the target to the host. This layout assumes the target operates
  8155. * as little-endian.
  8156. *
  8157. * This message always contains a SW peer ID. The main purpose of the
  8158. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8159. * with, so that the host can use that peer ID to determine which peer
  8160. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8161. * other purposes, such as identifying during tx completions which peer
  8162. * the tx frames in question were transmitted to.
  8163. *
  8164. * In certain generations of chips, the peer map message also contains
  8165. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  8166. * to identify which peer the frame needs to be forwarded to (i.e. the
  8167. * peer assocated with the Destination MAC Address within the packet),
  8168. * and particularly which vdev needs to transmit the frame (for cases
  8169. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  8170. * meaning as AST_INDEX_0.
  8171. * This DA-based peer ID that is provided for certain rx frames
  8172. * (the rx frames that need to be re-transmitted as tx frames)
  8173. * is the ID that the HW uses for referring to the peer in question,
  8174. * rather than the peer ID that the SW+FW use to refer to the peer.
  8175. *
  8176. *
  8177. * |31 24|23 16|15 8|7 0|
  8178. * |-----------------------------------------------------------------------|
  8179. * | SW peer ID | VDEV ID | msg type |
  8180. * |-----------------------------------------------------------------------|
  8181. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8182. * |-----------------------------------------------------------------------|
  8183. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8184. * |-----------------------------------------------------------------------|
  8185. *
  8186. *
  8187. * The following diagram shows the format of the rx peer unmap message sent
  8188. * from the target to the host.
  8189. *
  8190. * |31 24|23 16|15 8|7 0|
  8191. * |-----------------------------------------------------------------------|
  8192. * | SW peer ID | VDEV ID | msg type |
  8193. * |-----------------------------------------------------------------------|
  8194. *
  8195. * The following field definitions describe the format of the rx peer map
  8196. * and peer unmap messages sent from the target to the host.
  8197. * - MSG_TYPE
  8198. * Bits 7:0
  8199. * Purpose: identifies this as an rx peer map or peer unmap message
  8200. * Value: peer map -> 0x3, peer unmap -> 0x4
  8201. * - VDEV_ID
  8202. * Bits 15:8
  8203. * Purpose: Indicates which virtual device the peer is associated
  8204. * with.
  8205. * Value: vdev ID (used in the host to look up the vdev object)
  8206. * - PEER_ID (a.k.a. SW_PEER_ID)
  8207. * Bits 31:16
  8208. * Purpose: The peer ID (index) that WAL is allocating (map) or
  8209. * freeing (unmap)
  8210. * Value: (rx) peer ID
  8211. * - MAC_ADDR_L32 (peer map only)
  8212. * Bits 31:0
  8213. * Purpose: Identifies which peer node the peer ID is for.
  8214. * Value: lower 4 bytes of peer node's MAC address
  8215. * - MAC_ADDR_U16 (peer map only)
  8216. * Bits 15:0
  8217. * Purpose: Identifies which peer node the peer ID is for.
  8218. * Value: upper 2 bytes of peer node's MAC address
  8219. * - HW_PEER_ID
  8220. * Bits 31:16
  8221. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8222. * address, so for rx frames marked for rx --> tx forwarding, the
  8223. * host can determine from the HW peer ID provided as meta-data with
  8224. * the rx frame which peer the frame is supposed to be forwarded to.
  8225. * Value: ID used by the MAC HW to identify the peer
  8226. */
  8227. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  8228. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  8229. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  8230. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  8231. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  8232. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  8233. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  8234. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  8235. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  8236. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  8237. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  8238. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  8239. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  8240. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  8241. do { \
  8242. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  8243. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  8244. } while (0)
  8245. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  8246. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  8247. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  8248. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  8249. do { \
  8250. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  8251. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  8252. } while (0)
  8253. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  8254. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  8255. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  8256. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  8257. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  8258. do { \
  8259. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  8260. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  8261. } while (0)
  8262. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  8263. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  8264. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  8265. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  8266. #define HTT_RX_PEER_MAP_BYTES 12
  8267. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  8268. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  8269. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  8270. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  8271. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  8272. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  8273. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  8274. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  8275. #define HTT_RX_PEER_UNMAP_BYTES 4
  8276. /**
  8277. * @brief target -> host rx peer map V2 message definition
  8278. *
  8279. * @details
  8280. * The following diagram shows the format of the rx peer map v2 message sent
  8281. * from the target to the host. This layout assumes the target operates
  8282. * as little-endian.
  8283. *
  8284. * This message always contains a SW peer ID. The main purpose of the
  8285. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  8286. * with, so that the host can use that peer ID to determine which peer
  8287. * transmitted the rx frame. This SW peer ID is sometimes also used for
  8288. * other purposes, such as identifying during tx completions which peer
  8289. * the tx frames in question were transmitted to.
  8290. *
  8291. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  8292. * is used during rx --> tx frame forwarding to identify which peer the
  8293. * frame needs to be forwarded to (i.e. the peer assocated with the
  8294. * Destination MAC Address within the packet), and particularly which vdev
  8295. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  8296. * This DA-based peer ID that is provided for certain rx frames
  8297. * (the rx frames that need to be re-transmitted as tx frames)
  8298. * is the ID that the HW uses for referring to the peer in question,
  8299. * rather than the peer ID that the SW+FW use to refer to the peer.
  8300. *
  8301. * The HW peer id here is the same meaning as AST_INDEX_0.
  8302. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  8303. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  8304. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  8305. * AST is valid.
  8306. *
  8307. * |31 28|27 24|23 20|19 17|16|15 8|7 0|
  8308. * |-----------------------------------------------------------------------|
  8309. * | SW peer ID | VDEV ID | msg type |
  8310. * |-----------------------------------------------------------------------|
  8311. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8312. * |-----------------------------------------------------------------------|
  8313. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  8314. * |-----------------------------------------------------------------------|
  8315. * | Reserved_20_31 |ASTVM|NH| AST Hash Value |
  8316. * |-----------------------------------------------------------------------|
  8317. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  8318. * |-----------------------------------------------------------------------|
  8319. * |TID valid low pri| TID valid hi pri| AST index 2 |
  8320. * |-----------------------------------------------------------------------|
  8321. * | Reserved_1 | AST index 3 |
  8322. * |-----------------------------------------------------------------------|
  8323. * | Reserved_2 |
  8324. * |-----------------------------------------------------------------------|
  8325. * Where:
  8326. * NH = Next Hop
  8327. * ASTVM = AST valid mask
  8328. * ASTFM = AST flow mask
  8329. *
  8330. * The following field definitions describe the format of the rx peer map v2
  8331. * messages sent from the target to the host.
  8332. * - MSG_TYPE
  8333. * Bits 7:0
  8334. * Purpose: identifies this as an rx peer map v2 message
  8335. * Value: peer map v2 -> 0x1e
  8336. * - VDEV_ID
  8337. * Bits 15:8
  8338. * Purpose: Indicates which virtual device the peer is associated with.
  8339. * Value: vdev ID (used in the host to look up the vdev object)
  8340. * - SW_PEER_ID
  8341. * Bits 31:16
  8342. * Purpose: The peer ID (index) that WAL is allocating
  8343. * Value: (rx) peer ID
  8344. * - MAC_ADDR_L32
  8345. * Bits 31:0
  8346. * Purpose: Identifies which peer node the peer ID is for.
  8347. * Value: lower 4 bytes of peer node's MAC address
  8348. * - MAC_ADDR_U16
  8349. * Bits 15:0
  8350. * Purpose: Identifies which peer node the peer ID is for.
  8351. * Value: upper 2 bytes of peer node's MAC address
  8352. * - HW_PEER_ID / AST_INDEX_0
  8353. * Bits 31:16
  8354. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  8355. * address, so for rx frames marked for rx --> tx forwarding, the
  8356. * host can determine from the HW peer ID provided as meta-data with
  8357. * the rx frame which peer the frame is supposed to be forwarded to.
  8358. * Value: ID used by the MAC HW to identify the peer
  8359. * - AST_HASH_VALUE
  8360. * Bits 15:0
  8361. * Purpose: Indicates AST Hash value is required for the TCL AST index
  8362. * override feature.
  8363. * - NEXT_HOP
  8364. * Bit 16
  8365. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  8366. * (Wireless Distribution System).
  8367. * - AST_VALID_MASK
  8368. * Bits 19:17
  8369. * Purpose: Indicate if the AST 1 through AST 3 are valid
  8370. * - AST_INDEX_1
  8371. * Bits 15:0
  8372. * Purpose: indicate the second AST index for this peer
  8373. * - AST_0_FLOW_MASK
  8374. * Bits 19:16
  8375. * Purpose: identify the which flow the AST 0 entry corresponds to.
  8376. * - AST_1_FLOW_MASK
  8377. * Bits 23:20
  8378. * Purpose: identify the which flow the AST 1 entry corresponds to.
  8379. * - AST_2_FLOW_MASK
  8380. * Bits 27:24
  8381. * Purpose: identify the which flow the AST 2 entry corresponds to.
  8382. * - AST_3_FLOW_MASK
  8383. * Bits 31:28
  8384. * Purpose: identify the which flow the AST 3 entry corresponds to.
  8385. * - AST_INDEX_2
  8386. * Bits 15:0
  8387. * Purpose: indicate the third AST index for this peer
  8388. * - TID_VALID_HI_PRI
  8389. * Bits 23:16
  8390. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  8391. * - TID_VALID_LOW_PRI
  8392. * Bits 31:24
  8393. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  8394. * - AST_INDEX_3
  8395. * Bits 15:0
  8396. * Purpose: indicate the fourth AST index for this peer
  8397. */
  8398. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  8399. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  8400. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  8401. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  8402. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  8403. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  8404. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  8405. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  8406. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  8407. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  8408. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  8409. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  8410. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  8411. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  8412. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  8413. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  8414. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  8415. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  8416. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  8417. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  8418. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  8419. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  8420. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  8421. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  8422. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  8423. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  8424. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  8425. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  8426. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  8427. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  8428. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  8429. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  8430. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  8431. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  8432. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  8433. do { \
  8434. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  8435. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  8436. } while (0)
  8437. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  8438. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  8439. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  8440. do { \
  8441. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  8442. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  8443. } while (0)
  8444. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  8445. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  8446. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  8447. do { \
  8448. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  8449. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  8450. } while (0)
  8451. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  8452. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  8453. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  8454. do { \
  8455. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  8456. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  8457. } while (0)
  8458. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  8459. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  8460. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  8461. do { \
  8462. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  8463. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  8464. } while (0)
  8465. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  8466. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  8467. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  8468. do { \
  8469. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  8470. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  8471. } while (0)
  8472. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  8473. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  8474. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  8475. do { \
  8476. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  8477. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  8478. } while (0)
  8479. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  8480. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  8481. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  8482. do { \
  8483. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  8484. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  8485. } while (0)
  8486. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  8487. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  8488. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  8489. do { \
  8490. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  8491. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  8492. } while (0)
  8493. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  8494. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  8495. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  8496. do { \
  8497. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  8498. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  8499. } while (0)
  8500. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  8501. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  8502. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  8503. do { \
  8504. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  8505. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  8506. } while (0)
  8507. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  8508. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  8509. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  8510. do { \
  8511. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  8512. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  8513. } while (0)
  8514. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  8515. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  8516. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  8517. do { \
  8518. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  8519. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  8520. } while (0)
  8521. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  8522. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  8523. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  8524. do { \
  8525. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  8526. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  8527. } while (0)
  8528. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  8529. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  8530. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  8531. do { \
  8532. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  8533. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  8534. } while (0)
  8535. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  8536. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  8537. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8538. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  8539. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  8540. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  8541. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  8542. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  8543. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  8544. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  8545. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  8546. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  8547. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  8548. #define HTT_RX_PEER_MAP_V2_BYTES 32
  8549. /**
  8550. * @brief target -> host rx peer unmap V2 message definition
  8551. *
  8552. *
  8553. * The following diagram shows the format of the rx peer unmap message sent
  8554. * from the target to the host.
  8555. *
  8556. * |31 24|23 16|15 8|7 0|
  8557. * |-----------------------------------------------------------------------|
  8558. * | SW peer ID | VDEV ID | msg type |
  8559. * |-----------------------------------------------------------------------|
  8560. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  8561. * |-----------------------------------------------------------------------|
  8562. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  8563. * |-----------------------------------------------------------------------|
  8564. * | Peer Delete Duration |
  8565. * |-----------------------------------------------------------------------|
  8566. * | Reserved_0 | WDS Free Count |
  8567. * |-----------------------------------------------------------------------|
  8568. * | Reserved_1 |
  8569. * |-----------------------------------------------------------------------|
  8570. * | Reserved_2 |
  8571. * |-----------------------------------------------------------------------|
  8572. *
  8573. *
  8574. * The following field definitions describe the format of the rx peer unmap
  8575. * messages sent from the target to the host.
  8576. * - MSG_TYPE
  8577. * Bits 7:0
  8578. * Purpose: identifies this as an rx peer unmap v2 message
  8579. * Value: peer unmap v2 -> 0x1f
  8580. * - VDEV_ID
  8581. * Bits 15:8
  8582. * Purpose: Indicates which virtual device the peer is associated
  8583. * with.
  8584. * Value: vdev ID (used in the host to look up the vdev object)
  8585. * - SW_PEER_ID
  8586. * Bits 31:16
  8587. * Purpose: The peer ID (index) that WAL is freeing
  8588. * Value: (rx) peer ID
  8589. * - MAC_ADDR_L32
  8590. * Bits 31:0
  8591. * Purpose: Identifies which peer node the peer ID is for.
  8592. * Value: lower 4 bytes of peer node's MAC address
  8593. * - MAC_ADDR_U16
  8594. * Bits 15:0
  8595. * Purpose: Identifies which peer node the peer ID is for.
  8596. * Value: upper 2 bytes of peer node's MAC address
  8597. * - NEXT_HOP
  8598. * Bits 16
  8599. * Purpose: Bit indicates next_hop AST entry used for WDS
  8600. * (Wireless Distribution System).
  8601. * - PEER_DELETE_DURATION
  8602. * Bits 31:0
  8603. * Purpose: Time taken to delete peer, in msec,
  8604. * Used for monitoring / debugging PEER delete response delay
  8605. * - PEER_WDS_FREE_COUNT
  8606. * Bits 15:0
  8607. * Purpose: Count of WDS entries deleted associated to peer deleted
  8608. */
  8609. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  8610. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  8611. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  8612. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  8613. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  8614. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  8615. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  8616. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  8617. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  8618. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  8619. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  8620. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  8621. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  8622. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  8623. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  8624. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  8625. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  8626. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  8627. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  8628. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  8629. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  8630. do { \
  8631. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  8632. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  8633. } while (0)
  8634. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  8635. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  8636. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  8637. do { \
  8638. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  8639. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  8640. } while (0)
  8641. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  8642. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  8643. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  8644. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  8645. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  8646. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  8647. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  8648. /**
  8649. * @brief target -> host message specifying security parameters
  8650. *
  8651. * @details
  8652. * The following diagram shows the format of the security specification
  8653. * message sent from the target to the host.
  8654. * This security specification message tells the host whether a PN check is
  8655. * necessary on rx data frames, and if so, how large the PN counter is.
  8656. * This message also tells the host about the security processing to apply
  8657. * to defragmented rx frames - specifically, whether a Message Integrity
  8658. * Check is required, and the Michael key to use.
  8659. *
  8660. * |31 24|23 16|15|14 8|7 0|
  8661. * |-----------------------------------------------------------------------|
  8662. * | peer ID | U| security type | msg type |
  8663. * |-----------------------------------------------------------------------|
  8664. * | Michael Key K0 |
  8665. * |-----------------------------------------------------------------------|
  8666. * | Michael Key K1 |
  8667. * |-----------------------------------------------------------------------|
  8668. * | WAPI RSC Low0 |
  8669. * |-----------------------------------------------------------------------|
  8670. * | WAPI RSC Low1 |
  8671. * |-----------------------------------------------------------------------|
  8672. * | WAPI RSC Hi0 |
  8673. * |-----------------------------------------------------------------------|
  8674. * | WAPI RSC Hi1 |
  8675. * |-----------------------------------------------------------------------|
  8676. *
  8677. * The following field definitions describe the format of the security
  8678. * indication message sent from the target to the host.
  8679. * - MSG_TYPE
  8680. * Bits 7:0
  8681. * Purpose: identifies this as a security specification message
  8682. * Value: 0xb
  8683. * - SEC_TYPE
  8684. * Bits 14:8
  8685. * Purpose: specifies which type of security applies to the peer
  8686. * Value: htt_sec_type enum value
  8687. * - UNICAST
  8688. * Bit 15
  8689. * Purpose: whether this security is applied to unicast or multicast data
  8690. * Value: 1 -> unicast, 0 -> multicast
  8691. * - PEER_ID
  8692. * Bits 31:16
  8693. * Purpose: The ID number for the peer the security specification is for
  8694. * Value: peer ID
  8695. * - MICHAEL_KEY_K0
  8696. * Bits 31:0
  8697. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  8698. * Value: Michael Key K0 (if security type is TKIP)
  8699. * - MICHAEL_KEY_K1
  8700. * Bits 31:0
  8701. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  8702. * Value: Michael Key K1 (if security type is TKIP)
  8703. * - WAPI_RSC_LOW0
  8704. * Bits 31:0
  8705. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  8706. * Value: WAPI RSC Low0 (if security type is WAPI)
  8707. * - WAPI_RSC_LOW1
  8708. * Bits 31:0
  8709. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  8710. * Value: WAPI RSC Low1 (if security type is WAPI)
  8711. * - WAPI_RSC_HI0
  8712. * Bits 31:0
  8713. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  8714. * Value: WAPI RSC Hi0 (if security type is WAPI)
  8715. * - WAPI_RSC_HI1
  8716. * Bits 31:0
  8717. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  8718. * Value: WAPI RSC Hi1 (if security type is WAPI)
  8719. */
  8720. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  8721. #define HTT_SEC_IND_SEC_TYPE_S 8
  8722. #define HTT_SEC_IND_UNICAST_M 0x00008000
  8723. #define HTT_SEC_IND_UNICAST_S 15
  8724. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  8725. #define HTT_SEC_IND_PEER_ID_S 16
  8726. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  8727. do { \
  8728. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  8729. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  8730. } while (0)
  8731. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  8732. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  8733. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  8734. do { \
  8735. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  8736. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  8737. } while (0)
  8738. #define HTT_SEC_IND_UNICAST_GET(word) \
  8739. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  8740. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  8741. do { \
  8742. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  8743. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  8744. } while (0)
  8745. #define HTT_SEC_IND_PEER_ID_GET(word) \
  8746. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  8747. #define HTT_SEC_IND_BYTES 28
  8748. /**
  8749. * @brief target -> host rx ADDBA / DELBA message definitions
  8750. *
  8751. * @details
  8752. * The following diagram shows the format of the rx ADDBA message sent
  8753. * from the target to the host:
  8754. *
  8755. * |31 20|19 16|15 8|7 0|
  8756. * |---------------------------------------------------------------------|
  8757. * | peer ID | TID | window size | msg type |
  8758. * |---------------------------------------------------------------------|
  8759. *
  8760. * The following diagram shows the format of the rx DELBA message sent
  8761. * from the target to the host:
  8762. *
  8763. * |31 20|19 16|15 10|9 8|7 0|
  8764. * |---------------------------------------------------------------------|
  8765. * | peer ID | TID | window size | IR| msg type |
  8766. * |---------------------------------------------------------------------|
  8767. *
  8768. * The following field definitions describe the format of the rx ADDBA
  8769. * and DELBA messages sent from the target to the host.
  8770. * - MSG_TYPE
  8771. * Bits 7:0
  8772. * Purpose: identifies this as an rx ADDBA or DELBA message
  8773. * Value: ADDBA -> 0x5, DELBA -> 0x6
  8774. * - IR (initiator / recipient)
  8775. * Bits 9:8 (DELBA only)
  8776. * Purpose: specify whether the DELBA handshake was initiated by the
  8777. * local STA/AP, or by the peer STA/AP
  8778. * Value:
  8779. * 0 - unspecified
  8780. * 1 - initiator (a.k.a. originator)
  8781. * 2 - recipient (a.k.a. responder)
  8782. * 3 - unused / reserved
  8783. * - WIN_SIZE
  8784. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  8785. * Purpose: Specifies the length of the block ack window (max = 64).
  8786. * Value:
  8787. * block ack window length specified by the received ADDBA/DELBA
  8788. * management message.
  8789. * - TID
  8790. * Bits 19:16
  8791. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  8792. * Value:
  8793. * TID specified by the received ADDBA or DELBA management message.
  8794. * - PEER_ID
  8795. * Bits 31:20
  8796. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  8797. * Value:
  8798. * ID (hash value) used by the host for fast, direct lookup of
  8799. * host SW peer info, including rx reorder states.
  8800. */
  8801. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  8802. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  8803. #define HTT_RX_ADDBA_TID_M 0xf0000
  8804. #define HTT_RX_ADDBA_TID_S 16
  8805. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  8806. #define HTT_RX_ADDBA_PEER_ID_S 20
  8807. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  8808. do { \
  8809. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  8810. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  8811. } while (0)
  8812. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  8813. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  8814. #define HTT_RX_ADDBA_TID_SET(word, value) \
  8815. do { \
  8816. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  8817. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  8818. } while (0)
  8819. #define HTT_RX_ADDBA_TID_GET(word) \
  8820. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  8821. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  8822. do { \
  8823. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  8824. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  8825. } while (0)
  8826. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  8827. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  8828. #define HTT_RX_ADDBA_BYTES 4
  8829. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  8830. #define HTT_RX_DELBA_INITIATOR_S 8
  8831. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  8832. #define HTT_RX_DELBA_WIN_SIZE_S 10
  8833. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  8834. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  8835. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  8836. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  8837. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  8838. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  8839. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  8840. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  8841. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  8842. do { \
  8843. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  8844. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  8845. } while (0)
  8846. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  8847. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  8848. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  8849. do { \
  8850. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  8851. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  8852. } while (0)
  8853. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  8854. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  8855. #define HTT_RX_DELBA_BYTES 4
  8856. /**
  8857. * @brief tx queue group information element definition
  8858. *
  8859. * @details
  8860. * The following diagram shows the format of the tx queue group
  8861. * information element, which can be included in target --> host
  8862. * messages to specify the number of tx "credits" (tx descriptors
  8863. * for LL, or tx buffers for HL) available to a particular group
  8864. * of host-side tx queues, and which host-side tx queues belong to
  8865. * the group.
  8866. *
  8867. * |31|30 24|23 16|15|14|13 0|
  8868. * |------------------------------------------------------------------------|
  8869. * | X| reserved | tx queue grp ID | A| S| credit count |
  8870. * |------------------------------------------------------------------------|
  8871. * | vdev ID mask | AC mask |
  8872. * |------------------------------------------------------------------------|
  8873. *
  8874. * The following definitions describe the fields within the tx queue group
  8875. * information element:
  8876. * - credit_count
  8877. * Bits 13:1
  8878. * Purpose: specify how many tx credits are available to the tx queue group
  8879. * Value: An absolute or relative, positive or negative credit value
  8880. * The 'A' bit specifies whether the value is absolute or relative.
  8881. * The 'S' bit specifies whether the value is positive or negative.
  8882. * A negative value can only be relative, not absolute.
  8883. * An absolute value replaces any prior credit value the host has for
  8884. * the tx queue group in question.
  8885. * A relative value is added to the prior credit value the host has for
  8886. * the tx queue group in question.
  8887. * - sign
  8888. * Bit 14
  8889. * Purpose: specify whether the credit count is positive or negative
  8890. * Value: 0 -> positive, 1 -> negative
  8891. * - absolute
  8892. * Bit 15
  8893. * Purpose: specify whether the credit count is absolute or relative
  8894. * Value: 0 -> relative, 1 -> absolute
  8895. * - txq_group_id
  8896. * Bits 23:16
  8897. * Purpose: indicate which tx queue group's credit and/or membership are
  8898. * being specified
  8899. * Value: 0 to max_tx_queue_groups-1
  8900. * - reserved
  8901. * Bits 30:16
  8902. * Value: 0x0
  8903. * - eXtension
  8904. * Bit 31
  8905. * Purpose: specify whether another tx queue group info element follows
  8906. * Value: 0 -> no more tx queue group information elements
  8907. * 1 -> another tx queue group information element immediately follows
  8908. * - ac_mask
  8909. * Bits 15:0
  8910. * Purpose: specify which Access Categories belong to the tx queue group
  8911. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  8912. * the tx queue group.
  8913. * The AC bit-mask values are obtained by left-shifting by the
  8914. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  8915. * - vdev_id_mask
  8916. * Bits 31:16
  8917. * Purpose: specify which vdev's tx queues belong to the tx queue group
  8918. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  8919. * belong to the tx queue group.
  8920. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  8921. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  8922. */
  8923. PREPACK struct htt_txq_group {
  8924. A_UINT32
  8925. credit_count: 14,
  8926. sign: 1,
  8927. absolute: 1,
  8928. tx_queue_group_id: 8,
  8929. reserved0: 7,
  8930. extension: 1;
  8931. A_UINT32
  8932. ac_mask: 16,
  8933. vdev_id_mask: 16;
  8934. } POSTPACK;
  8935. /* first word */
  8936. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  8937. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  8938. #define HTT_TXQ_GROUP_SIGN_S 14
  8939. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  8940. #define HTT_TXQ_GROUP_ABS_S 15
  8941. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  8942. #define HTT_TXQ_GROUP_ID_S 16
  8943. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  8944. #define HTT_TXQ_GROUP_EXT_S 31
  8945. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  8946. /* second word */
  8947. #define HTT_TXQ_GROUP_AC_MASK_S 0
  8948. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  8949. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  8950. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  8951. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  8952. do { \
  8953. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  8954. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  8955. } while (0)
  8956. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  8957. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  8958. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  8959. do { \
  8960. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  8961. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  8962. } while (0)
  8963. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  8964. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  8965. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  8966. do { \
  8967. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  8968. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  8969. } while (0)
  8970. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  8971. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  8972. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  8973. do { \
  8974. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  8975. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  8976. } while (0)
  8977. #define HTT_TXQ_GROUP_ID_GET(_info) \
  8978. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  8979. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  8980. do { \
  8981. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  8982. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  8983. } while (0)
  8984. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  8985. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  8986. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  8987. do { \
  8988. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  8989. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  8990. } while (0)
  8991. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  8992. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  8993. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  8996. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  8997. } while (0)
  8998. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  8999. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  9000. /**
  9001. * @brief target -> host TX completion indication message definition
  9002. *
  9003. * @details
  9004. * The following diagram shows the format of the TX completion indication sent
  9005. * from the target to the host
  9006. *
  9007. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  9008. * |-------------------------------------------------------------------|
  9009. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  9010. * |-------------------------------------------------------------------|
  9011. * payload:| MSDU1 ID | MSDU0 ID |
  9012. * |-------------------------------------------------------------------|
  9013. * : MSDU3 ID | MSDU2 ID :
  9014. * |-------------------------------------------------------------------|
  9015. * | struct htt_tx_compl_ind_append_retries |
  9016. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9017. * | struct htt_tx_compl_ind_append_tx_tstamp |
  9018. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9019. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  9020. * |-------------------------------------------------------------------|
  9021. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  9022. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9023. * | MSDU0 tx_tsf64_low |
  9024. * |-------------------------------------------------------------------|
  9025. * | MSDU0 tx_tsf64_high |
  9026. * |-------------------------------------------------------------------|
  9027. * | MSDU1 tx_tsf64_low |
  9028. * |-------------------------------------------------------------------|
  9029. * | MSDU1 tx_tsf64_high |
  9030. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9031. * | phy_timestamp |
  9032. * |-------------------------------------------------------------------|
  9033. * | rate specs (see below) |
  9034. * |-------------------------------------------------------------------|
  9035. * | seqctrl | framectrl |
  9036. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  9037. * Where:
  9038. * A0 = append (a.k.a. append0)
  9039. * A1 = append1
  9040. * TP = MSDU tx power presence
  9041. * A2 = append2
  9042. * A3 = append3
  9043. * A4 = append4
  9044. *
  9045. * The following field definitions describe the format of the TX completion
  9046. * indication sent from the target to the host
  9047. * Header fields:
  9048. * - msg_type
  9049. * Bits 7:0
  9050. * Purpose: identifies this as HTT TX completion indication
  9051. * Value: 0x7
  9052. * - status
  9053. * Bits 10:8
  9054. * Purpose: the TX completion status of payload fragmentations descriptors
  9055. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  9056. * - tid
  9057. * Bits 14:11
  9058. * Purpose: the tid associated with those fragmentation descriptors. It is
  9059. * valid or not, depending on the tid_invalid bit.
  9060. * Value: 0 to 15
  9061. * - tid_invalid
  9062. * Bits 15:15
  9063. * Purpose: this bit indicates whether the tid field is valid or not
  9064. * Value: 0 indicates valid; 1 indicates invalid
  9065. * - num
  9066. * Bits 23:16
  9067. * Purpose: the number of payload in this indication
  9068. * Value: 1 to 255
  9069. * - append (a.k.a. append0)
  9070. * Bits 24:24
  9071. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  9072. * the number of tx retries for one MSDU at the end of this message
  9073. * Value: 0 indicates no appending; 1 indicates appending
  9074. * - append1
  9075. * Bits 25:25
  9076. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  9077. * contains the timestamp info for each TX msdu id in payload.
  9078. * The order of the timestamps matches the order of the MSDU IDs.
  9079. * Note that a big-endian host needs to account for the reordering
  9080. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9081. * conversion) when determining which tx timestamp corresponds to
  9082. * which MSDU ID.
  9083. * Value: 0 indicates no appending; 1 indicates appending
  9084. * - msdu_tx_power_presence
  9085. * Bits 26:26
  9086. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  9087. * for each MSDU referenced by the TX_COMPL_IND message.
  9088. * The tx power is reported in 0.5 dBm units.
  9089. * The order of the per-MSDU tx power reports matches the order
  9090. * of the MSDU IDs.
  9091. * Note that a big-endian host needs to account for the reordering
  9092. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  9093. * conversion) when determining which Tx Power corresponds to
  9094. * which MSDU ID.
  9095. * Value: 0 indicates MSDU tx power reports are not appended,
  9096. * 1 indicates MSDU tx power reports are appended
  9097. * - append2
  9098. * Bits 27:27
  9099. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  9100. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  9101. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  9102. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  9103. * for each MSDU, for convenience.
  9104. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  9105. * this append2 bit is set).
  9106. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  9107. * dB above the noise floor.
  9108. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  9109. * 1 indicates MSDU ACK RSSI values are appended.
  9110. * - append3
  9111. * Bits 28:28
  9112. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  9113. * contains the tx tsf info based on wlan global TSF for
  9114. * each TX msdu id in payload.
  9115. * The order of the tx tsf matches the order of the MSDU IDs.
  9116. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  9117. * values to indicate the the lower 32 bits and higher 32 bits of
  9118. * the tx tsf.
  9119. * The tx_tsf64 here represents the time MSDU was acked and the
  9120. * tx_tsf64 has microseconds units.
  9121. * Value: 0 indicates no appending; 1 indicates appending
  9122. * - append4
  9123. * Bits 29:29
  9124. * Purpose: Indicate whether data frame control fields and fields required
  9125. * for radio tap header are appended for each MSDU in TX_COMP_IND
  9126. * message. The order of the this message matches the order of
  9127. * the MSDU IDs.
  9128. * Value: 0 indicates frame control fields and fields required for
  9129. * radio tap header values are not appended,
  9130. * 1 indicates frame control fields and fields required for
  9131. * radio tap header values are appended.
  9132. * Payload fields:
  9133. * - hmsdu_id
  9134. * Bits 15:0
  9135. * Purpose: this ID is used to track the Tx buffer in host
  9136. * Value: 0 to "size of host MSDU descriptor pool - 1"
  9137. */
  9138. PREPACK struct htt_tx_data_hdr_information {
  9139. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  9140. A_UINT32 /* word 1 */
  9141. /* preamble:
  9142. * 0-OFDM,
  9143. * 1-CCk,
  9144. * 2-HT,
  9145. * 3-VHT
  9146. */
  9147. preamble: 2, /* [1:0] */
  9148. /* mcs:
  9149. * In case of HT preamble interpret
  9150. * MCS along with NSS.
  9151. * Valid values for HT are 0 to 7.
  9152. * HT mcs 0 with NSS 2 is mcs 8.
  9153. * Valid values for VHT are 0 to 9.
  9154. */
  9155. mcs: 4, /* [5:2] */
  9156. /* rate:
  9157. * This is applicable only for
  9158. * CCK and OFDM preamble type
  9159. * rate 0: OFDM 48 Mbps,
  9160. * 1: OFDM 24 Mbps,
  9161. * 2: OFDM 12 Mbps
  9162. * 3: OFDM 6 Mbps
  9163. * 4: OFDM 54 Mbps
  9164. * 5: OFDM 36 Mbps
  9165. * 6: OFDM 18 Mbps
  9166. * 7: OFDM 9 Mbps
  9167. * rate 0: CCK 11 Mbps Long
  9168. * 1: CCK 5.5 Mbps Long
  9169. * 2: CCK 2 Mbps Long
  9170. * 3: CCK 1 Mbps Long
  9171. * 4: CCK 11 Mbps Short
  9172. * 5: CCK 5.5 Mbps Short
  9173. * 6: CCK 2 Mbps Short
  9174. */
  9175. rate : 3, /* [ 8: 6] */
  9176. rssi : 8, /* [16: 9] units=dBm */
  9177. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9178. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9179. stbc : 1, /* [22] */
  9180. sgi : 1, /* [23] */
  9181. ldpc : 1, /* [24] */
  9182. beamformed: 1, /* [25] */
  9183. /* tx_retry_cnt:
  9184. * Indicates retry count of data tx frames provided by the host.
  9185. */
  9186. tx_retry_cnt: 6; /* [31:26] */
  9187. A_UINT32 /* word 2 */
  9188. framectrl:16, /* [15: 0] */
  9189. seqno:16; /* [31:16] */
  9190. } POSTPACK;
  9191. #define HTT_TX_COMPL_IND_STATUS_S 8
  9192. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  9193. #define HTT_TX_COMPL_IND_TID_S 11
  9194. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  9195. #define HTT_TX_COMPL_IND_TID_INV_S 15
  9196. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  9197. #define HTT_TX_COMPL_IND_NUM_S 16
  9198. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  9199. #define HTT_TX_COMPL_IND_APPEND_S 24
  9200. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  9201. #define HTT_TX_COMPL_IND_APPEND1_S 25
  9202. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  9203. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  9204. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  9205. #define HTT_TX_COMPL_IND_APPEND2_S 27
  9206. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  9207. #define HTT_TX_COMPL_IND_APPEND3_S 28
  9208. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  9209. #define HTT_TX_COMPL_IND_APPEND4_S 29
  9210. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  9211. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  9212. do { \
  9213. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  9214. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  9215. } while (0)
  9216. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  9217. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  9218. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  9219. do { \
  9220. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  9221. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  9222. } while (0)
  9223. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  9224. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  9225. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  9226. do { \
  9227. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  9228. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  9229. } while (0)
  9230. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  9231. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  9232. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  9233. do { \
  9234. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  9235. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  9236. } while (0)
  9237. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  9238. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  9239. HTT_TX_COMPL_IND_TID_INV_S)
  9240. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  9241. do { \
  9242. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  9243. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  9244. } while (0)
  9245. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  9246. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  9247. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  9248. do { \
  9249. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  9250. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  9251. } while (0)
  9252. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  9253. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  9254. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  9255. do { \
  9256. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  9257. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  9258. } while (0)
  9259. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  9260. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  9261. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  9262. do { \
  9263. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  9264. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  9265. } while (0)
  9266. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  9267. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  9268. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  9269. do { \
  9270. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  9271. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  9272. } while (0)
  9273. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  9274. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  9275. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  9276. do { \
  9277. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  9278. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  9279. } while (0)
  9280. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  9281. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  9282. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  9283. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  9284. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  9285. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  9286. #define HTT_TX_COMPL_IND_STAT_OK 0
  9287. /* DISCARD:
  9288. * current meaning:
  9289. * MSDUs were queued for transmission but filtered by HW or SW
  9290. * without any over the air attempts
  9291. * legacy meaning (HL Rome):
  9292. * MSDUs were discarded by the target FW without any over the air
  9293. * attempts due to lack of space
  9294. */
  9295. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  9296. /* NO_ACK:
  9297. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  9298. */
  9299. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  9300. /* POSTPONE:
  9301. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  9302. * be downloaded again later (in the appropriate order), when they are
  9303. * deliverable.
  9304. */
  9305. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  9306. /*
  9307. * The PEER_DEL tx completion status is used for HL cases
  9308. * where the peer the frame is for has been deleted.
  9309. * The host has already discarded its copy of the frame, but
  9310. * it still needs the tx completion to restore its credit.
  9311. */
  9312. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  9313. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  9314. #define HTT_TX_COMPL_IND_STAT_DROP 5
  9315. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  9316. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  9317. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  9318. PREPACK struct htt_tx_compl_ind_base {
  9319. A_UINT32 hdr;
  9320. A_UINT16 payload[1/*or more*/];
  9321. } POSTPACK;
  9322. PREPACK struct htt_tx_compl_ind_append_retries {
  9323. A_UINT16 msdu_id;
  9324. A_UINT8 tx_retries;
  9325. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  9326. 0: this is the last append_retries struct */
  9327. } POSTPACK;
  9328. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  9329. A_UINT32 timestamp[1/*or more*/];
  9330. } POSTPACK;
  9331. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  9332. A_UINT32 tx_tsf64_low;
  9333. A_UINT32 tx_tsf64_high;
  9334. } POSTPACK;
  9335. /* htt_tx_data_hdr_information payload extension fields: */
  9336. /* DWORD zero */
  9337. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  9338. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  9339. /* DWORD one */
  9340. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  9341. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  9342. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  9343. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  9344. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  9345. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  9346. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  9347. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  9348. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  9349. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  9350. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  9351. #define HTT_FW_TX_DATA_HDR_BW_S 19
  9352. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  9353. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  9354. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  9355. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  9356. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  9357. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  9358. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  9359. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  9360. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  9361. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  9362. /* DWORD two */
  9363. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  9364. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  9365. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  9366. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  9367. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  9368. do { \
  9369. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  9370. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  9371. } while (0)
  9372. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  9373. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  9374. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  9375. do { \
  9376. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  9377. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  9378. } while (0)
  9379. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  9380. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  9381. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  9382. do { \
  9383. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  9384. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  9385. } while (0)
  9386. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  9387. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  9388. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  9389. do { \
  9390. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  9391. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  9392. } while (0)
  9393. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  9394. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  9395. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  9396. do { \
  9397. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  9398. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  9399. } while (0)
  9400. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  9401. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  9402. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  9403. do { \
  9404. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  9405. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  9406. } while (0)
  9407. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  9408. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  9409. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  9410. do { \
  9411. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  9412. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  9413. } while (0)
  9414. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  9415. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  9416. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  9417. do { \
  9418. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  9419. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  9420. } while (0)
  9421. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  9422. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  9423. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  9424. do { \
  9425. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  9426. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  9427. } while (0)
  9428. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  9429. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  9430. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  9431. do { \
  9432. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  9433. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  9434. } while (0)
  9435. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  9436. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  9437. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  9438. do { \
  9439. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  9440. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  9441. } while (0)
  9442. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  9443. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  9444. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  9445. do { \
  9446. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  9447. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  9448. } while (0)
  9449. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  9450. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  9451. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  9452. do { \
  9453. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  9454. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  9455. } while (0)
  9456. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  9457. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  9458. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  9459. do { \
  9460. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  9461. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  9462. } while (0)
  9463. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  9464. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  9465. /**
  9466. * @brief target -> host rate-control update indication message
  9467. *
  9468. * @details
  9469. * The following diagram shows the format of the RC Update message
  9470. * sent from the target to the host, while processing the tx-completion
  9471. * of a transmitted PPDU.
  9472. *
  9473. * |31 24|23 16|15 8|7 0|
  9474. * |-------------------------------------------------------------|
  9475. * | peer ID | vdev ID | msg_type |
  9476. * |-------------------------------------------------------------|
  9477. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9478. * |-------------------------------------------------------------|
  9479. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  9480. * |-------------------------------------------------------------|
  9481. * | : |
  9482. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9483. * | : |
  9484. * |-------------------------------------------------------------|
  9485. * | : |
  9486. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  9487. * | : |
  9488. * |-------------------------------------------------------------|
  9489. * : :
  9490. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9491. *
  9492. */
  9493. typedef struct {
  9494. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  9495. A_UINT32 rate_code_flags;
  9496. A_UINT32 flags; /* Encodes information such as excessive
  9497. retransmission, aggregate, some info
  9498. from .11 frame control,
  9499. STBC, LDPC, (SGI and Tx Chain Mask
  9500. are encoded in ptx_rc->flags field),
  9501. AMPDU truncation (BT/time based etc.),
  9502. RTS/CTS attempt */
  9503. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  9504. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  9505. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  9506. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  9507. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  9508. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  9509. } HTT_RC_TX_DONE_PARAMS;
  9510. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  9511. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  9512. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  9513. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  9514. #define HTT_RC_UPDATE_VDEVID_S 8
  9515. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  9516. #define HTT_RC_UPDATE_PEERID_S 16
  9517. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  9518. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  9519. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  9520. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  9521. do { \
  9522. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  9523. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  9524. } while (0)
  9525. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  9526. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  9527. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  9528. do { \
  9529. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  9530. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  9531. } while (0)
  9532. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  9533. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  9534. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  9535. do { \
  9536. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  9537. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  9538. } while (0)
  9539. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  9540. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  9541. /**
  9542. * @brief target -> host rx fragment indication message definition
  9543. *
  9544. * @details
  9545. * The following field definitions describe the format of the rx fragment
  9546. * indication message sent from the target to the host.
  9547. * The rx fragment indication message shares the format of the
  9548. * rx indication message, but not all fields from the rx indication message
  9549. * are relevant to the rx fragment indication message.
  9550. *
  9551. *
  9552. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9553. * |-----------+-------------------+---------------------+-------------|
  9554. * | peer ID | |FV| ext TID | msg type |
  9555. * |-------------------------------------------------------------------|
  9556. * | | flush | flush |
  9557. * | | end | start |
  9558. * | | seq num | seq num |
  9559. * |-------------------------------------------------------------------|
  9560. * | reserved | FW rx desc bytes |
  9561. * |-------------------------------------------------------------------|
  9562. * | | FW MSDU Rx |
  9563. * | | desc B0 |
  9564. * |-------------------------------------------------------------------|
  9565. * Header fields:
  9566. * - MSG_TYPE
  9567. * Bits 7:0
  9568. * Purpose: identifies this as an rx fragment indication message
  9569. * Value: 0xa
  9570. * - EXT_TID
  9571. * Bits 12:8
  9572. * Purpose: identify the traffic ID of the rx data, including
  9573. * special "extended" TID values for multicast, broadcast, and
  9574. * non-QoS data frames
  9575. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9576. * - FLUSH_VALID (FV)
  9577. * Bit 13
  9578. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9579. * is valid
  9580. * Value:
  9581. * 1 -> flush IE is valid and needs to be processed
  9582. * 0 -> flush IE is not valid and should be ignored
  9583. * - PEER_ID
  9584. * Bits 31:16
  9585. * Purpose: Identify, by ID, which peer sent the rx data
  9586. * Value: ID of the peer who sent the rx data
  9587. * - FLUSH_SEQ_NUM_START
  9588. * Bits 5:0
  9589. * Purpose: Indicate the start of a series of MPDUs to flush
  9590. * Not all MPDUs within this series are necessarily valid - the host
  9591. * must check each sequence number within this range to see if the
  9592. * corresponding MPDU is actually present.
  9593. * This field is only valid if the FV bit is set.
  9594. * Value:
  9595. * The sequence number for the first MPDUs to check to flush.
  9596. * The sequence number is masked by 0x3f.
  9597. * - FLUSH_SEQ_NUM_END
  9598. * Bits 11:6
  9599. * Purpose: Indicate the end of a series of MPDUs to flush
  9600. * Value:
  9601. * The sequence number one larger than the sequence number of the
  9602. * last MPDU to check to flush.
  9603. * The sequence number is masked by 0x3f.
  9604. * Not all MPDUs within this series are necessarily valid - the host
  9605. * must check each sequence number within this range to see if the
  9606. * corresponding MPDU is actually present.
  9607. * This field is only valid if the FV bit is set.
  9608. * Rx descriptor fields:
  9609. * - FW_RX_DESC_BYTES
  9610. * Bits 15:0
  9611. * Purpose: Indicate how many bytes in the Rx indication are used for
  9612. * FW Rx descriptors
  9613. * Value: 1
  9614. */
  9615. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  9616. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  9617. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  9618. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  9619. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  9620. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  9621. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  9622. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  9623. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  9624. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  9625. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  9626. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  9627. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  9628. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  9629. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  9630. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  9631. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  9632. #define HTT_RX_FRAG_IND_BYTES \
  9633. (4 /* msg hdr */ + \
  9634. 4 /* flush spec */ + \
  9635. 4 /* (unused) FW rx desc bytes spec */ + \
  9636. 4 /* FW rx desc */)
  9637. /**
  9638. * @brief target -> host test message definition
  9639. *
  9640. * @details
  9641. * The following field definitions describe the format of the test
  9642. * message sent from the target to the host.
  9643. * The message consists of a 4-octet header, followed by a variable
  9644. * number of 32-bit integer values, followed by a variable number
  9645. * of 8-bit character values.
  9646. *
  9647. * |31 16|15 8|7 0|
  9648. * |-----------------------------------------------------------|
  9649. * | num chars | num ints | msg type |
  9650. * |-----------------------------------------------------------|
  9651. * | int 0 |
  9652. * |-----------------------------------------------------------|
  9653. * | int 1 |
  9654. * |-----------------------------------------------------------|
  9655. * | ... |
  9656. * |-----------------------------------------------------------|
  9657. * | char 3 | char 2 | char 1 | char 0 |
  9658. * |-----------------------------------------------------------|
  9659. * | | | ... | char 4 |
  9660. * |-----------------------------------------------------------|
  9661. * - MSG_TYPE
  9662. * Bits 7:0
  9663. * Purpose: identifies this as a test message
  9664. * Value: HTT_MSG_TYPE_TEST
  9665. * - NUM_INTS
  9666. * Bits 15:8
  9667. * Purpose: indicate how many 32-bit integers follow the message header
  9668. * - NUM_CHARS
  9669. * Bits 31:16
  9670. * Purpose: indicate how many 8-bit charaters follow the series of integers
  9671. */
  9672. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  9673. #define HTT_RX_TEST_NUM_INTS_S 8
  9674. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  9675. #define HTT_RX_TEST_NUM_CHARS_S 16
  9676. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  9677. do { \
  9678. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  9679. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  9680. } while (0)
  9681. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  9682. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  9683. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  9684. do { \
  9685. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  9686. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  9687. } while (0)
  9688. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  9689. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  9690. /**
  9691. * @brief target -> host packet log message
  9692. *
  9693. * @details
  9694. * The following field definitions describe the format of the packet log
  9695. * message sent from the target to the host.
  9696. * The message consists of a 4-octet header,followed by a variable number
  9697. * of 32-bit character values.
  9698. *
  9699. * |31 16|15 12|11 10|9 8|7 0|
  9700. * |------------------------------------------------------------------|
  9701. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  9702. * |------------------------------------------------------------------|
  9703. * | payload |
  9704. * |------------------------------------------------------------------|
  9705. * - MSG_TYPE
  9706. * Bits 7:0
  9707. * Purpose: identifies this as a pktlog message
  9708. * Value: HTT_T2H_MSG_TYPE_PKTLOG
  9709. * - mac_id
  9710. * Bits 9:8
  9711. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  9712. * Value: 0-3
  9713. * - pdev_id
  9714. * Bits 11:10
  9715. * Purpose: pdev_id
  9716. * Value: 0-3
  9717. * 0 (for rings at SOC level),
  9718. * 1/2/3 PDEV -> 0/1/2
  9719. * - payload_size
  9720. * Bits 31:16
  9721. * Purpose: explicitly specify the payload size
  9722. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  9723. */
  9724. PREPACK struct htt_pktlog_msg {
  9725. A_UINT32 header;
  9726. A_UINT32 payload[1/* or more */];
  9727. } POSTPACK;
  9728. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  9729. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  9730. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  9731. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  9732. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  9733. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  9734. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  9735. do { \
  9736. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  9737. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  9738. } while (0)
  9739. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  9740. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  9741. HTT_T2H_PKTLOG_MAC_ID_S)
  9742. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  9743. do { \
  9744. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  9745. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  9746. } while (0)
  9747. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  9748. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  9749. HTT_T2H_PKTLOG_PDEV_ID_S)
  9750. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  9751. do { \
  9752. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  9753. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  9754. } while (0)
  9755. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  9756. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  9757. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  9758. /*
  9759. * Rx reorder statistics
  9760. * NB: all the fields must be defined in 4 octets size.
  9761. */
  9762. struct rx_reorder_stats {
  9763. /* Non QoS MPDUs received */
  9764. A_UINT32 deliver_non_qos;
  9765. /* MPDUs received in-order */
  9766. A_UINT32 deliver_in_order;
  9767. /* Flush due to reorder timer expired */
  9768. A_UINT32 deliver_flush_timeout;
  9769. /* Flush due to move out of window */
  9770. A_UINT32 deliver_flush_oow;
  9771. /* Flush due to DELBA */
  9772. A_UINT32 deliver_flush_delba;
  9773. /* MPDUs dropped due to FCS error */
  9774. A_UINT32 fcs_error;
  9775. /* MPDUs dropped due to monitor mode non-data packet */
  9776. A_UINT32 mgmt_ctrl;
  9777. /* Unicast-data MPDUs dropped due to invalid peer */
  9778. A_UINT32 invalid_peer;
  9779. /* MPDUs dropped due to duplication (non aggregation) */
  9780. A_UINT32 dup_non_aggr;
  9781. /* MPDUs dropped due to processed before */
  9782. A_UINT32 dup_past;
  9783. /* MPDUs dropped due to duplicate in reorder queue */
  9784. A_UINT32 dup_in_reorder;
  9785. /* Reorder timeout happened */
  9786. A_UINT32 reorder_timeout;
  9787. /* invalid bar ssn */
  9788. A_UINT32 invalid_bar_ssn;
  9789. /* reorder reset due to bar ssn */
  9790. A_UINT32 ssn_reset;
  9791. /* Flush due to delete peer */
  9792. A_UINT32 deliver_flush_delpeer;
  9793. /* Flush due to offload*/
  9794. A_UINT32 deliver_flush_offload;
  9795. /* Flush due to out of buffer*/
  9796. A_UINT32 deliver_flush_oob;
  9797. /* MPDUs dropped due to PN check fail */
  9798. A_UINT32 pn_fail;
  9799. /* MPDUs dropped due to unable to allocate memory */
  9800. A_UINT32 store_fail;
  9801. /* Number of times the tid pool alloc succeeded */
  9802. A_UINT32 tid_pool_alloc_succ;
  9803. /* Number of times the MPDU pool alloc succeeded */
  9804. A_UINT32 mpdu_pool_alloc_succ;
  9805. /* Number of times the MSDU pool alloc succeeded */
  9806. A_UINT32 msdu_pool_alloc_succ;
  9807. /* Number of times the tid pool alloc failed */
  9808. A_UINT32 tid_pool_alloc_fail;
  9809. /* Number of times the MPDU pool alloc failed */
  9810. A_UINT32 mpdu_pool_alloc_fail;
  9811. /* Number of times the MSDU pool alloc failed */
  9812. A_UINT32 msdu_pool_alloc_fail;
  9813. /* Number of times the tid pool freed */
  9814. A_UINT32 tid_pool_free;
  9815. /* Number of times the MPDU pool freed */
  9816. A_UINT32 mpdu_pool_free;
  9817. /* Number of times the MSDU pool freed */
  9818. A_UINT32 msdu_pool_free;
  9819. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  9820. A_UINT32 msdu_queued;
  9821. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  9822. A_UINT32 msdu_recycled;
  9823. /* Number of MPDUs with invalid peer but A2 found in AST */
  9824. A_UINT32 invalid_peer_a2_in_ast;
  9825. /* Number of MPDUs with invalid peer but A3 found in AST */
  9826. A_UINT32 invalid_peer_a3_in_ast;
  9827. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  9828. A_UINT32 invalid_peer_bmc_mpdus;
  9829. /* Number of MSDUs with err attention word */
  9830. A_UINT32 rxdesc_err_att;
  9831. /* Number of MSDUs with flag of peer_idx_invalid */
  9832. A_UINT32 rxdesc_err_peer_idx_inv;
  9833. /* Number of MSDUs with flag of peer_idx_timeout */
  9834. A_UINT32 rxdesc_err_peer_idx_to;
  9835. /* Number of MSDUs with flag of overflow */
  9836. A_UINT32 rxdesc_err_ov;
  9837. /* Number of MSDUs with flag of msdu_length_err */
  9838. A_UINT32 rxdesc_err_msdu_len;
  9839. /* Number of MSDUs with flag of mpdu_length_err */
  9840. A_UINT32 rxdesc_err_mpdu_len;
  9841. /* Number of MSDUs with flag of tkip_mic_err */
  9842. A_UINT32 rxdesc_err_tkip_mic;
  9843. /* Number of MSDUs with flag of decrypt_err */
  9844. A_UINT32 rxdesc_err_decrypt;
  9845. /* Number of MSDUs with flag of fcs_err */
  9846. A_UINT32 rxdesc_err_fcs;
  9847. /* Number of Unicast (bc_mc bit is not set in attention word)
  9848. * frames with invalid peer handler
  9849. */
  9850. A_UINT32 rxdesc_uc_msdus_inv_peer;
  9851. /* Number of unicast frame directly (direct bit is set in attention word)
  9852. * to DUT with invalid peer handler
  9853. */
  9854. A_UINT32 rxdesc_direct_msdus_inv_peer;
  9855. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  9856. * frames with invalid peer handler
  9857. */
  9858. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  9859. /* Number of MSDUs dropped due to no first MSDU flag */
  9860. A_UINT32 rxdesc_no_1st_msdu;
  9861. /* Number of MSDUs droped due to ring overflow */
  9862. A_UINT32 msdu_drop_ring_ov;
  9863. /* Number of MSDUs dropped due to FC mismatch */
  9864. A_UINT32 msdu_drop_fc_mismatch;
  9865. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  9866. A_UINT32 msdu_drop_mgmt_remote_ring;
  9867. /* Number of MSDUs dropped due to errors not reported in attention word */
  9868. A_UINT32 msdu_drop_misc;
  9869. /* Number of MSDUs go to offload before reorder */
  9870. A_UINT32 offload_msdu_wal;
  9871. /* Number of data frame dropped by offload after reorder */
  9872. A_UINT32 offload_msdu_reorder;
  9873. /* Number of MPDUs with sequence number in the past and within the BA window */
  9874. A_UINT32 dup_past_within_window;
  9875. /* Number of MPDUs with sequence number in the past and outside the BA window */
  9876. A_UINT32 dup_past_outside_window;
  9877. /* Number of MSDUs with decrypt/MIC error */
  9878. A_UINT32 rxdesc_err_decrypt_mic;
  9879. /* Number of data MSDUs received on both local and remote rings */
  9880. A_UINT32 data_msdus_on_both_rings;
  9881. /* MPDUs never filled */
  9882. A_UINT32 holes_not_filled;
  9883. };
  9884. /*
  9885. * Rx Remote buffer statistics
  9886. * NB: all the fields must be defined in 4 octets size.
  9887. */
  9888. struct rx_remote_buffer_mgmt_stats {
  9889. /* Total number of MSDUs reaped for Rx processing */
  9890. A_UINT32 remote_reaped;
  9891. /* MSDUs recycled within firmware */
  9892. A_UINT32 remote_recycled;
  9893. /* MSDUs stored by Data Rx */
  9894. A_UINT32 data_rx_msdus_stored;
  9895. /* Number of HTT indications from WAL Rx MSDU */
  9896. A_UINT32 wal_rx_ind;
  9897. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  9898. A_UINT32 wal_rx_ind_unconsumed;
  9899. /* Number of HTT indications from Data Rx MSDU */
  9900. A_UINT32 data_rx_ind;
  9901. /* Number of unconsumed HTT indications from Data Rx MSDU */
  9902. A_UINT32 data_rx_ind_unconsumed;
  9903. /* Number of HTT indications from ATHBUF */
  9904. A_UINT32 athbuf_rx_ind;
  9905. /* Number of remote buffers requested for refill */
  9906. A_UINT32 refill_buf_req;
  9907. /* Number of remote buffers filled by the host */
  9908. A_UINT32 refill_buf_rsp;
  9909. /* Number of times MAC hw_index = f/w write_index */
  9910. A_INT32 mac_no_bufs;
  9911. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  9912. A_INT32 fw_indices_equal;
  9913. /* Number of times f/w finds no buffers to post */
  9914. A_INT32 host_no_bufs;
  9915. };
  9916. /*
  9917. * TXBF MU/SU packets and NDPA statistics
  9918. * NB: all the fields must be defined in 4 octets size.
  9919. */
  9920. struct rx_txbf_musu_ndpa_pkts_stats {
  9921. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  9922. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  9923. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  9924. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  9925. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  9926. A_UINT32 reserved[3]; /* must be set to 0x0 */
  9927. };
  9928. /*
  9929. * htt_dbg_stats_status -
  9930. * present - The requested stats have been delivered in full.
  9931. * This indicates that either the stats information was contained
  9932. * in its entirety within this message, or else this message
  9933. * completes the delivery of the requested stats info that was
  9934. * partially delivered through earlier STATS_CONF messages.
  9935. * partial - The requested stats have been delivered in part.
  9936. * One or more subsequent STATS_CONF messages with the same
  9937. * cookie value will be sent to deliver the remainder of the
  9938. * information.
  9939. * error - The requested stats could not be delivered, for example due
  9940. * to a shortage of memory to construct a message holding the
  9941. * requested stats.
  9942. * invalid - The requested stat type is either not recognized, or the
  9943. * target is configured to not gather the stats type in question.
  9944. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  9945. * series_done - This special value indicates that no further stats info
  9946. * elements are present within a series of stats info elems
  9947. * (within a stats upload confirmation message).
  9948. */
  9949. enum htt_dbg_stats_status {
  9950. HTT_DBG_STATS_STATUS_PRESENT = 0,
  9951. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  9952. HTT_DBG_STATS_STATUS_ERROR = 2,
  9953. HTT_DBG_STATS_STATUS_INVALID = 3,
  9954. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  9955. };
  9956. /**
  9957. * @brief target -> host statistics upload
  9958. *
  9959. * @details
  9960. * The following field definitions describe the format of the HTT target
  9961. * to host stats upload confirmation message.
  9962. * The message contains a cookie echoed from the HTT host->target stats
  9963. * upload request, which identifies which request the confirmation is
  9964. * for, and a series of tag-length-value stats information elements.
  9965. * The tag-length header for each stats info element also includes a
  9966. * status field, to indicate whether the request for the stat type in
  9967. * question was fully met, partially met, unable to be met, or invalid
  9968. * (if the stat type in question is disabled in the target).
  9969. * A special value of all 1's in this status field is used to indicate
  9970. * the end of the series of stats info elements.
  9971. *
  9972. *
  9973. * |31 16|15 8|7 5|4 0|
  9974. * |------------------------------------------------------------|
  9975. * | reserved | msg type |
  9976. * |------------------------------------------------------------|
  9977. * | cookie LSBs |
  9978. * |------------------------------------------------------------|
  9979. * | cookie MSBs |
  9980. * |------------------------------------------------------------|
  9981. * | stats entry length | reserved | S |stat type|
  9982. * |------------------------------------------------------------|
  9983. * | |
  9984. * | type-specific stats info |
  9985. * | |
  9986. * |------------------------------------------------------------|
  9987. * | stats entry length | reserved | S |stat type|
  9988. * |------------------------------------------------------------|
  9989. * | |
  9990. * | type-specific stats info |
  9991. * | |
  9992. * |------------------------------------------------------------|
  9993. * | n/a | reserved | 111 | n/a |
  9994. * |------------------------------------------------------------|
  9995. * Header fields:
  9996. * - MSG_TYPE
  9997. * Bits 7:0
  9998. * Purpose: identifies this is a statistics upload confirmation message
  9999. * Value: 0x9
  10000. * - COOKIE_LSBS
  10001. * Bits 31:0
  10002. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10003. * message with its preceding host->target stats request message.
  10004. * Value: LSBs of the opaque cookie specified by the host-side requestor
  10005. * - COOKIE_MSBS
  10006. * Bits 31:0
  10007. * Purpose: Provide a mechanism to match a target->host stats confirmation
  10008. * message with its preceding host->target stats request message.
  10009. * Value: MSBs of the opaque cookie specified by the host-side requestor
  10010. *
  10011. * Stats Information Element tag-length header fields:
  10012. * - STAT_TYPE
  10013. * Bits 4:0
  10014. * Purpose: identifies the type of statistics info held in the
  10015. * following information element
  10016. * Value: htt_dbg_stats_type
  10017. * - STATUS
  10018. * Bits 7:5
  10019. * Purpose: indicate whether the requested stats are present
  10020. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  10021. * the completion of the stats entry series
  10022. * - LENGTH
  10023. * Bits 31:16
  10024. * Purpose: indicate the stats information size
  10025. * Value: This field specifies the number of bytes of stats information
  10026. * that follows the element tag-length header.
  10027. * It is expected but not required that this length is a multiple of
  10028. * 4 bytes. Even if the length is not an integer multiple of 4, the
  10029. * subsequent stats entry header will begin on a 4-byte aligned
  10030. * boundary.
  10031. */
  10032. #define HTT_T2H_STATS_COOKIE_SIZE 8
  10033. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  10034. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  10035. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  10036. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  10037. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  10038. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  10039. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  10040. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  10041. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  10042. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  10043. do { \
  10044. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  10045. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  10046. } while (0)
  10047. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  10048. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  10049. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  10050. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  10051. do { \
  10052. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  10053. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  10054. } while (0)
  10055. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  10056. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  10057. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  10058. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  10059. do { \
  10060. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  10061. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  10062. } while (0)
  10063. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  10064. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  10065. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  10066. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  10067. #define HTT_MAX_AGGR 64
  10068. #define HTT_HL_MAX_AGGR 18
  10069. /**
  10070. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  10071. *
  10072. * @details
  10073. * The following field definitions describe the format of the HTT host
  10074. * to target frag_desc/msdu_ext bank configuration message.
  10075. * The message contains the based address and the min and max id of the
  10076. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  10077. * MSDU_EXT/FRAG_DESC.
  10078. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  10079. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  10080. * the hardware does the mapping/translation.
  10081. *
  10082. * Total banks that can be configured is configured to 16.
  10083. *
  10084. * This should be called before any TX has be initiated by the HTT
  10085. *
  10086. * |31 16|15 8|7 5|4 0|
  10087. * |------------------------------------------------------------|
  10088. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  10089. * |------------------------------------------------------------|
  10090. * | BANK0_BASE_ADDRESS (bits 31:0) |
  10091. #if HTT_PADDR64
  10092. * | BANK0_BASE_ADDRESS (bits 63:32) |
  10093. #endif
  10094. * |------------------------------------------------------------|
  10095. * | ... |
  10096. * |------------------------------------------------------------|
  10097. * | BANK15_BASE_ADDRESS (bits 31:0) |
  10098. #if HTT_PADDR64
  10099. * | BANK15_BASE_ADDRESS (bits 63:32) |
  10100. #endif
  10101. * |------------------------------------------------------------|
  10102. * | BANK0_MAX_ID | BANK0_MIN_ID |
  10103. * |------------------------------------------------------------|
  10104. * | ... |
  10105. * |------------------------------------------------------------|
  10106. * | BANK15_MAX_ID | BANK15_MIN_ID |
  10107. * |------------------------------------------------------------|
  10108. * Header fields:
  10109. * - MSG_TYPE
  10110. * Bits 7:0
  10111. * Value: 0x6
  10112. * for systems with 64-bit format for bus addresses:
  10113. * - BANKx_BASE_ADDRESS_LO
  10114. * Bits 31:0
  10115. * Purpose: Provide a mechanism to specify the base address of the
  10116. * MSDU_EXT bank physical/bus address.
  10117. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  10118. * - BANKx_BASE_ADDRESS_HI
  10119. * Bits 31:0
  10120. * Purpose: Provide a mechanism to specify the base address of the
  10121. * MSDU_EXT bank physical/bus address.
  10122. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  10123. * for systems with 32-bit format for bus addresses:
  10124. * - BANKx_BASE_ADDRESS
  10125. * Bits 31:0
  10126. * Purpose: Provide a mechanism to specify the base address of the
  10127. * MSDU_EXT bank physical/bus address.
  10128. * Value: MSDU_EXT bank physical / bus address
  10129. * - BANKx_MIN_ID
  10130. * Bits 15:0
  10131. * Purpose: Provide a mechanism to specify the min index that needs to
  10132. * mapped.
  10133. * - BANKx_MAX_ID
  10134. * Bits 31:16
  10135. * Purpose: Provide a mechanism to specify the max index that needs to
  10136. * mapped.
  10137. *
  10138. */
  10139. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  10140. * safe value.
  10141. * @note MAX supported banks is 16.
  10142. */
  10143. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  10144. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  10145. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  10146. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  10147. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  10148. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  10149. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  10150. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  10151. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  10152. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  10153. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  10154. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  10155. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  10156. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  10157. do { \
  10158. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  10159. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  10160. } while (0)
  10161. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  10162. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  10163. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  10164. do { \
  10165. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  10166. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  10167. } while (0)
  10168. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  10169. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  10170. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  10171. do { \
  10172. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  10173. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  10174. } while (0)
  10175. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  10176. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  10177. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  10178. do { \
  10179. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  10180. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  10181. } while (0)
  10182. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  10183. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  10184. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  10185. do { \
  10186. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  10187. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  10188. } while (0)
  10189. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  10190. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  10191. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  10192. do { \
  10193. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  10194. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  10195. } while (0)
  10196. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  10197. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  10198. /*
  10199. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  10200. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  10201. * addresses are stored in a XXX-bit field.
  10202. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  10203. * htt_tx_frag_desc64_bank_cfg_t structs.
  10204. */
  10205. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  10206. _paddr_bits_, \
  10207. _paddr__bank_base_address_) \
  10208. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  10209. /** word 0 \
  10210. * msg_type: 8, \
  10211. * pdev_id: 2, \
  10212. * swap: 1, \
  10213. * reserved0: 5, \
  10214. * num_banks: 8, \
  10215. * desc_size: 8; \
  10216. */ \
  10217. A_UINT32 word0; \
  10218. /* \
  10219. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  10220. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  10221. * the second A_UINT32). \
  10222. */ \
  10223. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10224. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  10225. } POSTPACK
  10226. /* define htt_tx_frag_desc32_bank_cfg_t */
  10227. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  10228. /* define htt_tx_frag_desc64_bank_cfg_t */
  10229. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  10230. /*
  10231. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  10232. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  10233. */
  10234. #if HTT_PADDR64
  10235. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  10236. #else
  10237. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  10238. #endif
  10239. /**
  10240. * @brief target -> host HTT TX Credit total count update message definition
  10241. *
  10242. *|31 16|15|14 9| 8 |7 0 |
  10243. *|---------------------+--+----------+-------+----------|
  10244. *|cur htt credit delta | Q| reserved | sign | msg type |
  10245. *|------------------------------------------------------|
  10246. *
  10247. * Header fields:
  10248. * - MSG_TYPE
  10249. * Bits 7:0
  10250. * Purpose: identifies this as a htt tx credit delta update message
  10251. * Value: 0xe
  10252. * - SIGN
  10253. * Bits 8
  10254. * identifies whether credit delta is positive or negative
  10255. * Value:
  10256. * - 0x0: credit delta is positive, rebalance in some buffers
  10257. * - 0x1: credit delta is negative, rebalance out some buffers
  10258. * - reserved
  10259. * Bits 14:9
  10260. * Value: 0x0
  10261. * - TXQ_GRP
  10262. * Bit 15
  10263. * Purpose: indicates whether any tx queue group information elements
  10264. * are appended to the tx credit update message
  10265. * Value: 0 -> no tx queue group information element is present
  10266. * 1 -> a tx queue group information element immediately follows
  10267. * - DELTA_COUNT
  10268. * Bits 31:16
  10269. * Purpose: Specify current htt credit delta absolute count
  10270. */
  10271. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  10272. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  10273. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  10274. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  10275. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  10276. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  10277. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  10278. do { \
  10279. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  10280. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  10281. } while (0)
  10282. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  10283. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  10284. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  10285. do { \
  10286. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  10287. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  10288. } while (0)
  10289. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  10290. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  10291. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  10292. do { \
  10293. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  10294. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  10295. } while (0)
  10296. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  10297. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  10298. #define HTT_TX_CREDIT_MSG_BYTES 4
  10299. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  10300. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  10301. /**
  10302. * @brief HTT WDI_IPA Operation Response Message
  10303. *
  10304. * @details
  10305. * HTT WDI_IPA Operation Response message is sent by target
  10306. * to host confirming suspend or resume operation.
  10307. * |31 24|23 16|15 8|7 0|
  10308. * |----------------+----------------+----------------+----------------|
  10309. * | op_code | Rsvd | msg_type |
  10310. * |-------------------------------------------------------------------|
  10311. * | Rsvd | Response len |
  10312. * |-------------------------------------------------------------------|
  10313. * | |
  10314. * | Response-type specific info |
  10315. * | |
  10316. * | |
  10317. * |-------------------------------------------------------------------|
  10318. * Header fields:
  10319. * - MSG_TYPE
  10320. * Bits 7:0
  10321. * Purpose: Identifies this as WDI_IPA Operation Response message
  10322. * value: = 0x13
  10323. * - OP_CODE
  10324. * Bits 31:16
  10325. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  10326. * value: = enum htt_wdi_ipa_op_code
  10327. * - RSP_LEN
  10328. * Bits 16:0
  10329. * Purpose: length for the response-type specific info
  10330. * value: = length in bytes for response-type specific info
  10331. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  10332. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  10333. */
  10334. PREPACK struct htt_wdi_ipa_op_response_t
  10335. {
  10336. /* DWORD 0: flags and meta-data */
  10337. A_UINT32
  10338. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10339. reserved1: 8,
  10340. op_code: 16;
  10341. A_UINT32
  10342. rsp_len: 16,
  10343. reserved2: 16;
  10344. } POSTPACK;
  10345. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  10346. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  10347. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  10348. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  10349. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  10350. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  10351. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  10352. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  10353. do { \
  10354. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  10355. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  10356. } while (0)
  10357. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  10358. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  10359. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  10360. do { \
  10361. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  10362. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  10363. } while (0)
  10364. enum htt_phy_mode {
  10365. htt_phy_mode_11a = 0,
  10366. htt_phy_mode_11g = 1,
  10367. htt_phy_mode_11b = 2,
  10368. htt_phy_mode_11g_only = 3,
  10369. htt_phy_mode_11na_ht20 = 4,
  10370. htt_phy_mode_11ng_ht20 = 5,
  10371. htt_phy_mode_11na_ht40 = 6,
  10372. htt_phy_mode_11ng_ht40 = 7,
  10373. htt_phy_mode_11ac_vht20 = 8,
  10374. htt_phy_mode_11ac_vht40 = 9,
  10375. htt_phy_mode_11ac_vht80 = 10,
  10376. htt_phy_mode_11ac_vht20_2g = 11,
  10377. htt_phy_mode_11ac_vht40_2g = 12,
  10378. htt_phy_mode_11ac_vht80_2g = 13,
  10379. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  10380. htt_phy_mode_11ac_vht160 = 15,
  10381. htt_phy_mode_max,
  10382. };
  10383. /**
  10384. * @brief target -> host HTT channel change indication
  10385. * @details
  10386. * Specify when a channel change occurs.
  10387. * This allows the host to precisely determine which rx frames arrived
  10388. * on the old channel and which rx frames arrived on the new channel.
  10389. *
  10390. *|31 |7 0 |
  10391. *|-------------------------------------------+----------|
  10392. *| reserved | msg type |
  10393. *|------------------------------------------------------|
  10394. *| primary_chan_center_freq_mhz |
  10395. *|------------------------------------------------------|
  10396. *| contiguous_chan1_center_freq_mhz |
  10397. *|------------------------------------------------------|
  10398. *| contiguous_chan2_center_freq_mhz |
  10399. *|------------------------------------------------------|
  10400. *| phy_mode |
  10401. *|------------------------------------------------------|
  10402. *
  10403. * Header fields:
  10404. * - MSG_TYPE
  10405. * Bits 7:0
  10406. * Purpose: identifies this as a htt channel change indication message
  10407. * Value: 0x15
  10408. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  10409. * Bits 31:0
  10410. * Purpose: identify the (center of the) new 20 MHz primary channel
  10411. * Value: center frequency of the 20 MHz primary channel, in MHz units
  10412. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  10413. * Bits 31:0
  10414. * Purpose: identify the (center of the) contiguous frequency range
  10415. * comprising the new channel.
  10416. * For example, if the new channel is a 80 MHz channel extending
  10417. * 60 MHz beyond the primary channel, this field would be 30 larger
  10418. * than the primary channel center frequency field.
  10419. * Value: center frequency of the contiguous frequency range comprising
  10420. * the full channel in MHz units
  10421. * (80+80 channels also use the CONTIG_CHAN2 field)
  10422. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  10423. * Bits 31:0
  10424. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  10425. * within a VHT 80+80 channel.
  10426. * This field is only relevant for VHT 80+80 channels.
  10427. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  10428. * channel (arbitrary value for cases besides VHT 80+80)
  10429. * - PHY_MODE
  10430. * Bits 31:0
  10431. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  10432. * and band
  10433. * Value: htt_phy_mode enum value
  10434. */
  10435. PREPACK struct htt_chan_change_t
  10436. {
  10437. /* DWORD 0: flags and meta-data */
  10438. A_UINT32
  10439. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  10440. reserved1: 24;
  10441. A_UINT32 primary_chan_center_freq_mhz;
  10442. A_UINT32 contig_chan1_center_freq_mhz;
  10443. A_UINT32 contig_chan2_center_freq_mhz;
  10444. A_UINT32 phy_mode;
  10445. } POSTPACK;
  10446. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  10447. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  10448. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  10449. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  10450. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  10451. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  10452. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  10453. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  10454. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  10455. do { \
  10456. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  10457. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  10458. } while (0)
  10459. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  10460. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  10461. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  10462. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  10463. do { \
  10464. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  10465. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  10466. } while (0)
  10467. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  10468. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  10469. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  10470. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  10471. do { \
  10472. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  10473. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  10474. } while (0)
  10475. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  10476. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  10477. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  10478. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  10479. do { \
  10480. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  10481. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  10482. } while (0)
  10483. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  10484. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  10485. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  10486. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  10487. /**
  10488. * @brief rx offload packet error message
  10489. *
  10490. * @details
  10491. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  10492. * of target payload like mic err.
  10493. *
  10494. * |31 24|23 16|15 8|7 0|
  10495. * |----------------+----------------+----------------+----------------|
  10496. * | tid | vdev_id | msg_sub_type | msg_type |
  10497. * |-------------------------------------------------------------------|
  10498. * : (sub-type dependent content) :
  10499. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10500. * Header fields:
  10501. * - msg_type
  10502. * Bits 7:0
  10503. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  10504. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  10505. * - msg_sub_type
  10506. * Bits 15:8
  10507. * Purpose: Identifies which type of rx error is reported by this message
  10508. * value: htt_rx_ofld_pkt_err_type
  10509. * - vdev_id
  10510. * Bits 23:16
  10511. * Purpose: Identifies which vdev received the erroneous rx frame
  10512. * value:
  10513. * - tid
  10514. * Bits 31:24
  10515. * Purpose: Identifies the traffic type of the rx frame
  10516. * value:
  10517. *
  10518. * - The payload fields used if the sub-type == MIC error are shown below.
  10519. * Note - MIC err is per MSDU, while PN is per MPDU.
  10520. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  10521. * with MIC err in A-MSDU case, so FW will send only one HTT message
  10522. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  10523. * instead of sending separate HTT messages for each wrong MSDU within
  10524. * the MPDU.
  10525. *
  10526. * |31 24|23 16|15 8|7 0|
  10527. * |----------------+----------------+----------------+----------------|
  10528. * | Rsvd | key_id | peer_id |
  10529. * |-------------------------------------------------------------------|
  10530. * | receiver MAC addr 31:0 |
  10531. * |-------------------------------------------------------------------|
  10532. * | Rsvd | receiver MAC addr 47:32 |
  10533. * |-------------------------------------------------------------------|
  10534. * | transmitter MAC addr 31:0 |
  10535. * |-------------------------------------------------------------------|
  10536. * | Rsvd | transmitter MAC addr 47:32 |
  10537. * |-------------------------------------------------------------------|
  10538. * | PN 31:0 |
  10539. * |-------------------------------------------------------------------|
  10540. * | Rsvd | PN 47:32 |
  10541. * |-------------------------------------------------------------------|
  10542. * - peer_id
  10543. * Bits 15:0
  10544. * Purpose: identifies which peer is frame is from
  10545. * value:
  10546. * - key_id
  10547. * Bits 23:16
  10548. * Purpose: identifies key_id of rx frame
  10549. * value:
  10550. * - RA_31_0 (receiver MAC addr 31:0)
  10551. * Bits 31:0
  10552. * Purpose: identifies by MAC address which vdev received the frame
  10553. * value: MAC address lower 4 bytes
  10554. * - RA_47_32 (receiver MAC addr 47:32)
  10555. * Bits 15:0
  10556. * Purpose: identifies by MAC address which vdev received the frame
  10557. * value: MAC address upper 2 bytes
  10558. * - TA_31_0 (transmitter MAC addr 31:0)
  10559. * Bits 31:0
  10560. * Purpose: identifies by MAC address which peer transmitted the frame
  10561. * value: MAC address lower 4 bytes
  10562. * - TA_47_32 (transmitter MAC addr 47:32)
  10563. * Bits 15:0
  10564. * Purpose: identifies by MAC address which peer transmitted the frame
  10565. * value: MAC address upper 2 bytes
  10566. * - PN_31_0
  10567. * Bits 31:0
  10568. * Purpose: Identifies pn of rx frame
  10569. * value: PN lower 4 bytes
  10570. * - PN_47_32
  10571. * Bits 15:0
  10572. * Purpose: Identifies pn of rx frame
  10573. * value:
  10574. * TKIP or CCMP: PN upper 2 bytes
  10575. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  10576. */
  10577. enum htt_rx_ofld_pkt_err_type {
  10578. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  10579. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  10580. };
  10581. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  10582. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  10583. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  10584. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  10585. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  10586. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  10587. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  10588. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  10589. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  10590. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  10591. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  10592. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  10593. do { \
  10594. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  10595. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  10596. } while (0)
  10597. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  10598. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  10599. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  10600. do { \
  10601. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  10602. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  10603. } while (0)
  10604. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  10605. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  10606. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  10607. do { \
  10608. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  10609. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  10610. } while (0)
  10611. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  10612. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  10613. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  10614. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  10615. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  10616. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  10617. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  10618. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  10619. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  10620. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  10621. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  10622. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  10623. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  10624. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  10625. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  10626. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  10627. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  10628. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  10629. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  10630. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  10631. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  10632. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  10633. do { \
  10634. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  10635. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  10636. } while (0)
  10637. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  10638. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  10639. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  10640. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  10641. do { \
  10642. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  10643. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  10644. } while (0)
  10645. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  10646. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  10647. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  10648. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  10649. do { \
  10650. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  10651. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  10652. } while (0)
  10653. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  10654. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  10655. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  10656. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  10657. do { \
  10658. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  10659. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  10660. } while (0)
  10661. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  10662. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  10663. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  10664. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  10665. do { \
  10666. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  10667. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  10668. } while (0)
  10669. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  10670. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  10671. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  10672. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  10673. do { \
  10674. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  10675. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  10676. } while (0)
  10677. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  10678. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  10679. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  10680. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  10681. do { \
  10682. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  10683. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  10684. } while (0)
  10685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  10686. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  10687. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  10688. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  10689. do { \
  10690. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  10691. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  10692. } while (0)
  10693. /**
  10694. * @brief peer rate report message
  10695. *
  10696. * @details
  10697. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  10698. * justified rate of all the peers.
  10699. *
  10700. * |31 24|23 16|15 8|7 0|
  10701. * |----------------+----------------+----------------+----------------|
  10702. * | peer_count | | msg_type |
  10703. * |-------------------------------------------------------------------|
  10704. * : Payload (variant number of peer rate report) :
  10705. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  10706. * Header fields:
  10707. * - msg_type
  10708. * Bits 7:0
  10709. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  10710. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  10711. * - reserved
  10712. * Bits 15:8
  10713. * Purpose:
  10714. * value:
  10715. * - peer_count
  10716. * Bits 31:16
  10717. * Purpose: Specify how many peer rate report elements are present in the payload.
  10718. * value:
  10719. *
  10720. * Payload:
  10721. * There are variant number of peer rate report follow the first 32 bits.
  10722. * The peer rate report is defined as follows.
  10723. *
  10724. * |31 20|19 16|15 0|
  10725. * |-----------------------+---------+---------------------------------|-
  10726. * | reserved | phy | peer_id | \
  10727. * |-------------------------------------------------------------------| -> report #0
  10728. * | rate | /
  10729. * |-----------------------+---------+---------------------------------|-
  10730. * | reserved | phy | peer_id | \
  10731. * |-------------------------------------------------------------------| -> report #1
  10732. * | rate | /
  10733. * |-----------------------+---------+---------------------------------|-
  10734. * | reserved | phy | peer_id | \
  10735. * |-------------------------------------------------------------------| -> report #2
  10736. * | rate | /
  10737. * |-------------------------------------------------------------------|-
  10738. * : :
  10739. * : :
  10740. * : :
  10741. * :-------------------------------------------------------------------:
  10742. *
  10743. * - peer_id
  10744. * Bits 15:0
  10745. * Purpose: identify the peer
  10746. * value:
  10747. * - phy
  10748. * Bits 19:16
  10749. * Purpose: identify which phy is in use
  10750. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  10751. * Please see enum htt_peer_report_phy_type for detail.
  10752. * - reserved
  10753. * Bits 31:20
  10754. * Purpose:
  10755. * value:
  10756. * - rate
  10757. * Bits 31:0
  10758. * Purpose: represent the justified rate of the peer specified by peer_id
  10759. * value:
  10760. */
  10761. enum htt_peer_rate_report_phy_type {
  10762. HTT_PEER_RATE_REPORT_11B = 0,
  10763. HTT_PEER_RATE_REPORT_11A_G,
  10764. HTT_PEER_RATE_REPORT_11N,
  10765. HTT_PEER_RATE_REPORT_11AC,
  10766. };
  10767. #define HTT_PEER_RATE_REPORT_SIZE 8
  10768. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  10769. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  10770. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  10771. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  10772. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  10773. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  10774. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  10775. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  10776. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  10777. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  10778. do { \
  10779. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  10780. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  10781. } while (0)
  10782. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  10783. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  10784. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  10785. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  10786. do { \
  10787. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  10788. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  10789. } while (0)
  10790. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  10791. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  10792. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  10793. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  10794. do { \
  10795. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  10796. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  10797. } while (0)
  10798. /**
  10799. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  10800. *
  10801. * @details
  10802. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  10803. * a flow of descriptors.
  10804. *
  10805. * This message is in TLV format and indicates the parameters to be setup a
  10806. * flow in the host. Each entry indicates that a particular flow ID is ready to
  10807. * receive descriptors from a specified pool.
  10808. *
  10809. * The message would appear as follows:
  10810. *
  10811. * |31 24|23 16|15 8|7 0|
  10812. * |----------------+----------------+----------------+----------------|
  10813. * header | reserved | num_flows | msg_type |
  10814. * |-------------------------------------------------------------------|
  10815. * | |
  10816. * : payload :
  10817. * | |
  10818. * |-------------------------------------------------------------------|
  10819. *
  10820. * The header field is one DWORD long and is interpreted as follows:
  10821. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  10822. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  10823. * this message
  10824. * b'16-31 - reserved: These bits are reserved for future use
  10825. *
  10826. * Payload:
  10827. * The payload would contain multiple objects of the following structure. Each
  10828. * object represents a flow.
  10829. *
  10830. * |31 24|23 16|15 8|7 0|
  10831. * |----------------+----------------+----------------+----------------|
  10832. * header | reserved | num_flows | msg_type |
  10833. * |-------------------------------------------------------------------|
  10834. * payload0| flow_type |
  10835. * |-------------------------------------------------------------------|
  10836. * | flow_id |
  10837. * |-------------------------------------------------------------------|
  10838. * | reserved0 | flow_pool_id |
  10839. * |-------------------------------------------------------------------|
  10840. * | reserved1 | flow_pool_size |
  10841. * |-------------------------------------------------------------------|
  10842. * | reserved2 |
  10843. * |-------------------------------------------------------------------|
  10844. * payload1| flow_type |
  10845. * |-------------------------------------------------------------------|
  10846. * | flow_id |
  10847. * |-------------------------------------------------------------------|
  10848. * | reserved0 | flow_pool_id |
  10849. * |-------------------------------------------------------------------|
  10850. * | reserved1 | flow_pool_size |
  10851. * |-------------------------------------------------------------------|
  10852. * | reserved2 |
  10853. * |-------------------------------------------------------------------|
  10854. * | . |
  10855. * | . |
  10856. * | . |
  10857. * |-------------------------------------------------------------------|
  10858. *
  10859. * Each payload is 5 DWORDS long and is interpreted as follows:
  10860. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  10861. * this flow is associated. It can be VDEV, peer,
  10862. * or tid (AC). Based on enum htt_flow_type.
  10863. *
  10864. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10865. * object. For flow_type vdev it is set to the
  10866. * vdevid, for peer it is peerid and for tid, it is
  10867. * tid_num.
  10868. *
  10869. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  10870. * in the host for this flow
  10871. * b'16:31 - reserved0: This field in reserved for the future. In case
  10872. * we have a hierarchical implementation (HCM) of
  10873. * pools, it can be used to indicate the ID of the
  10874. * parent-pool.
  10875. *
  10876. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  10877. * Descriptors for this flow will be
  10878. * allocated from this pool in the host.
  10879. * b'16:31 - reserved1: This field in reserved for the future. In case
  10880. * we have a hierarchical implementation of pools,
  10881. * it can be used to indicate the max number of
  10882. * descriptors in the pool. The b'0:15 can be used
  10883. * to indicate min number of descriptors in the
  10884. * HCM scheme.
  10885. *
  10886. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  10887. * we have a hierarchical implementation of pools,
  10888. * b'0:15 can be used to indicate the
  10889. * priority-based borrowing (PBB) threshold of
  10890. * the flow's pool. The b'16:31 are still left
  10891. * reserved.
  10892. */
  10893. enum htt_flow_type {
  10894. FLOW_TYPE_VDEV = 0,
  10895. /* Insert new flow types above this line */
  10896. };
  10897. PREPACK struct htt_flow_pool_map_payload_t {
  10898. A_UINT32 flow_type;
  10899. A_UINT32 flow_id;
  10900. A_UINT32 flow_pool_id:16,
  10901. reserved0:16;
  10902. A_UINT32 flow_pool_size:16,
  10903. reserved1:16;
  10904. A_UINT32 reserved2;
  10905. } POSTPACK;
  10906. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  10907. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  10908. (sizeof(struct htt_flow_pool_map_payload_t))
  10909. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  10910. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  10911. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  10912. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  10913. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  10914. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  10915. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  10916. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  10917. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  10918. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  10919. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  10920. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  10921. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  10922. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  10923. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  10924. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  10925. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  10926. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  10927. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  10928. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  10929. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  10930. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  10931. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  10932. do { \
  10933. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  10934. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  10935. } while (0)
  10936. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  10937. do { \
  10938. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  10939. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  10940. } while (0)
  10941. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  10942. do { \
  10943. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  10944. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  10945. } while (0)
  10946. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  10947. do { \
  10948. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  10949. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  10950. } while (0)
  10951. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  10952. do { \
  10953. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  10954. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  10955. } while (0)
  10956. /**
  10957. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  10958. *
  10959. * @details
  10960. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  10961. * down a flow of descriptors.
  10962. * This message indicates that for the flow (whose ID is provided) is wanting
  10963. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  10964. * pool of descriptors from where descriptors are being allocated for this
  10965. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  10966. * be unmapped by the host.
  10967. *
  10968. * The message would appear as follows:
  10969. *
  10970. * |31 24|23 16|15 8|7 0|
  10971. * |----------------+----------------+----------------+----------------|
  10972. * | reserved0 | msg_type |
  10973. * |-------------------------------------------------------------------|
  10974. * | flow_type |
  10975. * |-------------------------------------------------------------------|
  10976. * | flow_id |
  10977. * |-------------------------------------------------------------------|
  10978. * | reserved1 | flow_pool_id |
  10979. * |-------------------------------------------------------------------|
  10980. *
  10981. * The message is interpreted as follows:
  10982. * dword0 - b'0:7 - msg_type: This will be set to
  10983. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  10984. * b'8:31 - reserved0: Reserved for future use
  10985. *
  10986. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  10987. * this flow is associated. It can be VDEV, peer,
  10988. * or tid (AC). Based on enum htt_flow_type.
  10989. *
  10990. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  10991. * object. For flow_type vdev it is set to the
  10992. * vdevid, for peer it is peerid and for tid, it is
  10993. * tid_num.
  10994. *
  10995. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  10996. * used in the host for this flow
  10997. * b'16:31 - reserved0: This field in reserved for the future.
  10998. *
  10999. */
  11000. PREPACK struct htt_flow_pool_unmap_t {
  11001. A_UINT32 msg_type:8,
  11002. reserved0:24;
  11003. A_UINT32 flow_type;
  11004. A_UINT32 flow_id;
  11005. A_UINT32 flow_pool_id:16,
  11006. reserved1:16;
  11007. } POSTPACK;
  11008. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  11009. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  11010. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  11011. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  11012. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  11013. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  11014. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  11015. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  11016. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  11017. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  11018. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  11019. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  11020. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  11021. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  11022. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  11023. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  11024. do { \
  11025. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  11026. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  11027. } while (0)
  11028. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  11029. do { \
  11030. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  11031. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  11032. } while (0)
  11033. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  11034. do { \
  11035. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  11036. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  11037. } while (0)
  11038. /**
  11039. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  11040. *
  11041. * @details
  11042. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  11043. * SRNG ring setup is done
  11044. *
  11045. * This message indicates whether the last setup operation is successful.
  11046. * It will be sent to host when host set respose_required bit in
  11047. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  11048. * The message would appear as follows:
  11049. *
  11050. * |31 24|23 16|15 8|7 0|
  11051. * |--------------- +----------------+----------------+----------------|
  11052. * | setup_status | ring_id | pdev_id | msg_type |
  11053. * |-------------------------------------------------------------------|
  11054. *
  11055. * The message is interpreted as follows:
  11056. * dword0 - b'0:7 - msg_type: This will be set to
  11057. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  11058. * b'8:15 - pdev_id:
  11059. * 0 (for rings at SOC/UMAC level),
  11060. * 1/2/3 mac id (for rings at LMAC level)
  11061. * b'16:23 - ring_id: Identify the ring which is set up
  11062. * More details can be got from enum htt_srng_ring_id
  11063. * b'24:31 - setup_status: Indicate status of setup operation
  11064. * Refer to htt_ring_setup_status
  11065. */
  11066. PREPACK struct htt_sring_setup_done_t {
  11067. A_UINT32 msg_type: 8,
  11068. pdev_id: 8,
  11069. ring_id: 8,
  11070. setup_status: 8;
  11071. } POSTPACK;
  11072. enum htt_ring_setup_status {
  11073. htt_ring_setup_status_ok = 0,
  11074. htt_ring_setup_status_error,
  11075. };
  11076. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  11077. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  11078. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  11079. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  11080. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  11081. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  11082. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  11083. do { \
  11084. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  11085. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  11086. } while (0)
  11087. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  11088. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  11089. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  11090. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  11091. HTT_SRING_SETUP_DONE_RING_ID_S)
  11092. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  11093. do { \
  11094. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  11095. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  11096. } while (0)
  11097. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  11098. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  11099. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  11100. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  11101. HTT_SRING_SETUP_DONE_STATUS_S)
  11102. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  11103. do { \
  11104. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  11105. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  11106. } while (0)
  11107. /**
  11108. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  11109. *
  11110. * @details
  11111. * HTT TX map flow entry with tqm flow pointer
  11112. * Sent from firmware to host to add tqm flow pointer in corresponding
  11113. * flow search entry. Flow metadata is replayed back to host as part of this
  11114. * struct to enable host to find the specific flow search entry
  11115. *
  11116. * The message would appear as follows:
  11117. *
  11118. * |31 28|27 18|17 14|13 8|7 0|
  11119. * |-------+------------------------------------------+----------------|
  11120. * | rsvd0 | fse_hsh_idx | msg_type |
  11121. * |-------------------------------------------------------------------|
  11122. * | rsvd1 | tid | peer_id |
  11123. * |-------------------------------------------------------------------|
  11124. * | tqm_flow_pntr_lo |
  11125. * |-------------------------------------------------------------------|
  11126. * | tqm_flow_pntr_hi |
  11127. * |-------------------------------------------------------------------|
  11128. * | fse_meta_data |
  11129. * |-------------------------------------------------------------------|
  11130. *
  11131. * The message is interpreted as follows:
  11132. *
  11133. * dword0 - b'0:7 - msg_type: This will be set to
  11134. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  11135. *
  11136. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  11137. * for this flow entry
  11138. *
  11139. * dword0 - b'28:31 - rsvd0: Reserved for future use
  11140. *
  11141. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  11142. *
  11143. * dword1 - b'14:17 - tid
  11144. *
  11145. * dword1 - b'18:31 - rsvd1: Reserved for future use
  11146. *
  11147. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  11148. *
  11149. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  11150. *
  11151. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  11152. * given by host
  11153. */
  11154. PREPACK struct htt_tx_map_flow_info {
  11155. A_UINT32
  11156. msg_type: 8,
  11157. fse_hsh_idx: 20,
  11158. rsvd0: 4;
  11159. A_UINT32
  11160. peer_id: 14,
  11161. tid: 4,
  11162. rsvd1: 14;
  11163. A_UINT32 tqm_flow_pntr_lo;
  11164. A_UINT32 tqm_flow_pntr_hi;
  11165. struct htt_tx_flow_metadata fse_meta_data;
  11166. } POSTPACK;
  11167. /* DWORD 0 */
  11168. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  11169. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  11170. /* DWORD 1 */
  11171. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  11172. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  11173. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  11174. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  11175. /* DWORD 0 */
  11176. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  11177. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  11178. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  11179. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  11180. do { \
  11181. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  11182. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  11183. } while (0)
  11184. /* DWORD 1 */
  11185. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  11186. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  11187. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  11188. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  11189. do { \
  11190. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  11191. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  11192. } while (0)
  11193. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  11194. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  11195. HTT_TX_MAP_FLOW_INFO_TID_S)
  11196. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  11197. do { \
  11198. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  11199. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  11200. } while (0)
  11201. /*
  11202. * htt_dbg_ext_stats_status -
  11203. * present - The requested stats have been delivered in full.
  11204. * This indicates that either the stats information was contained
  11205. * in its entirety within this message, or else this message
  11206. * completes the delivery of the requested stats info that was
  11207. * partially delivered through earlier STATS_CONF messages.
  11208. * partial - The requested stats have been delivered in part.
  11209. * One or more subsequent STATS_CONF messages with the same
  11210. * cookie value will be sent to deliver the remainder of the
  11211. * information.
  11212. * error - The requested stats could not be delivered, for example due
  11213. * to a shortage of memory to construct a message holding the
  11214. * requested stats.
  11215. * invalid - The requested stat type is either not recognized, or the
  11216. * target is configured to not gather the stats type in question.
  11217. */
  11218. enum htt_dbg_ext_stats_status {
  11219. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  11220. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  11221. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  11222. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  11223. };
  11224. /**
  11225. * @brief target -> host ppdu stats upload
  11226. *
  11227. * @details
  11228. * The following field definitions describe the format of the HTT target
  11229. * to host ppdu stats indication message.
  11230. *
  11231. *
  11232. * |31 16|15 12|11 10|9 8|7 0 |
  11233. * |----------------------------------------------------------------------|
  11234. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  11235. * |----------------------------------------------------------------------|
  11236. * | ppdu_id |
  11237. * |----------------------------------------------------------------------|
  11238. * | Timestamp in us |
  11239. * |----------------------------------------------------------------------|
  11240. * | reserved |
  11241. * |----------------------------------------------------------------------|
  11242. * | type-specific stats info |
  11243. * | (see htt_ppdu_stats.h) |
  11244. * |----------------------------------------------------------------------|
  11245. * Header fields:
  11246. * - MSG_TYPE
  11247. * Bits 7:0
  11248. * Purpose: Identifies this is a PPDU STATS indication
  11249. * message.
  11250. * Value: 0x1d
  11251. * - mac_id
  11252. * Bits 9:8
  11253. * Purpose: mac_id of this ppdu_id
  11254. * Value: 0-3
  11255. * - pdev_id
  11256. * Bits 11:10
  11257. * Purpose: pdev_id of this ppdu_id
  11258. * Value: 0-3
  11259. * 0 (for rings at SOC level),
  11260. * 1/2/3 PDEV -> 0/1/2
  11261. * - payload_size
  11262. * Bits 31:16
  11263. * Purpose: total tlv size
  11264. * Value: payload_size in bytes
  11265. */
  11266. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  11267. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  11268. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  11269. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  11270. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  11271. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  11272. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  11273. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  11274. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  11275. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  11276. do { \
  11277. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  11278. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  11279. } while (0)
  11280. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  11281. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  11282. HTT_T2H_PPDU_STATS_MAC_ID_S)
  11283. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  11284. do { \
  11285. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  11286. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  11287. } while (0)
  11288. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  11289. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  11290. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  11291. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  11292. do { \
  11293. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  11294. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  11295. } while (0)
  11296. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  11297. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  11298. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  11299. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  11300. do { \
  11301. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  11302. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  11303. } while (0)
  11304. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  11305. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  11306. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  11307. /* htt_t2h_ppdu_stats_ind_hdr_t
  11308. * This struct contains the fields within the header of the
  11309. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  11310. * stats info.
  11311. * This struct assumes little-endian layout, and thus is only
  11312. * suitable for use within processors known to be little-endian
  11313. * (such as the target).
  11314. * In contrast, the above macros provide endian-portable methods
  11315. * to get and set the bitfields within this PPDU_STATS_IND header.
  11316. */
  11317. typedef struct {
  11318. A_UINT32 msg_type: 8, /* bits 7:0 */
  11319. mac_id: 2, /* bits 9:8 */
  11320. pdev_id: 2, /* bits 11:10 */
  11321. reserved1: 4, /* bits 15:12 */
  11322. payload_size: 16; /* bits 31:16 */
  11323. A_UINT32 ppdu_id;
  11324. A_UINT32 timestamp_us;
  11325. A_UINT32 reserved2;
  11326. } htt_t2h_ppdu_stats_ind_hdr_t;
  11327. /**
  11328. * @brief target -> host extended statistics upload
  11329. *
  11330. * @details
  11331. * The following field definitions describe the format of the HTT target
  11332. * to host stats upload confirmation message.
  11333. * The message contains a cookie echoed from the HTT host->target stats
  11334. * upload request, which identifies which request the confirmation is
  11335. * for, and a single stats can span over multiple HTT stats indication
  11336. * due to the HTT message size limitation so every HTT ext stats indication
  11337. * will have tag-length-value stats information elements.
  11338. * The tag-length header for each HTT stats IND message also includes a
  11339. * status field, to indicate whether the request for the stat type in
  11340. * question was fully met, partially met, unable to be met, or invalid
  11341. * (if the stat type in question is disabled in the target).
  11342. * A Done bit 1's indicate the end of the of stats info elements.
  11343. *
  11344. *
  11345. * |31 16|15 12|11|10 8|7 5|4 0|
  11346. * |--------------------------------------------------------------|
  11347. * | reserved | msg type |
  11348. * |--------------------------------------------------------------|
  11349. * | cookie LSBs |
  11350. * |--------------------------------------------------------------|
  11351. * | cookie MSBs |
  11352. * |--------------------------------------------------------------|
  11353. * | stats entry length | rsvd | D| S | stat type |
  11354. * |--------------------------------------------------------------|
  11355. * | type-specific stats info |
  11356. * | (see htt_stats.h) |
  11357. * |--------------------------------------------------------------|
  11358. * Header fields:
  11359. * - MSG_TYPE
  11360. * Bits 7:0
  11361. * Purpose: Identifies this is a extended statistics upload confirmation
  11362. * message.
  11363. * Value: 0x1c
  11364. * - COOKIE_LSBS
  11365. * Bits 31:0
  11366. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11367. * message with its preceding host->target stats request message.
  11368. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11369. * - COOKIE_MSBS
  11370. * Bits 31:0
  11371. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11372. * message with its preceding host->target stats request message.
  11373. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11374. *
  11375. * Stats Information Element tag-length header fields:
  11376. * - STAT_TYPE
  11377. * Bits 7:0
  11378. * Purpose: identifies the type of statistics info held in the
  11379. * following information element
  11380. * Value: htt_dbg_ext_stats_type
  11381. * - STATUS
  11382. * Bits 10:8
  11383. * Purpose: indicate whether the requested stats are present
  11384. * Value: htt_dbg_ext_stats_status
  11385. * - DONE
  11386. * Bits 11
  11387. * Purpose:
  11388. * Indicates the completion of the stats entry, this will be the last
  11389. * stats conf HTT segment for the requested stats type.
  11390. * Value:
  11391. * 0 -> the stats retrieval is ongoing
  11392. * 1 -> the stats retrieval is complete
  11393. * - LENGTH
  11394. * Bits 31:16
  11395. * Purpose: indicate the stats information size
  11396. * Value: This field specifies the number of bytes of stats information
  11397. * that follows the element tag-length header.
  11398. * It is expected but not required that this length is a multiple of
  11399. * 4 bytes.
  11400. */
  11401. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  11402. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  11403. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  11404. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  11405. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  11406. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  11407. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  11408. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  11409. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  11410. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11411. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  11412. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  11413. do { \
  11414. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  11415. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  11416. } while (0)
  11417. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  11418. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  11419. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  11420. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  11421. do { \
  11422. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  11423. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  11424. } while (0)
  11425. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  11426. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  11427. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  11428. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  11429. do { \
  11430. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  11431. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  11432. } while (0)
  11433. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  11434. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  11435. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  11436. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11437. do { \
  11438. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  11439. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  11440. } while (0)
  11441. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  11442. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  11443. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  11444. typedef enum {
  11445. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  11446. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  11447. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  11448. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  11449. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  11450. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  11451. /* Reserved from 128 - 255 for target internal use.*/
  11452. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  11453. } HTT_PEER_TYPE;
  11454. /** 2 word representation of MAC addr */
  11455. typedef struct {
  11456. /** upper 4 bytes of MAC address */
  11457. A_UINT32 mac_addr31to0;
  11458. /** lower 2 bytes of MAC address */
  11459. A_UINT32 mac_addr47to32;
  11460. } htt_mac_addr;
  11461. /** macro to convert MAC address from char array to HTT word format */
  11462. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  11463. (phtt_mac_addr)->mac_addr31to0 = \
  11464. (((c_macaddr)[0] << 0) | \
  11465. ((c_macaddr)[1] << 8) | \
  11466. ((c_macaddr)[2] << 16) | \
  11467. ((c_macaddr)[3] << 24)); \
  11468. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  11469. } while (0)
  11470. /**
  11471. * @brief target -> host monitor mac header indication message
  11472. *
  11473. * @details
  11474. * The following diagram shows the format of the monitor mac header message
  11475. * sent from the target to the host.
  11476. * This message is primarily sent when promiscuous rx mode is enabled.
  11477. * One message is sent per rx PPDU.
  11478. *
  11479. * |31 24|23 16|15 8|7 0|
  11480. * |-------------------------------------------------------------|
  11481. * | peer_id | reserved0 | msg_type |
  11482. * |-------------------------------------------------------------|
  11483. * | reserved1 | num_mpdu |
  11484. * |-------------------------------------------------------------|
  11485. * | struct hw_rx_desc |
  11486. * | (see wal_rx_desc.h) |
  11487. * |-------------------------------------------------------------|
  11488. * | struct ieee80211_frame_addr4 |
  11489. * | (see ieee80211_defs.h) |
  11490. * |-------------------------------------------------------------|
  11491. * | struct ieee80211_frame_addr4 |
  11492. * | (see ieee80211_defs.h) |
  11493. * |-------------------------------------------------------------|
  11494. * | ...... |
  11495. * |-------------------------------------------------------------|
  11496. *
  11497. * Header fields:
  11498. * - msg_type
  11499. * Bits 7:0
  11500. * Purpose: Identifies this is a monitor mac header indication message.
  11501. * Value: 0x20
  11502. * - peer_id
  11503. * Bits 31:16
  11504. * Purpose: Software peer id given by host during association,
  11505. * During promiscuous mode, the peer ID will be invalid (0xFF)
  11506. * for rx PPDUs received from unassociated peers.
  11507. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  11508. * - num_mpdu
  11509. * Bits 15:0
  11510. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  11511. * delivered within the message.
  11512. * Value: 1 to 32
  11513. * num_mpdu is limited to a maximum value of 32, due to buffer
  11514. * size limits. For PPDUs with more than 32 MPDUs, only the
  11515. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  11516. * the PPDU will be provided.
  11517. */
  11518. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  11519. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  11520. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  11521. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  11522. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  11523. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  11524. do { \
  11525. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  11526. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  11527. } while (0)
  11528. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  11529. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  11530. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  11531. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  11532. do { \
  11533. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  11534. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  11535. } while (0)
  11536. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  11537. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  11538. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  11539. /**
  11540. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
  11541. *
  11542. * @details
  11543. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  11544. * the flow pool associated with the specified ID is resized
  11545. *
  11546. * The message would appear as follows:
  11547. *
  11548. * |31 16|15 8|7 0|
  11549. * |---------------------------------+----------------+----------------|
  11550. * | reserved0 | Msg type |
  11551. * |-------------------------------------------------------------------|
  11552. * | flow pool new size | flow pool ID |
  11553. * |-------------------------------------------------------------------|
  11554. *
  11555. * The message is interpreted as follows:
  11556. * b'0:7 - msg_type: This will be set to
  11557. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  11558. *
  11559. * b'0:15 - flow pool ID: Existing flow pool ID
  11560. *
  11561. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  11562. *
  11563. */
  11564. PREPACK struct htt_flow_pool_resize_t {
  11565. A_UINT32 msg_type:8,
  11566. reserved0:24;
  11567. A_UINT32 flow_pool_id:16,
  11568. flow_pool_new_size:16;
  11569. } POSTPACK;
  11570. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  11571. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  11572. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  11573. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  11574. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  11575. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  11576. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  11577. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  11578. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  11579. do { \
  11580. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  11581. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  11582. } while (0)
  11583. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  11584. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  11585. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  11586. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  11587. do { \
  11588. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  11589. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  11590. } while (0)
  11591. /**
  11592. * @brief host -> target channel change message
  11593. *
  11594. * @details
  11595. * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
  11596. * to associate RX frames to correct channel they were received on.
  11597. * The following field definitions describe the format of the HTT target
  11598. * to host channel change message.
  11599. * |31 16|15 8|7 5|4 0|
  11600. * |------------------------------------------------------------|
  11601. * | reserved | MSG_TYPE |
  11602. * |------------------------------------------------------------|
  11603. * | CHAN_MHZ |
  11604. * |------------------------------------------------------------|
  11605. * | BAND_CENTER_FREQ1 |
  11606. * |------------------------------------------------------------|
  11607. * | BAND_CENTER_FREQ2 |
  11608. * |------------------------------------------------------------|
  11609. * | CHAN_PHY_MODE |
  11610. * |------------------------------------------------------------|
  11611. * Header fields:
  11612. * - MSG_TYPE
  11613. * Bits 7:0
  11614. * Value: 0xf
  11615. * - CHAN_MHZ
  11616. * Bits 31:0
  11617. * Purpose: frequency of the primary 20mhz channel.
  11618. * - BAND_CENTER_FREQ1
  11619. * Bits 31:0
  11620. * Purpose: centre frequency of the full channel.
  11621. * - BAND_CENTER_FREQ2
  11622. * Bits 31:0
  11623. * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
  11624. * - CHAN_PHY_MODE
  11625. * Bits 31:0
  11626. * Purpose: phy mode of the channel.
  11627. */
  11628. PREPACK struct htt_chan_change_msg {
  11629. A_UINT32 chan_mhz; /* frequency in mhz */
  11630. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
  11631. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  11632. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  11633. } POSTPACK;
  11634. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  11635. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  11636. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  11637. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  11638. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  11639. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  11640. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  11641. /*
  11642. * The read and write indices point to the data within the host buffer.
  11643. * Because the first 4 bytes of the host buffer is used for the read index and
  11644. * the next 4 bytes for the write index, the data itself starts at offset 8.
  11645. * The read index and write index are the byte offsets from the base of the
  11646. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  11647. * Refer the ASCII text picture below.
  11648. */
  11649. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  11650. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  11651. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  11652. /*
  11653. ***************************************************************************
  11654. *
  11655. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11656. *
  11657. ***************************************************************************
  11658. *
  11659. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  11660. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  11661. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  11662. * written into the Host memory region mentioned below.
  11663. *
  11664. * Read index is updated by the Host. At any point of time, the read index will
  11665. * indicate the index that will next be read by the Host. The read index is
  11666. * in units of bytes offset from the base of the meta-data buffer.
  11667. *
  11668. * Write index is updated by the FW. At any point of time, the write index will
  11669. * indicate from where the FW can start writing any new data. The write index is
  11670. * in units of bytes offset from the base of the meta-data buffer.
  11671. *
  11672. * If the Host is not fast enough in reading the CFR data, any new capture data
  11673. * would be dropped if there is no space left to write the new captures.
  11674. *
  11675. * The last 4 bytes of the memory region will have the magic pattern
  11676. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  11677. * not overrun the host buffer.
  11678. *
  11679. * ,--------------------. read and write indices store the
  11680. * | | byte offset from the base of the
  11681. * | ,--------+--------. meta-data buffer to the next
  11682. * | | | | location within the data buffer
  11683. * | | v v that will be read / written
  11684. * ************************************************************************
  11685. * * Read * Write * * Magic *
  11686. * * index * index * CFR data1 ...... CFR data N * pattern *
  11687. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  11688. * ************************************************************************
  11689. * |<---------- data buffer ---------->|
  11690. *
  11691. * |<----------------- meta-data buffer allocated in Host ----------------|
  11692. *
  11693. * Note:
  11694. * - Considering the 4 bytes needed to store the Read index (R) and the
  11695. * Write index (W), the initial value is as follows:
  11696. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  11697. * - Buffer empty condition:
  11698. * R = W
  11699. *
  11700. * Regarding CFR data format:
  11701. * --------------------------
  11702. *
  11703. * Each CFR tone is stored in HW as 16-bits with the following format:
  11704. * {bits[15:12], bits[11:6], bits[5:0]} =
  11705. * {unsigned exponent (4 bits),
  11706. * signed mantissa_real (6 bits),
  11707. * signed mantissa_imag (6 bits)}
  11708. *
  11709. * CFR_real = mantissa_real * 2^(exponent-5)
  11710. * CFR_imag = mantissa_imag * 2^(exponent-5)
  11711. *
  11712. *
  11713. * The CFR data is written to the 16-bit unsigned output array (buff) in
  11714. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  11715. *
  11716. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  11717. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  11718. * .
  11719. * .
  11720. * .
  11721. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  11722. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  11723. */
  11724. /* Bandwidth of peer CFR captures */
  11725. typedef enum {
  11726. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  11727. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  11728. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  11729. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  11730. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  11731. HTT_PEER_CFR_CAPTURE_BW_MAX,
  11732. } HTT_PEER_CFR_CAPTURE_BW;
  11733. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  11734. * was captured
  11735. */
  11736. typedef enum {
  11737. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  11738. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  11739. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  11740. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  11741. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  11742. } HTT_PEER_CFR_CAPTURE_MODE;
  11743. typedef enum {
  11744. /* This message type is currently used for the below purpose:
  11745. *
  11746. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  11747. * wmi_peer_cfr_capture_cmd.
  11748. * If payload_present bit is set to 0 then the associated memory region
  11749. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  11750. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  11751. * message; the CFR dump will be present at the end of the message,
  11752. * after the chan_phy_mode.
  11753. */
  11754. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  11755. /* Always keep this last */
  11756. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  11757. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  11758. /**
  11759. * @brief target -> host CFR dump completion indication message definition
  11760. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  11761. *
  11762. * @details
  11763. * The following diagram shows the format of the Channel Frequency Response
  11764. * (CFR) dump completion indication. This inidcation is sent to the Host when
  11765. * the channel capture of a peer is copied by Firmware into the Host memory
  11766. *
  11767. * **************************************************************************
  11768. *
  11769. * Message format when the CFR capture message type is
  11770. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  11771. *
  11772. * **************************************************************************
  11773. *
  11774. * |31 16|15 |8|7 0|
  11775. * |----------------------------------------------------------------|
  11776. * header: | reserved |P| msg_type |
  11777. * word 0 | | | |
  11778. * |----------------------------------------------------------------|
  11779. * payload: | cfr_capture_msg_type |
  11780. * word 1 | |
  11781. * |----------------------------------------------------------------|
  11782. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  11783. * word 2 | | | | | | | | |
  11784. * |----------------------------------------------------------------|
  11785. * | mac_addr31to0 |
  11786. * word 3 | |
  11787. * |----------------------------------------------------------------|
  11788. * | unused / reserved | mac_addr47to32 |
  11789. * word 4 | | |
  11790. * |----------------------------------------------------------------|
  11791. * | index |
  11792. * word 5 | |
  11793. * |----------------------------------------------------------------|
  11794. * | length |
  11795. * word 6 | |
  11796. * |----------------------------------------------------------------|
  11797. * | timestamp |
  11798. * word 7 | |
  11799. * |----------------------------------------------------------------|
  11800. * | counter |
  11801. * word 8 | |
  11802. * |----------------------------------------------------------------|
  11803. * | chan_mhz |
  11804. * word 9 | |
  11805. * |----------------------------------------------------------------|
  11806. * | band_center_freq1 |
  11807. * word 10 | |
  11808. * |----------------------------------------------------------------|
  11809. * | band_center_freq2 |
  11810. * word 11 | |
  11811. * |----------------------------------------------------------------|
  11812. * | chan_phy_mode |
  11813. * word 12 | |
  11814. * |----------------------------------------------------------------|
  11815. * where,
  11816. * P - payload present bit (payload_present explained below)
  11817. * req_id - memory request id (mem_req_id explained below)
  11818. * S - status field (status explained below)
  11819. * capbw - capture bandwidth (capture_bw explained below)
  11820. * mode - mode of capture (mode explained below)
  11821. * sts - space time streams (sts_count explained below)
  11822. * chbw - channel bandwidth (channel_bw explained below)
  11823. * captype - capture type (cap_type explained below)
  11824. *
  11825. * The following field definitions describe the format of the CFR dump
  11826. * completion indication sent from the target to the host
  11827. *
  11828. * Header fields:
  11829. *
  11830. * Word 0
  11831. * - msg_type
  11832. * Bits 7:0
  11833. * Purpose: Identifies this as CFR TX completion indication
  11834. * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  11835. * - payload_present
  11836. * Bit 8
  11837. * Purpose: Identifies how CFR data is sent to host
  11838. * Value: 0 - If CFR Payload is written to host memory
  11839. * 1 - If CFR Payload is sent as part of HTT message
  11840. * (This is the requirement for SDIO/USB where it is
  11841. * not possible to write CFR data to host memory)
  11842. * - reserved
  11843. * Bits 31:9
  11844. * Purpose: Reserved
  11845. * Value: 0
  11846. *
  11847. * Payload fields:
  11848. *
  11849. * Word 1
  11850. * - cfr_capture_msg_type
  11851. * Bits 31:0
  11852. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  11853. * to specify the format used for the remainder of the message
  11854. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11855. * (currently only MSG_TYPE_1 is defined)
  11856. *
  11857. * Word 2
  11858. * - mem_req_id
  11859. * Bits 6:0
  11860. * Purpose: Contain the mem request id of the region where the CFR capture
  11861. * has been stored - of type WMI_HOST_MEM_REQ_ID
  11862. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  11863. this value is invalid)
  11864. * - status
  11865. * Bit 7
  11866. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  11867. * Value: 1 (True) - Successful; 0 (False) - Not successful
  11868. * - capture_bw
  11869. * Bits 10:8
  11870. * Purpose: Carry the bandwidth of the CFR capture
  11871. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  11872. * - mode
  11873. * Bits 13:11
  11874. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  11875. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  11876. * - sts_count
  11877. * Bits 16:14
  11878. * Purpose: Carry the number of space time streams
  11879. * Value: Number of space time streams
  11880. * - channel_bw
  11881. * Bits 19:17
  11882. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  11883. * measurement
  11884. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  11885. * - cap_type
  11886. * Bits 23:20
  11887. * Purpose: Carry the type of the capture
  11888. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  11889. * - vdev_id
  11890. * Bits 31:24
  11891. * Purpose: Carry the virtual device id
  11892. * Value: vdev ID
  11893. *
  11894. * Word 3
  11895. * - mac_addr31to0
  11896. * Bits 31:0
  11897. * Purpose: Contain the bits 31:0 of the peer MAC address
  11898. * Value: Bits 31:0 of the peer MAC address
  11899. *
  11900. * Word 4
  11901. * - mac_addr47to32
  11902. * Bits 15:0
  11903. * Purpose: Contain the bits 47:32 of the peer MAC address
  11904. * Value: Bits 47:32 of the peer MAC address
  11905. *
  11906. * Word 5
  11907. * - index
  11908. * Bits 31:0
  11909. * Purpose: Contain the index at which this CFR dump was written in the Host
  11910. * allocated memory. This index is the number of bytes from the base address.
  11911. * Value: Index position
  11912. *
  11913. * Word 6
  11914. * - length
  11915. * Bits 31:0
  11916. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  11917. * Value: Length of the CFR capture of the peer
  11918. *
  11919. * Word 7
  11920. * - timestamp
  11921. * Bits 31:0
  11922. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  11923. * clock used for this timestamp is private to the target and not visible to
  11924. * the host i.e., Host can interpret only the relative timestamp deltas from
  11925. * one message to the next, but can't interpret the absolute timestamp from a
  11926. * single message.
  11927. * Value: Timestamp in microseconds
  11928. *
  11929. * Word 8
  11930. * - counter
  11931. * Bits 31:0
  11932. * Purpose: Carry the count of the current CFR capture from FW. This is
  11933. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  11934. * in host memory)
  11935. * Value: Count of the current CFR capture
  11936. *
  11937. * Word 9
  11938. * - chan_mhz
  11939. * Bits 31:0
  11940. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  11941. * Value: Primary 20 channel frequency
  11942. *
  11943. * Word 10
  11944. * - band_center_freq1
  11945. * Bits 31:0
  11946. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  11947. * Value: Center frequency 1 in MHz
  11948. *
  11949. * Word 11
  11950. * - band_center_freq2
  11951. * Bits 31:0
  11952. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  11953. * the VDEV
  11954. * 80plus80 mode
  11955. * Value: Center frequency 2 in MHz
  11956. *
  11957. * Word 12
  11958. * - chan_phy_mode
  11959. * Bits 31:0
  11960. * Purpose: Carry the phy mode of the channel, of the VDEV
  11961. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  11962. */
  11963. PREPACK struct htt_cfr_dump_ind_type_1 {
  11964. A_UINT32 mem_req_id:7,
  11965. status:1,
  11966. capture_bw:3,
  11967. mode:3,
  11968. sts_count:3,
  11969. channel_bw:3,
  11970. cap_type:4,
  11971. vdev_id:8;
  11972. htt_mac_addr addr;
  11973. A_UINT32 index;
  11974. A_UINT32 length;
  11975. A_UINT32 timestamp;
  11976. A_UINT32 counter;
  11977. struct htt_chan_change_msg chan;
  11978. } POSTPACK;
  11979. PREPACK struct htt_cfr_dump_compl_ind {
  11980. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  11981. union {
  11982. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  11983. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  11984. /* If there is a need to change the memory layout and its associated
  11985. * HTT indication format, a new CFR capture message type can be
  11986. * introduced and added into this union.
  11987. */
  11988. };
  11989. } POSTPACK;
  11990. /*
  11991. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  11992. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  11993. */
  11994. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  11995. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  11996. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  11997. do { \
  11998. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  11999. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  12000. } while(0)
  12001. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  12002. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  12003. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  12004. /*
  12005. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  12006. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  12007. */
  12008. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  12009. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  12010. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  12011. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  12012. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  12013. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  12014. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  12015. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  12016. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  12017. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  12018. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  12019. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  12020. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  12021. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  12022. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  12023. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  12024. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  12025. do { \
  12026. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  12027. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  12028. } while (0)
  12029. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  12030. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  12031. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  12032. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  12033. do { \
  12034. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  12035. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  12036. } while (0)
  12037. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  12038. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  12039. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  12040. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  12041. do { \
  12042. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  12043. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  12044. } while (0)
  12045. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  12046. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  12047. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  12048. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  12049. do { \
  12050. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  12051. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  12052. } while (0)
  12053. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  12054. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  12055. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  12056. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  12057. do { \
  12058. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  12059. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  12060. } while (0)
  12061. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  12062. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  12063. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  12064. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  12065. do { \
  12066. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  12067. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  12068. } while (0)
  12069. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  12070. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  12071. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  12072. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  12073. do { \
  12074. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  12075. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  12076. } while (0)
  12077. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  12078. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  12079. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  12080. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  12081. do { \
  12082. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  12083. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  12084. } while (0)
  12085. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  12086. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  12087. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  12088. /**
  12089. * @brief target -> host peer (PPDU) stats message
  12090. * HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12091. * @details
  12092. * This message is generated by FW when FW is sending stats to host
  12093. * about one or more PPDUs that the FW has transmitted to one or more peers.
  12094. * This message is sent autonomously by the target rather than upon request
  12095. * by the host.
  12096. * The following field definitions describe the format of the HTT target
  12097. * to host peer stats indication message.
  12098. *
  12099. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  12100. * or more PPDU stats records.
  12101. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  12102. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  12103. * then the message would start with the
  12104. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  12105. * below.
  12106. *
  12107. * |31 16|15|14|13 11|10 9|8|7 0|
  12108. * |-------------------------------------------------------------|
  12109. * | reserved |MSG_TYPE |
  12110. * |-------------------------------------------------------------|
  12111. * rec 0 | TLV header |
  12112. * rec 0 |-------------------------------------------------------------|
  12113. * rec 0 | ppdu successful bytes |
  12114. * rec 0 |-------------------------------------------------------------|
  12115. * rec 0 | ppdu retry bytes |
  12116. * rec 0 |-------------------------------------------------------------|
  12117. * rec 0 | ppdu failed bytes |
  12118. * rec 0 |-------------------------------------------------------------|
  12119. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  12120. * rec 0 |-------------------------------------------------------------|
  12121. * rec 0 | retried MSDUs | successful MSDUs |
  12122. * rec 0 |-------------------------------------------------------------|
  12123. * rec 0 | TX duration | failed MSDUs |
  12124. * rec 0 |-------------------------------------------------------------|
  12125. * ...
  12126. * |-------------------------------------------------------------|
  12127. * rec N | TLV header |
  12128. * rec N |-------------------------------------------------------------|
  12129. * rec N | ppdu successful bytes |
  12130. * rec N |-------------------------------------------------------------|
  12131. * rec N | ppdu retry bytes |
  12132. * rec N |-------------------------------------------------------------|
  12133. * rec N | ppdu failed bytes |
  12134. * rec N |-------------------------------------------------------------|
  12135. * rec N | peer id | S|SG| BW | BA |A|rate code|
  12136. * rec N |-------------------------------------------------------------|
  12137. * rec N | retried MSDUs | successful MSDUs |
  12138. * rec N |-------------------------------------------------------------|
  12139. * rec N | TX duration | failed MSDUs |
  12140. * rec N |-------------------------------------------------------------|
  12141. *
  12142. * where:
  12143. * A = is A-MPDU flag
  12144. * BA = block-ack failure flags
  12145. * BW = bandwidth spec
  12146. * SG = SGI enabled spec
  12147. * S = skipped rate ctrl
  12148. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  12149. *
  12150. * Header
  12151. * ------
  12152. * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
  12153. * dword0 - b'8:31 - reserved : Reserved for future use
  12154. *
  12155. * payload include below peer_stats information
  12156. * --------------------------------------------
  12157. * @TLV : HTT_PPDU_STATS_INFO_TLV
  12158. * @tx_success_bytes : total successful bytes in the PPDU.
  12159. * @tx_retry_bytes : total retried bytes in the PPDU.
  12160. * @tx_failed_bytes : total failed bytes in the PPDU.
  12161. * @tx_ratecode : rate code used for the PPDU.
  12162. * @is_ampdu : Indicates PPDU is AMPDU or not.
  12163. * @ba_ack_failed : BA/ACK failed for this PPDU
  12164. * b00 -> BA received
  12165. * b01 -> BA failed once
  12166. * b10 -> BA failed twice, when HW retry is enabled.
  12167. * @bw : BW
  12168. * b00 -> 20 MHz
  12169. * b01 -> 40 MHz
  12170. * b10 -> 80 MHz
  12171. * b11 -> 160 MHz (or 80+80)
  12172. * @sg : SGI enabled
  12173. * @s : skipped ratectrl
  12174. * @peer_id : peer id
  12175. * @tx_success_msdus : successful MSDUs
  12176. * @tx_retry_msdus : retried MSDUs
  12177. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  12178. * @tx_duration : Tx duration for the PPDU (microsecond units)
  12179. */
  12180. /**
  12181. * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
  12182. *
  12183. * @details
  12184. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  12185. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  12186. * This message will only be sent if the backpressure condition has existed
  12187. * continuously for an initial period (100 ms).
  12188. * Repeat messages with updated information will be sent after each
  12189. * subsequent period (100 ms) as long as the backpressure remains unabated.
  12190. * This message indicates the ring id along with current head and tail index
  12191. * locations (i.e. write and read indices).
  12192. * The backpressure time indicates the time in ms for which continous
  12193. * backpressure has been observed in the ring.
  12194. *
  12195. * The message format is as follows:
  12196. *
  12197. * |31 24|23 16|15 8|7 0|
  12198. * |----------------+----------------+----------------+----------------|
  12199. * | ring_id | ring_type | pdev_id | msg_type |
  12200. * |-------------------------------------------------------------------|
  12201. * | tail_idx | head_idx |
  12202. * |-------------------------------------------------------------------|
  12203. * | backpressure_time_ms |
  12204. * |-------------------------------------------------------------------|
  12205. *
  12206. * The message is interpreted as follows:
  12207. * dword0 - b'0:7 - msg_type: This will be set to
  12208. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  12209. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  12210. * 1, 2, 3 indicates pdev_id 0,1,2 and
  12211. the msg is for LMAC ring.
  12212. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  12213. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  12214. * htt_backpressure_lmac_ring_id. This represents
  12215. * the ring id for which continous backpressure is seen
  12216. *
  12217. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  12218. * the ring indicated by the ring_id
  12219. *
  12220. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  12221. * the ring indicated by the ring id
  12222. *
  12223. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  12224. * backpressure has been seen in the ring
  12225. * indicated by the ring_id.
  12226. * Units = milliseconds
  12227. */
  12228. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  12229. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  12230. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  12231. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  12232. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  12233. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  12234. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  12235. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  12236. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  12237. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  12238. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  12239. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  12240. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  12241. do { \
  12242. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  12243. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  12244. } while (0)
  12245. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  12246. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  12247. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  12248. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  12249. do { \
  12250. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  12251. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  12252. } while (0)
  12253. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  12254. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  12255. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  12256. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  12257. do { \
  12258. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  12259. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  12260. } while (0)
  12261. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  12262. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  12263. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  12264. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  12265. do { \
  12266. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  12267. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  12268. } while (0)
  12269. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  12270. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  12271. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  12272. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  12273. do { \
  12274. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  12275. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  12276. } while (0)
  12277. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  12278. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  12279. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  12280. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  12281. do { \
  12282. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  12283. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  12284. } while (0)
  12285. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  12286. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  12287. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  12288. enum htt_backpressure_ring_type {
  12289. HTT_SW_RING_TYPE_UMAC,
  12290. HTT_SW_RING_TYPE_LMAC,
  12291. HTT_SW_RING_TYPE_MAX,
  12292. };
  12293. /* Ring id for which the message is sent to host */
  12294. enum htt_backpressure_umac_ringid {
  12295. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  12296. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  12297. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  12298. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  12299. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  12300. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  12301. HTT_SW_RING_IDX_REO_REO2FW_RING,
  12302. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  12303. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  12304. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  12305. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  12306. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  12307. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  12308. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  12309. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  12310. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  12311. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  12312. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  12313. HTT_SW_UMAC_RING_IDX_MAX,
  12314. };
  12315. enum htt_backpressure_lmac_ringid {
  12316. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  12317. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  12318. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  12319. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  12320. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  12321. HTT_SW_RING_IDX_RXDMA2FW_RING,
  12322. HTT_SW_RING_IDX_RXDMA2SW_RING,
  12323. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  12324. HTT_SW_RING_IDX_RXDMA2REO_RING,
  12325. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  12326. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  12327. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  12328. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  12329. HTT_SW_LMAC_RING_IDX_MAX,
  12330. };
  12331. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  12332. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  12333. pdev_id: 8,
  12334. ring_type: 8, /* htt_backpressure_ring_type */
  12335. /*
  12336. * ring_id holds an enum value from either
  12337. * htt_backpressure_umac_ringid or
  12338. * htt_backpressure_lmac_ringid, based on
  12339. * the ring_type setting.
  12340. */
  12341. ring_id: 8;
  12342. A_UINT16 head_idx;
  12343. A_UINT16 tail_idx;
  12344. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  12345. } POSTPACK;
  12346. /*
  12347. * Defines two 32 bit words that can be used by the target to indicate a per
  12348. * user RU allocation and rate information.
  12349. *
  12350. * This information is currently provided in the "sw_response_reference_ptr"
  12351. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  12352. * "rx_ppdu_end_user_stats" TLV.
  12353. *
  12354. * VALID:
  12355. * The consumer of these words must explicitly check the valid bit,
  12356. * and only attempt interpretation of any of the remaining fields if
  12357. * the valid bit is set to 1.
  12358. *
  12359. * VERSION:
  12360. * The consumer of these words must also explicitly check the version bit,
  12361. * and only use the V0 definition if the VERSION field is set to 0.
  12362. *
  12363. * Version 1 is currently undefined, with the exception of the VALID and
  12364. * VERSION fields.
  12365. *
  12366. * Version 0:
  12367. *
  12368. * The fields below are duplicated per BW.
  12369. *
  12370. * The consumer must determine which BW field to use, based on the UL OFDMA
  12371. * PPDU BW indicated by HW.
  12372. *
  12373. * RU_START: RU26 start index for the user.
  12374. * Note that this is always using the RU26 index, regardless
  12375. * of the actual RU assigned to the user
  12376. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  12377. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  12378. *
  12379. * For example, 20MHz (the value in the top row is RU_START)
  12380. *
  12381. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  12382. * RU Size 1 (52): | | | | | |
  12383. * RU Size 2 (106): | | | |
  12384. * RU Size 3 (242): | |
  12385. *
  12386. * RU_SIZE: Indicates the RU size, as defined by enum
  12387. * htt_ul_ofdma_user_info_ru_size.
  12388. *
  12389. * LDPC: LDPC enabled (if 0, BCC is used)
  12390. *
  12391. * DCM: DCM enabled
  12392. *
  12393. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  12394. * |---------------------------------+--------------------------------|
  12395. * |Ver|Valid| FW internal |
  12396. * |---------------------------------+--------------------------------|
  12397. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  12398. * |---------------------------------+--------------------------------|
  12399. */
  12400. enum htt_ul_ofdma_user_info_ru_size {
  12401. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  12402. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  12403. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  12404. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  12405. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  12406. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  12407. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  12408. };
  12409. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  12410. struct htt_ul_ofdma_user_info_v0 {
  12411. A_UINT32 word0;
  12412. A_UINT32 word1;
  12413. };
  12414. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  12415. A_UINT32 w0_fw_rsvd:30; \
  12416. A_UINT32 w0_valid:1; \
  12417. A_UINT32 w0_version:1;
  12418. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  12419. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12420. };
  12421. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  12422. A_UINT32 w1_nss:3; \
  12423. A_UINT32 w1_mcs:4; \
  12424. A_UINT32 w1_ldpc:1; \
  12425. A_UINT32 w1_dcm:1; \
  12426. A_UINT32 w1_ru_start:7; \
  12427. A_UINT32 w1_ru_size:3; \
  12428. A_UINT32 w1_trig_type:4; \
  12429. A_UINT32 w1_unused:9;
  12430. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  12431. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12432. };
  12433. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  12434. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  12435. union {
  12436. A_UINT32 word0;
  12437. struct {
  12438. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  12439. };
  12440. };
  12441. union {
  12442. A_UINT32 word1;
  12443. struct {
  12444. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  12445. };
  12446. };
  12447. } POSTPACK;
  12448. enum HTT_UL_OFDMA_TRIG_TYPE {
  12449. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  12450. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  12451. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  12452. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  12453. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  12454. };
  12455. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  12456. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  12457. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  12458. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  12459. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  12460. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  12461. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  12462. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  12463. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  12464. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  12465. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  12466. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  12467. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  12468. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  12469. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  12470. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  12471. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  12472. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  12473. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  12474. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  12475. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  12476. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  12477. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  12478. /*--- word 0 ---*/
  12479. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  12480. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  12481. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  12482. do { \
  12483. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  12484. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  12485. } while (0)
  12486. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  12487. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  12488. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  12489. do { \
  12490. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  12491. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  12492. } while (0)
  12493. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  12494. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  12495. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  12496. do { \
  12497. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  12498. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  12499. } while (0)
  12500. /*--- word 1 ---*/
  12501. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  12502. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  12503. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  12504. do { \
  12505. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  12506. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  12507. } while (0)
  12508. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  12509. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  12510. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  12511. do { \
  12512. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  12513. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  12514. } while (0)
  12515. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  12516. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  12517. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  12518. do { \
  12519. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  12520. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  12521. } while (0)
  12522. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  12523. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  12524. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  12525. do { \
  12526. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  12527. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  12528. } while (0)
  12529. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  12530. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  12531. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  12532. do { \
  12533. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  12534. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  12535. } while (0)
  12536. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  12537. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  12538. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  12539. do { \
  12540. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  12541. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  12542. } while (0)
  12543. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  12544. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  12545. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  12546. do { \
  12547. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  12548. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  12549. } while (0)
  12550. /**
  12551. * @brief target -> host channel calibration data message
  12552. * @brief host -> target channel calibration data message
  12553. *
  12554. * @details
  12555. * The following field definitions describe the format of the channel
  12556. * calibration data message sent from the target to the host when
  12557. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  12558. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  12559. * The message is defined as htt_chan_caldata_msg followed by a variable
  12560. * number of 32-bit character values.
  12561. *
  12562. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  12563. * |------------------------------------------------------------------|
  12564. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  12565. * |------------------------------------------------------------------|
  12566. * | payload size | mhz |
  12567. * |------------------------------------------------------------------|
  12568. * | center frequency 2 | center frequency 1 |
  12569. * |------------------------------------------------------------------|
  12570. * | check sum |
  12571. * |------------------------------------------------------------------|
  12572. * | payload |
  12573. * |------------------------------------------------------------------|
  12574. * message info field:
  12575. * - MSG_TYPE
  12576. * Bits 7:0
  12577. * Purpose: identifies this as a channel calibration data message
  12578. * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
  12579. * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
  12580. * - SUB_TYPE
  12581. * Bits 11:8
  12582. * Purpose: T2H: indicates whether target is providing chan cal data
  12583. * to the host to store, or requesting that the host
  12584. * download previously-stored data.
  12585. * H2T: indicates whether the host is providing the requested
  12586. * channel cal data, or if it is rejecting the data
  12587. * request because it does not have the requested data.
  12588. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  12589. * - CHKSUM_VALID
  12590. * Bit 12
  12591. * Purpose: indicates if the checksum field is valid
  12592. * value:
  12593. * - FRAG
  12594. * Bit 19:16
  12595. * Purpose: indicates the fragment index for message
  12596. * value: 0 for first fragment, 1 for second fragment, ...
  12597. * - APPEND
  12598. * Bit 20
  12599. * Purpose: indicates if this is the last fragment
  12600. * value: 0 = final fragment, 1 = more fragments will be appended
  12601. *
  12602. * channel and payload size field
  12603. * - MHZ
  12604. * Bits 15:0
  12605. * Purpose: indicates the channel primary frequency
  12606. * Value:
  12607. * - PAYLOAD_SIZE
  12608. * Bits 31:16
  12609. * Purpose: indicates the bytes of calibration data in payload
  12610. * Value:
  12611. *
  12612. * center frequency field
  12613. * - CENTER FREQUENCY 1
  12614. * Bits 15:0
  12615. * Purpose: indicates the channel center frequency
  12616. * Value: channel center frequency, in MHz units
  12617. * - CENTER FREQUENCY 2
  12618. * Bits 31:16
  12619. * Purpose: indicates the secondary channel center frequency,
  12620. * only for 11acvht 80plus80 mode
  12621. * Value: secondary channel center frequeny, in MHz units, if applicable
  12622. *
  12623. * checksum field
  12624. * - CHECK_SUM
  12625. * Bits 31:0
  12626. * Purpose: check the payload data, it is just for this fragment.
  12627. * This is intended for the target to check that the channel
  12628. * calibration data returned by the host is the unmodified data
  12629. * that was previously provided to the host by the target.
  12630. * value: checksum of fragment payload
  12631. */
  12632. PREPACK struct htt_chan_caldata_msg {
  12633. /* DWORD 0: message info */
  12634. A_UINT32
  12635. msg_type: 8,
  12636. sub_type: 4 ,
  12637. chksum_valid: 1, /** 1:valid, 0:invalid */
  12638. reserved1: 3,
  12639. frag_idx: 4, /** fragment index for calibration data */
  12640. appending: 1, /** 0: no fragment appending,
  12641. * 1: extra fragment appending */
  12642. reserved2: 11;
  12643. /* DWORD 1: channel and payload size */
  12644. A_UINT32
  12645. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  12646. payload_size: 16; /** unit: bytes */
  12647. /* DWORD 2: center frequency */
  12648. A_UINT32
  12649. band_center_freq1: 16, /** Center frequency 1 in MHz */
  12650. band_center_freq2: 16; /** Center frequency 2 in MHz,
  12651. * valid only for 11acvht 80plus80 mode */
  12652. /* DWORD 3: check sum */
  12653. A_UINT32 chksum;
  12654. /* variable length for calibration data */
  12655. A_UINT32 payload[1/* or more */];
  12656. } POSTPACK;
  12657. /* T2H SUBTYPE */
  12658. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  12659. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  12660. /* H2T SUBTYPE */
  12661. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  12662. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  12663. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  12664. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  12665. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  12666. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  12667. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  12668. do { \
  12669. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  12670. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  12671. } while (0)
  12672. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  12673. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  12674. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  12675. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  12676. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  12677. do { \
  12678. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  12679. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  12680. } while (0)
  12681. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  12682. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  12683. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  12684. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  12685. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  12686. do { \
  12687. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  12688. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  12689. } while (0)
  12690. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  12691. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  12692. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  12693. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  12694. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  12695. do { \
  12696. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  12697. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  12698. } while (0)
  12699. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  12700. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  12701. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  12702. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  12703. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  12704. do { \
  12705. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  12706. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  12707. } while (0)
  12708. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  12709. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  12710. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  12711. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  12712. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  12713. do { \
  12714. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  12715. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  12716. } while (0)
  12717. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  12718. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  12719. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  12720. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  12721. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  12722. do { \
  12723. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  12724. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  12725. } while (0)
  12726. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  12727. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  12728. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  12729. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  12730. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  12731. do { \
  12732. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  12733. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  12734. } while (0)
  12735. /**
  12736. * @brief - HTT PPDU ID format
  12737. *
  12738. * @details
  12739. * The following field definitions describe the format of the PPDU ID.
  12740. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  12741. *
  12742. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  12743. * +--------------------------------------------------------------------------
  12744. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  12745. * +--------------------------------------------------------------------------
  12746. *
  12747. * sch id :Schedule command id
  12748. * Bits [11 : 0] : monotonically increasing counter to track the
  12749. * PPDU posted to a specific transmit queue.
  12750. *
  12751. * hwq_id: Hardware Queue ID.
  12752. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  12753. *
  12754. * mac_id: MAC ID
  12755. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  12756. *
  12757. * seq_idx: Sequence index.
  12758. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  12759. * a particular TXOP.
  12760. *
  12761. * tqm_cmd: HWSCH/TQM flag.
  12762. * Bit [23] : Always set to 0.
  12763. *
  12764. * seq_cmd_type: Sequence command type.
  12765. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  12766. * Refer to enum HTT_STATS_FTYPE for values.
  12767. */
  12768. PREPACK struct htt_ppdu_id {
  12769. A_UINT32
  12770. sch_id: 12,
  12771. hwq_id: 5,
  12772. mac_id: 2,
  12773. seq_idx: 2,
  12774. reserved1: 2,
  12775. tqm_cmd: 1,
  12776. seq_cmd_type: 6,
  12777. reserved2: 2;
  12778. } POSTPACK;
  12779. #define HTT_PPDU_ID_SCH_ID_S 0
  12780. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  12781. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  12782. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  12783. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  12784. do { \
  12785. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  12786. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  12787. } while (0)
  12788. #define HTT_PPDU_ID_HWQ_ID_S 12
  12789. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  12790. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  12791. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  12792. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  12793. do { \
  12794. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  12795. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  12796. } while (0)
  12797. #define HTT_PPDU_ID_MAC_ID_S 17
  12798. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  12799. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  12800. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  12801. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  12802. do { \
  12803. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  12804. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  12805. } while (0)
  12806. #define HTT_PPDU_ID_SEQ_IDX_S 19
  12807. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  12808. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  12809. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  12810. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  12811. do { \
  12812. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  12813. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  12814. } while (0)
  12815. #define HTT_PPDU_ID_TQM_CMD_S 23
  12816. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  12817. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  12818. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  12819. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  12820. do { \
  12821. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  12822. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  12823. } while (0)
  12824. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  12825. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  12826. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  12827. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  12828. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  12829. do { \
  12830. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  12831. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  12832. } while (0)
  12833. #endif