htt.h 387 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628
  1. /*
  2. * Copyright (c) 2011-2016 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 <a_types.h> /* A_UINT32 */
  34. #include <a_osapi.h> /* PREPACK, POSTPACK */
  35. #ifdef ATHR_WIN_NWF
  36. #pragma warning(disable:4214) /*bit field types other than int */
  37. #endif
  38. #include "wlan_defs.h"
  39. #include <htt_common.h>
  40. /*
  41. * Unless explicitly specified to use 64 bits to represent physical addresses
  42. * (or more precisely, bus addresses), default to 32 bits.
  43. */
  44. #ifndef HTT_PADDR64
  45. #define HTT_PADDR64 0
  46. #endif
  47. #ifndef offsetof
  48. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  49. #endif
  50. /*
  51. * HTT version history:
  52. * 1.0 initial numbered version
  53. * 1.1 modifications to STATS messages.
  54. * These modifications are not backwards compatible, but since the
  55. * STATS messages themselves are non-essential (they are for debugging),
  56. * the 1.1 version of the HTT message library as a whole is compatible
  57. * with the 1.0 version.
  58. * 1.2 reset mask IE added to STATS_REQ message
  59. * 1.3 stat config IE added to STATS_REQ message
  60. *----
  61. * 2.0 FW rx PPDU desc added to RX_IND message
  62. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  63. *----
  64. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  65. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  66. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  67. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  68. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  69. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  70. * 3.5 Added flush and fail stats in rx_reorder stats structure
  71. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  72. * 3.7 Made changes to support EOS Mac_core 3.0
  73. * 3.8 Added txq_group information element definition;
  74. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  75. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  76. * Allow buffer addresses in bus-address format to be stored as
  77. * either 32 bits or 64 bits.
  78. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  79. * messages to specify which HTT options to use.
  80. * Initial TLV options cover:
  81. * - whether to use 32 or 64 bits to represent LL bus addresses
  82. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  83. * - how many tx queue groups to use
  84. * 3.11 Expand rx debug stats:
  85. * - Expand the rx_reorder_stats struct with stats about successful and
  86. * failed rx buffer allcoations.
  87. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  88. * the supply, allocation, use, and recycling of rx buffers for the
  89. * "remote ring" of rx buffers in host member in LL systems.
  90. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  91. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  92. * 3.13 Add constants + macros to support 64-bit address format for the
  93. * tx fragments descriptor, the rx ring buffer, and the rx ring
  94. * index shadow register.
  95. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  96. * - Add htt_tx_msdu_desc_ext_t struct def.
  97. * - Add TLV to specify whether the target supports the HTT tx MSDU
  98. * extension descriptor.
  99. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  100. * "extension" bit, to specify whether a HTT tx MSDU extension
  101. * descriptor is present.
  102. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  103. * (This allows the host to obtain key information about the MSDU
  104. * from a memory location already in the cache, rather than taking a
  105. * cache miss for each MSDU by reading the HW rx descs.)
  106. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  107. * whether a copy-engine classification result is appended to TX_FRM.
  108. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  109. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  110. * tx frames in the target after the peer has already been deleted.
  111. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  112. * 3.20 Expand rx_reorder_stats.
  113. * 3.21 Add optional rx channel spec to HL RX_IND.
  114. * 3.22 Expand rx_reorder_stats
  115. * (distinguish duplicates within vs. outside block ack window)
  116. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  117. * The justified rate is calculated by two steps. The first is to multiply
  118. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  119. * by a low pass filter.
  120. * This change allows HL download scheduling to consider the WLAN rate
  121. * that will be used for transmitting the downloaded frames.
  122. * 3.24 Expand rx_reorder_stats
  123. * (add counter for decrypt / MIC errors)
  124. * 3.25 Expand rx_reorder_stats
  125. * (add counter of frames received into both local + remote rings)
  126. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  127. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  128. * 3.27 Add a new interface for flow-control. The following t2h messages have
  129. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  130. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  131. * 3.28 Add a new interface for ring interface change. The following two h2t
  132. * and one t2h messages have been included:
  133. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  134. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  135. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  136. * information elements passed from the host to a Lithium target,
  137. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  138. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  139. * targets).
  140. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  141. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  142. */
  143. #define HTT_CURRENT_VERSION_MAJOR 3
  144. #define HTT_CURRENT_VERSION_MINOR 31
  145. #define HTT_NUM_TX_FRAG_DESC 1024
  146. #define HTT_WIFI_IP_VERSION(x, y) ((x) == (y))
  147. #define HTT_CHECK_SET_VAL(field, val) \
  148. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  149. /* macros to assist in sign-extending fields from HTT messages */
  150. #define HTT_SIGN_BIT_MASK(field) \
  151. ((field ## _M + (1 << field ## _S)) >> 1)
  152. #define HTT_SIGN_BIT(_val, field) \
  153. (_val & HTT_SIGN_BIT_MASK(field))
  154. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  155. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  156. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  157. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  158. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  159. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  160. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  161. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  162. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  163. /*
  164. * TEMPORARY:
  165. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  166. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  167. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  168. * updated.
  169. */
  170. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  171. /*
  172. * TEMPORARY:
  173. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  174. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  175. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  176. * updated.
  177. */
  178. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  179. /* HTT Access Category values */
  180. enum HTT_AC_WMM {
  181. /* WMM Access Categories */
  182. HTT_AC_WMM_BE = 0x0,
  183. HTT_AC_WMM_BK = 0x1,
  184. HTT_AC_WMM_VI = 0x2,
  185. HTT_AC_WMM_VO = 0x3,
  186. /* extension Access Categories */
  187. HTT_AC_EXT_NON_QOS = 0x4,
  188. HTT_AC_EXT_UCAST_MGMT = 0x5,
  189. HTT_AC_EXT_MCAST_DATA = 0x6,
  190. HTT_AC_EXT_MCAST_MGMT = 0x7,
  191. };
  192. enum HTT_AC_WMM_MASK {
  193. /* WMM Access Categories */
  194. HTT_AC_WMM_BE_MASK = (1 << HTT_AC_WMM_BE),
  195. HTT_AC_WMM_BK_MASK = (1 << HTT_AC_WMM_BK),
  196. HTT_AC_WMM_VI_MASK = (1 << HTT_AC_WMM_VI),
  197. HTT_AC_WMM_VO_MASK = (1 << HTT_AC_WMM_VO),
  198. /* extension Access Categories */
  199. HTT_AC_EXT_NON_QOS_MASK = (1 << HTT_AC_EXT_NON_QOS),
  200. HTT_AC_EXT_UCAST_MGMT_MASK = (1 << HTT_AC_EXT_UCAST_MGMT),
  201. HTT_AC_EXT_MCAST_DATA_MASK = (1 << HTT_AC_EXT_MCAST_DATA),
  202. HTT_AC_EXT_MCAST_MGMT_MASK = (1 << HTT_AC_EXT_MCAST_MGMT),
  203. };
  204. #define HTT_AC_MASK_WMM \
  205. (HTT_AC_WMM_BE_MASK | HTT_AC_WMM_BK_MASK | \
  206. HTT_AC_WMM_VI_MASK | HTT_AC_WMM_VO_MASK)
  207. #define HTT_AC_MASK_EXT \
  208. (HTT_AC_EXT_NON_QOS_MASK | HTT_AC_EXT_UCAST_MGMT_MASK | \
  209. HTT_AC_EXT_MCAST_DATA_MASK | HTT_AC_EXT_MCAST_MGMT_MASK)
  210. #define HTT_AC_MASK_ALL (HTT_AC_MASK_WMM | HTT_AC_MASK_EXT)
  211. /*
  212. * htt_dbg_stats_type -
  213. * bit positions for each stats type within a stats type bitmask
  214. * The bitmask contains 24 bits.
  215. */
  216. enum htt_dbg_stats_type {
  217. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  218. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  219. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  220. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  221. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  222. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  223. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  224. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  225. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  226. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  227. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  228. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  229. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  230. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  231. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  232. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  233. /* bits 16-23 currently reserved */
  234. /* keep this last */
  235. HTT_DBG_NUM_STATS
  236. };
  237. /*=== HTT option selection TLVs ===
  238. * Certain HTT messages have alternatives or options.
  239. * For such cases, the host and target need to agree on which option to use.
  240. * Option specification TLVs can be appended to the VERSION_REQ and
  241. * VERSION_CONF messages to select options other than the default.
  242. * These TLVs are entirely optional - if they are not provided, there is a
  243. * well-defined default for each option. If they are provided, they can be
  244. * provided in any order. Each TLV can be present or absent independent of
  245. * the presence / absence of other TLVs.
  246. *
  247. * The HTT option selection TLVs use the following format:
  248. * |31 16|15 8|7 0|
  249. * |---------------------------------+----------------+----------------|
  250. * | value (payload) | length | tag |
  251. * |-------------------------------------------------------------------|
  252. * The value portion need not be only 2 bytes; it can be extended by any
  253. * integer number of 4-byte units. The total length of the TLV, including
  254. * the tag and length fields, must be a multiple of 4 bytes. The length
  255. * field specifies the total TLV size in 4-byte units. Thus, the typical
  256. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  257. * field, would store 0x1 in its length field, to show that the TLV occupies
  258. * a single 4-byte unit.
  259. */
  260. /*--- TLV header format - applies to all HTT option TLVs ---*/
  261. enum HTT_OPTION_TLV_TAGS {
  262. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  263. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  264. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  265. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  266. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  267. };
  268. PREPACK struct htt_option_tlv_header_t {
  269. A_UINT8 tag;
  270. A_UINT8 length;
  271. } POSTPACK;
  272. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  273. #define HTT_OPTION_TLV_TAG_S 0
  274. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  275. #define HTT_OPTION_TLV_LENGTH_S 8
  276. /*
  277. * value0 - 16 bit value field stored in word0
  278. * The TLV's value field may be longer than 2 bytes, in which case
  279. * the remainder of the value is stored in word1, word2, etc.
  280. */
  281. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  282. #define HTT_OPTION_TLV_VALUE0_S 16
  283. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  284. do { \
  285. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  286. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  287. } while (0)
  288. #define HTT_OPTION_TLV_TAG_GET(word) \
  289. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  290. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  291. do { \
  292. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  293. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  294. } while (0)
  295. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  296. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  297. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  298. do { \
  299. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  300. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  301. } while (0)
  302. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  303. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  304. /*--- format of specific HTT option TLVs ---*/
  305. /*
  306. * HTT option TLV for specifying LL bus address size
  307. * Some chips require bus addresses used by the target to access buffers
  308. * within the host's memory to be 32 bits; others require bus addresses
  309. * used by the target to access buffers within the host's memory to be
  310. * 64 bits.
  311. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  312. * a suffix to the VERSION_CONF message to specify which bus address format
  313. * the target requires.
  314. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  315. * default to providing bus addresses to the target in 32-bit format.
  316. */
  317. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  318. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  319. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  320. };
  321. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  322. struct htt_option_tlv_header_t hdr;
  323. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  324. } POSTPACK;
  325. /*
  326. * HTT option TLV for specifying whether HL systems should indicate
  327. * over-the-air tx completion for individual frames, or should instead
  328. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  329. * requests an OTA tx completion for a particular tx frame.
  330. * This option does not apply to LL systems, where the TX_COMPL_IND
  331. * is mandatory.
  332. * This option is primarily intended for HL systems in which the tx frame
  333. * downloads over the host --> target bus are as slow as or slower than
  334. * the transmissions over the WLAN PHY. For cases where the bus is faster
  335. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  336. * and consquently will send one TX_COMPL_IND message that covers several
  337. * tx frames. For cases where the WLAN PHY is faster than the bus,
  338. * the target will end up transmitting very short A-MPDUs, and consequently
  339. * sending many TX_COMPL_IND messages, which each cover a very small number
  340. * of tx frames.
  341. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  342. * a suffix to the VERSION_REQ message to request whether the host desires to
  343. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  344. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  345. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  346. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  347. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  348. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  349. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  350. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  351. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  352. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  353. * TLV.
  354. */
  355. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  356. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  357. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  358. };
  359. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  360. struct htt_option_tlv_header_t hdr;
  361. A_UINT16 hl_suppress_tx_compl_ind;/*HL_SUPPRESS_TX_COMPL_IND enum*/
  362. } POSTPACK;
  363. /*
  364. * HTT option TLV for specifying how many tx queue groups the target
  365. * may establish.
  366. * This TLV specifies the maximum value the target may send in the
  367. * txq_group_id field of any TXQ_GROUP information elements sent by
  368. * the target to the host. This allows the host to pre-allocate an
  369. * appropriate number of tx queue group structs.
  370. *
  371. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  372. * a suffix to the VERSION_REQ message to specify whether the host supports
  373. * tx queue groups at all, and if so if there is any limit on the number of
  374. * tx queue groups that the host supports.
  375. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  376. * a suffix to the VERSION_CONF message. If the host has specified in the
  377. * VER_REQ message a limit on the number of tx queue groups the host can
  378. * supprt, the target shall limit its specification of the maximum tx groups
  379. * to be no larger than this host-specified limit.
  380. *
  381. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  382. * shall preallocate 4 tx queue group structs, and the target shall not
  383. * specify a txq_group_id larger than 3.
  384. */
  385. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  386. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  387. /*
  388. * values 1 through N specify the max number of tx queue groups
  389. * the sender supports
  390. */
  391. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  392. };
  393. /* TEMPORARY backwards-compatibility alias for a typo fix -
  394. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  395. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  396. * to support the old name (with the typo) until all references to the
  397. * old name are replaced with the new name.
  398. */
  399. #define htt_option_tlv_mac_tx_queue_groups_t \
  400. htt_option_tlv_max_tx_queue_groups_t
  401. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  402. struct htt_option_tlv_header_t hdr;
  403. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  404. } POSTPACK;
  405. /*
  406. * HTT option TLV for specifying whether the target supports an extended
  407. * version of the HTT tx descriptor. If the target provides this TLV
  408. * and specifies in the TLV that the target supports an extended version
  409. * of the HTT tx descriptor, the target must check the "extension" bit in
  410. * the HTT tx descriptor, and if the extension bit is set, to expect a
  411. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  412. * descriptor. Furthermore, the target must provide room for the HTT
  413. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  414. * This option is intended for systems where the host needs to explicitly
  415. * control the transmission parameters such as tx power for individual
  416. * tx frames.
  417. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  418. * as a suffix to the VERSION_CONF message to explicitly specify whether
  419. * the target supports the HTT tx MSDU extension descriptor.
  420. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  421. * by the host as lack of target support for the HTT tx MSDU extension
  422. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  423. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  424. * the HTT tx MSDU extension descriptor.
  425. * The host is not required to provide the HTT tx MSDU extension descriptor
  426. * just because the target supports it; the target must check the
  427. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  428. * extension descriptor is present.
  429. */
  430. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  431. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  432. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  433. };
  434. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  435. struct htt_option_tlv_header_t hdr;
  436. A_UINT16 tx_msdu_desc_ext_support;/*SUPPORT_TX_MSDU_DESC_EXT enum*/
  437. } POSTPACK;
  438. /*=== host -> target messages ===============================================*/
  439. enum htt_h2t_msg_type {
  440. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  441. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  442. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  443. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  444. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  445. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  446. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  447. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  448. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  449. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  450. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /*per vdev amsdu subfrm limit*/
  451. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  452. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  453. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  454. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  455. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  456. /* keep this last */
  457. HTT_H2T_NUM_MSGS
  458. };
  459. /*
  460. * HTT host to target message type -
  461. * stored in bits 7:0 of the first word of the message
  462. */
  463. #define HTT_H2T_MSG_TYPE_M 0xff
  464. #define HTT_H2T_MSG_TYPE_S 0
  465. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  466. do { \
  467. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  468. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  469. } while (0)
  470. #define HTT_H2T_MSG_TYPE_GET(word) \
  471. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  472. /**
  473. * @brief target -> host version number request message definition
  474. *
  475. * |31 24|23 16|15 8|7 0|
  476. * |----------------+----------------+----------------+----------------|
  477. * | reserved | msg type |
  478. * |-------------------------------------------------------------------|
  479. * : option request TLV (optional) |
  480. * :...................................................................:
  481. *
  482. * The VER_REQ message may consist of a single 4-byte word, or may be
  483. * extended with TLVs that specify which HTT options the host is requesting
  484. * from the target.
  485. * The following option TLVs may be appended to the VER_REQ message:
  486. * - HL_SUPPRESS_TX_COMPL_IND
  487. * - HL_MAX_TX_QUEUE_GROUPS
  488. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  489. * may be appended to the VER_REQ message (but only one TLV of each type).
  490. *
  491. * Header fields:
  492. * - MSG_TYPE
  493. * Bits 7:0
  494. * Purpose: identifies this as a version number request message
  495. * Value: 0x0
  496. */
  497. #define HTT_VER_REQ_BYTES 4
  498. /* TBDXXX: figure out a reasonable number */
  499. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  500. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  501. /**
  502. * @brief HTT tx MSDU descriptor
  503. *
  504. * @details
  505. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  506. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  507. * the target firmware needs for the FW's tx processing, particularly
  508. * for creating the HW msdu descriptor.
  509. * The same HTT tx descriptor is used for HL and LL systems, though
  510. * a few fields within the tx descriptor are used only by LL or
  511. * only by HL.
  512. * The HTT tx descriptor is defined in two manners: by a struct with
  513. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  514. * definitions.
  515. * The target should use the struct def, for simplicitly and clarity,
  516. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  517. * neutral. Specifically, the host shall use the get/set macros built
  518. * around the mask + shift defs.
  519. */
  520. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  521. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  522. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  523. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  524. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  525. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  526. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  527. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  528. #define HTT_TX_VDEV_ID_WORD 0
  529. #define HTT_TX_VDEV_ID_MASK 0x3f
  530. #define HTT_TX_VDEV_ID_SHIFT 16
  531. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  532. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  533. #define HTT_TX_MSDU_LEN_DWORD 1
  534. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  535. /*
  536. * HTT_VAR_PADDR macros
  537. * Allow physical / bus addresses to be either a single 32-bit value,
  538. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  539. */
  540. /*
  541. * Note that in this macro A_UINT32 has been converted to
  542. * uint32_t only to address checkpath errors caused by declaring
  543. * var_name as A_UINT32.
  544. */
  545. #define HTT_VAR_PADDR32(var_name) uint32_t (var_name)
  546. #define HTT_VAR_PADDR64_LE(var_name) \
  547. struct { \
  548. /* little-endian: lo precedes hi */ \
  549. A_UINT32 lo; \
  550. A_UINT32 hi; \
  551. } var_name
  552. /*
  553. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  554. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  555. * addresses are stored in a XXX-bit field.
  556. * This macro is used to define both htt_tx_msdu_desc32_t and
  557. * htt_tx_msdu_desc64_t structs.
  558. */
  559. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  560. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  561. { \
  562. /* DWORD 0: flags and meta-data */ \
  563. A_UINT32 \
  564. msg_type:8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  565. \
  566. /* pkt_subtype - \
  567. * Detailed specification of the tx frame contents, extending the \
  568. * general specification provided by pkt_type. \
  569. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  570. *pkt_type | pkt_subtype \
  571. *============================================================== \
  572. *802.3 | bit 0:3 - Reserved \
  573. * | bit 4: 0x0 - Copy-Engine Classification Results \
  574. * | not appended to the HTT message \
  575. * | 0x1 - Copy-Engine Classification Results \
  576. * | appended to the HTT message in the \
  577. * | format: \
  578. * | [HTT tx desc, frame header, \
  579. * | CE classification results] \
  580. * | The CE classification results begin \
  581. * | at the next 4-byte boundary after \
  582. * | the frame header. \
  583. *------------+------------------------------------------------- \
  584. *Eth2 | bit 0:3 - Reserved \
  585. * | bit 4: 0x0 - Copy-Engine Classification Results \
  586. * | not appended to the HTT message \
  587. * | 0x1 - Copy-Engine Classification Results \
  588. * | appended to the HTT message. \
  589. * | See the above specification of the \
  590. * | CE classification results location. \
  591. *------------+------------------------------------------------- \
  592. *native WiFi | bit 0:3 - Reserved \
  593. * | bit 4: 0x0 - Copy-Engine Classification Results \
  594. * | not appended to the HTT message \
  595. * | 0x1 - Copy-Engine Classification Results \
  596. * | appended to the HTT message. \
  597. * | See the above specification of the \
  598. * | CE classification results location. \
  599. *------------+------------------------------------------------- \
  600. *mgmt | 0x0 - 802.11 MAC header absent \
  601. * | 0x1 - 802.11 MAC header present \
  602. *------------+------------------------------------------------- \
  603. *raw | bit 0: 0x0 - 802.11 MAC header absent \
  604. * | 0x1 - 802.11 MAC header present \
  605. * | bit 1: 0x0 - allow aggregation \
  606. * | 0x1 - don't allow aggregation \
  607. * | bit 2: 0x0 - perform encryption \
  608. * | 0x1 - don't perform encryption \
  609. * | bit 3: 0x0 - perform tx classification / queuing \
  610. * | 0x1 - don't perform tx classification; \
  611. * | insert the frame into the "misc" \
  612. * | tx queue \
  613. * | bit 4: 0x0 - Copy-Engine Classification Results \
  614. * | not appended to the HTT message \
  615. * | 0x1 - Copy-Engine Classification Results \
  616. * | appended to the HTT message. \
  617. * | See the above specification of the \
  618. * | CE classification results location. \
  619. */ \
  620. pkt_subtype:5, \
  621. \
  622. /* pkt_type - \
  623. * General specification of the tx frame contents. \
  624. * The htt_pkt_type enum should be used to specify \
  625. * and check the value of this field. \
  626. */ \
  627. pkt_type:3, \
  628. \
  629. /* vdev_id - \
  630. * ID for the vdev that is sending this tx frame. \
  631. * For certain non-standard packet types, e.g. pkt_type == raw \
  632. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  633. * This field is used primarily for determining where to queue \
  634. * broadcast and multicast frames. \
  635. */ \
  636. vdev_id:6, \
  637. /* ext_tid - \
  638. * The extended traffic ID. \
  639. * If the TID is unknown, the extended TID is set to \
  640. * HTT_TX_EXT_TID_INVALID. \
  641. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  642. * value of the QoS TID. \
  643. * If the tx frame is non-QoS data, then the extended TID is set to \
  644. * HTT_TX_EXT_TID_NON_QOS. \
  645. * If the tx frame is multicast or broadcast, then the extended TID \
  646. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  647. */ \
  648. ext_tid:5, \
  649. \
  650. /* postponed - \
  651. * This flag indicates whether the tx frame has been downloaded to \
  652. * the target before but discarded by the target, and now is being \
  653. * downloaded again; or if this is a new frame that is being \
  654. * downloaded for the first time. \
  655. * This flag allows the target to determine the correct order for \
  656. * transmitting new vs. old frames. \
  657. * value: 0 -> new frame, 1 -> re-send of a previously
  658. * sent frame \
  659. * This flag only applies to HL systems, since in LL systems, \
  660. * the tx flow control is handled entirely within the target. \
  661. */ \
  662. postponed:1, \
  663. \
  664. /* extension - \
  665. * This flag indicates whether a HTT tx MSDU extension descriptor\
  666. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor.\
  667. * \
  668. * 0x0 - no extension MSDU descriptor is present \
  669. * 0x1 - an extension MSDU descriptor immediately follows the \
  670. * regular MSDU descriptor \
  671. */ \
  672. extension:1, \
  673. \
  674. /* cksum_offload - \
  675. * This flag indicates whether checksum offload is enabled or not \
  676. * for this frame. Target FW use this flag to turn on HW checksumming \
  677. * 0x0 - No checksum offload \
  678. * 0x1 - L3 header checksum only \
  679. * 0x2 - L4 checksum only \
  680. * 0x3 - L3 header checksum + L4 checksum \
  681. */ \
  682. cksum_offload:2, \
  683. \
  684. /* tx_comp_req - \
  685. * This flag indicates whether Tx Completion \
  686. * from fw is required or not. \
  687. * This flag is only relevant if tx completion is not \
  688. * universally enabled. \
  689. * For all LL systems, tx completion is mandatory, \
  690. * so this flag will be irrelevant. \
  691. * For HL systems tx completion is optional, but HL systems in which \
  692. * the bus throughput exceeds the WLAN throughput will \
  693. * probably want to always use tx completion, and thus \
  694. * would not check this flag. \
  695. * This flag is required when tx completions are not used universally, \
  696. * but are still required for certain tx frames for which \
  697. * an OTA delivery acknowledgment is needed by the host. \
  698. * In practice, this would be for HL systems in which the \
  699. * bus throughput is less than the WLAN throughput. \
  700. * \
  701. * 0x0 - Tx Completion Indication from Fw not required \
  702. * 0x1 - Tx Completion Indication from Fw is required \
  703. */ \
  704. tx_compl_req:1; \
  705. \
  706. \
  707. /* DWORD 1: MSDU length and ID */ \
  708. A_UINT32 \
  709. len:16, /* MSDU length, in bytes */ \
  710. id:16; /* MSDU ID used to identify the MSDU to the host, \
  711. * and this id is used to calculate fragmentation \
  712. * descriptor pointer inside the target based on \
  713. * the base address, configured inside the target. \
  714. */ \
  715. \
  716. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  717. /* frags_desc_ptr - \
  718. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  719. * where the tx frame's fragments reside in memory. \
  720. * This field only applies to LL systems, since in HL systems the \
  721. * (degenerate single-fragment) fragmentation descriptor is created \
  722. * within the target. \
  723. */ \
  724. _paddr__frags_desc_ptr_; \
  725. \
  726. /* DWORD 3 (or 4): peerid, chanfreq */ \
  727. /* \
  728. * Peer ID : Target can use this value to know which peer-id packet \
  729. * destined to. \
  730. * It's intended to be specified by host in case of NAWDS. \
  731. */ \
  732. A_UINT16 peerid; \
  733. \
  734. /* \
  735. * Channel frequency: This identifies the desired channel \
  736. * frequency (in mhz) for tx frames. This is used by FW to help \
  737. * determine when it is safe to transmit or drop frames for \
  738. * off-channel operation. \
  739. * The default value of zero indicates to FW that the \
  740. * corresponding VDEV's home channel (if there is one) is \
  741. * the desired channel frequency. \
  742. */ \
  743. A_UINT16 chanfreq; \
  744. \
  745. /* Reason reserved is commented is increasing the htt
  746. * structure size leads to some wierd issues.
  747. * A_UINT32 reserved_dword3_bits0_31; \
  748. */ \
  749. } POSTPACK
  750. /* define a htt_tx_msdu_desc32_t type */
  751. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  752. /* define a htt_tx_msdu_desc64_t type */
  753. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  754. /*
  755. * Make htt_tx_msdu_desc_t be an alias for either
  756. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  757. */
  758. #if HTT_PADDR64
  759. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  760. #else
  761. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  762. #endif
  763. /* decriptor information for Management frame*/
  764. /*
  765. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  766. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  767. */
  768. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  769. extern A_UINT32 mgmt_hdr_len;
  770. PREPACK struct htt_mgmt_tx_desc_t {
  771. A_UINT32 msg_type;
  772. #if HTT_PADDR64
  773. A_UINT64 frag_paddr; /* DMAble address of the data */
  774. #else
  775. A_UINT32 frag_paddr; /* DMAble address of the data */
  776. #endif
  777. A_UINT32 desc_id; /* returned to host during completion
  778. * to free the meory*/
  779. A_UINT32 len; /* Fragment length */
  780. A_UINT32 vdev_id; /* virtual device ID */
  781. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  782. } POSTPACK;
  783. PREPACK struct htt_mgmt_tx_compl_ind {
  784. A_UINT32 desc_id;
  785. A_UINT32 status;
  786. } POSTPACK;
  787. /*
  788. * This SDU header size comes from the summation of the following:
  789. * 1. Max of:
  790. * a. Native WiFi header, for native WiFi frames: 24 bytes
  791. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  792. * b. 802.11 header, for raw frames: 36 bytes
  793. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  794. * QoS header, HT header)
  795. * c. 802.3 header, for ethernet frames: 14 bytes
  796. * (destination address, source address, ethertype / length)
  797. * 2. Max of:
  798. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  799. * b. IPv6 header, up through the Traffic Class: 2 bytes
  800. * 3. 802.1Q VLAN header: 4 bytes
  801. * 4. LLC/SNAP header: 8 bytes
  802. */
  803. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  804. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  805. #define HTT_TX_HDR_SIZE_ETHERNET 14
  806. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  807. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_nwifi,
  808. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  809. HTT_TX_HDR_SIZE_NATIVE_WIFI);
  810. A_COMPILE_TIME_ASSERT(htt_encap_hdr_size_max_check_enet,
  811. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >=
  812. HTT_TX_HDR_SIZE_ETHERNET);
  813. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  814. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  815. #define HTT_TX_HDR_SIZE_802_1Q 4
  816. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  817. #define HTT_COMMON_TX_FRM_HDR_LEN \
  818. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  819. HTT_TX_HDR_SIZE_802_1Q + \
  820. HTT_TX_HDR_SIZE_LLC_SNAP)
  821. #define HTT_HL_TX_FRM_HDR_LEN \
  822. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  823. #define HTT_LL_TX_FRM_HDR_LEN \
  824. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  825. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  826. /* dword 0 */
  827. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  828. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  829. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  830. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  831. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  832. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  833. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  834. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  835. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  836. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  837. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  838. #define HTT_TX_DESC_PKT_TYPE_S 13
  839. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  840. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  841. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  842. #define HTT_TX_DESC_VDEV_ID_S 16
  843. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  844. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  845. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  846. #define HTT_TX_DESC_EXT_TID_S 22
  847. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  848. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  849. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  850. #define HTT_TX_DESC_POSTPONED_S 27
  851. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  852. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  853. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  854. #define HTT_TX_DESC_EXTENSION_S 28
  855. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  856. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  857. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  858. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  859. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  860. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  861. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  862. #define HTT_TX_DESC_TX_COMP_S 31
  863. /* dword 1 */
  864. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  865. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  866. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  867. #define HTT_TX_DESC_FRM_LEN_S 0
  868. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  869. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  870. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  871. #define HTT_TX_DESC_FRM_ID_S 16
  872. /* dword 2 */
  873. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  874. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  875. /* for systems using 64-bit format for bus addresses */
  876. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  877. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  878. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  879. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  880. /* for systems using 32-bit format for bus addresses */
  881. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  882. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  883. /* dword 3 */
  884. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  885. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  886. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  887. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  888. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  889. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  890. #if HTT_PADDR64
  891. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  892. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  893. #else
  894. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  895. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  896. #endif
  897. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  898. #define HTT_TX_DESC_PEER_ID_S 0
  899. /*
  900. * TEMPORARY:
  901. * The original definitions for the PEER_ID fields contained typos
  902. * (with _DESC_PADDR appended to this PEER_ID field name).
  903. * Retain deprecated original names for PEER_ID fields until all code that
  904. * refers to them has been updated.
  905. */
  906. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  907. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  908. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  909. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  910. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  911. HTT_TX_DESC_PEER_ID_M
  912. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  913. HTT_TX_DESC_PEER_ID_S
  914. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  915. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  916. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  917. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  918. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  919. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  920. #if HTT_PADDR64
  921. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  922. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  923. #else
  924. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  925. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  926. #endif
  927. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  928. #define HTT_TX_DESC_CHAN_FREQ_S 16
  929. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  930. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  931. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  932. do { \
  933. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  934. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  935. } while (0)
  936. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  937. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  938. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  939. do { \
  940. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  941. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  942. } while (0)
  943. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  944. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  945. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  946. do { \
  947. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  948. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  949. } while (0)
  950. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  951. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  952. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  953. do { \
  954. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  955. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  956. } while (0)
  957. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  958. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  959. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  960. do { \
  961. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  962. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  963. } while (0)
  964. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  965. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  966. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  967. do { \
  968. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  969. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  970. } while (0)
  971. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  972. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  973. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  976. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  977. } while (0)
  978. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  979. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  980. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  981. do { \
  982. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  983. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  984. } while (0)
  985. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  986. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  987. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  988. do { \
  989. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  990. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  991. } while (0)
  992. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  993. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  994. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  997. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  998. } while (0)
  999. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1000. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1001. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1002. do { \
  1003. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1004. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1005. } while (0)
  1006. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1007. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1008. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1011. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1012. } while (0)
  1013. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1014. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1015. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1016. do { \
  1017. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1018. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1019. } while (0)
  1020. /* enums used in the HTT tx MSDU extension descriptor */
  1021. enum {
  1022. htt_tx_guard_interval_regular = 0,
  1023. htt_tx_guard_interval_short = 1,
  1024. };
  1025. enum {
  1026. htt_tx_preamble_type_ofdm = 0,
  1027. htt_tx_preamble_type_cck = 1,
  1028. htt_tx_preamble_type_ht = 2,
  1029. htt_tx_preamble_type_vht = 3,
  1030. };
  1031. enum {
  1032. htt_tx_bandwidth_5MHz = 0,
  1033. htt_tx_bandwidth_10MHz = 1,
  1034. htt_tx_bandwidth_20MHz = 2,
  1035. htt_tx_bandwidth_40MHz = 3,
  1036. htt_tx_bandwidth_80MHz = 4,
  1037. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1038. };
  1039. /**
  1040. * @brief HTT tx MSDU extension descriptor
  1041. * @details
  1042. * If the target supports HTT tx MSDU extension descriptors, the host has
  1043. * the option of appending the following struct following the regular
  1044. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1045. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1046. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1047. * tx specs for each frame.
  1048. */
  1049. PREPACK struct htt_tx_msdu_desc_ext_t {
  1050. /* DWORD 0: flags */
  1051. A_UINT32 valid_pwr:1,/* bit 0:if set, tx pwr spec is valid */
  1052. valid_mcs_mask:1,/* bit 1:if set, tx MCS mask spec is valid */
  1053. valid_nss_mask:1,/* bit 2:if set, tx Nss mask spec is valid */
  1054. valid_guard_interval:1,/* bit 3:if set, tx guard intv spec is valid */
  1055. valid_preamble_type_mask:1,/* 4:if set, tx preamble mask is valid */
  1056. valid_chainmask:1,/* bit 5:if set, tx chainmask spec is valid */
  1057. valid_retries:1,/* bit 6:if set, tx retries spec is valid */
  1058. valid_bandwidth:1,/* bit 7:if set, tx bandwidth spec is valid */
  1059. valid_expire_tsf:1,/* bit 8:if set, tx expire TSF spec is valid */
  1060. is_dsrc:1, /* bit 9:if set, MSDU is a DSRC frame */
  1061. reserved0_31_7:22; /* bits 31:10 - unused, set to 0x0 */
  1062. /* DWORD 1:tx power, tx rate, tx BW */
  1063. A_UINT32
  1064. /* pwr -
  1065. * Specify what power the tx frame needs to be transmitted at.
  1066. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1067. * The value needs to be appropriately sign-extended when extracting
  1068. * the value from the message and storing it in a variable that is
  1069. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1070. * automatically handles this sign-extension.)
  1071. * If the transmission uses multiple tx chains, this power spec is
  1072. * the total transmit power, assuming incoherent combination of
  1073. * per-chain power to produce the total power.
  1074. */
  1075. pwr:8,
  1076. /* mcs_mask -
  1077. * Specify the allowable values for MCS index (modulation and coding)
  1078. * to use for transmitting the frame.
  1079. *
  1080. * For HT / VHT preamble types, this mask directly corresponds to
  1081. * the HT or VHT MCS indices that are allowed. For each bit N set
  1082. * within the mask, MCS index N is allowed for transmitting the frame.
  1083. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1084. * rates versus OFDM rates, so the host has the option of specifying
  1085. * that the target must transmit the frame with CCK or OFDM rates
  1086. * (not HT or VHT), but leaving the decision to the target whether
  1087. * to use CCK or OFDM.
  1088. *
  1089. * For CCK and OFDM, the bits within this mask are interpreted as
  1090. * follows:
  1091. * bit 0 -> CCK 1 Mbps rate is allowed
  1092. * bit 1 -> CCK 2 Mbps rate is allowed
  1093. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1094. * bit 3 -> CCK 11 Mbps rate is allowed
  1095. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1096. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1097. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1098. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1099. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1100. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1101. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1102. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1103. *
  1104. * The MCS index specification needs to be compatible with the
  1105. * bandwidth mask specification. For example, a MCS index == 9
  1106. * specification is inconsistent with a preamble type == VHT,
  1107. * Nss == 1, and channel bandwidth == 20 MHz.
  1108. *
  1109. * Furthermore, the host has only a limited ability to specify to
  1110. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1111. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1112. */
  1113. mcs_mask:12,
  1114. /* nss_mask -
  1115. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1116. * Each bit in this mask corresponds to a Nss value:
  1117. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1118. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1119. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1120. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1121. * The values in the Nss mask must be suitable for the recipient, e.g.
  1122. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1123. * recipient which only supports 2x2 MIMO.
  1124. */
  1125. nss_mask:4,
  1126. /* guard_interval -
  1127. * Specify a htt_tx_guard_interval enum value to indicate whether
  1128. * the transmission should use a regular guard interval or a
  1129. * short guard interval.
  1130. */
  1131. guard_interval:1,
  1132. /* preamble_type_mask -
  1133. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1134. * may choose from for transmitting this frame.
  1135. * The bits in this mask correspond to the values in the
  1136. * htt_tx_preamble_type enum. For example, to allow the target
  1137. * to transmit the frame as either CCK or OFDM, this field would
  1138. * be set to
  1139. * (1 << htt_tx_preamble_type_ofdm) |
  1140. * (1 << htt_tx_preamble_type_cck)
  1141. */
  1142. preamble_type_mask:4,
  1143. reserved1_31_29:3; /* unused, set to 0x0 */
  1144. /* DWORD 2: tx chain mask, tx retries */
  1145. A_UINT32
  1146. /* chain_mask - specify which chains to transmit from */
  1147. chain_mask:4,
  1148. /* retry_limit -
  1149. * Specify the maximum number of transmissions, including the
  1150. * initial transmission, to attempt before giving up if no ack
  1151. * is received.
  1152. * If the tx rate is specified, then all retries shall use the
  1153. * same rate as the initial transmission.
  1154. * If no tx rate is specified, the target can choose whether to
  1155. * retain the original rate during the retransmissions, or to
  1156. * fall back to a more robust rate.
  1157. */
  1158. retry_limit:4,
  1159. /* bandwidth_mask -
  1160. * Specify what channel widths may be used for the transmission.
  1161. * A value of zero indicates "don't care" - the target may choose
  1162. * the transmission bandwidth.
  1163. * The bits within this mask correspond to the htt_tx_bandwidth
  1164. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1165. * The bandwidth_mask must be consistent with the
  1166. * preamble_type_mask * and mcs_mask specs, if they are
  1167. * provided. For example,
  1168. * 80 MHz and 160 MHz can only be enabled in the mask
  1169. * if preamble_type == VHT.
  1170. */
  1171. bandwidth_mask:6,
  1172. reserved2_31_14:18; /* unused, set to 0x0 */
  1173. /* DWORD 3: tx expiry time (TSF) LSBs */
  1174. A_UINT32 expire_tsf_lo;
  1175. /* DWORD 4: tx expiry time (TSF) MSBs */
  1176. A_UINT32 expire_tsf_hi;
  1177. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1178. } POSTPACK;
  1179. /* DWORD 0 */
  1180. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1181. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1182. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1183. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1184. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1185. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1186. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1187. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1188. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1189. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1190. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1191. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1192. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1193. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1194. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1195. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1196. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1197. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1198. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1199. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1200. /* DWORD 1 */
  1201. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1202. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1203. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1204. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1205. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1206. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1207. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1208. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1209. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1210. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1211. /* DWORD 2 */
  1212. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1213. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1214. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1215. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1216. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1217. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1218. /* DWORD 0 */
  1219. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1220. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1221. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1222. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1223. do { \
  1224. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1225. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1226. } while (0)
  1227. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1228. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1229. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1230. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1231. do { \
  1232. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1233. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1234. } while (0)
  1235. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1236. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1237. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1238. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1239. do { \
  1240. HTT_CHECK_SET_VAL( \
  1241. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1242. ((_var) |= ((_val) \
  1243. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1244. } while (0)
  1245. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1246. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >>\
  1247. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1248. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1249. do { \
  1250. HTT_CHECK_SET_VAL( \
  1251. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1252. ((_var) |= ((_val) \
  1253. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1254. } while (0)
  1255. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1256. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1257. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1258. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1261. ((_var) |= ((_val) << \
  1262. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1263. } while (0)
  1264. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1265. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1266. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1267. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1271. } while (0)
  1272. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1273. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1274. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1275. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1278. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1279. } while (0)
  1280. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1281. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1282. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1283. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1284. do { \
  1285. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1286. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1287. } while (0)
  1288. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1289. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1290. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1291. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1292. do { \
  1293. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1294. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1295. } while (0)
  1296. /* DWORD 1 */
  1297. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1298. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1299. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1300. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1301. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1302. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1303. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1304. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1305. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1306. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1307. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1308. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1309. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1313. } while (0)
  1314. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1315. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1316. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1317. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1321. } while (0)
  1322. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1323. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1324. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1325. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1326. do { \
  1327. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1328. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1329. } while (0)
  1330. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1331. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1332. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1333. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1334. do { \
  1335. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK,\
  1336. _val); \
  1337. ((_var) |= ((_val) << \
  1338. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1339. } while (0)
  1340. /* DWORD 2 */
  1341. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1342. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1343. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1344. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1348. } while (0)
  1349. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1350. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1351. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1352. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1353. do { \
  1354. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1355. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1356. } while (0)
  1357. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1358. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1359. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1360. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1361. do { \
  1362. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1363. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1364. } while (0)
  1365. typedef enum {
  1366. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1367. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1368. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1369. } htt_11ax_ltf_subtype_t;
  1370. typedef enum {
  1371. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1372. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1373. HTT_TX_MSDU_EXT2_DESC_PREAM_HT,
  1374. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1375. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1376. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1377. } htt_tx_ext2_preamble_type_t;
  1378. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1379. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1380. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1381. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1382. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1383. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1384. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1385. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1386. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1387. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1388. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1389. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1390. /**
  1391. * @brief HTT tx MSDU extension descriptor v2
  1392. * @details
  1393. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1394. * is received as tcl_exit_base->host_meta_info in firmware.
  1395. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1396. * are already part of tcl_exit_base.
  1397. */
  1398. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1399. /* DWORD 0: flags */
  1400. A_UINT32
  1401. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1402. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1403. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1404. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1405. valid_retries : 1, /* if set, tx retries spec is valid */
  1406. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1407. /* if set, tx dyn_bw and bw_mask are valid */
  1408. valid_bw_info : 1,
  1409. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1410. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1411. valid_key_flags : 1, /* if set, key flags is valid */
  1412. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1413. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1414. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1415. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1416. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1417. * 1 = ENCRYPT,
  1418. * 2 ~ 3 - Reserved
  1419. */
  1420. /* retry_limit -
  1421. * Specify the maximum number of transmissions, including the
  1422. * initial transmission, to attempt before giving up if no ack
  1423. * is received.
  1424. * If the tx rate is specified, then all retries shall use the
  1425. * same rate as the initial transmission.
  1426. * If no tx rate is specified, the target can choose whether to
  1427. * retain the original rate during the retransmissions, or to
  1428. * fall back to a more robust rate.
  1429. */
  1430. retry_limit : 4,
  1431. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1432. * Valid only for 11ax preamble types HE_SU
  1433. * and HE_EXT_SU
  1434. */
  1435. /* Takes enum values of htt_11ax_ltf_subtype_t
  1436. * Valid only for 11ax preamble types HE_SU
  1437. * and HE_EXT_SU
  1438. */
  1439. ltf_subtype_11ax : 2,
  1440. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1441. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1442. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1443. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1444. */
  1445. reserved0_31 : 1;
  1446. /* DWORD 1: tx power, tx rate */
  1447. A_UINT32
  1448. /* unit of the power field is 0.5 dbm
  1449. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1450. * signed value ranging from -64dbm to 63.5 dbm
  1451. */
  1452. power : 8,
  1453. /* mcs bit mask of 0 ~ 11
  1454. * Setting more than one MCS isn't currently
  1455. * supported by the target (but is supported
  1456. * in the interface in case in the future
  1457. * the target supports specifications of
  1458. * a limited set of MCS values.
  1459. */
  1460. mcs_mask : 12,
  1461. /* Nss bit mask 0 ~ 7
  1462. * Setting more than one Nss isn't currently
  1463. * supported by the target (but is supported
  1464. * in the interface in case in the future
  1465. * the target supports specifications of
  1466. * a limited set of Nss values.
  1467. */
  1468. nss_mask : 8,
  1469. /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1470. pream_type : 3,
  1471. reserved1_31 : 1;
  1472. /* DWORD 2: tx chain mask, tx retries */
  1473. A_UINT32
  1474. /* chain_mask - specify which chains to transmit from */
  1475. chain_mask : 8,
  1476. /* Key Index and related flags - used in mesh mode
  1477. * TODO: Update Enum values for key_flags
  1478. */
  1479. key_flags : 8,
  1480. /*
  1481. * Channel frequency: This identifies the desired channel
  1482. * frequency (in MHz) for tx frames. This is used by FW to help
  1483. * determine when it is safe to transmit or drop frames for
  1484. * off-channel operation.
  1485. * The default value of zero indicates to FW that the corresponding
  1486. * VDEV's home channel (if there is one) is the desired channel
  1487. * frequency.
  1488. */
  1489. chanfreq : 16;
  1490. /* DWORD 3: tx expiry time (TSF) LSBs */
  1491. A_UINT32 expire_tsf_lo;
  1492. /* DWORD 4: tx expiry time (TSF) MSBs */
  1493. A_UINT32 expire_tsf_hi;
  1494. } POSTPACK;
  1495. /* DWORD 0 */
  1496. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1497. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1498. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1499. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1500. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1501. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1502. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1503. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1504. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1505. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1506. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1507. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1508. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1509. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1510. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1511. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1512. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1513. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1514. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1515. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1516. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1517. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1518. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1519. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1520. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1521. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1522. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1523. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1524. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1525. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1526. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1527. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1528. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1529. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1530. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1531. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1532. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1533. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1534. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1535. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1536. /* DWORD 1 */
  1537. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1538. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1539. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1540. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1541. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1542. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1543. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1544. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1545. /* DWORD 2 */
  1546. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1547. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1548. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1549. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1550. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1551. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1552. /* DWORD 0 */
  1553. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1554. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1555. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1556. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1557. do { \
  1558. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1559. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S));\
  1560. } while (0)
  1561. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1562. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1563. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1564. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1565. do { \
  1566. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK,\
  1567. _val); \
  1568. ((_var) |= \
  1569. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1570. } while (0)
  1571. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1572. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1573. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1574. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1575. do { \
  1576. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK,\
  1577. _val); \
  1578. ((_var) |= \
  1579. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1580. } while (0)
  1581. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1582. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1583. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1584. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1585. do { \
  1586. HTT_CHECK_SET_VAL( \
  1587. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1588. ((_var) |= ((_val) \
  1589. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1590. } while (0)
  1591. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1592. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1593. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1594. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1595. do { \
  1596. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES,\
  1597. _val); \
  1598. ((_var) |= ((_val) << \
  1599. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1600. } while (0)
  1601. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1602. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1603. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1604. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1605. do { \
  1606. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO,\
  1607. _val); \
  1608. ((_var) |= \
  1609. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >>\
  1613. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1614. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL( \
  1617. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1618. ((_var) |= ((_val) \
  1619. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1620. } while (0)
  1621. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1622. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1623. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1624. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1625. do { \
  1626. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK,\
  1627. _val); \
  1628. ((_var) |= \
  1629. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1630. } while (0)
  1631. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1632. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1633. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1634. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1635. do { \
  1636. HTT_CHECK_SET_VAL( \
  1637. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1638. ((_var) |= \
  1639. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1643. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1644. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL( \
  1647. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1648. ((_var) |= \
  1649. ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1653. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1654. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME,\
  1657. _val); \
  1658. ((_var) |= ((_val) << \
  1659. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1663. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1664. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ,\
  1667. _val); \
  1668. ((_var) |= ((_val) << \
  1669. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S));\
  1670. } while (0)
  1671. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1672. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1673. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1674. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1675. do { \
  1676. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val);\
  1677. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S));\
  1678. } while (0)
  1679. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1680. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1681. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1682. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1683. do { \
  1684. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val);\
  1685. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S));\
  1686. } while (0)
  1687. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1688. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1689. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1690. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val);\
  1693. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S));\
  1694. } while (0)
  1695. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1696. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1697. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1698. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1699. do { \
  1700. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val);\
  1701. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S));\
  1702. } while (0)
  1703. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1704. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1705. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1706. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1707. do { \
  1708. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val);\
  1709. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S));\
  1710. } while (0)
  1711. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1712. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1713. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1714. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1715. do { \
  1716. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX,\
  1717. _val); \
  1718. ((_var) |= ((_val) << \
  1719. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1720. } while (0)
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1722. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1723. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1727. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S));\
  1728. } while (0)
  1729. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1730. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1731. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1732. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1733. do { \
  1734. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val);\
  1735. ((_var) |= ((_val) << \
  1736. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1737. } while (0)
  1738. /* DWORD 1 */
  1739. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1740. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1741. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1742. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1743. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1744. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1745. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1746. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1747. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1748. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1749. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1750. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1751. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1752. do { \
  1753. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val);\
  1754. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S));\
  1755. } while (0)
  1756. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1757. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  1758. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  1759. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  1760. do { \
  1761. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val);\
  1762. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S));\
  1763. } while (0)
  1764. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  1765. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  1766. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  1767. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  1768. do { \
  1769. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val);\
  1770. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S));\
  1771. } while (0)
  1772. /* DWORD 2 */
  1773. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  1774. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  1775. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  1776. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  1777. do { \
  1778. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val);\
  1779. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S));\
  1780. } while (0)
  1781. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  1782. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  1783. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  1784. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val);\
  1787. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S));\
  1788. } while (0)
  1789. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  1790. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  1791. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  1792. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  1793. do { \
  1794. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val);\
  1795. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S));\
  1796. } while (0)
  1797. typedef enum {
  1798. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  1799. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  1800. } htt_tcl_metadata_type;
  1801. /**
  1802. * @brief HTT TCL command number format
  1803. * @details
  1804. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  1805. * available to firmware as tcl_exit_base->tcl_status_number.
  1806. * For regular / multicast packets host will send vdev and mac id and for
  1807. * NAWDS packets, host will send peer id.
  1808. * A_UINT32 is used to avoid endianness conversion problems.
  1809. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  1810. */
  1811. typedef struct {
  1812. A_UINT32
  1813. type: 1, /* vdev_id based or peer_id based */
  1814. rsvd: 31;
  1815. } htt_tx_tcl_vdev_or_peer_t;
  1816. typedef struct {
  1817. A_UINT32
  1818. type: 1, /* vdev_id based or peer_id based */
  1819. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1820. vdev_id: 8,
  1821. pdev_id: 2,
  1822. rsvd: 20;
  1823. } htt_tx_tcl_vdev_metadata;
  1824. typedef struct {
  1825. A_UINT32
  1826. type: 1, /* vdev_id based or peer_id based */
  1827. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  1828. peer_id: 14,
  1829. rsvd: 16;
  1830. } htt_tx_tcl_peer_metadata;
  1831. PREPACK struct htt_tx_tcl_metadata {
  1832. union {
  1833. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  1834. htt_tx_tcl_vdev_metadata vdev_meta;
  1835. htt_tx_tcl_peer_metadata peer_meta;
  1836. };
  1837. } POSTPACK;
  1838. /* DWORD 0 */
  1839. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  1840. #define HTT_TX_TCL_METADATA_TYPE_S 0
  1841. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  1842. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  1843. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  1844. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  1845. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  1846. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  1847. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  1848. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  1849. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  1850. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  1851. HTT_TX_TCL_METADATA_TYPE_S)
  1852. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  1853. do { \
  1854. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val);\
  1855. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S));\
  1856. } while (0)
  1857. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  1858. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  1859. HTT_TX_TCL_METADATA_VALID_HTT_S)
  1860. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  1861. do { \
  1862. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val);\
  1863. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S));\
  1864. } while (0)
  1865. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  1866. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  1867. HTT_TX_TCL_METADATA_VDEV_ID_S)
  1868. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  1869. do { \
  1870. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val);\
  1871. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S));\
  1872. } while (0)
  1873. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  1874. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  1875. HTT_TX_TCL_METADATA_PDEV_ID_S)
  1876. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  1877. do { \
  1878. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val);\
  1879. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S));\
  1880. } while (0)
  1881. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  1882. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  1883. HTT_TX_TCL_METADATA_PEER_ID_S)
  1884. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  1885. do { \
  1886. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val);\
  1887. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S));\
  1888. } while (0)
  1889. typedef enum {
  1890. HTT_TX_FW2WBM_TX_STATUS_OK,
  1891. HTT_TX_FW2WBM_TX_STATUS_DROP,
  1892. HTT_TX_FW2WBM_TX_STATUS_TTL,
  1893. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  1894. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  1895. HTT_TX_FW2WBM_TX_STATUS_MAX
  1896. } htt_tx_fw2wbm_tx_status_t;
  1897. typedef enum {
  1898. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  1899. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  1900. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  1901. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  1902. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  1903. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  1904. } htt_tx_fw2wbm_reinject_reason_t;
  1905. /**
  1906. * @brief HTT TX WBM Completion from firmware to host
  1907. * @details
  1908. * This structure is passed from firmware to host overlayed on wbm_release_ring
  1909. * DWORD 3 and 4 for software based completions (Exception frames and
  1910. * TQM bypass frames)
  1911. * For software based completions, wbm_release_ring->release_source_module will
  1912. * be set to release_source_fw
  1913. */
  1914. PREPACK struct htt_tx_wbm_completion {
  1915. A_UINT32
  1916. sch_cmd_id: 24,
  1917. /* If set, this packet was queued via exception path */
  1918. exception_frame: 1,
  1919. rsvd0_31_25: 7;
  1920. A_UINT32
  1921. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  1922. * reception of an ACK or BA, this field indicates
  1923. * the RSSI of the received ACK or BA frame.
  1924. * When the frame is removed as result of a direct
  1925. * remove command from the SW, this field is set
  1926. * to 0x0 (which is never a valid value when real
  1927. * RSSI is available).
  1928. * Units: dB w.r.t noise floor
  1929. */
  1930. /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  1931. tx_status: 4,
  1932. /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  1933. reinject_reason: 4,
  1934. rsvd1_31_16: 16;
  1935. } POSTPACK;
  1936. /* DWORD 0 */
  1937. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  1938. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  1939. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  1940. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  1941. /* DWORD 1 */
  1942. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  1943. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  1944. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  1945. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  1946. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  1947. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  1948. /* DWORD 0 */
  1949. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  1950. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  1951. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  1952. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val);\
  1955. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S));\
  1956. } while (0)
  1957. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  1958. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  1959. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  1960. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val);\
  1963. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S));\
  1964. } while (0)
  1965. /* DWORD 1 */
  1966. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  1967. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  1968. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  1969. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val);\
  1972. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S));\
  1973. } while (0)
  1974. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  1975. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  1976. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  1977. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val);\
  1980. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S));\
  1981. } while (0)
  1982. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  1983. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  1984. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  1985. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  1986. do { \
  1987. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val);\
  1988. ((_var) |= ((_val) << \
  1989. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  1990. } while (0)
  1991. typedef enum {
  1992. TX_FLOW_PRIORITY_BE,
  1993. TX_FLOW_PRIORITY_HIGH,
  1994. TX_FLOW_PRIORITY_LOW,
  1995. } htt_tx_flow_priority_t;
  1996. typedef enum {
  1997. TX_FLOW_LATENCY_SENSITIVE,
  1998. TX_FLOW_LATENCY_INSENSITIVE,
  1999. } htt_tx_flow_latency_t;
  2000. typedef enum {
  2001. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2002. TX_FLOW_INTERACTIVE_TRAFFIC,
  2003. TX_FLOW_PERIODIC_TRAFFIC,
  2004. TX_FLOW_BURSTY_TRAFFIC,
  2005. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2006. } htt_tx_flow_traffic_pattern_t;
  2007. /**
  2008. * @brief HTT TX Flow search metadata format
  2009. * @details
  2010. * Host will set this metadata in flow table's flow search entry along with
  2011. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2012. * firmware and TQM ring if the flow search entry wins.
  2013. * This metadata is available to firmware in that first MSDU's
  2014. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2015. * to one of the available flows for specific tid and returns the tqm flow
  2016. * pointer as part of htt_tx_map_flow_info message.
  2017. */
  2018. PREPACK struct htt_tx_flow_metadata {
  2019. A_UINT32
  2020. rsvd0_1_0: 2,
  2021. tid: 4,
  2022. /* Takes enum values of htt_tx_flow_priority_t */
  2023. priority: 3,
  2024. /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2025. traffic_pattern: 3,
  2026. /* If set, tid field in this struct is the final tid.
  2027. * Else choose final tid based on latency, priority.
  2028. */
  2029. tid_override: 1,
  2030. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2031. /* Takes enum values of htt_tx_flow_latency_t */
  2032. latency_sensitive: 2,
  2033. /* Used by host to map flow metadata with flow entry */
  2034. host_flow_identifier: 16;
  2035. } POSTPACK;
  2036. /* DWORD 0 */
  2037. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2038. #define HTT_TX_FLOW_METADATA_TID_S 2
  2039. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2040. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2041. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2042. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2043. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2044. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2045. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2046. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2047. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2048. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2049. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2050. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2051. /* DWORD 0 */
  2052. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2053. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2054. HTT_TX_FLOW_METADATA_TID_S)
  2055. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2058. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2059. } while (0)
  2060. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2061. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2062. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2063. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2064. do { \
  2065. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2066. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S));\
  2067. } while (0)
  2068. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2069. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2070. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2071. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val);\
  2074. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S));\
  2075. } while (0)
  2076. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2077. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2078. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2079. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val);\
  2082. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S));\
  2083. } while (0)
  2084. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2085. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2086. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2087. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val);\
  2090. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S));\
  2091. } while (0)
  2092. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2093. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2094. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2095. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2098. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S));\
  2099. } while (0)
  2100. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2101. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2102. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2103. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2104. do { \
  2105. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val);\
  2106. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S));\
  2107. } while (0)
  2108. /**
  2109. * @brief for HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and
  2110. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
  2111. *
  2112. * @details
  2113. * HTT wds entry from source port learning
  2114. * Host will learn wds entries from rx and send this message to firmware
  2115. * to enable firmware to configure/delete AST entries for wds clients.
  2116. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2117. * and when SA's entry is deleted, firmware removes this AST entry
  2118. *
  2119. * The message would appear as follows:
  2120. *
  2121. * |31 30|29 |17 16|15 8|7 0|
  2122. * |----------------+----------------+----------------+----------------|
  2123. * | rsvd0 |PDVID| vdev_id | msg_type |
  2124. * |-------------------------------------------------------------------|
  2125. * | sa_addr_31_0 |
  2126. * |-------------------------------------------------------------------|
  2127. * | | ta_peer_id | sa_addr_47_32 |
  2128. * |-------------------------------------------------------------------|
  2129. * Where PDVID = pdev_id
  2130. *
  2131. * The message is interpreted as follows:
  2132. *
  2133. * dword0 - b'0:7 - msg_type: This will be set to
  2134. * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
  2135. * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2136. *
  2137. * dword0 - b'8:15 - vdev_id
  2138. *
  2139. * dword0 - b'16:17 - pdev_id
  2140. *
  2141. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2142. *
  2143. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2144. *
  2145. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2146. *
  2147. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2148. */
  2149. PREPACK struct htt_wds_entry {
  2150. A_UINT32
  2151. msg_type: 8,
  2152. vdev_id: 8,
  2153. pdev_id: 2,
  2154. rsvd0: 14;
  2155. A_UINT32 sa_addr_31_0;
  2156. A_UINT32
  2157. sa_addr_47_32: 16,
  2158. ta_peer_id: 14,
  2159. rsvd2: 2;
  2160. } POSTPACK;
  2161. /* DWORD 0 */
  2162. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2163. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2164. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2165. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2166. /* DWORD 2 */
  2167. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2168. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2169. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2170. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2171. /* DWORD 0 */
  2172. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2173. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2174. HTT_WDS_ENTRY_VDEV_ID_S)
  2175. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2178. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2179. } while (0)
  2180. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2181. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2182. HTT_WDS_ENTRY_PDEV_ID_S)
  2183. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2186. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2187. } while (0)
  2188. /* DWORD 2 */
  2189. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2190. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2191. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2192. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2193. do { \
  2194. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2195. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2196. } while (0)
  2197. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2198. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2199. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2200. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2201. do { \
  2202. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2203. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2204. } while (0)
  2205. /**
  2206. * @brief MAC DMA rx ring setup specification
  2207. * @details
  2208. * To allow for dynamic rx ring reconfiguration and to avoid race
  2209. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2210. * it uses. Instead, it sends this message to the target, indicating how
  2211. * the rx ring used by the host should be set up and maintained.
  2212. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2213. * specifications.
  2214. *
  2215. * |31 16|15 8|7 0|
  2216. * |---------------------------------------------------------------|
  2217. * header: | reserved | num rings | msg type |
  2218. * |---------------------------------------------------------------|
  2219. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2220. #if HTT_PADDR64
  2221. * | FW_IDX shadow register physical address (bits 63:32) |
  2222. #endif
  2223. * |---------------------------------------------------------------|
  2224. * | rx ring base physical address (bits 31:0) |
  2225. #if HTT_PADDR64
  2226. * | rx ring base physical address (bits 63:32) |
  2227. #endif
  2228. * |---------------------------------------------------------------|
  2229. * | rx ring buffer size | rx ring length |
  2230. * |---------------------------------------------------------------|
  2231. * | FW_IDX initial value | enabled flags |
  2232. * |---------------------------------------------------------------|
  2233. * | MSDU payload offset | 802.11 header offset |
  2234. * |---------------------------------------------------------------|
  2235. * | PPDU end offset | PPDU start offset |
  2236. * |---------------------------------------------------------------|
  2237. * | MPDU end offset | MPDU start offset |
  2238. * |---------------------------------------------------------------|
  2239. * | MSDU end offset | MSDU start offset |
  2240. * |---------------------------------------------------------------|
  2241. * | frag info offset | rx attention offset |
  2242. * |---------------------------------------------------------------|
  2243. * payload 2, if present, has the same format as payload 1
  2244. * Header fields:
  2245. * - MSG_TYPE
  2246. * Bits 7:0
  2247. * Purpose: identifies this as an rx ring configuration message
  2248. * Value: 0x2
  2249. * - NUM_RINGS
  2250. * Bits 15:8
  2251. * Purpose: indicates whether the host is setting up one rx ring or two
  2252. * Value: 1 or 2
  2253. * Payload:
  2254. * for systems using 64-bit format for bus addresses:
  2255. * - IDX_SHADOW_REG_PADDR_LO
  2256. * Bits 31:0
  2257. * Value: lower 4 bytes of physical address of the host's
  2258. * FW_IDX shadow register
  2259. * - IDX_SHADOW_REG_PADDR_HI
  2260. * Bits 31:0
  2261. * Value: upper 4 bytes of physical address of the host's
  2262. * FW_IDX shadow register
  2263. * - RING_BASE_PADDR_LO
  2264. * Bits 31:0
  2265. * Value: lower 4 bytes of physical address of the host's rx ring
  2266. * - RING_BASE_PADDR_HI
  2267. * Bits 31:0
  2268. * Value: uppper 4 bytes of physical address of the host's rx ring
  2269. * for systems using 32-bit format for bus addresses:
  2270. * - IDX_SHADOW_REG_PADDR
  2271. * Bits 31:0
  2272. * Value: physical address of the host's FW_IDX shadow register
  2273. * - RING_BASE_PADDR
  2274. * Bits 31:0
  2275. * Value: physical address of the host's rx ring
  2276. * - RING_LEN
  2277. * Bits 15:0
  2278. * Value: number of elements in the rx ring
  2279. * - RING_BUF_SZ
  2280. * Bits 31:16
  2281. * Value: size of the buffers referenced by the rx ring, in byte units
  2282. * - ENABLED_FLAGS
  2283. * Bits 15:0
  2284. * Value: 1-bit flags to show whether different rx fields are enabled
  2285. * bit 0: 802.11 header enabled (1) or disabled (0)
  2286. * bit 1: MSDU payload enabled (1) or disabled (0)
  2287. * bit 2: PPDU start enabled (1) or disabled (0)
  2288. * bit 3: PPDU end enabled (1) or disabled (0)
  2289. * bit 4: MPDU start enabled (1) or disabled (0)
  2290. * bit 5: MPDU end enabled (1) or disabled (0)
  2291. * bit 6: MSDU start enabled (1) or disabled (0)
  2292. * bit 7: MSDU end enabled (1) or disabled (0)
  2293. * bit 8: rx attention enabled (1) or disabled (0)
  2294. * bit 9: frag info enabled (1) or disabled (0)
  2295. * bit 10: unicast rx enabled (1) or disabled (0)
  2296. * bit 11: multicast rx enabled (1) or disabled (0)
  2297. * bit 12: ctrl rx enabled (1) or disabled (0)
  2298. * bit 13: mgmt rx enabled (1) or disabled (0)
  2299. * bit 14: null rx enabled (1) or disabled (0)
  2300. * bit 15: phy data rx enabled (1) or disabled (0)
  2301. * - IDX_INIT_VAL
  2302. * Bits 31:16
  2303. * Purpose: Specify the initial value for the FW_IDX.
  2304. * Value: the number of buffers initially present in the host's rx ring
  2305. * - OFFSET_802_11_HDR
  2306. * Bits 15:0
  2307. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2308. * - OFFSET_MSDU_PAYLOAD
  2309. * Bits 31:16
  2310. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2311. * - OFFSET_PPDU_START
  2312. * Bits 15:0
  2313. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2314. * - OFFSET_PPDU_END
  2315. * Bits 31:16
  2316. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2317. * - OFFSET_MPDU_START
  2318. * Bits 15:0
  2319. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2320. * - OFFSET_MPDU_END
  2321. * Bits 31:16
  2322. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2323. * - OFFSET_MSDU_START
  2324. * Bits 15:0
  2325. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2326. * - OFFSET_MSDU_END
  2327. * Bits 31:16
  2328. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2329. * - OFFSET_RX_ATTN
  2330. * Bits 15:0
  2331. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2332. * - OFFSET_FRAG_INFO
  2333. * Bits 31:16
  2334. * Value: offset in QUAD-bytes of frag info table
  2335. */
  2336. /* header fields */
  2337. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2338. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2339. /* payload fields */
  2340. /* for systems using a 64-bit format for bus addresses */
  2341. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2342. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2343. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2344. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2345. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2346. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2347. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2348. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2349. /* for systems using a 32-bit format for bus addresses */
  2350. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2351. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2352. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2353. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2354. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2355. #define HTT_RX_RING_CFG_LEN_S 0
  2356. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2357. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2358. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2359. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2360. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2361. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2362. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2363. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2364. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2365. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2366. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2367. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2368. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2369. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2370. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2371. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2372. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2373. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2374. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2375. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2376. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2377. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2378. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2379. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2380. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2381. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2382. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2383. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2384. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2385. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2386. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2387. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2388. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2389. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2390. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2391. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2392. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2393. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2394. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2395. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2396. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2397. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2398. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2399. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2400. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2401. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2402. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2403. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2404. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2405. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2406. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2407. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2408. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2409. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2410. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2411. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2412. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2413. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2414. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2415. #if HTT_PADDR64
  2416. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2417. #else
  2418. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2419. #endif
  2420. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2421. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2422. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2423. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2424. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2425. do { \
  2426. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2427. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2428. } while (0)
  2429. /* degenerate case for 32-bit fields */
  2430. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2431. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2432. ((_var) = (_val))
  2433. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2434. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2435. ((_var) = (_val))
  2436. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2437. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2438. ((_var) = (_val))
  2439. /* degenerate case for 32-bit fields */
  2440. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2441. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) ((_var) = (_val))
  2442. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2443. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) ((_var) = (_val))
  2444. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  2445. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) ((_var) = (_val))
  2446. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  2447. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  2448. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  2449. do { \
  2450. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  2451. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  2452. } while (0)
  2453. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  2454. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  2455. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  2456. do { \
  2457. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  2458. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  2459. } while (0)
  2460. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  2461. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  2462. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  2463. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  2464. do { \
  2465. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  2466. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  2467. } while (0)
  2468. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  2469. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  2470. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  2471. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  2472. do { \
  2473. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  2474. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  2475. } while (0)
  2476. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  2477. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  2478. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  2479. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  2480. do { \
  2481. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  2482. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  2483. } while (0)
  2484. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  2485. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  2486. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  2487. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  2488. do { \
  2489. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  2490. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  2491. } while (0)
  2492. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  2493. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  2494. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  2495. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  2496. do { \
  2497. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  2498. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  2499. } while (0)
  2500. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  2501. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  2502. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  2503. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  2504. do { \
  2505. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  2506. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  2507. } while (0)
  2508. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  2509. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  2510. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  2511. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  2512. do { \
  2513. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  2514. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  2515. } while (0)
  2516. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  2517. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  2518. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  2519. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  2520. do { \
  2521. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  2522. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  2523. } while (0)
  2524. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  2525. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  2526. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  2527. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  2528. do { \
  2529. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  2530. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  2531. } while (0)
  2532. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  2533. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  2534. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  2535. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  2536. do { \
  2537. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  2538. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  2539. } while (0)
  2540. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  2541. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  2542. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  2543. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  2544. do { \
  2545. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  2546. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  2547. } while (0)
  2548. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  2549. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  2550. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  2551. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  2552. do { \
  2553. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  2554. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  2555. } while (0)
  2556. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  2557. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  2558. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  2559. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  2560. do { \
  2561. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  2562. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  2563. } while (0)
  2564. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  2565. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  2566. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  2567. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  2568. do { \
  2569. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  2570. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  2571. } while (0)
  2572. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  2573. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  2574. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  2575. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  2576. do { \
  2577. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  2578. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  2579. } while (0)
  2580. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  2581. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  2582. HTT_RX_RING_CFG_ENABLED_NULL_S)
  2583. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  2584. do { \
  2585. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  2586. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  2587. } while (0)
  2588. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  2589. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  2590. HTT_RX_RING_CFG_ENABLED_PHY_S)
  2591. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  2592. do { \
  2593. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  2594. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  2595. } while (0)
  2596. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  2597. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  2598. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  2599. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  2600. do { \
  2601. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  2602. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  2603. } while (0)
  2604. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  2605. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  2606. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  2607. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  2608. do { \
  2609. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  2610. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  2611. } while (0)
  2612. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  2613. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  2614. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  2615. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  2616. do { \
  2617. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  2618. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  2619. } while (0)
  2620. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  2621. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  2622. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  2623. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  2624. do { \
  2625. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  2626. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  2627. } while (0)
  2628. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  2629. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  2630. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  2631. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  2632. do { \
  2633. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  2634. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  2635. } while (0)
  2636. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  2637. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  2638. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  2639. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  2640. do { \
  2641. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  2642. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  2643. } while (0)
  2644. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  2645. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  2646. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  2647. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  2648. do { \
  2649. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  2650. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  2651. } while (0)
  2652. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  2653. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  2654. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  2655. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  2656. do { \
  2657. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  2658. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  2659. } while (0)
  2660. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  2661. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  2662. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  2663. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  2664. do { \
  2665. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  2666. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  2667. } while (0)
  2668. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  2669. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  2670. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  2671. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  2672. do { \
  2673. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  2674. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  2675. } while (0)
  2676. /**
  2677. * @brief host -> target FW statistics retrieve
  2678. *
  2679. * @details
  2680. * The following field definitions describe the format of the HTT host
  2681. * to target FW stats retrieve message. The message specifies the type of
  2682. * stats host wants to retrieve.
  2683. *
  2684. * |31 24|23 16|15 8|7 0|
  2685. * |-----------------------------------------------------------|
  2686. * | stats types request bitmask | msg type |
  2687. * |-----------------------------------------------------------|
  2688. * | stats types reset bitmask | reserved |
  2689. * |-----------------------------------------------------------|
  2690. * | stats type | config value |
  2691. * |-----------------------------------------------------------|
  2692. * | cookie LSBs |
  2693. * |-----------------------------------------------------------|
  2694. * | cookie MSBs |
  2695. * |-----------------------------------------------------------|
  2696. * Header fields:
  2697. * - MSG_TYPE
  2698. * Bits 7:0
  2699. * Purpose: identifies this is a stats upload request message
  2700. * Value: 0x3
  2701. * - UPLOAD_TYPES
  2702. * Bits 31:8
  2703. * Purpose: identifies which types of FW statistics to upload
  2704. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2705. * - RESET_TYPES
  2706. * Bits 31:8
  2707. * Purpose: identifies which types of FW statistics to reset
  2708. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  2709. * - CFG_VAL
  2710. * Bits 23:0
  2711. * Purpose: give an opaque configuration value to the specified stats type
  2712. * Value: stats-type specific configuration value
  2713. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  2714. * bits 7:0 - how many per-MPDU byte counts to include in a record
  2715. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  2716. * bits 23:16 - how many per-MSDU byte counts to include in a record
  2717. * - CFG_STAT_TYPE
  2718. * Bits 31:24
  2719. * Purpose: specify which stats type (if any) the config value applies to
  2720. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  2721. * a valid configuration specification
  2722. * - COOKIE_LSBS
  2723. * Bits 31:0
  2724. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2725. * message with its preceding host->target stats request message.
  2726. * Value: LSBs of the opaque cookie specified by the host-side requestor
  2727. * - COOKIE_MSBS
  2728. * Bits 31:0
  2729. * Purpose: Provide a mechanism to match a target->host stats confirmation
  2730. * message with its preceding host->target stats request message.
  2731. * Value: MSBs of the opaque cookie specified by the host-side requestor
  2732. */
  2733. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  2734. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  2735. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  2736. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  2737. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  2738. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  2739. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  2740. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  2741. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  2742. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  2743. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  2744. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  2745. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  2746. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  2747. do { \
  2748. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  2749. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  2750. } while (0)
  2751. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  2752. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  2753. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  2754. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  2755. do { \
  2756. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  2757. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  2758. } while (0)
  2759. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  2760. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  2761. HTT_H2T_STATS_REQ_CFG_VAL_S)
  2762. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  2763. do { \
  2764. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  2765. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  2766. } while (0)
  2767. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  2768. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  2769. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  2770. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  2771. do { \
  2772. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  2773. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  2774. } while (0)
  2775. /**
  2776. * @brief host -> target HTT out-of-band sync request
  2777. *
  2778. * @details
  2779. * The HTT SYNC tells the target to suspend processing of subsequent
  2780. * HTT host-to-target messages until some other target agent locally
  2781. * informs the target HTT FW that the current sync counter is equal to
  2782. * or greater than (in a modulo sense) the sync counter specified in
  2783. * the SYNC message.
  2784. * This allows other host-target components to synchronize their operation
  2785. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  2786. * security key has been downloaded to and activated by the target.
  2787. * In the absence of any explicit synchronization counter value
  2788. * specification, the target HTT FW will use zero as the default current
  2789. * sync value.
  2790. *
  2791. * |31 24|23 16|15 8|7 0|
  2792. * |-----------------------------------------------------------|
  2793. * | reserved | sync count | msg type |
  2794. * |-----------------------------------------------------------|
  2795. * Header fields:
  2796. * - MSG_TYPE
  2797. * Bits 7:0
  2798. * Purpose: identifies this as a sync message
  2799. * Value: 0x4
  2800. * - SYNC_COUNT
  2801. * Bits 15:8
  2802. * Purpose: specifies what sync value the HTT FW will wait for from
  2803. * an out-of-band specification to resume its operation
  2804. * Value: in-band sync counter value to compare against the out-of-band
  2805. * counter spec.
  2806. * The HTT target FW will suspend its host->target message processing
  2807. * as long as
  2808. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  2809. */
  2810. #define HTT_H2T_SYNC_MSG_SZ 4
  2811. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  2812. #define HTT_H2T_SYNC_COUNT_S 8
  2813. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  2814. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  2815. HTT_H2T_SYNC_COUNT_S)
  2816. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  2817. do { \
  2818. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  2819. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  2820. } while (0)
  2821. /**
  2822. * @brief HTT aggregation configuration
  2823. */
  2824. #define HTT_AGGR_CFG_MSG_SZ 4
  2825. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  2826. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  2827. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  2828. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  2829. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  2830. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  2831. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  2832. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  2835. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  2836. } while (0)
  2837. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2838. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2839. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  2840. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  2843. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  2844. } while (0)
  2845. /**
  2846. * @brief host -> target HTT configure max amsdu info per vdev
  2847. *
  2848. * @details
  2849. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  2850. *
  2851. * |31 21|20 16|15 8|7 0|
  2852. * |-----------------------------------------------------------|
  2853. * | reserved | vdev id | max amsdu | msg type |
  2854. * |-----------------------------------------------------------|
  2855. * Header fields:
  2856. * - MSG_TYPE
  2857. * Bits 7:0
  2858. * Purpose: identifies this as a aggr cfg ex message
  2859. * Value: 0xa
  2860. * - MAX_NUM_AMSDU_SUBFRM
  2861. * Bits 15:8
  2862. * Purpose: max MSDUs per A-MSDU
  2863. * - VDEV_ID
  2864. * Bits 20:16
  2865. * Purpose: ID of the vdev to which this limit is applied
  2866. */
  2867. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  2868. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  2869. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  2870. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  2871. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  2872. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  2873. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  2874. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  2875. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  2876. do { \
  2877. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  2878. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  2879. } while (0)
  2880. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  2881. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  2882. HTT_AGGR_CFG_EX_VDEV_ID_S)
  2883. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  2884. do { \
  2885. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  2886. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  2887. } while (0)
  2888. /**
  2889. * @brief HTT WDI_IPA Config Message
  2890. *
  2891. * @details
  2892. * The HTT WDI_IPA config message is created/sent by host at driver
  2893. * init time. It contains information about data structures used on
  2894. * WDI_IPA TX and RX path.
  2895. * TX CE ring is used for pushing packet metadata from IPA uC
  2896. * to WLAN FW
  2897. * TX Completion ring is used for generating TX completions from
  2898. * WLAN FW to IPA uC
  2899. * RX Indication ring is used for indicating RX packets from FW
  2900. * to IPA uC
  2901. * RX Ring2 is used as either completion ring or as second
  2902. * indication ring. when Ring2 is used as completion ring, IPA uC
  2903. * puts completed RX packet meta data to Ring2. when Ring2 is used
  2904. * as second indication ring, RX packets for LTE-WLAN aggregation are
  2905. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  2906. * indicated in RX Indication ring. Please see WDI_IPA specification
  2907. * for more details.
  2908. * |31 24|23 16|15 8|7 0|
  2909. * |----------------+----------------+----------------+----------------|
  2910. * | tx pkt pool size | Rsvd | msg_type |
  2911. * |-------------------------------------------------------------------|
  2912. * | tx comp ring base (bits 31:0) |
  2913. #if HTT_PADDR64
  2914. * | tx comp ring base (bits 63:32) |
  2915. #endif
  2916. * |-------------------------------------------------------------------|
  2917. * | tx comp ring size |
  2918. * |-------------------------------------------------------------------|
  2919. * | tx comp WR_IDX physical address (bits 31:0) |
  2920. #if HTT_PADDR64
  2921. * | tx comp WR_IDX physical address (bits 63:32) |
  2922. #endif
  2923. * |-------------------------------------------------------------------|
  2924. * | tx CE WR_IDX physical address (bits 31:0) |
  2925. #if HTT_PADDR64
  2926. * | tx CE WR_IDX physical address (bits 63:32) |
  2927. #endif
  2928. * |-------------------------------------------------------------------|
  2929. * | rx indication ring base (bits 31:0) |
  2930. #if HTT_PADDR64
  2931. * | rx indication ring base (bits 63:32) |
  2932. #endif
  2933. * |-------------------------------------------------------------------|
  2934. * | rx indication ring size |
  2935. * |-------------------------------------------------------------------|
  2936. * | rx ind RD_IDX physical address (bits 31:0) |
  2937. #if HTT_PADDR64
  2938. * | rx ind RD_IDX physical address (bits 63:32) |
  2939. #endif
  2940. * |-------------------------------------------------------------------|
  2941. * | rx ind WR_IDX physical address (bits 31:0) |
  2942. #if HTT_PADDR64
  2943. * | rx ind WR_IDX physical address (bits 63:32) |
  2944. #endif
  2945. * |-------------------------------------------------------------------|
  2946. * |-------------------------------------------------------------------|
  2947. * | rx ring2 base (bits 31:0) |
  2948. #if HTT_PADDR64
  2949. * | rx ring2 base (bits 63:32) |
  2950. #endif
  2951. * |-------------------------------------------------------------------|
  2952. * | rx ring2 size |
  2953. * |-------------------------------------------------------------------|
  2954. * | rx ring2 RD_IDX physical address (bits 31:0) |
  2955. #if HTT_PADDR64
  2956. * | rx ring2 RD_IDX physical address (bits 63:32) |
  2957. #endif
  2958. * |-------------------------------------------------------------------|
  2959. * | rx ring2 WR_IDX physical address (bits 31:0) |
  2960. #if HTT_PADDR64
  2961. * | rx ring2 WR_IDX physical address (bits 63:32) |
  2962. #endif
  2963. * |-------------------------------------------------------------------|
  2964. *
  2965. * Header fields:
  2966. * Header fields:
  2967. * - MSG_TYPE
  2968. * Bits 7:0
  2969. * Purpose: Identifies this as WDI_IPA config message
  2970. * value: = 0x8
  2971. * - TX_PKT_POOL_SIZE
  2972. * Bits 15:0
  2973. * Purpose: Total number of TX packet buffer pool allocated by Host for
  2974. * WDI_IPA TX path
  2975. * For systems using 32-bit format for bus addresses:
  2976. * - TX_COMP_RING_BASE_ADDR
  2977. * Bits 31:0
  2978. * Purpose: TX Completion Ring base address in DDR
  2979. * - TX_COMP_RING_SIZE
  2980. * Bits 31:0
  2981. * Purpose: TX Completion Ring size (must be power of 2)
  2982. * - TX_COMP_WR_IDX_ADDR
  2983. * Bits 31:0
  2984. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  2985. * updates the Write Index for WDI_IPA TX completion ring
  2986. * - TX_CE_WR_IDX_ADDR
  2987. * Bits 31:0
  2988. * Purpose: DDR address where IPA uC
  2989. * updates the WR Index for TX CE ring
  2990. * (needed for fusion platforms)
  2991. * - RX_IND_RING_BASE_ADDR
  2992. * Bits 31:0
  2993. * Purpose: RX Indication Ring base address in DDR
  2994. * - RX_IND_RING_SIZE
  2995. * Bits 31:0
  2996. * Purpose: RX Indication Ring size
  2997. * - RX_IND_RD_IDX_ADDR
  2998. * Bits 31:0
  2999. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3000. * RX indication ring
  3001. * - RX_IND_WR_IDX_ADDR
  3002. * Bits 31:0
  3003. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3004. * updates the Write Index for WDI_IPA RX indication ring
  3005. * - RX_RING2_BASE_ADDR
  3006. * Bits 31:0
  3007. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3008. * - RX_RING2_SIZE
  3009. * Bits 31:0
  3010. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3011. * - RX_RING2_RD_IDX_ADDR
  3012. * Bits 31:0
  3013. * Purpose: If Second RX ring is Indication ring, DDR address where
  3014. * IPA uC updates the Read Index for Ring2.
  3015. * If Second RX ring is completion ring, this is NOT used
  3016. * - RX_RING2_WR_IDX_ADDR
  3017. * Bits 31:0
  3018. * Purpose: If Second RX ring is Indication ring, DDR address where
  3019. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3020. * If second RX ring is completion ring, DDR address where
  3021. * IPA uC updates the Write Index for Ring 2.
  3022. * For systems using 64-bit format for bus addresses:
  3023. * - TX_COMP_RING_BASE_ADDR_LO
  3024. * Bits 31:0
  3025. * Purpose: Lower 4 bytes of TX Completion Ring base physical
  3026. * address in DDR
  3027. * - TX_COMP_RING_BASE_ADDR_HI
  3028. * Bits 31:0
  3029. * Purpose: Higher 4 bytes of TX Completion Ring base physical
  3030. * address in DDR
  3031. * - TX_COMP_RING_SIZE
  3032. * Bits 31:0
  3033. * Purpose: TX Completion Ring size (must be power of 2)
  3034. * - TX_COMP_WR_IDX_ADDR_LO
  3035. * Bits 31:0
  3036. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3037. * Lower 4 bytes of DDR address where WIFI FW
  3038. * updates the Write Index for WDI_IPA TX completion ring
  3039. * - TX_COMP_WR_IDX_ADDR_HI
  3040. * Bits 31:0
  3041. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3042. * Higher 4 bytes of DDR address where WIFI FW
  3043. * updates the Write Index for WDI_IPA TX completion ring
  3044. * - TX_CE_WR_IDX_ADDR_LO
  3045. * Bits 31:0
  3046. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3047. * updates the WR Index for TX CE ring
  3048. * (needed for fusion platforms)
  3049. * - TX_CE_WR_IDX_ADDR_HI
  3050. * Bits 31:0
  3051. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3052. * updates the WR Index for TX CE ring
  3053. * (needed for fusion platforms)
  3054. * - RX_IND_RING_BASE_ADDR_LO
  3055. * Bits 31:0
  3056. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3057. * - RX_IND_RING_BASE_ADDR_HI
  3058. * Bits 31:0
  3059. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3060. * - RX_IND_RING_SIZE
  3061. * Bits 31:0
  3062. * Purpose: RX Indication Ring size
  3063. * - RX_IND_RD_IDX_ADDR_LO
  3064. * Bits 31:0
  3065. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the
  3066. * Read Index for WDI_IPA RX indication ring
  3067. * - RX_IND_RD_IDX_ADDR_HI
  3068. * Bits 31:0
  3069. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the
  3070. * Read Index for WDI_IPA RX indication ring
  3071. * - RX_IND_WR_IDX_ADDR_LO
  3072. * Bits 31:0
  3073. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3074. * Lower 4 bytes of DDR address where WIFI FW
  3075. * updates the Write Index for WDI_IPA RX indication ring
  3076. * - RX_IND_WR_IDX_ADDR_HI
  3077. * Bits 31:0
  3078. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3079. * Higher 4 bytes of DDR address where WIFI FW
  3080. * updates the Write Index for WDI_IPA RX indication ring
  3081. * - RX_RING2_BASE_ADDR_LO
  3082. * Bits 31:0
  3083. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)
  3084. * base address in DDR
  3085. * - RX_RING2_BASE_ADDR_HI
  3086. * Bits 31:0
  3087. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)
  3088. * base address in DDR
  3089. * - RX_RING2_SIZE
  3090. * Bits 31:0
  3091. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3092. * - RX_RING2_RD_IDX_ADDR_LO
  3093. * Bits 31:0
  3094. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3095. * DDR address where IPA uC updates the Read Index for Ring2.
  3096. * If Second RX ring is completion ring, this is NOT used
  3097. * - RX_RING2_RD_IDX_ADDR_HI
  3098. * Bits 31:0
  3099. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3100. * DDR address where IPA uC updates the Read Index for Ring2.
  3101. * If Second RX ring is completion ring, this is NOT used
  3102. * - RX_RING2_WR_IDX_ADDR_LO
  3103. * Bits 31:0
  3104. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3105. * DDR address where WIFI FW updates the Write Index
  3106. * for WDI_IPA RX ring2
  3107. * If second RX ring is completion ring, lower 4 bytes of
  3108. * DDR address where IPA uC updates the Write Index for Ring 2.
  3109. * - RX_RING2_WR_IDX_ADDR_HI
  3110. * Bits 31:0
  3111. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3112. * DDR address where WIFI FW updates the Write Index
  3113. * for WDI_IPA RX ring2
  3114. * If second RX ring is completion ring, higher 4 bytes of
  3115. * DDR address where IPA uC updates the Write Index for Ring 2.
  3116. */
  3117. #if HTT_PADDR64
  3118. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3119. #else
  3120. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3121. #endif
  3122. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3123. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3124. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3126. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3127. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3128. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3129. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3130. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3131. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3132. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3133. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3134. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3135. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3136. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3137. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3138. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3139. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3140. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3141. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3142. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3143. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3144. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3145. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3146. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3147. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3148. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3149. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3150. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3151. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3152. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3153. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3154. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3155. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3156. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3157. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3158. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3159. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3160. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3161. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3162. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3163. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3164. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3165. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3166. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3167. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3168. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3169. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3170. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3171. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3172. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3173. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3174. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3175. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3176. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3177. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3178. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3179. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3180. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3181. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3182. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3183. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3184. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3185. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> \
  3186. HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3187. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3188. do { \
  3189. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3190. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3191. } while (0)
  3192. /* for systems using 32-bit format for bus addr */
  3193. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3194. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> \
  3195. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3196. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3197. do { \
  3198. HTT_CHECK_SET_VAL( \
  3199. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val);\
  3200. ((_var) |= \
  3201. ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3202. } while (0)
  3203. /* for systems using 64-bit format for bus addr */
  3204. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3205. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> \
  3206. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3207. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3208. do { \
  3209. HTT_CHECK_SET_VAL( \
  3210. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val);\
  3211. ((_var) |= \
  3212. ((_val) << \
  3213. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3214. } while (0)
  3215. /* for systems using 64-bit format for bus addr */
  3216. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3217. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> \
  3218. HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3219. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3220. do { \
  3221. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3222. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3223. } while (0)
  3224. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3225. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> \
  3226. HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3227. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3228. do { \
  3229. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3230. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3231. } while (0)
  3232. /* for systems using 32-bit format for bus addr */
  3233. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3234. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> \
  3235. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3236. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3237. do { \
  3238. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3239. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3240. } while (0)
  3241. /* for systems using 64-bit format for bus addr */
  3242. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3243. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> \
  3244. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3245. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3246. do { \
  3247. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3248. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3249. } while (0)
  3250. /* for systems using 64-bit format for bus addr */
  3251. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3252. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> \
  3253. HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3254. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3255. do { \
  3256. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3257. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3258. } while (0)
  3259. /* for systems using 32-bit format for bus addr */
  3260. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3261. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> \
  3262. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3263. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3264. do { \
  3265. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3266. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3267. } while (0)
  3268. /* for systems using 64-bit format for bus addr */
  3269. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3270. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >>\
  3271. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3272. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3273. do { \
  3274. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3275. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3276. } while (0)
  3277. /* for systems using 64-bit format for bus addr */
  3278. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3279. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> \
  3280. HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3281. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3282. do { \
  3283. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3284. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3285. } while (0)
  3286. /* for systems using 32-bit format for bus addr */
  3287. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3288. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> \
  3289. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3290. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3291. do { \
  3292. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3293. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3294. } while (0)
  3295. /* for systems using 64-bit format for bus addr */
  3296. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3297. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> \
  3298. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3299. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3300. do { \
  3301. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3302. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3303. } while (0)
  3304. /* for systems using 64-bit format for bus addr */
  3305. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3306. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> \
  3307. HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3308. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3309. do { \
  3310. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3311. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3312. } while (0)
  3313. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3314. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> \
  3315. HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3316. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3317. do { \
  3318. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3319. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3320. } while (0)
  3321. /* for systems using 32-bit format for bus addr */
  3322. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3323. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> \
  3324. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3325. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3326. do { \
  3327. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3328. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3329. } while (0)
  3330. /* for systems using 64-bit format for bus addr */
  3331. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3332. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> \
  3333. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3334. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3335. do { \
  3336. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3337. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3338. } while (0)
  3339. /* for systems using 64-bit format for bus addr */
  3340. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3341. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> \
  3342. HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3343. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3344. do { \
  3345. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3346. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3347. } while (0)
  3348. /* for systems using 32-bit format for bus addr */
  3349. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3350. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> \
  3351. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3352. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3353. do { \
  3354. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3355. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3356. } while (0)
  3357. /* for systems using 64-bit format for bus addr */
  3358. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3359. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> \
  3360. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3361. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3362. do { \
  3363. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3364. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3365. } while (0)
  3366. /* for systems using 64-bit format for bus addr */
  3367. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3368. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> \
  3369. HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3370. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3371. do { \
  3372. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3373. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3374. } while (0)
  3375. /* for systems using 32-bit format for bus addr */
  3376. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3377. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> \
  3378. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3379. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3380. do { \
  3381. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3382. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3383. } while (0)
  3384. /* for systems using 64-bit format for bus addr */
  3385. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3386. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> \
  3387. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3388. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3389. do { \
  3390. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3391. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3392. } while (0)
  3393. /* for systems using 64-bit format for bus addr */
  3394. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3395. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> \
  3396. HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3397. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3398. do { \
  3399. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3400. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3401. } while (0)
  3402. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3403. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> \
  3404. HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3405. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3406. do { \
  3407. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3408. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3409. } while (0)
  3410. /* for systems using 32-bit format for bus addr */
  3411. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3412. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> \
  3413. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3414. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3417. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3418. } while (0)
  3419. /* for systems using 64-bit format for bus addr */
  3420. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3421. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> \
  3422. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3423. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3424. do { \
  3425. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3426. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3427. } while (0)
  3428. /* for systems using 64-bit format for bus addr */
  3429. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3430. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> \
  3431. HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3432. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3435. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3436. } while (0)
  3437. /* for systems using 32-bit format for bus addr */
  3438. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3439. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> \
  3440. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3441. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3442. do { \
  3443. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3444. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3445. } while (0)
  3446. /* for systems using 64-bit format for bus addr */
  3447. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3448. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> \
  3449. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3450. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3451. do { \
  3452. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3453. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3454. } while (0)
  3455. /* for systems using 64-bit format for bus addr */
  3456. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3457. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> \
  3458. HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3459. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3460. do { \
  3461. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3462. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3463. } while (0)
  3464. /*
  3465. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3466. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3467. * addresses are stored in a XXX-bit field.
  3468. * This macro is used to define both htt_wdi_ipa_config32_t and
  3469. * htt_wdi_ipa_config64_t structs.
  3470. */
  3471. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3472. _paddr__tx_comp_ring_base_addr_, \
  3473. _paddr__tx_comp_wr_idx_addr_, \
  3474. _paddr__tx_ce_wr_idx_addr_, \
  3475. _paddr__rx_ind_ring_base_addr_, \
  3476. _paddr__rx_ind_rd_idx_addr_, \
  3477. _paddr__rx_ind_wr_idx_addr_, \
  3478. _paddr__rx_ring2_base_addr_,\
  3479. _paddr__rx_ring2_rd_idx_addr_,\
  3480. _paddr__rx_ring2_wr_idx_addr_) \
  3481. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  3482. { \
  3483. /* DWORD 0: flags and meta-data */ \
  3484. A_UINT32 \
  3485. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  3486. reserved:8, \
  3487. tx_pkt_pool_size:16;\
  3488. /* DWORD 1 */\
  3489. _paddr__tx_comp_ring_base_addr_;\
  3490. /* DWORD 2 (or 3)*/\
  3491. A_UINT32 tx_comp_ring_size;\
  3492. /* DWORD 3 (or 4)*/\
  3493. _paddr__tx_comp_wr_idx_addr_;\
  3494. /* DWORD 4 (or 6)*/\
  3495. _paddr__tx_ce_wr_idx_addr_;\
  3496. /* DWORD 5 (or 8)*/\
  3497. _paddr__rx_ind_ring_base_addr_;\
  3498. /* DWORD 6 (or 10)*/\
  3499. A_UINT32 rx_ind_ring_size;\
  3500. /* DWORD 7 (or 11)*/\
  3501. _paddr__rx_ind_rd_idx_addr_;\
  3502. /* DWORD 8 (or 13)*/\
  3503. _paddr__rx_ind_wr_idx_addr_;\
  3504. /* DWORD 9 (or 15)*/\
  3505. _paddr__rx_ring2_base_addr_;\
  3506. /* DWORD 10 (or 17) */\
  3507. A_UINT32 rx_ring2_size;\
  3508. /* DWORD 11 (or 18) */\
  3509. _paddr__rx_ring2_rd_idx_addr_;\
  3510. /* DWORD 12 (or 20) */\
  3511. _paddr__rx_ring2_wr_idx_addr_;\
  3512. } POSTPACK
  3513. /* define a htt_wdi_ipa_config32_t type */
  3514. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr),
  3515. HTT_VAR_PADDR32(tx_comp_wr_idx_addr),
  3516. HTT_VAR_PADDR32(tx_ce_wr_idx_addr),
  3517. HTT_VAR_PADDR32(rx_ind_ring_base_addr),
  3518. HTT_VAR_PADDR32(rx_ind_rd_idx_addr),
  3519. HTT_VAR_PADDR32(rx_ind_wr_idx_addr),
  3520. HTT_VAR_PADDR32(rx_ring2_base_addr),
  3521. HTT_VAR_PADDR32(rx_ring2_rd_idx_addr),
  3522. HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  3523. /* define a htt_wdi_ipa_config64_t type */
  3524. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr),
  3525. HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr),
  3526. HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr),
  3527. HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr),
  3528. HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr),
  3529. HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr),
  3530. HTT_VAR_PADDR64_LE(rx_ring2_base_addr),
  3531. HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr),
  3532. HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  3533. #if HTT_PADDR64
  3534. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  3535. #else
  3536. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  3537. #endif
  3538. enum htt_wdi_ipa_op_code {
  3539. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  3540. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  3541. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  3542. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  3543. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  3544. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  3545. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  3546. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  3547. /* keep this last */
  3548. HTT_WDI_IPA_OPCODE_MAX
  3549. };
  3550. /**
  3551. * @brief HTT WDI_IPA Operation Request Message
  3552. *
  3553. * @details
  3554. * HTT WDI_IPA Operation Request message is sent by host
  3555. * to either suspend or resume WDI_IPA TX or RX path.
  3556. * |31 24|23 16|15 8|7 0|
  3557. * |----------------+----------------+----------------+----------------|
  3558. * | op_code | Rsvd | msg_type |
  3559. * |-------------------------------------------------------------------|
  3560. *
  3561. * Header fields:
  3562. * - MSG_TYPE
  3563. * Bits 7:0
  3564. * Purpose: Identifies this as WDI_IPA Operation Request message
  3565. * value: = 0x9
  3566. * - OP_CODE
  3567. * Bits 31:16
  3568. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  3569. * value: = enum htt_wdi_ipa_op_code
  3570. */
  3571. PREPACK struct htt_wdi_ipa_op_request_t {
  3572. /* DWORD 0: flags and meta-data */
  3573. A_UINT32
  3574. msg_type:8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ */
  3575. reserved:8,
  3576. op_code:16;
  3577. } POSTPACK;
  3578. #define HTT_WDI_IPA_OP_REQUEST_SZ 4
  3579. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  3580. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  3581. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  3582. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> \
  3583. HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  3584. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  3585. do { \
  3586. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  3587. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  3588. } while (0)
  3589. /**
  3590. * @brief WLAN_WDI_IPA_GET_SHARING_STATS_REQ
  3591. * |31 24|23 16|15 8|7 0|
  3592. * |----------------+----------------+----------------+----------------|
  3593. * | reserved | reset_stats |
  3594. * |-------------------------------------------------------------------|
  3595. * Header fields:
  3596. * - RESET_STATS
  3597. * Bits 7:0
  3598. * Purpose: when 1, FW clears sharing stats
  3599. * - RESERVED
  3600. * Bits 31:8
  3601. * Purpose: reserved bits
  3602. */
  3603. PREPACK struct htt_wdi_ipa_get_sharing_stats_t {
  3604. A_UINT32
  3605. reset_stats:8, /* reset stat countis after response */
  3606. reserved:24;
  3607. } POSTPACK;
  3608. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_SZ \
  3609. (sizeof(struct htt_wdi_ipa_get_sharing_stats_t))
  3610. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_M 0x000000ff
  3611. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S 0
  3612. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_GET(_var) \
  3613. (((_var) & HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_M) >>\
  3614. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S)
  3615. #define HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_SET(_var, _val)\
  3616. do { \
  3617. HTT_CHECK_SET_VAL( \
  3618. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS,\
  3619. _val); \
  3620. ((_var) |= ((_val) << \
  3621. HTT_WDI_IPA_OP_REQ_GET_SHARING_STATS_RESET_STATS_S)); \
  3622. } while (0)
  3623. /**
  3624. * @brief WLAN_WDI_IPA_SET_QUOTA_REQ
  3625. *
  3626. * |31 24|23 16|15 8|7 0|
  3627. * |----------------+----------------+----------------+----------------|
  3628. * | reserved | set_quota |
  3629. * |-------------------------------------------------------------------|
  3630. * | quota_lo |
  3631. * |-------------------------------------------------------------------|
  3632. * | quota_hi |
  3633. * |-------------------------------------------------------------------|
  3634. * Header fields:
  3635. * - set_quota
  3636. * Bits 7:0
  3637. * Purpose: when 1, FW configures quota and starts quota monitoring.
  3638. * when 0, FW stops.
  3639. * - RESERVED
  3640. * Bits 31:8
  3641. * Purpose: reserved bits
  3642. * - quota_lo
  3643. * Bits 31:0
  3644. * Purpose: bytes of quota to be set, low 32-bit.
  3645. * It is accumulated number of bytes from when quota is configured.
  3646. * - quota_hi
  3647. * Bits 31:0
  3648. * Purpose: bytes of quota to be set, high 32-bit
  3649. */
  3650. PREPACK struct htt_wdi_ipa_set_quota_t {
  3651. A_UINT32
  3652. set_quota:8, /* enable quota monitoring */
  3653. reserved:24;
  3654. A_UINT32 quota_lo; /* quota limit in bytes */
  3655. A_UINT32 quota_hi;
  3656. } POSTPACK;
  3657. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SZ \
  3658. (sizeof(struct htt_wdi_ipa_set_quota_t))
  3659. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_M 0x000000ff
  3660. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S 0
  3661. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_GET(_var) \
  3662. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_M) >> \
  3663. HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S)
  3664. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_SET(_var, _val) \
  3665. do { \
  3666. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA,\
  3667. _val); \
  3668. ((_var) |= ((_val) << \
  3669. HTT_WDI_IPA_OP_REQ_SET_QUOTA_SET_QUOTA_S)); \
  3670. } while (0)
  3671. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_M 0xffffffff
  3672. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S 0
  3673. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_GET(_var) \
  3674. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_M) >> \
  3675. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S)
  3676. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_SET(_var, _val) \
  3677. do { \
  3678. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO,\
  3679. _val); \
  3680. ((_var) |= ((_val) << \
  3681. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_LO_S)); \
  3682. } while (0)
  3683. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_M 0xffffffff
  3684. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S 0
  3685. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_GET(_var) \
  3686. (((_var) & HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_M) >> \
  3687. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S)
  3688. #define HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_SET(_var, _val) \
  3689. do { \
  3690. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI,\
  3691. _val); \
  3692. ((_var) |= ((_val) << \
  3693. HTT_WDI_IPA_OP_REQ_SET_QUOTA_QUOTA_HI_S)); \
  3694. } while (0)
  3695. /*
  3696. * @brief host -> target HTT_SRING_SETUP message
  3697. *
  3698. * @details
  3699. * After target is booted up, Host can send SRING setup message for
  3700. * each host facing LMAC SRING. Target setups up HW registers based
  3701. * on setup message and confirms back to Host if response_required is set.
  3702. * Host should wait for confirmation message before sending new SRING
  3703. * setup message
  3704. *
  3705. * The message would appear as follows:
  3706. * |31 24|23 20|19|18 16|15|14 8|7 0|
  3707. * |--------------- +-----------------+----------------+------------------|
  3708. * | ring_type | ring_id | pdev_id | msg_type |
  3709. * |----------------------------------------------------------------------|
  3710. * | ring_base_addr_lo |
  3711. * |----------------------------------------------------------------------|
  3712. * | ring_base_addr_hi |
  3713. * |----------------------------------------------------------------------|
  3714. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  3715. * |----------------------------------------------------------------------|
  3716. * | ring_head_offset32_remote_addr_lo |
  3717. * |----------------------------------------------------------------------|
  3718. * | ring_head_offset32_remote_addr_hi |
  3719. * |----------------------------------------------------------------------|
  3720. * | ring_tail_offset32_remote_addr_lo |
  3721. * |----------------------------------------------------------------------|
  3722. * | ring_tail_offset32_remote_addr_hi |
  3723. * |----------------------------------------------------------------------|
  3724. * | ring_msi_addr_lo |
  3725. * |----------------------------------------------------------------------|
  3726. * | ring_msi_addr_hi |
  3727. * |----------------------------------------------------------------------|
  3728. * | ring_msi_data |
  3729. * |----------------------------------------------------------------------|
  3730. * | intr_timer_th |IM| intr_batch_counter_th |
  3731. * |----------------------------------------------------------------------|
  3732. * | reserved |RR|PTCF| intr_low_threshold |
  3733. * |----------------------------------------------------------------------|
  3734. * Where
  3735. * IM = sw_intr_mode
  3736. * RR = response_required
  3737. * PTCF = prefetch_timer_cfg
  3738. *
  3739. * The message is interpreted as follows:
  3740. * dword0 - b'0:7 - msg_type: This will be set to
  3741. * HTT_H2T_MSG_TYPE_SRING_SETUP
  3742. * b'8:15 - pdev_id:
  3743. * 0 (for rings at SOC/UMAC level),
  3744. * 1/2/3 mac id (for rings at LMAC level)
  3745. * b'16:23 - ring_id: identify which ring is to setup,
  3746. * more details can be got from enum htt_srng_ring_id
  3747. * b'24:31 - ring_type: identify type of host rings,
  3748. * more details can be got from enum htt_srng_ring_type
  3749. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  3750. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  3751. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  3752. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  3753. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  3754. * SW_TO_HW_RING.
  3755. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  3756. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  3757. * Lower 32 bits of memory address of the remote variable
  3758. * storing the 4-byte word offset that identifies the head
  3759. * element within the ring.
  3760. * (The head offset variable has type A_UINT32.)
  3761. * Valid for HW_TO_SW and SW_TO_SW rings.
  3762. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  3763. * Upper 32 bits of memory address of the remote variable
  3764. * storing the 4-byte word offset that identifies the head
  3765. * element within the ring.
  3766. * (The head offset variable has type A_UINT32.)
  3767. * Valid for HW_TO_SW and SW_TO_SW rings.
  3768. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  3769. * Lower 32 bits of memory address of the remote variable
  3770. * storing the 4-byte word offset that identifies the tail
  3771. * element within the ring.
  3772. * (The tail offset variable has type A_UINT32.)
  3773. * Valid for HW_TO_SW and SW_TO_SW rings.
  3774. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  3775. * Upper 32 bits of memory address of the remote variable
  3776. * storing the 4-byte word offset that identifies the tail
  3777. * element within the ring.
  3778. * (The tail offset variable has type A_UINT32.)
  3779. * Valid for HW_TO_SW and SW_TO_SW rings.
  3780. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  3781. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3782. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  3783. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3784. * dword10 - b'0:31 - ring_msi_data: MSI data
  3785. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  3786. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  3787. * dword11 - b'0:14 - intr_batch_counter_th:
  3788. * batch counter threshold is in units of 4-byte words.
  3789. * HW internally maintains and increments batch count.
  3790. * (see SRING spec for detail description).
  3791. * When batch count reaches threshold value, an interrupt
  3792. * is generated by HW.
  3793. * b'15 - sw_intr_mode:
  3794. * This configuration shall be static.
  3795. * Only programmed at power up.
  3796. * 0: generate pulse style sw interrupts
  3797. * 1: generate level style sw interrupts
  3798. * b'16:31 - intr_timer_th:
  3799. * The timer init value when timer is idle or is
  3800. * initialized to start downcounting.
  3801. * In 8us units (to cover a range of 0 to 524 ms)
  3802. * dword12 - b'0:15 - intr_low_threshold:
  3803. * Used only by Consumer ring to generate ring_sw_int_p.
  3804. * Ring entries low threshold water mark, that is used
  3805. * in combination with the interrupt timer as well as
  3806. * the the clearing of the level interrupt.
  3807. * b'16:18 - prefetch_timer_cfg:
  3808. * Used only by Consumer ring to set timer mode to
  3809. * support Application prefetch handling.
  3810. * The external tail offset/pointer will be updated
  3811. * at following intervals:
  3812. * 3'b000: (Prefetch feature disabled; used only for debug)
  3813. * 3'b001: 1 usec
  3814. * 3'b010: 4 usec
  3815. * 3'b011: 8 usec (default)
  3816. * 3'b100: 16 usec
  3817. * Others: Reserverd
  3818. * b'19 - response_required:
  3819. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  3820. * b'20:31 - reserved: reserved for future use
  3821. */
  3822. PREPACK struct htt_sring_setup_t {
  3823. A_UINT32 msg_type: 8,
  3824. pdev_id: 8,
  3825. ring_id: 8,
  3826. ring_type: 8;
  3827. A_UINT32 ring_base_addr_lo;
  3828. A_UINT32 ring_base_addr_hi;
  3829. A_UINT32 ring_size: 16,
  3830. ring_entry_size: 8,
  3831. ring_misc_cfg_flag: 8;
  3832. A_UINT32 ring_head_offset32_remote_addr_lo;
  3833. A_UINT32 ring_head_offset32_remote_addr_hi;
  3834. A_UINT32 ring_tail_offset32_remote_addr_lo;
  3835. A_UINT32 ring_tail_offset32_remote_addr_hi;
  3836. A_UINT32 ring_msi_addr_lo;
  3837. A_UINT32 ring_msi_addr_hi;
  3838. A_UINT32 ring_msi_data;
  3839. A_UINT32 intr_batch_counter_th: 15,
  3840. sw_intr_mode: 1,
  3841. intr_timer_th: 16;
  3842. A_UINT32 intr_low_threshold: 16,
  3843. prefetch_timer_cfg: 3,
  3844. response_required: 1,
  3845. reserved1: 12;
  3846. } POSTPACK;
  3847. enum htt_srng_ring_type {
  3848. HTT_HW_TO_SW_RING = 0,
  3849. HTT_SW_TO_HW_RING,
  3850. HTT_SW_TO_SW_RING,
  3851. /* Insert new ring types above this line */
  3852. };
  3853. enum htt_srng_ring_id {
  3854. /* Used by FW to feed remote buffers and update remote packets */
  3855. HTT_RXDMA_HOST_BUF_RING = 0,
  3856. /*
  3857. * For getting all PPDU/MPDU/MSDU status deescriptors on host for
  3858. * monitor VAP or packet log purposes
  3859. */
  3860. HTT_RXDMA_MONITOR_STATUS_RING,
  3861. /* For feeding free host buffers to RxDMA for monitor traffic upload */
  3862. HTT_RXDMA_MONITOR_BUF_RING,
  3863. /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  3864. HTT_RXDMA_MONITOR_DESC_RING,
  3865. /* Per MPDU indication to host for monitor traffic upload */
  3866. HTT_RXDMA_MONITOR_DEST_RING,
  3867. /* (mobile only) used by host to provide remote RX buffers */
  3868. HTT_HOST1_TO_FW_RXBUF_RING,
  3869. /* (mobile only) second ring used by host to provide remote RX buffers*/
  3870. HTT_HOST2_TO_FW_RXBUF_RING,
  3871. /*
  3872. * Add Other SRING which can't be directly configured by host software
  3873. * above this line
  3874. */
  3875. };
  3876. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  3877. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  3878. #define HTT_SRING_SETUP_PDEV_ID_S 8
  3879. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  3880. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  3881. HTT_SRING_SETUP_PDEV_ID_S)
  3882. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  3883. do { \
  3884. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  3885. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  3886. } while (0)
  3887. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  3888. #define HTT_SRING_SETUP_RING_ID_S 16
  3889. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  3890. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  3891. HTT_SRING_SETUP_RING_ID_S)
  3892. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  3893. do { \
  3894. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  3895. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  3896. } while (0)
  3897. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  3898. #define HTT_SRING_SETUP_RING_TYPE_S 24
  3899. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  3900. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  3901. HTT_SRING_SETUP_RING_TYPE_S)
  3902. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  3903. do { \
  3904. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  3905. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  3906. } while (0)
  3907. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  3908. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  3909. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  3910. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  3911. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  3912. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3913. do { \
  3914. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val);\
  3915. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S));\
  3916. } while (0)
  3917. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  3918. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  3919. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  3920. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  3921. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  3922. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3923. do { \
  3924. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val);\
  3925. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S));\
  3926. } while (0)
  3927. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  3928. #define HTT_SRING_SETUP_RING_SIZE_S 0
  3929. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  3930. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  3931. HTT_SRING_SETUP_RING_SIZE_S)
  3932. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  3933. do { \
  3934. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  3935. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  3936. } while (0)
  3937. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  3938. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  3939. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  3940. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  3941. HTT_SRING_SETUP_ENTRY_SIZE_S)
  3942. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  3943. do { \
  3944. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  3945. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  3946. } while (0)
  3947. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  3948. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  3949. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var)\
  3950. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  3951. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  3952. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  3953. do { \
  3954. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  3955. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  3956. } while (0)
  3957. /* This control bit is applicable to only Producer, which updates Ring ID field
  3958. * of each descriptor before pushing into the ring.
  3959. * 0: updates ring_id(default)
  3960. * 1: ring_id updating disabled
  3961. */
  3962. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  3963. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  3964. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  3965. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  3966. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  3967. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  3968. do { \
  3969. HTT_CHECK_SET_VAL( \
  3970. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val);\
  3971. ((_var) |= ((_val) << \
  3972. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  3973. } while (0)
  3974. /* This control bit is applicable to only Producer, which updates Loopcnt field
  3975. * of each descriptor before pushing into the ring.
  3976. * 0: updates Loopcnt(default)
  3977. * 1: Loopcnt updating disabled
  3978. */
  3979. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  3980. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  3981. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  3982. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  3983. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  3984. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  3985. do { \
  3986. HTT_CHECK_SET_VAL( \
  3987. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  3988. ((_var) |= ((_val) << \
  3989. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  3990. } while (0)
  3991. /* Secured access enable/disable bit. SRNG drives value of this register bit
  3992. * into security_id port of GXI/AXI.
  3993. */
  3994. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  3995. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  3996. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  3997. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  3998. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  3999. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4000. do { \
  4001. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY,\
  4002. _val); \
  4003. ((_var) |= ((_val) << \
  4004. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S));\
  4005. } while (0)
  4006. /* During MSI write operation, SRNG drives value of this register bit into
  4007. * swap bit of GXI/AXI.
  4008. */
  4009. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4010. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4011. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4012. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4013. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4014. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4015. do { \
  4016. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP,\
  4017. _val); \
  4018. ((_var) |= ((_val) << \
  4019. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4020. } while (0)
  4021. /* During Pointer write operation, SRNG drives value of this register bit into
  4022. * swap bit of GXI/AXI.
  4023. */
  4024. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4025. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4026. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4027. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4028. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4029. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4030. do { \
  4031. HTT_CHECK_SET_VAL( \
  4032. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4033. ((_var) |= ((_val) << \
  4034. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4035. } while (0)
  4036. /* During any data or TLV write operation, SRNG drives value of this register
  4037. * bit into swap bit of GXI/AXI.
  4038. */
  4039. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4040. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4041. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4042. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4043. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4044. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4045. do { \
  4046. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP,\
  4047. _val); \
  4048. ((_var) |= ((_val) << \
  4049. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S));\
  4050. } while (0)
  4051. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4052. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4053. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4054. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4055. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4056. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4057. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4058. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4059. do { \
  4060. HTT_CHECK_SET_VAL( \
  4061. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4062. ((_var) |= ((_val) << \
  4063. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4064. } while (0)
  4065. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4066. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4067. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4068. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >>\
  4069. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4070. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val)\
  4071. do { \
  4072. HTT_CHECK_SET_VAL( \
  4073. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val);\
  4074. ((_var) |= ((_val) << \
  4075. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4076. } while (0)
  4077. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4078. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4079. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4080. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4081. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4082. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4083. do { \
  4084. HTT_CHECK_SET_VAL( \
  4085. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4086. ((_var) |= ((_val) << \
  4087. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S));\
  4088. } while (0)
  4089. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4090. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4091. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4092. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4093. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4094. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL( \
  4097. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4098. ((_var) |= ((_val) << \
  4099. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4100. } while (0)
  4101. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4102. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4103. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4104. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4105. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4106. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4107. do { \
  4108. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4109. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4110. } while (0)
  4111. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4112. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4113. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4114. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4115. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4116. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4117. do { \
  4118. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4119. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4120. } while (0)
  4121. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4122. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4123. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4124. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4125. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4126. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4129. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4130. } while (0)
  4131. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4132. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4133. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4134. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4135. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4136. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4137. do { \
  4138. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4139. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4140. } while (0)
  4141. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4142. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4143. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4144. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4145. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4146. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4147. do { \
  4148. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4149. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4150. } while (0)
  4151. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4152. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4153. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4154. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4155. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4156. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4157. do { \
  4158. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4159. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4160. } while (0)
  4161. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4162. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4163. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4164. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4165. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4166. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4169. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4170. } while (0)
  4171. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4172. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4173. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4174. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4175. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4176. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4179. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4180. } while (0)
  4181. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4182. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4183. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4184. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4185. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4186. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4187. do { \
  4188. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4189. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4190. } while (0)
  4191. /**
  4192. * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
  4193. *
  4194. * @details
  4195. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4196. * configure RXDMA rings.
  4197. * The configuration is per ring based and includes both packet subtypes
  4198. * and PPDU/MPDU TLVs.
  4199. *
  4200. * The message would appear as follows:
  4201. *
  4202. * |31 26|25|24|23 16|15 8|7 0|
  4203. * |-----------------+----------------+----------------+---------------|
  4204. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  4205. * |-------------------------------------------------------------------|
  4206. * | rsvd2 | ring_buffer_size |
  4207. * |-------------------------------------------------------------------|
  4208. * | packet_type_enable_flags_0 |
  4209. * |-------------------------------------------------------------------|
  4210. * | packet_type_enable_flags_1 |
  4211. * |-------------------------------------------------------------------|
  4212. * | packet_type_enable_flags_2 |
  4213. * |-------------------------------------------------------------------|
  4214. * | packet_type_enable_flags_3 |
  4215. * |-------------------------------------------------------------------|
  4216. * | tlv_filter_in_flags |
  4217. * |-------------------------------------------------------------------|
  4218. * Where:
  4219. * PS = pkt_swap
  4220. * SS = status_swap
  4221. * The message is interpreted as follows:
  4222. * dword0 - b'0:7 - msg_type: This will be set to
  4223. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4224. * b'8:15 - pdev_id:
  4225. * 0 (for rings at SOC/UMAC level),
  4226. * 1/2/3 mac id (for rings at LMAC level)
  4227. * b'16:23 - ring_id : Identify the ring to configure.
  4228. * More details can be got from enum htt_srng_ring_id
  4229. * b'24 - status_swap: 1 is to swap status TLV
  4230. * b'25 - pkt_swap: 1 is to swap packet TLV
  4231. * b'26:31 - rsvd1: reserved for future use
  4232. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4233. * in byte units.
  4234. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4235. * - b'16:31 - rsvd2: Reserved for future use
  4236. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4237. * Enable MGMT packet from 0b0000 to 0b1001
  4238. * bits from low to high: FP, MD, MO - 3 bits
  4239. * FP: Filter_Pass
  4240. * MD: Monitor_Direct
  4241. * MO: Monitor_Other
  4242. * 10 mgmt subtypes * 3 bits -> 30 bits
  4243. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4244. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4245. * Enable MGMT packet from 0b1010 to 0b1111
  4246. * bits from low to high: FP, MD, MO - 3 bits
  4247. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4248. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4249. * Enable CTRL packet from 0b0000 to 0b1001
  4250. * bits from low to high: FP, MD, MO - 3 bits
  4251. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4252. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4253. * Enable CTRL packet from 0b1010 to 0b1111,
  4254. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4255. * bits from low to high: FP, MD, MO - 3 bits
  4256. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4257. * dword6 - b'0:31 - tlv_filter_in_flags:
  4258. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4259. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4260. */
  4261. PREPACK struct htt_rx_ring_selection_cfg_t {
  4262. A_UINT32 msg_type: 8,
  4263. pdev_id: 8,
  4264. ring_id: 8,
  4265. status_swap: 1,
  4266. pkt_swap: 1,
  4267. rsvd1: 6;
  4268. A_UINT32 ring_buffer_size: 16,
  4269. rsvd2: 16;
  4270. A_UINT32 packet_type_enable_flags_0;
  4271. A_UINT32 packet_type_enable_flags_1;
  4272. A_UINT32 packet_type_enable_flags_2;
  4273. A_UINT32 packet_type_enable_flags_3;
  4274. A_UINT32 tlv_filter_in_flags;
  4275. } POSTPACK;
  4276. #define HTT_RX_RING_SELECTION_CFG_SZ \
  4277. (sizeof(struct htt_rx_ring_selection_cfg_t))
  4278. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4279. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4280. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4281. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4282. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4283. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4286. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4287. } while (0)
  4288. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4289. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4290. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4291. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4292. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4293. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4294. do { \
  4295. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4296. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4297. } while (0)
  4298. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4299. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4300. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4301. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4302. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4303. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP,\
  4306. _val); \
  4307. ((_var) |= ((_val) << \
  4308. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4309. } while (0)
  4310. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4311. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4312. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4313. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4314. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4315. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP,\
  4318. _val); \
  4319. ((_var) |= ((_val) << \
  4320. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4321. } while (0)
  4322. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4323. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4324. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4325. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4326. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4327. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4328. do { \
  4329. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE,\
  4330. _val); \
  4331. ((_var) |= ((_val) << \
  4332. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4333. } while (0)
  4334. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4335. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4336. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4337. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4338. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4339. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4340. do { \
  4341. HTT_CHECK_SET_VAL( \
  4342. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, \
  4343. _val); \
  4344. ((_var) |= ((_val) << \
  4345. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4346. } while (0)
  4347. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4348. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4349. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4350. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4351. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4352. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4353. do { \
  4354. HTT_CHECK_SET_VAL( \
  4355. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val);\
  4356. ((_var) |= ((_val) << \
  4357. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4358. } while (0)
  4359. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4362. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4363. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4364. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4365. do { \
  4366. HTT_CHECK_SET_VAL( \
  4367. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val);\
  4368. ((_var) |= ((_val) << \
  4369. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4370. } while (0)
  4371. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4372. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4373. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4374. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4375. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4377. do { \
  4378. HTT_CHECK_SET_VAL( \
  4379. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val);\
  4380. ((_var) |= ((_val) << \
  4381. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4382. } while (0)
  4383. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4384. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4385. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4386. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4387. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4388. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4389. do { \
  4390. HTT_CHECK_SET_VAL( \
  4391. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4392. ((_var) |= ((_val) << \
  4393. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4394. } while (0)
  4395. /*
  4396. * Subtype based MGMT frames enable bits.
  4397. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4398. */
  4399. /* association request */
  4400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M \
  4401. 0x00000001
  4402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M \
  4404. 0x00000002
  4405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M \
  4407. 0x00000004
  4408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4409. /* association response */
  4410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M \
  4411. 0x00000008
  4412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M \
  4414. 0x00000010
  4415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M \
  4417. 0x00000020
  4418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4419. /* Reassociation request */
  4420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M \
  4421. 0x00000040
  4422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M \
  4424. 0x00000080
  4425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M \
  4427. 0x00000100
  4428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4429. /* Reassociation response */
  4430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M \
  4431. 0x00000200
  4432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M \
  4434. 0x00000400
  4435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M \
  4437. 0x00000800
  4438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4439. /* Probe request */
  4440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M \
  4441. 0x00001000
  4442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  4443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M \
  4444. 0x00002000
  4445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  4446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M \
  4447. 0x00004000
  4448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  4449. /* Probe response */
  4450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M \
  4451. 0x00008000
  4452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  4453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M \
  4454. 0x00010000
  4455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  4456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M \
  4457. 0x00020000
  4458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  4459. /* Timing Advertisement */
  4460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M \
  4461. 0x00040000
  4462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  4463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M \
  4464. 0x00080000
  4465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  4466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M \
  4467. 0x00100000
  4468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  4469. /* Reserved */
  4470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M \
  4471. 0x00200000
  4472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  4473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M \
  4474. 0x00400000
  4475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  4476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M \
  4477. 0x00800000
  4478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  4479. /* Beacon */
  4480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M \
  4481. 0x01000001
  4482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  4483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M \
  4484. 0x02000001
  4485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  4486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M \
  4487. 0x00000001
  4488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  4489. /* ATIM */
  4490. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M \
  4491. 0x00000001
  4492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  4493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M \
  4494. 0x00000001
  4495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  4496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M \
  4497. 0x00000001
  4498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  4499. /* Disassociation */
  4500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M \
  4501. 0x00000001
  4502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  4503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M \
  4504. 0x00000002
  4505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  4506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M \
  4507. 0x00000004
  4508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  4509. /* Authentication */
  4510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M \
  4511. 0x00000008
  4512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  4513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M \
  4514. 0x00000010
  4515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  4516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M \
  4517. 0x00000020
  4518. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  4519. /* Deauthentication */
  4520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M \
  4521. 0x00000040
  4522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  4523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M \
  4524. 0x00000080
  4525. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  4526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M \
  4527. 0x00000100
  4528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  4529. /* Action */
  4530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M \
  4531. 0x00000200
  4532. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  4533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M \
  4534. 0x00000400
  4535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  4536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M \
  4537. 0x00000800
  4538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  4539. /* Action No Ack */
  4540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M \
  4541. 0x00001000
  4542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  4543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M \
  4544. 0x00002000
  4545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  4546. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M \
  4547. 0x00004000
  4548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  4549. /* Reserved */
  4550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M \
  4551. 0x00008000
  4552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  4553. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M \
  4554. 0x00010000
  4555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  4556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M \
  4557. 0x00020000
  4558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  4559. /*
  4560. * Subtype based CTRL frames enable bits.
  4561. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  4562. */
  4563. /* Reserved */
  4564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M \
  4565. 0x00000001
  4566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  4567. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M \
  4568. 0x00000002
  4569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  4570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M \
  4571. 0x00000004
  4572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  4573. /* Reserved */
  4574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M \
  4575. 0x00000008
  4576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  4577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M \
  4578. 0x00000010
  4579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  4580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M \
  4581. 0x00000020
  4582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  4583. /* Reserved */
  4584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M \
  4585. 0x00000040
  4586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  4587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M \
  4588. 0x00000080
  4589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  4590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M \
  4591. 0x00000100
  4592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  4593. /* Reserved */
  4594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M \
  4595. 0x00000200
  4596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  4597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M \
  4598. 0x00000400
  4599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  4600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M \
  4601. 0x00000800
  4602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  4603. /* Reserved */
  4604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M \
  4605. 0x00001000
  4606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  4607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M \
  4608. 0x00002000
  4609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  4610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M \
  4611. 0x00004000
  4612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  4613. /* Reserved */
  4614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M \
  4615. 0x00008000
  4616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  4617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M \
  4618. 0x00010000
  4619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  4620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M \
  4621. 0x00020000
  4622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  4623. /* Reserved */
  4624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M \
  4625. 0x00040000
  4626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  4627. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M \
  4628. 0x00080000
  4629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  4630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M \
  4631. 0x00100000
  4632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  4633. /* Control Wrapper */
  4634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M \
  4635. 0x00200000
  4636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  4637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M \
  4638. 0x00400000
  4639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  4640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M \
  4641. 0x00800000
  4642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  4643. /* Block Ack Request */
  4644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M \
  4645. 0x01000001
  4646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  4647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M \
  4648. 0x02000001
  4649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  4650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M \
  4651. 0x00000001
  4652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  4653. /* Block Ack*/
  4654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M \
  4655. 0x00000001
  4656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  4657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M \
  4658. 0x00000001
  4659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  4660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M \
  4661. 0x00000001
  4662. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  4663. /* PS-POLL */
  4664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M \
  4665. 0x00000001
  4666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  4667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M \
  4668. 0x00000002
  4669. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  4670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M \
  4671. 0x00000004
  4672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  4673. /* RTS */
  4674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M \
  4675. 0x00000008
  4676. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  4677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M \
  4678. 0x00000010
  4679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  4680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M \
  4681. 0x00000020
  4682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  4683. /* CTS */
  4684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M \
  4685. 0x00000040
  4686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  4687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M \
  4688. 0x00000080
  4689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  4690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M \
  4691. 0x00000100
  4692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  4693. /* ACK */
  4694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M \
  4695. 0x00000200
  4696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  4697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M \
  4698. 0x00000400
  4699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  4700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M \
  4701. 0x00000800
  4702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  4703. /* CF-END */
  4704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M \
  4705. 0x00001000
  4706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  4707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M \
  4708. 0x00002000
  4709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  4710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M \
  4711. 0x00004000
  4712. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  4713. /* CF-END + CF-ACK */
  4714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M \
  4715. 0x00008000
  4716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  4717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M \
  4718. 0x00010000
  4719. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  4720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M \
  4721. 0x00020000
  4722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  4723. /* Multicast data */
  4724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M \
  4725. 0x00040000
  4726. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  4727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M \
  4728. 0x00080000
  4729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  4730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M \
  4731. 0x00100000
  4732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  4733. /* Unicast data */
  4734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M \
  4735. 0x00200000
  4736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  4737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M \
  4738. 0x00400000
  4739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  4740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M \
  4741. 0x00800000
  4742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  4743. /* NULL data */
  4744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M \
  4745. 0x01000000
  4746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  4747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M \
  4748. 0x02000000
  4749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  4750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M \
  4751. 0x04000000
  4752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  4753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  4754. do { \
  4755. HTT_CHECK_SET_VAL(httsym, value); \
  4756. (word) |= (value) << httsym##_S; \
  4757. } while (0)
  4758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  4759. (((word) & httsym##_M) >> httsym##_S)
  4760. #define htt_rx_ring_pkt_enable_subtype_set( \
  4761. word, flag, mode, type, subtype, val) \
  4762. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, \
  4763. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype,\
  4764. val)
  4765. #define htt_rx_ring_pkt_enable_subtype_get( \
  4766. word, flag, mode, type, subtype) \
  4767. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word,\
  4768. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  4769. /* Definition to filter in TLVs */
  4770. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  4771. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  4772. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  4773. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  4774. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  4775. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  4776. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  4777. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  4778. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  4779. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  4780. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M \
  4781. 0x00000020
  4782. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  4783. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  4784. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  4785. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  4786. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  4787. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  4788. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  4789. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  4790. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  4791. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M \
  4792. 0x00000400
  4793. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  4794. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  4795. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  4796. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M \
  4797. 0x00001000
  4798. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S\
  4799. 12
  4800. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  4801. do { \
  4802. HTT_CHECK_SET_VAL(httsym, enable); \
  4803. (word) |= (enable) << httsym##_S; \
  4804. } while (0)
  4805. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  4806. (((word) & httsym##_M) >> httsym##_S)
  4807. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  4808. HTT_RX_RING_TLV_ENABLE_SET( \
  4809. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  4810. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  4811. HTT_RX_RING_TLV_ENABLE_GET(word, \
  4812. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  4813. /**
  4814. * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
  4815. * host --> target Receive Flow Steering configuration message definition.
  4816. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4817. * The reason for this is we want RFS to be configured and ready before MAC
  4818. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  4819. *
  4820. * |31 24|23 16|15 9|8|7 0|
  4821. * |----------------+----------------+----------------+----------------|
  4822. * | reserved |E| msg type |
  4823. * |-------------------------------------------------------------------|
  4824. * Where E = RFS enable flag
  4825. *
  4826. * The RFS_CONFIG message consists of a single 4-byte word.
  4827. *
  4828. * Header fields:
  4829. * - MSG_TYPE
  4830. * Bits 7:0
  4831. * Purpose: identifies this as a RFS config msg
  4832. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  4833. * - RFS_CONFIG
  4834. * Bit 8
  4835. * Purpose: Tells target whether to enable (1) or disable (0)
  4836. * flow steering feature when sending rx indication messages to host
  4837. */
  4838. #define HTT_RFS_CFG_REQ_BYTES 4
  4839. #define HTT_H2T_RFS_CONFIG_M 0x100
  4840. #define HTT_H2T_RFS_CONFIG_S 8
  4841. #define HTT_RX_RFS_CONFIG_GET(_var) \
  4842. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  4843. HTT_H2T_RFS_CONFIG_S)
  4844. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  4845. do { \
  4846. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  4847. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  4848. } while (0)
  4849. /*=== target -> host messages ===============================================*/
  4850. enum htt_t2h_msg_type {
  4851. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  4852. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  4853. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  4854. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  4855. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  4856. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  4857. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  4858. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  4859. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  4860. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  4861. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  4862. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  4863. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc,/* no longer used */
  4864. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  4865. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  4866. /* only used for HL, add HTT MSG for HTT CREDIT update */
  4867. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  4868. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  4869. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  4870. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  4871. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  4872. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  4873. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  4874. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  4875. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  4876. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  4877. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  4878. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  4879. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  4880. HTT_T2H_MSG_TYPE_TEST,
  4881. /* keep this last */
  4882. HTT_T2H_NUM_MSGS
  4883. };
  4884. /*
  4885. * HTT target to host message type -
  4886. * stored in bits 7:0 of the first word of the message
  4887. */
  4888. #define HTT_T2H_MSG_TYPE_M 0xff
  4889. #define HTT_T2H_MSG_TYPE_S 0
  4890. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  4891. do { \
  4892. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  4893. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  4894. } while (0)
  4895. #define HTT_T2H_MSG_TYPE_GET(word) \
  4896. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  4897. /**
  4898. * @brief target -> host version number confirmation message definition
  4899. *
  4900. * |31 24|23 16|15 8|7 0|
  4901. * |----------------+----------------+----------------+----------------|
  4902. * | reserved | major number | minor number | msg type |
  4903. * |-------------------------------------------------------------------|
  4904. * : option request TLV (optional) |
  4905. * :...................................................................:
  4906. *
  4907. * The VER_CONF message may consist of a single 4-byte word, or may be
  4908. * extended with TLVs that specify HTT options selected by the target.
  4909. * The following option TLVs may be appended to the VER_CONF message:
  4910. * - LL_BUS_ADDR_SIZE
  4911. * - HL_SUPPRESS_TX_COMPL_IND
  4912. * - MAX_TX_QUEUE_GROUPS
  4913. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  4914. * may be appended to the VER_CONF message (but only one TLV of each type).
  4915. *
  4916. * Header fields:
  4917. * - MSG_TYPE
  4918. * Bits 7:0
  4919. * Purpose: identifies this as a version number confirmation message
  4920. * Value: 0x0
  4921. * - VER_MINOR
  4922. * Bits 15:8
  4923. * Purpose: Specify the minor number of the HTT message library version
  4924. * in use by the target firmware.
  4925. * The minor number specifies the specific revision within a range
  4926. * of fundamentally compatible HTT message definition revisions.
  4927. * Compatible revisions involve adding new messages or perhaps
  4928. * adding new fields to existing messages, in a backwards-compatible
  4929. * manner.
  4930. * Incompatible revisions involve changing the message type values,
  4931. * or redefining existing messages.
  4932. * Value: minor number
  4933. * - VER_MAJOR
  4934. * Bits 15:8
  4935. * Purpose: Specify the major number of the HTT message library version
  4936. * in use by the target firmware.
  4937. * The major number specifies the family of minor revisions that are
  4938. * fundamentally compatible with each other, but not with prior or
  4939. * later families.
  4940. * Value: major number
  4941. */
  4942. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  4943. #define HTT_VER_CONF_MINOR_S 8
  4944. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  4945. #define HTT_VER_CONF_MAJOR_S 16
  4946. #define HTT_VER_CONF_MINOR_SET(word, value) \
  4947. do { \
  4948. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  4949. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  4950. } while (0)
  4951. #define HTT_VER_CONF_MINOR_GET(word) \
  4952. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  4953. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  4954. do { \
  4955. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  4956. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  4957. } while (0)
  4958. #define HTT_VER_CONF_MAJOR_GET(word) \
  4959. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  4960. #define HTT_VER_CONF_BYTES 4
  4961. /**
  4962. * @brief - target -> host HTT Rx In order indication message
  4963. *
  4964. * @details
  4965. *
  4966. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  4967. * |----------------+-------------------+---------------------+---------------|
  4968. * | peer ID | P| F| O| ext TID | msg type |
  4969. * |--------------------------------------------------------------------------|
  4970. * | MSDU count | Reserved | vdev id |
  4971. * |--------------------------------------------------------------------------|
  4972. * | MSDU 0 bus address (bits 31:0) |
  4973. #if HTT_PADDR64
  4974. * | MSDU 0 bus address (bits 63:32) |
  4975. #endif
  4976. * |--------------------------------------------------------------------------|
  4977. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  4978. * |--------------------------------------------------------------------------|
  4979. * | MSDU 1 bus address (bits 31:0) |
  4980. #if HTT_PADDR64
  4981. * | MSDU 1 bus address (bits 63:32) |
  4982. #endif
  4983. * |--------------------------------------------------------------------------|
  4984. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  4985. * |--------------------------------------------------------------------------|
  4986. */
  4987. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  4988. *
  4989. * @details
  4990. * bits
  4991. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  4992. * |-----+----+-------+--------+--------+---------+---------+-----------|
  4993. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  4994. * | | frag | | | | fail |chksum fail|
  4995. * |-----+----+-------+--------+--------+---------+---------+-----------|
  4996. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  4997. */
  4998. struct htt_rx_in_ord_paddr_ind_hdr_t {
  4999. A_UINT32 /* word 0 */
  5000. msg_type:8,
  5001. ext_tid:5,
  5002. offload:1,
  5003. frag:1,
  5004. /*
  5005. * Tell host whether to store MSDUs referenced in this message
  5006. * in pktlog
  5007. */
  5008. pktlog:1,
  5009. peer_id:16;
  5010. A_UINT32 /* word 1 */
  5011. vap_id:8,
  5012. reserved_1:8,
  5013. msdu_cnt:16;
  5014. };
  5015. struct htt_rx_in_ord_paddr_ind_msdu32_t {
  5016. A_UINT32 dma_addr;
  5017. A_UINT32
  5018. length:16,
  5019. fw_desc:8,
  5020. msdu_info:8;
  5021. };
  5022. struct htt_rx_in_ord_paddr_ind_msdu64_t {
  5023. A_UINT32 dma_addr_lo;
  5024. A_UINT32 dma_addr_hi;
  5025. A_UINT32
  5026. length:16,
  5027. fw_desc:8,
  5028. msdu_info:8;
  5029. };
  5030. #if HTT_PADDR64
  5031. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  5032. #else
  5033. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  5034. #endif
  5035. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES \
  5036. (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  5037. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS \
  5038. (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  5039. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET \
  5040. HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  5041. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET \
  5042. HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  5043. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 \
  5044. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  5045. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 \
  5046. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  5047. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 \
  5048. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  5049. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 \
  5050. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  5051. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES \
  5052. (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  5053. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS \
  5054. (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  5055. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  5056. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  5057. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  5058. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  5059. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  5060. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  5061. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  5062. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  5063. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  5064. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  5065. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  5066. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  5067. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  5068. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  5069. /* for systems using 64-bit format for bus addresses */
  5070. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  5071. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  5072. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  5073. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  5074. /* for systems using 32-bit format for bus addresses */
  5075. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  5076. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  5077. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  5078. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  5079. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  5080. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  5081. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  5082. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  5083. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  5084. do { \
  5085. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  5086. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  5087. } while (0)
  5088. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  5089. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> \
  5090. HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  5091. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  5092. do { \
  5093. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  5094. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  5095. } while (0)
  5096. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  5097. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> \
  5098. HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  5099. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  5100. do { \
  5101. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  5102. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  5103. } while (0)
  5104. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  5105. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> \
  5106. HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  5107. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  5108. do { \
  5109. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  5110. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  5111. } while (0)
  5112. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  5113. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> \
  5114. HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  5115. /* for systems using 64-bit format for bus addresses */
  5116. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  5117. do { \
  5118. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  5119. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  5120. } while (0)
  5121. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  5122. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> \
  5123. HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  5124. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  5125. do { \
  5126. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  5127. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  5128. } while (0)
  5129. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  5130. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> \
  5131. HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  5132. /* for systems using 32-bit format for bus addresses */
  5133. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  5134. do { \
  5135. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  5136. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  5137. } while (0)
  5138. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  5139. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> \
  5140. HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  5141. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  5142. do { \
  5143. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value);\
  5144. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  5145. } while (0)
  5146. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  5147. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> \
  5148. HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  5149. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  5150. do { \
  5151. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  5152. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  5153. } while (0)
  5154. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  5155. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> \
  5156. HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  5157. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  5158. do { \
  5159. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value);\
  5160. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S;\
  5161. } while (0)
  5162. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  5163. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> \
  5164. HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  5165. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  5166. do { \
  5167. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value);\
  5168. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  5169. } while (0)
  5170. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  5171. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> \
  5172. HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  5173. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  5174. do { \
  5175. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  5176. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  5177. } while (0)
  5178. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  5179. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> \
  5180. HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  5181. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  5182. do { \
  5183. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  5184. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  5185. } while (0)
  5186. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  5187. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> \
  5188. HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  5189. /* definitions used within target -> host rx indication message */
  5190. PREPACK struct htt_rx_ind_hdr_prefix_t {
  5191. A_UINT32 /* word 0 */
  5192. msg_type:8,
  5193. ext_tid:5,
  5194. release_valid:1,
  5195. flush_valid:1,
  5196. reserved0:1,
  5197. peer_id:16;
  5198. A_UINT32 /* word 1 */
  5199. flush_start_seq_num:6,
  5200. flush_end_seq_num:6,
  5201. release_start_seq_num:6,
  5202. release_end_seq_num:6,
  5203. num_mpdu_ranges:8;
  5204. } POSTPACK;
  5205. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  5206. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  5207. #define HTT_TGT_RSSI_INVALID 0x80
  5208. PREPACK struct htt_rx_ppdu_desc_t {
  5209. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  5210. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  5211. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  5212. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  5213. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  5214. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  5215. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  5216. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  5217. A_UINT32 /* word 0 */
  5218. rssi_cmb:8,
  5219. timestamp_submicrosec:8,
  5220. phy_err_code:8,
  5221. phy_err:1,
  5222. legacy_rate:4,
  5223. legacy_rate_sel:1,
  5224. end_valid:1,
  5225. start_valid:1;
  5226. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  5227. union {
  5228. A_UINT32 /* word 1 */
  5229. rssi0_pri20:8,
  5230. rssi0_ext20:8,
  5231. rssi0_ext40:8,
  5232. rssi0_ext80:8;
  5233. A_UINT32 rssi0; /* access all 20/40/80 per-b/w RSSIs together */
  5234. } u0;
  5235. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  5236. union {
  5237. A_UINT32 /* word 2 */
  5238. rssi1_pri20:8,
  5239. rssi1_ext20:8,
  5240. rssi1_ext40:8,
  5241. rssi1_ext80:8;
  5242. A_UINT32 rssi1; /* access all 20/40/80 per-b/w RSSIs together */
  5243. } u1;
  5244. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  5245. union {
  5246. A_UINT32 /* word 3 */
  5247. rssi2_pri20:8,
  5248. rssi2_ext20:8,
  5249. rssi2_ext40:8,
  5250. rssi2_ext80:8;
  5251. A_UINT32 rssi2; /* access all 20/40/80 per-b/w RSSIs together */
  5252. } u2;
  5253. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  5254. union {
  5255. A_UINT32 /* word 4 */
  5256. rssi3_pri20:8,
  5257. rssi3_ext20:8,
  5258. rssi3_ext40:8,
  5259. rssi3_ext80:8;
  5260. A_UINT32 rssi3; /* access all 20/40/80 per-b/w RSSIs together */
  5261. } u3;
  5262. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  5263. A_UINT32 tsf32; /* word 5 */
  5264. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  5265. A_UINT32 timestamp_microsec; /* word 6 */
  5266. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  5267. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  5268. A_UINT32 /* word 7 */
  5269. vht_sig_a1:24,
  5270. preamble_type:8;
  5271. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  5272. A_UINT32 /* word 8 */
  5273. vht_sig_a2:24,
  5274. reserved0:8;
  5275. } POSTPACK;
  5276. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  5277. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  5278. PREPACK struct htt_rx_ind_hdr_suffix_t {
  5279. A_UINT32 /* word 0 */
  5280. fw_rx_desc_bytes:16,
  5281. reserved0:16;
  5282. } POSTPACK;
  5283. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  5284. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  5285. PREPACK struct htt_rx_ind_hdr_t {
  5286. struct htt_rx_ind_hdr_prefix_t prefix;
  5287. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  5288. struct htt_rx_ind_hdr_suffix_t suffix;
  5289. } POSTPACK;
  5290. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  5291. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  5292. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  5293. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  5294. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  5295. /*
  5296. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  5297. * the offset into the HTT rx indication message at which the
  5298. * FW rx PPDU descriptor resides
  5299. */
  5300. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  5301. /*
  5302. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  5303. * the offset into the HTT rx indication message at which the
  5304. * header suffix (FW rx MSDU byte count) resides
  5305. */
  5306. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  5307. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  5308. /*
  5309. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  5310. * the offset into the HTT rx indication message at which the per-MSDU
  5311. * information starts
  5312. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  5313. * per-MSDU information portion of the message. The per-MSDU info itself
  5314. * starts at byte 12.
  5315. */
  5316. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  5317. /**
  5318. * @brief target -> host rx indication message definition
  5319. *
  5320. * @details
  5321. * The following field definitions describe the format of the rx indication
  5322. * message sent from the target to the host.
  5323. * The message consists of three major sections:
  5324. * 1. a fixed-length header
  5325. * 2. a variable-length list of firmware rx MSDU descriptors
  5326. * 3. one or more 4-octet MPDU range information elements
  5327. * The fixed length header itself has two sub-sections
  5328. * 1. the message meta-information, including identification of the
  5329. * sender and type of the received data, and a 4-octet flush/release IE
  5330. * 2. the firmware rx PPDU descriptor
  5331. *
  5332. * The format of the message is depicted below.
  5333. * in this depiction, the following abbreviations are used for information
  5334. * elements within the message:
  5335. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  5336. * elements associated with the PPDU start are valid.
  5337. * Specifically, the following fields are valid only if SV is set:
  5338. * RSSI (all variants), L, legacy rate, preamble type, service,
  5339. * VHT-SIG-A
  5340. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  5341. * elements associated with the PPDU end are valid.
  5342. * Specifically, the following fields are valid only if EV is set:
  5343. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  5344. * - L - Legacy rate selector - if legacy rates are used, this flag
  5345. * indicates whether the rate is from a CCK (L == 1) or OFDM
  5346. * (L == 0) PHY.
  5347. * - P - PHY error flag - boolean indication of whether the rx frame had
  5348. * a PHY error
  5349. *
  5350. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  5351. * |----------------+-------------------+---------------------+---------------|
  5352. * | peer ID | |RV|FV| ext TID | msg type |
  5353. * |--------------------------------------------------------------------------|
  5354. * | num | release | release | flush | flush |
  5355. * | MPDU | end | start | end | start |
  5356. * | ranges | seq num | seq num | seq num | seq num |
  5357. * |==========================================================================|
  5358. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  5359. * |V|V| | rate | | | timestamp | RSSI |
  5360. * |--------------------------------------------------------------------------|
  5361. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  5362. * |--------------------------------------------------------------------------|
  5363. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  5364. * |--------------------------------------------------------------------------|
  5365. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  5366. * |--------------------------------------------------------------------------|
  5367. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  5368. * |--------------------------------------------------------------------------|
  5369. * | TSF LSBs |
  5370. * |--------------------------------------------------------------------------|
  5371. * | microsec timestamp |
  5372. * |--------------------------------------------------------------------------|
  5373. * | preamble type | HT-SIG / VHT-SIG-A1 |
  5374. * |--------------------------------------------------------------------------|
  5375. * | service | HT-SIG / VHT-SIG-A2 |
  5376. * |==========================================================================|
  5377. * | reserved | FW rx desc bytes |
  5378. * |--------------------------------------------------------------------------|
  5379. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  5380. * | desc B3 | desc B2 | desc B1 | desc B0 |
  5381. * |--------------------------------------------------------------------------|
  5382. * : : :
  5383. * |--------------------------------------------------------------------------|
  5384. * | alignment | MSDU Rx |
  5385. * | padding | desc Bn |
  5386. * |--------------------------------------------------------------------------|
  5387. * | reserved | MPDU range status | MPDU count |
  5388. * |--------------------------------------------------------------------------|
  5389. * : reserved : MPDU range status : MPDU count :
  5390. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  5391. *
  5392. * Header fields:
  5393. * - MSG_TYPE
  5394. * Bits 7:0
  5395. * Purpose: identifies this as an rx indication message
  5396. * Value: 0x1
  5397. * - EXT_TID
  5398. * Bits 12:8
  5399. * Purpose: identify the traffic ID of the rx data, including
  5400. * special "extended" TID values for multicast, broadcast, and
  5401. * non-QoS data frames
  5402. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  5403. * - FLUSH_VALID (FV)
  5404. * Bit 13
  5405. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  5406. * is valid
  5407. * Value:
  5408. * 1 -> flush IE is valid and needs to be processed
  5409. * 0 -> flush IE is not valid and should be ignored
  5410. * - REL_VALID (RV)
  5411. * Bit 13
  5412. * Purpose: indicate whether the release IE (start/end sequence numbers)
  5413. * is valid
  5414. * Value:
  5415. * 1 -> release IE is valid and needs to be processed
  5416. * 0 -> release IE is not valid and should be ignored
  5417. * - PEER_ID
  5418. * Bits 31:16
  5419. * Purpose: Identify, by ID, which peer sent the rx data
  5420. * Value: ID of the peer who sent the rx data
  5421. * - FLUSH_SEQ_NUM_START
  5422. * Bits 5:0
  5423. * Purpose: Indicate the start of a series of MPDUs to flush
  5424. * Not all MPDUs within this series are necessarily valid - the host
  5425. * must check each sequence number within this range to see if the
  5426. * corresponding MPDU is actually present.
  5427. * This field is only valid if the FV bit is set.
  5428. * Value:
  5429. * The sequence number for the first MPDUs to check to flush.
  5430. * The sequence number is masked by 0x3f.
  5431. * - FLUSH_SEQ_NUM_END
  5432. * Bits 11:6
  5433. * Purpose: Indicate the end of a series of MPDUs to flush
  5434. * Value:
  5435. * The sequence number one larger than the sequence number of the
  5436. * last MPDU to check to flush.
  5437. * The sequence number is masked by 0x3f.
  5438. * Not all MPDUs within this series are necessarily valid - the host
  5439. * must check each sequence number within this range to see if the
  5440. * corresponding MPDU is actually present.
  5441. * This field is only valid if the FV bit is set.
  5442. * - REL_SEQ_NUM_START
  5443. * Bits 17:12
  5444. * Purpose: Indicate the start of a series of MPDUs to release.
  5445. * All MPDUs within this series are present and valid - the host
  5446. * need not check each sequence number within this range to see if
  5447. * the corresponding MPDU is actually present.
  5448. * This field is only valid if the RV bit is set.
  5449. * Value:
  5450. * The sequence number for the first MPDUs to check to release.
  5451. * The sequence number is masked by 0x3f.
  5452. * - REL_SEQ_NUM_END
  5453. * Bits 23:18
  5454. * Purpose: Indicate the end of a series of MPDUs to release.
  5455. * Value:
  5456. * The sequence number one larger than the sequence number of the
  5457. * last MPDU to check to release.
  5458. * The sequence number is masked by 0x3f.
  5459. * All MPDUs within this series are present and valid - the host
  5460. * need not check each sequence number within this range to see if
  5461. * the corresponding MPDU is actually present.
  5462. * This field is only valid if the RV bit is set.
  5463. * - NUM_MPDU_RANGES
  5464. * Bits 31:24
  5465. * Purpose: Indicate how many ranges of MPDUs are present.
  5466. * Each MPDU range consists of a series of contiguous MPDUs within the
  5467. * rx frame sequence which all have the same MPDU status.
  5468. * Value: 1-63 (typically a small number, like 1-3)
  5469. *
  5470. * Rx PPDU descriptor fields:
  5471. * - RSSI_CMB
  5472. * Bits 7:0
  5473. * Purpose: Combined RSSI from all active rx chains, across the active
  5474. * bandwidth.
  5475. * Value: RSSI dB units w.r.t. noise floor
  5476. * - TIMESTAMP_SUBMICROSEC
  5477. * Bits 15:8
  5478. * Purpose: high-resolution timestamp
  5479. * Value:
  5480. * Sub-microsecond time of PPDU reception.
  5481. * This timestamp ranges from [0,MAC clock MHz).
  5482. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  5483. * to form a high-resolution, large range rx timestamp.
  5484. * - PHY_ERR_CODE
  5485. * Bits 23:16
  5486. * Purpose:
  5487. * If the rx frame processing resulted in a PHY error, indicate what
  5488. * type of rx PHY error occurred.
  5489. * Value:
  5490. * This field is valid if the "P" (PHY_ERR) flag is set.
  5491. * TBD: document/specify the values for this field
  5492. * - PHY_ERR
  5493. * Bit 24
  5494. * Purpose: indicate whether the rx PPDU had a PHY error
  5495. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  5496. * - LEGACY_RATE
  5497. * Bits 28:25
  5498. * Purpose:
  5499. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  5500. * specify which rate was used.
  5501. * Value:
  5502. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  5503. * flag.
  5504. * If LEGACY_RATE_SEL is 0:
  5505. * 0x8: OFDM 48 Mbps
  5506. * 0x9: OFDM 24 Mbps
  5507. * 0xA: OFDM 12 Mbps
  5508. * 0xB: OFDM 6 Mbps
  5509. * 0xC: OFDM 54 Mbps
  5510. * 0xD: OFDM 36 Mbps
  5511. * 0xE: OFDM 18 Mbps
  5512. * 0xF: OFDM 9 Mbps
  5513. * If LEGACY_RATE_SEL is 1:
  5514. * 0x8: CCK 11 Mbps long preamble
  5515. * 0x9: CCK 5.5 Mbps long preamble
  5516. * 0xA: CCK 2 Mbps long preamble
  5517. * 0xB: CCK 1 Mbps long preamble
  5518. * 0xC: CCK 11 Mbps short preamble
  5519. * 0xD: CCK 5.5 Mbps short preamble
  5520. * 0xE: CCK 2 Mbps short preamble
  5521. * - LEGACY_RATE_SEL
  5522. * Bit 29
  5523. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  5524. * Value:
  5525. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  5526. * used a legacy rate.
  5527. * 0 -> OFDM, 1 -> CCK
  5528. * - END_VALID
  5529. * Bit 30
  5530. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5531. * the start of the PPDU are valid. Specifically, the following
  5532. * fields are only valid if END_VALID is set:
  5533. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  5534. * TIMESTAMP_SUBMICROSEC
  5535. * Value:
  5536. * 0 -> rx PPDU desc end fields are not valid
  5537. * 1 -> rx PPDU desc end fields are valid
  5538. * - START_VALID
  5539. * Bit 31
  5540. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  5541. * the end of the PPDU are valid. Specifically, the following
  5542. * fields are only valid if START_VALID is set:
  5543. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  5544. * VHT-SIG-A
  5545. * Value:
  5546. * 0 -> rx PPDU desc start fields are not valid
  5547. * 1 -> rx PPDU desc start fields are valid
  5548. * - RSSI0_PRI20
  5549. * Bits 7:0
  5550. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  5551. * Value: RSSI dB units w.r.t. noise floor
  5552. *
  5553. * - RSSI0_EXT20
  5554. * Bits 7:0
  5555. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  5556. * (if the rx bandwidth was >= 40 MHz)
  5557. * Value: RSSI dB units w.r.t. noise floor
  5558. * - RSSI0_EXT40
  5559. * Bits 7:0
  5560. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  5561. * (if the rx bandwidth was >= 80 MHz)
  5562. * Value: RSSI dB units w.r.t. noise floor
  5563. * - RSSI0_EXT80
  5564. * Bits 7:0
  5565. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  5566. * (if the rx bandwidth was >= 160 MHz)
  5567. * Value: RSSI dB units w.r.t. noise floor
  5568. *
  5569. * - RSSI1_PRI20
  5570. * Bits 7:0
  5571. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  5572. * Value: RSSI dB units w.r.t. noise floor
  5573. * - RSSI1_EXT20
  5574. * Bits 7:0
  5575. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  5576. * (if the rx bandwidth was >= 40 MHz)
  5577. * Value: RSSI dB units w.r.t. noise floor
  5578. * - RSSI1_EXT40
  5579. * Bits 7:0
  5580. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  5581. * (if the rx bandwidth was >= 80 MHz)
  5582. * Value: RSSI dB units w.r.t. noise floor
  5583. * - RSSI1_EXT80
  5584. * Bits 7:0
  5585. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  5586. * (if the rx bandwidth was >= 160 MHz)
  5587. * Value: RSSI dB units w.r.t. noise floor
  5588. *
  5589. * - RSSI2_PRI20
  5590. * Bits 7:0
  5591. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  5592. * Value: RSSI dB units w.r.t. noise floor
  5593. * - RSSI2_EXT20
  5594. * Bits 7:0
  5595. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  5596. * (if the rx bandwidth was >= 40 MHz)
  5597. * Value: RSSI dB units w.r.t. noise floor
  5598. * - RSSI2_EXT40
  5599. * Bits 7:0
  5600. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  5601. * (if the rx bandwidth was >= 80 MHz)
  5602. * Value: RSSI dB units w.r.t. noise floor
  5603. * - RSSI2_EXT80
  5604. * Bits 7:0
  5605. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  5606. * (if the rx bandwidth was >= 160 MHz)
  5607. * Value: RSSI dB units w.r.t. noise floor
  5608. *
  5609. * - RSSI3_PRI20
  5610. * Bits 7:0
  5611. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  5612. * Value: RSSI dB units w.r.t. noise floor
  5613. * - RSSI3_EXT20
  5614. * Bits 7:0
  5615. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  5616. * (if the rx bandwidth was >= 40 MHz)
  5617. * Value: RSSI dB units w.r.t. noise floor
  5618. * - RSSI3_EXT40
  5619. * Bits 7:0
  5620. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  5621. * (if the rx bandwidth was >= 80 MHz)
  5622. * Value: RSSI dB units w.r.t. noise floor
  5623. * - RSSI3_EXT80
  5624. * Bits 7:0
  5625. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  5626. * (if the rx bandwidth was >= 160 MHz)
  5627. * Value: RSSI dB units w.r.t. noise floor
  5628. *
  5629. * - TSF32
  5630. * Bits 31:0
  5631. * Purpose: specify the time the rx PPDU was received, in TSF units
  5632. * Value: 32 LSBs of the TSF
  5633. * - TIMESTAMP_MICROSEC
  5634. * Bits 31:0
  5635. * Purpose: specify the time the rx PPDU was received, in microsecond units
  5636. * Value: PPDU rx time, in microseconds
  5637. * - VHT_SIG_A1
  5638. * Bits 23:0
  5639. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  5640. * from the rx PPDU
  5641. * Value:
  5642. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5643. * VHT-SIG-A1 data.
  5644. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5645. * first 24 bits of the HT-SIG data.
  5646. * Otherwise, this field is invalid.
  5647. * Refer to the the 802.11 protocol for the definition of the
  5648. * HT-SIG and VHT-SIG-A1 fields
  5649. * - VHT_SIG_A2
  5650. * Bits 23:0
  5651. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  5652. * from the rx PPDU
  5653. * Value:
  5654. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  5655. * VHT-SIG-A2 data.
  5656. * If PREAMBLE_TYPE specifies HT, then this field contains the
  5657. * last 24 bits of the HT-SIG data.
  5658. * Otherwise, this field is invalid.
  5659. * Refer to the the 802.11 protocol for the definition of the
  5660. * HT-SIG and VHT-SIG-A2 fields
  5661. * - PREAMBLE_TYPE
  5662. * Bits 31:24
  5663. * Purpose: indicate the PHY format of the received burst
  5664. * Value:
  5665. * 0x4: Legacy (OFDM/CCK)
  5666. * 0x8: HT
  5667. * 0x9: HT with TxBF
  5668. * 0xC: VHT
  5669. * 0xD: VHT with TxBF
  5670. * - SERVICE
  5671. * Bits 31:24
  5672. * Purpose: TBD
  5673. * Value: TBD
  5674. *
  5675. * Rx MSDU descriptor fields:
  5676. * - FW_RX_DESC_BYTES
  5677. * Bits 15:0
  5678. * Purpose: Indicate how many bytes in the Rx indication are used for
  5679. * FW Rx descriptors
  5680. *
  5681. * Payload fields:
  5682. * - MPDU_COUNT
  5683. * Bits 7:0
  5684. * Purpose: Indicate how many sequential MPDUs share the same status.
  5685. * All MPDUs within the indicated list are from the same RA-TA-TID.
  5686. * - MPDU_STATUS
  5687. * Bits 15:8
  5688. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  5689. * received successfully.
  5690. * Value:
  5691. * 0x1: success
  5692. * 0x2: FCS error
  5693. * 0x3: duplicate error
  5694. * 0x4: replay error
  5695. * 0x5: invalid peer
  5696. */
  5697. /* header fields */
  5698. #define HTT_RX_IND_EXT_TID_M 0x1f00
  5699. #define HTT_RX_IND_EXT_TID_S 8
  5700. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  5701. #define HTT_RX_IND_FLUSH_VALID_S 13
  5702. #define HTT_RX_IND_REL_VALID_M 0x4000
  5703. #define HTT_RX_IND_REL_VALID_S 14
  5704. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  5705. #define HTT_RX_IND_PEER_ID_S 16
  5706. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  5707. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  5708. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  5709. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  5710. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  5711. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  5712. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  5713. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  5714. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  5715. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  5716. /* rx PPDU descriptor fields */
  5717. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  5718. #define HTT_RX_IND_RSSI_CMB_S 0
  5719. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  5720. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  5721. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  5722. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  5723. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  5724. #define HTT_RX_IND_PHY_ERR_S 24
  5725. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  5726. #define HTT_RX_IND_LEGACY_RATE_S 25
  5727. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  5728. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  5729. #define HTT_RX_IND_END_VALID_M 0x40000000
  5730. #define HTT_RX_IND_END_VALID_S 30
  5731. #define HTT_RX_IND_START_VALID_M 0x80000000
  5732. #define HTT_RX_IND_START_VALID_S 31
  5733. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  5734. #define HTT_RX_IND_RSSI_PRI20_S 0
  5735. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  5736. #define HTT_RX_IND_RSSI_EXT20_S 8
  5737. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  5738. #define HTT_RX_IND_RSSI_EXT40_S 16
  5739. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  5740. #define HTT_RX_IND_RSSI_EXT80_S 24
  5741. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  5742. #define HTT_RX_IND_VHT_SIG_A1_S 0
  5743. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  5744. #define HTT_RX_IND_VHT_SIG_A2_S 0
  5745. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  5746. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  5747. #define HTT_RX_IND_SERVICE_M 0xff000000
  5748. #define HTT_RX_IND_SERVICE_S 24
  5749. /* rx MSDU descriptor fields */
  5750. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  5751. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  5752. /* payload fields */
  5753. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  5754. #define HTT_RX_IND_MPDU_COUNT_S 0
  5755. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  5756. #define HTT_RX_IND_MPDU_STATUS_S 8
  5757. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  5758. do { \
  5759. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  5760. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  5761. } while (0)
  5762. #define HTT_RX_IND_EXT_TID_GET(word) \
  5763. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  5764. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  5765. do { \
  5766. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  5767. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  5768. } while (0)
  5769. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  5770. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  5771. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  5772. do { \
  5773. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  5774. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  5775. } while (0)
  5776. #define HTT_RX_IND_REL_VALID_GET(word) \
  5777. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  5778. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  5779. do { \
  5780. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  5781. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  5782. } while (0)
  5783. #define HTT_RX_IND_PEER_ID_GET(word) \
  5784. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  5785. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  5786. do { \
  5787. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  5788. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  5789. } while (0)
  5790. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  5791. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> \
  5792. HTT_RX_IND_FW_RX_DESC_BYTES_S)
  5793. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  5794. do { \
  5795. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  5796. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  5797. } while (0)
  5798. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  5799. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  5800. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  5801. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  5802. do { \
  5803. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  5804. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  5805. } while (0)
  5806. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  5807. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  5808. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  5809. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  5810. do { \
  5811. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  5812. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  5813. } while (0)
  5814. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  5815. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  5816. HTT_RX_IND_REL_SEQ_NUM_START_S)
  5817. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  5818. do { \
  5819. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  5820. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  5821. } while (0)
  5822. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  5823. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  5824. HTT_RX_IND_REL_SEQ_NUM_END_S)
  5825. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  5826. do { \
  5827. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  5828. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  5829. } while (0)
  5830. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  5831. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  5832. HTT_RX_IND_NUM_MPDU_RANGES_S)
  5833. /* FW rx PPDU descriptor fields */
  5834. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  5835. do { \
  5836. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  5837. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  5838. } while (0)
  5839. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  5840. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  5841. HTT_RX_IND_RSSI_CMB_S)
  5842. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  5843. do { \
  5844. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  5845. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  5846. } while (0)
  5847. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  5848. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  5849. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  5850. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  5851. do { \
  5852. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  5853. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  5854. } while (0)
  5855. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  5856. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  5857. HTT_RX_IND_PHY_ERR_CODE_S)
  5858. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  5859. do { \
  5860. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  5861. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  5862. } while (0)
  5863. #define HTT_RX_IND_PHY_ERR_GET(word) \
  5864. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  5865. HTT_RX_IND_PHY_ERR_S)
  5866. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  5867. do { \
  5868. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  5869. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  5870. } while (0)
  5871. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  5872. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  5873. HTT_RX_IND_LEGACY_RATE_S)
  5874. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  5875. do { \
  5876. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  5877. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  5878. } while (0)
  5879. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  5880. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  5881. HTT_RX_IND_LEGACY_RATE_SEL_S)
  5882. #define HTT_RX_IND_END_VALID_SET(word, value) \
  5883. do { \
  5884. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  5885. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  5886. } while (0)
  5887. #define HTT_RX_IND_END_VALID_GET(word) \
  5888. (((word) & HTT_RX_IND_END_VALID_M) >> \
  5889. HTT_RX_IND_END_VALID_S)
  5890. #define HTT_RX_IND_START_VALID_SET(word, value) \
  5891. do { \
  5892. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  5893. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  5894. } while (0)
  5895. #define HTT_RX_IND_START_VALID_GET(word) \
  5896. (((word) & HTT_RX_IND_START_VALID_M) >> \
  5897. HTT_RX_IND_START_VALID_S)
  5898. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  5899. do { \
  5900. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  5901. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  5902. } while (0)
  5903. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  5904. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  5905. HTT_RX_IND_RSSI_PRI20_S)
  5906. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  5907. do { \
  5908. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  5909. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  5910. } while (0)
  5911. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  5912. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  5913. HTT_RX_IND_RSSI_EXT20_S)
  5914. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  5915. do { \
  5916. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  5917. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  5918. } while (0)
  5919. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  5920. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  5921. HTT_RX_IND_RSSI_EXT40_S)
  5922. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  5923. do { \
  5924. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  5925. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  5926. } while (0)
  5927. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  5928. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  5929. HTT_RX_IND_RSSI_EXT80_S)
  5930. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  5931. do { \
  5932. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  5933. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  5934. } while (0)
  5935. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  5936. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  5937. HTT_RX_IND_VHT_SIG_A1_S)
  5938. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  5939. do { \
  5940. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  5941. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  5942. } while (0)
  5943. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  5944. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  5945. HTT_RX_IND_VHT_SIG_A2_S)
  5946. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  5947. do { \
  5948. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  5949. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  5950. } while (0)
  5951. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  5952. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  5953. HTT_RX_IND_PREAMBLE_TYPE_S)
  5954. #define HTT_RX_IND_SERVICE_SET(word, value) \
  5955. do { \
  5956. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  5957. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  5958. } while (0)
  5959. #define HTT_RX_IND_SERVICE_GET(word) \
  5960. (((word) & HTT_RX_IND_SERVICE_M) >> \
  5961. HTT_RX_IND_SERVICE_S)
  5962. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  5963. do { \
  5964. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  5965. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  5966. } while (0)
  5967. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  5968. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  5969. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  5970. do { \
  5971. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  5972. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  5973. } while (0)
  5974. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  5975. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  5976. #define HTT_RX_IND_HL_BYTES \
  5977. (HTT_RX_IND_HDR_BYTES + \
  5978. 4 /* single FW rx MSDU descriptor, plus padding */ + \
  5979. 4 /* single MPDU range information element */)
  5980. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  5981. /* Could we use one macro entry? */
  5982. #define HTT_WORD_SET(word, field, value) \
  5983. do { \
  5984. HTT_CHECK_SET_VAL(field, value); \
  5985. (word) |= ((value) << field ## _S); \
  5986. } while (0)
  5987. #define HTT_WORD_GET(word, field) \
  5988. (((word) & field ## _M) >> field ## _S)
  5989. PREPACK struct hl_htt_rx_ind_base {
  5990. /*
  5991. * align with LL case rx indication message,but
  5992. * reduced to 5 words
  5993. */
  5994. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32];
  5995. } POSTPACK;
  5996. /*
  5997. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  5998. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  5999. * HL host needed info. The field is just after the msdu fw rx desc.
  6000. */
  6001. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6002. (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  6003. struct htt_rx_ind_hl_rx_desc_t {
  6004. A_UINT8 ver;
  6005. A_UINT8 len;
  6006. struct {
  6007. A_UINT8
  6008. first_msdu:1,
  6009. last_msdu:1,
  6010. c3_failed:1,
  6011. c4_failed:1,
  6012. ipv6:1,
  6013. tcp:1,
  6014. udp:1,
  6015. reserved:1;
  6016. } flags;
  6017. };
  6018. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  6019. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6020. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  6021. #define HTT_RX_IND_HL_RX_DESC_VER 0
  6022. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  6023. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6024. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  6025. #define HTT_RX_IND_HL_FLAG_OFFSET \
  6026. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  6027. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  6028. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  6029. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  6030. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  6031. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  6032. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or ipv4 */
  6033. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  6034. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  6035. /* This structure is used in HL, the basic descriptor information
  6036. * used by host. the structure is translated by FW from HW desc
  6037. * or generated by FW. But in HL monitor mode, the host would use
  6038. * the same structure with LL.
  6039. */
  6040. PREPACK struct hl_htt_rx_desc_base {
  6041. A_UINT32
  6042. seq_num:12,
  6043. encrypted:1,
  6044. chan_info_present:1,
  6045. resv0:2,
  6046. mcast_bcast:1,
  6047. fragment:1,
  6048. key_id_oct:8,
  6049. resv1:6;
  6050. A_UINT32 pn_31_0;
  6051. union {
  6052. struct {
  6053. A_UINT16 pn_47_32;
  6054. A_UINT16 pn_63_48;
  6055. } pn16;
  6056. A_UINT32 pn_63_32;
  6057. } u0;
  6058. A_UINT32 pn_95_64;
  6059. A_UINT32 pn_127_96;
  6060. } POSTPACK;
  6061. /*
  6062. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  6063. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  6064. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  6065. * Please see htt_chan_change_t for description of the fields.
  6066. */
  6067. PREPACK struct htt_chan_info_t
  6068. {
  6069. A_UINT32
  6070. primary_chan_center_freq_mhz:16,
  6071. contig_chan1_center_freq_mhz:16;
  6072. A_UINT32
  6073. contig_chan2_center_freq_mhz:16,
  6074. phy_mode:8,
  6075. reserved:8;
  6076. } POSTPACK;
  6077. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  6078. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  6079. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  6080. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  6081. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  6082. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  6083. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  6084. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  6085. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  6086. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  6087. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  6088. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  6089. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  6090. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  6091. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  6092. #define HTT_HL_RX_DESC_PN_OFFSET \
  6093. offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  6094. #define HTT_HL_RX_DESC_PN_WORD_OFFSET \
  6095. (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  6096. /* Channel information */
  6097. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  6098. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  6099. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  6100. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  6101. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  6102. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  6103. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  6104. #define HTT_CHAN_INFO_PHY_MODE_S 16
  6105. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  6106. do { \
  6107. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  6108. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  6109. } while (0)
  6110. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  6111. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) \
  6112. >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  6113. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  6114. do { \
  6115. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  6116. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  6117. } while (0)
  6118. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  6119. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) \
  6120. >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  6121. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  6122. do { \
  6123. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  6124. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  6125. } while (0)
  6126. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  6127. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) \
  6128. >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  6129. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  6130. do { \
  6131. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  6132. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  6133. } while (0)
  6134. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  6135. (((word) & HTT_CHAN_INFO_PHY_MODE_M) \
  6136. >> HTT_CHAN_INFO_PHY_MODE_S)
  6137. /*
  6138. * @brief target -> host rx reorder flush message definition
  6139. *
  6140. * @details
  6141. * The following field definitions describe the format of the rx flush
  6142. * message sent from the target to the host.
  6143. * The message consists of a 4-octet header, followed by one or more
  6144. * 4-octet payload information elements.
  6145. *
  6146. * |31 24|23 8|7 0|
  6147. * |--------------------------------------------------------------|
  6148. * | TID | peer ID | msg type |
  6149. * |--------------------------------------------------------------|
  6150. * | seq num end | seq num start | MPDU status | reserved |
  6151. * |--------------------------------------------------------------|
  6152. * First DWORD:
  6153. * - MSG_TYPE
  6154. * Bits 7:0
  6155. * Purpose: identifies this as an rx flush message
  6156. * Value: 0x2
  6157. * - PEER_ID
  6158. * Bits 23:8 (only bits 18:8 actually used)
  6159. * Purpose: identify which peer's rx data is being flushed
  6160. * Value: (rx) peer ID
  6161. * - TID
  6162. * Bits 31:24 (only bits 27:24 actually used)
  6163. * Purpose: Specifies which traffic identifier's rx data is being flushed
  6164. * Value: traffic identifier
  6165. * Second DWORD:
  6166. * - MPDU_STATUS
  6167. * Bits 15:8
  6168. * Purpose:
  6169. * Indicate whether the flushed MPDUs should be discarded or processed.
  6170. * Value:
  6171. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  6172. * stages of rx processing
  6173. * other: discard the MPDUs
  6174. * It is anticipated that flush messages will always have
  6175. * MPDU status == 1, but the status flag is included for
  6176. * flexibility.
  6177. * - SEQ_NUM_START
  6178. * Bits 23:16
  6179. * Purpose:
  6180. * Indicate the start of a series of consecutive MPDUs being flushed.
  6181. * Not all MPDUs within this range are necessarily valid - the host
  6182. * must check each sequence number within this range to see if the
  6183. * corresponding MPDU is actually present.
  6184. * Value:
  6185. * The sequence number for the first MPDU in the sequence.
  6186. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6187. * - SEQ_NUM_END
  6188. * Bits 30:24
  6189. * Purpose:
  6190. * Indicate the end of a series of consecutive MPDUs being flushed.
  6191. * Value:
  6192. * The sequence number one larger than the sequence number of the
  6193. * last MPDU being flushed.
  6194. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6195. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  6196. * are to be released for further rx processing.
  6197. * Not all MPDUs within this range are necessarily valid - the host
  6198. * must check each sequence number within this range to see if the
  6199. * corresponding MPDU is actually present.
  6200. */
  6201. /* first DWORD */
  6202. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  6203. #define HTT_RX_FLUSH_PEER_ID_S 8
  6204. #define HTT_RX_FLUSH_TID_M 0xff000000
  6205. #define HTT_RX_FLUSH_TID_S 24
  6206. /* second DWORD */
  6207. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  6208. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  6209. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  6210. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  6211. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  6212. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  6213. #define HTT_RX_FLUSH_BYTES 8
  6214. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  6215. do { \
  6216. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  6217. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  6218. } while (0)
  6219. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  6220. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  6221. #define HTT_RX_FLUSH_TID_SET(word, value) \
  6222. do { \
  6223. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  6224. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  6225. } while (0)
  6226. #define HTT_RX_FLUSH_TID_GET(word) \
  6227. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  6228. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  6229. do { \
  6230. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  6231. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  6232. } while (0)
  6233. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  6234. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  6235. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  6236. do { \
  6237. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  6238. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  6239. } while (0)
  6240. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  6241. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> \
  6242. HTT_RX_FLUSH_SEQ_NUM_START_S)
  6243. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  6244. do { \
  6245. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  6246. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  6247. } while (0)
  6248. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  6249. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  6250. /*
  6251. * @brief target -> host rx pn check indication message
  6252. *
  6253. * @details
  6254. * The following field definitions describe the format of the Rx PN check
  6255. * indication message sent from the target to the host.
  6256. * The message consists of a 4-octet header, followed by the start and
  6257. * end sequence numbers to be released, followed by the PN IEs. Each PN
  6258. * IE is one octet containing the sequence number that failed the PN
  6259. * check.
  6260. *
  6261. * |31 24|23 8|7 0|
  6262. * |--------------------------------------------------------------|
  6263. * | TID | peer ID | msg type |
  6264. * |--------------------------------------------------------------|
  6265. * | Reserved | PN IE count | seq num end | seq num start|
  6266. * |--------------------------------------------------------------|
  6267. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  6268. * |--------------------------------------------------------------|
  6269. * First DWORD:
  6270. * - MSG_TYPE
  6271. * Bits 7:0
  6272. * Purpose: Identifies this as an rx pn check indication message
  6273. * Value: 0x2
  6274. * - PEER_ID
  6275. * Bits 23:8 (only bits 18:8 actually used)
  6276. * Purpose: identify which peer
  6277. * Value: (rx) peer ID
  6278. * - TID
  6279. * Bits 31:24 (only bits 27:24 actually used)
  6280. * Purpose: identify traffic identifier
  6281. * Value: traffic identifier
  6282. * Second DWORD:
  6283. * - SEQ_NUM_START
  6284. * Bits 7:0
  6285. * Purpose:
  6286. * Indicates the starting sequence number of the MPDU in this
  6287. * series of MPDUs that went though PN check.
  6288. * Value:
  6289. * The sequence number for the first MPDU in the sequence.
  6290. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6291. * - SEQ_NUM_END
  6292. * Bits 15:8
  6293. * Purpose:
  6294. * Indicates the ending sequence number of the MPDU in this
  6295. * series of MPDUs that went though PN check.
  6296. * Value:
  6297. * The sequence number one larger then the sequence number of the last
  6298. * MPDU being flushed.
  6299. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  6300. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1]
  6301. * have been checked for invalid PN numbers and are ready
  6302. * to be released for further processing.
  6303. * Not all MPDUs within this range are necessarily valid - the host
  6304. * must check each sequence number within this range to see if the
  6305. * corresponding MPDU is actually present.
  6306. * - PN_IE_COUNT
  6307. * Bits 23:16
  6308. * Purpose:
  6309. * Used to determine the variable number of PN information
  6310. * elements in this message
  6311. *
  6312. * PN information elements:
  6313. * - PN_IE_x-
  6314. * Purpose:
  6315. * Each PN information element contains the sequence number
  6316. * of the MPDU that has failed the target PN check.
  6317. * Value:
  6318. * Contains the 6 LSBs of the 802.11 sequence number
  6319. * corresponding to the MPDU that failed the PN check.
  6320. */
  6321. /* first DWORD */
  6322. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  6323. #define HTT_RX_PN_IND_PEER_ID_S 8
  6324. #define HTT_RX_PN_IND_TID_M 0xff000000
  6325. #define HTT_RX_PN_IND_TID_S 24
  6326. /* second DWORD */
  6327. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  6328. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  6329. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  6330. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  6331. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  6332. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  6333. #define HTT_RX_PN_IND_BYTES 8
  6334. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  6335. do { \
  6336. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  6337. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  6338. } while (0)
  6339. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  6340. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  6341. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  6342. do { \
  6343. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  6344. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  6345. } while (0)
  6346. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  6347. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  6348. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  6349. do { \
  6350. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  6351. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  6352. } while (0)
  6353. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  6354. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> \
  6355. HTT_RX_PN_IND_SEQ_NUM_START_S)
  6356. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  6357. do { \
  6358. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  6359. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  6360. } while (0)
  6361. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  6362. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  6363. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  6364. do { \
  6365. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  6366. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  6367. } while (0)
  6368. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  6369. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  6370. /*
  6371. * @brief target -> host rx offload deliver message for LL system
  6372. *
  6373. * @details
  6374. * In a low latency system this message is sent whenever the offload
  6375. * manager flushes out the packets it has coalesced in its coalescing buffer.
  6376. * The DMA of the actual packets into host memory is done before sending out
  6377. * this message. This message indicates only how many MSDUs to reap. The
  6378. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  6379. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  6380. * DMA'd by the MAC directly into host memory these packets do not contain
  6381. * the MAC descriptors in the header portion of the packet. Instead they contain
  6382. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  6383. * message, the packets are delivered directly to the NW stack without going
  6384. * through the regular reorder buffering and PN checking path since it has
  6385. * already been done in target.
  6386. *
  6387. * |31 24|23 16|15 8|7 0|
  6388. * |-----------------------------------------------------------------------|
  6389. * | Total MSDU count | reserved | msg type |
  6390. * |-----------------------------------------------------------------------|
  6391. *
  6392. * @brief target -> host rx offload deliver message for HL system
  6393. *
  6394. * @details
  6395. * In a high latency system this message is sent whenever the offload manager
  6396. * flushes out the packets it has coalesced in its coalescing buffer. The
  6397. * actual packets are also carried along with this message. When the host
  6398. * receives this message, it is expected to deliver these packets to the NW
  6399. * stack directly instead of routing them through the reorder buffering and
  6400. * PN checking path since it has already been done in target.
  6401. *
  6402. * |31 24|23 16|15 8|7 0|
  6403. * |-----------------------------------------------------------------------|
  6404. * | Total MSDU count | reserved | msg type |
  6405. * |-----------------------------------------------------------------------|
  6406. * | peer ID | MSDU length |
  6407. * |-----------------------------------------------------------------------|
  6408. * | MSDU payload | FW Desc | tid | vdev ID |
  6409. * |-----------------------------------------------------------------------|
  6410. * | MSDU payload contd. |
  6411. * |-----------------------------------------------------------------------|
  6412. * | peer ID | MSDU length |
  6413. * |-----------------------------------------------------------------------|
  6414. * | MSDU payload | FW Desc | tid | vdev ID |
  6415. * |-----------------------------------------------------------------------|
  6416. * | MSDU payload contd. |
  6417. * |-----------------------------------------------------------------------|
  6418. *
  6419. */
  6420. /* first DWORD */
  6421. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  6422. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  6423. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  6424. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  6425. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  6426. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  6427. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  6428. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  6429. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  6430. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  6431. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  6432. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  6433. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  6434. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  6435. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  6436. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> \
  6437. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  6438. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  6439. do { \
  6440. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  6441. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  6442. } while (0) \
  6443. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  6444. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> \
  6445. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  6446. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  6447. do { \
  6448. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  6449. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  6450. } while (0) \
  6451. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  6452. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> \
  6453. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  6454. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  6455. do { \
  6456. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  6457. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  6458. } while (0) \
  6459. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  6460. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> \
  6461. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  6462. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  6463. do { \
  6464. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  6465. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  6466. } while (0) \
  6467. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  6468. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> \
  6469. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  6470. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  6471. do { \
  6472. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  6473. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  6474. } while (0) \
  6475. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  6476. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> \
  6477. HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  6478. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  6479. do { \
  6480. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  6481. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  6482. } while (0) \
  6483. /**
  6484. * @brief target -> host rx peer map/unmap message definition
  6485. *
  6486. * @details
  6487. * The following diagram shows the format of the rx peer map message sent
  6488. * from the target to the host. This layout assumes the target operates
  6489. * as little-endian.
  6490. *
  6491. * |31 24|23 16|15 8|7 0|
  6492. * |-----------------------------------------------------------------------|
  6493. * | peer ID | VDEV ID | msg type |
  6494. * |-----------------------------------------------------------------------|
  6495. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  6496. * |-----------------------------------------------------------------------|
  6497. * | reserved | MAC addr 5 | MAC addr 4 |
  6498. * |-----------------------------------------------------------------------|
  6499. *
  6500. *
  6501. * The following diagram shows the format of the rx peer unmap message sent
  6502. * from the target to the host.
  6503. *
  6504. * |31 24|23 16|15 8|7 0|
  6505. * |-----------------------------------------------------------------------|
  6506. * | peer ID | VDEV ID | msg type |
  6507. * |-----------------------------------------------------------------------|
  6508. *
  6509. * The following field definitions describe the format of the rx peer map
  6510. * and peer unmap messages sent from the target to the host.
  6511. * - MSG_TYPE
  6512. * Bits 7:0
  6513. * Purpose: identifies this as an rx peer map or peer unmap message
  6514. * Value: peer map -> 0x3, peer unmap -> 0x4
  6515. * - VDEV_ID
  6516. * Bits 15:8
  6517. * Purpose: Indicates which virtual device the peer is associated
  6518. * with.
  6519. * Value: vdev ID (used in the host to look up the vdev object)
  6520. * - PEER_ID
  6521. * Bits 31:16
  6522. * Purpose: The peer ID (index) that WAL is allocating (map) or
  6523. * freeing (unmap)
  6524. * Value: (rx) peer ID
  6525. * - MAC_ADDR_L32 (peer map only)
  6526. * Bits 31:0
  6527. * Purpose: Identifies which peer node the peer ID is for.
  6528. * Value: lower 4 bytes of peer node's MAC address
  6529. * - MAC_ADDR_U16 (peer map only)
  6530. * Bits 15:0
  6531. * Purpose: Identifies which peer node the peer ID is for.
  6532. * Value: upper 2 bytes of peer node's MAC address
  6533. */
  6534. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  6535. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  6536. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  6537. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  6538. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  6539. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  6540. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  6541. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  6542. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  6543. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  6546. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  6547. } while (0)
  6548. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  6549. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  6550. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  6551. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  6554. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  6555. } while (0)
  6556. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  6557. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  6558. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  6559. #define HTT_RX_PEER_MAP_BYTES 12
  6560. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  6561. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  6562. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  6563. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  6564. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  6565. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  6566. #define HTT_RX_PEER_UNMAP_BYTES 4
  6567. /**
  6568. * @brief target -> host message specifying security parameters
  6569. *
  6570. * @details
  6571. * The following diagram shows the format of the security specification
  6572. * message sent from the target to the host.
  6573. * This security specification message tells the host whether a PN check is
  6574. * necessary on rx data frames, and if so, how large the PN counter is.
  6575. * This message also tells the host about the security processing to apply
  6576. * to defragmented rx frames - specifically, whether a Message Integrity
  6577. * Check is required, and the Michael key to use.
  6578. *
  6579. * |31 24|23 16|15|14 8|7 0|
  6580. * |-----------------------------------------------------------------------|
  6581. * | peer ID | U| security type | msg type |
  6582. * |-----------------------------------------------------------------------|
  6583. * | Michael Key K0 |
  6584. * |-----------------------------------------------------------------------|
  6585. * | Michael Key K1 |
  6586. * |-----------------------------------------------------------------------|
  6587. * | WAPI RSC Low0 |
  6588. * |-----------------------------------------------------------------------|
  6589. * | WAPI RSC Low1 |
  6590. * |-----------------------------------------------------------------------|
  6591. * | WAPI RSC Hi0 |
  6592. * |-----------------------------------------------------------------------|
  6593. * | WAPI RSC Hi1 |
  6594. * |-----------------------------------------------------------------------|
  6595. *
  6596. * The following field definitions describe the format of the security
  6597. * indication message sent from the target to the host.
  6598. * - MSG_TYPE
  6599. * Bits 7:0
  6600. * Purpose: identifies this as a security specification message
  6601. * Value: 0xb
  6602. * - SEC_TYPE
  6603. * Bits 14:8
  6604. * Purpose: specifies which type of security applies to the peer
  6605. * Value: htt_sec_type enum value
  6606. * - UNICAST
  6607. * Bit 15
  6608. * Purpose: whether this security is applied to unicast or multicast data
  6609. * Value: 1 -> unicast, 0 -> multicast
  6610. * - PEER_ID
  6611. * Bits 31:16
  6612. * Purpose: The ID number for the peer the security specification is for
  6613. * Value: peer ID
  6614. * - MICHAEL_KEY_K0
  6615. * Bits 31:0
  6616. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  6617. * Value: Michael Key K0 (if security type is TKIP)
  6618. * - MICHAEL_KEY_K1
  6619. * Bits 31:0
  6620. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  6621. * Value: Michael Key K1 (if security type is TKIP)
  6622. * - WAPI_RSC_LOW0
  6623. * Bits 31:0
  6624. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  6625. * Value: WAPI RSC Low0 (if security type is WAPI)
  6626. * - WAPI_RSC_LOW1
  6627. * Bits 31:0
  6628. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  6629. * Value: WAPI RSC Low1 (if security type is WAPI)
  6630. * - WAPI_RSC_HI0
  6631. * Bits 31:0
  6632. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  6633. * Value: WAPI RSC Hi0 (if security type is WAPI)
  6634. * - WAPI_RSC_HI1
  6635. * Bits 31:0
  6636. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  6637. * Value: WAPI RSC Hi1 (if security type is WAPI)
  6638. */
  6639. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  6640. #define HTT_SEC_IND_SEC_TYPE_S 8
  6641. #define HTT_SEC_IND_UNICAST_M 0x00008000
  6642. #define HTT_SEC_IND_UNICAST_S 15
  6643. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  6644. #define HTT_SEC_IND_PEER_ID_S 16
  6645. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  6646. do { \
  6647. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  6648. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  6649. } while (0)
  6650. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  6651. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  6652. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  6653. do { \
  6654. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  6655. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  6656. } while (0)
  6657. #define HTT_SEC_IND_UNICAST_GET(word) \
  6658. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  6659. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  6660. do { \
  6661. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  6662. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  6663. } while (0)
  6664. #define HTT_SEC_IND_PEER_ID_GET(word) \
  6665. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  6666. #define HTT_SEC_IND_BYTES 28
  6667. /**
  6668. * @brief target -> host rx ADDBA / DELBA message definitions
  6669. *
  6670. * @details
  6671. * The following diagram shows the format of the rx ADDBA message sent
  6672. * from the target to the host:
  6673. *
  6674. * |31 20|19 16|15 8|7 0|
  6675. * |---------------------------------------------------------------------|
  6676. * | peer ID | TID | window size | msg type |
  6677. * |---------------------------------------------------------------------|
  6678. *
  6679. * The following diagram shows the format of the rx DELBA message sent
  6680. * from the target to the host:
  6681. *
  6682. * |31 20|19 16|15 8|7 0|
  6683. * |---------------------------------------------------------------------|
  6684. * | peer ID | TID | reserved | msg type |
  6685. * |---------------------------------------------------------------------|
  6686. *
  6687. * The following field definitions describe the format of the rx ADDBA
  6688. * and DELBA messages sent from the target to the host.
  6689. * - MSG_TYPE
  6690. * Bits 7:0
  6691. * Purpose: identifies this as an rx ADDBA or DELBA message
  6692. * Value: ADDBA -> 0x5, DELBA -> 0x6
  6693. * - WIN_SIZE
  6694. * Bits 15:8 (ADDBA only)
  6695. * Purpose: Specifies the length of the block ack window (max = 64).
  6696. * Value:
  6697. * block ack window length specified by the received ADDBA
  6698. * management message.
  6699. * - TID
  6700. * Bits 19:16
  6701. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  6702. * Value:
  6703. * TID specified by the received ADDBA or DELBA management message.
  6704. * - PEER_ID
  6705. * Bits 31:20
  6706. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  6707. * Value:
  6708. * ID (hash value) used by the host for fast, direct lookup of
  6709. * host SW peer info, including rx reorder states.
  6710. */
  6711. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  6712. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  6713. #define HTT_RX_ADDBA_TID_M 0xf0000
  6714. #define HTT_RX_ADDBA_TID_S 16
  6715. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  6716. #define HTT_RX_ADDBA_PEER_ID_S 20
  6717. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  6718. do { \
  6719. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  6720. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  6721. } while (0)
  6722. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  6723. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  6724. #define HTT_RX_ADDBA_TID_SET(word, value) \
  6725. do { \
  6726. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  6727. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  6728. } while (0)
  6729. #define HTT_RX_ADDBA_TID_GET(word) \
  6730. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  6731. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  6732. do { \
  6733. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  6734. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  6735. } while (0)
  6736. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  6737. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  6738. #define HTT_RX_ADDBA_BYTES 4
  6739. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  6740. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  6741. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  6742. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  6743. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  6744. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  6745. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  6746. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  6747. #define HTT_RX_DELBA_BYTES 4
  6748. /**
  6749. * @brief tx queue group information element definition
  6750. *
  6751. * @details
  6752. * The following diagram shows the format of the tx queue group
  6753. * information element, which can be included in target --> host
  6754. * messages to specify the number of tx "credits" (tx descriptors
  6755. * for LL, or tx buffers for HL) available to a particular group
  6756. * of host-side tx queues, and which host-side tx queues belong to
  6757. * the group.
  6758. *
  6759. * |31|30 24|23 16|15|14|13 0|
  6760. * |------------------------------------------------------------------------|
  6761. * | X| reserved | tx queue grp ID | A| S| credit count |
  6762. * |------------------------------------------------------------------------|
  6763. * | vdev ID mask | AC mask |
  6764. * |------------------------------------------------------------------------|
  6765. *
  6766. * The following definitions describe the fields within the tx queue group
  6767. * information element:
  6768. * - credit_count
  6769. * Bits 13:1
  6770. * Purpose: specify how many tx credits are available to the tx queue group
  6771. * Value: An absolute or relative, positive or negative credit value
  6772. * The 'A' bit specifies whether the value is absolute or relative.
  6773. * The 'S' bit specifies whether the value is positive or negative.
  6774. * A negative value can only be relative, not absolute.
  6775. * An absolute value replaces any prior credit value the host has for
  6776. * the tx queue group in question.
  6777. * A relative value is added to the prior credit value the host has for
  6778. * the tx queue group in question.
  6779. * - sign
  6780. * Bit 14
  6781. * Purpose: specify whether the credit count is positive or negative
  6782. * Value: 0 -> positive, 1 -> negative
  6783. * - absolute
  6784. * Bit 15
  6785. * Purpose: specify whether the credit count is absolute or relative
  6786. * Value: 0 -> relative, 1 -> absolute
  6787. * - txq_group_id
  6788. * Bits 23:16
  6789. * Purpose: indicate which tx queue group's credit and/or membership are
  6790. * being specified
  6791. * Value: 0 to max_tx_queue_groups-1
  6792. * - reserved
  6793. * Bits 30:16
  6794. * Value: 0x0
  6795. * - eXtension
  6796. * Bit 31
  6797. * Purpose: specify whether another tx queue group info element follows
  6798. * Value: 0 -> no more tx queue group information elements
  6799. * 1 -> another tx queue group information element immediately follows
  6800. * - ac_mask
  6801. * Bits 15:0
  6802. * Purpose: specify which Access Categories belong to the tx queue group
  6803. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  6804. * the tx queue group.
  6805. * The AC bit-mask values are obtained by left-shifting by the
  6806. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  6807. * - vdev_id_mask
  6808. * Bits 31:16
  6809. * Purpose: specify which vdev's tx queues belong to the tx queue group
  6810. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  6811. * belong to the tx queue group.
  6812. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  6813. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  6814. */
  6815. PREPACK struct htt_txq_group {
  6816. A_UINT32
  6817. credit_count:14,
  6818. sign:1,
  6819. absolute:1,
  6820. tx_queue_group_id:8,
  6821. reserved0:7,
  6822. extension:1;
  6823. A_UINT32
  6824. ac_mask:16,
  6825. vdev_id_mask:16;
  6826. } POSTPACK;
  6827. /* first word */
  6828. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  6829. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  6830. #define HTT_TXQ_GROUP_SIGN_S 14
  6831. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  6832. #define HTT_TXQ_GROUP_ABS_S 15
  6833. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  6834. #define HTT_TXQ_GROUP_ID_S 16
  6835. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  6836. #define HTT_TXQ_GROUP_EXT_S 31
  6837. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  6838. /* second word */
  6839. #define HTT_TXQ_GROUP_AC_MASK_S 0
  6840. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  6841. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  6842. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  6843. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  6844. do { \
  6845. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  6846. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  6847. } while (0)
  6848. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  6849. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> \
  6850. HTT_TXQ_GROUP_CREDIT_COUNT_S)
  6851. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  6852. do { \
  6853. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  6854. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  6855. } while (0)
  6856. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  6857. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  6858. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  6859. do { \
  6860. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  6861. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  6862. } while (0)
  6863. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  6864. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  6865. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  6866. do { \
  6867. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  6868. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  6869. } while (0)
  6870. #define HTT_TXQ_GROUP_ID_GET(_info) \
  6871. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  6872. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  6873. do { \
  6874. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  6875. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  6876. } while (0)
  6877. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  6878. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  6879. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  6880. do { \
  6881. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  6882. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  6883. } while (0)
  6884. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  6885. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  6886. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  6887. do { \
  6888. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  6889. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  6890. } while (0)
  6891. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  6892. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> \
  6893. HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  6894. /**
  6895. * @brief target -> host TX completion indication message definition
  6896. *
  6897. * @details
  6898. * The following diagram shows the format of the TX completion indication sent
  6899. * from the target to the host
  6900. *
  6901. * |31 25| 24|23 16| 15 |14 11|10 8|7 0|
  6902. * |-------------------------------------------------------------|
  6903. * header: | reserved |append| num | t_i| tid |status| msg_type |
  6904. * |-------------------------------------------------------------|
  6905. * payload: | MSDU1 ID | MSDU0 ID |
  6906. * |-------------------------------------------------------------|
  6907. * : MSDU3 ID : MSDU2 ID :
  6908. * |-------------------------------------------------------------|
  6909. * | struct htt_tx_compl_ind_append_retries |
  6910. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  6911. *
  6912. * The following field definitions describe the format of the TX completion
  6913. * indication sent from the target to the host
  6914. * Header fields:
  6915. * - msg_type
  6916. * Bits 7:0
  6917. * Purpose: identifies this as HTT TX completion indication
  6918. * Value: 0x7
  6919. * - status
  6920. * Bits 10:8
  6921. * Purpose: the TX completion status of payload fragmentations descriptors
  6922. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  6923. * - tid
  6924. * Bits 14:11
  6925. * Purpose: the tid associated with those fragmentation descriptors. It is
  6926. * valid or not, depending on the tid_invalid bit.
  6927. * Value: 0 to 15
  6928. * - tid_invalid
  6929. * Bits 15:15
  6930. * Purpose: this bit indicates whether the tid field is valid or not
  6931. * Value: 0 indicates valid; 1 indicates invalid
  6932. * - num
  6933. * Bits 23:16
  6934. * Purpose: the number of payload in this indication
  6935. * Value: 1 to 255
  6936. * - append
  6937. * Bits 24:24
  6938. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  6939. * the number of tx retries for one MSDU at the end of this message
  6940. * Value: 0 indicates no appending; 1 indicates appending
  6941. * Payload fields:
  6942. * - hmsdu_id
  6943. * Bits 15:0
  6944. * Purpose: this ID is used to track the Tx buffer in host
  6945. * Value: 0 to "size of host MSDU descriptor pool - 1"
  6946. */
  6947. #define HTT_TX_COMPL_IND_STATUS_S 8
  6948. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  6949. #define HTT_TX_COMPL_IND_TID_S 11
  6950. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  6951. #define HTT_TX_COMPL_IND_TID_INV_S 15
  6952. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  6953. #define HTT_TX_COMPL_IND_NUM_S 16
  6954. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  6955. #define HTT_TX_COMPL_IND_APPEND_S 24
  6956. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  6957. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  6958. do { \
  6959. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  6960. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  6961. } while (0)
  6962. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  6963. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  6964. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  6965. do { \
  6966. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  6967. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  6968. } while (0)
  6969. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  6970. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  6971. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  6972. do { \
  6973. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  6974. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  6975. } while (0)
  6976. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  6977. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  6978. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  6979. do { \
  6980. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  6981. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  6982. } while (0)
  6983. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  6984. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  6985. HTT_TX_COMPL_IND_TID_INV_S)
  6986. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  6987. do { \
  6988. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  6989. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  6990. } while (0)
  6991. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  6992. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  6993. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  6994. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  6995. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  6996. #define HTT_TX_COMPL_IND_STAT_OK 0
  6997. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  6998. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  6999. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  7000. /*
  7001. * The PEER_DEL tx completion status is used for HL cases
  7002. * where the peer the frame is for has been deleted.
  7003. * The host has already discarded its copy of the frame, but
  7004. * it still needs the tx completion to restore its credit.
  7005. */
  7006. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  7007. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  7008. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  7009. PREPACK struct htt_tx_compl_ind_base {
  7010. A_UINT32 hdr;
  7011. A_UINT16 payload[1 /*or more */];
  7012. } POSTPACK;
  7013. PREPACK struct htt_tx_compl_ind_append_retries {
  7014. A_UINT16 msdu_id;
  7015. A_UINT8 tx_retries;
  7016. A_UINT8 flag;/* Bit 0, 1: another append_retries struct is appended
  7017. 0: this is the last append_retries struct */
  7018. } POSTPACK;
  7019. /**
  7020. * @brief target -> host rate-control update indication message
  7021. *
  7022. * @details
  7023. * The following diagram shows the format of the RC Update message
  7024. * sent from the target to the host, while processing the tx-completion
  7025. * of a transmitted PPDU.
  7026. *
  7027. * |31 24|23 16|15 8|7 0|
  7028. * |-------------------------------------------------------------|
  7029. * | peer ID | vdev ID | msg_type |
  7030. * |-------------------------------------------------------------|
  7031. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  7032. * |-------------------------------------------------------------|
  7033. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  7034. * |-------------------------------------------------------------|
  7035. * | : |
  7036. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7037. * | : |
  7038. * |-------------------------------------------------------------|
  7039. * | : |
  7040. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  7041. * | : |
  7042. * |-------------------------------------------------------------|
  7043. * : :
  7044. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7045. *
  7046. */
  7047. typedef struct {
  7048. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  7049. A_UINT32 rate_code_flags;
  7050. A_UINT32 flags; /* Encodes information such as excessive
  7051. retransmission, aggregate, some info
  7052. from .11 frame control,
  7053. STBC, LDPC, (SGI and Tx Chain Mask
  7054. are encoded in ptx_rc->flags field),
  7055. AMPDU truncation (BT/time based etc.),
  7056. RTS/CTS attempt */
  7057. A_UINT32 num_enqued;/* # of MPDUs (for non-AMPDU 1) for this rate */
  7058. A_UINT32 num_retries;/* Total # of transmission attempt for this rate */
  7059. A_UINT32 num_failed;/* # of failed MPDUs in A-MPDU, 0 otherwise */
  7060. A_UINT32 ack_rssi;/* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  7061. A_UINT32 time_stamp; /* ACK timestamp (helps determine age) */
  7062. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  7063. } HTT_RC_TX_DONE_PARAMS;
  7064. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS))/* bytes */
  7065. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  7066. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  7067. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  7068. #define HTT_RC_UPDATE_VDEVID_S 8
  7069. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  7070. #define HTT_RC_UPDATE_PEERID_S 16
  7071. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  7072. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  7073. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  7074. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  7075. do { \
  7076. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  7077. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  7078. } while (0)
  7079. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  7080. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  7081. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  7082. do { \
  7083. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  7084. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  7085. } while (0)
  7086. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  7087. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  7088. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  7089. do { \
  7090. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  7091. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  7092. } while (0)
  7093. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  7094. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  7095. /**
  7096. * @brief target -> host rx fragment indication message definition
  7097. *
  7098. * @details
  7099. * The following field definitions describe the format of the rx fragment
  7100. * indication message sent from the target to the host.
  7101. * The rx fragment indication message shares the format of the
  7102. * rx indication message, but not all fields from the rx indication message
  7103. * are relevant to the rx fragment indication message.
  7104. *
  7105. *
  7106. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7107. * |-----------+-------------------+---------------------+-------------|
  7108. * | peer ID | |FV| ext TID | msg type |
  7109. * |-------------------------------------------------------------------|
  7110. * | | flush | flush |
  7111. * | | end | start |
  7112. * | | seq num | seq num |
  7113. * |-------------------------------------------------------------------|
  7114. * | reserved | FW rx desc bytes |
  7115. * |-------------------------------------------------------------------|
  7116. * | | FW MSDU Rx |
  7117. * | | desc B0 |
  7118. * |-------------------------------------------------------------------|
  7119. * Header fields:
  7120. * - MSG_TYPE
  7121. * Bits 7:0
  7122. * Purpose: identifies this as an rx fragment indication message
  7123. * Value: 0xa
  7124. * - EXT_TID
  7125. * Bits 12:8
  7126. * Purpose: identify the traffic ID of the rx data, including
  7127. * special "extended" TID values for multicast, broadcast, and
  7128. * non-QoS data frames
  7129. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7130. * - FLUSH_VALID (FV)
  7131. * Bit 13
  7132. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7133. * is valid
  7134. * Value:
  7135. * 1 -> flush IE is valid and needs to be processed
  7136. * 0 -> flush IE is not valid and should be ignored
  7137. * - PEER_ID
  7138. * Bits 31:16
  7139. * Purpose: Identify, by ID, which peer sent the rx data
  7140. * Value: ID of the peer who sent the rx data
  7141. * - FLUSH_SEQ_NUM_START
  7142. * Bits 5:0
  7143. * Purpose: Indicate the start of a series of MPDUs to flush
  7144. * Not all MPDUs within this series are necessarily valid - the host
  7145. * must check each sequence number within this range to see if the
  7146. * corresponding MPDU is actually present.
  7147. * This field is only valid if the FV bit is set.
  7148. * Value:
  7149. * The sequence number for the first MPDUs to check to flush.
  7150. * The sequence number is masked by 0x3f.
  7151. * - FLUSH_SEQ_NUM_END
  7152. * Bits 11:6
  7153. * Purpose: Indicate the end of a series of MPDUs to flush
  7154. * Value:
  7155. * The sequence number one larger than the sequence number of the
  7156. * last MPDU to check to flush.
  7157. * The sequence number is masked by 0x3f.
  7158. * Not all MPDUs within this series are necessarily valid - the host
  7159. * must check each sequence number within this range to see if the
  7160. * corresponding MPDU is actually present.
  7161. * This field is only valid if the FV bit is set.
  7162. * Rx descriptor fields:
  7163. * - FW_RX_DESC_BYTES
  7164. * Bits 15:0
  7165. * Purpose: Indicate how many bytes in the Rx indication are used for
  7166. * FW Rx descriptors
  7167. * Value: 1
  7168. */
  7169. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  7170. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  7171. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  7172. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  7173. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  7174. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  7175. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  7176. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  7177. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  7178. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  7179. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  7180. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  7181. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  7182. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  7183. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  7184. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  7185. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  7186. #define HTT_RX_FRAG_IND_BYTES \
  7187. (4 /* msg hdr */ + \
  7188. 4 /* flush spec */ + \
  7189. 4 /* (unused) FW rx desc bytes spec */ + \
  7190. 4 /* FW rx desc */)
  7191. /**
  7192. * @brief target -> host test message definition
  7193. *
  7194. * @details
  7195. * The following field definitions describe the format of the test
  7196. * message sent from the target to the host.
  7197. * The message consists of a 4-octet header, followed by a variable
  7198. * number of 32-bit integer values, followed by a variable number
  7199. * of 8-bit character values.
  7200. *
  7201. * |31 16|15 8|7 0|
  7202. * |-----------------------------------------------------------|
  7203. * | num chars | num ints | msg type |
  7204. * |-----------------------------------------------------------|
  7205. * | int 0 |
  7206. * |-----------------------------------------------------------|
  7207. * | int 1 |
  7208. * |-----------------------------------------------------------|
  7209. * | ... |
  7210. * |-----------------------------------------------------------|
  7211. * | char 3 | char 2 | char 1 | char 0 |
  7212. * |-----------------------------------------------------------|
  7213. * | | | ... | char 4 |
  7214. * |-----------------------------------------------------------|
  7215. * - MSG_TYPE
  7216. * Bits 7:0
  7217. * Purpose: identifies this as a test message
  7218. * Value: HTT_MSG_TYPE_TEST
  7219. * - NUM_INTS
  7220. * Bits 15:8
  7221. * Purpose: indicate how many 32-bit integers follow the message header
  7222. * - NUM_CHARS
  7223. * Bits 31:16
  7224. * Purpose: indicate how many 8-bit charaters follow the series of integers
  7225. */
  7226. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  7227. #define HTT_RX_TEST_NUM_INTS_S 8
  7228. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  7229. #define HTT_RX_TEST_NUM_CHARS_S 16
  7230. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  7231. do { \
  7232. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  7233. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  7234. } while (0)
  7235. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  7236. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  7237. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  7238. do { \
  7239. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  7240. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  7241. } while (0)
  7242. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  7243. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  7244. /**
  7245. * @brief target -> host packet log message
  7246. *
  7247. * @details
  7248. * The following field definitions describe the format of the packet log
  7249. * message sent from the target to the host.
  7250. * The message consists of a 4-octet header,followed by a variable number
  7251. * of 32-bit character values.
  7252. *
  7253. * |31 24|23 16|15 8|7 0|
  7254. * |-----------------------------------------------------------|
  7255. * | | | | msg type |
  7256. * |-----------------------------------------------------------|
  7257. * | payload |
  7258. * |-----------------------------------------------------------|
  7259. * - MSG_TYPE
  7260. * Bits 7:0
  7261. * Purpose: identifies this as a test message
  7262. * Value: HTT_MSG_TYPE_PACKETLOG
  7263. */
  7264. PREPACK struct htt_pktlog_msg {
  7265. A_UINT32 header;
  7266. A_UINT32 payload[1 /* or more */];
  7267. } POSTPACK;
  7268. /*
  7269. * Rx reorder statistics
  7270. * NB: all the fields must be defined in 4 octets size.
  7271. */
  7272. struct rx_reorder_stats {
  7273. /* Non QoS MPDUs received */
  7274. A_UINT32 deliver_non_qos;
  7275. /* MPDUs received in-order */
  7276. A_UINT32 deliver_in_order;
  7277. /* Flush due to reorder timer expired */
  7278. A_UINT32 deliver_flush_timeout;
  7279. /* Flush due to move out of window */
  7280. A_UINT32 deliver_flush_oow;
  7281. /* Flush due to DELBA */
  7282. A_UINT32 deliver_flush_delba;
  7283. /* MPDUs dropped due to FCS error */
  7284. A_UINT32 fcs_error;
  7285. /* MPDUs dropped due to monitor mode non-data packet */
  7286. A_UINT32 mgmt_ctrl;
  7287. /* Unicast-data MPDUs dropped due to invalid peer */
  7288. A_UINT32 invalid_peer;
  7289. /* MPDUs dropped due to duplication (non aggregation) */
  7290. A_UINT32 dup_non_aggr;
  7291. /* MPDUs dropped due to processed before */
  7292. A_UINT32 dup_past;
  7293. /* MPDUs dropped due to duplicate in reorder queue */
  7294. A_UINT32 dup_in_reorder;
  7295. /* Reorder timeout happened */
  7296. A_UINT32 reorder_timeout;
  7297. /* invalid bar ssn */
  7298. A_UINT32 invalid_bar_ssn;
  7299. /* reorder reset due to bar ssn */
  7300. A_UINT32 ssn_reset;
  7301. /* Flush due to delete peer */
  7302. A_UINT32 deliver_flush_delpeer;
  7303. /* Flush due to offload */
  7304. A_UINT32 deliver_flush_offload;
  7305. /* Flush due to out of buffer */
  7306. A_UINT32 deliver_flush_oob;
  7307. /* MPDUs dropped due to PN check fail */
  7308. A_UINT32 pn_fail;
  7309. /* MPDUs dropped due to unable to allocate memory */
  7310. A_UINT32 store_fail;
  7311. /* Number of times the tid pool alloc succeeded */
  7312. A_UINT32 tid_pool_alloc_succ;
  7313. /* Number of times the MPDU pool alloc succeeded */
  7314. A_UINT32 mpdu_pool_alloc_succ;
  7315. /* Number of times the MSDU pool alloc succeeded */
  7316. A_UINT32 msdu_pool_alloc_succ;
  7317. /* Number of times the tid pool alloc failed */
  7318. A_UINT32 tid_pool_alloc_fail;
  7319. /* Number of times the MPDU pool alloc failed */
  7320. A_UINT32 mpdu_pool_alloc_fail;
  7321. /* Number of times the MSDU pool alloc failed */
  7322. A_UINT32 msdu_pool_alloc_fail;
  7323. /* Number of times the tid pool freed */
  7324. A_UINT32 tid_pool_free;
  7325. /* Number of times the MPDU pool freed */
  7326. A_UINT32 mpdu_pool_free;
  7327. /* Number of times the MSDU pool freed */
  7328. A_UINT32 msdu_pool_free;
  7329. /* number of MSDUs undelivered to HTT and queued
  7330. * to Data Rx MSDU free list */
  7331. A_UINT32 msdu_queued;
  7332. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  7333. A_UINT32 msdu_recycled;
  7334. /* Number of MPDUs with invalid peer but A2 found in AST */
  7335. A_UINT32 invalid_peer_a2_in_ast;
  7336. /* Number of MPDUs with invalid peer but A3 found in AST */
  7337. A_UINT32 invalid_peer_a3_in_ast;
  7338. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  7339. A_UINT32 invalid_peer_bmc_mpdus;
  7340. /* Number of MSDUs with err attention word */
  7341. A_UINT32 rxdesc_err_att;
  7342. /* Number of MSDUs with flag of peer_idx_invalid */
  7343. A_UINT32 rxdesc_err_peer_idx_inv;
  7344. /* Number of MSDUs with flag of peer_idx_timeout */
  7345. A_UINT32 rxdesc_err_peer_idx_to;
  7346. /* Number of MSDUs with flag of overflow */
  7347. A_UINT32 rxdesc_err_ov;
  7348. /* Number of MSDUs with flag of msdu_length_err */
  7349. A_UINT32 rxdesc_err_msdu_len;
  7350. /* Number of MSDUs with flag of mpdu_length_err */
  7351. A_UINT32 rxdesc_err_mpdu_len;
  7352. /* Number of MSDUs with flag of tkip_mic_err */
  7353. A_UINT32 rxdesc_err_tkip_mic;
  7354. /* Number of MSDUs with flag of decrypt_err */
  7355. A_UINT32 rxdesc_err_decrypt;
  7356. /* Number of MSDUs with flag of fcs_err */
  7357. A_UINT32 rxdesc_err_fcs;
  7358. /* Number of Unicast (bc_mc bit is not set in attention word)
  7359. * frames with invalid peer handler
  7360. */
  7361. A_UINT32 rxdesc_uc_msdus_inv_peer;
  7362. /* Number of unicast frame directly (direct bit is set in attention word)
  7363. * to DUT with invalid peer handler
  7364. */
  7365. A_UINT32 rxdesc_direct_msdus_inv_peer;
  7366. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  7367. * frames with invalid peer handler
  7368. */
  7369. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  7370. /* Number of MSDUs dropped due to no first MSDU flag */
  7371. A_UINT32 rxdesc_no_1st_msdu;
  7372. /* Number of MSDUs droped due to ring overflow */
  7373. A_UINT32 msdu_drop_ring_ov;
  7374. /* Number of MSDUs dropped due to FC mismatch */
  7375. A_UINT32 msdu_drop_fc_mismatch;
  7376. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  7377. A_UINT32 msdu_drop_mgmt_remote_ring;
  7378. /* Number of MSDUs dropped due to errors not reported in attention word */
  7379. A_UINT32 msdu_drop_misc;
  7380. /* Number of MSDUs go to offload before reorder */
  7381. A_UINT32 offload_msdu_wal;
  7382. /* Number of data frame dropped by offload after reorder */
  7383. A_UINT32 offload_msdu_reorder;
  7384. /* Number of MPDUs with sequence number in the past and within
  7385. the BA window */
  7386. A_UINT32 dup_past_within_window;
  7387. /* Number of MPDUs with sequence number in the past and
  7388. * outside the BA window */
  7389. A_UINT32 dup_past_outside_window;
  7390. /* Number of MSDUs with decrypt/MIC error */
  7391. A_UINT32 rxdesc_err_decrypt_mic;
  7392. /* Number of data MSDUs received on both local and remote rings */
  7393. A_UINT32 data_msdus_on_both_rings;
  7394. };
  7395. /*
  7396. * Rx Remote buffer statistics
  7397. * NB: all the fields must be defined in 4 octets size.
  7398. */
  7399. struct rx_remote_buffer_mgmt_stats {
  7400. /* Total number of MSDUs reaped for Rx processing */
  7401. A_UINT32 remote_reaped;
  7402. /* MSDUs recycled within firmware */
  7403. A_UINT32 remote_recycled;
  7404. /* MSDUs stored by Data Rx */
  7405. A_UINT32 data_rx_msdus_stored;
  7406. /* Number of HTT indications from WAL Rx MSDU */
  7407. A_UINT32 wal_rx_ind;
  7408. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  7409. A_UINT32 wal_rx_ind_unconsumed;
  7410. /* Number of HTT indications from Data Rx MSDU */
  7411. A_UINT32 data_rx_ind;
  7412. /* Number of unconsumed HTT indications from Data Rx MSDU */
  7413. A_UINT32 data_rx_ind_unconsumed;
  7414. /* Number of HTT indications from ATHBUF */
  7415. A_UINT32 athbuf_rx_ind;
  7416. /* Number of remote buffers requested for refill */
  7417. A_UINT32 refill_buf_req;
  7418. /* Number of remote buffers filled by the host */
  7419. A_UINT32 refill_buf_rsp;
  7420. /* Number of times MAC hw_index = f/w write_index */
  7421. A_INT32 mac_no_bufs;
  7422. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  7423. A_INT32 fw_indices_equal;
  7424. /* Number of times f/w finds no buffers to post */
  7425. A_INT32 host_no_bufs;
  7426. };
  7427. /*
  7428. * TXBF MU/SU packets and NDPA statistics
  7429. * NB: all the fields must be defined in 4 octets size.
  7430. */
  7431. struct rx_txbf_musu_ndpa_pkts_stats {
  7432. /* number of TXBF MU packets received */
  7433. A_UINT32 number_mu_pkts;
  7434. /* number of TXBF SU packets received */
  7435. A_UINT32 number_su_pkts;
  7436. /* number of TXBF directed NDPA */
  7437. A_UINT32 txbf_directed_ndpa_count;
  7438. /* number of TXBF retried NDPA */
  7439. A_UINT32 txbf_ndpa_retry_count;
  7440. /* total number of TXBF NDPA */
  7441. A_UINT32 txbf_total_ndpa_count;
  7442. /* must be set to 0x0 */
  7443. A_UINT32 reserved[3];
  7444. };
  7445. /*
  7446. * htt_dbg_stats_status -
  7447. * present - The requested stats have been delivered in full.
  7448. * This indicates that either the stats information was contained
  7449. * in its entirety within this message, or else this message
  7450. * completes the delivery of the requested stats info that was
  7451. * partially delivered through earlier STATS_CONF messages.
  7452. * partial - The requested stats have been delivered in part.
  7453. * One or more subsequent STATS_CONF messages with the same
  7454. * cookie value will be sent to deliver the remainder of the
  7455. * information.
  7456. * error - The requested stats could not be delivered, for example due
  7457. * to a shortage of memory to construct a message holding the
  7458. * requested stats.
  7459. * invalid - The requested stat type is either not recognized, or the
  7460. * target is configured to not gather the stats type in question.
  7461. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  7462. * series_done - This special value indicates that no further stats info
  7463. * elements are present within a series of stats info elems
  7464. * (within a stats upload confirmation message).
  7465. */
  7466. enum htt_dbg_stats_status {
  7467. HTT_DBG_STATS_STATUS_PRESENT = 0,
  7468. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  7469. HTT_DBG_STATS_STATUS_ERROR = 2,
  7470. HTT_DBG_STATS_STATUS_INVALID = 3,
  7471. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  7472. };
  7473. /**
  7474. * @brief target -> host statistics upload
  7475. *
  7476. * @details
  7477. * The following field definitions describe the format of the HTT target
  7478. * to host stats upload confirmation message.
  7479. * The message contains a cookie echoed from the HTT host->target stats
  7480. * upload request, which identifies which request the confirmation is
  7481. * for, and a series of tag-length-value stats information elements.
  7482. * The tag-length header for each stats info element also includes a
  7483. * status field, to indicate whether the request for the stat type in
  7484. * question was fully met, partially met, unable to be met, or invalid
  7485. * (if the stat type in question is disabled in the target).
  7486. * A special value of all 1's in this status field is used to indicate
  7487. * the end of the series of stats info elements.
  7488. *
  7489. *
  7490. * |31 16|15 8|7 5|4 0|
  7491. * |------------------------------------------------------------|
  7492. * | reserved | msg type |
  7493. * |------------------------------------------------------------|
  7494. * | cookie LSBs |
  7495. * |------------------------------------------------------------|
  7496. * | cookie MSBs |
  7497. * |------------------------------------------------------------|
  7498. * | stats entry length | reserved | S |stat type|
  7499. * |------------------------------------------------------------|
  7500. * | |
  7501. * | type-specific stats info |
  7502. * | |
  7503. * |------------------------------------------------------------|
  7504. * | stats entry length | reserved | S |stat type|
  7505. * |------------------------------------------------------------|
  7506. * | |
  7507. * | type-specific stats info |
  7508. * | |
  7509. * |------------------------------------------------------------|
  7510. * | n/a | reserved | 111 | n/a |
  7511. * |------------------------------------------------------------|
  7512. * Header fields:
  7513. * - MSG_TYPE
  7514. * Bits 7:0
  7515. * Purpose: identifies this is a statistics upload confirmation message
  7516. * Value: 0x9
  7517. * - COOKIE_LSBS
  7518. * Bits 31:0
  7519. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7520. * message with its preceding host->target stats request message.
  7521. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7522. * - COOKIE_MSBS
  7523. * Bits 31:0
  7524. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7525. * message with its preceding host->target stats request message.
  7526. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7527. *
  7528. * Stats Information Element tag-length header fields:
  7529. * - STAT_TYPE
  7530. * Bits 4:0
  7531. * Purpose: identifies the type of statistics info held in the
  7532. * following information element
  7533. * Value: htt_dbg_stats_type
  7534. * - STATUS
  7535. * Bits 7:5
  7536. * Purpose: indicate whether the requested stats are present
  7537. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  7538. * the completion of the stats entry series
  7539. * - LENGTH
  7540. * Bits 31:16
  7541. * Purpose: indicate the stats information size
  7542. * Value: This field specifies the number of bytes of stats information
  7543. * that follows the element tag-length header.
  7544. * It is expected but not required that this length is a multiple of
  7545. * 4 bytes. Even if the length is not an integer multiple of 4, the
  7546. * subsequent stats entry header will begin on a 4-byte aligned
  7547. * boundary.
  7548. */
  7549. #define HTT_T2H_STATS_COOKIE_SIZE 8
  7550. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  7551. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  7552. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  7553. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  7554. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  7555. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  7556. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  7557. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  7558. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  7559. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  7560. do { \
  7561. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  7562. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  7563. } while (0)
  7564. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  7565. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  7566. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  7567. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  7568. do { \
  7569. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  7570. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  7571. } while (0)
  7572. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  7573. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  7574. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  7575. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  7576. do { \
  7577. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  7578. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  7579. } while (0)
  7580. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  7581. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  7582. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  7583. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  7584. #define HTT_MAX_AGGR 64
  7585. #define HTT_HL_MAX_AGGR 18
  7586. /**
  7587. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  7588. *
  7589. * @details
  7590. * The following field definitions describe the format of the HTT host
  7591. * to target frag_desc/msdu_ext bank configuration message.
  7592. * The message contains the based address and the min and max id of the
  7593. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  7594. * MSDU_EXT/FRAG_DESC.
  7595. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  7596. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  7597. * the hardware does the mapping/translation.
  7598. *
  7599. * Total banks that can be configured is configured to 16.
  7600. *
  7601. * This should be called before any TX has be initiated by the HTT
  7602. *
  7603. * |31 16|15 8|7 5|4 0|
  7604. * |------------------------------------------------------------|
  7605. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  7606. * |------------------------------------------------------------|
  7607. * | BANK0_BASE_ADDRESS (bits 31:0) |
  7608. #if HTT_PADDR64
  7609. * | BANK0_BASE_ADDRESS (bits 63:32) |
  7610. #endif
  7611. * |------------------------------------------------------------|
  7612. * | ... |
  7613. * |------------------------------------------------------------|
  7614. * | BANK15_BASE_ADDRESS (bits 31:0) |
  7615. #if HTT_PADDR64
  7616. * | BANK15_BASE_ADDRESS (bits 63:32) |
  7617. #endif
  7618. * |------------------------------------------------------------|
  7619. * | BANK0_MAX_ID | BANK0_MIN_ID |
  7620. * |------------------------------------------------------------|
  7621. * | ... |
  7622. * |------------------------------------------------------------|
  7623. * | BANK15_MAX_ID | BANK15_MIN_ID |
  7624. * |------------------------------------------------------------|
  7625. * Header fields:
  7626. * - MSG_TYPE
  7627. * Bits 7:0
  7628. * Value: 0x6
  7629. * for systems with 64-bit format for bus addresses:
  7630. * - BANKx_BASE_ADDRESS_LO
  7631. * Bits 31:0
  7632. * Purpose: Provide a mechanism to specify the base address of the
  7633. * MSDU_EXT bank physical/bus address.
  7634. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  7635. * - BANKx_BASE_ADDRESS_HI
  7636. * Bits 31:0
  7637. * Purpose: Provide a mechanism to specify the base address of the
  7638. * MSDU_EXT bank physical/bus address.
  7639. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  7640. * for systems with 32-bit format for bus addresses:
  7641. * - BANKx_BASE_ADDRESS
  7642. * Bits 31:0
  7643. * Purpose: Provide a mechanism to specify the base address of the
  7644. * MSDU_EXT bank physical/bus address.
  7645. * Value: MSDU_EXT bank physical / bus address
  7646. * - BANKx_MIN_ID
  7647. * Bits 15:0
  7648. * Purpose: Provide a mechanism to specify the min index that needs to
  7649. * mapped.
  7650. * - BANKx_MAX_ID
  7651. * Bits 31:16
  7652. * Purpose: Provide a mechanism to specify the max index that needs to
  7653. * mapped.
  7654. *
  7655. */
  7656. /** @todo Compress the fields to fit MAX HTT Message size, until then
  7657. * configure to a safe value.
  7658. * @note MAX supported banks is 16.
  7659. */
  7660. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  7661. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  7662. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  7663. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  7664. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  7665. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  7666. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  7667. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  7668. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  7669. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  7670. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  7671. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  7672. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  7673. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  7674. do { \
  7675. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  7676. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  7677. } while (0)
  7678. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  7679. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> \
  7680. HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  7681. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  7682. do { \
  7683. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value);\
  7684. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S);\
  7685. } while (0)
  7686. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  7687. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> \
  7688. HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  7689. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  7690. do { \
  7691. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  7692. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  7693. } while (0)
  7694. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  7695. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> \
  7696. HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  7697. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  7698. do { \
  7699. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  7700. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  7701. } while (0)
  7702. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  7703. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> \
  7704. HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  7705. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  7706. do { \
  7707. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  7708. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  7709. } while (0)
  7710. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  7711. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> \
  7712. HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  7713. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  7714. do { \
  7715. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  7716. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  7717. } while (0)
  7718. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  7719. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> \
  7720. HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  7721. /*
  7722. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  7723. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  7724. * addresses are stored in a XXX-bit field.
  7725. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  7726. * htt_tx_frag_desc64_bank_cfg_t structs.
  7727. */
  7728. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  7729. _paddr_bits_, \
  7730. _paddr__bank_base_address_) \
  7731. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  7732. /** word 0 \
  7733. * msg_type: 8, \
  7734. * pdev_id: 2, \
  7735. * swap: 1, \
  7736. * reserved0: 5, \
  7737. * num_banks: 8, \
  7738. * desc_size: 8; \
  7739. */ \
  7740. A_UINT32 word0; \
  7741. /* \
  7742. * If bank_base_address is 64 bits, the upper / lower
  7743. * halves are stored \
  7744. * in little-endian order (bytes 0-3 in the first A_UINT32,
  7745. * bytes 4-7 in the second A_UINT32). \
  7746. */ \
  7747. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  7748. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  7749. } POSTPACK
  7750. /* define htt_tx_frag_desc32_bank_cfg_t */
  7751. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  7752. /* define htt_tx_frag_desc64_bank_cfg_t */
  7753. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  7754. /*
  7755. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  7756. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  7757. */
  7758. #if HTT_PADDR64
  7759. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  7760. #else
  7761. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  7762. #endif
  7763. /**
  7764. * @brief target -> host HTT TX Credit total count update message definition
  7765. *
  7766. *|31 16|15|14 9| 8 |7 0 |
  7767. *|---------------------+--+----------+-------+----------|
  7768. *|cur htt credit delta | Q| reserved | sign | msg type |
  7769. *|------------------------------------------------------|
  7770. *
  7771. * Header fields:
  7772. * - MSG_TYPE
  7773. * Bits 7:0
  7774. * Purpose: identifies this as a htt tx credit delta update message
  7775. * Value: 0xe
  7776. * - SIGN
  7777. * Bits 8
  7778. * identifies whether credit delta is positive or negative
  7779. * Value:
  7780. * - 0x0: credit delta is positive, rebalance in some buffers
  7781. * - 0x1: credit delta is negative, rebalance out some buffers
  7782. * - reserved
  7783. * Bits 14:9
  7784. * Value: 0x0
  7785. * - TXQ_GRP
  7786. * Bit 15
  7787. * Purpose: indicates whether any tx queue group information elements
  7788. * are appended to the tx credit update message
  7789. * Value: 0 -> no tx queue group information element is present
  7790. * 1 -> a tx queue group information element immediately follows
  7791. * - DELTA_COUNT
  7792. * Bits 31:16
  7793. * Purpose: Specify current htt credit delta absolute count
  7794. */
  7795. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  7796. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  7797. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  7798. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  7799. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  7800. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  7801. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  7802. do { \
  7803. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  7804. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  7805. } while (0)
  7806. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  7807. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  7808. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  7809. do { \
  7810. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  7811. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  7812. } while (0)
  7813. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  7814. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  7815. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  7816. do { \
  7817. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  7818. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  7819. } while (0)
  7820. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  7821. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  7822. #define HTT_TX_CREDIT_MSG_BYTES 4
  7823. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  7824. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  7825. /**
  7826. * @brief HTT WDI_IPA Operation Response Message
  7827. *
  7828. * @details
  7829. * HTT WDI_IPA Operation Response message is sent by target
  7830. * to host confirming suspend or resume operation.
  7831. * |31 24|23 16|15 8|7 0|
  7832. * |----------------+----------------+----------------+----------------|
  7833. * | op_code | Rsvd | msg_type |
  7834. * |-------------------------------------------------------------------|
  7835. * | Rsvd | Response len |
  7836. * |-------------------------------------------------------------------|
  7837. * | |
  7838. * | Response-type specific info |
  7839. * | |
  7840. * | |
  7841. * |-------------------------------------------------------------------|
  7842. * Header fields:
  7843. * - MSG_TYPE
  7844. * Bits 7:0
  7845. * Purpose: Identifies this as WDI_IPA Operation Response message
  7846. * value: = 0x13
  7847. * - OP_CODE
  7848. * Bits 31:16
  7849. * Purpose: Identifies the operation target is responding to
  7850. * (e.g. TX suspend)
  7851. * value: = enum htt_wdi_ipa_op_code
  7852. * - RSP_LEN
  7853. * Bits 16:0
  7854. * Purpose: length for the response-type specific info
  7855. * value: = length in bytes for response-type specific info
  7856. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  7857. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  7858. */
  7859. PREPACK struct htt_wdi_ipa_op_response_t {
  7860. /* DWORD 0: flags and meta-data */
  7861. A_UINT32
  7862. msg_type:8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  7863. reserved1:8,
  7864. op_code:16;
  7865. A_UINT32
  7866. rsp_len:16,
  7867. reserved2:16;
  7868. } POSTPACK;
  7869. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  7870. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  7871. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  7872. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  7873. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  7874. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  7875. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> \
  7876. HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  7877. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  7878. do { \
  7879. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  7880. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  7881. } while (0)
  7882. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  7883. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> \
  7884. HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  7885. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  7886. do { \
  7887. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  7888. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  7889. } while (0)
  7890. enum htt_phy_mode {
  7891. htt_phy_mode_11a = 0,
  7892. htt_phy_mode_11g = 1,
  7893. htt_phy_mode_11b = 2,
  7894. htt_phy_mode_11g_only = 3,
  7895. htt_phy_mode_11na_ht20 = 4,
  7896. htt_phy_mode_11ng_ht20 = 5,
  7897. htt_phy_mode_11na_ht40 = 6,
  7898. htt_phy_mode_11ng_ht40 = 7,
  7899. htt_phy_mode_11ac_vht20 = 8,
  7900. htt_phy_mode_11ac_vht40 = 9,
  7901. htt_phy_mode_11ac_vht80 = 10,
  7902. htt_phy_mode_11ac_vht20_2g = 11,
  7903. htt_phy_mode_11ac_vht40_2g = 12,
  7904. htt_phy_mode_11ac_vht80_2g = 13,
  7905. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  7906. htt_phy_mode_11ac_vht160 = 15,
  7907. htt_phy_mode_max,
  7908. };
  7909. /**
  7910. * @brief target -> host HTT channel change indication
  7911. * @details
  7912. * Specify when a channel change occurs.
  7913. * This allows the host to precisely determine which rx frames arrived
  7914. * on the old channel and which rx frames arrived on the new channel.
  7915. *
  7916. *|31 |7 0 |
  7917. *|-------------------------------------------+----------|
  7918. *| reserved | msg type |
  7919. *|------------------------------------------------------|
  7920. *| primary_chan_center_freq_mhz |
  7921. *|------------------------------------------------------|
  7922. *| contiguous_chan1_center_freq_mhz |
  7923. *|------------------------------------------------------|
  7924. *| contiguous_chan2_center_freq_mhz |
  7925. *|------------------------------------------------------|
  7926. *| phy_mode |
  7927. *|------------------------------------------------------|
  7928. *
  7929. * Header fields:
  7930. * - MSG_TYPE
  7931. * Bits 7:0
  7932. * Purpose: identifies this as a htt channel change indication message
  7933. * Value: 0x15
  7934. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  7935. * Bits 31:0
  7936. * Purpose: identify the (center of the) new 20 MHz primary channel
  7937. * Value: center frequency of the 20 MHz primary channel, in MHz units
  7938. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  7939. * Bits 31:0
  7940. * Purpose: identify the (center of the) contiguous frequency range
  7941. * comprising the new channel.
  7942. * For example, if the new channel is a 80 MHz channel extending
  7943. * 60 MHz beyond the primary channel, this field would be 30 larger
  7944. * than the primary channel center frequency field.
  7945. * Value: center frequency of the contiguous frequency range comprising
  7946. * the full channel in MHz units
  7947. * (80+80 channels also use the CONTIG_CHAN2 field)
  7948. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  7949. * Bits 31:0
  7950. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  7951. * within a VHT 80+80 channel.
  7952. * This field is only relevant for VHT 80+80 channels.
  7953. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  7954. * channel (arbitrary value for cases besides VHT 80+80)
  7955. * - PHY_MODE
  7956. * Bits 31:0
  7957. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  7958. * and band
  7959. * Value: htt_phy_mode enum value
  7960. */
  7961. PREPACK struct htt_chan_change_t {
  7962. /* DWORD 0: flags and meta-data */
  7963. A_UINT32 msg_type:8, /* HTT_T2H_MSG_TYPE_CHAN_CHANGE */
  7964. reserved1:24;
  7965. A_UINT32 primary_chan_center_freq_mhz;
  7966. A_UINT32 contig_chan1_center_freq_mhz;
  7967. A_UINT32 contig_chan2_center_freq_mhz;
  7968. A_UINT32 phy_mode;
  7969. } POSTPACK;
  7970. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  7971. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  7972. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  7973. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  7974. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  7975. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  7976. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  7977. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  7978. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  7979. do { \
  7980. HTT_CHECK_SET_VAL( \
  7981. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value); \
  7982. (word) |= (value) << \
  7983. HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  7984. } while (0)
  7985. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  7986. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  7987. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  7988. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  7989. do { \
  7990. HTT_CHECK_SET_VAL( \
  7991. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value); \
  7992. (word) |= (value) << \
  7993. HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  7994. } while (0)
  7995. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  7996. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  7997. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  7998. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  7999. do { \
  8000. HTT_CHECK_SET_VAL( \
  8001. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value); \
  8002. (word) |= (value) << \
  8003. HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  8004. } while (0)
  8005. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  8006. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  8007. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  8008. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  8009. do { \
  8010. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value); \
  8011. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  8012. } while (0)
  8013. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  8014. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  8015. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  8016. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  8017. /**
  8018. * @brief rx offload packet error message
  8019. *
  8020. * @details
  8021. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  8022. * of target payload like mic err.
  8023. *
  8024. * |31 24|23 16|15 8|7 0|
  8025. * |----------------+----------------+----------------+----------------|
  8026. * | tid | vdev_id | msg_sub_type | msg_type |
  8027. * |-------------------------------------------------------------------|
  8028. * : (sub-type dependent content) :
  8029. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8030. * Header fields:
  8031. * - msg_type
  8032. * Bits 7:0
  8033. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  8034. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  8035. * - msg_sub_type
  8036. * Bits 15:8
  8037. * Purpose: Identifies which type of rx error is reported by this message
  8038. * value: htt_rx_ofld_pkt_err_type
  8039. * - vdev_id
  8040. * Bits 23:16
  8041. * Purpose: Identifies which vdev received the erroneous rx frame
  8042. * value:
  8043. * - tid
  8044. * Bits 31:24
  8045. * Purpose: Identifies the traffic type of the rx frame
  8046. * value:
  8047. *
  8048. * - The payload fields used if the sub-type == MIC error are shown below.
  8049. * Note - MIC err is per MSDU, while PN is per MPDU.
  8050. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  8051. * with MIC err in A-MSDU case, so FW will send only one HTT message
  8052. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  8053. * instead of sending separate HTT messages for each wrong MSDU within
  8054. * the MPDU.
  8055. *
  8056. * |31 24|23 16|15 8|7 0|
  8057. * |----------------+----------------+----------------+----------------|
  8058. * | Rsvd | key_id | peer_id |
  8059. * |-------------------------------------------------------------------|
  8060. * | receiver MAC addr 31:0 |
  8061. * |-------------------------------------------------------------------|
  8062. * | Rsvd | receiver MAC addr 47:32 |
  8063. * |-------------------------------------------------------------------|
  8064. * | transmitter MAC addr 31:0 |
  8065. * |-------------------------------------------------------------------|
  8066. * | Rsvd | transmitter MAC addr 47:32 |
  8067. * |-------------------------------------------------------------------|
  8068. * | PN 31:0 |
  8069. * |-------------------------------------------------------------------|
  8070. * | Rsvd | PN 47:32 |
  8071. * |-------------------------------------------------------------------|
  8072. * - peer_id
  8073. * Bits 15:0
  8074. * Purpose: identifies which peer is frame is from
  8075. * value:
  8076. * - key_id
  8077. * Bits 23:16
  8078. * Purpose: identifies key_id of rx frame
  8079. * value:
  8080. * - RA_31_0 (receiver MAC addr 31:0)
  8081. * Bits 31:0
  8082. * Purpose: identifies by MAC address which vdev received the frame
  8083. * value: MAC address lower 4 bytes
  8084. * - RA_47_32 (receiver MAC addr 47:32)
  8085. * Bits 15:0
  8086. * Purpose: identifies by MAC address which vdev received the frame
  8087. * value: MAC address upper 2 bytes
  8088. * - TA_31_0 (transmitter MAC addr 31:0)
  8089. * Bits 31:0
  8090. * Purpose: identifies by MAC address which peer transmitted the frame
  8091. * value: MAC address lower 4 bytes
  8092. * - TA_47_32 (transmitter MAC addr 47:32)
  8093. * Bits 15:0
  8094. * Purpose: identifies by MAC address which peer transmitted the frame
  8095. * value: MAC address upper 2 bytes
  8096. * - PN_31_0
  8097. * Bits 31:0
  8098. * Purpose: Identifies pn of rx frame
  8099. * value: PN lower 4 bytes
  8100. * - PN_47_32
  8101. * Bits 15:0
  8102. * Purpose: Identifies pn of rx frame
  8103. * value:
  8104. * TKIP or CCMP: PN upper 2 bytes
  8105. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  8106. */
  8107. enum htt_rx_ofld_pkt_err_type {
  8108. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  8109. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  8110. };
  8111. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  8112. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  8113. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  8114. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  8115. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  8116. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  8117. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  8118. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  8119. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  8120. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  8121. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  8122. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  8123. do { \
  8124. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  8125. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  8126. } while (0)
  8127. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  8128. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> \
  8129. HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  8130. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  8131. do { \
  8132. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  8133. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  8134. } while (0)
  8135. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  8136. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  8137. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  8138. do { \
  8139. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  8140. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  8141. } while (0)
  8142. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  8143. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  8144. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  8145. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  8146. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  8147. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  8148. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  8149. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  8150. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  8151. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  8152. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  8153. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  8154. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  8155. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  8156. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  8157. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  8158. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  8159. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  8160. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  8161. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  8162. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  8163. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  8164. do { \
  8165. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  8166. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  8167. } while (0)
  8168. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  8169. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  8170. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  8171. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  8172. do { \
  8173. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  8174. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  8175. } while (0)
  8176. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  8177. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  8178. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  8179. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  8180. do { \
  8181. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  8182. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  8183. } while (0)
  8184. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  8185. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  8186. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  8187. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  8188. do { \
  8189. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  8190. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  8191. } while (0)
  8192. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  8193. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  8194. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  8195. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  8196. do { \
  8197. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  8198. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  8199. } while (0)
  8200. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  8201. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  8202. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  8203. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  8204. do { \
  8205. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  8206. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  8207. } while (0)
  8208. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  8209. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  8210. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  8211. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  8212. do { \
  8213. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  8214. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  8215. } while (0)
  8216. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  8217. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  8218. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  8219. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  8220. do { \
  8221. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  8222. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  8223. } while (0)
  8224. /**
  8225. * @brief peer rate report message
  8226. *
  8227. * @details
  8228. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  8229. * justified rate of all the peers.
  8230. *
  8231. * |31 24|23 16|15 8|7 0|
  8232. * |----------------+----------------+----------------+----------------|
  8233. * | peer_count | | msg_type |
  8234. * |-------------------------------------------------------------------|
  8235. * : Payload (variant number of peer rate report) :
  8236. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  8237. * Header fields:
  8238. * - msg_type
  8239. * Bits 7:0
  8240. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  8241. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  8242. * - reserved
  8243. * Bits 15:8
  8244. * Purpose:
  8245. * value:
  8246. * - peer_count
  8247. * Bits 31:16
  8248. * Purpose: Specify how many peer rate report elements are present in the payload.
  8249. * value:
  8250. *
  8251. * Payload:
  8252. * There are variant number of peer rate report follow the first 32 bits.
  8253. * The peer rate report is defined as follows.
  8254. *
  8255. * |31 20|19 16|15 0|
  8256. * |-----------------------+---------+---------------------------------|-
  8257. * | reserved | phy | peer_id | \
  8258. * |-------------------------------------------------------------------| -> report #0
  8259. * | rate | /
  8260. * |-----------------------+---------+---------------------------------|-
  8261. * | reserved | phy | peer_id | \
  8262. * |-------------------------------------------------------------------| -> report #1
  8263. * | rate | /
  8264. * |-----------------------+---------+---------------------------------|-
  8265. * | reserved | phy | peer_id | \
  8266. * |-------------------------------------------------------------------| -> report #2
  8267. * | rate | /
  8268. * |-------------------------------------------------------------------|-
  8269. * : :
  8270. * : :
  8271. * : :
  8272. * :-------------------------------------------------------------------:
  8273. *
  8274. * - peer_id
  8275. * Bits 15:0
  8276. * Purpose: identify the peer
  8277. * value:
  8278. * - phy
  8279. * Bits 19:16
  8280. * Purpose: identify which phy is in use
  8281. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  8282. * Please see enum htt_peer_report_phy_type for detail.
  8283. * - reserved
  8284. * Bits 31:20
  8285. * Purpose:
  8286. * value:
  8287. * - rate
  8288. * Bits 31:0
  8289. * Purpose: represent the justified rate of the peer specified by peer_id
  8290. * value:
  8291. */
  8292. enum htt_peer_rate_report_phy_type {
  8293. HTT_PEER_RATE_REPORT_11B = 0,
  8294. HTT_PEER_RATE_REPORT_11A_G,
  8295. HTT_PEER_RATE_REPORT_11N,
  8296. HTT_PEER_RATE_REPORT_11AC,
  8297. };
  8298. #define HTT_PEER_RATE_REPORT_SIZE 8
  8299. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  8300. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  8301. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  8302. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  8303. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  8304. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  8305. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  8306. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  8307. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  8308. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  8309. do { \
  8310. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  8311. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  8312. } while (0)
  8313. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  8314. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  8315. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  8316. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  8317. do { \
  8318. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  8319. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  8320. } while (0)
  8321. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  8322. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  8323. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  8324. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  8325. do { \
  8326. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  8327. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  8328. } while (0)
  8329. /**
  8330. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
  8331. *
  8332. * @details
  8333. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  8334. * a flow of descriptors.
  8335. *
  8336. * This message is in TLV format and indicates the parameters to be setup a
  8337. * flow in the host. Each entry indicates that a particular flow ID is ready to
  8338. * receive descriptors from a specified pool.
  8339. *
  8340. * The message would appear as follows:
  8341. *
  8342. * |31 24|23 16|15 8|7 0|
  8343. * |----------------+----------------+----------------+----------------|
  8344. * header | reserved | num_flows | msg_type |
  8345. * |-------------------------------------------------------------------|
  8346. * | |
  8347. * : payload :
  8348. * | |
  8349. * |-------------------------------------------------------------------|
  8350. *
  8351. * The header field is one DWORD long and is interpreted as follows:
  8352. * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  8353. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  8354. * this message
  8355. * b'16-31 - reserved: These bits are reserved for future use
  8356. *
  8357. * Payload:
  8358. * The payload would contain multiple objects of the following structure. Each
  8359. * object represents a flow.
  8360. *
  8361. * |31 24|23 16|15 8|7 0|
  8362. * |----------------+----------------+----------------+----------------|
  8363. * header | reserved | num_flows | msg_type |
  8364. * |-------------------------------------------------------------------|
  8365. * payload0| flow_type |
  8366. * |-------------------------------------------------------------------|
  8367. * | flow_id |
  8368. * |-------------------------------------------------------------------|
  8369. * | reserved0 | flow_pool_id |
  8370. * |-------------------------------------------------------------------|
  8371. * | reserved1 | flow_pool_size |
  8372. * |-------------------------------------------------------------------|
  8373. * | reserved2 |
  8374. * |-------------------------------------------------------------------|
  8375. * payload1| flow_type |
  8376. * |-------------------------------------------------------------------|
  8377. * | flow_id |
  8378. * |-------------------------------------------------------------------|
  8379. * | reserved0 | flow_pool_id |
  8380. * |-------------------------------------------------------------------|
  8381. * | reserved1 | flow_pool_size |
  8382. * |-------------------------------------------------------------------|
  8383. * | reserved2 |
  8384. * |-------------------------------------------------------------------|
  8385. * | . |
  8386. * | . |
  8387. * | . |
  8388. * |-------------------------------------------------------------------|
  8389. *
  8390. * Each payload is 5 DWORDS long and is interpreted as follows:
  8391. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  8392. * this flow is associated. It can be VDEV, peer,
  8393. * or tid (AC). Based on enum htt_flow_type.
  8394. *
  8395. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8396. * object. For flow_type vdev it is set to the
  8397. * vdevid, for peer it is peerid and for tid, it is
  8398. * tid_num.
  8399. *
  8400. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  8401. * in the host for this flow
  8402. * b'16:31 - reserved0: This field in reserved for the future. In case
  8403. * we have a hierarchical implementation (HCM) of
  8404. * pools, it can be used to indicate the ID of the
  8405. * parent-pool.
  8406. *
  8407. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  8408. * Descriptors for this flow will be
  8409. * allocated from this pool in the host.
  8410. * b'16:31 - reserved1: This field in reserved for the future. In case
  8411. * we have a hierarchical implementation of pools,
  8412. * it can be used to indicate the max number of
  8413. * descriptors in the pool. The b'0:15 can be used
  8414. * to indicate min number of descriptors in the
  8415. * HCM scheme.
  8416. *
  8417. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  8418. * we have a hierarchical implementation of pools,
  8419. * b'0:15 can be used to indicate the
  8420. * priority-based borrowing (PBB) threshold of
  8421. * the flow's pool. The b'16:31 are still left
  8422. * reserved.
  8423. */
  8424. enum htt_flow_type {
  8425. FLOW_TYPE_VDEV = 0,
  8426. /* Insert new flow types above this line */
  8427. };
  8428. PREPACK struct htt_flow_pool_map_payload_t {
  8429. A_UINT32 flow_type;
  8430. A_UINT32 flow_id;
  8431. A_UINT32 flow_pool_id:16,
  8432. reserved0:16;
  8433. A_UINT32 flow_pool_size:16,
  8434. reserved1:16;
  8435. A_UINT32 reserved2;
  8436. } POSTPACK;
  8437. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  8438. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  8439. (sizeof(struct htt_flow_pool_map_payload_t))
  8440. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  8441. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  8442. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  8443. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  8444. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  8445. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  8446. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  8447. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  8448. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  8449. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  8450. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  8451. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  8452. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  8453. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  8454. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  8455. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  8456. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  8457. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  8458. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  8459. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  8460. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  8461. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  8462. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  8463. do { \
  8464. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  8465. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  8466. } while (0)
  8467. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  8468. do { \
  8469. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  8470. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  8471. } while (0)
  8472. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  8473. do { \
  8474. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  8475. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  8476. } while (0)
  8477. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  8478. do { \
  8479. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  8480. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  8481. } while (0)
  8482. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  8483. do { \
  8484. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  8485. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  8486. } while (0)
  8487. /**
  8488. * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
  8489. *
  8490. * @details
  8491. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  8492. * down a flow of descriptors.
  8493. * This message indicates that for the flow (whose ID is provided) is wanting
  8494. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  8495. * pool of descriptors from where descriptors are being allocated for this
  8496. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  8497. * be unmapped by the host.
  8498. *
  8499. * The message would appear as follows:
  8500. *
  8501. * |31 24|23 16|15 8|7 0|
  8502. * |----------------+----------------+----------------+----------------|
  8503. * | reserved0 | msg_type |
  8504. * |-------------------------------------------------------------------|
  8505. * | flow_type |
  8506. * |-------------------------------------------------------------------|
  8507. * | flow_id |
  8508. * |-------------------------------------------------------------------|
  8509. * | reserved1 | flow_pool_id |
  8510. * |-------------------------------------------------------------------|
  8511. *
  8512. * The message is interpreted as follows:
  8513. * dword0 - b'0:7 - msg_type: This will be set to
  8514. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  8515. * b'8:31 - reserved0: Reserved for future use
  8516. *
  8517. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  8518. * this flow is associated. It can be VDEV, peer,
  8519. * or tid (AC). Based on enum htt_flow_type.
  8520. *
  8521. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  8522. * object. For flow_type vdev it is set to the
  8523. * vdevid, for peer it is peerid and for tid, it is
  8524. * tid_num.
  8525. *
  8526. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  8527. * used in the host for this flow
  8528. * b'16:31 - reserved0: This field in reserved for the future.
  8529. *
  8530. */
  8531. PREPACK struct htt_flow_pool_unmap_t {
  8532. A_UINT32 msg_type:8,
  8533. reserved0:24;
  8534. A_UINT32 flow_type;
  8535. A_UINT32 flow_id;
  8536. A_UINT32 flow_pool_id:16,
  8537. reserved1:16;
  8538. } POSTPACK;
  8539. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  8540. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  8541. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  8542. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  8543. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  8544. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  8545. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  8546. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  8547. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  8548. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  8549. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  8550. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  8551. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  8552. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  8553. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  8554. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  8555. do { \
  8556. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  8557. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  8558. } while (0)
  8559. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  8560. do { \
  8561. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  8562. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  8563. } while (0)
  8564. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  8565. do { \
  8566. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  8567. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  8568. } while (0)
  8569. /**
  8570. * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
  8571. *
  8572. * @details
  8573. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  8574. * SRNG ring setup is done
  8575. *
  8576. * This message indicates whether the last setup operation is successful.
  8577. * It will be sent to host when host set respose_required bit in
  8578. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  8579. * The message would appear as follows:
  8580. *
  8581. * |31 24|23 16|15 8|7 0|
  8582. * |--------------- +----------------+----------------+----------------|
  8583. * | setup_status | ring_id | pdev_id | msg_type |
  8584. * |-------------------------------------------------------------------|
  8585. *
  8586. * The message is interpreted as follows:
  8587. * dword0 - b'0:7 - msg_type: This will be set to
  8588. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  8589. * b'8:15 - pdev_id:
  8590. * 0 (for rings at SOC/UMAC level),
  8591. * 1/2/3 mac id (for rings at LMAC level)
  8592. * b'16:23 - ring_id: Identify the ring which is set up
  8593. * More details can be got from enum htt_srng_ring_id
  8594. * b'24:31 - setup_status: Indicate status of setup operation
  8595. * Refer to htt_ring_setup_status
  8596. */
  8597. PREPACK struct htt_sring_setup_done_t {
  8598. A_UINT32 msg_type: 8,
  8599. pdev_id: 8,
  8600. ring_id: 8,
  8601. setup_status: 8;
  8602. } POSTPACK;
  8603. enum htt_ring_setup_status {
  8604. htt_ring_setup_status_ok = 0,
  8605. htt_ring_setup_status_error,
  8606. };
  8607. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  8608. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  8609. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  8610. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  8611. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  8612. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  8613. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  8614. do { \
  8615. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  8616. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  8617. } while (0)
  8618. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  8619. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  8620. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  8621. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  8622. HTT_SRING_SETUP_DONE_RING_ID_S)
  8623. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  8624. do { \
  8625. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  8626. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  8627. } while (0)
  8628. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  8629. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  8630. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  8631. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  8632. HTT_SRING_SETUP_DONE_STATUS_S)
  8633. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  8634. do { \
  8635. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  8636. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  8637. } while (0)
  8638. /**
  8639. * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
  8640. *
  8641. * @details
  8642. * HTT TX map flow entry with tqm flow pointer
  8643. * Sent from firmware to host to add tqm flow pointer in corresponding
  8644. * flow search entry. Flow metadata is replayed back to host as part of this
  8645. * struct to enable host to find the specific flow search entry
  8646. *
  8647. * The message would appear as follows:
  8648. *
  8649. * |31 28|27 18|17 14|13 8|7 0|
  8650. * |-------+------------------------------------------+----------------|
  8651. * | rsvd0 | fse_hsh_idx | msg_type |
  8652. * |-------------------------------------------------------------------|
  8653. * | rsvd1 | tid | peer_id |
  8654. * |-------------------------------------------------------------------|
  8655. * | tqm_flow_pntr_lo |
  8656. * |-------------------------------------------------------------------|
  8657. * | tqm_flow_pntr_hi |
  8658. * |-------------------------------------------------------------------|
  8659. * | fse_meta_data |
  8660. * |-------------------------------------------------------------------|
  8661. *
  8662. * The message is interpreted as follows:
  8663. *
  8664. * dword0 - b'0:7 - msg_type: This will be set to
  8665. * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  8666. *
  8667. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  8668. * for this flow entry
  8669. *
  8670. * dword0 - b'28:31 - rsvd0: Reserved for future use
  8671. *
  8672. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  8673. *
  8674. * dword1 - b'14:17 - tid
  8675. *
  8676. * dword1 - b'18:31 - rsvd1: Reserved for future use
  8677. *
  8678. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  8679. *
  8680. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  8681. *
  8682. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  8683. * given by host
  8684. */
  8685. PREPACK struct htt_tx_map_flow_info {
  8686. A_UINT32
  8687. msg_type: 8,
  8688. fse_hsh_idx: 20,
  8689. rsvd0: 4;
  8690. A_UINT32
  8691. peer_id: 14,
  8692. tid: 4,
  8693. rsvd1: 14;
  8694. A_UINT32 tqm_flow_pntr_lo;
  8695. A_UINT32 tqm_flow_pntr_hi;
  8696. struct htt_tx_flow_metadata fse_meta_data;
  8697. } POSTPACK;
  8698. /* DWORD 0 */
  8699. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  8700. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  8701. /* DWORD 1 */
  8702. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  8703. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  8704. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  8705. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  8706. /* DWORD 0 */
  8707. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  8708. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  8709. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  8710. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  8711. do { \
  8712. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  8713. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  8714. } while (0)
  8715. /* DWORD 1 */
  8716. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  8717. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  8718. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  8719. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  8720. do { \
  8721. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  8722. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  8723. } while (0)
  8724. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  8725. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  8726. HTT_TX_MAP_FLOW_INFO_TID_S)
  8727. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  8728. do { \
  8729. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  8730. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  8731. } while (0)
  8732. #endif