wlioctl.h 738 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691
  1. /*
  2. * Custom OID/ioctl definitions for
  3. *
  4. *
  5. * Broadcom 802.11abg Networking Device Driver
  6. *
  7. * Definitions subject to change without notice.
  8. *
  9. * Portions of this code are copyright (c) 2020 Cypress Semiconductor Corporation
  10. *
  11. * Copyright (C) 1999-2020, Broadcom Corporation
  12. *
  13. * Unless you and Broadcom execute a separate written software license
  14. * agreement governing use of this software, this software is licensed to you
  15. * under the terms of the GNU General Public License version 2 (the "GPL"),
  16. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  17. * following added to such license:
  18. *
  19. * As a special exception, the copyright holders of this software give you
  20. * permission to link this software with independent modules, and to copy and
  21. * distribute the resulting executable under terms of your choice, provided that
  22. * you also meet, for each linked independent module, the terms and conditions of
  23. * the license of that module. An independent module is a module which is not
  24. * derived from this software. The special exception does not apply to any
  25. * modifications of the software.
  26. *
  27. * Notwithstanding the above, under no circumstances may you combine this
  28. * software in any way with any other Broadcom software provided under a license
  29. * other than the GPL, without Broadcom's express prior written consent.
  30. *
  31. *
  32. * <<Broadcom-WL-IPTag/Open:>>
  33. *
  34. * $Id: wlioctl.h 725552 2020-05-07 09:18:14Z $
  35. */
  36. #ifndef _wlioctl_h_
  37. #define _wlioctl_h_
  38. #include <typedefs.h>
  39. #include <ethernet.h>
  40. #include <bcmip.h>
  41. #include <bcmeth.h>
  42. #include <bcmip.h>
  43. #include <bcmipv6.h>
  44. #include <bcmevent.h>
  45. #include <802.11.h>
  46. #include <802.11s.h>
  47. #include <802.1d.h>
  48. #include <bcmwifi_channels.h>
  49. #ifdef WL11AX
  50. #include <802.11ax.h>
  51. #endif /* WL11AX */
  52. #include <bcmwifi_rates.h>
  53. #include <wlioctl_defs.h>
  54. #include <bcmipv6.h>
  55. #include <bcm_mpool_pub.h>
  56. #include <bcmcdc.h>
  57. #define SSSR_NEW_API
  58. /* Include bcmerror.h for error codes or aliases */
  59. #ifdef BCMUTILS_ERR_CODES
  60. #include <bcmerror.h>
  61. #endif /* BCMUTILS_ERR_CODES */
  62. /* NOTE re: Module specific error codes.
  63. *
  64. * BCME_.. error codes are extended by various features - e.g. FTM, NAN, SAE etc.
  65. * The current process is to allocate a range of 1024 negative 32 bit integers to
  66. * each module that extends the error codes to indicate a module specific status.
  67. *
  68. * The next range to use is below. If that range is used for a new feature, please
  69. * update the range to be used by the next feature.
  70. *
  71. * The error codes -4096 ... -5119 are reserved for firmware signing.
  72. *
  73. * Next available (inclusive) range: [-8*1024 + 1, -7*1024]
  74. *
  75. * End Note
  76. */
  77. /* 11ax trigger frame format - versioning info */
  78. #define TRIG_FRAME_FORMAT_11AX_DRAFT_1P1 0
  79. typedef struct {
  80. uint32 num;
  81. chanspec_t list[1];
  82. } chanspec_list_t;
  83. #define RSN_KCK_LENGTH 16
  84. #define RSN_KEK_LENGTH 16
  85. #define TPK_FTM_LEN 16
  86. #ifndef INTF_NAME_SIZ
  87. #define INTF_NAME_SIZ 16
  88. #endif // endif
  89. #define WL_ASSOC_START_EVT_DATA_VERSION 1
  90. typedef struct assoc_event_data {
  91. uint32 version;
  92. uint32 flags;
  93. chanspec_t join_chspec;
  94. } assoc_event_data_t;
  95. /**Used to send ioctls over the transport pipe */
  96. typedef struct remote_ioctl {
  97. cdc_ioctl_t msg;
  98. uint32 data_len;
  99. char intf_name[INTF_NAME_SIZ];
  100. } rem_ioctl_t;
  101. #define REMOTE_SIZE sizeof(rem_ioctl_t)
  102. #define BCM_IOV_XTLV_VERSION 0
  103. #define MAX_NUM_D11CORES 2
  104. /**DFS Forced param */
  105. typedef struct wl_dfs_forced_params {
  106. chanspec_t chspec;
  107. uint16 version;
  108. chanspec_list_t chspec_list;
  109. } wl_dfs_forced_t;
  110. #define DFS_PREFCHANLIST_VER 0x01
  111. #define WL_CHSPEC_LIST_FIXED_SIZE OFFSETOF(chanspec_list_t, list)
  112. /* size of dfs forced param size given n channels are in the list */
  113. #define WL_DFS_FORCED_PARAMS_SIZE(n) \
  114. (sizeof(wl_dfs_forced_t) + (((n) < 1) ? (0) : (((n) - 1)* sizeof(chanspec_t))))
  115. #define WL_DFS_FORCED_PARAMS_FIXED_SIZE \
  116. (WL_CHSPEC_LIST_FIXED_SIZE + OFFSETOF(wl_dfs_forced_t, chspec_list))
  117. #define WL_DFS_FORCED_PARAMS_MAX_SIZE \
  118. WL_DFS_FORCED_PARAMS_FIXED_SIZE + (WL_NUMCHANNELS * sizeof(chanspec_t))
  119. /**association decision information */
  120. typedef struct {
  121. uint8 assoc_approved; /**< (re)association approved */
  122. uint8 pad;
  123. uint16 reject_reason; /**< reason code for rejecting association */
  124. struct ether_addr da;
  125. uint8 pad1[6];
  126. int64 sys_time; /**< current system time */
  127. } assoc_decision_t;
  128. #define DFS_SCAN_S_IDLE -1
  129. #define DFS_SCAN_S_RADAR_FREE 0
  130. #define DFS_SCAN_S_RADAR_FOUND 1
  131. #define DFS_SCAN_S_INPROGESS 2
  132. #define DFS_SCAN_S_SCAN_ABORTED 3
  133. #define DFS_SCAN_S_SCAN_MODESW_INPROGRESS 4
  134. #define DFS_SCAN_S_MAX 5
  135. #define ACTION_FRAME_SIZE 1800
  136. typedef struct wl_action_frame {
  137. struct ether_addr da;
  138. uint16 len;
  139. uint32 packetId;
  140. uint8 data[ACTION_FRAME_SIZE];
  141. } wl_action_frame_t;
  142. #define WL_WIFI_ACTION_FRAME_SIZE sizeof(struct wl_action_frame)
  143. typedef struct ssid_info
  144. {
  145. uint8 ssid_len; /**< the length of SSID */
  146. uint8 ssid[32]; /**< SSID string */
  147. } ssid_info_t;
  148. typedef struct wl_af_params {
  149. uint32 channel;
  150. int32 dwell_time;
  151. struct ether_addr BSSID;
  152. uint8 PAD[2];
  153. wl_action_frame_t action_frame;
  154. } wl_af_params_t;
  155. #define WL_WIFI_AF_PARAMS_SIZE sizeof(struct wl_af_params)
  156. #define WL_EXTAUTH_START 1
  157. #define WL_EXTAUTH_ABORT 2
  158. #define WL_EXTAUTH_FAIL 3
  159. #define WL_EXTAUTH_SUCCESS 4
  160. /**
  161. * Used by both dongle and host
  162. * dongle asks host to start auth(SAE)
  163. * host updates auth status to dongle
  164. */
  165. typedef struct wl_auth_req_status {
  166. uint16 flags;
  167. struct ether_addr peer_mac; /**< peer mac address */
  168. uint32 ssid_len;
  169. uint8 ssid[DOT11_MAX_SSID_LEN];
  170. uint8 pmkid[WPA2_PMKID_LEN];
  171. } wl_auth_req_status_t;
  172. typedef struct wl_mf_params {
  173. uint32 version;
  174. uint32 dwell_time;
  175. uint16 len;
  176. uint16 fc;
  177. uint16 channel;
  178. struct ether_addr da;
  179. struct ether_addr bssid;
  180. uint32 packetId;
  181. uint8 data[1];
  182. } wl_mf_params_t;
  183. #define WL_MGMT_FRAME_FIXED_SIZE sizeof(struct wl_mf_params)
  184. #define MFP_TEST_FLAG_NORMAL 0
  185. #define MFP_TEST_FLAG_ANY_KEY 1
  186. typedef struct wl_sa_query {
  187. uint32 flag;
  188. uint8 action;
  189. uint8 PAD;
  190. uint16 id;
  191. struct ether_addr da;
  192. uint16 PAD;
  193. } wl_sa_query_t;
  194. /* EXT_STA */
  195. /**association information */
  196. typedef struct {
  197. uint32 assoc_req; /**< offset to association request frame */
  198. uint32 assoc_req_len; /**< association request frame length */
  199. uint32 assoc_rsp; /**< offset to association response frame */
  200. uint32 assoc_rsp_len; /**< association response frame length */
  201. uint32 bcn; /**< offset to AP beacon */
  202. uint32 bcn_len; /**< AP beacon length */
  203. uint32 wsec; /**< ucast security algo */
  204. uint32 wpaie; /**< offset to WPA ie */
  205. uint8 auth_alg; /**< 802.11 authentication mode */
  206. uint8 WPA_auth; /**< WPA: authenticated key management */
  207. uint8 ewc_cap; /**< EWC (MIMO) capable */
  208. uint8 ofdm; /**< OFDM */
  209. } assoc_info_t;
  210. /* defined(EXT_STA) */
  211. /* Flags for OBSS IOVAR Parameters */
  212. #define WL_OBSS_DYN_BWSW_FLAG_ACTIVITY_PERIOD (0x01)
  213. #define WL_OBSS_DYN_BWSW_FLAG_NOACTIVITY_PERIOD (0x02)
  214. #define WL_OBSS_DYN_BWSW_FLAG_NOACTIVITY_INCR_PERIOD (0x04)
  215. #define WL_OBSS_DYN_BWSW_FLAG_PSEUDO_SENSE_PERIOD (0x08)
  216. #define WL_OBSS_DYN_BWSW_FLAG_RX_CRS_PERIOD (0x10)
  217. #define WL_OBSS_DYN_BWSW_FLAG_DUR_THRESHOLD (0x20)
  218. #define WL_OBSS_DYN_BWSW_FLAG_TXOP_PERIOD (0x40)
  219. /* OBSS IOVAR Version information */
  220. #define WL_PROT_OBSS_CONFIG_PARAMS_VERSION 1
  221. #include <packed_section_start.h>
  222. typedef BWL_PRE_PACKED_STRUCT struct {
  223. uint8 obss_bwsw_activity_cfm_count_cfg; /**< configurable count in
  224. * seconds before we confirm that OBSS is present and
  225. * dynamically activate dynamic bwswitch.
  226. */
  227. uint8 obss_bwsw_no_activity_cfm_count_cfg; /**< configurable count in
  228. * seconds before we confirm that OBSS is GONE and
  229. * dynamically start pseudo upgrade. If in pseudo sense time, we
  230. * will see OBSS, [means that, we false detected that OBSS-is-gone
  231. * in watchdog] this count will be incremented in steps of
  232. * obss_bwsw_no_activity_cfm_count_incr_cfg for confirming OBSS
  233. * detection again. Note that, at present, max 30seconds is
  234. * allowed like this. [OBSS_BWSW_NO_ACTIVITY_MAX_INCR_DEFAULT]
  235. */
  236. uint8 obss_bwsw_no_activity_cfm_count_incr_cfg; /* see above
  237. */
  238. uint16 obss_bwsw_pseudo_sense_count_cfg; /**< number of msecs/cnt to be in
  239. * pseudo state. This is used to sense/measure the stats from lq.
  240. */
  241. uint8 obss_bwsw_rx_crs_threshold_cfg; /**< RX CRS default threshold */
  242. uint8 obss_bwsw_dur_thres; /**< OBSS dyn bwsw trigger/RX CRS Sec */
  243. uint8 obss_bwsw_txop_threshold_cfg; /**< TXOP default threshold */
  244. } BWL_POST_PACKED_STRUCT wlc_obss_dynbwsw_config_t;
  245. #include <packed_section_end.h>
  246. #include <packed_section_start.h>
  247. typedef BWL_PRE_PACKED_STRUCT struct {
  248. uint32 version; /**< version field */
  249. uint32 config_mask;
  250. uint32 reset_mask;
  251. wlc_obss_dynbwsw_config_t config_params;
  252. } BWL_POST_PACKED_STRUCT obss_config_params_t;
  253. #include <packed_section_end.h>
  254. /**bsscfg type */
  255. typedef enum bsscfg_type {
  256. BSSCFG_TYPE_GENERIC = 0, /**< Generic AP/STA/IBSS BSS */
  257. BSSCFG_TYPE_P2P = 1, /**< P2P BSS */
  258. /* index 2 earlier used for BTAMP */
  259. BSSCFG_TYPE_PSTA = 3,
  260. BSSCFG_TYPE_TDLS = 4,
  261. BSSCFG_TYPE_SLOTTED_BSS = 5,
  262. BSSCFG_TYPE_PROXD = 6,
  263. BSSCFG_TYPE_NAN = 7,
  264. BSSCFG_TYPE_MESH = 8,
  265. BSSCFG_TYPE_AIBSS = 9
  266. } bsscfg_type_t;
  267. /* bsscfg subtype */
  268. typedef enum bsscfg_subtype {
  269. BSSCFG_SUBTYPE_NONE = 0,
  270. BSSCFG_GENERIC_STA = 1, /* GENERIC */
  271. BSSCFG_GENERIC_AP = 2,
  272. BSSCFG_GENERIC_IBSS = 6,
  273. BSSCFG_P2P_GC = 3, /* P2P */
  274. BSSCFG_P2P_GO = 4,
  275. BSSCFG_P2P_DISC = 5,
  276. /* Index 7 & 8 earlier used for BTAMP */
  277. BSSCFG_SUBTYPE_AWDL = 9, /* SLOTTED_BSS_TYPE */
  278. BSSCFG_SUBTYPE_NAN_MGMT = 10,
  279. BSSCFG_SUBTYPE_NAN_DATA = 11,
  280. BSSCFG_SUBTYPE_NAN_MGMT_DATA = 12
  281. } bsscfg_subtype_t;
  282. typedef struct wlc_bsscfg_info {
  283. uint32 type;
  284. uint32 subtype;
  285. } wlc_bsscfg_info_t;
  286. /* ULP SHM Offsets info */
  287. typedef struct ulp_shm_info {
  288. uint32 m_ulp_ctrl_sdio;
  289. uint32 m_ulp_wakeevt_ind;
  290. uint32 m_ulp_wakeind;
  291. } ulp_shm_info_t;
  292. /* Legacy structure to help keep backward compatible wl tool and tray app */
  293. #define LEGACY_WL_BSS_INFO_VERSION 107 /**< older version of wl_bss_info struct */
  294. typedef struct wl_bss_info_107 {
  295. uint32 version; /**< version field */
  296. uint32 length; /**< byte length of data in this record,
  297. * starting at version and including IEs
  298. */
  299. struct ether_addr BSSID;
  300. uint16 beacon_period; /**< units are Kusec */
  301. uint16 capability; /**< Capability information */
  302. uint8 SSID_len;
  303. uint8 SSID[32];
  304. uint8 PAD;
  305. struct {
  306. uint32 count; /**< # rates in this set */
  307. uint8 rates[16]; /**< rates in 500kbps units w/hi bit set if basic */
  308. } rateset; /**< supported rates */
  309. uint8 channel; /**< Channel no. */
  310. uint8 PAD;
  311. uint16 atim_window; /**< units are Kusec */
  312. uint8 dtim_period; /**< DTIM period */
  313. uint8 PAD;
  314. int16 RSSI; /**< receive signal strength (in dBm) */
  315. int8 phy_noise; /**< noise (in dBm) */
  316. uint8 PAD[3];
  317. uint32 ie_length; /**< byte length of Information Elements */
  318. /* variable length Information Elements */
  319. } wl_bss_info_107_t;
  320. /*
  321. * Per-BSS information structure.
  322. */
  323. #define LEGACY2_WL_BSS_INFO_VERSION 108 /**< old version of wl_bss_info struct */
  324. /**
  325. * BSS info structure
  326. * Applications MUST CHECK ie_offset field and length field to access IEs and
  327. * next bss_info structure in a vector (in wl_scan_results_t)
  328. */
  329. typedef struct wl_bss_info_108 {
  330. uint32 version; /**< version field */
  331. uint32 length; /**< byte length of data in this record,
  332. * starting at version and including IEs
  333. */
  334. struct ether_addr BSSID;
  335. uint16 beacon_period; /**< units are Kusec */
  336. uint16 capability; /**< Capability information */
  337. uint8 SSID_len;
  338. uint8 SSID[32];
  339. uint8 PAD[1];
  340. struct {
  341. uint32 count; /**< # rates in this set */
  342. uint8 rates[16]; /**< rates in 500kbps units w/hi bit set if basic */
  343. } rateset; /**< supported rates */
  344. chanspec_t chanspec; /**< chanspec for bss */
  345. uint16 atim_window; /**< units are Kusec */
  346. uint8 dtim_period; /**< DTIM period */
  347. uint8 PAD;
  348. int16 RSSI; /**< receive signal strength (in dBm) */
  349. int8 phy_noise; /**< noise (in dBm) */
  350. uint8 n_cap; /**< BSS is 802.11N Capable */
  351. uint8 PAD[2];
  352. uint32 nbss_cap; /**< 802.11N BSS Capabilities (based on HT_CAP_*) */
  353. uint8 ctl_ch; /**< 802.11N BSS control channel number */
  354. uint8 PAD[3];
  355. uint32 reserved32[1]; /**< Reserved for expansion of BSS properties */
  356. uint8 flags; /**< flags */
  357. uint8 reserved[3]; /**< Reserved for expansion of BSS properties */
  358. uint8 basic_mcs[MCSSET_LEN]; /**< 802.11N BSS required MCS set */
  359. uint16 ie_offset; /**< offset at which IEs start, from beginning */
  360. uint8 PAD[2];
  361. uint32 ie_length; /**< byte length of Information Elements */
  362. /* Add new fields here */
  363. /* variable length Information Elements */
  364. } wl_bss_info_108_t;
  365. #define WL_BSS_INFO_VERSION 109 /**< current version of wl_bss_info struct */
  366. /**
  367. * BSS info structure
  368. * Applications MUST CHECK ie_offset field and length field to access IEs and
  369. * next bss_info structure in a vector (in wl_scan_results_t)
  370. */
  371. typedef struct wl_bss_info {
  372. uint32 version; /**< version field */
  373. uint32 length; /**< byte length of data in this record,
  374. * starting at version and including IEs
  375. */
  376. struct ether_addr BSSID;
  377. uint16 beacon_period; /**< units are Kusec */
  378. uint16 capability; /**< Capability information */
  379. uint8 SSID_len;
  380. uint8 SSID[32];
  381. uint8 bcnflags; /* additional flags w.r.t. beacon */
  382. struct {
  383. uint32 count; /**< # rates in this set */
  384. uint8 rates[16]; /**< rates in 500kbps units w/hi bit set if basic */
  385. } rateset; /**< supported rates */
  386. chanspec_t chanspec; /**< chanspec for bss */
  387. uint16 atim_window; /**< units are Kusec */
  388. uint8 dtim_period; /**< DTIM period */
  389. uint8 accessnet; /* from beacon interwork IE (if bcnflags) */
  390. int16 RSSI; /**< receive signal strength (in dBm) */
  391. int8 phy_noise; /**< noise (in dBm) */
  392. uint8 n_cap; /**< BSS is 802.11N Capable */
  393. uint16 freespace1; /* make implicit padding explicit */
  394. uint32 nbss_cap; /**< 802.11N+AC BSS Capabilities */
  395. uint8 ctl_ch; /**< 802.11N BSS control channel number */
  396. uint8 padding1[3]; /**< explicit struct alignment padding */
  397. uint16 vht_rxmcsmap; /**< VHT rx mcs map (802.11ac IE, VHT_CAP_MCS_MAP_*) */
  398. uint16 vht_txmcsmap; /**< VHT tx mcs map (802.11ac IE, VHT_CAP_MCS_MAP_*) */
  399. uint8 flags; /**< flags */
  400. uint8 vht_cap; /**< BSS is vht capable */
  401. uint8 reserved[2]; /**< Reserved for expansion of BSS properties */
  402. uint8 basic_mcs[MCSSET_LEN]; /**< 802.11N BSS required MCS set */
  403. uint16 ie_offset; /**< offset at which IEs start, from beginning */
  404. uint16 freespace2; /* making implicit padding explicit */
  405. uint32 ie_length; /**< byte length of Information Elements */
  406. int16 SNR; /**< average SNR of during frame reception */
  407. uint16 vht_mcsmap; /**< STA's Associated vhtmcsmap */
  408. uint16 vht_mcsmap_prop; /**< STA's Associated prop vhtmcsmap */
  409. uint16 vht_txmcsmap_prop; /**< prop VHT tx mcs prop */
  410. } wl_bss_info_v109_t;
  411. /**
  412. * BSS info structure
  413. * Applications MUST CHECK ie_offset field and length field to access IEs and
  414. * next bss_info structure in a vector (in wl_scan_results_t)
  415. */
  416. typedef struct wl_bss_info_v109_1 {
  417. uint32 version; /**< version field */
  418. uint32 length; /**< byte length of data in this record,
  419. * starting at version and including IEs
  420. */
  421. struct ether_addr BSSID;
  422. uint16 beacon_period; /**< units are Kusec */
  423. uint16 capability; /**< Capability information */
  424. uint8 SSID_len;
  425. uint8 SSID[32];
  426. uint8 bcnflags; /* additional flags w.r.t. beacon */
  427. struct {
  428. uint32 count; /**< # rates in this set */
  429. uint8 rates[16]; /**< rates in 500kbps units w/hi bit set if basic */
  430. } rateset; /**< supported rates */
  431. chanspec_t chanspec; /**< chanspec for bss */
  432. uint16 atim_window; /**< units are Kusec */
  433. uint8 dtim_period; /**< DTIM period */
  434. uint8 accessnet; /* from beacon interwork IE (if bcnflags) */
  435. int16 RSSI; /**< receive signal strength (in dBm) */
  436. int8 phy_noise; /**< noise (in dBm) */
  437. uint8 n_cap; /**< BSS is 802.11N Capable */
  438. uint8 he_cap; /**< BSS is he capable */
  439. uint8 freespace1; /* make implicit padding explicit */
  440. uint32 nbss_cap; /**< 802.11N+AC BSS Capabilities */
  441. uint8 ctl_ch; /**< 802.11N BSS control channel number */
  442. uint8 padding1[3]; /**< explicit struct alignment padding */
  443. uint16 vht_rxmcsmap; /**< VHT rx mcs map (802.11ac IE, VHT_CAP_MCS_MAP_*) */
  444. uint16 vht_txmcsmap; /**< VHT tx mcs map (802.11ac IE, VHT_CAP_MCS_MAP_*) */
  445. uint8 flags; /**< flags */
  446. uint8 vht_cap; /**< BSS is vht capable */
  447. uint8 reserved[2]; /**< Reserved for expansion of BSS properties */
  448. uint8 basic_mcs[MCSSET_LEN]; /**< 802.11N BSS required MCS set */
  449. uint16 ie_offset; /**< offset at which IEs start, from beginning */
  450. uint16 freespace2; /* making implicit padding explicit */
  451. uint32 ie_length; /**< byte length of Information Elements */
  452. int16 SNR; /**< average SNR of during frame reception */
  453. uint16 vht_mcsmap; /**< STA's Associated vhtmcsmap */
  454. uint16 vht_mcsmap_prop; /**< STA's Associated prop vhtmcsmap */
  455. uint16 vht_txmcsmap_prop; /**< prop VHT tx mcs prop */
  456. uint32 he_mcsmap; /**< STA's Associated hemcsmap */
  457. uint32 he_rxmcsmap; /**< HE rx mcs map (802.11ax IE, HE_CAP_MCS_MAP_*) */
  458. uint32 he_txmcsmap; /**< HE tx mcs map (802.11ax IE, HE_CAP_MCS_MAP_*) */
  459. } wl_bss_info_v109_1_t;
  460. /**
  461. * BSS info structure
  462. * Applications MUST CHECK ie_offset field and length field to access IEs and
  463. * next bss_info structure in a vector (in wl_scan_results_t)
  464. */
  465. typedef struct wl_bss_info_v109_2 {
  466. uint32 version; /**< version field */
  467. uint32 length; /**< byte length of data in this record,
  468. * starting at version and including IEs
  469. */
  470. struct ether_addr BSSID;
  471. uint16 beacon_period; /**< units are Kusec */
  472. uint16 capability; /**< Capability information */
  473. uint8 SSID_len;
  474. uint8 SSID[32];
  475. uint8 bcnflags; /* additional flags w.r.t. beacon */
  476. struct {
  477. uint32 count; /**< # rates in this set */
  478. uint8 rates[16]; /**< rates in 500kbps units w/hi bit set if basic */
  479. } rateset; /**< supported rates */
  480. chanspec_t chanspec; /**< chanspec for bss */
  481. uint16 atim_window; /**< units are Kusec */
  482. uint8 dtim_period; /**< DTIM period */
  483. uint8 accessnet; /* from beacon interwork IE (if bcnflags) */
  484. int16 RSSI; /**< receive signal strength (in dBm) */
  485. int8 phy_noise; /**< noise (in dBm) */
  486. uint8 n_cap; /**< BSS is 802.11N Capable */
  487. uint8 he_cap; /**< BSS is he capable */
  488. uint8 freespace1; /* make implicit padding explicit */
  489. uint32 nbss_cap; /**< 802.11N+AC BSS Capabilities */
  490. uint8 ctl_ch; /**< 802.11N BSS control channel number */
  491. uint8 padding1[3]; /**< explicit struct alignment padding */
  492. uint16 vht_rxmcsmap; /**< VHT rx mcs map (802.11ac IE, VHT_CAP_MCS_MAP_*) */
  493. uint16 vht_txmcsmap; /**< VHT tx mcs map (802.11ac IE, VHT_CAP_MCS_MAP_*) */
  494. uint8 flags; /**< flags */
  495. uint8 vht_cap; /**< BSS is vht capable */
  496. uint8 reserved[2]; /**< Reserved for expansion of BSS properties */
  497. uint8 basic_mcs[MCSSET_LEN]; /**< 802.11N BSS required MCS set */
  498. uint16 ie_offset; /**< offset at which IEs start, from beginning */
  499. uint16 freespace2; /* making implicit padding explicit */
  500. uint32 ie_length; /**< byte length of Information Elements */
  501. int16 SNR; /**< average SNR of during frame reception */
  502. uint16 vht_mcsmap; /**< STA's Associated vhtmcsmap */
  503. uint16 vht_mcsmap_prop; /**< STA's Associated prop vhtmcsmap */
  504. uint16 vht_txmcsmap_prop; /**< prop VHT tx mcs prop */
  505. uint32 he_mcsmap; /**< STA's Associated hemcsmap */
  506. uint32 he_rxmcsmap; /**< HE rx mcs map (802.11ax IE, HE_CAP_MCS_MAP_*) */
  507. uint32 he_txmcsmap; /**< HE tx mcs map (802.11ax IE, HE_CAP_MCS_MAP_*) */
  508. uint32 timestamp[2]; /* Beacon Timestamp for FAKEAP req */
  509. } wl_bss_info_v109_2_t;
  510. #ifndef WL_BSS_INFO_TYPEDEF_HAS_ALIAS
  511. typedef wl_bss_info_v109_t wl_bss_info_t;
  512. #endif // endif
  513. #define WL_GSCAN_FULL_RESULT_VERSION 2 /* current version of wl_gscan_result_t struct */
  514. typedef struct wl_gscan_bss_info {
  515. uint32 timestamp[2];
  516. wl_bss_info_v109_t info;
  517. /* Do not add any more members below, fixed */
  518. /* and variable length Information Elements to follow */
  519. } wl_gscan_bss_info_v2_t;
  520. typedef struct wl_gscan_bss_info_v3 {
  521. uint32 timestamp[2];
  522. uint8 info[]; /* var length wl_bss_info_X structures */
  523. /* Do not add any more members below, fixed */
  524. /* and variable length Information Elements to follow */
  525. } wl_gscan_bss_info_v3_t;
  526. #ifndef WL_BSS_INFO_TYPEDEF_HAS_ALIAS
  527. typedef wl_gscan_bss_info_v2_t wl_gscan_bss_info_t;
  528. #define WL_GSCAN_INFO_FIXED_FIELD_SIZE (sizeof(wl_gscan_bss_info_t) - sizeof(wl_bss_info_t))
  529. #endif // endif
  530. typedef struct wl_bsscfg {
  531. uint32 bsscfg_idx;
  532. uint32 wsec;
  533. uint32 WPA_auth;
  534. uint32 wsec_index;
  535. uint32 associated;
  536. uint32 BSS;
  537. uint32 phytest_on;
  538. struct ether_addr prev_BSSID;
  539. struct ether_addr BSSID;
  540. uint32 targetbss_wpa2_flags;
  541. uint32 assoc_type;
  542. uint32 assoc_state;
  543. } wl_bsscfg_t;
  544. typedef struct wl_if_add {
  545. uint32 bsscfg_flags;
  546. uint32 if_flags;
  547. uint32 ap;
  548. struct ether_addr mac_addr;
  549. uint16 PAD;
  550. uint32 wlc_index;
  551. } wl_if_add_t;
  552. typedef struct wl_bss_config {
  553. uint32 atim_window;
  554. uint32 beacon_period;
  555. uint32 chanspec;
  556. } wl_bss_config_t;
  557. /* Number of Bsscolor supported per core */
  558. #ifndef HE_MAX_BSSCOLOR_RES
  559. #define HE_MAX_BSSCOLOR_RES 2
  560. #endif // endif
  561. #ifndef HE_MAX_STAID_PER_BSSCOLOR
  562. #define HE_MAX_STAID_PER_BSSCOLOR 4
  563. #endif // endif
  564. /* BSSColor indices */
  565. #define BSSCOLOR0_IDX 0
  566. #define BSSCOLOR1_IDX 1
  567. #define HE_BSSCOLOR0 0
  568. #define HE_BSSCOLOR_MAX_VAL 63
  569. /* STAID indices */
  570. #define STAID0_IDX 0
  571. #define STAID1_IDX 1
  572. #define STAID2_IDX 2
  573. #define STAID3_IDX 3
  574. #define HE_STAID_MAX_VAL 0x07FF
  575. typedef struct wl_bsscolor_info {
  576. uint16 version; /**< structure version */
  577. uint16 length; /**< length of the bsscolor info */
  578. uint8 bsscolor_index; /**< bsscolor index 0-1 */
  579. uint8 bsscolor; /**<bsscolor value from 0 to 63 */
  580. uint8 partial_bsscolor_ind;
  581. uint8 disable_bsscolor_ind; /**< To disable particular bsscolor */
  582. /* bsscolor_disable to be added as part of D1.0 */
  583. uint16 staid_info[HE_MAX_STAID_PER_BSSCOLOR]; /**< 0-3 staid info of each bsscolor */
  584. } wl_bsscolor_info_t;
  585. #define WL_BSS_USER_RADAR_CHAN_SELECT 0x1 /**< User application will randomly select
  586. * radar channel.
  587. */
  588. #define DLOAD_HANDLER_VER 1 /**< Downloader version */
  589. #define DLOAD_FLAG_VER_MASK 0xf000 /**< Downloader version mask */
  590. #define DLOAD_FLAG_VER_SHIFT 12 /**< Downloader version shift */
  591. #define DL_CRC_NOT_INUSE 0x0001
  592. #define DL_BEGIN 0x0002
  593. #define DL_END 0x0004
  594. /* Flags for Major/Minor/Date number shift and mask */
  595. #define EPI_VER_SHIFT 16
  596. #define EPI_VER_MASK 0xFFFF
  597. /** generic download types & flags */
  598. enum {
  599. DL_TYPE_UCODE = 1,
  600. DL_TYPE_CLM = 2
  601. };
  602. /** ucode type values */
  603. enum {
  604. UCODE_FW,
  605. INIT_VALS,
  606. BS_INIT_VALS
  607. };
  608. struct wl_dload_data {
  609. uint16 flag;
  610. uint16 dload_type;
  611. uint32 len;
  612. uint32 crc;
  613. uint8 data[1];
  614. };
  615. typedef struct wl_dload_data wl_dload_data_t;
  616. struct wl_ucode_info {
  617. uint32 ucode_type;
  618. uint32 num_chunks;
  619. uint32 chunk_len;
  620. uint32 chunk_num;
  621. uint8 data_chunk[1];
  622. };
  623. typedef struct wl_ucode_info wl_ucode_info_t;
  624. struct wl_clm_dload_info {
  625. uint32 ds_id;
  626. uint32 clm_total_len;
  627. uint32 num_chunks;
  628. uint32 chunk_len;
  629. uint32 chunk_offset;
  630. uint8 data_chunk[1];
  631. };
  632. typedef struct wl_clm_dload_info wl_clm_dload_info_t;
  633. typedef struct wlc_ssid {
  634. uint32 SSID_len;
  635. uint8 SSID[DOT11_MAX_SSID_LEN];
  636. } wlc_ssid_t;
  637. typedef struct wlc_ssid_ext {
  638. uint8 hidden;
  639. uint8 PAD;
  640. uint16 flags;
  641. uint8 SSID_len;
  642. int8 rssi_thresh;
  643. uint8 SSID[DOT11_MAX_SSID_LEN];
  644. } wlc_ssid_ext_t;
  645. #define MAX_PREFERRED_AP_NUM 5
  646. typedef struct wlc_fastssidinfo {
  647. uint32 SSID_channel[MAX_PREFERRED_AP_NUM];
  648. wlc_ssid_t SSID_info[MAX_PREFERRED_AP_NUM];
  649. } wlc_fastssidinfo_t;
  650. typedef struct wnm_url {
  651. uint8 len;
  652. uint8 data[1];
  653. } wnm_url_t;
  654. typedef struct chan_scandata {
  655. uint8 txpower;
  656. uint8 pad;
  657. chanspec_t channel; /**< Channel num, bw, ctrl_sb and band */
  658. uint32 channel_mintime;
  659. uint32 channel_maxtime;
  660. } chan_scandata_t;
  661. typedef enum wl_scan_type {
  662. EXTDSCAN_FOREGROUND_SCAN,
  663. EXTDSCAN_BACKGROUND_SCAN,
  664. EXTDSCAN_FORCEDBACKGROUND_SCAN
  665. } wl_scan_type_t;
  666. #define WLC_EXTDSCAN_MAX_SSID 5
  667. typedef struct wl_extdscan_params {
  668. int8 nprobes; /**< 0, passive, otherwise active */
  669. int8 split_scan; /**< split scan */
  670. int8 band; /**< band */
  671. int8 pad;
  672. wlc_ssid_t ssid[WLC_EXTDSCAN_MAX_SSID]; /**< ssid list */
  673. uint32 tx_rate; /**< in 500ksec units */
  674. wl_scan_type_t scan_type; /**< enum */
  675. int32 channel_num;
  676. chan_scandata_t channel_list[1]; /**< list of chandata structs */
  677. } wl_extdscan_params_t;
  678. #define WL_EXTDSCAN_PARAMS_FIXED_SIZE (sizeof(wl_extdscan_params_t) - sizeof(chan_scandata_t))
  679. #define WL_SCAN_PARAMS_SSID_MAX 10
  680. struct wl_scan_params {
  681. wlc_ssid_t ssid; /**< default: {0, ""} */
  682. struct ether_addr bssid; /**< default: bcast */
  683. int8 bss_type; /**< default: any,
  684. * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
  685. */
  686. uint8 scan_type; /**< flags, 0 use default */
  687. int32 nprobes; /**< -1 use default, number of probes per channel */
  688. int32 active_time; /**< -1 use default, dwell time per channel for
  689. * active scanning
  690. */
  691. int32 passive_time; /**< -1 use default, dwell time per channel
  692. * for passive scanning
  693. */
  694. int32 home_time; /**< -1 use default, dwell time for the home channel
  695. * between channel scans
  696. */
  697. int32 channel_num; /**< count of channels and ssids that follow
  698. *
  699. * low half is count of channels in channel_list, 0
  700. * means default (use all available channels)
  701. *
  702. * high half is entries in wlc_ssid_t array that
  703. * follows channel_list, aligned for int32 (4 bytes)
  704. * meaning an odd channel count implies a 2-byte pad
  705. * between end of channel_list and first ssid
  706. *
  707. * if ssid count is zero, single ssid in the fixed
  708. * parameter portion is assumed, otherwise ssid in
  709. * the fixed portion is ignored
  710. */
  711. uint16 channel_list[1]; /**< list of chanspecs */
  712. };
  713. /* changes in wl_scan_params_v2 as comapred to wl_scan_params (v1)
  714. * unit8 scantype to uint32
  715. */
  716. typedef struct wl_scan_params_v2 {
  717. uint16 version; /* Version of wl_scan_params, change value of
  718. * WL_SCAN_PARAM_VERSION on version update
  719. */
  720. uint16 length; /* length of structure wl_scan_params_v1_t
  721. * without implicit pad
  722. */
  723. wlc_ssid_t ssid; /**< default: {0, ""} */
  724. struct ether_addr bssid; /**< default: bcast */
  725. int8 bss_type; /**< default: any,
  726. * DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
  727. */
  728. uint8 PAD;
  729. uint32 scan_type; /**< flags, 0 use default, and flags specified in
  730. * WL_SCANFLAGS_XXX
  731. */
  732. int32 nprobes; /**< -1 use default, number of probes per channel */
  733. int32 active_time; /**< -1 use default, dwell time per channel for
  734. * active scanning
  735. */
  736. int32 passive_time; /**< -1 use default, dwell time per channel
  737. * for passive scanning
  738. */
  739. int32 home_time; /**< -1 use default, dwell time for the home channel
  740. * between channel scans
  741. */
  742. int32 channel_num; /**< count of channels and ssids that follow
  743. *
  744. * low half is count of channels in channel_list, 0
  745. * means default (use all available channels)
  746. *
  747. * high half is entries in wlc_ssid_t array that
  748. * follows channel_list, aligned for int32 (4 bytes)
  749. * meaning an odd channel count implies a 2-byte pad
  750. * between end of channel_list and first ssid
  751. *
  752. * if ssid count is zero, single ssid in the fixed
  753. * parameter portion is assumed, otherwise ssid in
  754. * the fixed portion is ignored
  755. */
  756. uint16 channel_list[1]; /**< list of chanspecs */
  757. } wl_scan_params_v2_t;
  758. #define WL_SCAN_PARAMS_VERSION_V2 2
  759. /** size of wl_scan_params not including variable length array */
  760. #define WL_SCAN_PARAMS_V2_FIXED_SIZE (OFFSETOF(wl_scan_params_v2_t, channel_list))
  761. #define WL_MAX_ROAMSCAN_DATSZ \
  762. (WL_SCAN_PARAMS_FIXED_SIZE + (WL_NUMCHANNELS * sizeof(uint16)))
  763. #define WL_MAX_ROAMSCAN_V2_DATSZ \
  764. (WL_SCAN_PARAMS_V2_FIXED_SIZE + (WL_NUMCHANNELS * sizeof(uint16)))
  765. #define ISCAN_REQ_VERSION 1
  766. #define ISCAN_REQ_VERSION_V2 2
  767. /** incremental scan struct */
  768. struct wl_iscan_params {
  769. uint32 version;
  770. uint16 action;
  771. uint16 scan_duration;
  772. struct wl_scan_params params;
  773. };
  774. /** incremental scan struct */
  775. typedef struct wl_iscan_params_v2 {
  776. uint32 version;
  777. uint16 action;
  778. uint16 scan_duration;
  779. wl_scan_params_v2_t params;
  780. } wl_iscan_params_v2_t;
  781. /** 3 fields + size of wl_scan_params, not including variable length array */
  782. #define WL_ISCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
  783. #define WL_ISCAN_PARAMS_V2_FIXED_SIZE \
  784. (OFFSETOF(wl_iscan_params_v2_t, params) + sizeof(wlc_ssid_t))
  785. typedef struct wl_scan_results {
  786. uint32 buflen;
  787. uint32 version;
  788. uint32 count;
  789. wl_bss_info_v109_t bss_info[1];
  790. } wl_scan_results_v109_t;
  791. typedef struct wl_scan_results_v2 {
  792. uint32 buflen;
  793. uint32 version;
  794. uint32 count;
  795. uint8 bss_info[]; /* var length wl_bss_info_X structures */
  796. } wl_scan_results_v2_t;
  797. #ifndef WL_BSS_INFO_TYPEDEF_HAS_ALIAS
  798. typedef wl_scan_results_v109_t wl_scan_results_t;
  799. /** size of wl_scan_results not including variable length array */
  800. #define WL_SCAN_RESULTS_FIXED_SIZE (sizeof(wl_scan_results_t) - sizeof(wl_bss_info_t))
  801. #endif // endif
  802. #if defined(SIMPLE_ISCAN)
  803. /** the buf lengh can be WLC_IOCTL_MAXLEN (8K) to reduce iteration */
  804. #define WLC_IW_ISCAN_MAXLEN 2048
  805. typedef struct iscan_buf {
  806. struct iscan_buf * next;
  807. int8 iscan_buf[WLC_IW_ISCAN_MAXLEN];
  808. } iscan_buf_t;
  809. #endif /* SIMPLE_ISCAN */
  810. #define ESCAN_REQ_VERSION 1
  811. #define ESCAN_REQ_VERSION_V2 2
  812. /** event scan reduces amount of SOC memory needed to store scan results */
  813. struct wl_escan_params {
  814. uint32 version;
  815. uint16 action;
  816. uint16 sync_id;
  817. struct wl_scan_params params;
  818. };
  819. typedef struct wl_escan_params_v2 {
  820. uint32 version;
  821. uint16 action;
  822. uint16 sync_id;
  823. wl_scan_params_v2_t params;
  824. } wl_escan_params_v2_t;
  825. #define WL_ESCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_escan_params_t, params) + sizeof(wlc_ssid_t))
  826. #define WL_ESCAN_PARAMS_V2_FIXED_SIZE (OFFSETOF(wl_escan_params_v2_t, params) + sizeof(wlc_ssid_t))
  827. /* New scan version is defined then change old version of scan to
  828. * wl_scan_params_v1_t and new one to wl_scan_params_t
  829. */
  830. #ifdef WL_SCAN_PARAMS_V2
  831. typedef struct wl_scan_params wl_scan_params_v1_t;
  832. typedef struct wl_escan_params wl_escan_params_v1_t;
  833. typedef struct wl_iscan_params wl_iscan_params_v1_t;
  834. typedef struct wl_scan_params_v2 wl_scan_params_t;
  835. typedef struct wl_escan_params_v2 wl_escan_params_t;
  836. typedef struct wl_iscan_params_v2 wl_iscan_params_t;
  837. #define WL_SCAN_PARAMS_FIXED_SIZE (OFFSETOF(wl_scan_params_t, channel_list))
  838. #else
  839. typedef struct wl_scan_params wl_scan_params_t;
  840. typedef struct wl_escan_params wl_escan_params_t;
  841. typedef struct wl_iscan_params wl_iscan_params_t;
  842. #define WL_SCAN_PARAMS_FIXED_SIZE 64
  843. #endif // endif
  844. /** event scan reduces amount of SOC memory needed to store scan results */
  845. typedef struct wl_escan_result {
  846. uint32 buflen;
  847. uint32 version;
  848. uint16 sync_id;
  849. uint16 bss_count;
  850. wl_bss_info_v109_t bss_info[1];
  851. } wl_escan_result_v109_t;
  852. /** event scan reduces amount of SOC memory needed to store scan results */
  853. typedef struct wl_escan_result_v2 {
  854. uint32 buflen;
  855. uint32 version;
  856. uint16 sync_id;
  857. uint16 bss_count;
  858. uint8 bss_info[]; /* var length wl_bss_info_X structures */
  859. } wl_escan_result_v2_t;
  860. #ifndef WL_BSS_INFO_TYPEDEF_HAS_ALIAS
  861. typedef wl_escan_result_v109_t wl_escan_result_t;
  862. #define WL_ESCAN_RESULTS_FIXED_SIZE (sizeof(wl_escan_result_t) - sizeof(wl_bss_info_t))
  863. #endif // endif
  864. typedef struct wl_gscan_result {
  865. uint32 buflen;
  866. uint32 version;
  867. uint32 scan_ch_bucket;
  868. wl_gscan_bss_info_v2_t bss_info[1];
  869. } wl_gscan_result_v2_t;
  870. typedef struct wl_gscan_result_v2_1 {
  871. uint32 buflen;
  872. uint32 version;
  873. uint32 scan_ch_bucket;
  874. uint8 bss_info[]; /* var length wl_bss_info_X structures */
  875. } wl_gscan_result_v2_1_t;
  876. #ifndef WL_BSS_INFO_TYPEDEF_HAS_ALIAS
  877. typedef wl_gscan_result_v2_t wl_gscan_result_t;
  878. #define WL_GSCAN_RESULTS_FIXED_SIZE (sizeof(wl_gscan_result_t) - sizeof(wl_gscan_bss_info_t))
  879. #endif // endif
  880. /** incremental scan results struct */
  881. typedef struct wl_iscan_results {
  882. uint32 status;
  883. wl_scan_results_v109_t results;
  884. } wl_iscan_results_v109_t;
  885. /** incremental scan results struct */
  886. typedef struct wl_iscan_results_v2 {
  887. uint32 status;
  888. wl_scan_results_v2_t results;
  889. } wl_iscan_results_v2_t;
  890. #ifndef WL_BSS_INFO_TYPEDEF_HAS_ALIAS
  891. typedef wl_iscan_results_v109_t wl_iscan_results_t;
  892. /** size of wl_iscan_results not including variable length array */
  893. #define WL_ISCAN_RESULTS_FIXED_SIZE \
  894. (WL_SCAN_RESULTS_FIXED_SIZE + OFFSETOF(wl_iscan_results_t, results))
  895. #endif // endif
  896. typedef struct wl_probe_params {
  897. wlc_ssid_t ssid;
  898. struct ether_addr bssid;
  899. struct ether_addr mac;
  900. } wl_probe_params_t;
  901. #define WL_MAXRATES_IN_SET 16 /**< max # of rates in a rateset */
  902. typedef struct wl_rateset {
  903. uint32 count; /**< # rates in this set */
  904. uint8 rates[WL_MAXRATES_IN_SET]; /**< rates in 500kbps units w/hi bit set if basic */
  905. } wl_rateset_t;
  906. #define WL_VHT_CAP_MCS_MAP_NSS_MAX 8
  907. typedef struct wl_rateset_args_v1 {
  908. uint32 count; /**< # rates in this set */
  909. uint8 rates[WL_MAXRATES_IN_SET]; /**< rates in 500kbps units w/hi bit set if basic */
  910. uint8 mcs[MCSSET_LEN]; /**< supported mcs index bit map */
  911. uint16 vht_mcs[WL_VHT_CAP_MCS_MAP_NSS_MAX]; /**< supported mcs index bit map per nss */
  912. } wl_rateset_args_v1_t;
  913. #define RATESET_ARGS_V1 (1)
  914. #define RATESET_ARGS_V2 (2)
  915. /* RATESET_VERSION_ENABLED is defined in wl.mk post J branch.
  916. * Guidelines to use wl_rateset_args_t:
  917. * [a] in wlioctl.h: Add macro RATESET_ARGS_VX where X is the new version number.
  918. * [b] in wlioctl.h: Add a new structure with wl_rateset_args_vX_t
  919. * [c] in wlu.c app: Add support to parse new structure under RATESET_ARGS_VX
  920. * [d] in wlc_types.h: in respective branch and trunk: redefine wl_rateset_args_t with
  921. * new wl_rateset_args_vX_t
  922. */
  923. #ifndef RATESET_VERSION_ENABLED
  924. /* rateset structure before versioning. legacy. DONOT update anymore here */
  925. #define RATESET_ARGS_VERSION (RATESET_ARGS_V1)
  926. typedef wl_rateset_args_v1_t wl_rateset_args_t;
  927. #endif /* RATESET_VERSION_ENABLED */
  928. /* Note: dependent structures: sta_info_vX_t. When any update to this structure happens,
  929. * update sta_info_vX_t also.
  930. */
  931. #define WL_HE_CAP_MCS_MAP_NSS_MAX 8
  932. typedef struct wl_rateset_args_v2 {
  933. uint16 version; /**< version. */
  934. uint16 len; /**< length */
  935. uint32 count; /**< # rates in this set */
  936. uint8 rates[WL_MAXRATES_IN_SET]; /**< rates in 500kbps units w/hi bit set if basic */
  937. uint8 mcs[MCSSET_LEN]; /**< supported mcs index bit map */
  938. uint16 vht_mcs[WL_VHT_CAP_MCS_MAP_NSS_MAX]; /**< supported mcs index bit map per nss */
  939. uint16 he_mcs[WL_HE_CAP_MCS_MAP_NSS_MAX]; /**< supported he mcs index bit map per nss */
  940. } wl_rateset_args_v2_t;
  941. /* HE Rates BITMAP */
  942. #define WL_HE_CAP_MCS_0_7_MAP 0x00ff
  943. #define WL_HE_CAP_MCS_0_8_MAP 0x01ff
  944. #define WL_HE_CAP_MCS_0_9_MAP 0x03ff
  945. #define WL_HE_CAP_MCS_0_10_MAP 0x07ff
  946. #define WL_HE_CAP_MCS_0_11_MAP 0x0fff
  947. #define TXBF_RATE_MCS_ALL 4
  948. #define TXBF_RATE_VHT_ALL 4
  949. #define TXBF_RATE_OFDM_ALL 8
  950. typedef struct wl_txbf_rateset {
  951. uint8 txbf_rate_mcs[TXBF_RATE_MCS_ALL]; /**< one for each stream */
  952. uint8 txbf_rate_mcs_bcm[TXBF_RATE_MCS_ALL]; /**< one for each stream */
  953. uint16 txbf_rate_vht[TXBF_RATE_VHT_ALL]; /**< one for each stream */
  954. uint16 txbf_rate_vht_bcm[TXBF_RATE_VHT_ALL]; /**< one for each stream */
  955. uint8 txbf_rate_ofdm[TXBF_RATE_OFDM_ALL]; /**< bitmap of ofdm rates that enables txbf */
  956. uint8 txbf_rate_ofdm_bcm[TXBF_RATE_OFDM_ALL]; /* bitmap of ofdm rates that enables txbf */
  957. uint8 txbf_rate_ofdm_cnt;
  958. uint8 txbf_rate_ofdm_cnt_bcm;
  959. } wl_txbf_rateset_t;
  960. #define NUM_BFGAIN_ARRAY_1RX 2
  961. #define NUM_BFGAIN_ARRAY_2RX 3
  962. #define NUM_BFGAIN_ARRAY_3RX 4
  963. #define NUM_BFGAIN_ARRAY_4RX 5
  964. typedef struct wl_txbf_expgainset {
  965. /* bitmap for each element: B[4:0]=>c0, B[9:5]=>c1, B[14:10]=>c2, B[19:15]=>c[3-7]
  966. * B[24:20]=>c[8-9], B[29:25]=>c[10-11]
  967. */
  968. uint32 bfgain_2x1[NUM_BFGAIN_ARRAY_1RX]; /* exp 1ss, imp 1ss */
  969. uint32 bfgain_2x2[NUM_BFGAIN_ARRAY_2RX]; /* exp [1-2]ss, imp 1ss */
  970. uint32 bfgain_3x1[NUM_BFGAIN_ARRAY_1RX];
  971. uint32 bfgain_3x2[NUM_BFGAIN_ARRAY_2RX];
  972. uint32 bfgain_3x3[NUM_BFGAIN_ARRAY_3RX]; /* exp [1-3]ss, imp 1ss */
  973. uint32 bfgain_4x1[NUM_BFGAIN_ARRAY_1RX];
  974. uint32 bfgain_4x2[NUM_BFGAIN_ARRAY_2RX];
  975. uint32 bfgain_4x3[NUM_BFGAIN_ARRAY_3RX];
  976. uint32 bfgain_4x4[NUM_BFGAIN_ARRAY_4RX]; /* exp [1-4]ss, imp 1ss */
  977. } wl_txbf_expgainset_t;
  978. #define OFDM_RATE_MASK 0x0000007f
  979. typedef uint8 ofdm_rates_t;
  980. typedef struct wl_rates_info {
  981. wl_rateset_t rs_tgt;
  982. uint32 phy_type;
  983. int32 bandtype;
  984. uint8 cck_only;
  985. uint8 rate_mask;
  986. uint8 mcsallow;
  987. uint8 bw;
  988. uint8 txstreams;
  989. uint8 PAD[3];
  990. } wl_rates_info_t;
  991. /**uint32 list */
  992. typedef struct wl_uint32_list {
  993. /** in - # of elements, out - # of entries */
  994. uint32 count;
  995. /** variable length uint32 list */
  996. uint32 element[1];
  997. } wl_uint32_list_t;
  998. /* WLC_SET_ALLOW_MODE values */
  999. #define ALLOW_MODE_ANY_BSSID 0
  1000. #define ALLOW_MODE_ONLY_DESIRED_BSSID 1
  1001. #define ALLOW_MODE_NO_BSSID 2
  1002. /** used for association with a specific BSSID and chanspec list */
  1003. typedef struct wl_assoc_params {
  1004. struct ether_addr bssid; /**< 00:00:00:00:00:00: broadcast scan */
  1005. uint16 bssid_cnt; /**< 0: use chanspec_num, and the single bssid,
  1006. * otherwise count of chanspecs in chanspec_list
  1007. * AND paired bssids following chanspec_list
  1008. * also, chanspec_num has to be set to zero
  1009. * for bssid list to be used
  1010. */
  1011. int32 chanspec_num; /**< 0: all available channels,
  1012. * otherwise count of chanspecs in chanspec_list
  1013. */
  1014. chanspec_t chanspec_list[1]; /**< list of chanspecs */
  1015. } wl_assoc_params_t;
  1016. #define WL_ASSOC_PARAMS_FIXED_SIZE OFFSETOF(wl_assoc_params_t, chanspec_list)
  1017. /** used for reassociation/roam to a specific BSSID and channel */
  1018. typedef wl_assoc_params_t wl_reassoc_params_t;
  1019. #define WL_REASSOC_PARAMS_FIXED_SIZE WL_ASSOC_PARAMS_FIXED_SIZE
  1020. /** used for association to a specific BSSID and channel */
  1021. typedef wl_assoc_params_t wl_join_assoc_params_t;
  1022. #define WL_JOIN_ASSOC_PARAMS_FIXED_SIZE WL_ASSOC_PARAMS_FIXED_SIZE
  1023. /** used for join with or without a specific bssid and channel list */
  1024. typedef struct wl_join_params {
  1025. wlc_ssid_t ssid;
  1026. wl_assoc_params_t params; /**< optional field, but it must include the fixed portion
  1027. * of the wl_assoc_params_t struct when it does present.
  1028. */
  1029. } wl_join_params_t;
  1030. #define WL_JOIN_PARAMS_FIXED_SIZE (OFFSETOF(wl_join_params_t, params) + \
  1031. WL_ASSOC_PARAMS_FIXED_SIZE)
  1032. typedef struct wlc_roam_exp_params {
  1033. int8 a_band_boost_threshold;
  1034. int8 a_band_penalty_threshold;
  1035. int8 a_band_boost_factor;
  1036. int8 a_band_penalty_factor;
  1037. int8 cur_bssid_boost;
  1038. int8 alert_roam_trigger_threshold;
  1039. int16 a_band_max_boost;
  1040. } wlc_roam_exp_params_t;
  1041. #define ROAM_EXP_CFG_VERSION 1
  1042. #define ROAM_EXP_ENABLE_FLAG (1 << 0)
  1043. #define ROAM_EXP_CFG_PRESENT (1 << 1)
  1044. typedef struct wl_roam_exp_cfg {
  1045. uint16 version;
  1046. uint16 flags;
  1047. wlc_roam_exp_params_t params;
  1048. } wl_roam_exp_cfg_t;
  1049. typedef struct wl_bssid_pref_list {
  1050. struct ether_addr bssid;
  1051. /* Add this to modify rssi */
  1052. int8 rssi_factor;
  1053. int8 flags;
  1054. } wl_bssid_pref_list_t;
  1055. #define BSSID_PREF_LIST_VERSION 1
  1056. #define ROAM_EXP_CLEAR_BSSID_PREF (1 << 0)
  1057. typedef struct wl_bssid_pref_cfg {
  1058. uint16 version;
  1059. uint16 flags;
  1060. uint16 count;
  1061. uint16 reserved;
  1062. wl_bssid_pref_list_t bssids[];
  1063. } wl_bssid_pref_cfg_t;
  1064. #define SSID_WHITELIST_VERSION 1
  1065. #define ROAM_EXP_CLEAR_SSID_WHITELIST (1 << 0)
  1066. /* Roam SSID whitelist, ssids in this list are ok to */
  1067. /* be considered as targets to join when considering a roam */
  1068. typedef struct wl_ssid_whitelist {
  1069. uint16 version;
  1070. uint16 flags;
  1071. uint8 ssid_count;
  1072. uint8 reserved[3];
  1073. wlc_ssid_t ssids[];
  1074. } wl_ssid_whitelist_t;
  1075. #define ROAM_EXP_EVENT_VERSION 1
  1076. typedef struct wl_roam_exp_event {
  1077. uint16 version;
  1078. uint16 flags;
  1079. wlc_ssid_t cur_ssid;
  1080. } wl_roam_exp_event_t;
  1081. /** scan params for extended join */
  1082. typedef struct wl_join_scan_params {
  1083. uint8 scan_type; /**< 0 use default, active or passive scan */
  1084. uint8 PAD[3];
  1085. int32 nprobes; /**< -1 use default, number of probes per channel */
  1086. int32 active_time; /**< -1 use default, dwell time per channel for
  1087. * active scanning
  1088. */
  1089. int32 passive_time; /**< -1 use default, dwell time per channel
  1090. * for passive scanning
  1091. */
  1092. int32 home_time; /**< -1 use default, dwell time for the home channel
  1093. * between channel scans
  1094. */
  1095. } wl_join_scan_params_t;
  1096. /** extended join params */
  1097. typedef struct wl_extjoin_params {
  1098. wlc_ssid_t ssid; /**< {0, ""}: wildcard scan */
  1099. wl_join_scan_params_t scan;
  1100. wl_join_assoc_params_t assoc; /**< optional field, but it must include the fixed portion
  1101. * of the wl_join_assoc_params_t struct when it does
  1102. * present.
  1103. */
  1104. } wl_extjoin_params_t;
  1105. #define WL_EXTJOIN_PARAMS_FIXED_SIZE (OFFSETOF(wl_extjoin_params_t, assoc) + \
  1106. WL_JOIN_ASSOC_PARAMS_FIXED_SIZE)
  1107. #define ANT_SELCFG_MAX 4 /**< max number of antenna configurations */
  1108. #define MAX_STREAMS_SUPPORTED 4 /**< max number of streams supported */
  1109. typedef struct {
  1110. uint8 ant_config[ANT_SELCFG_MAX]; /**< antenna configuration */
  1111. uint8 num_antcfg; /**< number of available antenna configurations */
  1112. } wlc_antselcfg_t;
  1113. typedef struct {
  1114. uint32 duration; /**< millisecs spent sampling this channel */
  1115. union {
  1116. uint32 congest_ibss; /**< millisecs in our bss (presumably this traffic will */
  1117. /**< move if cur bss moves channels) */
  1118. uint32 congest_me; /**< millisecs in my own traffic */
  1119. };
  1120. union {
  1121. uint32 congest_obss; /**< traffic not in our bss */
  1122. uint32 congest_notme; /**< traffic not from/to me (including bc/mc) */
  1123. };
  1124. uint32 interference; /**< millisecs detecting a non 802.11 interferer. */
  1125. uint32 timestamp; /**< second timestamp */
  1126. } cca_congest_t;
  1127. typedef struct {
  1128. chanspec_t chanspec; /**< Which channel? */
  1129. uint16 num_secs; /**< How many secs worth of data */
  1130. cca_congest_t secs[1]; /**< Data */
  1131. } cca_congest_channel_req_t;
  1132. typedef struct {
  1133. uint32 timestamp; /**< second timestamp */
  1134. /* Base structure of cca_congest_t: CCA statistics all inclusive */
  1135. uint32 duration; /**< millisecs spent sampling this channel */
  1136. uint32 congest_meonly; /**< millisecs in my own traffic (TX + RX) */
  1137. uint32 congest_ibss; /**< millisecs in our bss (presumably this traffic will */
  1138. /**< move if cur bss moves channels) */
  1139. uint32 congest_obss; /**< traffic not in our bss */
  1140. uint32 interference; /**< millisecs detecting a non 802.11 interferer. */
  1141. /* CCA statistics for non PM only */
  1142. uint32 duration_nopm; /**< millisecs spent sampling this channel */
  1143. uint32 congest_meonly_nopm; /**< millisecs in my own traffic (TX + RX) */
  1144. uint32 congest_ibss_nopm; /**< millisecs in our bss (presumably this traffic will */
  1145. /**< move if cur bss moves channels) */
  1146. uint32 congest_obss_nopm; /**< traffic not in our bss */
  1147. uint32 interference_nopm; /**< millisecs detecting a non 802.11 interferer. */
  1148. /* CCA statistics for during PM only */
  1149. uint32 duration_pm; /**< millisecs spent sampling this channel */
  1150. uint32 congest_meonly_pm; /**< millisecs in my own traffic (TX + RX) */
  1151. uint32 congest_ibss_pm; /**< millisecs in our bss (presumably this traffic will */
  1152. /**< move if cur bss moves channels) */
  1153. uint32 congest_obss_pm; /**< traffic not in our bss */
  1154. uint32 interference_pm; /**< millisecs detecting a non 802.11 interferer. */
  1155. } cca_congest_ext_t;
  1156. #define WL_CCA_EXT_REQ_VER 0
  1157. typedef struct {
  1158. uint16 ver; /**< version of this struct */
  1159. uint16 len; /**< len of this structure */
  1160. chanspec_t chanspec; /**< Which channel? */
  1161. uint16 num_secs; /**< How many secs worth of data */
  1162. cca_congest_ext_t secs[1]; /**< Data - 3 sets for ALL - non-PM - PM */
  1163. } cca_congest_ext_channel_req_t;
  1164. typedef struct {
  1165. uint32 duration; /**< millisecs spent sampling this channel */
  1166. uint32 congest; /**< millisecs detecting busy CCA */
  1167. uint32 timestamp; /**< second timestamp */
  1168. } cca_congest_simple_t;
  1169. /* The following two structure must have same first 4 fields.
  1170. * The cca_chan_qual_event_t is used to report CCA in older formats and NF.
  1171. * The cca_only_chan_qual_event_t is used to report CCA only with newer format.
  1172. */
  1173. typedef struct {
  1174. uint16 status;
  1175. uint16 id;
  1176. chanspec_t chanspec; /**< Which channel? */
  1177. uint16 len;
  1178. union {
  1179. cca_congest_simple_t cca_busy; /**< CCA busy */
  1180. cca_congest_t cca_busy_ext; /**< Extended CCA report */
  1181. int32 noise; /**< noise floor */
  1182. };
  1183. } cca_chan_qual_event_t;
  1184. typedef struct {
  1185. uint16 status;
  1186. uint16 id;
  1187. chanspec_t chanspec; /**< Which channel? */
  1188. uint16 len;
  1189. union {
  1190. cca_congest_simple_t cca_busy; /**< CCA busy */
  1191. struct {
  1192. cca_congest_t cca_busy_ext; /**< Extended CCA report */
  1193. cca_congest_t cca_busy_nopm; /**< Extedned CCA report (PM awake time) */
  1194. cca_congest_t cca_busy_pm; /**< Extedned CCA report (PM sleep time) */
  1195. };
  1196. };
  1197. } cca_only_chan_qual_event_t;
  1198. typedef struct {
  1199. uint32 msrmnt_time; /**< Time for Measurement (msec) */
  1200. uint32 msrmnt_done; /**< flag set when measurement complete */
  1201. char buf[];
  1202. } cca_stats_n_flags;
  1203. typedef struct {
  1204. uint32 msrmnt_query; /* host to driver query for measurement done */
  1205. uint32 time_req; /* time required for measurement */
  1206. uint8 report_opt; /* option to print different stats in report */
  1207. uint8 PAD[3];
  1208. } cca_msrmnt_query;
  1209. /* interference sources */
  1210. enum interference_source {
  1211. ITFR_NONE = 0, /**< interference */
  1212. ITFR_PHONE, /**< wireless phone */
  1213. ITFR_VIDEO_CAMERA, /**< wireless video camera */
  1214. ITFR_MICROWAVE_OVEN, /**< microwave oven */
  1215. ITFR_BABY_MONITOR, /**< wireless baby monitor */
  1216. ITFR_BLUETOOTH, /**< bluetooth */
  1217. ITFR_VIDEO_CAMERA_OR_BABY_MONITOR, /**< wireless camera or baby monitor */
  1218. ITFR_BLUETOOTH_OR_BABY_MONITOR, /**< bluetooth or baby monitor */
  1219. ITFR_VIDEO_CAMERA_OR_PHONE, /**< video camera or phone */
  1220. ITFR_UNIDENTIFIED /**< interference from unidentified source */
  1221. };
  1222. /** structure for interference source report */
  1223. typedef struct {
  1224. uint32 flags; /**< flags. bit definitions below */
  1225. uint32 source; /**< last detected interference source */
  1226. uint32 timestamp; /**< second timestamp on interferenced flag change */
  1227. } interference_source_rep_t;
  1228. #define WLC_CNTRY_BUF_SZ 4 /**< Country string is 3 bytes + NUL */
  1229. typedef struct wl_country {
  1230. char country_abbrev[WLC_CNTRY_BUF_SZ]; /**< nul-terminated country code used in
  1231. * the Country IE
  1232. */
  1233. int32 rev; /**< revision specifier for ccode
  1234. * on set, -1 indicates unspecified.
  1235. * on get, rev >= 0
  1236. */
  1237. char ccode[WLC_CNTRY_BUF_SZ]; /**< nul-terminated built-in country code.
  1238. * variable length, but fixed size in
  1239. * struct allows simple allocation for
  1240. * expected country strings <= 3 chars.
  1241. */
  1242. } wl_country_t;
  1243. #define CCODE_INFO_VERSION 1
  1244. typedef enum wl_ccode_role {
  1245. WLC_CCODE_ROLE_ACTIVE = 0,
  1246. WLC_CCODE_ROLE_HOST,
  1247. WLC_CCODE_ROLE_80211D_ASSOC,
  1248. WLC_CCODE_ROLE_80211D_SCAN,
  1249. WLC_CCODE_ROLE_DEFAULT,
  1250. WLC_CCODE_ROLE_DEFAULT_SROM_BKUP,
  1251. WLC_CCODE_LAST
  1252. } wl_ccode_role_t;
  1253. #define WLC_NUM_CCODE_INFO WLC_CCODE_LAST
  1254. typedef struct wl_ccode_entry {
  1255. uint16 reserved;
  1256. uint8 band;
  1257. uint8 role;
  1258. char ccode[WLC_CNTRY_BUF_SZ];
  1259. } wl_ccode_entry_t;
  1260. typedef struct wl_ccode_info {
  1261. uint16 version;
  1262. uint16 count; /**< Number of ccodes entries in the set */
  1263. wl_ccode_entry_t ccodelist[1];
  1264. } wl_ccode_info_t;
  1265. #define WL_CCODE_INFO_FIXED_LEN OFFSETOF(wl_ccode_info_t, ccodelist)
  1266. typedef struct wl_channels_in_country {
  1267. uint32 buflen;
  1268. uint32 band;
  1269. char country_abbrev[WLC_CNTRY_BUF_SZ];
  1270. uint32 count;
  1271. uint32 channel[1];
  1272. } wl_channels_in_country_t;
  1273. typedef struct wl_country_list {
  1274. uint32 buflen;
  1275. uint32 band_set;
  1276. uint32 band;
  1277. uint32 count;
  1278. char country_abbrev[1];
  1279. } wl_country_list_t;
  1280. typedef struct wl_rm_req_elt {
  1281. int8 type;
  1282. int8 flags;
  1283. chanspec_t chanspec;
  1284. uint32 token; /**< token for this measurement */
  1285. uint32 tsf_h; /**< TSF high 32-bits of Measurement start time */
  1286. uint32 tsf_l; /**< TSF low 32-bits */
  1287. uint32 dur; /**< TUs */
  1288. } wl_rm_req_elt_t;
  1289. typedef struct wl_rm_req {
  1290. uint32 token; /**< overall measurement set token */
  1291. uint32 count; /**< number of measurement requests */
  1292. void *cb; /**< completion callback function: may be NULL */
  1293. void *cb_arg; /**< arg to completion callback function */
  1294. wl_rm_req_elt_t req[1]; /**< variable length block of requests */
  1295. } wl_rm_req_t;
  1296. #define WL_RM_REQ_FIXED_LEN OFFSETOF(wl_rm_req_t, req)
  1297. typedef struct wl_rm_rep_elt {
  1298. int8 type;
  1299. int8 flags;
  1300. chanspec_t chanspec;
  1301. uint32 token; /**< token for this measurement */
  1302. uint32 tsf_h; /**< TSF high 32-bits of Measurement start time */
  1303. uint32 tsf_l; /**< TSF low 32-bits */
  1304. uint32 dur; /**< TUs */
  1305. uint32 len; /**< byte length of data block */
  1306. uint8 data[1]; /**< variable length data block */
  1307. } wl_rm_rep_elt_t;
  1308. #define WL_RM_REP_ELT_FIXED_LEN 24 /**< length excluding data block */
  1309. #define WL_RPI_REP_BIN_NUM 8
  1310. typedef struct wl_rm_rpi_rep {
  1311. uint8 rpi[WL_RPI_REP_BIN_NUM];
  1312. int8 rpi_max[WL_RPI_REP_BIN_NUM];
  1313. } wl_rm_rpi_rep_t;
  1314. typedef struct wl_rm_rep {
  1315. uint32 token; /**< overall measurement set token */
  1316. uint32 len; /**< length of measurement report block */
  1317. wl_rm_rep_elt_t rep[1]; /**< variable length block of reports */
  1318. } wl_rm_rep_t;
  1319. #define WL_RM_REP_FIXED_LEN 8
  1320. #ifdef BCMCCX
  1321. #define LEAP_USER_MAX 32
  1322. #define LEAP_DOMAIN_MAX 32
  1323. #define LEAP_PASSWORD_MAX 32
  1324. typedef struct wl_leap_info {
  1325. wlc_ssid_t ssid;
  1326. uint8 user_len;
  1327. uint8 user[LEAP_USER_MAX];
  1328. uint8 password_len;
  1329. uint8 password[LEAP_PASSWORD_MAX];
  1330. uint8 domain_len;
  1331. uint8 domain[LEAP_DOMAIN_MAX];
  1332. uint8 PAD;
  1333. } wl_leap_info_t;
  1334. typedef struct wl_leap_list {
  1335. uint32 buflen;
  1336. uint32 version;
  1337. uint32 count;
  1338. wl_leap_info_t leap_info[1];
  1339. } wl_leap_list_t;
  1340. #endif /* BCMCCX */
  1341. typedef enum sup_auth_status {
  1342. /* Basic supplicant authentication states */
  1343. WLC_SUP_DISCONNECTED = 0,
  1344. WLC_SUP_CONNECTING,
  1345. WLC_SUP_IDREQUIRED,
  1346. WLC_SUP_AUTHENTICATING,
  1347. WLC_SUP_AUTHENTICATED,
  1348. WLC_SUP_KEYXCHANGE,
  1349. WLC_SUP_KEYED,
  1350. WLC_SUP_TIMEOUT,
  1351. WLC_SUP_LAST_BASIC_STATE,
  1352. /* Extended supplicant authentication states */
  1353. /** Waiting to receive handshake msg M1 */
  1354. WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
  1355. /** Preparing to send handshake msg M2 */
  1356. WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
  1357. /* Waiting to receive handshake msg M3 */
  1358. WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
  1359. WLC_SUP_KEYXCHANGE_PREP_M4, /**< Preparing to send handshake msg M4 */
  1360. WLC_SUP_KEYXCHANGE_WAIT_G1, /**< Waiting to receive handshake msg G1 */
  1361. WLC_SUP_KEYXCHANGE_PREP_G2 /**< Preparing to send handshake msg G2 */
  1362. } sup_auth_status_t;
  1363. typedef struct wl_wsec_key {
  1364. uint32 index; /**< key index */
  1365. uint32 len; /**< key length */
  1366. uint8 data[DOT11_MAX_KEY_SIZE]; /**< key data */
  1367. uint32 pad_1[18];
  1368. uint32 algo; /**< CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
  1369. uint32 flags; /**< misc flags */
  1370. uint32 pad_2[2];
  1371. int32 pad_3;
  1372. int32 iv_initialized; /**< has IV been initialized already? */
  1373. int32 pad_4;
  1374. /* Rx IV */
  1375. struct {
  1376. uint32 hi; /**< upper 32 bits of IV */
  1377. uint16 lo; /**< lower 16 bits of IV */
  1378. uint16 PAD;
  1379. } rxiv;
  1380. uint32 pad_5[2];
  1381. struct ether_addr ea; /**< per station */
  1382. uint16 PAD;
  1383. } wl_wsec_key_t;
  1384. /* Min length for PSK passphrase */
  1385. #define WSEC_MIN_PSK_LEN 8
  1386. /* Max length of supported passphrases for PSK */
  1387. #define WSEC_MAX_PSK_LEN 64
  1388. /* Max length of supported passphrases for SAE */
  1389. #define WSEC_MAX_PASSPHRASE_LEN 256u
  1390. /* Flag for key material needing passhash'ing */
  1391. #define WSEC_PASSPHRASE 1u
  1392. /* Flag indicating an SAE passphrase */
  1393. #define WSEC_SAE_PASSPHRASE 2u
  1394. /**receptacle for WLC_SET_WSEC_PMK parameter */
  1395. typedef struct wsec_pmk {
  1396. ushort key_len; /* octets in key material */
  1397. ushort flags; /* key handling qualification */
  1398. uint8 key[WSEC_MAX_PASSPHRASE_LEN]; /* PMK material */
  1399. } wsec_pmk_t;
  1400. #define WL_AUTH_EVENT_DATA_V1 0x1
  1401. /* tlv ids for auth event */
  1402. #define WL_AUTH_PMK_TLV_ID 1
  1403. #define WL_AUTH_PMKID_TLV_ID 2
  1404. /* AUTH event data
  1405. * pmk and pmkid in case of SAE auth
  1406. * xtlvs will be 32 bit alligned
  1407. */
  1408. typedef struct wl_auth_event {
  1409. uint16 version;
  1410. uint16 length;
  1411. uint8 xtlvs[];
  1412. } wl_auth_event_t;
  1413. #define WL_AUTH_EVENT_FIXED_LEN_V1 OFFSETOF(wl_auth_event_t, xtlvs)
  1414. #define WL_PMKSA_EVENT_DATA_V1 1u
  1415. /* tlv ids for PMKSA event */
  1416. #define WL_PMK_TLV_ID 1u
  1417. #define WL_PMKID_TLV_ID 2u
  1418. #define WL_PEER_ADDR_TLV_ID 3u
  1419. /* PMKSA event data structure */
  1420. typedef struct wl_pmksa_event {
  1421. uint16 version;
  1422. uint16 length;
  1423. uint8 xtlvs[];
  1424. } wl_pmksa_event_t;
  1425. #define WL_PMKSA_EVENT_FIXED_LEN_V1 OFFSETOF(wl_pmksa_event_t, xtlvs)
  1426. #define FILS_CACHE_ID_LEN 2u
  1427. #define PMK_LEN_MAX 48u
  1428. typedef struct _pmkid_v1 {
  1429. struct ether_addr BSSID;
  1430. uint8 PMKID[WPA2_PMKID_LEN];
  1431. } pmkid_v1_t;
  1432. #define PMKID_ELEM_V2_LENGTH (sizeof(struct ether_addr) + WPA2_PMKID_LEN + PMK_LEN_MAX + \
  1433. sizeof(ssid_info_t) + FILS_CACHE_ID_LEN)
  1434. typedef struct _pmkid_v2 {
  1435. uint16 length; /* Should match PMKID_ELEM_VX_LENGTH */
  1436. struct ether_addr BSSID;
  1437. uint8 PMKID[WPA2_PMKID_LEN];
  1438. uint8 pmk[PMK_LEN_MAX]; /* for FILS key deriviation */
  1439. uint16 pmk_len;
  1440. ssid_info_t ssid;
  1441. uint8 fils_cache_id[FILS_CACHE_ID_LEN];
  1442. } pmkid_v2_t;
  1443. #define PMKID_LIST_VER_2 2
  1444. typedef struct _pmkid_v3 {
  1445. struct ether_addr bssid;
  1446. uint8 pmkid[WPA2_PMKID_LEN];
  1447. uint8 pmkid_len;
  1448. uint8 pmk[PMK_LEN_MAX];
  1449. uint8 pmk_len;
  1450. uint16 fils_cache_id; /* 2-byte length */
  1451. uint8 pad;
  1452. uint8 ssid_len;
  1453. uint8 ssid[DOT11_MAX_SSID_LEN]; /* For FILS, to save ESSID */
  1454. /* one pmkid used in whole ESS */
  1455. uint32 time_left; /* remaining time until expirary in sec. */
  1456. /* 0 means expired, all 0xFF means never expire */
  1457. } pmkid_v3_t;
  1458. #define PMKID_LIST_VER_3 3
  1459. typedef struct _pmkid_list_v1 {
  1460. uint32 npmkid;
  1461. pmkid_v1_t pmkid[1];
  1462. } pmkid_list_v1_t;
  1463. typedef struct _pmkid_list_v2 {
  1464. uint16 version;
  1465. uint16 length;
  1466. pmkid_v2_t pmkid[1];
  1467. } pmkid_list_v2_t;
  1468. typedef struct _pmkid_list_v3 {
  1469. uint16 version;
  1470. uint16 length;
  1471. uint16 count;
  1472. uint16 pad;
  1473. pmkid_v3_t pmkid[];
  1474. } pmkid_list_v3_t;
  1475. #ifndef PMKID_VERSION_ENABLED
  1476. /* pmkid structure before versioning. legacy. DONOT update anymore here */
  1477. typedef pmkid_v1_t pmkid_t;
  1478. typedef pmkid_list_v1_t pmkid_list_t;
  1479. #endif /* PMKID_VERSION_ENABLED */
  1480. typedef struct _pmkid_cand {
  1481. struct ether_addr BSSID;
  1482. uint8 preauth;
  1483. } pmkid_cand_t;
  1484. typedef struct _pmkid_cand_list {
  1485. uint32 npmkid_cand;
  1486. pmkid_cand_t pmkid_cand[1];
  1487. } pmkid_cand_list_t;
  1488. #define WL_STA_ANT_MAX 4 /**< max possible rx antennas */
  1489. typedef struct wl_assoc_info {
  1490. uint32 req_len;
  1491. uint32 resp_len;
  1492. uint32 flags;
  1493. struct dot11_assoc_req req;
  1494. struct ether_addr reassoc_bssid; /**< used in reassoc's */
  1495. struct dot11_assoc_resp resp;
  1496. uint32 state;
  1497. } wl_assoc_info_t;
  1498. typedef struct wl_led_info {
  1499. uint32 index; /**< led index */
  1500. uint32 behavior;
  1501. uint8 activehi;
  1502. uint8 PAD[3];
  1503. } wl_led_info_t;
  1504. /** srom read/write struct passed through ioctl */
  1505. typedef struct {
  1506. uint32 byteoff; /**< byte offset */
  1507. uint32 nbytes; /**< number of bytes */
  1508. uint16 buf[];
  1509. } srom_rw_t;
  1510. #define CISH_FLAG_PCIECIS (1 << 15) /**< write CIS format bit for PCIe CIS */
  1511. /** similar cis (srom or otp) struct [iovar: may not be aligned] */
  1512. typedef struct {
  1513. uint16 source; /**< cis source */
  1514. uint16 flags; /**< flags */
  1515. uint32 byteoff; /**< byte offset */
  1516. uint32 nbytes; /**< number of bytes */
  1517. /* data follows here */
  1518. } cis_rw_t;
  1519. /** R_REG and W_REG struct passed through ioctl */
  1520. typedef struct {
  1521. uint32 byteoff; /**< byte offset of the field in d11regs_t */
  1522. uint32 val; /**< read/write value of the field */
  1523. uint32 size; /**< sizeof the field */
  1524. uint32 band; /**< band (optional) */
  1525. } rw_reg_t;
  1526. /**
  1527. * Structure used by GET/SET_ATTEN ioctls - it controls power in b/g-band
  1528. * PCL - Power Control Loop
  1529. */
  1530. typedef struct {
  1531. uint16 auto_ctrl; /**< WL_ATTEN_XX */
  1532. uint16 bb; /**< Baseband attenuation */
  1533. uint16 radio; /**< Radio attenuation */
  1534. uint16 txctl1; /**< Radio TX_CTL1 value */
  1535. } atten_t;
  1536. /** Per-AC retry parameters */
  1537. struct wme_tx_params_s {
  1538. uint8 short_retry;
  1539. uint8 short_fallback;
  1540. uint8 long_retry;
  1541. uint8 long_fallback;
  1542. uint16 max_rate; /**< In units of 512 Kbps */
  1543. };
  1544. typedef struct wme_tx_params_s wme_tx_params_t;
  1545. #define WL_WME_TX_PARAMS_IO_BYTES (sizeof(wme_tx_params_t) * AC_COUNT)
  1546. /**Used to get specific link/ac parameters */
  1547. typedef struct {
  1548. int32 ac;
  1549. uint8 val;
  1550. struct ether_addr ea;
  1551. uint8 PAD;
  1552. } link_val_t;
  1553. #define WL_PM_MUTE_TX_VER 1
  1554. typedef struct wl_pm_mute_tx {
  1555. uint16 version; /**< version */
  1556. uint16 len; /**< length */
  1557. uint16 deadline; /**< deadline timer (in milliseconds) */
  1558. uint8 enable; /**< set to 1 to enable mode; set to 0 to disable it */
  1559. uint8 PAD;
  1560. } wl_pm_mute_tx_t;
  1561. /*
  1562. * Please update the following when modifying this structure:
  1563. * StaInfo Twiki page flags section - description of the sta_info_t struct
  1564. * src/wl/exe/wlu.c - print of sta_info_t
  1565. * Pay attention to version if structure changes.
  1566. */
  1567. /* sta_info_t version 4 */
  1568. typedef struct {
  1569. uint16 ver; /**< version of this struct */
  1570. uint16 len; /**< length in bytes of this structure */
  1571. uint16 cap; /**< sta's advertised capabilities */
  1572. uint16 PAD;
  1573. uint32 flags; /**< flags defined below */
  1574. uint32 idle; /**< time since data pkt rx'd from sta */
  1575. struct ether_addr ea; /**< Station address */
  1576. uint16 PAD;
  1577. wl_rateset_t rateset; /**< rateset in use */
  1578. uint32 in; /**< seconds elapsed since associated */
  1579. uint32 listen_interval_inms; /**< Min Listen interval in ms for this STA */
  1580. uint32 tx_pkts; /**< # of user packets transmitted (unicast) */
  1581. uint32 tx_failures; /**< # of user packets failed */
  1582. uint32 rx_ucast_pkts; /**< # of unicast packets received */
  1583. uint32 rx_mcast_pkts; /**< # of multicast packets received */
  1584. uint32 tx_rate; /**< Rate used by last tx frame */
  1585. uint32 rx_rate; /**< Rate of last successful rx frame */
  1586. uint32 rx_decrypt_succeeds; /**< # of packet decrypted successfully */
  1587. uint32 rx_decrypt_failures; /**< # of packet decrypted unsuccessfully */
  1588. uint32 tx_tot_pkts; /**< # of user tx pkts (ucast + mcast) */
  1589. uint32 rx_tot_pkts; /**< # of data packets recvd (uni + mcast) */
  1590. uint32 tx_mcast_pkts; /**< # of mcast pkts txed */
  1591. uint64 tx_tot_bytes; /**< data bytes txed (ucast + mcast) */
  1592. uint64 rx_tot_bytes; /**< data bytes recvd (ucast + mcast) */
  1593. uint64 tx_ucast_bytes; /**< data bytes txed (ucast) */
  1594. uint64 tx_mcast_bytes; /**< # data bytes txed (mcast) */
  1595. uint64 rx_ucast_bytes; /**< data bytes recvd (ucast) */
  1596. uint64 rx_mcast_bytes; /**< data bytes recvd (mcast) */
  1597. int8 rssi[WL_STA_ANT_MAX]; /**< average rssi per antenna
  1598. * of data frames
  1599. */
  1600. int8 nf[WL_STA_ANT_MAX]; /**< per antenna noise floor */
  1601. uint16 aid; /**< association ID */
  1602. uint16 ht_capabilities; /**< advertised ht caps */
  1603. uint16 vht_flags; /**< converted vht flags */
  1604. uint16 PAD;
  1605. uint32 tx_pkts_retried; /**< # of frames where a retry was
  1606. * necessary
  1607. */
  1608. uint32 tx_pkts_retry_exhausted; /**< # of user frames where a retry
  1609. * was exhausted
  1610. */
  1611. int8 rx_lastpkt_rssi[WL_STA_ANT_MAX]; /**< Per antenna RSSI of last
  1612. * received data frame.
  1613. */
  1614. /* TX WLAN retry/failure statistics:
  1615. * Separated for host requested frames and WLAN locally generated frames.
  1616. * Include unicast frame only where the retries/failures can be counted.
  1617. */
  1618. uint32 tx_pkts_total; /**< # user frames sent successfully */
  1619. uint32 tx_pkts_retries; /**< # user frames retries */
  1620. uint32 tx_pkts_fw_total; /**< # FW generated sent successfully */
  1621. uint32 tx_pkts_fw_retries; /**< # retries for FW generated frames */
  1622. uint32 tx_pkts_fw_retry_exhausted; /**< # FW generated where a retry
  1623. * was exhausted
  1624. */
  1625. uint32 rx_pkts_retried; /**< # rx with retry bit set */
  1626. uint32 tx_rate_fallback; /**< lowest fallback TX rate */
  1627. /* Fields above this line are common to sta_info_t versions 4 and 5 */
  1628. uint32 rx_dur_total; /* total user RX duration (estimated) */
  1629. chanspec_t chanspec; /** chanspec this sta is on */
  1630. uint16 PAD;
  1631. wl_rateset_args_v1_t rateset_adv; /* rateset along with mcs index bitmap */
  1632. uint32 PAD;
  1633. } sta_info_v4_t;
  1634. /* Note: Version 4 is the latest version of sta_info_t. Version 5 is abandoned.
  1635. * Please add new fields to version 4, not version 5.
  1636. */
  1637. /* sta_info_t version 5 */
  1638. typedef struct {
  1639. uint16 ver; /**< version of this struct */
  1640. uint16 len; /**< length in bytes of this structure */
  1641. uint16 cap; /**< sta's advertised capabilities */
  1642. uint16 PAD;
  1643. uint32 flags; /**< flags defined below */
  1644. uint32 idle; /**< time since data pkt rx'd from sta */
  1645. struct ether_addr ea; /**< Station address */
  1646. uint16 PAD;
  1647. wl_rateset_t rateset; /**< rateset in use */
  1648. uint32 in; /**< seconds elapsed since associated */
  1649. uint32 listen_interval_inms; /**< Min Listen interval in ms for this STA */
  1650. uint32 tx_pkts; /**< # of user packets transmitted (unicast) */
  1651. uint32 tx_failures; /**< # of user packets failed */
  1652. uint32 rx_ucast_pkts; /**< # of unicast packets received */
  1653. uint32 rx_mcast_pkts; /**< # of multicast packets received */
  1654. uint32 tx_rate; /**< Rate used by last tx frame */
  1655. uint32 rx_rate; /**< Rate of last successful rx frame */
  1656. uint32 rx_decrypt_succeeds; /**< # of packet decrypted successfully */
  1657. uint32 rx_decrypt_failures; /**< # of packet decrypted unsuccessfully */
  1658. uint32 tx_tot_pkts; /**< # of user tx pkts (ucast + mcast) */
  1659. uint32 rx_tot_pkts; /**< # of data packets recvd (uni + mcast) */
  1660. uint32 tx_mcast_pkts; /**< # of mcast pkts txed */
  1661. uint64 tx_tot_bytes; /**< data bytes txed (ucast + mcast) */
  1662. uint64 rx_tot_bytes; /**< data bytes recvd (ucast + mcast) */
  1663. uint64 tx_ucast_bytes; /**< data bytes txed (ucast) */
  1664. uint64 tx_mcast_bytes; /**< # data bytes txed (mcast) */
  1665. uint64 rx_ucast_bytes; /**< data bytes recvd (ucast) */
  1666. uint64 rx_mcast_bytes; /**< data bytes recvd (mcast) */
  1667. int8 rssi[WL_STA_ANT_MAX]; /**< average rssi per antenna
  1668. * of data frames
  1669. */
  1670. int8 nf[WL_STA_ANT_MAX]; /**< per antenna noise floor */
  1671. uint16 aid; /**< association ID */
  1672. uint16 ht_capabilities; /**< advertised ht caps */
  1673. uint16 vht_flags; /**< converted vht flags */
  1674. uint16 PAD;
  1675. uint32 tx_pkts_retried; /**< # of frames where a retry was
  1676. * necessary
  1677. */
  1678. uint32 tx_pkts_retry_exhausted; /**< # of user frames where a retry
  1679. * was exhausted
  1680. */
  1681. int8 rx_lastpkt_rssi[WL_STA_ANT_MAX]; /**< Per antenna RSSI of last
  1682. * received data frame.
  1683. */
  1684. /* TX WLAN retry/failure statistics:
  1685. * Separated for host requested frames and WLAN locally generated frames.
  1686. * Include unicast frame only where the retries/failures can be counted.
  1687. */
  1688. uint32 tx_pkts_total; /**< # user frames sent successfully */
  1689. uint32 tx_pkts_retries; /**< # user frames retries */
  1690. uint32 tx_pkts_fw_total; /**< # FW generated sent successfully */
  1691. uint32 tx_pkts_fw_retries; /**< # retries for FW generated frames */
  1692. uint32 tx_pkts_fw_retry_exhausted; /**< # FW generated where a retry
  1693. * was exhausted
  1694. */
  1695. uint32 rx_pkts_retried; /**< # rx with retry bit set */
  1696. uint32 tx_rate_fallback; /**< lowest fallback TX rate */
  1697. /* Fields above this line are common to sta_info_t versions 4 and 5 */
  1698. chanspec_t chanspec; /** chanspec this sta is on */
  1699. uint16 PAD;
  1700. wl_rateset_args_v1_t rateset_adv; /* rateset along with mcs index bitmap */
  1701. } sta_info_v5_t;
  1702. /*
  1703. * Please update the following when modifying this structure:
  1704. * StaInfo Twiki page flags section - description of the sta_info_t struct
  1705. * src/wl/exe/wlu.c - print of sta_info_t
  1706. * Pay attention to version if structure changes.
  1707. */
  1708. /* sta_info_t version 6
  1709. changes to wl_rateset_args_t is leading to update this struct version as well.
  1710. */
  1711. typedef struct {
  1712. uint16 ver; /**< version of this struct */
  1713. uint16 len; /**< length in bytes of this structure */
  1714. uint16 cap; /**< sta's advertised capabilities */
  1715. uint16 PAD;
  1716. uint32 flags; /**< flags defined below */
  1717. uint32 idle; /**< time since data pkt rx'd from sta */
  1718. struct ether_addr ea; /**< Station address */
  1719. uint16 PAD;
  1720. wl_rateset_t rateset; /**< rateset in use */
  1721. uint32 in; /**< seconds elapsed since associated */
  1722. uint32 listen_interval_inms; /**< Min Listen interval in ms for this STA */
  1723. uint32 tx_pkts; /**< # of user packets transmitted (unicast) */
  1724. uint32 tx_failures; /**< # of user packets failed */
  1725. uint32 rx_ucast_pkts; /**< # of unicast packets received */
  1726. uint32 rx_mcast_pkts; /**< # of multicast packets received */
  1727. uint32 tx_rate; /**< Rate used by last tx frame */
  1728. uint32 rx_rate; /**< Rate of last successful rx frame */
  1729. uint32 rx_decrypt_succeeds; /**< # of packet decrypted successfully */
  1730. uint32 rx_decrypt_failures; /**< # of packet decrypted unsuccessfully */
  1731. uint32 tx_tot_pkts; /**< # of user tx pkts (ucast + mcast) */
  1732. uint32 rx_tot_pkts; /**< # of data packets recvd (uni + mcast) */
  1733. uint32 tx_mcast_pkts; /**< # of mcast pkts txed */
  1734. uint64 tx_tot_bytes; /**< data bytes txed (ucast + mcast) */
  1735. uint64 rx_tot_bytes; /**< data bytes recvd (ucast + mcast) */
  1736. uint64 tx_ucast_bytes; /**< data bytes txed (ucast) */
  1737. uint64 tx_mcast_bytes; /**< # data bytes txed (mcast) */
  1738. uint64 rx_ucast_bytes; /**< data bytes recvd (ucast) */
  1739. uint64 rx_mcast_bytes; /**< data bytes recvd (mcast) */
  1740. int8 rssi[WL_STA_ANT_MAX]; /**< average rssi per antenna
  1741. * of data frames
  1742. */
  1743. int8 nf[WL_STA_ANT_MAX]; /**< per antenna noise floor */
  1744. uint16 aid; /**< association ID */
  1745. uint16 ht_capabilities; /**< advertised ht caps */
  1746. uint16 vht_flags; /**< converted vht flags */
  1747. uint16 PAD;
  1748. uint32 tx_pkts_retried; /**< # of frames where a retry was
  1749. * necessary
  1750. */
  1751. uint32 tx_pkts_retry_exhausted; /**< # of user frames where a retry
  1752. * was exhausted
  1753. */
  1754. int8 rx_lastpkt_rssi[WL_STA_ANT_MAX]; /**< Per antenna RSSI of last
  1755. * received data frame.
  1756. */
  1757. /* TX WLAN retry/failure statistics:
  1758. * Separated for host requested frames and WLAN locally generated frames.
  1759. * Include unicast frame only where the retries/failures can be counted.
  1760. */
  1761. uint32 tx_pkts_total; /**< # user frames sent successfully */
  1762. uint32 tx_pkts_retries; /**< # user frames retries */
  1763. uint32 tx_pkts_fw_total; /**< # FW generated sent successfully */
  1764. uint32 tx_pkts_fw_retries; /**< # retries for FW generated frames */
  1765. uint32 tx_pkts_fw_retry_exhausted; /**< # FW generated where a retry
  1766. * was exhausted
  1767. */
  1768. uint32 rx_pkts_retried; /**< # rx with retry bit set */
  1769. uint32 tx_rate_fallback; /**< lowest fallback TX rate */
  1770. /* Fields above this line are common to sta_info_t versions 4 and 5 */
  1771. uint32 rx_dur_total; /* total user RX duration (estimated) */
  1772. chanspec_t chanspec; /** chanspec this sta is on */
  1773. uint16 PAD;
  1774. wl_rateset_args_v2_t rateset_adv; /* rateset along with mcs index bitmap */
  1775. } sta_info_v6_t;
  1776. /* define to help support one version older sta_info_t from user level
  1777. * applications.
  1778. */
  1779. #define WL_OLD_STAINFO_SIZE OFFSETOF(sta_info_t, tx_tot_pkts)
  1780. #define WL_STA_VER_4 4
  1781. #define WL_STA_VER_5 5
  1782. #define WL_STA_VER WL_STA_VER_4
  1783. #define SWDIV_STATS_VERSION_2 2
  1784. #define SWDIV_STATS_CURRENT_VERSION SWDIV_STATS_VERSION_2
  1785. struct wlc_swdiv_stats_v1 {
  1786. uint32 auto_en;
  1787. uint32 active_ant;
  1788. uint32 rxcount;
  1789. int32 avg_snr_per_ant0;
  1790. int32 avg_snr_per_ant1;
  1791. int32 avg_snr_per_ant2;
  1792. uint32 swap_ge_rxcount0;
  1793. uint32 swap_ge_rxcount1;
  1794. uint32 swap_ge_snrthresh0;
  1795. uint32 swap_ge_snrthresh1;
  1796. uint32 swap_txfail0;
  1797. uint32 swap_txfail1;
  1798. uint32 swap_timer0;
  1799. uint32 swap_timer1;
  1800. uint32 swap_alivecheck0;
  1801. uint32 swap_alivecheck1;
  1802. uint32 rxcount_per_ant0;
  1803. uint32 rxcount_per_ant1;
  1804. uint32 acc_rxcount;
  1805. uint32 acc_rxcount_per_ant0;
  1806. uint32 acc_rxcount_per_ant1;
  1807. uint32 tx_auto_en;
  1808. uint32 tx_active_ant;
  1809. uint32 rx_policy;
  1810. uint32 tx_policy;
  1811. uint32 cell_policy;
  1812. uint32 swap_snrdrop0;
  1813. uint32 swap_snrdrop1;
  1814. uint32 mws_antsel_ovr_tx;
  1815. uint32 mws_antsel_ovr_rx;
  1816. uint8 swap_trig_event_id;
  1817. };
  1818. struct wlc_swdiv_stats_v2 {
  1819. uint16 version; /* version of the structure
  1820. * as defined by SWDIV_STATS_CURRENT_VERSION
  1821. */
  1822. uint16 length; /* length of the entire structure */
  1823. uint32 auto_en;
  1824. uint32 active_ant;
  1825. uint32 rxcount;
  1826. int32 avg_snr_per_ant0;
  1827. int32 avg_snr_per_ant1;
  1828. int32 avg_snr_per_ant2;
  1829. uint32 swap_ge_rxcount0;
  1830. uint32 swap_ge_rxcount1;
  1831. uint32 swap_ge_snrthresh0;
  1832. uint32 swap_ge_snrthresh1;
  1833. uint32 swap_txfail0;
  1834. uint32 swap_txfail1;
  1835. uint32 swap_timer0;
  1836. uint32 swap_timer1;
  1837. uint32 swap_alivecheck0;
  1838. uint32 swap_alivecheck1;
  1839. uint32 rxcount_per_ant0;
  1840. uint32 rxcount_per_ant1;
  1841. uint32 acc_rxcount;
  1842. uint32 acc_rxcount_per_ant0;
  1843. uint32 acc_rxcount_per_ant1;
  1844. uint32 tx_auto_en;
  1845. uint32 tx_active_ant;
  1846. uint32 rx_policy;
  1847. uint32 tx_policy;
  1848. uint32 cell_policy;
  1849. uint32 swap_snrdrop0;
  1850. uint32 swap_snrdrop1;
  1851. uint32 mws_antsel_ovr_tx;
  1852. uint32 mws_antsel_ovr_rx;
  1853. uint32 swap_trig_event_id;
  1854. };
  1855. #define WLC_NUMRATES 16 /**< max # of rates in a rateset */
  1856. /**Used to get specific STA parameters */
  1857. typedef struct {
  1858. uint32 val;
  1859. struct ether_addr ea;
  1860. uint16 PAD;
  1861. } scb_val_t;
  1862. /**Used by iovar versions of some ioctls, i.e. WLC_SCB_AUTHORIZE et al */
  1863. typedef struct {
  1864. uint32 code;
  1865. scb_val_t ioctl_args;
  1866. } authops_t;
  1867. /** channel encoding */
  1868. typedef struct channel_info {
  1869. int32 hw_channel;
  1870. int32 target_channel;
  1871. int32 scan_channel;
  1872. } channel_info_t;
  1873. /** For ioctls that take a list of MAC addresses */
  1874. typedef struct maclist {
  1875. uint32 count; /**< number of MAC addresses */
  1876. struct ether_addr ea[1]; /**< variable length array of MAC addresses */
  1877. } maclist_t;
  1878. typedef struct wds_client_info {
  1879. char ifname[INTF_NAME_SIZ]; /* WDS ifname */
  1880. struct ether_addr ea; /* WDS client MAC address */
  1881. } wds_client_info_t;
  1882. #define WDS_MACLIST_MAGIC 0xFFFFFFFF
  1883. #define WDS_MACLIST_VERSION 1
  1884. /* For wds MAC list ioctls */
  1885. typedef struct wds_maclist {
  1886. uint32 count; /* Number of WDS clients */
  1887. uint32 magic; /* Magic number */
  1888. uint32 version; /* Version number */
  1889. struct wds_client_info client_list[1]; /* Variable length array of WDS clients */
  1890. } wds_maclist_t;
  1891. /**get pkt count struct passed through ioctl */
  1892. typedef struct get_pktcnt {
  1893. uint32 rx_good_pkt;
  1894. uint32 rx_bad_pkt;
  1895. uint32 tx_good_pkt;
  1896. uint32 tx_bad_pkt;
  1897. uint32 rx_ocast_good_pkt; /**< unicast packets destined for others */
  1898. } get_pktcnt_t;
  1899. /* NINTENDO2 */
  1900. #define LQ_IDX_MIN 0
  1901. #define LQ_IDX_MAX 1
  1902. #define LQ_IDX_AVG 2
  1903. #define LQ_IDX_SUM 2
  1904. #define LQ_IDX_LAST 3
  1905. #define LQ_STOP_MONITOR 0
  1906. #define LQ_START_MONITOR 1
  1907. /** Get averages RSSI, Rx PHY rate and SNR values */
  1908. /* Link Quality */
  1909. typedef struct {
  1910. int32 rssi[LQ_IDX_LAST]; /**< Array to keep min, max, avg rssi */
  1911. int32 snr[LQ_IDX_LAST]; /**< Array to keep min, max, avg snr */
  1912. int32 isvalid; /**< Flag indicating whether above data is valid */
  1913. } wl_lq_t;
  1914. typedef enum wl_wakeup_reason_type {
  1915. LCD_ON = 1,
  1916. LCD_OFF,
  1917. DRC1_WAKE,
  1918. DRC2_WAKE,
  1919. REASON_LAST
  1920. } wl_wr_type_t;
  1921. typedef struct {
  1922. /** Unique filter id */
  1923. uint32 id;
  1924. /** stores the reason for the last wake up */
  1925. uint8 reason;
  1926. uint8 PAD[3];
  1927. } wl_wr_t;
  1928. /** Get MAC specific rate histogram command */
  1929. typedef struct {
  1930. struct ether_addr ea; /**< MAC Address */
  1931. uint8 ac_cat; /**< Access Category */
  1932. uint8 num_pkts; /**< Number of packet entries to be averaged */
  1933. } wl_mac_ratehisto_cmd_t;
  1934. /** Get MAC rate histogram response */
  1935. /* deprecated after JAGUAR branch */
  1936. typedef struct {
  1937. uint32 rate[DOT11_RATE_MAX + 1]; /**< Rates */
  1938. uint32 mcs[WL_RATESET_SZ_HT_IOCTL * WL_TX_CHAINS_MAX]; /**< MCS counts */
  1939. uint32 vht[WL_RATESET_SZ_VHT_MCS][WL_TX_CHAINS_MAX]; /**< VHT counts */
  1940. uint32 tsf_timer[2][2]; /**< Start and End time for 8bytes value */
  1941. uint32 prop11n_mcs[WLC_11N_LAST_PROP_MCS - WLC_11N_FIRST_PROP_MCS + 1]; /** MCS counts */
  1942. } wl_mac_ratehisto_res_t;
  1943. /* sta_info ecounters */
  1944. typedef struct {
  1945. struct ether_addr ea; /* Station MAC addr */
  1946. struct ether_addr BSSID; /* BSSID of the BSS */
  1947. uint32 tx_pkts_fw_total; /* # FW generated sent successfully */
  1948. uint32 tx_pkts_fw_retries; /* # retries for FW generated frames */
  1949. uint32 tx_pkts_fw_retry_exhausted; /* # FW generated which
  1950. * failed after retry
  1951. */
  1952. } sta_info_ecounters_t;
  1953. #define STAMON_MODULE_VER 1
  1954. /**Linux network driver ioctl encoding */
  1955. typedef struct wl_ioctl {
  1956. uint32 cmd; /**< common ioctl definition */
  1957. void *buf; /**< pointer to user buffer */
  1958. uint32 len; /**< length of user buffer */
  1959. uint8 set; /**< 1=set IOCTL; 0=query IOCTL */
  1960. uint32 used; /**< bytes read or written (optional) */
  1961. uint32 needed; /**< bytes needed (optional) */
  1962. } wl_ioctl_t;
  1963. #define WL_NUM_RATES_CCK 4 /**< 1, 2, 5.5, 11 Mbps */
  1964. #define WL_NUM_RATES_OFDM 8 /**< 6, 9, 12, 18, 24, 36, 48, 54 Mbps SISO/CDD */
  1965. #define WL_NUM_RATES_MCS_1STREAM 8 /**< MCS 0-7 1-stream rates - SISO/CDD/STBC/MCS */
  1966. #define WL_NUM_RATES_EXTRA_VHT 2 /**< Additional VHT 11AC rates */
  1967. #define WL_NUM_RATES_VHT 10
  1968. #define WL_NUM_RATES_VHT_ALL (WL_NUM_RATES_VHT + WL_NUM_RATES_EXTRA_VHT)
  1969. #define WL_NUM_RATES_HE 12
  1970. #define WL_NUM_RATES_MCS32 1
  1971. #define UC_PATH_LEN 128u /**< uCode path length */
  1972. /*
  1973. * Structure for passing hardware and software
  1974. * revision info up from the driver.
  1975. */
  1976. typedef struct wlc_rev_info {
  1977. uint32 vendorid; /**< PCI vendor id */
  1978. uint32 deviceid; /**< device id of chip */
  1979. uint32 radiorev; /**< radio revision */
  1980. uint32 chiprev; /**< chip revision */
  1981. uint32 corerev; /**< core revision */
  1982. uint32 boardid; /**< board identifier (usu. PCI sub-device id) */
  1983. uint32 boardvendor; /**< board vendor (usu. PCI sub-vendor id) */
  1984. uint32 boardrev; /**< board revision */
  1985. uint32 driverrev; /**< driver version */
  1986. uint32 ucoderev; /**< uCode version */
  1987. uint32 bus; /**< bus type */
  1988. uint32 chipnum; /**< chip number */
  1989. uint32 phytype; /**< phy type */
  1990. uint32 phyrev; /**< phy revision */
  1991. uint32 anarev; /**< anacore rev */
  1992. uint32 chippkg; /**< chip package info */
  1993. uint32 nvramrev; /**< nvram revision number */
  1994. uint32 phyminorrev; /**< phy minor rev */
  1995. uint32 coreminorrev; /**< core minor rev */
  1996. uint32 drvrev_major; /**< driver version: major */
  1997. uint32 drvrev_minor; /**< driver version: minor */
  1998. uint32 drvrev_rc; /**< driver version: rc */
  1999. uint32 drvrev_rc_inc; /**< driver version: rc incremental */
  2000. uint16 ucodeprebuilt; /**< uCode prebuilt flag */
  2001. uint16 ucodediffct; /**< uCode diff count */
  2002. uchar ucodeurl[128u]; /* obsolete, kept for ROM compatiblity */
  2003. uchar ucodepath[UC_PATH_LEN]; /**< uCode URL or path */
  2004. } wlc_rev_info_t;
  2005. #define WL_REV_INFO_LEGACY_LENGTH 48
  2006. #define WL_BRAND_MAX 10
  2007. typedef struct wl_instance_info {
  2008. uint32 instance;
  2009. int8 brand[WL_BRAND_MAX];
  2010. int8 PAD[4-(WL_BRAND_MAX%4)];
  2011. } wl_instance_info_t;
  2012. /** structure to change size of tx fifo */
  2013. typedef struct wl_txfifo_sz {
  2014. uint16 magic;
  2015. uint16 fifo;
  2016. uint16 size;
  2017. } wl_txfifo_sz_t;
  2018. /* Transfer info about an IOVar from the driver */
  2019. /**Max supported IOV name size in bytes, + 1 for nul termination */
  2020. #define WLC_IOV_NAME_LEN (32 + 1)
  2021. typedef struct wlc_iov_trx_s {
  2022. uint8 module;
  2023. uint8 type;
  2024. char name[WLC_IOV_NAME_LEN];
  2025. } wlc_iov_trx_t;
  2026. /** bump this number if you change the ioctl interface */
  2027. #define WLC_IOCTL_VERSION 2
  2028. #define WLC_IOCTL_VERSION_LEGACY_IOTYPES 1
  2029. /* ifdef EXT_STA */
  2030. typedef struct _wl_assoc_result {
  2031. ulong associated;
  2032. ulong NDIS_auth;
  2033. ulong NDIS_infra;
  2034. } wl_assoc_result_t;
  2035. /* EXT_STA */
  2036. #define WL_PHY_PAVARS_LEN 32 /**< Phytype, Bandrange, chain, a[0], b[0], c[0], d[0] .. */
  2037. #define WL_PHY_PAVAR_VER 1 /**< pavars version */
  2038. #define WL_PHY_PAVARS2_NUM 3 /**< a1, b0, b1 */
  2039. typedef struct wl_pavars2 {
  2040. uint16 ver; /**< version of this struct */
  2041. uint16 len; /**< len of this structure */
  2042. uint16 inuse; /**< driver return 1 for a1,b0,b1 in current band range */
  2043. uint16 phy_type; /**< phy type */
  2044. uint16 bandrange;
  2045. uint16 chain;
  2046. uint16 inpa[WL_PHY_PAVARS2_NUM]; /**< phy pavars for one band range */
  2047. } wl_pavars2_t;
  2048. typedef struct wl_po {
  2049. uint16 phy_type; /**< Phy type */
  2050. uint16 band;
  2051. uint16 cckpo;
  2052. uint16 PAD;
  2053. uint32 ofdmpo;
  2054. uint16 mcspo[8];
  2055. } wl_po_t;
  2056. #define WL_NUM_RPCALVARS 5 /**< number of rpcal vars */
  2057. typedef struct wl_rpcal {
  2058. uint16 value;
  2059. uint16 update;
  2060. } wl_rpcal_t;
  2061. #define WL_NUM_RPCALPHASEVARS 5 /* number of rpcal phase vars */
  2062. typedef struct wl_rpcal_phase {
  2063. uint16 value;
  2064. uint16 update;
  2065. } wl_rpcal_phase_t;
  2066. typedef struct wl_aci_args {
  2067. int32 enter_aci_thresh; /* Trigger level to start detecting ACI */
  2068. int32 exit_aci_thresh; /* Trigger level to exit ACI mode */
  2069. int32 usec_spin; /* microsecs to delay between rssi samples */
  2070. int32 glitch_delay; /* interval between ACI scans when glitch count is consistently high */
  2071. uint16 nphy_adcpwr_enter_thresh; /**< ADC power to enter ACI mitigation mode */
  2072. uint16 nphy_adcpwr_exit_thresh; /**< ADC power to exit ACI mitigation mode */
  2073. uint16 nphy_repeat_ctr; /**< Number of tries per channel to compute power */
  2074. uint16 nphy_num_samples; /**< Number of samples to compute power on one channel */
  2075. uint16 nphy_undetect_window_sz; /**< num of undetects to exit ACI Mitigation mode */
  2076. uint16 nphy_b_energy_lo_aci; /**< low ACI power energy threshold for bphy */
  2077. uint16 nphy_b_energy_md_aci; /**< mid ACI power energy threshold for bphy */
  2078. uint16 nphy_b_energy_hi_aci; /**< high ACI power energy threshold for bphy */
  2079. uint16 nphy_noise_noassoc_glitch_th_up; /**< wl interference 4 */
  2080. uint16 nphy_noise_noassoc_glitch_th_dn;
  2081. uint16 nphy_noise_assoc_glitch_th_up;
  2082. uint16 nphy_noise_assoc_glitch_th_dn;
  2083. uint16 nphy_noise_assoc_aci_glitch_th_up;
  2084. uint16 nphy_noise_assoc_aci_glitch_th_dn;
  2085. uint16 nphy_noise_assoc_enter_th;
  2086. uint16 nphy_noise_noassoc_enter_th;
  2087. uint16 nphy_noise_assoc_rx_glitch_badplcp_enter_th;
  2088. uint16 nphy_noise_noassoc_crsidx_incr;
  2089. uint16 nphy_noise_assoc_crsidx_incr;
  2090. uint16 nphy_noise_crsidx_decr;
  2091. } wl_aci_args_t;
  2092. #define WL_ACI_ARGS_LEGACY_LENGTH 16 /**< bytes of pre NPHY aci args */
  2093. #define WL_MACFIFO_PLAY_ARGS_T_VERSION 1u /* version of wl_macfifo_play_args_t struct */
  2094. enum wl_macfifo_play_flags {
  2095. WL_MACFIFO_PLAY_STOP = 0x00u, /* stop playing samples */
  2096. WL_MACFIFO_PLAY_START = 0x01u, /* start playing samples */
  2097. WL_MACFIFO_PLAY_LOAD = 0x02u, /* for set: load samples
  2098. for get: samples are loaded
  2099. */
  2100. WL_MACFIFO_PLAY_GET_MAX_SIZE = 0x10u, /* get the macfifo buffer size */
  2101. WL_MACFIFO_PLAY_GET_STATUS = 0x20u, /* get macfifo play status */
  2102. };
  2103. typedef struct wl_macfifo_play_args {
  2104. uint16 version; /* structure version */
  2105. uint16 len; /* size of structure */
  2106. uint16 flags;
  2107. uint8 PAD[2];
  2108. uint32 data_len; /* data length */
  2109. } wl_macfifo_play_args_t;
  2110. #define WL_MACFIFO_PLAY_DATA_T_VERSION 1u /* version of wl_macfifo_play_data_t struct */
  2111. typedef struct wl_macfifo_play_data {
  2112. uint16 version; /* structure version */
  2113. uint16 len; /* size of structure */
  2114. uint32 data_len; /* data length */
  2115. } wl_macfifo_play_data_t;
  2116. #define WL_SAMPLECOLLECT_T_VERSION 2 /**< version of wl_samplecollect_args_t struct */
  2117. typedef struct wl_samplecollect_args {
  2118. /* version 0 fields */
  2119. uint8 coll_us;
  2120. uint8 PAD[3];
  2121. int32 cores;
  2122. /* add'l version 1 fields */
  2123. uint16 version; /**< see definition of WL_SAMPLECOLLECT_T_VERSION */
  2124. uint16 length; /**< length of entire structure */
  2125. int8 trigger;
  2126. uint8 PAD;
  2127. uint16 timeout;
  2128. uint16 mode;
  2129. uint16 PAD;
  2130. uint32 pre_dur;
  2131. uint32 post_dur;
  2132. uint8 gpio_sel;
  2133. uint8 downsamp;
  2134. uint8 be_deaf;
  2135. uint8 agc; /**< loop from init gain and going down */
  2136. uint8 filter; /**< override high pass corners to lowest */
  2137. /* add'l version 2 fields */
  2138. uint8 trigger_state;
  2139. uint8 module_sel1;
  2140. uint8 module_sel2;
  2141. uint16 nsamps;
  2142. uint16 PAD;
  2143. int32 bitStart;
  2144. uint32 gpioCapMask;
  2145. uint8 gpio_collection;
  2146. uint8 PAD[3];
  2147. } wl_samplecollect_args_t;
  2148. #define WL_SAMPLEDATA_T_VERSION 1 /**< version of wl_samplecollect_args_t struct */
  2149. /* version for unpacked sample data, int16 {(I,Q),Core(0..N)} */
  2150. #define WL_SAMPLEDATA_T_VERSION_SPEC_AN 2
  2151. typedef struct wl_sampledata {
  2152. uint16 version; /**< structure version */
  2153. uint16 size; /**< size of structure */
  2154. uint16 tag; /**< Header/Data */
  2155. uint16 length; /**< data length */
  2156. uint32 flag; /**< bit def */
  2157. } wl_sampledata_t;
  2158. /* WL_OTA START */
  2159. /* OTA Test Status */
  2160. enum {
  2161. WL_OTA_TEST_IDLE = 0, /**< Default Idle state */
  2162. WL_OTA_TEST_ACTIVE = 1, /**< Test Running */
  2163. WL_OTA_TEST_SUCCESS = 2, /**< Successfully Finished Test */
  2164. WL_OTA_TEST_FAIL = 3 /**< Test Failed in the Middle */
  2165. };
  2166. /* OTA SYNC Status */
  2167. enum {
  2168. WL_OTA_SYNC_IDLE = 0, /**< Idle state */
  2169. WL_OTA_SYNC_ACTIVE = 1, /**< Waiting for Sync */
  2170. WL_OTA_SYNC_FAIL = 2 /**< Sync pkt not recieved */
  2171. };
  2172. /* Various error states dut can get stuck during test */
  2173. enum {
  2174. WL_OTA_SKIP_TEST_CAL_FAIL = 1, /**< Phy calibration failed */
  2175. WL_OTA_SKIP_TEST_SYNCH_FAIL = 2, /**< Sync Packet not recieved */
  2176. WL_OTA_SKIP_TEST_FILE_DWNLD_FAIL = 3, /**< Cmd flow file download failed */
  2177. WL_OTA_SKIP_TEST_NO_TEST_FOUND = 4, /**< No test found in Flow file */
  2178. WL_OTA_SKIP_TEST_WL_NOT_UP = 5, /**< WL UP failed */
  2179. WL_OTA_SKIP_TEST_UNKNOWN_CALL /**< Unintentional scheduling on ota test */
  2180. };
  2181. /* Differentiator for ota_tx and ota_rx */
  2182. enum {
  2183. WL_OTA_TEST_TX = 0, /**< ota_tx */
  2184. WL_OTA_TEST_RX = 1, /**< ota_rx */
  2185. };
  2186. /* Catch 3 modes of operation: 20Mhz, 40Mhz, 20 in 40 Mhz */
  2187. enum {
  2188. WL_OTA_TEST_BW_20_IN_40MHZ = 0, /**< 20 in 40 operation */
  2189. WL_OTA_TEST_BW_20MHZ = 1, /**< 20 Mhz operation */
  2190. WL_OTA_TEST_BW_40MHZ = 2, /**< full 40Mhz operation */
  2191. WL_OTA_TEST_BW_80MHZ = 3 /* full 80Mhz operation */
  2192. };
  2193. #define HT_MCS_INUSE 0x00000080 /* HT MCS in use,indicates b0-6 holds an mcs */
  2194. #define VHT_MCS_INUSE 0x00000100 /* VHT MCS in use,indicates b0-6 holds an mcs */
  2195. #define OTA_RATE_MASK 0x0000007f /* rate/mcs value */
  2196. #define OTA_STF_SISO 0
  2197. #define OTA_STF_CDD 1
  2198. #define OTA_STF_STBC 2
  2199. #define OTA_STF_SDM 3
  2200. typedef struct ota_rate_info {
  2201. uint8 rate_cnt; /**< Total number of rates */
  2202. uint8 PAD;
  2203. uint16 rate_val_mbps[WL_OTA_TEST_MAX_NUM_RATE]; /**< array of rates from 1mbps to 130mbps */
  2204. /**< for legacy rates : ratein mbps * 2 */
  2205. /**< for HT rates : mcs index */
  2206. } ota_rate_info_t;
  2207. typedef struct ota_power_info {
  2208. int8 pwr_ctrl_on; /**< power control on/off */
  2209. int8 start_pwr; /**< starting power/index */
  2210. int8 delta_pwr; /**< delta power/index */
  2211. int8 end_pwr; /**< end power/index */
  2212. } ota_power_info_t;
  2213. typedef struct ota_packetengine {
  2214. uint16 delay; /**< Inter-packet delay */
  2215. /**< for ota_tx, delay is tx ifs in micro seconds */
  2216. /* for ota_rx, delay is wait time in milliseconds */
  2217. uint16 nframes; /**< Number of frames */
  2218. uint16 length; /**< Packet length */
  2219. } ota_packetengine_t;
  2220. /*
  2221. * OTA txant/rxant parameter
  2222. * bit7-4: 4 bits swdiv_tx/rx_policy bitmask, specify antenna-policy for SW diversity
  2223. * bit3-0: 4 bits TxCore bitmask, specify cores used for transmit frames
  2224. * (maximum spatial expansion)
  2225. */
  2226. #define WL_OTA_TEST_ANT_MASK 0xF0
  2227. #define WL_OTA_TEST_CORE_MASK 0x0F
  2228. /* OTA txant/rxant 'ant_mask' field; map to Tx/Rx antenna policy for SW diversity */
  2229. enum {
  2230. WL_OTA_TEST_FORCE_ANT0 = 0x10, /* force antenna to Ant 0 */
  2231. WL_OTA_TEST_FORCE_ANT1 = 0x20, /* force antenna to Ant 1 */
  2232. };
  2233. /* antenna/core fields access */
  2234. #define WL_OTA_TEST_GET_ANT(_txant) ((_txant) & WL_OTA_TEST_ANT_MASK)
  2235. #define WL_OTA_TEST_GET_CORE(_txant) ((_txant) & WL_OTA_TEST_CORE_MASK)
  2236. /** Test info vector */
  2237. typedef struct wl_ota_test_args {
  2238. uint8 cur_test; /**< test phase */
  2239. uint8 chan; /**< channel */
  2240. uint8 bw; /**< bandwidth */
  2241. uint8 control_band; /**< control band */
  2242. uint8 stf_mode; /**< stf mode */
  2243. uint8 PAD;
  2244. ota_rate_info_t rt_info; /**< Rate info */
  2245. ota_packetengine_t pkteng; /**< packeteng info */
  2246. uint8 txant; /**< tx antenna */
  2247. uint8 rxant; /**< rx antenna */
  2248. ota_power_info_t pwr_info; /**< power sweep info */
  2249. uint8 wait_for_sync; /**< wait for sync or not */
  2250. uint8 ldpc;
  2251. uint8 sgi;
  2252. uint8 PAD;
  2253. /* Update WL_OTA_TESTVEC_T_VERSION for adding new members to this structure */
  2254. } wl_ota_test_args_t;
  2255. #define WL_OTA_TESTVEC_T_VERSION 1 /* version of wl_ota_test_vector_t struct */
  2256. typedef struct wl_ota_test_vector {
  2257. uint16 version;
  2258. wl_ota_test_args_t test_arg[WL_OTA_TEST_MAX_NUM_SEQ]; /**< Test argument struct */
  2259. uint16 test_cnt; /**< Total no of test */
  2260. uint8 file_dwnld_valid; /**< File successfully downloaded */
  2261. uint8 sync_timeout; /**< sync packet timeout */
  2262. int8 sync_fail_action; /**< sync fail action */
  2263. struct ether_addr sync_mac; /**< macaddress for sync pkt */
  2264. struct ether_addr tx_mac; /**< macaddress for tx */
  2265. struct ether_addr rx_mac; /**< macaddress for rx */
  2266. int8 loop_test; /**< dbg feature to loop the test */
  2267. uint16 test_rxcnt;
  2268. /* Update WL_OTA_TESTVEC_T_VERSION for adding new members to this structure */
  2269. } wl_ota_test_vector_t;
  2270. /** struct copied back form dongle to host to query the status */
  2271. typedef struct wl_ota_test_status {
  2272. int16 cur_test_cnt; /**< test phase */
  2273. int8 skip_test_reason; /**< skip test reasoin */
  2274. uint8 PAD;
  2275. wl_ota_test_args_t test_arg; /**< cur test arg details */
  2276. uint16 test_cnt; /**< total no of test downloaded */
  2277. uint8 file_dwnld_valid; /**< file successfully downloaded ? */
  2278. uint8 sync_timeout; /**< sync timeout */
  2279. int8 sync_fail_action; /**< sync fail action */
  2280. struct ether_addr sync_mac; /**< macaddress for sync pkt */
  2281. struct ether_addr tx_mac; /**< tx mac address */
  2282. struct ether_addr rx_mac; /**< rx mac address */
  2283. uint8 test_stage; /**< check the test status */
  2284. int8 loop_test; /**< Debug feature to puts test enfine in a loop */
  2285. uint8 sync_status; /**< sync status */
  2286. } wl_ota_test_status_t;
  2287. /* FOR ioctl that take the sta monitor information */
  2288. typedef struct stamon_data {
  2289. struct ether_addr ea;
  2290. uint8 PAD[2];
  2291. int32 rssi;
  2292. } stamon_data_t;
  2293. typedef struct stamon_info {
  2294. int32 version;
  2295. uint32 count;
  2296. stamon_data_t sta_data[1];
  2297. } stamon_info_t;
  2298. typedef struct wl_ota_rx_rssi {
  2299. uint16 pktcnt; /* Pkt count used for this rx test */
  2300. chanspec_t chanspec; /* Channel info on which the packets are received */
  2301. int16 rssi; /* Average RSSI of the first 50% packets received */
  2302. } wl_ota_rx_rssi_t;
  2303. #define WL_OTARSSI_T_VERSION 1 /* version of wl_ota_test_rssi_t struct */
  2304. #define WL_OTA_TEST_RSSI_FIXED_SIZE OFFSETOF(wl_ota_test_rssi_t, rx_rssi)
  2305. typedef struct wl_ota_test_rssi {
  2306. uint8 version;
  2307. uint8 testcnt; /* total measured RSSI values, valid on output only */
  2308. wl_ota_rx_rssi_t rx_rssi[1]; /* Variable length array of wl_ota_rx_rssi_t */
  2309. } wl_ota_test_rssi_t;
  2310. /* WL_OTA END */
  2311. /**wl_radar_args_t */
  2312. typedef struct {
  2313. int32 npulses; /**< required number of pulses at n * t_int */
  2314. int32 ncontig; /**< required number of pulses at t_int */
  2315. int32 min_pw; /**< minimum pulse width (20 MHz clocks) */
  2316. int32 max_pw; /**< maximum pulse width (20 MHz clocks) */
  2317. uint16 thresh0; /**< Radar detection, thresh 0 */
  2318. uint16 thresh1; /**< Radar detection, thresh 1 */
  2319. uint16 blank; /**< Radar detection, blank control */
  2320. uint16 fmdemodcfg; /**< Radar detection, fmdemod config */
  2321. int32 npulses_lp; /**< Radar detection, minimum long pulses */
  2322. int32 min_pw_lp; /**< Minimum pulsewidth for long pulses */
  2323. int32 max_pw_lp; /**< Maximum pulsewidth for long pulses */
  2324. int32 min_fm_lp; /**< Minimum fm for long pulses */
  2325. int32 max_span_lp; /**< Maximum deltat for long pulses */
  2326. int32 min_deltat; /**< Minimum spacing between pulses */
  2327. int32 max_deltat; /**< Maximum spacing between pulses */
  2328. uint16 autocorr; /**< Radar detection, autocorr on or off */
  2329. uint16 st_level_time; /**< Radar detection, start_timing level */
  2330. uint16 t2_min; /**< minimum clocks needed to remain in state 2 */
  2331. uint8 PAD[2];
  2332. uint32 version; /**< version */
  2333. uint32 fra_pulse_err; /**< sample error margin for detecting French radar pulsed */
  2334. int32 npulses_fra; /**< Radar detection, minimum French pulses set */
  2335. int32 npulses_stg2; /**< Radar detection, minimum staggered-2 pulses set */
  2336. int32 npulses_stg3; /**< Radar detection, minimum staggered-3 pulses set */
  2337. uint16 percal_mask; /**< defines which period cal is masked from radar detection */
  2338. uint8 PAD[2];
  2339. int32 quant; /**< quantization resolution to pulse positions */
  2340. uint32 min_burst_intv_lp; /**< minimum burst to burst interval for bin3 radar */
  2341. uint32 max_burst_intv_lp; /**< maximum burst to burst interval for bin3 radar */
  2342. int32 nskip_rst_lp; /**< number of skipped pulses before resetting lp buffer */
  2343. int32 max_pw_tol; /* maximum tolerance allowd in detected pulse width for radar detection */
  2344. uint16 feature_mask; /**< 16-bit mask to specify enabled features */
  2345. uint16 thresh0_sc; /**< Radar detection, thresh 0 */
  2346. uint16 thresh1_sc; /**< Radar detection, thresh 1 */
  2347. uint8 PAD[2];
  2348. } wl_radar_args_t;
  2349. #define WL_RADAR_ARGS_VERSION 2
  2350. typedef struct {
  2351. uint32 version; /**< version */
  2352. uint16 thresh0_20_lo; /**< Radar detection, thresh 0 (range 5250-5350MHz) for BW 20MHz */
  2353. uint16 thresh1_20_lo; /**< Radar detection, thresh 1 (range 5250-5350MHz) for BW 20MHz */
  2354. uint16 thresh0_40_lo; /**< Radar detection, thresh 0 (range 5250-5350MHz) for BW 40MHz */
  2355. uint16 thresh1_40_lo; /**< Radar detection, thresh 1 (range 5250-5350MHz) for BW 40MHz */
  2356. uint16 thresh0_80_lo; /**< Radar detection, thresh 0 (range 5250-5350MHz) for BW 80MHz */
  2357. uint16 thresh1_80_lo; /**< Radar detection, thresh 1 (range 5250-5350MHz) for BW 80MHz */
  2358. uint16 thresh0_20_hi; /**< Radar detection, thresh 0 (range 5470-5725MHz) for BW 20MHz */
  2359. uint16 thresh1_20_hi; /**< Radar detection, thresh 1 (range 5470-5725MHz) for BW 20MHz */
  2360. uint16 thresh0_40_hi; /**< Radar detection, thresh 0 (range 5470-5725MHz) for BW 40MHz */
  2361. uint16 thresh1_40_hi; /**< Radar detection, thresh 1 (range 5470-5725MHz) for BW 40MHz */
  2362. uint16 thresh0_80_hi; /**< Radar detection, thresh 0 (range 5470-5725MHz) for BW 80MHz */
  2363. uint16 thresh1_80_hi; /**< Radar detection, thresh 1 (range 5470-5725MHz) for BW 80MHz */
  2364. uint16 thresh0_160_lo; /**< Radar detection, thresh 0 (range 5250-5350MHz) for BW 160MHz */
  2365. uint16 thresh1_160_lo; /**< Radar detection, thresh 1 (range 5250-5350MHz) for BW 160MHz */
  2366. uint16 thresh0_160_hi; /**< Radar detection, thresh 0 (range 5470-5725MHz) for BW 160MHz */
  2367. uint16 thresh1_160_hi; /**< Radar detection, thresh 1 (range 5470-5725MHz) for BW 160MHz */
  2368. } wl_radar_thr_t;
  2369. typedef struct {
  2370. uint32 version; /* version */
  2371. uint16 thresh0_sc_20_lo;
  2372. uint16 thresh1_sc_20_lo;
  2373. uint16 thresh0_sc_40_lo;
  2374. uint16 thresh1_sc_40_lo;
  2375. uint16 thresh0_sc_80_lo;
  2376. uint16 thresh1_sc_80_lo;
  2377. uint16 thresh0_sc_20_hi;
  2378. uint16 thresh1_sc_20_hi;
  2379. uint16 thresh0_sc_40_hi;
  2380. uint16 thresh1_sc_40_hi;
  2381. uint16 thresh0_sc_80_hi;
  2382. uint16 thresh1_sc_80_hi;
  2383. uint16 fc_varth_sb;
  2384. uint16 fc_varth_bin5_sb;
  2385. uint16 notradar_enb;
  2386. uint16 max_notradar_lp;
  2387. uint16 max_notradar;
  2388. uint16 max_notradar_lp_sc;
  2389. uint16 max_notradar_sc;
  2390. uint16 highpow_war_enb;
  2391. uint16 highpow_sp_ratio; //unit is 0.5
  2392. } wl_radar_thr2_t;
  2393. #define WL_RADAR_THR_VERSION 2
  2394. typedef struct {
  2395. uint32 ver;
  2396. uint32 len;
  2397. int32 rssi_th[3];
  2398. uint8 rssi_gain_80[4];
  2399. uint8 rssi_gain_160[4];
  2400. } wl_dyn_switch_th_t;
  2401. #define WL_PHY_DYN_SWITCH_TH_VERSION 1
  2402. /** RSSI per antenna */
  2403. typedef struct {
  2404. uint32 version; /**< version field */
  2405. uint32 count; /**< number of valid antenna rssi */
  2406. int8 rssi_ant[WL_RSSI_ANT_MAX]; /**< rssi per antenna */
  2407. int8 rssi_sum; /**< summed rssi across all antennas */
  2408. int8 PAD[3];
  2409. } wl_rssi_ant_t;
  2410. /* SNR per antenna */
  2411. typedef struct {
  2412. uint32 version; /* version field */
  2413. uint32 count; /* number of valid antenna snr */
  2414. int8 snr_ant[WL_RSSI_ANT_MAX]; /* snr per antenna */
  2415. } wl_snr_ant_t;
  2416. /* Weighted average support */
  2417. #define WL_WA_VER 0 /* Initial version - Basic WA algorithm only */
  2418. #define WL_WA_ALGO_BASIC 0 /* Basic weighted average algorithm (all 4 metrics) */
  2419. #define WL_WA_TYPE_RSSI 0
  2420. #define WL_WA_TYPE_SNR 1
  2421. #define WL_WA_TYPE_TXRATE 2
  2422. #define WL_WA_TYPE_RXRATE 3
  2423. #define WL_WA_TYPE_MAX 4
  2424. typedef struct { /* payload of subcmd in xtlv */
  2425. uint8 id;
  2426. uint8 n_total; /* Total number of samples (n_total >= n_recent) */
  2427. uint8 n_recent; /* Number of samples denoted as recent */
  2428. uint8 w_recent; /* Total weight for the recent samples (as percentage) */
  2429. } wl_wa_basic_params_t;
  2430. typedef struct {
  2431. uint16 ver;
  2432. uint16 len;
  2433. uint8 subcmd[]; /* sub-cmd in bcm_xtlv_t */
  2434. } wl_wa_cmd_t;
  2435. /** data structure used in 'dfs_status' wl interface, which is used to query dfs status */
  2436. typedef struct {
  2437. uint32 state; /**< noted by WL_DFS_CACSTATE_XX. */
  2438. uint32 duration; /**< time spent in ms in state. */
  2439. /**
  2440. * as dfs enters ISM state, it removes the operational channel from quiet channel
  2441. * list and notes the channel in channel_cleared. set to 0 if no channel is cleared
  2442. */
  2443. chanspec_t chanspec_cleared;
  2444. /** chanspec cleared used to be a uint32, add another to uint16 to maintain size */
  2445. uint16 pad;
  2446. } wl_dfs_status_t;
  2447. typedef struct {
  2448. uint32 state; /* noted by WL_DFS_CACSTATE_XX */
  2449. uint32 duration; /* time spent in ms in state */
  2450. chanspec_t chanspec; /* chanspec of this core */
  2451. chanspec_t chanspec_last_cleared; /* chanspec last cleared for operation by scanning */
  2452. uint16 sub_type; /* currently just the index of the core or the respective PLL */
  2453. uint16 pad;
  2454. } wl_dfs_sub_status_t;
  2455. #define WL_DFS_STATUS_ALL_VERSION (1)
  2456. typedef struct {
  2457. uint16 version; /* version field; current max version 1 */
  2458. uint16 num_sub_status;
  2459. wl_dfs_sub_status_t dfs_sub_status[1]; /* struct array of length num_sub_status */
  2460. } wl_dfs_status_all_t;
  2461. #define WL_DFS_AP_MOVE_VERSION (1)
  2462. struct wl_dfs_ap_move_status_v1 {
  2463. int16 dfs_status; /* DFS scan status */
  2464. chanspec_t chanspec; /* New AP Chanspec */
  2465. wl_dfs_status_t cac_status; /* CAC status */
  2466. };
  2467. typedef struct wl_dfs_ap_move_status_v2 {
  2468. int8 version; /* version field; current max version 1 */
  2469. int8 move_status; /* DFS move status */
  2470. chanspec_t chanspec; /* New AP Chanspec */
  2471. wl_dfs_status_all_t scan_status; /* status; see dfs_status_all for wl_dfs_status_all_t */
  2472. } wl_dfs_ap_move_status_v2_t;
  2473. #define WL_DFS_AP_MOVE_ABORT -1 /* Abort any dfs_ap_move in progress immediately */
  2474. #define WL_DFS_AP_MOVE_STUNT -2 /* Stunt move but continue background CSA if in progress */
  2475. /** data structure used in 'radar_status' wl interface, which is use to query radar det status */
  2476. typedef struct {
  2477. uint8 detected;
  2478. uint8 PAD[3];
  2479. int32 count;
  2480. uint8 pretended;
  2481. uint8 PAD[3];
  2482. uint32 radartype;
  2483. uint32 timenow;
  2484. uint32 timefromL;
  2485. int32 lp_csect_single;
  2486. int32 detected_pulse_index;
  2487. int32 nconsecq_pulses;
  2488. chanspec_t ch;
  2489. uint8 PAD[2];
  2490. int32 pw[10];
  2491. int32 intv[10];
  2492. int32 fm[10];
  2493. } wl_radar_status_t;
  2494. #define NUM_PWRCTRL_RATES 12
  2495. typedef struct {
  2496. uint8 txpwr_band_max[NUM_PWRCTRL_RATES]; /**< User set target */
  2497. uint8 txpwr_limit[NUM_PWRCTRL_RATES]; /**< reg and local power limit */
  2498. uint8 txpwr_local_max; /**< local max according to the AP */
  2499. uint8 txpwr_local_constraint; /**< local constraint according to the AP */
  2500. uint8 txpwr_chan_reg_max; /**< Regulatory max for this channel */
  2501. uint8 txpwr_target[2][NUM_PWRCTRL_RATES]; /**< Latest target for 2.4 and 5 Ghz */
  2502. uint8 txpwr_est_Pout[2]; /**< Latest estimate for 2.4 and 5 Ghz */
  2503. uint8 txpwr_opo[NUM_PWRCTRL_RATES]; /**< On G phy, OFDM power offset */
  2504. uint8 txpwr_bphy_cck_max[NUM_PWRCTRL_RATES]; /**< Max CCK power for this band (SROM) */
  2505. uint8 txpwr_bphy_ofdm_max; /**< Max OFDM power for this band (SROM) */
  2506. uint8 txpwr_aphy_max[NUM_PWRCTRL_RATES]; /**< Max power for A band (SROM) */
  2507. int8 txpwr_antgain[2]; /**< Ant gain for each band - from SROM */
  2508. uint8 txpwr_est_Pout_gofdm; /**< Pwr estimate for 2.4 OFDM */
  2509. } tx_power_legacy_t;
  2510. #define WL_TX_POWER_RATES_LEGACY 45
  2511. #define WL_TX_POWER_MCS20_FIRST 12
  2512. #define WL_TX_POWER_MCS20_NUM 16
  2513. #define WL_TX_POWER_MCS40_FIRST 28
  2514. #define WL_TX_POWER_MCS40_NUM 17
  2515. typedef struct {
  2516. uint32 flags;
  2517. chanspec_t chanspec; /**< txpwr report for this channel */
  2518. chanspec_t local_chanspec; /**< channel on which we are associated */
  2519. uint8 local_max; /**< local max according to the AP */
  2520. uint8 local_constraint; /**< local constraint according to the AP */
  2521. int8 antgain[2]; /**< Ant gain for each band - from SROM */
  2522. uint8 rf_cores; /**< count of RF Cores being reported */
  2523. uint8 est_Pout[4]; /**< Latest tx power out estimate per RF
  2524. * chain without adjustment
  2525. */
  2526. uint8 est_Pout_cck; /**< Latest CCK tx power out estimate */
  2527. uint8 user_limit[WL_TX_POWER_RATES_LEGACY]; /**< User limit */
  2528. uint8 reg_limit[WL_TX_POWER_RATES_LEGACY]; /**< Regulatory power limit */
  2529. uint8 board_limit[WL_TX_POWER_RATES_LEGACY]; /**< Max power board can support (SROM) */
  2530. uint8 target[WL_TX_POWER_RATES_LEGACY]; /**< Latest target power */
  2531. uint8 PAD[2];
  2532. } tx_power_legacy2_t;
  2533. #define WL_NUM_2x2_ELEMENTS 4
  2534. #define WL_NUM_3x3_ELEMENTS 6
  2535. #define WL_NUM_4x4_ELEMENTS 10
  2536. typedef struct {
  2537. uint16 ver; /**< version of this struct */
  2538. uint16 len; /**< length in bytes of this structure */
  2539. uint32 flags;
  2540. chanspec_t chanspec; /**< txpwr report for this channel */
  2541. chanspec_t local_chanspec; /**< channel on which we are associated */
  2542. uint32 buflen; /**< ppr buffer length */
  2543. uint8 pprbuf[1]; /**< Latest target power buffer */
  2544. } wl_txppr_t;
  2545. #define WL_TXPPR_VERSION 1
  2546. #define WL_TXPPR_LENGTH (sizeof(wl_txppr_t))
  2547. #define TX_POWER_T_VERSION 45
  2548. /* curpower ppr types */
  2549. enum {
  2550. PPRTYPE_TARGETPOWER = 1,
  2551. PPRTYPE_BOARDLIMITS = 2,
  2552. PPRTYPE_REGLIMITS = 3,
  2553. PPRTYPE_RU_REGLIMITS = 4,
  2554. PPRTYPE_RU_BOARDLIMITS = 5,
  2555. PPRTYPE_RU_TARGETPOWER = 6,
  2556. PPRTYPE_LAST
  2557. };
  2558. /** number of ppr serialization buffers, it should be reg, board and target */
  2559. #define WL_TXPPR_SER_BUF_NUM (PPRTYPE_LAST - 1)
  2560. typedef struct chanspec_txpwr_max {
  2561. chanspec_t chanspec; /**< chanspec */
  2562. uint8 txpwr_max; /**< max txpwr in all the rates */
  2563. uint8 padding;
  2564. } chanspec_txpwr_max_t;
  2565. typedef struct wl_chanspec_txpwr_max {
  2566. uint16 ver; /**< version of this struct */
  2567. uint16 len; /**< length in bytes of this structure */
  2568. uint32 count; /**< number of elements of (chanspec, txpwr_max) pair */
  2569. chanspec_txpwr_max_t txpwr[1]; /**< array of (chanspec, max_txpwr) pair */
  2570. } wl_chanspec_txpwr_max_t;
  2571. #define WL_CHANSPEC_TXPWR_MAX_VER 1
  2572. #define WL_CHANSPEC_TXPWR_MAX_LEN (sizeof(wl_chanspec_txpwr_max_t))
  2573. typedef struct tx_inst_power {
  2574. uint8 txpwr_est_Pout[2]; /**< Latest estimate for 2.4 and 5 Ghz */
  2575. uint8 txpwr_est_Pout_gofdm; /**< Pwr estimate for 2.4 OFDM */
  2576. } tx_inst_power_t;
  2577. #define WL_NUM_TXCHAIN_MAX 4
  2578. typedef struct wl_txchain_pwr_offsets {
  2579. int8 offset[WL_NUM_TXCHAIN_MAX]; /**< quarter dBm signed offset for each chain */
  2580. } wl_txchain_pwr_offsets_t;
  2581. /** maximum channels returned by the get valid channels iovar */
  2582. #define WL_NUMCHANNELS 64
  2583. #define WL_NUMCHANNELS_MANY_CHAN 10
  2584. #define WL_ITER_LIMIT_MANY_CHAN 5
  2585. #define WL_MIMO_PS_CFG_VERSION_1 1
  2586. typedef struct wl_mimops_cfg {
  2587. uint8 version;
  2588. /* active_chains: 0 for all, 1 for 1 chain. */
  2589. uint8 active_chains;
  2590. /* static (0) or dynamic (1).or disabled (3) Mode applies only when active_chains = 0. */
  2591. uint8 mode;
  2592. /* bandwidth = Full (0), 20M (1), 40M (2), 80M (3). */
  2593. uint8 bandwidth;
  2594. uint8 applychangesafterlearning;
  2595. uint8 pad[3];
  2596. } wl_mimops_cfg_t;
  2597. /* This event is for tracing MIMO PS metrics snapshot calls.
  2598. * It is helpful to debug out-of-sync issue between
  2599. * ucode SHM values and FW snapshot calculation.
  2600. * It is part of the EVENT_LOG_TAG_MIMO_PS_TRACE.
  2601. */
  2602. #define WL_MIMO_PS_METRICS_SNAPSHOT_TRACE_TYPE 0
  2603. typedef struct wl_mimo_ps_metrics_snapshot_trace {
  2604. /* type field for this TLV: */
  2605. uint16 type;
  2606. /* length field for this TLV */
  2607. uint16 len;
  2608. uint32 idle_slotcnt_mimo; /* MIMO idle slotcnt raw SHM value */
  2609. uint32 last_idle_slotcnt_mimo; /* stored value snapshot */
  2610. uint32 idle_slotcnt_siso; /* SISO idle slotcnt raw SHM value */
  2611. uint32 last_idle_slotcnt_siso; /* stored value snapshot */
  2612. uint32 rx_time_mimo; /* Rx MIMO raw SHM value */
  2613. uint32 last_rx_time_mimo; /* stored value snapshot */
  2614. uint32 rx_time_siso; /* RX SISO raw SHM value */
  2615. uint32 last_rx_time_siso; /* stored value snapshot */
  2616. uint32 tx_time_1chain; /* Tx 1-chain raw SHM value */
  2617. uint32 last_tx_time_1chain; /* stored value snapshot */
  2618. uint32 tx_time_2chain; /* Tx 2-chain raw SHM value */
  2619. uint32 last_tx_time_2chain; /* stored value snapshot */
  2620. uint32 tx_time_3chain; /* Tx 3-chain raw SHM value */
  2621. uint32 last_tx_time_3chain; /* stored value snapshot */
  2622. uint16 reason; /* reason for snapshot call, see below */
  2623. /* Does the call reset last values after delta calculation */
  2624. uint16 reset_last;
  2625. } wl_mimo_ps_metrics_snapshot_trace_t;
  2626. /* reason codes for mimo ps metrics snapshot function calls */
  2627. #define WL_MIMOPS_METRICS_SNAPSHOT_REPORT 1
  2628. #define WL_MIMOPS_METRICS_SNAPSHOT_RXCHAIN_SET 2
  2629. #define WL_MIMOPS_METRICS_SNAPSHOT_ARBI 3
  2630. #define WL_MIMOPS_METRICS_SNAPSHOT_SLOTUPD 4
  2631. #define WL_MIMOPS_METRICS_SNAPSHOT_PMBCNRX 5
  2632. #define WL_MIMOPS_METRICS_SNAPSHOT_BMACINIT 6
  2633. #define WL_MIMOPS_METRICS_SNAPSHOT_HT_COMPLETE 7
  2634. #define WL_MIMOPS_METRICS_SNAPSHOT_OCL 8
  2635. #define WL_MIMO_PS_STATUS_VERSION_2 2
  2636. typedef struct wl_mimo_ps_status {
  2637. uint8 version;
  2638. uint8 ap_cap; /* The associated AP's capability (BW, MIMO/SISO). */
  2639. uint8 association_status; /* How we are associated to the AP (MIMO/SISO). */
  2640. uint8 mimo_ps_state; /* mimo_ps_cfg states: [0-5]. See below for values */
  2641. uint8 mrc_state; /* MRC state: NONE (0), ACTIVE(1) */
  2642. uint8 bss_rxchain; /* bss rxchain bitmask */
  2643. uint8 bss_txchain; /* bss txchain bitmask */
  2644. uint8 bss_bw; /* bandwidth: Full (0), 20M (1), 40M (2), 80M (3), etc */
  2645. uint16 hw_state; /* bitmask of hw state. See below for values */
  2646. uint8 hw_rxchain; /* actual HW rxchain bitmask */
  2647. uint8 hw_txchain; /* actual HW txchain bitmask */
  2648. uint8 hw_bw; /* bandwidth: Full (0), 20M (1), 40M (2), 80M (3), etc */
  2649. uint8 pm_bcnrx_state; /* actual state of ucode flag */
  2650. uint8 basic_rates_present; /* internal flag to trigger siso bcmc rx */
  2651. uint8 siso_bcmc_rx_state; /* actual state of ucode flag */
  2652. } wl_mimo_ps_status_t;
  2653. #define WL_MIMO_PS_STATUS_VERSION_1 1
  2654. typedef struct wl_mimo_ps_status_v1 {
  2655. uint8 version;
  2656. uint8 ap_cap; /* The associated AP's capability (BW, MIMO/SISO). */
  2657. uint8 association_status; /* How we are associated to the AP (MIMO/SISO). */
  2658. uint8 mimo_ps_state; /* mimo_ps_cfg states: [0-5]. See below for values */
  2659. uint8 mrc_state; /* MRC state: NONE (0), ACTIVE(1) */
  2660. uint8 bss_rxchain; /* bss rxchain bitmask */
  2661. uint8 bss_txchain; /* bss txchain bitmask */
  2662. uint8 bss_bw; /* bandwidth: Full (0), 20M (1), 40M (2), 80M (3), etc */
  2663. uint16 hw_state; /* bitmask of hw state. See below for values */
  2664. uint8 hw_rxchain; /* actual HW rxchain bitmask */
  2665. uint8 hw_txchain; /* actual HW txchain bitmask */
  2666. uint8 hw_bw; /* bandwidth: Full (0), 20M (1), 40M (2), 80M (3), etc */
  2667. uint8 pad[3];
  2668. } wl_mimo_ps_status_v1_t;
  2669. #define WL_MIMO_PS_STATUS_AP_CAP(ap_cap) (ap_cap & 0x0F)
  2670. #define WL_MIMO_PS_STATUS_AP_CAP_BW(ap_cap) (ap_cap >> 4)
  2671. #define WL_MIMO_PS_STATUS_ASSOC_BW_SHIFT 4
  2672. /* version 3: assoc status: low nibble is status enum, high other flags */
  2673. #define WL_MIMO_PS_STATUS_VERSION_3 3
  2674. #define WL_MIMO_PS_STATUS_ASSOC_STATUS_MASK 0x0F
  2675. #define WL_MIMO_PS_STATUS_ASSOC_STATUS_VHT_WITHOUT_OMN 0x80
  2676. /* mimo_ps_status: ap_cap/association status */
  2677. enum {
  2678. WL_MIMO_PS_STATUS_ASSOC_NONE = 0,
  2679. WL_MIMO_PS_STATUS_ASSOC_SISO = 1,
  2680. WL_MIMO_PS_STATUS_ASSOC_MIMO = 2,
  2681. WL_MIMO_PS_STATUS_ASSOC_LEGACY = 3
  2682. };
  2683. /* mimo_ps_status: mimo_ps_cfg states */
  2684. enum {
  2685. WL_MIMO_PS_CFG_STATE_NONE = 0,
  2686. WL_MIMO_PS_CFG_STATE_INFORM_AP_INPROGRESS = 1,
  2687. WL_MIMO_PS_CFG_STATE_INFORM_AP_DONE = 2,
  2688. WL_MIMO_PS_CFG_STATE_LEARNING = 3,
  2689. WL_MIMO_PS_CFG_STATE_HW_CONFIGURE = 4,
  2690. WL_MIMO_PS_CFG_STATE_INFORM_AP_PENDING = 5
  2691. };
  2692. /* mimo_ps_status: hw_state values */
  2693. #define WL_MIMO_PS_STATUS_HW_STATE_NONE 0
  2694. #define WL_MIMO_PS_STATUS_HW_STATE_LTECOEX (0x1 << 0)
  2695. #define WL_MIMO_PS_STATUS_HW_STATE_MIMOPS_BSS (0x1 << 1)
  2696. #define WL_MIMO_PS_STATUS_HW_STATE_AWDL_BSS (0x1 << 2)
  2697. #define WL_MIMO_PS_STATUS_HW_STATE_SCAN (0x1 << 3)
  2698. #define WL_MIMO_PS_STATUS_HW_STATE_TXPPR (0x1 << 4)
  2699. #define WL_MIMO_PS_STATUS_HW_STATE_PWRTHOTTLE (0x1 << 5)
  2700. #define WL_MIMO_PS_STATUS_HW_STATE_TMPSENSE (0x1 << 6)
  2701. #define WL_MIMO_PS_STATUS_HW_STATE_IOVAR (0x1 << 7)
  2702. #define WL_MIMO_PS_STATUS_HW_STATE_AP_BSS (0x1 << 8)
  2703. /* mimo_ps_status: mrc states */
  2704. #define WL_MIMO_PS_STATUS_MRC_NONE 0
  2705. #define WL_MIMO_PS_STATUS_MRC_ACTIVE 1
  2706. /* mimo_ps_status: core flag states for single-core beacon and siso-bcmc rx */
  2707. #define WL_MIMO_PS_STATUS_MHF_FLAG_NONE 0
  2708. #define WL_MIMO_PS_STATUS_MHF_FLAG_ACTIVE 1
  2709. #define WL_MIMO_PS_STATUS_MHF_FLAG_COREDOWN 2
  2710. #define WL_MIMO_PS_STATUS_MHF_FLAG_INVALID 3
  2711. /* Type values for the REASON */
  2712. #define WL_MIMO_PS_PS_LEARNING_ABORTED (1 << 0)
  2713. #define WL_MIMO_PS_PS_LEARNING_COMPLETED (1 << 1)
  2714. #define WL_MIMO_PS_PS_LEARNING_ONGOING (1 << 2)
  2715. typedef struct wl_mimo_ps_learning_event_data {
  2716. uint32 startTimeStamp;
  2717. uint32 endTimeStamp;
  2718. uint16 reason;
  2719. struct ether_addr BSSID;
  2720. uint32 totalSISO_below_rssi_threshold;
  2721. uint32 totalMIMO_below_rssi_threshold;
  2722. uint32 totalSISO_above_rssi_threshold;
  2723. uint32 totalMIMO_above_rssi_threshold;
  2724. } wl_mimo_ps_learning_event_data_t;
  2725. #define WL_MIMO_PS_PS_LEARNING_CFG_ABORT (1 << 0)
  2726. #define WL_MIMO_PS_PS_LEARNING_CFG_STATUS (1 << 1)
  2727. #define WL_MIMO_PS_PS_LEARNING_CFG_CONFIG (1 << 2)
  2728. #define WL_MIMO_PS_PS_LEARNING_CFG_MASK (0x7)
  2729. #define WL_MIMO_PS_PS_LEARNING_CFG_V1 1
  2730. typedef struct wl_mimops_learning_cfg {
  2731. /* flag: bit 0 for abort */
  2732. /* flag: bit 1 for status */
  2733. /* flag: bit 2 for configuring no of packets and rssi */
  2734. uint8 flag;
  2735. /* mimo ps learning version, compatible version is 0 */
  2736. uint8 version;
  2737. /* if version is 0 or rssi is 0, ignored */
  2738. int8 learning_rssi_threshold;
  2739. uint8 reserved;
  2740. uint32 no_of_packets_for_learning;
  2741. wl_mimo_ps_learning_event_data_t mimops_learning_data;
  2742. } wl_mimops_learning_cfg_t;
  2743. #define WL_OCL_STATUS_VERSION 1
  2744. typedef struct ocl_status_info {
  2745. uint8 version;
  2746. uint8 len;
  2747. uint16 fw_status; /* Bits representing FW disable reasons */
  2748. uint8 hw_status; /* Bits for actual HW config and SISO/MIMO coremask */
  2749. uint8 coremask; /* The ocl core mask (indicating listening core) */
  2750. } ocl_status_info_t;
  2751. /* MWS OCL map */
  2752. #define WL_MWS_OCL_OVERRIDE_VERSION 1
  2753. typedef struct wl_mws_ocl_override {
  2754. uint16 version; /* Structure version */
  2755. uint16 bitmap_2g; /* bitmap for 2.4G channels bits 1-13 */
  2756. uint16 bitmap_5g_lo; /* bitmap for 5G low channels by 2:
  2757. *34-48, 52-56, 60-64, 100-102
  2758. */
  2759. uint16 bitmap_5g_mid; /* bitmap for 5G mid channels by 2:
  2760. * 104, 108-112, 116-120, 124-128,
  2761. * 132-136, 140, 149-151
  2762. */
  2763. uint16 bitmap_5g_high; /* bitmap for 5G high channels by 2
  2764. * 153, 157-161, 165
  2765. */
  2766. } wl_mws_ocl_override_t;
  2767. /* Bits for fw_status */
  2768. #define OCL_DISABLED_HOST 0x01 /* Host has disabled through ocl_enable */
  2769. #define OCL_DISABLED_RSSI 0x02 /* Disabled because of ocl_rssi_threshold */
  2770. #define OCL_DISABLED_LTEC 0x04 /* Disabled due to LTE Coex activity */
  2771. #define OCL_DISABLED_SISO 0x08 /* Disabled while in SISO mode */
  2772. #define OCL_DISABLED_CAL 0x10 /* Disabled during active calibration */
  2773. #define OCL_DISABLED_CHANSWITCH 0x20 /* Disabled during active channel switch */
  2774. #define OCL_DISABLED_ASPEND 0x40 /* Disabled due to assoc pending */
  2775. /* Bits for hw_status */
  2776. #define OCL_HWCFG 0x01 /* State of OCL config bit in phy HW */
  2777. #define OCL_HWMIMO 0x02 /* Set if current coremask is > 1 bit */
  2778. #define OCL_COREDOWN 0x80 /* Set if core is currently down */
  2779. #define WL_OPS_CFG_VERSION_1 1
  2780. /* Common IOVAR struct */
  2781. typedef struct wl_ops_cfg_v1 {
  2782. uint16 version;
  2783. uint16 len; /* total length includes fixed fields and variable data[] */
  2784. uint16 subcmd_id; /* subcommand id */
  2785. uint16 padding; /* reserved / padding for 4 byte align */
  2786. uint8 data[]; /* subcommand data; could be empty */
  2787. } wl_ops_cfg_v1_t;
  2788. /* subcommands ids */
  2789. enum {
  2790. WL_OPS_CFG_SUBCMD_ENABLE = 0, /* OPS enable/disable mybss and obss
  2791. * for nav and plcp options
  2792. */
  2793. WL_OPS_CFG_SUBCMD_MAX_SLEEP_DUR = 1, /* Max sleep duration used for OPS */
  2794. WL_OPS_CFG_SUBCMD_RESET_STATS = 2 /* Reset stats part of ops_status
  2795. * on both slices
  2796. */
  2797. };
  2798. #define WL_OPS_CFG_MASK 0xffff
  2799. #define WL_OPS_CFG_CAP_MASK 0xffff0000
  2800. #define WL_OPS_CFG_CAP_SHIFT 16 /* Shift bits to locate the OPS CAP */
  2801. #define WL_OPS_MAX_SLEEP_DUR 12500 /* max ops duration in us */
  2802. #define WL_OPS_MINOF_MAX_SLEEP_DUR 512 /* minof max ops duration in us */
  2803. #define WL_OPS_SUPPORTED_CFG (WL_OPS_MYBSS_PLCP_DUR | WL_OPS_MYBSS_NAV_DUR \
  2804. | WL_OPS_OBSS_PLCP_DUR | WL_OPS_OBSS_NAV_DUR)
  2805. #define WL_OPS_DEFAULT_CFG WL_OPS_SUPPORTED_CFG
  2806. /* WL_OPS_CFG_SUBCMD_ENABLE */
  2807. typedef struct wl_ops_cfg_enable {
  2808. uint32 bits; /* selectively enable ops for mybss and obss */
  2809. } wl_ops_cfg_enable_t;
  2810. /* Bits for WL_OPS_CFG_SUBCMD_ENABLE Parameter */
  2811. #define WL_OPS_MYBSS_PLCP_DUR 0x1 /* OPS based on mybss 11b & 11n mixed HT frames
  2812. * PLCP header duration
  2813. */
  2814. #define WL_OPS_MYBSS_NAV_DUR 0x2 /* OPS based on mybss RTS-CTS duration */
  2815. #define WL_OPS_OBSS_PLCP_DUR 0x4 /* OPS based on obss 11b & 11n mixed HT frames
  2816. * PLCP header duration
  2817. */
  2818. #define WL_OPS_OBSS_NAV_DUR 0x8 /* OPS based on obss RTS-CTS duration */
  2819. /* WL_OPS_CFG_SUBCMD_MAX_SLEEP_DUR */
  2820. typedef struct wl_ops_cfg_max_sleep_dur {
  2821. uint32 val; /* maximum sleep duration (us) used for OPS */
  2822. } wl_ops_cfg_max_sleep_dur_t;
  2823. /* WL_OPS_CFG_SUBCMD_RESET_STATS */
  2824. typedef struct wl_ops_cfg_reset_stats {
  2825. uint32 val; /* bitmap of slices, 0 means all slices */
  2826. } wl_ops_cfg_reset_stats_t;
  2827. #define WL_OPS_STATUS_VERSION_1 1
  2828. #define OPS_DUR_HIST_BINS 5 /* number of bins used, 0-1, 1-2, 2-4, 4-8, >8 msec */
  2829. typedef struct wl_ops_status_v1 {
  2830. uint16 version;
  2831. uint16 len; /* Total length including all fixed fields */
  2832. uint8 slice_index; /* Slice for which status is reported */
  2833. uint8 disable_obss; /* indicate if obss cfg is disabled */
  2834. uint8 pad[2]; /* 4-byte alignment */
  2835. uint32 disable_reasons; /* FW disable reasons */
  2836. uint32 disable_duration; /* ops disable time(ms) due to disable reasons */
  2837. uint32 applied_ops_config; /* currently applied ops config */
  2838. uint32 partial_ops_dur; /* Total time (in usec) of partial ops duration */
  2839. uint32 full_ops_dur; /* Total time (in usec) of full ops duration */
  2840. uint32 count_dur_hist[OPS_DUR_HIST_BINS]; /* ops occurrence histogram */
  2841. uint32 nav_cnt; /* number of times ops triggered based NAV duration */
  2842. uint32 plcp_cnt; /* number of times ops triggered based PLCP duration */
  2843. uint32 mybss_cnt; /* number of times mybss ops trigger */
  2844. uint32 obss_cnt; /* number of times obss ops trigger */
  2845. uint32 miss_dur_cnt; /* number of times ops couldn't happen
  2846. * due to insufficient duration
  2847. */
  2848. uint32 miss_premt_cnt; /* number of times ops couldn't happen due
  2849. * to not meeting Phy preemption thresh
  2850. */
  2851. uint32 max_dur_cnt; /* number of times ops did not trigger due to
  2852. * frames exceeding max sleep duration
  2853. */
  2854. uint32 wake_cnt; /* number of ops miss due to wake reason */
  2855. uint32 bcn_wait_cnt; /* number of ops miss due to waiting for bcn */
  2856. } wl_ops_status_v1_t;
  2857. /* Bits for disable_reasons */
  2858. #define OPS_DISABLED_HOST 0x01 /* Host has disabled through ops_cfg */
  2859. #define OPS_DISABLED_UNASSOC 0x02 /* Disabled because the slice is in unassociated state */
  2860. #define OPS_DISABLED_SCAN 0x04 /* Disabled because the slice is in scan state */
  2861. #define OPS_DISABLED_BCN_MISS 0x08 /* Disabled because beacon missed for a duration */
  2862. #define WL_PSBW_CFG_VERSION_1 1
  2863. /* Common IOVAR struct */
  2864. typedef struct wl_psbw_cfg_v1 {
  2865. uint16 version;
  2866. uint16 len; /* total length includes fixed fields and variable data[] */
  2867. uint16 subcmd_id; /* subcommand id */
  2868. uint16 pad; /* reserved / padding for 4 byte align */
  2869. uint8 data[]; /* subcommand data */
  2870. } wl_psbw_cfg_v1_t;
  2871. /* subcommands ids */
  2872. enum {
  2873. /* PSBW enable/disable */
  2874. WL_PSBW_CFG_SUBCMD_ENABLE = 0,
  2875. /* override psbw disable requests */
  2876. WL_PSBW_CFG_SUBCMD_OVERRIDE_DISABLE_MASK = 1,
  2877. /* Reset stats part of psbw status */
  2878. WL_PSBW_CFG_SUBCMD_RESET_STATS = 2
  2879. };
  2880. #define WL_PSBW_OVERRIDE_DISA_CFG_MASK 0x0000ffff
  2881. #define WL_PSBW_OVERRIDE_DISA_CAP_MASK 0xffff0000
  2882. #define WL_PSBW_OVERRIDE_DISA_CAP_SHIFT 16 /* shift bits for cap */
  2883. /* WL_PSBW_CFG_SUBCMD_ENABLE */
  2884. typedef struct wl_psbw_cfg_enable {
  2885. bool enable; /* enable or disable */
  2886. } wl_psbw_cfg_enable_t;
  2887. /* WL_PSBW_CFG_SUBCMD_OVERRIDE_DISABLE_MASK */
  2888. typedef struct wl_psbw_cfg_override_disable_mask {
  2889. uint32 mask; /* disable requests to override, cap and current cfg */
  2890. } wl_psbw_cfg_override_disable_mask_t;
  2891. /* WL_PSBW_CFG_SUBCMD_RESET_STATS */
  2892. typedef struct wl_psbw_cfg_reset_stats {
  2893. uint32 val; /* infra interface index, 0 */
  2894. } wl_psbw_cfg_reset_stats_t;
  2895. #define WL_PSBW_STATUS_VERSION_1 1
  2896. typedef struct wl_psbw_status_v1 {
  2897. uint16 version;
  2898. uint16 len; /* total length including all fixed fields */
  2899. uint8 curr_slice_index; /* current slice index of the interface */
  2900. uint8 associated; /* interface associatd */
  2901. chanspec_t chspec; /* radio chspec */
  2902. uint32 state; /* psbw state */
  2903. uint32 disable_reasons; /* FW disable reasons */
  2904. uint32 slice_enable_dur; /* time(ms) psbw remains enabled on this slice */
  2905. uint32 total_enable_dur; /* time(ms) psbw remains enabled total */
  2906. uint32 enter_cnt; /* total cnt entering PSBW active */
  2907. uint32 exit_cnt; /* total cnt exiting PSBW active */
  2908. uint32 exit_imd_cnt; /* total cnt imd exit when waited N tbtts */
  2909. uint32 enter_skip_cnt; /* total cnt entering PSBW active skipped */
  2910. } wl_psbw_status_v1_t;
  2911. /* Bit for state */
  2912. #define PSBW_ACTIVE 0x1 /* active 20MHz */
  2913. #define PSBW_TTTT_PEND 0x2 /* waiting for TTTT intr */
  2914. #define PSBW_WAIT_ENTER 0x4 /* in wait period before entering */
  2915. #define PSBW_CAL_DONE 0x8 /* 20M channel cal done */
  2916. /* Bits for disable_reasons */
  2917. #define WL_PSBW_DISA_HOST 0x00000001 /* Host has disabled through psbw_cfg */
  2918. #define WL_PSBW_DISA_AP20M 0x00000002 /* AP is operating on 20 MHz */
  2919. #define WL_PSBW_DISA_SLOTTED_BSS 0x00000004 /* AWDL or NAN active */
  2920. #define WL_PSBW_DISA_NOT_PMFAST 0x00000008 /* Not PM_FAST */
  2921. #define WL_PSBW_DISA_BASICRATESET 0x00000010 /* BasicRateSet is empty */
  2922. #define WL_PSBW_DISA_NOT_D3 0x00000020 /* PCIe not in D3 */
  2923. #define WL_PSBW_DISA_CSA 0x00000040 /* CSA IE is present */
  2924. #define WL_PSBW_DISA_ASSOC 0x00000080 /* assoc state is active/or unassoc */
  2925. #define WL_PSBW_DISA_SCAN 0x00000100 /* scan state is active */
  2926. #define WL_PSBW_DISA_CAL 0x00000200 /* cal pending or active */
  2927. /* following are not part of disable reasons */
  2928. #define WL_PSBW_EXIT_PM 0x00001000 /* Out of PM */
  2929. #define WL_PSBW_EXIT_TIM 0x00002000 /* unicast TIM bit present */
  2930. #define WL_PSBW_EXIT_DATA 0x00004000 /* Data for transmission */
  2931. #define WL_PSBW_EXIT_MGMTDATA 0x00008000 /* management frame for transmission */
  2932. #define WL_PSBW_EXIT_BW_UPD 0x00010000 /* BW being updated */
  2933. #define WL_PSBW_DISA_NONE 0x80000000 /* reserved for internal use only */
  2934. /*
  2935. * Join preference iovar value is an array of tuples. Each tuple has a one-byte type,
  2936. * a one-byte length, and a variable length value. RSSI type tuple must be present
  2937. * in the array.
  2938. *
  2939. * Types are defined in "join preference types" section.
  2940. *
  2941. * Length is the value size in octets. It is reserved for WL_JOIN_PREF_WPA type tuple
  2942. * and must be set to zero.
  2943. *
  2944. * Values are defined below.
  2945. *
  2946. * 1. RSSI - 2 octets
  2947. * offset 0: reserved
  2948. * offset 1: reserved
  2949. *
  2950. * 2. WPA - 2 + 12 * n octets (n is # tuples defined below)
  2951. * offset 0: reserved
  2952. * offset 1: # of tuples
  2953. * offset 2: tuple 1
  2954. * offset 14: tuple 2
  2955. * ...
  2956. * offset 2 + 12 * (n - 1) octets: tuple n
  2957. *
  2958. * struct wpa_cfg_tuple {
  2959. * uint8 akm[DOT11_OUI_LEN+1]; akm suite
  2960. * uint8 ucipher[DOT11_OUI_LEN+1]; unicast cipher suite
  2961. * uint8 mcipher[DOT11_OUI_LEN+1]; multicast cipher suite
  2962. * };
  2963. *
  2964. * multicast cipher suite can be specified as a specific cipher suite or WL_WPA_ACP_MCS_ANY.
  2965. *
  2966. * 3. BAND - 2 octets
  2967. * offset 0: reserved
  2968. * offset 1: see "band preference" and "band types"
  2969. *
  2970. * 4. BAND RSSI - 2 octets
  2971. * offset 0: band types
  2972. * offset 1: +ve RSSI boost value in dB
  2973. */
  2974. struct tsinfo_arg {
  2975. uint8 octets[3];
  2976. };
  2977. #define RATE_CCK_1MBPS 0
  2978. #define RATE_CCK_2MBPS 1
  2979. #define RATE_CCK_5_5MBPS 2
  2980. #define RATE_CCK_11MBPS 3
  2981. #define RATE_LEGACY_OFDM_6MBPS 0
  2982. #define RATE_LEGACY_OFDM_9MBPS 1
  2983. #define RATE_LEGACY_OFDM_12MBPS 2
  2984. #define RATE_LEGACY_OFDM_18MBPS 3
  2985. #define RATE_LEGACY_OFDM_24MBPS 4
  2986. #define RATE_LEGACY_OFDM_36MBPS 5
  2987. #define RATE_LEGACY_OFDM_48MBPS 6
  2988. #define RATE_LEGACY_OFDM_54MBPS 7
  2989. #define WL_BSSTRANS_RSSI_RATE_MAP_VERSION 1
  2990. #define WL_BSSTRANS_RSSI_RATE_MAP_VERSION_V1 1
  2991. #define WL_BSSTRANS_RSSI_RATE_MAP_VERSION_V2 2
  2992. typedef struct wl_bsstrans_rssi {
  2993. int8 rssi_2g; /**< RSSI in dbm for 2.4 G */
  2994. int8 rssi_5g; /**< RSSI in dbm for 5G, unused for cck */
  2995. } wl_bsstrans_rssi_t;
  2996. #define RSSI_RATE_MAP_MAX_STREAMS 4 /**< max streams supported */
  2997. /** RSSI to rate mapping, all 20Mhz, no SGI */
  2998. typedef struct wl_bsstrans_rssi_rate_map_v2 {
  2999. uint16 ver;
  3000. uint16 len; /**< length of entire structure */
  3001. wl_bsstrans_rssi_t cck[WL_NUM_RATES_CCK]; /**< 2.4G only */
  3002. wl_bsstrans_rssi_t ofdm[WL_NUM_RATES_OFDM]; /**< 6 to 54mbps */
  3003. wl_bsstrans_rssi_t phy_n[RSSI_RATE_MAP_MAX_STREAMS][WL_NUM_RATES_MCS_1STREAM]; /* MCS0-7 */
  3004. wl_bsstrans_rssi_t phy_ac[RSSI_RATE_MAP_MAX_STREAMS][WL_NUM_RATES_VHT_ALL]; /**< MCS0-11 */
  3005. wl_bsstrans_rssi_t phy_ax[RSSI_RATE_MAP_MAX_STREAMS][WL_NUM_RATES_HE]; /**< MCS0-11 */
  3006. } wl_bsstrans_rssi_rate_map_v2_t;
  3007. /** RSSI to rate mapping, all 20Mhz, no SGI */
  3008. typedef struct wl_bsstrans_rssi_rate_map_v1 {
  3009. uint16 ver;
  3010. uint16 len; /**< length of entire structure */
  3011. wl_bsstrans_rssi_t cck[WL_NUM_RATES_CCK]; /**< 2.4G only */
  3012. wl_bsstrans_rssi_t ofdm[WL_NUM_RATES_OFDM]; /**< 6 to 54mbps */
  3013. wl_bsstrans_rssi_t phy_n[RSSI_RATE_MAP_MAX_STREAMS][WL_NUM_RATES_MCS_1STREAM]; /* MCS0-7 */
  3014. wl_bsstrans_rssi_t phy_ac[RSSI_RATE_MAP_MAX_STREAMS][WL_NUM_RATES_VHT]; /**< MCS0-9 */
  3015. } wl_bsstrans_rssi_rate_map_v1_t;
  3016. /** RSSI to rate mapping, all 20Mhz, no SGI */
  3017. typedef struct wl_bsstrans_rssi_rate_map {
  3018. uint16 ver;
  3019. uint16 len; /**< length of entire structure */
  3020. wl_bsstrans_rssi_t cck[WL_NUM_RATES_CCK]; /**< 2.4G only */
  3021. wl_bsstrans_rssi_t ofdm[WL_NUM_RATES_OFDM]; /**< 6 to 54mbps */
  3022. wl_bsstrans_rssi_t phy_n[RSSI_RATE_MAP_MAX_STREAMS][WL_NUM_RATES_MCS_1STREAM]; /* MCS0-7 */
  3023. wl_bsstrans_rssi_t phy_ac[RSSI_RATE_MAP_MAX_STREAMS][WL_NUM_RATES_VHT]; /**< MCS0-9 */
  3024. } wl_bsstrans_rssi_rate_map_t;
  3025. #define WL_BSSTRANS_ROAMTHROTTLE_VERSION 1
  3026. /** Configure number of scans allowed per throttle period */
  3027. typedef struct wl_bsstrans_roamthrottle {
  3028. uint16 ver;
  3029. uint16 period;
  3030. uint16 scans_allowed;
  3031. } wl_bsstrans_roamthrottle_t;
  3032. #define NFIFO 6 /**< # tx/rx fifopairs */
  3033. #ifndef NFIFO_EXT
  3034. #if defined(BCM_AQM_DMA_DESC) && !defined(BCM_AQM_DMA_DESC_DISABLED)
  3035. #if defined(WL_MU_TX) && !defined(WL_MU_TX_DISABLED)
  3036. #define NFIFO_EXT 32 /* 6 traditional FIFOs + 2 rsvd + 24 MU FIFOs */
  3037. #else
  3038. #define NFIFO_EXT 10 /* 4EDCA + 4 TWT + 1 Mcast/Bcast + 1 Spare */
  3039. #endif // endif
  3040. #elif defined(WL11AX_TRIGGERQ) && !defined(WL11AX_TRIGGERQ_DISABLED)
  3041. #define NFIFO_EXT 10
  3042. #else
  3043. #define NFIFO_EXT NFIFO
  3044. #endif /* BCM_AQM_DMA_DESC && !BCM_AQM_DMA_DESC_DISABLED */
  3045. #endif /* NFIFO_EXT */
  3046. /* When new reason codes are added to list, Please update wl_reinit_names also */
  3047. /* Reinit reason codes */
  3048. enum {
  3049. WL_REINIT_RC_NONE = 0,
  3050. WL_REINIT_RC_PS_SYNC = 1,
  3051. WL_REINIT_RC_PSM_WD = 2,
  3052. WL_REINIT_RC_MAC_WAKE = 3,
  3053. WL_REINIT_RC_MAC_SUSPEND = 4,
  3054. WL_REINIT_RC_MAC_SPIN_WAIT = 5,
  3055. WL_REINIT_RC_AXI_BUS_ERROR = 6,
  3056. WL_REINIT_RC_DEVICE_REMOVED = 7,
  3057. WL_REINIT_RC_PCIE_FATAL_ERROR = 8,
  3058. WL_REINIT_RC_OL_FW_TRAP = 9,
  3059. WL_REINIT_RC_FIFO_ERR = 10,
  3060. WL_REINIT_RC_INV_TX_STATUS = 11,
  3061. WL_REINIT_RC_MQ_ERROR = 12,
  3062. WL_REINIT_RC_PHYTXERR_THRESH = 13,
  3063. WL_REINIT_RC_USER_FORCED = 14,
  3064. WL_REINIT_RC_FULL_RESET = 15,
  3065. WL_REINIT_RC_AP_BEACON = 16,
  3066. WL_REINIT_RC_PM_EXCESSED = 17,
  3067. WL_REINIT_RC_NO_CLK = 18,
  3068. WL_REINIT_RC_SW_ASSERT = 19,
  3069. WL_REINIT_RC_PSM_JMP0 = 20,
  3070. WL_REINIT_RC_PSM_RUN = 21,
  3071. WL_REINIT_RC_ENABLE_MAC = 22,
  3072. WL_REINIT_RC_SCAN_TIMEOUT = 23,
  3073. WL_REINIT_RC_JOIN_TIMEOUT = 24,
  3074. /* Below error codes are generated during D3 exit validation */
  3075. WL_REINIT_RC_LINK_NOT_ACTIVE = 25,
  3076. WL_REINIT_RC_PCI_CFG_RD_FAIL = 26,
  3077. WL_REINIT_RC_INV_VEN_ID = 27,
  3078. WL_REINIT_RC_INV_DEV_ID = 28,
  3079. WL_REINIT_RC_INV_BAR0 = 29,
  3080. WL_REINIT_RC_INV_BAR2 = 30,
  3081. WL_REINIT_RC_AER_UC_FATAL = 31,
  3082. WL_REINIT_RC_AER_UC_NON_FATAL = 32,
  3083. WL_REINIT_RC_AER_CORR = 33,
  3084. WL_REINIT_RC_AER_DEV_STS = 34,
  3085. WL_REINIT_RC_PCIe_STS = 35,
  3086. WL_REINIT_RC_MMIO_RD_FAIL = 36,
  3087. WL_REINIT_RC_MMIO_RD_INVAL = 37,
  3088. WL_REINIT_RC_MMIO_ARM_MEM_RD_FAIL = 38,
  3089. WL_REINIT_RC_MMIO_ARM_MEM_INVAL = 39,
  3090. WL_REINIT_RC_SROM_LOAD_FAILED = 40,
  3091. WL_REINIT_RC_PHY_CRASH = 41,
  3092. WL_REINIT_TX_STALL = 42,
  3093. WL_REINIT_RC_TX_FLOW_CONTROL_BLOCKED = 43,
  3094. WL_REINIT_RC_RX_HC_FAIL = 44,
  3095. WL_REINIT_RC_RX_DMA_STALL = 45,
  3096. WL_REINIT_UTRACE_BUF_OVERLAP_SR = 46,
  3097. WL_REINIT_UTRACE_TPL_OUT_BOUNDS = 47,
  3098. WL_REINIT_UTRACE_TPL_OSET_STRT0 = 48,
  3099. WL_REINIT_RC_PHYTXERR = 49,
  3100. WL_REINIT_RC_PSM_FATAL_SUSP = 50,
  3101. WL_REINIT_RC_TX_FIFO_SUSP = 51,
  3102. WL_REINIT_RC_MAC_ENABLE = 52,
  3103. WL_REINIT_RC_SCAN_STALLED = 53,
  3104. WL_REINIT_RC_PHY_HC = 54,
  3105. WL_REINIT_RC_LAST /* This must be the last entry */
  3106. };
  3107. #define WL_REINIT_RC_INVALID 255
  3108. #define NREINITREASONCOUNT 8
  3109. /* NREINITREASONCOUNT is 8 in other branches.
  3110. * Any change to this will break wl tool compatibility with other branches
  3111. * #define NREINITREASONCOUNT WL_REINIT_RC_LAST
  3112. */
  3113. #define REINITRSNIDX(_x) (((_x) < WL_REINIT_RC_LAST) ? (_x) : 0)
  3114. #define WL_CNT_T_VERSION 30 /**< current version of wl_cnt_t struct */
  3115. #define WL_CNT_VERSION_6 6
  3116. #define WL_CNT_VERSION_7 7
  3117. #define WL_CNT_VERSION_11 11
  3118. #define WL_CNT_VERSION_XTLV 30
  3119. #define WL_COUNTERS_IOV_VERSION_1 1
  3120. #define WL_SUBCNTR_IOV_VER WL_COUNTERS_IOV_VERSION_1
  3121. /* First two uint16 are version and lenght fields. So offset of the first counter will be 4 */
  3122. #define FIRST_COUNTER_OFFSET 0x04
  3123. /* need for now due to src/wl/ndis automerged to other branches. e.g. BISON */
  3124. #define WLC_WITH_XTLV_CNT
  3125. /* Number of xtlv info as required to calculate subcounter offsets */
  3126. #define WL_CNT_XTLV_ID_NUM 12
  3127. #define WL_TLV_IOV_VER 1
  3128. /**
  3129. * tlv IDs uniquely identifies counter component
  3130. * packed into wl_cmd_t container
  3131. */
  3132. enum wl_cnt_xtlv_id {
  3133. WL_CNT_XTLV_SLICE_IDX = 0x1, /**< Slice index */
  3134. WL_CNT_XTLV_WLC = 0x100, /**< WLC layer counters */
  3135. WL_CNT_XTLV_WLC_RINIT_RSN = 0x101, /**< WLC layer reinitreason extension */
  3136. WL_CNT_XTLV_WLC_HE = 0x102, /* he counters */
  3137. WL_CNT_XTLV_WLC_SECVLN = 0x103, /* security vulnerabilities counters */
  3138. WL_CNT_XTLV_WLC_HE_OMI = 0x104, /* he omi counters */
  3139. WL_CNT_XTLV_CNTV_LE10_UCODE = 0x200, /**< wl counter ver < 11 UCODE MACSTAT */
  3140. WL_CNT_XTLV_LT40_UCODE_V1 = 0x300, /**< corerev < 40 UCODE MACSTAT */
  3141. WL_CNT_XTLV_GE40_UCODE_V1 = 0x400, /**< corerev >= 40 UCODE MACSTAT */
  3142. WL_CNT_XTLV_GE64_UCODEX_V1 = 0x800, /* corerev >= 64 UCODEX MACSTAT */
  3143. WL_CNT_XTLV_GE80_UCODE_V1 = 0x900, /* corerev >= 80 UCODEX MACSTAT */
  3144. WL_CNT_XTLV_GE80_TXFUNFL_UCODE_V1 = 0x1000 /* corerev >= 80 UCODEX MACSTAT */
  3145. };
  3146. /* tlv IDs uniquely identifies periodic state component */
  3147. enum wl_periodic_slice_state_xtlv_id {
  3148. WL_STATE_COMPACT_COUNTERS = 0x1,
  3149. WL_STATE_TXBF_COUNTERS = 0x2,
  3150. WL_STATE_COMPACT_HE_COUNTERS = 0x3
  3151. };
  3152. /* Sub tlvs for chan_counters */
  3153. enum wl_periodic_chan_xtlv_id {
  3154. WL_CHAN_GENERIC_COUNTERS = 0x1,
  3155. WL_CHAN_PERIODIC_COUNTERS = 0x2
  3156. };
  3157. #ifdef WLC_CHAN_ECNTR_TEST
  3158. #define WL_CHAN_PERIODIC_CNTRS_VER_1 1
  3159. typedef struct wlc_chan_periodic_cntr
  3160. {
  3161. uint16 version;
  3162. uint16 pad;
  3163. uint32 rxstrt;
  3164. } wlc_chan_periodic_cntr_t;
  3165. #endif /* WLC_CHAN_ECNTR_TEST */
  3166. #define WL_CHANCNTR_HDR_VER_1 1
  3167. typedef struct wlc_chan_cntr_hdr_v1
  3168. {
  3169. uint16 version;
  3170. uint16 pad;
  3171. chanspec_t chanspec; /* Dont add any fields above this */
  3172. uint16 pad1;
  3173. uint32 total_time;
  3174. uint32 chan_entry_cnt;
  3175. } wlc_chan_cntr_hdr_v1_t;
  3176. /* tlv IDs uniquely identifies periodic state component */
  3177. enum wl_periodic_if_state_xtlv_id {
  3178. WL_STATE_IF_COMPACT_STATE = 0x1,
  3179. WL_STATE_IF_ADPS_STATE = 0x02
  3180. };
  3181. enum wl_periodic_tdls_if_state_xtlv_id {
  3182. WL_STATE_IF_TDLS_STATE = 0x1
  3183. };
  3184. #define TDMTX_CNT_VERSION_V1 1
  3185. #define TDMTX_CNT_VERSION_V2 2
  3186. /* structure holding tdm counters that interface to iovar */
  3187. typedef struct tdmtx_cnt_v1 {
  3188. uint16 ver;
  3189. uint16 length; /* length of this structure */
  3190. uint16 wlc_idx; /* index for wlc */
  3191. uint16 enabled; /* tdmtx is enabled on slice */
  3192. uint32 tdmtx_txa_on; /* TXA on requests */
  3193. uint32 tdmtx_txa_tmcnt; /* Total number of TXA timeout */
  3194. uint32 tdmtx_por_on; /* TXA POR requests */
  3195. uint32 tdmtx_txpuen; /* Path enable requests */
  3196. uint32 tdmtx_txpudis; /* Total number of times Tx path is muted on the slice */
  3197. uint32 tdmtx_txpri_on; /* Total number of times Tx priority was obtained by the slice */
  3198. uint32 tdmtx_txdefer; /* Total number of times Tx was deferred on the slice */
  3199. uint32 tdmtx_txmute; /* Total number of times active Tx muted on the slice */
  3200. uint32 tdmtx_actpwrboff; /* Total number of times TX power is backed off by the slice */
  3201. uint32 tdmtx_txa_dur; /* Total time txa on */
  3202. uint32 tdmtx_txpri_dur; /* Total time TXPri */
  3203. uint32 tdmtx_txdefer_dur; /* Total time txdefer */
  3204. /* TDMTX input fields */
  3205. uint32 tdmtx_txpri;
  3206. uint32 tdmtx_defer;
  3207. uint32 tdmtx_threshold;
  3208. uint32 tdmtx_rssi_threshold;
  3209. uint32 tdmtx_txpwrboff;
  3210. uint32 tdmtx_txpwrboff_dt;
  3211. } tdmtx_cnt_v1_t;
  3212. typedef struct {
  3213. uint16 ver;
  3214. uint16 length; /* length of the data portion */
  3215. uint16 cnt;
  3216. uint16 pad; /* pad to align to 32 bit */
  3217. uint8 data[]; /* array of tdmtx_cnt_v1_t */
  3218. } tdmtx_status_t;
  3219. /* structure holding counters that match exactly shm field sizes */
  3220. typedef struct tdmtx_cnt_shm_v1 {
  3221. uint16 tdmtx_txa_on; /* TXA on requests */
  3222. uint16 tdmtx_tmcnt; /* TXA on requests */
  3223. uint16 tdmtx_por_on; /* TXA POR requests */
  3224. uint16 tdmtx_txpuen; /* Path enable requests */
  3225. uint16 tdmtx_txpudis; /* Total number of times Tx path is muted on the slice */
  3226. uint16 tdmtx_txpri_on; /* Total number of times Tx priority was obtained by the slice */
  3227. uint16 tdmtx_txdefer; /* Total number of times Tx was defered by the slice */
  3228. uint16 tdmtx_txmute; /* Total number of times active Tx muted on the slice */
  3229. uint16 tdmtx_actpwrboff; /* Total number of times TX power is backed off by the slice */
  3230. uint16 tdmtx_txa_dur_l; /* Total time (low 16 bits) txa on */
  3231. uint16 tdmtx_txa_dur_h; /* Total time (low 16 bits) txa on */
  3232. uint16 tdmtx_txpri_dur_l; /* Total time (low 16 bits) TXPri */
  3233. uint16 tdmtx_txpri_dur_h; /* Total time (high 16 bits) TXPri */
  3234. uint16 tdmtx_txdefer_dur_l; /* Total time (low 16 bits) txdefer */
  3235. uint16 tdmtx_txdefer_dur_h; /* Total time (high 16 bits) txdefer */
  3236. } tdmtx_cnt_shm_v1_t;
  3237. /* structure holding tdm counters that interface to iovar for version 2 */
  3238. typedef struct tdmtx_cnt_v2 {
  3239. uint16 ver;
  3240. uint16 length; /* length of this structure */
  3241. uint16 wlc_idx; /* index for wlc */
  3242. uint16 enabled; /* tdmtx is enabled on slice */
  3243. uint32 tdmtx_txa_on; /* TXA on requests */
  3244. uint32 tdmtx_txa_tmcnt; /* Total number of TXA timeout */
  3245. uint32 tdmtx_porhi_on; /* TXA PORHI requests */
  3246. uint32 tdmtx_porlo_on; /* TXA PORLO requests */
  3247. uint32 tdmtx_txpuen; /* Path enable requests */
  3248. uint32 tdmtx_txpudis; /* Total number of times Tx path is muted on the slice */
  3249. uint32 tdmtx_txpri_on; /* Total number of times Tx priority was obtained by the slice */
  3250. uint32 tdmtx_txdefer; /* Total number of times Tx was deferred on the slice */
  3251. uint32 tdmtx_txmute; /* Total number of times active Tx muted on the slice */
  3252. uint32 tdmtx_actpwrboff; /* Total number of times TX power is backed off by the slice */
  3253. uint32 tdmtx_txa_dur; /* Total time txa on */
  3254. uint32 tdmtx_txpri_dur; /* Total time TXPri */
  3255. uint32 tdmtx_txdefer_dur; /* Total time txdefer */
  3256. /* TDMTX input fields */
  3257. uint32 tdmtx_txpri;
  3258. uint32 tdmtx_defer;
  3259. uint32 tdmtx_threshold;
  3260. uint32 tdmtx_rssi_threshold;
  3261. uint32 tdmtx_txpwrboff;
  3262. uint32 tdmtx_txpwrboff_dt;
  3263. } tdmtx_cnt_v2_t;
  3264. /* structure holding counters that match exactly shm field sizes */
  3265. typedef struct tdmtx_cnt_shm_v2 {
  3266. uint16 tdmtx_txa_on; /* TXA on requests */
  3267. uint16 tdmtx_tmcnt; /* TXA on requests */
  3268. uint16 tdmtx_porhi_on; /* TXA PORHI requests */
  3269. uint16 tdmtx_porlo_on; /* TXA PORLO requests */
  3270. uint16 tdmtx_txpuen; /* Path enable requests */
  3271. uint16 tdmtx_txpudis; /* Total number of times Tx path is muted on the slice */
  3272. uint16 tdmtx_txpri_on; /* Total number of times Tx priority was obtained by the slice */
  3273. uint16 tdmtx_txdefer; /* Total number of times Tx was defered by the slice */
  3274. uint16 tdmtx_txmute; /* Total number of times active Tx muted on the slice */
  3275. uint16 tdmtx_actpwrboff; /* Total number of times TX power is backed off by the slice */
  3276. uint16 tdmtx_txa_dur_l; /* Total time (low 16 bits) txa on */
  3277. uint16 tdmtx_txa_dur_h; /* Total time (low 16 bits) txa on */
  3278. uint16 tdmtx_txpri_dur_l; /* Total time (low 16 bits) TXPri */
  3279. uint16 tdmtx_txpri_dur_h; /* Total time (high 16 bits) TXPri */
  3280. uint16 tdmtx_txdefer_dur_l; /* Total time (low 16 bits) txdefer */
  3281. uint16 tdmtx_txdefer_dur_h; /* Total time (high 16 bits) txdefer */
  3282. } tdmtx_cnt_shm_v2_t;
  3283. typedef struct wl_tdmtx_ioc {
  3284. uint16 id; /* ID of the sub-command */
  3285. uint16 len; /* total length of all data[] */
  3286. uint8 data[]; /* var len payload */
  3287. } wl_tdmtx_ioc_t;
  3288. /*
  3289. * iovar subcommand ids
  3290. */
  3291. enum {
  3292. IOV_TDMTX_ENB = 1,
  3293. IOV_TDMTX_STATUS = 2,
  3294. IOV_TDMTX_TXPRI = 3,
  3295. IOV_TDMTX_DEFER = 4,
  3296. IOV_TDMTX_TXA = 5,
  3297. IOV_TDMTX_CFG = 6,
  3298. IOV_TDMTX_LAST
  3299. };
  3300. /**
  3301. * The number of variables in wl macstat cnt struct.
  3302. * (wl_cnt_ge40mcst_v1_t, wl_cnt_lt40mcst_v1_t, wl_cnt_v_le10_mcst_t)
  3303. */
  3304. #define WL_CNT_MCST_VAR_NUM 64
  3305. /* sizeof(wl_cnt_ge40mcst_v1_t), sizeof(wl_cnt_lt40mcst_v1_t), and sizeof(wl_cnt_v_le10_mcst_t) */
  3306. #define WL_CNT_MCST_STRUCT_SZ ((uint32)sizeof(uint32) * WL_CNT_MCST_VAR_NUM)
  3307. #define WL_CNT_REV80_MCST_STRUCT_SZ ((uint32)sizeof(wl_cnt_ge80mcst_v1_t))
  3308. #define WL_CNT_REV80_MCST_TXFUNFlW_STRUCT_FIXED_SZ \
  3309. ((uint32)OFFSETOF(wl_cnt_ge80_txfunfl_v1_t, txfunfl))
  3310. #define WL_CNT_REV80_MCST_TXFUNFl_STRUCT_SZ(fcnt) \
  3311. (WL_CNT_REV80_MCST_TXFUNFlW_STRUCT_FIXED_SZ + (fcnt * sizeof(uint32)))
  3312. #define WL_CNT_REV80_MCST_TXFUNFlW_STRUCT_SZ (WL_CNT_REV80_MCST_TXFUNFl_STRUCT_SZ(NFIFO_EXT))
  3313. #define WL_CNT_MCXST_STRUCT_SZ ((uint32)sizeof(wl_cnt_ge64mcxst_v1_t))
  3314. #define WL_CNT_HE_STRUCT_SZ ((uint32)sizeof(wl_he_cnt_wlc_t))
  3315. #define WL_CNT_SECVLN_STRUCT_SZ ((uint32)sizeof(wl_secvln_cnt_t))
  3316. #define WL_CNT_HE_OMI_STRUCT_SZ ((uint32)sizeof(wl_he_omi_cnt_wlc_v1_t))
  3317. #define INVALID_CNT_VAL (uint32)(-1)
  3318. #define WL_XTLV_CNTBUF_MAX_SIZE ((uint32)(OFFSETOF(wl_cnt_info_t, data)) + \
  3319. (uint32)BCM_XTLV_HDR_SIZE + (uint32)sizeof(wl_cnt_wlc_t) + \
  3320. (uint32)BCM_XTLV_HDR_SIZE + WL_CNT_MCST_STRUCT_SZ + \
  3321. (uint32)BCM_XTLV_HDR_SIZE + WL_CNT_MCXST_STRUCT_SZ)
  3322. #define WL_CNTBUF_MAX_SIZE MAX(WL_XTLV_CNTBUF_MAX_SIZE, (uint32)sizeof(wl_cnt_ver_11_t))
  3323. /* Please refer to the twiki for counters addition/deletion.
  3324. * http://hwnbu-twiki.sj.broadcom.com/bin/view/Mwgroup/WlCounters#Counter_Edition
  3325. */
  3326. /** Top structure of counters IOVar buffer */
  3327. typedef struct {
  3328. uint16 version; /**< see definition of WL_CNT_T_VERSION */
  3329. uint16 datalen; /**< length of data including all paddings. */
  3330. uint8 data []; /**< variable length payload:
  3331. * 1 or more bcm_xtlv_t type of tuples.
  3332. * each tuple is padded to multiple of 4 bytes.
  3333. * 'datalen' field of this structure includes all paddings.
  3334. */
  3335. } wl_cnt_info_t;
  3336. /* Top structure of subcounters IOVar buffer
  3337. * Whenever we make any change in this structure
  3338. * WL_SUBCNTR_IOV_VER should be updated accordingly
  3339. * The structure definition should remain consistant b/w
  3340. * FW and wl/WLM app.
  3341. */
  3342. typedef struct {
  3343. uint16 version; /* Version of IOVAR structure. Used for backward
  3344. * compatibility in future. Whenever we make any
  3345. * changes to this structure then value of WL_SUBCNTR_IOV_VER
  3346. * needs to be updated properly.
  3347. */
  3348. uint16 length; /* length in bytes of this structure */
  3349. uint16 counters_version; /* see definition of WL_CNT_T_VERSION
  3350. * wl app will send the version of counters
  3351. * which is used to calculate the offset of counters.
  3352. * It must match the version of counters FW is using
  3353. * else FW will return error with his version of counters
  3354. * set in this field.
  3355. */
  3356. uint16 num_subcounters; /* Number of counter offset passed by wl app to FW. */
  3357. uint32 data[1]; /* variable length payload:
  3358. * Offsets to the counters will be passed to FW
  3359. * throught this data field. FW will return the value of counters
  3360. * at the offsets passed by wl app in this fiels itself.
  3361. */
  3362. } wl_subcnt_info_t;
  3363. /* Top structure of counters TLV version IOVar buffer
  3364. * The structure definition should remain consistant b/w
  3365. * FW and wl/WLM app.
  3366. */
  3367. typedef struct {
  3368. uint16 version; /* Version of IOVAR structure. Added for backward
  3369. * compatibility feature. If any changes are done,
  3370. * WL_TLV_IOV_VER need to be updated.
  3371. */
  3372. uint16 length; /* total len in bytes of this structure + payload */
  3373. uint16 counters_version; /* See definition of WL_CNT_VERSION_XTLV
  3374. * wl app will update counter tlv version to be used
  3375. * so to calculate offset of supported TLVs.
  3376. * If there is a mismatch in the version, FW will update an error
  3377. */
  3378. uint16 num_tlv; /* Max number of TLV info passed by FW to WL app.
  3379. * and vice-versa
  3380. */
  3381. uint32 data[]; /* variable length payload:
  3382. * This stores the tlv as supported by F/W to the wl app.
  3383. * This table is required to compute subcounter offsets at WLapp end.
  3384. */
  3385. } wl_cntr_tlv_info_t;
  3386. /** wlc layer counters */
  3387. typedef struct {
  3388. /* transmit stat counters */
  3389. uint32 txframe; /**< tx data frames */
  3390. uint32 txbyte; /**< tx data bytes */
  3391. uint32 txretrans; /**< tx mac retransmits */
  3392. uint32 txerror; /**< tx data errors (derived: sum of others) */
  3393. uint32 txctl; /**< tx management frames */
  3394. uint32 txprshort; /**< tx short preamble frames */
  3395. uint32 txserr; /**< tx status errors */
  3396. uint32 txnobuf; /**< tx out of buffers errors */
  3397. uint32 txnoassoc; /**< tx discard because we're not associated */
  3398. uint32 txrunt; /**< tx runt frames */
  3399. uint32 txchit; /**< tx header cache hit (fastpath) */
  3400. uint32 txcmiss; /**< tx header cache miss (slowpath) */
  3401. /* transmit chip error counters */
  3402. uint32 txuflo; /**< tx fifo underflows */
  3403. uint32 txphyerr; /**< tx phy errors (indicated in tx status) */
  3404. uint32 txphycrs;
  3405. /* receive stat counters */
  3406. uint32 rxframe; /**< rx data frames */
  3407. uint32 rxbyte; /**< rx data bytes */
  3408. uint32 rxerror; /**< rx data errors (derived: sum of others) */
  3409. uint32 rxctl; /**< rx management frames */
  3410. uint32 rxnobuf; /**< rx out of buffers errors */
  3411. uint32 rxnondata; /**< rx non data frames in the data channel errors */
  3412. uint32 rxbadds; /**< rx bad DS errors */
  3413. uint32 rxbadcm; /**< rx bad control or management frames */
  3414. uint32 rxfragerr; /**< rx fragmentation errors */
  3415. uint32 rxrunt; /**< rx runt frames */
  3416. uint32 rxgiant; /**< rx giant frames */
  3417. uint32 rxnoscb; /**< rx no scb error */
  3418. uint32 rxbadproto; /**< rx invalid frames */
  3419. uint32 rxbadsrcmac; /**< rx frames with Invalid Src Mac */
  3420. uint32 rxbadda; /**< rx frames tossed for invalid da */
  3421. uint32 rxfilter; /**< rx frames filtered out */
  3422. /* receive chip error counters */
  3423. uint32 rxoflo; /**< rx fifo overflow errors */
  3424. uint32 rxuflo[NFIFO]; /**< rx dma descriptor underflow errors */
  3425. uint32 d11cnt_txrts_off; /**< d11cnt txrts value when reset d11cnt */
  3426. uint32 d11cnt_rxcrc_off; /**< d11cnt rxcrc value when reset d11cnt */
  3427. uint32 d11cnt_txnocts_off; /**< d11cnt txnocts value when reset d11cnt */
  3428. /* misc counters */
  3429. uint32 dmade; /**< tx/rx dma descriptor errors */
  3430. uint32 dmada; /**< tx/rx dma data errors */
  3431. uint32 dmape; /**< tx/rx dma descriptor protocol errors */
  3432. uint32 reset; /**< reset count */
  3433. uint32 tbtt; /**< cnts the TBTT int's */
  3434. uint32 txdmawar;
  3435. uint32 pkt_callback_reg_fail; /**< callbacks register failure */
  3436. /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
  3437. uint32 txfrag; /**< dot11TransmittedFragmentCount */
  3438. uint32 txmulti; /**< dot11MulticastTransmittedFrameCount */
  3439. uint32 txfail; /**< dot11FailedCount */
  3440. uint32 txretry; /**< dot11RetryCount */
  3441. uint32 txretrie; /**< dot11MultipleRetryCount */
  3442. uint32 rxdup; /**< dot11FrameduplicateCount */
  3443. uint32 txrts; /**< dot11RTSSuccessCount */
  3444. uint32 txnocts; /**< dot11RTSFailureCount */
  3445. uint32 txnoack; /**< dot11ACKFailureCount */
  3446. uint32 rxfrag; /**< dot11ReceivedFragmentCount */
  3447. uint32 rxmulti; /**< dot11MulticastReceivedFrameCount */
  3448. uint32 rxcrc; /**< dot11FCSErrorCount */
  3449. uint32 txfrmsnt; /**< dot11TransmittedFrameCount (bogus MIB?) */
  3450. uint32 rxundec; /**< dot11WEPUndecryptableCount */
  3451. /* WPA2 counters (see rxundec for DecryptFailureCount) */
  3452. uint32 tkipmicfaill; /**< TKIPLocalMICFailures */
  3453. uint32 tkipcntrmsr; /**< TKIPCounterMeasuresInvoked */
  3454. uint32 tkipreplay; /**< TKIPReplays */
  3455. uint32 ccmpfmterr; /**< CCMPFormatErrors */
  3456. uint32 ccmpreplay; /**< CCMPReplays */
  3457. uint32 ccmpundec; /**< CCMPDecryptErrors */
  3458. uint32 fourwayfail; /**< FourWayHandshakeFailures */
  3459. uint32 wepundec; /**< dot11WEPUndecryptableCount */
  3460. uint32 wepicverr; /**< dot11WEPICVErrorCount */
  3461. uint32 decsuccess; /**< DecryptSuccessCount */
  3462. uint32 tkipicverr; /**< TKIPICVErrorCount */
  3463. uint32 wepexcluded; /**< dot11WEPExcludedCount */
  3464. uint32 txchanrej; /**< Tx frames suppressed due to channel rejection */
  3465. uint32 psmwds; /**< Count PSM watchdogs */
  3466. uint32 phywatchdog; /**< Count Phy watchdogs (triggered by ucode) */
  3467. /* MBSS counters, AP only */
  3468. uint32 prq_entries_handled; /**< PRQ entries read in */
  3469. uint32 prq_undirected_entries; /**< which were bcast bss & ssid */
  3470. uint32 prq_bad_entries; /**< which could not be translated to info */
  3471. uint32 atim_suppress_count; /**< TX suppressions on ATIM fifo */
  3472. uint32 bcn_template_not_ready; /**< Template marked in use on send bcn ... */
  3473. uint32 bcn_template_not_ready_done; /**< ...but "DMA done" interrupt rcvd */
  3474. uint32 late_tbtt_dpc; /**< TBTT DPC did not happen in time */
  3475. /* per-rate receive stat counters */
  3476. uint32 rx1mbps; /**< packets rx at 1Mbps */
  3477. uint32 rx2mbps; /**< packets rx at 2Mbps */
  3478. uint32 rx5mbps5; /**< packets rx at 5.5Mbps */
  3479. uint32 rx6mbps; /**< packets rx at 6Mbps */
  3480. uint32 rx9mbps; /**< packets rx at 9Mbps */
  3481. uint32 rx11mbps; /**< packets rx at 11Mbps */
  3482. uint32 rx12mbps; /**< packets rx at 12Mbps */
  3483. uint32 rx18mbps; /**< packets rx at 18Mbps */
  3484. uint32 rx24mbps; /**< packets rx at 24Mbps */
  3485. uint32 rx36mbps; /**< packets rx at 36Mbps */
  3486. uint32 rx48mbps; /**< packets rx at 48Mbps */
  3487. uint32 rx54mbps; /**< packets rx at 54Mbps */
  3488. uint32 rx108mbps; /**< packets rx at 108mbps */
  3489. uint32 rx162mbps; /**< packets rx at 162mbps */
  3490. uint32 rx216mbps; /**< packets rx at 216 mbps */
  3491. uint32 rx270mbps; /**< packets rx at 270 mbps */
  3492. uint32 rx324mbps; /**< packets rx at 324 mbps */
  3493. uint32 rx378mbps; /**< packets rx at 378 mbps */
  3494. uint32 rx432mbps; /**< packets rx at 432 mbps */
  3495. uint32 rx486mbps; /**< packets rx at 486 mbps */
  3496. uint32 rx540mbps; /**< packets rx at 540 mbps */
  3497. uint32 rfdisable; /**< count of radio disables */
  3498. uint32 txexptime; /**< Tx frames suppressed due to timer expiration */
  3499. uint32 txmpdu_sgi; /**< count for sgi transmit */
  3500. uint32 rxmpdu_sgi; /**< count for sgi received */
  3501. uint32 txmpdu_stbc; /**< count for stbc transmit */
  3502. uint32 rxmpdu_stbc; /**< count for stbc received */
  3503. uint32 rxundec_mcst; /**< dot11WEPUndecryptableCount */
  3504. /* WPA2 counters (see rxundec for DecryptFailureCount) */
  3505. uint32 tkipmicfaill_mcst; /**< TKIPLocalMICFailures */
  3506. uint32 tkipcntrmsr_mcst; /**< TKIPCounterMeasuresInvoked */
  3507. uint32 tkipreplay_mcst; /**< TKIPReplays */
  3508. uint32 ccmpfmterr_mcst; /**< CCMPFormatErrors */
  3509. uint32 ccmpreplay_mcst; /**< CCMPReplays */
  3510. uint32 ccmpundec_mcst; /**< CCMPDecryptErrors */
  3511. uint32 fourwayfail_mcst; /**< FourWayHandshakeFailures */
  3512. uint32 wepundec_mcst; /**< dot11WEPUndecryptableCount */
  3513. uint32 wepicverr_mcst; /**< dot11WEPICVErrorCount */
  3514. uint32 decsuccess_mcst; /**< DecryptSuccessCount */
  3515. uint32 tkipicverr_mcst; /**< TKIPICVErrorCount */
  3516. uint32 wepexcluded_mcst; /**< dot11WEPExcludedCount */
  3517. uint32 dma_hang; /**< count for dma hang */
  3518. uint32 reinit; /**< count for reinit */
  3519. uint32 pstatxucast; /**< count of ucast frames xmitted on all psta assoc */
  3520. uint32 pstatxnoassoc; /**< count of txnoassoc frames xmitted on all psta assoc */
  3521. uint32 pstarxucast; /**< count of ucast frames received on all psta assoc */
  3522. uint32 pstarxbcmc; /**< count of bcmc frames received on all psta */
  3523. uint32 pstatxbcmc; /**< count of bcmc frames transmitted on all psta */
  3524. uint32 cso_passthrough; /**< hw cso required but passthrough */
  3525. uint32 cso_normal; /**< hw cso hdr for normal process */
  3526. uint32 chained; /**< number of frames chained */
  3527. uint32 chainedsz1; /**< number of chain size 1 frames */
  3528. uint32 unchained; /**< number of frames not chained */
  3529. uint32 maxchainsz; /**< max chain size so far */
  3530. uint32 currchainsz; /**< current chain size */
  3531. uint32 pciereset; /**< Secondary Bus Reset issued by driver */
  3532. uint32 cfgrestore; /**< configspace restore by driver */
  3533. uint32 reinitreason[NREINITREASONCOUNT]; /**< reinitreason counters; 0: Unknown reason */
  3534. uint32 rxrtry;
  3535. uint32 rxmpdu_mu; /**< Number of MU MPDUs received */
  3536. /* detailed control/management frames */
  3537. uint32 txbar; /**< Number of TX BAR */
  3538. uint32 rxbar; /**< Number of RX BAR */
  3539. uint32 txpspoll; /**< Number of TX PS-poll */
  3540. uint32 rxpspoll; /**< Number of RX PS-poll */
  3541. uint32 txnull; /**< Number of TX NULL_DATA */
  3542. uint32 rxnull; /**< Number of RX NULL_DATA */
  3543. uint32 txqosnull; /**< Number of TX NULL_QoSDATA */
  3544. uint32 rxqosnull; /**< Number of RX NULL_QoSDATA */
  3545. uint32 txassocreq; /**< Number of TX ASSOC request */
  3546. uint32 rxassocreq; /**< Number of RX ASSOC request */
  3547. uint32 txreassocreq; /**< Number of TX REASSOC request */
  3548. uint32 rxreassocreq; /**< Number of RX REASSOC request */
  3549. uint32 txdisassoc; /**< Number of TX DISASSOC */
  3550. uint32 rxdisassoc; /**< Number of RX DISASSOC */
  3551. uint32 txassocrsp; /**< Number of TX ASSOC response */
  3552. uint32 rxassocrsp; /**< Number of RX ASSOC response */
  3553. uint32 txreassocrsp; /**< Number of TX REASSOC response */
  3554. uint32 rxreassocrsp; /**< Number of RX REASSOC response */
  3555. uint32 txauth; /**< Number of TX AUTH */
  3556. uint32 rxauth; /**< Number of RX AUTH */
  3557. uint32 txdeauth; /**< Number of TX DEAUTH */
  3558. uint32 rxdeauth; /**< Number of RX DEAUTH */
  3559. uint32 txprobereq; /**< Number of TX probe request */
  3560. uint32 rxprobereq; /**< Number of RX probe request */
  3561. uint32 txprobersp; /**< Number of TX probe response */
  3562. uint32 rxprobersp; /**< Number of RX probe response */
  3563. uint32 txaction; /**< Number of TX action frame */
  3564. uint32 rxaction; /**< Number of RX action frame */
  3565. uint32 ampdu_wds; /**< Number of AMPDU watchdogs */
  3566. uint32 txlost; /**< Number of lost packets reported in txs */
  3567. uint32 txdatamcast; /**< Number of TX multicast data packets */
  3568. uint32 txdatabcast; /**< Number of TX broadcast data packets */
  3569. uint32 psmxwds; /**< Number of PSMx watchdogs */
  3570. uint32 rxback;
  3571. uint32 txback;
  3572. uint32 p2p_tbtt; /**< Number of P2P TBTT Events */
  3573. uint32 p2p_tbtt_miss; /**< Number of P2P TBTT Events Miss */
  3574. uint32 txqueue_start;
  3575. uint32 txqueue_end;
  3576. uint32 txbcast; /* Broadcast TransmittedFrameCount */
  3577. uint32 txdropped; /* tx dropped pkts */
  3578. uint32 rxbcast; /* BroadcastReceivedFrameCount */
  3579. uint32 rxdropped; /* rx dropped pkts (derived: sum of others) */
  3580. uint32 txq_end_assoccb; /* forced txqueue_end callback fired in assoc */
  3581. uint32 tx_toss_cnt; /* number of tx packets tossed */
  3582. uint32 rx_toss_cnt; /* number of rx packets tossed */
  3583. uint32 last_tx_toss_rsn; /* reason because of which last tx pkt tossed */
  3584. uint32 last_rx_toss_rsn; /* reason because of which last rx pkt tossed */
  3585. uint32 pmk_badlen_cnt; /* number of invalid pmk len */
  3586. uint32 txbar_notx; /* number of TX BAR not sent (maybe supressed or muted) */
  3587. uint32 txbar_noack; /* number of TX BAR sent, but not acknowledged by peer */
  3588. uint32 rxfrag_agedout; /**< # of aged out rx fragmentation */
  3589. /* Do not remove or rename in the middle of this struct.
  3590. * All counter variables have to be of uint32.
  3591. * Please follow the instruction in
  3592. * http://hwnbu-twiki.sj.broadcom.com/bin/view/Mwgroup/WlCounters#Counter_Edition
  3593. */
  3594. } wl_cnt_wlc_t;
  3595. /* he counters Version 1 */
  3596. #define HE_COUNTERS_V1 (1)
  3597. typedef struct wl_he_cnt_wlc_v1 {
  3598. uint32 he_rxtrig_myaid;
  3599. uint32 he_rxtrig_rand;
  3600. uint32 he_colormiss_cnt;
  3601. uint32 he_txmampdu;
  3602. uint32 he_txmtid_back;
  3603. uint32 he_rxmtid_back;
  3604. uint32 he_rxmsta_back;
  3605. uint32 he_txfrag;
  3606. uint32 he_rxdefrag;
  3607. uint32 he_txtrig;
  3608. uint32 he_rxtrig_basic;
  3609. uint32 he_rxtrig_murts;
  3610. uint32 he_rxtrig_bsrp;
  3611. uint32 he_rxdlmu;
  3612. uint32 he_physu_rx;
  3613. uint32 he_phyru_rx;
  3614. uint32 he_txtbppdu;
  3615. } wl_he_cnt_wlc_v1_t;
  3616. /* he counters Version 2 */
  3617. #define HE_COUNTERS_V2 (2)
  3618. typedef struct wl_he_cnt_wlc_v2 {
  3619. uint16 version;
  3620. uint16 len;
  3621. uint32 he_rxtrig_myaid; /**< rxed valid trigger frame with myaid */
  3622. uint32 he_rxtrig_rand; /**< rxed valid trigger frame with random aid */
  3623. uint32 he_colormiss_cnt; /**< for bss color mismatch cases */
  3624. uint32 he_txmampdu; /**< for multi-TID AMPDU transmission */
  3625. uint32 he_txmtid_back; /**< for multi-TID BACK transmission */
  3626. uint32 he_rxmtid_back; /**< reception of multi-TID BACK */
  3627. uint32 he_rxmsta_back; /**< reception of multi-STA BACK */
  3628. uint32 he_txfrag; /**< transmission of Dynamic fragmented packets */
  3629. uint32 he_rxdefrag; /**< reception of dynamic fragmented packets */
  3630. uint32 he_txtrig; /**< transmission of trigger frames */
  3631. uint32 he_rxtrig_basic; /**< reception of basic trigger frame */
  3632. uint32 he_rxtrig_murts; /**< reception of MU-RTS trigger frame */
  3633. uint32 he_rxtrig_bsrp; /**< reception of BSR poll trigger frame */
  3634. uint32 he_rxdlmu; /**< reception of DL MU PPDU */
  3635. uint32 he_physu_rx; /**< reception of SU frame */
  3636. uint32 he_phyru_rx; /**< reception of RU frame */
  3637. uint32 he_txtbppdu; /**< increments on transmission of every TB PPDU */
  3638. uint32 he_null_tbppdu; /**< null TB PPDU's sent as a response to basic trigger frame */
  3639. } wl_he_cnt_wlc_v2_t;
  3640. /* he counters Version 3 */
  3641. #define WL_RU_TYPE_MAX 6
  3642. #define HE_COUNTERS_V3 (3)
  3643. typedef struct wl_he_cnt_wlc_v3 {
  3644. uint16 version;
  3645. uint16 len;
  3646. uint32 he_rxtrig_myaid; /**< rxed valid trigger frame with myaid */
  3647. uint32 he_rxtrig_rand; /**< rxed valid trigger frame with random aid */
  3648. uint32 he_colormiss_cnt; /**< for bss color mismatch cases */
  3649. uint32 he_txmampdu; /**< for multi-TID AMPDU transmission */
  3650. uint32 he_txmtid_back; /**< for multi-TID BACK transmission */
  3651. uint32 he_rxmtid_back; /**< reception of multi-TID BACK */
  3652. uint32 he_rxmsta_back; /**< reception of multi-STA BACK */
  3653. uint32 he_txfrag; /**< transmission of Dynamic fragmented packets */
  3654. uint32 he_rxdefrag; /**< reception of dynamic fragmented packets */
  3655. uint32 he_txtrig; /**< transmission of trigger frames */
  3656. uint32 he_rxtrig_basic; /**< reception of basic trigger frame */
  3657. uint32 he_rxtrig_murts; /**< reception of MU-RTS trigger frame */
  3658. uint32 he_rxtrig_bsrp; /**< reception of BSR poll trigger frame */
  3659. uint32 he_rxhemuppdu_cnt; /**< rxing HE MU PPDU */
  3660. uint32 he_physu_rx; /**< reception of SU frame */
  3661. uint32 he_phyru_rx; /**< reception of RU frame */
  3662. uint32 he_txtbppdu; /**< increments on transmission of every TB PPDU */
  3663. uint32 he_null_tbppdu; /**< null TB PPDU's sent as a response to basic trigger frame */
  3664. uint32 he_rxhesuppdu_cnt; /**< rxing SU PPDU */
  3665. uint32 he_rxhesureppdu_cnt; /**< rxing Range Extension(RE) SU PPDU */
  3666. uint32 he_null_zero_agg; /**< null AMPDU's transmitted in response to basic trigger
  3667. * because of zero aggregation
  3668. */
  3669. uint32 he_null_bsrp_rsp; /**< null AMPDU's txed in response to BSR poll */
  3670. uint32 he_null_fifo_empty; /**< null AMPDU's in response to basic trigger
  3671. * because of no frames in fifo's
  3672. */
  3673. uint32 he_myAID_cnt;
  3674. uint32 he_rxtrig_bfm_cnt;
  3675. uint32 he_rxtrig_mubar;
  3676. uint32 rxheru[WL_RU_TYPE_MAX]; /**< HE of rx pkts */
  3677. uint32 txheru[WL_RU_TYPE_MAX];
  3678. uint32 he_mgmt_tbppdu;
  3679. uint32 he_cs_req_tx_cancel;
  3680. uint32 he_wrong_nss;
  3681. uint32 he_trig_unsupp_rate;
  3682. uint32 he_rxtrig_nfrp;
  3683. uint32 he_rxtrig_bqrp;
  3684. uint32 he_rxtrig_gcrmubar;
  3685. } wl_he_cnt_wlc_v3_t;
  3686. /* he counters Version 4 */
  3687. #define HE_COUNTERS_V4 (4)
  3688. typedef struct wl_he_cnt_wlc_v4 {
  3689. uint16 version;
  3690. uint16 len;
  3691. uint32 he_rxtrig_myaid; /**< rxed valid trigger frame with myaid */
  3692. uint32 he_rxtrig_rand; /**< rxed valid trigger frame with random aid */
  3693. uint32 he_colormiss_cnt; /**< for bss color mismatch cases */
  3694. uint32 he_txmampdu; /**< for multi-TID AMPDU transmission */
  3695. uint32 he_txmtid_back; /**< for multi-TID BACK transmission */
  3696. uint32 he_rxmtid_back; /**< reception of multi-TID BACK */
  3697. uint32 he_rxmsta_back; /**< reception of multi-STA BACK */
  3698. uint32 he_txfrag; /**< transmission of Dynamic fragmented packets */
  3699. uint32 he_rxdefrag; /**< reception of dynamic fragmented packets */
  3700. uint32 he_txtrig; /**< transmission of trigger frames */
  3701. uint32 he_rxtrig_basic; /**< reception of basic trigger frame */
  3702. uint32 he_rxtrig_murts; /**< reception of MU-RTS trigger frame */
  3703. uint32 he_rxtrig_bsrp; /**< reception of BSR poll trigger frame */
  3704. uint32 he_rxtsrt_hemuppdu_cnt; /**< rxing HE MU PPDU */
  3705. uint32 he_physu_rx; /**< reception of SU frame */
  3706. uint32 he_phyru_rx; /**< reception of RU frame */
  3707. uint32 he_txtbppdu; /**< increments on transmission of every TB PPDU */
  3708. uint32 he_null_tbppdu; /**< null TB PPDU's sent as a response to basic trigger frame */
  3709. uint32 he_rxstrt_hesuppdu_cnt; /**< rxing SU PPDU */
  3710. uint32 he_rxstrt_hesureppdu_cnt; /**< rxing Range Extension(RE) SU PPDU */
  3711. uint32 he_null_zero_agg; /**< null AMPDU's transmitted in response to basic trigger
  3712. * because of zero aggregation
  3713. */
  3714. uint32 he_null_bsrp_rsp; /**< null AMPDU's txed in response to BSR poll */
  3715. uint32 he_null_fifo_empty; /**< null AMPDU's in response to basic trigger
  3716. * because of no frames in fifo's
  3717. */
  3718. uint32 he_myAID_cnt;
  3719. uint32 he_rxtrig_bfm_cnt;
  3720. uint32 he_rxtrig_mubar;
  3721. uint32 rxheru[WL_RU_TYPE_MAX]; /**< HE of rx pkts */
  3722. uint32 txheru[WL_RU_TYPE_MAX];
  3723. uint32 he_mgmt_tbppdu;
  3724. uint32 he_cs_req_tx_cancel;
  3725. uint32 he_wrong_nss;
  3726. uint32 he_trig_unsupp_rate;
  3727. uint32 he_rxtrig_nfrp;
  3728. uint32 he_rxtrig_bqrp;
  3729. uint32 he_rxtrig_gcrmubar;
  3730. uint32 he_rxtrig_basic_htpack; /**< triggers received with HTP ack policy */
  3731. uint32 he_rxtrig_ed_cncl; /**< count of cancelled packets
  3732. * becasue of cs_req in trigger frame
  3733. */
  3734. uint32 he_rxtrig_suppr_null_tbppdu; /**< count of null frame sent becasue of
  3735. * suppression scenarios
  3736. */
  3737. uint32 he_ulmu_disable; /**< number of UL MU disable scenario's handled in ucode */
  3738. uint32 he_ulmu_data_disable; /**<number of UL MU data disable scenarios
  3739. * handled in ucode
  3740. */
  3741. } wl_he_cnt_wlc_v4_t;
  3742. #ifndef HE_COUNTERS_VERSION_ENABLED
  3743. #define HE_COUNTERS_VERSION (HE_COUNTERS_V1)
  3744. typedef wl_he_cnt_wlc_v1_t wl_he_cnt_wlc_t;
  3745. #endif /* HE_COUNTERS_VERSION_ENABLED */
  3746. /* he omi counters Version 1 */
  3747. #define HE_OMI_COUNTERS_V1 (1)
  3748. typedef struct wl_he_omi_cnt_wlc_v1 {
  3749. uint16 version;
  3750. uint16 len;
  3751. uint32 he_omitx_sched; /* Count for total number of OMIs scheduled */
  3752. uint32 he_omitx_success; /* Count for OMI Tx success */
  3753. uint32 he_omitx_retries; /* Count for OMI retries as TxDone not set */
  3754. uint32 he_omitx_dur; /* Accumulated duration of OMI completion time */
  3755. uint32 he_omitx_ulmucfg; /* count for UL MU enable/disable change req */
  3756. uint32 he_omitx_ulmucfg_ack; /* count for UL MU enable/disable req txed successfully */
  3757. uint32 he_omitx_txnsts; /* count for Txnsts change req */
  3758. uint32 he_omitx_txnsts_ack; /* count for Txnsts change req txed successfully */
  3759. uint32 he_omitx_rxnss; /* count for Rxnss change req */
  3760. uint32 he_omitx_rxnss_ack; /* count for Rxnss change req txed successfully */
  3761. uint32 he_omitx_bw; /* count for BW change req */
  3762. uint32 he_omitx_bw_ack; /* count for BW change req txed successfully */
  3763. uint32 he_omitx_ersudis; /* count for ER SU enable/disable req */
  3764. uint32 he_omitx_ersudis_ack; /* count for ER SU enable/disable req txed successfully */
  3765. uint32 he_omitx_dlmursdrec; /* count for Resound recommendation change req */
  3766. uint32 he_omitx_dlmursdrec_ack; /* count for Resound recommendation req txed successfully */
  3767. } wl_he_omi_cnt_wlc_v1_t;
  3768. /* WL_IFSTATS_XTLV_WL_SLICE_TXBF */
  3769. /* beamforming counters version 1 */
  3770. #define TXBF_ECOUNTERS_V1 (1u)
  3771. #define WL_TXBF_CNT_ARRAY_SZ (8u)
  3772. typedef struct wl_txbf_ecounters_v1 {
  3773. uint16 version;
  3774. uint16 len;
  3775. /* transmit beamforming stats */
  3776. uint16 txndpa; /* null data packet announcements */
  3777. uint16 txndp; /* null data packets */
  3778. uint16 txbfpoll; /* beamforming report polls */
  3779. uint16 txsf; /* subframes */
  3780. uint16 txcwrts; /* contention window rts */
  3781. uint16 txcwcts; /* contention window cts */
  3782. uint16 txbfm;
  3783. /* receive beamforming stats */
  3784. uint16 rxndpa_u; /* unicast NDPAs */
  3785. uint16 rxndpa_m; /* multicast NDPAs */
  3786. uint16 rxbfpoll; /* unicast bf-polls */
  3787. uint16 bferpt; /* beamforming reports */
  3788. uint16 rxsf;
  3789. uint16 rxcwrts;
  3790. uint16 rxcwcts;
  3791. uint16 rxtrig_bfpoll;
  3792. uint16 unused_uint16; /* pad */
  3793. /* sounding stats - interval capture */
  3794. uint16 rxnontb_sound[WL_TXBF_CNT_ARRAY_SZ]; /* non-TB sounding for last 8 captures */
  3795. uint16 rxtb_sound[WL_TXBF_CNT_ARRAY_SZ]; /* TB sounding count for last 8 captures */
  3796. uint32 cap_dur_ms[WL_TXBF_CNT_ARRAY_SZ]; /* last 8 capture durations (in ms) */
  3797. uint32 cap_last_ts; /* timestamp of last sample capture */
  3798. } wl_txbf_ecounters_v1_t;
  3799. /* security vulnerabilities counters */
  3800. typedef struct {
  3801. uint32 ie_unknown; /* number of unknown IEs */
  3802. uint32 ie_invalid_length; /* number of IEs with invalid length */
  3803. uint32 ie_invalid_data; /* number of IEs with invalid data */
  3804. uint32 ipv6_invalid_length; /* number of IPv6 packets with invalid payload length */
  3805. } wl_secvln_cnt_t;
  3806. /* Reinit reasons - do not put anything else other than reinit reasons here */
  3807. typedef struct {
  3808. uint32 rsn[WL_REINIT_RC_LAST];
  3809. } reinit_rsns_t;
  3810. /* MACXSTAT counters for ucodex (corerev >= 64) */
  3811. typedef struct {
  3812. uint32 macxsusp;
  3813. uint32 m2vmsg;
  3814. uint32 v2mmsg;
  3815. uint32 mboxout;
  3816. uint32 musnd;
  3817. uint32 sfb2v;
  3818. } wl_cnt_ge64mcxst_v1_t;
  3819. /** MACSTAT counters for ucode (corerev >= 40) */
  3820. typedef struct {
  3821. /* MAC counters: 32-bit version of d11.h's macstat_t */
  3822. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  3823. * Control Management (includes retransmissions)
  3824. */
  3825. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  3826. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  3827. uint32 txackfrm; /**< number of ACK frames sent out */
  3828. uint32 txdnlfrm; /**< number of Null-Data transmission generated from template */
  3829. uint32 txbcnfrm; /**< beacons transmitted */
  3830. uint32 txfunfl[6]; /**< per-fifo tx underflows */
  3831. uint32 txampdu; /**< number of AMPDUs transmitted */
  3832. uint32 txmpdu; /**< number of MPDUs transmitted */
  3833. uint32 txtplunfl; /**< Template underflows (mac was too slow to transmit ACK/CTS
  3834. * or BCN)
  3835. */
  3836. uint32 txphyerror; /**< Transmit phy error, type of error is reported in tx-status for
  3837. * driver enqueued frames
  3838. */
  3839. uint32 pktengrxducast; /**< unicast frames rxed by the pkteng code */
  3840. uint32 pktengrxdmcast; /**< multicast frames rxed by the pkteng code */
  3841. uint32 rxfrmtoolong; /**< Received frame longer than legal limit (2346 bytes) */
  3842. uint32 rxfrmtooshrt; /**< Received frame did not contain enough bytes for its frame type */
  3843. uint32 rxanyerr; /**< Any RX error that is not counted by other counters. */
  3844. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  3845. uint32 rxbadplcp; /**< parity check of the PLCP header failed */
  3846. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  3847. uint32 rxstrt; /**< Number of received frames with a good PLCP
  3848. * (i.e. passing parity check)
  3849. */
  3850. uint32 rxdtucastmbss; /**< number of received DATA frames with good FCS and matching RA */
  3851. uint32 rxmgucastmbss; /**< number of received mgmt frames with good FCS and matching RA */
  3852. uint32 rxctlucast; /**< number of received CNTRL frames with good FCS and matching RA */
  3853. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  3854. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  3855. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  3856. uint32 rxdtocast; /**< number of received DATA frames (good FCS and not matching RA) */
  3857. uint32 rxmgocast; /**< number of received MGMT frames (good FCS and not matching RA) */
  3858. uint32 rxctlocast; /**< number of received CNTRL frame (good FCS and not matching RA) */
  3859. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  3860. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  3861. uint32 rxdtmcast; /**< number of RX Data multicast frames received by the MAC */
  3862. uint32 rxmgmcast; /**< number of RX Management multicast frames received by the MAC */
  3863. uint32 rxctlmcast; /**< number of RX Control multicast frames received by the MAC
  3864. * (unlikely to see these)
  3865. */
  3866. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  3867. uint32 rxdtucastobss; /**< number of unicast frames addressed to the MAC from
  3868. * other BSS (WDS FRAME)
  3869. */
  3870. uint32 rxbeaconobss; /**< beacons received from other BSS */
  3871. uint32 rxrsptmout; /**< number of response timeouts for transmitted frames
  3872. * expecting a response
  3873. */
  3874. uint32 bcntxcancl; /**< transmit beacons canceled due to receipt of beacon (IBSS) */
  3875. uint32 rxnodelim; /**< number of no valid delimiter detected by ampdu parser */
  3876. uint32 rxf0ovfl; /**< number of receive fifo 0 overflows */
  3877. uint32 rxf1ovfl; /**< number of receive fifo 1 overflows */
  3878. uint32 rxhlovfl; /**< number of length / header fifo overflows */
  3879. uint32 missbcn_dbg; /**< number of beacon missed to receive */
  3880. uint32 pmqovfl; /**< number of PMQ overflows */
  3881. uint32 rxcgprqfrm; /**< number of received Probe requests that made it into
  3882. * the PRQ fifo
  3883. */
  3884. uint32 rxcgprsqovfl; /**< Rx Probe Request Que overflow in the AP */
  3885. uint32 txcgprsfail; /**< Tx Probe Response Fail. AP sent probe response but did
  3886. * not get ACK
  3887. */
  3888. uint32 txcgprssuc; /**< Tx Probe Response Success (ACK was received) */
  3889. uint32 prs_timeout; /**< number of probe requests that were dropped from the PRQ
  3890. * fifo because a probe response could not be sent out within
  3891. * the time limit defined in M_PRS_MAXTIME
  3892. */
  3893. uint32 txrtsfail; /**< number of rts transmission failure that reach retry limit */
  3894. uint32 txucast; /**< number of unicast tx expecting response other than cts/cwcts */
  3895. uint32 txinrtstxop; /**< number of data frame transmissions during rts txop */
  3896. uint32 rxback; /**< blockack rxcnt */
  3897. uint32 txback; /**< blockack txcnt */
  3898. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  3899. uint32 rxdrop20s; /**< drop secondary cnt */
  3900. uint32 rxtoolate; /**< receive too late */
  3901. uint32 bphy_badplcp; /**< number of bad PLCP reception on BPHY rate */
  3902. /* All counter variables have to be of uint32. */
  3903. } wl_cnt_ge40mcst_v1_t;
  3904. /** MACSTAT counters for ucode (corerev < 40) */
  3905. typedef struct {
  3906. /* MAC counters: 32-bit version of d11.h's macstat_t */
  3907. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  3908. * Control Management (includes retransmissions)
  3909. */
  3910. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  3911. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  3912. uint32 txackfrm; /**< number of ACK frames sent out */
  3913. uint32 txdnlfrm; /**< number of Null-Data transmission generated from template */
  3914. uint32 txbcnfrm; /**< beacons transmitted */
  3915. uint32 txfunfl[6]; /**< per-fifo tx underflows */
  3916. uint32 txampdu; /**< number of AMPDUs transmitted */
  3917. uint32 txmpdu; /**< number of MPDUs transmitted */
  3918. uint32 txtplunfl; /**< Template underflows (mac was too slow to transmit ACK/CTS
  3919. * or BCN)
  3920. */
  3921. uint32 txphyerror; /**< Transmit phy error, type of error is reported in tx-status for
  3922. * driver enqueued frames
  3923. */
  3924. uint32 pktengrxducast; /**< unicast frames rxed by the pkteng code */
  3925. uint32 pktengrxdmcast; /**< multicast frames rxed by the pkteng code */
  3926. uint32 rxfrmtoolong; /**< Received frame longer than legal limit (2346 bytes) */
  3927. uint32 rxfrmtooshrt; /**< Received frame did not contain enough bytes for its frame type */
  3928. uint32 rxanyerr; /**< Any RX error that is not counted by other counters. */
  3929. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  3930. uint32 rxbadplcp; /**< parity check of the PLCP header failed */
  3931. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  3932. uint32 rxstrt; /**< Number of received frames with a good PLCP
  3933. * (i.e. passing parity check)
  3934. */
  3935. uint32 rxdtucastmbss; /**< number of received DATA frames with good FCS and matching RA */
  3936. uint32 rxmgucastmbss; /**< number of received mgmt frames with good FCS and matching RA */
  3937. uint32 rxctlucast; /**< number of received CNTRL frames with good FCS and matching RA */
  3938. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  3939. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  3940. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  3941. uint32 rxdtocast; /**< number of received DATA frames (good FCS and not matching RA) */
  3942. uint32 rxmgocast; /**< number of received MGMT frames (good FCS and not matching RA) */
  3943. uint32 rxctlocast; /**< number of received CNTRL frame (good FCS and not matching RA) */
  3944. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  3945. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  3946. uint32 rxdtmcast; /**< number of RX Data multicast frames received by the MAC */
  3947. uint32 rxmgmcast; /**< number of RX Management multicast frames received by the MAC */
  3948. uint32 rxctlmcast; /**< number of RX Control multicast frames received by the MAC
  3949. * (unlikely to see these)
  3950. */
  3951. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  3952. uint32 rxdtucastobss; /**< number of unicast frames addressed to the MAC from
  3953. * other BSS (WDS FRAME)
  3954. */
  3955. uint32 rxbeaconobss; /**< beacons received from other BSS */
  3956. uint32 rxrsptmout; /**< number of response timeouts for transmitted frames
  3957. * expecting a response
  3958. */
  3959. uint32 bcntxcancl; /**< transmit beacons canceled due to receipt of beacon (IBSS) */
  3960. uint32 rxnodelim; /**< number of no valid delimiter detected by ampdu parser */
  3961. uint32 rxf0ovfl; /**< number of receive fifo 0 overflows */
  3962. uint32 dbgoff46;
  3963. uint32 dbgoff47;
  3964. uint32 dbgoff48; /**< Used for counting txstatus queue overflow (corerev <= 4) */
  3965. uint32 pmqovfl; /**< number of PMQ overflows */
  3966. uint32 rxcgprqfrm; /**< number of received Probe requests that made it into
  3967. * the PRQ fifo
  3968. */
  3969. uint32 rxcgprsqovfl; /**< Rx Probe Request Que overflow in the AP */
  3970. uint32 txcgprsfail; /**< Tx Probe Response Fail. AP sent probe response but did
  3971. * not get ACK
  3972. */
  3973. uint32 txcgprssuc; /**< Tx Probe Response Success (ACK was received) */
  3974. uint32 prs_timeout; /**< number of probe requests that were dropped from the PRQ
  3975. * fifo because a probe response could not be sent out within
  3976. * the time limit defined in M_PRS_MAXTIME
  3977. */
  3978. uint32 txrtsfail; /**< number of rts transmission failure that reach retry limit */
  3979. uint32 txucast; /**< number of unicast tx expecting response other than cts/cwcts */
  3980. uint32 txinrtstxop; /**< number of data frame transmissions during rts txop */
  3981. uint32 rxback; /**< blockack rxcnt */
  3982. uint32 txback; /**< blockack txcnt */
  3983. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  3984. uint32 phywatch;
  3985. uint32 rxtoolate; /**< receive too late */
  3986. uint32 bphy_badplcp; /**< number of bad PLCP reception on BPHY rate */
  3987. /* All counter variables have to be of uint32. */
  3988. } wl_cnt_lt40mcst_v1_t;
  3989. /** MACSTAT counters for ucode (corerev >= 80) */
  3990. typedef struct {
  3991. /* MAC counters: 32-bit version of d11.h's macstat_t */
  3992. /* Start of PSM2HOST stats(72) block */
  3993. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  3994. * Control Management (includes retransmissions)
  3995. */
  3996. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  3997. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  3998. uint32 txackfrm; /**< number of ACK frames sent out */
  3999. uint32 txdnlfrm; /**< number of Null-Data transmission generated from template */
  4000. uint32 txbcnfrm; /**< beacons transmitted */
  4001. uint32 txampdu; /**< number of AMPDUs transmitted */
  4002. uint32 txmpdu; /**< number of MPDUs transmitted */
  4003. uint32 txtplunfl; /**< Template underflows (mac was too slow to transmit ACK/CTS
  4004. * or BCN)
  4005. */
  4006. uint32 txphyerror; /**< Transmit phy error, type of error is reported in tx-status for
  4007. * driver enqueued frames
  4008. */
  4009. uint32 pktengrxducast; /**< unicast frames rxed by the pkteng code */
  4010. uint32 pktengrxdmcast; /**< multicast frames rxed by the pkteng code */
  4011. uint32 rxfrmtoolong; /**< Received frame longer than legal limit (2346 bytes) */
  4012. uint32 rxfrmtooshrt; /**< Received frame did not contain enough bytes for its frame type */
  4013. uint32 rxanyerr; /**< Any RX error that is not counted by other counters. */
  4014. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  4015. uint32 rxbadplcp; /**< parity check of the PLCP header failed */
  4016. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  4017. uint32 rxstrt; /**< Number of received frames with a good PLCP
  4018. * (i.e. passing parity check)
  4019. */
  4020. uint32 rxdtucastmbss; /**< number of received DATA frames with good FCS and matching RA */
  4021. uint32 rxmgucastmbss; /**< number of received mgmt frames with good FCS and matching RA */
  4022. uint32 rxctlucast; /**< number of received CNTRL frames with good FCS and matching RA */
  4023. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  4024. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  4025. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  4026. uint32 rxdtocast; /**< number of received DATA frames (good FCS and not matching RA) */
  4027. uint32 rxmgocast; /**< number of received MGMT frames (good FCS and not matching RA) */
  4028. uint32 rxctlocast; /**< number of received CNTRL frame (good FCS and not matching RA) */
  4029. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  4030. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  4031. uint32 rxdtmcast; /**< number of RX Data multicast frames received by the MAC */
  4032. uint32 rxmgmcast; /**< number of RX Management multicast frames received by the MAC */
  4033. uint32 rxctlmcast; /**< number of RX Control multicast frames received by the MAC
  4034. * (unlikely to see these)
  4035. */
  4036. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  4037. uint32 rxdtucastobss; /**< number of unicast frames addressed to the MAC from
  4038. * other BSS (WDS FRAME)
  4039. */
  4040. uint32 rxbeaconobss; /**< beacons received from other BSS */
  4041. uint32 rxrsptmout; /**< number of response timeouts for transmitted frames
  4042. * expecting a response
  4043. */
  4044. uint32 bcntxcancl; /**< transmit beacons canceled due to receipt of beacon (IBSS) */
  4045. uint32 rxnodelim; /**< number of no valid delimiter detected by ampdu parser */
  4046. uint32 missbcn_dbg; /**< number of beacon missed to receive */
  4047. uint32 pmqovfl; /**< number of PMQ overflows */
  4048. uint32 rxcgprqfrm; /**< number of received Probe requests that made it into
  4049. * the PRQ fifo
  4050. */
  4051. uint32 rxcgprsqovfl; /**< Rx Probe Request Que overflow in the AP */
  4052. uint32 txcgprsfail; /**< Tx Probe Response Fail. AP sent probe response but did
  4053. * not get ACK
  4054. */
  4055. uint32 txcgprssuc; /**< Tx Probe Response Success (ACK was received) */
  4056. uint32 prs_timeout; /**< number of probe requests that were dropped from the PRQ
  4057. * fifo because a probe response could not be sent out within
  4058. * the time limit defined in M_PRS_MAXTIME
  4059. */
  4060. uint32 txrtsfail; /**< number of rts transmission failure that reach retry limit */
  4061. uint32 txucast; /**< number of unicast tx expecting response other than cts/cwcts */
  4062. uint32 txinrtstxop; /**< number of data frame transmissions during rts txop */
  4063. uint32 rxback; /**< blockack rxcnt */
  4064. uint32 txback; /**< blockack txcnt */
  4065. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  4066. uint32 rxdrop20s; /**< drop secondary cnt */
  4067. uint32 rxtoolate; /**< receive too late */
  4068. uint32 bphy_badplcp; /**< number of bad PLCP reception on BPHY rate */
  4069. uint32 rxtrig_myaid; /* New counters added in corerev 80 */
  4070. uint32 rxtrig_rand;
  4071. uint32 goodfcs;
  4072. uint32 colormiss;
  4073. uint32 txmampdu;
  4074. uint32 rxmtidback;
  4075. uint32 rxmstaback;
  4076. uint32 txfrag;
  4077. /* End of PSM2HOST stats block */
  4078. /* start of rxerror overflow counter(24) block which are modified/added in corerev 80 */
  4079. uint32 phyovfl;
  4080. uint32 rxf0ovfl; /**< number of receive fifo 0 overflows */
  4081. uint32 rxf1ovfl; /**< number of receive fifo 1 overflows */
  4082. uint32 lenfovfl;
  4083. uint32 weppeof;
  4084. uint32 badplcp;
  4085. uint32 msduthresh;
  4086. uint32 strmeof;
  4087. uint32 stsfifofull;
  4088. uint32 stsfifoerr;
  4089. uint32 PAD[6];
  4090. uint32 rxerr_stat;
  4091. uint32 ctx_fifo_full;
  4092. uint32 PAD0[9];
  4093. uint32 ctmode_ufc_cnt;
  4094. uint32 PAD1[28]; /* PAD added for counter elements to be added soon */
  4095. } wl_cnt_ge80mcst_v1_t;
  4096. typedef struct {
  4097. uint32 fifocount;
  4098. uint32 txfunfl[];
  4099. } wl_cnt_ge80_txfunfl_v1_t;
  4100. /** MACSTAT counters for "wl counter" version <= 10 */
  4101. /* With ucode before its macstat cnts cleaned up */
  4102. typedef struct {
  4103. /* MAC counters: 32-bit version of d11.h's macstat_t */
  4104. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  4105. * Control Management (includes retransmissions)
  4106. */
  4107. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  4108. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  4109. uint32 txackfrm; /**< number of ACK frames sent out */
  4110. uint32 txdnlfrm; /**< number of Null-Data transmission generated from template */
  4111. uint32 txbcnfrm; /**< beacons transmitted */
  4112. uint32 txfunfl[6]; /**< per-fifo tx underflows */
  4113. uint32 txfbw; /**< transmit at fallback bw (dynamic bw) */
  4114. uint32 PAD0; /**< number of MPDUs transmitted */
  4115. uint32 txtplunfl; /**< Template underflows (mac was too slow to transmit ACK/CTS
  4116. * or BCN)
  4117. */
  4118. uint32 txphyerror; /**< Transmit phy error, type of error is reported in tx-status for
  4119. * driver enqueued frames
  4120. */
  4121. uint32 pktengrxducast; /**< unicast frames rxed by the pkteng code */
  4122. uint32 pktengrxdmcast; /**< multicast frames rxed by the pkteng code */
  4123. uint32 rxfrmtoolong; /**< Received frame longer than legal limit (2346 bytes) */
  4124. uint32 rxfrmtooshrt; /**< Received frame did not contain enough bytes for its frame type */
  4125. uint32 rxinvmachdr; /**< Either the protocol version != 0 or frame type not
  4126. * data/control/management
  4127. */
  4128. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  4129. uint32 rxbadplcp; /**< parity check of the PLCP header failed */
  4130. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  4131. uint32 rxstrt; /**< Number of received frames with a good PLCP
  4132. * (i.e. passing parity check)
  4133. */
  4134. uint32 rxdfrmucastmbss; /* number of received DATA frames with good FCS and matching RA */
  4135. uint32 rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
  4136. uint32 rxcfrmucast; /**< number of received CNTRL frames with good FCS and matching RA */
  4137. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  4138. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  4139. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  4140. uint32 rxdfrmocast; /**< number of received DATA frames (good FCS and not matching RA) */
  4141. uint32 rxmfrmocast; /**< number of received MGMT frames (good FCS and not matching RA) */
  4142. uint32 rxcfrmocast; /**< number of received CNTRL frame (good FCS and not matching RA) */
  4143. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  4144. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  4145. uint32 rxdfrmmcast; /**< number of RX Data multicast frames received by the MAC */
  4146. uint32 rxmfrmmcast; /**< number of RX Management multicast frames received by the MAC */
  4147. uint32 rxcfrmmcast; /**< number of RX Control multicast frames received by the MAC
  4148. * (unlikely to see these)
  4149. */
  4150. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  4151. uint32 rxdfrmucastobss; /**< number of unicast frames addressed to the MAC from
  4152. * other BSS (WDS FRAME)
  4153. */
  4154. uint32 rxbeaconobss; /**< beacons received from other BSS */
  4155. uint32 rxrsptmout; /**< number of response timeouts for transmitted frames
  4156. * expecting a response
  4157. */
  4158. uint32 bcntxcancl; /**< transmit beacons canceled due to receipt of beacon (IBSS) */
  4159. uint32 PAD1;
  4160. uint32 rxf0ovfl; /**< number of receive fifo 0 overflows */
  4161. uint32 rxf1ovfl; /**< Number of receive fifo 1 overflows (obsolete) */
  4162. uint32 rxf2ovfl; /**< Number of receive fifo 2 overflows (obsolete) */
  4163. uint32 txsfovfl; /**< Number of transmit status fifo overflows (obsolete) */
  4164. uint32 pmqovfl; /**< number of PMQ overflows */
  4165. uint32 rxcgprqfrm; /**< number of received Probe requests that made it into
  4166. * the PRQ fifo
  4167. */
  4168. uint32 rxcgprsqovfl; /**< Rx Probe Request Que overflow in the AP */
  4169. uint32 txcgprsfail; /**< Tx Probe Response Fail. AP sent probe response but did
  4170. * not get ACK
  4171. */
  4172. uint32 txcgprssuc; /**< Tx Probe Response Success (ACK was received) */
  4173. uint32 prs_timeout; /**< number of probe requests that were dropped from the PRQ
  4174. * fifo because a probe response could not be sent out within
  4175. * the time limit defined in M_PRS_MAXTIME
  4176. */
  4177. uint32 rxnack; /**< obsolete */
  4178. uint32 frmscons; /**< obsolete */
  4179. uint32 txnack; /**< obsolete */
  4180. uint32 rxback; /**< blockack rxcnt */
  4181. uint32 txback; /**< blockack txcnt */
  4182. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  4183. uint32 rxdrop20s; /**< drop secondary cnt */
  4184. uint32 rxtoolate; /**< receive too late */
  4185. uint32 bphy_badplcp; /**< number of bad PLCP reception on BPHY rate */
  4186. /* All counter variables have to be of uint32. */
  4187. } wl_cnt_v_le10_mcst_t;
  4188. #define MAX_RX_FIFO 3
  4189. #define WL_RXFIFO_CNT_VERSION 1 /* current version of wl_rxfifo_cnt_t */
  4190. typedef struct {
  4191. /* Counters for frames received from rx fifos */
  4192. uint16 version;
  4193. uint16 length; /* length of entire structure */
  4194. uint32 rxf_data[MAX_RX_FIFO]; /* data frames from rx fifo */
  4195. uint32 rxf_mgmtctl[MAX_RX_FIFO]; /* mgmt/ctl frames from rx fifo */
  4196. } wl_rxfifo_cnt_t;
  4197. typedef struct {
  4198. uint16 version; /**< see definition of WL_CNT_T_VERSION */
  4199. uint16 length; /**< length of entire structure */
  4200. /* transmit stat counters */
  4201. uint32 txframe; /**< tx data frames */
  4202. uint32 txbyte; /**< tx data bytes */
  4203. uint32 txretrans; /**< tx mac retransmits */
  4204. uint32 txerror; /**< tx data errors (derived: sum of others) */
  4205. uint32 txctl; /**< tx management frames */
  4206. uint32 txprshort; /**< tx short preamble frames */
  4207. uint32 txserr; /**< tx status errors */
  4208. uint32 txnobuf; /**< tx out of buffers errors */
  4209. uint32 txnoassoc; /**< tx discard because we're not associated */
  4210. uint32 txrunt; /**< tx runt frames */
  4211. uint32 txchit; /**< tx header cache hit (fastpath) */
  4212. uint32 txcmiss; /**< tx header cache miss (slowpath) */
  4213. /* transmit chip error counters */
  4214. uint32 txuflo; /**< tx fifo underflows */
  4215. uint32 txphyerr; /**< tx phy errors (indicated in tx status) */
  4216. uint32 txphycrs;
  4217. /* receive stat counters */
  4218. uint32 rxframe; /**< rx data frames */
  4219. uint32 rxbyte; /**< rx data bytes */
  4220. uint32 rxerror; /**< rx data errors (derived: sum of others) */
  4221. uint32 rxctl; /**< rx management frames */
  4222. uint32 rxnobuf; /**< rx out of buffers errors */
  4223. uint32 rxnondata; /**< rx non data frames in the data channel errors */
  4224. uint32 rxbadds; /**< rx bad DS errors */
  4225. uint32 rxbadcm; /**< rx bad control or management frames */
  4226. uint32 rxfragerr; /**< rx fragmentation errors */
  4227. uint32 rxrunt; /**< rx runt frames */
  4228. uint32 rxgiant; /**< rx giant frames */
  4229. uint32 rxnoscb; /**< rx no scb error */
  4230. uint32 rxbadproto; /**< rx invalid frames */
  4231. uint32 rxbadsrcmac; /**< rx frames with Invalid Src Mac */
  4232. uint32 rxbadda; /**< rx frames tossed for invalid da */
  4233. uint32 rxfilter; /**< rx frames filtered out */
  4234. /* receive chip error counters */
  4235. uint32 rxoflo; /**< rx fifo overflow errors */
  4236. uint32 rxuflo[NFIFO]; /**< rx dma descriptor underflow errors */
  4237. uint32 d11cnt_txrts_off; /**< d11cnt txrts value when reset d11cnt */
  4238. uint32 d11cnt_rxcrc_off; /**< d11cnt rxcrc value when reset d11cnt */
  4239. uint32 d11cnt_txnocts_off; /**< d11cnt txnocts value when reset d11cnt */
  4240. /* misc counters */
  4241. uint32 dmade; /**< tx/rx dma descriptor errors */
  4242. uint32 dmada; /**< tx/rx dma data errors */
  4243. uint32 dmape; /**< tx/rx dma descriptor protocol errors */
  4244. uint32 reset; /**< reset count */
  4245. uint32 tbtt; /**< cnts the TBTT int's */
  4246. uint32 txdmawar;
  4247. uint32 pkt_callback_reg_fail; /**< callbacks register failure */
  4248. /* MAC counters: 32-bit version of d11.h's macstat_t */
  4249. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  4250. * Control Management (includes retransmissions)
  4251. */
  4252. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  4253. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  4254. uint32 txackfrm; /**< number of ACK frames sent out */
  4255. uint32 txdnlfrm; /**< Not used */
  4256. uint32 txbcnfrm; /**< beacons transmitted */
  4257. uint32 txfunfl[6]; /**< per-fifo tx underflows */
  4258. uint32 rxtoolate; /**< receive too late */
  4259. uint32 txfbw; /**< transmit at fallback bw (dynamic bw) */
  4260. uint32 txtplunfl; /**< Template underflows (mac was too slow to transmit ACK/CTS
  4261. * or BCN)
  4262. */
  4263. uint32 txphyerror; /**< Transmit phy error, type of error is reported in tx-status for
  4264. * driver enqueued frames
  4265. */
  4266. uint32 rxfrmtoolong; /**< Received frame longer than legal limit (2346 bytes) */
  4267. uint32 rxfrmtooshrt; /**< Received frame did not contain enough bytes for its frame type */
  4268. uint32 rxinvmachdr; /**< Either the protocol version != 0 or frame type not
  4269. * data/control/management
  4270. */
  4271. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  4272. uint32 rxbadplcp; /**< parity check of the PLCP header failed */
  4273. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  4274. uint32 rxstrt; /**< Number of received frames with a good PLCP
  4275. * (i.e. passing parity check)
  4276. */
  4277. uint32 rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
  4278. uint32 rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
  4279. uint32 rxcfrmucast; /**< number of received CNTRL frames with good FCS and matching RA */
  4280. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  4281. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  4282. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  4283. uint32 rxdfrmocast; /**< number of received DATA frames (good FCS and not matching RA) */
  4284. uint32 rxmfrmocast; /**< number of received MGMT frames (good FCS and not matching RA) */
  4285. uint32 rxcfrmocast; /**< number of received CNTRL frame (good FCS and not matching RA) */
  4286. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  4287. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  4288. uint32 rxdfrmmcast; /**< number of RX Data multicast frames received by the MAC */
  4289. uint32 rxmfrmmcast; /**< number of RX Management multicast frames received by the MAC */
  4290. uint32 rxcfrmmcast; /**< number of RX Control multicast frames received by the MAC
  4291. * (unlikely to see these)
  4292. */
  4293. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  4294. uint32 rxdfrmucastobss; /**< number of unicast frames addressed to the MAC from
  4295. * other BSS (WDS FRAME)
  4296. */
  4297. uint32 rxbeaconobss; /**< beacons received from other BSS */
  4298. uint32 rxrsptmout; /**< Number of response timeouts for transmitted frames
  4299. * expecting a response
  4300. */
  4301. uint32 bcntxcancl; /**< transmit beacons canceled due to receipt of beacon (IBSS) */
  4302. uint32 rxf0ovfl; /**< Number of receive fifo 0 overflows */
  4303. uint32 rxf1ovfl; /**< Number of receive fifo 1 overflows (obsolete) */
  4304. uint32 rxf2ovfl; /**< Number of receive fifo 2 overflows (obsolete) */
  4305. uint32 txsfovfl; /**< Number of transmit status fifo overflows (obsolete) */
  4306. uint32 pmqovfl; /**< Number of PMQ overflows */
  4307. uint32 rxcgprqfrm; /**< Number of received Probe requests that made it into
  4308. * the PRQ fifo
  4309. */
  4310. uint32 rxcgprsqovfl; /**< Rx Probe Request Que overflow in the AP */
  4311. uint32 txcgprsfail; /**< Tx Probe Response Fail. AP sent probe response but did
  4312. * not get ACK
  4313. */
  4314. uint32 txcgprssuc; /**< Tx Probe Response Success (ACK was received) */
  4315. uint32 prs_timeout; /**< Number of probe requests that were dropped from the PRQ
  4316. * fifo because a probe response could not be sent out within
  4317. * the time limit defined in M_PRS_MAXTIME
  4318. */
  4319. uint32 rxnack; /**< obsolete */
  4320. uint32 frmscons; /**< obsolete */
  4321. uint32 txnack; /**< obsolete */
  4322. uint32 rxback; /**< blockack rxcnt */
  4323. uint32 txback; /**< blockack txcnt */
  4324. /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
  4325. uint32 txfrag; /**< dot11TransmittedFragmentCount */
  4326. uint32 txmulti; /**< dot11MulticastTransmittedFrameCount */
  4327. uint32 txfail; /**< dot11FailedCount */
  4328. uint32 txretry; /**< dot11RetryCount */
  4329. uint32 txretrie; /**< dot11MultipleRetryCount */
  4330. uint32 rxdup; /**< dot11FrameduplicateCount */
  4331. uint32 txrts; /**< dot11RTSSuccessCount */
  4332. uint32 txnocts; /**< dot11RTSFailureCount */
  4333. uint32 txnoack; /**< dot11ACKFailureCount */
  4334. uint32 rxfrag; /**< dot11ReceivedFragmentCount */
  4335. uint32 rxmulti; /**< dot11MulticastReceivedFrameCount */
  4336. uint32 rxcrc; /**< dot11FCSErrorCount */
  4337. uint32 txfrmsnt; /**< dot11TransmittedFrameCount (bogus MIB?) */
  4338. uint32 rxundec; /**< dot11WEPUndecryptableCount */
  4339. /* WPA2 counters (see rxundec for DecryptFailureCount) */
  4340. uint32 tkipmicfaill; /**< TKIPLocalMICFailures */
  4341. uint32 tkipcntrmsr; /**< TKIPCounterMeasuresInvoked */
  4342. uint32 tkipreplay; /**< TKIPReplays */
  4343. uint32 ccmpfmterr; /**< CCMPFormatErrors */
  4344. uint32 ccmpreplay; /**< CCMPReplays */
  4345. uint32 ccmpundec; /**< CCMPDecryptErrors */
  4346. uint32 fourwayfail; /**< FourWayHandshakeFailures */
  4347. uint32 wepundec; /**< dot11WEPUndecryptableCount */
  4348. uint32 wepicverr; /**< dot11WEPICVErrorCount */
  4349. uint32 decsuccess; /**< DecryptSuccessCount */
  4350. uint32 tkipicverr; /**< TKIPICVErrorCount */
  4351. uint32 wepexcluded; /**< dot11WEPExcludedCount */
  4352. uint32 txchanrej; /**< Tx frames suppressed due to channel rejection */
  4353. uint32 psmwds; /**< Count PSM watchdogs */
  4354. uint32 phywatchdog; /**< Count Phy watchdogs (triggered by ucode) */
  4355. /* MBSS counters, AP only */
  4356. uint32 prq_entries_handled; /**< PRQ entries read in */
  4357. uint32 prq_undirected_entries; /**< which were bcast bss & ssid */
  4358. uint32 prq_bad_entries; /**< which could not be translated to info */
  4359. uint32 atim_suppress_count; /**< TX suppressions on ATIM fifo */
  4360. uint32 bcn_template_not_ready; /**< Template marked in use on send bcn ... */
  4361. uint32 bcn_template_not_ready_done; /**< ...but "DMA done" interrupt rcvd */
  4362. uint32 late_tbtt_dpc; /**< TBTT DPC did not happen in time */
  4363. /* per-rate receive stat counters */
  4364. uint32 rx1mbps; /**< packets rx at 1Mbps */
  4365. uint32 rx2mbps; /**< packets rx at 2Mbps */
  4366. uint32 rx5mbps5; /**< packets rx at 5.5Mbps */
  4367. uint32 rx6mbps; /**< packets rx at 6Mbps */
  4368. uint32 rx9mbps; /**< packets rx at 9Mbps */
  4369. uint32 rx11mbps; /**< packets rx at 11Mbps */
  4370. uint32 rx12mbps; /**< packets rx at 12Mbps */
  4371. uint32 rx18mbps; /**< packets rx at 18Mbps */
  4372. uint32 rx24mbps; /**< packets rx at 24Mbps */
  4373. uint32 rx36mbps; /**< packets rx at 36Mbps */
  4374. uint32 rx48mbps; /**< packets rx at 48Mbps */
  4375. uint32 rx54mbps; /**< packets rx at 54Mbps */
  4376. uint32 rx108mbps; /**< packets rx at 108mbps */
  4377. uint32 rx162mbps; /**< packets rx at 162mbps */
  4378. uint32 rx216mbps; /**< packets rx at 216 mbps */
  4379. uint32 rx270mbps; /**< packets rx at 270 mbps */
  4380. uint32 rx324mbps; /**< packets rx at 324 mbps */
  4381. uint32 rx378mbps; /**< packets rx at 378 mbps */
  4382. uint32 rx432mbps; /**< packets rx at 432 mbps */
  4383. uint32 rx486mbps; /**< packets rx at 486 mbps */
  4384. uint32 rx540mbps; /**< packets rx at 540 mbps */
  4385. /* pkteng rx frame stats */
  4386. uint32 pktengrxducast; /**< unicast frames rxed by the pkteng code */
  4387. uint32 pktengrxdmcast; /**< multicast frames rxed by the pkteng code */
  4388. uint32 rfdisable; /**< count of radio disables */
  4389. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  4390. uint32 bphy_badplcp;
  4391. uint32 txexptime; /**< Tx frames suppressed due to timer expiration */
  4392. uint32 txmpdu_sgi; /**< count for sgi transmit */
  4393. uint32 rxmpdu_sgi; /**< count for sgi received */
  4394. uint32 txmpdu_stbc; /**< count for stbc transmit */
  4395. uint32 rxmpdu_stbc; /**< count for stbc received */
  4396. uint32 rxundec_mcst; /**< dot11WEPUndecryptableCount */
  4397. /* WPA2 counters (see rxundec for DecryptFailureCount) */
  4398. uint32 tkipmicfaill_mcst; /**< TKIPLocalMICFailures */
  4399. uint32 tkipcntrmsr_mcst; /**< TKIPCounterMeasuresInvoked */
  4400. uint32 tkipreplay_mcst; /**< TKIPReplays */
  4401. uint32 ccmpfmterr_mcst; /**< CCMPFormatErrors */
  4402. uint32 ccmpreplay_mcst; /**< CCMPReplays */
  4403. uint32 ccmpundec_mcst; /**< CCMPDecryptErrors */
  4404. uint32 fourwayfail_mcst; /**< FourWayHandshakeFailures */
  4405. uint32 wepundec_mcst; /**< dot11WEPUndecryptableCount */
  4406. uint32 wepicverr_mcst; /**< dot11WEPICVErrorCount */
  4407. uint32 decsuccess_mcst; /**< DecryptSuccessCount */
  4408. uint32 tkipicverr_mcst; /**< TKIPICVErrorCount */
  4409. uint32 wepexcluded_mcst; /**< dot11WEPExcludedCount */
  4410. uint32 dma_hang; /**< count for dma hang */
  4411. uint32 reinit; /**< count for reinit */
  4412. uint32 pstatxucast; /**< count of ucast frames xmitted on all psta assoc */
  4413. uint32 pstatxnoassoc; /**< count of txnoassoc frames xmitted on all psta assoc */
  4414. uint32 pstarxucast; /**< count of ucast frames received on all psta assoc */
  4415. uint32 pstarxbcmc; /**< count of bcmc frames received on all psta */
  4416. uint32 pstatxbcmc; /**< count of bcmc frames transmitted on all psta */
  4417. uint32 cso_passthrough; /**< hw cso required but passthrough */
  4418. uint32 cso_normal; /**< hw cso hdr for normal process */
  4419. uint32 chained; /**< number of frames chained */
  4420. uint32 chainedsz1; /**< number of chain size 1 frames */
  4421. uint32 unchained; /**< number of frames not chained */
  4422. uint32 maxchainsz; /**< max chain size so far */
  4423. uint32 currchainsz; /**< current chain size */
  4424. uint32 rxdrop20s; /**< drop secondary cnt */
  4425. uint32 pciereset; /**< Secondary Bus Reset issued by driver */
  4426. uint32 cfgrestore; /**< configspace restore by driver */
  4427. uint32 reinitreason[NREINITREASONCOUNT]; /**< reinitreason counters; 0: Unknown reason */
  4428. uint32 rxrtry; /**< num of received packets with retry bit on */
  4429. uint32 txmpdu; /**< macstat cnt only valid in ver 11. number of MPDUs txed. */
  4430. uint32 rxnodelim; /**< macstat cnt only valid in ver 11.
  4431. * number of occasions that no valid delimiter is detected
  4432. * by ampdu parser.
  4433. */
  4434. uint32 rxmpdu_mu; /**< Number of MU MPDUs received */
  4435. /* detailed control/management frames */
  4436. uint32 txbar; /**< Number of TX BAR */
  4437. uint32 rxbar; /**< Number of RX BAR */
  4438. uint32 txpspoll; /**< Number of TX PS-poll */
  4439. uint32 rxpspoll; /**< Number of RX PS-poll */
  4440. uint32 txnull; /**< Number of TX NULL_DATA */
  4441. uint32 rxnull; /**< Number of RX NULL_DATA */
  4442. uint32 txqosnull; /**< Number of TX NULL_QoSDATA */
  4443. uint32 rxqosnull; /**< Number of RX NULL_QoSDATA */
  4444. uint32 txassocreq; /**< Number of TX ASSOC request */
  4445. uint32 rxassocreq; /**< Number of RX ASSOC request */
  4446. uint32 txreassocreq; /**< Number of TX REASSOC request */
  4447. uint32 rxreassocreq; /**< Number of RX REASSOC request */
  4448. uint32 txdisassoc; /**< Number of TX DISASSOC */
  4449. uint32 rxdisassoc; /**< Number of RX DISASSOC */
  4450. uint32 txassocrsp; /**< Number of TX ASSOC response */
  4451. uint32 rxassocrsp; /**< Number of RX ASSOC response */
  4452. uint32 txreassocrsp; /**< Number of TX REASSOC response */
  4453. uint32 rxreassocrsp; /**< Number of RX REASSOC response */
  4454. uint32 txauth; /**< Number of TX AUTH */
  4455. uint32 rxauth; /**< Number of RX AUTH */
  4456. uint32 txdeauth; /**< Number of TX DEAUTH */
  4457. uint32 rxdeauth; /**< Number of RX DEAUTH */
  4458. uint32 txprobereq; /**< Number of TX probe request */
  4459. uint32 rxprobereq; /**< Number of RX probe request */
  4460. uint32 txprobersp; /**< Number of TX probe response */
  4461. uint32 rxprobersp; /**< Number of RX probe response */
  4462. uint32 txaction; /**< Number of TX action frame */
  4463. uint32 rxaction; /**< Number of RX action frame */
  4464. uint32 ampdu_wds; /**< Number of AMPDU watchdogs */
  4465. uint32 txlost; /**< Number of lost packets reported in txs */
  4466. uint32 txdatamcast; /**< Number of TX multicast data packets */
  4467. uint32 txdatabcast; /**< Number of TX broadcast data packets */
  4468. uint32 txbcast; /* Broadcast TransmittedFrameCount */
  4469. uint32 txdropped; /* tx dropped pkts */
  4470. uint32 rxbcast; /* BroadcastReceivedFrameCount */
  4471. uint32 rxdropped; /* rx dropped pkts (derived: sum of others) */
  4472. /* This structure is deprecated and used only for ver <= 11.
  4473. * All counter variables have to be of uint32.
  4474. * Please refer to the following twiki before editing.
  4475. * http://hwnbu-twiki.sj.broadcom.com/bin/view/
  4476. * Mwgroup/WlCounters#wlc_layer_counters_non_xTLV
  4477. */
  4478. } wl_cnt_ver_11_t;
  4479. typedef struct {
  4480. uint16 version; /* see definition of WL_CNT_T_VERSION */
  4481. uint16 length; /* length of entire structure */
  4482. /* transmit stat counters */
  4483. uint32 txframe; /* tx data frames */
  4484. uint32 txbyte; /* tx data bytes */
  4485. uint32 txretrans; /* tx mac retransmits */
  4486. uint32 txerror; /* tx data errors (derived: sum of others) */
  4487. uint32 txctl; /* tx management frames */
  4488. uint32 txprshort; /* tx short preamble frames */
  4489. uint32 txserr; /* tx status errors */
  4490. uint32 txnobuf; /* tx out of buffers errors */
  4491. uint32 txnoassoc; /* tx discard because we're not associated */
  4492. uint32 txrunt; /* tx runt frames */
  4493. uint32 txchit; /* tx header cache hit (fastpath) */
  4494. uint32 txcmiss; /* tx header cache miss (slowpath) */
  4495. /* transmit chip error counters */
  4496. uint32 txuflo; /* tx fifo underflows */
  4497. uint32 txphyerr; /* tx phy errors (indicated in tx status) */
  4498. uint32 txphycrs;
  4499. /* receive stat counters */
  4500. uint32 rxframe; /* rx data frames */
  4501. uint32 rxbyte; /* rx data bytes */
  4502. uint32 rxerror; /* rx data errors (derived: sum of others) */
  4503. uint32 rxctl; /* rx management frames */
  4504. uint32 rxnobuf; /* rx out of buffers errors */
  4505. uint32 rxnondata; /* rx non data frames in the data channel errors */
  4506. uint32 rxbadds; /* rx bad DS errors */
  4507. uint32 rxbadcm; /* rx bad control or management frames */
  4508. uint32 rxfragerr; /* rx fragmentation errors */
  4509. uint32 rxrunt; /* rx runt frames */
  4510. uint32 rxgiant; /* rx giant frames */
  4511. uint32 rxnoscb; /* rx no scb error */
  4512. uint32 rxbadproto; /* rx invalid frames */
  4513. uint32 rxbadsrcmac; /* rx frames with Invalid Src Mac */
  4514. uint32 rxbadda; /* rx frames tossed for invalid da */
  4515. uint32 rxfilter; /* rx frames filtered out */
  4516. /* receive chip error counters */
  4517. uint32 rxoflo; /* rx fifo overflow errors */
  4518. uint32 rxuflo[NFIFO]; /* rx dma descriptor underflow errors */
  4519. uint32 d11cnt_txrts_off; /* d11cnt txrts value when reset d11cnt */
  4520. uint32 d11cnt_rxcrc_off; /* d11cnt rxcrc value when reset d11cnt */
  4521. uint32 d11cnt_txnocts_off; /* d11cnt txnocts value when reset d11cnt */
  4522. /* misc counters */
  4523. uint32 dmade; /* tx/rx dma descriptor errors */
  4524. uint32 dmada; /* tx/rx dma data errors */
  4525. uint32 dmape; /* tx/rx dma descriptor protocol errors */
  4526. uint32 reset; /* reset count */
  4527. uint32 tbtt; /* cnts the TBTT int's */
  4528. uint32 txdmawar;
  4529. uint32 pkt_callback_reg_fail; /* callbacks register failure */
  4530. /* MAC counters: 32-bit version of d11.h's macstat_t */
  4531. uint32 txallfrm; /* total number of frames sent, incl. Data, ACK, RTS, CTS,
  4532. * Control Management (includes retransmissions)
  4533. */
  4534. uint32 txrtsfrm; /* number of RTS sent out by the MAC */
  4535. uint32 txctsfrm; /* number of CTS sent out by the MAC */
  4536. uint32 txackfrm; /* number of ACK frames sent out */
  4537. uint32 txdnlfrm; /* Not used */
  4538. uint32 txbcnfrm; /* beacons transmitted */
  4539. uint32 txfunfl[8]; /* per-fifo tx underflows */
  4540. uint32 txtplunfl; /* Template underflows (mac was too slow to transmit ACK/CTS
  4541. * or BCN)
  4542. */
  4543. uint32 txphyerror; /* Transmit phy error, type of error is reported in tx-status for
  4544. * driver enqueued frames
  4545. */
  4546. uint32 rxfrmtoolong; /* Received frame longer than legal limit (2346 bytes) */
  4547. uint32 rxfrmtooshrt; /* Received frame did not contain enough bytes for its frame type */
  4548. uint32 rxinvmachdr; /* Either the protocol version != 0 or frame type not
  4549. * data/control/management
  4550. */
  4551. uint32 rxbadfcs; /* number of frames for which the CRC check failed in the MAC */
  4552. uint32 rxbadplcp; /* parity check of the PLCP header failed */
  4553. uint32 rxcrsglitch; /* PHY was able to correlate the preamble but not the header */
  4554. uint32 rxstrt; /* Number of received frames with a good PLCP
  4555. * (i.e. passing parity check)
  4556. */
  4557. uint32 rxdfrmucastmbss; /* Number of received DATA frames with good FCS and matching RA */
  4558. uint32 rxmfrmucastmbss; /* number of received mgmt frames with good FCS and matching RA */
  4559. uint32 rxcfrmucast; /* number of received CNTRL frames with good FCS and matching RA */
  4560. uint32 rxrtsucast; /* number of unicast RTS addressed to the MAC (good FCS) */
  4561. uint32 rxctsucast; /* number of unicast CTS addressed to the MAC (good FCS) */
  4562. uint32 rxackucast; /* number of ucast ACKS received (good FCS) */
  4563. uint32 rxdfrmocast; /* number of received DATA frames (good FCS and not matching RA) */
  4564. uint32 rxmfrmocast; /* number of received MGMT frames (good FCS and not matching RA) */
  4565. uint32 rxcfrmocast; /* number of received CNTRL frame (good FCS and not matching RA) */
  4566. uint32 rxrtsocast; /* number of received RTS not addressed to the MAC */
  4567. uint32 rxctsocast; /* number of received CTS not addressed to the MAC */
  4568. uint32 rxdfrmmcast; /* number of RX Data multicast frames received by the MAC */
  4569. uint32 rxmfrmmcast; /* number of RX Management multicast frames received by the MAC */
  4570. uint32 rxcfrmmcast; /* number of RX Control multicast frames received by the MAC
  4571. * (unlikely to see these)
  4572. */
  4573. uint32 rxbeaconmbss; /* beacons received from member of BSS */
  4574. uint32 rxdfrmucastobss; /* number of unicast frames addressed to the MAC from
  4575. * other BSS (WDS FRAME)
  4576. */
  4577. uint32 rxbeaconobss; /* beacons received from other BSS */
  4578. uint32 rxrsptmout; /* Number of response timeouts for transmitted frames
  4579. * expecting a response
  4580. */
  4581. uint32 bcntxcancl; /* transmit beacons canceled due to receipt of beacon (IBSS) */
  4582. uint32 rxf0ovfl; /* Number of receive fifo 0 overflows */
  4583. uint32 rxf1ovfl; /* Number of receive fifo 1 overflows (obsolete) */
  4584. uint32 rxf2ovfl; /* Number of receive fifo 2 overflows (obsolete) */
  4585. uint32 txsfovfl; /* Number of transmit status fifo overflows (obsolete) */
  4586. uint32 pmqovfl; /* Number of PMQ overflows */
  4587. uint32 rxcgprqfrm; /* Number of received Probe requests that made it into
  4588. * the PRQ fifo
  4589. */
  4590. uint32 rxcgprsqovfl; /* Rx Probe Request Que overflow in the AP */
  4591. uint32 txcgprsfail; /* Tx Probe Response Fail. AP sent probe response but did
  4592. * not get ACK
  4593. */
  4594. uint32 txcgprssuc; /* Tx Probe Response Success (ACK was received) */
  4595. uint32 prs_timeout; /* Number of probe requests that were dropped from the PRQ
  4596. * fifo because a probe response could not be sent out within
  4597. * the time limit defined in M_PRS_MAXTIME
  4598. */
  4599. uint32 rxnack; /* obsolete */
  4600. uint32 frmscons; /* obsolete */
  4601. uint32 txnack; /* obsolete */
  4602. uint32 txglitch_nack; /* obsolete */
  4603. uint32 txburst; /* obsolete */
  4604. /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
  4605. uint32 txfrag; /* dot11TransmittedFragmentCount */
  4606. uint32 txmulti; /* dot11MulticastTransmittedFrameCount */
  4607. uint32 txfail; /* dot11FailedCount */
  4608. uint32 txretry; /* dot11RetryCount */
  4609. uint32 txretrie; /* dot11MultipleRetryCount */
  4610. uint32 rxdup; /* dot11FrameduplicateCount */
  4611. uint32 txrts; /* dot11RTSSuccessCount */
  4612. uint32 txnocts; /* dot11RTSFailureCount */
  4613. uint32 txnoack; /* dot11ACKFailureCount */
  4614. uint32 rxfrag; /* dot11ReceivedFragmentCount */
  4615. uint32 rxmulti; /* dot11MulticastReceivedFrameCount */
  4616. uint32 rxcrc; /* dot11FCSErrorCount */
  4617. uint32 txfrmsnt; /* dot11TransmittedFrameCount (bogus MIB?) */
  4618. uint32 rxundec; /* dot11WEPUndecryptableCount */
  4619. /* WPA2 counters (see rxundec for DecryptFailureCount) */
  4620. uint32 tkipmicfaill; /* TKIPLocalMICFailures */
  4621. uint32 tkipcntrmsr; /* TKIPCounterMeasuresInvoked */
  4622. uint32 tkipreplay; /* TKIPReplays */
  4623. uint32 ccmpfmterr; /* CCMPFormatErrors */
  4624. uint32 ccmpreplay; /* CCMPReplays */
  4625. uint32 ccmpundec; /* CCMPDecryptErrors */
  4626. uint32 fourwayfail; /* FourWayHandshakeFailures */
  4627. uint32 wepundec; /* dot11WEPUndecryptableCount */
  4628. uint32 wepicverr; /* dot11WEPICVErrorCount */
  4629. uint32 decsuccess; /* DecryptSuccessCount */
  4630. uint32 tkipicverr; /* TKIPICVErrorCount */
  4631. uint32 wepexcluded; /* dot11WEPExcludedCount */
  4632. uint32 txchanrej; /* Tx frames suppressed due to channel rejection */
  4633. uint32 psmwds; /* Count PSM watchdogs */
  4634. uint32 phywatchdog; /* Count Phy watchdogs (triggered by ucode) */
  4635. /* MBSS counters, AP only */
  4636. uint32 prq_entries_handled; /* PRQ entries read in */
  4637. uint32 prq_undirected_entries; /* which were bcast bss & ssid */
  4638. uint32 prq_bad_entries; /* which could not be translated to info */
  4639. uint32 atim_suppress_count; /* TX suppressions on ATIM fifo */
  4640. uint32 bcn_template_not_ready; /* Template marked in use on send bcn ... */
  4641. uint32 bcn_template_not_ready_done; /* ...but "DMA done" interrupt rcvd */
  4642. uint32 late_tbtt_dpc; /* TBTT DPC did not happen in time */
  4643. /* per-rate receive stat counters */
  4644. uint32 rx1mbps; /* packets rx at 1Mbps */
  4645. uint32 rx2mbps; /* packets rx at 2Mbps */
  4646. uint32 rx5mbps5; /* packets rx at 5.5Mbps */
  4647. uint32 rx6mbps; /* packets rx at 6Mbps */
  4648. uint32 rx9mbps; /* packets rx at 9Mbps */
  4649. uint32 rx11mbps; /* packets rx at 11Mbps */
  4650. uint32 rx12mbps; /* packets rx at 12Mbps */
  4651. uint32 rx18mbps; /* packets rx at 18Mbps */
  4652. uint32 rx24mbps; /* packets rx at 24Mbps */
  4653. uint32 rx36mbps; /* packets rx at 36Mbps */
  4654. uint32 rx48mbps; /* packets rx at 48Mbps */
  4655. uint32 rx54mbps; /* packets rx at 54Mbps */
  4656. uint32 rx108mbps; /* packets rx at 108mbps */
  4657. uint32 rx162mbps; /* packets rx at 162mbps */
  4658. uint32 rx216mbps; /* packets rx at 216 mbps */
  4659. uint32 rx270mbps; /* packets rx at 270 mbps */
  4660. uint32 rx324mbps; /* packets rx at 324 mbps */
  4661. uint32 rx378mbps; /* packets rx at 378 mbps */
  4662. uint32 rx432mbps; /* packets rx at 432 mbps */
  4663. uint32 rx486mbps; /* packets rx at 486 mbps */
  4664. uint32 rx540mbps; /* packets rx at 540 mbps */
  4665. /* pkteng rx frame stats */
  4666. uint32 pktengrxducast; /* unicast frames rxed by the pkteng code */
  4667. uint32 pktengrxdmcast; /* multicast frames rxed by the pkteng code */
  4668. uint32 rfdisable; /* count of radio disables */
  4669. uint32 bphy_rxcrsglitch; /* PHY count of bphy glitches */
  4670. uint32 txexptime; /* Tx frames suppressed due to timer expiration */
  4671. uint32 txmpdu_sgi; /* count for sgi transmit */
  4672. uint32 rxmpdu_sgi; /* count for sgi received */
  4673. uint32 txmpdu_stbc; /* count for stbc transmit */
  4674. uint32 rxmpdu_stbc; /* count for stbc received */
  4675. uint32 rxundec_mcst; /* dot11WEPUndecryptableCount */
  4676. /* WPA2 counters (see rxundec for DecryptFailureCount) */
  4677. uint32 tkipmicfaill_mcst; /* TKIPLocalMICFailures */
  4678. uint32 tkipcntrmsr_mcst; /* TKIPCounterMeasuresInvoked */
  4679. uint32 tkipreplay_mcst; /* TKIPReplays */
  4680. uint32 ccmpfmterr_mcst; /* CCMPFormatErrors */
  4681. uint32 ccmpreplay_mcst; /* CCMPReplays */
  4682. uint32 ccmpundec_mcst; /* CCMPDecryptErrors */
  4683. uint32 fourwayfail_mcst; /* FourWayHandshakeFailures */
  4684. uint32 wepundec_mcst; /* dot11WEPUndecryptableCount */
  4685. uint32 wepicverr_mcst; /* dot11WEPICVErrorCount */
  4686. uint32 decsuccess_mcst; /* DecryptSuccessCount */
  4687. uint32 tkipicverr_mcst; /* TKIPICVErrorCount */
  4688. uint32 wepexcluded_mcst; /* dot11WEPExcludedCount */
  4689. uint32 dma_hang; /* count for stbc received */
  4690. uint32 rxrtry; /* number of packets with retry bit set to 1 */
  4691. } wl_cnt_ver_7_t;
  4692. typedef struct {
  4693. uint16 version; /**< see definition of WL_CNT_T_VERSION */
  4694. uint16 length; /**< length of entire structure */
  4695. /* transmit stat counters */
  4696. uint32 txframe; /**< tx data frames */
  4697. uint32 txbyte; /**< tx data bytes */
  4698. uint32 txretrans; /**< tx mac retransmits */
  4699. uint32 txerror; /**< tx data errors (derived: sum of others) */
  4700. uint32 txctl; /**< tx management frames */
  4701. uint32 txprshort; /**< tx short preamble frames */
  4702. uint32 txserr; /**< tx status errors */
  4703. uint32 txnobuf; /**< tx out of buffers errors */
  4704. uint32 txnoassoc; /**< tx discard because we're not associated */
  4705. uint32 txrunt; /**< tx runt frames */
  4706. uint32 txchit; /**< tx header cache hit (fastpath) */
  4707. uint32 txcmiss; /**< tx header cache miss (slowpath) */
  4708. /* transmit chip error counters */
  4709. uint32 txuflo; /**< tx fifo underflows */
  4710. uint32 txphyerr; /**< tx phy errors (indicated in tx status) */
  4711. uint32 txphycrs;
  4712. /* receive stat counters */
  4713. uint32 rxframe; /**< rx data frames */
  4714. uint32 rxbyte; /**< rx data bytes */
  4715. uint32 rxerror; /**< rx data errors (derived: sum of others) */
  4716. uint32 rxctl; /**< rx management frames */
  4717. uint32 rxnobuf; /**< rx out of buffers errors */
  4718. uint32 rxnondata; /**< rx non data frames in the data channel errors */
  4719. uint32 rxbadds; /**< rx bad DS errors */
  4720. uint32 rxbadcm; /**< rx bad control or management frames */
  4721. uint32 rxfragerr; /**< rx fragmentation errors */
  4722. uint32 rxrunt; /**< rx runt frames */
  4723. uint32 rxgiant; /**< rx giant frames */
  4724. uint32 rxnoscb; /**< rx no scb error */
  4725. uint32 rxbadproto; /**< rx invalid frames */
  4726. uint32 rxbadsrcmac; /**< rx frames with Invalid Src Mac */
  4727. uint32 rxbadda; /**< rx frames tossed for invalid da */
  4728. uint32 rxfilter; /**< rx frames filtered out */
  4729. /* receive chip error counters */
  4730. uint32 rxoflo; /**< rx fifo overflow errors */
  4731. uint32 rxuflo[NFIFO]; /**< rx dma descriptor underflow errors */
  4732. uint32 d11cnt_txrts_off; /**< d11cnt txrts value when reset d11cnt */
  4733. uint32 d11cnt_rxcrc_off; /**< d11cnt rxcrc value when reset d11cnt */
  4734. uint32 d11cnt_txnocts_off; /**< d11cnt txnocts value when reset d11cnt */
  4735. /* misc counters */
  4736. uint32 dmade; /**< tx/rx dma descriptor errors */
  4737. uint32 dmada; /**< tx/rx dma data errors */
  4738. uint32 dmape; /**< tx/rx dma descriptor protocol errors */
  4739. uint32 reset; /**< reset count */
  4740. uint32 tbtt; /**< cnts the TBTT int's */
  4741. uint32 txdmawar;
  4742. uint32 pkt_callback_reg_fail; /**< callbacks register failure */
  4743. /* MAC counters: 32-bit version of d11.h's macstat_t */
  4744. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  4745. * Control Management (includes retransmissions)
  4746. */
  4747. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  4748. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  4749. uint32 txackfrm; /**< number of ACK frames sent out */
  4750. uint32 txdnlfrm; /**< Not used */
  4751. uint32 txbcnfrm; /**< beacons transmitted */
  4752. uint32 txfunfl[6]; /**< per-fifo tx underflows */
  4753. uint32 rxtoolate; /**< receive too late */
  4754. uint32 txfbw; /**< transmit at fallback bw (dynamic bw) */
  4755. uint32 txtplunfl; /**< Template underflows (mac was too slow to transmit ACK/CTS
  4756. * or BCN)
  4757. */
  4758. uint32 txphyerror; /**< Transmit phy error, type of error is reported in tx-status for
  4759. * driver enqueued frames
  4760. */
  4761. uint32 rxfrmtoolong; /**< Received frame longer than legal limit (2346 bytes) */
  4762. uint32 rxfrmtooshrt; /**< Received frame did not contain enough bytes for its frame type */
  4763. uint32 rxinvmachdr; /**< Either the protocol version != 0 or frame type not
  4764. * data/control/management
  4765. */
  4766. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  4767. uint32 rxbadplcp; /**< parity check of the PLCP header failed */
  4768. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  4769. uint32 rxstrt; /**< Number of received frames with a good PLCP
  4770. * (i.e. passing parity check)
  4771. */
  4772. uint32 rxdfrmucastmbss; /**< # of received DATA frames with good FCS and matching RA */
  4773. uint32 rxmfrmucastmbss; /**< # of received mgmt frames with good FCS and matching RA */
  4774. uint32 rxcfrmucast; /**< # of received CNTRL frames with good FCS and matching RA */
  4775. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  4776. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  4777. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  4778. uint32 rxdfrmocast; /**< # of received DATA frames (good FCS and not matching RA) */
  4779. uint32 rxmfrmocast; /**< # of received MGMT frames (good FCS and not matching RA) */
  4780. uint32 rxcfrmocast; /**< # of received CNTRL frame (good FCS and not matching RA) */
  4781. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  4782. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  4783. uint32 rxdfrmmcast; /**< number of RX Data multicast frames received by the MAC */
  4784. uint32 rxmfrmmcast; /**< number of RX Management multicast frames received by the MAC */
  4785. uint32 rxcfrmmcast; /**< number of RX Control multicast frames received by the MAC
  4786. * (unlikely to see these)
  4787. */
  4788. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  4789. uint32 rxdfrmucastobss; /**< number of unicast frames addressed to the MAC from
  4790. * other BSS (WDS FRAME)
  4791. */
  4792. uint32 rxbeaconobss; /**< beacons received from other BSS */
  4793. uint32 rxrsptmout; /**< Number of response timeouts for transmitted frames
  4794. * expecting a response
  4795. */
  4796. uint32 bcntxcancl; /**< transmit beacons canceled due to receipt of beacon (IBSS) */
  4797. uint32 rxf0ovfl; /**< Number of receive fifo 0 overflows */
  4798. uint32 rxf1ovfl; /**< Number of receive fifo 1 overflows (obsolete) */
  4799. uint32 rxf2ovfl; /**< Number of receive fifo 2 overflows (obsolete) */
  4800. uint32 txsfovfl; /**< Number of transmit status fifo overflows (obsolete) */
  4801. uint32 pmqovfl; /**< Number of PMQ overflows */
  4802. uint32 rxcgprqfrm; /**< Number of received Probe requests that made it into
  4803. * the PRQ fifo
  4804. */
  4805. uint32 rxcgprsqovfl; /**< Rx Probe Request Que overflow in the AP */
  4806. uint32 txcgprsfail; /**< Tx Probe Response Fail. AP sent probe response but did
  4807. * not get ACK
  4808. */
  4809. uint32 txcgprssuc; /**< Tx Probe Response Success (ACK was received) */
  4810. uint32 prs_timeout; /**< Number of probe requests that were dropped from the PRQ
  4811. * fifo because a probe response could not be sent out within
  4812. * the time limit defined in M_PRS_MAXTIME
  4813. */
  4814. uint32 rxnack; /**< Number of NACKS received (Afterburner) */
  4815. uint32 frmscons; /**< Number of frames completed without transmission because of an
  4816. * Afterburner re-queue
  4817. */
  4818. uint32 txnack; /**< obsolete */
  4819. uint32 rxback; /**< blockack rxcnt */
  4820. uint32 txback; /**< blockack txcnt */
  4821. /* 802.11 MIB counters, pp. 614 of 802.11 reaff doc. */
  4822. uint32 txfrag; /**< dot11TransmittedFragmentCount */
  4823. uint32 txmulti; /**< dot11MulticastTransmittedFrameCount */
  4824. uint32 txfail; /**< dot11FailedCount */
  4825. uint32 txretry; /**< dot11RetryCount */
  4826. uint32 txretrie; /**< dot11MultipleRetryCount */
  4827. uint32 rxdup; /**< dot11FrameduplicateCount */
  4828. uint32 txrts; /**< dot11RTSSuccessCount */
  4829. uint32 txnocts; /**< dot11RTSFailureCount */
  4830. uint32 txnoack; /**< dot11ACKFailureCount */
  4831. uint32 rxfrag; /**< dot11ReceivedFragmentCount */
  4832. uint32 rxmulti; /**< dot11MulticastReceivedFrameCount */
  4833. uint32 rxcrc; /**< dot11FCSErrorCount */
  4834. uint32 txfrmsnt; /**< dot11TransmittedFrameCount (bogus MIB?) */
  4835. uint32 rxundec; /**< dot11WEPUndecryptableCount */
  4836. /* WPA2 counters (see rxundec for DecryptFailureCount) */
  4837. uint32 tkipmicfaill; /**< TKIPLocalMICFailures */
  4838. uint32 tkipcntrmsr; /**< TKIPCounterMeasuresInvoked */
  4839. uint32 tkipreplay; /**< TKIPReplays */
  4840. uint32 ccmpfmterr; /**< CCMPFormatErrors */
  4841. uint32 ccmpreplay; /**< CCMPReplays */
  4842. uint32 ccmpundec; /**< CCMPDecryptErrors */
  4843. uint32 fourwayfail; /**< FourWayHandshakeFailures */
  4844. uint32 wepundec; /**< dot11WEPUndecryptableCount */
  4845. uint32 wepicverr; /**< dot11WEPICVErrorCount */
  4846. uint32 decsuccess; /**< DecryptSuccessCount */
  4847. uint32 tkipicverr; /**< TKIPICVErrorCount */
  4848. uint32 wepexcluded; /**< dot11WEPExcludedCount */
  4849. uint32 rxundec_mcst; /**< dot11WEPUndecryptableCount */
  4850. /* WPA2 counters (see rxundec for DecryptFailureCount) */
  4851. uint32 tkipmicfaill_mcst; /**< TKIPLocalMICFailures */
  4852. uint32 tkipcntrmsr_mcst; /**< TKIPCounterMeasuresInvoked */
  4853. uint32 tkipreplay_mcst; /**< TKIPReplays */
  4854. uint32 ccmpfmterr_mcst; /**< CCMPFormatErrors */
  4855. uint32 ccmpreplay_mcst; /**< CCMPReplays */
  4856. uint32 ccmpundec_mcst; /**< CCMPDecryptErrors */
  4857. uint32 fourwayfail_mcst; /**< FourWayHandshakeFailures */
  4858. uint32 wepundec_mcst; /**< dot11WEPUndecryptableCount */
  4859. uint32 wepicverr_mcst; /**< dot11WEPICVErrorCount */
  4860. uint32 decsuccess_mcst; /**< DecryptSuccessCount */
  4861. uint32 tkipicverr_mcst; /**< TKIPICVErrorCount */
  4862. uint32 wepexcluded_mcst; /**< dot11WEPExcludedCount */
  4863. uint32 txchanrej; /**< Tx frames suppressed due to channel rejection */
  4864. uint32 txexptime; /**< Tx frames suppressed due to timer expiration */
  4865. uint32 psmwds; /**< Count PSM watchdogs */
  4866. uint32 phywatchdog; /**< Count Phy watchdogs (triggered by ucode) */
  4867. /* MBSS counters, AP only */
  4868. uint32 prq_entries_handled; /**< PRQ entries read in */
  4869. uint32 prq_undirected_entries; /**< which were bcast bss & ssid */
  4870. uint32 prq_bad_entries; /**< which could not be translated to info */
  4871. uint32 atim_suppress_count; /**< TX suppressions on ATIM fifo */
  4872. uint32 bcn_template_not_ready; /**< Template marked in use on send bcn ... */
  4873. uint32 bcn_template_not_ready_done; /**< ...but "DMA done" interrupt rcvd */
  4874. uint32 late_tbtt_dpc; /**< TBTT DPC did not happen in time */
  4875. /* per-rate receive stat counters */
  4876. uint32 rx1mbps; /**< packets rx at 1Mbps */
  4877. uint32 rx2mbps; /**< packets rx at 2Mbps */
  4878. uint32 rx5mbps5; /**< packets rx at 5.5Mbps */
  4879. uint32 rx6mbps; /**< packets rx at 6Mbps */
  4880. uint32 rx9mbps; /**< packets rx at 9Mbps */
  4881. uint32 rx11mbps; /**< packets rx at 11Mbps */
  4882. uint32 rx12mbps; /**< packets rx at 12Mbps */
  4883. uint32 rx18mbps; /**< packets rx at 18Mbps */
  4884. uint32 rx24mbps; /**< packets rx at 24Mbps */
  4885. uint32 rx36mbps; /**< packets rx at 36Mbps */
  4886. uint32 rx48mbps; /**< packets rx at 48Mbps */
  4887. uint32 rx54mbps; /**< packets rx at 54Mbps */
  4888. uint32 rx108mbps; /**< packets rx at 108mbps */
  4889. uint32 rx162mbps; /**< packets rx at 162mbps */
  4890. uint32 rx216mbps; /**< packets rx at 216 mbps */
  4891. uint32 rx270mbps; /**< packets rx at 270 mbps */
  4892. uint32 rx324mbps; /**< packets rx at 324 mbps */
  4893. uint32 rx378mbps; /**< packets rx at 378 mbps */
  4894. uint32 rx432mbps; /**< packets rx at 432 mbps */
  4895. uint32 rx486mbps; /**< packets rx at 486 mbps */
  4896. uint32 rx540mbps; /**< packets rx at 540 mbps */
  4897. /* pkteng rx frame stats */
  4898. uint32 pktengrxducast; /**< unicast frames rxed by the pkteng code */
  4899. uint32 pktengrxdmcast; /**< multicast frames rxed by the pkteng code */
  4900. uint32 rfdisable; /**< count of radio disables */
  4901. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  4902. uint32 bphy_badplcp;
  4903. uint32 txmpdu_sgi; /**< count for sgi transmit */
  4904. uint32 rxmpdu_sgi; /**< count for sgi received */
  4905. uint32 txmpdu_stbc; /**< count for stbc transmit */
  4906. uint32 rxmpdu_stbc; /**< count for stbc received */
  4907. uint32 rxdrop20s; /**< drop secondary cnt */
  4908. /* All counter variables have to be of uint32. */
  4909. } wl_cnt_ver_6_t;
  4910. #define WL_DELTA_STATS_T_VERSION 2 /**< current version of wl_delta_stats_t struct */
  4911. typedef struct {
  4912. uint16 version; /**< see definition of WL_DELTA_STATS_T_VERSION */
  4913. uint16 length; /**< length of entire structure */
  4914. /* transmit stat counters */
  4915. uint32 txframe; /**< tx data frames */
  4916. uint32 txbyte; /**< tx data bytes */
  4917. uint32 txretrans; /**< tx mac retransmits */
  4918. uint32 txfail; /**< tx failures */
  4919. /* receive stat counters */
  4920. uint32 rxframe; /**< rx data frames */
  4921. uint32 rxbyte; /**< rx data bytes */
  4922. /* per-rate receive stat counters */
  4923. uint32 rx1mbps; /**< packets rx at 1Mbps */
  4924. uint32 rx2mbps; /**< packets rx at 2Mbps */
  4925. uint32 rx5mbps5; /**< packets rx at 5.5Mbps */
  4926. uint32 rx6mbps; /**< packets rx at 6Mbps */
  4927. uint32 rx9mbps; /**< packets rx at 9Mbps */
  4928. uint32 rx11mbps; /**< packets rx at 11Mbps */
  4929. uint32 rx12mbps; /**< packets rx at 12Mbps */
  4930. uint32 rx18mbps; /**< packets rx at 18Mbps */
  4931. uint32 rx24mbps; /**< packets rx at 24Mbps */
  4932. uint32 rx36mbps; /**< packets rx at 36Mbps */
  4933. uint32 rx48mbps; /**< packets rx at 48Mbps */
  4934. uint32 rx54mbps; /**< packets rx at 54Mbps */
  4935. uint32 rx108mbps; /**< packets rx at 108mbps */
  4936. uint32 rx162mbps; /**< packets rx at 162mbps */
  4937. uint32 rx216mbps; /**< packets rx at 216 mbps */
  4938. uint32 rx270mbps; /**< packets rx at 270 mbps */
  4939. uint32 rx324mbps; /**< packets rx at 324 mbps */
  4940. uint32 rx378mbps; /**< packets rx at 378 mbps */
  4941. uint32 rx432mbps; /**< packets rx at 432 mbps */
  4942. uint32 rx486mbps; /**< packets rx at 486 mbps */
  4943. uint32 rx540mbps; /**< packets rx at 540 mbps */
  4944. /* phy stats */
  4945. uint32 rxbadplcp;
  4946. uint32 rxcrsglitch;
  4947. uint32 bphy_rxcrsglitch;
  4948. uint32 bphy_badplcp;
  4949. uint32 slice_index; /**< Slice for which stats are reported */
  4950. } wl_delta_stats_t;
  4951. /* Partial statistics counter report */
  4952. #define WL_CNT_CTL_MGT_FRAMES 0
  4953. typedef struct {
  4954. uint16 type;
  4955. uint16 len;
  4956. /* detailed control/management frames */
  4957. uint32 txnull;
  4958. uint32 rxnull;
  4959. uint32 txqosnull;
  4960. uint32 rxqosnull;
  4961. uint32 txassocreq;
  4962. uint32 rxassocreq;
  4963. uint32 txreassocreq;
  4964. uint32 rxreassocreq;
  4965. uint32 txdisassoc;
  4966. uint32 rxdisassoc;
  4967. uint32 txassocrsp;
  4968. uint32 rxassocrsp;
  4969. uint32 txreassocrsp;
  4970. uint32 rxreassocrsp;
  4971. uint32 txauth;
  4972. uint32 rxauth;
  4973. uint32 txdeauth;
  4974. uint32 rxdeauth;
  4975. uint32 txprobereq;
  4976. uint32 rxprobereq;
  4977. uint32 txprobersp;
  4978. uint32 rxprobersp;
  4979. uint32 txaction;
  4980. uint32 rxaction;
  4981. uint32 txrts;
  4982. uint32 rxrts;
  4983. uint32 txcts;
  4984. uint32 rxcts;
  4985. uint32 txack;
  4986. uint32 rxack;
  4987. uint32 txbar;
  4988. uint32 rxbar;
  4989. uint32 txback;
  4990. uint32 rxback;
  4991. uint32 txpspoll;
  4992. uint32 rxpspoll;
  4993. } wl_ctl_mgt_cnt_t;
  4994. typedef struct {
  4995. uint32 packets;
  4996. uint32 bytes;
  4997. } wl_traffic_stats_t;
  4998. typedef struct {
  4999. uint16 version; /**< see definition of WL_WME_CNT_VERSION */
  5000. uint16 length; /**< length of entire structure */
  5001. wl_traffic_stats_t tx[AC_COUNT]; /**< Packets transmitted */
  5002. wl_traffic_stats_t tx_failed[AC_COUNT]; /**< Packets dropped or failed to transmit */
  5003. wl_traffic_stats_t rx[AC_COUNT]; /**< Packets received */
  5004. wl_traffic_stats_t rx_failed[AC_COUNT]; /**< Packets failed to receive */
  5005. wl_traffic_stats_t forward[AC_COUNT]; /**< Packets forwarded by AP */
  5006. wl_traffic_stats_t tx_expired[AC_COUNT]; /**< packets dropped due to lifetime expiry */
  5007. } wl_wme_cnt_t;
  5008. struct wl_msglevel2 {
  5009. uint32 low;
  5010. uint32 high;
  5011. };
  5012. /* A versioned structure for setting and retrieving debug message levels. */
  5013. #define WL_MSGLEVEL_STRUCT_VERSION_1 1
  5014. typedef struct wl_msglevel_v1 {
  5015. uint16 version;
  5016. uint16 length;
  5017. uint32 msglevel1;
  5018. uint32 msglevel2;
  5019. uint32 msglevel3;
  5020. /* add another uint32 when full */
  5021. } wl_msglevel_v1_t;
  5022. #define WL_ICMP_IPV6_CFG_VERSION 1
  5023. #define WL_ICMP_IPV6_CLEAR_ALL (1 << 0)
  5024. typedef struct wl_icmp_ipv6_cfg {
  5025. uint16 version;
  5026. uint16 length;
  5027. uint16 fixed_length;
  5028. uint16 flags;
  5029. uint32 num_ipv6;
  5030. /* num_ipv6 to follow */
  5031. struct ipv6_addr host_ipv6[];
  5032. } wl_icmp_ipv6_cfg_t;
  5033. #define WL_ICMP_CFG_IPV6_FIXED_LEN OFFSETOF(wl_icmp_ipv6_cfg_t, host_ipv6)
  5034. #define WL_ICMP_CFG_IPV6_LEN(count) (WL_ICMP_CFG_IPV6_FIXED_LEN + \
  5035. ((count) * sizeof(struct ipv6_addr)))
  5036. typedef struct wl_mkeep_alive_pkt {
  5037. uint16 version; /* Version for mkeep_alive */
  5038. uint16 length; /* length of fixed parameters in the structure */
  5039. uint32 period_msec; /* high bit on means immediate send */
  5040. uint16 len_bytes;
  5041. uint8 keep_alive_id; /* 0 - 3 for N = 4 */
  5042. uint8 data[1];
  5043. } wl_mkeep_alive_pkt_t;
  5044. #define WL_MKEEP_ALIVE_VERSION 1
  5045. #define WL_MKEEP_ALIVE_FIXED_LEN OFFSETOF(wl_mkeep_alive_pkt_t, data)
  5046. /* 1/2 second precision since idle time is a seconds counter anyway */
  5047. #define WL_MKEEP_ALIVE_PRECISION 500
  5048. #define WL_MKEEP_ALIVE_PERIOD_MASK 0x7FFFFFFF
  5049. #define WL_MKEEP_ALIVE_IMMEDIATE 0x80000000
  5050. /** TCP Keep-Alive conn struct */
  5051. typedef struct wl_mtcpkeep_alive_conn_pkt {
  5052. struct ether_addr saddr; /**< src mac address */
  5053. struct ether_addr daddr; /**< dst mac address */
  5054. struct ipv4_addr sipaddr; /**< source IP addr */
  5055. struct ipv4_addr dipaddr; /**< dest IP addr */
  5056. uint16 sport; /**< src port */
  5057. uint16 dport; /**< dest port */
  5058. uint32 seq; /**< seq number */
  5059. uint32 ack; /**< ACK number */
  5060. uint16 tcpwin; /**< TCP window */
  5061. uint16 PAD;
  5062. } wl_mtcpkeep_alive_conn_pkt_t;
  5063. /** TCP Keep-Alive interval struct */
  5064. typedef struct wl_mtcpkeep_alive_timers_pkt {
  5065. uint16 interval; /**< interval timer */
  5066. uint16 retry_interval; /**< retry_interval timer */
  5067. uint16 retry_count; /**< retry_count */
  5068. } wl_mtcpkeep_alive_timers_pkt_t;
  5069. typedef struct wake_info {
  5070. uint32 wake_reason;
  5071. uint32 wake_info_len; /**< size of packet */
  5072. uint8 packet[];
  5073. } wake_info_t;
  5074. typedef struct wake_pkt {
  5075. uint32 wake_pkt_len; /**< size of packet */
  5076. uint8 packet[];
  5077. } wake_pkt_t;
  5078. #define WL_MTCPKEEP_ALIVE_VERSION 1
  5079. /* #ifdef WLBA */
  5080. #define WLC_BA_CNT_VERSION 1 /**< current version of wlc_ba_cnt_t */
  5081. /** block ack related stats */
  5082. typedef struct wlc_ba_cnt {
  5083. uint16 version; /**< WLC_BA_CNT_VERSION */
  5084. uint16 length; /**< length of entire structure */
  5085. /* transmit stat counters */
  5086. uint32 txpdu; /**< pdus sent */
  5087. uint32 txsdu; /**< sdus sent */
  5088. uint32 txfc; /**< tx side flow controlled packets */
  5089. uint32 txfci; /**< tx side flow control initiated */
  5090. uint32 txretrans; /**< retransmitted pdus */
  5091. uint32 txbatimer; /**< ba resend due to timer */
  5092. uint32 txdrop; /**< dropped packets */
  5093. uint32 txaddbareq; /**< addba req sent */
  5094. uint32 txaddbaresp; /**< addba resp sent */
  5095. uint32 txdelba; /**< delba sent */
  5096. uint32 txba; /**< ba sent */
  5097. uint32 txbar; /**< bar sent */
  5098. uint32 txpad[4]; /**< future */
  5099. /* receive side counters */
  5100. uint32 rxpdu; /**< pdus recd */
  5101. uint32 rxqed; /**< pdus buffered before sending up */
  5102. uint32 rxdup; /**< duplicate pdus */
  5103. uint32 rxnobuf; /**< pdus discarded due to no buf */
  5104. uint32 rxaddbareq; /**< addba req recd */
  5105. uint32 rxaddbaresp; /**< addba resp recd */
  5106. uint32 rxdelba; /**< delba recd */
  5107. uint32 rxba; /**< ba recd */
  5108. uint32 rxbar; /**< bar recd */
  5109. uint32 rxinvba; /**< invalid ba recd */
  5110. uint32 rxbaholes; /**< ba recd with holes */
  5111. uint32 rxunexp; /**< unexpected packets */
  5112. uint32 rxpad[4]; /**< future */
  5113. } wlc_ba_cnt_t;
  5114. /* #endif WLBA */
  5115. /** structure for per-tid ampdu control */
  5116. struct ampdu_tid_control {
  5117. uint8 tid; /* tid */
  5118. uint8 enable; /* enable/disable */
  5119. };
  5120. /** struct for ampdu tx/rx aggregation control */
  5121. struct ampdu_aggr {
  5122. int8 aggr_override; /**< aggr overrided by dongle. Not to be set by host. */
  5123. uint16 conf_TID_bmap; /**< bitmap of TIDs to configure */
  5124. uint16 enab_TID_bmap; /**< enable/disable per TID */
  5125. };
  5126. /** structure for identifying ea/tid for sending addba/delba */
  5127. struct ampdu_ea_tid {
  5128. struct ether_addr ea; /**< Station address */
  5129. uint8 tid; /**< tid */
  5130. uint8 initiator; /**< 0 is recipient, 1 is originator */
  5131. };
  5132. /** structure for identifying retry/tid for retry_limit_tid/rr_retry_limit_tid */
  5133. struct ampdu_retry_tid {
  5134. uint8 tid; /**< tid */
  5135. uint8 retry; /**< retry value */
  5136. };
  5137. #define BDD_FNAME_LEN 32 /**< Max length of friendly name */
  5138. typedef struct bdd_fname {
  5139. uint8 len; /**< length of friendly name */
  5140. uchar name[BDD_FNAME_LEN]; /**< friendly name */
  5141. } bdd_fname_t;
  5142. /* structure for addts arguments */
  5143. /** For ioctls that take a list of TSPEC */
  5144. struct tslist {
  5145. int32 count; /**< number of tspecs */
  5146. struct tsinfo_arg tsinfo[]; /**< variable length array of tsinfo */
  5147. };
  5148. /* WLTDLS */
  5149. /**structure for tdls iovars */
  5150. typedef struct tdls_iovar {
  5151. struct ether_addr ea; /**< Station address */
  5152. uint8 mode; /**< mode: depends on iovar */
  5153. uint8 PAD;
  5154. chanspec_t chanspec;
  5155. uint8 PAD[6];
  5156. } tdls_iovar_t;
  5157. #define TDLS_WFD_IE_SIZE 512
  5158. /**structure for tdls wfd ie */
  5159. typedef struct tdls_wfd_ie_iovar {
  5160. struct ether_addr ea; /**< Station address */
  5161. uint8 mode;
  5162. uint8 PAD;
  5163. uint16 length;
  5164. uint8 data[TDLS_WFD_IE_SIZE];
  5165. } tdls_wfd_ie_iovar_t;
  5166. /* #endif WLTDLS */
  5167. /** structure for addts/delts arguments */
  5168. typedef struct tspec_arg {
  5169. uint16 version; /**< see definition of TSPEC_ARG_VERSION */
  5170. uint16 length; /**< length of entire structure */
  5171. uint32 flag; /**< bit field */
  5172. /* TSPEC Arguments */
  5173. struct tsinfo_arg tsinfo; /**< TS Info bit field */
  5174. uint8 PAD;
  5175. uint16 nom_msdu_size; /**< (Nominal or fixed) MSDU Size (bytes) */
  5176. uint16 max_msdu_size; /**< Maximum MSDU Size (bytes) */
  5177. uint32 min_srv_interval; /**< Minimum Service Interval (us) */
  5178. uint32 max_srv_interval; /**< Maximum Service Interval (us) */
  5179. uint32 inactivity_interval; /**< Inactivity Interval (us) */
  5180. uint32 suspension_interval; /**< Suspension Interval (us) */
  5181. uint32 srv_start_time; /**< Service Start Time (us) */
  5182. uint32 min_data_rate; /**< Minimum Data Rate (bps) */
  5183. uint32 mean_data_rate; /**< Mean Data Rate (bps) */
  5184. uint32 peak_data_rate; /**< Peak Data Rate (bps) */
  5185. uint32 max_burst_size; /**< Maximum Burst Size (bytes) */
  5186. uint32 delay_bound; /**< Delay Bound (us) */
  5187. uint32 min_phy_rate; /**< Minimum PHY Rate (bps) */
  5188. uint16 surplus_bw; /**< Surplus Bandwidth Allowance (range 1.0 to 8.0) */
  5189. uint16 medium_time; /**< Medium Time (32 us/s periods) */
  5190. uint8 dialog_token; /**< dialog token */
  5191. uint8 PAD[3];
  5192. } tspec_arg_t;
  5193. /** tspec arg for desired station */
  5194. typedef struct tspec_per_sta_arg {
  5195. struct ether_addr ea;
  5196. uint8 PAD[2];
  5197. struct tspec_arg ts;
  5198. } tspec_per_sta_arg_t;
  5199. /** structure for max bandwidth for each access category */
  5200. typedef struct wme_max_bandwidth {
  5201. uint32 ac[AC_COUNT]; /**< max bandwidth for each access category */
  5202. } wme_max_bandwidth_t;
  5203. #define WL_WME_MBW_PARAMS_IO_BYTES (sizeof(wme_max_bandwidth_t))
  5204. /* current version of wl_tspec_arg_t struct */
  5205. #define TSPEC_ARG_VERSION 2 /**< current version of wl_tspec_arg_t struct */
  5206. #define TSPEC_ARG_LENGTH 55 /**< argument length from tsinfo to medium_time */
  5207. #define TSPEC_DEFAULT_DIALOG_TOKEN 42 /**< default dialog token */
  5208. #define TSPEC_DEFAULT_SBW_FACTOR 0x3000 /**< default surplus bw */
  5209. #define WL_WOWL_KEEPALIVE_MAX_PACKET_SIZE 80
  5210. #define WLC_WOWL_MAX_KEEPALIVE 2
  5211. /** Packet lifetime configuration per ac */
  5212. typedef struct wl_lifetime {
  5213. uint32 ac; /**< access class */
  5214. uint32 lifetime; /**< Packet lifetime value in ms */
  5215. } wl_lifetime_t;
  5216. /** Management time configuration */
  5217. typedef struct wl_lifetime_mg {
  5218. uint32 mgmt_bitmap; /**< Mgmt subtype */
  5219. uint32 lifetime; /**< Packet lifetime value in us */
  5220. } wl_lifetime_mg_t;
  5221. /* MAC Sample Capture related */
  5222. #define WL_MACCAPTR_DEFSTART_PTR 0xA00
  5223. #define WL_MACCAPTR_DEFSTOP_PTR 0xA3F
  5224. #define WL_MACCAPTR_DEFSZ 0x3F
  5225. #define WL_MACCAPTR_DEF_MASK 0xFFFFFFFF
  5226. typedef enum {
  5227. WL_MACCAPT_TRIG = 0,
  5228. WL_MACCAPT_STORE = 1,
  5229. WL_MACCAPT_TRANS = 2,
  5230. WL_MACCAPT_MATCH = 3
  5231. } maccaptr_optn;
  5232. typedef enum {
  5233. WL_MACCAPT_STRT = 1,
  5234. WL_MACCAPT_STOP = 2,
  5235. WL_MACCAPT_RST = 3
  5236. } maccaptr_cmd_t;
  5237. /* MAC Sample Capture Set-up Paramters */
  5238. typedef struct wl_maccapture_params {
  5239. uint8 gpio_sel;
  5240. uint8 la_mode; /* TRUE: GPIO Out Enabled */
  5241. uint8 PAD[2];
  5242. uint32 start_ptr; /* Start address to store */
  5243. uint32 stop_ptr; /* Stop address to store */
  5244. uint8 optn_bmp; /* Options */
  5245. uint8 PAD[3];
  5246. /* Don't change the order after this nor
  5247. * add anything in betw. Code uses offsets to populate
  5248. * registers
  5249. */
  5250. uint32 tr_mask; /* Trigger Mask */
  5251. uint32 tr_val; /* Trigger Value */
  5252. uint32 s_mask; /* Store Mode Mask */
  5253. uint32 x_mask; /* Trans. Mode Mask */
  5254. uint32 m_mask; /* Match Mode Mask */
  5255. uint32 m_val; /* Match Value */
  5256. maccaptr_cmd_t cmd; /* Start / Stop */
  5257. } wl_maccapture_params_t;
  5258. /** Channel Switch Announcement param */
  5259. typedef struct wl_chan_switch {
  5260. uint8 mode; /**< value 0 or 1 */
  5261. uint8 count; /**< count # of beacons before switching */
  5262. chanspec_t chspec; /**< chanspec */
  5263. uint8 reg; /**< regulatory class */
  5264. uint8 frame_type; /**< csa frame type, unicast or broadcast */
  5265. } wl_chan_switch_t;
  5266. enum {
  5267. PFN_LIST_ORDER,
  5268. PFN_RSSI
  5269. };
  5270. enum {
  5271. DISABLE,
  5272. ENABLE
  5273. };
  5274. enum {
  5275. OFF_ADAPT,
  5276. SMART_ADAPT,
  5277. STRICT_ADAPT,
  5278. SLOW_ADAPT
  5279. };
  5280. #define SORT_CRITERIA_BIT 0
  5281. #define AUTO_NET_SWITCH_BIT 1
  5282. #define ENABLE_BKGRD_SCAN_BIT 2
  5283. #define IMMEDIATE_SCAN_BIT 3
  5284. #define AUTO_CONNECT_BIT 4
  5285. #define ENABLE_BD_SCAN_BIT 5
  5286. #define ENABLE_ADAPTSCAN_BIT 6
  5287. #define IMMEDIATE_EVENT_BIT 8
  5288. #define SUPPRESS_SSID_BIT 9
  5289. #define ENABLE_NET_OFFLOAD_BIT 10
  5290. /** report found/lost events for SSID and BSSID networks seperately */
  5291. #define REPORT_SEPERATELY_BIT 11
  5292. #define SORT_CRITERIA_MASK 0x0001
  5293. #define AUTO_NET_SWITCH_MASK 0x0002
  5294. #define ENABLE_BKGRD_SCAN_MASK 0x0004
  5295. #define IMMEDIATE_SCAN_MASK 0x0008
  5296. #define AUTO_CONNECT_MASK 0x0010
  5297. #define ENABLE_BD_SCAN_MASK 0x0020
  5298. #define ENABLE_ADAPTSCAN_MASK 0x00c0
  5299. #define IMMEDIATE_EVENT_MASK 0x0100
  5300. #define SUPPRESS_SSID_MASK 0x0200
  5301. #define ENABLE_NET_OFFLOAD_MASK 0x0400
  5302. /** report found/lost events for SSID and BSSID networks seperately */
  5303. #define REPORT_SEPERATELY_MASK 0x0800
  5304. #define PFN_VERSION 2
  5305. #define PFN_COMPLETE 1
  5306. #define PFN_INCOMPLETE 0
  5307. #define DEFAULT_BESTN 2
  5308. #define DEFAULT_MSCAN 0
  5309. #define DEFAULT_REPEAT 10
  5310. #define DEFAULT_EXP 2
  5311. #define PFN_PARTIAL_SCAN_BIT 0
  5312. #define PFN_PARTIAL_SCAN_MASK 1
  5313. #define PFN_SWC_RSSI_WINDOW_MAX 8
  5314. #define PFN_SWC_MAX_NUM_APS 16
  5315. #define PFN_HOTLIST_MAX_NUM_APS 64
  5316. #define MAX_EPNO_HIDDEN_SSID 8
  5317. #define MAX_WHITELIST_SSID 2
  5318. /* Version 1 and 2 for various scan results structures defined below */
  5319. #define PFN_SCANRESULTS_VERSION_V1 1
  5320. #define PFN_SCANRESULTS_VERSION_V2 2
  5321. /** PFN network info structure */
  5322. typedef struct wl_pfn_subnet_info_v1 {
  5323. struct ether_addr BSSID;
  5324. uint8 channel; /**< channel number only */
  5325. uint8 SSID_len;
  5326. uint8 SSID[32];
  5327. } wl_pfn_subnet_info_v1_t;
  5328. typedef struct wl_pfn_subnet_info_v2 {
  5329. struct ether_addr BSSID;
  5330. uint8 channel; /**< channel number only */
  5331. uint8 SSID_len;
  5332. union {
  5333. uint8 SSID[32];
  5334. uint16 index;
  5335. } u;
  5336. } wl_pfn_subnet_info_v2_t;
  5337. typedef struct wl_pfn_net_info_v1 {
  5338. wl_pfn_subnet_info_v1_t pfnsubnet;
  5339. int16 RSSI; /**< receive signal strength (in dBm) */
  5340. uint16 timestamp; /**< age in seconds */
  5341. } wl_pfn_net_info_v1_t;
  5342. typedef struct wl_pfn_net_info_v2 {
  5343. wl_pfn_subnet_info_v2_t pfnsubnet;
  5344. int16 RSSI; /**< receive signal strength (in dBm) */
  5345. uint16 timestamp; /**< age in seconds */
  5346. } wl_pfn_net_info_v2_t;
  5347. /* Version 1 and 2 for various lbest scan results structures below */
  5348. #define PFN_LBEST_SCAN_RESULT_VERSION_V1 1
  5349. #define PFN_LBEST_SCAN_RESULT_VERSION_V2 2
  5350. #define MAX_CHBKT_PER_RESULT 4
  5351. typedef struct wl_pfn_lnet_info_v1 {
  5352. wl_pfn_subnet_info_v1_t pfnsubnet; /**< BSSID + channel + SSID len + SSID */
  5353. uint16 flags; /**< partial scan, etc */
  5354. int16 RSSI; /**< receive signal strength (in dBm) */
  5355. uint32 timestamp; /**< age in miliseconds */
  5356. uint16 rtt0; /**< estimated distance to this AP in centimeters */
  5357. uint16 rtt1; /**< standard deviation of the distance to this AP in centimeters */
  5358. } wl_pfn_lnet_info_v1_t;
  5359. typedef struct wl_pfn_lnet_info_v2 {
  5360. wl_pfn_subnet_info_v2_t pfnsubnet; /**< BSSID + channel + SSID len + SSID */
  5361. uint16 flags; /**< partial scan, etc */
  5362. int16 RSSI; /**< receive signal strength (in dBm) */
  5363. uint32 timestamp; /**< age in miliseconds */
  5364. uint16 rtt0; /**< estimated distance to this AP in centimeters */
  5365. uint16 rtt1; /**< standard deviation of the distance to this AP in centimeters */
  5366. } wl_pfn_lnet_info_v2_t;
  5367. typedef struct wl_pfn_lscanresults_v1 {
  5368. uint32 version;
  5369. uint32 status;
  5370. uint32 count;
  5371. wl_pfn_lnet_info_v1_t netinfo[1];
  5372. } wl_pfn_lscanresults_v1_t;
  5373. typedef struct wl_pfn_lscanresults_v2 {
  5374. uint32 version;
  5375. uint16 status;
  5376. uint16 count;
  5377. uint32 scan_ch_buckets[MAX_CHBKT_PER_RESULT];
  5378. wl_pfn_lnet_info_v2_t netinfo[1];
  5379. } wl_pfn_lscanresults_v2_t;
  5380. /**this is used to report on 1-* pfn scan results */
  5381. typedef struct wl_pfn_scanresults_v1 {
  5382. uint32 version;
  5383. uint32 status;
  5384. uint32 count;
  5385. wl_pfn_net_info_v1_t netinfo[1];
  5386. } wl_pfn_scanresults_v1_t;
  5387. typedef struct wl_pfn_scanresults_v2 {
  5388. uint32 version;
  5389. uint32 status;
  5390. uint32 count;
  5391. uint32 scan_ch_bucket;
  5392. wl_pfn_net_info_v2_t netinfo[1];
  5393. } wl_pfn_scanresults_v2_t;
  5394. typedef struct wl_pfn_significant_net {
  5395. uint16 flags;
  5396. uint16 channel;
  5397. struct ether_addr BSSID;
  5398. int8 rssi[PFN_SWC_RSSI_WINDOW_MAX];
  5399. } wl_pfn_significant_net_t;
  5400. #define PFN_SWC_SCANRESULT_VERSION 1
  5401. typedef struct wl_pfn_swc_results {
  5402. uint32 version;
  5403. uint32 pkt_count; /**< No. of results in current frame */
  5404. uint32 total_count; /**< Total expected results */
  5405. wl_pfn_significant_net_t list[];
  5406. } wl_pfn_swc_results_t;
  5407. typedef struct wl_pfn_net_info_bssid {
  5408. struct ether_addr BSSID;
  5409. uint8 channel; /**< channel number only */
  5410. int8 RSSI; /**< receive signal strength (in dBm) */
  5411. uint16 flags; /**< (e.g. partial scan, off channel) */
  5412. uint16 timestamp; /**< age in seconds */
  5413. } wl_pfn_net_info_bssid_t;
  5414. typedef struct wl_pfn_scanhist_bssid {
  5415. uint32 version;
  5416. uint32 status;
  5417. uint32 count;
  5418. wl_pfn_net_info_bssid_t netinfo[1];
  5419. } wl_pfn_scanhist_bssid_t;
  5420. /* Version 1 and 2 for various single scan result */
  5421. #define PFN_SCANRESULT_VERSION_V1 1
  5422. #define PFN_SCANRESULT_VERSION_V2 2
  5423. /* used to report exactly one scan result */
  5424. /* plus reports detailed scan info in bss_info */
  5425. typedef struct wl_pfn_scanresult_v1 {
  5426. uint32 version;
  5427. uint32 status;
  5428. uint32 count;
  5429. wl_pfn_net_info_v1_t netinfo;
  5430. wl_bss_info_v109_t bss_info;
  5431. } wl_pfn_scanresult_v1_t;
  5432. typedef struct wl_pfn_scanresult_v2 {
  5433. uint32 version;
  5434. uint32 status;
  5435. uint32 count;
  5436. wl_pfn_net_info_v2_t netinfo;
  5437. wl_bss_info_v109_t bss_info;
  5438. } wl_pfn_scanresult_v2_t;
  5439. typedef struct wl_pfn_scanresult_v2_1 {
  5440. uint32 version;
  5441. uint32 status;
  5442. uint32 count;
  5443. wl_pfn_net_info_v2_t netinfo;
  5444. uint8 bss_info[]; /* var length wl_bss_info_X structures */
  5445. } wl_pfn_scanresult_v2_1_t;
  5446. /**PFN data structure */
  5447. typedef struct wl_pfn_param {
  5448. int32 version; /**< PNO parameters version */
  5449. int32 scan_freq; /**< Scan frequency */
  5450. int32 lost_network_timeout; /**< Timeout in sec. to declare
  5451. * discovered network as lost
  5452. */
  5453. int16 flags; /**< Bit field to control features
  5454. * of PFN such as sort criteria auto
  5455. * enable switch and background scan
  5456. */
  5457. int16 rssi_margin; /**< Margin to avoid jitter for choosing a
  5458. * PFN based on RSSI sort criteria
  5459. */
  5460. uint8 bestn; /**< number of best networks in each scan */
  5461. uint8 mscan; /**< number of scans recorded */
  5462. uint8 repeat; /**< Minimum number of scan intervals
  5463. *before scan frequency changes in adaptive scan
  5464. */
  5465. uint8 exp; /**< Exponent of 2 for maximum scan interval */
  5466. int32 slow_freq; /**< slow scan period */
  5467. } wl_pfn_param_t;
  5468. typedef struct wl_pfn_bssid {
  5469. struct ether_addr macaddr;
  5470. /* Bit4: suppress_lost, Bit3: suppress_found */
  5471. uint16 flags;
  5472. } wl_pfn_bssid_t;
  5473. typedef struct wl_pfn_significant_bssid {
  5474. struct ether_addr macaddr;
  5475. int8 rssi_low_threshold;
  5476. int8 rssi_high_threshold;
  5477. } wl_pfn_significant_bssid_t;
  5478. #define WL_PFN_SUPPRESSFOUND_MASK 0x08
  5479. #define WL_PFN_SUPPRESSLOST_MASK 0x10
  5480. #define WL_PFN_SSID_IMPRECISE_MATCH 0x80
  5481. #define WL_PFN_SSID_SAME_NETWORK 0x10000
  5482. #define WL_PFN_SUPPRESS_AGING_MASK 0x20000
  5483. #define WL_PFN_FLUSH_ALL_SSIDS 0x40000
  5484. #define WL_PFN_IOVAR_FLAG_MASK 0xFFFF00FF
  5485. #define WL_PFN_RSSI_MASK 0xff00
  5486. #define WL_PFN_RSSI_SHIFT 8
  5487. typedef struct wl_pfn_cfg {
  5488. uint32 reporttype;
  5489. int32 channel_num;
  5490. uint16 channel_list[WL_NUMCHANNELS];
  5491. uint32 flags;
  5492. } wl_pfn_cfg_t;
  5493. #define WL_PFN_SSID_CFG_VERSION 1
  5494. #define WL_PFN_SSID_CFG_CLEAR 0x1
  5495. typedef struct wl_pfn_ssid_params {
  5496. int8 min5G_rssi; /* minimum 5GHz RSSI for a BSSID to be considered */
  5497. int8 min2G_rssi; /* minimum 2.4GHz RSSI for a BSSID to be considered */
  5498. int16 init_score_max; /* The maximum score that a network can have before bonuses */
  5499. int16 cur_bssid_bonus; /* Add to current bssid */
  5500. int16 same_ssid_bonus; /* score bonus for all networks with the same network flag */
  5501. int16 secure_bonus; /* score bonus for networks that are not open */
  5502. int16 band_5g_bonus;
  5503. } wl_pfn_ssid_params_t;
  5504. typedef struct wl_ssid_ext_params {
  5505. int8 min5G_rssi; /* minimum 5GHz RSSI for a BSSID to be considered */
  5506. int8 min2G_rssi; /* minimum 2.4GHz RSSI for a BSSID to be considered */
  5507. int16 init_score_max; /* The maximum score that a network can have before bonuses */
  5508. int16 cur_bssid_bonus; /* Add to current bssid */
  5509. int16 same_ssid_bonus; /* score bonus for all networks with the same network flag */
  5510. int16 secure_bonus; /* score bonus for networks that are not open */
  5511. int16 band_5g_bonus;
  5512. } wl_ssid_ext_params_t;
  5513. typedef struct wl_pfn_ssid_cfg {
  5514. uint16 version;
  5515. uint16 flags;
  5516. wl_ssid_ext_params_t params;
  5517. } wl_pfn_ssid_cfg_t;
  5518. #define CH_BUCKET_REPORT_NONE 0
  5519. #define CH_BUCKET_REPORT_SCAN_COMPLETE_ONLY 1
  5520. #define CH_BUCKET_REPORT_FULL_RESULT 2
  5521. #define CH_BUCKET_REPORT_SCAN_COMPLETE (CH_BUCKET_REPORT_SCAN_COMPLETE_ONLY | \
  5522. CH_BUCKET_REPORT_FULL_RESULT)
  5523. #define CH_BUCKET_REPORT_REGULAR 0
  5524. #define CH_BUCKET_GSCAN 4
  5525. typedef struct wl_pfn_gscan_ch_bucket_cfg {
  5526. uint8 bucket_end_index;
  5527. uint8 bucket_freq_multiple;
  5528. uint8 flag;
  5529. uint8 reserved;
  5530. uint16 repeat;
  5531. uint16 max_freq_multiple;
  5532. } wl_pfn_gscan_ch_bucket_cfg_t;
  5533. typedef struct wl_pfn_capabilities {
  5534. uint16 max_mscan;
  5535. uint16 max_bestn;
  5536. uint16 max_swc_bssid;
  5537. uint16 max_hotlist_bssid;
  5538. } wl_pfn_capabilities_t;
  5539. #define GSCAN_SEND_ALL_RESULTS_MASK (1 << 0)
  5540. #define GSCAN_ALL_BUCKETS_IN_FIRST_SCAN_MASK (1 << 3)
  5541. #define GSCAN_CFG_FLAGS_ONLY_MASK (1 << 7)
  5542. #define WL_GSCAN_CFG_VERSION 1
  5543. typedef struct wl_pfn_gscan_cfg {
  5544. uint16 version;
  5545. /**
  5546. * BIT0 1 = send probes/beacons to HOST
  5547. * BIT1 Reserved
  5548. * BIT2 Reserved
  5549. * Add any future flags here
  5550. * BIT7 1 = no other useful cfg sent
  5551. */
  5552. uint8 flags;
  5553. /** Buffer filled threshold in % to generate an event */
  5554. uint8 buffer_threshold;
  5555. /**
  5556. * No. of BSSIDs with "change" to generate an evt
  5557. * change - crosses rssi threshold/lost
  5558. */
  5559. uint8 swc_nbssid_threshold;
  5560. /* Max=8 (for now) Size of rssi cache buffer */
  5561. uint8 swc_rssi_window_size;
  5562. uint8 count_of_channel_buckets;
  5563. uint8 retry_threshold;
  5564. uint16 lost_ap_window;
  5565. wl_pfn_gscan_ch_bucket_cfg_t channel_bucket[1];
  5566. } wl_pfn_gscan_cfg_t;
  5567. #define WL_PFN_REPORT_ALLNET 0
  5568. #define WL_PFN_REPORT_SSIDNET 1
  5569. #define WL_PFN_REPORT_BSSIDNET 2
  5570. #define WL_PFN_CFG_FLAGS_PROHIBITED 0x00000001 /* Accept and use prohibited channels */
  5571. #define WL_PFN_CFG_FLAGS_RESERVED 0xfffffffe /**< Remaining reserved for future use */
  5572. typedef struct wl_pfn {
  5573. wlc_ssid_t ssid; /**< ssid name and its length */
  5574. int32 flags; /**< bit2: hidden */
  5575. int32 infra; /**< BSS Vs IBSS */
  5576. int32 auth; /**< Open Vs Closed */
  5577. int32 wpa_auth; /**< WPA type */
  5578. int32 wsec; /**< wsec value */
  5579. } wl_pfn_t;
  5580. typedef struct wl_pfn_list {
  5581. uint32 version;
  5582. uint32 enabled;
  5583. uint32 count;
  5584. wl_pfn_t pfn[1];
  5585. } wl_pfn_list_t;
  5586. #define PFN_SSID_EXT_VERSION 1
  5587. typedef struct wl_pfn_ext {
  5588. uint8 flags;
  5589. int8 rssi_thresh; /* RSSI threshold, track only if RSSI > threshold */
  5590. uint16 wpa_auth; /* Match the wpa auth type defined in wlioctl_defs.h */
  5591. uint8 ssid[DOT11_MAX_SSID_LEN];
  5592. uint8 ssid_len;
  5593. uint8 pad;
  5594. } wl_pfn_ext_t;
  5595. typedef struct wl_pfn_ext_list {
  5596. uint16 version;
  5597. uint16 count;
  5598. wl_pfn_ext_t pfn_ext[1];
  5599. } wl_pfn_ext_list_t;
  5600. #define WL_PFN_SSID_EXT_FOUND 0x1
  5601. #define WL_PFN_SSID_EXT_LOST 0x2
  5602. typedef struct wl_pfn_result_ssid {
  5603. uint8 flags;
  5604. int8 rssi;
  5605. /* channel number */
  5606. uint16 channel;
  5607. /* Assume idx in order of cfg */
  5608. uint32 index;
  5609. } wl_pfn_result_ssid_crc32_t;
  5610. typedef struct wl_pfn_ssid_ext_result {
  5611. uint16 version;
  5612. uint16 count;
  5613. wl_pfn_result_ssid_crc32_t net[1];
  5614. } wl_pfn_ssid_ext_result_t;
  5615. #define PFN_EXT_AUTH_CODE_OPEN 1 /* open */
  5616. #define PFN_EXT_AUTH_CODE_PSK 2 /* WPA_PSK or WPA2PSK */
  5617. #define PFN_EXT_AUTH_CODE_EAPOL 4 /* any EAPOL */
  5618. #define WL_PFN_HIDDEN_BIT 2
  5619. #define WL_PFN_HIDDEN_MASK 0x4
  5620. #ifndef BESTN_MAX
  5621. #define BESTN_MAX 10
  5622. #endif // endif
  5623. #ifndef MSCAN_MAX
  5624. #define MSCAN_MAX 90
  5625. #endif // endif
  5626. /* Dynamic scan configuration for motion profiles */
  5627. #define WL_PFN_MPF_VERSION 1
  5628. /* Valid group IDs, may be expanded in the future */
  5629. #define WL_PFN_MPF_GROUP_SSID 0
  5630. #define WL_PFN_MPF_GROUP_BSSID 1
  5631. #define WL_PFN_MPF_MAX_GROUPS 2
  5632. /* Max number of MPF states supported in this time */
  5633. #define WL_PFN_MPF_STATES_MAX 4
  5634. /* Flags for the mpf-specific stuff */
  5635. #define WL_PFN_MPF_ADAPT_ON_BIT 0
  5636. #define WL_PFN_MPF_ADAPTSCAN_BIT 1
  5637. #define WL_PFN_MPF_ADAPT_ON_MASK 0x0001
  5638. #define WL_PFN_MPF_ADAPTSCAN_MASK 0x0006
  5639. /* Per-state timing values */
  5640. typedef struct wl_pfn_mpf_state_params {
  5641. int32 scan_freq; /* Scan frequency (secs) */
  5642. int32 lost_network_timeout; /* Timeout to declare net lost (secs) */
  5643. int16 flags; /* Space for flags: ADAPT etc */
  5644. uint8 exp; /* Exponent of 2 for max interval for SMART/STRICT_ADAPT */
  5645. uint8 repeat; /* Number of scans before changing adaptation level */
  5646. int32 slow_freq; /* Slow scan period for SLOW_ADAPT */
  5647. } wl_pfn_mpf_state_params_t;
  5648. typedef struct wl_pfn_mpf_param {
  5649. uint16 version; /* Structure version */
  5650. uint16 groupid; /* Group ID: 0 (SSID), 1 (BSSID), other: reserved */
  5651. wl_pfn_mpf_state_params_t state[WL_PFN_MPF_STATES_MAX];
  5652. } wl_pfn_mpf_param_t;
  5653. /* Structure for setting pfn_override iovar */
  5654. typedef struct wl_pfn_override_param {
  5655. uint16 version; /* Structure version */
  5656. uint16 start_offset; /* Seconds from now to apply new params */
  5657. uint16 duration; /* Seconds to keep new params applied */
  5658. uint16 reserved;
  5659. wl_pfn_mpf_state_params_t override;
  5660. } wl_pfn_override_param_t;
  5661. #define WL_PFN_OVERRIDE_VERSION 1
  5662. /*
  5663. * Definitions for base MPF configuration
  5664. */
  5665. #define WL_MPF_VERSION 1
  5666. #define WL_MPF_MAX_BITS 3
  5667. #define WL_MPF_MAX_STATES (1 << WL_MPF_MAX_BITS)
  5668. #define WL_MPF_STATE_NAME_MAX 12
  5669. typedef struct wl_mpf_val {
  5670. uint16 val; /* Value of GPIO bits */
  5671. uint16 state; /* State identifier */
  5672. char name[WL_MPF_STATE_NAME_MAX]; /* Optional name */
  5673. } wl_mpf_val_t;
  5674. typedef struct wl_mpf_map {
  5675. uint16 version;
  5676. uint16 type;
  5677. uint16 mask; /* Which GPIO bits to use */
  5678. uint8 count; /* Count of state/value mappings */
  5679. uint8 PAD;
  5680. wl_mpf_val_t vals[WL_MPF_MAX_STATES];
  5681. } wl_mpf_map_t;
  5682. #define WL_MPF_STATE_AUTO (0xFFFF) /* (uint16)-1) */
  5683. typedef struct wl_mpf_state {
  5684. uint16 version;
  5685. uint16 type;
  5686. uint16 state; /* Get/Set */
  5687. uint8 force; /* 0 - auto (HW) state, 1 - forced state */
  5688. char name[WL_MPF_STATE_NAME_MAX]; /* Get/Set: Optional/actual name */
  5689. uint8 PAD;
  5690. } wl_mpf_state_t;
  5691. /*
  5692. * WLFCTS definition
  5693. */
  5694. typedef struct wl_txstatus_additional_info {
  5695. uint32 rspec;
  5696. uint32 enq_ts;
  5697. uint32 last_ts;
  5698. uint32 entry_ts;
  5699. uint16 seq;
  5700. uint8 rts_cnt;
  5701. uint8 tx_cnt;
  5702. } wl_txstatus_additional_info_t;
  5703. /** Service discovery */
  5704. typedef struct {
  5705. uint8 transaction_id; /**< Transaction id */
  5706. uint8 protocol; /**< Service protocol type */
  5707. uint16 query_len; /**< Length of query */
  5708. uint16 response_len; /**< Length of response */
  5709. uint8 qrbuf[];
  5710. } wl_p2po_qr_t;
  5711. typedef struct {
  5712. uint16 period; /**< extended listen period */
  5713. uint16 interval; /**< extended listen interval */
  5714. uint16 count; /* count to repeat */
  5715. uint16 pad; /* pad for 32bit align */
  5716. } wl_p2po_listen_t;
  5717. /** GAS state machine tunable parameters. Structure field values of 0 means use the default. */
  5718. typedef struct wl_gas_config {
  5719. uint16 max_retransmit; /**< Max # of firmware/driver retransmits on no Ack
  5720. * from peer (on top of the ucode retries).
  5721. */
  5722. uint16 response_timeout; /**< Max time to wait for a GAS-level response
  5723. * after sending a packet.
  5724. */
  5725. uint16 max_comeback_delay; /**< Max GAS response comeback delay.
  5726. * Exceeding this fails the GAS exchange.
  5727. */
  5728. uint16 max_retries; /**< Max # of GAS state machine retries on failure
  5729. * of a GAS frame exchange.
  5730. */
  5731. } wl_gas_config_t;
  5732. /** P2P Find Offload parameters */
  5733. typedef struct wl_p2po_find_config {
  5734. uint16 version; /**< Version of this struct */
  5735. uint16 length; /**< sizeof(wl_p2po_find_config_t) */
  5736. int32 search_home_time; /**< P2P search state home time when concurrent
  5737. * connection exists. -1 for default.
  5738. */
  5739. uint8 num_social_channels;
  5740. /**< Number of social channels up to WL_P2P_SOCIAL_CHANNELS_MAX.
  5741. * 0 means use default social channels.
  5742. */
  5743. uint8 flags;
  5744. uint16 social_channels[1]; /**< Variable length array of social channels */
  5745. } wl_p2po_find_config_t;
  5746. #define WL_P2PO_FIND_CONFIG_VERSION 2 /**< value for version field */
  5747. /** wl_p2po_find_config_t flags */
  5748. #define P2PO_FIND_FLAG_SCAN_ALL_APS 0x01 /**< Whether to scan for all APs in the p2po_find
  5749. * periodic scans of all channels.
  5750. * 0 means scan for only P2P devices.
  5751. * 1 means scan for P2P devices plus non-P2P APs.
  5752. */
  5753. /** For adding a WFDS service to seek */
  5754. typedef struct {
  5755. uint32 seek_hdl; /**< unique id chosen by host */
  5756. uint8 addr[6]; /**< Seek service from a specific device with this
  5757. * MAC address, all 1's for any device.
  5758. */
  5759. uint8 service_hash[P2P_WFDS_HASH_LEN];
  5760. uint8 service_name_len;
  5761. uint8 service_name[MAX_WFDS_SEEK_SVC_NAME_LEN];
  5762. /**< Service name to seek, not null terminated */
  5763. uint8 service_info_req_len;
  5764. uint8 service_info_req[1]; /**< Service info request, not null terminated.
  5765. * Variable length specified by service_info_req_len.
  5766. * Maximum length is MAX_WFDS_SEEK_SVC_INFO_LEN.
  5767. */
  5768. } wl_p2po_wfds_seek_add_t;
  5769. /** For deleting a WFDS service to seek */
  5770. typedef struct {
  5771. uint32 seek_hdl; /**< delete service specified by id */
  5772. } wl_p2po_wfds_seek_del_t;
  5773. /** For adding a WFDS service to advertise */
  5774. #include <packed_section_start.h>
  5775. typedef BWL_PRE_PACKED_STRUCT struct {
  5776. uint32 advertise_hdl; /**< unique id chosen by host */
  5777. uint8 service_hash[P2P_WFDS_HASH_LEN];
  5778. uint32 advertisement_id;
  5779. uint16 service_config_method;
  5780. uint8 service_name_len;
  5781. uint8 service_name[MAX_WFDS_SVC_NAME_LEN];
  5782. /**< Service name , not null terminated */
  5783. uint8 service_status;
  5784. uint16 service_info_len;
  5785. uint8 service_info[1]; /**< Service info, not null terminated.
  5786. * Variable length specified by service_info_len.
  5787. * Maximum length is MAX_WFDS_ADV_SVC_INFO_LEN.
  5788. */
  5789. } BWL_POST_PACKED_STRUCT wl_p2po_wfds_advertise_add_t;
  5790. #include <packed_section_end.h>
  5791. /** For deleting a WFDS service to advertise */
  5792. typedef struct {
  5793. uint32 advertise_hdl; /**< delete service specified by hdl */
  5794. } wl_p2po_wfds_advertise_del_t;
  5795. /** P2P Offload discovery mode for the p2po_state iovar */
  5796. typedef enum {
  5797. WL_P2PO_DISC_STOP,
  5798. WL_P2PO_DISC_LISTEN,
  5799. WL_P2PO_DISC_DISCOVERY
  5800. } disc_mode_t;
  5801. /* ANQP offload */
  5802. #define ANQPO_MAX_QUERY_SIZE 256
  5803. typedef struct {
  5804. uint16 max_retransmit; /**< ~0 use default, max retransmit on no ACK from peer */
  5805. uint16 response_timeout; /**< ~0 use default, msec to wait for resp after tx packet */
  5806. uint16 max_comeback_delay; /**< ~0 use default, max comeback delay in resp else fail */
  5807. uint16 max_retries; /**< ~0 use default, max retries on failure */
  5808. uint16 query_len; /**< length of ANQP query */
  5809. uint8 query_data[1]; /**< ANQP encoded query (max ANQPO_MAX_QUERY_SIZE) */
  5810. } wl_anqpo_set_t;
  5811. #define WL_ANQPO_FLAGS_BSSID_WILDCARD 0x0001
  5812. #define WL_ANQPO_PEER_LIST_VERSION_2 2
  5813. typedef struct {
  5814. uint16 channel; /**< channel of the peer */
  5815. struct ether_addr addr; /**< addr of the peer */
  5816. } wl_anqpo_peer_v1_t;
  5817. typedef struct {
  5818. uint16 channel; /**< channel of the peer */
  5819. struct ether_addr addr; /**< addr of the peer */
  5820. uint32 flags; /**< 0x01-Peer is MBO Capable */
  5821. } wl_anqpo_peer_v2_t;
  5822. #define ANQPO_MAX_PEER_LIST 64
  5823. typedef struct {
  5824. uint16 count; /**< number of peers in list */
  5825. wl_anqpo_peer_v1_t peer[1]; /**< max ANQPO_MAX_PEER_LIST */
  5826. } wl_anqpo_peer_list_v1_t;
  5827. typedef struct {
  5828. uint16 version; /**<VERSION */
  5829. uint16 length; /**< length of entire structure */
  5830. uint16 count; /**< number of peers in list */
  5831. wl_anqpo_peer_v2_t peer[1]; /**< max ANQPO_MAX_PEER_LIST */
  5832. } wl_anqpo_peer_list_v2_t;
  5833. #ifndef WL_ANQPO_PEER_LIST_TYPEDEF_HAS_ALIAS
  5834. typedef wl_anqpo_peer_list_v1_t wl_anqpo_peer_list_t;
  5835. typedef wl_anqpo_peer_v1_t wl_anqpo_peer_t;
  5836. #endif /* WL_ANQPO_PEER_LIST_TYPEDEF_HAS_ALIAS */
  5837. #define ANQPO_MAX_IGNORE_SSID 64
  5838. typedef struct {
  5839. uint8 is_clear; /**< set to clear list (not used on GET) */
  5840. uint8 PAD;
  5841. uint16 count; /**< number of SSID in list */
  5842. wlc_ssid_t ssid[1]; /**< max ANQPO_MAX_IGNORE_SSID */
  5843. } wl_anqpo_ignore_ssid_list_t;
  5844. #define ANQPO_MAX_IGNORE_BSSID 64
  5845. typedef struct {
  5846. uint8 is_clear; /**< set to clear list (not used on GET) */
  5847. uint8 PAD;
  5848. uint16 count; /**< number of addr in list */
  5849. struct ether_addr bssid[]; /**< max ANQPO_MAX_IGNORE_BSSID */
  5850. } wl_anqpo_ignore_bssid_list_t;
  5851. struct toe_ol_stats_t {
  5852. /** Num of tx packets that don't need to be checksummed */
  5853. uint32 tx_summed;
  5854. /* Num of tx packets where checksum is filled by offload engine */
  5855. uint32 tx_iph_fill;
  5856. uint32 tx_tcp_fill;
  5857. uint32 tx_udp_fill;
  5858. uint32 tx_icmp_fill;
  5859. /* Num of rx packets where toe finds out if checksum is good or bad */
  5860. uint32 rx_iph_good;
  5861. uint32 rx_iph_bad;
  5862. uint32 rx_tcp_good;
  5863. uint32 rx_tcp_bad;
  5864. uint32 rx_udp_good;
  5865. uint32 rx_udp_bad;
  5866. uint32 rx_icmp_good;
  5867. uint32 rx_icmp_bad;
  5868. /* Num of tx packets in which csum error is injected */
  5869. uint32 tx_tcp_errinj;
  5870. uint32 tx_udp_errinj;
  5871. uint32 tx_icmp_errinj;
  5872. /* Num of rx packets in which csum error is injected */
  5873. uint32 rx_tcp_errinj;
  5874. uint32 rx_udp_errinj;
  5875. uint32 rx_icmp_errinj;
  5876. };
  5877. /** Arp offload statistic counts */
  5878. struct arp_ol_stats_t {
  5879. uint32 host_ip_entries; /**< Host IP table addresses (more than one if multihomed) */
  5880. uint32 host_ip_overflow; /**< Host IP table additions skipped due to overflow */
  5881. uint32 arp_table_entries; /**< ARP table entries */
  5882. uint32 arp_table_overflow; /**< ARP table additions skipped due to overflow */
  5883. uint32 host_request; /**< ARP requests from host */
  5884. uint32 host_reply; /**< ARP replies from host */
  5885. uint32 host_service; /**< ARP requests from host serviced by ARP Agent */
  5886. uint32 peer_request; /**< ARP requests received from network */
  5887. uint32 peer_request_drop; /**< ARP requests from network that were dropped */
  5888. uint32 peer_reply; /**< ARP replies received from network */
  5889. uint32 peer_reply_drop; /**< ARP replies from network that were dropped */
  5890. uint32 peer_service; /**< ARP request from host serviced by ARP Agent */
  5891. };
  5892. /** NS offload statistic counts */
  5893. struct nd_ol_stats_t {
  5894. uint32 host_ip_entries; /**< Host IP table addresses (more than one if multihomed) */
  5895. uint32 host_ip_overflow; /**< Host IP table additions skipped due to overflow */
  5896. uint32 peer_request; /**< NS requests received from network */
  5897. uint32 peer_request_drop; /**< NS requests from network that were dropped */
  5898. uint32 peer_reply_drop; /**< NA replies from network that were dropped */
  5899. uint32 peer_service; /**< NS request from host serviced by firmware */
  5900. };
  5901. /*
  5902. * Neighbor Discovery Offloading
  5903. */
  5904. enum {
  5905. WL_ND_IPV6_ADDR_TYPE_UNICAST = 0,
  5906. WL_ND_IPV6_ADDR_TYPE_ANYCAST
  5907. };
  5908. typedef struct wl_nd_host_ip_addr {
  5909. struct ipv6_addr ip_addr; /* host ip address */
  5910. uint8 type; /* type of address */
  5911. uint8 pad[3];
  5912. } wl_nd_host_ip_addr_t;
  5913. typedef struct wl_nd_host_ip_list {
  5914. uint32 count;
  5915. wl_nd_host_ip_addr_t host_ip[1];
  5916. } wl_nd_host_ip_list_t;
  5917. #define WL_ND_HOSTIP_IOV_VER 1
  5918. enum {
  5919. WL_ND_HOSTIP_OP_VER = 0, /* get version */
  5920. WL_ND_HOSTIP_OP_ADD, /* add address */
  5921. WL_ND_HOSTIP_OP_DEL, /* delete specified address */
  5922. WL_ND_HOSTIP_OP_DEL_UC, /* delete all unicast address */
  5923. WL_ND_HOSTIP_OP_DEL_AC, /* delete all anycast address */
  5924. WL_ND_HOSTIP_OP_DEL_ALL, /* delete all addresses */
  5925. WL_ND_HOSTIP_OP_LIST, /* get list of host ip address */
  5926. WL_ND_HOSTIP_OP_MAX
  5927. };
  5928. typedef struct wl_nd_hostip {
  5929. uint16 version; /* version of iovar buf */
  5930. uint16 op_type; /* operation type */
  5931. uint32 length; /* length of entire structure */
  5932. union {
  5933. wl_nd_host_ip_addr_t host_ip; /* set param for add */
  5934. uint16 version; /* get return for ver */
  5935. } u;
  5936. } wl_nd_hostip_t;
  5937. #define WL_ND_HOSTIP_FIXED_LEN OFFSETOF(wl_nd_hostip_t, u)
  5938. #define WL_ND_HOSTIP_WITH_ADDR_LEN (WL_ND_HOSTIP_FIXED_LEN + sizeof(wl_nd_host_ip_addr_t))
  5939. /*
  5940. * Keep-alive packet offloading.
  5941. */
  5942. /**
  5943. * NAT keep-alive packets format: specifies the re-transmission period, the packet
  5944. * length, and packet contents.
  5945. */
  5946. typedef struct wl_keep_alive_pkt {
  5947. uint32 period_msec; /** Retransmission period (0 to disable packet re-transmits) */
  5948. uint16 len_bytes; /* Size of packet to transmit (0 to disable packet re-transmits) */
  5949. uint8 data[1]; /** Variable length packet to transmit. Contents should include
  5950. * entire ethernet packet (enet header, IP header, UDP header,
  5951. * and UDP payload) in network byte order.
  5952. */
  5953. } wl_keep_alive_pkt_t;
  5954. #define WL_KEEP_ALIVE_FIXED_LEN OFFSETOF(wl_keep_alive_pkt_t, data)
  5955. #define MAX_RSSI_COUNT 8
  5956. typedef struct rssi_struct {
  5957. int8 val[MAX_RSSI_COUNT]; /**< rssi values in AFs */
  5958. int16 sum; /**< total rssi sum */
  5959. uint8 cnt; /**< number rssi samples */
  5960. uint8 idx; /**< next rssi location */
  5961. } rssi_struct_t;
  5962. #ifdef WLDFSP
  5963. #define DFSP_EVT_OFFSET OFFSETOF(dfsp_event_data_t, ie)
  5964. #define DFSP_EVT_FLAGS_AP_ASSOC (1 << 0)
  5965. #define DFSP_EVT_FLAGS_AP_BCNMON (1 << 1)
  5966. #define DFSP_EVT_FLAGS_PROXY_BCSA (1 << 2)
  5967. #define DFSP_EVT_FLAGS_PROXY_UCSA (1 << 3)
  5968. #define DFSP_EVT_FLAGS_PROXY_PCSA (1 << 4)
  5969. typedef struct dfsp_event_data {
  5970. uint16 flags; /* indicate what triggers the event */
  5971. uint16 ie_len;
  5972. uint8 ie[]; /* variable length */
  5973. } dfsp_event_data_t;
  5974. /* Proxy Channel Switch Announcement is a collection of IEs */
  5975. typedef struct dfsp_pcsa {
  5976. dot11_ext_csa_ie_t ecsa;
  5977. dot11_mesh_csp_ie_t mcsp;
  5978. dot11_wide_bw_chan_switch_ie_t wbcs;
  5979. } dfsp_pcsa_t;
  5980. /* DFS Proxy */
  5981. #define DFSP_CFG_VERSION 1
  5982. #define DFSP_FLAGS_ENAB 0x1
  5983. typedef struct dfsp_cfg {
  5984. uint16 version;
  5985. uint16 len;
  5986. uint16 flags; /**< bit 1 to enable/disable the feature */
  5987. uint16 max_bcn_miss_dur; /**< maximum beacon miss duration before ceasing data tx */
  5988. uint8 mcsp_ttl; /**< remaining number of hops allowed for pcsa message */
  5989. uint8 bcsa_cnt; /**< repeat numbers of broadcast CSA */
  5990. chanspec_t mon_chan; /**< passive monitoring channel spec */
  5991. struct ether_addr mon_bssid; /**< broadcast means monitoring all */
  5992. uint16 max_bcn_miss_dur_af; /**< maximum beacon miss duration before ceasing AF tx */
  5993. } dfsp_cfg_t;
  5994. #define DFSP_UCSA_VERSION 1
  5995. typedef struct dfsp_ucsa {
  5996. uint16 version;
  5997. uint16 len;
  5998. struct ether_addr address;
  5999. uint8 enable;
  6000. uint8 retry_cnt; /**< just in case host needs to control the value */
  6001. } dfsp_ucsa_t;
  6002. typedef struct dfsp_ucsa_tbl {
  6003. uint8 tbl_num;
  6004. uint8 tbl[];
  6005. } dfsp_ucsa_tbl_t;
  6006. typedef struct dfsp_stats {
  6007. uint32 dfsp_csainfra;
  6008. uint32 dfsp_csabcnmon;
  6009. uint32 dfsp_bcsarx;
  6010. uint32 dfsp_ucsarx;
  6011. uint32 dfsp_pcsarx;
  6012. uint32 dfsp_bcsatx;
  6013. uint32 dfsp_ucsatx;
  6014. uint32 dfsp_pcsatx;
  6015. uint32 dfsp_ucsatxfail;
  6016. uint32 dfsp_evtnotif;
  6017. uint32 dfsp_evtsuspect;
  6018. uint32 dfsp_evtresume;
  6019. } dfsp_stats_t;
  6020. #endif /* WLDFSP */
  6021. /*
  6022. * ptk_start: iovar to start 4-way handshake for secured ranging
  6023. */
  6024. /* ptk negotiation security type - determines negotiation parameters */
  6025. typedef enum {
  6026. WL_PTK_START_SEC_TYPE_PMK = 1
  6027. } wl_ptk_start_sec_type_t;
  6028. /* ptk negotiation role */
  6029. typedef enum {
  6030. ROLE_NONE = 0x0,
  6031. ROLE_AUTH = 0x1,
  6032. ROLE_SUP = 0x2,
  6033. ROLE_STATIC = 0x3,
  6034. ROLE_INVALID = 0xff,
  6035. WL_PTK_START_ROLE_NONE = ROLE_NONE,
  6036. WL_PTK_START_ROLE_AUTH = ROLE_AUTH,
  6037. WL_PTK_START_ROLE_SUP = ROLE_SUP,
  6038. WL_PTK_START_ROLE_STATIC = ROLE_STATIC,
  6039. WL_PTK_START_ROLE_INVALID = ROLE_INVALID
  6040. } wl_ptk_start_role_t;
  6041. typedef struct wl_ptk_start_tlv {
  6042. uint16 id;
  6043. uint16 len;
  6044. uint8 data[1];
  6045. } wl_ptk_start_tlv_t;
  6046. typedef enum {
  6047. WL_PTK_START_TLV_PMK = 1 /* uint8[] */
  6048. } wl_ptk_start_tlv_type;
  6049. typedef enum {
  6050. WL_PTK_START_FLAG_NO_DATA_PROT = 1, /* data frame protection disabled */
  6051. WL_PTK_START_FLAG_GEN_FTM_TPK = 2 /* Generate FTM Toast/Seq Protection Key */
  6052. } wl_ptk_start_flags_t;
  6053. typedef struct wl_ptk_start_iov {
  6054. uint16 version;
  6055. uint16 len; /* length of entire iov from version */
  6056. wl_ptk_start_flags_t flags;
  6057. wl_ptk_start_sec_type_t sec_type;
  6058. wl_ptk_start_role_t role;
  6059. struct ether_addr peer_addr;
  6060. uint16 pad; /* reserved/32 bit alignment */
  6061. wl_ptk_start_tlv_t tlvs[1];
  6062. } wl_ptk_start_iov_t;
  6063. /*
  6064. * Dongle pattern matching filter.
  6065. */
  6066. #define MAX_WAKE_PACKET_CACHE_BYTES 128 /**< Maximum cached wake packet */
  6067. #define MAX_WAKE_PACKET_BYTES (DOT11_A3_HDR_LEN + \
  6068. DOT11_QOS_LEN + \
  6069. sizeof(struct dot11_llc_snap_header) + \
  6070. ETHER_MAX_DATA)
  6071. typedef struct pm_wake_packet {
  6072. uint32 status; /**< Is the wake reason a packet (if all the other field's valid) */
  6073. uint32 pattern_id; /**< Pattern ID that matched */
  6074. uint32 original_packet_size;
  6075. uint32 saved_packet_size;
  6076. uint8 packet[MAX_WAKE_PACKET_CACHE_BYTES];
  6077. } pm_wake_packet_t;
  6078. /* Packet filter types. Currently, only pattern matching is supported. */
  6079. typedef enum wl_pkt_filter_type {
  6080. WL_PKT_FILTER_TYPE_PATTERN_MATCH=0, /**< Pattern matching filter */
  6081. WL_PKT_FILTER_TYPE_MAGIC_PATTERN_MATCH=1, /**< Magic packet match */
  6082. WL_PKT_FILTER_TYPE_PATTERN_LIST_MATCH=2, /**< A pattern list (match all to match filter) */
  6083. WL_PKT_FILTER_TYPE_ENCRYPTED_PATTERN_MATCH=3, /**< SECURE WOWL magic / net pattern match */
  6084. WL_PKT_FILTER_TYPE_APF_MATCH=4, /* Android packet filter match */
  6085. WL_PKT_FILTER_TYPE_PATTERN_MATCH_TIMEOUT=5, /* Pattern matching filter with timeout event */
  6086. WL_PKT_FILTER_TYPE_IMMEDIATE_PATTERN_MATCH=6, /* Immediately pattern matching filter */
  6087. WL_PKT_FILTYER_TYPE_MAX = 7, /* Pkt filter type MAX */
  6088. } wl_pkt_filter_type_t;
  6089. #define WL_PKT_FILTER_TYPE wl_pkt_filter_type_t
  6090. /* String mapping for types that may be used by applications or debug */
  6091. #define WL_PKT_FILTER_TYPE_NAMES \
  6092. { "PATTERN", WL_PKT_FILTER_TYPE_PATTERN_MATCH }, \
  6093. { "MAGIC", WL_PKT_FILTER_TYPE_MAGIC_PATTERN_MATCH }, \
  6094. { "PATLIST", WL_PKT_FILTER_TYPE_PATTERN_LIST_MATCH }, \
  6095. { "SECURE WOWL", WL_PKT_FILTER_TYPE_ENCRYPTED_PATTERN_MATCH }, \
  6096. { "APF", WL_PKT_FILTER_TYPE_APF_MATCH }, \
  6097. { "PATTERN TIMEOUT", WL_PKT_FILTER_TYPE_PATTERN_MATCH_TIMEOUT }, \
  6098. { "IMMEDIATE", WL_PKT_FILTER_TYPE_IMMEDIATE_PATTERN_MATCH }
  6099. /** Secured WOWL packet was encrypted, need decrypted before check filter match */
  6100. typedef struct wl_pkt_decrypter {
  6101. uint8* (*dec_cb)(void* dec_ctx, const void *sdu, int sending);
  6102. void* dec_ctx;
  6103. } wl_pkt_decrypter_t;
  6104. /**
  6105. * Pattern matching filter. Specifies an offset within received packets to
  6106. * start matching, the pattern to match, the size of the pattern, and a bitmask
  6107. * that indicates which bits within the pattern should be matched.
  6108. */
  6109. typedef struct wl_pkt_filter_pattern {
  6110. uint32 offset; /**< Offset within received packet to start pattern matching.
  6111. * Offset '0' is the first byte of the ethernet header.
  6112. */
  6113. uint32 size_bytes; /**< Size of the pattern. Bitmask must be the same size. */
  6114. uint8 mask_and_pattern[]; /**< Variable length mask and pattern data. mask starts
  6115. * at offset 0. Pattern immediately follows mask. for
  6116. * secured pattern, put the descrypter pointer to the
  6117. * beginning, mask and pattern postponed correspondingly
  6118. */
  6119. } wl_pkt_filter_pattern_t;
  6120. /** A pattern list is a numerically specified list of modified pattern structures. */
  6121. typedef struct wl_pkt_filter_pattern_listel {
  6122. uint16 rel_offs; /**< Offset to begin match (relative to 'base' below) */
  6123. uint16 base_offs; /**< Base for offset (defined below) */
  6124. uint16 size_bytes; /**< Size of mask/pattern */
  6125. uint16 match_flags; /**< Addition flags controlling the match */
  6126. uint8 mask_and_data[]; /**< Variable length mask followed by data, each size_bytes */
  6127. } wl_pkt_filter_pattern_listel_t;
  6128. typedef struct wl_pkt_filter_pattern_list {
  6129. uint8 list_cnt; /**< Number of elements in the list */
  6130. uint8 PAD1[1]; /**< Reserved (possible version: reserved) */
  6131. uint16 totsize; /**< Total size of this pattern list (includes this struct) */
  6132. uint8 patterns[]; /**< Variable number of wl_pkt_filter_pattern_listel_t elements */
  6133. } wl_pkt_filter_pattern_list_t;
  6134. typedef struct wl_apf_program {
  6135. uint16 version;
  6136. uint16 instr_len; /* number of instruction blocks */
  6137. uint32 inst_ts; /* program installation timestamp */
  6138. uint8 instrs[]; /* variable length instructions */
  6139. } wl_apf_program_t;
  6140. typedef struct wl_pkt_filter_pattern_timeout {
  6141. uint32 offset; /* Offset within received packet to start pattern matching.
  6142. * Offset '0' is the first byte of the ethernet header.
  6143. */
  6144. uint32 size_bytes; /* Size of the pattern. Bitmask must be the same size. */
  6145. uint32 timeout; /* Timeout(seconds) */
  6146. uint8 mask_and_pattern[]; /* Variable length mask and pattern data.
  6147. * mask starts at offset 0. Pattern
  6148. * immediately follows mask.
  6149. */
  6150. } wl_pkt_filter_pattern_timeout_t;
  6151. /** IOVAR "pkt_filter_add" parameter. Used to install packet filters. */
  6152. typedef struct wl_pkt_filter {
  6153. uint32 id; /**< Unique filter id, specified by app. */
  6154. uint32 type; /**< Filter type (WL_PKT_FILTER_TYPE_xxx). */
  6155. uint32 negate_match; /**< Negate the result of filter matches */
  6156. union { /* Filter definitions */
  6157. wl_pkt_filter_pattern_t pattern; /**< Pattern matching filter */
  6158. wl_pkt_filter_pattern_list_t patlist; /**< List of patterns to match */
  6159. wl_apf_program_t apf_program; /* apf program */
  6160. wl_pkt_filter_pattern_timeout_t pattern_timeout; /* Pattern timeout event filter */
  6161. } u;
  6162. /* Do NOT add structure members after the filter definitions, since they
  6163. * may include variable length arrays.
  6164. */
  6165. } wl_pkt_filter_t;
  6166. /** IOVAR "tcp_keep_set" parameter. Used to install tcp keep_alive stuff. */
  6167. typedef struct wl_tcp_keep_set {
  6168. uint32 val1;
  6169. uint32 val2;
  6170. } wl_tcp_keep_set_t;
  6171. #define WL_PKT_FILTER_FIXED_LEN OFFSETOF(wl_pkt_filter_t, u)
  6172. #define WL_PKT_FILTER_PATTERN_FIXED_LEN OFFSETOF(wl_pkt_filter_pattern_t, mask_and_pattern)
  6173. #define WL_PKT_FILTER_PATTERN_LIST_FIXED_LEN OFFSETOF(wl_pkt_filter_pattern_list_t, patterns)
  6174. #define WL_PKT_FILTER_PATTERN_LISTEL_FIXED_LEN \
  6175. OFFSETOF(wl_pkt_filter_pattern_listel_t, mask_and_data)
  6176. #define WL_PKT_FILTER_PATTERN_TIMEOUT_FIXED_LEN \
  6177. OFFSETOF(wl_pkt_filter_pattern_timeout_t, mask_and_pattern)
  6178. #define WL_APF_INTERNAL_VERSION 1
  6179. #define WL_APF_PROGRAM_MAX_SIZE (2 * 1024)
  6180. #define WL_APF_PROGRAM_FIXED_LEN OFFSETOF(wl_apf_program_t, instrs)
  6181. #define WL_APF_PROGRAM_LEN(apf_program) \
  6182. ((apf_program)->instr_len * sizeof((apf_program)->instrs[0]))
  6183. #define WL_APF_PROGRAM_TOTAL_LEN(apf_program) \
  6184. (WL_APF_PROGRAM_FIXED_LEN + WL_APF_PROGRAM_LEN(apf_program))
  6185. /** IOVAR "pkt_filter_enable" parameter. */
  6186. typedef struct wl_pkt_filter_enable {
  6187. uint32 id; /**< Unique filter id */
  6188. uint32 enable; /**< Enable/disable bool */
  6189. } wl_pkt_filter_enable_t;
  6190. /** IOVAR "pkt_filter_list" parameter. Used to retrieve a list of installed filters. */
  6191. typedef struct wl_pkt_filter_list {
  6192. uint32 num; /**< Number of installed packet filters */
  6193. uint8 filter[]; /**< Variable array of packet filters. */
  6194. } wl_pkt_filter_list_t;
  6195. #define WL_PKT_FILTER_LIST_FIXED_LEN OFFSETOF(wl_pkt_filter_list_t, filter)
  6196. /** IOVAR "pkt_filter_stats" parameter. Used to retrieve debug statistics. */
  6197. typedef struct wl_pkt_filter_stats {
  6198. uint32 num_pkts_matched; /**< # filter matches for specified filter id */
  6199. uint32 num_pkts_forwarded; /**< # packets fwded from dongle to host for all filters */
  6200. uint32 num_pkts_discarded; /**< # packets discarded by dongle for all filters */
  6201. } wl_pkt_filter_stats_t;
  6202. /** IOVAR "pkt_filter_ports" parameter. Configure TCP/UDP port filters. */
  6203. typedef struct wl_pkt_filter_ports {
  6204. uint8 version; /**< Be proper */
  6205. uint8 reserved; /**< Be really proper */
  6206. uint16 count; /**< Number of ports following */
  6207. /* End of fixed data */
  6208. uint16 ports[1]; /**< Placeholder for ports[<count>] */
  6209. } wl_pkt_filter_ports_t;
  6210. #define WL_PKT_FILTER_PORTS_FIXED_LEN OFFSETOF(wl_pkt_filter_ports_t, ports)
  6211. #define WL_PKT_FILTER_PORTS_VERSION 0
  6212. #if defined(WL_PKT_FLTR_EXT) && !defined(WL_PKT_FLTR_EXT_DISABLED)
  6213. #define WL_PKT_FILTER_PORTS_MAX 256
  6214. #else
  6215. #define WL_PKT_FILTER_PORTS_MAX 128
  6216. #endif /* WL_PKT_FLTR_EXT && !WL_PKT_FLTR_EXT_DISABLED */
  6217. #define RSN_REPLAY_LEN 8
  6218. typedef struct _gtkrefresh {
  6219. uint8 KCK[RSN_KCK_LENGTH];
  6220. uint8 KEK[RSN_KEK_LENGTH];
  6221. uint8 ReplayCounter[RSN_REPLAY_LEN];
  6222. } gtk_keyinfo_t, *pgtk_keyinfo_t;
  6223. /** Sequential Commands ioctl */
  6224. typedef struct wl_seq_cmd_ioctl {
  6225. uint32 cmd; /**< common ioctl definition */
  6226. uint32 len; /**< length of user buffer */
  6227. } wl_seq_cmd_ioctl_t;
  6228. #define WL_SEQ_CMD_ALIGN_BYTES 4
  6229. /**
  6230. * These are the set of get IOCTLs that should be allowed when using
  6231. * IOCTL sequence commands. These are issued implicitly by wl.exe each time
  6232. * it is invoked. We never want to buffer these, or else wl.exe will stop working.
  6233. */
  6234. #define WL_SEQ_CMDS_GET_IOCTL_FILTER(cmd) \
  6235. (((cmd) == WLC_GET_MAGIC) || \
  6236. ((cmd) == WLC_GET_VERSION) || \
  6237. ((cmd) == WLC_GET_AP) || \
  6238. ((cmd) == WLC_GET_INSTANCE))
  6239. #define MAX_PKTENG_SWEEP_STEPS 40
  6240. typedef struct wl_pkteng {
  6241. uint32 flags;
  6242. uint32 delay; /**< Inter-packet delay */
  6243. uint32 nframes; /**< Number of frames */
  6244. uint32 length; /**< Packet length */
  6245. uint8 seqno; /**< Enable/disable sequence no. */
  6246. struct ether_addr dest; /**< Destination address */
  6247. struct ether_addr src; /**< Source address */
  6248. uint8 sweep_steps; /**< Number of sweep power */
  6249. uint8 PAD[2];
  6250. } wl_pkteng_t;
  6251. /* IOVAR pkteng_sweep_counters response structure */
  6252. #define WL_PKTENG_SWEEP_COUNTERS_VERSION 1
  6253. typedef struct wl_pkteng_sweep_ctrs {
  6254. uint16 version; /**< Version - 1 */
  6255. uint16 size; /**< Complete Size including sweep_counters */
  6256. uint16 sweep_steps; /**< Number of steps */
  6257. uint16 PAD;
  6258. uint16 sweep_counter[]; /**< Array of frame counters */
  6259. } wl_pkteng_sweep_ctrs_t;
  6260. /* IOVAR pkteng_rx_pkt response structure */
  6261. #define WL_PKTENG_RX_PKT_VERSION 1
  6262. typedef struct wl_pkteng_rx_pkt {
  6263. uint16 version; /**< Version - 1 */
  6264. uint16 size; /**< Complete Size including the packet */
  6265. uint8 payload[]; /**< Packet payload */
  6266. } wl_pkteng_rx_pkt_t;
  6267. #define WL_PKTENG_RU_FILL_VER_1 1u
  6268. #define WL_PKTENG_RU_FILL_VER_2 2u
  6269. // struct for ru packet engine
  6270. typedef struct wl_pkteng_ru_v1 {
  6271. uint16 version; /* ver is 1 */
  6272. uint16 length; /* size of complete structure */
  6273. uint8 bw; /* bandwidth info */
  6274. uint8 ru_alloc_val; /* ru allocation index number */
  6275. uint8 mcs_val; /* mcs allocated value */
  6276. uint8 nss_val; /* num of spatial streams */
  6277. uint32 num_bytes; /* approx num of bytes to calculate other required params */
  6278. uint8 cp_ltf_val ; /* GI and LTF symbol size */
  6279. uint8 he_ltf_symb ; /* num of HE-LTF symbols */
  6280. uint8 stbc; /* STBC support */
  6281. uint8 coding_val; /* BCC/LDPC coding support */
  6282. uint8 pe_category; /* PE duration 0/8/16usecs */
  6283. uint8 dcm; /* dual carrier modulation */
  6284. uint8 mumimo_ltfmode; /* ltf mode */
  6285. uint8 trig_tx; /* form and transmit the trigger frame */
  6286. uint8 trig_type; /* type of trigger frame */
  6287. uint8 trig_period; /* trigger tx periodicity TBD */
  6288. struct ether_addr dest; /* destination address for un-associated mode */
  6289. } wl_pkteng_ru_v1_t;
  6290. typedef struct wl_pkteng_ru_v2 {
  6291. uint16 version; /* ver is 1 */
  6292. uint16 length; /* size of complete structure */
  6293. uint8 bw; /* bandwidth info */
  6294. uint8 ru_alloc_val; /* ru allocation index number */
  6295. uint8 mcs_val; /* mcs allocated value */
  6296. uint8 nss_val; /* num of spatial streams */
  6297. uint32 num_bytes; /* approx num of bytes to calculate other required params */
  6298. struct ether_addr dest; /* destination address for un-associated mode */
  6299. uint8 cp_ltf_val ; /* GI and LTF symbol size */
  6300. uint8 he_ltf_symb ; /* num of HE-LTF symbols */
  6301. uint8 stbc; /* STBC support */
  6302. uint8 coding_val; /* BCC/LDPC coding support */
  6303. uint8 pe_category; /* PE duration 0/8/16usecs */
  6304. uint8 dcm; /* dual carrier modulation */
  6305. uint8 mumimo_ltfmode; /* ltf mode */
  6306. uint8 trig_tx; /* form and transmit the trigger frame */
  6307. uint8 trig_type; /* type of trigger frame */
  6308. uint8 trig_period; /* trigger tx periodicity TBD */
  6309. uint8 tgt_rssi; /* target rssi value in encoded format */
  6310. uint8 pad[3]; /* 3 byte padding to make structure size a multiple of 32bits */
  6311. } wl_pkteng_ru_v2_t;
  6312. #ifndef WL_PKTENG_RU_VER
  6313. /* App uses the latest version - source picks it up from wlc_types.h */
  6314. typedef wl_pkteng_ru_v2_t wl_pkteng_ru_fill_t;
  6315. #endif // endif
  6316. typedef struct wl_trig_frame_info {
  6317. /* Structure versioning and structure length params */
  6318. uint16 version;
  6319. uint16 length;
  6320. /* Below params are the fields related to trigger frame contents */
  6321. /* Common Info Params Figure 9-52d - 11ax Draft 1.1 */
  6322. uint16 lsig_len;
  6323. uint16 trigger_type;
  6324. uint16 cascade_indication;
  6325. uint16 cs_req;
  6326. uint16 bw;
  6327. uint16 cp_ltf_type;
  6328. uint16 mu_mimo_ltf_mode;
  6329. uint16 num_he_ltf_syms;
  6330. uint16 stbc;
  6331. uint16 ldpc_extra_symb;
  6332. uint16 ap_tx_pwr;
  6333. uint16 afactor;
  6334. uint16 pe_disambiguity;
  6335. uint16 spatial_resuse;
  6336. uint16 doppler;
  6337. uint16 he_siga_rsvd;
  6338. uint16 cmn_info_rsvd;
  6339. /* User Info Params Figure 9-52e - 11ax Draft 1.1 */
  6340. uint16 aid12;
  6341. uint16 ru_alloc;
  6342. uint16 coding_type;
  6343. uint16 mcs;
  6344. uint16 dcm;
  6345. uint16 ss_alloc;
  6346. uint16 tgt_rssi;
  6347. uint16 usr_info_rsvd;
  6348. } wl_trig_frame_info_t;
  6349. /* wl pkteng_stats related definitions */
  6350. #define WL_PKTENG_STATS_V1 (1)
  6351. #define WL_PKTENG_STATS_V2 (2)
  6352. typedef struct wl_pkteng_stats_v1 {
  6353. uint32 lostfrmcnt; /**< RX PER test: no of frames lost (skip seqno) */
  6354. int32 rssi; /**< RSSI */
  6355. int32 snr; /**< signal to noise ratio */
  6356. uint16 rxpktcnt[NUM_80211_RATES+1];
  6357. uint8 rssi_qdb; /**< qdB portion of the computed rssi */
  6358. uint8 version;
  6359. } wl_pkteng_stats_v1_t;
  6360. typedef struct wl_pkteng_stats_v2 {
  6361. uint32 lostfrmcnt; /**< RX PER test: no of frames lost (skip seqno) */
  6362. int32 rssi; /**< RSSI */
  6363. int32 snr; /**< signal to noise ratio */
  6364. uint16 rxpktcnt[NUM_80211_RATES+1];
  6365. uint8 rssi_qdb; /**< qdB portion of the computed rssi */
  6366. uint8 version;
  6367. uint16 length;
  6368. uint16 pad;
  6369. int32 rssi_per_core[WL_RSSI_ANT_MAX];
  6370. int32 rssi_per_core_qdb[WL_RSSI_ANT_MAX];
  6371. } wl_pkteng_stats_v2_t;
  6372. #ifndef WL_PKTENG_STATS_TYPEDEF_HAS_ALIAS
  6373. typedef wl_pkteng_stats_v1_t wl_pkteng_stats_t;
  6374. #endif /* WL_PKTENG_STATS_TYPEDEF_HAS_ALIAS */
  6375. typedef struct wl_txcal_params {
  6376. wl_pkteng_t pkteng;
  6377. uint8 gidx_start;
  6378. int8 gidx_step;
  6379. uint8 gidx_stop;
  6380. uint8 PAD;
  6381. } wl_txcal_params_t;
  6382. typedef struct wl_txcal_gainidx {
  6383. uint8 num_actv_cores;
  6384. uint8 gidx_start_percore[WL_STA_ANT_MAX];
  6385. uint8 gidx_stop_percore[WL_STA_ANT_MAX];
  6386. uint8 PAD[3];
  6387. } wl_txcal_gainidx_t;
  6388. typedef struct wl_txcal_params_v2 {
  6389. wl_pkteng_t pkteng;
  6390. int8 gidx_step;
  6391. uint8 pwr_start[WL_STA_ANT_MAX];
  6392. uint8 pwr_stop[WL_STA_ANT_MAX];
  6393. uint8 init_start_idx;
  6394. uint8 gidx_start_percore[WL_STA_ANT_MAX];
  6395. uint8 gidx_stop_percore[WL_STA_ANT_MAX];
  6396. uint16 version;
  6397. } wl_txcal_params_v2_t;
  6398. typedef wl_txcal_params_t wl_txcal_params_v1_t;
  6399. typedef struct wl_rssilog_params {
  6400. uint8 enable;
  6401. uint8 rssi_threshold;
  6402. uint8 time_threshold;
  6403. uint8 pad;
  6404. } wl_rssilog_params_t;
  6405. typedef struct wl_sslpnphy_papd_debug_data {
  6406. uint8 psat_pwr;
  6407. uint8 psat_indx;
  6408. uint8 final_idx;
  6409. uint8 start_idx;
  6410. int32 min_phase;
  6411. int32 voltage;
  6412. int8 temperature;
  6413. uint8 PAD[3];
  6414. } wl_sslpnphy_papd_debug_data_t;
  6415. typedef struct wl_sslpnphy_debug_data {
  6416. int16 papdcompRe [64];
  6417. int16 papdcompIm [64];
  6418. } wl_sslpnphy_debug_data_t;
  6419. typedef struct wl_sslpnphy_spbdump_data {
  6420. uint16 tbl_length;
  6421. int16 spbreal[256];
  6422. int16 spbimg[256];
  6423. } wl_sslpnphy_spbdump_data_t;
  6424. typedef struct wl_sslpnphy_percal_debug_data {
  6425. uint32 cur_idx;
  6426. uint32 tx_drift;
  6427. uint8 prev_cal_idx;
  6428. uint8 PAD[3];
  6429. uint32 percal_ctr;
  6430. int32 nxt_cal_idx;
  6431. uint32 force_1idxcal;
  6432. uint32 onedxacl_req;
  6433. int32 last_cal_volt;
  6434. int8 last_cal_temp;
  6435. uint8 PAD[3];
  6436. uint32 vbat_ripple;
  6437. uint32 exit_route;
  6438. int32 volt_winner;
  6439. } wl_sslpnphy_percal_debug_data_t;
  6440. typedef enum {
  6441. wowl_pattern_type_bitmap = 0,
  6442. wowl_pattern_type_arp,
  6443. wowl_pattern_type_na
  6444. } wowl_pattern_type_t;
  6445. typedef struct wl_wowl_pattern {
  6446. uint32 masksize; /**< Size of the mask in #of bytes */
  6447. uint32 offset; /**< Pattern byte offset in packet */
  6448. uint32 patternoffset; /**< Offset of start of pattern in the structure */
  6449. uint32 patternsize; /**< Size of the pattern itself in #of bytes */
  6450. uint32 id; /**< id */
  6451. uint32 reasonsize; /**< Size of the wakeup reason code */
  6452. wowl_pattern_type_t type; /**< Type of pattern */
  6453. /* Mask follows the structure above */
  6454. /* Pattern follows the mask is at 'patternoffset' from the start */
  6455. } wl_wowl_pattern_t;
  6456. typedef struct wl_wowl_pattern_list {
  6457. uint32 count;
  6458. wl_wowl_pattern_t pattern[1];
  6459. } wl_wowl_pattern_list_t;
  6460. typedef struct wl_wowl_wakeind {
  6461. uint8 pci_wakeind; /**< Whether PCI PMECSR PMEStatus bit was set */
  6462. uint32 ucode_wakeind; /**< What wakeup-event indication was set by ucode */
  6463. } wl_wowl_wakeind_t;
  6464. /** per AC rate control related data structure */
  6465. typedef struct wl_txrate_class {
  6466. uint8 init_rate;
  6467. uint8 min_rate;
  6468. uint8 max_rate;
  6469. } wl_txrate_class_t;
  6470. /** structure for Overlap BSS scan arguments */
  6471. typedef struct wl_obss_scan_arg {
  6472. int16 passive_dwell;
  6473. int16 active_dwell;
  6474. int16 bss_widthscan_interval;
  6475. int16 passive_total;
  6476. int16 active_total;
  6477. int16 chanwidth_transition_delay;
  6478. int16 activity_threshold;
  6479. } wl_obss_scan_arg_t;
  6480. #define WL_OBSS_SCAN_PARAM_LEN sizeof(wl_obss_scan_arg_t)
  6481. /** RSSI event notification configuration. */
  6482. typedef struct wl_rssi_event {
  6483. uint32 rate_limit_msec; /**< # of events posted to application will be limited to
  6484. * one per specified period (0 to disable rate limit).
  6485. */
  6486. uint8 num_rssi_levels; /**< Number of entries in rssi_levels[] below */
  6487. int8 rssi_levels[MAX_RSSI_LEVELS]; /**< Variable number of RSSI levels. An event
  6488. * will be posted each time the RSSI of received
  6489. * beacons/packets crosses a level.
  6490. */
  6491. int8 pad[3];
  6492. } wl_rssi_event_t;
  6493. #define RSSI_MONITOR_VERSION 1
  6494. #define RSSI_MONITOR_STOP (1 << 0)
  6495. typedef struct wl_rssi_monitor_cfg {
  6496. uint8 version;
  6497. uint8 flags;
  6498. int8 max_rssi;
  6499. int8 min_rssi;
  6500. } wl_rssi_monitor_cfg_t;
  6501. typedef struct wl_rssi_monitor_evt {
  6502. uint8 version;
  6503. int8 cur_rssi;
  6504. uint16 pad;
  6505. } wl_rssi_monitor_evt_t;
  6506. /* CCA based channel quality event configuration (ID values for both config and report) */
  6507. #define WL_CHAN_QUAL_CCA 0
  6508. #define WL_CHAN_QUAL_NF 1
  6509. #define WL_CHAN_QUAL_NF_LTE 2
  6510. #define WL_CHAN_QUAL_TOTAL 3 /* The total IDs supported in both config and report */
  6511. /* Additional channel quality event support in report only (>= 0x100)
  6512. * Notice that uint8 is used in configuration struct wl_chan_qual_metric_t, but uint16 is
  6513. * used for report in struct cca_chan_qual_event_t. So the ID values beyond 8-bit are used
  6514. * for reporting purpose only.
  6515. */
  6516. #define WL_CHAN_QUAL_FULL_CCA (0x100u | WL_CHAN_QUAL_CCA) /* CCA: ibss vs. obss */
  6517. #define WL_CHAN_QUAL_FULLPM_CCA (0x200u | WL_CHAN_QUAL_CCA) /* CCA: me vs. notme, PM vs. !PM */
  6518. #define MAX_CHAN_QUAL_LEVELS 8
  6519. typedef struct wl_chan_qual_metric {
  6520. uint8 id; /**< metric ID */
  6521. uint8 num_levels; /**< Number of entries in rssi_levels[] below */
  6522. uint16 flags;
  6523. int16 htol[MAX_CHAN_QUAL_LEVELS]; /**< threshold level array: hi-to-lo */
  6524. int16 ltoh[MAX_CHAN_QUAL_LEVELS]; /**< threshold level array: lo-to-hi */
  6525. } wl_chan_qual_metric_t;
  6526. typedef struct wl_chan_qual_event {
  6527. uint32 rate_limit_msec; /**< # of events posted to application will be limited to
  6528. * one per specified period (0 to disable rate limit).
  6529. */
  6530. uint16 flags;
  6531. uint16 num_metrics;
  6532. wl_chan_qual_metric_t metric[WL_CHAN_QUAL_TOTAL]; /**< metric array */
  6533. } wl_chan_qual_event_t;
  6534. typedef struct wl_action_obss_coex_req {
  6535. uint8 info;
  6536. uint8 num;
  6537. uint8 ch_list[1];
  6538. } wl_action_obss_coex_req_t;
  6539. /** IOVar parameter block for small MAC address array with type indicator */
  6540. #define WL_IOV_MAC_PARAM_LEN 4
  6541. /** This value is hardcoded to be 16 and MUST match PKTQ_MAX_PREC value defined elsewhere */
  6542. #define WL_IOV_PKTQ_LOG_PRECS 16
  6543. #include <packed_section_start.h>
  6544. typedef BWL_PRE_PACKED_STRUCT struct {
  6545. uint32 num_addrs;
  6546. uint8 addr_type[WL_IOV_MAC_PARAM_LEN];
  6547. struct ether_addr ea[WL_IOV_MAC_PARAM_LEN];
  6548. } BWL_POST_PACKED_STRUCT wl_iov_mac_params_t;
  6549. #include <packed_section_end.h>
  6550. /** This is extra info that follows wl_iov_mac_params_t */
  6551. typedef struct {
  6552. uint32 addr_info[WL_IOV_MAC_PARAM_LEN];
  6553. } wl_iov_mac_extra_params_t;
  6554. /** Combined structure */
  6555. typedef struct {
  6556. wl_iov_mac_params_t params;
  6557. wl_iov_mac_extra_params_t extra_params;
  6558. } wl_iov_mac_full_params_t;
  6559. /** Parameter block for PKTQ_LOG statistics */
  6560. /* NOTE: this structure cannot change! It is exported to wlu as a binary format
  6561. * A new format revision number must be created if the interface changes
  6562. * The latest is v05; previous v01...v03 are no longer supported, v04 has
  6563. * common base with v05
  6564. */
  6565. #define PKTQ_LOG_COUNTERS_V4 \
  6566. /* packets requested to be stored */ \
  6567. uint32 requested; \
  6568. /* packets stored */ \
  6569. uint32 stored; \
  6570. /* packets saved, because a lowest priority queue has given away one packet */ \
  6571. uint32 saved; \
  6572. /* packets saved, because an older packet from the same queue has been dropped */ \
  6573. uint32 selfsaved; \
  6574. /* packets dropped, because pktq is full with higher precedence packets */ \
  6575. uint32 full_dropped; \
  6576. /* packets dropped because pktq per that precedence is full */ \
  6577. uint32 dropped; \
  6578. /* packets dropped, in order to save one from a queue of a highest priority */ \
  6579. uint32 sacrificed; \
  6580. /* packets droped because of hardware/transmission error */ \
  6581. uint32 busy; \
  6582. /* packets re-sent because they were not received */ \
  6583. uint32 retry; \
  6584. /* packets retried again (ps pretend) prior to moving power save mode */ \
  6585. uint32 ps_retry; \
  6586. /* suppressed packet count */ \
  6587. uint32 suppress; \
  6588. /* packets finally dropped after retry limit */ \
  6589. uint32 retry_drop; \
  6590. /* the high-water mark of the queue capacity for packets - goes to zero as queue fills */ \
  6591. uint32 max_avail; \
  6592. /* the high-water mark of the queue utilisation for packets - ('inverse' of max_avail) */ \
  6593. uint32 max_used; \
  6594. /* the maximum capacity of the queue */ \
  6595. uint32 queue_capacity; \
  6596. /* count of rts attempts that failed to receive cts */ \
  6597. uint32 rtsfail; \
  6598. /* count of packets sent (acked) successfully */ \
  6599. uint32 acked; \
  6600. /* running total of phy rate of packets sent successfully */ \
  6601. uint32 txrate_succ; \
  6602. /* running total of phy 'main' rate */ \
  6603. uint32 txrate_main; \
  6604. /* actual data transferred successfully */ \
  6605. uint32 throughput; \
  6606. /* time difference since last pktq_stats */ \
  6607. uint32 time_delta;
  6608. typedef struct {
  6609. PKTQ_LOG_COUNTERS_V4
  6610. } pktq_log_counters_v04_t;
  6611. /** v5 is the same as V4 with extra parameter */
  6612. typedef struct {
  6613. PKTQ_LOG_COUNTERS_V4
  6614. /** cumulative time to transmit */
  6615. uint32 airtime;
  6616. } pktq_log_counters_v05_t;
  6617. typedef struct {
  6618. uint8 num_prec[WL_IOV_MAC_PARAM_LEN];
  6619. pktq_log_counters_v04_t counters[WL_IOV_MAC_PARAM_LEN][WL_IOV_PKTQ_LOG_PRECS];
  6620. uint32 counter_info[WL_IOV_MAC_PARAM_LEN];
  6621. uint32 pspretend_time_delta[WL_IOV_MAC_PARAM_LEN];
  6622. char headings[];
  6623. } pktq_log_format_v04_t;
  6624. typedef struct {
  6625. uint8 num_prec[WL_IOV_MAC_PARAM_LEN];
  6626. pktq_log_counters_v05_t counters[WL_IOV_MAC_PARAM_LEN][WL_IOV_PKTQ_LOG_PRECS];
  6627. uint32 counter_info[WL_IOV_MAC_PARAM_LEN];
  6628. uint32 pspretend_time_delta[WL_IOV_MAC_PARAM_LEN];
  6629. char headings[];
  6630. } pktq_log_format_v05_t;
  6631. typedef struct {
  6632. uint32 version;
  6633. wl_iov_mac_params_t params;
  6634. union {
  6635. pktq_log_format_v04_t v04;
  6636. pktq_log_format_v05_t v05;
  6637. } pktq_log;
  6638. } wl_iov_pktq_log_t;
  6639. /* PKTQ_LOG_AUTO, PKTQ_LOG_DEF_PREC flags introduced in v05, they are ignored by v04 */
  6640. #define PKTQ_LOG_AUTO (1 << 31)
  6641. #define PKTQ_LOG_DEF_PREC (1 << 30)
  6642. typedef struct wl_pfn_macaddr_cfg_0 {
  6643. uint8 version;
  6644. uint8 reserved;
  6645. struct ether_addr macaddr;
  6646. } wl_pfn_macaddr_cfg_0_t;
  6647. #define LEGACY1_WL_PFN_MACADDR_CFG_VER 0
  6648. #define WL_PFN_MAC_OUI_ONLY_MASK 1
  6649. #define WL_PFN_SET_MAC_UNASSOC_MASK 2
  6650. #define WL_PFN_RESTRICT_LA_MAC_MASK 4
  6651. #define WL_PFN_MACADDR_FLAG_MASK 0x7
  6652. /** To configure pfn_macaddr */
  6653. typedef struct wl_pfn_macaddr_cfg {
  6654. uint8 version;
  6655. uint8 flags;
  6656. struct ether_addr macaddr;
  6657. } wl_pfn_macaddr_cfg_t;
  6658. #define WL_PFN_MACADDR_CFG_VER 1
  6659. /*
  6660. * SCB_BS_DATA iovar definitions start.
  6661. */
  6662. #define SCB_BS_DATA_STRUCT_VERSION 1
  6663. /** The actual counters maintained for each station */
  6664. typedef struct {
  6665. /* The following counters are a subset of what pktq_stats provides per precedence. */
  6666. uint32 retry; /**< packets re-sent because they were not received */
  6667. uint32 retry_drop; /**< packets finally dropped after retry limit */
  6668. uint32 rtsfail; /**< count of rts attempts that failed to receive cts */
  6669. uint32 acked; /**< count of packets sent (acked) successfully */
  6670. uint32 txrate_succ; /**< running total of phy rate of packets sent successfully */
  6671. uint32 txrate_main; /**< running total of phy 'main' rate */
  6672. uint32 throughput; /**< actual data transferred successfully */
  6673. uint32 time_delta; /**< time difference since last pktq_stats */
  6674. uint32 airtime; /**< cumulative total medium access delay in useconds */
  6675. } iov_bs_data_counters_t;
  6676. /** The structure for individual station information. */
  6677. #include <packed_section_start.h>
  6678. typedef BWL_PRE_PACKED_STRUCT struct {
  6679. struct ether_addr station_address; /**< The station MAC address */
  6680. uint16 station_flags; /**< Bit mask of flags, for future use. */
  6681. iov_bs_data_counters_t station_counters; /**< The actual counter values */
  6682. } BWL_POST_PACKED_STRUCT iov_bs_data_record_t;
  6683. #include <packed_section_end.h>
  6684. #include <packed_section_start.h>
  6685. typedef BWL_PRE_PACKED_STRUCT struct {
  6686. uint16 structure_version; /**< Structure version number (for wl/wlu matching) */
  6687. uint16 structure_count; /**< Number of iov_bs_data_record_t records following */
  6688. iov_bs_data_record_t structure_record[1]; /**< 0 - structure_count records */
  6689. } BWL_POST_PACKED_STRUCT iov_bs_data_struct_t;
  6690. #include <packed_section_end.h>
  6691. /* Bitmask of options that can be passed in to the iovar. */
  6692. enum {
  6693. SCB_BS_DATA_FLAG_NO_RESET = (1<<0) /**< Do not clear the counters after reading */
  6694. };
  6695. /*
  6696. * SCB_BS_DATA iovar definitions end.
  6697. */
  6698. typedef struct wlc_extlog_cfg {
  6699. int32 max_number;
  6700. uint16 module; /**< bitmap */
  6701. uint8 level;
  6702. uint8 flag;
  6703. uint16 version;
  6704. uint16 PAD;
  6705. } wlc_extlog_cfg_t;
  6706. typedef struct log_record {
  6707. uint32 time;
  6708. uint16 module;
  6709. uint16 id;
  6710. uint8 level;
  6711. uint8 sub_unit;
  6712. uint8 seq_num;
  6713. uint8 pad;
  6714. int32 arg;
  6715. char str[MAX_ARGSTR_LEN];
  6716. char PAD[4-MAX_ARGSTR_LEN%4];
  6717. } log_record_t;
  6718. typedef struct wlc_extlog_req {
  6719. uint32 from_last;
  6720. uint32 num;
  6721. } wlc_extlog_req_t;
  6722. typedef struct wlc_extlog_results {
  6723. uint16 version;
  6724. uint16 record_len;
  6725. uint32 num;
  6726. log_record_t logs[1];
  6727. } wlc_extlog_results_t;
  6728. typedef struct log_idstr {
  6729. uint16 id;
  6730. uint16 flag;
  6731. uint8 arg_type;
  6732. const char *fmt_str;
  6733. } log_idstr_t;
  6734. #define FMTSTRF_USER 1
  6735. /* flat ID definitions
  6736. * New definitions HAVE TO BE ADDED at the end of the table. Otherwise, it will
  6737. * affect backward compatibility with pre-existing apps
  6738. */
  6739. typedef enum {
  6740. FMTSTR_DRIVER_UP_ID = 0,
  6741. FMTSTR_DRIVER_DOWN_ID = 1,
  6742. FMTSTR_SUSPEND_MAC_FAIL_ID = 2,
  6743. FMTSTR_NO_PROGRESS_ID = 3,
  6744. FMTSTR_RFDISABLE_ID = 4,
  6745. FMTSTR_REG_PRINT_ID = 5,
  6746. FMTSTR_EXPTIME_ID = 6,
  6747. FMTSTR_JOIN_START_ID = 7,
  6748. FMTSTR_JOIN_COMPLETE_ID = 8,
  6749. FMTSTR_NO_NETWORKS_ID = 9,
  6750. FMTSTR_SECURITY_MISMATCH_ID = 10,
  6751. FMTSTR_RATE_MISMATCH_ID = 11,
  6752. FMTSTR_AP_PRUNED_ID = 12,
  6753. FMTSTR_KEY_INSERTED_ID = 13,
  6754. FMTSTR_DEAUTH_ID = 14,
  6755. FMTSTR_DISASSOC_ID = 15,
  6756. FMTSTR_LINK_UP_ID = 16,
  6757. FMTSTR_LINK_DOWN_ID = 17,
  6758. FMTSTR_RADIO_HW_OFF_ID = 18,
  6759. FMTSTR_RADIO_HW_ON_ID = 19,
  6760. FMTSTR_EVENT_DESC_ID = 20,
  6761. FMTSTR_PNP_SET_POWER_ID = 21,
  6762. FMTSTR_RADIO_SW_OFF_ID = 22,
  6763. FMTSTR_RADIO_SW_ON_ID = 23,
  6764. FMTSTR_PWD_MISMATCH_ID = 24,
  6765. FMTSTR_FATAL_ERROR_ID = 25,
  6766. FMTSTR_AUTH_FAIL_ID = 26,
  6767. FMTSTR_ASSOC_FAIL_ID = 27,
  6768. FMTSTR_IBSS_FAIL_ID = 28,
  6769. FMTSTR_EXTAP_FAIL_ID = 29,
  6770. FMTSTR_MAX_ID
  6771. } log_fmtstr_id_t;
  6772. /** 11k Neighbor Report element (unversioned, deprecated) */
  6773. typedef struct nbr_element {
  6774. uint8 id;
  6775. uint8 len;
  6776. struct ether_addr bssid;
  6777. uint32 bssid_info;
  6778. uint8 reg;
  6779. uint8 channel;
  6780. uint8 phytype;
  6781. uint8 pad;
  6782. } nbr_element_t;
  6783. #define NBR_ADD_STATIC 0
  6784. #define NBR_ADD_DYNAMIC 1
  6785. #define WL_RRM_NBR_RPT_VER 1
  6786. #define WL_NBR_RPT_FLAG_BSS_PREF_FROM_AP 0x01
  6787. /** 11k Neighbor Report element */
  6788. typedef struct nbr_rpt_elem {
  6789. uint8 version;
  6790. uint8 id;
  6791. uint8 len;
  6792. uint8 pad;
  6793. struct ether_addr bssid;
  6794. uint8 pad_1[2];
  6795. uint32 bssid_info;
  6796. uint8 reg;
  6797. uint8 channel;
  6798. uint8 phytype;
  6799. uint8 addtype; /* static for manual add or dynamic if auto-learning of neighbors */
  6800. wlc_ssid_t ssid;
  6801. chanspec_t chanspec;
  6802. uint8 bss_trans_preference;
  6803. uint8 flags;
  6804. } nbr_rpt_elem_t;
  6805. typedef enum event_msgs_ext_command {
  6806. EVENTMSGS_NONE = 0,
  6807. EVENTMSGS_SET_BIT = 1,
  6808. EVENTMSGS_RESET_BIT = 2,
  6809. EVENTMSGS_SET_MASK = 3
  6810. } event_msgs_ext_command_t;
  6811. #define EVENTMSGS_VER 1
  6812. #define EVENTMSGS_EXT_STRUCT_SIZE OFFSETOF(eventmsgs_ext_t, mask[0])
  6813. /* len- for SET it would be mask size from the application to the firmware */
  6814. /* for GET it would be actual firmware mask size */
  6815. /* maxgetsize - is only used for GET. indicate max mask size that the */
  6816. /* application can read from the firmware */
  6817. typedef struct eventmsgs_ext
  6818. {
  6819. uint8 ver;
  6820. uint8 command;
  6821. uint8 len;
  6822. uint8 maxgetsize;
  6823. uint8 mask[1];
  6824. } eventmsgs_ext_t;
  6825. #include <packed_section_start.h>
  6826. typedef BWL_PRE_PACKED_STRUCT struct pcie_bus_tput_params {
  6827. /** no of host dma descriptors programmed by the firmware before a commit */
  6828. uint16 max_dma_descriptors;
  6829. uint16 host_buf_len; /**< length of host buffer */
  6830. dmaaddr_t host_buf_addr; /**< physical address for bus_throughput_buf */
  6831. } BWL_POST_PACKED_STRUCT pcie_bus_tput_params_t;
  6832. #include <packed_section_end.h>
  6833. typedef struct pcie_bus_tput_stats {
  6834. uint16 time_taken; /**< no of secs the test is run */
  6835. uint16 nbytes_per_descriptor; /**< no of bytes of data dma ed per descriptor */
  6836. /** no of desciptors for which dma is sucessfully completed within the test time */
  6837. uint32 count;
  6838. } pcie_bus_tput_stats_t;
  6839. #define HOST_WAKEUP_DATA_VER 1
  6840. #include <packed_section_start.h>
  6841. /* Bus interface host wakeup data */
  6842. typedef BWL_PRE_PACKED_STRUCT struct wl_host_wakeup_data {
  6843. uint16 ver;
  6844. uint16 len;
  6845. uchar data[1]; /* wakeup data */
  6846. } BWL_POST_PACKED_STRUCT wl_host_wakeup_data_t;
  6847. #include <packed_section_end.h>
  6848. #define HOST_WAKEUP_DATA_VER_2 2
  6849. #include <packed_section_start.h>
  6850. /* Bus interface host wakeup data */
  6851. typedef BWL_PRE_PACKED_STRUCT struct wl_host_wakeup_data_v2 {
  6852. uint16 ver;
  6853. uint16 len;
  6854. uint32 gpio_toggle_time; /* gpio toggle time in ms */
  6855. uchar data[1]; /* wakeup data */
  6856. } BWL_POST_PACKED_STRUCT wl_host_wakeup_data_v2_t;
  6857. #include <packed_section_end.h>
  6858. typedef struct keepalives_max_idle {
  6859. uint16 keepalive_count; /**< nmbr of keepalives per bss_max_idle period */
  6860. uint8 mkeepalive_index; /**< mkeepalive_index for keepalive frame to be used */
  6861. uint8 PAD; /**< to align next field */
  6862. uint16 max_interval; /**< seconds */
  6863. } keepalives_max_idle_t;
  6864. #define PM_IGNORE_BCMC_PROXY_ARP (1 << 0)
  6865. #define PM_IGNORE_BCMC_ALL_DMS_ACCEPTED (1 << 1)
  6866. /* ##### HMAP section ##### */
  6867. #define PCIE_MAX_HMAP_WINDOWS 8
  6868. #define PCIE_HMAPTEST_VERSION 2
  6869. #define HMAPTEST_INVALID_OFFSET 0xFFFFFFFFu
  6870. #define HMAPTEST_DEFAULT_WRITE_PATTERN 0xBABECAFEu
  6871. #define HMAPTEST_ACCESS_ARM 0
  6872. #define HMAPTEST_ACCESS_M2M 1
  6873. #define HMAPTEST_ACCESS_D11 2
  6874. #define HMAPTEST_ACCESS_NONE 3
  6875. typedef struct pcie_hmaptest {
  6876. uint16 version; /* Version */
  6877. uint16 length; /* Length of entire structure */
  6878. uint32 xfer_len;
  6879. uint32 accesstype;
  6880. uint32 is_write;
  6881. uint32 is_invalid;
  6882. uint32 host_addr_hi;
  6883. uint32 host_addr_lo;
  6884. uint32 host_offset;
  6885. uint32 value; /* 4 byte value to be filled in case of write access test */
  6886. uint32 delay; /* wait time in seconds before initiating access from dongle */
  6887. } pcie_hmaptest_t;
  6888. /* HMAP window register set */
  6889. typedef struct hmapwindow {
  6890. uint32 baseaddr_lo; /* BaseAddrLower */
  6891. uint32 baseaddr_hi; /* BaseAddrUpper */
  6892. uint32 windowlength; /* Window Length */
  6893. } hmapwindow_t;
  6894. #define PCIE_HMAP_VERSION 1
  6895. typedef struct pcie_hmap {
  6896. uint16 version; /**< Version */
  6897. uint16 length; /**< Length of entire structure */
  6898. uint32 enable; /**< status of HMAP enabled/disabled */
  6899. uint32 nwindows; /* no. of HMAP windows enabled */
  6900. uint32 window_config; /* HMAP window_config register */
  6901. uint32 hmap_violationaddr_lo; /* violating address lo */
  6902. uint32 hmap_violationaddr_hi; /* violating addr hi */
  6903. uint32 hmap_violation_info; /* violation info */
  6904. hmapwindow_t hwindows[]; /* Multiple hwindows */
  6905. } pcie_hmap_t;
  6906. /* ##### Power Stats section ##### */
  6907. #define WL_PWRSTATS_VERSION 2
  6908. /** Input structure for pwrstats IOVAR */
  6909. typedef struct wl_pwrstats_query {
  6910. uint16 length; /**< Number of entries in type array. */
  6911. uint16 type[1]; /**< Types (tags) to retrieve.
  6912. * Length 0 (no types) means get all.
  6913. */
  6914. } wl_pwrstats_query_t;
  6915. /** This structure is for version 2; version 1 will be deprecated in by FW */
  6916. #include <packed_section_start.h>
  6917. typedef BWL_PRE_PACKED_STRUCT struct wl_pwrstats {
  6918. uint16 version; /**< Version = 2 is TLV format */
  6919. uint16 length; /**< Length of entire structure */
  6920. uint8 data[1]; /**< TLV data, a series of structures,
  6921. * each starting with type and length.
  6922. *
  6923. * Padded as necessary so each section
  6924. * starts on a 4-byte boundary.
  6925. *
  6926. * Both type and len are uint16, but the
  6927. * upper nibble of length is reserved so
  6928. * valid len values are 0-4095.
  6929. */
  6930. } BWL_POST_PACKED_STRUCT wl_pwrstats_t;
  6931. #include <packed_section_end.h>
  6932. #define WL_PWR_STATS_HDRLEN OFFSETOF(wl_pwrstats_t, data)
  6933. /* Bits for wake reasons */
  6934. #define WLC_PMD_WAKE_SET 0x1
  6935. #define WLC_PMD_PM_AWAKE_BCN 0x2
  6936. /* BIT:3 is no longer being used */
  6937. #define WLC_PMD_SCAN_IN_PROGRESS 0x8
  6938. #define WLC_PMD_RM_IN_PROGRESS 0x10
  6939. #define WLC_PMD_AS_IN_PROGRESS 0x20
  6940. #define WLC_PMD_PM_PEND 0x40
  6941. #define WLC_PMD_PS_POLL 0x80
  6942. #define WLC_PMD_CHK_UNALIGN_TBTT 0x100
  6943. #define WLC_PMD_APSD_STA_UP 0x200
  6944. #define WLC_PMD_TX_PEND_WAR 0x400 /* obsolete, can be reused */
  6945. #define WLC_PMD_NAN_AWAKE 0x400 /* Reusing for NAN */
  6946. #define WLC_PMD_GPTIMER_STAY_AWAKE 0x800
  6947. #define WLC_PMD_PM2_RADIO_SOFF_PEND 0x2000
  6948. #define WLC_PMD_NON_PRIM_STA_UP 0x4000
  6949. #define WLC_PMD_AP_UP 0x8000
  6950. typedef struct wlc_pm_debug {
  6951. uint32 timestamp; /**< timestamp in millisecond */
  6952. uint32 reason; /**< reason(s) for staying awake */
  6953. } wlc_pm_debug_t;
  6954. /** WL_PWRSTATS_TYPE_PM_AWAKE1 structures (for 6.25 firmware) */
  6955. #define WLC_STA_AWAKE_STATES_MAX_V1 30
  6956. #define WLC_PMD_EVENT_MAX_V1 32
  6957. /** Data sent as part of pwrstats IOVAR (and EXCESS_PM_WAKE event) */
  6958. #include <packed_section_start.h>
  6959. typedef BWL_PRE_PACKED_STRUCT struct pm_awake_data_v1 {
  6960. uint32 curr_time; /**< ms */
  6961. uint32 hw_macc; /**< HW maccontrol */
  6962. uint32 sw_macc; /**< SW maccontrol */
  6963. uint32 pm_dur; /**< Total sleep time in PM, msecs */
  6964. uint32 mpc_dur; /**< Total sleep time in MPC, msecs */
  6965. /* int32 drifts = remote - local; +ve drift => local-clk slow */
  6966. int32 last_drift; /**< Most recent TSF drift from beacon */
  6967. int32 min_drift; /**< Min TSF drift from beacon in magnitude */
  6968. int32 max_drift; /**< Max TSF drift from beacon in magnitude */
  6969. uint32 avg_drift; /**< Avg TSF drift from beacon */
  6970. /* Wake history tracking */
  6971. uint8 pmwake_idx; /**< for stepping through pm_state */
  6972. wlc_pm_debug_t pm_state[WLC_STA_AWAKE_STATES_MAX_V1]; /**< timestamped wake bits */
  6973. uint32 pmd_event_wake_dur[WLC_PMD_EVENT_MAX_V1]; /**< cumulative usecs per wake reason */
  6974. uint32 drift_cnt; /**< Count of drift readings over which avg_drift was computed */
  6975. } BWL_POST_PACKED_STRUCT pm_awake_data_v1_t;
  6976. #include <packed_section_end.h>
  6977. #include <packed_section_start.h>
  6978. typedef BWL_PRE_PACKED_STRUCT struct wl_pwr_pm_awake_stats_v1 {
  6979. uint16 type; /**< WL_PWRSTATS_TYPE_PM_AWAKE */
  6980. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  6981. pm_awake_data_v1_t awake_data;
  6982. uint32 frts_time; /**< Cumulative ms spent in frts since driver load */
  6983. uint32 frts_end_cnt; /**< No of times frts ended since driver load */
  6984. } BWL_POST_PACKED_STRUCT wl_pwr_pm_awake_stats_v1_t;
  6985. #include <packed_section_end.h>
  6986. /** WL_PWRSTATS_TYPE_PM_AWAKE2 structures. Data sent as part of pwrstats IOVAR */
  6987. typedef struct pm_awake_data_v2 {
  6988. uint32 curr_time; /**< ms */
  6989. uint32 hw_macc; /**< HW maccontrol */
  6990. uint32 sw_macc; /**< SW maccontrol */
  6991. uint32 pm_dur; /**< Total sleep time in PM, msecs */
  6992. uint32 mpc_dur; /**< Total sleep time in MPC, msecs */
  6993. /* int32 drifts = remote - local; +ve drift => local-clk slow */
  6994. int32 last_drift; /**< Most recent TSF drift from beacon */
  6995. int32 min_drift; /**< Min TSF drift from beacon in magnitude */
  6996. int32 max_drift; /**< Max TSF drift from beacon in magnitude */
  6997. uint32 avg_drift; /**< Avg TSF drift from beacon */
  6998. /* Wake history tracking */
  6999. /* pmstate array (type wlc_pm_debug_t) start offset */
  7000. uint16 pm_state_offset;
  7001. /** pmstate number of array entries */
  7002. uint16 pm_state_len;
  7003. /** array (type uint32) start offset */
  7004. uint16 pmd_event_wake_dur_offset;
  7005. /** pmd_event_wake_dur number of array entries */
  7006. uint16 pmd_event_wake_dur_len;
  7007. uint32 drift_cnt; /**< Count of drift readings over which avg_drift was computed */
  7008. uint8 pmwake_idx; /**< for stepping through pm_state */
  7009. uint8 flags; /**< bit0: 1-sleep, 0- wake. bit1: 0-bit0 invlid, 1-bit0 valid */
  7010. uint8 pad[2];
  7011. uint32 frts_time; /**< Cumulative ms spent in frts since driver load */
  7012. uint32 frts_end_cnt; /**< No of times frts ended since driver load */
  7013. } pm_awake_data_v2_t;
  7014. typedef struct wl_pwr_pm_awake_stats_v2 {
  7015. uint16 type; /**< WL_PWRSTATS_TYPE_PM_AWAKE */
  7016. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7017. pm_awake_data_v2_t awake_data;
  7018. } wl_pwr_pm_awake_stats_v2_t;
  7019. /* bit0: 1-sleep, 0- wake. bit1: 0-bit0 invlid, 1-bit0 valid */
  7020. #define WL_PWR_PM_AWAKE_STATS_WAKE 0x02
  7021. #define WL_PWR_PM_AWAKE_STATS_ASLEEP 0x03
  7022. #define WL_PWR_PM_AWAKE_STATS_WAKE_MASK 0x03
  7023. /* WL_PWRSTATS_TYPE_PM_AWAKE Version 2 structures taken from 4324/43342 */
  7024. /* These structures are only to be used with 4324/43342 devices */
  7025. #define WL_STA_AWAKE_STATES_MAX_V2 30
  7026. #define WL_PMD_EVENT_MAX_V2 32
  7027. #define MAX_P2P_BSS_DTIM_PRD 4
  7028. #include <packed_section_start.h>
  7029. typedef BWL_PRE_PACKED_STRUCT struct ucode_dbg_v2 {
  7030. uint32 macctrl;
  7031. uint16 m_p2p_hps;
  7032. uint16 m_p2p_bss_dtim_prd[MAX_P2P_BSS_DTIM_PRD];
  7033. uint32 psmdebug[20];
  7034. uint32 phydebug[20];
  7035. uint32 psm_brc;
  7036. uint32 ifsstat;
  7037. } BWL_POST_PACKED_STRUCT ucode_dbg_v2_t;
  7038. #include <packed_section_end.h>
  7039. #include <packed_section_start.h>
  7040. typedef BWL_PRE_PACKED_STRUCT struct pmalert_awake_data_v2 {
  7041. uint32 curr_time; /* ms */
  7042. uint32 hw_macc; /* HW maccontrol */
  7043. uint32 sw_macc; /* SW maccontrol */
  7044. uint32 pm_dur; /* Total sleep time in PM, msecs */
  7045. uint32 mpc_dur; /* Total sleep time in MPC, msecs */
  7046. /* int32 drifts = remote - local; +ve drift => local-clk slow */
  7047. int32 last_drift; /* Most recent TSF drift from beacon */
  7048. int32 min_drift; /* Min TSF drift from beacon in magnitude */
  7049. int32 max_drift; /* Max TSF drift from beacon in magnitude */
  7050. uint32 avg_drift; /* Avg TSF drift from beacon */
  7051. /* Wake history tracking */
  7052. uint8 pmwake_idx; /* for stepping through pm_state */
  7053. wlc_pm_debug_t pm_state[WL_STA_AWAKE_STATES_MAX_V2]; /* timestamped wake bits */
  7054. uint32 pmd_event_wake_dur[WL_PMD_EVENT_MAX_V2]; /* cumulative usecs per wake reason */
  7055. uint32 drift_cnt; /* Count of drift readings over which avg_drift was computed */
  7056. uint32 start_event_dur[WL_PMD_EVENT_MAX_V2]; /* start event-duration */
  7057. ucode_dbg_v2_t ud;
  7058. uint32 frts_time; /* Cumulative ms spent in frts since driver load */
  7059. uint32 frts_end_cnt; /* No of times frts ended since driver load */
  7060. } BWL_POST_PACKED_STRUCT pmalert_awake_data_v2_t;
  7061. #include <packed_section_end.h>
  7062. #include <packed_section_start.h>
  7063. typedef BWL_PRE_PACKED_STRUCT struct pm_alert_data_v2 {
  7064. uint32 version;
  7065. uint32 length; /* Length of entire structure */
  7066. uint32 reasons; /* reason(s) for pm_alert */
  7067. /* Following fields are present only for reasons
  7068. * PM_DUR_EXCEEDED, MPC_DUR_EXCEEDED & CONST_AWAKE_DUR_EXCEEDED
  7069. */
  7070. uint32 prev_stats_time; /* msecs */
  7071. uint32 prev_pm_dur; /* msecs */
  7072. uint32 prev_mpc_dur; /* msecs */
  7073. pmalert_awake_data_v2_t awake_data;
  7074. } BWL_POST_PACKED_STRUCT pm_alert_data_v2_t;
  7075. #include <packed_section_end.h>
  7076. #include <packed_section_start.h>
  7077. typedef BWL_PRE_PACKED_STRUCT struct wl_pwr_pm_awake_status_v2 {
  7078. uint16 type; /* WL_PWRSTATS_TYPE_PM_AWAKE */
  7079. uint16 len; /* Up to 4K-1, top 4 bits are reserved */
  7080. pmalert_awake_data_v2_t awake_data;
  7081. uint32 frts_time; /* Cumulative ms spent in frts since driver load */
  7082. uint32 frts_end_cnt; /* No of times frts ended since driver load */
  7083. } BWL_POST_PACKED_STRUCT wl_pwr_pm_awake_status_v2_t;
  7084. #include <packed_section_end.h>
  7085. /* Below are latest definitions from PHO25178RC100_BRANCH_6_50 */
  7086. /* wl_pwr_pm_awake_stats_v1_t is used for WL_PWRSTATS_TYPE_PM_AWAKE */
  7087. /* Use regs from d11.h instead of raw addresses for */
  7088. /* (at least) the chip independent registers */
  7089. typedef struct ucode_dbg_ext {
  7090. uint32 x120;
  7091. uint32 x124;
  7092. uint32 x154;
  7093. uint32 x158;
  7094. uint32 x15c;
  7095. uint32 x180;
  7096. uint32 x184;
  7097. uint32 x188;
  7098. uint32 x18c;
  7099. uint32 x1a0;
  7100. uint32 x1a8;
  7101. uint32 x1e0;
  7102. uint32 scr_x14;
  7103. uint32 scr_x2b;
  7104. uint32 scr_x2c;
  7105. uint32 scr_x2d;
  7106. uint32 scr_x2e;
  7107. uint16 x40a;
  7108. uint16 x480;
  7109. uint16 x490;
  7110. uint16 x492;
  7111. uint16 x4d8;
  7112. uint16 x4b8;
  7113. uint16 x4ba;
  7114. uint16 x4bc;
  7115. uint16 x4be;
  7116. uint16 x500;
  7117. uint16 x50e;
  7118. uint16 x522;
  7119. uint16 x546;
  7120. uint16 x578;
  7121. uint16 x602;
  7122. uint16 x646;
  7123. uint16 x648;
  7124. uint16 x666;
  7125. uint16 x670;
  7126. uint16 x690;
  7127. uint16 x692;
  7128. uint16 x6a0;
  7129. uint16 x6a2;
  7130. uint16 x6a4;
  7131. uint16 x6b2;
  7132. uint16 x7c0;
  7133. uint16 shm_x20;
  7134. uint16 shm_x4a;
  7135. uint16 shm_x5e;
  7136. uint16 shm_x5f;
  7137. uint16 shm_xaab;
  7138. uint16 shm_x74a;
  7139. uint16 shm_x74b;
  7140. uint16 shm_x74c;
  7141. uint16 shm_x74e;
  7142. uint16 shm_x756;
  7143. uint16 shm_x75b;
  7144. uint16 shm_x7b9;
  7145. uint16 shm_x7d4;
  7146. uint16 shm_P2P_HPS;
  7147. uint16 shm_P2P_intr[16];
  7148. uint16 shm_P2P_perbss[48];
  7149. } ucode_dbg_ext_t;
  7150. #include <packed_section_start.h>
  7151. typedef BWL_PRE_PACKED_STRUCT struct pm_alert_data_v1 {
  7152. uint32 version;
  7153. uint32 length; /**< Length of entire structure */
  7154. uint32 reasons; /**< reason(s) for pm_alert */
  7155. /* Following fields are present only for reasons
  7156. * PM_DUR_EXCEEDED, MPC_DUR_EXCEEDED & CONST_AWAKE_DUR_EXCEEDED
  7157. */
  7158. uint32 prev_stats_time; /**< msecs */
  7159. uint32 prev_pm_dur; /**< msecs */
  7160. uint32 prev_mpc_dur; /**< msecs */
  7161. pm_awake_data_v1_t awake_data;
  7162. uint32 start_event_dur[WLC_PMD_EVENT_MAX_V1]; /**< start event-duration */
  7163. ucode_dbg_v2_t ud;
  7164. uint32 frts_time; /**< Cumulative ms spent in frts since driver load */
  7165. uint32 frts_end_cnt; /**< No of times frts ended since driver load */
  7166. ucode_dbg_ext_t ud_ext;
  7167. uint32 prev_frts_dur; /**< ms */
  7168. } BWL_POST_PACKED_STRUCT pm_alert_data_v1_t;
  7169. #include <packed_section_end.h>
  7170. /* End of 43342/4324 v2 structure definitions */
  7171. /* Original bus structure is for HSIC */
  7172. typedef struct bus_metrics {
  7173. uint32 suspend_ct; /**< suspend count */
  7174. uint32 resume_ct; /**< resume count */
  7175. uint32 disconnect_ct; /**< disconnect count */
  7176. uint32 reconnect_ct; /**< reconnect count */
  7177. uint32 active_dur; /**< msecs in bus, usecs for user */
  7178. uint32 suspend_dur; /**< msecs in bus, usecs for user */
  7179. uint32 disconnect_dur; /**< msecs in bus, usecs for user */
  7180. } bus_metrics_t;
  7181. /** Bus interface info for USB/HSIC */
  7182. #include <packed_section_start.h>
  7183. typedef BWL_PRE_PACKED_STRUCT struct wl_pwr_usb_hsic_stats {
  7184. uint16 type; /**< WL_PWRSTATS_TYPE_USB_HSIC */
  7185. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7186. bus_metrics_t hsic; /**< stats from hsic bus driver */
  7187. } BWL_POST_PACKED_STRUCT wl_pwr_usb_hsic_stats_t;
  7188. #include <packed_section_end.h>
  7189. /* PCIe Event counter tlv IDs */
  7190. enum pcie_cnt_xtlv_id {
  7191. PCIE_CNT_XTLV_METRICS = 0x1, /**< PCIe Bus Metrics */
  7192. PCIE_CNT_XTLV_BUS_CNT = 0x2 /**< PCIe Bus counters */
  7193. };
  7194. typedef struct pcie_bus_metrics {
  7195. uint32 d3_suspend_ct; /**< suspend count */
  7196. uint32 d0_resume_ct; /**< resume count */
  7197. uint32 perst_assrt_ct; /**< PERST# assert count */
  7198. uint32 perst_deassrt_ct; /**< PERST# de-assert count */
  7199. uint32 active_dur; /**< msecs */
  7200. uint32 d3_suspend_dur; /**< msecs */
  7201. uint32 perst_dur; /**< msecs */
  7202. uint32 l0_cnt; /**< L0 entry count */
  7203. uint32 l0_usecs; /**< L0 duration in usecs */
  7204. uint32 l1_cnt; /**< L1 entry count */
  7205. uint32 l1_usecs; /**< L1 duration in usecs */
  7206. uint32 l1_1_cnt; /**< L1_1ss entry count */
  7207. uint32 l1_1_usecs; /**< L1_1ss duration in usecs */
  7208. uint32 l1_2_cnt; /**< L1_2ss entry count */
  7209. uint32 l1_2_usecs; /**< L1_2ss duration in usecs */
  7210. uint32 l2_cnt; /**< L2 entry count */
  7211. uint32 l2_usecs; /**< L2 duration in usecs */
  7212. uint32 timestamp; /**< Timestamp on when stats are collected */
  7213. uint32 num_h2d_doorbell; /**< # of doorbell interrupts - h2d */
  7214. uint32 num_d2h_doorbell; /**< # of doorbell interrupts - d2h */
  7215. uint32 num_submissions; /**< # of submissions */
  7216. uint32 num_completions; /**< # of completions */
  7217. uint32 num_rxcmplt; /**< # of rx completions */
  7218. uint32 num_rxcmplt_drbl; /**< of drbl interrupts for rx complt. */
  7219. uint32 num_txstatus; /**< # of tx completions */
  7220. uint32 num_txstatus_drbl; /**< of drbl interrupts for tx complt. */
  7221. uint32 deepsleep_count; /**< # of times chip went to deepsleep */
  7222. uint32 deepsleep_dur; /**< # of msecs chip was in deepsleep */
  7223. uint32 ltr_active_ct; /**< # of times chip went to LTR ACTIVE */
  7224. uint32 ltr_active_dur; /**< # of msecs chip was in LTR ACTIVE */
  7225. uint32 ltr_sleep_ct; /**< # of times chip went to LTR SLEEP */
  7226. uint32 ltr_sleep_dur; /**< # of msecs chip was in LTR SLEEP */
  7227. } pcie_bus_metrics_t;
  7228. typedef struct pcie_cnt {
  7229. uint32 ltr_state; /**< Current LTR state */
  7230. uint32 l0_sr_cnt; /**< SR count during L0 */
  7231. uint32 l2l3_sr_cnt; /**< SR count during L2L3 */
  7232. uint32 d3_ack_sr_cnt; /**< srcount during last D3-ACK */
  7233. uint32 d3_sr_cnt; /**< SR count during D3 */
  7234. uint32 d3_info_start; /**< D3 INFORM received time */
  7235. uint32 d3_info_enter_cnt; /**< # of D3 INFORM received */
  7236. uint32 d3_cnt; /**< # of real D3 */
  7237. uint32 d3_ack_sent_cnt; /**< # of D3 ACK sent count */
  7238. uint32 d3_drop_cnt_event; /**< # of events dropped during D3 */
  7239. uint32 d2h_req_q_len; /**< # of Packet pending in D2H request queue */
  7240. uint32 hw_reason; /**< Last Host wake assert reason */
  7241. uint32 hw_assert_cnt; /**< # of times Host wake Asserted */
  7242. uint32 host_ready_cnt; /**< # of Host ready interrupts */
  7243. uint32 hw_assert_reason_0; /**< timestamp when hw_reason is TRAP */
  7244. uint32 hw_assert_reason_1; /**< timestamp when hw_reason is WL_EVENT */
  7245. uint32 hw_assert_reason_2; /**< timestamp when hw_reason is DATA */
  7246. uint32 hw_assert_reason_3; /**< timestamp when hw_reason is DELAYED_WAKE */
  7247. uint32 last_host_ready; /**< Timestamp of last Host ready */
  7248. bool hw_asserted; /**< Flag to indicate if Host wake is Asserted */
  7249. bool event_delivery_pend; /**< No resources to send event */
  7250. uint16 pad; /**< Word alignment for scripts */
  7251. } pcie_cnt_t;
  7252. /** Bus interface info for PCIE */
  7253. typedef struct wl_pwr_pcie_stats {
  7254. uint16 type; /**< WL_PWRSTATS_TYPE_PCIE */
  7255. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7256. pcie_bus_metrics_t pcie; /**< stats from pcie bus driver */
  7257. } wl_pwr_pcie_stats_t;
  7258. /** Scan information history per category */
  7259. typedef struct scan_data {
  7260. uint32 count; /**< Number of scans performed */
  7261. uint32 dur; /**< Total time (in us) used */
  7262. } scan_data_t;
  7263. typedef struct wl_pwr_scan_stats {
  7264. uint16 type; /**< WL_PWRSTATS_TYPE_SCAN */
  7265. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7266. /* Scan history */
  7267. scan_data_t user_scans; /**< User-requested scans: (i/e/p)scan */
  7268. scan_data_t assoc_scans; /**< Scans initiated by association requests */
  7269. scan_data_t roam_scans; /**< Scans initiated by the roam engine */
  7270. scan_data_t pno_scans[8]; /**< For future PNO bucketing (BSSID, SSID, etc) */
  7271. scan_data_t other_scans; /**< Scan engine usage not assigned to the above */
  7272. } wl_pwr_scan_stats_t;
  7273. typedef struct wl_pwr_connect_stats {
  7274. uint16 type; /**< WL_PWRSTATS_TYPE_SCAN */
  7275. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7276. /* Connection (Association + Key exchange) data */
  7277. uint32 count; /**< Number of connections performed */
  7278. uint32 dur; /**< Total time (in ms) used */
  7279. } wl_pwr_connect_stats_t;
  7280. typedef struct wl_pwr_phy_stats {
  7281. uint16 type; /**< WL_PWRSTATS_TYPE_PHY */
  7282. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7283. uint32 tx_dur; /**< TX Active duration in us */
  7284. uint32 rx_dur; /**< RX Active duration in us */
  7285. } wl_pwr_phy_stats_t;
  7286. typedef struct wl_mimo_meas_metrics_v1 {
  7287. uint16 type;
  7288. uint16 len;
  7289. /* Total time(us) idle in MIMO RX chain configuration */
  7290. uint32 total_idle_time_mimo;
  7291. /* Total time(us) idle in SISO RX chain configuration */
  7292. uint32 total_idle_time_siso;
  7293. /* Total receive time (us) in SISO RX chain configuration */
  7294. uint32 total_rx_time_siso;
  7295. /* Total receive time (us) in MIMO RX chain configuration */
  7296. uint32 total_rx_time_mimo;
  7297. /* Total 1-chain transmit time(us) */
  7298. uint32 total_tx_time_1chain;
  7299. /* Total 2-chain transmit time(us) */
  7300. uint32 total_tx_time_2chain;
  7301. /* Total 3-chain transmit time(us) */
  7302. uint32 total_tx_time_3chain;
  7303. } wl_mimo_meas_metrics_v1_t;
  7304. typedef struct wl_mimo_meas_metrics {
  7305. uint16 type;
  7306. uint16 len;
  7307. /* Total time(us) idle in MIMO RX chain configuration */
  7308. uint32 total_idle_time_mimo;
  7309. /* Total time(us) idle in SISO RX chain configuration */
  7310. uint32 total_idle_time_siso;
  7311. /* Total receive time (us) in SISO RX chain configuration */
  7312. uint32 total_rx_time_siso;
  7313. /* Total receive time (us) in MIMO RX chain configuration */
  7314. uint32 total_rx_time_mimo;
  7315. /* Total 1-chain transmit time(us) */
  7316. uint32 total_tx_time_1chain;
  7317. /* Total 2-chain transmit time(us) */
  7318. uint32 total_tx_time_2chain;
  7319. /* Total 3-chain transmit time(us) */
  7320. uint32 total_tx_time_3chain;
  7321. /* End of original, OCL fields start here */
  7322. /* Total time(us) idle in ocl mode */
  7323. uint32 total_idle_time_ocl;
  7324. /* Total receive time (us) in ocl mode */
  7325. uint32 total_rx_time_ocl;
  7326. /* End of OCL fields, internal adjustment fields here */
  7327. /* Total SIFS idle time in MIMO mode */
  7328. uint32 total_sifs_time_mimo;
  7329. /* Total SIFS idle time in SISO mode */
  7330. uint32 total_sifs_time_siso;
  7331. } wl_mimo_meas_metrics_t;
  7332. typedef struct wl_pwr_slice_index {
  7333. uint16 type; /* WL_PWRSTATS_TYPE_SLICE_INDEX */
  7334. uint16 len;
  7335. uint32 slice_index; /* Slice index for which stats are meant for */
  7336. } wl_pwr_slice_index_t;
  7337. typedef struct wl_pwr_tsync_stats {
  7338. uint16 type; /**< WL_PWRSTATS_TYPE_TSYNC */
  7339. uint16 len;
  7340. uint32 avb_uptime; /**< AVB uptime in msec */
  7341. } wl_pwr_tsync_stats_t;
  7342. typedef struct wl_pwr_ops_stats {
  7343. uint16 type; /* WL_PWRSTATS_TYPE_OPS_STATS */
  7344. uint16 len; /* total length includes fixed fields */
  7345. uint32 partial_ops_dur; /* Total time(in usec) partial ops duration */
  7346. uint32 full_ops_dur; /* Total time(in usec) full ops duration */
  7347. } wl_pwr_ops_stats_t;
  7348. typedef struct wl_pwr_bcntrim_stats {
  7349. uint16 type; /* WL_PWRSTATS_TYPE_BCNTRIM_STATS */
  7350. uint16 len; /* total length includes fixed fields */
  7351. uint8 associated; /* STA is associated ? */
  7352. uint8 slice_idx; /* on which slice STA is associated */
  7353. uint16 pad; /* padding */
  7354. uint32 slice_beacon_seen; /* number of beacons seen on the Infra
  7355. * interface on this slice
  7356. */
  7357. uint32 slice_beacon_trimmed; /* number beacons actually trimmed on this slice */
  7358. uint32 total_beacon_seen; /* total number of beacons seen on the Infra interface */
  7359. uint32 total_beacon_trimmed; /* total beacons actually trimmed */
  7360. } wl_pwr_bcntrim_stats_t;
  7361. typedef struct wl_pwr_slice_index_band {
  7362. uint16 type; /* WL_PWRSTATS_TYPE_SLICE_INDEX_BAND_INFO */
  7363. uint16 len; /* Total length includes fixed fields */
  7364. uint16 index; /* Slice Index */
  7365. int16 bandtype; /* Slice Bandtype */
  7366. } wl_pwr_slice_index_band_t;
  7367. typedef struct wl_pwr_psbw_stats {
  7368. uint16 type; /* WL_PWRSTATS_TYPE_PSBW_STATS */
  7369. uint16 len; /* total length includes fixed fields */
  7370. uint8 slice_idx; /* on which slice STA is associated */
  7371. uint8 pad[3];
  7372. uint32 slice_enable_dur; /* time(ms) psbw remains enabled on this slice */
  7373. uint32 total_enable_dur; /* time(ms) psbw remains enabled total */
  7374. } wl_pwr_psbw_stats_t;
  7375. /* ##### End of Power Stats section ##### */
  7376. /** IPV4 Arp offloads for ndis context */
  7377. #include <packed_section_start.h>
  7378. BWL_PRE_PACKED_STRUCT struct hostip_id {
  7379. struct ipv4_addr ipa;
  7380. uint8 id;
  7381. } BWL_POST_PACKED_STRUCT;
  7382. #include <packed_section_end.h>
  7383. /* Return values */
  7384. #define ND_REPLY_PEER 0x1 /**< Reply was sent to service NS request from peer */
  7385. #define ND_REQ_SINK 0x2 /**< Input packet should be discarded */
  7386. #define ND_FORCE_FORWARD 0X3 /**< For the dongle to forward req to HOST */
  7387. /** Neighbor Solicitation Response Offload IOVAR param */
  7388. #include <packed_section_start.h>
  7389. typedef BWL_PRE_PACKED_STRUCT struct nd_param {
  7390. struct ipv6_addr host_ip[2];
  7391. struct ipv6_addr solicit_ip;
  7392. struct ipv6_addr remote_ip;
  7393. uint8 host_mac[ETHER_ADDR_LEN];
  7394. uint32 offload_id;
  7395. } BWL_POST_PACKED_STRUCT nd_param_t;
  7396. #include <packed_section_end.h>
  7397. typedef struct wl_pfn_roam_thresh {
  7398. uint32 pfn_alert_thresh; /**< time in ms */
  7399. uint32 roam_alert_thresh; /**< time in ms */
  7400. } wl_pfn_roam_thresh_t;
  7401. /* Reasons for wl_pmalert_t */
  7402. #define PM_DUR_EXCEEDED (1<<0)
  7403. #define MPC_DUR_EXCEEDED (1<<1)
  7404. #define ROAM_ALERT_THRESH_EXCEEDED (1<<2)
  7405. #define PFN_ALERT_THRESH_EXCEEDED (1<<3)
  7406. #define CONST_AWAKE_DUR_ALERT (1<<4)
  7407. #define CONST_AWAKE_DUR_RECOVERY (1<<5)
  7408. #define MIN_PM_ALERT_LEN 9
  7409. /** Data sent in EXCESS_PM_WAKE event */
  7410. #define WL_PM_ALERT_VERSION 3
  7411. /** This structure is for version 3; version 2 will be deprecated in by FW */
  7412. #include <packed_section_start.h>
  7413. typedef BWL_PRE_PACKED_STRUCT struct wl_pmalert {
  7414. uint16 version; /**< Version = 3 is TLV format */
  7415. uint16 length; /**< Length of entire structure */
  7416. uint32 reasons; /**< reason(s) for pm_alert */
  7417. uint8 data[1]; /**< TLV data, a series of structures,
  7418. * each starting with type and length.
  7419. *
  7420. * Padded as necessary so each section
  7421. * starts on a 4-byte boundary.
  7422. *
  7423. * Both type and len are uint16, but the
  7424. * upper nibble of length is reserved so
  7425. * valid len values are 0-4095.
  7426. */
  7427. } BWL_POST_PACKED_STRUCT wl_pmalert_t;
  7428. #include <packed_section_end.h>
  7429. /* Type values for the data section */
  7430. #define WL_PMALERT_FIXED 0 /**< struct wl_pmalert_fixed_t, fixed fields */
  7431. #define WL_PMALERT_PMSTATE 1 /**< struct wl_pmalert_pmstate_t, variable */
  7432. #define WL_PMALERT_EVENT_DUR 2 /**< struct wl_pmalert_event_dur_t, variable */
  7433. #define WL_PMALERT_UCODE_DBG 3 /**< struct wl_pmalert_ucode_dbg_v1, variable */
  7434. #define WL_PMALERT_PS_ALLOWED_HIST 4 /**< struct wl_pmalert_ps_allowed_history, variable */
  7435. #define WL_PMALERT_EXT_UCODE_DBG 5 /**< struct wl_pmalert_ext_ucode_dbg_t, variable */
  7436. #define WL_PMALERT_EPM_START_EVENT_DUR 6 /**< struct wl_pmalert_event_dur_t, variable */
  7437. #define WL_PMALERT_UCODE_DBG_V2 7 /**< struct wl_pmalert_ucode_dbg_v2, variable */
  7438. typedef struct wl_pmalert_fixed {
  7439. uint16 type; /**< WL_PMALERT_FIXED */
  7440. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7441. uint32 prev_stats_time; /**< msecs */
  7442. uint32 curr_time; /**< ms */
  7443. uint32 prev_pm_dur; /**< msecs */
  7444. uint32 pm_dur; /**< Total sleep time in PM, msecs */
  7445. uint32 prev_mpc_dur; /**< msecs */
  7446. uint32 mpc_dur; /**< Total sleep time in MPC, msecs */
  7447. uint32 hw_macc; /**< HW maccontrol */
  7448. uint32 sw_macc; /**< SW maccontrol */
  7449. /* int32 drifts = remote - local; +ve drift -> local-clk slow */
  7450. int32 last_drift; /**< Most recent TSF drift from beacon */
  7451. int32 min_drift; /**< Min TSF drift from beacon in magnitude */
  7452. int32 max_drift; /**< Max TSF drift from beacon in magnitude */
  7453. uint32 avg_drift; /**< Avg TSF drift from beacon */
  7454. uint32 drift_cnt; /**< Count of drift readings over which avg_drift was computed */
  7455. uint32 frts_time; /**< Cumulative ms spent in data frts since driver load */
  7456. uint32 frts_end_cnt; /**< No of times frts ended since driver load */
  7457. uint32 prev_frts_dur; /**< Data frts duration at start of pm-period */
  7458. uint32 cal_dur; /**< Cumulative ms spent in calibration */
  7459. uint32 prev_cal_dur; /**< cal duration at start of pm-period */
  7460. } wl_pmalert_fixed_t;
  7461. typedef struct wl_pmalert_pmstate {
  7462. uint16 type; /**< WL_PMALERT_PMSTATE */
  7463. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7464. uint8 pmwake_idx; /**< for stepping through pm_state */
  7465. uint8 pad[3];
  7466. /* Array of pmstate; len of array is based on tlv len */
  7467. wlc_pm_debug_t pmstate[1];
  7468. } wl_pmalert_pmstate_t;
  7469. typedef struct wl_pmalert_event_dur {
  7470. uint16 type; /**< WL_PMALERT_EVENT_DUR */
  7471. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7472. /* Array of event_dur, len of array is based on tlv len */
  7473. uint32 event_dur[1];
  7474. } wl_pmalert_event_dur_t;
  7475. #include <packed_section_start.h>
  7476. BWL_PRE_PACKED_STRUCT struct wl_pmalert_ucode_dbg_v1 {
  7477. uint16 type; /* WL_PMALERT_UCODE_DBG */
  7478. uint16 len; /* Up to 4K-1, top 4 bits are reserved */
  7479. uint32 macctrl;
  7480. uint16 m_p2p_hps;
  7481. uint32 psm_brc;
  7482. uint32 ifsstat;
  7483. uint16 m_p2p_bss_dtim_prd[MAX_P2P_BSS_DTIM_PRD];
  7484. uint32 psmdebug[20];
  7485. uint32 phydebug[20];
  7486. uint16 M_P2P_BSS[3][12];
  7487. uint16 M_P2P_PRE_TBTT[3];
  7488. /* Following is valid only for corerevs<40 */
  7489. uint16 xmtfifordy;
  7490. /* Following 3 are valid only for 11ac corerevs (>=40) */
  7491. uint16 psm_maccommand;
  7492. uint16 txe_status1;
  7493. uint16 AQMFifoReady;
  7494. } BWL_POST_PACKED_STRUCT;
  7495. #include <packed_section_end.h>
  7496. #include <packed_section_start.h>
  7497. BWL_PRE_PACKED_STRUCT struct wl_pmalert_ucode_dbg_v2 {
  7498. uint16 type; /**< WL_PMALERT_UCODE_DBG_V2 */
  7499. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7500. uint32 macctrl;
  7501. uint16 m_p2p_hps;
  7502. uint32 psm_brc;
  7503. uint32 ifsstat;
  7504. uint16 m_p2p_bss_dtim_prd[MAX_P2P_BSS_DTIM_PRD];
  7505. uint32 psmdebug[20];
  7506. uint32 phydebug[20];
  7507. uint16 M_P2P_BSS[3][12];
  7508. uint16 M_P2P_PRE_TBTT[3];
  7509. /* Following is valid only for corerevs<40 */
  7510. uint16 xmtfifordy;
  7511. /* Following 3 are valid only for 11ac corerevs (>=40) */
  7512. uint16 psm_maccommand;
  7513. uint16 txe_status1;
  7514. uint32 AQMFifoReady;
  7515. } BWL_POST_PACKED_STRUCT;
  7516. #include <packed_section_end.h>
  7517. typedef struct wlc_ps_debug {
  7518. uint32 timestamp; /**< timestamp in millisecond */
  7519. uint32 ps_mask; /**< reason(s) for disallowing ps */
  7520. } wlc_ps_debug_t;
  7521. typedef struct wl_pmalert_ps_allowed_hist {
  7522. uint16 type; /**< WL_PMALERT_PS_ALLOWED_HIST */
  7523. uint16 len; /**< Up to 4K-1, top 4 bits are reserved */
  7524. uint32 ps_allowed_start_idx;
  7525. /* Array of ps_debug, len of array is based on tlv len */
  7526. wlc_ps_debug_t ps_debug[1];
  7527. } wl_pmalert_ps_allowed_hist_t;
  7528. /* Structures and constants used for "vndr_ie" IOVar interface */
  7529. #define VNDR_IE_CMD_LEN 4 /**< length of the set command string:
  7530. * "add", "del" (+ NUL)
  7531. */
  7532. #define VNDR_IE_INFO_HDR_LEN (sizeof(uint32))
  7533. #include <packed_section_start.h>
  7534. typedef BWL_PRE_PACKED_STRUCT struct {
  7535. uint32 pktflag; /**< bitmask indicating which packet(s) contain this IE */
  7536. vndr_ie_t vndr_ie_data; /**< vendor IE data */
  7537. } BWL_POST_PACKED_STRUCT vndr_ie_info_t;
  7538. #include <packed_section_end.h>
  7539. #include <packed_section_start.h>
  7540. typedef BWL_PRE_PACKED_STRUCT struct {
  7541. int32 iecount; /**< number of entries in the vndr_ie_list[] array */
  7542. vndr_ie_info_t vndr_ie_list[1]; /**< variable size list of vndr_ie_info_t structs */
  7543. } BWL_POST_PACKED_STRUCT vndr_ie_buf_t;
  7544. #include <packed_section_end.h>
  7545. #include <packed_section_start.h>
  7546. typedef BWL_PRE_PACKED_STRUCT struct {
  7547. char cmd[VNDR_IE_CMD_LEN]; /**< vndr_ie IOVar set command : "add", "del" + NUL */
  7548. vndr_ie_buf_t vndr_ie_buffer; /**< buffer containing Vendor IE list information */
  7549. } BWL_POST_PACKED_STRUCT vndr_ie_setbuf_t;
  7550. #include <packed_section_end.h>
  7551. /** tag_ID/length/value_buffer tuple */
  7552. #include <packed_section_start.h>
  7553. typedef BWL_PRE_PACKED_STRUCT struct {
  7554. uint8 id;
  7555. uint8 len;
  7556. uint8 data[1];
  7557. } BWL_POST_PACKED_STRUCT tlv_t;
  7558. #include <packed_section_end.h>
  7559. #include <packed_section_start.h>
  7560. typedef BWL_PRE_PACKED_STRUCT struct {
  7561. uint32 pktflag; /**< bitmask indicating which packet(s) contain this IE */
  7562. tlv_t ie_data; /**< IE data */
  7563. } BWL_POST_PACKED_STRUCT ie_info_t;
  7564. #include <packed_section_end.h>
  7565. #include <packed_section_start.h>
  7566. typedef BWL_PRE_PACKED_STRUCT struct {
  7567. int32 iecount; /**< number of entries in the ie_list[] array */
  7568. ie_info_t ie_list[1]; /**< variable size list of ie_info_t structs */
  7569. } BWL_POST_PACKED_STRUCT ie_buf_t;
  7570. #include <packed_section_end.h>
  7571. #include <packed_section_start.h>
  7572. typedef BWL_PRE_PACKED_STRUCT struct {
  7573. char cmd[VNDR_IE_CMD_LEN]; /**< ie IOVar set command : "add" + NUL */
  7574. ie_buf_t ie_buffer; /**< buffer containing IE list information */
  7575. } BWL_POST_PACKED_STRUCT ie_setbuf_t;
  7576. #include <packed_section_end.h>
  7577. #include <packed_section_start.h>
  7578. typedef BWL_PRE_PACKED_STRUCT struct {
  7579. uint32 pktflag; /**< bitmask indicating which packet(s) contain this IE */
  7580. uint8 id; /**< IE type */
  7581. } BWL_POST_PACKED_STRUCT ie_getbuf_t;
  7582. #include <packed_section_end.h>
  7583. /* structures used to define format of wps ie data from probe requests */
  7584. /* passed up to applications via iovar "prbreq_wpsie" */
  7585. typedef struct sta_prbreq_wps_ie_hdr {
  7586. struct ether_addr staAddr;
  7587. uint16 ieLen;
  7588. } sta_prbreq_wps_ie_hdr_t;
  7589. #include <packed_section_start.h>
  7590. typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_data {
  7591. sta_prbreq_wps_ie_hdr_t hdr;
  7592. uint8 ieData[1];
  7593. } BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_data_t;
  7594. #include <packed_section_end.h>
  7595. #include <packed_section_start.h>
  7596. typedef BWL_PRE_PACKED_STRUCT struct sta_prbreq_wps_ie_list {
  7597. uint32 totLen;
  7598. uint8 ieDataList[1];
  7599. } BWL_POST_PACKED_STRUCT sta_prbreq_wps_ie_list_t;
  7600. #include <packed_section_end.h>
  7601. #include <packed_section_start.h>
  7602. typedef BWL_PRE_PACKED_STRUCT struct {
  7603. uint32 flags;
  7604. chanspec_t chanspec; /**< txpwr report for this channel */
  7605. chanspec_t local_chanspec; /**< channel on which we are associated */
  7606. uint8 local_max; /**< local max according to the AP */
  7607. uint8 local_constraint; /**< local constraint according to the AP */
  7608. int8 antgain[2]; /**< Ant gain for each band - from SROM */
  7609. uint8 rf_cores; /**< count of RF Cores being reported */
  7610. uint8 est_Pout[4]; /**< Latest tx power out estimate per RF chain */
  7611. uint8 est_Pout_act[4]; /**< Latest tx power out estimate per RF chain w/o adjustment */
  7612. uint8 est_Pout_cck; /**< Latest CCK tx power out estimate */
  7613. uint8 tx_power_max[4]; /**< Maximum target power among all rates */
  7614. uint32 tx_power_max_rate_ind[4]; /**< Index of the rate with the max target power */
  7615. int8 sar; /**< SAR limit for display by wl executable */
  7616. int8 channel_bandwidth; /**< 20, 40 or 80 MHz bandwidth? */
  7617. uint8 version; /**< Version of the data format wlu <--> driver */
  7618. uint8 display_core; /**< Displayed curpower core */
  7619. int8 target_offsets[4]; /**< Target power offsets for current rate per core */
  7620. uint32 last_tx_ratespec; /**< Ratespec for last transmition */
  7621. uint32 user_target; /**< user limit */
  7622. uint32 ppr_len; /**< length of each ppr serialization buffer */
  7623. int8 SARLIMIT[MAX_STREAMS_SUPPORTED];
  7624. uint8 pprdata[1]; /**< ppr serialization buffer */
  7625. } BWL_POST_PACKED_STRUCT tx_pwr_rpt_t;
  7626. #include <packed_section_end.h>
  7627. typedef struct tx_pwr_ru_rate_info {
  7628. uint16 version;
  7629. uint16 ru_alloc;
  7630. uint16 mcs;
  7631. uint16 nss;
  7632. uint16 num_he_ltf_syms;
  7633. uint16 ldpc;
  7634. uint16 gi;
  7635. uint16 txmode;
  7636. uint16 dcm;
  7637. uint16 tx_chain;
  7638. } tx_pwr_ru_rate_info_t;
  7639. #define TX_PWR_RU_RATE_INFO_VER 1
  7640. /* TLV ID for curpower report, ID < 63 is reserved for ppr module */
  7641. typedef enum tx_pwr_tlv_id {
  7642. TX_PWR_RPT_RU_RATE_INFO_ID = 64
  7643. } tx_pwr_tlv_id_t;
  7644. #include <packed_section_start.h>
  7645. typedef BWL_PRE_PACKED_STRUCT struct {
  7646. struct ipv4_addr ipv4_addr;
  7647. struct ether_addr nexthop;
  7648. } BWL_POST_PACKED_STRUCT ibss_route_entry_t;
  7649. #include <packed_section_end.h>
  7650. #include <packed_section_start.h>
  7651. typedef BWL_PRE_PACKED_STRUCT struct {
  7652. uint32 num_entry;
  7653. ibss_route_entry_t route_entry[1];
  7654. } BWL_POST_PACKED_STRUCT ibss_route_tbl_t;
  7655. #include <packed_section_end.h>
  7656. #define MAX_IBSS_ROUTE_TBL_ENTRY 64
  7657. #define TXPWR_TARGET_VERSION 0
  7658. #include <packed_section_start.h>
  7659. typedef BWL_PRE_PACKED_STRUCT struct {
  7660. int32 version; /**< version number */
  7661. chanspec_t chanspec; /**< txpwr report for this channel */
  7662. int8 txpwr[WL_STA_ANT_MAX]; /**< Max tx target power, in qdb */
  7663. uint8 rf_cores; /**< count of RF Cores being reported */
  7664. } BWL_POST_PACKED_STRUCT txpwr_target_max_t;
  7665. #include <packed_section_end.h>
  7666. #define BSS_PEER_INFO_PARAM_CUR_VER 0
  7667. /** Input structure for IOV_BSS_PEER_INFO */
  7668. #include <packed_section_start.h>
  7669. typedef BWL_PRE_PACKED_STRUCT struct {
  7670. uint16 version;
  7671. struct ether_addr ea; /**< peer MAC address */
  7672. } BWL_POST_PACKED_STRUCT bss_peer_info_param_t;
  7673. #include <packed_section_end.h>
  7674. #define BSS_PEER_INFO_CUR_VER 0
  7675. #include <packed_section_start.h>
  7676. typedef BWL_PRE_PACKED_STRUCT struct {
  7677. uint16 version;
  7678. struct ether_addr ea;
  7679. int32 rssi;
  7680. uint32 tx_rate; /**< current tx rate */
  7681. uint32 rx_rate; /**< current rx rate */
  7682. wl_rateset_t rateset; /**< rateset in use */
  7683. uint32 age; /**< age in seconds */
  7684. } BWL_POST_PACKED_STRUCT bss_peer_info_t;
  7685. #include <packed_section_end.h>
  7686. #define BSS_PEER_LIST_INFO_CUR_VER 0
  7687. #include <packed_section_start.h>
  7688. typedef BWL_PRE_PACKED_STRUCT struct {
  7689. uint16 version;
  7690. uint16 bss_peer_info_len; /**< length of bss_peer_info_t */
  7691. uint32 count; /**< number of peer info */
  7692. bss_peer_info_t peer_info[1]; /**< peer info */
  7693. } BWL_POST_PACKED_STRUCT bss_peer_list_info_t;
  7694. #include <packed_section_end.h>
  7695. #define BSS_PEER_LIST_INFO_FIXED_LEN OFFSETOF(bss_peer_list_info_t, peer_info)
  7696. #define AIBSS_BCN_FORCE_CONFIG_VER_0 0
  7697. /** structure used to configure AIBSS beacon force xmit */
  7698. #include <packed_section_start.h>
  7699. typedef BWL_PRE_PACKED_STRUCT struct {
  7700. uint16 version;
  7701. uint16 len;
  7702. uint32 initial_min_bcn_dur; /**< dur in ms to check a bcn in bcn_flood period */
  7703. uint32 min_bcn_dur; /**< dur in ms to check a bcn after bcn_flood period */
  7704. uint32 bcn_flood_dur; /**< Initial bcn xmit period in ms */
  7705. } BWL_POST_PACKED_STRUCT aibss_bcn_force_config_t;
  7706. #include <packed_section_end.h>
  7707. #define AIBSS_TXFAIL_CONFIG_VER_0 0
  7708. #define AIBSS_TXFAIL_CONFIG_VER_1 1
  7709. #define AIBSS_TXFAIL_CONFIG_CUR_VER AIBSS_TXFAIL_CONFIG_VER_1
  7710. /** structure used to configure aibss tx fail event */
  7711. #include <packed_section_start.h>
  7712. typedef BWL_PRE_PACKED_STRUCT struct {
  7713. uint16 version;
  7714. uint16 len;
  7715. uint32 bcn_timeout; /**< dur in seconds to receive 1 bcn */
  7716. uint32 max_tx_retry; /**< no of consecutive no acks to send txfail event */
  7717. uint32 max_atim_failure; /**< no of consecutive atim failure */
  7718. } BWL_POST_PACKED_STRUCT aibss_txfail_config_t;
  7719. #include <packed_section_end.h>
  7720. #include <packed_section_start.h>
  7721. typedef BWL_PRE_PACKED_STRUCT struct wl_aibss_if {
  7722. uint16 version;
  7723. uint16 len;
  7724. uint32 flags;
  7725. struct ether_addr addr;
  7726. chanspec_t chspec;
  7727. } BWL_POST_PACKED_STRUCT wl_aibss_if_t;
  7728. #include <packed_section_end.h>
  7729. #include <packed_section_start.h>
  7730. typedef BWL_PRE_PACKED_STRUCT struct wlc_ipfo_route_entry {
  7731. struct ipv4_addr ip_addr;
  7732. struct ether_addr nexthop;
  7733. } BWL_POST_PACKED_STRUCT wlc_ipfo_route_entry_t;
  7734. #include <packed_section_end.h>
  7735. #include <packed_section_start.h>
  7736. typedef BWL_PRE_PACKED_STRUCT struct wlc_ipfo_route_tbl {
  7737. uint32 num_entry;
  7738. wlc_ipfo_route_entry_t route_entry[1];
  7739. } BWL_POST_PACKED_STRUCT wlc_ipfo_route_tbl_t;
  7740. #include <packed_section_end.h>
  7741. /* Version of wlc_btc_stats_t structure.
  7742. * Increment whenever a change is made to wlc_btc_stats_t
  7743. */
  7744. #define BTCX_STATS_VER_4 4
  7745. typedef struct wlc_btc_stats_v4 {
  7746. uint16 version; /* version number of struct */
  7747. uint16 valid; /* Size of this struct */
  7748. uint32 stats_update_timestamp; /* tStamp when data is updated. */
  7749. uint32 btc_status; /* Hybrid/TDM indicator: Bit2:Hybrid, Bit1:TDM,Bit0:CoexEnabled */
  7750. uint32 bt_req_type_map; /* BT Antenna Req types since last stats sample */
  7751. uint32 bt_req_cnt; /* #BT antenna requests since last stats sampl */
  7752. uint32 bt_gnt_cnt; /* #BT antenna grants since last stats sample */
  7753. uint32 bt_gnt_dur; /* usec BT owns antenna since last stats sample */
  7754. uint16 bt_abort_cnt; /* #Times WL was preempted due to BT since WL up */
  7755. uint16 bt_rxf1ovfl_cnt; /* #Time PSNULL retry count exceeded since WL up */
  7756. uint16 bt_latency_cnt; /* #Time ucode high latency detected since WL up */
  7757. uint16 bt_succ_pm_protect_cnt; /* successful PM protection */
  7758. uint16 bt_succ_cts_cnt; /* successful CTS2A protection */
  7759. uint16 bt_wlan_tx_preempt_cnt; /* WLAN TX Preemption */
  7760. uint16 bt_wlan_rx_preempt_cnt; /* WLAN RX Preemption */
  7761. uint16 bt_ap_tx_after_pm_cnt; /* AP TX even after PM protection */
  7762. uint16 bt_peraud_cumu_gnt_cnt; /* Grant cnt for periodic audio */
  7763. uint16 bt_peraud_cumu_deny_cnt; /* Deny cnt for periodic audio */
  7764. uint16 bt_a2dp_cumu_gnt_cnt; /* Grant cnt for A2DP */
  7765. uint16 bt_a2dp_cumu_deny_cnt; /* Deny cnt for A2DP */
  7766. uint16 bt_sniff_cumu_gnt_cnt; /* Grant cnt for Sniff */
  7767. uint16 bt_sniff_cumu_deny_cnt; /* Deny cnt for Sniff */
  7768. uint16 bt_dcsn_map; /* Accumulated decision bitmap once Ant grant */
  7769. uint16 bt_dcsn_cnt; /* Accumulated decision bitmap counters once Ant grant */
  7770. uint16 bt_a2dp_hiwat_cnt; /* Ant grant by a2dp high watermark */
  7771. uint16 bt_datadelay_cnt; /* Ant grant by acl/a2dp datadelay */
  7772. uint16 bt_crtpri_cnt; /* Ant grant by critical BT task */
  7773. uint16 bt_pri_cnt; /* Ant grant by high BT task */
  7774. uint16 a2dpbuf1cnt; /* Ant request with a2dp buffercnt 1 */
  7775. uint16 a2dpbuf2cnt; /* Ant request with a2dp buffercnt 2 */
  7776. uint16 a2dpbuf3cnt; /* Ant request with a2dp buffercnt 3 */
  7777. uint16 a2dpbuf4cnt; /* Ant request with a2dp buffercnt 4 */
  7778. uint16 a2dpbuf5cnt; /* Ant request with a2dp buffercnt 5 */
  7779. uint16 a2dpbuf6cnt; /* Ant request with a2dp buffercnt 6 */
  7780. uint16 a2dpbuf7cnt; /* Ant request with a2dp buffercnt 7 */
  7781. uint16 a2dpbuf8cnt; /* Ant request with a2dp buffercnt 8 */
  7782. uint16 antgrant_lt10ms; /* Ant grant duration cnt 0~10ms */
  7783. uint16 antgrant_lt30ms; /* Ant grant duration cnt 10~30ms */
  7784. uint16 antgrant_lt60ms; /* Ant grant duration cnt 30~60ms */
  7785. uint16 antgrant_ge60ms; /* Ant grant duration cnt 60~ms */
  7786. } wlc_btc_stats_v4_t;
  7787. #define BTCX_STATS_VER_3 3
  7788. typedef struct wlc_btc_stats_v3 {
  7789. uint16 version; /* version number of struct */
  7790. uint16 valid; /* Size of this struct */
  7791. uint32 stats_update_timestamp; /* tStamp when data is updated. */
  7792. uint32 btc_status; /* Hybrid/TDM indicator: Bit2:Hybrid, Bit1:TDM,Bit0:CoexEnabled */
  7793. uint32 bt_req_type_map; /* BT Antenna Req types since last stats sample */
  7794. uint32 bt_req_cnt; /* #BT antenna requests since last stats sampl */
  7795. uint32 bt_gnt_cnt; /* #BT antenna grants since last stats sample */
  7796. uint32 bt_gnt_dur; /* usec BT owns antenna since last stats sample */
  7797. uint16 bt_abort_cnt; /* #Times WL was preempted due to BT since WL up */
  7798. uint16 bt_rxf1ovfl_cnt; /* #Time PSNULL retry count exceeded since WL up */
  7799. uint16 bt_latency_cnt; /* #Time ucode high latency detected since WL up */
  7800. uint16 rsvd; /* pad to align struct to 32bit bndry */
  7801. uint16 bt_succ_pm_protect_cnt; /* successful PM protection */
  7802. uint16 bt_succ_cts_cnt; /* successful CTS2A protection */
  7803. uint16 bt_wlan_tx_preempt_cnt; /* WLAN TX Preemption */
  7804. uint16 bt_wlan_rx_preempt_cnt; /* WLAN RX Preemption */
  7805. uint16 bt_ap_tx_after_pm_cnt; /* AP TX even after PM protection */
  7806. uint16 bt_peraud_cumu_gnt_cnt; /* Grant cnt for periodic audio */
  7807. uint16 bt_peraud_cumu_deny_cnt; /* Deny cnt for periodic audio */
  7808. uint16 bt_a2dp_cumu_gnt_cnt; /* Grant cnt for A2DP */
  7809. uint16 bt_a2dp_cumu_deny_cnt; /* Deny cnt for A2DP */
  7810. uint16 bt_sniff_cumu_gnt_cnt; /* Grant cnt for Sniff */
  7811. uint16 bt_sniff_cumu_deny_cnt; /* Deny cnt for Sniff */
  7812. uint8 pad; /* Padding */
  7813. uint8 slice_index; /* Slice to report */
  7814. } wlc_btc_stats_v3_t;
  7815. #define BTCX_STATS_VER_2 2
  7816. typedef struct wlc_btc_stats_v2 {
  7817. uint16 version; /* version number of struct */
  7818. uint16 valid; /* Size of this struct */
  7819. uint32 stats_update_timestamp; /* tStamp when data is updated. */
  7820. uint32 btc_status; /* Hybrid/TDM indicator: Bit2:Hybrid, Bit1:TDM,Bit0:CoexEnabled */
  7821. uint32 bt_req_type_map; /* BT Antenna Req types since last stats sample */
  7822. uint32 bt_req_cnt; /* #BT antenna requests since last stats sampl */
  7823. uint32 bt_gnt_cnt; /* #BT antenna grants since last stats sample */
  7824. uint32 bt_gnt_dur; /* usec BT owns antenna since last stats sample */
  7825. uint16 bt_abort_cnt; /* #Times WL was preempted due to BT since WL up */
  7826. uint16 bt_rxf1ovfl_cnt; /* #Time PSNULL retry count exceeded since WL up */
  7827. uint16 bt_latency_cnt; /* #Time ucode high latency detected since WL up */
  7828. uint16 rsvd; /* pad to align struct to 32bit bndry */
  7829. } wlc_btc_stats_v2_t;
  7830. /* Durations for each bt task in millisecond */
  7831. #define WL_BTCX_DURSTATS_VER_1 (1u)
  7832. typedef struct wlc_btcx_durstats_v1 {
  7833. uint16 version; /* version number of struct */
  7834. uint16 valid; /* validity of this struct */
  7835. uint32 stats_update_timestamp; /* tStamp when data is updated */
  7836. uint16 bt_acl_dur; /* acl duration in ms */
  7837. uint16 bt_sco_dur; /* sco duration in ms */
  7838. uint16 bt_esco_dur; /* esco duration in ms */
  7839. uint16 bt_a2dp_dur; /* a2dp duration in ms */
  7840. uint16 bt_sniff_dur; /* sniff duration in ms */
  7841. uint16 bt_pscan_dur; /* page scan duration in ms */
  7842. uint16 bt_iscan_dur; /* inquiry scan duration in ms */
  7843. uint16 bt_page_dur; /* paging duration in ms */
  7844. uint16 bt_inquiry_dur; /* inquiry duration in ms */
  7845. uint16 bt_mss_dur; /* mss duration in ms */
  7846. uint16 bt_park_dur; /* park duration in ms */
  7847. uint16 bt_rssiscan_dur; /* rssiscan duration in ms */
  7848. uint16 bt_iscan_sco_dur; /* inquiry scan sco duration in ms */
  7849. uint16 bt_pscan_sco_dur; /* page scan sco duration in ms */
  7850. uint16 bt_tpoll_dur; /* tpoll duration in ms */
  7851. uint16 bt_sacq_dur; /* sacq duration in ms */
  7852. uint16 bt_sdata_dur; /* sdata duration in ms */
  7853. uint16 bt_rs_listen_dur; /* rs listen duration in ms */
  7854. uint16 bt_rs_burst_dur; /* rs brust duration in ms */
  7855. uint16 bt_ble_adv_dur; /* ble adv duration in ms */
  7856. uint16 bt_ble_scan_dur; /* ble scan duration in ms */
  7857. uint16 bt_ble_init_dur; /* ble init duration in ms */
  7858. uint16 bt_ble_conn_dur; /* ble connection duration in ms */
  7859. uint16 bt_task_lmp_dur; /* lmp duration in ms */
  7860. uint16 bt_esco_retran_dur; /* esco retransmission duration in ms */
  7861. uint16 bt_task26_dur; /* task26 duration in ms */
  7862. uint16 bt_task27_dur; /* task27 duration in ms */
  7863. uint16 bt_task28_dur; /* task28 duration in ms */
  7864. uint16 bt_task_pred_dur; /* prediction task duration in ms */
  7865. uint16 bt_multihid_dur; /* multihid duration in ms */
  7866. } wlc_btcx_durstats_v1_t;
  7867. #define WL_IPFO_ROUTE_TBL_FIXED_LEN 4
  7868. #define WL_MAX_IPFO_ROUTE_TBL_ENTRY 64
  7869. /* Global ASSERT Logging */
  7870. #define ASSERTLOG_CUR_VER 0x0100
  7871. #define MAX_ASSRTSTR_LEN 64
  7872. typedef struct assert_record {
  7873. uint32 time;
  7874. uint8 seq_num;
  7875. int8 str[MAX_ASSRTSTR_LEN];
  7876. } assert_record_t;
  7877. typedef struct assertlog_results {
  7878. uint16 version;
  7879. uint16 record_len;
  7880. uint32 num;
  7881. assert_record_t logs[1];
  7882. } assertlog_results_t;
  7883. #define LOGRRC_FIX_LEN 8
  7884. #define IOBUF_ALLOWED_NUM_OF_LOGREC(type, len) ((len - LOGRRC_FIX_LEN)/sizeof(type))
  7885. /* BCMWAPI_WAI */
  7886. #define IV_LEN 16 /* same as SMS4_WPI_PN_LEN */
  7887. struct wapi_sta_msg_t
  7888. {
  7889. uint16 msg_type;
  7890. uint16 datalen;
  7891. uint8 vap_mac[6];
  7892. uint8 reserve_data1[2];
  7893. uint8 sta_mac[6];
  7894. uint8 reserve_data2[2];
  7895. uint8 gsn[IV_LEN];
  7896. uint8 wie[TLV_BODY_LEN_MAX + TLV_HDR_LEN]; /* 257 */
  7897. uint8 pad[3]; /* padding for alignment */
  7898. };
  7899. /* #endif BCMWAPI_WAI */
  7900. /* chanim acs record */
  7901. typedef struct {
  7902. uint8 valid;
  7903. uint8 trigger;
  7904. chanspec_t selected_chspc;
  7905. int8 bgnoise;
  7906. uint32 glitch_cnt;
  7907. uint8 ccastats;
  7908. uint8 chan_idle;
  7909. uint32 timestamp;
  7910. } chanim_acs_record_t;
  7911. typedef struct {
  7912. chanim_acs_record_t acs_record[CHANIM_ACS_RECORD];
  7913. uint8 count;
  7914. uint32 timestamp;
  7915. } wl_acs_record_t;
  7916. #define WL_CHANIM_STATS_V2 2
  7917. #define CCASTATS_V2_MAX 9
  7918. typedef struct chanim_stats_v2 {
  7919. uint32 glitchcnt; /**< normalized as per second count */
  7920. uint32 badplcp; /**< normalized as per second count */
  7921. uint8 ccastats[CCASTATS_V2_MAX]; /**< normalized as 0-255 */
  7922. int8 bgnoise; /**< background noise level (in dBm) */
  7923. chanspec_t chanspec; /**< ctrl chanspec of the interface */
  7924. uint32 timestamp; /**< time stamp at which the stats are collected */
  7925. uint32 bphy_glitchcnt; /**< normalized as per second count */
  7926. uint32 bphy_badplcp; /**< normalized as per second count */
  7927. uint8 chan_idle; /**< normalized as 0~255 */
  7928. uint8 PAD[3];
  7929. } chanim_stats_v2_t;
  7930. typedef struct chanim_stats {
  7931. uint32 glitchcnt; /**< normalized as per second count */
  7932. uint32 badplcp; /**< normalized as per second count */
  7933. uint8 ccastats[CCASTATS_MAX]; /**< normalized as 0-255 */
  7934. int8 bgnoise; /**< background noise level (in dBm) */
  7935. uint8 pad_1[11 - CCASTATS_MAX];
  7936. chanspec_t chanspec; /**< ctrl chanspec of the interface */
  7937. uint8 pad_2[2];
  7938. uint32 timestamp; /**< time stamp at which the stats are collected */
  7939. uint32 bphy_glitchcnt; /**< normalized as per second count */
  7940. uint32 bphy_badplcp; /**< normalized as per second count */
  7941. uint8 chan_idle; /**< normalized as 0~255 */
  7942. uint8 PAD[3];
  7943. } chanim_stats_t;
  7944. #define WL_CHANIM_STATS_VERSION 3
  7945. typedef struct {
  7946. uint32 buflen;
  7947. uint32 version;
  7948. uint32 count;
  7949. chanim_stats_t stats[1];
  7950. } wl_chanim_stats_t;
  7951. #define WL_CHANIM_STATS_FIXED_LEN OFFSETOF(wl_chanim_stats_t, stats)
  7952. /** Noise measurement metrics. */
  7953. #define NOISE_MEASURE_KNOISE 0x1
  7954. /** scb probe parameter */
  7955. typedef struct {
  7956. uint32 scb_timeout;
  7957. uint32 scb_activity_time;
  7958. uint32 scb_max_probe;
  7959. } wl_scb_probe_t;
  7960. /* structure/defines for selective mgmt frame (smf) stats support */
  7961. #define SMFS_VERSION 1
  7962. /** selected mgmt frame (smf) stats element */
  7963. typedef struct wl_smfs_elem {
  7964. uint32 count;
  7965. uint16 code; /**< SC or RC code */
  7966. uint8 PAD[2];
  7967. } wl_smfs_elem_t;
  7968. typedef struct wl_smf_stats {
  7969. uint32 version;
  7970. uint16 length; /**< reserved for future usage */
  7971. uint8 type;
  7972. uint8 codetype;
  7973. uint32 ignored_cnt;
  7974. uint32 malformed_cnt;
  7975. uint32 count_total; /**< count included the interested group */
  7976. wl_smfs_elem_t elem[1];
  7977. } wl_smf_stats_t;
  7978. #define WL_SMFSTATS_FIXED_LEN OFFSETOF(wl_smf_stats_t, elem);
  7979. enum {
  7980. SMFS_CODETYPE_SC,
  7981. SMFS_CODETYPE_RC
  7982. };
  7983. typedef enum smfs_type {
  7984. SMFS_TYPE_AUTH,
  7985. SMFS_TYPE_ASSOC,
  7986. SMFS_TYPE_REASSOC,
  7987. SMFS_TYPE_DISASSOC_TX,
  7988. SMFS_TYPE_DISASSOC_RX,
  7989. SMFS_TYPE_DEAUTH_TX,
  7990. SMFS_TYPE_DEAUTH_RX,
  7991. SMFS_TYPE_MAX
  7992. } smfs_type_t;
  7993. /* #ifdef PHYMON */
  7994. #define PHYMON_VERSION 1
  7995. typedef struct wl_phycal_core_state {
  7996. /* Tx IQ/LO calibration coeffs */
  7997. int16 tx_iqlocal_a;
  7998. int16 tx_iqlocal_b;
  7999. int8 tx_iqlocal_ci;
  8000. int8 tx_iqlocal_cq;
  8001. int8 tx_iqlocal_di;
  8002. int8 tx_iqlocal_dq;
  8003. int8 tx_iqlocal_ei;
  8004. int8 tx_iqlocal_eq;
  8005. int8 tx_iqlocal_fi;
  8006. int8 tx_iqlocal_fq;
  8007. /** Rx IQ calibration coeffs */
  8008. int16 rx_iqcal_a;
  8009. int16 rx_iqcal_b;
  8010. uint8 tx_iqlocal_pwridx; /**< Tx Power Index for Tx IQ/LO calibration */
  8011. uint8 PAD[3];
  8012. uint32 papd_epsilon_table[64]; /**< PAPD epsilon table */
  8013. int16 papd_epsilon_offset; /**< PAPD epsilon offset */
  8014. uint8 curr_tx_pwrindex; /**< Tx power index */
  8015. int8 idle_tssi; /**< Idle TSSI */
  8016. int8 est_tx_pwr; /**< Estimated Tx Power (dB) */
  8017. int8 est_rx_pwr; /**< Estimated Rx Power (dB) from RSSI */
  8018. uint16 rx_gaininfo; /**< Rx gain applied on last Rx pkt */
  8019. uint16 init_gaincode; /**< initgain required for ACI */
  8020. int8 estirr_tx;
  8021. int8 estirr_rx;
  8022. } wl_phycal_core_state_t;
  8023. typedef struct wl_phycal_state {
  8024. int32 version;
  8025. int8 num_phy_cores; /**< number of cores */
  8026. int8 curr_temperature; /**< on-chip temperature sensor reading */
  8027. chanspec_t chspec; /**< channspec for this state */
  8028. uint8 aci_state; /**< ACI state: ON/OFF */
  8029. uint8 PAD;
  8030. uint16 crsminpower; /**< crsminpower required for ACI */
  8031. uint16 crsminpowerl; /**< crsminpowerl required for ACI */
  8032. uint16 crsminpoweru; /**< crsminpoweru required for ACI */
  8033. wl_phycal_core_state_t phycal_core[1];
  8034. } wl_phycal_state_t;
  8035. #define WL_PHYCAL_STAT_FIXED_LEN OFFSETOF(wl_phycal_state_t, phycal_core)
  8036. /* endif PHYMON */
  8037. /** discovery state */
  8038. typedef struct wl_p2p_disc_st {
  8039. uint8 state; /**< see state */
  8040. uint8 PAD;
  8041. chanspec_t chspec; /**< valid in listen state */
  8042. uint16 dwell; /**< valid in listen state, in ms */
  8043. } wl_p2p_disc_st_t;
  8044. /** scan request */
  8045. typedef struct wl_p2p_scan {
  8046. uint8 type; /**< 'S' for WLC_SCAN, 'E' for "escan" */
  8047. uint8 reserved[3];
  8048. /* scan or escan parms... */
  8049. } wl_p2p_scan_t;
  8050. /** i/f request */
  8051. typedef struct wl_p2p_if {
  8052. struct ether_addr addr;
  8053. uint8 type; /**< see i/f type */
  8054. uint8 PAD;
  8055. chanspec_t chspec; /**< for p2p_ifadd GO */
  8056. } wl_p2p_if_t;
  8057. /** i/f query */
  8058. typedef struct wl_p2p_ifq {
  8059. uint32 bsscfgidx;
  8060. char ifname[BCM_MSG_IFNAME_MAX];
  8061. } wl_p2p_ifq_t;
  8062. /** OppPS & CTWindow */
  8063. typedef struct wl_p2p_ops {
  8064. uint8 ops; /**< 0: disable 1: enable */
  8065. uint8 ctw; /**< >= 10 */
  8066. } wl_p2p_ops_t;
  8067. /** absence and presence request */
  8068. typedef struct wl_p2p_sched_desc {
  8069. uint32 start;
  8070. uint32 interval;
  8071. uint32 duration;
  8072. uint32 count; /**< see count */
  8073. } wl_p2p_sched_desc_t;
  8074. typedef struct wl_p2p_sched {
  8075. uint8 type; /**< see schedule type */
  8076. uint8 action; /**< see schedule action */
  8077. uint8 option; /**< see schedule option */
  8078. uint8 PAD;
  8079. wl_p2p_sched_desc_t desc[1];
  8080. } wl_p2p_sched_t;
  8081. typedef struct wl_p2p_wfds_hash {
  8082. uint32 advt_id;
  8083. uint16 nw_cfg_method;
  8084. uint8 wfds_hash[6];
  8085. uint8 name_len;
  8086. uint8 service_name[MAX_WFDS_SVC_NAME_LEN];
  8087. uint8 PAD[3];
  8088. } wl_p2p_wfds_hash_t;
  8089. typedef struct wl_p2p_config_params {
  8090. uint16 enable; /**< 0: disable 1: enable */
  8091. uint16 chanspec; /* GO chanspec */
  8092. wlc_ssid_t ssid; /* SSID */
  8093. } wl_p2p_config_params_t;
  8094. typedef struct wl_bcmdcs_data {
  8095. uint32 reason;
  8096. chanspec_t chspec;
  8097. uint8 PAD[2];
  8098. } wl_bcmdcs_data_t;
  8099. /* ifdef EXT_STA */
  8100. /**
  8101. * Format of IHV data passed to OID_DOT11_NIC_SPECIFIC_EXTENSION.
  8102. */
  8103. typedef struct _IHV_NIC_SPECIFIC_EXTENSION {
  8104. uint8 oui[4]; /**< vendor specific OUI value */
  8105. uint32 event; /**< event code */
  8106. uint8 ihvData[1]; /**< ihv data */
  8107. } IHV_NIC_SPECIFIC_EXTENSION, *PIHV_NIC_SPECIFIC_EXTENSION;
  8108. #define IHV_NIC_SPECIFIC_EXTENTION_HEADER OFFSETOF(IHV_NIC_SPECIFIC_EXTENSION, ihvData[0])
  8109. /* EXT_STA */
  8110. /** NAT configuration */
  8111. typedef struct {
  8112. uint32 ipaddr; /**< interface ip address */
  8113. uint32 ipaddr_mask; /**< interface ip address mask */
  8114. uint32 ipaddr_gateway; /**< gateway ip address */
  8115. uint8 mac_gateway[6]; /**< gateway mac address */
  8116. uint8 PAD[2];
  8117. uint32 ipaddr_dns; /**< DNS server ip address, valid only for public if */
  8118. uint8 mac_dns[6]; /**< DNS server mac address, valid only for public if */
  8119. uint8 GUID[38]; /**< interface GUID */
  8120. } nat_if_info_t;
  8121. typedef struct {
  8122. uint32 op; /**< operation code */
  8123. uint8 pub_if; /**< set for public if, clear for private if */
  8124. uint8 PAD[3];
  8125. nat_if_info_t if_info; /**< interface info */
  8126. } nat_cfg_t;
  8127. typedef struct {
  8128. int32 state; /**< NAT state returned */
  8129. } nat_state_t;
  8130. typedef struct flush_txfifo {
  8131. uint32 txfifobmp;
  8132. uint32 hwtxfifoflush;
  8133. struct ether_addr ea;
  8134. uint8 PAD[2];
  8135. } flush_txfifo_t;
  8136. enum {
  8137. SPATIAL_MODE_2G_IDX = 0,
  8138. SPATIAL_MODE_5G_LOW_IDX,
  8139. SPATIAL_MODE_5G_MID_IDX,
  8140. SPATIAL_MODE_5G_HIGH_IDX,
  8141. SPATIAL_MODE_5G_UPPER_IDX,
  8142. SPATIAL_MODE_MAX_IDX
  8143. };
  8144. #define WLC_TXCORE_MAX 4 /**< max number of txcore supports */
  8145. #define WLC_TXCORE_MAX_OLD 2 /**< backward compatibilty for TXCAL */
  8146. #define WLC_SUBBAND_MAX 4 /**< max number of sub-band supports */
  8147. typedef struct {
  8148. uint8 band2g[WLC_TXCORE_MAX];
  8149. uint8 band5g[WLC_SUBBAND_MAX][WLC_TXCORE_MAX];
  8150. } sar_limit_t;
  8151. #define MAX_NUM_TXCAL_MEAS 128
  8152. #define MAX_NUM_PWR_STEP 40
  8153. #define TXCAL_IOVAR_VERSION 0x1
  8154. #define TXCAL_GAINSWEEP_VER (TXCAL_GAINSWEEP_VERSION_V2)
  8155. #define TXCAL_GAINSWEEP_VERSION_V2 2
  8156. /* Below macro defines the latest txcal iovar version updated */
  8157. /* This macro also reflects in the 'txcal_ver' iovar */
  8158. #define TXCAL_IOVAR_LATEST TXCAL_GAINSWEEP_VER
  8159. /* below are used for bphy/ofdm separated LSC */
  8160. #define TXCAL_PWR_BPHY 0
  8161. #define TXCAL_PWR_OFDM 1
  8162. typedef struct wl_txcal_meas_percore {
  8163. uint16 tssi[MAX_NUM_TXCAL_MEAS];
  8164. int16 pwr[MAX_NUM_TXCAL_MEAS];
  8165. } wl_txcal_meas_percore_t;
  8166. typedef struct wl_txcal_meas_ncore {
  8167. uint16 version;
  8168. uint8 valid_cnt;
  8169. uint8 num_core;
  8170. wl_txcal_meas_percore_t txcal_percore[1];
  8171. } wl_txcal_meas_ncore_t;
  8172. typedef struct wl_txcal_power_tssi_percore {
  8173. int16 tempsense;
  8174. int16 pwr_start;
  8175. uint8 pwr_start_idx;
  8176. uint8 num_entries;
  8177. uint16 pad;
  8178. uint8 tssi[MAX_NUM_PWR_STEP];
  8179. } wl_txcal_power_tssi_percore_t;
  8180. typedef struct wl_txcal_power_tssi_ncore {
  8181. uint16 version;
  8182. uint8 set_core;
  8183. uint8 channel;
  8184. uint8 num_core;
  8185. uint8 gen_tbl;
  8186. uint8 ofdm;
  8187. uint8 pad;
  8188. wl_txcal_power_tssi_percore_t tssi_percore[4];
  8189. } wl_txcal_power_tssi_ncore_t;
  8190. typedef struct wl_txcal_meas {
  8191. uint16 tssi[WLC_TXCORE_MAX][MAX_NUM_TXCAL_MEAS];
  8192. int16 pwr[WLC_TXCORE_MAX][MAX_NUM_TXCAL_MEAS];
  8193. uint8 valid_cnt;
  8194. uint8 PAD;
  8195. } wl_txcal_meas_t;
  8196. typedef struct wl_txcal_meas_old {
  8197. uint16 tssi[WLC_TXCORE_MAX_OLD][MAX_NUM_TXCAL_MEAS];
  8198. int16 pwr[WLC_TXCORE_MAX_OLD][MAX_NUM_TXCAL_MEAS];
  8199. uint8 valid_cnt;
  8200. uint8 PAD;
  8201. } wl_txcal_meas_old_t;
  8202. typedef struct wl_txcal_power_tssi {
  8203. uint8 set_core;
  8204. uint8 channel;
  8205. int16 tempsense[WLC_TXCORE_MAX];
  8206. int16 pwr_start[WLC_TXCORE_MAX];
  8207. uint8 pwr_start_idx[WLC_TXCORE_MAX];
  8208. uint8 num_entries[WLC_TXCORE_MAX];
  8209. uint8 tssi[WLC_TXCORE_MAX][MAX_NUM_PWR_STEP];
  8210. uint8 gen_tbl;
  8211. uint8 ofdm;
  8212. } wl_txcal_power_tssi_t;
  8213. typedef struct wl_txcal_power_tssi_old {
  8214. uint8 set_core;
  8215. uint8 channel;
  8216. int16 tempsense[WLC_TXCORE_MAX_OLD];
  8217. int16 pwr_start[WLC_TXCORE_MAX_OLD];
  8218. uint8 pwr_start_idx[WLC_TXCORE_MAX_OLD];
  8219. uint8 num_entries[WLC_TXCORE_MAX_OLD];
  8220. uint8 tssi[WLC_TXCORE_MAX_OLD][MAX_NUM_PWR_STEP];
  8221. uint8 gen_tbl;
  8222. uint8 ofdm;
  8223. } wl_txcal_power_tssi_old_t;
  8224. typedef struct wl_olpc_pwr {
  8225. uint16 version;
  8226. uint8 core;
  8227. uint8 channel;
  8228. int16 tempsense;
  8229. uint8 olpc_idx;
  8230. uint8 ofdm;
  8231. } wl_olpc_pwr_t;
  8232. typedef struct wl_rfem_temp_vdet_temp {
  8233. uint8 vdet_fem_t1;
  8234. int8 rfem_temp_t1;
  8235. uint8 vdet_fem_t2;
  8236. int8 rfem_temp_t2;
  8237. } wl_rfem_temp_vdet_temp_t;
  8238. typedef struct wl_rfem_temp_vin_tssi {
  8239. uint16 vin_chip_v1;
  8240. int16 tssi_chip_v1;
  8241. uint16 vin_chip_v2;
  8242. int16 tssi_chip_v2;
  8243. } wl_rfem_temp_vin_tssi_t;
  8244. typedef struct wl_txcal_tempsense {
  8245. uint16 version;
  8246. uint8 valid_cnt;
  8247. uint8 core;
  8248. int16 ref_temperature;
  8249. int16 meas_temperature;
  8250. wl_rfem_temp_vdet_temp_t vdet_temp;
  8251. wl_rfem_temp_vin_tssi_t vin_tssi;
  8252. } wl_txcal_tempsense_t;
  8253. /** IOVAR "mempool" parameter. Used to retrieve a list of memory pool statistics. */
  8254. typedef struct wl_mempool_stats {
  8255. int32 num; /**< Number of memory pools */
  8256. bcm_mp_stats_t s[1]; /**< Variable array of memory pool stats. */
  8257. } wl_mempool_stats_t;
  8258. typedef struct {
  8259. uint32 ipaddr;
  8260. uint32 ipaddr_netmask;
  8261. uint32 ipaddr_gateway;
  8262. } nwoe_ifconfig_t;
  8263. /* Both powersel_params and lpc_params are used by IOVAR lpc_params.
  8264. * The powersel_params is replaced by lpc_params in later WLC versions.
  8265. */
  8266. typedef struct powersel_params {
  8267. /* LPC Params exposed via IOVAR */
  8268. int32 tp_ratio_thresh; /**< Throughput ratio threshold */
  8269. uint8 rate_stab_thresh; /**< Thresh for rate stability based on nupd */
  8270. uint8 pwr_stab_thresh; /**< Number of successes before power step down */
  8271. uint8 pwr_sel_exp_time; /**< Time lapse for expiry of database */
  8272. uint8 PAD;
  8273. } powersel_params_t;
  8274. #define WL_LPC_PARAMS_VER_2 2
  8275. #define WL_LPC_PARAMS_CURRENT_VERSION WL_LPC_PARAMS_VER_2
  8276. typedef struct lpc_params {
  8277. uint16 version;
  8278. uint16 length;
  8279. /* LPC Params exposed via IOVAR */
  8280. uint8 rate_stab_thresh; /**< Thresh for rate stability based on nupd */
  8281. uint8 pwr_stab_thresh; /**< Number of successes before power step down */
  8282. uint8 lpc_exp_time; /**< Time lapse for expiry of database */
  8283. uint8 pwrup_slow_step; /**< Step size for slow step up */
  8284. uint8 pwrup_fast_step; /**< Step size for fast step up */
  8285. uint8 pwrdn_slow_step; /**< Step size for slow step down */
  8286. } lpc_params_t;
  8287. /* tx pkt delay statistics */
  8288. #define SCB_RETRY_SHORT_DEF 7 /**< Default Short retry Limit */
  8289. #define WLPKTDLY_HIST_NBINS 16 /**< number of bins used in the Delay histogram */
  8290. /** structure to store per-AC delay statistics */
  8291. typedef struct scb_delay_stats {
  8292. uint32 txmpdu_lost; /**< number of MPDUs lost */
  8293. uint32 txmpdu_cnt[SCB_RETRY_SHORT_DEF]; /**< retry times histogram */
  8294. uint32 delay_sum[SCB_RETRY_SHORT_DEF]; /**< cumulative packet latency */
  8295. uint32 delay_min; /**< minimum packet latency observed */
  8296. uint32 delay_max; /**< maximum packet latency observed */
  8297. uint32 delay_avg; /**< packet latency average */
  8298. uint32 delay_hist[WLPKTDLY_HIST_NBINS]; /**< delay histogram */
  8299. uint32 delay_count; /**< minimum number of time period units before
  8300. consequent packet delay events can be generated
  8301. */
  8302. uint32 prev_txmpdu_cnt; /**< Previous value of txmpdu_cnt[] during last iteration */
  8303. uint32 prev_delay_sum; /**< Previous value of delay_sum[] during last iteration */
  8304. } scb_delay_stats_t;
  8305. /** structure for txdelay event */
  8306. typedef struct txdelay_event {
  8307. uint8 status;
  8308. uint8 PAD[3];
  8309. int32 rssi;
  8310. chanim_stats_t chanim_stats;
  8311. scb_delay_stats_t delay_stats[AC_COUNT];
  8312. } txdelay_event_t;
  8313. /** structure for txdelay parameters */
  8314. typedef struct txdelay_params {
  8315. uint16 ratio; /**< Avg Txdelay Delta */
  8316. uint8 cnt; /**< Sample cnt */
  8317. uint8 period; /**< Sample period */
  8318. uint8 tune; /**< Debug */
  8319. uint8 PAD;
  8320. } txdelay_params_t;
  8321. #define MAX_TXDELAY_STATS_SCBS 6
  8322. #define TXDELAY_STATS_VERSION 1
  8323. enum {
  8324. TXDELAY_STATS_PARTIAL_RESULT = 0,
  8325. TXDELAY_STATS_FULL_RESULT = 1
  8326. };
  8327. typedef struct scb_total_delay_stats {
  8328. struct ether_addr ea;
  8329. uint8 pad[2];
  8330. scb_delay_stats_t dlystats[AC_COUNT];
  8331. } scb_total_delay_stats_t;
  8332. typedef struct txdelay_stats {
  8333. uint32 version;
  8334. uint32 full_result; /* 0:Partial, 1:full */
  8335. uint32 scb_cnt; /* in:requested, out:returned */
  8336. scb_total_delay_stats_t scb_delay_stats[1];
  8337. } txdelay_stats_t;
  8338. #define WL_TXDELAY_STATS_FIXED_SIZE \
  8339. (sizeof(txdelay_stats_t)+(MAX_TXDELAY_STATS_SCBS-1)*sizeof(scb_total_delay_stats_t))
  8340. enum {
  8341. WNM_SERVICE_DMS = 1,
  8342. WNM_SERVICE_FMS = 2,
  8343. WNM_SERVICE_TFS = 3
  8344. };
  8345. /** Definitions for WNM/NPS TCLAS */
  8346. typedef struct wl_tclas {
  8347. uint8 user_priority;
  8348. uint8 fc_len;
  8349. dot11_tclas_fc_t fc;
  8350. } wl_tclas_t;
  8351. #define WL_TCLAS_FIXED_SIZE OFFSETOF(wl_tclas_t, fc)
  8352. typedef struct wl_tclas_list {
  8353. uint32 num;
  8354. wl_tclas_t tclas[];
  8355. } wl_tclas_list_t;
  8356. /** Definitions for WNM/NPS Traffic Filter Service */
  8357. typedef struct wl_tfs_req {
  8358. uint8 tfs_id;
  8359. uint8 tfs_actcode;
  8360. uint8 tfs_subelem_id;
  8361. uint8 send;
  8362. } wl_tfs_req_t;
  8363. typedef struct wl_tfs_filter {
  8364. uint8 status; /**< Status returned by the AP */
  8365. uint8 tclas_proc; /**< TCLAS processing value (0:and, 1:or) */
  8366. uint8 tclas_cnt; /**< count of all wl_tclas_t in tclas array */
  8367. uint8 tclas[1]; /**< VLA of wl_tclas_t */
  8368. } wl_tfs_filter_t;
  8369. #define WL_TFS_FILTER_FIXED_SIZE OFFSETOF(wl_tfs_filter_t, tclas)
  8370. typedef struct wl_tfs_fset {
  8371. struct ether_addr ea; /**< Address of AP/STA involved with this filter set */
  8372. uint8 tfs_id; /**< TFS ID field chosen by STA host */
  8373. uint8 status; /**< Internal status TFS_STATUS_xxx */
  8374. uint8 actcode; /**< Action code DOT11_TFS_ACTCODE_xxx */
  8375. uint8 token; /**< Token used in last request frame */
  8376. uint8 notify; /**< Notify frame sent/received because of this set */
  8377. uint8 filter_cnt; /**< count of all wl_tfs_filter_t in filter array */
  8378. uint8 filter[1]; /**< VLA of wl_tfs_filter_t */
  8379. } wl_tfs_fset_t;
  8380. #define WL_TFS_FSET_FIXED_SIZE OFFSETOF(wl_tfs_fset_t, filter)
  8381. enum {
  8382. TFS_STATUS_DISABLED = 0, /**< TFS filter set disabled by user */
  8383. TFS_STATUS_DISABLING = 1, /**< Empty request just sent to AP */
  8384. TFS_STATUS_VALIDATED = 2, /**< Filter set validated by AP (but maybe not enabled!) */
  8385. TFS_STATUS_VALIDATING = 3, /**< Filter set just sent to AP */
  8386. TFS_STATUS_NOT_ASSOC = 4, /**< STA not associated */
  8387. TFS_STATUS_NOT_SUPPORT = 5, /**< TFS not supported by AP */
  8388. TFS_STATUS_DENIED = 6, /**< Filter set refused by AP (=> all sets are disabled!) */
  8389. };
  8390. typedef struct wl_tfs_status {
  8391. uint8 fset_cnt; /**< count of all wl_tfs_fset_t in fset array */
  8392. wl_tfs_fset_t fset[1]; /**< VLA of wl_tfs_fset_t */
  8393. } wl_tfs_status_t;
  8394. typedef struct wl_tfs_set {
  8395. uint8 send; /**< Immediatly register registered sets on AP side */
  8396. uint8 tfs_id; /**< ID of a specific set (existing or new), or nul for all */
  8397. uint8 actcode; /**< Action code for this filter set */
  8398. uint8 tclas_proc; /**< TCLAS processing operator for this filter set */
  8399. } wl_tfs_set_t;
  8400. typedef struct wl_tfs_term {
  8401. uint8 del; /**< Delete internal set once confirmation received */
  8402. uint8 tfs_id; /**< ID of a specific set (existing), or nul for all */
  8403. } wl_tfs_term_t;
  8404. #define DMS_DEP_PROXY_ARP (1 << 0)
  8405. /* Definitions for WNM/NPS Directed Multicast Service */
  8406. enum {
  8407. DMS_STATUS_DISABLED = 0, /**< DMS desc disabled by user */
  8408. DMS_STATUS_ACCEPTED = 1, /**< Request accepted by AP */
  8409. DMS_STATUS_NOT_ASSOC = 2, /**< STA not associated */
  8410. DMS_STATUS_NOT_SUPPORT = 3, /**< DMS not supported by AP */
  8411. DMS_STATUS_DENIED = 4, /**< Request denied by AP */
  8412. DMS_STATUS_TERM = 5, /**< Request terminated by AP */
  8413. DMS_STATUS_REMOVING = 6, /**< Remove request just sent */
  8414. DMS_STATUS_ADDING = 7, /**< Add request just sent */
  8415. DMS_STATUS_ERROR = 8, /**< Non compliant AP behvior */
  8416. DMS_STATUS_IN_PROGRESS = 9, /**< Request just sent */
  8417. DMS_STATUS_REQ_MISMATCH = 10 /**< Conditions for sending DMS req not met */
  8418. };
  8419. typedef struct wl_dms_desc {
  8420. uint8 user_id;
  8421. uint8 status;
  8422. uint8 token;
  8423. uint8 dms_id;
  8424. uint8 tclas_proc;
  8425. uint8 mac_len; /**< length of all ether_addr in data array, 0 if STA */
  8426. uint8 tclas_len; /**< length of all wl_tclas_t in data array */
  8427. uint8 data[1]; /**< VLA of 'ether_addr' and 'wl_tclas_t' (in this order ) */
  8428. } wl_dms_desc_t;
  8429. #define WL_DMS_DESC_FIXED_SIZE OFFSETOF(wl_dms_desc_t, data)
  8430. typedef struct wl_dms_status {
  8431. uint32 cnt;
  8432. wl_dms_desc_t desc[1];
  8433. } wl_dms_status_t;
  8434. typedef struct wl_dms_set {
  8435. uint8 send;
  8436. uint8 user_id;
  8437. uint8 tclas_proc;
  8438. } wl_dms_set_t;
  8439. typedef struct wl_dms_term {
  8440. uint8 del;
  8441. uint8 user_id;
  8442. } wl_dms_term_t;
  8443. typedef struct wl_service_term {
  8444. uint8 service;
  8445. union {
  8446. wl_dms_term_t dms;
  8447. } u;
  8448. } wl_service_term_t;
  8449. /** Definitions for WNM/NPS BSS Transistion */
  8450. #define WL_BSSTRANS_QUERY_VERSION_1 1
  8451. typedef struct wl_bsstrans_query {
  8452. uint16 version; /* structure version */
  8453. uint16 pad0; /* padding for 4-byte allignment */
  8454. wlc_ssid_t ssid; /* SSID of NBR elem to be queried for */
  8455. uint8 reason; /* Reason code of the BTQ */
  8456. uint8 pad1[3]; /* padding for 4-byte allignment */
  8457. } wl_bsstrans_query_t;
  8458. #define BTM_QUERY_NBR_COUNT_MAX 16
  8459. #define WL_BTQ_NBR_LIST_VERSION_1 1
  8460. typedef struct wl_btq_nbr_list {
  8461. uint16 version; /* structure version */
  8462. uint8 count; /* No. of BTQ NBRs returned */
  8463. uint8 pad; /* padding for 4-byte allignment */
  8464. nbr_rpt_elem_t btq_nbt_elem[]; /* BTQ NBR elem in a BTQ NBR list */
  8465. } wl_btq_nbr_list_t;
  8466. typedef struct wl_bsstrans_req {
  8467. uint16 tbtt; /**< time of BSS to end of life, in unit of TBTT */
  8468. uint16 dur; /**< time of BSS to keep off, in unit of minute */
  8469. uint8 reqmode; /**< request mode of BSS transition request */
  8470. uint8 unicast; /**< request by unicast or by broadcast */
  8471. } wl_bsstrans_req_t;
  8472. enum {
  8473. BSSTRANS_RESP_AUTO = 0, /**< Currently equivalent to ENABLE */
  8474. BSSTRANS_RESP_DISABLE = 1, /**< Never answer BSS Trans Req frames */
  8475. BSSTRANS_RESP_ENABLE = 2, /**< Always answer Req frames with preset data */
  8476. BSSTRANS_RESP_WAIT = 3, /**< Send ind, wait and/or send preset data (NOT IMPL) */
  8477. BSSTRANS_RESP_IMMEDIATE = 4 /**< After an ind, set data and send resp (NOT IMPL) */
  8478. };
  8479. typedef struct wl_bsstrans_resp {
  8480. uint8 policy;
  8481. uint8 status;
  8482. uint8 delay;
  8483. struct ether_addr target;
  8484. } wl_bsstrans_resp_t;
  8485. /* "wnm_bsstrans_policy" argument programs behavior after BSSTRANS Req reception.
  8486. * BSS-Transition feature is used by multiple programs such as NPS-PF, VE-PF,
  8487. * Band-steering, Hotspot 2.0 and customer requirements. Each PF and its test plan
  8488. * mandates different behavior on receiving BSS-transition request. To accomodate
  8489. * such divergent behaviors these policies have been created.
  8490. */
  8491. typedef enum {
  8492. WL_BSSTRANS_POLICY_ROAM_ALWAYS = 0, /**< Roam (or disassociate) in all cases */
  8493. WL_BSSTRANS_POLICY_ROAM_IF_MODE = 1, /**< Roam only if requested by Request Mode field */
  8494. WL_BSSTRANS_POLICY_ROAM_IF_PREF = 2, /**< Roam only if Preferred BSS provided */
  8495. WL_BSSTRANS_POLICY_WAIT = 3, /**< Wait for deauth and send Accepted status */
  8496. WL_BSSTRANS_POLICY_PRODUCT = 4, /**< Policy for real product use cases (Olympic) */
  8497. WL_BSSTRANS_POLICY_PRODUCT_WBTEXT = 5, /**< Policy for real product use cases (SS) */
  8498. WL_BSSTRANS_POLICY_MBO = 6, /**< Policy for MBO certification */
  8499. WL_BSSTRANS_POLICY_MAX = 7
  8500. } wnm_bsstrans_policy_type_t;
  8501. /** Definitions for WNM/NPS TIM Broadcast */
  8502. typedef struct wl_timbc_offset {
  8503. int16 offset; /**< offset in us */
  8504. uint16 fix_intv; /**< override interval sent from STA */
  8505. uint16 rate_override; /**< use rate override to send high rate TIM broadcast frame */
  8506. uint8 tsf_present; /**< show timestamp in TIM broadcast frame */
  8507. uint8 PAD;
  8508. } wl_timbc_offset_t;
  8509. typedef struct wl_timbc_set {
  8510. uint8 interval; /**< Interval in DTIM wished or required. */
  8511. uint8 flags; /**< Bitfield described below */
  8512. uint16 rate_min; /**< Minimum rate required for High/Low TIM frames. Optionnal */
  8513. uint16 rate_max; /**< Maximum rate required for High/Low TIM frames. Optionnal */
  8514. } wl_timbc_set_t;
  8515. enum {
  8516. WL_TIMBC_SET_TSF_REQUIRED = 1, /**< Enable TIMBC only if TSF in TIM frames */
  8517. WL_TIMBC_SET_NO_OVERRIDE = 2, /**< ... if AP does not override interval */
  8518. WL_TIMBC_SET_PROXY_ARP = 4, /**< ... if AP support Proxy ARP */
  8519. WL_TIMBC_SET_DMS_ACCEPTED = 8 /**< ... if all DMS desc have been accepted */
  8520. };
  8521. typedef struct wl_timbc_status {
  8522. uint8 status_sta; /**< Status from internal state machine (check below) */
  8523. uint8 status_ap; /**< From AP response frame (check 8.4.2.86 from 802.11) */
  8524. uint8 interval;
  8525. uint8 pad;
  8526. int32 offset;
  8527. uint16 rate_high;
  8528. uint16 rate_low;
  8529. } wl_timbc_status_t;
  8530. enum {
  8531. WL_TIMBC_STATUS_DISABLE = 0, /**< TIMBC disabled by user */
  8532. WL_TIMBC_STATUS_REQ_MISMATCH = 1, /**< AP settings do no match user requirements */
  8533. WL_TIMBC_STATUS_NOT_ASSOC = 2, /**< STA not associated */
  8534. WL_TIMBC_STATUS_NOT_SUPPORT = 3, /**< TIMBC not supported by AP */
  8535. WL_TIMBC_STATUS_DENIED = 4, /**< Req to disable TIMBC sent to AP */
  8536. WL_TIMBC_STATUS_ENABLE = 5 /**< TIMBC enabled */
  8537. };
  8538. /** Definitions for PM2 Dynamic Fast Return To Sleep */
  8539. typedef struct wl_pm2_sleep_ret_ext {
  8540. uint8 logic; /**< DFRTS logic: see WL_DFRTS_LOGIC_* below */
  8541. uint8 PAD;
  8542. uint16 low_ms; /**< Low FRTS timeout */
  8543. uint16 high_ms; /**< High FRTS timeout */
  8544. uint16 rx_pkts_threshold; /**< switching threshold: # rx pkts */
  8545. uint16 tx_pkts_threshold; /**< switching threshold: # tx pkts */
  8546. uint16 txrx_pkts_threshold; /**< switching threshold: # (tx+rx) pkts */
  8547. uint32 rx_bytes_threshold; /**< switching threshold: # rx bytes */
  8548. uint32 tx_bytes_threshold; /**< switching threshold: # tx bytes */
  8549. uint32 txrx_bytes_threshold; /**< switching threshold: # (tx+rx) bytes */
  8550. } wl_pm2_sleep_ret_ext_t;
  8551. #define WL_DFRTS_LOGIC_OFF 0 /**< Feature is disabled */
  8552. #define WL_DFRTS_LOGIC_OR 1 /**< OR all non-zero threshold conditions */
  8553. #define WL_DFRTS_LOGIC_AND 2 /**< AND all non-zero threshold conditions */
  8554. /* Values for the passive_on_restricted_mode iovar. When set to non-zero, this iovar
  8555. * disables automatic conversions of a channel from passively scanned to
  8556. * actively scanned. These values only have an effect for country codes such
  8557. * as XZ where some 5 GHz channels are defined to be passively scanned.
  8558. */
  8559. #define WL_PASSACTCONV_DISABLE_NONE 0 /**< Enable permanent and temporary conversions */
  8560. #define WL_PASSACTCONV_DISABLE_ALL 1 /**< Disable permanent and temporary conversions */
  8561. #define WL_PASSACTCONV_DISABLE_PERM 2 /**< Disable only permanent conversions */
  8562. /* Definitions for Reliable Multicast */
  8563. #define WL_RMC_CNT_VERSION 1
  8564. #define WL_RMC_TR_VERSION 1
  8565. #define WL_RMC_MAX_CLIENT 32
  8566. #define WL_RMC_FLAG_INBLACKLIST 1
  8567. #define WL_RMC_FLAG_ACTIVEACKER 2
  8568. #define WL_RMC_FLAG_RELMCAST 4
  8569. #define WL_RMC_MAX_TABLE_ENTRY 4
  8570. #define WL_RMC_VER 1
  8571. #define WL_RMC_INDEX_ACK_ALL 255
  8572. #define WL_RMC_NUM_OF_MC_STREAMS 4
  8573. #define WL_RMC_MAX_TRS_PER_GROUP 1
  8574. #define WL_RMC_MAX_TRS_IN_ACKALL 1
  8575. #define WL_RMC_ACK_MCAST0 0x02
  8576. #define WL_RMC_ACK_MCAST_ALL 0x01
  8577. #define WL_RMC_ACTF_TIME_MIN 300 /**< time in ms */
  8578. #define WL_RMC_ACTF_TIME_MAX 20000 /**< time in ms */
  8579. #define WL_RMC_MAX_NUM_TRS 32 /**< maximun transmitters allowed */
  8580. #define WL_RMC_ARTMO_MIN 350 /**< time in ms */
  8581. #define WL_RMC_ARTMO_MAX 40000 /**< time in ms */
  8582. /* RMC events in action frames */
  8583. enum rmc_opcodes {
  8584. RELMCAST_ENTRY_OP_DISABLE = 0, /**< Disable multi-cast group */
  8585. RELMCAST_ENTRY_OP_DELETE = 1, /**< Delete multi-cast group */
  8586. RELMCAST_ENTRY_OP_ENABLE = 2, /**< Enable multi-cast group */
  8587. RELMCAST_ENTRY_OP_ACK_ALL = 3 /**< Enable ACK ALL bit in AMT */
  8588. };
  8589. /* RMC operational modes */
  8590. enum rmc_modes {
  8591. WL_RMC_MODE_RECEIVER = 0, /**< Receiver mode by default */
  8592. WL_RMC_MODE_TRANSMITTER = 1, /**< Transmitter mode using wl ackreq */
  8593. WL_RMC_MODE_INITIATOR = 2 /**< Initiator mode using wl ackreq */
  8594. };
  8595. /** Each RMC mcast client info */
  8596. typedef struct wl_relmcast_client {
  8597. uint8 flag; /**< status of client such as AR, R, or blacklisted */
  8598. uint8 PAD;
  8599. int16 rssi; /**< rssi value of RMC client */
  8600. struct ether_addr addr; /**< mac address of RMC client */
  8601. } wl_relmcast_client_t;
  8602. /** RMC Counters */
  8603. typedef struct wl_rmc_cnts {
  8604. uint16 version; /**< see definition of WL_CNT_T_VERSION */
  8605. uint16 length; /**< length of entire structure */
  8606. uint16 dupcnt; /**< counter for duplicate rmc MPDU */
  8607. uint16 ackreq_err; /**< counter for wl ackreq error */
  8608. uint16 af_tx_err; /**< error count for action frame transmit */
  8609. uint16 null_tx_err; /**< error count for rmc null frame transmit */
  8610. uint16 af_unicast_tx_err; /**< error count for rmc unicast frame transmit */
  8611. uint16 mc_no_amt_slot; /**< No mcast AMT entry available */
  8612. /* Unused. Keep for rom compatibility */
  8613. uint16 mc_no_glb_slot; /**< No mcast entry available in global table */
  8614. uint16 mc_not_mirrored; /**< mcast group is not mirrored */
  8615. uint16 mc_existing_tr; /**< mcast group is already taken by transmitter */
  8616. uint16 mc_exist_in_amt; /**< mcast group is already programmed in amt */
  8617. /* Unused. Keep for rom compatibility */
  8618. uint16 mc_not_exist_in_gbl; /**< mcast group is not in global table */
  8619. uint16 mc_not_exist_in_amt; /**< mcast group is not in AMT table */
  8620. uint16 mc_utilized; /**< mcast addressed is already taken */
  8621. uint16 mc_taken_other_tr; /**< multi-cast addressed is already taken */
  8622. uint32 rmc_rx_frames_mac; /**< no of mc frames received from mac */
  8623. uint32 rmc_tx_frames_mac; /**< no of mc frames transmitted to mac */
  8624. uint32 mc_null_ar_cnt; /**< no. of times NULL AR is received */
  8625. uint32 mc_ar_role_selected; /**< no. of times took AR role */
  8626. uint32 mc_ar_role_deleted; /**< no. of times AR role cancelled */
  8627. uint32 mc_noacktimer_expired; /**< no. of times noack timer expired */
  8628. uint16 mc_no_wl_clk; /**< no wl clk detected when trying to access amt */
  8629. uint16 mc_tr_cnt_exceeded; /**< No of transmitters in the network exceeded */
  8630. } wl_rmc_cnts_t;
  8631. /** RMC Status */
  8632. typedef struct wl_relmcast_st {
  8633. uint8 ver; /**< version of RMC */
  8634. uint8 num; /**< number of clients detected by transmitter */
  8635. wl_relmcast_client_t clients[WL_RMC_MAX_CLIENT];
  8636. uint16 err; /**< error status (used in infra) */
  8637. uint16 actf_time; /**< action frame time period */
  8638. } wl_relmcast_status_t;
  8639. /** Entry for each STA/node */
  8640. typedef struct wl_rmc_entry {
  8641. /* operation on multi-cast entry such add,
  8642. * delete, ack-all
  8643. */
  8644. int8 flag;
  8645. struct ether_addr addr; /**< multi-cast group mac address */
  8646. } wl_rmc_entry_t;
  8647. /** RMC table */
  8648. typedef struct wl_rmc_entry_table {
  8649. uint8 index; /**< index to a particular mac entry in table */
  8650. uint8 opcode; /**< opcodes or operation on entry */
  8651. wl_rmc_entry_t entry[WL_RMC_MAX_TABLE_ENTRY];
  8652. } wl_rmc_entry_table_t;
  8653. typedef struct wl_rmc_trans_elem {
  8654. struct ether_addr tr_mac; /**< transmitter mac */
  8655. struct ether_addr ar_mac; /**< ar mac */
  8656. uint16 artmo; /**< AR timeout */
  8657. uint8 amt_idx; /**< amt table entry */
  8658. uint8 PAD;
  8659. uint16 flag; /**< entry will be acked, not acked, programmed, full etc */
  8660. } wl_rmc_trans_elem_t;
  8661. /** RMC transmitters */
  8662. typedef struct wl_rmc_trans_in_network {
  8663. uint8 ver; /**< version of RMC */
  8664. uint8 num_tr; /**< number of transmitters in the network */
  8665. wl_rmc_trans_elem_t trs[WL_RMC_MAX_NUM_TRS];
  8666. } wl_rmc_trans_in_network_t;
  8667. /** To update vendor specific ie for RMC */
  8668. typedef struct wl_rmc_vsie {
  8669. uint8 oui[DOT11_OUI_LEN];
  8670. uint8 PAD;
  8671. uint16 payload; /**< IE Data Payload */
  8672. } wl_rmc_vsie_t;
  8673. /* structures & defines for proximity detection */
  8674. enum proxd_method {
  8675. PROXD_UNDEFINED_METHOD = 0,
  8676. PROXD_RSSI_METHOD = 1,
  8677. PROXD_TOF_METHOD = 2
  8678. };
  8679. /* structures for proximity detection device role */
  8680. #define WL_PROXD_MODE_DISABLE 0
  8681. #define WL_PROXD_MODE_NEUTRAL 1
  8682. #define WL_PROXD_MODE_INITIATOR 2
  8683. #define WL_PROXD_MODE_TARGET 3
  8684. #define WL_PROXD_ACTION_STOP 0
  8685. #define WL_PROXD_ACTION_START 1
  8686. #define WL_PROXD_FLAG_TARGET_REPORT 0x1
  8687. #define WL_PROXD_FLAG_REPORT_FAILURE 0x2
  8688. #define WL_PROXD_FLAG_INITIATOR_REPORT 0x4
  8689. #define WL_PROXD_FLAG_NOCHANSWT 0x8
  8690. #define WL_PROXD_FLAG_NETRUAL 0x10
  8691. #define WL_PROXD_FLAG_INITIATOR_RPTRTT 0x20
  8692. #define WL_PROXD_FLAG_ONEWAY 0x40
  8693. #define WL_PROXD_FLAG_SEQ_EN 0x80
  8694. #define WL_PROXD_SETFLAG_K 0x1
  8695. #define WL_PROXD_SETFLAG_N 0x2
  8696. #define WL_PROXD_SETFLAG_S 0x4
  8697. #define WL_PROXD_SETFLAG_K 0x1
  8698. #define WL_PROXD_SETFLAG_N 0x2
  8699. #define WL_PROXD_SETFLAG_S 0x4
  8700. #define WL_PROXD_RANDOM_WAKEUP 0x8000
  8701. #define WL_PROXD_MAXREPORT 8
  8702. typedef struct wl_proxd_iovar {
  8703. uint16 method; /**< Proximity Detection method */
  8704. uint16 mode; /**< Mode (neutral, initiator, target) */
  8705. } wl_proxd_iovar_t;
  8706. /*
  8707. * structures for proximity detection parameters
  8708. * consists of two parts, common and method specific params
  8709. * common params should be placed at the beginning
  8710. */
  8711. typedef struct wl_proxd_params_common {
  8712. chanspec_t chanspec; /**< channel spec */
  8713. int16 tx_power; /**< tx power of Proximity Detection(PD) frames (in dBm) */
  8714. uint16 tx_rate; /**< tx rate of PD rames (in 500kbps units) */
  8715. uint16 timeout; /**< timeout value */
  8716. uint16 interval; /**< interval between neighbor finding attempts (in TU) */
  8717. uint16 duration; /**< duration of neighbor finding attempts (in ms) */
  8718. } wl_proxd_params_common_t;
  8719. typedef struct wl_proxd_params_rssi_method {
  8720. chanspec_t chanspec; /**< chanspec for home channel */
  8721. int16 tx_power; /**< tx power of Proximity Detection frames (in dBm) */
  8722. uint16 tx_rate; /**< tx rate of PD frames, 500kbps units */
  8723. uint16 timeout; /**< state machine wait timeout of the frames (in ms) */
  8724. uint16 interval; /**< interval between neighbor finding attempts (in TU) */
  8725. uint16 duration; /**< duration of neighbor finding attempts (in ms) */
  8726. /* method specific ones go after this line */
  8727. int16 rssi_thresh; /**< RSSI threshold (in dBm) */
  8728. uint16 maxconvergtmo; /**< max wait converge timeout (in ms) */
  8729. } wl_proxd_params_rssi_method_t;
  8730. #define Q1_NS 25 /**< Q1 time units */
  8731. #define TOF_BW_NUM 3 /**< number of bandwidth that the TOF can support */
  8732. #define TOF_BW_SEQ_NUM (TOF_BW_NUM+2) /* number of total index */
  8733. enum tof_bw_index {
  8734. TOF_BW_20MHZ_INDEX = 0,
  8735. TOF_BW_40MHZ_INDEX = 1,
  8736. TOF_BW_80MHZ_INDEX = 2,
  8737. TOF_BW_SEQTX_INDEX = 3,
  8738. TOF_BW_SEQRX_INDEX = 4
  8739. };
  8740. #define BANDWIDTH_BASE 20 /**< base value of bandwidth */
  8741. #define TOF_BW_20MHZ (BANDWIDTH_BASE << TOF_BW_20MHZ_INDEX)
  8742. #define TOF_BW_40MHZ (BANDWIDTH_BASE << TOF_BW_40MHZ_INDEX)
  8743. #define TOF_BW_80MHZ (BANDWIDTH_BASE << TOF_BW_80MHZ_INDEX)
  8744. #define TOF_BW_10MHZ 10
  8745. #define NFFT_BASE 64 /**< base size of fft */
  8746. #define TOF_NFFT_20MHZ (NFFT_BASE << TOF_BW_20MHZ_INDEX)
  8747. #define TOF_NFFT_40MHZ (NFFT_BASE << TOF_BW_40MHZ_INDEX)
  8748. #define TOF_NFFT_80MHZ (NFFT_BASE << TOF_BW_80MHZ_INDEX)
  8749. typedef struct wl_proxd_params_tof_method {
  8750. chanspec_t chanspec; /**< chanspec for home channel */
  8751. int16 tx_power; /**< tx power of Proximity Detection(PD) frames (in dBm) */
  8752. uint16 tx_rate; /**< tx rate of PD rames (in 500kbps units) */
  8753. uint16 timeout; /**< state machine wait timeout of the frames (in ms) */
  8754. uint16 interval; /**< interval between neighbor finding attempts (in TU) */
  8755. uint16 duration; /**< duration of neighbor finding attempts (in ms) */
  8756. /* specific for the method go after this line */
  8757. struct ether_addr tgt_mac; /**< target mac addr for TOF method */
  8758. uint16 ftm_cnt; /**< number of the frames txed by initiator */
  8759. uint16 retry_cnt; /**< number of retransmit attampts for ftm frames */
  8760. int16 vht_rate; /**< ht or vht rate */
  8761. /* add more params required for other methods can be added here */
  8762. } wl_proxd_params_tof_method_t;
  8763. typedef struct wl_proxd_seq_config
  8764. {
  8765. int16 N_tx_log2;
  8766. int16 N_rx_log2;
  8767. int16 N_tx_scale;
  8768. int16 N_rx_scale;
  8769. int16 w_len;
  8770. int16 w_offset;
  8771. } wl_proxd_seq_config_t;
  8772. #define WL_PROXD_TUNE_VERSION_1 1
  8773. #define WL_PROXD_TUNE_VERSION_2 2
  8774. #include <packed_section_start.h>
  8775. /* For legacy ranging target (e.g. 43430, 43342) */
  8776. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_params_tof_tune_v1 {
  8777. uint32 version;
  8778. uint32 Ki; /**< h/w delay K factor for initiator */
  8779. uint32 Kt; /**< h/w delay K factor for target */
  8780. int16 vhtack; /**< enable/disable VHT ACK */
  8781. int16 N_log2[TOF_BW_SEQ_NUM]; /**< simple threshold crossing */
  8782. int16 w_offset[TOF_BW_NUM]; /**< offset of threshold crossing window(per BW) */
  8783. int16 w_len[TOF_BW_NUM]; /**< length of threshold crossing window(per BW) */
  8784. int32 maxDT; /**< max time difference of T4/T1 or T3/T2 */
  8785. int32 minDT; /**< min time difference of T4/T1 or T3/T2 */
  8786. uint8 totalfrmcnt; /**< total count of transfered measurement frames */
  8787. uint16 rsv_media; /**< reserve media value for TOF */
  8788. uint32 flags; /**< flags */
  8789. uint8 core; /**< core to use for tx */
  8790. uint8 setflags; /* set flags of K, N. S values */
  8791. int16 N_scale[TOF_BW_SEQ_NUM]; /**< simple threshold crossing */
  8792. uint8 sw_adj; /**< enable sw assisted timestamp adjustment */
  8793. uint8 hw_adj; /**< enable hw assisted timestamp adjustment */
  8794. uint8 seq_en; /**< enable ranging sequence */
  8795. uint8 ftm_cnt[TOF_BW_SEQ_NUM]; /**< number of ftm frames based on bandwidth */
  8796. int16 N_log2_2g; /**< simple threshold crossing for 2g channel */
  8797. int16 N_scale_2g; /**< simple threshold crossing for 2g channel */
  8798. wl_proxd_seq_config_t seq_5g20;
  8799. wl_proxd_seq_config_t seq_2g20; /* Thresh crossing params for 2G Sequence */
  8800. uint16 bitflip_thresh; /* bitflip threshold */
  8801. uint16 snr_thresh; /* SNR threshold */
  8802. int8 recv_2g_thresh; /* 2g recieve sensitivity threshold */
  8803. uint32 acs_gdv_thresh;
  8804. int8 acs_rssi_thresh;
  8805. uint8 smooth_win_en;
  8806. int32 emu_delay;
  8807. } BWL_POST_PACKED_STRUCT wl_proxd_params_tof_tune_v1_t;
  8808. #include <packed_section_end.h>
  8809. #include <packed_section_start.h>
  8810. /* For legacy ranging initiator (including 4364) */
  8811. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_params_tof_tune_v2 {
  8812. uint32 version;
  8813. uint32 Ki; /**< h/w delay K factor for initiator */
  8814. uint32 Kt; /**< h/w delay K factor for target */
  8815. int16 vhtack; /**< enable/disable VHT ACK */
  8816. int16 N_log2[TOF_BW_SEQ_NUM]; /**< simple threshold crossing */
  8817. int16 w_offset[TOF_BW_NUM]; /**< offset of threshold crossing window(per BW) */
  8818. int16 w_len[TOF_BW_NUM]; /**< length of threshold crossing window(per BW) */
  8819. int32 maxDT; /**< max time difference of T4/T1 or T3/T2 */
  8820. int32 minDT; /**< min time difference of T4/T1 or T3/T2 */
  8821. uint8 totalfrmcnt; /**< total count of transfered measurement frames */
  8822. uint16 rsv_media; /**< reserve media value for TOF */
  8823. uint32 flags; /**< flags */
  8824. uint8 core; /**< core to use for tx */
  8825. uint8 setflags; /* set flags of K, N. S values */
  8826. int16 N_scale[TOF_BW_SEQ_NUM]; /**< simple threshold crossing */
  8827. uint8 sw_adj; /**< enable sw assisted timestamp adjustment */
  8828. uint8 hw_adj; /**< enable hw assisted timestamp adjustment */
  8829. uint8 seq_en; /**< enable ranging sequence */
  8830. uint8 ftm_cnt[TOF_BW_SEQ_NUM]; /**< number of ftm frames based on bandwidth */
  8831. int16 N_log2_2g; /**< simple threshold crossing for 2g channel */
  8832. int16 N_scale_2g; /**< simple threshold crossing for 2g channel */
  8833. wl_proxd_seq_config_t seq_5g20;
  8834. wl_proxd_seq_config_t seq_2g20; /* Thresh crossing params for 2G Sequence */
  8835. uint16 bitflip_thresh; /* bitflip threshold */
  8836. uint16 snr_thresh; /* SNR threshold */
  8837. int8 recv_2g_thresh; /* 2g recieve sensitivity threshold */
  8838. uint32 acs_gdv_thresh;
  8839. int8 acs_rssi_thresh;
  8840. uint8 smooth_win_en;
  8841. int32 acs_gdmm_thresh;
  8842. int8 acs_delta_rssi_thresh;
  8843. int32 emu_delay;
  8844. uint8 core_mask; /* core mask selection */
  8845. } BWL_POST_PACKED_STRUCT wl_proxd_params_tof_tune_v2_t;
  8846. #include <packed_section_end.h>
  8847. #define WL_PROXD_TUNE_VERSION_3 3
  8848. /* Future ranging support */
  8849. typedef struct wl_proxd_params_tof_tune_v3 {
  8850. uint16 version;
  8851. uint16 len;
  8852. uint32 Ki; /**< h/w delay K factor for initiator */
  8853. uint32 Kt; /**< h/w delay K factor for target */
  8854. int16 vhtack; /**< enable/disable VHT ACK */
  8855. uint16 PAD;
  8856. int16 N_log2[TOF_BW_SEQ_NUM]; /**< simple threshold crossing */
  8857. uint16 PAD;
  8858. int16 w_offset[TOF_BW_NUM]; /**< offset of threshold crossing window(per BW) */
  8859. uint16 PAD;
  8860. int16 w_len[TOF_BW_NUM]; /**< length of threshold crossing window(per BW) */
  8861. uint16 PAD;
  8862. int32 maxDT; /**< max time difference of T4/T1 or T3/T2 */
  8863. int32 minDT; /**< min time difference of T4/T1 or T3/T2 */
  8864. uint8 totalfrmcnt; /**< total count of transfered measurement frames */
  8865. uint8 PAD[3];
  8866. uint16 rsv_media; /**< reserve media value for TOF */
  8867. uint16 PAD;
  8868. uint32 flags; /**< flags */
  8869. uint8 core; /**< core to use for tx */
  8870. uint8 setflags; /* set flags of K, N. S values */
  8871. uint16 PAD;
  8872. int16 N_scale[TOF_BW_SEQ_NUM]; /**< simple threshold crossing */
  8873. uint8 sw_adj; /**< enable sw assisted timestamp adjustment */
  8874. uint8 hw_adj; /**< enable hw assisted timestamp adjustment */
  8875. uint8 seq_en; /**< enable ranging sequence */
  8876. uint8 PAD[3];
  8877. uint8 ftm_cnt[TOF_BW_SEQ_NUM]; /**< number of ftm frames based on bandwidth */
  8878. uint8 PAD[3];
  8879. int16 N_log2_2g; /**< simple threshold crossing for 2g channel */
  8880. int16 N_scale_2g; /**< simple threshold crossing for 2g channel */
  8881. wl_proxd_seq_config_t seq_5g20;
  8882. wl_proxd_seq_config_t seq_2g20; /* Thresh crossing params for 2G Sequence */
  8883. uint16 bitflip_thresh; /* bitflip threshold */
  8884. uint16 snr_thresh; /* SNR threshold */
  8885. int8 recv_2g_thresh; /* 2g recieve sensitivity threshold */
  8886. uint8 PAD[3];
  8887. uint32 acs_gdv_thresh;
  8888. int8 acs_rssi_thresh;
  8889. uint8 smooth_win_en;
  8890. uint16 PAD;
  8891. int32 acs_gdmm_thresh;
  8892. int8 acs_delta_rssi_thresh;
  8893. uint8 PAD[3];
  8894. int32 emu_delay;
  8895. uint8 core_mask; /* core mask selection */
  8896. uint8 PAD[3];
  8897. } wl_proxd_params_tof_tune_v3_t;
  8898. typedef struct wl_proxd_params_iovar {
  8899. uint16 method; /**< Proximity Detection method */
  8900. uint8 PAD[2];
  8901. union {
  8902. /* common params for pdsvc */
  8903. wl_proxd_params_common_t cmn_params; /**< common parameters */
  8904. /* method specific */
  8905. wl_proxd_params_rssi_method_t rssi_params; /**< RSSI method parameters */
  8906. wl_proxd_params_tof_method_t tof_params; /**< TOF method parameters */
  8907. /* tune parameters */
  8908. wl_proxd_params_tof_tune_v3_t tof_tune; /**< TOF tune parameters */
  8909. } u; /**< Method specific optional parameters */
  8910. } wl_proxd_params_iovar_t;
  8911. #define PROXD_COLLECT_GET_STATUS 0
  8912. #define PROXD_COLLECT_SET_STATUS 1
  8913. #define PROXD_COLLECT_QUERY_HEADER 2
  8914. #define PROXD_COLLECT_QUERY_DATA 3
  8915. #define PROXD_COLLECT_QUERY_DEBUG 4
  8916. #define PROXD_COLLECT_REMOTE_REQUEST 5
  8917. #define PROXD_COLLECT_DONE 6
  8918. typedef enum {
  8919. WL_PROXD_COLLECT_METHOD_TYPE_DISABLE = 0x0,
  8920. WL_PROXD_COLLECT_METHOD_TYPE_IOVAR = 0x1,
  8921. WL_PROXD_COLLECT_METHOD_TYPE_EVENT = 0x2,
  8922. WL_PROXD_COLLECT_METHOD_TYPE_EVENT_LOG = 0x4
  8923. } wl_proxd_collect_method_type_t;
  8924. typedef uint16 wl_proxd_collect_method_t; /* query status: method to send proxd collect */
  8925. #include <packed_section_start.h>
  8926. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_collect_query {
  8927. uint32 method; /**< method */
  8928. uint8 request; /**< Query request. */
  8929. uint8 status; /**< bitmask 0 -- disable, 0x1 -- enable collection, */
  8930. /* 0x2 -- Use generic event, 0x4 -- use event log */
  8931. uint16 index; /**< The current frame index [0 to total_frames - 1]. */
  8932. uint16 mode; /**< Initiator or Target */
  8933. uint8 busy; /**< tof sm is busy */
  8934. uint8 remote; /**< Remote collect data */
  8935. } BWL_POST_PACKED_STRUCT wl_proxd_collect_query_t;
  8936. #include <packed_section_end.h>
  8937. #include <packed_section_start.h>
  8938. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_collect_header {
  8939. uint16 total_frames; /**< The total frames for this collect. */
  8940. uint16 nfft; /**< nfft value */
  8941. uint16 bandwidth; /**< bandwidth */
  8942. uint16 channel; /**< channel number */
  8943. uint32 chanspec; /**< channel spec */
  8944. uint32 fpfactor; /**< avb timer value factor */
  8945. uint16 fpfactor_shift; /**< avb timer value shift bits */
  8946. int32 distance; /**< distance calculated by fw */
  8947. uint32 meanrtt; /**< mean of RTTs */
  8948. uint32 modertt; /**< mode of RTTs */
  8949. uint32 medianrtt; /**< median of RTTs */
  8950. uint32 sdrtt; /**< standard deviation of RTTs */
  8951. uint32 clkdivisor; /**< clock divisor */
  8952. uint16 chipnum; /**< chip type */
  8953. uint8 chiprev; /**< chip revision */
  8954. uint8 phyver; /**< phy version */
  8955. struct ether_addr localMacAddr; /**< local mac address */
  8956. struct ether_addr remoteMacAddr; /**< remote mac address */
  8957. wl_proxd_params_tof_tune_v3_t params;
  8958. } BWL_POST_PACKED_STRUCT wl_proxd_collect_header_t;
  8959. #include <packed_section_end.h>
  8960. /* ifdef WL_NAN */
  8961. /* ********************** NAN wl interface struct types and defs ******************** */
  8962. /*
  8963. * Uses new common IOVAR batch processing mechanism
  8964. */
  8965. /*
  8966. * NAN config control
  8967. * Bits 0 - 23 can be set by host
  8968. * Bits 24 - 31 - Internal use for firmware, host cannot set it
  8969. */
  8970. /*
  8971. * Bit 0 : If set to 1, means event uses nan bsscfg,
  8972. * otherwise uses infra bsscfg. Default is using infra bsscfg
  8973. */
  8974. #define WL_NAN_CTRL_ROUTE_EVENT_VIA_NAN_BSSCFG 0x000001
  8975. /* If set, discovery beacons are transmitted on 2G band */
  8976. #define WL_NAN_CTRL_DISC_BEACON_TX_2G 0x000002
  8977. /* If set, sync beacons are transmitted on 2G band */
  8978. #define WL_NAN_CTRL_SYNC_BEACON_TX_2G 0x000004
  8979. /* If set, discovery beacons are transmitted on 5G band */
  8980. #define WL_NAN_CTRL_DISC_BEACON_TX_5G 0x000008
  8981. /* If set, sync beacons are transmitted on 5G band */
  8982. #define WL_NAN_CTRL_SYNC_BEACON_TX_5G 0x000010
  8983. /* If set, auto datapath responses will be sent by FW */
  8984. #define WL_NAN_CTRL_AUTO_DPRESP 0x000020
  8985. /* If set, auto datapath confirms will be sent by FW */
  8986. #define WL_NAN_CTRL_AUTO_DPCONF 0x000040
  8987. /* If set, auto schedule responses will be sent by FW */
  8988. #define WL_NAN_CTRL_AUTO_SCHEDRESP 0x000080
  8989. /* If set, auto schedule confirms will be sent by FW */
  8990. #define WL_NAN_CTRL_AUTO_SCHEDCONF 0x000100
  8991. /* If set, proprietary rates are supported by FW */
  8992. #define WL_NAN_CTRL_PROP_RATE 0x000200
  8993. /* If set, service awake_dw overrides global dev awake_dw */
  8994. #define WL_NAN_CTRL_SVC_OVERRIDE_DEV_AWAKE_DW 0x000400
  8995. /* If set, merge scan will be disabled */
  8996. #define WL_NAN_CTRL_SCAN_DISABLE 0x000800
  8997. /* If set, power save will be disabled */
  8998. #define WL_NAN_CTRL_POWER_SAVE_DISABLE 0x001000
  8999. /* If set, device will merge to configured CID only */
  9000. #define WL_NAN_CTRL_MERGE_CONF_CID_ONLY 0x002000
  9001. /* If set, 5g core will be brought down in single band NAN */
  9002. #define WL_NAN_CTRL_5G_SLICE_POWER_OPT 0x004000
  9003. #define WL_NAN_CTRL_DUMP_HEAP 0x008000
  9004. /* If set, host generates and assign ndp id for ndp sessions */
  9005. #define WL_NAN_CTRL_HOST_GEN_NDPID 0x010000
  9006. /* If set, nan ndp inactivity watchdog will be activated */
  9007. #define WL_NAN_CTRL_DELETE_INACTIVE_PEERS 0x020000
  9008. /* If set, nan assoc coex will be activated */
  9009. #define WL_NAN_CTRL_INFRA_ASSOC_COEX 0x040000
  9010. /* If set, dam will accept all NDP/RNG request from the peer including counter */
  9011. #define WL_NAN_CTRL_DAM_ACCEPT_ALL 0x080000
  9012. /* If set, nan mac ignores role for tx discovery beacon for periodic config */
  9013. #define WL_NAN_CTRL_FASTDISC_IGNO_ROLE 0x100000
  9014. /* If set, include NA in NAN beacons (disc beacons for now) */
  9015. #define WL_NAN_CTRL_INCL_NA_IN_BCNS 0x200000
  9016. /* If set, host assist will be enabled */
  9017. #define WL_NAN_CTRL_HOST_ASSIST 0x400000
  9018. /* If set, host configures NDI associated with the service */
  9019. #define WL_NAN_CTRL_HOST_CFG_SVC_NDI 0x800000
  9020. /* Value when all host-configurable bits set */
  9021. #define WL_NAN_CTRL_MAX_MASK 0xFFFFFF
  9022. #define WL_NAN_CFG_CTRL_FW_BITS 8
  9023. /* Last 8-bits are firmware controlled bits.
  9024. * Bit 31:
  9025. * If set - indicates that NAN initialization is successful
  9026. * Bit 30:
  9027. * If set - indicates that NAN MAC cfg creation is successful
  9028. *
  9029. * NOTE: These are only ready-only bits for host.
  9030. * All sets to these bits from host are masked off
  9031. */
  9032. #define WL_NAN_PROTO_INIT_DONE (1 << 31)
  9033. #define WL_NAN_CFG_CREATE_DONE (1 << 30)
  9034. #define WL_NAN_GET_PROTO_INIT_STATUS(x) \
  9035. (((x) & WL_NAN_PROTO_INIT_DONE) ? TRUE:FALSE)
  9036. #define WL_NAN_CLEAR_PROTO_INIT_STATUS(x) \
  9037. ((x) &= ~WL_NAN_PROTO_INIT_DONE)
  9038. #define WL_NAN_SET_PROTO_INIT_STATUS(x) \
  9039. ((x) |= (WL_NAN_PROTO_INIT_DONE))
  9040. #define WL_NAN_GET_CFG_CREATE_STATUS(x) \
  9041. (((x) & WL_NAN_CFG_CREATE_DONE) ? TRUE:FALSE)
  9042. #define WL_NAN_CLEAR_CFG_CREATE_STATUS(x) \
  9043. ((x) &= ~WL_NAN_CFG_CREATE_DONE)
  9044. #define WL_NAN_SET_CFG_CREATE_STATUS(x) \
  9045. ((x) |= (WL_NAN_CFG_CREATE_DONE))
  9046. #define WL_NAN_IOCTL_VERSION 0x2
  9047. /* < some sufficient ioc buff size for our module */
  9048. #define WL_NAN_IOC_BUFSZ 256
  9049. /* some sufficient ioc buff size for dump commands */
  9050. #define WL_NAN_IOC_BUFSZ_EXT 1024
  9051. #define WL_NAN_MAX_SIDS_IN_BEACONS 127 /* Max allowed SIDs */
  9052. #define WL_NAN_MASTER_RANK_LEN 8
  9053. #define WL_NAN_RANGE_LIMITED 0x0040 /* Publish/Subscribe flags */
  9054. /** The service hash (service id) is exactly this many bytes. */
  9055. #define WL_NAN_SVC_HASH_LEN 6
  9056. #define WL_NAN_HASHES_PER_BLOOM 4 /** Number of hash functions per bloom filter */
  9057. /* no. of max last disc results */
  9058. #define WL_NAN_MAX_DISC_RESULTS 3
  9059. /* Max len of Rx and Tx filters */
  9060. #define WL_NAN_MAX_SVC_MATCH_FILTER_LEN 255
  9061. /* Max service name len */
  9062. #define WL_NAN_MAX_SVC_NAME_LEN 32
  9063. /* Type of Data path connection */
  9064. #define WL_NAN_DP_TYPE_UNICAST 0
  9065. #define WL_NAN_DP_TYPE_MULTICAST 1
  9066. /* MAX security params length PMK field */
  9067. #define WL_NAN_NCS_SK_PMK_LEN 32
  9068. /* Post disc attr ID type */
  9069. typedef uint8 wl_nan_post_disc_attr_id_t;
  9070. /*
  9071. * Component IDs
  9072. */
  9073. typedef enum {
  9074. WL_NAN_COMPID_CONFIG = 1,
  9075. WL_NAN_COMPID_ELECTION = 2,
  9076. WL_NAN_COMPID_SD = 3,
  9077. WL_NAN_COMPID_TIMESYNC = 4,
  9078. WL_NAN_COMPID_DATA_PATH = 5,
  9079. WL_NAN_COMPID_DEBUG = 15 /* Keep this at the end */
  9080. } wl_nan_comp_id_t;
  9081. #define WL_NAN_COMP_SHIFT 8
  9082. #define WL_NAN_COMP_MASK(_c) (0x0F & ((uint8)(_c)))
  9083. #define WL_NAN_COMP_ID(_c) (WL_NAN_COMP_MASK(_c) << WL_NAN_COMP_SHIFT)
  9084. /* NAN Events */
  9085. /** Instance ID type (unique identifier) */
  9086. typedef uint8 wl_nan_instance_id_t;
  9087. /* Publish sent for a subscribe */
  9088. /* WL_NAN_EVENT_REPLIED */
  9089. typedef struct wl_nan_ev_replied {
  9090. struct ether_addr sub_mac; /* Subscriber MAC */
  9091. wl_nan_instance_id_t pub_id; /* Publisher Instance ID */
  9092. uint8 sub_id; /* Subscriber ID */
  9093. int8 sub_rssi; /* Subscriber RSSI */
  9094. uint8 pad[3];
  9095. } wl_nan_ev_replied_t;
  9096. typedef struct wl_nan_event_replied {
  9097. struct ether_addr sub_mac; /* Subscriber MAC */
  9098. wl_nan_instance_id_t pub_id; /* Publisher Instance ID */
  9099. uint8 sub_id; /* Subscriber ID */
  9100. int8 sub_rssi; /* Subscriber RSSI */
  9101. uint8 attr_num;
  9102. uint16 attr_list_len; /* sizeof attributes attached to payload */
  9103. uint8 attr_list[0]; /* attributes payload */
  9104. } wl_nan_event_replied_t;
  9105. /* NAN Tx status of transmitted frames */
  9106. #define WL_NAN_TXS_FAILURE 0
  9107. #define WL_NAN_TXS_SUCCESS 1
  9108. /* NAN frame types */
  9109. enum wl_nan_frame_type {
  9110. /* discovery frame types */
  9111. WL_NAN_FRM_TYPE_PUBLISH = 1,
  9112. WL_NAN_FRM_TYPE_SUBSCRIBE = 2,
  9113. WL_NAN_FRM_TYPE_FOLLOWUP = 3,
  9114. /* datapath frame types */
  9115. WL_NAN_FRM_TYPE_DP_REQ = 4,
  9116. WL_NAN_FRM_TYPE_DP_RESP = 5,
  9117. WL_NAN_FRM_TYPE_DP_CONF = 6,
  9118. WL_NAN_FRM_TYPE_DP_INSTALL = 7,
  9119. WL_NAN_FRM_TYPE_DP_END = 8,
  9120. /* schedule frame types */
  9121. WL_NAN_FRM_TYPE_SCHED_REQ = 9,
  9122. WL_NAN_FRM_TYPE_SCHED_RESP = 10,
  9123. WL_NAN_FRM_TYPE_SCHED_CONF = 11,
  9124. WL_NAN_FRM_TYPE_SCHED_UPD = 12,
  9125. /* ranging frame types */
  9126. WL_NAN_FRM_TYPE_RNG_REQ = 13,
  9127. WL_NAN_FRM_TYPE_RNG_RESP = 14,
  9128. WL_NAN_FRM_TYPE_RNG_TERM = 15,
  9129. WL_NAN_FRM_TYPE_RNG_REPORT = 16,
  9130. WL_NAN_FRM_TYPE_UNSOLICIT_SDF = 17,
  9131. WL_NAN_FRM_TYPE_INVALID
  9132. };
  9133. typedef uint8 wl_nan_frame_type_t;
  9134. /* NAN Reason codes for tx status */
  9135. enum wl_nan_txs_reason_codes {
  9136. WL_NAN_REASON_SUCCESS = 1, /* NAN status success */
  9137. WL_NAN_REASON_TIME_OUT = 2, /* timeout reached */
  9138. WL_NAN_REASON_DROPPED = 3, /* pkt dropped due to internal failure */
  9139. WL_NAN_REASON_MAX_RETRIES_DONE = 4 /* Max retries exceeded */
  9140. };
  9141. /* For NAN TX status */
  9142. typedef struct wl_nan_event_txs {
  9143. uint8 status; /* For TX status, success or failure */
  9144. uint8 reason_code; /* to identify reason when status is failure */
  9145. uint16 host_seq; /* seq num to keep track of pkts sent by host */
  9146. uint8 type; /* wl_nan_frame_type_t */
  9147. uint8 pad;
  9148. uint16 opt_tlvs_len;
  9149. uint8 opt_tlvs[];
  9150. } wl_nan_event_txs_t;
  9151. /* SD transmit pkt's event status is sent as optional tlv in wl_nan_event_txs_t */
  9152. typedef struct wl_nan_event_sd_txs {
  9153. uint8 inst_id; /* Publish or subscribe instance id */
  9154. uint8 req_id; /* Requestor instance id */
  9155. } wl_nan_event_sd_txs_t;
  9156. /* nanho fsm tlv WL_NAN_XTLV_NANHO_OOB_TXS(0x0b0a) */
  9157. typedef struct wl_nan_event_nanho_txs {
  9158. uint32 fsm_id; /* nho fsm id */
  9159. uint16 seq_id; /* nho seq id */
  9160. uint16 pad;
  9161. } wl_nan_event_nanho_txs_t;
  9162. /* Subscribe or Publish instance Terminated */
  9163. /* WL_NAN_EVENT_TERMINATED */
  9164. #define NAN_SD_TERM_REASON_TIMEOUT 1
  9165. #define NAN_SD_TERM_REASON_HOSTREQ 2
  9166. #define NAN_SD_TERM_REASON_FWTERM 3
  9167. #define NAN_SD_TERM_REASON_FAIL 4
  9168. typedef struct wl_nan_ev_terminated {
  9169. uint8 instance_id; /* publish / subscribe instance id */
  9170. uint8 reason; /* 1=timeout, 2=Host/IOVAR, 3=FW Terminated 4=Failure */
  9171. uint8 svctype; /* 0 - Publish, 0x1 - Subscribe */
  9172. uint8 pad; /* Align */
  9173. uint32 tx_cnt; /* Number of SDFs sent */
  9174. } wl_nan_ev_terminated_t;
  9175. /* Follow up received against a pub / subscr */
  9176. /* WL_NAN_EVENT_RECEIVE */
  9177. typedef struct wl_nan_ev_receive {
  9178. struct ether_addr remote_addr; /* Peer NAN device MAC */
  9179. uint8 local_id; /* Local subscribe or publish ID */
  9180. uint8 remote_id; /* Remote subscribe or publish ID */
  9181. int8 fup_rssi;
  9182. uint8 attr_num;
  9183. uint16 attr_list_len; /* sizeof attributes attached to payload */
  9184. uint8 attr_list[0]; /* attributes payload */
  9185. } wl_nan_ev_receive_t;
  9186. /* WL_NAN_EVENT_DISC_CACHE_TIMEOUT */
  9187. #define WL_NAN_DISC_CACHE_EXPIRY_ENTRIES_MAX 8
  9188. typedef struct wl_nan_disc_expired_cache_entry {
  9189. uint8 l_sub_id; /* local sub instance_id */
  9190. uint8 r_pub_id; /* remote-matched pub instance_id */
  9191. struct ether_addr r_nmi_addr; /* remote-matched pub nmi addr */
  9192. } wl_nan_disc_expired_cache_entry_t;
  9193. typedef struct wl_nan_ev_disc_cache_timeout {
  9194. uint16 count; /* no. of expired cache entries */
  9195. uint16 pad;
  9196. wl_nan_disc_expired_cache_entry_t cache_exp_list[];
  9197. } wl_nan_ev_disc_cache_timeout_t;
  9198. /* For NAN event mask extention */
  9199. #define WL_NAN_EVMASK_EXTN_VER 1
  9200. #define WL_NAN_EVMASK_EXTN_LEN 16 /* 16*8 = 128 masks supported */
  9201. typedef struct wl_nan_event_extn {
  9202. uint8 ver;
  9203. uint8 pad;
  9204. uint16 len;
  9205. uint8 evmask[];
  9206. } wl_nan_evmask_extn_t;
  9207. /* WL_NAN_XTLV_DATA_DP_TXS */
  9208. typedef struct wl_nan_data_dp_txs {
  9209. uint8 ndp_id;
  9210. uint8 pad;
  9211. struct ether_addr indi; /* initiator ndi */
  9212. } wl_nan_data_dp_txs_t;
  9213. /* WL_NAN_XTLV_RNG_TXS */
  9214. typedef struct wl_nan_range_txs {
  9215. uint8 range_id;
  9216. uint8 pad[3];
  9217. } wl_nan_range_txs_t;
  9218. #define NAN_MAX_BANDS 2
  9219. /*
  9220. * TLVs - Below XTLV definitions will be deprecated
  9221. * in due course (soon as all other branches update
  9222. * to the comp ID based XTLVs listed below).
  9223. */
  9224. enum wl_nan_cmd_xtlv_id {
  9225. WL_NAN_XTLV_MAC_ADDR = 0x120,
  9226. WL_NAN_XTLV_MATCH_RX = 0x121,
  9227. WL_NAN_XTLV_MATCH_TX = 0x122,
  9228. WL_NAN_XTLV_SVC_INFO = 0x123,
  9229. WL_NAN_XTLV_SVC_NAME = 0x124,
  9230. WL_NAN_XTLV_SR_FILTER = 0x125,
  9231. WL_NAN_XTLV_FOLLOWUP = 0x126,
  9232. WL_NAN_XTLV_SVC_LIFE_COUNT = 0x127,
  9233. WL_NAN_XTLV_AVAIL = 0x128,
  9234. WL_NAN_XTLV_SDF_RX = 0x129,
  9235. WL_NAN_XTLV_SDE_CONTROL = 0x12a,
  9236. WL_NAN_XTLV_SDE_RANGE_LIMIT = 0x12b,
  9237. WL_NAN_XTLV_NAN_AF = 0x12c,
  9238. WL_NAN_XTLV_SD_TERMINATE = 0x12d,
  9239. WL_NAN_XTLV_CLUSTER_ID = 0x12e,
  9240. WL_NAN_XTLV_PEER_RSSI = 0x12f,
  9241. WL_NAN_XTLV_BCN_RX = 0x130,
  9242. WL_NAN_XTLV_REPLIED = 0x131, /* Publish sent for a subscribe */
  9243. WL_NAN_XTLV_RECEIVED = 0x132, /* FUP Received */
  9244. WL_NAN_XTLV_DISC_RESULTS = 0x133, /* Discovery results */
  9245. WL_NAN_XTLV_TXS = 0x134 /* TX status */
  9246. };
  9247. #define WL_NAN_CMD_GLOBAL 0x00
  9248. #define WL_NAN_CMD_CFG_COMP_ID 0x01
  9249. #define WL_NAN_CMD_ELECTION_COMP_ID 0x02
  9250. #define WL_NAN_CMD_SD_COMP_ID 0x03
  9251. #define WL_NAN_CMD_SYNC_COMP_ID 0x04
  9252. #define WL_NAN_CMD_DATA_COMP_ID 0x05
  9253. #define WL_NAN_CMD_DAM_COMP_ID 0x06
  9254. #define WL_NAN_CMD_RANGE_COMP_ID 0x07
  9255. #define WL_NAN_CMD_GENERIC_COMP_ID 0x08
  9256. #define WL_NAN_CMD_SCHED_COMP_ID 0x09
  9257. #define WL_NAN_CMD_NSR_COMP_ID 0x0a /* NAN Save Restore */
  9258. #define WL_NAN_CMD_NANHO_COMP_ID 0x0b /* NAN Host offload */
  9259. #define WL_NAN_CMD_DBG_COMP_ID 0x0f
  9260. #define WL_NAN_CMD_COMP_SHIFT 8
  9261. #define NAN_CMD(x, y) (((x) << WL_NAN_CMD_COMP_SHIFT) | (y))
  9262. /*
  9263. * Module based NAN TLV IDs
  9264. */
  9265. typedef enum wl_nan_tlv {
  9266. WL_NAN_XTLV_CFG_MATCH_RX = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x01),
  9267. WL_NAN_XTLV_CFG_MATCH_TX = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x02),
  9268. WL_NAN_XTLV_CFG_SR_FILTER = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x03),
  9269. WL_NAN_XTLV_CFG_SVC_NAME = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x04),
  9270. WL_NAN_XTLV_CFG_NAN_STATUS = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x05),
  9271. WL_NAN_XTLV_CFG_SVC_LIFE_COUNT = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x06),
  9272. WL_NAN_XTLV_CFG_SVC_HASH = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x07),
  9273. WL_NAN_XTLV_CFG_SEC_CSID = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x08), /* Security CSID */
  9274. WL_NAN_XTLV_CFG_SEC_PMK = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x09), /* Security PMK */
  9275. WL_NAN_XTLV_CFG_SEC_PMKID = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0A),
  9276. WL_NAN_XTLV_CFG_SEC_SCID = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0B),
  9277. WL_NAN_XTLV_CFG_VNDR_PAYLOAD = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0C),
  9278. WL_NAN_XTLV_CFG_HOST_INDPID = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0D),
  9279. /* when host ndpid is used */
  9280. WL_NAN_XTLV_CFG_MAC_ADDR = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0E),
  9281. /* fast disc time bitmap config */
  9282. WL_NAN_XTLV_CFG_FDISC_TBMP = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0F),
  9283. WL_NAN_XTLV_SD_SVC_INFO = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x01),
  9284. WL_NAN_XTLV_SD_FOLLOWUP = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x02),
  9285. WL_NAN_XTLV_SD_SDF_RX = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x03),
  9286. WL_NAN_XTLV_SD_SDE_CONTROL = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x04),
  9287. WL_NAN_XTLV_SD_SDE_RANGE_LIMIT = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x05),
  9288. WL_NAN_XTLV_SD_NAN_AF = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x06),
  9289. WL_NAN_XTLV_SD_TERM = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x07),
  9290. WL_NAN_XTLV_SD_REPLIED = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x08), /* Pub sent */
  9291. WL_NAN_XTLV_SD_FUP_RECEIVED = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x09), /* FUP Received */
  9292. WL_NAN_XTLV_SD_DISC_RESULTS = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0A), /* Pub RX */
  9293. WL_NAN_XTLV_SD_TXS = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0B), /* Tx status */
  9294. WL_NAN_XTLV_SD_SDE_SVC_INFO = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0C),
  9295. WL_NAN_XTLV_SD_SDE_SVC_UPD_IND = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0D),
  9296. WL_NAN_XTLV_SD_SVC_NDI = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0E),
  9297. WL_NAN_XTLV_SD_NDP_SPEC_INFO = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0F),
  9298. WL_NAN_XTLV_SD_NDPE_TLV_LIST = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x10),
  9299. WL_NAN_XTLV_SD_NDL_QOS_UPD = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x11),
  9300. WL_NAN_XTLV_SD_DISC_CACHE_TIMEOUT = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x12),
  9301. WL_NAN_XTLV_SD_PEER_NMI = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x13),
  9302. WL_NAN_XTLV_SYNC_BCN_RX = NAN_CMD(WL_NAN_CMD_SYNC_COMP_ID, 0x01),
  9303. WL_NAN_XTLV_EV_MR_CHANGED = NAN_CMD(WL_NAN_CMD_SYNC_COMP_ID, 0x02),
  9304. WL_NAN_XTLV_DATA_DP_END = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x01),
  9305. WL_NAN_XTLV_DATA_DP_INFO = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x02),
  9306. WL_NAN_XTLV_DATA_DP_SEC_INST = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x03),
  9307. WL_NAN_XTLV_DATA_DP_TXS = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x04), /* txs for dp */
  9308. WL_NAN_XTLV_DATA_DP_OPAQUE_INFO = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x05),
  9309. WL_NAN_XTLV_RANGE_INFO = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x01),
  9310. WL_NAN_XTLV_RNG_TXS = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x02),
  9311. WL_NAN_XTLV_EV_SLOT_INFO = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x01),
  9312. WL_NAN_XTLV_EV_GEN_INFO = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x02),
  9313. WL_NAN_XTLV_CCA_STATS = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x03),
  9314. WL_NAN_XTLV_PER_STATS = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x04),
  9315. WL_NAN_XTLV_CHBOUND_INFO = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x05),
  9316. WL_NAN_XTLV_SLOT_STATS = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x06),
  9317. WL_NAN_XTLV_DAM_NA_ATTR = NAN_CMD(WL_NAN_CMD_DAM_COMP_ID, 0x01), /* na attr */
  9318. WL_NAN_XTLV_HOST_ASSIST_REQ = NAN_CMD(WL_NAN_CMD_DAM_COMP_ID, 0x02), /* host assist */
  9319. /* wl_nan_fw_cap_t */
  9320. WL_NAN_XTLV_GEN_FW_CAP = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x01),
  9321. /* wl_nan_fw_cap_v2_t */
  9322. WL_NAN_XTLV_GEN_FW_CAP_V2 = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x02),
  9323. WL_NAN_XTLV_SCHED_INFO = NAN_CMD(WL_NAN_CMD_SCHED_COMP_ID, 0x01),
  9324. /* Nan Save-Restore XTLVs */
  9325. WL_NAN_XTLV_NSR2_PEER = NAN_CMD(WL_NAN_CMD_NSR_COMP_ID, 0x21),
  9326. WL_NAN_XTLV_NSR2_NDP = NAN_CMD(WL_NAN_CMD_NSR_COMP_ID, 0x22),
  9327. /* Host offload XTLVs */
  9328. WL_NAN_XTLV_NANHO_PEER_ENTRY = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x01),
  9329. WL_NAN_XTLV_NANHO_DCAPLIST = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x02),
  9330. WL_NAN_XTLV_NANHO_DCSLIST = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x03),
  9331. WL_NAN_XTLV_NANHO_BLOB = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x04),
  9332. WL_NAN_XTLV_NANHO_NDP_STATE = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x05),
  9333. WL_NAN_XTLV_NANHO_FRM_TPLT = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x06),
  9334. WL_NAN_XTLV_NANHO_OOB_NAF = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x07),
  9335. WL_NAN_XTLV_NANHO_LOG_ERR_CTRL = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x08),
  9336. WL_NAN_XTLV_NANHO_LOG_DBG_CTRL = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x09),
  9337. WL_NAN_XTLV_NANHO_OOB_TXS = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x0A),
  9338. WL_NAN_XTLV_NANHO_DCAP_ATTR = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x0B),
  9339. WL_NAN_XTLV_NANHO_ELEM_ATTR = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x0C),
  9340. WL_NAN_XTLV_NANHO_SEC_SA = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x0D)
  9341. } wl_nan_tlv_t;
  9342. /* Sub Module ID's for NAN */
  9343. enum {
  9344. NAN_MAC = 0, /* nan mac */
  9345. NAN_DISC = 1, /* nan discovery */
  9346. NAN_DBG = 2, /* nan debug */
  9347. NAN_SCHED = 3, /* nan sched */
  9348. NAN_PEER_ENTRY = 4, /* nan peer entry */
  9349. NAN_AVAIL = 5, /* nan avail */
  9350. NAN_DAM = 6, /* nan dam */
  9351. NAN_FSM = 7, /* nan fsm registry */
  9352. NAN_NDP = 8, /* nan ndp */
  9353. NAN_NDL = 9, /* nan ndl */
  9354. NAN_DP = 10, /* nan dp core */
  9355. NAN_RNG = 11, /* nan ranging */
  9356. NAN_SEC = 12, /* nan sec */
  9357. NAN_LAST = 13
  9358. };
  9359. enum wl_nan_sub_cmd_xtlv_id {
  9360. /* Special command - Tag zero */
  9361. WL_NAN_CMD_GLB_NAN_VER = NAN_CMD(WL_NAN_CMD_GLOBAL, 0x00),
  9362. /* nan cfg sub-commands */
  9363. WL_NAN_CMD_CFG_NAN_INIT = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x01),
  9364. WL_NAN_CMD_CFG_ROLE = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x02),
  9365. WL_NAN_CMD_CFG_HOP_CNT = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x03),
  9366. WL_NAN_CMD_CFG_HOP_LIMIT = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x04),
  9367. WL_NAN_CMD_CFG_WARMUP_TIME = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x05),
  9368. WL_NAN_CMD_CFG_STATUS = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x06),
  9369. WL_NAN_CMD_CFG_OUI = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x07),
  9370. WL_NAN_CMD_CFG_COUNT = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x08),
  9371. WL_NAN_CMD_CFG_CLEARCOUNT = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x09),
  9372. WL_NAN_CMD_CFG_CHANNEL = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0A),
  9373. WL_NAN_CMD_CFG_BAND = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0B),
  9374. WL_NAN_CMD_CFG_CID = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0C),
  9375. WL_NAN_CMD_CFG_IF_ADDR = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0D),
  9376. WL_NAN_CMD_CFG_BCN_INTERVAL = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0E),
  9377. WL_NAN_CMD_CFG_SDF_TXTIME = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x0F),
  9378. WL_NAN_CMD_CFG_SID_BEACON = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x10),
  9379. WL_NAN_CMD_CFG_DW_LEN = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x11),
  9380. WL_NAN_CMD_CFG_AVAIL = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x12),
  9381. WL_NAN_CMD_CFG_WFA_TM = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x13),
  9382. WL_NAN_CMD_CFG_EVENT_MASK = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x14),
  9383. WL_NAN_CMD_CFG_NAN_CONFIG = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x15), /* ctrl */
  9384. WL_NAN_CMD_CFG_NAN_ENAB = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x16),
  9385. WL_NAN_CMD_CFG_ULW = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x17),
  9386. WL_NAN_CMD_CFG_NAN_CONFIG2 = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x18), /* ctrl2 */
  9387. WL_NAN_CMD_CFG_DEV_CAP = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x19),
  9388. WL_NAN_CMD_CFG_SCAN_PARAMS = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x1A),
  9389. WL_NAN_CMD_CFG_VNDR_PAYLOAD = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x1B),
  9390. WL_NAN_CMD_CFG_FASTDISC = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x1C),
  9391. WL_NAN_CMD_CFG_MIN_TX_RATE = NAN_CMD(WL_NAN_CMD_CFG_COMP_ID, 0x1D),
  9392. WL_NAN_CMD_CFG_MAX = WL_NAN_CMD_CFG_MIN_TX_RATE,
  9393. /* Add new commands before and update */
  9394. /* nan election sub-commands */
  9395. WL_NAN_CMD_ELECTION_HOST_ENABLE = NAN_CMD(WL_NAN_CMD_ELECTION_COMP_ID, 0x01),
  9396. WL_NAN_CMD_ELECTION_METRICS_CONFIG = NAN_CMD(WL_NAN_CMD_ELECTION_COMP_ID, 0x02),
  9397. WL_NAN_CMD_ELECTION_METRICS_STATE = NAN_CMD(WL_NAN_CMD_ELECTION_COMP_ID, 0x03),
  9398. WL_NAN_CMD_ELECTION_LEAVE = NAN_CMD(WL_NAN_CMD_ELECTION_COMP_ID, 0x03),
  9399. WL_NAN_CMD_ELECTION_MERGE = NAN_CMD(WL_NAN_CMD_ELECTION_COMP_ID, 0x04),
  9400. WL_NAN_CMD_ELECTION_ADVERTISERS = NAN_CMD(WL_NAN_CMD_ELECTION_COMP_ID, 0x05),
  9401. WL_NAN_CMD_ELECTION_RSSI_THRESHOLD = NAN_CMD(WL_NAN_CMD_ELECTION_COMP_ID, 0x06),
  9402. WL_NAN_CMD_ELECTION_MAX = WL_NAN_CMD_ELECTION_RSSI_THRESHOLD,
  9403. /* New commands go before and update */
  9404. /* nan SD sub-commands */
  9405. WL_NAN_CMD_SD_PARAMS = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x01),
  9406. WL_NAN_CMD_SD_PUBLISH = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x02),
  9407. WL_NAN_CMD_SD_PUBLISH_LIST = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x03),
  9408. WL_NAN_CMD_SD_CANCEL_PUBLISH = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x04),
  9409. WL_NAN_CMD_SD_SUBSCRIBE = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x05),
  9410. WL_NAN_CMD_SD_SUBSCRIBE_LIST = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x06),
  9411. WL_NAN_CMD_SD_CANCEL_SUBSCRIBE = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x07),
  9412. WL_NAN_CMD_SD_VND_INFO = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x08),
  9413. WL_NAN_CMD_SD_STATS = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x09),
  9414. WL_NAN_CMD_SD_TRANSMIT = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0A),
  9415. WL_NAN_CMD_SD_FUP_TRANSMIT = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0B),
  9416. WL_NAN_CMD_SD_CONNECTION = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0C),
  9417. WL_NAN_CMD_SD_SHOW = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0D),
  9418. WL_NAN_CMD_SD_DISC_CACHE_TIMEOUT = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0E),
  9419. WL_NAN_CMD_SD_DISC_CACHE_CLEAR = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x0F),
  9420. WL_NAN_CMD_SD_MAX = WL_NAN_CMD_SD_DISC_CACHE_CLEAR,
  9421. /* nan time sync sub-commands */
  9422. WL_NAN_CMD_SYNC_SOCIAL_CHAN = NAN_CMD(WL_NAN_CMD_SYNC_COMP_ID, 0x01),
  9423. WL_NAN_CMD_SYNC_AWAKE_DWS = NAN_CMD(WL_NAN_CMD_SYNC_COMP_ID, 0x02),
  9424. WL_NAN_CMD_SYNC_BCN_RSSI_NOTIF_THRESHOLD = NAN_CMD(WL_NAN_CMD_SYNC_COMP_ID, 0x03),
  9425. WL_NAN_CMD_SYNC_MAX = WL_NAN_CMD_SYNC_BCN_RSSI_NOTIF_THRESHOLD,
  9426. /* nan2 commands */
  9427. WL_NAN_CMD_DATA_CONFIG = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x01),
  9428. WL_NAN_CMD_DATA_RSVD02 = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x02),
  9429. WL_NAN_CMD_DATA_RSVD03 = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x03),
  9430. WL_NAN_CMD_DATA_DATAREQ = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x04),
  9431. WL_NAN_CMD_DATA_DATARESP = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x05),
  9432. WL_NAN_CMD_DATA_DATAEND = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x06),
  9433. WL_NAN_CMD_DATA_SCHEDUPD = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x07),
  9434. WL_NAN_CMD_DATA_RSVD08 = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x08),
  9435. WL_NAN_CMD_DATA_CAP = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x9),
  9436. WL_NAN_CMD_DATA_STATUS = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x0A),
  9437. WL_NAN_CMD_DATA_STATS = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x0B),
  9438. WL_NAN_CMD_DATA_RSVD0C = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x0C),
  9439. WL_NAN_CMD_DATA_NDP_SHOW = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x0D),
  9440. WL_NAN_CMD_DATA_DATACONF = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x0E),
  9441. WL_NAN_CMD_DATA_MIN_TX_RATE = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x0F),
  9442. WL_NAN_CMD_DATA_MAX_PEERS = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x10),
  9443. WL_NAN_CMD_DATA_DP_IDLE_PERIOD = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x11),
  9444. WL_NAN_CMD_DATA_DP_OPAQUE_INFO = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x12),
  9445. WL_NAN_CMD_DATA_DP_HB_DURATION = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x13),
  9446. WL_NAN_CMD_DATA_PATH_MAX = WL_NAN_CMD_DATA_DP_HB_DURATION, /* New ones before and update */
  9447. /* nan dam sub-commands */
  9448. WL_NAN_CMD_DAM_CFG = NAN_CMD(WL_NAN_CMD_DAM_COMP_ID, 0x01),
  9449. WL_NAN_CMD_DAM_MAX = WL_NAN_CMD_DAM_CFG, /* New ones before and update */
  9450. /* nan2.0 ranging commands */
  9451. WL_NAN_CMD_RANGE_REQUEST = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x01),
  9452. WL_NAN_CMD_RANGE_AUTO = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x02),
  9453. WL_NAN_CMD_RANGE_RESPONSE = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x03),
  9454. WL_NAN_CMD_RANGE_CANCEL = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x04),
  9455. WL_NAN_CMD_RANGE_IDLE_COUNT = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x05),
  9456. WL_NAN_CMD_RANGE_CANCEL_EXT = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x06),
  9457. /* nan debug sub-commands */
  9458. WL_NAN_CMD_DBG_SCAN_PARAMS = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x01),
  9459. WL_NAN_CMD_DBG_SCAN = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x02),
  9460. WL_NAN_CMD_DBG_SCAN_RESULTS = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x03),
  9461. /* This is now moved under CFG */
  9462. WL_NAN_CMD_DBG_EVENT_MASK = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x04),
  9463. WL_NAN_CMD_DBG_EVENT_CHECK = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x05),
  9464. WL_NAN_CMD_DBG_DUMP = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x06),
  9465. WL_NAN_CMD_DBG_CLEAR = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x07),
  9466. WL_NAN_CMD_DBG_RSSI = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x08),
  9467. WL_NAN_CMD_DBG_DEBUG = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x09),
  9468. WL_NAN_CMD_DBG_TEST1 = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x0A),
  9469. WL_NAN_CMD_DBG_TEST2 = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x0B),
  9470. WL_NAN_CMD_DBG_TEST3 = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x0C),
  9471. WL_NAN_CMD_DBG_DISC_RESULTS = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x0D),
  9472. WL_NAN_CMD_DBG_STATS = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x0E),
  9473. WL_NAN_CMD_DBG_LEVEL = NAN_CMD(WL_NAN_CMD_DBG_COMP_ID, 0x0F),
  9474. WL_NAN_CMD_DBG_MAX = WL_NAN_CMD_DBG_LEVEL, /* New ones before and update */
  9475. /* Generic componenet */
  9476. WL_NAN_CMD_GEN_STATS = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x01),
  9477. WL_NAN_CMD_GEN_FW_CAP = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x02),
  9478. WL_NAN_CMD_GEN_MAX = WL_NAN_CMD_GEN_FW_CAP,
  9479. /* NAN Save-Restore */
  9480. WL_NAN_CMD_NSR2 = NAN_CMD(WL_NAN_CMD_NSR_COMP_ID, 0x20),
  9481. WL_NAN_CMD_NSR2_MAX = WL_NAN_CMD_NSR2,
  9482. /* Host offload sub-commands */
  9483. WL_NAN_CMD_NANHO_UPDATE = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x01), /* WILL BE REMOVED */
  9484. WL_NAN_CMD_NANHO_INFO = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x01),
  9485. WL_NAN_CMD_NANHO_FRM_TPLT = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x02), /* unused */
  9486. WL_NAN_CMD_NANHO_OOB_NAF = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x03), /* unused */
  9487. WL_NAN_CMD_NANHO_LOG_CTRL = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x04),
  9488. WL_NAN_CMD_NANHO_VER = NAN_CMD(WL_NAN_CMD_NANHO_COMP_ID, 0x05),
  9489. WL_NAN_CMD_NANHO_MAX = WL_NAN_CMD_NANHO_VER,
  9490. /* Add submodules below, and update WL_NAN_CMD_MAX */
  9491. /* ROML check for this enum should use WL_NAN_CMD_MAX */
  9492. WL_NAN_CMD_MAX = WL_NAN_CMD_NANHO_MAX
  9493. };
  9494. /*
  9495. * Component/Module based NAN TLV IDs for NAN stats
  9496. */
  9497. typedef enum wl_nan_stats_tlv {
  9498. WL_NAN_XTLV_SYNC_MAC_STATS = NAN_CMD(WL_NAN_CMD_SYNC_COMP_ID, 0x01),
  9499. WL_NAN_XTLV_SD_DISC_STATS = NAN_CMD(WL_NAN_CMD_SD_COMP_ID, 0x01),
  9500. WL_NAN_XTLV_DATA_NDP_STATS = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x01),
  9501. WL_NAN_XTLV_DATA_NDL_STATS = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x02),
  9502. WL_NAN_XTLV_DATA_SEC_STATS = NAN_CMD(WL_NAN_CMD_DATA_COMP_ID, 0x03),
  9503. WL_NAN_XTLV_GEN_SCHED_STATS = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x01),
  9504. WL_NAN_XTLV_GEN_PEER_STATS = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x02),
  9505. WL_NAN_XTLV_GEN_PEER_STATS_DEVCAP = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x03),
  9506. WL_NAN_XTLV_GEN_PEER_STATS_NDP = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x04),
  9507. WL_NAN_XTLV_GEN_PEER_STATS_SCHED = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x05),
  9508. WL_NAN_XTLV_GEN_AVAIL_STATS_SCHED = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x06),
  9509. WL_NAN_XTLV_GEN_NDP_STATS = NAN_CMD(WL_NAN_CMD_GENERIC_COMP_ID, 0x07),
  9510. WL_NAN_XTLV_DAM_STATS = NAN_CMD(WL_NAN_CMD_DAM_COMP_ID, 0x01),
  9511. WL_NAN_XTLV_DAM_AVAIL_STATS = NAN_CMD(WL_NAN_CMD_DAM_COMP_ID, 0x02),
  9512. WL_NAN_XTLV_RANGE_STATS = NAN_CMD(WL_NAN_CMD_RANGE_COMP_ID, 0x01)
  9513. } wl_nan_stats_tlv_t;
  9514. /* NAN stats WL_NAN_CMD_GEN_STATS command */
  9515. /* Input data */
  9516. typedef struct wl_nan_cmn_get_stat {
  9517. uint32 modules_btmap; /* Bitmap to indicate module stats are needed:
  9518. * See NAN Sub Module ID's above
  9519. */
  9520. uint8 operation; /* Get, Get and Clear */
  9521. uint8 arg1; /* Submodule control variable1 */
  9522. uint8 arg2; /* Submodule control variable2 */
  9523. uint8 pad; /* May not be needed as TLV's are aligned,add to pass compile chk */
  9524. } wl_nan_cmn_get_stat_t;
  9525. /* Output for Stats container */
  9526. typedef struct wl_nan_cmn_stat {
  9527. uint32 n_stats; /* Number of different sub TLV stats present in the container */
  9528. uint32 totlen; /* Total Length of stats data in container */
  9529. uint8 stats_tlvs []; /* Stat TLV's container */
  9530. } wl_nan_cmn_stat_t;
  9531. /* Defines for operation */
  9532. #define WLA_NAN_STATS_GET 0
  9533. #define WLA_NAN_STATS_GET_CLEAR 1
  9534. #define WL_NAN_STAT_ALL 0xFFFFFFFF
  9535. /* NAN Mac stats */
  9536. typedef struct wl_nan_mac_band_stats {
  9537. uint32 bcn_tx; /* 2g/5g disc/sync beacon tx count */
  9538. uint32 bcn_rx; /* 2g/5g disc/sync beacon rx count */
  9539. uint32 dws; /* Number of 2g/5g DW's */
  9540. } wl_nan_mac_band_stats_t;
  9541. /* Note: if this struct is changing update wl_nan_slot_ecounters_vX_t version,
  9542. * as this struct is sent as payload in wl_nan_slot_ecounter_vX_ts
  9543. */
  9544. typedef struct wl_nan_mac_stats {
  9545. wl_nan_mac_band_stats_t band[NAN_MAX_BANDS]; /* MAC sync band specific stats */
  9546. uint32 naf_tx; /* NAN AF tx */
  9547. uint32 naf_rx; /* NAN AF rx */
  9548. uint32 sdf_tx; /* SDF tx */
  9549. uint32 sdf_rx; /* SDF rx */
  9550. uint32 cnt_sync_bcn_rx_tu[3]; /* delta bw */
  9551. uint32 cnt_bcn_tx_out_dw; /* TX sync beacon outside dw */
  9552. uint32 cnt_role_am_dw; /* anchor master role due to dw */
  9553. uint32 cnt_am_hop_err; /* wrong hopcount set for AM */
  9554. } wl_nan_mac_stats_t;
  9555. /* NAN Sched stats */
  9556. /* Per core Sched stats */
  9557. typedef struct nan_sched_stats_core {
  9558. uint32 slotstart; /* slot_start */
  9559. uint32 slotend; /* slot_end */
  9560. uint32 slotskip; /* slot_skip */
  9561. uint32 slotstart_partial; /* slot resume */
  9562. uint32 slotend_partial; /* slot pre-empt */
  9563. uint8 avail_upd_cnt; /* count to track num of times avail has been updated */
  9564. uint8 pad[3];
  9565. } nan_sched_stats_core_t;
  9566. /* Common Sched stats */
  9567. typedef struct nan_sched_stats_cmn {
  9568. uint32 slot_adj_dw; /* Slot adjusts due to DW changes */
  9569. uint32 slot_dur; /* Total slot duration in TU's */
  9570. } nan_sched_stats_cmn_t;
  9571. /* Note: if this struct is changing update wl_nan_slot_ecounters_vX_t version,
  9572. * as this struct is sent as payload in wl_nan_slot_ecounters_vX_t
  9573. */
  9574. typedef struct nan_sched_stats {
  9575. nan_sched_stats_cmn_t cmn;
  9576. nan_sched_stats_core_t slice[MAX_NUM_D11CORES];
  9577. } nan_sched_stats_t;
  9578. /* End NAN Sched stats */
  9579. /* NAN Discovery stats */
  9580. typedef struct nan_disc_stats {
  9581. uint32 pub_tx; /* Publish tx */
  9582. uint32 pub_rx; /* Publish rx */
  9583. uint32 sub_tx; /* Subscribe tx */
  9584. uint32 sub_rx; /* Subscribe rx */
  9585. uint32 fup_tx; /* Followup tx */
  9586. uint32 fup_rx; /* Followup rx */
  9587. uint32 pub_resp_ignored; /* response to incoming publish ignored */
  9588. uint32 sub_resp_ignored; /* response to incoming subscribe ignored */
  9589. } nan_disc_stats_t;
  9590. /* NAN Discovery stats end */
  9591. /* statistics for nan sec */
  9592. typedef struct nan_sec_stats_s {
  9593. uint32 mic_fail; /* rx mic fail */
  9594. uint32 replay_fail; /* replay counter */
  9595. uint32 tx_fail; /* tx fail (from txstatus) */
  9596. uint32 key_info_err; /* key info field err */
  9597. uint32 ok_sessions; /* successful mx negotiations */
  9598. uint32 fail_sessions; /* failed sessions */
  9599. uint32 keydesc_err; /* key desc error */
  9600. uint32 invalid_cipher; /* cipher suite not valid */
  9601. uint32 pmk_not_found; /* no pmk found for given service or for any reason */
  9602. uint32 no_pmk_for_pmkid; /* no pmk found for give pmkid */
  9603. uint32 key_install_err; /* failed to install keys */
  9604. uint32 no_keydesc_attr; /* key desc attr missing */
  9605. uint32 nonce_mismatch; /* nonce mismatch */
  9606. } nan_sec_stats_t;
  9607. /* WL_NAN_XTLV_GEN_PEER_STATS */
  9608. typedef struct wl_nan_peer_stats {
  9609. struct ether_addr nmi;
  9610. uint8 pad[2];
  9611. uint32 pkt_enq; /* counter for queued pkt of peer */
  9612. /* NDL */
  9613. bool ndl_exist;
  9614. uint8 ndl_state;
  9615. bool counter_proposed;
  9616. uint8 pad1;
  9617. /* NDL QoS */
  9618. uint16 local_max_latency;
  9619. uint16 peer_max_latency;
  9620. uint8 local_min_slots;
  9621. uint8 peer_min_slots;
  9622. /* security association */
  9623. struct ether_addr sec_laddr; /* local mac addr */
  9624. struct ether_addr sec_raddr; /* remote mac addr */
  9625. uint8 sec_csid;
  9626. uint8 pad2;
  9627. } wl_nan_peer_stats_t;
  9628. /* WL_NAN_XTLV_GEN_PEER_STATS_DEVCAP */
  9629. typedef struct wl_nan_peer_stats_dev_cap {
  9630. uint8 mapid;
  9631. uint8 awake_dw_2g;
  9632. uint8 awake_dw_5g;
  9633. uint8 bands_supported;
  9634. uint8 op_mode;
  9635. uint8 num_antennas;
  9636. uint16 chan_switch_time;
  9637. uint8 capabilities;
  9638. uint8 pad[3];
  9639. } wl_nan_peer_stats_dev_cap_t;
  9640. /* WL_NAN_XTLV_GEN_PEER_STATS_NDP */
  9641. typedef struct wl_nan_peer_stats_ndp {
  9642. uint8 peer_role;
  9643. uint8 ndp_state;
  9644. uint8 indp_id; /* initiator ndp id */
  9645. uint8 ndp_ctrl; /* ndp control field */
  9646. struct ether_addr peer_nmi;
  9647. struct ether_addr peer_ndi;
  9648. struct ether_addr local_ndi;
  9649. /* peer scb info */
  9650. bool scb_allocated;
  9651. bool scb_found;
  9652. uint32 scb_flags;
  9653. uint32 scb_flags2;
  9654. uint32 scb_flags3;
  9655. } wl_nan_peer_stats_ndp_t;
  9656. enum {
  9657. WL_NAN_SCHED_STAT_SLOT_COMM = 0x01, /* Committed slot */
  9658. WL_NAN_SCHED_STAT_SLOT_COND = 0x02, /* Conditional slot(proposal/counter) */
  9659. WL_NAN_SCHED_STAT_SLOT_NDC = 0x04, /* NDC slot */
  9660. WL_NAN_SCHED_STAT_SLOT_IMMUT = 0x08, /* Immutable slot */
  9661. WL_NAN_SCHED_STAT_SLOT_RANGE = 0x10, /* Ranging slot */
  9662. };
  9663. typedef uint16 wl_nan_stats_sched_slot_info_t;
  9664. typedef struct wl_nan_stats_sched_slot {
  9665. wl_nan_stats_sched_slot_info_t info; /* capture slot type and more info */
  9666. chanspec_t chanspec;
  9667. } wl_nan_stats_sched_slot_t;
  9668. /* WL_NAN_XTLV_GEN_PEER_STATS_SCHED, WL_NAN_XTLV_GEN_AVAIL_STATS_SCHED */
  9669. typedef struct wl_nan_stats_sched {
  9670. uint8 map_id;
  9671. uint8 seq_id; /* seq id from NA attr */
  9672. uint8 slot_dur;
  9673. uint8 pad;
  9674. uint16 period;
  9675. uint16 num_slot;
  9676. wl_nan_stats_sched_slot_t slot[];
  9677. } wl_nan_stats_sched_t;
  9678. /* WL_NAN_XTLV_GEN_PEER_STATS_SCHED */
  9679. typedef struct wl_nan_peer_stats_sched {
  9680. uint8 map_id;
  9681. uint8 seq_id; /* seq id from NA attr */
  9682. uint8 slot_dur;
  9683. uint8 pad;
  9684. uint16 period;
  9685. uint16 num_slot;
  9686. wl_nan_stats_sched_slot_t slot[];
  9687. } wl_nan_peer_stats_sched_t;
  9688. /* WL_NAN_XTLV_RANGE_STATS */
  9689. typedef struct wl_nan_range_stats {
  9690. uint16 rng_ssn_estb;
  9691. uint16 rng_ssn_fail;
  9692. uint16 rng_sched_start;
  9693. uint16 rng_sched_end;
  9694. uint16 ftm_ssn_success; /* number of succesfull ftm sessions */
  9695. uint16 ftm_ssn_fail;
  9696. uint16 num_meas; /* number of ftm frames */
  9697. uint16 num_valid_meas; /* number of ftm frames with valid timestamp */
  9698. } wl_nan_range_stats_t;
  9699. /* defines for ndp stats flag */
  9700. #define NAN_NDP_STATS_FLAG_ROLE_MASK 0x01
  9701. #define NAN_NDP_STATS_FLAG_ROLE_INIT 0x00
  9702. #define NAN_NDP_STATS_FLAG_ROLE_RESP 0x01
  9703. #define NAN_NDP_STATS_STATE_BIT_SHIFT 1
  9704. #define NAN_NDP_STATS_FLAG_STATE_MASK 0x07
  9705. #define NAN_NDP_STATS_FLAG_STATE_IN_PROG 0x00
  9706. #define NAN_NDP_STATS_FLAG_STATE_ESTB 0x01
  9707. #define NAN_NDP_STATS_FLAG_STATE_TEARDOWN_WAIT 0x02
  9708. /* More states can be added here, when needed */
  9709. /* WL_NAN_XTLV_GEN_NDP_STATS */
  9710. typedef struct wl_nan_ndp_stats_s {
  9711. uint8 ndp_id;
  9712. uint8 indp_id;
  9713. uint8 flags;
  9714. uint8 nan_sec_csid;
  9715. struct ether_addr lndi_addr;
  9716. struct ether_addr pnmi_addr;
  9717. struct ether_addr pndi_addr;
  9718. uint8 PAD[2];
  9719. } wl_nan_ndp_stats_t;
  9720. /* WL_NAN_XTLV_EV_SLOT_INFO */
  9721. typedef struct wl_nan_slot_info_s {
  9722. /* dw slot start expected */
  9723. uint32 dwst_h;
  9724. uint32 dwst_l;
  9725. /* dw slot start actual */
  9726. uint32 act_dwst_h;
  9727. uint32 act_dwst_l;
  9728. uint16 cur_chan[MAX_NUM_D11CORES]; /* sdb channels */
  9729. uint16 dw_chan; /* dw channel */
  9730. uint8 dw_no; /* dw number */
  9731. uint8 slot_seq_no; /* slot seq no. */
  9732. } wl_nan_slot_info_t;
  9733. /* WL_NAN_EVENT_MR_CHANGED */
  9734. typedef uint8 wl_nan_mr_changed_t;
  9735. #define WL_NAN_AMR_CHANGED 1
  9736. #define WL_NAN_IMR_CHANGED 2
  9737. /*
  9738. * The macro BCMUTILS_ERR_CODES is defined only
  9739. * when using the common header file(a new approach) bcmutils/include/bcmerror.h.
  9740. * Otherwise, use the error codes from this file.
  9741. */
  9742. #ifndef BCMUTILS_ERR_CODES
  9743. /** status - TBD BCME_ vs NAN status - range reserved for BCME_ */
  9744. enum {
  9745. /* add new status here... */
  9746. WL_NAN_E_INVALID_TOKEN = -2135, /* invalid token or mismatch */
  9747. WL_NAN_E_INVALID_ATTR = -2134, /* generic invalid attr error */
  9748. WL_NAN_E_INVALID_NDL_ATTR = -2133, /* invalid NDL attribute */
  9749. WL_NAN_E_SCB_NORESOURCE = -2132, /* no more peer scb available */
  9750. WL_NAN_E_PEER_NOTAVAIL = -2131,
  9751. WL_NAN_E_SCB_EXISTS = -2130,
  9752. WL_NAN_E_INVALID_PEER_NDI = -2129,
  9753. WL_NAN_E_INVALID_LOCAL_NDI = -2128,
  9754. WL_NAN_E_ALREADY_EXISTS = -2127, /* generic NAN error for duplication */
  9755. WL_NAN_E_EXCEED_MAX_NUM_MAPS = -2126,
  9756. WL_NAN_E_INVALID_DEV_CHAN_SCHED = -2125,
  9757. WL_NAN_E_INVALID_PEER_BLOB_TYPE = -2124,
  9758. WL_NAN_E_INVALID_LCL_BLOB_TYPE = -2123,
  9759. WL_NAN_E_BCMC_PDPA = -2122, /* BCMC NAF PDPA */
  9760. WL_NAN_E_TIMEOUT = -2121,
  9761. WL_NAN_E_HOST_CFG = -2120,
  9762. WL_NAN_E_NO_ACK = -2119,
  9763. WL_NAN_E_SECINST_FAIL = -2118,
  9764. WL_NAN_E_REJECT_NDL = -2117, /* generic NDL rejection error */
  9765. WL_NAN_E_INVALID_NDP_ATTR = -2116,
  9766. WL_NAN_E_HOST_REJECTED = -2115,
  9767. WL_NAN_E_PCB_NORESOURCE = -2114,
  9768. WL_NAN_E_NDC_EXISTS = -2113,
  9769. WL_NAN_E_NO_NDC_ENTRY_AVAIL = -2112,
  9770. WL_NAN_E_INVALID_NDC_ENTRY = -2111,
  9771. WL_NAN_E_SD_TX_LIST_FULL = -2110,
  9772. WL_NAN_E_SVC_SUB_LIST_FULL = -2109,
  9773. WL_NAN_E_SVC_PUB_LIST_FULL = -2108,
  9774. WL_NAN_E_SDF_MAX_LEN_EXCEEDED = -2107,
  9775. WL_NAN_E_ZERO_CRB = -2106, /* no CRB between local and peer */
  9776. WL_NAN_E_PEER_NDC_NOT_SELECTED = -2105, /* peer ndc not selected */
  9777. WL_NAN_E_DAM_CHAN_CONFLICT = -2104, /* dam schedule channel conflict */
  9778. WL_NAN_E_DAM_SCHED_PERIOD = -2103, /* dam schedule period mismatch */
  9779. WL_NAN_E_LCL_NDC_NOT_SELECTED = -2102, /* local selected ndc not configured */
  9780. WL_NAN_E_NDL_QOS_INVALID_NA = -2101, /* na doesn't comply with ndl qos */
  9781. WL_NAN_E_CLEAR_NAF_WITH_SA_AS_RNDI = -2100, /* rx clear naf with peer rndi */
  9782. WL_NAN_E_SEC_CLEAR_PKT = -2099, /* rx clear pkt from a peer with sec_sa */
  9783. WL_NAN_E_PROT_NON_PDPA_NAF = -2098, /* rx protected non PDPA frame */
  9784. WL_NAN_E_DAM_DOUBLE_REMOVE = -2097, /* remove peer schedule already removed */
  9785. WL_NAN_E_DAM_DOUBLE_MERGE = -2096, /* merge peer schedule already merged */
  9786. WL_NAN_E_DAM_REJECT_INVALID = -2095, /* reject for invalid schedule */
  9787. WL_NAN_E_DAM_REJECT_RANGE = -2094,
  9788. WL_NAN_E_DAM_REJECT_QOS = -2093,
  9789. WL_NAN_E_DAM_REJECT_NDC = -2092,
  9790. WL_NAN_E_DAM_REJECT_PEER_IMMUT = -2091,
  9791. WL_NAN_E_DAM_REJECT_LCL_IMMUT = -2090,
  9792. WL_NAN_E_DAM_EXCEED_NUM_SCHED = -2089,
  9793. WL_NAN_E_DAM_INVALID_SCHED_MAP = -2088, /* invalid schedule map list */
  9794. WL_NAN_E_DAM_INVALID_LCL_SCHED = -2087,
  9795. WL_NAN_E_INVALID_MAP_ID = -2086,
  9796. WL_NAN_E_CHAN_OVERLAP_ACROSS_MAP = -2085,
  9797. WL_NAN_E_INVALID_CHAN_LIST = -2084,
  9798. WL_NAN_E_INVALID_RANGE_TBMP = -2083,
  9799. WL_NAN_E_INVALID_IMMUT_SCHED = -2082,
  9800. WL_NAN_E_INVALID_NDC_ATTR = -2081,
  9801. WL_NAN_E_INVALID_TIME_BITMAP = -2080,
  9802. WL_NAN_E_INVALID_NA_ATTR = -2079,
  9803. WL_NAN_E_NO_NA_ATTR_IN_AVAIL_MAP = -2078, /* no na attr saved in avail map */
  9804. WL_NAN_E_INVALID_MAP_IDX = -2077,
  9805. WL_NAN_E_SEC_SA_NOTFOUND = -2076,
  9806. WL_NAN_E_BSSCFG_NOTFOUND = -2075,
  9807. WL_NAN_E_SCB_NOTFOUND = -2074,
  9808. WL_NAN_E_NCS_SK_KDESC_TYPE = -2073,
  9809. WL_NAN_E_NCS_SK_KEY_DESC_VER = -2072, /* key descr ver */
  9810. WL_NAN_E_NCS_SK_KEY_TYPE = -2071, /* key descr type */
  9811. WL_NAN_E_NCS_SK_KEYINFO_FAIL = -2070, /* key info (generic) */
  9812. WL_NAN_E_NCS_SK_KEY_LEN = -2069, /* key len */
  9813. WL_NAN_E_NCS_SK_KDESC_NOT_FOUND = -2068, /* key desc not found */
  9814. WL_NAN_E_NCS_SK_INVALID_PARAMS = -2067, /* invalid args */
  9815. WL_NAN_E_NCS_SK_KDESC_INVALID = -2066, /* key descr is not valid */
  9816. WL_NAN_E_NCS_SK_NONCE_MISMATCH = -2065,
  9817. WL_NAN_E_NCS_SK_KDATA_SAVE_FAIL = -2064, /* not able to save key data */
  9818. WL_NAN_E_NCS_SK_AUTH_TOKEN_CALC_FAIL = -2063,
  9819. WL_NAN_E_NCS_SK_PTK_CALC_FAIL = -2062,
  9820. WL_NAN_E_INVALID_STARTOFFSET = -2061,
  9821. WL_NAN_E_BAD_NA_ENTRY_TYPE = -2060,
  9822. WL_NAN_E_INVALID_CHANBMP = -2059,
  9823. WL_NAN_E_INVALID_OP_CLASS = -2058,
  9824. WL_NAN_E_NO_IES = -2057,
  9825. WL_NAN_E_NO_PEER_ENTRY_AVAIL = -2056,
  9826. WL_NAN_E_INVALID_PEER = -2055,
  9827. WL_NAN_E_PEER_EXISTS = -2054,
  9828. WL_NAN_E_PEER_NOTFOUND = -2053,
  9829. WL_NAN_E_NO_MEM = -2052,
  9830. WL_NAN_E_INVALID_OPTION = -2051,
  9831. WL_NAN_E_INVALID_BAND = -2050,
  9832. WL_NAN_E_INVALID_MAC = -2049,
  9833. WL_NAN_E_BAD_INSTANCE = -2048,
  9834. /* NAN status code reserved from -2048 to -3071 */
  9835. /* Do NOT add new status below -2048 */
  9836. WL_NAN_E_ERROR = -1,
  9837. WL_NAN_E_OK = 0
  9838. };
  9839. #endif /* BCMUTILS_ERR_CODES */
  9840. /* Error codes used in vendor specific attribute in Data Path Termination frames */
  9841. enum {
  9842. WL_NAN_DPEND_E_OK = 0,
  9843. WL_NAN_DPEND_E_ERROR = 1,
  9844. WL_NAN_DPEND_E_HOST_CMD = 2,
  9845. WL_NAN_DPEND_E_HOST_REJECTED = 3, /* host rejected rx frame */
  9846. WL_NAN_DPEND_E_RESOURCE_LIMIT = 4,
  9847. WL_NAN_DPEND_E_NO_ACK_RCV = 5,
  9848. WL_NAN_DPEND_E_TIMEOUT = 6,
  9849. WL_NAN_DPEND_E_NO_ELT = 7, /* rx frame missing element container */
  9850. WL_NAN_DPEND_E_NO_NDP_ATTR = 8,
  9851. WL_NAN_DPEND_E_NO_AVAIL_ATTR = 9,
  9852. WL_NAN_DPEND_E_NO_NDC_ATTR = 10,
  9853. WL_NAN_DPEND_E_NO_RANGE_BM = 11,
  9854. WL_NAN_DPEND_E_INVALID_NDP_ATTR = 12,
  9855. WL_NAN_DPEND_E_INVALID_NDC_ATTR = 13,
  9856. WL_NAN_DPEND_E_INVALID_IMMUT = 14,
  9857. WL_NAN_DPEND_E_INVALID_NDL_QOS = 15,
  9858. WL_NAN_DPEND_E_INVALID_SEC_PARAMS = 16,
  9859. WL_NAN_DPEND_E_REJECT_AVAIL = 17,
  9860. WL_NAN_DPEND_E_REJECT_NDL = 18,
  9861. WL_NAN_DPEND_E_SCB_NORESOURCE = 19
  9862. };
  9863. typedef int32 wl_nan_status_t;
  9864. /** nan cmd list entry */
  9865. enum wl_nan_sub_cmd_input_flags {
  9866. WL_NAN_SUB_CMD_FLAG_NONE = 0,
  9867. WL_NAN_SUB_CMD_FLAG_SKIP = 1, /* Skip to next sub-command on error */
  9868. WL_NAN_SUB_CMD_FLAG_TERMINATE = 2, /* Terminate processing and return */
  9869. WL_NAN_SUB_CMD_FLAG_LAST /* Keep this at the end */
  9870. };
  9871. /** container for nan events */
  9872. typedef struct wl_nan_ioc {
  9873. uint16 version; /**< interface command or event version */
  9874. uint16 id; /**< nan ioctl cmd ID */
  9875. uint16 len; /**< total length of all tlv records in data[] */
  9876. uint16 pad; /**< pad to be 32 bit aligment */
  9877. uint8 data []; /**< var len payload of bcm_xtlv_t type */
  9878. } wl_nan_ioc_t;
  9879. /*
  9880. * NAN sub-command data structures
  9881. */
  9882. /*
  9883. * Config component WL_NAN_CMD_CFG_XXXX sub-commands
  9884. * WL_NAN_CMD_CFG_ENABLE
  9885. */
  9886. enum wl_nan_config_state {
  9887. WL_NAN_CONFIG_STATE_DISABLE = 0,
  9888. WL_NAN_CONFIG_STATE_ENABLE = 1
  9889. };
  9890. typedef int8 wl_nan_config_state_t;
  9891. /* WL_NAN_CMD_CFG_NAN_INIT */
  9892. typedef uint8 wl_nan_init_t;
  9893. /* WL_NAN_CMD_CFG_NAN_VERSION */
  9894. typedef uint16 wl_nan_ver_t;
  9895. /* WL_NAN_CMD_CFG_NAN_CONFIG */
  9896. typedef uint32 wl_nan_cfg_ctrl_t;
  9897. /* WL_NAN_CMD_CFG_NAN_CONFIG2 */
  9898. typedef struct wl_nan_cfg_ctrl2 {
  9899. uint32 flags1; /* wl_nan_cfg_ctrl2_flags1 */
  9900. uint32 flags2; /* wl_nan_cfg_ctrl2_flags2 */
  9901. } wl_nan_cfg_ctrl2_t;
  9902. enum wl_nan_cfg_ctrl2_flags1 {
  9903. /* Allows unicast SDF TX while local device is under NDP/NDL negotiation,
  9904. * but Not with the peer SDF destined to.
  9905. */
  9906. WL_NAN_CTRL2_FLAG1_ALLOW_SDF_TX_UCAST_IN_PROG = 0x00000001,
  9907. /* Allows broadcast SDF TX while local device is under NDP/NDL negotiation */
  9908. WL_NAN_CTRL2_FLAG1_ALLOW_SDF_TX_BCAST_IN_PROG = 0x00000002,
  9909. /* Allows the device to send schedule update automatically on local schedule change */
  9910. WL_NAN_CTRL2_FLAG1_AUTO_SCHEDUPD = 0x00000004,
  9911. /* Allows the device to handle slot pre_close operations */
  9912. WL_NAN_CTRL2_FLAG1_SLOT_PRE_CLOSE = 0x00000008
  9913. };
  9914. #define WL_NAN_CTRL2_FLAGS1_MASK 0x0000000F
  9915. #define WL_NAN_CTRL2_FLAGS2_MASK 0x00000000
  9916. /*
  9917. * WL_NAN_CMD_CFG_BAND, WL_NAN_CMD_CFG_RSSI_THRESHOLD(Get only)
  9918. */
  9919. typedef uint8 wl_nan_band_t;
  9920. /*
  9921. * WL_NAN_CMD_CFG_ROLE
  9922. */
  9923. enum wl_nan_role {
  9924. WL_NAN_ROLE_AUTO = 0,
  9925. WL_NAN_ROLE_NON_MASTER_NON_SYNC = 1,
  9926. WL_NAN_ROLE_NON_MASTER_SYNC = 2,
  9927. WL_NAN_ROLE_MASTER = 3,
  9928. WL_NAN_ROLE_ANCHOR_MASTER = 4
  9929. };
  9930. typedef uint8 wl_nan_role_t;
  9931. typedef struct wl_nan_device_state
  9932. {
  9933. wl_nan_role_t role; /* Sync Master, Non-Sync Master */
  9934. uint8 state; /* TBD */
  9935. uint8 hopcount; /* Hops to the Anchor Master */
  9936. struct ether_addr immediate_master; /* Master MAC */
  9937. struct ether_addr anchor_master; /* Anchor Master MAC */
  9938. struct ether_addr cluster_id; /* Cluster ID to which this device belongs to */
  9939. uint8 PAD[3];
  9940. uint32 tsf_high; /* NAN Cluster TSFs */
  9941. uint32 tsf_low;
  9942. } wl_nan_device_state_t;
  9943. /*
  9944. * WL_NAN_CMD_CFG_HOP_CNT, WL_NAN_CMD_CFG_HOP_LIMIT
  9945. */
  9946. typedef uint8 wl_nan_hop_count_t;
  9947. /*
  9948. * WL_NAN_CMD_CFG_WARMUP_TIME
  9949. */
  9950. typedef uint32 wl_nan_warmup_time_ticks_t;
  9951. /*
  9952. * WL_NAN_CMD_CFG_RSSI_THRESHOLD
  9953. * rssi_close and rssi_mid are used to transition master to non-master
  9954. * role by NAN state machine. rssi thresholds corresponding to the band
  9955. * will be updated.
  9956. */
  9957. /* To be deprecated */
  9958. typedef struct wl_nan_rssi_threshold {
  9959. wl_nan_band_t band;
  9960. int8 rssi_close;
  9961. int8 rssi_mid;
  9962. uint8 pad;
  9963. } wl_nan_rssi_threshold_t;
  9964. /* WL_NAN_CMD_ELECTION_RSSI_THRESHOLD */
  9965. typedef struct wl_nan_rssi_thld {
  9966. int8 rssi_close_2g;
  9967. int8 rssi_mid_2g;
  9968. int8 rssi_close_5g;
  9969. int8 rssi_mid_5g;
  9970. } wl_nan_rssi_thld_t;
  9971. /* WL_NAN_CMD_DATA_MAX_PEERS */
  9972. typedef uint8 wl_nan_max_peers_t;
  9973. /*
  9974. * WL_NAN_CMD_CFG_STATUS
  9975. */
  9976. typedef enum wl_nan_election_mode {
  9977. WL_NAN_ELECTION_RUN_BY_HOST = 1,
  9978. WL_NAN_ELECTION_RUN_BY_FW = 2
  9979. } wl_nan_election_mode_t;
  9980. typedef struct wl_nan_conf_status {
  9981. struct ether_addr nmi; /* NAN mgmt interface address */
  9982. uint8 enabled; /* NAN is enabled */
  9983. uint8 role; /* Current nan sync role */
  9984. struct ether_addr cid; /* Current Cluster id */
  9985. uint8 social_chans[2]; /* Social channels */
  9986. uint8 mr[8]; /* Self Master Rank */
  9987. uint8 amr[8]; /* Anchor Master Rank */
  9988. uint32 ambtt; /* Anchor master beacon target time */
  9989. uint32 cluster_tsf_h; /* Current Cluster TSF High */
  9990. uint32 cluster_tsf_l; /* Current Cluster TSF Low */
  9991. uint8 election_mode; /* Election mode, host or firmware */
  9992. uint8 hop_count; /* Current Hop count */
  9993. uint8 imr[8]; /* Immediate Master Rank */
  9994. uint8 pad[4]; /* remove after precommit */
  9995. uint16 opt_tlvs_len;
  9996. uint8 opt_tlvs[];
  9997. } wl_nan_conf_status_t;
  9998. /*
  9999. * WL_NAN_CMD_CFG_OUI
  10000. */
  10001. typedef struct wl_nan_oui_type {
  10002. uint8 nan_oui[DOT11_OUI_LEN];
  10003. uint8 type;
  10004. } wl_nan_oui_type_t;
  10005. /*
  10006. * WL_NAN_CMD_CFG_COUNT
  10007. */
  10008. typedef struct wl_nan_count {
  10009. uint32 cnt_bcn_tx; /**< TX disc/sync beacon count */
  10010. uint32 cnt_bcn_rx; /**< RX disc/sync beacon count */
  10011. uint32 cnt_svc_disc_tx; /**< TX svc disc frame count */
  10012. uint32 cnt_svc_disc_rx; /**< RX svc disc frame count */
  10013. } wl_nan_count_t;
  10014. /*
  10015. * Election component WL_NAN_CMD_ELECTION_XXXX sub-commands
  10016. * WL_NAN_CMD_ELECTION_HOST_ENABLE
  10017. */
  10018. enum wl_nan_enable_flags {
  10019. WL_NAN_DISABLE_FLAG_HOST_ELECTION = 0,
  10020. WL_NAN_ENABLE_FLAG_HOST_ELECTION = 1
  10021. };
  10022. /*
  10023. * 0 - disable host based election
  10024. * 1 - enable host based election
  10025. */
  10026. typedef uint8 wl_nan_host_enable_t;
  10027. /*
  10028. * WL_NAN_CMD_ELECTION_METRICS_CONFIG
  10029. */
  10030. /* Set only */
  10031. typedef struct wl_nan_election_metric_config {
  10032. uint8 random_factor; /* Configured random factor */
  10033. uint8 master_pref; /* configured master preference */
  10034. uint8 pad[2];
  10035. } wl_nan_election_metric_config_t;
  10036. /*
  10037. * WL_NAN_CMD_ELECTION_METRICS_STATE
  10038. */
  10039. /* Get only */
  10040. typedef struct wl_nan_election_metric_state {
  10041. uint8 random_factor; /* random factor used in MIs */
  10042. uint8 master_pref; /* Master advertised in MIs */
  10043. uint8 pad[2];
  10044. } wl_nan_election_metric_state_t;
  10045. /*
  10046. * WL_NAN_CMD_ELECTION_LEAVE
  10047. * WL_NAN_CMD_ELECTION_STOP
  10048. */
  10049. typedef struct ether_addr wl_nan_cluster_id_t;
  10050. #define NHO_SEC_NCS_SK_REPLAY_CNT_LEN 8u
  10051. /* kck */
  10052. #define NHO_SEC_NCS_SK_256_KCK_LEN 24u /* refer nan2 r21 7.1.4.1 */
  10053. /* kek */
  10054. #define NHO_SEC_NCS_SK_256_KEK_LEN 32u /* refer nan2 r21 7.1.4.1 */
  10055. /* tk */
  10056. #define NHO_SEC_NCS_SK_256_TK_LEN 32u /* refer nan2 r21 section 7 */
  10057. #define NHO_SEC_NCS_SK_MAX_KEY_LEN (NHO_SEC_NCS_SK_256_KCK_LEN \
  10058. + NHO_SEC_NCS_SK_256_KEK_LEN \
  10059. + NHO_SEC_NCS_SK_256_TK_LEN)
  10060. #define NHO_SEC_KEY_INSTALL_FLAG (1 << 0)
  10061. #define NHO_SEC_KEY_UNINSTALL_FLAG (1 << 1)
  10062. /* WL_NAN_XTLV_NANHO_SEC_SA */
  10063. typedef struct nanho_sec_sa {
  10064. int8 csid; /* Cipher suite ID to identify the security type */
  10065. uint8 kck_len; /* KCK len in key_buf */
  10066. uint8 kek_len; /* KEK len in key_buf */
  10067. uint8 tk_len; /* Transient key len in key_buf */
  10068. uint16 flags;
  10069. uint16 pad;
  10070. struct ether_addr laddr; /* local mac addr */
  10071. struct ether_addr raddr; /* remote mac addr */
  10072. uint8 key_krc[NHO_SEC_NCS_SK_REPLAY_CNT_LEN]; /* Key Replay ctr */
  10073. uint8 key_buf[NHO_SEC_NCS_SK_MAX_KEY_LEN]; /* PTK = KCK + KEK + TK */
  10074. } nanho_sec_sa_t;
  10075. /*
  10076. * WL_NAN_CMD_ELECTION_MERGE
  10077. * 0 - disable cluster merge
  10078. * 1 - enable cluster merge
  10079. */
  10080. typedef uint8 wl_nan_merge_enable_t;
  10081. /*
  10082. * WL_NAN_CMD_CFG_ROLE
  10083. * role = 0 means configuration by firmware(obsolete); otherwise by host
  10084. * when host configures role, also need target master address to sync to
  10085. */
  10086. #define NAN_SYNC_MASTER_SELF 1
  10087. #define NAN_SYNC_MASTER_USE_TIMING 2 /* Use the tsf timing provided */
  10088. #define NAN_SYNC_MASTER_AMREC_UPD 4 /* provide AM record update */
  10089. /*
  10090. struct ether_addr addr:
  10091. when NAN_SYNC_MASTER_USE_TIMING is set, addr is the mac of Rx NAN beacon
  10092. providing the timing info
  10093. ltsf_h, ltsf_l:
  10094. The local TSF timestamp filled in by FW in the WL_NAN_EVENT_BCN_RX event;
  10095. rtsf_h, rtsf_l:
  10096. The timestamp in the Rx beacon frame, filled in by host
  10097. uint32 ambtt:
  10098. the amtt in the cluster ID attribute in the Rx beacon frame
  10099. */
  10100. typedef struct nan_sync_master {
  10101. uint8 flag; /* 1: self; 2: use TSF timing; 4: AMR update */
  10102. uint8 hop_count;
  10103. struct ether_addr addr;
  10104. struct ether_addr cluster_id;
  10105. chanspec_t channel; /* bcn reception channel */
  10106. uint32 ltsf_h;
  10107. uint32 ltsf_l;
  10108. uint32 rtsf_h;
  10109. uint32 rtsf_l;
  10110. uint8 amr[WL_NAN_MASTER_RANK_LEN];
  10111. uint32 ambtt;
  10112. } nan_sync_master_t;
  10113. /*
  10114. * NAN Sync TLV(NSTLV):
  10115. * To keep NAN/AWDL concurrency time sync.
  10116. * It is generated at hybrid device, and propogated by AWDL only device.
  10117. * It contains the information needed to run NAN election
  10118. */
  10119. #include <packed_section_start.h>
  10120. typedef BWL_PRE_PACKED_STRUCT struct awdl_nan_sync_tlv {
  10121. uint16 hop_count; /* total hop_count */
  10122. struct ether_addr src_addr; /* macaddr of the hybrid originator of nstlv */
  10123. struct ether_addr cluster_id; /* NAN cluster ID of hybrid originator of nstlv */
  10124. uint32 nan_tsf_h; /* NAN cluster TSF of the hybrid originator of nstlv */
  10125. uint32 nan_tsf_l;
  10126. uint8 master_preference;
  10127. uint8 random_factor;
  10128. uint8 amr[WL_NAN_MASTER_RANK_LEN];
  10129. uint8 orig_hop_count; /* hop_count of the origin hybrid NAN device */
  10130. uint32 ambtt; /* Anchor Master Beacon Transmission Time */
  10131. uint8 opt_xtlv_len; /* xtlv len */
  10132. } BWL_POST_PACKED_STRUCT awdl_nan_sync_tlv_t;
  10133. typedef BWL_PRE_PACKED_STRUCT struct wl_awdl_nan_sync_tlv {
  10134. uint8 type; /* 23 for NTLV */
  10135. uint16 param_len;
  10136. awdl_nan_sync_tlv_t ntlv;
  10137. } BWL_POST_PACKED_STRUCT wl_awdl_nan_sync_tlv_t;
  10138. #include <packed_section_end.h>
  10139. /* NAN advertiser structure */
  10140. /* TODO RSDB: add chspec to indicates core corresponds correct core */
  10141. typedef struct nan_adv_entry {
  10142. uint8 age; /* used to remove stale entries */
  10143. uint8 hop_count; /* for NTLV support, use bit7 for virtual NAN peer */
  10144. struct ether_addr addr;
  10145. struct ether_addr cluster_id;
  10146. chanspec_t channel; /* bcn reception channel */
  10147. uint32 ltsf_h;
  10148. uint32 ltsf_l;
  10149. uint32 rtsf_h;
  10150. uint32 rtsf_l;
  10151. uint8 amr[WL_NAN_MASTER_RANK_LEN];
  10152. uint32 ambtt;
  10153. int8 rssi[NAN_MAX_BANDS]; /* rssi last af was received at */
  10154. int8 last_rssi[NAN_MAX_BANDS]; /* rssi in the last AF */
  10155. } nan_adv_entry_t;
  10156. #define NAN_VIRTUAL_PEER_BIT 0x80
  10157. typedef enum {
  10158. NAC_CNT_NTLV_AF_TX = 0, /* count of AWDL AF containing NTLV tx */
  10159. NAC_CNT_NTLV_AF_RX, /* count of AWDL AF containing NTLV rx */
  10160. NAC_CNT_NTLV_TMERR_TX, /* count of NTLV tx timing error */
  10161. NAC_CNT_NTLV_TMERR_RX, /* count of NTLV rx timing error */
  10162. NAC_CNT_NTLV_TM_MISMATCH, /* count of TopMaster mismatch in Rx NTLV processing */
  10163. NAC_CNT_NTLV_ADV_EXISTED, /* count of NTLV ignored bc advertiser existed from bcn */
  10164. NAC_CNT_NTLV_STALED_BCN, /* count of staled bcn from NTLV info */
  10165. NAC_CNT_NTLV_MERGE, /* count of NTLV used for NAN cluster merge */
  10166. NAC_CNT_NTLV_ELECTION_DROP, /* count of NTLV dropped in NAN election */
  10167. NAC_CNT_NTLV_TSF_ADOPT, /* count of NTLV used for NAN TSF adoption */
  10168. NAC_CNT_NTLV_LAST
  10169. } nac_cnt_enum_t;
  10170. #define NAC_MAX_CNT (NAC_CNT_NTLV_LAST)
  10171. typedef struct nac_stats {
  10172. uint32 nac_cnt[NAC_MAX_CNT];
  10173. } nac_stats_t;
  10174. typedef struct nan_adv_table {
  10175. uint8 num_adv;
  10176. uint8 adv_size;
  10177. uint8 pad[2];
  10178. nan_adv_entry_t adv_nodes[0];
  10179. } nan_adv_table_t;
  10180. typedef struct wl_nan_role_cfg {
  10181. wl_nan_role_t cfg_role;
  10182. wl_nan_role_t cur_role;
  10183. uint8 pad[2];
  10184. nan_sync_master_t target_master;
  10185. } wl_nan_role_cfg_t;
  10186. typedef struct wl_nan_role_config {
  10187. wl_nan_role_t role;
  10188. struct ether_addr target_master;
  10189. uint8 pad;
  10190. } wl_nan_role_config_t;
  10191. typedef int8 wl_nan_sd_optional_field_types_t;
  10192. /* Flag bits for Publish and Subscribe (wl_nan_sd_params_t flags) */
  10193. /* First 8 bits are blocked for mapping
  10194. * against svc_control flag bits which goes out
  10195. * as part of SDA attribute in air in SDF frames
  10196. */
  10197. #define WL_NAN_RANGE_LIMITED 0x0040
  10198. /* Event generation indicator (default is continuous) */
  10199. #define WL_NAN_MATCH_ONCE 0x100000
  10200. #define WL_NAN_MATCH_NEVER 0x200000
  10201. /* Bits specific to Publish */
  10202. #define WL_NAN_PUB_UNSOLICIT 0x1000 /* Unsolicited Tx */
  10203. #define WL_NAN_PUB_SOLICIT 0x2000 /* Solicited Tx */
  10204. #define WL_NAN_PUB_BOTH 0x3000 /* Both the above */
  10205. #define WL_NAN_PUB_BCAST 0x4000 /* bcast solicited Tx only */
  10206. #define WL_NAN_PUB_EVENT 0x8000 /* Event on each solicited Tx */
  10207. #define WL_NAN_PUB_SOLICIT_PENDING 0x10000 /* Used for one-time solicited Publish */
  10208. #define WL_NAN_FOLLOWUP 0x20000 /* Follow-up frames */
  10209. #define WL_NAN_TX_FOLLOWUP 0x40000 /* host generated transmit Follow-up frames */
  10210. /* Bits specific to Subscribe */
  10211. #define WL_NAN_SUB_ACTIVE 0x1000 /* Active subscribe mode */
  10212. #define WL_NAN_SUB_MATCH_IF_SVC_INFO 0x2000 /* Service info in publish */
  10213. #define WL_NAN_TTL_UNTIL_CANCEL 0xFFFFFFFF /* Special values for time to live (ttl) parameter */
  10214. /*
  10215. * Publish - runs until first transmission
  10216. * Subscribe - runs until first DiscoveryResult event
  10217. */
  10218. #define WL_NAN_TTL_FIRST 0
  10219. /* Nan Service Based control Flags */
  10220. /* If set, dev will take care of dp_resp */
  10221. #define WL_NAN_SVC_CTRL_AUTO_DPRESP 0x1000000
  10222. /* If set, host wont rec event "receive" */
  10223. #define WL_NAN_SVC_CTRL_SUPPRESS_EVT_RECEIVE 0x2000000
  10224. /* If set, host wont rec event "replied" */
  10225. #define WL_NAN_SVC_CTRL_SUPPRESS_EVT_REPLIED 0x4000000
  10226. /* If set, host wont rec event "terminated" */
  10227. #define WL_NAN_SVC_CTRL_SUPPRESS_EVT_TERMINATED 0x8000000
  10228. /*
  10229. * WL_NAN_CMD_SD_PARAMS
  10230. */
  10231. typedef struct wl_nan_sd_params
  10232. {
  10233. uint16 length; /* length including options */
  10234. uint8 period; /* period of the unsolicited SDF xmission in DWs */
  10235. uint8 awake_dw; /* interval between two DWs where SDF tx/rx are done */
  10236. uint8 svc_hash[WL_NAN_SVC_HASH_LEN]; /* Hash for the service name */
  10237. uint8 instance_id; /* Instance of the current service */
  10238. int8 proximity_rssi; /* RSSI limit to Rx subscribe or pub SDF 0 no effect */
  10239. uint32 flags; /* bitmap representing aforesaid optional flags */
  10240. int32 ttl; /* TTL for this instance id, -1 will run till cancelled */
  10241. tlv_t optional[1]; /* optional fields in the SDF as appropriate */
  10242. } wl_nan_sd_params_t;
  10243. /*
  10244. * WL_NAN_CMD_SD_PUBLISH_LIST
  10245. * WL_NAN_CMD_SD_SUBSCRIBE_LIST
  10246. */
  10247. typedef struct wl_nan_service_info
  10248. {
  10249. uint8 instance_id; /* Publish instance ID */
  10250. uint8 service_hash[WL_NAN_SVC_HASH_LEN]; /* Hash for service name */
  10251. } wl_nan_service_info_t;
  10252. typedef struct wl_nan_service_list
  10253. {
  10254. uint16 id_count; /* Number of registered publish/subscribe services */
  10255. wl_nan_service_info_t list[1]; /* service info defined by nan_service instance */
  10256. } wl_nan_service_list_t;
  10257. /*
  10258. * WL_NAN_CMD_CFG_BCN_INTERVAL
  10259. */
  10260. typedef uint16 wl_nan_disc_bcn_interval_t;
  10261. /*
  10262. * WL_NAN_CMD_CFG_SDF_TXTIME
  10263. */
  10264. typedef uint16 wl_nan_svc_disc_txtime_t;
  10265. /*
  10266. * WL_NAN_CMD_CFG_STOP_BCN_TX
  10267. */
  10268. typedef uint16 wl_nan_stop_bcn_tx_t;
  10269. /*
  10270. * WL_NAN_CMD_CFG_SID_BEACON
  10271. */
  10272. typedef struct wl_nan_sid_beacon_control {
  10273. uint8 sid_enable; /* Flag to indicate the inclusion of Service IDs in Beacons */
  10274. uint8 sid_count; /* Limit for number of publish SIDs to be included in Beacons */
  10275. uint8 sub_sid_count; /* Limit for number of subscribe SIDs to be included in Beacons */
  10276. uint8 pad;
  10277. } wl_nan_sid_beacon_control_t;
  10278. /*
  10279. * WL_NAN_CMD_CFG_DW_LEN
  10280. */
  10281. typedef uint16 wl_nan_dw_len_t;
  10282. /*
  10283. * WL_NAN_CMD_CFG_AWAKE_DW Will be deprecated.
  10284. */
  10285. typedef struct wl_nan_awake_dw {
  10286. wl_nan_band_t band; /* 0 - b mode 1- a mode */
  10287. uint8 interval; /* 1 or 2 or 4 or 8 or 16 */
  10288. uint16 pad;
  10289. } wl_nan_awake_dw_t;
  10290. /*
  10291. * WL_NAN_CMD_CFG_AWAKE_DWS
  10292. */
  10293. typedef struct wl_nan_awake_dws {
  10294. uint8 dw_interval_2g; /* 2G DW interval */
  10295. uint8 dw_interval_5g; /* 5G DW interval */
  10296. uint16 pad;
  10297. } wl_nan_awake_dws_t;
  10298. /* WL_NAN_CMD_SYNC_BCN_RSSI_NOTIF_THRESHOLD */
  10299. typedef struct wl_nan_rssi_notif_thld {
  10300. int8 bcn_rssi_2g;
  10301. int8 bcn_rssi_5g;
  10302. int16 pad;
  10303. } wl_nan_rssi_notif_thld_t;
  10304. /*
  10305. * WL_NAN_CMD_CFG_SOCIAL_CHAN
  10306. */
  10307. typedef struct wl_nan_social_channels {
  10308. uint8 soc_chan_2g; /* 2G social channel */
  10309. uint8 soc_chan_5g; /* 5G social channel */
  10310. uint16 pad;
  10311. } wl_nan_social_channels_t;
  10312. /*
  10313. * WL_NAN_CMD_SD_CANCEL_PUBLISH
  10314. * WL_NAN_CMD_SD_CANCEL_SUBSCRIBE
  10315. */
  10316. typedef uint8 wl_nan_instance_id; /* Instance ID of an active publish instance */
  10317. /*
  10318. * WL_NAN_CMD_SD_VND_INFO
  10319. */
  10320. typedef struct wl_nan_sd_vendor_info
  10321. {
  10322. uint16 length; /* Size in bytes of the payload following this field */
  10323. uint8 data[]; /* Vendor Information */
  10324. } wl_nan_sd_vendor_info_t;
  10325. /*
  10326. * WL_NAN_CMD_SD_STATS
  10327. */
  10328. typedef struct wl_nan_sd_stats {
  10329. uint32 sdftx;
  10330. uint32 sdfrx;
  10331. uint32 sdsrffail;
  10332. uint32 sdrejrssi;
  10333. uint32 sdfollowuprx;
  10334. uint32 sdsubmatch;
  10335. uint32 sdpubreplied;
  10336. uint32 sdmftfail1;
  10337. uint32 sdmftfail2;
  10338. uint32 sdmftfail3;
  10339. uint32 sdmftfail4;
  10340. } wl_nan_sd_stats_t;
  10341. /* Flag bits for sd transmit message (wl_nan_sd_transmit_t flags) */
  10342. /* If set, host wont rec "tx status" event for tx-followup msg */
  10343. #define WL_NAN_FUP_SUPR_EVT_TXS 0x01
  10344. /* more flags can be added here */
  10345. /*
  10346. * WL_NAN_CMD_SD_TRANSMIT
  10347. * WL_NAN_CMD_SD_FUP_TRANSMIT
  10348. */
  10349. typedef struct wl_nan_sd_transmit {
  10350. uint8 local_service_id; /* Sender Service ID */
  10351. uint8 requestor_service_id; /* Destination Service ID */
  10352. struct ether_addr destination_addr; /* Destination MAC */
  10353. uint16 token; /* follow_up_token when a follow-up
  10354. * msg is queued successfully
  10355. */
  10356. uint8 priority; /* requested relative prio */
  10357. uint8 flags; /* Flags for tx follow-up msg */
  10358. uint16 opt_len; /* total length of optional tlvs */
  10359. uint8 opt_tlv[]; /* optional tlvs in bcm_xtlv_t type */
  10360. } wl_nan_sd_transmit_t;
  10361. /* disc cache timeout for a cache entry */
  10362. typedef uint16 wl_nan_disc_cache_timeout_t;
  10363. /*
  10364. * WL_NAN_CMD_SYNC_TSRESERVE
  10365. */
  10366. /** time slot */
  10367. #define NAN_MAX_TIMESLOT 32
  10368. typedef struct wl_nan_timeslot {
  10369. uint32 abitmap; /**< available bitmap */
  10370. uint32 chanlist[NAN_MAX_TIMESLOT];
  10371. } wl_nan_timeslot_t;
  10372. /*
  10373. * Deprecated
  10374. *
  10375. * WL_NAN_CMD_SYNC_TSRELEASE
  10376. */
  10377. typedef uint32 wl_nan_ts_bitmap_t;
  10378. /* nan passive scan params */
  10379. #define NAN_SCAN_MAX_CHCNT 8
  10380. /* nan merge scan params */
  10381. typedef struct wl_nan_scan_params {
  10382. /* dwell time of discovery channel corresponds to band_idx.
  10383. * If set to 0 then fw default will be used.
  10384. */
  10385. uint16 dwell_time;
  10386. /* scan period of discovery channel corresponds to band_idx.
  10387. * If set to 0 then fw default will be used.
  10388. */
  10389. uint16 scan_period;
  10390. /* band index of discovery channel */
  10391. uint8 band_index;
  10392. } wl_nan_scan_params_t;
  10393. /*
  10394. * WL_NAN_CMD_DBG_SCAN
  10395. */
  10396. typedef struct wl_nan_dbg_scan {
  10397. struct ether_addr cid;
  10398. uint8 pad[2];
  10399. } wl_nan_dbg_scan_t;
  10400. /* NAN_DBG_LEVEL */
  10401. typedef struct wl_nan_dbg_level {
  10402. uint32 nan_err_level; /* for Error levels */
  10403. uint32 nan_dbg_level; /* for bebug logs and trace */
  10404. uint32 nan_info_level; /* for dumps like prhex */
  10405. } wl_nan_dbg_level_t;
  10406. /*
  10407. * WL_NAN_CMD_DBG_EVENT_MASK
  10408. */
  10409. typedef uint32 wl_nan_event_mask_t;
  10410. /*
  10411. * WL_NAN_CMD_DBG_EVENT_CHECK
  10412. */
  10413. typedef uint8 wl_nan_dbg_ifname[BCM_MSG_IFNAME_MAX];
  10414. /*
  10415. * WL_NAN_CMD_DBG_DUMP
  10416. * WL_NAN_CMD_DBG_CLEAR
  10417. */
  10418. enum wl_nan_dbg_dump_type {
  10419. WL_NAN_DBG_DT_RSSI_DATA = 1,
  10420. WL_NAN_DBG_DT_STATS_DATA = 2,
  10421. /*
  10422. * Additional enums before this line
  10423. */
  10424. WL_NAN_DBG_DT_INVALID
  10425. };
  10426. typedef int8 wl_nan_dbg_dump_type_t;
  10427. /** various params and ctl swithce for nan_debug instance */
  10428. /*
  10429. * WL_NAN_CMD_DBG_DEBUG
  10430. */
  10431. typedef struct wl_nan_debug_params {
  10432. uint16 cmd; /**< debug cmd to perform a debug action */
  10433. uint16 status;
  10434. uint32 msglevel; /**< msg level if enabled */
  10435. uint8 enabled; /**< runtime debuging enabled */
  10436. uint8 collect;
  10437. uint8 PAD[2];
  10438. } wl_nan_debug_params_t;
  10439. typedef struct wl_nan_sched_svc_timeslot_s {
  10440. uint32 abitmap; /* availability bitmap */
  10441. uint32 chanlist[NAN_MAX_TIMESLOT];
  10442. uint8 res; /* resolution: 0 = 16ms, 1 = 32ms, 2 = 64ms 3 = reserved. REfer NAN spec */
  10443. uint8 mapid; /* mapid from NAN spec. Used to differentiate 2G Vs 5G band */
  10444. uint8 PAD[2];
  10445. } wl_nan_sched_svc_timeslot_t;
  10446. /*
  10447. * WL_NAN_CMD_DATA_DP_IDLE_PERIOD
  10448. */
  10449. typedef uint16 wl_nan_ndp_idle_period_t;
  10450. /*
  10451. * WL_NAN_CMD_DATA_DP_HB_DURATION
  10452. */
  10453. typedef uint16 wl_nan_ndp_hb_duration_t;
  10454. /* nan cmd IDs */
  10455. enum wl_nan_cmds {
  10456. /* nan cfg /disc & dbg ioctls */
  10457. WL_NAN_CMD_ENABLE = 1,
  10458. WL_NAN_CMD_ATTR = 2,
  10459. WL_NAN_CMD_NAN_JOIN = 3,
  10460. WL_NAN_CMD_LEAVE = 4,
  10461. WL_NAN_CMD_MERGE = 5,
  10462. WL_NAN_CMD_STATUS = 6,
  10463. WL_NAN_CMD_TSRESERVE = 7,
  10464. WL_NAN_CMD_TSSCHEDULE = 8,
  10465. WL_NAN_CMD_TSRELEASE = 9,
  10466. WL_NAN_CMD_OUI = 10,
  10467. WL_NAN_CMD_OOB_AF = 11,
  10468. WL_NAN_CMD_SCAN_PARAMS = 12,
  10469. WL_NAN_CMD_COUNT = 15,
  10470. WL_NAN_CMD_CLEARCOUNT = 16,
  10471. /* discovery engine commands */
  10472. WL_NAN_CMD_PUBLISH = 20,
  10473. WL_NAN_CMD_SUBSCRIBE = 21,
  10474. WL_NAN_CMD_CANCEL_PUBLISH = 22,
  10475. WL_NAN_CMD_CANCEL_SUBSCRIBE = 23,
  10476. WL_NAN_CMD_TRANSMIT = 24,
  10477. WL_NAN_CMD_CONNECTION = 25,
  10478. WL_NAN_CMD_SHOW = 26,
  10479. WL_NAN_CMD_STOP = 27, /* stop nan for a given cluster ID */
  10480. /* nan debug iovars & cmds */
  10481. WL_NAN_CMD_SCAN = 47,
  10482. WL_NAN_CMD_SCAN_RESULTS = 48,
  10483. WL_NAN_CMD_EVENT_MASK = 49,
  10484. WL_NAN_CMD_EVENT_CHECK = 50,
  10485. WL_NAN_CMD_DUMP = 51,
  10486. WL_NAN_CMD_CLEAR = 52,
  10487. WL_NAN_CMD_RSSI = 53,
  10488. WL_NAN_CMD_DEBUG = 60,
  10489. WL_NAN_CMD_TEST1 = 61,
  10490. WL_NAN_CMD_TEST2 = 62,
  10491. WL_NAN_CMD_TEST3 = 63,
  10492. WL_NAN_CMD_DISC_RESULTS = 64,
  10493. /* nan 2.0 data path commands */
  10494. WL_NAN_CMD_DATAPATH = 65
  10495. };
  10496. /* NAN DP interface commands */
  10497. enum wl_nan_dp_cmds {
  10498. /* nan 2.0 ioctls */
  10499. WL_NAN_CMD_DP_CAP = 1000,
  10500. WL_NAN_CMD_DP_CONFIG = 1001,
  10501. WL_NAN_CMD_DP_CREATE = 1002,
  10502. WL_NAN_CMD_DP_AUTO_CONNECT = 1003,
  10503. WL_NAN_CMD_DP_DATA_REQ = 1004,
  10504. WL_NAN_CMD_DP_DATA_RESP = 1005,
  10505. WL_NAN_CMD_DP_SCHED_UPD = 1006,
  10506. WL_NAN_CMD_DP_END = 1007,
  10507. WL_NAN_CMD_DP_CONNECT = 1008,
  10508. WL_NAN_CMD_DP_STATUS = 1009
  10509. };
  10510. /* TODO Should remove this fixed length */
  10511. #define WL_NAN_DATA_SVC_SPEC_INFO_LEN 32 /* arbitrary */
  10512. #define WL_NAN_DP_MAX_SVC_INFO 0xFF
  10513. #define WL_NAN_DATA_NDP_INST_SUPPORT 16
  10514. /* Nan flags (16 bits) */
  10515. #define WL_NAN_DP_FLAG_SVC_INFO 0x0001
  10516. #define WL_NAN_DP_FLAG_CONFIRM 0x0002
  10517. #define WL_NAN_DP_FLAG_EXPLICIT_CFM 0x0004
  10518. #define WL_NAN_DP_FLAG_SECURITY 0x0008
  10519. #define WL_NAN_DP_FLAG_HAST_NDL_COUNTER 0x0010 /* Host assisted NDL counter */
  10520. /* NAN Datapath host status */
  10521. #define WL_NAN_DP_STATUS_ACCEPTED 1
  10522. #define WL_NAN_DP_STATUS_REJECTED 0
  10523. /* to be done */
  10524. typedef struct wl_nan_dp_cap {
  10525. uint8 tbd;
  10526. } wl_nan_dp_cap_t;
  10527. /** The service hash (service id) is exactly this many bytes. */
  10528. #define WL_NAN_SVC_HASH_LEN 6
  10529. /** Number of hash functions per bloom filter */
  10530. #define WL_NAN_HASHES_PER_BLOOM 4
  10531. /* no. of max last disc results */
  10532. #define WL_NAN_MAX_DISC_RESULTS 3
  10533. /* NAN security related defines */
  10534. /* NCS-SK related */
  10535. #define WL_NAN_NCS_SK_PMK_LEN 32
  10536. #define WL_NAN_NCS_SK_PMKID_LEN 16
  10537. /* recent discovery results */
  10538. typedef struct wl_nan_disc_result_s
  10539. {
  10540. wl_nan_instance_id_t instance_id; /* instance id of pub/sub req */
  10541. wl_nan_instance_id_t peer_instance_id; /* peer instance id of pub/sub req/resp */
  10542. uint8 svc_hash[WL_NAN_SVC_HASH_LEN]; /* service descp string */
  10543. struct ether_addr peer_mac; /* peer mac address */
  10544. } wl_nan_disc_result_t;
  10545. /* list of recent discovery results */
  10546. typedef struct wl_nan_disc_results_s
  10547. {
  10548. wl_nan_disc_result_t disc_result[WL_NAN_MAX_DISC_RESULTS];
  10549. } wl_nan_disc_results_list_t;
  10550. /* nan 1.0 events */
  10551. /* To be deprecated - will be replaced by event_disc_result */
  10552. typedef struct wl_nan_ev_disc_result {
  10553. wl_nan_instance_id_t pub_id;
  10554. wl_nan_instance_id_t sub_id;
  10555. struct ether_addr pub_mac;
  10556. uint8 opt_tlvs[0];
  10557. } wl_nan_ev_disc_result_t;
  10558. typedef struct wl_nan_event_disc_result {
  10559. wl_nan_instance_id_t pub_id;
  10560. wl_nan_instance_id_t sub_id;
  10561. struct ether_addr pub_mac;
  10562. int8 publish_rssi; /* publisher RSSI */
  10563. uint8 attr_num;
  10564. uint16 attr_list_len; /* length of the all the attributes in the SDF */
  10565. uint8 attr_list[0]; /* list of NAN attributes */
  10566. } wl_nan_event_disc_result_t;
  10567. typedef struct wl_nan_ev_p2p_avail {
  10568. struct ether_addr sender;
  10569. struct ether_addr p2p_dev_addr;
  10570. uint8 dev_role;
  10571. uint8 resolution;
  10572. uint8 repeat;
  10573. uint8 pad[3];
  10574. chanspec_t chanspec;
  10575. uint32 avail_bmap;
  10576. } wl_nan_ev_p2p_avail_t;
  10577. /*
  10578. * discovery interface event structures *
  10579. */
  10580. enum wl_nan_oob_af_flags {
  10581. WL_NAN_OOB_AF_FLAG_SEND_EVENT = 0x0001, /* send tx status event */
  10582. WL_NAN_OOB_AF_FLAG_FLUSH_PCB = 0x0002, /* flush PCB */
  10583. WL_NAN_OOB_AF_FLAG_ADD_DCAP = 0x0004, /* add dev cap attr into NAF body */
  10584. WL_NAN_OOB_AF_FLAG_ADD_ELMT = 0x0008, /* add elmt container attr into NAF body */
  10585. WL_NAN_OOB_AF_FLAG_MFP_REQUIRED = 0x0010 /* MFP required */
  10586. };
  10587. typedef uint16 wl_nan_oob_af_flags_t;
  10588. /* mandatory parameters for OOB action frame */
  10589. typedef struct wl_nan_oob_af_params_s
  10590. {
  10591. uint8 fup_lcl_id; /* local instance ID of follow-up SDF */
  10592. uint8 fup_peer_id; /* peer instance ID of follow-up SDF */
  10593. uint8 sdf_type; /* represented by service control type NAN_SC_XXX */
  10594. uint8 unused_uint8;
  10595. uint32 unused_uint32;
  10596. struct ether_addr bssid;
  10597. struct ether_addr dest;
  10598. uint32 pkt_lifetime;
  10599. uint8 n2af_sub_type; /* NAN2 AF sub type */
  10600. uint8 retry_cnt; /* NAF tx retry (not 802.11 re-tx) */
  10601. uint16 token; /* NAN host seq num */
  10602. uint16 flags; /* wl_nan_oob_af_flags_t */
  10603. uint32 fsm_id; /* unique fsm id */
  10604. uint16 payload_len;
  10605. uint8 payload[1];
  10606. } wl_nan_oob_af_params_t;
  10607. /* NAN Ranging */
  10608. /* Bit defines for global flags */
  10609. #define WL_NAN_RANGING_ENABLE 1 /**< enable RTT */
  10610. #define WL_NAN_RANGING_RANGED 2 /**< Report to host if ranged as target */
  10611. typedef struct nan_ranging_config {
  10612. uint32 chanspec; /**< Ranging chanspec */
  10613. uint16 timeslot; /**< NAN RTT start time slot 1-511 */
  10614. uint16 duration; /**< NAN RTT duration in ms */
  10615. struct ether_addr allow_mac; /**< peer initiated ranging: the allowed peer mac
  10616. * address, a unicast (for one peer) or
  10617. * a broadcast for all. Setting it to all zeros
  10618. * means responding to none,same as not setting
  10619. * the flag bit NAN_RANGING_RESPOND
  10620. */
  10621. uint16 flags;
  10622. } wl_nan_ranging_config_t;
  10623. /** list of peers for self initiated ranging */
  10624. /** Bit defines for per peer flags */
  10625. #define WL_NAN_RANGING_REPORT (1<<0) /**< Enable reporting range to target */
  10626. typedef struct nan_ranging_peer {
  10627. uint32 chanspec; /**< desired chanspec for this peer */
  10628. uint32 abitmap; /**< available bitmap */
  10629. struct ether_addr ea; /**< peer MAC address */
  10630. uint8 frmcnt; /**< frame count */
  10631. uint8 retrycnt; /**< retry count */
  10632. uint16 flags; /**< per peer flags, report or not */
  10633. uint16 PAD;
  10634. } wl_nan_ranging_peer_t;
  10635. typedef struct nan_ranging_list {
  10636. uint8 count; /**< number of MAC addresses */
  10637. uint8 num_peers_done; /**< host set to 0, when read, shows number of peers
  10638. * completed, success or fail
  10639. */
  10640. uint8 num_dws; /**< time period to do the ranging, specified in dws */
  10641. uint8 reserve; /**< reserved field */
  10642. wl_nan_ranging_peer_t rp[1]; /**< variable length array of peers */
  10643. } wl_nan_ranging_list_t;
  10644. /* ranging results, a list for self initiated ranging and one for peer initiated ranging */
  10645. /* There will be one structure for each peer */
  10646. #define WL_NAN_RANGING_STATUS_SUCCESS 1
  10647. #define WL_NAN_RANGING_STATUS_FAIL 2
  10648. #define WL_NAN_RANGING_STATUS_TIMEOUT 3
  10649. #define WL_NAN_RANGING_STATUS_ABORT 4 /**< with partial results if sounding count > 0 */
  10650. typedef struct nan_ranging_result {
  10651. uint8 status; /**< 1: Success, 2: Fail 3: Timeout 4: Aborted */
  10652. uint8 sounding_count; /**< number of measurements completed (0 = failure) */
  10653. struct ether_addr ea; /**< initiator MAC address */
  10654. uint32 chanspec; /**< Chanspec where the ranging was done */
  10655. uint32 timestamp; /**< 32bits of the TSF timestamp ranging was completed at */
  10656. uint32 distance; /**< mean distance in meters expressed as Q4 number.
  10657. * Only valid when sounding_count > 0. Examples:
  10658. * 0x08 = 0.5m
  10659. * 0x10 = 1m
  10660. * 0x18 = 1.5m
  10661. * set to 0xffffffff to indicate invalid number
  10662. */
  10663. int32 rtt_var; /**< standard deviation in 10th of ns of RTTs measured.
  10664. * Only valid when sounding_count > 0
  10665. */
  10666. struct ether_addr tgtea; /**< target MAC address */
  10667. uint8 PAD[2];
  10668. } wl_nan_ranging_result_t;
  10669. typedef struct nan_ranging_event_data {
  10670. uint8 mode; /**< 1: Result of host initiated ranging */
  10671. /* 2: Result of peer initiated ranging */
  10672. uint8 reserved;
  10673. uint8 success_count; /**< number of peers completed successfully */
  10674. uint8 count; /**< number of peers in the list */
  10675. wl_nan_ranging_result_t rr[1]; /**< variable array of ranging peers */
  10676. } wl_nan_ranging_event_data_t;
  10677. enum {
  10678. WL_NAN_STATS_RSSI = 1,
  10679. WL_NAN_STATS_DATA = 2,
  10680. WL_NAN_STATS_DP = 3,
  10681. /*
  10682. * ***** ADD before this line ****
  10683. */
  10684. WL_NAN_STATS_INVALID
  10685. };
  10686. typedef struct wl_nan_dp_stats {
  10687. uint32 tbd; /* TBD */
  10688. } wl_nan_dp_stats_t;
  10689. typedef struct wl_nan_stats {
  10690. /* general */
  10691. uint32 cnt_dw; /* DW slots */
  10692. uint32 cnt_disc_bcn_sch; /* disc beacon slots */
  10693. uint32 cnt_amr_exp; /* count of ambtt expiries resetting roles */
  10694. uint32 cnt_bcn_upd; /* count of beacon template updates */
  10695. uint32 cnt_bcn_tx; /* count of sync & disc bcn tx */
  10696. uint32 cnt_bcn_rx; /* count of sync & disc bcn rx */
  10697. uint32 cnt_sync_bcn_tx; /* count of sync bcn tx within DW */
  10698. uint32 cnt_disc_bcn_tx; /* count of disc bcn tx */
  10699. uint32 cnt_sdftx_bcmc; /* count of bcast/mcast sdf tx */
  10700. uint32 cnt_sdftx_uc; /* count of unicast sdf tx */
  10701. uint32 cnt_sdftx_fail; /* count of unicast sdf tx fails */
  10702. uint32 cnt_sdf_rx; /* count of sdf rx */
  10703. /* NAN roles */
  10704. uint32 cnt_am; /* anchor master */
  10705. uint32 cnt_master; /* master */
  10706. uint32 cnt_nms; /* non master sync */
  10707. uint32 cnt_nmns; /* non master non sync */
  10708. /* TX */
  10709. uint32 cnt_err_txtime; /* txtime in sync bcn frame not a multiple of dw intv */
  10710. uint32 cnt_err_unsch_tx; /* tx while not in DW/ disc bcn slot */
  10711. uint32 cnt_err_bcn_tx; /* beacon tx error */
  10712. uint32 cnt_sync_bcn_tx_miss; /* no. of times time delta between 2 cosequetive
  10713. * sync beacons is more than expected
  10714. */
  10715. /* MSCH */
  10716. uint32 cnt_err_msch_reg; /* error is Dw/disc reg with msch */
  10717. uint32 cnt_err_wrong_ch_cb; /* count of msch calbacks in wrong channel */
  10718. uint32 cnt_dw_skip; /* count of DW rejected */
  10719. uint32 cnt_disc_skip; /* count of disc bcn rejected */
  10720. uint32 cnt_dw_start_early; /* msch cb not at registered time */
  10721. uint32 cnt_dw_start_late; /* no. of delays in slot start */
  10722. /* SCANS */
  10723. uint32 cnt_mrg_scan; /* count of merge scans completed */
  10724. uint32 cnt_err_ms_rej; /* number of merge scan failed */
  10725. uint32 cnt_scan_results; /* no. of nan beacons scanned */
  10726. uint32 cnt_join_scan_rej; /* no. of join scans rejected */
  10727. uint32 cnt_nan_scan_abort; /* no. of join scans rejected */
  10728. /* enable/disable */
  10729. uint32 cnt_nan_enab; /* no. of times nan feature got enabled */
  10730. uint32 cnt_nan_disab; /* no. of times nan feature got disabled */
  10731. uint32 cnt_sync_bcn_rx; /* count of sync bcn rx within DW */
  10732. uint32 cnt_sync_bcn_rx_tu[3]; /* Delta bw the tsf in bcn & remote */
  10733. uint32 cnt_bcn_tx_out_dw; /* TX sync beacon outside dw */
  10734. uint32 cnt_role_am_dw; /* anchor master role due to dw */
  10735. uint32 cnt_am_hop_err; /* wrong hopcount set for AM */
  10736. } wl_nan_stats_t;
  10737. #define WL_NAN_MAC_MAX_NAN_PEERS 6
  10738. #define WL_NAN_MAC_MAX_RSSI_DATA_PER_PEER 10
  10739. typedef struct wl_nan_nbr_rssi {
  10740. uint8 rx_chan; /* channel number on which bcn rcvd */
  10741. uint8 PAD[3];
  10742. int32 rssi_raw; /* received rssi value */
  10743. int32 rssi_avg; /* normalized rssi value */
  10744. } wl_nan_peer_rssi_t;
  10745. typedef struct wl_nan_peer_rssi_entry {
  10746. struct ether_addr mac; /* peer mac address */
  10747. uint8 flags; /* TODO:rssi data order: latest first, oldest first etc */
  10748. uint8 rssi_cnt; /* rssi data sample present */
  10749. wl_nan_peer_rssi_t rssi[WL_NAN_MAC_MAX_RSSI_DATA_PER_PEER]; /* RSSI data frm peer */
  10750. } wl_nan_peer_rssi_entry_t;
  10751. #define WL_NAN_PEER_RSSI 0x1
  10752. #define WL_NAN_PEER_RSSI_LIST 0x2
  10753. typedef struct wl_nan_nbr_rssi_data {
  10754. uint8 flags; /* this is a list or single rssi data */
  10755. uint8 peer_cnt; /* number of peers */
  10756. uint16 pad; /* padding */
  10757. wl_nan_peer_rssi_entry_t peers[1]; /* peers data list */
  10758. } wl_nan_peer_rssi_data_t;
  10759. /* WL_NAN_CMD_DBG_DUMP, GET Resp */
  10760. typedef struct wl_nan_dbg_dump_rsp {
  10761. wl_nan_dbg_dump_type_t dump_type; /* dump data type */
  10762. uint8 pad[3];
  10763. union {
  10764. wl_nan_peer_rssi_data_t peer_rssi;
  10765. wl_nan_stats_t nan_stats;
  10766. } u;
  10767. } wl_nan_dbg_dump_rsp_t;
  10768. enum nan_termination_status {
  10769. NAN_TERM_REASON_INVALID = 1,
  10770. NAN_TERM_REASON_TIMEOUT = 2,
  10771. NAN_TERM_REASON_USER_REQ = 3,
  10772. NAN_TERM_REASON_FAILURE = 4,
  10773. NAN_TERM_REASON_COUNT_REACHED = 5,
  10774. NAN_TERM_REASON_DE_SHUTDOWN = 6,
  10775. NAN_TERM_REASON_DISABLE_IN_PROGRESS = 7
  10776. };
  10777. /* nan2 data iovar */
  10778. /* nan2 qos */
  10779. typedef struct wl_nan_dp_qos
  10780. {
  10781. uint8 tid;
  10782. uint8 pad;
  10783. uint16 pkt_size;
  10784. uint16 mean_rate;
  10785. uint16 svc_interval;
  10786. } wl_nan_dp_qos_t;
  10787. #define WL_NAN_NDL_QOS_MAX_LAT_NO_PREF 0xFFFF
  10788. /* nan2 qos */
  10789. typedef struct wl_nan_ndl_qos
  10790. {
  10791. uint8 min_slots; /* min slots per dw interval */
  10792. uint8 pad;
  10793. uint16 max_latency; /* max latency */
  10794. } wl_nan_ndl_qos_t;
  10795. /* ndp config */
  10796. typedef struct wl_nan_ndp_config
  10797. {
  10798. uint8 ndp_id;
  10799. uint8 pub_id;
  10800. struct ether_addr pub_addr;
  10801. struct ether_addr data_addr; /* configure local data addr */
  10802. struct ether_addr init_data_addr; /* initiator data addr */
  10803. uint8 svc_spec_info[WL_NAN_DATA_SVC_SPEC_INFO_LEN];
  10804. wl_nan_dp_qos_t qos;
  10805. uint16 avail_len;
  10806. uint8 pad[3];
  10807. uint8 data[1];
  10808. } wl_nan_ndp_config_t;
  10809. /* nan2 device capabilities */
  10810. typedef struct wl_nan_ndp_oper_cfg {
  10811. uint8 awake_dw_2g;
  10812. uint8 awake_dw_5g;
  10813. uint8 bands_supported;
  10814. uint8 op_mode;
  10815. } wl_nan_ndp_oper_cfg_t;
  10816. typedef uint8 wl_nan_ndp_ndpid_t;
  10817. typedef uint8 wl_nan_ndp_conn_t;
  10818. #define WL_NAN_INVALID_NDPID 0 /* reserved ndp id */
  10819. typedef struct wl_nan_dp_req {
  10820. uint8 type; /* 0- unicast 1 - multicast */
  10821. uint8 pub_id; /* Publisher ID */
  10822. uint16 flags;
  10823. struct ether_addr peer_mac; /* Peer's NMI addr */
  10824. struct ether_addr mcast_mac; /* Multicast addr */
  10825. struct ether_addr ndi;
  10826. wl_nan_dp_qos_t qos;
  10827. wl_nan_ndl_qos_t ndl_qos; /* ndl qos */
  10828. uint8 tlv_params[]; /* xtlv parameters for command */
  10829. } wl_nan_dp_req_t;
  10830. /* TODO Need to replace ndp_id with lndp_id */
  10831. /* Return structure to data req IOVAR */
  10832. typedef struct wl_nan_dp_req_ret {
  10833. struct ether_addr indi; /* Initiators data mac addr */
  10834. uint8 ndp_id; /* Initiators ndpid */
  10835. uint8 pad;
  10836. } wl_nan_dp_req_ret_t;
  10837. typedef struct wl_nan_dp_resp {
  10838. uint8 type; /* 0- unicast 1 - multicast */
  10839. uint8 status; /* Accepted or Rejected */
  10840. uint8 reason_code;
  10841. /* Local NDP ID for unicast, mc_id for multicast, 0 for implicit NMSG */
  10842. uint8 ndp_id; /* can be host indp id also */
  10843. wl_nan_dp_qos_t qos;
  10844. /* Initiator data address for unicast or multicast address for multicast */
  10845. struct ether_addr mac_addr;
  10846. struct ether_addr ndi;
  10847. uint16 flags;
  10848. wl_nan_ndl_qos_t ndl_qos; /* ndl qos */
  10849. uint8 tlv_params[]; /* xtlv parameters for command */
  10850. } wl_nan_dp_resp_t;
  10851. /* Return structure to data resp IOVAR */
  10852. typedef struct wl_nan_dp_resp_ret {
  10853. uint8 nmsgid; /* NMSG ID or for multicast else 0 */
  10854. uint8 pad[3];
  10855. } wl_nan_dp_resp_ret_t;
  10856. typedef struct wl_nan_dp_conf {
  10857. uint8 lndp_id; /* can be host ndp id */
  10858. uint8 status; /* Accepted or Rejected */
  10859. uint8 pad[2];
  10860. } wl_nan_dp_conf_t;
  10861. typedef struct wl_nan_dp_end
  10862. {
  10863. uint8 lndp_id; /* can be host ndp id */
  10864. uint8 status;
  10865. struct ether_addr mac_addr; /* initiator's ndi */
  10866. } wl_nan_dp_end_t;
  10867. typedef struct wl_nan_dp_schedupd {
  10868. uint8 type; /* 0: unicast, 1: multicast */
  10869. uint8 flags;
  10870. struct ether_addr addr; /* peer NMI or multicast addr */
  10871. wl_nan_dp_qos_t qos;
  10872. wl_nan_ndl_qos_t ndl_qos; /* ndl qos */
  10873. uint8 map_id;
  10874. uint8 pad;
  10875. uint16 hostseq;
  10876. } wl_nan_dp_schedupd_t;
  10877. /* set: update with notification, unset: NDL setup handshake */
  10878. #define WL_NAN_DP_SCHEDUPD_NOTIF (1 << 0)
  10879. /* list ndp ids */
  10880. typedef struct wl_nan_ndp_id_list {
  10881. uint16 ndp_count;
  10882. uint8 lndp_id[];
  10883. } wl_nan_ndp_id_list_t;
  10884. /* nan2 status */
  10885. typedef struct ndp_session {
  10886. uint8 lndp_id;
  10887. uint8 state;
  10888. uint8 pub_id;
  10889. uint8 pad;
  10890. } ndp_session_t;
  10891. typedef struct wl_nan_ndp_status {
  10892. struct ether_addr peer_nmi;
  10893. struct ether_addr peer_ndi;
  10894. ndp_session_t session;
  10895. struct ether_addr lndi;
  10896. uint8 pad[2];
  10897. } wl_nan_ndp_status_t;
  10898. #define NAN_DP_OPAQUE_INFO_DP_RESP 0x01
  10899. #define NAN_DP_OPAQUE_INFO_DP_CONF 0x02
  10900. typedef struct wl_nan_dp_opaque_info {
  10901. uint8 frm_mask; /* dp_resp / dp_conf as defined above. */
  10902. struct ether_addr initiator_ndi; /* NDI to match in the dp_req. */
  10903. uint8 pub_id; /* publish id where the opaque data is included. */
  10904. uint8 len; /* len of opaque_info[]. */
  10905. uint8 pad[3];
  10906. uint8 opaque_info[0];
  10907. } wl_nan_dp_opaque_info_t;
  10908. /* events */
  10909. #define NAN_DP_SESSION_UNICAST 0
  10910. #define NAN_DP_SESSION_MULTICAST 1
  10911. #define NAN_DP_SECURITY_NONE 0
  10912. #define NAN_DP_SECURITY_CSID 1
  10913. #define NAN_DP_SECURITY_MK 2
  10914. #define WL_NAN_DATA_NMSGID_LEN 8 /* 8 bytes as per nan spec */
  10915. /* Common event structure for Nan Datapath
  10916. * Used for sending NDP Indication, Response, Confirmation, Securty Install and Establish events
  10917. */
  10918. typedef struct wl_nan_ev_datapath_cmn {
  10919. uint8 type;
  10920. /* ndp_id is valid only if type is unicast */
  10921. uint8 ndp_id;
  10922. uint8 pub_id;
  10923. uint8 security;
  10924. /* Following two fields are valid only if type is unicast */
  10925. struct ether_addr initiator_ndi;
  10926. struct ether_addr responder_ndi;
  10927. struct ether_addr peer_nmi;
  10928. uint8 status;
  10929. uint8 role;
  10930. /* Following two fields are valid only if type is multicast */
  10931. uint8 nmsg_id[WL_NAN_DATA_NMSGID_LEN];
  10932. uint8 mc_id;
  10933. uint8 pad;
  10934. uint16 opt_tlv_len;
  10935. uint8 opt_tlvs[];
  10936. } wl_nan_ev_datapath_cmn_t;
  10937. /* this is obsolete - DON'T USE */
  10938. typedef struct wl_nan_ev_datapath_end {
  10939. uint8 ndp_id;
  10940. uint8 status;
  10941. uint8 pad[2];
  10942. struct ether_addr peer_nmi;
  10943. struct ether_addr peer_ndi;
  10944. } wl_nan_ev_datapath_end_t;
  10945. typedef struct wl_tsf {
  10946. uint32 tsf_l;
  10947. uint32 tsf_h;
  10948. } wl_tsf_t;
  10949. typedef struct wl_nan_ev_rx_bcn {
  10950. wl_tsf_t tsf;
  10951. uint16 bcn_len;
  10952. uint8 pad[2];
  10953. uint8 bcn[0];
  10954. } wl_nan_ev_rx_bcn_t;
  10955. /* reason of host assist request */
  10956. enum wl_nan_host_assist_reason {
  10957. WL_NAN_HAST_REASON_NONE = 0,
  10958. /* reason for host assist request */
  10959. WL_NAN_HAST_REASON_NO_CRB = 1, /* NDL: no common NA */
  10960. WL_NAN_HAST_REASON_NDC = 2, /* NDL: NDC not compliant */
  10961. WL_NAN_HAST_REASON_IMMUT = 3, /* NDL: peer immutable schedule */
  10962. WL_NAN_HAST_REASON_RNG = 4, /* NDL: ranging schedule */
  10963. WL_NAN_HAST_REASON_QOS = 5, /* NDL: QoS not satisfied */
  10964. WL_NAN_HAST_REASON_SVC_NDI_MISSING = 6, /* SD: NDI associated with svc is missing */
  10965. WL_NAN_HAST_REASON_PEER_SCB_NORESOURCE = 7 /* NDP: no more peer scb available */
  10966. };
  10967. typedef uint8 wl_nan_host_assist_reason_t;
  10968. /* WL_NAN_XTLV_HOST_ASSIST_REQ */
  10969. typedef struct wl_nan_host_assist_req {
  10970. struct ether_addr peer_nmi; /* peer nmi */
  10971. struct ether_addr initiator_ndi; /* initiator ndi */
  10972. uint8 indp_id; /* initiator NDP ID */
  10973. wl_nan_frame_type_t frm_type; /* received NAF type */
  10974. wl_nan_host_assist_reason_t reason; /* reason of host assist request */
  10975. uint8 pub_id; /* Publish ID (valid for WL_NAN_FRM_TYPE_DP_REQ) */
  10976. uint8 pad[2];
  10977. } wl_nan_host_assist_req_t;
  10978. /* nan sub-features */
  10979. enum wl_nan_fw_cap_flag1 {
  10980. WL_NAN_FW_CAP_FLAG_NONE = 0x00000000, /* dummy */
  10981. WL_NAN_FW_CAP_FLAG1_AVAIL = 0x00000001,
  10982. WL_NAN_FW_CAP_FLAG1_DISC = 0x00000002,
  10983. WL_NAN_FW_CAP_FLAG1_DATA = 0x00000004,
  10984. WL_NAN_FW_CAP_FLAG1_SEC = 0x00000008,
  10985. WL_NAN_FW_CAP_FLAG1_RANGE = 0x00000010,
  10986. WL_NAN_FW_CAP_FLAG1_WFA_TB = 0x00000020,
  10987. WL_NAN_FW_CAP_FLAG1_DAM = 0x00000040,
  10988. WL_NAN_FW_CAP_FLAG1_DAM_STRICT = 0x00000080,
  10989. WL_NAN_FW_CAP_FLAG1_DAM_AUTO = 0x00000100,
  10990. WL_NAN_FW_CAP_FLAG1_DBG = 0x00000200,
  10991. WL_NAN_FW_CAP_FLAG1_BCMC_IN_NDC = 0x00000400,
  10992. WL_NAN_FW_CAP_FLAG1_CHSTATS = 0x00000800,
  10993. WL_NAN_FW_CAP_FLAG1_ASSOC_COEX = 0x00001000,
  10994. WL_NAN_FW_CAP_FLAG1_FASTDISC = 0x00002000,
  10995. WL_NAN_FW_CAP_FLAG1_NO_ID_GEN = 0x00004000,
  10996. WL_NAN_FW_CAP_FLAG1_DP_OPAQUE_DATA = 0x00008000,
  10997. WL_NAN_FW_CAP_FLAG1_NSR2 = 0x00010000,
  10998. WL_NAN_FW_CAP_FLAG1_NSR2_SAVE = 0x00020000,
  10999. WL_NAN_FW_CAP_FLAG1_NANHO = 0x00040000
  11000. };
  11001. /* WL_NAN_XTLV_GEN_FW_CAP */
  11002. typedef struct wl_nan_fw_cap {
  11003. uint32 flags1; /* nan sub-features compiled in firmware */
  11004. uint32 flags2; /* for more sub-features in future */
  11005. uint8 max_svc_publishes; /* max num of service publish */
  11006. uint8 max_svc_subscribes; /* max num of service subscribe */
  11007. uint8 max_lcl_sched_maps; /* max num of local schedule map */
  11008. uint8 max_lcl_ndc_entries; /* max num of local NDC entry */
  11009. uint8 max_lcl_ndi_interfaces; /* max num of local NDI interface */
  11010. uint8 max_peer_entries; /* max num of peer entry */
  11011. uint8 max_ndp_sessions; /* max num of NDP session */
  11012. uint8 max_concurrent_nan_clusters; /* max num of concurrent clusters */
  11013. uint16 max_service_name_len; /* max service name length */
  11014. uint16 max_match_filter_len; /* max match filter length */
  11015. uint16 max_total_match_filter_len; /* max total match filter length */
  11016. uint16 max_service_specific_info_len; /* max service specific info length */
  11017. uint16 max_vsa_data_len; /* max vendor specific attrib data length */
  11018. uint16 max_mesh_data_len; /* max mesh data length */
  11019. uint16 max_app_info_len; /* max app info length */
  11020. uint16 max_sdea_svc_specific_info_len; /* max sdea ser specific info length */
  11021. uint8 max_queued_tx_followup_msgs; /* max no. of queued tx followup msgs */
  11022. uint8 max_subscribe_address; /* max subscribe addresses supported */
  11023. uint8 ndp_supported_bands; /* number of ndp supported bands */
  11024. uint8 is_ndp_security_supported; /* if secure ndp is supported */
  11025. uint8 cipher_suites_supported_mask; /* bitmask for suites supported */
  11026. uint8 pad[3];
  11027. } wl_nan_fw_cap_t;
  11028. /* WL_NAN_XTLV_GEN_FW_CAP_V2 */
  11029. typedef struct wl_nan_fw_cap_v2 {
  11030. uint32 flags1; /* nan sub-features compiled in firmware */
  11031. uint32 flags2; /* for more sub-features in future */
  11032. uint8 max_svc_publishes; /* max num of service publish */
  11033. uint8 max_svc_subscribes; /* max num of service subscribe */
  11034. uint8 max_lcl_sched_maps; /* max num of local schedule map */
  11035. uint8 max_lcl_ndc_entries; /* max num of local NDC entry */
  11036. uint8 max_lcl_ndi_interfaces; /* max num of local NDI interface */
  11037. uint8 max_peer_entries; /* max num of peer entry */
  11038. uint8 max_peer_sched_maps; /* max num of peer schedule maps */
  11039. uint8 max_ndp_sessions; /* max num of NDP session */
  11040. uint32 cipher_suites_supported_mask; /* bitmask for supported cipher suites */
  11041. uint32 reserved_uint32_1; /* reserved for future sub-features */
  11042. uint32 reserved_uint32_2; /* reserved for future sub-features */
  11043. uint32 reserved_uint32_3; /* reserved for future sub-features */
  11044. uint32 reserved_uint32_4; /* reserved for future sub-features */
  11045. } wl_nan_fw_cap_v2_t;
  11046. /* nan cipher suite support mask bits */
  11047. #define WL_NAN_CIPHER_SUITE_SHARED_KEY_128_MASK 0x01
  11048. #define WL_NAN_CIPHER_SUITE_SHARED_KEY_256_MASK 0x02
  11049. /* NAN Save Restore */
  11050. #define WL_NAN_NSR2_INFO_MAX_SIZE 2048 /* arbitrary */
  11051. /* WL_NAN_XTLV_NSR2_PEER */
  11052. typedef struct wl_nan_nsr_peer_info {
  11053. struct ether_addr nmi;
  11054. uint8 l_min_slots; /* local QoS min slots */
  11055. uint8 p_min_slots; /* peer QoS min slots */
  11056. uint16 l_max_latency; /* local QoS max latency */
  11057. uint16 p_max_latency; /* peer QoS max latency */
  11058. uint8 num_map; /* num of NA map */
  11059. uint8 pad;
  11060. uint16 attrs_len; /* total len of following attrs */
  11061. uint8 attrs[]; /* peer attributes (NA/NDC/ULW/DevCap/Element container) */
  11062. } wl_nan_nsr_peer_info_t;
  11063. enum wl_nan_nsr_ndp_flag {
  11064. WL_NAN_NSR_NDP_FLAG_LCL_INITATOR = 0x0001,
  11065. WL_NAN_NSR_NDP_FLAG_MCAST = 0x0002
  11066. };
  11067. typedef uint16 wl_nan_nsr_ndp_flag_t;
  11068. /* WL_NAN_XTLV_NSR2_NDP */
  11069. typedef struct wl_nan_nsr_ndp_info {
  11070. struct ether_addr peer_nmi;
  11071. struct ether_addr peer_ndi;
  11072. struct ether_addr lcl_ndi;
  11073. uint16 flags; /* wl_nan_nsr_ndp_flag_t */
  11074. uint8 pub_id; /* publish id */
  11075. uint8 indp_id; /* initiator's ndp id */
  11076. uint8 last_token; /* last NDP dialog token */
  11077. uint8 pad;
  11078. } wl_nan_nsr_ndp_info_t;
  11079. /* NAN2.0 Ranging definitions */
  11080. /* result indication bit map */
  11081. #define NAN_RANGE_INDICATION_CONT (1<<0)
  11082. #define NAN_RANGE_INDICATION_INGRESS (1<<1)
  11083. #define NAN_RANGE_INDICATION_EGRESS (1<<2)
  11084. /* responder flags */
  11085. #define NAN_RANGE_FLAG_AUTO_ACCEPT (1 << 0)
  11086. #define NAN_RANGE_FLAG_RESULT_REQUIRED (1 << 1)
  11087. typedef struct wl_nan_range_req {
  11088. struct ether_addr peer;
  11089. uint8 publisher_id;
  11090. uint8 indication; /* bit map for result event */
  11091. uint32 resolution; /* default millimeters */
  11092. uint32 ingress; /* ingress limit in mm */
  11093. uint32 egress; /* egress limit in mm */
  11094. uint32 interval; /* max interval(in TU) b/w two ranging measurements */
  11095. } wl_nan_range_req_t;
  11096. #define NAN_RNG_REQ_IOV_LEN 24
  11097. typedef uint8 wl_nan_range_id;
  11098. typedef struct wl_nan_range_resp {
  11099. wl_nan_range_id range_id;
  11100. uint8 flags; /* auto response, range result required */
  11101. uint8 status; /* accept, reject */
  11102. uint8 indication; /* bit map for result event */
  11103. uint32 resolution; /* default millimeters */
  11104. uint32 ingress; /* ingress limit in mm */
  11105. uint32 egress; /* egress limit in mm */
  11106. uint32 interval; /* max interval(in TU) b/w two ranging measurements */
  11107. } wl_nan_range_resp_t;
  11108. #define NAN_RNG_RESP_IOV_LEN 20
  11109. #define NAN_RNG_TERM_FLAG_IMMEDIATE (1u << 0u) /* Do not wait for TXS */
  11110. #define NAN_RNG_TERM_FLAG_SILIENT_TEARDOWN (1u << 1u) /* Do not TX rng_term */
  11111. #define NAN_RNG_TERM_FLAG_EVENT_HOST (1u << 2u) /* Notify event to host */
  11112. #define NAN_RNG_TERM_FLAG_OPT_TLVS (1u << 3u) /* opt tlvs present */
  11113. typedef struct wl_nan_range_cancel_ext {
  11114. wl_nan_range_id range_id;
  11115. uint8 flags;
  11116. uint8 pad[2];
  11117. } wl_nan_range_cancel_ext_t;
  11118. #define NAN_RNG_CANCEL_IOV_FIXED_LEN 4u
  11119. #define NAN_RNG_MAX_IOV_LEN 255
  11120. typedef struct wl_nan_ev_rng_req_ind {
  11121. struct ether_addr peer_m_addr;
  11122. uint8 rng_id;
  11123. /* ftm parameters */
  11124. uint8 max_burst_dur;
  11125. uint8 min_ftm_delta;
  11126. uint8 max_num_ftm;
  11127. uint8 ftm_format_bw;
  11128. /* location info availability bit map */
  11129. uint8 lc_info_avail;
  11130. /* Last movement indication */
  11131. uint16 last_movement;
  11132. uint8 pad[2];
  11133. } wl_nan_ev_rng_req_ind_t;
  11134. #define NAN_RNG_REQ_IND_SIZE 14
  11135. typedef struct wl_nan_ev_rng_rpt_ind {
  11136. uint32 dist_mm; /* in millimeter */
  11137. struct ether_addr peer_m_addr;
  11138. uint8 indication; /* indication definitions mentioned above */
  11139. uint8 rng_id;
  11140. } wl_nan_ev_rng_rpt_ind_t;
  11141. #define NAN_RNG_RPT_IND_SIZE 12
  11142. /* number of continuous ranging crbs which can be idle,
  11143. * after which ranging session will be terminated.
  11144. * Default value is 5. Set to zero for disabling the
  11145. * idle timeout functionality
  11146. */
  11147. typedef uint8 wl_nan_range_idle_count_t;
  11148. /* nan ranging termination reason codes */
  11149. #define NAN_RNG_TERM_IDLE_TIMEOUT 1 /* no ftms from peer */
  11150. #define NAN_RNG_TERM_PEER_REQ 2
  11151. #define NAN_RNG_TERM_USER_REQ 3
  11152. #define NAN_RNG_TERM_RNG_RESP_TIMEOUT 4
  11153. typedef struct wl_nan_ev_rng_term_ind {
  11154. struct ether_addr peer_m_addr;
  11155. uint8 reason_code;
  11156. uint8 rng_id;
  11157. } wl_nan_ev_rng_term_ind_t;
  11158. #define NAN_RNG_TERM_IND_SIZE 8
  11159. typedef struct wl_nan_ev_rng_resp {
  11160. struct ether_addr peer_m_addr;
  11161. uint8 status;
  11162. uint8 rng_id;
  11163. } wl_nan_ev_rng_resp_t;
  11164. /* Used by NDL schedule events -
  11165. * WL_NAN_EVENT_PEER_SCHED_UPD_NOTIF, WL_NAN_EVENT_PEER_SCHED_REQ
  11166. * WL_NAN_EVENT_PEER_SCHED_RESP, WL_NAN_EVENT_PEER_SCHED_CONF
  11167. */
  11168. typedef struct wl_nan_ev_sched_info {
  11169. struct ether_addr peer_nmi;
  11170. uint8 ndl_status; /* applies only to sched resp/conf */
  11171. uint8 pad;
  11172. uint16 opt_tlv_len;
  11173. uint8 opt_tlvs[];
  11174. } wl_nan_ev_sched_info_t;
  11175. /* WL_NAN_EVENT_CHAN_BOUNDARY */
  11176. typedef struct wl_nan_chbound_info {
  11177. uint32 cluster_tsf_h; /* Current Cluster TSF High */
  11178. uint32 cluster_tsf_l; /* Current Cluster TSF Low */
  11179. uint16 cur_chspec;
  11180. uint16 opt_tlvs_len;
  11181. uint8 opt_tlvs[];
  11182. } wl_nan_chbound_info_t;
  11183. /* channel stats (includes nan & non-nan) */
  11184. /* WL_NAN_XTLV_CCA_STATS */
  11185. typedef struct wl_nan_cca_stats {
  11186. uint16 chanspec;
  11187. uint8 pad[2];
  11188. uint32 sample_dur;
  11189. uint32 congest_ibss;
  11190. uint32 congest_obss;
  11191. uint32 interference;
  11192. } wl_nan_cca_stats_t;
  11193. /* WL_NAN_XTLV_PER_STATS */
  11194. typedef struct wl_nan_per_stats_s {
  11195. uint16 chanspec;
  11196. uint8 pad[2];
  11197. uint32 sample_dur;
  11198. uint32 txframe; /* tx data frames */
  11199. uint32 txretrans; /* tx mac retransmits */
  11200. uint32 txerror; /* tx data errors */
  11201. uint32 txctl; /* tx management frames */
  11202. uint32 txserr; /* tx status errors */
  11203. uint32 rxframe; /* rx data frames */
  11204. uint32 rxerror; /* rx data errors */
  11205. uint32 rxctl; /* rx management frames */
  11206. uint32 txbar; /* tx bar */
  11207. uint32 rxbar; /* rx bar */
  11208. uint32 txaction; /* tx action frame */
  11209. uint32 rxaction; /* rx action frame */
  11210. uint32 txlost; /* lost packets reported in txs */
  11211. uint32 rxback; /* rx block ack */
  11212. uint32 txback; /* tx bloak ack */
  11213. } wl_nan_per_stats_t;
  11214. /* fast discovery beacon config
  11215. * WL_NAN_XTLV_CFG_FDISC_TBMP
  11216. */
  11217. typedef struct wl_nan_fastdisc_s {
  11218. uint8 id;
  11219. uint8 bitmap_len;
  11220. uint8 pad[2];
  11221. uint8 bitmap[];
  11222. } wl_nan_fastdisc_t;
  11223. #define WL_NAN_FASTDISC_CFG_SIZE 1024 /* arbitrary */
  11224. /* ********************* end of NAN section ******************************** */
  11225. /* endif WL_NAN */
  11226. #define P2P_NAN_IOC_BUFSZ 512 /* some sufficient ioc buff size */
  11227. #define WL_P2P_NAN_IOCTL_VERSION 0x1
  11228. /* container for p2p nan iovtls & events */
  11229. typedef struct wl_p2p_nan_ioc {
  11230. uint16 version; /* interface command or event version */
  11231. uint16 id; /* p2p nan ioctl cmd ID */
  11232. uint16 len; /* total length of data[] */
  11233. uint16 pad; /* padding */
  11234. uint8 data []; /* var len payload of bcm_xtlv_t type */
  11235. } wl_p2p_nan_ioc_t;
  11236. /* p2p nan cmd IDs */
  11237. enum wl_p2p_nan_cmds {
  11238. /* p2p nan cfg ioctls */
  11239. WL_P2P_NAN_CMD_ENABLE = 1,
  11240. WL_P2P_NAN_CMD_CONFIG = 2,
  11241. WL_P2P_NAN_CMD_DEL_CONFIG = 3,
  11242. WL_P2P_NAN_CMD_GET_INSTS = 4
  11243. };
  11244. #define WL_P2P_NAN_CONFIG_VERSION 1
  11245. #define WL_P2P_NAN_DEVICE_P2P 0x0
  11246. #define WL_P2P_NAN_DEVICE_GO 0x1
  11247. #define WL_P2P_NAN_DEVICE_GC 0x2
  11248. #define WL_P2P_NAN_DEVICE_INVAL 0xFF
  11249. /* NAN P2P operation */
  11250. typedef struct p2p_nan_config {
  11251. uint16 version; /* wl_p2p_nan_config_t structure version */
  11252. uint16 len; /* total length including version and variable IE */
  11253. uint32 flags; /* 0x1 to NEW, 0x2 to ADD, 0x4 to DEL */
  11254. uint8 inst_id; /* publisher/subscriber id */
  11255. uint8 inst_type; /* publisher/subscriber */
  11256. uint8 dev_role; /* P2P device role: 'P2P','GO' or 'GC' */
  11257. uint8 pad1; /* padding */
  11258. uint8 resolution; /* Availability bitmap resolution */
  11259. uint8 repeat; /* Whether Availabilty repeat across DW */
  11260. uint16 ie_len; /* variable ie len */
  11261. struct ether_addr dev_mac; /* P2P device addres */
  11262. uint16 pad2; /* Padding */
  11263. uint32 avail_bmap; /* availability interval bitmap */
  11264. uint32 chanspec; /* Chanspec */
  11265. uint8 ie[]; /* hex ie data */
  11266. } wl_p2p_nan_config_t;
  11267. #define WL_P2P_NAN_SERVICE_LIST_VERSION 1
  11268. typedef enum wl_nan_service_type {
  11269. WL_NAN_SVC_INST_PUBLISHER = 1,
  11270. WL_NAN_SVC_INST_SUBSCRIBER = 2
  11271. } wl_nan_service_type_t;
  11272. #define WL_P2P_NAN_CONFIG_NEW 0x1
  11273. #define WL_P2P_NAN_CONFIG_ADD 0x2
  11274. #define WL_P2P_NAN_CONFIG_DEL 0x4
  11275. typedef struct wl_nan_svc_inst {
  11276. uint8 inst_id; /* publisher/subscriber id */
  11277. uint8 inst_type; /* publisher/subscriber */
  11278. } wl_nan_svc_inst_t;
  11279. typedef struct wl_nan_svc_inst_list {
  11280. uint16 version; /* this structure version */
  11281. uint16 len; /* total length including version and variable svc list */
  11282. uint16 count; /* service instance count */
  11283. uint16 pad; /* padding */
  11284. wl_nan_svc_inst_t svc[1]; /* service instance list */
  11285. } wl_nan_svc_inst_list_t;
  11286. #define NAN_POST_DISC_P2P_DATA_VER 1
  11287. /* This structure will be used send peer p2p data with
  11288. * NAN discovery result
  11289. */
  11290. typedef struct nan_post_disc_p2p_data {
  11291. uint8 ver; /* this structure version */
  11292. uint8 dev_role; /* P2P Device role */
  11293. uint8 resolution; /* Availability bitmap resolution */
  11294. uint8 repeat; /* Whether Availabilty repeat across DW */
  11295. struct ether_addr dev_mac; /* P2P device addres */
  11296. uint16 pad1; /* Padding */
  11297. uint32 chanspec; /* Chanspec */
  11298. uint32 avl_bmp; /* availability interval bitmap */
  11299. } nan_post_disc_p2p_data_t;
  11300. enum {
  11301. WL_AVAIL_NONE = 0x0000,
  11302. WL_AVAIL_LOCAL = 0x0001,
  11303. WL_AVAIL_PEER = 0x0002,
  11304. WL_AVAIL_NDC = 0x0003,
  11305. WL_AVAIL_IMMUTABLE = 0x0004,
  11306. WL_AVAIL_RESPONSE = 0x0005,
  11307. WL_AVAIL_COUNTER = 0x0006,
  11308. WL_AVAIL_RANGING = 0x0007,
  11309. WL_AVAIL_UPD_POT = 0x0008, /* modify potential, keep committed/conditional */
  11310. WL_AVAIL_UPD_COM_COND = 0x0009, /* modify committed/conditional, keep potential */
  11311. WL_AVAIL_REMOVE_MAP = 0x000A, /* remove map */
  11312. WL_AVAIL_FRM_TYPE = 0x000B, /* specify frame types containing NA */
  11313. WL_AVAIL_TYPE_MAX = WL_AVAIL_FRM_TYPE /* New ones before and update */
  11314. };
  11315. #define WL_AVAIL_TYPE_MASK 0x000F
  11316. #define WL_AVAIL_FLAG_REMOVE 0x2000 /* remove schedule attr of given type & map id */
  11317. #define WL_AVAIL_FLAG_SELECTED_NDC 0x4000
  11318. #define WL_AVAIL_FLAG_RAW_MODE 0x8000
  11319. #define WL_AVAIL_FLAGS_MASK 0xFF00
  11320. #define WL_AVAIL_FLAGS_SHIFT 8
  11321. typedef int16 wl_avail_flags_t;
  11322. /* availability entry flags */
  11323. enum {
  11324. WL_AVAIL_ENTRY_NONE = 0x0000,
  11325. WL_AVAIL_ENTRY_COM = 0x0001, /* committed */
  11326. WL_AVAIL_ENTRY_POT = 0x0002, /* potential */
  11327. WL_AVAIL_ENTRY_COND = 0x0004, /* conditional */
  11328. WL_AVAIL_ENTRY_PAGED = 0x0008, /* P-NDL */
  11329. WL_AVAIL_ENTRY_USAGE = 0x0030, /* usage preference */
  11330. WL_AVAIL_ENTRY_BIT_DUR = 0x00C0, /* bit duration */
  11331. WL_AVAIL_ENTRY_BAND_PRESENT = 0x0100, /* band present */
  11332. WL_AVAIL_ENTRY_CHAN_PRESENT = 0x0200, /* channel information present */
  11333. WL_AVAIL_ENTRY_CHAN_ENTRY_PRESENT = 0x0400, /* channel entry (opclass+bitmap) */
  11334. /* free to use 0x0800 */
  11335. WL_AVAIL_ENTRY_RXNSS = 0xF000 /* max num of spatial stream RX */
  11336. };
  11337. /* bit duration */
  11338. enum {
  11339. WL_AVAIL_BIT_DUR_16 = 0, /* 16TU */
  11340. WL_AVAIL_BIT_DUR_32 = 1, /* 32TU */
  11341. WL_AVAIL_BIT_DUR_64 = 2, /* 64TU */
  11342. WL_AVAIL_BIT_DUR_128 = 3, /* 128TU */
  11343. };
  11344. /* period */
  11345. enum {
  11346. WL_AVAIL_PERIOD_0 = 0, /* 0TU */
  11347. WL_AVAIL_PERIOD_128 = 1, /* 128TU */
  11348. WL_AVAIL_PERIOD_256 = 2, /* 256TU */
  11349. WL_AVAIL_PERIOD_512 = 3, /* 512TU */
  11350. WL_AVAIL_PERIOD_1024 = 4, /* 1024TU */
  11351. WL_AVAIL_PERIOD_2048 = 5, /* 2048TU */
  11352. WL_AVAIL_PERIOD_4096 = 6, /* 4096TU */
  11353. WL_AVAIL_PERIOD_8192 = 7, /* 8192TU */
  11354. };
  11355. /* band */
  11356. enum {
  11357. WL_AVAIL_BAND_NONE = 0, /* reserved */
  11358. WL_AVAIL_BAND_SUB1G = 1, /* sub-1 GHz */
  11359. WL_AVAIL_BAND_2G = 2, /* 2.4 GHz */
  11360. WL_AVAIL_BAND_3G = 3, /* reserved (for 3.6 GHz) */
  11361. WL_AVAIL_BAND_5G = 4, /* 4.9 and 5 GHz */
  11362. WL_AVAIL_BAND_60G = 5, /* reserved (for 60 GHz) */
  11363. };
  11364. #define WL_AVAIL_ENTRY_TYPE_MASK 0x000F
  11365. #define WL_AVAIL_ENTRY_USAGE_MASK 0x0030 /* up to 4 usage preferences */
  11366. #define WL_AVAIL_ENTRY_USAGE_SHIFT 4
  11367. #define WL_AVAIL_ENTRY_USAGE_VAL(_flags) (((_flags) & WL_AVAIL_ENTRY_USAGE_MASK) \
  11368. >> WL_AVAIL_ENTRY_USAGE_SHIFT)
  11369. #define WL_AVAIL_ENTRY_BIT_DUR_MASK 0x00C0 /* 0:16TU, 1:32TU, 2:64TU, 3:128TU */
  11370. #define WL_AVAIL_ENTRY_BIT_DUR_SHIFT 6
  11371. #define WL_AVAIL_ENTRY_BIT_DUR_VAL(_flags) (((_flags) & WL_AVAIL_ENTRY_BIT_DUR_MASK) \
  11372. >> WL_AVAIL_ENTRY_BIT_DUR_SHIFT)
  11373. #define WL_AVAIL_ENTRY_BAND_MASK 0x0100 /* 0=band not present, 1=present */
  11374. #define WL_AVAIL_ENTRY_BAND_SHIFT 8
  11375. #define WL_AVAIL_ENTRY_CHAN_MASK 0x0200 /* 0=channel info not present, 1=present */
  11376. #define WL_AVAIL_ENTRY_CHAN_SHIFT 9
  11377. #define WL_AVAIL_ENTRY_CHAN_ENTRY_MASK 0x0400 /* 0=chanspec, 1=hex channel entry */
  11378. #define WL_AVAIL_ENTRY_CHAN_ENTRY_SHIFT 10
  11379. #define WL_AVAIL_ENTRY_RXNSS_MASK 0xF000
  11380. #define WL_AVAIL_ENTRY_RXNSS_SHIFT 12
  11381. #define WL_AVAIL_ENTRY_RXNSS_VAL(_flags) (((_flags) & WL_AVAIL_ENTRY_RXNSS_MASK) \
  11382. >> WL_AVAIL_ENTRY_RXNSS_SHIFT)
  11383. #define WL_AVAIL_ENTRY_RXNSS_MAX 15 /* 0-15 */
  11384. /* mask for channel_entry (to be obsoleted) */
  11385. #define WL_AVAIL_ENTRY_OPCLASS_MASK 0xFF
  11386. #define WL_AVAIL_ENTRY_CHAN_BITMAP_MASK 0xFF00
  11387. #define WL_AVAIL_ENTRY_CHAN_BITMAP_SHIFT 8
  11388. #define WL_AVAIL_ENTRY_CHAN_BITMAP_VAL(_info) (((_info) & WL_AVAIL_ENTRY_CHAN_BITMAP_MASK) \
  11389. >> WL_AVAIL_ENTRY_CHAN_BITMAP_SHIFT)
  11390. /* Used for raw channel entry field input */
  11391. #define MAX_CHAN_ENTRY_LEN 6
  11392. typedef struct wl_avail_entry {
  11393. uint16 length; /* total length */
  11394. uint16 start_offset; /* in TUs, multiply by 16 for total offset */
  11395. union {
  11396. uint32 channel_info; /* either chanspec or hex channel entry (opclass +
  11397. * bitmap per NAN spec), as indicated by setting
  11398. * WL_AVAIL_ENTRY_HEX_CHAN_ENTRY flag
  11399. */
  11400. uint32 band; /* defined by WL_BAND enum, 2=2.4GHz, 4=5GHz */
  11401. uint8 channel_entry[MAX_CHAN_ENTRY_LEN];
  11402. uint8 align[8]; /* aligned len of union in structure (not for use)
  11403. * if member of union is changed,
  11404. * update length of align[] accordingly.
  11405. */
  11406. } u; /* band or channel value, 0=all band/channels */
  11407. uint8 sched_map_id; /* avail map id associated with sched entry */
  11408. uint8 pad;
  11409. uint8 period; /* in TUs, defined by WL_AVAIL_PERIOD enum
  11410. * 1:128, 2:256, 3:512, 4:1024, 5:2048, 6:4096,
  11411. * 7:8192
  11412. */
  11413. uint8 bitmap_len;
  11414. uint16 flags; /* defined by avail entry flags enum:
  11415. * type, usage pref, bit duration, rx nss,
  11416. * and band, channel or channel entry
  11417. */
  11418. uint8 bitmap[]; /* time bitmap */
  11419. } wl_avail_entry_t;
  11420. #define WL_AVAIL_VERSION 1 /* current wl_avail version */
  11421. typedef struct wl_avail {
  11422. uint16 length; /* total length */
  11423. uint16 flags; /* LSB - avail type (defined by WL_AVAIL enum)
  11424. * MSB - avail flags
  11425. */
  11426. uint8 id; /* id used for multiple maps/avail */
  11427. uint8 lndc_id; /* ndc id used in multi-ndc case */
  11428. uint8 version;
  11429. uint8 pad;
  11430. struct ether_addr addr; /* peer mac address or ndc id */
  11431. uint8 num_entries;
  11432. uint8 unused_byte;
  11433. /* add additional fields above this line */
  11434. uint8 entry[];
  11435. } wl_avail_t;
  11436. #define WL_AVAIL_MIN_LEN(n) ((n) ? OFFSETOF(wl_avail_t, entry) + \
  11437. ((n) * OFFSETOF(wl_avail_entry_t, bitmap)) : 0)
  11438. /* unaligned schedule (window) */
  11439. typedef struct wl_avail_ulw {
  11440. uint8 id; /* schedule ID */
  11441. uint8 overwrite; /* bit 0: overwrite all
  11442. * 1-4: map ID if overwrite all is 0
  11443. */
  11444. uint16 flags;
  11445. uint32 start; /* start time of first ULW, in us */
  11446. uint32 dur; /* duration of ULW, in us */
  11447. uint32 period; /* time between consecutive ULWs, in us */
  11448. union {
  11449. uint32 chanspec;
  11450. uint32 band;
  11451. uint8 chan_entry[MAX_CHAN_ENTRY_LEN];
  11452. uint8 pad[8];
  11453. } u;
  11454. uint8 cntdwn; /* remaining ULWs before schedule ends */
  11455. uint8 pad[3];
  11456. } wl_avail_ulw_t;
  11457. /* unset: NAN is not available during ULW, set: NAN is avail depending on ctrl flags */
  11458. #define WL_NAN_ULW_CTRL_PRESENT (1 << 0)
  11459. /* unset: band, set: channel */
  11460. #define WL_NAN_ULW_CTRL_TYPE (1 << 1)
  11461. /* set: NAN is availabile on specified band/channel */
  11462. #define WL_NAN_ULW_CTRL_AVAIL (1 << 2)
  11463. /* channel is provided in raw attribute format */
  11464. #define WL_NAN_ULW_CTRL_RAW_CHAN (1 << 3)
  11465. /* nan wfa testmode operations */
  11466. enum {
  11467. WL_NAN_WFA_TM_IGNORE_TERMINATE_NAF = 0x00000001,
  11468. WL_NAN_WFA_TM_IGNORE_RX_DATA_OUTSIDE_CRB = 0x00000002,
  11469. WL_NAN_WFA_TM_ALLOW_TX_DATA_OUTSIDE_CRB = 0x00000004,
  11470. WL_NAN_WFA_TM_ENFORCE_NDL_COUNTER = 0x00000008,
  11471. WL_NAN_WFA_TM_BYPASS_NDL_PROPOSAL_VALIDATION = 0x00000010,
  11472. /* allow data(pings) tx while ndp sec negotiation */
  11473. WL_NAN_WFA_TM_SEC_SEND_PINGS_BYPASS_NDP_SM = 0x00000020,
  11474. /* generate and insert incorrect mic */
  11475. WL_NAN_WFA_TM_SEC_INCORRECT_MIC = 0x00000040,
  11476. /* send m4 reject deliberately */
  11477. WL_NAN_WFA_TM_SEC_REJECT_STATUS4M4 = 0x00000080,
  11478. /* send mgmt frame (for eg. ndp terminate) in clear txt (bypass security) */
  11479. WL_NAN_WFA_TM_SEC_SEND_MGMT_CLEAR = 0x00000100,
  11480. /* validate qos */
  11481. WL_NAN_WFA_TM_NDL_QOS_VALIDATE = 0x00000200,
  11482. /* firmware generated schedule update */
  11483. WL_NAN_WFA_TM_GEN_SCHED_UPD = 0x00000400,
  11484. /* add lower 4-bytes of TSF to configured start time */
  11485. WL_NAN_WFA_TM_ULW_START_TIME = 0x00000800,
  11486. /* enable schedule validation for SDF */
  11487. WL_NAN_WFA_TM_SDF_SCHED_VALIDATE = 0x00001000,
  11488. /* by pass faw na iovar */
  11489. WL_NAN_WFA_TM_SKIP_RAW_NA_BLOB = 0x00002000,
  11490. /* overwrite local NA with peer NA in received frame */
  11491. WL_NAN_WFA_TM_LOCAL_NA_OVERWRITE = 0x00004000,
  11492. /* randomize and self configure ndl qos(needed at responder in auto mode) */
  11493. WL_NAN_WFA_TM_SELF_CFG_NDL_QOS = 0x00008000,
  11494. /* send NAF frames only in DW */
  11495. WL_NAN_WFA_TM_SEND_NAF_IN_DW = 0x00010000,
  11496. /* restrict channels used for countered slots to Ch 6/149 only */
  11497. WL_NAN_WFA_TM_RESTRICT_COUNTER_SLOTS_CHAN = 0x00020000,
  11498. /* NDPE negative test case (4.2.5 & 4.2.6) */
  11499. WL_NAN_WFA_TM_NDPE_NEGATIVE_TEST_TB = 0x00040000,
  11500. /* Set NDPE(NAN3.0) capable bit in dev cap attr */
  11501. WL_NAN_WFA_TM_ENABLE_NDPE_CAP = 0x00080000,
  11502. /* NDPE negative test case (4.2.5.2). Enable both NDP and NDPE attributes */
  11503. WL_NAN_WFA_TM_ENABLE_NDP_NDPE_ATTR = 0x00100000,
  11504. /* add above & update mask */
  11505. WL_NAN_WFA_TM_FLAG_MASK = 0x001FFFFF
  11506. };
  11507. typedef uint32 wl_nan_wfa_testmode_t;
  11508. /* To be removed; replaced by wl_nan_vndr_payload */
  11509. typedef struct wl_nan_vndr_ie {
  11510. uint32 flags; /* bitmask indicating which packet(s) contain this IE */
  11511. uint16 body_len; /* length of body (does not include oui field) */
  11512. uint8 pad[2];
  11513. uint8 oui[DOT11_OUI_LEN];
  11514. uint8 pad2;
  11515. uint8 body[]; /* vendor IE payload */
  11516. } wl_nan_vndr_ie_t;
  11517. typedef struct wl_nan_vndr_payload {
  11518. uint32 flags; /* bitmask indicating which packet(s) contain payload */
  11519. uint16 payload_len; /* length of payload */
  11520. uint8 pad[2];
  11521. uint8 payload[]; /* payload to be appended to NAN frame */
  11522. } wl_nan_vndr_payload_t;
  11523. typedef struct wl_nan_dev_cap {
  11524. uint8 bands[NAN_MAX_BANDS];
  11525. uint8 awake_dw[NAN_MAX_BANDS];
  11526. uint8 overwrite_mapid[NAN_MAX_BANDS];
  11527. uint8 mapid; /* dev cap mapid */
  11528. uint8 all_maps; /* applies to device */
  11529. uint8 paging;
  11530. uint8 pad[3];
  11531. } wl_nan_dev_cap_t;
  11532. /* arbitrary max len for frame template */
  11533. #define WL_NAN_FRM_TPLT_MAX_LEN 1024
  11534. typedef struct wl_nan_frm_tplt {
  11535. wl_nan_frame_type_t type;
  11536. uint8 pad;
  11537. uint16 len; /* length of template */
  11538. uint8 data[]; /* template */
  11539. } wl_nan_frm_tplt_t;
  11540. #define RSSI_THRESHOLD_SIZE 16
  11541. #define MAX_IMP_RESP_SIZE 256
  11542. typedef struct wl_proxd_rssi_bias {
  11543. int32 version; /**< version */
  11544. int32 threshold[RSSI_THRESHOLD_SIZE]; /**< threshold */
  11545. int32 peak_offset; /**< peak offset */
  11546. int32 bias; /**< rssi bias */
  11547. int32 gd_delta; /**< GD - GD_ADJ */
  11548. int32 imp_resp[MAX_IMP_RESP_SIZE]; /**< (Hi*Hi)+(Hr*Hr) */
  11549. } wl_proxd_rssi_bias_t;
  11550. typedef struct wl_proxd_rssi_bias_avg {
  11551. int32 avg_threshold[RSSI_THRESHOLD_SIZE]; /**< avg threshold */
  11552. int32 avg_peak_offset; /**< avg peak offset */
  11553. int32 avg_rssi; /**< avg rssi */
  11554. int32 avg_bias; /**< avg bias */
  11555. } wl_proxd_rssi_bias_avg_t;
  11556. #include <packed_section_start.h>
  11557. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_collect_info {
  11558. uint16 type; /**< type: 0 channel table, 1 channel smoothing table, 2 and 3 seq */
  11559. uint16 index; /**< The current frame index, from 1 to total_frames. */
  11560. uint16 tof_cmd; /**< M_TOF_CMD */
  11561. uint16 tof_rsp; /**< M_TOF_RSP */
  11562. uint16 tof_avb_rxl; /**< M_TOF_AVB_RX_L */
  11563. uint16 tof_avb_rxh; /**< M_TOF_AVB_RX_H */
  11564. uint16 tof_avb_txl; /**< M_TOF_AVB_TX_L */
  11565. uint16 tof_avb_txh; /**< M_TOF_AVB_TX_H */
  11566. uint16 tof_id; /**< M_TOF_ID */
  11567. uint8 tof_frame_type;
  11568. uint8 tof_frame_bw;
  11569. int8 tof_rssi;
  11570. int32 tof_cfo;
  11571. int32 gd_adj_ns; /**< gound delay */
  11572. int32 gd_h_adj_ns; /**< group delay + threshold crossing */
  11573. int16 nfft; /**< number of samples stored in H */
  11574. uint8 num_max_cores;
  11575. } BWL_POST_PACKED_STRUCT wl_proxd_collect_info_t;
  11576. #include <packed_section_end.h>
  11577. #define K_TOF_COLLECT_H_PAD 1
  11578. #define K_TOF_COLLECT_SC_20MHZ (64)
  11579. /* Maximum possible size of sample capture */
  11580. #define K_TOF_COLLECT_SC_80MHZ (2*K_TOF_COLLECT_SC_20MHZ)
  11581. /* Maximum possible size of channel dump */
  11582. #define K_TOF_COLLECT_CHAN_SIZE (2*K_TOF_COLLECT_SC_80MHZ)
  11583. /*
  11584. A few extra samples are required to estimate frequency offset
  11585. Right now 16 samples are being used. Can be changed in future.
  11586. */
  11587. #define K_TOF_COLLECT_SAMP_SIZE_20MHZ (2*(K_TOF_COLLECT_SC_20MHZ)+16+K_TOF_COLLECT_H_PAD)
  11588. #define K_TOF_COLLECT_RAW_SAMP_SIZE_20MHZ (2*K_TOF_COLLECT_SAMP_SIZE_20MHZ)
  11589. #define K_TOF_COLLECT_H_SIZE_20MHZ (K_TOF_COLLECT_SAMP_SIZE_20MHZ)
  11590. #define K_TOF_COLLECT_HRAW_SIZE_20MHZ (K_TOF_COLLECT_RAW_SAMP_SIZE_20MHZ)
  11591. #define K_TOF_COLLECT_SAMP_SIZE_80MHZ (2*(K_TOF_COLLECT_SC_80MHZ)+16+K_TOF_COLLECT_H_PAD)
  11592. #define K_TOF_COLLECT_RAW_SAMP_SIZE_80MHZ (2*K_TOF_COLLECT_SAMP_SIZE_80MHZ)
  11593. #define K_TOF_COLLECT_H_SIZE_80MHZ (K_TOF_COLLECT_SAMP_SIZE_80MHZ)
  11594. #define K_TOF_COLLECT_HRAW_SIZE_80MHZ (K_TOF_COLLECT_RAW_SAMP_SIZE_80MHZ)
  11595. #define WL_PROXD_COLLECT_DATA_VERSION_1 1
  11596. #include <packed_section_start.h>
  11597. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_collect_data_v1 {
  11598. wl_proxd_collect_info_t info;
  11599. uint8 ri_rr[FTM_TPK_RI_RR_LEN];
  11600. /**< raw data read from phy used to adjust timestamps */
  11601. uint32 H[K_TOF_COLLECT_H_SIZE_20MHZ];
  11602. } BWL_POST_PACKED_STRUCT wl_proxd_collect_data_t_v1;
  11603. #include <packed_section_end.h>
  11604. #define WL_PROXD_COLLECT_DATA_VERSION_2 2
  11605. #include <packed_section_start.h>
  11606. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_collect_data_v2 {
  11607. wl_proxd_collect_info_t info;
  11608. uint8 ri_rr[FTM_TPK_RI_RR_LEN_SECURE_2_0];
  11609. /**< raw data read from phy used to adjust timestamps */
  11610. uint32 H[K_TOF_COLLECT_H_SIZE_20MHZ];
  11611. } BWL_POST_PACKED_STRUCT wl_proxd_collect_data_t_v2;
  11612. #include <packed_section_end.h>
  11613. #define WL_PROXD_COLLECT_DATA_VERSION_3 3
  11614. typedef struct wl_proxd_collect_data_v3 {
  11615. uint16 version;
  11616. uint16 len;
  11617. wl_proxd_collect_info_t info;
  11618. uint8 ri_rr[FTM_TPK_RI_RR_LEN_SECURE_2_0];
  11619. /**< raw data read from phy used to adjust timestamps */
  11620. uint32 H[K_TOF_COLLECT_H_SIZE_20MHZ];
  11621. uint32 chan[4 * K_TOF_COLLECT_CHAN_SIZE];
  11622. } wl_proxd_collect_data_t_v3;
  11623. #define WL_PROXD_COLLECT_DATA_VERSION_MAX WL_PROXD_COLLECT_DATA_VERSION_3
  11624. typedef struct wl_proxd_debug_data {
  11625. uint8 count; /**< number of packets */
  11626. uint8 stage; /**< state machone stage */
  11627. uint8 received; /**< received or txed */
  11628. uint8 paket_type; /**< packet type */
  11629. uint8 category; /**< category field */
  11630. uint8 action; /**< action field */
  11631. uint8 token; /**< token number */
  11632. uint8 follow_token; /**< following token number */
  11633. uint16 index; /**< index of the packet */
  11634. uint16 tof_cmd; /**< M_TOF_CMD */
  11635. uint16 tof_rsp; /**< M_TOF_RSP */
  11636. uint16 tof_avb_rxl; /**< M_TOF_AVB_RX_L */
  11637. uint16 tof_avb_rxh; /**< M_TOF_AVB_RX_H */
  11638. uint16 tof_avb_txl; /**< M_TOF_AVB_TX_L */
  11639. uint16 tof_avb_txh; /**< M_TOF_AVB_TX_H */
  11640. uint16 tof_id; /**< M_TOF_ID */
  11641. uint16 tof_status0; /**< M_TOF_STATUS_0 */
  11642. uint16 tof_status2; /**< M_TOF_STATUS_2 */
  11643. uint16 tof_chsm0; /**< M_TOF_CHNSM_0 */
  11644. uint16 tof_phyctl0; /**< M_TOF_PHYCTL0 */
  11645. uint16 tof_phyctl1; /**< M_TOF_PHYCTL1 */
  11646. uint16 tof_phyctl2; /**< M_TOF_PHYCTL2 */
  11647. uint16 tof_lsig; /**< M_TOF_LSIG */
  11648. uint16 tof_vhta0; /**< M_TOF_VHTA0 */
  11649. uint16 tof_vhta1; /**< M_TOF_VHTA1 */
  11650. uint16 tof_vhta2; /**< M_TOF_VHTA2 */
  11651. uint16 tof_vhtb0; /**< M_TOF_VHTB0 */
  11652. uint16 tof_vhtb1; /**< M_TOF_VHTB1 */
  11653. uint16 tof_apmductl; /**< M_TOF_AMPDU_CTL */
  11654. uint16 tof_apmdudlim; /**< M_TOF_AMPDU_DLIM */
  11655. uint16 tof_apmdulen; /**< M_TOF_AMPDU_LEN */
  11656. } wl_proxd_debug_data_t;
  11657. /** version of the wl_wsec_info structure */
  11658. #define WL_WSEC_INFO_VERSION 0x01
  11659. /** start enum value for BSS properties */
  11660. #define WL_WSEC_INFO_BSS_BASE 0x0100
  11661. /** size of len and type fields of wl_wsec_info_tlv_t struct */
  11662. #define WL_WSEC_INFO_TLV_HDR_LEN OFFSETOF(wl_wsec_info_tlv_t, data)
  11663. /** Allowed wl_wsec_info properties; not all of them may be supported. */
  11664. typedef enum {
  11665. WL_WSEC_INFO_NONE = 0,
  11666. WL_WSEC_INFO_MAX_KEYS = 1,
  11667. WL_WSEC_INFO_NUM_KEYS = 2,
  11668. WL_WSEC_INFO_NUM_HW_KEYS = 3,
  11669. WL_WSEC_INFO_MAX_KEY_IDX = 4,
  11670. WL_WSEC_INFO_NUM_REPLAY_CNTRS = 5,
  11671. WL_WSEC_INFO_SUPPORTED_ALGOS = 6,
  11672. WL_WSEC_INFO_MAX_KEY_LEN = 7,
  11673. WL_WSEC_INFO_FLAGS = 8,
  11674. /* add global/per-wlc properties above */
  11675. WL_WSEC_INFO_BSS_FLAGS = (WL_WSEC_INFO_BSS_BASE + 1),
  11676. WL_WSEC_INFO_BSS_WSEC = (WL_WSEC_INFO_BSS_BASE + 2),
  11677. WL_WSEC_INFO_BSS_TX_KEY_ID = (WL_WSEC_INFO_BSS_BASE + 3),
  11678. WL_WSEC_INFO_BSS_ALGO = (WL_WSEC_INFO_BSS_BASE + 4),
  11679. WL_WSEC_INFO_BSS_KEY_LEN = (WL_WSEC_INFO_BSS_BASE + 5),
  11680. WL_WSEC_INFO_BSS_ALGOS = (WL_WSEC_INFO_BSS_BASE + 6),
  11681. /* add per-BSS properties above */
  11682. WL_WSEC_INFO_MAX = 0xffff
  11683. } wl_wsec_info_type_t;
  11684. typedef struct {
  11685. uint32 algos; /* set algos to be enabled/disabled */
  11686. uint32 mask; /* algos outside mask unaltered */
  11687. } wl_wsec_info_algos_t;
  11688. /** tlv used to return wl_wsec_info properties */
  11689. typedef struct {
  11690. uint16 type;
  11691. uint16 len; /**< data length */
  11692. uint8 data[1]; /**< data follows */
  11693. } wl_wsec_info_tlv_t;
  11694. /** input/output data type for wsec_info iovar */
  11695. typedef struct wl_wsec_info {
  11696. uint8 version; /**< structure version */
  11697. uint8 pad[2];
  11698. uint8 num_tlvs;
  11699. wl_wsec_info_tlv_t tlvs[1]; /**< tlv data follows */
  11700. } wl_wsec_info_t;
  11701. /*
  11702. * randmac definitions
  11703. */
  11704. #define WL_RANDMAC_MODULE "randmac"
  11705. #define WL_RANDMAC_API_VERSION 0x0100 /**< version 1.0 */
  11706. #define WL_RANDMAC_API_MIN_VERSION 0x0100 /**< version 1.0 */
  11707. /** subcommands that can apply to randmac */
  11708. enum {
  11709. WL_RANDMAC_SUBCMD_NONE = 0,
  11710. WL_RANDMAC_SUBCMD_GET_VERSION = 1,
  11711. WL_RANDMAC_SUBCMD_ENABLE = 2,
  11712. WL_RANDMAC_SUBCMD_DISABLE = 3,
  11713. WL_RANDMAC_SUBCMD_CONFIG = 4,
  11714. WL_RANDMAC_SUBCMD_STATS = 5,
  11715. WL_RANDMAC_SUBCMD_CLEAR_STATS = 6,
  11716. WL_RANDMAC_SUBCMD_MAX
  11717. };
  11718. typedef int16 wl_randmac_subcmd_t;
  11719. /* Common IOVAR struct */
  11720. typedef struct wl_randmac {
  11721. uint16 version;
  11722. uint16 len; /* total length */
  11723. wl_randmac_subcmd_t subcmd_id; /* subcommand id */
  11724. uint8 data[0]; /* subcommand data */
  11725. } wl_randmac_t;
  11726. #define WL_RANDMAC_IOV_HDR_SIZE OFFSETOF(wl_randmac_t, data)
  11727. /* randmac version subcommand */
  11728. typedef struct wl_randmac_version {
  11729. uint16 version; /* Randmac method version info */
  11730. uint8 pad[2]; /* Align on 4 byte boundary */
  11731. } wl_randmac_version_t;
  11732. /*
  11733. * Bitmask for methods supporting MAC randomization feature
  11734. */
  11735. #define WL_RANDMAC_USER_NONE 0x0000
  11736. #define WL_RANDMAC_USER_FTM 0x0001
  11737. #define WL_RANDMAC_USER_NAN 0x0002
  11738. #define WL_RANDMAC_USER_SCAN 0x0004
  11739. #define WL_RANDMAC_USER_ANQP 0x0008
  11740. #define WL_RANDMAC_USER_ALL 0xFFFF
  11741. typedef uint16 wl_randmac_method_t;
  11742. enum {
  11743. WL_RANDMAC_FLAGS_NONE = 0x00,
  11744. WL_RANDMAC_FLAGS_ADDR = 0x01,
  11745. WL_RANDMAC_FLAGS_MASK = 0x02,
  11746. WL_RANDMAC_FLAGS_METHOD = 0x04,
  11747. WL_RANDMAC_FLAGS_ALL = 0xFF
  11748. };
  11749. typedef uint8 wl_randmac_flags_t;
  11750. /* randmac statistics subcommand */
  11751. typedef struct wl_randmac_stats {
  11752. uint32 set_ok; /* Set random addr success count */
  11753. uint32 set_fail; /* Set random addr failed count */
  11754. uint32 set_reqs; /* Set random addr count */
  11755. uint32 reset_reqs; /* Restore random addr count */
  11756. uint32 restore_ok; /* Restore random addr succes count */
  11757. uint32 restore_fail; /* Restore random addr failed count */
  11758. uint32 events_sent; /* randmac module events count */
  11759. uint32 events_rcvd; /* randmac events received count */
  11760. } wl_randmac_stats_t;
  11761. /* randmac config subcommand */
  11762. typedef struct wl_randmac_config {
  11763. struct ether_addr addr; /* Randomized MAC address */
  11764. struct ether_addr addr_mask; /* bitmask for randomization */
  11765. wl_randmac_method_t method; /* Enabled methods */
  11766. wl_randmac_flags_t flags; /* What config info changed */
  11767. uint8 PAD;
  11768. } wl_randmac_config_t;
  11769. enum {
  11770. WL_RANDMAC_EVENT_NONE = 0, /**< not an event, reserved */
  11771. WL_RANDMAC_EVENT_BSSCFG_ADDR_SET = 1, /* bsscfg addr randomized */
  11772. WL_RANDMAC_EVENT_BSSCFG_ADDR_RESTORE = 2, /* bsscfg addr restored */
  11773. WL_RANDMAC_EVENT_ENABLED = 3, /* randmac module enabled */
  11774. WL_RANDMAC_EVENT_DISABLE = 4, /* randmac module disabled */
  11775. WL_RANDMAC_EVENT_BSSCFG_STATUS = 5, /* bsscfg enable/disable */
  11776. WL_RANDMAC_EVENT_MAX
  11777. };
  11778. typedef int16 wl_randmac_event_type_t;
  11779. typedef int32 wl_randmac_status_t;
  11780. typedef uint32 wl_randmac_event_mask_t;
  11781. #define WL_RANDMAC_EVENT_MASK_ALL 0xfffffffe
  11782. #define WL_RANDMAC_EVENT_MASK_EVENT(_event_type) (1 << (_event_type))
  11783. #define WL_RANDMAC_EVENT_ENABLED(_mask, _event_type) (\
  11784. ((_mask) & WL_RANDMAC_EVENT_MASK_EVENT(_event_type)) != 0)
  11785. /** tlv IDs - data length 4 bytes unless overridden by type, alignment 32 bits */
  11786. enum {
  11787. WL_RANDMAC_TLV_NONE = 0,
  11788. WL_RANDMAC_TLV_METHOD = 1,
  11789. WL_RANDMAC_TLV_ADDR = 2,
  11790. WL_RANDMAC_TLV_MASK = 3
  11791. };
  11792. typedef uint16 wl_randmac_tlv_id_t;
  11793. typedef struct wl_randmac_tlv {
  11794. wl_randmac_tlv_id_t id;
  11795. uint16 len; /* Length of variable */
  11796. uint8 data[1];
  11797. } wl_randmac_tlv_t;
  11798. /** randmac event */
  11799. typedef struct wl_randmac_event {
  11800. uint16 version;
  11801. uint16 len; /* Length of all variables */
  11802. wl_randmac_event_type_t type;
  11803. wl_randmac_method_t method;
  11804. uint8 pad[2];
  11805. wl_randmac_tlv_t tlvs[1]; /**< variable */
  11806. } wl_randmac_event_t;
  11807. /*
  11808. * scan MAC definitions
  11809. */
  11810. /** common iovar struct */
  11811. typedef struct wl_scanmac {
  11812. uint16 subcmd_id; /**< subcommand id */
  11813. uint16 len; /**< total length of data[] */
  11814. uint8 data[]; /**< subcommand data */
  11815. } wl_scanmac_t;
  11816. /* subcommand ids */
  11817. #define WL_SCANMAC_SUBCMD_ENABLE 0
  11818. #define WL_SCANMAC_SUBCMD_BSSCFG 1 /**< only GET supported */
  11819. #define WL_SCANMAC_SUBCMD_CONFIG 2
  11820. /** scanmac enable data struct */
  11821. typedef struct wl_scanmac_enable {
  11822. uint8 enable; /**< 1 - enable, 0 - disable */
  11823. uint8 pad[3]; /**< 4-byte struct alignment */
  11824. } wl_scanmac_enable_t;
  11825. /** scanmac bsscfg data struct */
  11826. typedef struct wl_scanmac_bsscfg {
  11827. uint32 bsscfg; /**< bsscfg index */
  11828. } wl_scanmac_bsscfg_t;
  11829. /** scanmac config data struct */
  11830. typedef struct wl_scanmac_config {
  11831. struct ether_addr mac; /**< 6 bytes of MAC address or MAC prefix (i.e. OUI) */
  11832. struct ether_addr random_mask; /**< randomized bits on each scan */
  11833. uint16 scan_bitmap; /**< scans to use this MAC address */
  11834. uint8 pad[2]; /**< 4-byte struct alignment */
  11835. } wl_scanmac_config_t;
  11836. /* scan bitmap */
  11837. #define WL_SCANMAC_SCAN_UNASSOC (0x01 << 0) /**< unassociated scans */
  11838. #define WL_SCANMAC_SCAN_ASSOC_ROAM (0x01 << 1) /**< associated roam scans */
  11839. #define WL_SCANMAC_SCAN_ASSOC_PNO (0x01 << 2) /**< associated PNO scans */
  11840. #define WL_SCANMAC_SCAN_ASSOC_HOST (0x01 << 3) /**< associated host scans */
  11841. #define WL_SCAN_EVENT_VERSION 1
  11842. #define WL_SCAN_TYPE_ASSOC 0x1 /* Assoc scan */
  11843. #define WL_SCAN_TYPE_ROAM 0x2 /* Roam scan */
  11844. #define WL_SCAN_TYPE_FWSCAN 0x4 /* Other FW scan */
  11845. #define WL_SCAN_TYPE_HOSTSCAN 0x8 /* Host scan */
  11846. typedef struct scan_event_data {
  11847. uint32 version;
  11848. uint32 flags;
  11849. uint16 num_chan_slice0;
  11850. uint16 num_chan_slice1;
  11851. /* Will contain num_chan_slice0 followed by num_chan_slice1 chanspecs */
  11852. chanspec_t scan_chan_list[];
  11853. } scan_event_data_t;
  11854. /*
  11855. * bonjour dongle offload definitions
  11856. */
  11857. /* common iovar struct */
  11858. typedef struct wl_bdo {
  11859. uint16 subcmd_id; /* subcommand id */
  11860. uint16 len; /* total length of data[] */
  11861. uint8 data[]; /* subcommand data */
  11862. } wl_bdo_t;
  11863. /* subcommand ids */
  11864. #define WL_BDO_SUBCMD_DOWNLOAD 0 /* Download flattened database */
  11865. #define WL_BDO_SUBCMD_ENABLE 1 /* Start bonjour after download */
  11866. #define WL_BDO_SUBCMD_MAX_DOWNLOAD 2 /* Get the max download size */
  11867. /* maximum fragment size */
  11868. #define BDO_MAX_FRAGMENT_SIZE 1024
  11869. /* download flattened database
  11870. *
  11871. * BDO must be disabled before database download else fail.
  11872. *
  11873. * If database size is within BDO_MAX_FRAGMENT_SIZE then only a single fragment
  11874. * is required (i.e. frag_num = 0, total_size = frag_size).
  11875. * If database size exceeds BDO_MAX_FRAGMENT_SIZE then multiple fragments are required.
  11876. */
  11877. typedef struct wl_bdo_download {
  11878. uint16 total_size; /* total database size */
  11879. uint16 frag_num; /* fragment number, 0 for first fragment, N-1 for last fragment */
  11880. uint16 frag_size; /* size of fragment (max BDO_MAX_FRAGMENT_SIZE) */
  11881. uint8 pad[2]; /* 4-byte struct alignment */
  11882. uint8 fragment[BDO_MAX_FRAGMENT_SIZE]; /* fragment data */
  11883. } wl_bdo_download_t;
  11884. /* enable
  11885. *
  11886. * Enable requires a downloaded database else fail.
  11887. */
  11888. typedef struct wl_bdo_enable {
  11889. uint8 enable; /* 1 - enable, 0 - disable */
  11890. uint8 pad[3]; /* 4-byte struct alignment */
  11891. } wl_bdo_enable_t;
  11892. /*
  11893. * Get the max download size for Bonjour Offload.
  11894. */
  11895. typedef struct wl_bdo_max_download {
  11896. uint16 size; /* Max download size in bytes */
  11897. uint8 pad[2]; /* 4-byte struct alignment */
  11898. } wl_bdo_max_download_t;
  11899. /*
  11900. * TCP keepalive offload definitions
  11901. */
  11902. /* common iovar struct */
  11903. typedef struct wl_tko {
  11904. uint16 subcmd_id; /* subcommand id */
  11905. uint16 len; /* total length of data[] */
  11906. uint8 data[]; /* subcommand data */
  11907. } wl_tko_t;
  11908. /* subcommand ids */
  11909. #define WL_TKO_SUBCMD_MAX_TCP 0 /* max TCP connections supported */
  11910. #define WL_TKO_SUBCMD_PARAM 1 /* configure offload common parameters */
  11911. #define WL_TKO_SUBCMD_CONNECT 2 /* TCP connection info */
  11912. #define WL_TKO_SUBCMD_ENABLE 3 /* enable/disable */
  11913. #define WL_TKO_SUBCMD_STATUS 4 /* TCP connection status */
  11914. /* WL_TKO_SUBCMD_MAX_CONNECT subcommand data */
  11915. typedef struct wl_tko_max_tcp {
  11916. uint8 max; /* max TCP connections supported */
  11917. uint8 pad[3]; /* 4-byte struct alignment */
  11918. } wl_tko_max_tcp_t;
  11919. /* WL_TKO_SUBCMD_PARAM subcommand data */
  11920. typedef struct wl_tko_param {
  11921. uint16 interval; /* keepalive tx interval (secs) */
  11922. uint16 retry_interval; /* keepalive retry interval (secs) */
  11923. uint16 retry_count; /* retry_count */
  11924. uint8 pad[2]; /* 4-byte struct alignment */
  11925. } wl_tko_param_t;
  11926. /* WL_TKO_SUBCMD_CONNECT subcommand data
  11927. * invoke with unique 'index' for each TCP connection
  11928. */
  11929. typedef struct wl_tko_connect {
  11930. uint8 index; /* TCP connection index, 0 to max-1 */
  11931. uint8 ip_addr_type; /* 0 - IPv4, 1 - IPv6 */
  11932. uint16 local_port; /* local port */
  11933. uint16 remote_port; /* remote port */
  11934. uint16 PAD;
  11935. uint32 local_seq; /* local sequence number */
  11936. uint32 remote_seq; /* remote sequence number */
  11937. uint16 request_len; /* TCP keepalive request packet length */
  11938. uint16 response_len; /* TCP keepalive response packet length */
  11939. uint8 data[]; /* variable length field containing local/remote IPv4/IPv6,
  11940. * TCP keepalive request packet, TCP keepalive response packet
  11941. * For IPv4, length is 4 * 2 + request_length + response_length
  11942. * offset 0 - local IPv4
  11943. * offset 4 - remote IPv4
  11944. * offset 8 - TCP keepalive request packet
  11945. * offset 8+request_length - TCP keepalive response packet
  11946. * For IPv6, length is 16 * 2 + request_length + response_length
  11947. * offset 0 - local IPv6
  11948. * offset 16 - remote IPv6
  11949. * offset 32 - TCP keepalive request packet
  11950. * offset 32+request_length - TCP keepalive response packet
  11951. */
  11952. } wl_tko_connect_t;
  11953. /* WL_TKO_SUBCMD_CONNECT subcommand data to GET configured info for specific index */
  11954. typedef struct wl_tko_get_connect {
  11955. uint8 index; /* TCP connection index, 0 to max-1 */
  11956. uint8 pad[3]; /* 4-byte struct alignment */
  11957. } wl_tko_get_connect_t;
  11958. typedef struct wl_tko_enable {
  11959. uint8 enable; /* 1 - enable, 0 - disable */
  11960. uint8 pad[3]; /* 4-byte struct alignment */
  11961. } wl_tko_enable_t;
  11962. /* WL_TKO_SUBCMD_STATUS subcommand data */
  11963. /* must be invoked before tko is disabled else status is unavailable */
  11964. typedef struct wl_tko_status {
  11965. uint8 count; /* number of status entries (i.e. equals
  11966. * max TCP connections supported)
  11967. */
  11968. uint8 status[1]; /* variable length field contain status for
  11969. * each TCP connection index
  11970. */
  11971. } wl_tko_status_t;
  11972. typedef enum {
  11973. TKO_STATUS_NORMAL = 0, /* TCP connection normal, no error */
  11974. TKO_STATUS_NO_RESPONSE = 1, /* no response to TCP keepalive */
  11975. TKO_STATUS_NO_TCP_ACK_FLAG = 2, /* TCP ACK flag not set */
  11976. TKO_STATUS_UNEXPECT_TCP_FLAG = 3, /* unexpect TCP flags set other than ACK */
  11977. TKO_STATUS_SEQ_NUM_INVALID = 4, /* ACK != sequence number */
  11978. TKO_STATUS_REMOTE_SEQ_NUM_INVALID = 5, /* SEQ > remote sequence number */
  11979. TKO_STATUS_TCP_DATA = 6, /* TCP data available */
  11980. TKO_STATUS_UNAVAILABLE = 255, /* not used/configured */
  11981. } tko_status_t;
  11982. enum rssi_reason {
  11983. RSSI_REASON_UNKNOW = 0,
  11984. RSSI_REASON_LOWRSSI = 1,
  11985. RSSI_REASON_NSYC = 2,
  11986. RSSI_REASON_TIMEOUT = 3
  11987. };
  11988. enum tof_reason {
  11989. TOF_REASON_OK = 0,
  11990. TOF_REASON_REQEND = 1,
  11991. TOF_REASON_TIMEOUT = 2,
  11992. TOF_REASON_NOACK = 3,
  11993. TOF_REASON_INVALIDAVB = 4,
  11994. TOF_REASON_INITIAL = 5,
  11995. TOF_REASON_ABORT = 6
  11996. };
  11997. enum rssi_state {
  11998. RSSI_STATE_POLL = 0,
  11999. RSSI_STATE_TPAIRING = 1,
  12000. RSSI_STATE_IPAIRING = 2,
  12001. RSSI_STATE_THANDSHAKE = 3,
  12002. RSSI_STATE_IHANDSHAKE = 4,
  12003. RSSI_STATE_CONFIRMED = 5,
  12004. RSSI_STATE_PIPELINE = 6,
  12005. RSSI_STATE_NEGMODE = 7,
  12006. RSSI_STATE_MONITOR = 8,
  12007. RSSI_STATE_LAST = 9
  12008. };
  12009. enum tof_state {
  12010. TOF_STATE_IDLE = 0,
  12011. TOF_STATE_IWAITM = 1,
  12012. TOF_STATE_TWAITM = 2,
  12013. TOF_STATE_ILEGACY = 3,
  12014. TOF_STATE_IWAITCL = 4,
  12015. TOF_STATE_TWAITCL = 5,
  12016. TOF_STATE_ICONFIRM = 6,
  12017. TOF_STATE_IREPORT = 7
  12018. };
  12019. enum tof_mode_type {
  12020. TOF_LEGACY_UNKNOWN = 0,
  12021. TOF_LEGACY_AP = 1,
  12022. TOF_NONLEGACY_AP = 2
  12023. };
  12024. enum tof_way_type {
  12025. TOF_TYPE_ONE_WAY = 0,
  12026. TOF_TYPE_TWO_WAY = 1,
  12027. TOF_TYPE_REPORT = 2
  12028. };
  12029. enum tof_rate_type {
  12030. TOF_FRAME_RATE_VHT = 0,
  12031. TOF_FRAME_RATE_LEGACY = 1
  12032. };
  12033. #define TOF_ADJ_TYPE_NUM 4 /**< number of assisted timestamp adjustment */
  12034. enum tof_adj_mode {
  12035. TOF_ADJ_SOFTWARE = 0,
  12036. TOF_ADJ_HARDWARE = 1,
  12037. TOF_ADJ_SEQ = 2,
  12038. TOF_ADJ_NONE = 3
  12039. };
  12040. #define FRAME_TYPE_NUM 4 /**< number of frame type */
  12041. enum frame_type {
  12042. FRAME_TYPE_CCK = 0,
  12043. FRAME_TYPE_OFDM = 1,
  12044. FRAME_TYPE_11N = 2,
  12045. FRAME_TYPE_11AC = 3
  12046. };
  12047. typedef struct wl_proxd_status_iovar {
  12048. uint16 method; /**< method */
  12049. uint8 mode; /**< mode */
  12050. uint8 peermode; /**< peer mode */
  12051. uint8 state; /**< state */
  12052. uint8 reason; /**< reason code */
  12053. uint8 PAD[2];
  12054. uint32 distance; /**< distance */
  12055. uint32 txcnt; /**< tx pkt counter */
  12056. uint32 rxcnt; /**< rx pkt counter */
  12057. struct ether_addr peer; /**< peer mac address */
  12058. int8 avg_rssi; /**< average rssi */
  12059. int8 hi_rssi; /**< highest rssi */
  12060. int8 low_rssi; /**< lowest rssi */
  12061. uint8 PAD[3];
  12062. uint32 dbgstatus; /**< debug status */
  12063. uint16 frame_type_cnt[FRAME_TYPE_NUM]; /**< frame types */
  12064. uint8 adj_type_cnt[TOF_ADJ_TYPE_NUM]; /**< adj types HW/SW */
  12065. } wl_proxd_status_iovar_t;
  12066. /* ifdef NET_DETECT */
  12067. typedef struct net_detect_adapter_features {
  12068. uint8 wowl_enabled;
  12069. uint8 net_detect_enabled;
  12070. uint8 nlo_enabled;
  12071. } net_detect_adapter_features_t;
  12072. typedef enum net_detect_bss_type {
  12073. nd_bss_any = 0,
  12074. nd_ibss,
  12075. nd_ess
  12076. } net_detect_bss_type_t;
  12077. typedef struct net_detect_profile {
  12078. wlc_ssid_t ssid;
  12079. net_detect_bss_type_t bss_type; /**< Ignore for now since Phase 1 is only for ESS */
  12080. uint32 cipher_type; /**< DOT11_CIPHER_ALGORITHM enumeration values */
  12081. uint32 auth_type; /**< DOT11_AUTH_ALGORITHM enumeration values */
  12082. } net_detect_profile_t;
  12083. typedef struct net_detect_profile_list {
  12084. uint32 num_nd_profiles;
  12085. net_detect_profile_t nd_profile[];
  12086. } net_detect_profile_list_t;
  12087. typedef struct net_detect_config {
  12088. uint8 nd_enabled;
  12089. uint8 PAD[3];
  12090. uint32 scan_interval;
  12091. uint32 wait_period;
  12092. uint8 wake_if_connected;
  12093. uint8 wake_if_disconnected;
  12094. uint8 PAD[2];
  12095. net_detect_profile_list_t nd_profile_list;
  12096. } net_detect_config_t;
  12097. typedef enum net_detect_wake_reason {
  12098. nd_reason_unknown,
  12099. nd_net_detected,
  12100. nd_wowl_event,
  12101. nd_ucode_error
  12102. } net_detect_wake_reason_t;
  12103. typedef struct net_detect_wake_data {
  12104. net_detect_wake_reason_t nd_wake_reason;
  12105. uint32 nd_wake_date_length;
  12106. uint8 nd_wake_data[0]; /**< Wake data (currently unused) */
  12107. } net_detect_wake_data_t;
  12108. /* endif NET_DETECT */
  12109. /* (unversioned, deprecated) */
  12110. typedef struct bcnreq {
  12111. uint8 bcn_mode;
  12112. uint8 PAD[3];
  12113. int32 dur;
  12114. int32 channel;
  12115. struct ether_addr da;
  12116. uint16 random_int;
  12117. wlc_ssid_t ssid;
  12118. uint16 reps;
  12119. uint8 PAD[2];
  12120. } bcnreq_t;
  12121. #define WL_RRM_BCN_REQ_VER 1
  12122. typedef struct bcn_req {
  12123. uint8 version;
  12124. uint8 bcn_mode;
  12125. uint8 pad_1[2];
  12126. int32 dur;
  12127. int32 channel;
  12128. struct ether_addr da;
  12129. uint16 random_int;
  12130. wlc_ssid_t ssid;
  12131. uint16 reps;
  12132. uint8 req_elements;
  12133. uint8 pad_2;
  12134. chanspec_list_t chspec_list;
  12135. } bcn_req_t;
  12136. typedef struct rrmreq {
  12137. struct ether_addr da;
  12138. uint8 reg;
  12139. uint8 chan;
  12140. uint16 random_int;
  12141. uint16 dur;
  12142. uint16 reps;
  12143. } rrmreq_t;
  12144. typedef struct framereq {
  12145. struct ether_addr da;
  12146. uint8 reg;
  12147. uint8 chan;
  12148. uint16 random_int;
  12149. uint16 dur;
  12150. struct ether_addr ta;
  12151. uint16 reps;
  12152. } framereq_t;
  12153. typedef struct statreq {
  12154. struct ether_addr da;
  12155. struct ether_addr peer;
  12156. uint16 random_int;
  12157. uint16 dur;
  12158. uint8 group_id;
  12159. uint8 PAD;
  12160. uint16 reps;
  12161. } statreq_t;
  12162. typedef struct txstrmreq {
  12163. struct ether_addr da; /* Destination address */
  12164. uint16 random_int; /* Random interval for measurement start */
  12165. uint16 dur; /* Measurement duration */
  12166. uint16 reps; /* number of repetitions */
  12167. struct ether_addr peer; /* Peer MAC address */
  12168. uint8 tid; /* Traffic ID */
  12169. uint8 bin0_range; /* Delay range of the first bin */
  12170. } txstrmreq_t;
  12171. typedef struct lcireq {
  12172. struct ether_addr da; /* Destination address */
  12173. uint16 reps; /* number of repetitions */
  12174. uint8 subj; /* Local/Remote/Thid party */
  12175. uint8 lat_res; /* Latitude requested Resolution */
  12176. uint8 lon_res; /* Longitude requested Resolution */
  12177. uint8 alt_res; /* Altitude requested Resolution */
  12178. } lcireq_t;
  12179. typedef struct civicreq {
  12180. struct ether_addr da; /* Destination address */
  12181. uint16 reps; /* number of repetitions */
  12182. uint8 subj; /* Local/Remote/Thid party */
  12183. uint8 civloc_type; /* Format of location info */
  12184. uint8 siu; /* Unit of Location service interval */
  12185. uint8 pad;
  12186. uint16 si; /* Location service interval */
  12187. } civicreq_t;
  12188. typedef struct locidreq {
  12189. struct ether_addr da; /* Destination address */
  12190. uint16 reps; /* number of repetitions */
  12191. uint8 subj; /* Local/Remote/Thid party */
  12192. uint8 siu; /* Unit of Location service interval */
  12193. uint16 si; /* Location service interval */
  12194. } locidreq_t;
  12195. typedef struct wl_rrm_config_ioc {
  12196. uint16 version; /* command version */
  12197. uint16 id; /* subiovar cmd ID */
  12198. uint16 len; /* total length of all bytes in data[] */
  12199. uint16 pad; /* 4-byte boundary padding */
  12200. uint8 data[1]; /* payload */
  12201. } wl_rrm_config_ioc_t;
  12202. enum {
  12203. WL_RRM_CONFIG_NONE = 0, /* reserved */
  12204. WL_RRM_CONFIG_GET_LCI = 1, /* get LCI */
  12205. WL_RRM_CONFIG_SET_LCI = 2, /* set LCI */
  12206. WL_RRM_CONFIG_GET_CIVIC = 3, /* get civic location */
  12207. WL_RRM_CONFIG_SET_CIVIC = 4, /* set civic location */
  12208. WL_RRM_CONFIG_GET_LOCID = 5, /* get location identifier */
  12209. WL_RRM_CONFIG_SET_LOCID = 6, /* set location identifier */
  12210. WL_RRM_CONFIG_MAX = 7
  12211. };
  12212. #define WL_RRM_CONFIG_NAME "rrm_config"
  12213. #define WL_RRM_CONFIG_MIN_LENGTH OFFSETOF(wl_rrm_config_ioc_t, data)
  12214. enum {
  12215. WL_RRM_EVENT_NONE = 0, /* not an event, reserved */
  12216. WL_RRM_EVENT_FRNG_REQ = 1, /* Receipt of FRNG request frame */
  12217. WL_RRM_EVENT_FRNG_REP = 2, /* Receipt of FRNG report frame */
  12218. WL_RRM_EVENT_MAX
  12219. };
  12220. typedef int16 wl_rrm_event_type_t;
  12221. typedef struct frngreq_target {
  12222. uint32 bssid_info;
  12223. uint8 channel;
  12224. uint8 phytype;
  12225. uint8 reg;
  12226. uint8 pad;
  12227. struct ether_addr bssid;
  12228. chanspec_t chanspec;
  12229. uint32 sid;
  12230. } frngreq_target_t;
  12231. typedef struct frngreq {
  12232. wl_rrm_event_type_t event; /* RRM event type */
  12233. struct ether_addr da;
  12234. uint16 max_init_delay; /* Upper bound of random delay, in TUs */
  12235. uint8 min_ap_count; /* Min FTM ranges requested (1-15) */
  12236. uint8 num_aps; /* Number of APs to range, at least min_ap_count */
  12237. uint16 max_age; /* Max elapsed time before FTM request, 0xFFFF = any */
  12238. uint16 reps; /* Number of repetitions of this measurement type */
  12239. frngreq_target_t targets[1]; /* Target BSSIDs to range */
  12240. } frngreq_t;
  12241. typedef struct frngrep_range {
  12242. uint32 start_tsf; /* 4 lsb of tsf */
  12243. struct ether_addr bssid;
  12244. uint8 pad[2];
  12245. uint32 range;
  12246. uint32 max_err;
  12247. uint8 rsvd;
  12248. uint8 pad2[3];
  12249. } frngrep_range_t;
  12250. typedef struct frngrep_error {
  12251. uint32 start_tsf; /* 4 lsb of tsf */
  12252. struct ether_addr bssid;
  12253. uint8 code;
  12254. uint8 pad[1];
  12255. } frngrep_error_t;
  12256. typedef struct frngrep {
  12257. wl_rrm_event_type_t event; /* RRM event type */
  12258. struct ether_addr da;
  12259. uint8 range_entry_count;
  12260. uint8 error_entry_count;
  12261. uint16 dialog_token; /* dialog token */
  12262. frngrep_range_t range_entries[DOT11_FTM_RANGE_ENTRY_MAX_COUNT];
  12263. frngrep_error_t error_entries[DOT11_FTM_RANGE_ERROR_ENTRY_MAX_COUNT];
  12264. } frngrep_t;
  12265. typedef struct wl_rrm_frng_ioc {
  12266. uint16 version; /* command version */
  12267. uint16 id; /* subiovar cmd ID */
  12268. uint16 len; /* total length of all bytes in data[] */
  12269. uint16 pad; /* 4-byte boundary padding */
  12270. uint8 data[]; /* payload */
  12271. } wl_rrm_frng_ioc_t;
  12272. enum {
  12273. WL_RRM_FRNG_NONE = 0, /* reserved */
  12274. WL_RRM_FRNG_SET_REQ = 1, /* send ftm ranging request */
  12275. WL_RRM_FRNG_MAX = 2
  12276. };
  12277. #define WL_RRM_FRNG_NAME "rrm_frng"
  12278. #define WL_RRM_FRNG_MIN_LENGTH OFFSETOF(wl_rrm_frng_ioc_t, data)
  12279. #define WL_RRM_RPT_VER 0
  12280. #define WL_RRM_RPT_MAX_PAYLOAD 256
  12281. #define WL_RRM_RPT_MIN_PAYLOAD 7
  12282. #define WL_RRM_RPT_FALG_ERR 0
  12283. #define WL_RRM_RPT_FALG_GRP_ID_PROPR (1 << 0)
  12284. #define WL_RRM_RPT_FALG_GRP_ID_0 (1 << 1)
  12285. typedef struct {
  12286. uint16 ver; /**< version */
  12287. struct ether_addr addr; /**< STA MAC addr */
  12288. uint32 timestamp; /**< timestamp of the report */
  12289. uint16 flag; /**< flag */
  12290. uint16 len; /**< length of payload data */
  12291. uint8 data[WL_RRM_RPT_MAX_PAYLOAD];
  12292. } statrpt_t;
  12293. typedef struct wlc_dwds_config {
  12294. uint32 enable;
  12295. uint32 mode; /**< STA/AP interface */
  12296. struct ether_addr ea;
  12297. uint8 PAD[2];
  12298. } wlc_dwds_config_t;
  12299. typedef struct wl_el_set_params_s {
  12300. uint8 set; /**< Set number */
  12301. uint8 PAD[3];
  12302. uint32 size; /**< Size to make/expand */
  12303. } wl_el_set_params_t;
  12304. typedef struct wl_el_tag_params_s {
  12305. uint16 tag;
  12306. uint8 set;
  12307. uint8 flags;
  12308. } wl_el_tag_params_t;
  12309. #define EVENT_LOG_SET_TYPE_CURRENT_VERSION 0
  12310. typedef struct wl_el_set_type_s {
  12311. uint16 version;
  12312. uint16 len;
  12313. uint8 set; /* Set number */
  12314. uint8 type; /* Type- EVENT_LOG_SET_TYPE_DEFAULT or EVENT_LOG_SET_TYPE_PRSRV */
  12315. uint16 PAD;
  12316. } wl_el_set_type_t;
  12317. typedef struct wl_staprio_cfg {
  12318. struct ether_addr ea; /**< mac addr */
  12319. uint8 prio; /**< scb priority */
  12320. } wl_staprio_cfg_t;
  12321. #define STAMON_STACONFIG_VER 1
  12322. /* size of struct wlc_stamon_sta_config_t elements */
  12323. #define STAMON_STACONFIG_LENGTH 20
  12324. typedef enum wl_stamon_cfg_cmd_type {
  12325. STAMON_CFG_CMD_DEL = 0,
  12326. STAMON_CFG_CMD_ADD = 1,
  12327. STAMON_CFG_CMD_ENB = 2,
  12328. STAMON_CFG_CMD_DSB = 3,
  12329. STAMON_CFG_CMD_CNT = 4,
  12330. STAMON_CFG_CMD_RSTCNT = 5,
  12331. STAMON_CFG_CMD_GET_STATS = 6,
  12332. STAMON_CFG_CMD_SET_MONTIME = 7
  12333. } wl_stamon_cfg_cmd_type_t;
  12334. typedef struct wlc_stamon_sta_config {
  12335. wl_stamon_cfg_cmd_type_t cmd; /**< 0 - delete, 1 - add */
  12336. struct ether_addr ea;
  12337. uint16 version; /* Command structure version */
  12338. uint16 length; /* Command structure length */
  12339. uint8 pad[2];
  12340. /* Time (ms) for which STA's are monitored. Value ZERO indicates no time limit */
  12341. uint32 monitor_time;
  12342. } wlc_stamon_sta_config_t;
  12343. /* ifdef SR_DEBUG */
  12344. typedef struct /* pmu_reg */{
  12345. uint32 pmu_control;
  12346. uint32 pmu_capabilities;
  12347. uint32 pmu_status;
  12348. uint32 res_state;
  12349. uint32 res_pending;
  12350. uint32 pmu_timer1;
  12351. uint32 min_res_mask;
  12352. uint32 max_res_mask;
  12353. uint32 pmu_chipcontrol1[4];
  12354. uint32 pmu_regcontrol[5];
  12355. uint32 pmu_pllcontrol[5];
  12356. uint32 pmu_rsrc_up_down_timer[31];
  12357. uint32 rsrc_dep_mask[31];
  12358. } pmu_reg_t;
  12359. /* endif SR_DEBUG */
  12360. typedef struct wl_taf_define {
  12361. struct ether_addr ea; /**< STA MAC or 0xFF... */
  12362. uint16 version; /**< version */
  12363. uint32 sch; /**< method index */
  12364. uint32 prio; /**< priority */
  12365. uint32 misc; /**< used for return value */
  12366. uint8 text[]; /**< used to pass and return ascii text */
  12367. } wl_taf_define_t;
  12368. /** Received Beacons lengths information */
  12369. #define WL_LAST_BCNS_INFO_FIXED_LEN OFFSETOF(wlc_bcn_len_hist_t, bcnlen_ring)
  12370. typedef struct wlc_bcn_len_hist {
  12371. uint16 ver; /**< version field */
  12372. uint16 cur_index; /**< current pointed index in ring buffer */
  12373. uint32 max_bcnlen; /**< Max beacon length received */
  12374. uint32 min_bcnlen; /**< Min beacon length received */
  12375. uint32 ringbuff_len; /**< Length of the ring buffer 'bcnlen_ring' */
  12376. uint32 bcnlen_ring[1]; /**< ring buffer storing received beacon lengths */
  12377. } wlc_bcn_len_hist_t;
  12378. /* WDS net interface types */
  12379. #define WL_WDSIFTYPE_NONE 0x0 /**< The interface type is neither WDS nor DWDS. */
  12380. #define WL_WDSIFTYPE_WDS 0x1 /**< The interface is WDS type. */
  12381. #define WL_WDSIFTYPE_DWDS 0x2 /**< The interface is DWDS type. */
  12382. typedef struct wl_bssload_static {
  12383. uint8 is_static;
  12384. uint8 PAD;
  12385. uint16 sta_count;
  12386. uint8 chan_util;
  12387. uint8 PAD;
  12388. uint16 aac;
  12389. } wl_bssload_static_t;
  12390. /* Buffer of size WLC_SAMPLECOLLECT_MAXLEN (=10240 for 4345a0 ACPHY)
  12391. * gets copied to this, multiple times
  12392. */
  12393. typedef enum wl_gpaio_option {
  12394. GPAIO_PMU_AFELDO,
  12395. GPAIO_PMU_TXLDO,
  12396. GPAIO_PMU_VCOLDO,
  12397. GPAIO_PMU_LNALDO,
  12398. GPAIO_PMU_ADCLDO,
  12399. GPAIO_ICTAT_CAL,
  12400. GPAIO_PMU_CLEAR,
  12401. GPAIO_OFF,
  12402. GPAIO_PMU_LOGENLDO,
  12403. GPAIO_PMU_RXLDO2G,
  12404. GPAIO_PMU_RXLDO5G,
  12405. GPAIO_PMU_LPFTXLDO,
  12406. GPAIO_PMU_LDO1P6,
  12407. GPAIO_RCAL,
  12408. GPAIO_IQDAC_BUF_DC_MEAS,
  12409. GPAIO_IQDAC_BUF_DC_CLEAR,
  12410. GPAIO_DAC_IQ_DC_RDBK,
  12411. GPAIO_DAC_IQ_DC_RDBK_CLEAR,
  12412. GPAIO_AFE_LDO_FOR_DAC_DC,
  12413. GPAIO_PA5G_VCAS_SOURCE,
  12414. GPAIO_BIQ2_DC_MEAS,
  12415. GPAIO_BIQ2_DC_CLEAR,
  12416. GPAIO_VBATMONITOR,
  12417. GPAIO_PA5G_VCAS_GMDRAIN
  12418. } wl_gpaio_option_t;
  12419. /** IO Var Operations - the Value of iov_op In wlc_ap_doiovar */
  12420. typedef enum wlc_ap_iov_bss_operation {
  12421. WLC_AP_IOV_OP_DELETE = -1,
  12422. WLC_AP_IOV_OP_DISABLE = 0,
  12423. WLC_AP_IOV_OP_ENABLE = 1,
  12424. WLC_AP_IOV_OP_MANUAL_AP_BSSCFG_CREATE = 2,
  12425. WLC_AP_IOV_OP_MANUAL_STA_BSSCFG_CREATE = 3,
  12426. WLC_AP_IOV_OP_MOVE = 4
  12427. } wlc_ap_iov_bss_oper_t;
  12428. /* LTE coex info */
  12429. /* Analogue of HCI Set MWS Signaling cmd */
  12430. typedef struct {
  12431. int16 mws_rx_assert_offset;
  12432. int16 mws_rx_assert_jitter;
  12433. int16 mws_rx_deassert_offset;
  12434. int16 mws_rx_deassert_jitter;
  12435. int16 mws_tx_assert_offset;
  12436. int16 mws_tx_assert_jitter;
  12437. int16 mws_tx_deassert_offset;
  12438. int16 mws_tx_deassert_jitter;
  12439. int16 mws_pattern_assert_offset;
  12440. int16 mws_pattern_assert_jitter;
  12441. int16 mws_inact_dur_assert_offset;
  12442. int16 mws_inact_dur_assert_jitter;
  12443. int16 mws_scan_freq_assert_offset;
  12444. int16 mws_scan_freq_assert_jitter;
  12445. int16 mws_prio_assert_offset_req;
  12446. } wci2_config_t;
  12447. /** Analogue of HCI MWS Channel Params */
  12448. typedef struct {
  12449. uint16 mws_rx_center_freq; /**< MHz */
  12450. uint16 mws_tx_center_freq;
  12451. uint16 mws_rx_channel_bw; /**< KHz */
  12452. uint16 mws_tx_channel_bw;
  12453. uint8 mws_channel_en;
  12454. uint8 mws_channel_type; /**< Don't care for WLAN? */
  12455. } mws_params_t;
  12456. #define LTECX_MAX_NUM_PERIOD_TYPES 7
  12457. /* LTE Frame params */
  12458. typedef struct {
  12459. uint16 mws_frame_dur;
  12460. int16 mws_framesync_assert_offset;
  12461. uint16 mws_framesync_assert_jitter;
  12462. uint16 mws_period_dur[LTECX_MAX_NUM_PERIOD_TYPES];
  12463. uint8 mws_period_type[LTECX_MAX_NUM_PERIOD_TYPES];
  12464. uint8 mws_num_periods;
  12465. } mws_frame_config_t;
  12466. /** MWS wci2 message */
  12467. typedef struct {
  12468. uint8 mws_wci2_data; /**< BT-SIG msg */
  12469. uint8 PAD;
  12470. uint16 mws_wci2_interval; /**< Interval in us */
  12471. uint16 mws_wci2_repeat; /**< No of msgs to send */
  12472. } mws_wci2_msg_t;
  12473. /* MWS ANT map */
  12474. typedef struct {
  12475. uint16 combo1; /* mws ant selection 1 */
  12476. uint16 combo2; /* mws ant selection 2 */
  12477. uint16 combo3; /* mws ant selection 3 */
  12478. uint16 combo4; /* mws ant selection 4 */
  12479. } mws_ant_map_t;
  12480. /* MWS ANT map 2nd generation */
  12481. typedef struct {
  12482. uint16 combo[16]; /* mws ant selection 2nd */
  12483. } mws_ant_map_t_2nd;
  12484. /* MWS SCAN_REQ Bitmap */
  12485. typedef struct mws_scanreq_params {
  12486. uint16 idx;
  12487. uint16 bm_2g;
  12488. uint16 bm_5g_lo;
  12489. uint16 bm_5g_mid;
  12490. uint16 bm_5g_hi;
  12491. } mws_scanreq_params_t;
  12492. typedef struct {
  12493. uint32 config; /**< MODE: AUTO (-1), Disable (0), Enable (1) */
  12494. uint32 status; /**< Current state: Disabled (0), Enabled (1) */
  12495. } wl_config_t;
  12496. #define WLC_RSDB_MODE_AUTO_MASK 0x80
  12497. #define WLC_RSDB_EXTRACT_MODE(val) ((int8)((val) & (~(WLC_RSDB_MODE_AUTO_MASK))))
  12498. typedef struct {
  12499. uint16 request; /* type of sensor hub request */
  12500. uint16 enable; /* enable/disable response for specified request */
  12501. uint16 interval; /* interval between responses to the request */
  12502. } shub_req_t;
  12503. #define WL_IF_STATS_T_VERSION 1 /**< current version of wl_if_stats structure */
  12504. /** per interface counters */
  12505. typedef struct wl_if_stats {
  12506. uint16 version; /**< version of the structure */
  12507. uint16 length; /**< length of the entire structure */
  12508. uint32 PAD; /**< padding */
  12509. /* transmit stat counters */
  12510. uint64 txframe; /**< tx data frames */
  12511. uint64 txbyte; /**< tx data bytes */
  12512. uint64 txerror; /**< tx data errors (derived: sum of others) */
  12513. uint64 txnobuf; /**< tx out of buffer errors */
  12514. uint64 txrunt; /**< tx runt frames */
  12515. uint64 txfail; /**< tx failed frames */
  12516. uint64 txretry; /**< tx retry frames */
  12517. uint64 txretrie; /**< tx multiple retry frames */
  12518. uint64 txfrmsnt; /**< tx sent frames */
  12519. uint64 txmulti; /**< tx mulitcast sent frames */
  12520. uint64 txfrag; /**< tx fragments sent */
  12521. /* receive stat counters */
  12522. uint64 rxframe; /**< rx data frames */
  12523. uint64 rxbyte; /**< rx data bytes */
  12524. uint64 rxerror; /**< rx data errors (derived: sum of others) */
  12525. uint64 rxnobuf; /**< rx out of buffer errors */
  12526. uint64 rxrunt; /**< rx runt frames */
  12527. uint64 rxfragerr; /**< rx fragment errors */
  12528. uint64 rxmulti; /**< rx multicast frames */
  12529. uint64 txexptime; /* DATA Tx frames suppressed due to timer expiration */
  12530. uint64 txrts; /* RTS/CTS succeeeded count */
  12531. uint64 txnocts; /* RTS/CTS faled count */
  12532. uint64 txretrans; /* Number of frame retransmissions */
  12533. }
  12534. wl_if_stats_t;
  12535. typedef struct wl_band {
  12536. uint16 bandtype; /**< WL_BAND_2G, WL_BAND_5G */
  12537. uint16 bandunit; /**< bandstate[] index */
  12538. uint16 phytype; /**< phytype */
  12539. uint16 phyrev;
  12540. }
  12541. wl_band_t;
  12542. #define WL_ROAM_STATS_VER_1 (1u) /**< current version of wl_if_stats structure */
  12543. /** roam statistics counters */
  12544. typedef struct {
  12545. uint16 version; /**< version of the structure */
  12546. uint16 length; /**< length of the entire structure */
  12547. uint32 initial_assoc_time;
  12548. uint32 prev_roam_time;
  12549. uint32 last_roam_event_type;
  12550. uint32 last_roam_event_status;
  12551. uint32 last_roam_event_reason;
  12552. uint16 roam_success_cnt;
  12553. uint16 roam_fail_cnt;
  12554. uint16 roam_attempt_cnt;
  12555. uint16 max_roam_target_cnt;
  12556. uint16 min_roam_target_cnt;
  12557. uint16 max_cached_ch_cnt;
  12558. uint16 min_cached_ch_cnt;
  12559. uint16 partial_roam_scan_cnt;
  12560. uint16 full_roam_scan_cnt;
  12561. uint16 most_roam_reason;
  12562. uint16 most_roam_reason_cnt;
  12563. } wl_roam_stats_v1_t;
  12564. #define WL_WLC_VERSION_T_VERSION 1 /**< current version of wlc_version structure */
  12565. /** wlc interface version */
  12566. typedef struct wl_wlc_version {
  12567. uint16 version; /**< version of the structure */
  12568. uint16 length; /**< length of the entire structure */
  12569. /* epi version numbers */
  12570. uint16 epi_ver_major; /**< epi major version number */
  12571. uint16 epi_ver_minor; /**< epi minor version number */
  12572. uint16 epi_rc_num; /**< epi RC number */
  12573. uint16 epi_incr_num; /**< epi increment number */
  12574. /* wlc interface version numbers */
  12575. uint16 wlc_ver_major; /**< wlc interface major version number */
  12576. uint16 wlc_ver_minor; /**< wlc interface minor version number */
  12577. }
  12578. wl_wlc_version_t;
  12579. #define WL_SCAN_VERSION_T_VERSION 1 /**< current version of scan_version structure */
  12580. /** scan interface version */
  12581. typedef struct wl_scan_version {
  12582. uint16 version; /**< version of the structure */
  12583. uint16 length; /**< length of the entire structure */
  12584. /* scan interface version numbers */
  12585. uint16 scan_ver_major; /**< scan interface major version number */
  12586. } wl_scan_version_t;
  12587. /* Highest version of WLC_API_VERSION supported */
  12588. #define WLC_API_VERSION_MAJOR_MAX 8
  12589. #define WLC_API_VERSION_MINOR_MAX 0
  12590. /* begin proxd definitions */
  12591. #include <packed_section_start.h>
  12592. #define WL_PROXD_API_VERSION 0x0300 /**< version 3.0 */
  12593. /** Minimum supported API version */
  12594. #define WL_PROXD_API_MIN_VERSION 0x0300
  12595. /** proximity detection methods */
  12596. enum {
  12597. WL_PROXD_METHOD_NONE = 0,
  12598. WL_PROXD_METHOD_RSVD1 = 1, /**< backward compatibility - RSSI, not supported */
  12599. WL_PROXD_METHOD_TOF = 2,
  12600. WL_PROXD_METHOD_RSVD2 = 3, /**< 11v only - if needed */
  12601. WL_PROXD_METHOD_FTM = 4, /**< IEEE rev mc/2014 */
  12602. WL_PROXD_METHOD_MAX
  12603. };
  12604. typedef int16 wl_proxd_method_t;
  12605. /** global and method configuration flags */
  12606. enum {
  12607. WL_PROXD_FLAG_NONE = 0x00000000,
  12608. WL_PROXD_FLAG_RX_ENABLED = 0x00000001, /**< respond to requests, per bss */
  12609. WL_PROXD_FLAG_RX_RANGE_REQ = 0x00000002, /**< 11mc range requests enabled */
  12610. WL_PROXD_FLAG_TX_LCI = 0x00000004, /**< tx lci, if known */
  12611. WL_PROXD_FLAG_TX_CIVIC = 0x00000008, /**< tx civic, if known */
  12612. WL_PROXD_FLAG_RX_AUTO_BURST = 0x00000010, /**< auto respond w/o host action */
  12613. WL_PROXD_FLAG_TX_AUTO_BURST = 0x00000020, /**< continue tx w/o host action */
  12614. WL_PROXD_FLAG_AVAIL_PUBLISH = 0x00000040, /**< publish availability */
  12615. WL_PROXD_FLAG_AVAIL_SCHEDULE = 0x00000080, /**< schedule using availability */
  12616. WL_PROXD_FLAG_ASAP_CAPABLE = 0x00000100, /* ASAP capable */
  12617. WL_PROXD_FLAG_MBURST_FOLLOWUP = 0x00000200, /* new multi-burst algorithm */
  12618. WL_PROXD_FLAG_SECURE = 0x00000400, /* per bsscfg option */
  12619. WL_PROXD_FLAG_NO_TSF_SYNC = 0x00000800, /* disable tsf sync */
  12620. WL_PROXD_FLAG_ALL = 0xffffffff
  12621. };
  12622. typedef uint32 wl_proxd_flags_t;
  12623. #define WL_PROXD_FLAGS_AVAIL (WL_PROXD_FLAG_AVAIL_PUBLISH | \
  12624. WL_PROXD_FLAG_AVAIL_SCHEDULE)
  12625. /** session flags */
  12626. enum {
  12627. WL_PROXD_SESSION_FLAG_NONE = 0x00000000, /**< no flags */
  12628. WL_PROXD_SESSION_FLAG_INITIATOR = 0x00000001, /**< local device is initiator */
  12629. WL_PROXD_SESSION_FLAG_TARGET = 0x00000002, /**< local device is target */
  12630. WL_PROXD_SESSION_FLAG_ONE_WAY = 0x00000004, /**< (initiated) 1-way rtt */
  12631. WL_PROXD_SESSION_FLAG_AUTO_BURST = 0x00000008, /**< created w/ rx_auto_burst */
  12632. WL_PROXD_SESSION_FLAG_PERSIST = 0x00000010, /**< good until cancelled */
  12633. WL_PROXD_SESSION_FLAG_RTT_DETAIL = 0x00000020, /**< rtt detail in results */
  12634. WL_PROXD_SESSION_FLAG_SECURE = 0x00000040, /**< sessionis secure */
  12635. WL_PROXD_SESSION_FLAG_AOA = 0x00000080, /**< AOA along w/ RTT */
  12636. WL_PROXD_SESSION_FLAG_RX_AUTO_BURST = 0x00000100, /**< Same as proxd flags above */
  12637. WL_PROXD_SESSION_FLAG_TX_AUTO_BURST = 0x00000200, /**< Same as proxd flags above */
  12638. WL_PROXD_SESSION_FLAG_NAN_BSS = 0x00000400, /**< Use NAN BSS, if applicable */
  12639. WL_PROXD_SESSION_FLAG_TS1 = 0x00000800, /**< e.g. FTM1 - ASAP-capable */
  12640. WL_PROXD_SESSION_FLAG_REPORT_FAILURE = 0x00002000, /**< report failure to target */
  12641. WL_PROXD_SESSION_FLAG_INITIATOR_RPT = 0x00004000, /**< report distance to target */
  12642. WL_PROXD_SESSION_FLAG_NOCHANSWT = 0x00008000,
  12643. WL_PROXD_SESSION_FLAG_NETRUAL = 0x00010000, /**< netrual mode */
  12644. WL_PROXD_SESSION_FLAG_SEQ_EN = 0x00020000, /**< Toast */
  12645. WL_PROXD_SESSION_FLAG_NO_PARAM_OVRD = 0x00040000, /**< no param override from target */
  12646. WL_PROXD_SESSION_FLAG_ASAP = 0x00080000, /**< ASAP session */
  12647. WL_PROXD_SESSION_FLAG_REQ_LCI = 0x00100000, /**< transmit LCI req */
  12648. WL_PROXD_SESSION_FLAG_REQ_CIV = 0x00200000, /**< transmit civic loc req */
  12649. WL_PROXD_SESSION_FLAG_PRE_SCAN = 0x00400000, /* enable pre-scan for asap=1 */
  12650. WL_PROXD_SESSION_FLAG_AUTO_VHTACK = 0x00800000, /* use vhtack based on brcm ie */
  12651. WL_PROXD_SESSION_FLAG_VHTACK = 0x01000000, /* vht ack is in use - output only */
  12652. WL_PROXD_SESSION_FLAG_BDUR_NOPREF = 0x02000000, /* burst-duration: no preference */
  12653. WL_PROXD_SESSION_FLAG_NUM_FTM_NOPREF = 0x04000000, /* num of FTM frames: no preference */
  12654. WL_PROXD_SESSION_FLAG_FTM_SEP_NOPREF = 0x08000000, /* time btw FTM frams: no pref */
  12655. WL_PROXD_SESSION_FLAG_NUM_BURST_NOPREF = 0x10000000, /* num of bursts: no pref */
  12656. WL_PROXD_SESSION_FLAG_BURST_PERIOD_NOPREF = 0x20000000, /* burst period: no pref */
  12657. WL_PROXD_SESSION_FLAG_MBURST_FOLLOWUP = 0x40000000, /* new mburst algo - reserved */
  12658. WL_PROXD_SESSION_FLAG_MBURST_NODELAY = 0x80000000, /**< good until cancelled */
  12659. WL_PROXD_SESSION_FLAG_ALL = 0xffffffff
  12660. };
  12661. typedef uint32 wl_proxd_session_flags_t;
  12662. /** time units - mc supports up to 0.1ns resolution */
  12663. enum {
  12664. WL_PROXD_TMU_TU = 0, /**< 1024us */
  12665. WL_PROXD_TMU_SEC = 1,
  12666. WL_PROXD_TMU_MILLI_SEC = 2,
  12667. WL_PROXD_TMU_MICRO_SEC = 3,
  12668. WL_PROXD_TMU_NANO_SEC = 4,
  12669. WL_PROXD_TMU_PICO_SEC = 5
  12670. };
  12671. typedef int16 wl_proxd_tmu_t;
  12672. /** time interval e.g. 10ns */
  12673. typedef struct wl_proxd_intvl {
  12674. uint32 intvl;
  12675. wl_proxd_tmu_t tmu;
  12676. uint8 pad[2];
  12677. } wl_proxd_intvl_t;
  12678. /** commands that can apply to proxd, method or a session */
  12679. enum {
  12680. WL_PROXD_CMD_NONE = 0,
  12681. WL_PROXD_CMD_GET_VERSION = 1,
  12682. WL_PROXD_CMD_ENABLE = 2,
  12683. WL_PROXD_CMD_DISABLE = 3,
  12684. WL_PROXD_CMD_CONFIG = 4,
  12685. WL_PROXD_CMD_START_SESSION = 5,
  12686. WL_PROXD_CMD_BURST_REQUEST = 6,
  12687. WL_PROXD_CMD_STOP_SESSION = 7,
  12688. WL_PROXD_CMD_DELETE_SESSION = 8,
  12689. WL_PROXD_CMD_GET_RESULT = 9,
  12690. WL_PROXD_CMD_GET_INFO = 10,
  12691. WL_PROXD_CMD_GET_STATUS = 11,
  12692. WL_PROXD_CMD_GET_SESSIONS = 12,
  12693. WL_PROXD_CMD_GET_COUNTERS = 13,
  12694. WL_PROXD_CMD_CLEAR_COUNTERS = 14,
  12695. WL_PROXD_CMD_COLLECT = 15, /* not supported, see 'wl proxd_collect' */
  12696. WL_PROXD_CMD_TUNE = 16, /* not supported, see 'wl proxd_tune' */
  12697. WL_PROXD_CMD_DUMP = 17,
  12698. WL_PROXD_CMD_START_RANGING = 18,
  12699. WL_PROXD_CMD_STOP_RANGING = 19,
  12700. WL_PROXD_CMD_GET_RANGING_INFO = 20,
  12701. WL_PROXD_CMD_IS_TLV_SUPPORTED = 21,
  12702. WL_PROXD_CMD_MAX
  12703. };
  12704. typedef int16 wl_proxd_cmd_t;
  12705. /* session ids:
  12706. * id 0 is reserved
  12707. * ids 1..0x7fff - allocated by host/app
  12708. * 0x8000-0xffff - allocated by firmware, used for auto/rx
  12709. */
  12710. enum {
  12711. WL_PROXD_SESSION_ID_GLOBAL = 0
  12712. };
  12713. /* Externally allocated sids */
  12714. #define WL_PROXD_SID_EXT_MAX 0x7fff
  12715. #define WL_PROXD_SID_EXT_ALLOC(_sid) ((_sid) > 0 && (_sid) <= WL_PROXD_SID_EXT_MAX)
  12716. /* block size for reserved sid blocks */
  12717. #define WL_PROXD_SID_EXT_BLKSZ 256
  12718. #define WL_PROXD_SID_EXT_BLK_START(_i) (WL_PROXD_SID_EXT_MAX - (_i) * WL_PROXD_SID_EXT_BLKSZ + 1)
  12719. #define WL_PROXD_SID_EXT_BLK_END(_start) ((_start) + WL_PROXD_SID_EXT_BLKSZ - 1)
  12720. /* rrm block */
  12721. #define WL_PROXD_SID_RRM_START WL_PROXD_SID_EXT_BLK_START(1)
  12722. #define WL_PROXD_SID_RRM_END WL_PROXD_SID_EXT_BLK_END(WL_PROXD_SID_RRM_START)
  12723. /* nan block */
  12724. #define WL_PROXD_SID_NAN_START WL_PROXD_SID_EXT_BLK_START(2)
  12725. #define WL_PROXD_SID_NAN_END WL_PROXD_SID_EXT_BLK_END(WL_PROXD_SID_NAN_START)
  12726. /** maximum number sessions that can be allocated, may be less if tunable */
  12727. #define WL_PROXD_MAX_SESSIONS 16
  12728. typedef uint16 wl_proxd_session_id_t;
  12729. /* Use WL_PROXD_E_* errorcodes from this file if BCMUTILS_ERR_CODES not defined */
  12730. #ifndef BCMUTILS_ERR_CODES
  12731. /** status - TBD BCME_ vs proxd status - range reserved for BCME_ */
  12732. enum {
  12733. WL_PROXD_E_LAST = -1056,
  12734. WL_PROXD_E_NOAVAIL = -1056,
  12735. WL_PROXD_E_EXT_SCHED = -1055,
  12736. WL_PROXD_E_NOT_BCM = -1054,
  12737. WL_PROXD_E_FRAME_TYPE = -1053,
  12738. WL_PROXD_E_VERNOSUPPORT = -1052,
  12739. WL_PROXD_E_SEC_NOKEY = -1051,
  12740. WL_PROXD_E_SEC_POLICY = -1050,
  12741. WL_PROXD_E_SCAN_INPROCESS = -1049,
  12742. WL_PROXD_E_BAD_PARTIAL_TSF = -1048,
  12743. WL_PROXD_E_SCANFAIL = -1047,
  12744. WL_PROXD_E_NOTSF = -1046,
  12745. WL_PROXD_E_POLICY = -1045,
  12746. WL_PROXD_E_INCOMPLETE = -1044,
  12747. WL_PROXD_E_OVERRIDDEN = -1043,
  12748. WL_PROXD_E_ASAP_FAILED = -1042,
  12749. WL_PROXD_E_NOTSTARTED = -1041,
  12750. WL_PROXD_E_INVALIDMEAS = -1040,
  12751. WL_PROXD_E_INCAPABLE = -1039,
  12752. WL_PROXD_E_MISMATCH = -1038,
  12753. WL_PROXD_E_DUP_SESSION = -1037,
  12754. WL_PROXD_E_REMOTE_FAIL = -1036,
  12755. WL_PROXD_E_REMOTE_INCAPABLE = -1035,
  12756. WL_PROXD_E_SCHED_FAIL = -1034,
  12757. WL_PROXD_E_PROTO = -1033,
  12758. WL_PROXD_E_EXPIRED = -1032,
  12759. WL_PROXD_E_TIMEOUT = -1031,
  12760. WL_PROXD_E_NOACK = -1030,
  12761. WL_PROXD_E_DEFERRED = -1029,
  12762. WL_PROXD_E_INVALID_SID = -1028,
  12763. WL_PROXD_E_REMOTE_CANCEL = -1027,
  12764. WL_PROXD_E_CANCELED = -1026, /**< local */
  12765. WL_PROXD_E_INVALID_SESSION = -1025,
  12766. WL_PROXD_E_BAD_STATE = -1024,
  12767. WL_PROXD_E_START = -1024,
  12768. WL_PROXD_E_ERROR = -1,
  12769. WL_PROXD_E_OK = 0
  12770. };
  12771. typedef int32 wl_proxd_status_t;
  12772. #endif /* BCMUTILS_ERR_CODES */
  12773. /* proxd errors from phy */
  12774. #define PROXD_TOF_INIT_ERR_BITS 16
  12775. enum {
  12776. WL_PROXD_PHY_ERR_LB_CORR_THRESH = (1 << 0), /* Loopback Correlation threshold */
  12777. WL_PROXD_PHY_ERR_RX_CORR_THRESH = (1 << 1), /* Received Correlation threshold */
  12778. WL_PROXD_PHY_ERR_LB_PEAK_POWER = (1 << 2), /* Loopback Peak power */
  12779. WL_PROXD_PHY_ERR_RX_PEAK_POWER = (1 << 3), /* Received Peak power */
  12780. WL_PROXD_PHY_ERR_BITFLIP = (1 << 4), /* Bitflips */
  12781. WL_PROXD_PHY_ERR_SNR = (1 << 5), /* SNR */
  12782. WL_PROXD_PHY_RX_STRT_WIN_OFF = (1 << 6), /* Receive start window is off */
  12783. WL_PROXD_PHY_RX_END_WIN_OFF = (1 << 7), /* Receive End window is off */
  12784. WL_PROXD_PHY_ERR_LOW_CONFIDENCE = (1 << 15), /* Low confidence on meas distance */
  12785. };
  12786. typedef uint32 wl_proxd_phy_error_t;
  12787. /** session states */
  12788. enum {
  12789. WL_PROXD_SESSION_STATE_NONE = 0,
  12790. WL_PROXD_SESSION_STATE_CREATED = 1,
  12791. WL_PROXD_SESSION_STATE_CONFIGURED = 2,
  12792. WL_PROXD_SESSION_STATE_STARTED = 3,
  12793. WL_PROXD_SESSION_STATE_DELAY = 4,
  12794. WL_PROXD_SESSION_STATE_USER_WAIT = 5,
  12795. WL_PROXD_SESSION_STATE_SCHED_WAIT = 6,
  12796. WL_PROXD_SESSION_STATE_BURST = 7,
  12797. WL_PROXD_SESSION_STATE_STOPPING = 8,
  12798. WL_PROXD_SESSION_STATE_ENDED = 9,
  12799. WL_PROXD_SESSION_STATE_START_WAIT = 10,
  12800. WL_PROXD_SESSION_STATE_DESTROYING = -1
  12801. };
  12802. typedef int16 wl_proxd_session_state_t;
  12803. /** RTT sample flags */
  12804. enum {
  12805. WL_PROXD_RTT_SAMPLE_NONE = 0x00,
  12806. WL_PROXD_RTT_SAMPLE_DISCARD = 0x01
  12807. };
  12808. typedef uint8 wl_proxd_rtt_sample_flags_t;
  12809. typedef int16 wl_proxd_rssi_t;
  12810. typedef uint16 wl_proxd_snr_t;
  12811. typedef uint16 wl_proxd_bitflips_t;
  12812. /** result flags */
  12813. enum {
  12814. WL_PRXOD_RESULT_FLAG_NONE = 0x0000,
  12815. WL_PROXD_RESULT_FLAG_NLOS = 0x0001, /**< LOS - if available */
  12816. WL_PROXD_RESULT_FLAG_LOS = 0x0002, /**< NLOS - if available */
  12817. WL_PROXD_RESULT_FLAG_FATAL = 0x0004, /**< Fatal error during burst */
  12818. WL_PROXD_RESULT_FLAG_VHTACK = 0x0008, /* VHTACK or Legacy ACK used */
  12819. WL_PROXD_REQUEST_SENT = 0x0010, /* FTM request was sent */
  12820. WL_PROXD_REQUEST_ACKED = 0x0020, /* FTM request was acked */
  12821. WL_PROXD_LTFSEQ_STARTED = 0x0040, /* LTF sequence started */
  12822. WL_PROXD_RESULT_FLAG_ALL = 0xffff
  12823. };
  12824. typedef int16 wl_proxd_result_flags_t;
  12825. #define WL_PROXD_RTT_SAMPLE_VERSION_1 1
  12826. typedef struct wl_proxd_rtt_sample_v1 {
  12827. uint8 id; /**< id for the sample - non-zero */
  12828. wl_proxd_rtt_sample_flags_t flags;
  12829. wl_proxd_rssi_t rssi;
  12830. wl_proxd_intvl_t rtt; /**< round trip time */
  12831. uint32 ratespec;
  12832. wl_proxd_snr_t snr;
  12833. wl_proxd_bitflips_t bitflips;
  12834. wl_proxd_status_t status;
  12835. int32 distance;
  12836. wl_proxd_phy_error_t tof_phy_error;
  12837. wl_proxd_phy_error_t tof_tgt_phy_error; /* target phy error bit map */
  12838. wl_proxd_snr_t tof_tgt_snr;
  12839. wl_proxd_bitflips_t tof_tgt_bitflips;
  12840. uint8 coreid;
  12841. uint8 pad[3];
  12842. } wl_proxd_rtt_sample_v1_t;
  12843. #define WL_PROXD_RTT_RESULT_VERSION_1 1
  12844. /** rtt measurement result */
  12845. typedef struct wl_proxd_rtt_result_v1 {
  12846. wl_proxd_session_id_t sid;
  12847. wl_proxd_result_flags_t flags;
  12848. wl_proxd_status_t status;
  12849. struct ether_addr peer;
  12850. wl_proxd_session_state_t state; /**< current state */
  12851. union {
  12852. wl_proxd_intvl_t retry_after; /* hint for errors */
  12853. wl_proxd_intvl_t burst_duration; /* burst duration */
  12854. } u;
  12855. wl_proxd_rtt_sample_v1_t avg_rtt;
  12856. uint32 avg_dist; /* 1/256m units */
  12857. uint16 sd_rtt; /* RTT standard deviation */
  12858. uint8 num_valid_rtt; /* valid rtt cnt */
  12859. uint8 num_ftm; /* actual num of ftm cnt (Configured) */
  12860. uint16 burst_num; /* in a session */
  12861. uint16 num_rtt; /* 0 if no detail */
  12862. uint16 num_meas; /* number of ftm frames seen OTA */
  12863. uint8 pad[2];
  12864. wl_proxd_rtt_sample_v1_t rtt[1]; /* variable */
  12865. } wl_proxd_rtt_result_v1_t;
  12866. #define WL_PROXD_RTT_SAMPLE_VERSION_2 2
  12867. typedef struct wl_proxd_rtt_sample_v2 {
  12868. uint16 version;
  12869. uint16 length;
  12870. uint8 id; /**< id for the sample - non-zero */
  12871. wl_proxd_rtt_sample_flags_t flags;
  12872. wl_proxd_rssi_t rssi;
  12873. wl_proxd_intvl_t rtt; /**< round trip time */
  12874. uint32 ratespec;
  12875. wl_proxd_snr_t snr;
  12876. wl_proxd_bitflips_t bitflips;
  12877. wl_proxd_status_t status;
  12878. int32 distance;
  12879. wl_proxd_phy_error_t tof_phy_error;
  12880. wl_proxd_phy_error_t tof_tgt_phy_error; /* target phy error bit map */
  12881. wl_proxd_snr_t tof_tgt_snr;
  12882. wl_proxd_bitflips_t tof_tgt_bitflips;
  12883. uint8 coreid;
  12884. uint8 pad[3];
  12885. uint32 chanspec;
  12886. } wl_proxd_rtt_sample_v2_t;
  12887. #define WL_PROXD_RTT_RESULT_VERSION_2 2
  12888. /** rtt measurement result */
  12889. typedef struct wl_proxd_rtt_result_v2 {
  12890. uint16 version;
  12891. uint16 length; /* up to rtt[] */
  12892. wl_proxd_session_id_t sid;
  12893. wl_proxd_result_flags_t flags;
  12894. wl_proxd_status_t status;
  12895. struct ether_addr peer;
  12896. wl_proxd_session_state_t state; /**< current state */
  12897. union {
  12898. wl_proxd_intvl_t retry_after; /* hint for errors */
  12899. wl_proxd_intvl_t burst_duration; /* burst duration */
  12900. } u;
  12901. uint32 avg_dist; /* 1/256m units */
  12902. uint16 sd_rtt; /* RTT standard deviation */
  12903. uint8 num_valid_rtt; /* valid rtt cnt */
  12904. uint8 num_ftm; /* actual num of ftm cnt (Configured) */
  12905. uint16 burst_num; /* in a session */
  12906. uint16 num_rtt; /* 0 if no detail */
  12907. uint16 num_meas; /* number of ftm frames seen OTA */
  12908. uint8 pad[2];
  12909. wl_proxd_rtt_sample_v2_t rtt[1]; /* variable, first element is avg_rtt */
  12910. } wl_proxd_rtt_result_v2_t;
  12911. /** aoa measurement result */
  12912. typedef struct wl_proxd_aoa_result {
  12913. wl_proxd_session_id_t sid;
  12914. wl_proxd_result_flags_t flags;
  12915. wl_proxd_status_t status;
  12916. struct ether_addr peer;
  12917. wl_proxd_session_state_t state;
  12918. uint16 burst_num;
  12919. uint8 pad[2];
  12920. /* wl_proxd_aoa_sample_t sample_avg; TBD */
  12921. } BWL_POST_PACKED_STRUCT wl_proxd_aoa_result_t;
  12922. #include <packed_section_end.h>
  12923. /** global stats */
  12924. typedef struct wl_proxd_counters {
  12925. uint32 tx; /* tx frame count */
  12926. uint32 rx; /* rx frame count */
  12927. uint32 burst; /* total number of burst */
  12928. uint32 sessions; /* total number of sessions */
  12929. uint32 max_sessions; /* max concurrency */
  12930. uint32 sched_fail; /* scheduling failures */
  12931. uint32 timeouts; /* timeouts */
  12932. uint32 protoerr; /* protocol errors */
  12933. uint32 noack; /* tx w/o ack */
  12934. uint32 txfail; /* any tx falure */
  12935. uint32 lci_req_tx; /* tx LCI requests */
  12936. uint32 lci_req_rx; /* rx LCI requests */
  12937. uint32 lci_rep_tx; /* tx LCI reports */
  12938. uint32 lci_rep_rx; /* rx LCI reports */
  12939. uint32 civic_req_tx; /* tx civic requests */
  12940. uint32 civic_req_rx; /* rx civic requests */
  12941. uint32 civic_rep_tx; /* tx civic reports */
  12942. uint32 civic_rep_rx; /* rx civic reports */
  12943. uint32 rctx; /* ranging contexts created */
  12944. uint32 rctx_done; /* count of ranging done */
  12945. uint32 publish_err; /* availability publishing errors */
  12946. uint32 on_chan; /* count of scheduler onchan */
  12947. uint32 off_chan; /* count of scheduler offchan */
  12948. uint32 tsf_lo; /* local tsf or session tsf */
  12949. uint32 tsf_hi;
  12950. uint32 num_meas;
  12951. } wl_proxd_counters_t;
  12952. typedef struct wl_proxd_counters wl_proxd_session_counters_t;
  12953. enum {
  12954. WL_PROXD_CAP_NONE = 0x0000,
  12955. WL_PROXD_CAP_ALL = 0xffff
  12956. };
  12957. typedef int16 wl_proxd_caps_t;
  12958. /** method capabilities */
  12959. enum {
  12960. WL_PROXD_FTM_CAP_NONE = 0x0000,
  12961. WL_PROXD_FTM_CAP_FTM1 = 0x0001
  12962. };
  12963. typedef uint16 wl_proxd_ftm_caps_t;
  12964. typedef struct wl_proxd_tlv_id_list {
  12965. uint16 num_ids;
  12966. uint16 ids[1];
  12967. } wl_proxd_tlv_id_list_t;
  12968. typedef struct wl_proxd_session_id_list {
  12969. uint16 num_ids;
  12970. wl_proxd_session_id_t ids[1];
  12971. } wl_proxd_session_id_list_t;
  12972. typedef struct wl_proxd_tpk {
  12973. struct ether_addr peer;
  12974. uint8 tpk[TPK_FTM_LEN];
  12975. } wl_proxd_tpk_t;
  12976. /* tlvs returned for get_info on ftm method
  12977. * configuration:
  12978. * proxd flags
  12979. * event mask
  12980. * debug mask
  12981. * session defaults (session tlvs)
  12982. * status tlv - not supported for ftm method
  12983. * info tlv
  12984. */
  12985. typedef struct wl_proxd_ftm_info {
  12986. wl_proxd_ftm_caps_t caps;
  12987. uint16 max_sessions;
  12988. uint16 num_sessions;
  12989. uint16 rx_max_burst;
  12990. } wl_proxd_ftm_info_t;
  12991. enum {
  12992. WL_PROXD_WAIT_NONE = 0x0000,
  12993. WL_PROXD_WAIT_KEY = 0x0001,
  12994. WL_PROXD_WAIT_SCHED = 0x0002,
  12995. WL_PROXD_WAIT_TSF = 0x0004
  12996. };
  12997. typedef int16 wl_proxd_wait_reason_t;
  12998. /* tlvs returned for get_info on session
  12999. * session config (tlvs)
  13000. * session info tlv
  13001. */
  13002. typedef struct wl_proxd_ftm_session_info {
  13003. uint16 sid;
  13004. uint8 bss_index;
  13005. uint8 pad;
  13006. struct ether_addr bssid;
  13007. wl_proxd_session_state_t state;
  13008. wl_proxd_status_t status;
  13009. uint16 burst_num;
  13010. wl_proxd_wait_reason_t wait_reason;
  13011. uint32 meas_start_lo; /* sn tsf of 1st meas for cur/prev burst */
  13012. uint32 meas_start_hi;
  13013. } wl_proxd_ftm_session_info_t;
  13014. typedef struct wl_proxd_ftm_session_status {
  13015. uint16 sid;
  13016. wl_proxd_session_state_t state;
  13017. wl_proxd_status_t status;
  13018. uint16 burst_num;
  13019. uint16 pad;
  13020. } wl_proxd_ftm_session_status_t;
  13021. /** rrm range request */
  13022. typedef struct wl_proxd_range_req {
  13023. uint16 num_repeat;
  13024. uint16 init_delay_range; /**< in TUs */
  13025. uint8 pad;
  13026. uint8 num_nbr; /**< number of (possible) neighbors */
  13027. nbr_element_t nbr[1];
  13028. } wl_proxd_range_req_t;
  13029. #define WL_PROXD_LCI_LAT_OFF 0
  13030. #define WL_PROXD_LCI_LONG_OFF 5
  13031. #define WL_PROXD_LCI_ALT_OFF 10
  13032. #define WL_PROXD_LCI_GET_LAT(_lci, _lat, _lat_err) { \
  13033. unsigned _off = WL_PROXD_LCI_LAT_OFF; \
  13034. _lat_err = (_lci)->data[(_off)] & 0x3f; \
  13035. _lat = (_lci)->data[(_off)+1]; \
  13036. _lat |= (_lci)->data[(_off)+2] << 8; \
  13037. _lat |= (_lci)->data[_(_off)+3] << 16; \
  13038. _lat |= (_lci)->data[(_off)+4] << 24; \
  13039. _lat <<= 2; \
  13040. _lat |= (_lci)->data[(_off)] >> 6; \
  13041. }
  13042. #define WL_PROXD_LCI_GET_LONG(_lci, _lcilong, _long_err) { \
  13043. unsigned _off = WL_PROXD_LCI_LONG_OFF; \
  13044. _long_err = (_lci)->data[(_off)] & 0x3f; \
  13045. _lcilong = (_lci)->data[(_off)+1]; \
  13046. _lcilong |= (_lci)->data[(_off)+2] << 8; \
  13047. _lcilong |= (_lci)->data[_(_off)+3] << 16; \
  13048. _lcilong |= (_lci)->data[(_off)+4] << 24; \
  13049. __lcilong <<= 2; \
  13050. _lcilong |= (_lci)->data[(_off)] >> 6; \
  13051. }
  13052. #define WL_PROXD_LCI_GET_ALT(_lci, _alt_type, _alt, _alt_err) { \
  13053. unsigned _off = WL_PROXD_LCI_ALT_OFF; \
  13054. _alt_type = (_lci)->data[_off] & 0x0f; \
  13055. _alt_err = (_lci)->data[(_off)] >> 4; \
  13056. _alt_err |= ((_lci)->data[(_off)+1] & 0x03) << 4; \
  13057. _alt = (_lci)->data[(_off)+2]; \
  13058. _alt |= (_lci)->data[(_off)+3] << 8; \
  13059. _alt |= (_lci)->data[_(_off)+4] << 16; \
  13060. _alt <<= 6; \
  13061. _alt |= (_lci)->data[(_off) + 1] >> 2; \
  13062. }
  13063. #define WL_PROXD_LCI_VERSION(_lci) ((_lci)->data[15] >> 6)
  13064. /* availability. advertising mechanism bss specific */
  13065. /** availablity flags */
  13066. enum {
  13067. WL_PROXD_AVAIL_NONE = 0,
  13068. WL_PROXD_AVAIL_NAN_PUBLISHED = 0x0001,
  13069. WL_PROXD_AVAIL_SCHEDULED = 0x0002 /**< scheduled by proxd */
  13070. };
  13071. typedef int16 wl_proxd_avail_flags_t;
  13072. /** time reference */
  13073. enum {
  13074. WL_PROXD_TREF_NONE = 0,
  13075. WL_PROXD_TREF_DEV_TSF = 1,
  13076. WL_PROXD_TREF_NAN_DW = 2,
  13077. WL_PROXD_TREF_TBTT = 3,
  13078. WL_PROXD_TREF_MAX /* last entry */
  13079. };
  13080. typedef int16 wl_proxd_time_ref_t;
  13081. /** proxd channel-time slot */
  13082. typedef struct {
  13083. wl_proxd_intvl_t start; /**< from ref */
  13084. wl_proxd_intvl_t duration; /**< from start */
  13085. uint32 chanspec;
  13086. } wl_proxd_time_slot_t;
  13087. typedef struct wl_proxd_avail24 {
  13088. wl_proxd_avail_flags_t flags; /**< for query only */
  13089. wl_proxd_time_ref_t time_ref;
  13090. uint16 max_slots; /**< for query only */
  13091. uint16 num_slots;
  13092. wl_proxd_time_slot_t slots[1]; /**< ROM compat - not used */
  13093. wl_proxd_intvl_t repeat;
  13094. wl_proxd_time_slot_t ts0[1];
  13095. } wl_proxd_avail24_t;
  13096. #define WL_PROXD_AVAIL24_TIMESLOT(_avail24, _i) (&(_avail24)->ts0[(_i)])
  13097. #define WL_PROXD_AVAIL24_TIMESLOT_OFFSET(_avail24) OFFSETOF(wl_proxd_avail24_t, ts0)
  13098. #define WL_PROXD_AVAIL24_TIMESLOTS(_avail24) WL_PROXD_AVAIL24_TIMESLOT(_avail24, 0)
  13099. #define WL_PROXD_AVAIL24_SIZE(_avail24, _num_slots) (\
  13100. WL_PROXD_AVAIL24_TIMESLOT_OFFSET(_avail24) + \
  13101. (_num_slots) * sizeof(*WL_PROXD_AVAIL24_TIMESLOT(_avail24, 0)))
  13102. typedef struct wl_proxd_avail {
  13103. wl_proxd_avail_flags_t flags; /**< for query only */
  13104. wl_proxd_time_ref_t time_ref;
  13105. uint16 max_slots; /**< for query only */
  13106. uint16 num_slots;
  13107. wl_proxd_intvl_t repeat;
  13108. wl_proxd_time_slot_t slots[1];
  13109. } wl_proxd_avail_t;
  13110. #define WL_PROXD_AVAIL_TIMESLOT(_avail, _i) (&(_avail)->slots[(_i)])
  13111. #define WL_PROXD_AVAIL_TIMESLOT_OFFSET(_avail) OFFSETOF(wl_proxd_avail_t, slots)
  13112. #define WL_PROXD_AVAIL_TIMESLOTS(_avail) WL_PROXD_AVAIL_TIMESLOT(_avail, 0)
  13113. #define WL_PROXD_AVAIL_SIZE(_avail, _num_slots) (\
  13114. WL_PROXD_AVAIL_TIMESLOT_OFFSET(_avail) + \
  13115. (_num_slots) * sizeof(*WL_PROXD_AVAIL_TIMESLOT(_avail, 0)))
  13116. /* collect support TBD */
  13117. /** debugging */
  13118. enum {
  13119. WL_PROXD_DEBUG_NONE = 0x00000000,
  13120. WL_PROXD_DEBUG_LOG = 0x00000001,
  13121. WL_PROXD_DEBUG_IOV = 0x00000002,
  13122. WL_PROXD_DEBUG_EVENT = 0x00000004,
  13123. WL_PROXD_DEBUG_SESSION = 0x00000008,
  13124. WL_PROXD_DEBUG_PROTO = 0x00000010,
  13125. WL_PROXD_DEBUG_SCHED = 0x00000020,
  13126. WL_PROXD_DEBUG_RANGING = 0x00000040,
  13127. WL_PROXD_DEBUG_NAN = 0x00000080,
  13128. WL_PROXD_DEBUG_PKT = 0x00000100,
  13129. WL_PROXD_DEBUG_SEC = 0x00000200,
  13130. WL_PROXD_DEBUG_EVENTLOG = 0x80000000, /* map/enable EVNET_LOG_TAG_PROXD_INFO */
  13131. WL_PROXD_DEBUG_ALL = 0xffffffff
  13132. };
  13133. typedef uint32 wl_proxd_debug_mask_t;
  13134. /** tlv IDs - data length 4 bytes unless overridden by type, alignment 32 bits */
  13135. typedef enum {
  13136. WL_PROXD_TLV_ID_NONE = 0,
  13137. WL_PROXD_TLV_ID_METHOD = 1,
  13138. WL_PROXD_TLV_ID_FLAGS = 2,
  13139. WL_PROXD_TLV_ID_CHANSPEC = 3, /**< note: uint32 */
  13140. WL_PROXD_TLV_ID_TX_POWER = 4,
  13141. WL_PROXD_TLV_ID_RATESPEC = 5,
  13142. WL_PROXD_TLV_ID_BURST_DURATION = 6, /**< intvl - length of burst */
  13143. WL_PROXD_TLV_ID_BURST_PERIOD = 7, /**< intvl - between bursts */
  13144. WL_PROXD_TLV_ID_BURST_FTM_SEP = 8, /**< intvl - between FTMs */
  13145. WL_PROXD_TLV_ID_BURST_NUM_FTM = 9, /**< uint16 - per burst */
  13146. WL_PROXD_TLV_ID_NUM_BURST = 10, /**< uint16 */
  13147. WL_PROXD_TLV_ID_FTM_RETRIES = 11, /**< uint16 at FTM level */
  13148. WL_PROXD_TLV_ID_BSS_INDEX = 12, /**< uint8 */
  13149. WL_PROXD_TLV_ID_BSSID = 13,
  13150. WL_PROXD_TLV_ID_INIT_DELAY = 14, /**< intvl - optional,non-standalone only */
  13151. WL_PROXD_TLV_ID_BURST_TIMEOUT = 15, /**< expect response within - intvl */
  13152. WL_PROXD_TLV_ID_EVENT_MASK = 16, /**< interested events - in/out */
  13153. WL_PROXD_TLV_ID_FLAGS_MASK = 17, /**< interested flags - in only */
  13154. WL_PROXD_TLV_ID_PEER_MAC = 18, /**< mac address of peer */
  13155. WL_PROXD_TLV_ID_FTM_REQ = 19, /**< dot11_ftm_req */
  13156. WL_PROXD_TLV_ID_LCI_REQ = 20,
  13157. WL_PROXD_TLV_ID_LCI = 21,
  13158. WL_PROXD_TLV_ID_CIVIC_REQ = 22,
  13159. WL_PROXD_TLV_ID_CIVIC = 23,
  13160. WL_PROXD_TLV_ID_AVAIL24 = 24, /**< ROM compatibility */
  13161. WL_PROXD_TLV_ID_SESSION_FLAGS = 25,
  13162. WL_PROXD_TLV_ID_SESSION_FLAGS_MASK = 26, /**< in only */
  13163. WL_PROXD_TLV_ID_RX_MAX_BURST = 27, /**< uint16 - limit bursts per session */
  13164. WL_PROXD_TLV_ID_RANGING_INFO = 28, /**< ranging info */
  13165. WL_PROXD_TLV_ID_RANGING_FLAGS = 29, /**< uint16 */
  13166. WL_PROXD_TLV_ID_RANGING_FLAGS_MASK = 30, /**< uint16, in only */
  13167. WL_PROXD_TLV_ID_NAN_MAP_ID = 31,
  13168. WL_PROXD_TLV_ID_DEV_ADDR = 32,
  13169. WL_PROXD_TLV_ID_AVAIL = 33, /**< wl_proxd_avail_t */
  13170. WL_PROXD_TLV_ID_TLV_ID = 34, /* uint16 tlv-id */
  13171. WL_PROXD_TLV_ID_FTM_REQ_RETRIES = 35, /* uint16 FTM request retries */
  13172. WL_PROXD_TLV_ID_TPK = 36, /* 32byte TPK */
  13173. WL_PROXD_TLV_ID_RI_RR = 36, /* RI_RR */
  13174. WL_PROXD_TLV_ID_TUNE = 37, /* wl_proxd_pararms_tof_tune_t */
  13175. WL_PROXD_TLV_ID_CUR_ETHER_ADDR = 38, /* Source Address used for Tx */
  13176. /* output - 512 + x */
  13177. WL_PROXD_TLV_ID_STATUS = 512,
  13178. WL_PROXD_TLV_ID_COUNTERS = 513,
  13179. WL_PROXD_TLV_ID_INFO = 514,
  13180. WL_PROXD_TLV_ID_RTT_RESULT = 515,
  13181. WL_PROXD_TLV_ID_AOA_RESULT = 516,
  13182. WL_PROXD_TLV_ID_SESSION_INFO = 517,
  13183. WL_PROXD_TLV_ID_SESSION_STATUS = 518,
  13184. WL_PROXD_TLV_ID_SESSION_ID_LIST = 519,
  13185. WL_PROXD_TLV_ID_RTT_RESULT_V2 = 520,
  13186. /* debug tlvs can be added starting 1024 */
  13187. WL_PROXD_TLV_ID_DEBUG_MASK = 1024,
  13188. WL_PROXD_TLV_ID_COLLECT = 1025, /**< output only */
  13189. WL_PROXD_TLV_ID_STRBUF = 1026,
  13190. WL_PROXD_TLV_ID_COLLECT_HEADER = 1025, /* wl_proxd_collect_header_t */
  13191. WL_PROXD_TLV_ID_COLLECT_INFO = 1028, /* wl_proxd_collect_info_t */
  13192. WL_PROXD_TLV_ID_COLLECT_DATA = 1029, /* wl_proxd_collect_data_t */
  13193. WL_PROXD_TLV_ID_COLLECT_CHAN_DATA = 1030, /* wl_proxd_collect_data_t */
  13194. WL_PROXD_TLV_ID_MF_STATS_DATA = 1031, /* mf_stats_buffer */
  13195. WL_PROXD_TLV_ID_COLLECT_INLINE_HEADER = 1032,
  13196. WL_PROXD_TLV_ID_COLLECT_INLINE_FRAME_INFO = 1033,
  13197. WL_PROXD_TLV_ID_COLLECT_INLINE_FRAME_DATA = 1034,
  13198. WL_PROXD_TLV_ID_COLLECT_INLINE_RESULTS = 1035,
  13199. WL_PROXD_TLV_ID_MAX
  13200. } wl_proxd_tlv_types_t;
  13201. #define TOF_COLLECT_INLINE_HEADER_INFO_VER_1 1
  13202. typedef struct wl_proxd_collect_inline_header_info_v1
  13203. {
  13204. uint16 version;
  13205. uint16 pad1;
  13206. uint32 ratespec; /* override */
  13207. chanspec_t chanspec;
  13208. uint16 num_ftm;
  13209. struct ether_addr peer_mac;
  13210. struct ether_addr cur_ether_addr; /* source address for Tx */
  13211. } wl_proxd_collect_inline_header_info_v1_t;
  13212. #define TOF_COLLECT_INLINE_RESULTS_VER_1 1
  13213. typedef struct wl_proxd_collect_inline_results_info_v1
  13214. {
  13215. uint16 version;
  13216. uint16 pad1;
  13217. uint32 meanrtt;
  13218. uint32 distance;
  13219. uint16 num_rtt;
  13220. uint16 pad2;
  13221. int32 status;
  13222. uint32 ratespec;
  13223. } wl_proxd_collect_inline_results_info_v1_t;
  13224. #define TOF_COLLECT_INLINE_FRAME_INFO_VER_1 1
  13225. typedef struct wl_proxd_collect_inline_frame_info_v1
  13226. {
  13227. uint16 version;
  13228. uint16 pad1;
  13229. int32 gd;
  13230. uint32 T[4];
  13231. uint32 prev_t1;
  13232. uint32 prev_t4;
  13233. int32 hadj;
  13234. int8 rssi;
  13235. uint8 pad[3];
  13236. } wl_proxd_collect_inline_frame_info_v1_t;
  13237. #define TOF_COLLECT_INLINE_FRAME_INFO_VER_2 2
  13238. typedef struct wl_proxd_collect_inline_frame_info_v2
  13239. {
  13240. uint16 version;
  13241. uint16 pad1;
  13242. int32 gd;
  13243. uint32 T[4];
  13244. int32 hadj;
  13245. int8 rssi;
  13246. uint8 pad[3];
  13247. } wl_proxd_collect_inline_frame_info_v2_t;
  13248. typedef struct wl_proxd_tlv {
  13249. uint16 id;
  13250. uint16 len;
  13251. uint8 data[1];
  13252. } wl_proxd_tlv_t;
  13253. /** proxd iovar - applies to proxd, method or session */
  13254. typedef struct wl_proxd_iov {
  13255. uint16 version;
  13256. uint16 len;
  13257. wl_proxd_cmd_t cmd;
  13258. wl_proxd_method_t method;
  13259. wl_proxd_session_id_t sid;
  13260. uint8 PAD[2];
  13261. wl_proxd_tlv_t tlvs[1]; /**< variable */
  13262. } wl_proxd_iov_t;
  13263. #define WL_PROXD_IOV_HDR_SIZE OFFSETOF(wl_proxd_iov_t, tlvs)
  13264. /* The following event definitions may move to bcmevent.h, but sharing proxd types
  13265. * across needs more invasive changes unrelated to proxd
  13266. */
  13267. enum {
  13268. WL_PROXD_EVENT_NONE = 0, /**< not an event, reserved */
  13269. WL_PROXD_EVENT_SESSION_CREATE = 1,
  13270. WL_PROXD_EVENT_SESSION_START = 2,
  13271. WL_PROXD_EVENT_FTM_REQ = 3,
  13272. WL_PROXD_EVENT_BURST_START = 4,
  13273. WL_PROXD_EVENT_BURST_END = 5,
  13274. WL_PROXD_EVENT_SESSION_END = 6,
  13275. WL_PROXD_EVENT_SESSION_RESTART = 7,
  13276. WL_PROXD_EVENT_BURST_RESCHED = 8, /**< burst rescheduled-e.g. partial TSF */
  13277. WL_PROXD_EVENT_SESSION_DESTROY = 9,
  13278. WL_PROXD_EVENT_RANGE_REQ = 10,
  13279. WL_PROXD_EVENT_FTM_FRAME = 11,
  13280. WL_PROXD_EVENT_DELAY = 12,
  13281. WL_PROXD_EVENT_VS_INITIATOR_RPT = 13, /**< (target) rx initiator-report */
  13282. WL_PROXD_EVENT_RANGING = 14,
  13283. WL_PROXD_EVENT_LCI_MEAS_REP = 15, /* LCI measurement report */
  13284. WL_PROXD_EVENT_CIVIC_MEAS_REP = 16, /* civic measurement report */
  13285. WL_PROXD_EVENT_COLLECT = 17,
  13286. WL_PROXD_EVENT_START_WAIT = 18, /* waiting to start */
  13287. WL_PROXD_EVENT_MF_STATS = 19, /* mf stats event */
  13288. WL_PROXD_EVENT_MAX
  13289. };
  13290. typedef int16 wl_proxd_event_type_t;
  13291. /** proxd event mask - upto 32 events for now */
  13292. typedef uint32 wl_proxd_event_mask_t;
  13293. #define WL_PROXD_EVENT_MASK_ALL 0xfffffffe
  13294. #define WL_PROXD_EVENT_MASK_EVENT(_event_type) (1 << (_event_type))
  13295. #define WL_PROXD_EVENT_ENABLED(_mask, _event_type) (\
  13296. ((_mask) & WL_PROXD_EVENT_MASK_EVENT(_event_type)) != 0)
  13297. /** proxd event - applies to proxd, method or session */
  13298. typedef struct wl_proxd_event {
  13299. uint16 version;
  13300. uint16 len;
  13301. wl_proxd_event_type_t type;
  13302. wl_proxd_method_t method;
  13303. wl_proxd_session_id_t sid;
  13304. uint8 pad[2]; /* This field is used fragmentation purpose */
  13305. wl_proxd_tlv_t tlvs[1]; /**< variable */
  13306. } wl_proxd_event_t;
  13307. enum {
  13308. WL_PROXD_RANGING_STATE_NONE = 0,
  13309. WL_PROXD_RANGING_STATE_NOTSTARTED = 1,
  13310. WL_PROXD_RANGING_STATE_INPROGRESS = 2,
  13311. WL_PROXD_RANGING_STATE_DONE = 3
  13312. };
  13313. typedef int16 wl_proxd_ranging_state_t;
  13314. /** proxd ranging flags */
  13315. enum {
  13316. WL_PROXD_RANGING_FLAG_NONE = 0x0000, /**< no flags */
  13317. WL_PROXD_RANGING_FLAG_DEL_SESSIONS_ON_STOP = 0x0001,
  13318. WL_PROXD_RANGING_FLAG_ALL = 0xffff
  13319. };
  13320. typedef uint16 wl_proxd_ranging_flags_t;
  13321. struct wl_proxd_ranging_info {
  13322. wl_proxd_status_t status;
  13323. wl_proxd_ranging_state_t state;
  13324. wl_proxd_ranging_flags_t flags;
  13325. uint16 num_sids;
  13326. uint16 num_done;
  13327. };
  13328. typedef struct wl_proxd_ranging_info wl_proxd_ranging_info_t;
  13329. #include <packed_section_start.h>
  13330. /* Legacy platform i.e. 43342/43430 */
  13331. #define WL_PROXD_COLLECT_EVENT_DATA_VERSION_1 1
  13332. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_collect_event_data_v1 {
  13333. uint32 H_LB[K_TOF_COLLECT_H_SIZE_20MHZ];
  13334. uint32 H_RX[K_TOF_COLLECT_H_SIZE_20MHZ];
  13335. uint8 ri_rr[FTM_TPK_LEN];
  13336. wl_proxd_phy_error_t phy_err_mask;
  13337. } BWL_POST_PACKED_STRUCT wl_proxd_collect_event_data_v1_t;
  13338. /* Secured 2.0 supoorted devices i.e. 4364 */
  13339. #define WL_PROXD_COLLECT_EVENT_DATA_VERSION_2 2
  13340. typedef BWL_PRE_PACKED_STRUCT struct wl_proxd_collect_event_data_v2 {
  13341. uint32 H_LB[K_TOF_COLLECT_H_SIZE_20MHZ];
  13342. uint32 H_RX[K_TOF_COLLECT_H_SIZE_20MHZ];
  13343. uint8 ri_rr[FTM_TPK_RI_RR_LEN_SECURE_2_0];
  13344. wl_proxd_phy_error_t phy_err_mask;
  13345. } BWL_POST_PACKED_STRUCT wl_proxd_collect_event_data_v2_t;
  13346. #include <packed_section_end.h>
  13347. #define WL_PROXD_COLLECT_EVENT_DATA_VERSION_3 3
  13348. typedef struct wl_proxd_collect_event_data_v3 {
  13349. uint16 version;
  13350. uint16 length;
  13351. uint32 H_LB[K_TOF_COLLECT_H_SIZE_20MHZ];
  13352. uint32 H_RX[K_TOF_COLLECT_H_SIZE_20MHZ];
  13353. uint8 ri_rr[FTM_TPK_RI_RR_LEN_SECURE_2_0];
  13354. wl_proxd_phy_error_t phy_err_mask;
  13355. } wl_proxd_collect_event_data_v3_t;
  13356. #define WL_PROXD_COLLECT_EVENT_DATA_VERSION_MAX WL_PROXD_COLLECT_EVENT_DATA_VERSION_3
  13357. /** Data returned by the bssload_report iovar. This is also the WLC_E_BSS_LOAD event data */
  13358. #include <packed_section_start.h>
  13359. typedef BWL_PRE_PACKED_STRUCT struct wl_bssload {
  13360. uint16 sta_count; /**< station count */
  13361. uint16 aac; /**< available admission capacity */
  13362. uint8 chan_util; /**< channel utilization */
  13363. } BWL_POST_PACKED_STRUCT wl_bssload_t;
  13364. #include <packed_section_end.h>
  13365. /**
  13366. * Maximum number of configurable BSS Load levels. The number of BSS Load
  13367. * ranges is always 1 more than the number of configured levels. eg. if
  13368. * 3 levels of 10, 20, 30 are configured then this defines 4 load ranges:
  13369. * 0-10, 11-20, 21-30, 31-255. A WLC_E_BSS_LOAD event is generated each time
  13370. * the utilization level crosses into another range, subject to the rate limit.
  13371. */
  13372. #define MAX_BSSLOAD_LEVELS 8
  13373. #define MAX_BSSLOAD_RANGES (MAX_BSSLOAD_LEVELS + 1)
  13374. /** BSS Load event notification configuration. */
  13375. typedef struct wl_bssload_cfg {
  13376. uint32 rate_limit_msec; /**< # of events posted to application will be limited to
  13377. * one per specified period (0 to disable rate limit).
  13378. */
  13379. uint8 num_util_levels; /**< Number of entries in util_levels[] below */
  13380. uint8 util_levels[MAX_BSSLOAD_LEVELS];
  13381. /**< Variable number of BSS Load utilization levels in
  13382. * low to high order. An event will be posted each time
  13383. * a received beacon's BSS Load IE channel utilization
  13384. * value crosses a level.
  13385. */
  13386. uint8 PAD[3];
  13387. } wl_bssload_cfg_t;
  13388. /** Multiple roaming profile suport */
  13389. #define WL_MAX_ROAM_PROF_BRACKETS 4
  13390. #define WL_ROAM_PROF_VER_0 0
  13391. #define WL_ROAM_PROF_VER_1 1
  13392. #define WL_ROAM_PROF_VER_2 2
  13393. #define WL_MAX_ROAM_PROF_VER WL_ROAM_PROF_VER_1
  13394. #define WL_ROAM_PROF_NONE (0 << 0)
  13395. #define WL_ROAM_PROF_LAZY (1 << 0)
  13396. #define WL_ROAM_PROF_NO_CI (1 << 1)
  13397. #define WL_ROAM_PROF_SUSPEND (1 << 2)
  13398. #define WL_ROAM_PROF_SYNC_DTIM (1 << 6)
  13399. #define WL_ROAM_PROF_DEFAULT (1 << 7) /**< backward compatible single default profile */
  13400. #define WL_FACTOR_TABLE_MAX_LIMIT 5
  13401. #define WL_CU_2G_ROAM_TRIGGER (-60)
  13402. #define WL_CU_5G_ROAM_TRIGGER (-70)
  13403. #define WL_CU_SCORE_DELTA_DEFAULT 20
  13404. #define WL_MAX_CHANNEL_USAGE 0x0FF
  13405. #define WL_CU_PERCENTAGE_DISABLE 0
  13406. #define WL_CU_PERCENTAGE_DEFAULT 70
  13407. #define WL_CU_PERCENTAGE_MAX 100
  13408. #define WL_CU_CALC_DURATION_DEFAULT 10 /* seconds */
  13409. #define WL_CU_CALC_DURATION_MAX 60 /* seconds */
  13410. #define WL_ESTM_LOW_TRIGGER_DISABLE 0
  13411. #define WL_ESTM_LOW_TRIGGER_DEFAULT 5 /* Mbps */
  13412. #define WL_ESTM_LOW_TRIGGER_MAX 250 /* Mbps */
  13413. #define WL_ESTM_ROAM_DELTA_DEFAULT 10
  13414. typedef struct wl_roam_prof_v3 {
  13415. uint8 roam_flags; /**< bit flags */
  13416. int8 roam_trigger; /**< RSSI trigger level per profile/RSSI bracket */
  13417. int8 rssi_lower;
  13418. int8 roam_delta;
  13419. /* if channel_usage if zero, roam_delta is rssi delta required for new AP */
  13420. /* if channel_usage if non-zero, roam_delta is score delta(%) required for new AP */
  13421. int8 rssi_boost_thresh; /**< Min RSSI to qualify for RSSI boost */
  13422. int8 rssi_boost_delta; /**< RSSI boost for AP in the other band */
  13423. uint16 nfscan; /**< number of full scan to start with */
  13424. uint16 fullscan_period;
  13425. uint16 init_scan_period;
  13426. uint16 backoff_multiplier;
  13427. uint16 max_scan_period;
  13428. uint8 channel_usage;
  13429. uint8 cu_avg_calc_dur;
  13430. uint16 estm_low_trigger; /**< ESTM low throughput roam trigger */
  13431. int8 estm_roam_delta; /**< ESTM low throughput roam delta */
  13432. uint8 pad;
  13433. } wl_roam_prof_v3_t;
  13434. typedef struct wl_roam_prof_v2 {
  13435. int8 roam_flags; /**< bit flags */
  13436. int8 roam_trigger; /**< RSSI trigger level per profile/RSSI bracket */
  13437. int8 rssi_lower;
  13438. int8 roam_delta;
  13439. /* if channel_usage if zero, roam_delta is rssi delta required for new AP */
  13440. /* if channel_usage if non-zero, roam_delta is score delta(%) required for new AP */
  13441. int8 rssi_boost_thresh; /**< Min RSSI to qualify for RSSI boost */
  13442. int8 rssi_boost_delta; /**< RSSI boost for AP in the other band */
  13443. uint16 nfscan; /**< number of full scan to start with */
  13444. uint16 fullscan_period;
  13445. uint16 init_scan_period;
  13446. uint16 backoff_multiplier;
  13447. uint16 max_scan_period;
  13448. uint8 channel_usage;
  13449. uint8 cu_avg_calc_dur;
  13450. uint8 pad[2];
  13451. } wl_roam_prof_v2_t;
  13452. typedef struct wl_roam_prof_v1 {
  13453. int8 roam_flags; /**< bit flags */
  13454. int8 roam_trigger; /**< RSSI trigger level per profile/RSSI bracket */
  13455. int8 rssi_lower;
  13456. int8 roam_delta;
  13457. /* if channel_usage if zero, roam_delta is rssi delta required for new AP */
  13458. /* if channel_usage if non-zero, roam_delta is score delta(%) required for new AP */
  13459. int8 rssi_boost_thresh; /**< Min RSSI to qualify for RSSI boost */
  13460. int8 rssi_boost_delta; /**< RSSI boost for AP in the other band */
  13461. uint16 nfscan; /**< number of full scan to start with */
  13462. uint16 fullscan_period;
  13463. uint16 init_scan_period;
  13464. uint16 backoff_multiplier;
  13465. uint16 max_scan_period;
  13466. } wl_roam_prof_v1_t;
  13467. typedef struct wl_roam_prof_band_v3 {
  13468. uint32 band; /**< Must be just one band */
  13469. uint16 ver; /**< version of this struct */
  13470. uint16 len; /**< length in bytes of this structure */
  13471. wl_roam_prof_v3_t roam_prof[WL_MAX_ROAM_PROF_BRACKETS];
  13472. } wl_roam_prof_band_v3_t;
  13473. typedef struct wl_roam_prof_band_v2 {
  13474. uint32 band; /**< Must be just one band */
  13475. uint16 ver; /**< version of this struct */
  13476. uint16 len; /**< length in bytes of this structure */
  13477. wl_roam_prof_v2_t roam_prof[WL_MAX_ROAM_PROF_BRACKETS];
  13478. } wl_roam_prof_band_v2_t;
  13479. typedef struct wl_roam_prof_band_v1 {
  13480. uint32 band; /**< Must be just one band */
  13481. uint16 ver; /**< version of this struct */
  13482. uint16 len; /**< length in bytes of this structure */
  13483. wl_roam_prof_v1_t roam_prof[WL_MAX_ROAM_PROF_BRACKETS];
  13484. } wl_roam_prof_band_v1_t;
  13485. #define BSS_MAXTABLE_SIZE 10
  13486. #define WNM_BSS_SELECT_FACTOR_VERSION 1
  13487. typedef struct wnm_bss_select_factor_params {
  13488. uint8 low;
  13489. uint8 high;
  13490. uint8 factor;
  13491. uint8 pad;
  13492. } wnm_bss_select_factor_params_t;
  13493. #define WNM_BSS_SELECT_FIXED_SIZE OFFSETOF(wnm_bss_select_factor_cfg_t, params)
  13494. typedef struct wnm_bss_select_factor_cfg {
  13495. uint8 version;
  13496. uint8 band;
  13497. uint16 type;
  13498. uint16 pad;
  13499. uint16 count;
  13500. wnm_bss_select_factor_params_t params[1];
  13501. } wnm_bss_select_factor_cfg_t;
  13502. #define WNM_BSS_SELECT_WEIGHT_VERSION 1
  13503. typedef struct wnm_bss_select_weight_cfg {
  13504. uint8 version;
  13505. uint8 band;
  13506. uint16 type;
  13507. uint16 weight; /* weightage for each type between 0 to 100 */
  13508. } wnm_bss_select_weight_cfg_t;
  13509. /* For branches before koala .. wbtext is part
  13510. * of wnm need to use below type only
  13511. */
  13512. typedef struct wnm_btm_default_score_cfg {
  13513. uint32 default_score; /* default score */
  13514. uint8 band;
  13515. } wnm_btm_default_score_cfg_t;
  13516. /* For branches from koala and above .. wbtext is
  13517. * seperate module..need to use below type only
  13518. */
  13519. typedef struct wbtext_btm_default_score_cfg {
  13520. uint32 default_score; /* default score */
  13521. uint8 band;
  13522. } wbtext_btm_default_score_cfg_t;
  13523. #define WNM_BSS_SELECT_TYPE_RSSI 0
  13524. #define WNM_BSS_SELECT_TYPE_CU 1
  13525. #define WNM_BSS_SELECT_TYPE_ESTM_DL 2
  13526. #define WNM_BSSLOAD_MONITOR_VERSION 1
  13527. typedef struct wnm_bssload_monitor_cfg {
  13528. uint8 version;
  13529. uint8 band;
  13530. uint8 duration; /* duration between 1 to 20sec */
  13531. } wnm_bssload_monitor_cfg_t;
  13532. #define WNM_ROAM_TRIGGER_VERSION 1
  13533. typedef struct wnm_roam_trigger_cfg {
  13534. uint8 version;
  13535. uint8 band;
  13536. uint16 type;
  13537. int16 trigger; /* trigger for each type in new roam algorithm */
  13538. } wnm_roam_trigger_cfg_t;
  13539. /* Data structures for Interface Create/Remove */
  13540. #define WL_INTERFACE_CREATE_VER_1 1
  13541. #define WL_INTERFACE_CREATE_VER_2 2
  13542. #define WL_INTERFACE_CREATE_VER_3 3
  13543. /*
  13544. * The flags filed of the wl_interface_create is designed to be
  13545. * a Bit Mask. As of now only Bit 0 and Bit 1 are used as mentioned below.
  13546. * The rest of the bits can be used, incase we have to provide
  13547. * more information to the dongle
  13548. */
  13549. /*
  13550. * Bit 0 of flags field is used to inform whether the interface requested to
  13551. * be created is STA or AP.
  13552. * 0 - Create a STA interface
  13553. * 1 - Create an AP interface
  13554. * NOTE: This Bit 0 is applicable for the WL_INTERFACE_CREATE_VER < 2
  13555. */
  13556. #define WL_INTERFACE_CREATE_STA (0 << 0)
  13557. #define WL_INTERFACE_CREATE_AP (1 << 0)
  13558. /*
  13559. * From revision >= 2 Bit 0 of flags field will not used be for STA or AP interface creation.
  13560. * "iftype" field shall be used for identifying the interface type.
  13561. */
  13562. typedef enum wl_interface_type {
  13563. WL_INTERFACE_TYPE_STA = 0,
  13564. WL_INTERFACE_TYPE_AP = 1,
  13565. WL_INTERFACE_TYPE_AWDL = 2,
  13566. WL_INTERFACE_TYPE_NAN = 3,
  13567. WL_INTERFACE_TYPE_P2P_GO = 4,
  13568. WL_INTERFACE_TYPE_P2P_GC = 5,
  13569. WL_INTERFACE_TYPE_P2P_DISC = 6,
  13570. WL_INTERFACE_TYPE_IBSS = 7,
  13571. WL_INTERFACE_TYPE_MAX
  13572. } wl_interface_type_t;
  13573. /*
  13574. * Bit 1 of flags field is used to inform whether MAC is present in the
  13575. * data structure or not.
  13576. * 0 - Ignore mac_addr field
  13577. * 1 - Use the mac_addr field
  13578. */
  13579. #define WL_INTERFACE_MAC_DONT_USE (0 << 1)
  13580. #define WL_INTERFACE_MAC_USE (1 << 1)
  13581. /*
  13582. * Bit 2 of flags field is used to inform whether core or wlc index
  13583. * is present in the data structure or not.
  13584. * 0 - Ignore wlc_index field
  13585. * 1 - Use the wlc_index field
  13586. */
  13587. #define WL_INTERFACE_WLC_INDEX_DONT_USE (0 << 2)
  13588. #define WL_INTERFACE_WLC_INDEX_USE (1 << 2)
  13589. /*
  13590. * Bit 3 of flags field is used to create interface on the host requested interface index
  13591. * 0 - Ignore if_index field
  13592. * 1 - Use the if_index field
  13593. */
  13594. #define WL_INTERFACE_IF_INDEX_USE (1 << 3)
  13595. /*
  13596. * Bit 4 of flags field is used to assign BSSID
  13597. * 0 - Ignore bssid field
  13598. * 1 - Use the bssid field
  13599. */
  13600. #define WL_INTERFACE_BSSID_INDEX_USE (1 << 4)
  13601. typedef struct wl_interface_create {
  13602. uint16 ver; /**< version of this struct */
  13603. uint8 pad1[2]; /**< Padding bytes */
  13604. uint32 flags; /**< flags that defines the operation */
  13605. struct ether_addr mac_addr; /**< Optional Mac address */
  13606. uint8 pad2[2]; /**< Padding bytes */
  13607. uint32 wlc_index; /**< Optional wlc index */
  13608. } wl_interface_create_v1_t;
  13609. typedef struct wl_interface_create_v2 {
  13610. uint16 ver; /**< version of this struct */
  13611. uint8 pad1[2]; /**< Padding bytes */
  13612. uint32 flags; /**< flags that defines the operation */
  13613. struct ether_addr mac_addr; /**< Optional Mac address */
  13614. uint8 iftype; /**< Type of interface created */
  13615. uint8 pad2; /**< Padding bytes */
  13616. uint32 wlc_index; /**< Optional wlc index */
  13617. } wl_interface_create_v2_t;
  13618. typedef struct wl_interface_create_v3 {
  13619. uint16 ver; /**< version of this struct */
  13620. uint16 len; /**< length of whole structure including variable length */
  13621. uint16 fixed_len; /**< Fixed length of this structure excluding data[] */
  13622. uint8 iftype; /**< Type of interface created */
  13623. uint8 wlc_index; /**< Optional wlc index */
  13624. uint32 flags; /**< flags that defines the operation */
  13625. struct ether_addr mac_addr; /**< Optional Mac address */
  13626. struct ether_addr bssid; /**< Optional BSSID */
  13627. uint8 if_index; /**< interface index requested by Host */
  13628. uint8 pad[3]; /**< Padding bytes to ensure data[] is at 32 bit aligned */
  13629. uint8 data[]; /**< Optional application/Module specific data */
  13630. } wl_interface_create_v3_t;
  13631. #define WL_INTERFACE_INFO_VER_1 1
  13632. #define WL_INTERFACE_INFO_VER_2 2
  13633. typedef struct wl_interface_info_v1 {
  13634. uint16 ver; /**< version of this struct */
  13635. struct ether_addr mac_addr; /**< MAC address of the interface */
  13636. char ifname[BCM_MSG_IFNAME_MAX]; /**< name of interface */
  13637. uint8 bsscfgidx; /**< source bsscfg index */
  13638. uint8 PAD;
  13639. } wl_interface_info_v1_t;
  13640. typedef struct wl_interface_info_v2 {
  13641. uint16 ver; /**< version of this struct */
  13642. uint16 length; /**< length of the whole structure */
  13643. struct ether_addr mac_addr; /**< MAC address of the interface */
  13644. uint8 bsscfgidx; /**< source bsscfg index */
  13645. uint8 if_index; /**< Interface index allocated by FW */
  13646. char ifname[BCM_MSG_IFNAME_MAX]; /**< name of interface */
  13647. } wl_interface_info_v2_t;
  13648. #define PHY_RXIQEST_AVERAGING_DELAY 10
  13649. typedef struct wl_iqest_params {
  13650. uint32 rxiq;
  13651. uint8 niter;
  13652. uint8 delay;
  13653. uint8 PAD[2];
  13654. } wl_iqest_params_t;
  13655. typedef struct wl_iqest_sweep_params {
  13656. wl_iqest_params_t params;
  13657. uint8 nchannels;
  13658. uint8 channel[3]; /** variable */
  13659. } wl_iqest_sweep_params_t;
  13660. typedef struct wl_iqest_value {
  13661. uint8 channel;
  13662. uint8 PAD[3];
  13663. uint32 rxiq;
  13664. } wl_iqest_value_t;
  13665. typedef struct wl_iqest_result {
  13666. uint8 nvalues;
  13667. uint8 PAD[3];
  13668. wl_iqest_value_t value[1];
  13669. } wl_iqest_result_t;
  13670. #define WL_PRIO_ROAM_PROF_V1 (1u)
  13671. typedef struct wl_prio_roam_prof_v1 {
  13672. uint16 version; /* Version info */
  13673. uint16 length; /* byte length of this structure */
  13674. uint8 prio_roam_mode; /* Roam mode RCC/RCC+Full Scan */
  13675. uint8 PAD[3];
  13676. } wl_prio_roam_prof_v1_t;
  13677. typedef enum wl_prio_roam_mode {
  13678. PRIO_ROAM_MODE_OFF = 0, /* Prio_Roam feature disable */
  13679. PRIO_ROAM_MODE_RCC_ONLY = 1, /* Scan RCC list only */
  13680. PRIO_ROAM_MODE_RCC_FULLSCAN = 2, /* Scan RCC list + Full scan */
  13681. PRIO_ROAM_MODE_FULLSCAN_ONLY = 3 /* Full Scan only */
  13682. } wl_prio_roam_mode_t;
  13683. /* BTCX AIBSS (Oxygen) Status */
  13684. typedef struct wlc_btc_aibss_info {
  13685. uint32 prev_tsf_l; // Lower 32 bits of last read of TSF
  13686. uint32 prev_tsf_h; // Higher 32 bits of last read of TSF
  13687. uint32 last_btinfo; // Last read of BT info
  13688. uint32 local_btinfo; // Local BT INFO BitMap
  13689. uint8 bt_out_of_sync_cnt; // BT not in sync with strobe
  13690. uint8 esco_off_cnt; // Count incremented when ESCO is off
  13691. uint8 strobe_enabled; // Set only in AIBSS mode
  13692. uint8 strobe_on; // strobe to BT is on for Oxygen
  13693. uint8 local_bt_in_sync; // Sync status of local BT when strobe is on
  13694. uint8 other_bt_in_sync; // Sync state of BT in other devices in AIBSS
  13695. uint8 local_bt_is_master; // Local BT is master
  13696. uint8 sco_prot_on; // eSCO Protection on in local device
  13697. uint8 other_esco_present; // eSCO status in other devices in AIBSS
  13698. uint8 rx_agg_change; // Indicates Rx Agg size needs to change
  13699. uint8 rx_agg_modified; // Rx Agg size modified
  13700. uint8 acl_grant_set; // ACL grants on for speeding up sync
  13701. uint8 write_ie_err_cnt; // BTCX Ie write error cnt
  13702. uint8 parse_ie_err_cnt; // BTCX IE parse error cnt
  13703. uint8 wci2_fail_cnt; // WCI2 init failure cnt
  13704. uint8 strobe_enable_err_cnt; // Strobe enable err cnt
  13705. uint8 strobe_init_err_cnt; // Strobe init err cnt
  13706. uint8 tsf_jump_cnt; // TSF jump cnt
  13707. uint8 acl_grant_cnt; // ALC grant cnt
  13708. uint8 pad1;
  13709. uint16 ibss_tsf_shm; // SHM address of strobe TSF
  13710. uint16 pad2;
  13711. } wlc_btc_aibss_info_t;
  13712. #define WLC_BTC_AIBSS_STATUS_VER 1
  13713. #define WLC_BTC_AIBSS_STATUS_LEN (sizeof(wlc_btc_aibss_status_t) - 2 * (sizeof(uint16)))
  13714. typedef struct wlc_btc_aibss_status {
  13715. uint16 version; // Version #
  13716. uint16 len; // Length of the structure(excluding len & version)
  13717. int32 mode; // Current value of btc_mode
  13718. uint16 bth_period; // bt coex period. read from shm.
  13719. uint16 agg_off_bm; // AGG OFF BM read from SHM
  13720. uint8 bth_active; // bt active session
  13721. uint8 pad[3];
  13722. wlc_btc_aibss_info_t aibss_info; // Structure definition above
  13723. } wlc_btc_aibss_status_t;
  13724. typedef enum {
  13725. STATE_NONE = 0,
  13726. /* WLAN -> BT */
  13727. W2B_DATA_SET = 21,
  13728. B2W_ACK_SET = 22,
  13729. W2B_DATA_CLEAR = 23,
  13730. B2W_ACK_CLEAR = 24,
  13731. /* BT -> WLAN */
  13732. B2W_DATA_SET = 31,
  13733. W2B_ACK_SET = 32,
  13734. B2W_DATA_CLEAR = 33,
  13735. W2B_ACK_CLEAR = 34
  13736. } bwte_gci_intstate_t;
  13737. #define WL_BWTE_STATS_VERSION 1 /* version of bwte_stats_t */
  13738. typedef struct {
  13739. uint32 version;
  13740. bwte_gci_intstate_t inttobt;
  13741. bwte_gci_intstate_t intfrombt;
  13742. uint32 bt2wl_intrcnt; /* bt->wlan interrrupt count */
  13743. uint32 wl2bt_intrcnt; /* wlan->bt interrupt count */
  13744. uint32 wl2bt_dset_cnt;
  13745. uint32 wl2bt_dclear_cnt;
  13746. uint32 wl2bt_aset_cnt;
  13747. uint32 wl2bt_aclear_cnt;
  13748. uint32 bt2wl_dset_cnt;
  13749. uint32 bt2wl_dclear_cnt;
  13750. uint32 bt2wl_aset_cnt;
  13751. uint32 bt2wl_aclear_cnt;
  13752. uint32 state_error_1;
  13753. uint32 state_error_2;
  13754. uint32 state_error_3;
  13755. uint32 state_error_4;
  13756. } bwte_stats_t;
  13757. #define TBOW_MAX_SSID_LEN 32
  13758. #define TBOW_MAX_PASSPHRASE_LEN 63
  13759. #define WL_TBOW_SETUPINFO_T_VERSION 1 /* version of tbow_setup_netinfo_t */
  13760. typedef struct tbow_setup_netinfo {
  13761. uint32 version;
  13762. uint8 opmode;
  13763. uint8 pad;
  13764. uint8 macaddr[ETHER_ADDR_LEN];
  13765. uint32 ssid_len;
  13766. uint8 ssid[TBOW_MAX_SSID_LEN];
  13767. uint8 passphrase_len;
  13768. uint8 passphrase[TBOW_MAX_PASSPHRASE_LEN];
  13769. chanspec_t chanspec;
  13770. uint8 PAD[2];
  13771. uint32 channel;
  13772. } tbow_setup_netinfo_t;
  13773. typedef enum tbow_ho_opmode {
  13774. TBOW_HO_MODE_START_GO = 0,
  13775. TBOW_HO_MODE_START_STA,
  13776. TBOW_HO_MODE_START_GC,
  13777. TBOW_HO_MODE_TEST_GO,
  13778. TBOW_HO_MODE_STOP_GO = 0x10,
  13779. TBOW_HO_MODE_STOP_STA,
  13780. TBOW_HO_MODE_STOP_GC,
  13781. TBOW_HO_MODE_TEARDOWN
  13782. } tbow_ho_opmode_t;
  13783. /* Beacon trim feature statistics */
  13784. /* configuration */
  13785. #define BCNTRIMST_PER 0 /* Number of beacons to trim (0: disable) */
  13786. #define BCNTRIMST_TIMEND 1 /* Number of bytes till TIM IE */
  13787. #define BCNTRIMST_TSFLMT 2 /* TSF tolerance value (usecs) */
  13788. /* internal use */
  13789. #define BCNTRIMST_CUR 3 /* PSM's local beacon trim counter */
  13790. #define BCNTRIMST_PREVLEN 4 /* Beacon length excluding the TIM IE */
  13791. #define BCNTRIMST_TIMLEN 5 /* TIM IE Length */
  13792. #define BCNTRIMST_RSSI 6 /* Partial beacon RSSI */
  13793. #define BCNTRIMST_CHAN 7 /* Partial beacon channel */
  13794. /* debug stat (off by default) */
  13795. #define BCNTRIMST_DUR 8 /* RX duration until beacon trimmed */
  13796. #define BCNTRIMST_RXMBSS 9 /* MYBSSID beacon received */
  13797. #define BCNTRIMST_CANTRIM 10 /* # beacons which were trimmed */
  13798. #define BCNTRIMST_LENCHG 11 /* # beacons not trimmed due to length change */
  13799. #define BCNTRIMST_TSFDRF 12 /* # beacons not trimmed due to large TSF delta */
  13800. #define BCNTRIMST_NOTIM 13 /* # beacons not trimmed due to TIM missing */
  13801. #define BCNTRIMST_NUM 14
  13802. #define WL_BCNTRIM_STATUS_VERSION_1 1
  13803. typedef struct wl_bcntrim_status_query_v1 {
  13804. uint16 version;
  13805. uint16 len; /* Total length includes fixed fields */
  13806. uint8 reset; /* reset after reading the stats */
  13807. uint8 pad[3]; /* 4-byte alignment */
  13808. } wl_bcntrim_status_query_v1_t;
  13809. typedef struct wl_bcntrim_status_v1 {
  13810. uint16 version;
  13811. uint16 len; /* Total length includes fixed fields and variable data[] */
  13812. uint8 curr_slice_id; /* slice index of the interface */
  13813. uint8 applied_cfg; /* applied bcntrim N threshold */
  13814. uint8 pad[2]; /* 4-byte alignment */
  13815. uint32 fw_status; /* Bits representing bcntrim disable reason in FW */
  13816. uint32 total_disable_dur; /* total duration (msec) bcntrim remains
  13817. disabled due to FW disable reasons
  13818. */
  13819. uint32 data[]; /* variable length data containing stats */
  13820. } wl_bcntrim_status_v1_t;
  13821. #define BCNTRIM_STATS_MAX 10 /* Total stats part of the status data[] */
  13822. /* Bits for FW status */
  13823. #define WL_BCNTRIM_DISABLE_HOST 0x1 /* Host disabled bcntrim through bcntrim IOVar */
  13824. #define WL_BCNTRIM_DISABLE_PHY_RATE 0x2 /* bcntrim disabled because beacon rx rate is
  13825. * higher than phy_rate_thresh
  13826. */
  13827. #define WL_BCNTRIM_DISABLE_QUIET_IE 0x4 /* bcntrim disable when Quiet IE present */
  13828. #define WL_BCNTRIM_DISABLE_QBSSLOAD_IE 0x8 /* bcntrim disable when QBSS Load IE present */
  13829. #define WL_BCNTRIM_DISABLE_OPERMODE_IE 0x10 /* bcntrim dsiable when opermode IE is present */
  13830. #define WL_BCNTRIM_DISABLE_CSA_IE 0x20 /* bcntrim dsiable when CSA IE is present */
  13831. #define BCNTRIM_DISABLE_THRESHOLD_TIME 1000 * 10 /* enable bcntrim after a threshold (10sec)
  13832. * when disabled due to above mentioned IE's
  13833. */
  13834. #define WL_BCNTRIM_CFG_VERSION_1 1
  13835. /* Common IOVAR struct */
  13836. typedef struct wl_bcntrim_cfg_v1 {
  13837. uint16 version;
  13838. uint16 len; /* Total length includes fixed fields and variable data[] */
  13839. uint16 subcmd_id; /* subcommand id */
  13840. uint16 pad; /* pad/reserved */
  13841. uint8 data[]; /* subcommand data; could be empty */
  13842. } wl_bcntrim_cfg_v1_t;
  13843. /* subcommands ids */
  13844. enum {
  13845. WL_BCNTRIM_CFG_SUBCMD_PHY_RATE_THRESH = 0, /* PHY rate threshold above
  13846. which bcntrim is not applied
  13847. */
  13848. WL_BCNTRIM_CFG_SUBCMD_OVERRIDE_DISABLE_MASK = 1, /* Override bcntrim disable reasons */
  13849. WL_BCNTRIM_CFG_SUBCMD_TSF_DRIFT_LIMIT = 2 /* TSF drift limit to consider bcntrim */
  13850. };
  13851. #define BCNTRIM_MAX_PHY_RATE 48 /* in 500Kbps */
  13852. #define BCNTRIM_MAX_TSF_DRIFT 65535 /* in usec */
  13853. #define WL_BCNTRIM_OVERRIDE_DISABLE_MASK \
  13854. (WL_BCNTRIM_DISABLE_QUIET_IE | WL_BCNTRIM_DISABLE_QBSSLOAD_IE)
  13855. /* WL_BCNTRIM_CFG_SUBCMD_PHY_RATE_TRESH */
  13856. typedef struct wl_bcntrim_cfg_phy_rate_thresh {
  13857. uint32 rate; /* beacon rate (in 500kbps units) */
  13858. } wl_bcntrim_cfg_phy_rate_thresh_t;
  13859. /* WL_BCNTRIM_CFG_SUBCMD_OVERRIDE_DISABLE_MASK */
  13860. typedef struct wl_bcntrim_cfg_override_disable_mask {
  13861. uint32 mask; /* bits representing individual disable reason to override */
  13862. } wl_bcntrim_cfg_override_disable_mask_t;
  13863. /* WL_BCNTRIM_CFG_SUBCMD_TSF_DRIFT_LIMIT */
  13864. typedef struct wl_bcntrim_cfg_tsf_drift_limit {
  13865. uint16 drift; /* tsf drift limit specified in usec */
  13866. uint8 pad[2]; /* 4-byte alignment */
  13867. } wl_bcntrim_cfg_tsf_drift_limit_t;
  13868. /* -------------- TX Power Cap --------------- */
  13869. #define TXPWRCAP_MAX_NUM_CORES 8
  13870. #define TXPWRCAP_MAX_NUM_ANTENNAS (TXPWRCAP_MAX_NUM_CORES * 2)
  13871. #define TXPWRCAP_MAX_NUM_CORES_V3 4
  13872. #define TXPWRCAP_MAX_NUM_ANTENNAS_V3 (TXPWRCAP_MAX_NUM_CORES_V3 * 2)
  13873. #define TXPWRCAP_NUM_SUBBANDS 5
  13874. #define TXPWRCAP_MAX_NUM_SUBGRPS 10
  13875. /* IOVAR txcapconfig enum's */
  13876. #define TXPWRCAPCONFIG_WCI2 0u
  13877. #define TXPWRCAPCONFIG_HOST 1u
  13878. #define TXPWRCAPCONFIG_WCI2_AND_HOST 2u
  13879. #define TXPWRCAPCONFIG_NONE 0xFFu
  13880. /* IOVAR txcapstate enum's */
  13881. #define TXPWRCAPSTATE_LOW_CAP 0
  13882. #define TXPWRCAPSTATE_HIGH_CAP 1
  13883. #define TXPWRCAPSTATE_HOST_LOW_WCI2_LOW_CAP 0
  13884. #define TXPWRCAPSTATE_HOST_LOW_WCI2_HIGH_CAP 1
  13885. #define TXPWRCAPSTATE_HOST_HIGH_WCI2_LOW_CAP 2
  13886. #define TXPWRCAPSTATE_HOST_HIGH_WCI2_HIGH_CAP 3
  13887. /* IOVAR txcapconfig and txcapstate structure is shared: SET and GET */
  13888. #define TXPWRCAPCTL_VERSION 2
  13889. #define TXPWRCAPCTL_VERSION_3 3
  13890. typedef struct wl_txpwrcap_ctl {
  13891. uint8 version;
  13892. uint8 ctl[TXPWRCAP_NUM_SUBBANDS];
  13893. } wl_txpwrcap_ctl_t;
  13894. typedef struct wl_txpwrcap_ctl_v3 {
  13895. uint8 version;
  13896. uint8 ctl[TXPWRCAP_MAX_NUM_SUBGRPS];
  13897. } wl_txpwrcap_ctl_v3_t;
  13898. /* IOVAR txcapdump structure: GET only */
  13899. #define TXPWRCAP_DUMP_VERSION 2
  13900. typedef struct wl_txpwrcap_dump {
  13901. uint8 version;
  13902. uint8 pad0;
  13903. uint8 current_country[2];
  13904. uint32 current_channel;
  13905. uint8 config[TXPWRCAP_NUM_SUBBANDS];
  13906. uint8 state[TXPWRCAP_NUM_SUBBANDS];
  13907. uint8 high_cap_state_enabled;
  13908. uint8 wci2_cell_status_last;
  13909. uint8 download_present;
  13910. uint8 num_subbands;
  13911. uint8 num_antennas;
  13912. uint8 num_antennas_per_core[TXPWRCAP_MAX_NUM_CORES];
  13913. uint8 num_cc_groups;
  13914. uint8 current_country_cc_group_info_index;
  13915. int8 low_cap[TXPWRCAP_MAX_NUM_ANTENNAS*TXPWRCAP_NUM_SUBBANDS];
  13916. int8 high_cap[TXPWRCAP_MAX_NUM_ANTENNAS*TXPWRCAP_NUM_SUBBANDS];
  13917. uint8 PAD[3];
  13918. } wl_txpwrcap_dump_t;
  13919. typedef struct wl_txpwrcap_dump_v3 {
  13920. uint8 version;
  13921. uint8 pad0;
  13922. uint8 current_country[2];
  13923. uint32 current_channel;
  13924. uint8 config[TXPWRCAP_NUM_SUBBANDS];
  13925. uint8 state[TXPWRCAP_NUM_SUBBANDS];
  13926. uint8 high_cap_state_enabled;
  13927. uint8 wci2_cell_status_last;
  13928. uint8 download_present;
  13929. uint8 num_subbands;
  13930. uint8 num_antennas;
  13931. uint8 num_antennas_per_core[TXPWRCAP_MAX_NUM_CORES];
  13932. uint8 num_cc_groups;
  13933. uint8 current_country_cc_group_info_index;
  13934. uint8 cap_states_per_cc_group;
  13935. int8 host_low_wci2_low_cap[TXPWRCAP_MAX_NUM_ANTENNAS*TXPWRCAP_NUM_SUBBANDS];
  13936. int8 host_low_wci2_high_cap[TXPWRCAP_MAX_NUM_ANTENNAS*TXPWRCAP_NUM_SUBBANDS];
  13937. int8 host_high_wci2_low_cap[TXPWRCAP_MAX_NUM_ANTENNAS*TXPWRCAP_NUM_SUBBANDS];
  13938. int8 host_high_wci2_high_cap[TXPWRCAP_MAX_NUM_ANTENNAS*TXPWRCAP_NUM_SUBBANDS];
  13939. uint8 PAD[2];
  13940. } wl_txpwrcap_dump_v3_t;
  13941. /*
  13942. * Capability flag for wl_txpwrcap_tbl_v2_t and wl_txpwrcap_t
  13943. * The index into pwrs will be: 0: onbody-cck, 1: onbody-ofdm, 2:offbody-cck, 3:offbody-ofdm
  13944. *
  13945. * For 5G power in SDB case as well as for non-SDB case, the value of flag will be: CAP_ONOFF_BODY
  13946. * The index into pwrs will be: 0: onbody, 1: offbody-ofdm
  13947. */
  13948. #define CAP_ONOFF_BODY (0x1) /* on/off body only */
  13949. #define CAP_CCK_OFDM (0x2) /* cck/ofdm capability only */
  13950. #define CAP_LTE_CELL (0x4) /* cell on/off capability; required for iOS builds */
  13951. #define CAP_HEAD_BODY (0x8) /* head/body capability */
  13952. #define CAP_2G_DEPON_5G (0x10) /* 2G pwr caps depend on other slice 5G subband */
  13953. #define CAP_SISO_MIMO (0x20) /* Siso/Mimo Separate Power Caps */
  13954. #define CAP_ANT_TX (0x40) /* Separate Power Caps based on cell ant tx value */
  13955. #define CAP_LTE_PQBIT (0x100u) /* QPBit is enabled */
  13956. #define CAP_ONOFF_BODY_CCK_OFDM (CAP_ONOFF_BODY | CAP_CCK_OFDM)
  13957. #define CAP_TXPWR_ALL (CAP_ONOFF_BODY|CAP_CCK_OFDM|CAP_LTE_CELL|\
  13958. CAP_SISO_MIMO|CAP_HEAD_BODY|CAP_ANT_TX)
  13959. #define TXHDR_SEC_MAX 5u /* Deprecated. Kept till removed in all branches */
  13960. #define TXPWRCAP_MAX_STATES 4u
  13961. #define TXPWRCAP_MAX_STATES_V3 10u
  13962. #define TXPWRCAP_CCKOFDM_ONOFFBODY_MAX_STATES 4u
  13963. #define TXPWRCAP_ONOFFBODY_MAX_STATES 2u
  13964. #define TXPWRCAP_ONOFFCELL_MAX_STATES 2u
  13965. #define TXHDR_SEC_NONSDB_MAIN_2G 0
  13966. #define TXHDR_SEC_NONSDB_MAIN_5G 1
  13967. #define TXHDR_SEC_NONSDB_AUX_2G 2
  13968. #define TXHDR_SEC_NONSDB_AUX_5G 3
  13969. #define TXHDR_SEC_SDB_MAIN_2G 4
  13970. #define TXHDR_SEC_SDB_MAIN_5G 5
  13971. #define TXHDR_SEC_SDB_AUX_2G 6
  13972. #define TXHDR_SEC_SDB_AUX_5G 7
  13973. #define TXHDR_MAX_SECTION 8
  13974. #define WL_TXPWRCAP_MAX_SLICES 2
  13975. #define WL_TXPWRCAPDUMP_VER 4
  13976. #define WL_TXPWRCAP_VERSION_2 2
  13977. #define WL_TXPWRCAP_VERSION_3 3
  13978. typedef struct wl_txpwrcap {
  13979. uint8 capability;
  13980. uint8 num_cap_states;
  13981. uint8 section; /* Index from above,eg. TXHDR_SEC_NONSDB */
  13982. int8 pwrs[][TXPWRCAP_NUM_SUBBANDS][TXPWRCAP_MAX_NUM_CORES];
  13983. } wl_txpwrcap_t;
  13984. typedef struct {
  13985. uint8 capability;
  13986. uint8 num_cap_states;
  13987. uint8 num_subgrps;
  13988. uint8 section; /* Index from above,eg. TXHDR_SEC_NONSDB */
  13989. int8 pwrs[][TXPWRCAP_MAX_NUM_SUBGRPS][TXPWRCAP_MAX_NUM_ANTENNAS_V3];
  13990. } wl_txpwrcap_v2_t;
  13991. #define TXPWRCAP_DUMP_VERSION_4 4u
  13992. #define TXPWRCAP_DUMP_VERSION_5 5u
  13993. #define TXPWRCAP_DUMP_VERSION_6 6u
  13994. typedef struct wl_txpwrcap_dump_v4 {
  13995. uint8 version;
  13996. uint8 num_pwrcap;
  13997. uint8 current_country[2];
  13998. uint32 current_channel;
  13999. uint8 download_present;
  14000. uint8 num_cores; /* number cores on slice */
  14001. uint8 num_cc_groups; /* number cc groups */
  14002. uint8 current_country_cc_group_info_index;
  14003. /* first power cap always exist
  14004. * On main,-non-sdb follows by sdb2g and then sdb5g
  14005. * On aux slice - aux2g then aux5g.
  14006. */
  14007. wl_txpwrcap_t pwrcap; /* first power cap */
  14008. } wl_txpwrcap_dump_v4_t;
  14009. typedef struct wl_txpwrcap_dump_v5 {
  14010. uint8 version;
  14011. uint8 num_pwrcap;
  14012. uint8 current_country[2];
  14013. uint8 current_channel;
  14014. uint8 high_cap_state_enabled;
  14015. uint8 reserved[2];
  14016. uint8 download_present;
  14017. uint8 num_ants; /* number antenna slice */
  14018. uint8 num_cc_groups; /* number cc groups */
  14019. uint8 current_country_cc_group_info_index;
  14020. uint8 ant_tx; /* current value of ant_tx */
  14021. uint8 cell_status; /* current value of cell status */
  14022. int8 pwrcap[]; /* variable size power caps (wl_txpwrcap_v2_t) */
  14023. } wl_txpwrcap_dump_v5_t;
  14024. typedef struct wl_txpwrcap_dump_v6 {
  14025. uint8 version;
  14026. uint8 num_pwrcap;
  14027. uint8 current_country[2];
  14028. uint8 current_channel;
  14029. uint8 high_cap_state_enabled;
  14030. uint8 reserved[2];
  14031. uint8 download_present;
  14032. uint8 num_ants; /* number antenna slice */
  14033. uint8 num_cc_groups; /* number cc groups */
  14034. uint8 current_country_cc_group_info_index;
  14035. uint8 ant_tx; /* current value of ant_tx */
  14036. uint8 cell_status; /* current value of cell status */
  14037. uint16 capability[TXHDR_MAX_SECTION]; /* capabilities */
  14038. int8 pwrcap[]; /* variable size power caps (wl_txpwrcap_v2_t) */
  14039. } wl_txpwrcap_dump_v6_t;
  14040. #define TXCAPINFO_VERSION_1 1
  14041. typedef struct wl_txpwrcap_ccgrp_info {
  14042. uint8 num_cc;
  14043. char cc_list[1][2]; /* 2 letters for each country. At least one country */
  14044. } wl_txpwrcap_ccgrp_info_t;
  14045. typedef struct {
  14046. uint16 version;
  14047. uint16 length; /* length in bytes */
  14048. uint8 num_ccgrp;
  14049. /* followed by one or more wl_txpwrcap_ccgrp_info_t */
  14050. wl_txpwrcap_ccgrp_info_t ccgrp_data[1];
  14051. } wl_txpwrcap_info_t;
  14052. typedef struct wl_txpwrcap_tbl {
  14053. uint8 num_antennas_per_core[TXPWRCAP_MAX_NUM_CORES];
  14054. /* Stores values for valid antennas */
  14055. int8 pwrcap_cell_on[TXPWRCAP_MAX_NUM_ANTENNAS]; /* qdBm units */
  14056. int8 pwrcap_cell_off[TXPWRCAP_MAX_NUM_ANTENNAS]; /* qdBm units */
  14057. } wl_txpwrcap_tbl_t;
  14058. typedef struct wl_txpwrcap_tbl_v2 {
  14059. uint8 version;
  14060. uint8 length; /* size of entire structure, including the pwrs */
  14061. uint8 capability; /* capability bitmap */
  14062. uint8 num_cores; /* number of cores i.e. entries in each cap state row */
  14063. /*
  14064. * pwrs array has TXPWRCAP_MAX_STATES rows - one for each cap state.
  14065. * Each row has up to TXPWRCAP_MAX_NUM_CORES entries - one for each core.
  14066. */
  14067. uint8 pwrs[][TXPWRCAP_MAX_NUM_CORES]; /* qdBm units */
  14068. } wl_txpwrcap_tbl_v2_t;
  14069. typedef struct wl_txpwrcap_tbl_v3 {
  14070. uint8 version;
  14071. uint8 length; /* size of entire structure, including the pwrs */
  14072. uint8 capability; /* capability bitmap */
  14073. uint8 num_cores; /* number of cores */
  14074. uint8 num_antennas_per_core[TXPWRCAP_MAX_NUM_CORES_V3];
  14075. /*
  14076. * pwrs array has TXPWRCAP_MAX_STATES rows - one for each cap state.
  14077. * Each row has up to TXPWRCAP_MAX_NUM_ANTENNAS entries - for each antenna.
  14078. * Included in the rows of powers are rows for fail safe.
  14079. */
  14080. int8 pwrs[][TXPWRCAP_MAX_NUM_ANTENNAS_V3]; /* qdBm units */
  14081. } wl_txpwrcap_tbl_v3_t;
  14082. /* ##### Ecounters section ##### */
  14083. #define ECOUNTERS_VERSION_1 1
  14084. /* Input structure for ecounters IOVAR */
  14085. typedef struct ecounters_config_request {
  14086. uint16 version; /* config version */
  14087. uint16 set; /* Set where data will go. */
  14088. uint16 size; /* Size of the set. */
  14089. uint16 timeout; /* timeout in seconds. */
  14090. uint16 num_events; /* Number of events to report. */
  14091. uint16 ntypes; /* Number of entries in type array. */
  14092. uint16 type[1]; /* Statistics Types (tags) to retrieve. */
  14093. } ecounters_config_request_t;
  14094. #define ECOUNTERS_EVENTMSGS_VERSION_1 1
  14095. #define ECOUNTERS_TRIGGER_CONFIG_VERSION_1 1
  14096. #define ECOUNTERS_EVENTMSGS_EXT_MASK_OFFSET \
  14097. OFFSETOF(ecounters_eventmsgs_ext_t, mask[0])
  14098. #define ECOUNTERS_TRIG_CONFIG_TYPE_OFFSET \
  14099. OFFSETOF(ecounters_trigger_config_t, type[0])
  14100. typedef struct ecounters_eventmsgs_ext {
  14101. uint8 version;
  14102. uint8 len;
  14103. uint8 mask[1];
  14104. } ecounters_eventmsgs_ext_t;
  14105. typedef struct ecounters_trigger_config {
  14106. uint16 version; /* version */
  14107. uint16 set; /* set where data should go */
  14108. uint16 rsvd; /* reserved */
  14109. uint16 pad; /* pad/reserved */
  14110. uint16 ntypes; /* number of types/tags */
  14111. uint16 type[1]; /* list of types */
  14112. } ecounters_trigger_config_t;
  14113. #define ECOUNTERS_TRIGGER_REASON_VERSION_1 1
  14114. typedef enum {
  14115. /* Triggered due to timer based ecounters */
  14116. ECOUNTERS_TRIGGER_REASON_TIMER = 0,
  14117. /* Triggered due to event based configuration */
  14118. ECOUNTERS_TRIGGER_REASON_EVENTS = 1,
  14119. ECOUNTERS_TRIGGER_REASON_D2H_EVENTS = 2,
  14120. ECOUNTERS_TRIGGER_REASON_H2D_EVENTS = 3,
  14121. ECOUNTERS_TRIGGER_REASON_USER_EVENTS = 4,
  14122. ECOUNTERS_TRIGGER_REASON_MAX = 5
  14123. } ecounters_trigger_reasons_list_t;
  14124. typedef struct ecounters_trigger_reason {
  14125. uint16 version; /* version */
  14126. uint16 trigger_reason; /* trigger reason */
  14127. uint32 sub_reason_code; /* sub reason code */
  14128. uint32 trigger_time_now; /* time in ms at trigger */
  14129. uint32 host_ref_time; /* host ref time */
  14130. } ecounters_trigger_reason_t;
  14131. #define WL_LQM_VERSION_1 1
  14132. /* For wl_lqm_t flags field */
  14133. #define WL_LQM_CURRENT_BSS_VALID 0x1
  14134. #define WL_LQM_TARGET_BSS_VALID 0x2
  14135. #define WL_PERIODIC_COMPACT_CNTRS_VER_1 (1)
  14136. #define WL_PERIODIC_TXBF_CNTRS_VER_1 (1)
  14137. typedef struct {
  14138. uint16 version;
  14139. uint16 pad;
  14140. /* taken from wl_wlc_cnt_t */
  14141. uint32 txfail;
  14142. /* taken from wl_cnt_ge40mcst_v1_t */
  14143. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  14144. * Control Management (includes retransmissions)
  14145. */
  14146. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  14147. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  14148. uint32 txback; /**< blockack txcnt */
  14149. uint32 txucast; /**< number of unicast tx expecting response other than cts/cwcts */
  14150. uint32 txnoack; /**< dot11ACKFailureCount */
  14151. uint32 txframe; /**< tx data frames */
  14152. uint32 txretrans; /**< tx mac retransmits */
  14153. uint32 txpspoll; /**< Number of TX PS-poll */
  14154. uint32 rxrsptmout; /**< number of response timeouts for transmitted frames
  14155. * expecting a response
  14156. */
  14157. uint32 txrtsfail; /**< number of rts transmission failure that reach retry limit */
  14158. uint32 rxstrt; /**< number of received frames with a good PLCP */
  14159. uint32 rxbadplcp; /**< number of parity check of the PLCP header failed */
  14160. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  14161. uint32 rxnodelim; /**< number of no valid delimiter detected by ampdu parser */
  14162. uint32 bphy_badplcp; /**< number of bad PLCP reception on BPHY rate */
  14163. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  14164. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  14165. uint32 rxf0ovfl; /**< number of receive fifo 0 overflows */
  14166. uint32 rxf1ovfl; /**< number of receive fifo 0 overflows */
  14167. uint32 rxhlovfl; /**< number of length / header fifo overflows */
  14168. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  14169. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  14170. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  14171. uint32 rxback; /**< blockack rxcnt */
  14172. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  14173. uint32 rxdtucastmbss; /**< number of received DATA frames with good FCS and matching RA */
  14174. uint32 rxbeaconobss; /**< beacons received from other BSS */
  14175. uint32 rxdtucastobss; /**< number of unicast frames addressed to the MAC from
  14176. * other BSS (WDS FRAME)
  14177. */
  14178. uint32 rxdtocast; /**< number of received DATA frames (good FCS and no matching RA) */
  14179. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  14180. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  14181. uint32 rxdtmcast; /**< number of RX Data multicast frames received by the MAC */
  14182. uint32 rxmpdu_mu; /**< Number of MU MPDUs received */
  14183. uint32 rxtoolate; /**< receive too late */
  14184. uint32 rxframe; /**< rx data frames */
  14185. uint32 lqcm_report; /**< lqcm metric tx/rx idx */
  14186. uint32 tx_toss_cnt; /* number of tx packets tossed */
  14187. uint32 rx_toss_cnt; /* number of rx packets tossed */
  14188. uint32 last_tx_toss_rsn; /* reason because of which last tx pkt tossed */
  14189. uint32 last_rx_toss_rsn; /* reason because of which last rx pkt tossed */
  14190. uint32 txbcnfrm; /**< beacons transmitted */
  14191. } wl_periodic_compact_cntrs_v1_t;
  14192. #define WL_PERIODIC_COMPACT_CNTRS_VER_2 (2)
  14193. typedef struct {
  14194. uint16 version;
  14195. uint16 pad;
  14196. /* taken from wl_wlc_cnt_t */
  14197. uint32 txfail;
  14198. /* taken from wl_cnt_ge40mcst_v1_t */
  14199. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  14200. * Control Management (includes retransmissions)
  14201. */
  14202. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  14203. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  14204. uint32 txback; /**< blockack txcnt */
  14205. uint32 txucast; /**< number of unicast tx expecting response other than cts/cwcts */
  14206. uint32 txnoack; /**< dot11ACKFailureCount */
  14207. uint32 txframe; /**< tx data frames */
  14208. uint32 txretrans; /**< tx mac retransmits */
  14209. uint32 txpspoll; /**< Number of TX PS-poll */
  14210. uint32 rxrsptmout; /**< number of response timeouts for transmitted frames
  14211. * expecting a response
  14212. */
  14213. uint32 txrtsfail; /**< number of rts transmission failure that reach retry limit */
  14214. uint32 rxstrt; /**< number of received frames with a good PLCP */
  14215. uint32 rxbadplcp; /**< number of parity check of the PLCP header failed */
  14216. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  14217. uint32 rxnodelim; /**< number of no valid delimiter detected by ampdu parser */
  14218. uint32 bphy_badplcp; /**< number of bad PLCP reception on BPHY rate */
  14219. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  14220. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  14221. uint32 rxf0ovfl; /**< number of receive fifo 0 overflows */
  14222. uint32 rxf1ovfl; /**< number of receive fifo 0 overflows */
  14223. uint32 rxhlovfl; /**< number of length / header fifo overflows */
  14224. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  14225. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  14226. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  14227. uint32 rxback; /**< blockack rxcnt */
  14228. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  14229. uint32 rxdtucastmbss; /**< number of received DATA frames with good FCS and matching RA */
  14230. uint32 rxbeaconobss; /**< beacons received from other BSS */
  14231. uint32 rxdtucastobss; /**< number of unicast frames addressed to the MAC from
  14232. * other BSS (WDS FRAME)
  14233. */
  14234. uint32 rxdtocast; /**< number of received DATA frames (good FCS and no matching RA) */
  14235. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  14236. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  14237. uint32 rxdtmcast; /**< number of RX Data multicast frames received by the MAC */
  14238. uint32 rxmpdu_mu; /**< Number of MU MPDUs received */
  14239. uint32 rxtoolate; /**< receive too late */
  14240. uint32 rxframe; /**< rx data frames */
  14241. uint32 lqcm_report; /**< lqcm metric tx/rx idx */
  14242. uint32 tx_toss_cnt; /* number of tx packets tossed */
  14243. uint32 rx_toss_cnt; /* number of rx packets tossed */
  14244. uint32 last_tx_toss_rsn; /* reason because of which last tx pkt tossed */
  14245. uint32 last_rx_toss_rsn; /* reason because of which last rx pkt tossed */
  14246. uint32 txbcnfrm; /**< beacons transmitted */
  14247. uint32 rxretry; /* Number of rx packets received after retry */
  14248. uint32 rxdup; /* Number of dump packet. Indicates whether peer is receiving ack */
  14249. uint32 chswitch_cnt; /* Number of channel switches */
  14250. uint32 pm_dur; /* Total sleep time in PM, msecs */
  14251. } wl_periodic_compact_cntrs_v2_t;
  14252. #define WL_PERIODIC_COMPACT_CNTRS_VER_3 (3)
  14253. typedef struct {
  14254. uint16 version;
  14255. uint16 pad;
  14256. /* taken from wl_wlc_cnt_t */
  14257. uint32 txfail;
  14258. /* taken from wl_cnt_ge40mcst_v1_t */
  14259. uint32 txallfrm; /**< total number of frames sent, incl. Data, ACK, RTS, CTS,
  14260. * Control Management (includes retransmissions)
  14261. */
  14262. uint32 txrtsfrm; /**< number of RTS sent out by the MAC */
  14263. uint32 txctsfrm; /**< number of CTS sent out by the MAC */
  14264. uint32 txback; /**< blockack txcnt */
  14265. uint32 txucast; /**< number of unicast tx expecting response other than cts/cwcts */
  14266. uint32 txnoack; /**< dot11ACKFailureCount */
  14267. uint32 txframe; /**< tx data frames */
  14268. uint32 txretrans; /**< tx mac retransmits */
  14269. uint32 txpspoll; /**< Number of TX PS-poll */
  14270. uint32 rxrsptmout; /**< number of response timeouts for transmitted frames
  14271. * expecting a response
  14272. */
  14273. uint32 txrtsfail; /**< number of rts transmission failure that reach retry limit */
  14274. uint32 rxstrt; /**< number of received frames with a good PLCP */
  14275. uint32 rxbadplcp; /**< number of parity check of the PLCP header failed */
  14276. uint32 rxcrsglitch; /**< PHY was able to correlate the preamble but not the header */
  14277. uint32 rxnodelim; /**< number of no valid delimiter detected by ampdu parser */
  14278. uint32 bphy_badplcp; /**< number of bad PLCP reception on BPHY rate */
  14279. uint32 bphy_rxcrsglitch; /**< PHY count of bphy glitches */
  14280. uint32 rxbadfcs; /**< number of frames for which the CRC check failed in the MAC */
  14281. uint32 rxf0ovfl; /**< number of receive fifo 0 overflows */
  14282. uint32 rxf1ovfl; /**< number of receive fifo 0 overflows */
  14283. uint32 rxhlovfl; /**< number of length / header fifo overflows */
  14284. uint32 rxrtsucast; /**< number of unicast RTS addressed to the MAC (good FCS) */
  14285. uint32 rxctsucast; /**< number of unicast CTS addressed to the MAC (good FCS) */
  14286. uint32 rxackucast; /**< number of ucast ACKS received (good FCS) */
  14287. uint32 rxback; /**< blockack rxcnt */
  14288. uint32 rxbeaconmbss; /**< beacons received from member of BSS */
  14289. uint32 rxdtucastmbss; /**< number of received DATA frames with good FCS and matching RA */
  14290. uint32 rxbeaconobss; /**< beacons received from other BSS */
  14291. uint32 rxdtucastobss; /**< number of unicast frames addressed to the MAC from
  14292. * other BSS (WDS FRAME)
  14293. */
  14294. uint32 rxdtocast; /**< number of received DATA frames (good FCS and no matching RA) */
  14295. uint32 rxrtsocast; /**< number of received RTS not addressed to the MAC */
  14296. uint32 rxctsocast; /**< number of received CTS not addressed to the MAC */
  14297. uint32 rxdtmcast; /**< number of RX Data multicast frames received by the MAC */
  14298. uint32 rxmpdu_mu; /**< Number of MU MPDUs received */
  14299. uint32 rxtoolate; /**< receive too late */
  14300. uint32 rxframe; /**< rx data frames */
  14301. uint32 lqcm_report; /**< lqcm metric tx/rx idx */
  14302. uint32 tx_toss_cnt; /* number of tx packets tossed */
  14303. uint32 rx_toss_cnt; /* number of rx packets tossed */
  14304. uint32 last_tx_toss_rsn; /* reason because of which last tx pkt tossed */
  14305. uint32 last_rx_toss_rsn; /* reason because of which last rx pkt tossed */
  14306. uint32 txbcnfrm; /**< beacons transmitted */
  14307. uint32 rxretry; /* Number of rx packets received after retry */
  14308. uint32 rxdup; /* Number of dump packet. Indicates whether peer is receiving ack */
  14309. uint32 chswitch_cnt; /* Number of channel switches */
  14310. uint32 pm_dur; /* Total sleep time in PM, msecs */
  14311. uint32 rxholes; /* Count of missed packets from peer */
  14312. } wl_periodic_compact_cntrs_v3_t;
  14313. #define WL_PERIODIC_COMPACT_HE_CNTRS_VER_1 (1)
  14314. typedef struct {
  14315. uint16 version;
  14316. uint16 len;
  14317. uint32 he_rxtrig_rand;
  14318. uint32 he_colormiss_cnt;
  14319. uint32 he_txmtid_back;
  14320. uint32 he_rxmtid_back;
  14321. uint32 he_rxmsta_back;
  14322. uint32 he_rxtrig_basic;
  14323. uint32 he_rxtrig_murts;
  14324. uint32 he_rxtrig_bsrp;
  14325. uint32 he_rxdlmu;
  14326. uint32 he_physu_rx;
  14327. uint32 he_txtbppdu;
  14328. } wl_compact_he_cnt_wlc_v1_t;
  14329. #define WL_PERIODIC_COMPACT_HE_CNTRS_VER_2 (2)
  14330. typedef struct {
  14331. uint16 version;
  14332. uint16 len;
  14333. uint32 he_rxtrig_myaid;
  14334. uint32 he_rxtrig_rand;
  14335. uint32 he_colormiss_cnt;
  14336. uint32 he_txmampdu;
  14337. uint32 he_txmtid_back;
  14338. uint32 he_rxmtid_back;
  14339. uint32 he_rxmsta_back;
  14340. uint32 he_txfrag;
  14341. uint32 he_rxdefrag;
  14342. uint32 he_txtrig;
  14343. uint32 he_rxtrig_basic;
  14344. uint32 he_rxtrig_murts;
  14345. uint32 he_rxtrig_bsrp;
  14346. uint32 he_rxhemuppdu_cnt;
  14347. uint32 he_physu_rx;
  14348. uint32 he_phyru_rx;
  14349. uint32 he_txtbppdu;
  14350. uint32 he_null_tbppdu;
  14351. uint32 he_rxhesuppdu_cnt;
  14352. uint32 he_rxhesureppdu_cnt;
  14353. uint32 he_null_zero_agg;
  14354. uint32 he_null_bsrp_rsp;
  14355. uint32 he_null_fifo_empty;
  14356. } wl_compact_he_cnt_wlc_v2_t;
  14357. /* for future versions of this data structure, can consider wl_txbf_ecounters_t
  14358. * which contains the full list of txbf dump counters
  14359. */
  14360. typedef struct {
  14361. uint16 version;
  14362. uint16 coreup;
  14363. uint32 txndpa;
  14364. uint32 txndp;
  14365. uint32 rxsf;
  14366. uint32 txbfm;
  14367. uint32 rxndpa_u;
  14368. uint32 rxndpa_m;
  14369. uint32 bferpt;
  14370. uint32 rxbfpoll;
  14371. uint32 txsf;
  14372. } wl_periodic_txbf_cntrs_v1_t;
  14373. typedef struct {
  14374. struct ether_addr BSSID;
  14375. chanspec_t chanspec;
  14376. int32 rssi;
  14377. int32 snr;
  14378. } wl_rx_signal_metric_t;
  14379. typedef struct {
  14380. uint8 version;
  14381. uint8 flags;
  14382. uint16 pad;
  14383. int32 noise_level; /* current noise level */
  14384. wl_rx_signal_metric_t current_bss;
  14385. wl_rx_signal_metric_t target_bss;
  14386. } wl_lqm_t;
  14387. #define WL_PERIODIC_IF_STATE_VER_1 (1)
  14388. typedef struct wl_if_state_compact {
  14389. uint8 version;
  14390. uint8 assoc_state;
  14391. uint8 antenna_count; /**< number of valid antenna rssi */
  14392. int8 noise_level; /**< noise right after tx (in dBm) */
  14393. int8 snr; /* current noise level */
  14394. int8 rssi_sum; /**< summed rssi across all antennas */
  14395. uint16 pad16;
  14396. int8 rssi_ant[WL_RSSI_ANT_MAX]; /**< rssi per antenna */
  14397. struct ether_addr BSSID;
  14398. chanspec_t chanspec;
  14399. } wl_if_state_compact_t;
  14400. #define WL_EVENT_STATISTICS_VER_1 (1)
  14401. /* Event based statistics ecounters */
  14402. typedef struct {
  14403. uint16 version;
  14404. uint16 pad;
  14405. struct ether_addr BSSID; /* BSSID of the BSS */
  14406. uint32 txdeauthivalclass;
  14407. } wl_event_based_statistics_v1_t;
  14408. #define WL_EVENT_STATISTICS_VER_2 (2)
  14409. /* Event based statistics ecounters */
  14410. typedef struct {
  14411. uint16 version;
  14412. uint16 pad;
  14413. struct ether_addr BSSID; /* BSSID of the BSS */
  14414. uint32 txdeauthivalclass;
  14415. /* addition for v2 */
  14416. int32 timestamp; /* last deauth time */
  14417. struct ether_addr last_deauth; /* wrong deauth MAC */
  14418. uint16 misdeauth; /* wrong deauth count every 1sec */
  14419. int16 cur_rssi; /* current bss rssi */
  14420. int16 deauth_rssi; /* deauth pkt rssi */
  14421. } wl_event_based_statistics_v2_t;
  14422. #define WL_EVENT_STATISTICS_VER_3 (3)
  14423. /* Event based statistics ecounters */
  14424. typedef struct {
  14425. uint16 version;
  14426. uint16 pad;
  14427. struct ether_addr BSSID; /* BSSID of the BSS */
  14428. uint16 PAD;
  14429. uint32 txdeauthivalclass;
  14430. /* addition for v2 */
  14431. int32 timestamp; /* last deauth time */
  14432. struct ether_addr last_deauth; /* wrong deauth MAC */
  14433. uint16 misdeauth; /* wrong deauth count every 1sec */
  14434. int16 cur_rssi; /* current bss rssi */
  14435. int16 deauth_rssi; /* deauth pkt rssi */
  14436. /* addition for v3 (roam statistics) */
  14437. uint32 initial_assoc_time;
  14438. uint32 prev_roam_time;
  14439. uint32 last_roam_event_type;
  14440. uint32 last_roam_event_status;
  14441. uint32 last_roam_event_reason;
  14442. uint16 roam_success_cnt;
  14443. uint16 roam_fail_cnt;
  14444. uint16 roam_attempt_cnt;
  14445. uint16 max_roam_target_cnt;
  14446. uint16 min_roam_target_cnt;
  14447. uint16 max_cached_ch_cnt;
  14448. uint16 min_cached_ch_cnt;
  14449. uint16 partial_roam_scan_cnt;
  14450. uint16 full_roam_scan_cnt;
  14451. uint16 most_roam_reason;
  14452. uint16 most_roam_reason_cnt;
  14453. } wl_event_based_statistics_v3_t;
  14454. #define WL_EVENT_STATISTICS_VER_4 (4u)
  14455. /* Event based statistics ecounters */
  14456. typedef struct {
  14457. uint16 version;
  14458. uint16 pad;
  14459. struct ether_addr BSSID; /* BSSID of the BSS */
  14460. uint16 PAD;
  14461. uint32 txdeauthivalclass;
  14462. /* addition for v2 */
  14463. int32 timestamp; /* last deauth time */
  14464. struct ether_addr last_deauth; /* wrong deauth MAC */
  14465. uint16 misdeauth; /* wrong deauth count every 1sec */
  14466. int16 cur_rssi; /* current bss rssi */
  14467. int16 deauth_rssi; /* deauth pkt rssi */
  14468. } wl_event_based_statistics_v4_t;
  14469. /* ##### Ecounters v2 section ##### */
  14470. #define ECOUNTERS_VERSION_2 2
  14471. /* Enumeration of various ecounters request types. This namespace is different from
  14472. * global reportable stats namespace.
  14473. */
  14474. enum {
  14475. WL_ECOUNTERS_XTLV_REPORT_REQ = 1
  14476. };
  14477. /* Input structure for ecounters IOVAR */
  14478. typedef struct ecounters_config_request_v2 {
  14479. uint16 version; /* config version */
  14480. uint16 len; /* Length of this struct including variable len */
  14481. uint16 logset; /* Set where data will go. */
  14482. uint16 reporting_period; /* reporting_period */
  14483. uint16 num_reports; /* Number of timer expirations to report on */
  14484. uint8 pad[2]; /* Reserved for future use */
  14485. uint8 ecounters_xtlvs[]; /* Statistics Types (tags) to retrieve. */
  14486. } ecounters_config_request_v2_t;
  14487. #define ECOUNTERS_STATS_TYPES_FLAG_SLICE 0x1
  14488. #define ECOUNTERS_STATS_TYPES_FLAG_IFACE 0x2
  14489. #define ECOUNTERS_STATS_TYPES_FLAG_GLOBAL 0x4
  14490. #define ECOUNTERS_STATS_TYPES_DEFAULT 0x8
  14491. /* Slice mask bits */
  14492. #define ECOUNTERS_STATS_TYPES_SLICE_MASK_SLICE0 0x1
  14493. #define ECOUNTERS_STATS_TYPES_SLICE_MASK_SLICE1 0x2
  14494. typedef struct ecounters_stats_types_report_req {
  14495. /* flags: bit0 = slice, bit1 = iface, bit2 = global,
  14496. * rest reserved
  14497. */
  14498. uint16 flags;
  14499. uint16 if_index; /* host interface index */
  14500. uint16 slice_mask; /* bit0 = slice0, bit1=slice1, rest reserved */
  14501. uint8 pad[2]; /* padding */
  14502. uint8 stats_types_req[]; /* XTLVs of requested types */
  14503. } ecounters_stats_types_report_req_t;
  14504. /* ##### Ecounters_Eventmsgs v2 section ##### */
  14505. #define ECOUNTERS_EVENTMSGS_VERSION_2 2
  14506. typedef struct event_ecounters_config_request_v2 {
  14507. uint16 version; /* config version */
  14508. uint16 len; /* Length of this struct including variable len */
  14509. uint16 logset; /* Set where data will go. */
  14510. uint16 event_id; /* Event id for which this config is meant for */
  14511. uint8 flags; /* Config flags */
  14512. uint8 pad[3]; /* Reserved for future use */
  14513. uint8 ecounters_xtlvs[]; /* Statistics Types (tags) to retrieve. */
  14514. } event_ecounters_config_request_v2_t;
  14515. #define EVENT_ECOUNTERS_FLAGS_ADD (1 << 0) /* Add configuration for the event_id if set */
  14516. #define EVENT_ECOUNTERS_FLAGS_DEL (1 << 1) /* Delete configuration for event_id if set */
  14517. #define EVENT_ECOUNTERS_FLAGS_ANYIF (1 << 2) /* Interface filtering disable / off bit */
  14518. #define EVENT_ECOUNTERS_FLAGS_BE (1 << 3) /* If cleared report stats of
  14519. * one event log buffer
  14520. */
  14521. #define EVENT_ECOUNTERS_FLAGS_DEL_ALL (1 << 4) /* Delete all the configurations of
  14522. * event ecounters if set
  14523. */
  14524. #define EVENT_ECOUNTERS_FLAGS_BUS (1 << 5) /* Add configuration for the bus events */
  14525. #define EVENT_ECOUNTERS_FLAGS_BUS_H2D (1 << 6) /* Add configuration for the bus direction
  14526. * 0 - D2H and 1 - H2D
  14527. */
  14528. #define EVENT_ECOUNTERS_FLAGS_DELAYED_FLUSH (1 << 7) /* Flush only when half of the total size
  14529. * of blocks gets filled. This is to avoid
  14530. * many interrupts to host.
  14531. */
  14532. #define EVENT_ECOUNTERS_FLAGS_USER (1 << 6) /* Add configuration for user defined events
  14533. * Reuse the same flag as H2D
  14534. */
  14535. /* Ecounters suspend resume */
  14536. #define ECOUNTERS_SUSPEND_VERSION_V1 1
  14537. /* To be used in populating suspend_mask and suspend_bitmap */
  14538. #define ECOUNTERS_SUSPEND_TIMER (1 << ECOUNTERS_TRIGGER_REASON_TIMER)
  14539. #define ECOUNTERS_SUSPEND_EVENTS (1 << ECOUNTERS_TRIGGER_REASON_EVENTS)
  14540. typedef struct ecounters_suspend {
  14541. uint16 version;
  14542. uint16 len;
  14543. uint32 suspend_bitmap; /* type of ecounter reporting to be suspended */
  14544. uint32 suspend_mask; /* type of ecounter reporting to be suspended */
  14545. } ecounters_suspend_t;
  14546. /* -------------- dynamic BTCOEX --------------- */
  14547. #define DCTL_TROWS 2 /**< currently practical number of rows */
  14548. #define DCTL_TROWS_MAX 4 /**< 2 extra rows RFU */
  14549. /* DYNCTL profile flags */
  14550. #define DCTL_FLAGS_DISABLED 0 /**< default value: all features disabled */
  14551. #define DCTL_FLAGS_DYNCTL (1 << 0) /**< 1 - enabled, 0 - legacy only */
  14552. #define DCTL_FLAGS_DESENSE (1 << 1) /**< auto desense is enabled */
  14553. #define DCTL_FLAGS_MSWITCH (1 << 2) /**< mode switching is enabled */
  14554. #define DCTL_FLAGS_PWRCTRL (1 << 3) /**< Tx power control is enabled */
  14555. /* for now AGG on/off is handled separately */
  14556. #define DCTL_FLAGS_TX_AGG_OFF (1 << 4) /**< TBD: allow TX agg Off */
  14557. #define DCTL_FLAGS_RX_AGG_OFF (1 << 5) /**< TBD: allow RX agg Off */
  14558. /* used for dry run testing only */
  14559. #define DCTL_FLAGS_DRYRUN (1 << 7) /**< Enables dynctl dry run mode */
  14560. #define IS_DYNCTL_ON(prof) ((prof->flags & DCTL_FLAGS_DYNCTL) != 0)
  14561. #define IS_DESENSE_ON(prof) ((prof->flags & DCTL_FLAGS_DESENSE) != 0)
  14562. #define IS_MSWITCH_ON(prof) ((prof->flags & DCTL_FLAGS_MSWITCH) != 0)
  14563. #define IS_PWRCTRL_ON(prof) ((prof->flags & DCTL_FLAGS_PWRCTRL) != 0)
  14564. /* desense level currently in use */
  14565. #define DESENSE_OFF 0
  14566. #define DFLT_DESENSE_MID 12
  14567. #define DFLT_DESENSE_HIGH 2
  14568. /**
  14569. * dynctl data points(a set of btpwr & wlrssi thresholds)
  14570. * for mode & desense switching
  14571. */
  14572. typedef struct btc_thr_data {
  14573. int8 mode; /**< used by desense sw */
  14574. int8 bt_pwr; /**< BT tx power threshold */
  14575. int8 bt_rssi; /**< BT rssi threshold */
  14576. /* wl rssi range when mode or desense change may be needed */
  14577. int8 wl_rssi_high;
  14578. int8 wl_rssi_low;
  14579. } btc_thr_data_t;
  14580. /* dynctl. profile data structure */
  14581. #define DCTL_PROFILE_VER 0x01
  14582. #include <packed_section_start.h>
  14583. typedef BWL_PRE_PACKED_STRUCT struct dctl_prof {
  14584. uint8 version; /**< dynctl profile version */
  14585. /* dynctl profile flags bit:0 - dynctl On, bit:1 dsns On, bit:2 mode sw On, */
  14586. uint8 flags; /**< bit[6:3] reserved, bit7 - Dryrun (sim) - On */
  14587. /** wl desense levels to apply */
  14588. uint8 dflt_dsns_level;
  14589. uint8 low_dsns_level;
  14590. uint8 mid_dsns_level;
  14591. uint8 high_dsns_level;
  14592. /** mode switching hysteresis in dBm */
  14593. int8 msw_btrssi_hyster;
  14594. /** default btcoex mode */
  14595. uint8 default_btc_mode;
  14596. /** num of active rows in mode switching table */
  14597. uint8 msw_rows;
  14598. /** num of rows in desense table */
  14599. uint8 dsns_rows;
  14600. /** dynctl mode switching data table */
  14601. btc_thr_data_t msw_data[DCTL_TROWS_MAX];
  14602. /** dynctl desense switching data table */
  14603. btc_thr_data_t dsns_data[DCTL_TROWS_MAX];
  14604. } BWL_POST_PACKED_STRUCT dctl_prof_t;
  14605. #include <packed_section_end.h>
  14606. /** dynctl status info */
  14607. #include <packed_section_start.h>
  14608. typedef BWL_PRE_PACKED_STRUCT struct dynctl_status {
  14609. uint8 sim_on; /**< true if simulation is On */
  14610. uint16 bt_pwr_shm; /**< BT per/task power as read from ucode */
  14611. int8 bt_pwr; /**< BT pwr extracted & converted to dBm */
  14612. int8 bt_rssi; /**< BT rssi in dBm */
  14613. int8 wl_rssi; /**< last wl rssi reading used by btcoex */
  14614. uint8 dsns_level; /**< current desense level */
  14615. uint8 btc_mode; /**< current btcoex mode */
  14616. /* add more status items if needed, pad to 4 BB if needed */
  14617. } BWL_POST_PACKED_STRUCT dynctl_status_t;
  14618. #include <packed_section_end.h>
  14619. /** dynctl simulation (dryrun data) */
  14620. #include <packed_section_start.h>
  14621. typedef BWL_PRE_PACKED_STRUCT struct dynctl_sim {
  14622. uint8 sim_on; /**< simulation mode on/off */
  14623. int8 btpwr; /**< simulated BT power in dBm */
  14624. int8 btrssi; /**< simulated BT rssi in dBm */
  14625. int8 wlrssi; /**< simulated WL rssi in dBm */
  14626. } BWL_POST_PACKED_STRUCT dynctl_sim_t;
  14627. /* no default structure packing */
  14628. #include <packed_section_end.h>
  14629. /** PTK key maintained per SCB */
  14630. #define RSN_TEMP_ENCR_KEY_LEN 16
  14631. typedef struct wpa_ptk {
  14632. uint8 kck[RSN_KCK_LENGTH]; /**< EAPOL-Key Key Confirmation Key (KCK) */
  14633. uint8 kek[RSN_KEK_LENGTH]; /**< EAPOL-Key Key Encryption Key (KEK) */
  14634. uint8 tk1[RSN_TEMP_ENCR_KEY_LEN]; /**< Temporal Key 1 (TK1) */
  14635. uint8 tk2[RSN_TEMP_ENCR_KEY_LEN]; /**< Temporal Key 2 (TK2) */
  14636. } wpa_ptk_t;
  14637. /** GTK key maintained per SCB */
  14638. typedef struct wpa_gtk {
  14639. uint32 idx;
  14640. uint32 key_len;
  14641. uint8 key[DOT11_MAX_KEY_SIZE];
  14642. } wpa_gtk_t;
  14643. /** FBT Auth Response Data structure */
  14644. typedef struct wlc_fbt_auth_resp {
  14645. uint8 macaddr[ETHER_ADDR_LEN]; /**< station mac address */
  14646. uint8 pad[2];
  14647. uint8 pmk_r1_name[WPA2_PMKID_LEN];
  14648. wpa_ptk_t ptk; /**< pairwise key */
  14649. wpa_gtk_t gtk; /**< group key */
  14650. uint32 ie_len;
  14651. uint8 status; /**< Status of parsing FBT authentication
  14652. Request in application
  14653. */
  14654. uint8 ies[1]; /**< IEs contains MDIE, RSNIE,
  14655. FBTIE (ANonce, SNonce,R0KH-ID, R1KH-ID)
  14656. */
  14657. } wlc_fbt_auth_resp_t;
  14658. /** FBT Action Response frame */
  14659. typedef struct wlc_fbt_action_resp {
  14660. uint16 version; /**< structure version */
  14661. uint16 length; /**< length of structure */
  14662. uint8 macaddr[ETHER_ADDR_LEN]; /**< station mac address */
  14663. uint8 data_len; /**< len of ie from Category */
  14664. uint8 data[1]; /**< data contains category, action, sta address, target ap,
  14665. status code,fbt response frame body
  14666. */
  14667. } wlc_fbt_action_resp_t;
  14668. #define MACDBG_PMAC_ADDR_INPUT_MAXNUM 16
  14669. #define MACDBG_PMAC_OBJ_TYPE_LEN 8
  14670. typedef struct _wl_macdbg_pmac_param_t {
  14671. char type[MACDBG_PMAC_OBJ_TYPE_LEN];
  14672. uint8 step;
  14673. uint8 w_en;
  14674. uint16 num;
  14675. uint32 bitmap;
  14676. uint8 addr_raw;
  14677. uint8 addr_num;
  14678. uint16 addr[MACDBG_PMAC_ADDR_INPUT_MAXNUM];
  14679. uint8 pad0[2];
  14680. uint32 w_val;
  14681. } wl_macdbg_pmac_param_t;
  14682. /** IOVAR 'svmp_sampcol' parameter. Used to set and read SVMP_SAMPLE_COLLECT's setting */
  14683. typedef struct wl_svmp_sampcol_param {
  14684. uint32 version; /* version */
  14685. uint8 enable;
  14686. uint8 trigger_mode; /* SVMP_SAMPCOL_TRIGGER */
  14687. uint8 trigger_mode_s[2]; /* SVMP_SAMPCOL_PKTPROC */
  14688. uint8 data_samplerate; /* SVMP_SAMPCOL_SAMPLERATE */
  14689. uint8 data_sel_phy1; /* SVMP_SAMPCOL_PHY1MUX */
  14690. uint8 data_sel_rx1; /* SVMP_SAMPCOL_RX1MUX without iqCompOut */
  14691. uint8 data_sel_dualcap; /* SVMP_SAMPCOL_RX1MUX */
  14692. uint8 pack_mode; /* SVMP_SAMPCOL_PACK */
  14693. uint8 pack_order;
  14694. uint8 pack_cfix_fmt;
  14695. uint8 pack_1core_sel;
  14696. uint16 waitcnt;
  14697. uint16 caplen;
  14698. uint32 buff_addr_start; /* in word-size (2-bytes) */
  14699. uint32 buff_addr_end; /* note: Tcl in byte-size, HW in vector-size (8-bytes) */
  14700. uint8 int2vasip;
  14701. uint8 PAD;
  14702. uint16 status;
  14703. } wl_svmp_sampcol_t;
  14704. #define WL_SVMP_SAMPCOL_PARAMS_VERSION 1
  14705. enum {
  14706. SVMP_SAMPCOL_TRIGGER_PKTPROC_TRANSITION = 0,
  14707. SVMP_SAMPCOL_TRIGGER_FORCE_IMMEDIATE,
  14708. SVMP_SAMPCOL_TRIGGER_RADAR_DET
  14709. };
  14710. enum {
  14711. SVMP_SAMPCOL_PHY1MUX_GPIOOUT = 0,
  14712. SVMP_SAMPCOL_PHY1MUX_FFT,
  14713. SVMP_SAMPCOL_PHY1MUX_DBGHX,
  14714. SVMP_SAMPCOL_PHY1MUX_RX1MUX
  14715. };
  14716. enum {
  14717. SVMP_SAMPCOL_RX1MUX_FARROWOUT = 4,
  14718. SVMP_SAMPCOL_RX1MUX_IQCOMPOUT,
  14719. SVMP_SAMPCOL_RX1MUX_DCFILTEROUT,
  14720. SVMP_SAMPCOL_RX1MUX_RXFILTEROUT,
  14721. SVMP_SAMPCOL_RX1MUX_ACIFILTEROUT
  14722. };
  14723. enum {
  14724. SVMP_SAMPCOL_SAMPLERATE_1XBW = 0,
  14725. SVMP_SAMPCOL_SAMPLERATE_2XBW
  14726. };
  14727. enum {
  14728. SVMP_SAMPCOL_PACK_DUALCAP = 0,
  14729. SVMP_SAMPCOL_PACK_4CORE,
  14730. SVMP_SAMPCOL_PACK_2CORE,
  14731. SVMP_SAMPCOL_PACK_1CORE
  14732. };
  14733. enum {
  14734. SVMP_SAMPCOL_PKTPROC_RESET = 0,
  14735. SVMP_SAMPCOL_PKTPROC_CARRIER_SEARCH,
  14736. SVMP_SAMPCOL_PKTPROC_WAIT_FOR_NB_PWR,
  14737. SVMP_SAMPCOL_PKTPROC_WAIT_FOR_W1_PWR,
  14738. SVMP_SAMPCOL_PKTPROC_WAIT_FOR_W2_PWR,
  14739. SVMP_SAMPCOL_PKTPROC_OFDM_PHY,
  14740. SVMP_SAMPCOL_PKTPROC_TIMING_SEARCH,
  14741. SVMP_SAMPCOL_PKTPROC_CHAN_EST_1,
  14742. SVMP_SAMPCOL_PKTPROC_LEG_SIG_DEC,
  14743. SVMP_SAMPCOL_PKTPROC_SIG_DECODE_1,
  14744. SVMP_SAMPCOL_PKTPROC_SIG_DECODE_2,
  14745. SVMP_SAMPCOL_PKTPROC_HT_AGC,
  14746. SVMP_SAMPCOL_PKTPROC_CHAN_EST_2,
  14747. SVMP_SAMPCOL_PKTPROC_PAY_DECODE,
  14748. SVMP_SAMPCOL_PKTPROC_DSSS_CCK_PHY,
  14749. SVMP_SAMPCOL_PKTPROC_WAIT_ENERGY_DROP,
  14750. SVMP_SAMPCOL_PKTPROC_WAIT_NCLKS,
  14751. SVMP_SAMPCOL_PKTPROC_PAY_DEC_EXT,
  14752. SVMP_SAMPCOL_PKTPROC_SIG_FAIL_DELAY,
  14753. SVMP_SAMPCOL_PKTPROC_RIFS_SEARCH,
  14754. SVMP_SAMPCOL_PKTPROC_BOARD_SWITCH_DIV_SEARCH,
  14755. SVMP_SAMPCOL_PKTPROC_DSSS_CCK_BOARD_SWITCH_DIV_SEARCH,
  14756. SVMP_SAMPCOL_PKTPROC_CHAN_EST_3,
  14757. SVMP_SAMPCOL_PKTPROC_CHAN_EST_4,
  14758. SVMP_SAMPCOL_PKTPROC_FINE_TIMING_SEARCH,
  14759. SVMP_SAMPCOL_PKTPROC_SET_CLIP_GAIN,
  14760. SVMP_SAMPCOL_PKTPROC_NAP,
  14761. SVMP_SAMPCOL_PKTPROC_VHT_SIGA_DEC,
  14762. SVMP_SAMPCOL_PKTPROC_VHT_SIGB_DEC,
  14763. SVMP_SAMPCOL_PKTPROC_PKT_ABORT,
  14764. SVMP_SAMPCOL_PKTPROC_DCCAL
  14765. };
  14766. /** IOVAR 'svmp_mem' parameter. Used to read/clear svmp memory */
  14767. typedef struct svmp_mem {
  14768. uint32 addr; /**< offset to read svmp memory from vasip base address */
  14769. uint16 len; /**< length in count of uint16's */
  14770. uint16 val; /**< set the range of addr/len with a value */
  14771. } svmp_mem_t;
  14772. /** IOVAR 'mu_rate' parameter. read/set mu rate for upto four users */
  14773. #define MU_RATE_CFG_VERSION 1
  14774. typedef struct mu_rate {
  14775. uint16 version; /**< version of the structure as defined by MU_RATE_CFG_VERSION */
  14776. uint16 length; /**< length of entire structure */
  14777. uint8 auto_rate; /**< enable/disable auto rate */
  14778. uint8 PAD;
  14779. uint16 rate_user[4]; /**< rate per each of four users, set to -1 for no change */
  14780. } mu_rate_t;
  14781. /** IOVAR 'mu_group' parameter. Used to set and read MU group recommendation setting */
  14782. #define WL_MU_GROUP_AUTO_COMMAND -1
  14783. #define WL_MU_GROUP_PARAMS_VERSION 3
  14784. #define WL_MU_GROUP_METHOD_NAMELEN 64
  14785. #define WL_MU_GROUP_NGROUP_MAX 15
  14786. #define WL_MU_GROUP_NUSER_MAX 4
  14787. #define WL_MU_GROUP_METHOD_MIN 0
  14788. #define WL_MU_GROUP_NUMBER_AUTO_MIN 1
  14789. #define WL_MU_GROUP_NUMBER_AUTO_MAX 15
  14790. #define WL_MU_GROUP_NUMBER_FORCED_MAX 8
  14791. #define WL_MU_GROUP_METHOD_OLD 0
  14792. #define WL_MU_GROUP_MODE_AUTO 0
  14793. #define WL_MU_GROUP_MODE_FORCED 1
  14794. #define WL_MU_GROUP_FORCED_1GROUP 1
  14795. #define WL_MU_GROUP_ENTRY_EMPTY -1
  14796. typedef struct mu_group {
  14797. uint32 version; /* version */
  14798. int16 forced; /* forced group recommendation */
  14799. int16 forced_group_mcs; /* forced group with mcs */
  14800. int16 forced_group_num; /* forced group number */
  14801. int16 group_option[WL_MU_GROUP_NGROUP_MAX][WL_MU_GROUP_NUSER_MAX];
  14802. /* set mode for forced grouping and read mode for auto grouping */
  14803. int16 group_GID[WL_MU_GROUP_NGROUP_MAX];
  14804. int16 group_method; /* methof for VASIP group recommendation */
  14805. int16 group_number; /* requested number for VASIP group recommendation */
  14806. int16 auto_group_num; /* exact number from VASIP group recommendation */
  14807. int8 group_method_name[WL_MU_GROUP_METHOD_NAMELEN];
  14808. uint8 PAD[2];
  14809. } mu_group_t;
  14810. typedef struct mupkteng_sta {
  14811. struct ether_addr ea;
  14812. uint8 PAD[2];
  14813. int32 nrxchain;
  14814. int32 idx;
  14815. } mupkteng_sta_t;
  14816. typedef struct mupkteng_client {
  14817. int32 rspec;
  14818. int32 idx;
  14819. int32 flen;
  14820. int32 nframes;
  14821. } mupkteng_client_t;
  14822. typedef struct mupkteng_tx {
  14823. mupkteng_client_t client[8];
  14824. int32 nclients;
  14825. int32 ntx;
  14826. } mupkteng_tx_t;
  14827. /*
  14828. * MU Packet engine interface.
  14829. * The following two definitions will go into
  14830. * wlioctl_defs.h
  14831. * when wl utility changes are merged to EAGLE TOB & Trunk
  14832. */
  14833. #define WL_MUPKTENG_PER_TX_START 0x10
  14834. #define WL_MUPKTENG_PER_TX_STOP 0x20
  14835. /** IOVAR 'mu_policy' parameter. Used to configure MU admission control policies */
  14836. #define WL_MU_POLICY_PARAMS_VERSION 1
  14837. #define WL_MU_POLICY_SCHED_DEFAULT 60
  14838. #define WL_MU_POLICY_DISABLED 0
  14839. #define WL_MU_POLICY_ENABLED 1
  14840. #define WL_MU_POLICY_NRX_MIN 1
  14841. #define WL_MU_POLICY_NRX_MAX 2
  14842. typedef struct mu_policy {
  14843. uint16 version;
  14844. uint16 length;
  14845. uint32 sched_timer;
  14846. uint32 pfmon;
  14847. uint32 pfmon_gpos;
  14848. uint32 samebw;
  14849. uint32 nrx;
  14850. uint32 max_muclients;
  14851. } mu_policy_t;
  14852. #define WL_NAN_BAND_STR_SIZE 5 /* sizeof ("auto") */
  14853. /** Definitions of different NAN Bands */
  14854. /* do not change the order */
  14855. enum {
  14856. NAN_BAND_B = 0,
  14857. NAN_BAND_A,
  14858. NAN_BAND_AUTO,
  14859. NAN_BAND_INVALID = 0xFF
  14860. };
  14861. /* ifdef WL11ULB */
  14862. /* ULB Mode configured via "ulb_mode" IOVAR */
  14863. enum {
  14864. ULB_MODE_DISABLED = 0,
  14865. ULB_MODE_STD_ALONE_MODE = 1, /* Standalone ULB Mode */
  14866. ULB_MODE_DYN_MODE = 2, /* Dynamic ULB Mode */
  14867. /* Add all other enums before this */
  14868. MAX_SUPP_ULB_MODES
  14869. };
  14870. /* ULB BWs configured via "ulb_bw" IOVAR during Standalone Mode Only.
  14871. * Values of this enumeration are also used to specify 'Current Operational Bandwidth'
  14872. * and 'Primary Operational Bandwidth' sub-fields in 'ULB Operations' field (used in
  14873. * 'ULB Operations' Attribute or 'ULB Mode Switch' Attribute)
  14874. */
  14875. typedef enum {
  14876. ULB_BW_DISABLED = 0,
  14877. ULB_BW_10MHZ = 1, /* Standalone ULB BW in 10 MHz BW */
  14878. ULB_BW_5MHZ = 2, /* Standalone ULB BW in 5 MHz BW */
  14879. ULB_BW_2P5MHZ = 3, /* Standalone ULB BW in 2.5 MHz BW */
  14880. /* Add all other enums before this */
  14881. MAX_SUPP_ULB_BW
  14882. } ulb_bw_type_t;
  14883. /* endif WL11ULB */
  14884. #define WL_MESH_IOCTL_VERSION 1
  14885. #define MESH_IOC_BUFSZ 512 /* sufficient ioc buff size for mesh */
  14886. #ifdef WLMESH
  14887. typedef struct mesh_peer_info_ext {
  14888. mesh_peer_info_t peer_info;
  14889. uint8 pad1;
  14890. uint16 local_aid; /* AID generated by *local* to peer */
  14891. uint32 entry_state; /* see MESH_PEER_ENTRY_STATE_ACTIVE etc; valid
  14892. * ONLY for internal peering requests
  14893. */
  14894. int8 rssi;
  14895. uint8 pad2;
  14896. struct ether_addr ea; /* peer ea */
  14897. } mesh_peer_info_ext_t;
  14898. /* #ifdef WLMESH */
  14899. typedef struct mesh_peer_info_dump {
  14900. uint32 buflen;
  14901. uint32 version;
  14902. uint16 count; /* number of results */
  14903. uint16 remaining; /* remaining rsults */
  14904. mesh_peer_info_ext_t mpi_ext[1];
  14905. } mesh_peer_info_dump_t;
  14906. #define WL_MESH_PEER_RES_FIXED_SIZE (sizeof(mesh_peer_info_dump_t) - sizeof(mesh_peer_info_ext_t))
  14907. #endif /* WLMESH */
  14908. /* container for mesh iovtls & events */
  14909. typedef struct wl_mesh_ioc {
  14910. uint16 version; /* interface command or event version */
  14911. uint16 id; /* mesh ioctl cmd ID */
  14912. uint16 len; /* total length of all tlv records in data[] */
  14913. uint16 pad; /* pad to be 32 bit aligment */
  14914. uint8 data[]; /* var len payload of bcm_xtlv_t type */
  14915. } wl_mesh_ioc_t;
  14916. enum wl_mesh_cmds {
  14917. WL_MESH_CMD_ENABLE = 1,
  14918. WL_MESH_CMD_JOIN = 2,
  14919. WL_MESH_CMD_PEER_STATUS = 3,
  14920. WL_MESH_CMD_ADD_ROUTE = 4,
  14921. WL_MESH_CMD_DEL_ROUTE = 5,
  14922. WL_MESH_CMD_ADD_FILTER = 6,
  14923. WL_MESH_CMD_ENAB_AL_METRIC = 7
  14924. };
  14925. enum wl_mesh_cmd_xtlv_id {
  14926. WL_MESH_XTLV_ENABLE = 1,
  14927. WL_MESH_XTLV_JOIN = 2,
  14928. WL_MESH_XTLV_STATUS = 3,
  14929. WL_MESH_XTLV_ADD_ROUTE = 4,
  14930. WL_MESH_XTLV_DEL_ROUTE = 5,
  14931. WL_MESH_XTLV_ADD_FILTER = 6,
  14932. WL_MESH_XTLV_ENAB_AIRLINK = 7
  14933. };
  14934. /* endif WLMESH */
  14935. /* Fast BSS Transition parameter configuration */
  14936. #define FBT_PARAM_CURRENT_VERSION 0
  14937. typedef struct _wl_fbt_params {
  14938. uint16 version; /* version of the structure
  14939. * as defined by FBT_PARAM_CURRENT_VERSION
  14940. */
  14941. uint16 length; /* length of the entire structure */
  14942. uint16 param_type; /* type of parameter defined below */
  14943. uint16 param_len; /* length of the param_value */
  14944. uint8 param_value[1]; /* variable length */
  14945. } wl_fbt_params_t;
  14946. #define WL_FBT_PARAM_TYPE_RSNIE 0
  14947. #define WL_FBT_PARAM_TYPE_FTIE 0x1
  14948. #define WL_FBT_PARAM_TYPE_SNONCE 0x2
  14949. #define WL_FBT_PARAM_TYPE_MDE 0x3
  14950. #define WL_FBT_PARAM_TYPE_PMK_R0_NAME 0x4
  14951. #define WL_FBT_PARAM_TYPE_R0_KHID 0x5
  14952. #define WL_FBT_PARAM_TYPE_R1_KHID 0x6
  14953. #define WL_FBT_PARAM_TYPE_FIRST_INVALID 0x7
  14954. /* Assoc Mgr commands for fine control of assoc */
  14955. #define WL_ASSOC_MGR_CURRENT_VERSION 0x0
  14956. typedef struct {
  14957. uint16 version; /* version of the structure as
  14958. * defined by WL_ASSOC_MGR_CURRENT_VERSION
  14959. */
  14960. uint16 length; /* length of the entire structure */
  14961. uint16 cmd;
  14962. uint16 params;
  14963. } wl_assoc_mgr_cmd_t;
  14964. #define WL_ASSOC_MGR_CMD_PAUSE_ON_EVT 0 /* have assoc pause on certain events */
  14965. #define WL_ASSOC_MGR_CMD_ABORT_ASSOC 1
  14966. #define WL_ASSOC_MGR_PARAMS_EVENT_NONE 0 /* use this to resume as well as clear */
  14967. #define WL_ASSOC_MGR_PARAMS_PAUSE_EVENT_AUTH_RESP 1
  14968. #define WL_WINVER_STRUCT_VER_1 (1)
  14969. typedef struct wl_winver {
  14970. /* Version and length of this structure. Length includes all fields in wl_winver_t */
  14971. uint16 struct_version;
  14972. uint16 struct_length;
  14973. /* Windows operating system version info (Microsoft provided) */
  14974. struct {
  14975. uint32 major_ver;
  14976. uint32 minor_ver;
  14977. uint32 build;
  14978. } os_runtime;
  14979. /* NDIS runtime version (Microsoft provided) */
  14980. struct {
  14981. uint16 major_ver;
  14982. uint16 minor_ver;
  14983. } ndis_runtime;
  14984. /* NDIS Driver version (Broadcom provided) */
  14985. struct {
  14986. uint16 major_ver;
  14987. uint16 minor_ver;
  14988. } ndis_driver;
  14989. /* WDI Upper Edge (UE) Driver version (Microsoft provided) */
  14990. struct {
  14991. uint8 major_ver;
  14992. uint8 minor_ver;
  14993. uint8 suffix;
  14994. } wdi_ue;
  14995. /* WDI Lower Edge (LE) Driver version (Broadcom provided) */
  14996. struct {
  14997. uint8 major_ver;
  14998. uint8 minor_ver;
  14999. uint8 suffix;
  15000. } wdi_le;
  15001. uint8 PAD[2];
  15002. } wl_winver_t;
  15003. /* defined(WLRCC) || defined(ROAM_CHANNEL_CACHE) */
  15004. #define MAX_ROAM_CHANNEL 20
  15005. typedef struct {
  15006. int32 n;
  15007. chanspec_t channels[MAX_ROAM_CHANNEL];
  15008. } wl_roam_channel_list_t;
  15009. /* endif RCC || ROAM_CHANNEL_CACHE */
  15010. /* values for IOV_MFP arg */
  15011. enum {
  15012. WL_MFP_NONE = 0,
  15013. WL_MFP_CAPABLE,
  15014. WL_MFP_REQUIRED
  15015. };
  15016. typedef enum {
  15017. CHANSW_UNKNOWN = 0, /* channel switch due to unknown reason */
  15018. CHANSW_SCAN = 1, /* channel switch due to scan */
  15019. CHANSW_PHYCAL = 2, /* channel switch due to phy calibration */
  15020. CHANSW_INIT = 3, /* channel set at WLC up time */
  15021. CHANSW_ASSOC = 4, /* channel switch due to association */
  15022. CHANSW_ROAM = 5, /* channel switch due to roam */
  15023. CHANSW_MCHAN = 6, /* channel switch triggered by mchan module */
  15024. CHANSW_IOVAR = 7, /* channel switch due to IOVAR */
  15025. CHANSW_CSA_DFS = 8, /* channel switch due to chan switch announcement from AP */
  15026. CHANSW_APCS = 9, /* Channel switch from AP channel select module */
  15027. CHANSW_AWDL = 10, /* channel switch due to AWDL */
  15028. CHANSW_FBT = 11, /* Channel switch from FBT module for action frame response */
  15029. CHANSW_UPDBW = 12, /* channel switch at update bandwidth */
  15030. CHANSW_ULB = 13, /* channel switch at ULB */
  15031. CHANSW_LAST = 14 /* last channel switch reason */
  15032. } chansw_reason_t;
  15033. /*
  15034. * WOWL unassociated mode power svae pattern.
  15035. */
  15036. typedef struct wowl_radio_duty_cycle {
  15037. uint16 wake_interval;
  15038. uint16 sleep_interval;
  15039. } wowl_radio_duty_cycle_t;
  15040. typedef struct nd_ra_ol_limits {
  15041. uint16 version; /* version of the iovar buffer */
  15042. uint16 type; /* type of data provided */
  15043. uint16 length; /* length of the entire structure */
  15044. uint16 pad1; /* pad union to 4 byte boundary */
  15045. union {
  15046. struct {
  15047. uint16 min_time; /* seconds, min time for RA offload hold */
  15048. uint16 lifetime_percent;
  15049. /* percent, lifetime percentage for offload hold time */
  15050. } lifetime_relative;
  15051. struct {
  15052. uint16 hold_time; /* seconds, RA offload hold time */
  15053. uint16 pad2; /* unused */
  15054. } fixed;
  15055. } limits;
  15056. } nd_ra_ol_limits_t;
  15057. #define ND_RA_OL_LIMITS_VER 1
  15058. /* nd_ra_ol_limits sub-types */
  15059. #define ND_RA_OL_LIMITS_REL_TYPE 0 /* relative, percent of RA lifetime */
  15060. #define ND_RA_OL_LIMITS_FIXED_TYPE 1 /* fixed time */
  15061. /* buffer lengths for the different nd_ra_ol_limits types */
  15062. #define ND_RA_OL_LIMITS_REL_TYPE_LEN 12
  15063. #define ND_RA_OL_LIMITS_FIXED_TYPE_LEN 10
  15064. /*
  15065. * Temperature Throttling control mode
  15066. */
  15067. typedef struct wl_temp_control {
  15068. uint8 enable;
  15069. uint8 PAD;
  15070. uint16 control_bit;
  15071. } wl_temp_control_t;
  15072. /* SensorHub Interworking mode */
  15073. #define SHUB_CONTROL_VERSION 1
  15074. #define SHUB_CONTROL_LEN 12
  15075. typedef struct {
  15076. uint16 verison;
  15077. uint16 length;
  15078. uint16 cmd;
  15079. uint16 op_mode;
  15080. uint16 interval;
  15081. uint16 enable;
  15082. } shub_control_t;
  15083. /* WLC_MAJOR_VER <= 5 */
  15084. /* Data structures for non-TLV format */
  15085. /* Data structures for rsdb caps */
  15086. /*
  15087. * The flags field of the rsdb_caps_response is designed to be
  15088. * a Bit Mask. As of now only Bit 0 is used as mentioned below.
  15089. */
  15090. /* Bit-0 in flags is used to indicate if the cores can operate synchronously
  15091. * i.e either as 2x2 MIMO or 2(1x1 SISO). This is true only for 4349 variants
  15092. * 0 - device can operate only in rsdb mode (eg: 4364)
  15093. * 1 - device can operate in both rsdb and mimo (eg : 4359 variants)
  15094. */
  15095. #define WL_RSDB_CAPS_VER 2
  15096. #define SYNCHRONOUS_OPERATION_TRUE (1 << 0)
  15097. #define WL_RSDB_CAPS_FIXED_LEN OFFSETOF(rsdb_caps_response_t, num_chains)
  15098. typedef struct rsdb_caps_response {
  15099. uint8 ver; /* Version */
  15100. uint8 len; /* length of this structure excluding ver and len */
  15101. uint8 rsdb; /* TRUE for rsdb chip */
  15102. uint8 num_of_cores; /* no of d11 cores */
  15103. uint16 flags; /* Flags to indicate various capabilities */
  15104. uint8 num_chains[1]; /* Tx/Rx chains for each core */
  15105. } rsdb_caps_response_t;
  15106. /* Data structures for rsdb bands */
  15107. #define WL_RSDB_BANDS_VER 2
  15108. #define WL_RSDB_BANDS_FIXED_LEN OFFSETOF(rsdb_bands_t, band)
  15109. typedef struct rsdb_bands
  15110. {
  15111. uint8 ver;
  15112. uint8 len;
  15113. uint16 num_cores; /* num of D11 cores */
  15114. int16 band[1]; /* The band operating on each of the d11 cores */
  15115. } rsdb_bands_t;
  15116. /* rsdb config */
  15117. #define WL_RSDB_CONFIG_VER 3
  15118. #define ALLOW_SIB_PARALLEL_SCAN (1 << 0)
  15119. #define MAX_BANDS 2
  15120. #define WL_RSDB_CONFIG_LEN sizeof(rsdb_config_t)
  15121. typedef uint8 rsdb_opmode_t;
  15122. typedef uint32 rsdb_flags_t;
  15123. typedef enum rsdb_modes {
  15124. WLC_SDB_MODE_NOSDB_MAIN = 1, /* 2X2 or MIMO mode (applicable only for 4355) */
  15125. WLC_SDB_MODE_NOSDB_AUX = 2,
  15126. WLC_SDB_MODE_SDB_MAIN = 3, /* This is RSDB mode(default) applicable only for 4364 */
  15127. WLC_SDB_MODE_SDB_AUX = 4,
  15128. WLC_SDB_MODE_SDB_AUTO = 5, /* Same as WLC_RSDB_MODE_RSDB(1+1) mode above */
  15129. } rsdb_modes_t;
  15130. typedef struct rsdb_config {
  15131. uint8 ver;
  15132. uint8 len;
  15133. uint16 reserved;
  15134. rsdb_opmode_t non_infra_mode;
  15135. rsdb_opmode_t infra_mode[MAX_BANDS];
  15136. rsdb_flags_t flags[MAX_BANDS];
  15137. rsdb_opmode_t current_mode; /* Valid only in GET, returns the current mode */
  15138. uint8 pad[3];
  15139. } rsdb_config_t;
  15140. /* WLC_MAJOR_VER > =5 */
  15141. /* TLV definitions and data structures for rsdb subcmds */
  15142. enum wl_rsdb_cmd_ids {
  15143. /* RSDB ioctls */
  15144. WL_RSDB_CMD_VER = 0,
  15145. WL_RSDB_CMD_CAPS = 1,
  15146. WL_RSDB_CMD_BANDS = 2,
  15147. WL_RSDB_CMD_CONFIG = 3,
  15148. /* Add before this !! */
  15149. WL_RSDB_CMD_LAST
  15150. };
  15151. #define WL_RSDB_IOV_VERSION 0x1
  15152. typedef struct rsdb_caps_response_v1 {
  15153. uint8 rsdb; /* TRUE for rsdb chip */
  15154. uint8 num_of_cores; /* no of d11 cores */
  15155. uint16 flags; /* Flags to indicate various capabilities */
  15156. uint8 num_chains[MAX_NUM_D11CORES]; /* Tx/Rx chains for each core */
  15157. uint8 band_cap[MAX_NUM_D11CORES]; /* band cap bitmask per slice */
  15158. } rsdb_caps_response_v1_t;
  15159. typedef struct rsdb_bands_v1
  15160. {
  15161. uint8 num_cores; /* num of D11 cores */
  15162. uint8 pad; /* padding bytes for 4 byte alignment */
  15163. int8 band[MAX_NUM_D11CORES]; /* The band operating on each of the d11 cores */
  15164. } rsdb_bands_v1_t;
  15165. typedef struct rsdb_config_xtlv {
  15166. rsdb_opmode_t reserved1; /* Non_infra mode is no more applicable */
  15167. rsdb_opmode_t infra_mode[MAX_BANDS]; /* Target mode for Infra association */
  15168. uint8 pad; /* pad bytes for 4 byte alignment */
  15169. rsdb_flags_t flags[MAX_BANDS];
  15170. rsdb_opmode_t current_mode; /* GET only; has current mode of operation */
  15171. uint8 pad1[3];
  15172. } rsdb_config_xtlv_t;
  15173. /* Definitions for slot_bss chanseq iovar */
  15174. #define WL_SLOT_BSS_VERSION 1
  15175. /* critical slots max size */
  15176. #define WL_SLOTTED_BSS_CS_BMP_CFG_MAX_SZ 128 /* arbitrary */
  15177. enum wl_slotted_bss_cmd_id {
  15178. WL_SLOTTED_BSS_CMD_VER = 0,
  15179. WL_SLOTTED_BSS_CMD_CHANSEQ = 1,
  15180. WL_SLOTTED_BSS_CMD_CS_BMP = 2 /* critical slots bitmap */
  15181. };
  15182. typedef uint16 chan_seq_type_t;
  15183. enum chan_seq_type {
  15184. CHAN_SEQ_TYPE_AWDL = 1,
  15185. CHAN_SEQ_TYPE_SLICE = 2,
  15186. CHAN_SEQ_TYPE_NAN = 3, /* NAN avail XTLV */
  15187. CHAN_SEQ_TYPE_NANHO = 4 /* NANHO channel schedule XTLV */
  15188. };
  15189. typedef uint8 sched_flag_t;
  15190. enum sched_flag {
  15191. NO_SDB_SCHED = 0x1,
  15192. SDB_TDM_SCHED = 0x2,
  15193. SDB_SPLIT_BAND_SCHED = 0x4, /* default mode for 4357 */
  15194. MAIN_ONLY = 0x8,
  15195. AUX_ONLY = 0x10,
  15196. SDB_DUAL_TIME = (MAIN_ONLY | AUX_ONLY),
  15197. NO_SDB_MAIN_ONLY = (NO_SDB_SCHED | MAIN_ONLY), /* default mode for 4364 */
  15198. SDB_TDM_SCHED_MAIN = (SDB_TDM_SCHED | MAIN_ONLY),
  15199. SDB_TDM_SCHED_AUX = (SDB_TDM_SCHED | AUX_ONLY),
  15200. SDB_TDM_SCHED_DUAL_TIME = (SDB_TDM_SCHED | SDB_DUAL_TIME),
  15201. SDB_SPLIT_BAND_SCHED_DUAL_TIME = (SDB_SPLIT_BAND_SCHED | SDB_DUAL_TIME)
  15202. };
  15203. typedef struct chan_seq_tlv_data {
  15204. uint32 flags;
  15205. uint8 data[1];
  15206. } chan_seq_tlv_data_t;
  15207. typedef struct chan_seq_tlv {
  15208. chan_seq_type_t type;
  15209. uint16 len;
  15210. chan_seq_tlv_data_t chanseq_data[1];
  15211. } chan_seq_tlv_t;
  15212. typedef struct sb_channel_sequence {
  15213. sched_flag_t sched_flags; /* (sdb-tdm or sdb-sb or Dual-Time) */
  15214. uint8 num_seq; /* number of chan_seq_tlv following */
  15215. uint16 pad;
  15216. chan_seq_tlv_t seq[1];
  15217. } sb_channel_sequence_t;
  15218. typedef struct slice_chan_seq {
  15219. uint8 slice_index; /* 0(Main) or 1 (Aux) */
  15220. uint8 num_chanspecs;
  15221. uint8 dur;
  15222. uint8 pad;
  15223. chanspec_t chanspecs[1];
  15224. } slice_chan_seq_t;
  15225. #define SLOT_BSS_SLICE_TYPE_DUR_MAX_RANGE 2u
  15226. #define SLOTTED_BSS_AGGR_EN (1 << 0) /* Bitmap of mode */
  15227. #define SLOTTED_BSS_AGGR_LIMIT_DUR (1 << 1) /* Jira 49554 */
  15228. #define SLOTTED_BSS_HE_1024_QAM_SUPPORT (1 << 2) /* MCS10-11 Support */
  15229. #define WL_SLICE_CHAN_SEQ_FIXED_LEN OFFSETOF(slice_chan_seq_t, chanspecs)
  15230. /* Definitions for slotted_bss stats */
  15231. #define SBSS_STATS_VERSION 1
  15232. #define SBSS_STATS_CURRENT_VERSION SBSS_STATS_VERSION
  15233. #define SBSS_MAX_CHAN_STATS 4
  15234. typedef struct sbss_core_stats {
  15235. uint32 sb_slot_start;
  15236. uint32 sb_slot_end;
  15237. uint32 sb_slot_skip;
  15238. uint32 mismatch_count;
  15239. } sbss_core_stats_t;
  15240. typedef struct sbss_chan_stats {
  15241. chanspec_t chanspec;
  15242. uint32 slot_start;
  15243. uint32 slot_end;
  15244. uint32 slot_skip;
  15245. } sbss_chan_stats_t;
  15246. typedef struct sbss_stats_v1 {
  15247. uint16 version;
  15248. uint16 length;
  15249. sbss_core_stats_t corestats[MAX_NUM_D11CORES];
  15250. sbss_chan_stats_t sbss_chanstats[MAX_NUM_D11CORES][SBSS_MAX_CHAN_STATS];
  15251. } sbss_stats_t;
  15252. /* slotted bss critical slots */
  15253. typedef struct wl_sbss_cs_bmp_s {
  15254. uint8 bitmap_len;
  15255. uint8 pad[3];
  15256. uint8 bitmap[];
  15257. } wl_sbss_cs_bmp_t;
  15258. typedef struct sim_pm_params {
  15259. uint32 enabled;
  15260. uint16 cycle;
  15261. uint16 up;
  15262. } sim_pm_params_t;
  15263. /* Digital napping status */
  15264. #define WL_NAP_STATUS_VERSION_1 1
  15265. typedef struct wl_nap_status_v1 {
  15266. uint16 version; /* structure version */
  15267. uint16 len; /* length of returned data */
  15268. uint16 fw_status; /* bitmask of FW disable reasons */
  15269. uint8 hw_status; /* bitmask for actual HW state info */
  15270. uint8 slice_index; /* which slice this represents */
  15271. uint32 total_disable_dur; /* total time (ms) disabled for fw_status */
  15272. } wl_nap_status_v1_t;
  15273. /* Bits for fw_status */
  15274. #define NAP_DISABLED_HOST 0x0001 /* Host has disabled through nap_enable */
  15275. #define NAP_DISABLED_RSSI 0x0002 /* Disabled because of nap_rssi_threshold */
  15276. #define NAP_DISABLED_SCAN 0x0004 /* Disabled because of scan */
  15277. #define NAP_DISABLED_ASSOC 0x0008 /* Disabled because of association */
  15278. #define NAP_DISABLED_LTE 0x0010 /* Disabled because of LTE */
  15279. #define NAP_DISABLED_ACI 0x0020 /* Disabled because of ACI mitigation */
  15280. /* Bits for hw_status */
  15281. #define NAP_HWCFG 0x01 /* State of NAP config bit in phy HW */
  15282. #define NAP_NOCLK 0x80 /* No clock to read HW (e.g. core down) */
  15283. /* ifdef WL_NATOE */
  15284. #define WL_NATOE_IOCTL_VERSION 1
  15285. #define WL_NATOE_IOC_BUFSZ 512 /* sufficient ioc buff size for natoe */
  15286. #define WL_NATOE_DBG_STATS_BUFSZ 2048
  15287. #define NATOE_FLAGS_ENAB_MASK 0x1
  15288. #define NATOE_FLAGS_ACTIVE_MASK 0x2
  15289. #define NATOE_FLAGS_PUBNW_MASK 0x4
  15290. #define NATOE_FLAGS_PVTNW_MASK 0x8
  15291. #define NATOE_FLAGS_ENAB_SHFT_MASK 0
  15292. #define NATOE_FLAGS_ACTIVE_SHFT_MASK 1
  15293. #define NATOE_FLAGS_PUBNW_SHFT_MASK 2
  15294. #define NATOE_FLAGS_PVTNW_SHFT_MASK 3
  15295. #define NATOE_FLAGS_PUB_NW_UP (1 << NATOE_FLAGS_PUBNW_SHFT_MASK)
  15296. #define NATOE_FLAGS_PVT_NW_UP (1 << NATOE_FLAGS_PVTNW_SHFT_MASK)
  15297. #define PCIE_FRWDPKT_STATS_VERSION 1
  15298. /* Module version is 1 for IGUANA */
  15299. #define WL_NATOE_MODULE_VER_1 1
  15300. /* Module version is 2 for Lemur */
  15301. #define WL_NATOE_MODULE_VER_2 2
  15302. /* WL_NATOE_CMD_MOD_VER */
  15303. typedef uint16 wl_natoe_ver_t;
  15304. /* config natoe STA and AP IP's structure */
  15305. typedef struct {
  15306. uint32 sta_ip;
  15307. uint32 sta_netmask;
  15308. uint32 sta_router_ip;
  15309. uint32 sta_dnsip;
  15310. uint32 ap_ip;
  15311. uint32 ap_netmask;
  15312. } wl_natoe_config_ips_t;
  15313. /* natoe ports config structure */
  15314. typedef struct {
  15315. uint16 start_port_num;
  15316. uint16 no_of_ports;
  15317. } wl_natoe_ports_config_t;
  15318. /* natoe ports exception info */
  15319. typedef struct {
  15320. uint16 sta_port_num;
  15321. uint16 dst_port_num; /* for SIP type protocol, dst_port_num info can be ignored by FW */
  15322. uint32 ip; /* for SIP ip is APcli_ip and for port clash it is dst_ip */
  15323. uint8 entry_type; /* Create/Destroy */
  15324. uint8 pad[3];
  15325. } wl_natoe_exception_port_t;
  15326. /* container for natoe ioctls & events */
  15327. typedef struct wl_natoe_ioc {
  15328. uint16 version; /* interface command or event version */
  15329. uint16 id; /* natoe ioctl cmd ID */
  15330. uint16 len; /* total length of all tlv records in data[] */
  15331. uint16 pad; /* pad to be 32 bit aligment */
  15332. uint8 data[]; /* var len payload of bcm_xtlv_t type */
  15333. } wl_natoe_ioc_t;
  15334. typedef struct wl_natoe_pool_stats_v1 {
  15335. /* For debug purposes */
  15336. uint16 poolreorg_cnt;
  15337. uint16 poolrevert_cnt;
  15338. uint16 txfrag_state;
  15339. uint16 rxfrag_state;
  15340. uint16 txfrag_plen;
  15341. uint16 rxfrag_plen;
  15342. uint16 tx_pavail;
  15343. uint16 rx_pavail;
  15344. uint16 txmin_bkup_bufs;
  15345. uint16 rxmin_bkup_bufs;
  15346. uint16 pktpool_sbuf_alloc;
  15347. uint16 pktpool_plen;
  15348. uint16 pktpool_pavail;
  15349. /* Peak shared buffer count in all iterations */
  15350. uint16 sbuf_peak;
  15351. /* Peak shared buffer count in current D3 iteration */
  15352. uint16 sbuf_peak_cur;
  15353. } wl_natoe_pool_stats_v1_t;
  15354. typedef struct wl_natoe_arp_entry_v1 {
  15355. struct ipv4_addr ip;
  15356. struct ether_addr mac_addr;
  15357. uint8 lifetime;
  15358. uint8 flags;
  15359. } wl_natoe_arp_entry_v1_t;
  15360. typedef struct wl_natoe_dbg_arp_tbl_info_v1 {
  15361. uint8 valid_arp_entries;
  15362. uint8 PAD[3];
  15363. wl_natoe_arp_entry_v1_t arp_ent[];
  15364. } wl_natoe_dbg_arp_tbl_info_v1_t;
  15365. typedef struct wl_natoe_skip_port_entry_v1 {
  15366. struct ipv4_addr srcip;
  15367. uint16 src_port;
  15368. uint16 lifetime;
  15369. } wl_natoe_skip_port_entry_v1_t;
  15370. typedef struct wl_natoe_skip_port_info_v1 {
  15371. uint8 valid_entries;
  15372. uint8 PAD[3];
  15373. wl_natoe_skip_port_entry_v1_t skip_port_ent[];
  15374. } wl_natoe_skip_port_info_v1_t;
  15375. typedef struct wl_natoe_dbg_stats_v1 {
  15376. uint16 active_nat_entries;
  15377. uint16 active_dns_entries;
  15378. uint16 active_icmp_entries;
  15379. uint16 valid_arp_entries;
  15380. uint16 prev_nat_entries;
  15381. uint16 prev_dns_entries;
  15382. uint16 tcp_fast_reclaim_cnt;
  15383. uint16 mcast_packets;
  15384. uint16 bcast_packets;
  15385. uint16 port_commands_rcvd;
  15386. uint16 unsupported_prot;
  15387. uint16 arp_req_sent;
  15388. uint16 arp_rsp_rcvd;
  15389. uint16 non_ether_frames;
  15390. uint16 port_alloc_fail;
  15391. uint16 srcip_tbl_full;
  15392. uint16 dstip_tbl_full;
  15393. uint16 nat_tbl_full;
  15394. uint16 icmp_error_cnt;
  15395. uint16 pkt_drops_resource;
  15396. uint32 frwd_nat_pkt_cnt;
  15397. uint32 reverse_nat_pkt_cnt;
  15398. uint16 pub_nw_chspec;
  15399. uint16 pvt_nw_chspec;
  15400. uint8 pubnw_cfg_idx;
  15401. uint8 pvtnw_cfg_idx;
  15402. uint8 pubnw_cfg_ID;
  15403. uint8 pvtnw_cfg_ID;
  15404. uint16 natoe_flags;
  15405. } wl_natoe_dbg_stats_v1_t;
  15406. typedef struct wl_natoe_exception_port_inf_v1 {
  15407. uint16 except_bmap_size;
  15408. uint8 port_except_bmap[];
  15409. } wl_natoe_exception_port_inf_v1_t;
  15410. typedef struct wl_natoe_dstnat_entry_v1 {
  15411. struct ipv4_addr clientip;
  15412. struct ether_addr client_mac_addr;
  15413. uint16 client_listenport;
  15414. uint8 opcode;
  15415. } wl_natoe_dstnat_entry_v1_t;
  15416. typedef struct wl_pcie_frwd_stats_v1 {
  15417. uint16 version;
  15418. uint16 len;
  15419. uint16 frwd_txfrag_q_cnt; /* no. of txfrags in frwd_txfrag_list */
  15420. /* no. of outstanding lbufs in txpath on if0/ifx */
  15421. uint16 tx_frwd_n_lb_if0;
  15422. uint16 tx_frwd_n_lb_ifx;
  15423. /* no. of outstanding lfrags in txpath on if0/ifx */
  15424. uint16 tx_frwd_n_lf_if0;
  15425. uint16 tx_frwd_n_lf_ifx;
  15426. /* no. of pending frwd pkts dropped upon d3 entry */
  15427. uint16 tx_frwd_d3_drop_cnt;
  15428. /* Total no. of lbufs frwded in txpath on if0/ifx */
  15429. uint32 tx_frwd_n_lb_if0_cnt;
  15430. uint32 tx_frwd_n_lb_ifx_cnt;
  15431. /* Total no. of lfrags frwded in txpath on if0/ifx */
  15432. uint32 tx_frwd_n_lf_if0_cnt;
  15433. uint32 tx_frwd_n_lf_ifx_cnt;
  15434. uint32 frwd_tx_drop_thr_cnt; /* no. of pkts dropped due to txfrag threshold */
  15435. uint32 frwd_tx_drop_err_cnt; /* no. of pkts dropped due to txfrags not avail / errors */
  15436. } wl_pcie_frwd_stats_v1_t;
  15437. enum wl_natoe_cmds {
  15438. WL_NATOE_CMD_MOD_VER = 0,
  15439. WL_NATOE_CMD_ENABLE = 1,
  15440. WL_NATOE_CMD_CONFIG_IPS = 2,
  15441. WL_NATOE_CMD_CONFIG_PORTS = 3,
  15442. WL_NATOE_CMD_DBG_STATS = 4,
  15443. WL_NATOE_CMD_EXCEPTION_PORT = 5,
  15444. WL_NATOE_CMD_SKIP_PORT = 6,
  15445. WL_NATOE_CMD_TBL_CNT = 7,
  15446. WL_NATOE_CMD_CONFIG_DSTNAT = 8,
  15447. WL_NATOE_CMD_CTRL = 9
  15448. };
  15449. enum wl_natoe_cmd_xtlv_id {
  15450. WL_NATOE_XTLV_MOD_VER = 0,
  15451. WL_NATOE_XTLV_ENABLE = 1,
  15452. WL_NATOE_XTLV_CONFIG_IPS = 2,
  15453. WL_NATOE_XTLV_CONFIG_PORTS = 3,
  15454. WL_NATOE_XTLV_DBG_STATS = 4,
  15455. WL_NATOE_XTLV_EXCEPTION_PORT = 5,
  15456. WL_NATOE_XTLV_SKIP_PORT = 6,
  15457. WL_NATOE_XTLV_TBL_CNT = 7,
  15458. WL_NATOE_XTLV_ARP_TBL = 8,
  15459. WL_NATOE_XTLV_POOLREORG = 9,
  15460. WL_NATOE_XTLV_CONFIG_DSTNAT = 10,
  15461. WL_NATOE_XTLV_CTRL = 11
  15462. };
  15463. /* endif WL_NATOE */
  15464. enum wl_idauth_cmd_ids {
  15465. WL_IDAUTH_CMD_CONFIG = 1,
  15466. WL_IDAUTH_CMD_PEER_INFO = 2,
  15467. WL_IDAUTH_CMD_COUNTERS = 3,
  15468. WL_IDAUTH_CMD_LAST
  15469. };
  15470. enum wl_idauth_xtlv_id {
  15471. WL_IDAUTH_XTLV_AUTH_ENAB = 0x1,
  15472. WL_IDAUTH_XTLV_GTK_ROTATION = 0x2,
  15473. WL_IDAUTH_XTLV_EAPOL_COUNT = 0x3,
  15474. WL_IDAUTH_XTLV_EAPOL_INTRVL = 0x4,
  15475. WL_IDAUTH_XTLV_BLKLIST_COUNT = 0x5,
  15476. WL_IDAUTH_XTLV_BLKLIST_AGE = 0x6,
  15477. WL_IDAUTH_XTLV_PEERS_INFO = 0x7,
  15478. WL_IDAUTH_XTLV_COUNTERS = 0x8
  15479. };
  15480. enum wl_idauth_stats {
  15481. WL_AUTH_PEER_STATE_AUTHORISED = 0x01,
  15482. WL_AUTH_PEER_STATE_BLACKLISTED = 0x02,
  15483. WL_AUTH_PEER_STATE_4WAY_HS_ONGOING = 0x03,
  15484. WL_AUTH_PEER_STATE_LAST
  15485. };
  15486. typedef struct {
  15487. uint16 state; /* Peer State: Authorised or Blacklisted */
  15488. struct ether_addr peer_addr; /* peer Address */
  15489. uint32 blklist_end_time; /* Time of blacklist end */
  15490. } auth_peer_t;
  15491. typedef struct wl_idauth_counters {
  15492. uint32 auth_reqs; /* No of auth req recvd */
  15493. uint32 mic_fail; /* No of mic fails */
  15494. uint32 four_way_hs_fail; /* No of 4-way handshake fails */
  15495. } wl_idauth_counters_t;
  15496. #define WLC_UTRACE_LEN (1024u * 4u) // default length
  15497. #define WLC_UTRACE_LEN_AUX (1024u * 3u) // reduced length to fit smaller AUX BM
  15498. #define WLC_UTRACE_LEN_SC (1024u * 3u) // reduced length to fit smaller Scan core BM
  15499. #define WLC_UTRACE_READ_END 0
  15500. #define WLC_UTRACE_MORE_DATA 1
  15501. typedef struct wl_utrace_capture_args_v1 {
  15502. uint32 length;
  15503. uint32 flag;
  15504. } wl_utrace_capture_args_v1_t;
  15505. #define UTRACE_CAPTURE_VER_2 2
  15506. typedef struct wl_utrace_capture_args_v2 {
  15507. /* structure control */
  15508. uint16 version; /**< structure version */
  15509. uint16 length; /**< length of the response */
  15510. uint32 flag; /* Indicates if there is more data or not */
  15511. } wl_utrace_capture_args_v2_t;
  15512. /* Signal read end. */
  15513. #define WLC_REGVAL_READ_END 0
  15514. /* Signal more data pending. */
  15515. #define WLC_REGVAL_MORE_DATA 1
  15516. /* Internal read state. */
  15517. #define WLC_REGVAL_READ_CONTINUE 2
  15518. #define WLC_REGVAL_DUMP_PHYREG 0
  15519. #define WLC_REGVAL_DUMP_RADREG 1
  15520. #define PHYREGVAL_CAPTURE_BUFFER_LEN 2048
  15521. typedef struct wl_regval_capture_args {
  15522. uint32 control_flag; /* Carries status information. */
  15523. } wl_regval_capture_args_t;
  15524. /* XTLV IDs for the Health Check "hc" iovar top level container */
  15525. enum {
  15526. WL_HC_XTLV_ID_CAT_HC = 1, /* category for HC as a whole */
  15527. WL_HC_XTLV_ID_CAT_DATAPATH_TX = 2, /* Datapath Tx */
  15528. WL_HC_XTLV_ID_CAT_DATAPATH_RX = 3, /* Datapath Rx */
  15529. WL_HC_XTLV_ID_CAT_SCAN = 4, /* Scan */
  15530. WL_HC_XTLV_ID_CAT_EVENTMASK = 5, /* Health Check event mask. */
  15531. };
  15532. /* Health Check: Common XTLV IDs for sub-elements in the top level container
  15533. * Number starts at 0x8000 to be out of the way for category specific IDs.
  15534. */
  15535. enum {
  15536. WL_HC_XTLV_ID_ERR = 0x8000, /* for sub-command err return */
  15537. WL_HC_XTLV_ID_IDLIST = 0x8001, /* container for uint16 IDs */
  15538. };
  15539. /* Health Check: Datapath TX IDs */
  15540. enum {
  15541. WL_HC_TX_XTLV_ID_VAL_STALL_THRESHOLD = 1, /* stall_threshold */
  15542. WL_HC_TX_XTLV_ID_VAL_STALL_SAMPLE_SIZE = 2, /* stall_sample_size */
  15543. WL_HC_TX_XTLV_ID_VAL_STALL_TIMEOUT = 3, /* stall_timeout */
  15544. WL_HC_TX_XTLV_ID_VAL_STALL_FORCE = 4, /* stall_force */
  15545. WL_HC_TX_XTLV_ID_VAL_STALL_EXCLUDE = 5, /* stall_exclude */
  15546. WL_HC_TX_XTLV_ID_VAL_FC_TIMEOUT = 6, /* flow ctl timeout */
  15547. WL_HC_TX_XTLV_ID_VAL_FC_FORCE = 7, /* flow ctl force failure */
  15548. WL_HC_TX_XTLV_ID_VAL_DELAY_TO_TRAP = 8, /* delay threshold for forced trap */
  15549. WL_HC_TX_XTLV_ID_VAL_DELAY_TO_RPT = 9, /* delay threshold for event log report */
  15550. WL_HC_TX_XTLV_ID_VAL_FAILURE_TO_RPT = 10, /* threshold for consecutive TX failures */
  15551. };
  15552. /* Health Check: Datapath RX IDs */
  15553. enum {
  15554. WL_HC_RX_XTLV_ID_VAL_DMA_STALL_TIMEOUT = 1, /* dma_stall_timeout */
  15555. WL_HC_RX_XTLV_ID_VAL_DMA_STALL_FORCE = 2, /* dma_stall test trigger */
  15556. WL_HC_RX_XTLV_ID_VAL_STALL_THRESHOLD = 3, /* stall_threshold */
  15557. WL_HC_RX_XTLV_ID_VAL_STALL_SAMPLE_SIZE = 4, /* stall_sample_size */
  15558. WL_HC_RX_XTLV_ID_VAL_STALL_FORCE = 5, /* stall test trigger */
  15559. };
  15560. /* Health Check: Datapath SCAN IDs */
  15561. enum {
  15562. WL_HC_XTLV_ID_VAL_SCAN_STALL_THRESHOLD = 1, /* scan stall threshold */
  15563. };
  15564. /* Health check: PHY IDs */
  15565. /* Needed for iguana 13.35 branch */
  15566. typedef enum {
  15567. PHY_HC_DD_ALL = 0,
  15568. PHY_HC_DD_TEMPSENSE = 1,
  15569. PHY_HC_DD_VCOCAL = 2,
  15570. PHY_HC_DD_RX = 3,
  15571. PHY_HC_DD_TX = 4,
  15572. PHY_HC_DD_LAST /* This must be the last entry */
  15573. } phy_hc_dd_type_t;
  15574. typedef enum {
  15575. PHY_HC_DD_TEMP_FAIL = 0,
  15576. PHY_HC_DD_VCO_FAIL = 1,
  15577. PHY_HC_DD_RXDSN_FAIL = 2,
  15578. PHY_HC_DD_TXPOW_FAIL = 3,
  15579. PHY_HC_DD_END /* This must be the last entry */
  15580. } phy_hc_dd_type_v2_t;
  15581. /* IDs of Health Check report structures for sub types of health checks within WL */
  15582. typedef enum wl_hc_dd_type {
  15583. WL_HC_DD_PCIE = 0, /* PCIe */
  15584. WL_HC_DD_RX_DMA_STALL = 1, /* RX DMA stall check */
  15585. WL_HC_DD_RX_STALL = 2, /* RX stall check */
  15586. WL_HC_DD_TX_STALL = 3, /* TX stall check */
  15587. WL_HC_DD_SCAN_STALL = 4, /* SCAN stall check */
  15588. WL_HC_DD_PHY = 5, /* PHY health check */
  15589. WL_HC_DD_REINIT = 6, /* Reinit due to other reasons */
  15590. WL_HC_DD_TXQ_STALL = 7, /* TXQ stall */
  15591. WL_HC_DD_MAX
  15592. } wl_hc_dd_type_t;
  15593. /*
  15594. * Health Check report structures for sub types of health checks within WL
  15595. */
  15596. /* Health Check report structure for Rx DMA Stall check */
  15597. typedef struct {
  15598. uint16 type;
  15599. uint16 length;
  15600. uint16 timeout;
  15601. uint16 stalled_dma_bitmap;
  15602. } wl_rx_dma_hc_info_t;
  15603. /* Health Check report structure for Tx packet failure check */
  15604. typedef struct {
  15605. uint16 type;
  15606. uint16 length;
  15607. uint32 stall_bitmap;
  15608. uint32 stall_bitmap1;
  15609. uint32 failure_ac;
  15610. uint32 threshold;
  15611. uint32 tx_all;
  15612. uint32 tx_failure_all;
  15613. } wl_tx_hc_info_t;
  15614. /* Health Check report structure for Rx dropped packet failure check */
  15615. typedef struct {
  15616. uint16 type;
  15617. uint16 length;
  15618. uint32 bsscfg_idx;
  15619. uint32 rx_hc_pkts;
  15620. uint32 rx_hc_dropped_all;
  15621. uint32 rx_hc_alert_th;
  15622. } wl_rx_hc_info_t;
  15623. /* HE top level command IDs */
  15624. enum {
  15625. WL_HE_CMD_ENAB = 0u,
  15626. WL_HE_CMD_FEATURES = 1u,
  15627. WL_HE_CMD_TWT_SETUP = 2u,
  15628. WL_HE_CMD_TWT_TEARDOWN = 3u,
  15629. WL_HE_CMD_TWT_INFO = 4u,
  15630. WL_HE_CMD_BSSCOLOR = 5u,
  15631. WL_HE_CMD_PARTIAL_BSSCOLOR = 6u,
  15632. WL_HE_CMD_CAP = 7u,
  15633. WL_HE_CMD_STAID = 8u,
  15634. WL_HE_CMD_MUEDCA = 9u,
  15635. WL_HE_CMD_RTSDURTHRESH = 10u,
  15636. WL_HE_CMD_PEDURATION = 11u,
  15637. WL_HE_CMD_TESTBED_MODE = 12u,
  15638. WL_HE_CMD_OMI_CONFIG = 13u,
  15639. WL_HE_CMD_OMI_STATUS = 14u,
  15640. WL_HE_CMD_OMI_ULMU_THROTTLE = 15u,
  15641. WL_HE_CMD_ULMU_DISABLE_POLICY = 16u,
  15642. WL_HE_CMD_ULMU_DISABLE_STATS = 17u,
  15643. WL_HE_CMD_OMI_DLMU_RSD_RCM_MPF_MAP = 18u,
  15644. WL_HE_CMD_SR_PROHIBIT = 19u,
  15645. WL_HE_CMD_LAST
  15646. };
  15647. enum {
  15648. WL_HE_MUEDCA_IE = 0,
  15649. WL_HE_MUEDCA_SHM = 1,
  15650. WL_HE_MUEDCA_LAST
  15651. };
  15652. #ifdef WL11AX
  15653. /* struct for dump MU EDCA IE/SHM paramters */
  15654. typedef struct wl_he_muedca_ie_v1 {
  15655. uint16 version; /* structure version */
  15656. uint16 length; /* data length (starting after this field) */
  15657. uint8 mu_qos_info;
  15658. he_mu_ac_param_record_t param_ac[AC_COUNT];
  15659. } wl_he_muedca_ie_v1_t;
  15660. typedef wl_he_muedca_ie_v1_t wl_he_muedca_ie_t;
  15661. #define WL_HE_MUEDCA_VER_1 1
  15662. #endif /* WL11AX */
  15663. /* TWT top level command IDs */
  15664. enum {
  15665. WL_TWT_CMD_ENAB = 0,
  15666. WL_TWT_CMD_SETUP = 1,
  15667. WL_TWT_CMD_TEARDOWN = 2,
  15668. WL_TWT_CMD_INFO = 3,
  15669. WL_TWT_CMD_AUTOSCHED = 4,
  15670. WL_TWT_CMD_STATS = 5,
  15671. WL_TWT_CMD_EARLY_TERM_TIME = 6,
  15672. WL_TWT_CMD_RESP_CONFIG = 7,
  15673. WL_TWT_CMD_SPPS_ENAB = 8,
  15674. WL_TWT_CMD_LAST
  15675. };
  15676. /* TODO: Remove the follwoing after mering TWT changes to trunk */
  15677. #define WL_TWT_CMD_DEF_IN_WLIOCTL 1
  15678. #define WL_HEB_VER_1 1
  15679. /* HEB top level command IDs */
  15680. enum {
  15681. WL_HEB_CMD_ENAB = 0,
  15682. WL_HEB_CMD_NUM_HEB = 1,
  15683. WL_HEB_CMD_COUNTERS = 2,
  15684. WL_HEB_CMD_CLEAR_COUNTERS = 3,
  15685. WL_HEB_CMD_CONFIG = 4,
  15686. WL_HEB_CMD_STATUS = 5,
  15687. WL_HEB_CMD_LAST
  15688. };
  15689. /* HEB counters structures */
  15690. typedef struct wl_heb_int_cnt_v1 {
  15691. uint16 pre_event;
  15692. uint16 start_event;
  15693. uint16 end_event;
  15694. uint16 missed;
  15695. } wl_heb_int_cnt_v1_t;
  15696. typedef struct wl_heb_cnt_v1 {
  15697. /* structure control */
  15698. uint16 version; /* structure version */
  15699. uint16 length; /* data length (starting after this field) */
  15700. wl_heb_int_cnt_v1_t heb_int_cnt[1];
  15701. } wl_heb_cnt_v1_t;
  15702. // struct for configuring HEB
  15703. typedef struct wl_config_heb_fill_v1 {
  15704. uint16 version; /* structure version */
  15705. uint16 length; /* data length (starting after this field) */
  15706. uint32 duration;
  15707. uint32 periodicity;
  15708. uint16 heb_idx;
  15709. uint16 preeventtime;
  15710. uint8 count;
  15711. uint8 PAD[3];
  15712. } wl_config_heb_fill_v1_t;
  15713. typedef struct wl_heb_blk_params_v1 {
  15714. /* Don't change the order of following elements. This is as per the HEB HW spec */
  15715. uint32 event_int_val_l;
  15716. uint32 event_int_val_h;
  15717. uint32 param2;
  15718. uint32 param3;
  15719. uint32 pre_event_intmsk_bmp;
  15720. uint32 start_event_intmsk_bmp;
  15721. uint32 end_event_intmsk_bmp;
  15722. uint32 event_driver_info;
  15723. uint16 param1;
  15724. uint8 event_count;
  15725. uint8 noa_invert;
  15726. } wl_heb_blk_params_v1_t;
  15727. typedef struct wl_heb_int_status_v1 {
  15728. uint32 heb_idx;
  15729. wl_heb_blk_params_v1_t blk_params;
  15730. } wl_heb_reg_status_v1_t;
  15731. typedef struct wl_heb_status_v1 {
  15732. uint16 version; /* structure version */
  15733. uint16 length; /* data length (starting after this field) */
  15734. wl_heb_reg_status_v1_t heb_status[1];
  15735. } wl_heb_status_v1_t;
  15736. /* HWA */
  15737. #define WL_HWA_VER_1 1
  15738. /* HWA top level command IDs */
  15739. typedef enum wl_hwa_cmd_type {
  15740. WL_HWA_CMD_ENMODULES = 0,
  15741. WL_HWA_CMD_HWCAPS = 1,
  15742. WL_HWA_CMD_COUNTERS = 2,
  15743. WL_HWA_CMD_CLRCNTS = 3,
  15744. WL_HWA_CMD_LAST
  15745. } wl_hwa_cmd_type_t;
  15746. typedef struct wl_hwa_cnts_info_v1 {
  15747. uint16 cnt_rxs_filter; /* #filters added */
  15748. uint16 cnt_rxs_chainable; /* #rxchainable matched */
  15749. } wl_hwa_cnts_info_v1_t;
  15750. /* HWA dump info structures */
  15751. typedef struct wl_hwa_hwcaps_info_v1 {
  15752. uint16 up; /* is hwa init'd/deint'd */
  15753. uint16 corerev; /* hwa core revision */
  15754. uint32 submodules_mask; /* mask for hwa submodules that are enabled */
  15755. } wl_hwa_hwcaps_info_v1_t;
  15756. typedef struct wl_hwa_cnts_v1 {
  15757. /* structure control */
  15758. uint16 version; /* structure version */
  15759. uint16 length; /* data length (starting after this field) */
  15760. wl_hwa_cnts_info_v1_t hwa_cnts_info[]; /* variable length array with hwa counters */
  15761. } wl_hwa_cnts_v1_t;
  15762. /* All submodules, order is important and define order of initialization. */
  15763. /* Not use enumeration here because these defines are also used in macro */
  15764. #define HWA_SUBMODULES_COMMON 0 /**< Common */
  15765. #define HWA_SUBMODULES_TXPOST 1u /**< TxPost 3a */
  15766. #define HWA_SUBMODULES_RXPOSTFILL 2u /**< RxPost and Fill 1a/1b */
  15767. #define HWA_SUBMODULES_TXDMA 3u /**< TxDMA 3b */
  15768. #define HWA_SUBMODULES_TXS 4u /**< TxStatus 4a */
  15769. #define HWA_SUBMODULES_BUFMGR 5u /**< Buffer Manager, RX and TX. Do this last */
  15770. #define HWA_SUBMODULES_CPL 6u /**< Completion 2b/4b */
  15771. #define HWA_SUBMODULES_RXS 7u /**< RxStatus 2a */
  15772. #define HWA_SUBMODULES_NUM 8u /**< number of submodules */
  15773. #define HWA_SUBMODULES_ALL 0xFF /* Bitmaps for all submodules */
  15774. #ifdef HWA
  15775. #define HWA_SUBMODULE_MASK(submodule) (1u << (submodule))
  15776. #else
  15777. #define HWA_SUBMODULE_MASK(submodule) (0)
  15778. #endif /* HWA */
  15779. /*
  15780. * NOTES:
  15781. * wl_twt_sdesc_t is used to support both broadcast TWT and individual TWT.
  15782. * Value in bit[0:2] in 'flow_id' field is interpreted differently:
  15783. * - flow id for individual TWT (when WL_TWT_FLOW_FLAG_BROADCAST bit is NOT set
  15784. * in 'flow_flags' field)
  15785. * - flow id as defined in Table 8-248l1 for broadcast TWT (when
  15786. * WL_TWT_FLOW_FLAG_BROADCAST bit is set)
  15787. * In latter case other bits could be used to differentiate different flows
  15788. * in order to support multiple broadcast TWTs with the same flow id.
  15789. */
  15790. /* TWT Setup descriptor */
  15791. typedef struct wl_twt_sdesc {
  15792. /* Setup Command. */
  15793. uint8 setup_cmd; /* See TWT_SETUP_CMD_XXXX in 802.11ah.h */
  15794. uint8 flow_flags; /* Flow attributes. See WL_TWT_FLOW_FLAG_XXXX below */
  15795. uint8 flow_id; /* must be between 0 and 7. Set 0xFF for auto assignment */
  15796. uint8 bid; /* must be between 0 and 31. Set 0xFF for auto assignment */
  15797. uint8 channel; /* Twt channel - Not used for now */
  15798. uint8 negotiation_type; /* Negotiation Type: See macros TWT_NEGO_TYPE_X */
  15799. uint8 frame_recomm; /* frame recommendation for broadcast TWTs - Not used for now */
  15800. uint8 wake_type; /* See WL_TWT_TIME_TYPE_XXXX below */
  15801. uint32 wake_time_h; /* target wake time - BSS TSF (us) */
  15802. uint32 wake_time_l;
  15803. uint32 wake_dur; /* target wake duration in unit of microseconds */
  15804. uint32 wake_int; /* target wake interval */
  15805. uint32 btwt_persistence; /* Broadcast TWT Persistence */
  15806. uint32 wake_int_max; /* max wake interval(uS) for TWT */
  15807. uint8 duty_cycle_min; /* min duty cycle for TWT(Percentage) */
  15808. uint8 pad;
  15809. /* deprecated - to be removed */
  15810. uint16 li;
  15811. } wl_twt_sdesc_t;
  15812. /* Flow flags */
  15813. #define WL_TWT_FLOW_FLAG_UNANNOUNCED (1u << 0u)
  15814. #define WL_TWT_FLOW_FLAG_TRIGGER (1u << 1u)
  15815. #define WL_TWT_FLOW_FLAG_REQUEST (1u << 2u)
  15816. #define WL_TWT_FLOW_FLAG_PROTECT (1u << 3u)
  15817. #define WL_TWT_FLOW_FLAG_RESPONDER_PM (1u << 4u)
  15818. #define WL_TWT_FLOW_FLAG_UNSOLICITED (1u << 5u)
  15819. /* Deprecated - To be removed */
  15820. #define WL_TWT_FLOW_FLAG_BROADCAST (1u << 5u)
  15821. #define WL_TWT_FLOW_FLAG_WAKE_TBTT_NEGO (1u << 6u)
  15822. #define WL_TWT_FLOW_FLAG_IMPLICIT (1u << 7u)
  15823. /* Flow id */
  15824. #define WL_TWT_FLOW_ID_FID 0x07u /* flow id */
  15825. #define WL_TWT_FLOW_ID_GID_MASK 0x70u /* group id - broadcast TWT only */
  15826. #define WL_TWT_FLOW_ID_GID_SHIFT 4u
  15827. #define WL_TWT_INV_BCAST_ID 0xFFu
  15828. #define WL_TWT_INV_FLOW_ID 0xFFu
  15829. /* auto flow_id */
  15830. #define WL_TWT_SETUP_FLOW_ID_AUTO 0xFFu
  15831. /* auto broadcast ID */
  15832. #define WL_TWT_SETUP_BCAST_ID_AUTO 0xFFu
  15833. /* Infinite persistence for broadcast schedule */
  15834. #define WL_TWT_INFINITE_BTWT_PERSIST 0xFFFFFFFFu
  15835. /* should be larger than what chip supports */
  15836. #define WL_TWT_STATS_MAX_BTWT 4u
  15837. #define WL_TWT_STATS_MAX_ITWT 4u
  15838. /* Wake type */
  15839. /* TODO: not yet finalized */
  15840. #define WL_TWT_TIME_TYPE_BSS 0u /* The time specified in wake_time_h/l is
  15841. * the BSS TSF time.
  15842. */
  15843. #define WL_TWT_TIME_TYPE_OFFSET 1u /* The time specified in wake_time_h/l is an offset
  15844. * of the TSF time when the iovar is processed.
  15845. */
  15846. #define WL_TWT_TIME_TYPE_AUTO 2u /* The target wake time is chosen internally by the FW */
  15847. #define WL_TWT_SETUP_VER 0u
  15848. /* HE TWT Setup command */
  15849. typedef struct wl_twt_setup {
  15850. /* structure control */
  15851. uint16 version; /* structure version */
  15852. uint16 length; /* data length (starting after this field) */
  15853. /* peer address */
  15854. struct ether_addr peer; /* leave it all 0s' for AP */
  15855. uint8 pad[2];
  15856. /* setup descriptor */
  15857. wl_twt_sdesc_t desc;
  15858. /* deprecated - to be removed */
  15859. uint16 dialog;
  15860. uint8 pad1[2];
  15861. } wl_twt_setup_t;
  15862. /* deprecated -to be removed */
  15863. #define WL_TWT_DIALOG_TOKEN_AUTO 0xFFFF
  15864. #define WL_TWT_TEARDOWN_VER 0u
  15865. /* twt teardown descriptor */
  15866. typedef struct wl_twt_teardesc {
  15867. uint8 negotiation_type;
  15868. uint8 flow_id; /* must be between 0 and 7 */
  15869. uint8 bid; /* must be between 0 and 31 */
  15870. bool alltwt; /* all twt teardown - 0 or 1 */
  15871. } wl_twt_teardesc_t;
  15872. /* HE TWT Teardown command */
  15873. typedef struct wl_twt_teardown {
  15874. /* structure control */
  15875. uint16 version; /* structure version */
  15876. uint16 length; /* data length (starting after this field) */
  15877. /* peer address */
  15878. struct ether_addr peer; /* leave it all 0s' for AP */
  15879. wl_twt_teardesc_t teardesc; /* Teardown descriptor */
  15880. /* deprecated - to be removed */
  15881. uint8 flow_flags;
  15882. uint8 flow_id;
  15883. uint8 bid;
  15884. uint8 pad;
  15885. } wl_twt_teardown_t;
  15886. /* twt information descriptor */
  15887. typedef struct wl_twt_infodesc {
  15888. uint8 flow_flags; /* See WL_TWT_INFO_FLAG_XXX below */
  15889. uint8 flow_id;
  15890. uint8 pad[2];
  15891. uint32 next_twt_h;
  15892. uint32 next_twt_l;
  15893. /* deprecated - to be removed */
  15894. uint8 wake_type;
  15895. uint8 pad1[3];
  15896. } wl_twt_infodesc_t;
  15897. /* Flow flags */
  15898. #define WL_TWT_INFO_FLAG_ALL_TWT (1u << 0u) /* All TWT */
  15899. #define WL_TWT_INFO_FLAG_RESUME (1u << 1u) /* 1 is TWT Resume, 0 is TWT Suspend */
  15900. /* deprecated - to be removed */
  15901. #define WL_TWT_INFO_FLAG_RESP_REQ (1 << 0) /* Response Requested */
  15902. #define WL_TWT_INFO_FLAG_NEXT_TWT_REQ (1 << 1) /* Next TWT Request */
  15903. #define WL_TWT_INFO_FLAG_BTWT_RESCHED (1 << 2) /* Broadcast Reschedule */
  15904. typedef wl_twt_infodesc_t wl_twt_idesc_t;
  15905. #define WL_TWT_INFO_VER 0u
  15906. /* HE TWT Information command */
  15907. typedef struct wl_twt_info {
  15908. /* structure control */
  15909. uint16 version; /* structure version */
  15910. uint16 length; /* data length (starting after this field) */
  15911. /* peer address */
  15912. struct ether_addr peer; /* leave it all 0s' for AP */
  15913. uint8 pad[2];
  15914. wl_twt_infodesc_t infodesc; /* information descriptor */
  15915. /* deprecated - to be removed */
  15916. wl_twt_idesc_t desc;
  15917. } wl_twt_info_t;
  15918. #define WL_TWT_PEER_STATS_VERSION_1 1u
  15919. typedef struct wl_twt_peer_stats_v1 {
  15920. uint16 version;
  15921. uint16 length;
  15922. struct ether_addr peer;
  15923. uint8 PAD[2];
  15924. uint8 id;
  15925. uint8 flow_flags;
  15926. uint8 PAD[2];
  15927. uint32 sp_seq; /* sequence number of the service period */
  15928. uint32 tx_ucast_pkts;
  15929. uint32 tx_pkts_min;
  15930. uint32 tx_pkts_max;
  15931. uint32 tx_pkts_avg;
  15932. uint32 tx_failures;
  15933. uint32 rx_ucast_pkts;
  15934. uint32 rx_pkts_min;
  15935. uint32 rx_pkts_max;
  15936. uint32 rx_pkts_avg;
  15937. uint32 rx_pkts_retried;
  15938. } wl_twt_peer_stats_v1_t;
  15939. #define WL_TWT_STATS_VERSION_1 1
  15940. typedef struct wl_twt_stats_v1 {
  15941. uint16 version;
  15942. uint16 length;
  15943. uint32 num_stats; /* number of peer stats in the peer_stats_list */
  15944. wl_twt_peer_stats_v1_t peer_stats_list[];
  15945. } wl_twt_stats_v1_t;
  15946. #define WL_TWT_STATS_CMD_VERSION_1 1
  15947. #define WL_TWT_STATS_CMD_FLAGS_RESET (1u << 0u)
  15948. /* HE TWT stats command */
  15949. typedef struct wl_twt_stats_cmd_v1 {
  15950. uint16 version;
  15951. uint16 length;
  15952. struct ether_addr peer;
  15953. uint8 PAD[2];
  15954. uint16 flags; /* see WL_TWT_STATS_CMD_FLAGS */
  15955. uint8 num_fid;
  15956. uint8 num_bid;
  15957. uint8 fid_list[WL_TWT_STATS_MAX_ITWT];
  15958. uint8 bid_list[WL_TWT_STATS_MAX_BTWT];
  15959. } wl_twt_stats_cmd_v1_t;
  15960. #define WL_TWT_RESP_CFG_VER 0u
  15961. #define WL_TWT_CMD_RESP_CFG_TYPE_ALTERNATE 0u
  15962. #define WL_TWT_CMD_RESP_CFG_TYPE_DICTATE 1u
  15963. /* HE TWT resp command */
  15964. typedef struct wl_twt_resp_cfg {
  15965. /* structure control */
  15966. uint16 version; /* Structure version */
  15967. uint16 length; /* Data length (starting after this field) */
  15968. uint8 dc_max; /* Max supported duty cycle for single TWT */
  15969. uint8 resp_type; /* Resp. type(Alt/dict) if duty cycle>max duty cycle */
  15970. } wl_twt_resp_cfg_t;
  15971. /* Current version for wlc_clm_power_limits_req_t structure and flags */
  15972. #define WLC_CLM_POWER_LIMITS_REQ_VERSION 1
  15973. /* "clm_power_limits" iovar request structure */
  15974. typedef struct wlc_clm_power_limits_req {
  15975. /* Input. Structure and flags version */
  15976. uint32 version;
  15977. /* Full length of buffer (includes this structure and space for TLV-encoded PPR) */
  15978. uint32 buflen;
  15979. /* Input. Flags (see WLC_CLM_POWER_LIMITS_INPUT_FLAG_... below) */
  15980. uint32 input_flags;
  15981. /* Input. CC of region whose data is being requested */
  15982. char cc[WLC_CNTRY_BUF_SZ];
  15983. /* Input. Channel/subchannel in chanspec_t format */
  15984. uint32 chanspec;
  15985. /* Subchannel encoded as clm_limits_type_t */
  15986. uint32 clm_subchannel;
  15987. /* Input. 0-based antenna index */
  15988. uint32 antenna_idx;
  15989. /* Output. General flags (see WLC_CLM_POWER_LIMITS_OUTPUT_FLAG_... below) */
  15990. uint32 output_flags;
  15991. /* Output. 2.4G country flags, encoded as clm_flags_t enum */
  15992. uint32 clm_country_flags_2g;
  15993. /* Output. 5G country flags, encoded as clm_flags_t enum */
  15994. uint32 clm_country_flags_5g;
  15995. /* Output. Length of TLV-encoded PPR data that follows this structure */
  15996. uint32 ppr_tlv_size;
  15997. /* Output. Beginning of buffer for TLV-encoded PPR data */
  15998. uint8 ppr_tlv[1];
  15999. } wlc_clm_power_limits_req_t;
  16000. /* Input. Do not apply SAR limits */
  16001. #define WLC_CLM_POWER_LIMITS_INPUT_FLAG_NO_SAR 0x00000001
  16002. /* Input. Do not apply board limits */
  16003. #define WLC_CLM_POWER_LIMITS_INPUT_FLAG_NO_BOARD 0x00000002
  16004. /* Output. Limits taken from product-specific country data */
  16005. #define WLC_CLM_POWER_LIMITS_OUTPUT_FLAG_PRODUCT_LIMITS 0x00000001
  16006. /* Output. Limits taken from product-specific worldwide data */
  16007. #define WLC_CLM_POWER_LIMITS_OUTPUT_FLAG_WORLDWIDE_LIMITS 0x00000002
  16008. /* Output. Limits taken from country-default (all-product) data */
  16009. #define WLC_CLM_POWER_LIMITS_OUTPUT_FLAG_DEFAULT_COUNTRY_LIMITS 0x00000004
  16010. #define WL_MBO_IOV_MAJOR_VER 1
  16011. #define WL_MBO_IOV_MINOR_VER 1
  16012. #define WL_MBO_IOV_MAJOR_VER_SHIFT 8
  16013. #define WL_MBO_IOV_VERSION \
  16014. ((WL_MBO_IOV_MAJOR_VER << WL_MBO_IOV_MAJOR_VER_SHIFT)| WL_MBO_IOV_MINOR_VER)
  16015. #define MBO_MAX_CHAN_PREF_ENTRIES 16
  16016. enum wl_mbo_cmd_ids {
  16017. WL_MBO_CMD_ADD_CHAN_PREF = 1,
  16018. WL_MBO_CMD_DEL_CHAN_PREF = 2,
  16019. WL_MBO_CMD_LIST_CHAN_PREF = 3,
  16020. WL_MBO_CMD_CELLULAR_DATA_CAP = 4,
  16021. WL_MBO_CMD_DUMP_COUNTERS = 5,
  16022. WL_MBO_CMD_CLEAR_COUNTERS = 6,
  16023. WL_MBO_CMD_FORCE_ASSOC = 7,
  16024. WL_MBO_CMD_BSSTRANS_REJECT = 8,
  16025. WL_MBO_CMD_SEND_NOTIF = 9,
  16026. /* Unused command, This enum no can be use
  16027. * for next new command
  16028. */
  16029. WL_MBO_CMD_CLEAR_CHAN_PREF = 10,
  16030. WL_MBO_CMD_NBR_INFO_CACHE = 11,
  16031. WL_MBO_CMD_ANQPO_SUPPORT = 12,
  16032. WL_MBO_CMD_DBG_EVENT_CHECK = 13,
  16033. WL_MBO_CMD_EVENT_MASK = 14,
  16034. /* Add before this !! */
  16035. WL_MBO_CMD_LAST
  16036. };
  16037. enum wl_mbo_xtlv_id {
  16038. WL_MBO_XTLV_OPCLASS = 0x1,
  16039. WL_MBO_XTLV_CHAN = 0x2,
  16040. WL_MBO_XTLV_PREFERENCE = 0x3,
  16041. WL_MBO_XTLV_REASON_CODE = 0x4,
  16042. WL_MBO_XTLV_CELL_DATA_CAP = 0x5,
  16043. WL_MBO_XTLV_COUNTERS = 0x6,
  16044. WL_MBO_XTLV_ENABLE = 0x7,
  16045. WL_MBO_XTLV_SUB_ELEM_TYPE = 0x8,
  16046. WL_MBO_XTLV_BTQ_TRIG_START_OFFSET = 0x9,
  16047. WL_MBO_XTLV_BTQ_TRIG_RSSI_DELTA = 0xa,
  16048. WL_MBO_XTLV_ANQP_CELL_SUPP = 0xb,
  16049. WL_MBO_XTLV_BIT_MASK = 0xc
  16050. };
  16051. /* event bit mask flags for MBO */
  16052. #define MBO_EVT_BIT_MASK_CELLULAR_SWITCH 0x0001 /* Evt bit mask to enab cellular switch */
  16053. #define MBO_EVT_BIT_MASK_BTM_REQ_RCVD 0x0002 /* Evt bit mask to enab BTM req rcvd */
  16054. typedef struct wl_mbo_counters {
  16055. /* No of transition req recvd */
  16056. uint16 trans_req_rcvd;
  16057. /* No of transition req with disassoc imminent */
  16058. uint16 trans_req_disassoc;
  16059. /* No of transition req with BSS Termination */
  16060. uint16 trans_req_bss_term;
  16061. /* No of trans req w/ unspecified reason */
  16062. uint16 trans_resn_unspec;
  16063. /* No of trans req w/ reason frame loss */
  16064. uint16 trans_resn_frm_loss;
  16065. /* No of trans req w/ reason traffic delay */
  16066. uint16 trans_resn_traffic_delay;
  16067. /* No of trans req w/ reason insufficient buffer */
  16068. uint16 trans_resn_insuff_bw;
  16069. /* No of trans req w/ reason load balance */
  16070. uint16 trans_resn_load_bal;
  16071. /* No of trans req w/ reason low rssi */
  16072. uint16 trans_resn_low_rssi;
  16073. /* No of trans req w/ reason excessive retransmission */
  16074. uint16 trans_resn_xcess_retransmn;
  16075. /* No of trans req w/ reason gray zone */
  16076. uint16 trans_resn_gray_zone;
  16077. /* No of trans req w/ reason switch to premium AP */
  16078. uint16 trans_resn_prem_ap_sw;
  16079. /* No of transition rejection sent */
  16080. uint16 trans_rejn_sent;
  16081. /* No of trans rejn reason excessive frame loss */
  16082. uint16 trans_rejn_xcess_frm_loss;
  16083. /* No of trans rejn reason excessive traffic delay */
  16084. uint16 trans_rejn_xcess_traffic_delay;
  16085. /* No of trans rejn reason insufficient QoS capability */
  16086. uint16 trans_rejn_insuffic_qos_cap;
  16087. /* No of trans rejn reason low RSSI */
  16088. uint16 trans_rejn_low_rssi;
  16089. /* No of trans rejn reason high interference */
  16090. uint16 trans_rejn_high_interference;
  16091. /* No of trans rejn reason service unavilable */
  16092. uint16 trans_rejn_service_unavail;
  16093. /* No of beacon request rcvd */
  16094. uint16 bcn_req_rcvd;
  16095. /* No of beacon report sent */
  16096. uint16 bcn_rep_sent;
  16097. /* No of null beacon report sent */
  16098. uint16 null_bcn_rep_sent;
  16099. /* No of wifi to cell switch */
  16100. uint16 wifi_to_cell;
  16101. } wl_mbo_counters_t;
  16102. #define WL_FILS_IOV_MAJOR_VER 1
  16103. #define WL_FILS_IOV_MINOR_VER 1
  16104. #define WL_FILS_IOV_MAJOR_VER_SHIFT 8
  16105. #define WL_FILS_IOV_VERSION \
  16106. ((WL_FILS_IOV_MAJOR_VER << WL_FILS_IOV_MAJOR_VER_SHIFT)| WL_FILS_IOV_MINOR_VER)
  16107. enum wl_fils_cmd_ids {
  16108. WL_FILS_CMD_ADD_IND_IE = 1,
  16109. WL_FILS_CMD_ADD_AUTH_DATA = 2, /* Deprecated, kept to prevent ROM invalidation */
  16110. WL_FILS_CMD_ADD_HLP_IE = 3,
  16111. WL_FILS_CMD_ADD_CONNECT_PARAMS = 4,
  16112. WL_FILS_CMD_GET_CONNECT_PARAMS = 5,
  16113. /* Add before this !! */
  16114. WL_FILS_CMD_LAST
  16115. };
  16116. enum wl_fils_xtlv_id {
  16117. WL_FILS_XTLV_IND_IE = 0x1,
  16118. WL_FILS_XTLV_AUTH_DATA = 0x2, /* Deprecated, kept to prevent ROM invalidation */
  16119. WL_FILS_XTLV_HLP_IE = 0x3,
  16120. WL_FILS_XTLV_ERP_USERNAME = 0x4,
  16121. WL_FILS_XTLV_ERP_REALM = 0x5,
  16122. WL_FILS_XTLV_ERP_RRK = 0x6,
  16123. WL_FILS_XTLV_ERP_NEXT_SEQ_NUM = 0x7,
  16124. WL_FILS_XTLV_KEK = 0x8,
  16125. WL_FILS_XTLV_PMK = 0x9,
  16126. WL_FILS_XTLV_TK = 0xa,
  16127. WL_FILS_XTLV_PMKID = 0xb
  16128. };
  16129. #define WL_OCE_IOV_MAJOR_VER 1
  16130. #define WL_OCE_IOV_MINOR_VER 1
  16131. #define WL_OCE_IOV_MAJOR_VER_SHIFT 8
  16132. #define WL_OCE_IOV_VERSION \
  16133. ((WL_OCE_IOV_MAJOR_VER << WL_OCE_IOV_MAJOR_VER_SHIFT)| WL_OCE_IOV_MINOR_VER)
  16134. enum wl_oce_cmd_ids {
  16135. WL_OCE_CMD_ENABLE = 1,
  16136. WL_OCE_CMD_PROBE_DEF_TIME = 2,
  16137. WL_OCE_CMD_FD_TX_PERIOD = 3,
  16138. WL_OCE_CMD_FD_TX_DURATION = 4,
  16139. WL_OCE_CMD_RSSI_TH = 5,
  16140. WL_OCE_CMD_RWAN_LINKS = 6,
  16141. WL_OCE_CMD_CU_TRIGGER = 7,
  16142. /* Add before this !! */
  16143. WL_OCE_CMD_LAST
  16144. };
  16145. enum wl_oce_xtlv_id {
  16146. WL_OCE_XTLV_ENABLE = 0x1,
  16147. WL_OCE_XTLV_PROBE_DEF_TIME = 0x2,
  16148. WL_OCE_XTLV_FD_TX_PERIOD = 0x3,
  16149. WL_OCE_XTLV_FD_TX_DURATION = 0x4,
  16150. WL_OCE_XTLV_RSSI_TH = 0x5,
  16151. WL_OCE_XTLV_RWAN_LINKS = 0x6,
  16152. WL_OCE_XTLV_CU_TRIGGER = 0x7
  16153. };
  16154. #define WL_ESP_IOV_MAJOR_VER 1
  16155. #define WL_ESP_IOV_MINOR_VER 1
  16156. #define WL_ESP_IOV_MAJOR_VER_SHIFT 8
  16157. #define WL_ESP_IOV_VERSION \
  16158. ((WL_ESP_IOV_MAJOR_VER << WL_ESP_IOV_MAJOR_VER_SHIFT)| WL_ESP_IOV_MINOR_VER)
  16159. enum wl_esp_cmd_ids {
  16160. WL_ESP_CMD_ENABLE = 1,
  16161. WL_ESP_CMD_STATIC = 2,
  16162. /* Add before this !! */
  16163. WL_ESP_CMD_LAST
  16164. };
  16165. enum wl_esp_xtlv_id {
  16166. WL_ESP_XTLV_ENABLE = 0x1,
  16167. WL_ESP_XTLV_STATIC_AC = 0x2, /* access category */
  16168. WL_ESP_XTLV_STATIC_TYPE = 0x3, /* data type */
  16169. WL_ESP_XTLV_STATIC_VAL = 0x4
  16170. };
  16171. /* otpread command */
  16172. #define WL_OTPREAD_VER 1
  16173. typedef struct {
  16174. uint16 version; /* cmd structure version */
  16175. uint16 cmd_len; /* cmd struct len */
  16176. uint32 rdmode; /* otp read mode */
  16177. uint32 rdoffset; /* byte offset into otp to start read */
  16178. uint32 rdsize; /* number of bytes to read */
  16179. } wl_otpread_cmd_t;
  16180. /* "otpecc_rows" command */
  16181. typedef struct {
  16182. uint16 version; /* version of this structure */
  16183. uint16 len; /* len in bytes of this structure */
  16184. uint32 cmdtype; /* command type : 0 : read row data, 1 : ECC lock */
  16185. uint32 rowoffset; /* start row offset */
  16186. uint32 numrows; /* number of rows */
  16187. uint8 rowdata[]; /* read rows data */
  16188. } wl_otpecc_rows_t;
  16189. #define WL_OTPECC_ROWS_VER 1
  16190. #define WL_OTPECC_ROWS_CMD_READ 0
  16191. #define WL_OTPECC_ROWS_CMD_LOCK 1
  16192. #define WL_OTPECC_ARGIDX_CMDTYPE 0 /* command type */
  16193. #define WL_OTPECC_ARGIDX_ROWOFFSET 1 /* start row offset */
  16194. #define WL_OTPECC_ARGIDX_NUMROWS 2 /* number of rows */
  16195. /* "otpeccrows" raw data size per row */
  16196. #define WL_ECCDUMP_ROW_SIZE_BYTE 6 /* 4 bytes row data + 2 bytes ECC status */
  16197. #define WL_ECCDUMP_ROW_SIZE_WORD 3
  16198. /* otpECCstatus */
  16199. #define OTP_ECC_ENAB_SHIFT 13
  16200. #define OTP_ECC_ENAB_MASK 0x7
  16201. #define OTP_ECC_CORR_ST_SHIFT 12
  16202. #define OTP_ECC_CORR_ST_MASK 0x1
  16203. #define OTP_ECC_DBL_ERR_SHIFT 11
  16204. #define OTP_ECC_DBL_ERR_MASK 0x1
  16205. #define OTP_ECC_DED_ST_SHIFT 10
  16206. #define OTP_ECC_DED_ST_MASK 0x1
  16207. #define OTP_ECC_SEC_ST_SHIFT 9
  16208. #define OTP_ECC_SEC_ST_MASK 0x1
  16209. #define OTP_ECC_DATA_SHIFT 0
  16210. #define OTP_ECC_DATA_MASK 0x7f
  16211. /* OTP_ECC_CORR_ST field */
  16212. #define OTP_ECC_MODE 1
  16213. #define OTP_NO_ECC_MODE 0
  16214. /* OTP_ECC_ENAB field (bit15:13) :
  16215. * When 2 or 3 bits are set,
  16216. * it indicates that OTP ECC is enabled on the last row read.
  16217. * Otherwise, ECC is disabled
  16218. */
  16219. #define OTP_ECC_ENAB(val) \
  16220. (bcm_bitcount((uint8 *)&(val), sizeof(uint8)) > 1)
  16221. #define WL_LEAKY_AP_STATS_GT_TYPE 0
  16222. #define WL_LEAKY_AP_STATS_PKT_TYPE 1
  16223. typedef struct wlc_leaked_infra_guard_marker {
  16224. /* type field for this TLV: WL_LEAKY_AP_STATS_GT_TYPE */
  16225. uint16 type;
  16226. /* length field for this TLV */
  16227. uint16 len;
  16228. /* guard sample sequence number; Updated by 1 on every guard sample */
  16229. uint32 seq_number;
  16230. /* Guard time start time (tsf; PS indicated and acked) */
  16231. uint32 start_time;
  16232. /* tsf timestamp for the GT end event */
  16233. uint32 gt_tsf_l;
  16234. /* Guard time period in ms */
  16235. uint16 guard_duration;
  16236. /* Number PPDUs in the notification */
  16237. uint16 num_pkts;
  16238. /* Flags to indicate some states see below */
  16239. uint8 flag;
  16240. /* pad for 32-bit alignment */
  16241. uint8 reserved[3];
  16242. } wlc_leaked_infra_guard_marker_t;
  16243. /* Flag information */
  16244. #define WL_LEAKED_GUARD_TIME_NONE 0 /* Not in any guard time */
  16245. #define WL_LEAKED_GUARD_TIME_FRTS (0x01 << 0) /* Normal FRTS power save */
  16246. #define WL_LEAKED_GUARD_TIME_SCAN (0x01 << 1) /* Channel switch due to scanning */
  16247. #define WL_LEAKED_GUARD_TIME_AWDL_PSF (0x01 << 2) /* Channel switch due to AWDL PSF */
  16248. #define WL_LEAKED_GUARD_TIME_AWDL_AW (0x01 << 3) /* Channel switch due to AWDL AW */
  16249. #define WL_LEAKED_GUARD_TIME_INFRA_STA (0x01 << 4) /* generic type infra sta channel switch */
  16250. #define WL_LEAKED_GUARD_TIME_TERMINATED (0x01 << 7) /* indicate a GT is terminated early */
  16251. typedef struct wlc_leaked_infra_packet_stat {
  16252. uint16 type; /* type field for this TLV: WL_LEAKY_AP_STATS_PKT_TYPE */
  16253. uint16 len; /* length field for this TLV */
  16254. uint16 ppdu_len_bytes; /* PPDU packet length in bytes */
  16255. uint16 num_mpdus; /* number of the MPDUs in the PPDU */
  16256. uint32 ppdu_time; /* PPDU arrival time at the begining of the guard time */
  16257. uint32 rate; /* PPDU packet rate; Received packet's data rate */
  16258. uint16 seq_number; /* sequence number */
  16259. int8 rssi; /* RSSI */
  16260. uint8 tid; /* tid */
  16261. } wlc_leaked_infra_packet_stat_t;
  16262. /* Wake timer structure definition */
  16263. #define WAKE_TIMER_VERSION 1
  16264. #define WAKE_TIMER_NOLIMIT 0xFFFF
  16265. typedef struct wake_timer {
  16266. uint16 ver;
  16267. uint16 len;
  16268. uint16 limit; /* number of events to deliver
  16269. * 0-disable, 0xffff-indefinite, num_events otherwise
  16270. */
  16271. uint16 count; /* number of events delivered since enable (get only) */
  16272. uint16 period; /* timeout/period in milliseconds */
  16273. } wake_timer_t;
  16274. typedef struct wl_desense_restage_gain {
  16275. uint16 version;
  16276. uint16 length;
  16277. uint32 band;
  16278. uint8 num_cores;
  16279. uint8 desense_array[WL_TX_CHAINS_MAX];
  16280. uint8 PAD[3];
  16281. } wl_desense_restage_gain_t;
  16282. #define MAX_UCM_CHAINS 5
  16283. #define MAX_UCM_PROFILES 10
  16284. #define UCM_PROFILE_VERSION_1 1
  16285. /* UCM per chain attribute struct */
  16286. typedef struct wlc_btcx_chain_attr {
  16287. uint16 length; /* chain attr length, version is same as profile version */
  16288. int8 desense_level; /* per chain desense level */
  16289. int8 ack_pwr_strong_rssi; /* per chain ack power at strong rssi */
  16290. int8 ack_pwr_weak_rssi; /* per chain ack power at weak rssi */
  16291. int8 tx_pwr_strong_rssi; /* per chain tx power at strong rssi */
  16292. int8 tx_pwr_weak_rssi; /* per chain tx power at weak rssi */
  16293. uint8 PAD[1]; /* additional bytes for alignment */
  16294. } wlc_btcx_chain_attr_t;
  16295. typedef struct wlc_btcx_profile_v1 {
  16296. uint16 version; /* UCM profile version */
  16297. uint16 length; /* profile size */
  16298. uint16 fixed_length; /* size of the fixed portion of the profile */
  16299. uint8 init; /* profile initialized or not */
  16300. uint8 chain_attr_count; /* Number of elements in chain_attr array */
  16301. uint8 profile_index; /* profile index */
  16302. uint8 mode_strong_wl_bt; /* Mode under strong WLAN and BT RSSI */
  16303. uint8 mode_weak_wl; /* Mode under weak WLAN RSSI */
  16304. uint8 mode_weak_bt; /* Mode under weak BT RSSI */
  16305. uint8 mode_weak_wl_bt; /* Mode under weak BT and WLAN RSSI */
  16306. int8 mode_wl_hi_lo_rssi_thresh; /* Strong to weak WLAN RSSI threshold for mode selection */
  16307. int8 mode_wl_lo_hi_rssi_thresh; /* Weak to strong WLAN RSSI threshold for mode selection */
  16308. int8 mode_bt_hi_lo_rssi_thresh; /* Strong to weak BT RSSI threshold for mode selection */
  16309. int8 mode_bt_lo_hi_rssi_thresh; /* Weak to strong BT RSSI threshold for mode selection */
  16310. int8 desense_wl_hi_lo_rssi_thresh; /* Strong to weak RSSI threshold for desense */
  16311. int8 desense_wl_lo_hi_rssi_thresh; /* Weak to strong RSSI threshold for desense */
  16312. int8 ack_pwr_wl_hi_lo_rssi_thresh; /* Strong to weak RSSI threshold for ACK power */
  16313. int8 ack_pwr_wl_lo_hi_rssi_thresh; /* Weak to strong RSSI threshold for ACK power */
  16314. int8 tx_pwr_wl_hi_lo_rssi_thresh; /* Strong to weak RSSI threshold for Tx power */
  16315. int8 tx_pwr_wl_lo_hi_rssi_thresh; /* Weak to strong RSSI threshold for Tx power */
  16316. uint8 PAD[1]; /* additional bytes for 4 byte alignment */
  16317. wlc_btcx_chain_attr_t chain_attr[]; /* variable length array with chain attributes */
  16318. } wlc_btcx_profile_v1_t;
  16319. #define SSSR_D11_RESET_SEQ_STEPS 5
  16320. #define SSSR_REG_INFO_VER_0 0u
  16321. #define SSSR_REG_INFO_VER_1 1u
  16322. #define SSSR_REG_INFO_VER_2 2u
  16323. typedef struct sssr_reg_info_v0 {
  16324. uint16 version;
  16325. uint16 length; /* length of the structure validated at host */
  16326. struct {
  16327. struct {
  16328. uint32 pmuintmask0;
  16329. uint32 pmuintmask1;
  16330. uint32 resreqtimer;
  16331. uint32 macresreqtimer;
  16332. uint32 macresreqtimer1;
  16333. } base_regs;
  16334. } pmu_regs;
  16335. struct {
  16336. struct {
  16337. uint32 intmask;
  16338. uint32 powerctrl;
  16339. uint32 clockcontrolstatus;
  16340. uint32 powerctrl_mask;
  16341. } base_regs;
  16342. } chipcommon_regs;
  16343. struct {
  16344. struct {
  16345. uint32 clockcontrolstatus;
  16346. uint32 clockcontrolstatus_val;
  16347. } base_regs;
  16348. struct {
  16349. uint32 resetctrl;
  16350. uint32 itopoobb;
  16351. } wrapper_regs;
  16352. } arm_regs;
  16353. struct {
  16354. struct {
  16355. uint32 ltrstate;
  16356. uint32 clockcontrolstatus;
  16357. uint32 clockcontrolstatus_val;
  16358. } base_regs;
  16359. struct {
  16360. uint32 itopoobb;
  16361. } wrapper_regs;
  16362. } pcie_regs;
  16363. struct {
  16364. struct {
  16365. uint32 ioctrl;
  16366. } wrapper_regs;
  16367. uint32 vasip_sr_addr;
  16368. uint32 vasip_sr_size;
  16369. } vasip_regs;
  16370. struct {
  16371. struct {
  16372. uint32 xmtaddress;
  16373. uint32 xmtdata;
  16374. uint32 clockcontrolstatus;
  16375. uint32 clockcontrolstatus_val;
  16376. } base_regs;
  16377. struct {
  16378. uint32 resetctrl;
  16379. uint32 itopoobb;
  16380. uint32 ioctrl;
  16381. uint32 ioctrl_resetseq_val[SSSR_D11_RESET_SEQ_STEPS];
  16382. } wrapper_regs;
  16383. uint32 sr_size;
  16384. } mac_regs[MAX_NUM_D11CORES];
  16385. } sssr_reg_info_v0_t;
  16386. typedef struct sssr_reg_info_v1 {
  16387. uint16 version;
  16388. uint16 length; /* length of the structure validated at host */
  16389. struct {
  16390. struct {
  16391. uint32 pmuintmask0;
  16392. uint32 pmuintmask1;
  16393. uint32 resreqtimer;
  16394. uint32 macresreqtimer;
  16395. uint32 macresreqtimer1;
  16396. } base_regs;
  16397. } pmu_regs;
  16398. struct {
  16399. struct {
  16400. uint32 intmask;
  16401. uint32 powerctrl;
  16402. uint32 clockcontrolstatus;
  16403. uint32 powerctrl_mask;
  16404. } base_regs;
  16405. } chipcommon_regs;
  16406. struct {
  16407. struct {
  16408. uint32 clockcontrolstatus;
  16409. uint32 clockcontrolstatus_val;
  16410. } base_regs;
  16411. struct {
  16412. uint32 resetctrl;
  16413. uint32 itopoobb;
  16414. } wrapper_regs;
  16415. } arm_regs;
  16416. struct {
  16417. struct {
  16418. uint32 ltrstate;
  16419. uint32 clockcontrolstatus;
  16420. uint32 clockcontrolstatus_val;
  16421. } base_regs;
  16422. struct {
  16423. uint32 itopoobb;
  16424. } wrapper_regs;
  16425. } pcie_regs;
  16426. struct {
  16427. struct {
  16428. uint32 ioctrl;
  16429. } wrapper_regs;
  16430. uint32 vasip_sr_addr;
  16431. uint32 vasip_sr_size;
  16432. } vasip_regs;
  16433. struct {
  16434. struct {
  16435. uint32 xmtaddress;
  16436. uint32 xmtdata;
  16437. uint32 clockcontrolstatus;
  16438. uint32 clockcontrolstatus_val;
  16439. } base_regs;
  16440. struct {
  16441. uint32 resetctrl;
  16442. uint32 itopoobb;
  16443. uint32 ioctrl;
  16444. uint32 ioctrl_resetseq_val[SSSR_D11_RESET_SEQ_STEPS];
  16445. } wrapper_regs;
  16446. uint32 sr_size;
  16447. } mac_regs[MAX_NUM_D11CORES];
  16448. struct {
  16449. uint32 dig_sr_addr;
  16450. uint32 dig_sr_size;
  16451. } dig_mem_info;
  16452. } sssr_reg_info_v1_t;
  16453. #define MAX_NUM_D11_CORES_WITH_SCAN 3u
  16454. typedef struct sssr_reg_info_v2 {
  16455. uint16 version;
  16456. uint16 length; /* length of the structure validated at host */
  16457. struct {
  16458. struct {
  16459. uint32 pmuintmask0;
  16460. uint32 pmuintmask1;
  16461. uint32 resreqtimer;
  16462. uint32 macresreqtimer;
  16463. uint32 macresreqtimer1;
  16464. uint32 macresreqtimer2;
  16465. } base_regs;
  16466. } pmu_regs;
  16467. struct {
  16468. struct {
  16469. uint32 intmask;
  16470. uint32 powerctrl;
  16471. uint32 clockcontrolstatus;
  16472. uint32 powerctrl_mask;
  16473. } base_regs;
  16474. } chipcommon_regs;
  16475. struct {
  16476. struct {
  16477. uint32 clockcontrolstatus;
  16478. uint32 clockcontrolstatus_val;
  16479. } base_regs;
  16480. struct {
  16481. uint32 resetctrl;
  16482. uint32 extrsrcreq;
  16483. } wrapper_regs;
  16484. } arm_regs;
  16485. struct {
  16486. struct {
  16487. uint32 ltrstate;
  16488. uint32 clockcontrolstatus;
  16489. uint32 clockcontrolstatus_val;
  16490. } base_regs;
  16491. struct {
  16492. uint32 extrsrcreq;
  16493. } wrapper_regs;
  16494. } pcie_regs;
  16495. struct {
  16496. struct {
  16497. uint32 xmtaddress;
  16498. uint32 xmtdata;
  16499. uint32 clockcontrolstatus;
  16500. uint32 clockcontrolstatus_val;
  16501. } base_regs;
  16502. struct {
  16503. uint32 resetctrl;
  16504. uint32 extrsrcreq;
  16505. uint32 ioctrl;
  16506. uint32 ioctrl_resetseq_val[SSSR_D11_RESET_SEQ_STEPS];
  16507. } wrapper_regs;
  16508. uint32 sr_size;
  16509. } mac_regs[MAX_NUM_D11_CORES_WITH_SCAN];
  16510. struct {
  16511. uint32 dig_sr_addr;
  16512. uint32 dig_sr_size;
  16513. } dig_mem_info;
  16514. } sssr_reg_info_v2_t;
  16515. #ifndef SSSR_REG_INFO_HAS_ALIAS
  16516. typedef sssr_reg_info_v0_t sssr_reg_info_t;
  16517. #define SSSR_REG_INFO_VER SSSR_REG_INFO_VER_0
  16518. #endif // endif
  16519. /* A wrapper structure for all versions of SSSR register information structures */
  16520. typedef union sssr_reg_info {
  16521. sssr_reg_info_v0_t rev0;
  16522. sssr_reg_info_v1_t rev1;
  16523. sssr_reg_info_v2_t rev2;
  16524. } sssr_reg_info_cmn_t;
  16525. /* ADaptive Power Save(ADPS) structure definition */
  16526. #define WL_ADPS_IOV_MAJOR_VER 1
  16527. #define WL_ADPS_IOV_MINOR_VER 0
  16528. #define WL_ADPS_IOV_MAJOR_VER_SHIFT 8
  16529. #define WL_ADPS_IOV_VER \
  16530. ((WL_ADPS_IOV_MAJOR_VER << WL_ADPS_IOV_MAJOR_VER_SHIFT) | WL_ADPS_IOV_MINOR_VER)
  16531. #define ADPS_NUM_DIR 2
  16532. #define ADPS_RX 0
  16533. #define ADPS_TX 1
  16534. #define WL_ADPS_IOV_MODE 0x0001
  16535. #define WL_ADPS_IOV_RSSI 0x0002
  16536. #define WL_ADPS_IOV_DUMP 0x0003
  16537. #define WL_ADPS_IOV_DUMP_CLEAR 0x0004
  16538. #define WL_ADPS_IOV_SUSPEND 0x0005
  16539. #define ADPS_SUMMARY_STEP_NUM 2
  16540. #define ADPS_SUMMARY_STEP_LOW 0
  16541. #define ADPS_SUMMARY_STEP_HIGH 1
  16542. #define ADPS_SUB_IOV_VERSION_1 1
  16543. #define ADPS_SUB_IOV_VERSION_2 2
  16544. /* suspend/resume ADPS by wl/private command from host */
  16545. #define ADPS_RESUME 0u
  16546. #define ADPS_SUSPEND 1u
  16547. typedef struct wl_adps_params_v1 {
  16548. uint16 version;
  16549. uint16 length;
  16550. uint8 band; /* band - 2G or 5G */
  16551. uint8 mode; /* operation mode, default = 0 (ADPS disable) */
  16552. uint16 padding;
  16553. } wl_adps_params_v1_t;
  16554. typedef struct wl_adps_rssi {
  16555. int32 thresh_hi; /* rssi threshold to resume ADPS operation */
  16556. int32 thresh_lo; /* rssi threshold to suspend ADPS operation */
  16557. } wl_adps_rssi_t;
  16558. typedef struct wl_adps_rssi_params_v1 {
  16559. uint16 version;
  16560. uint16 length;
  16561. uint8 band;
  16562. uint8 padding[3];
  16563. wl_adps_rssi_t rssi;
  16564. } wl_adps_rssi_params_v1_t;
  16565. typedef struct adps_stat_elem {
  16566. uint32 duration; /* each step duration time (mSec) */
  16567. uint32 counts; /* each step hit count number */
  16568. } adps_stat_elem_t;
  16569. typedef struct wl_adps_dump_summary_v1 {
  16570. uint16 version;
  16571. uint16 length;
  16572. uint8 mode; /* operation mode: On/Off */
  16573. uint8 flags; /* restrict flags */
  16574. uint8 current_step; /* current step */
  16575. uint8 padding;
  16576. adps_stat_elem_t stat[ADPS_SUMMARY_STEP_NUM]; /* statistics */
  16577. } wl_adps_dump_summary_v1_t;
  16578. typedef struct wl_adps_dump_summary_v2 {
  16579. uint16 version;
  16580. uint16 length;
  16581. uint8 mode; /* operation mode: On/Off */
  16582. uint8 current_step; /* current step */
  16583. uint8 padding[2];
  16584. uint32 flags; /* restrict flags */
  16585. adps_stat_elem_t stat[ADPS_SUMMARY_STEP_NUM]; /* statistics */
  16586. } wl_adps_dump_summary_v2_t;
  16587. typedef struct wl_adps_suspend_v1 {
  16588. uint16 version;
  16589. uint16 length;
  16590. uint8 suspend; /* 1: suspend 0: resume */
  16591. uint8 padding[3];
  16592. } wl_adps_suspend_v1_t;
  16593. typedef struct wlc_btc_2gchain_dis {
  16594. uint16 ver;
  16595. uint16 len;
  16596. uint8 chain_dis;
  16597. uint8 flag;
  16598. } wlc_btc_2gchain_dis_t;
  16599. /* TDLS structure definition */
  16600. #define WL_TDLS_T_VERSION_V1 1
  16601. typedef struct wl_tdls_dump_summary_v1 {
  16602. uint16 version;
  16603. uint16 length; /* length of the entire structure */
  16604. uint32 txsetupreq; /* tdls setup req sent */
  16605. uint32 txsetupresp; /* tdls setup resp sent */
  16606. uint32 txsetupcfm; /* tdls setup confirm sent */
  16607. uint32 txteardown; /* tdls teardwon frames sent */
  16608. uint32 txptireq; /* tdls pti req frames sent */
  16609. uint32 txptiresp; /* tdls pti resp frames sent */
  16610. uint32 txchswreq; /* tdls chsw req frames sent */
  16611. uint32 txchswresp; /* tdls chsw resp frame sent */
  16612. uint32 rxsetupreq; /* tdls setup req rcvd */
  16613. uint32 rxdsetupresp; /* tdls setup resp rcvd */
  16614. uint32 rxsetupcfm; /* tdls setup confirm rcvd */
  16615. uint32 rxteardown; /* tdls teardown frames rcvd */
  16616. uint32 rxptireq; /* tdls pti req frames rcvd */
  16617. uint32 rxptiresp; /* tdls pti resp frames rcvd */
  16618. uint32 rxchswreq; /* tdls chsw req frames rcvd */
  16619. uint32 rxchswresp; /* tdls chsw resp frames rcvd */
  16620. uint32 discard; /* frames discarded due to full buffer */
  16621. uint32 ubuffered; /* frames buffered by TDLS txmod */
  16622. uint32 buf_reinserted; /* frames reinserted */
  16623. uint32 idletime; /* time since no traffic on tdls link */
  16624. uint32 uptime; /* time since tdls link connected */
  16625. uint32 tx_cnt; /* frames txed over tdls link */
  16626. uint32 rx_cnt; /* frames rcvd over tdls link */
  16627. uint32 blist_cnt; /* number of tdls black list */
  16628. uint32 scb_flags; /* connected tdls scb flags */
  16629. struct ether_addr peer_addr; /* connected peer addr */
  16630. uint8 padding[2];
  16631. } wl_tdls_dump_summary_v1_t;
  16632. #define WLC_BTC_2GCHAIN_DIS_REASSOC 0x1
  16633. #define WLC_BTC_2GCHAIN_DIS_VER1 0x1
  16634. #define WLC_BTC_2GCHAIN_DIS_VER1_LEN 6
  16635. /* --- BTCX WiFi Protection (btc_wifi_prot iovar) --- */
  16636. /* Current iovar structure version: 1 */
  16637. #define WL_BTC_WIFI_PROT_VER_1 1
  16638. typedef struct wl_btc_wifi_prot_v1 {
  16639. uint16 ver; /* version */
  16640. uint16 len; /* total length */
  16641. uint8 data[]; /* bcm_xtlv_t payload */
  16642. } wl_btc_wifi_prot_v1_t;
  16643. /* Xtlv tags (protection type) and data */
  16644. #define WL_BTC_WIFI_PROT_M1_M4 1
  16645. typedef struct wl_btc_wifi_prot_m1_m4 {
  16646. uint32 enable; /* enable/disable m1-m4 protection */
  16647. uint32 timeout; /* maximum timeout in ms (0: default) */
  16648. } wl_btc_wifi_prot_m1_m4_t;
  16649. #define WL_BTC_WIFI_PROT_ENABLE 1
  16650. #define WL_BTC_WIFI_PROT__DISABLE 0
  16651. /* --- End BTCX WiFi Protection --- */
  16652. /* --- BTCX ULMU disable (btc_ulmu_config iovar) --- */
  16653. /* Version number */
  16654. #define WL_BTC_ULMU_CONFIG_VER_1 1
  16655. typedef struct wl_btc_ulmu_config_v1 {
  16656. uint16 version; /* btc_ulmu_config version */
  16657. uint16 len; /* Total length */
  16658. uint32 ulmu_bt_task_bm; /* BT Task bimtap for ULMU disable */
  16659. uint32 ulmu_bt_period_th; /* BT period thresh for ULMU disable */
  16660. } wl_btc_ulmu_config_v1_t;
  16661. /* --- End BTCX ULMU config --- */
  16662. #define RPSNOA_IOV_MAJOR_VER 1
  16663. #define RPSNOA_IOV_MINOR_VER 1
  16664. #define RPSNOA_IOV_MAJOR_VER_SHIFT 8
  16665. #define RPSNOA_IOV_VERSION \
  16666. ((RPSNOA_IOV_MAJOR_VER << RPSNOA_IOV_MAJOR_VER_SHIFT)| RPSNOA_IOV_MINOR_VER)
  16667. enum wl_rpsnoa_cmd_ids {
  16668. WL_RPSNOA_CMD_ENABLE = 1,
  16669. WL_RPSNOA_CMD_STATUS,
  16670. WL_RPSNOA_CMD_PARAMS,
  16671. WL_RPSNOA_CMD_LAST
  16672. };
  16673. typedef struct rpsnoa_cmnhdr {
  16674. uint16 ver; /* cmd structure version */
  16675. uint16 len; /* cmd structure len */
  16676. uint32 subcmd;
  16677. uint32 cnt;
  16678. } rpsnoa_cmnhdr_t;
  16679. typedef struct rpsnoa_data {
  16680. int16 band;
  16681. int16 value;
  16682. } rpsnoa_data_t;
  16683. typedef struct rpsnoa_stats {
  16684. int16 band;
  16685. int16 state;
  16686. uint32 sleep_dur;
  16687. uint32 sleep_avail_dur;
  16688. uint32 last_pps;
  16689. } rpsnoa_stats_t;
  16690. typedef struct rpsnoa_param {
  16691. uint16 band;
  16692. uint8 level;
  16693. uint8 stas_assoc_check;
  16694. uint32 pps;
  16695. uint32 quiet_time;
  16696. } rpsnoa_param_t;
  16697. typedef struct rpsnoa_iovar {
  16698. rpsnoa_cmnhdr_t hdr;
  16699. rpsnoa_data_t data[1];
  16700. } rpsnoa_iovar_t;
  16701. typedef struct rpsnoa_iovar_status {
  16702. rpsnoa_cmnhdr_t hdr;
  16703. rpsnoa_stats_t stats[1];
  16704. } rpsnoa_iovar_status_t;
  16705. typedef struct rpsnoa_iovar_params {
  16706. rpsnoa_cmnhdr_t hdr;
  16707. rpsnoa_param_t param[1];
  16708. } rpsnoa_iovar_params_t;
  16709. /* Per-interface reportable stats types */
  16710. enum wl_ifstats_xtlv_id {
  16711. /* global */
  16712. WL_IFSTATS_XTLV_SLICE_INDEX = 1,
  16713. WL_IFSTATS_XTLV_IF_INDEX = 2,
  16714. WL_IFSTATS_XTLV_MAC_ADDR = 3,
  16715. WL_IFSTATS_XTLV_REPORT_CMD = 4, /* Comes in an iovar */
  16716. WL_IFSTATS_XTLV_BUS_PCIE = 5,
  16717. WL_STATS_XTLV_BUS_PCIE_TX_HISTOGRAMS = 6,
  16718. WL_STATS_XTLV_BUS_PCIE_TX_QUEUE_DEPTH = 7,
  16719. /* history of blocks freed most recently */
  16720. WL_STATS_XTLV_FBINFO_STATS = 8,
  16721. /* Report data across all SCBs using ecounters */
  16722. /* STA_info ecounters */
  16723. WL_IFSTATS_XTLV_WL_STA_INFO_ECOUNTERS = 0x100,
  16724. /* For AMPDU stat sub-types requested in a different format */
  16725. /* these could be sum and report stats across slices. OR
  16726. * report sub-types in pairs so host can sum and add.
  16727. * Information sent here is across slices, therefore global
  16728. */
  16729. WL_IFSTATS_XTLV_TX_AMPDU_STATS = 0x101,
  16730. WL_IFSTATS_XTLV_RX_AMPDU_STATS = 0x102,
  16731. /* scb ecounter statistics */
  16732. WL_IFSTATS_XTLV_SCB_ECOUNTERS = 0x103,
  16733. /* Global NAN stats */
  16734. WL_IFSTATS_XTLV_NAN_STATS = 0x104,
  16735. WL_IFSTATS_XTLV_CHAN_STATS = 0x105,
  16736. /* TDLS state */
  16737. WL_IFSTATS_XTLV_IF_TDLS_STATE = 0x106,
  16738. WL_IFSTATS_XTLV_KEY_PLUMB_INFO = 0x107,
  16739. /* Per-slice information
  16740. * Per-interface reporting could also include slice specific data
  16741. */
  16742. /* xtlv container for reporting */
  16743. WL_IFSTATS_XTLV_WL_SLICE = 0x301,
  16744. /* Per-slice AMPDU stats */
  16745. WL_IFSTATS_XTLV_WL_SLICE_TX_AMPDU_DUMP = 0x302,
  16746. WL_IFSTATS_XTLV_WL_SLICE_RX_AMPDU_DUMP = 0x303,
  16747. /* Per-slice BTCOEX stats */
  16748. WL_IFSTATS_XTLV_WL_SLICE_BTCOEX = 0x304,
  16749. /* V11_WLCNTRS used in ecounters */
  16750. WL_IFSTATS_XTLV_WL_SLICE_V11_WLCNTRS = 0x305,
  16751. /* V30_WLCNTRS Used in ecounters */
  16752. WL_IFSTATS_XTLV_WL_SLICE_V30_WLCNTRS = 0x306,
  16753. /* phy,ucode,scan pwrstats */
  16754. WL_IFSTATS_XTLV_WL_SLICE_PWRSTATS_PHY = 0x307,
  16755. WL_IFSTATS_XTLV_WL_SLICE_PWRSTATS_SCAN = 0x308,
  16756. WL_IFSTATS_XTLV_WL_SLICE_PWRSTATS_WAKE_V2 = 0x309,
  16757. /* Per-slice LTECOEX stats */
  16758. WL_IFSTATS_XTLV_WL_SLICE_LTECOEX = 0x30A,
  16759. /* TVPM ecounters */
  16760. WL_IFSTATS_XTLV_WL_SLICE_TVPM = 0x30B,
  16761. /* TDMTX ecounters */
  16762. WL_IFSTATS_XTLV_WL_SLICE_TDMTX = 0x30C,
  16763. /* Slice specific state capture in periodic fasion */
  16764. WL_SLICESTATS_XTLV_PERIODIC_STATE = 0x30D,
  16765. WL_SLICESTATS_XTLV_HIST_TX_STATS = 0x30E,
  16766. WL_SLICESTATS_XTLV_HIST_RX_STATS = 0x30F,
  16767. /* TX histograms */
  16768. WL_STATS_XTLV_WL_SLICE_TX_HISTOGRAMS = 0x310,
  16769. /* TX queue depth */
  16770. WL_STATS_XTLV_WL_SLICE_TX_QUEUE_DEPTH = 0x311,
  16771. /* Latency instrumentation debug */
  16772. WL_STATS_XTLV_WL_QUEUE_STOP = 0x312,
  16773. /* Beamforming counters */
  16774. WL_IFSTATS_XTLV_WL_SLICE_TXBF = 0x313,
  16775. /* Per-slice BTCOEX task duration stats */
  16776. WL_IFSTATS_XTLV_WL_SLICE_BTCOEX_TSKDUR_STATS = 0x314,
  16777. /* Per-interface */
  16778. /* XTLV container for reporting */
  16779. WL_IFSTATS_XTLV_IF = 0x501,
  16780. /* Generic stats applicable to all IFs */
  16781. WL_IFSTATS_XTLV_GENERIC = 0x502,
  16782. /* Infra specific */
  16783. WL_IFSTATS_XTLV_INFRA_SPECIFIC = 0x503,
  16784. /* MGT counters infra and softAP */
  16785. WL_IFSTATS_XTLV_MGT_CNT = 0x504,
  16786. /* AMPDU stats on per-IF */
  16787. WL_IFSTATS_XTLV_AMPDU_DUMP = 0x505,
  16788. WL_IFSTATS_XTLV_IF_SPECIFIC = 0x506,
  16789. WL_IFSTATS_XTLV_WL_PWRSTATS_AWDL = 0x507,
  16790. WL_IFSTATS_XTLV_IF_LQM = 0x508,
  16791. /* Interface specific state capture in periodic fashion */
  16792. WL_IFSTATS_XTLV_IF_PERIODIC_STATE = 0x509,
  16793. /* Event statistics on per-IF */
  16794. WL_IFSTATS_XTLV_IF_EVENT_STATS = 0x50A,
  16795. /* Infra HE specific */
  16796. WL_IFSTATS_XTLV_INFRA_SPECIFIC_HE = 0x50B,
  16797. /* Roam statistics */
  16798. WL_IFSTATS_XTLV_ROAM_STATS_PERIODIC = 0x50C,
  16799. WL_IFSTATS_XTLV_ROAM_STATS_EVENT = 0x50D,
  16800. /* ecounters for nan */
  16801. /* nan slot stats */
  16802. WL_IFSTATS_XTLV_NAN_SLOT_STATS = 0x601
  16803. };
  16804. /* current version of wl_stats_report_t structure for request */
  16805. #define WL_STATS_REPORT_REQUEST_VERSION_V2 2
  16806. /* current version of wl_stats_report_t structure for response */
  16807. #define WL_STATS_REPORT_RESPONSE_VERSION_V2 2
  16808. /** Top structure of if_counters IOVar buffer */
  16809. typedef struct wl_stats_report {
  16810. uint16 version; /**< see version definitions above */
  16811. uint16 length; /**< length of data including all paddings. */
  16812. uint8 data []; /**< variable length payload:
  16813. * 1 or more bcm_xtlv_t type of tuples.
  16814. * each tuple is padded to multiple of 4 bytes.
  16815. * 'length' field of this structure includes all paddings.
  16816. */
  16817. } wl_stats_report_t;
  16818. /* interface specific mgt count */
  16819. #define WL_MGT_STATS_VERSION_V1 1
  16820. /* Associated stats type: WL_IFSTATS_MGT_CNT */
  16821. typedef struct {
  16822. uint16 version;
  16823. uint16 length;
  16824. /* detailed control/management frames */
  16825. uint32 txnull;
  16826. uint32 rxnull;
  16827. uint32 txqosnull;
  16828. uint32 rxqosnull;
  16829. uint32 txassocreq;
  16830. uint32 rxassocreq;
  16831. uint32 txreassocreq;
  16832. uint32 rxreassocreq;
  16833. uint32 txdisassoc;
  16834. uint32 rxdisassoc;
  16835. uint32 txassocrsp;
  16836. uint32 rxassocrsp;
  16837. uint32 txreassocrsp;
  16838. uint32 rxreassocrsp;
  16839. uint32 txauth;
  16840. uint32 rxauth;
  16841. uint32 txdeauth;
  16842. uint32 rxdeauth;
  16843. uint32 txprobereq;
  16844. uint32 rxprobereq;
  16845. uint32 txprobersp;
  16846. uint32 rxprobersp;
  16847. uint32 txaction;
  16848. uint32 rxaction;
  16849. uint32 txpspoll;
  16850. uint32 rxpspoll;
  16851. } wl_if_mgt_stats_t;
  16852. #define WL_INFRA_STATS_VERSION_V1 1
  16853. /* Associated stats type: WL_IFSTATS_INFRA_SPECIFIC */
  16854. typedef struct wl_infra_stats {
  16855. uint16 version; /**< version of the structure */
  16856. uint16 length;
  16857. uint32 rxbeaconmbss;
  16858. uint32 tbtt;
  16859. } wl_if_infra_stats_t;
  16860. #define WL_INFRA_STATS_HE_VERSION_V1 (1u)
  16861. /* Associated stats type: WL_IFSTATS_INFRA_SPECIFIC_HE */
  16862. typedef struct wl_infra_stats_he {
  16863. uint16 version; /**< version of the structure */
  16864. uint16 length;
  16865. uint32 PAD; /**< Explicit padding */
  16866. /* DL SU MPDUs and total number of bytes */
  16867. uint64 dlsu_mpdudata;
  16868. uint64 dlsu_mpdu_bytes;
  16869. /* DL MUMIMO MPDUs and total number of bytes */
  16870. uint64 dlmumimo_mpdudata;
  16871. uint64 dlmumimo_mpdu_bytes;
  16872. /* DL OFDMA MPDUs and total number of bytes */
  16873. uint64 dlofdma_mpdudata;
  16874. uint64 dlofdma_mpdu_bytes;
  16875. /* UL SU MPDUs and total number of bytes */
  16876. uint64 ulsu_mpdudata;
  16877. uint64 ulsu_mpdu_bytes;
  16878. /* ULOFDMA MPSUs and total number of bytes */
  16879. uint64 ulofdma_mpdudata;
  16880. uint64 ulofdma_mpdu_bytes;
  16881. } wl_if_infra_stats_he_t;
  16882. #define LTECOEX_STATS_VER 1
  16883. typedef struct wlc_ltecoex_stats {
  16884. uint16 version; /**< WL_IFSTATS_XTLV_WL_SLICE_LTECOEX */
  16885. uint16 len; /* Length of wl_ltecx_stats structure */
  16886. uint8 slice_index; /* Slice unit of wl_ltecx_stats structure */
  16887. uint8 pad[3]; /* Padding */
  16888. /* LTE noise based eCounters Bins
  16889. cumulative the wl_cnt_wlc_t and wl_ctl_mgt_cnt_t
  16890. counter information based on LTE Coex interference level
  16891. */
  16892. uint32 txframe_no_LTE; /* txframe counter in no LTE Coex case */
  16893. uint32 rxframe_no_LTE; /* rxframe counter in no LTE Coex case */
  16894. uint32 rxrtry_no_LTE; /* rxrtry counter in no LTE Coex case */
  16895. uint32 txretrans_no_LTE; /* txretrans counter in no LTE Coex case */
  16896. uint32 txnocts_no_LTE; /* txnocts counter in no LTE Coex case */
  16897. uint32 txrts_no_LTE; /* txrts counter in no LTE Coex case */
  16898. uint32 txdeauth_no_LTE; /* txdeauth counter in no LTE Coex case */
  16899. uint32 txassocreq_no_LTE; /* txassocreq counter in no LTE Coex case */
  16900. uint32 txassocrsp_no_LTE; /* txassocrsp counter in no LTE Coex case */
  16901. uint32 txreassocreq_no_LTE; /* txreassocreq counter in no LTE Coex case */
  16902. uint32 txreassocrsp_no_LTE; /* txreassocrsp counter in no LTE Coex case */
  16903. uint32 txframe_light_LTE; /* txframe counter in light LTE Coex case */
  16904. uint32 txretrans_light_LTE; /* txretrans counter in light LTE Coex case */
  16905. uint32 rxframe_light_LTE; /* rxframe counter in light LTE Coex case */
  16906. uint32 rxrtry_light_LTE; /* rxrtry counter in light LTE Coex case */
  16907. uint32 txnocts_light_LTE; /* txnocts counter in light LTE Coex case */
  16908. uint32 txrts_light_LTE; /* txrts counter in light LTE Coex case */
  16909. uint32 txdeauth_light_LTE; /* txdeauth counter in light LTE Coex case */
  16910. uint32 txassocreq_light_LTE; /* txassocreq counter in light LTE Coex case */
  16911. uint32 txassocrsp_light_LTE; /* txassocrsp counter in light LTE Coex case */
  16912. uint32 txreassocreq_light_LTE; /* txreassocreq counter in light LTE Coex case */
  16913. uint32 txreassocrsp_light_LTE; /* txreassocrsp counter in light LTE Coex case */
  16914. uint32 txframe_heavy_LTE; /* txframe counter in heavy LTE Coex case */
  16915. uint32 txretrans_heavy_LTE; /* txretrans counter in heavy LTE Coex case */
  16916. uint32 rxframe_heavy_LTE; /* rxframe counter in heavy LTE Coex case */
  16917. uint32 rxrtry_heavy_LTE; /* rxrtry counter in heavy LTE Coex case */
  16918. uint32 txnocts_heavy_LTE; /* txnocts counter in heavy LTE Coex case */
  16919. uint32 txrts_heavy_LTE; /* txrts counter in heavy LTE Coex case */
  16920. uint32 txdeauth_heavy_LTE; /* txdeauth counter in heavy LTE Coex case */
  16921. uint32 txassocreq_heavy_LTE; /* txassocreq counter in heavy LTE Coex case */
  16922. uint32 txassocrsp_heavy_LTE; /* txassocrsp counter in heavy LTE Coex case */
  16923. uint32 txreassocreq_heavy_LTE; /* txreassocreq counter in heavy LTE Coex case */
  16924. uint32 txreassocrsp_heavy_LTE; /* txreassocrsp counter in heavy LTE Coex case */
  16925. /* LTE specific ecounters */
  16926. uint16 type4_txinhi_dur; /* Duration of tx inhibit(in ms) due to Type4 */
  16927. uint16 type4_nonzero_cnt; /* Counts of none zero Type4 msg */
  16928. uint16 type4_timeout_cnt; /* Counts of Type4 timeout */
  16929. uint16 rx_pri_dur; /* Duration of wlan_rx_pri assertions */
  16930. uint16 rx_pri_cnt; /* Count of wlan_rx_pri assertions */
  16931. uint16 type6_dur; /* duration of LTE Tx power limiting assertions */
  16932. uint16 type6_cnt; /* Count of LTE Tx power limiting assertions */
  16933. uint16 ts_prot_frm_cnt; /* count of WLAN protection frames triggered by LTE coex */
  16934. uint16 ts_gr_cnt; /* count of intervals granted to WLAN in timesharing */
  16935. uint16 ts_gr_dur; /* duration granted to WLAN in timesharing */
  16936. } wlc_ltecoex_stats_t;
  16937. #define CSA_EVT_CSA_RXED (1 << 0)
  16938. #define CSA_EVT_CSA_TIMEOUT (1 << 1)
  16939. #define CSA_EVT_FROM_INFRA (1 << 2)
  16940. typedef struct csa_event_data {
  16941. chanspec_t chan_old;
  16942. dot11_ext_csa_ie_t ecsa;
  16943. dot11_mesh_csp_ie_t mcsp;
  16944. dot11_wide_bw_chan_switch_ie_t wbcs;
  16945. uint8 flags;
  16946. uint8 pad[3];
  16947. } csa_event_data_t;
  16948. /* ifdef (WL_ASSOC_BCN_RPT) */
  16949. enum wl_bcn_report_cmd_id {
  16950. WL_BCN_RPT_CMD_VER = 0,
  16951. WL_BCN_RPT_CMD_CONFIG = 1,
  16952. WL_BCN_RPT_CMD_VENDOR_IE = 2,
  16953. WL_BCN_RPT_CMD_LAST
  16954. };
  16955. /* beacon report specific macros */
  16956. #define WL_BCN_RPT_CCX_IE_OVERRIDE (1u << 0)
  16957. /* beacon report specific macros */
  16958. #define WL_BCN_RPT_ASSOC_SCAN_UNSOLICITED_MODE (1u << 1)
  16959. #define WL_BCN_RPT_ASSOC_SCAN_SOLICITED_MODE (1u << 2)
  16960. #define WL_BCN_RPT_ASSOC_SCAN_MODE_SHIFT (1)
  16961. #define WL_BCN_RPT_ASSOC_SCAN_MODE_MASK (WL_BCN_RPT_ASSOC_SCAN_UNSOLICITED_MODE |\
  16962. WL_BCN_RPT_ASSOC_SCAN_SOLICITED_MODE)
  16963. #define WL_BCN_RPT_ASSOC_SCAN_MODE_MAX (WL_BCN_RPT_ASSOC_SCAN_MODE_MASK >> \
  16964. WL_BCN_RPT_ASSOC_SCAN_MODE_SHIFT)
  16965. /* beacon report mode specific macro */
  16966. #define WL_BCN_RPT_ASSOC_SCAN_MODE_DEFAULT WL_BCN_RPT_ASSOC_SCAN_UNSOLICITED_MODE
  16967. /* beacon report timeout config specific macros */
  16968. #define WL_BCN_RPT_ASSOC_SCAN_CACHE_TIMEOUT_DEFAULT (120000)
  16969. #define WL_BCN_RPT_ASSOC_SCAN_CACHE_TIMEOUT_MIN (60000)
  16970. #define WL_BCN_RPT_ASSOC_SCAN_CACHE_TIMEOUT_MAX (0xFFFFFFFF)
  16971. /* beacon report cache count specific macros */
  16972. #define WL_BCN_RPT_ASSOC_SCAN_CACHE_COUNT_MIN (0)
  16973. #define WL_BCN_RPT_ASSOC_SCAN_CACHE_COUNT_MAX (8)
  16974. #define WL_BCN_RPT_ASSOC_SCAN_CACHE_COUNT_DEFAULT (WL_BCN_RPT_ASSOC_SCAN_CACHE_COUNT_MAX)
  16975. #define WL_BCN_REPORT_CMD_VERSION 1
  16976. struct wl_bcn_report_cfg {
  16977. uint32 flags; /**< Flags that defines the operation/setting information */
  16978. uint32 scan_cache_timeout; /**< scan cache timeout value in millisec */
  16979. uint32 scan_cache_timer_pend; /**< Read only pending time for timer expiry in millisec */
  16980. uint8 scan_cache_cnt; /**< scan cache count */
  16981. };
  16982. /* endif (WL_ASSOC_BCN_RPT) */
  16983. /* Thermal, Voltage, and Power Mitigation */
  16984. #define TVPM_REQ_VERSION_1 1
  16985. #define TVPM_REQ_CURRENT_VERSION TVPM_REQ_VERSION_1
  16986. /* tvpm iovar data */
  16987. typedef struct {
  16988. uint16 version; /* TVPM request version */
  16989. uint16 length; /* Length of the entire structure */
  16990. uint16 req_type; /* Request type: wl_tvpm_req_type_t */
  16991. uint16 req_len; /* Length of the following value */
  16992. uint8 value[]; /* Variable length data depending on req_type */
  16993. } wl_tvpm_req_t;
  16994. /* tvpm iovar request types */
  16995. typedef enum {
  16996. WL_TVPM_REQ_CLTM_INDEX, /* req_value: uint32, range 1...100 */
  16997. WL_TVPM_REQ_PPM_INDEX, /* req_value: uint32, range 1...100 */
  16998. WL_TVPM_REQ_ENABLE, /* req_value: uint32, range 0...1 */
  16999. WL_TVPM_REQ_STATUS, /* req_value: none */
  17000. WL_TVPM_REQ_PERIOD, /* req_value: int32, range {-1,1-10} */
  17001. WL_TVPM_REQ_MAX
  17002. } wl_tvpm_req_type_t;
  17003. /* structure for data returned by request type WL_TVPM_REQ_STATUS */
  17004. typedef struct wl_tvpm_status {
  17005. uint16 enable; /* whether TVPM is enabled */
  17006. uint16 tx_dutycycle; /* a percentage: 1-100 */
  17007. int16 tx_power_backoff; /* 0...-6 */
  17008. uint16 num_active_chains; /* 1...3 */
  17009. int16 temp; /* local temperature in degrees C */
  17010. uint8 vbat; /* local voltage in units of 0.1V */
  17011. uint8 pad;
  17012. } wl_tvpm_status_t;
  17013. /* TVPM ecounters */
  17014. typedef struct wl_tvpm_ecounters_t {
  17015. uint16 version; /* version field */
  17016. uint16 length; /* byte length in wl_tvpm_ecounters_t starting at version */
  17017. uint16 tx_dutycycle; /* a percentage: 1-100 */
  17018. int16 tx_power_backoff; /* 0...-6 */
  17019. uint16 num_active_chains; /* 1...3 */
  17020. int16 temp; /* local temperature */
  17021. uint8 vbat; /* local voltage */
  17022. uint8 cltm; /* CLTM index */
  17023. uint8 ppm; /* PPM index */
  17024. uint8 pad; /* pad to align to uint16 */
  17025. } wl_tvpm_ecounters_t;
  17026. #define TDMTX_ECOUNTERS_VERSION_V1 1
  17027. #define TDMTX_ECOUNTERS_VERSION_V2 2
  17028. /* TDMTX ecounters */
  17029. typedef struct wl_tdmtx_ecounters_v1 {
  17030. uint16 version; /* version field */
  17031. uint16 length; /* byte length in wl_tdmtx_ecounters_t starting at version */
  17032. uint32 txa_on; /* TXA on requests */
  17033. uint32 txa_tmcnt; /* Total number of TXA timeout */
  17034. uint32 por_on; /* TXA POR requests */
  17035. uint32 txpuen; /* Path enable requests */
  17036. uint32 txpudis; /* Total number of times Tx path is muted on the slice */
  17037. uint32 txpri_on; /* Total number of times Tx priority was obtained by the slice */
  17038. uint32 txdefer; /* Total number of times Tx was deferred by the slice */
  17039. uint32 txmute; /* Total number of times active Tx muted on the slice */
  17040. uint32 actpwrboff; /* Total number of times TX power is backed off by the slice */
  17041. uint32 txa_dur; /* Total time txa on */
  17042. uint32 txpri_dur; /* Total time TXPri */
  17043. uint32 txdefer_dur; /* Total time txdefer */
  17044. } wl_tdmtx_ecounters_v1_t;
  17045. /* TDMTX ecounters for version 2 */
  17046. typedef struct wl_tdmtx_ecounters_v2 {
  17047. uint16 version; /* version field */
  17048. uint16 length; /* byte length in wl_tdmtx_ecounters_t starting at version */
  17049. uint32 txa_on; /* TXA on requests */
  17050. uint32 txa_tmcnt; /* Total number of TXA timeout */
  17051. uint32 porhi_on; /* TXA PORHI requests */
  17052. uint32 porlo_on; /* TXA PORLO requests */
  17053. uint32 txpuen; /* Path enable requests */
  17054. uint32 txpudis; /* Total number of times Tx path is muted on the slice */
  17055. uint32 txpri_on; /* Total number of times Tx priority was obtained by the slice */
  17056. uint32 txdefer; /* Total number of times Tx was deferred by the slice */
  17057. uint32 txmute; /* Total number of times active Tx muted on the slice */
  17058. uint32 actpwrboff; /* Total number of times TX power is backed off by the slice */
  17059. uint32 txa_dur; /* Total time txa on */
  17060. uint32 txpri_dur; /* Total time TXPri */
  17061. uint32 txdefer_dur; /* Total time txdefer */
  17062. } wl_tdmtx_ecounters_v2_t;
  17063. /* Note: if this struct is changing update wl_scb_ecounters_vX_t version,
  17064. * as this struct is sent as payload in wl_scb_ecounters_vX_t
  17065. */
  17066. typedef struct wlc_scb_stats_v1 {
  17067. uint32 tx_pkts; /* num of packets transmitted (ucast) */
  17068. uint32 tx_failures; /* num of packets failed */
  17069. uint32 rx_ucast_pkts; /* num of unicast packets received */
  17070. uint32 rx_mcast_pkts; /* num of multicast packets received */
  17071. uint32 tx_rate; /* Rate of last successful tx frame */
  17072. uint32 rx_rate; /* Rate of last successful rx frame */
  17073. uint32 rx_decrypt_succeeds; /* num of packets decrypted successfully */
  17074. uint32 rx_decrypt_failures; /* num of packets decrypted unsuccessfully */
  17075. uint32 tx_mcast_pkts; /* num of mcast pkts txed */
  17076. uint64 tx_ucast_bytes; /* data bytes txed (ucast) */
  17077. uint64 tx_mcast_bytes; /* data bytes txed (mcast) */
  17078. uint64 rx_ucast_bytes; /* data bytes recvd ucast */
  17079. uint64 rx_mcast_bytes; /* data bytes recvd mcast */
  17080. uint32 tx_pkts_retried; /* num of packets where a retry was necessary */
  17081. uint32 tx_pkts_retry_exhausted; /* num of packets where a retry was exhausted */
  17082. uint32 tx_rate_mgmt; /* Rate of last transmitted management frame */
  17083. uint32 tx_rate_fallback; /* last used lowest fallback TX rate */
  17084. uint32 rx_pkts_retried; /* # rx with retry bit set */
  17085. uint32 tx_pkts_total; /* total num of tx pkts */
  17086. uint32 tx_pkts_retries; /* total num of tx retries */
  17087. uint32 tx_pkts_fw_total; /* total num of tx pkts generated from fw */
  17088. uint32 tx_pkts_fw_retries; /* num of fw generated tx pkts retried */
  17089. uint32 tx_pkts_fw_retry_exhausted; /* num of fw generated tx pkts where retry exhausted */
  17090. } wlc_scb_stats_v1_t;
  17091. /* ecounters for scb stats
  17092. * XTLV ID: WL_IFSTATS_XTLV_SCB_ECOUNTERS
  17093. */
  17094. #define WL_SCB_ECOUNTERS_VERSION_1 1
  17095. #define WL_SCB_ECOUNTERS_VERSION_2 2
  17096. typedef struct wl_scb_ecounters_v1 {
  17097. uint16 version; /* version field */
  17098. uint16 length; /* struct length starting from version */
  17099. uint32 chanspec; /* current chanspec where scb is operating */
  17100. struct ether_addr ea; /* peer ndi or sta ea */
  17101. uint8 peer_type; /* peer type */
  17102. uint8 pad;
  17103. /* scb tx and rx stats */
  17104. wlc_scb_stats_v1_t stats;
  17105. } wl_scb_ecounters_v1_t;
  17106. typedef struct wl_scb_ecounters_v2 {
  17107. uint16 version; /* version field */
  17108. uint16 length; /* struct length starting from version */
  17109. uint32 chanspec; /* current chanspec where scb is operating */
  17110. struct ether_addr ea; /* peer ndi or sta ea */
  17111. uint8 peer_type; /* peer type */
  17112. uint8 pad;
  17113. /* scb tx and rx stats */
  17114. uint16 tx_rate; /* Rate(in Mbps) of last successful tx frame */
  17115. uint16 rx_rate; /* Rate(in Mbps) of last successful rx frame */
  17116. uint16 tx_rate_fallback; /* last used lowest fallback TX rate(in Mbps) */
  17117. uint16 pad1;
  17118. uint32 rx_decrypt_succeeds; /* num of packets decrypted successfully */
  17119. uint32 rx_decrypt_failures; /* num of packets decrypted unsuccessfully */
  17120. uint32 rx_pkts_retried; /* # rx with retry bit set */
  17121. uint32 tx_pkts_retries; /* total num of tx retries */
  17122. uint32 tx_failures; /* num of packets failed */
  17123. uint32 tx_pkts_total; /* total num of tx pkts */
  17124. int8 rssi[WL_STA_ANT_MAX]; /* average rssi per antenna of data frames */
  17125. } wl_scb_ecounters_v2_t;
  17126. /* ecounters for nan slot stats
  17127. * XTLV ID: WL_IFSTATS_XTLV_NAN_SLOT_STATS
  17128. */
  17129. #define WL_NAN_SLOT_ECOUNTERS_VERSION_1 1
  17130. typedef struct wl_nan_slot_ecounters_v1 {
  17131. uint16 version; /* version field */
  17132. uint16 length; /* struct length starting from version */
  17133. uint32 chan[NAN_MAX_BANDS]; /* cur nan slot chanspec of both bands */
  17134. uint16 cur_slot_idx; /* cur nan slot index */
  17135. uint16 pad;
  17136. nan_sched_stats_t sched; /* sched stats */
  17137. wl_nan_mac_stats_t mac; /* mac stats */
  17138. } wl_nan_slot_ecounters_v1_t;
  17139. /*
  17140. * BT log definitions
  17141. */
  17142. /* common iovar struct */
  17143. typedef struct wl_btl {
  17144. uint16 subcmd_id; /* subcommand id */
  17145. uint16 len; /* total length of data[] */
  17146. uint8 data[2]; /* subcommand data, variable length */
  17147. } wl_btl_t;
  17148. /* subcommand ids */
  17149. #define WL_BTL_SUBCMD_ENABLE 0 /* enable/disable logging */
  17150. #define WL_BTL_SUBCMD_STATS 1 /* statistics */
  17151. /* WL_BTL_SUBCMD_ENABLE data */
  17152. typedef struct wl_blt_enable {
  17153. uint8 enable; /* 1 - enable, 0 - disable */
  17154. uint8 pad[3]; /* 4-byte struct alignment */
  17155. } wl_btl_enable_t;
  17156. /* WL_BTL_SUBCMD_STATS data */
  17157. typedef struct wl_blt_stats {
  17158. uint32 bt_interrupt; /* num BT interrupts */
  17159. uint32 config_req; /* num CONFIG_REQ */
  17160. uint32 config_res_success; /* num CONFIG_RES successful */
  17161. uint32 config_res_fail; /* num CONFIG_RES failed */
  17162. uint32 log_req; /* num LOG_REQ */
  17163. uint32 log_res_success; /* num LOG_RES successful */
  17164. uint32 log_res_fail; /* num LOG_RES failed */
  17165. uint32 indirect_read_fail; /* num indirect read fail */
  17166. uint32 indirect_write_fail; /* num indirect write fail */
  17167. uint32 dma_fail; /* num DMA failed */
  17168. uint32 min_log_req_duration; /* min log request duration in usec */
  17169. uint32 max_log_req_duration; /* max log request duration in usec */
  17170. uint16 mem_dump_req; /* num mem dump requests */
  17171. uint16 mem_dump_success; /* num mem dumps successful */
  17172. uint16 mem_dump_fail; /* num mem dumps failed */
  17173. uint16 bt_wake_success; /* num BT wakes successful */
  17174. uint16 bt_wake_fail; /* num BT wakes failed */
  17175. uint16 mem_dump_req_interrupt; /* num MEM_DUMP_REQ interrupt */
  17176. uint16 mem_dump_res_interrupt; /* num MEM_DUMP_RES interrupt */
  17177. uint16 mem_dump_res_timeout; /* num MEM_DUMP_RES timeout */
  17178. uint16 mem_dump_proc_no_bt_ready; /* num proceed if no BT ready */
  17179. uint16 mem_dump_proc_no_bt_response; /* num proceed if no BT response */
  17180. uint16 mem_dump_proc_no_bt_clock; /* num proceed if no BT clock */
  17181. uint16 pad; /* alignment */
  17182. uint32 last_failed_region; /* start addr of last failed region */
  17183. uint32 min_mem_dump_duration; /* min mem dump duration in usec */
  17184. uint32 max_mem_dump_duration; /* max mem dump duration in usec */
  17185. } wl_btl_stats_t;
  17186. /* IOV AWD DATA */
  17187. /* AWD DATA structures */
  17188. typedef struct {
  17189. uint8 version; /* Extended trap version info */
  17190. uint8 reserved; /* currently unused */
  17191. uint16 length; /* Length of data excluding this header */
  17192. uint8 data[]; /* this data is TLV of tags */
  17193. } awd_data_v1_t;
  17194. /* AWD TAG structure */
  17195. typedef struct {
  17196. uint8 tagid; /* one of AWD DATA TAGs numbers */
  17197. uint8 length; /* the data size represented by this field must be aligned to 32 bits */
  17198. uint8 data[]; /* variable size, defined by length field */
  17199. } awd_tag_data_v1_t;
  17200. /* IOV ETD DATA */
  17201. /* ETD DATA structures */
  17202. typedef struct {
  17203. uint8 version; /* Extended trap version info */
  17204. uint8 reserved; /* currently unused */
  17205. uint16 length; /* Length of data excluding this header */
  17206. uint8 data[]; /* this data is TLV of tags */
  17207. } etd_data_v1_t;
  17208. /* ETD TAG structure */
  17209. typedef struct {
  17210. uint8 tagid; /* one of ETD DATA TAGs numbers */
  17211. uint8 length; /* the data size represented by this field must be aligned to 32 bits */
  17212. uint8 data[]; /* variable size, defined by length field */
  17213. } etd_tag_data_v1_t;
  17214. /* ETD information structures associated with ETD_DATA_Tags */
  17215. /* ETD_JOIN_CLASSIFICATION_INFO 10 */
  17216. typedef struct {
  17217. uint8 assoc_type; /* assoc type */
  17218. uint8 assoc_state; /* current state of assoc state machine */
  17219. uint8 wpa_state; /* wpa->state */
  17220. uint8 wsec_portopen; /* shows if security port is open */
  17221. uint8 total_attempts_num; /* total number of join attempts (bss_retries) */
  17222. uint8 num_of_targets; /* up to 3, in current design */
  17223. uint8 reserved [2]; /* padding to get 32 bits alignment */
  17224. uint32 wsec; /* bsscfg->wsec */
  17225. uint32 wpa_auth; /* bsscfg->WPA_auth */
  17226. uint32 time_to_join; /* time duration to process WLC_SET_SSID request (ms) */
  17227. } join_classification_info_v1_t;
  17228. /* ETD_JOIN_TARGET_CLASSIFICATION_INFO 11 */
  17229. typedef struct {
  17230. int8 rssi; /* RSSI on current channel */
  17231. uint8 cca; /* CCA on current channel */
  17232. uint8 channel; /* current channel */
  17233. uint8 num_of_attempts; /* (bss_retries) up to 5 */
  17234. uint8 oui[3]; /* the first three octets of the AP's address */
  17235. uint8 reserved; /* padding to get 32 bits alignment */
  17236. uint32 time_duration; /* time duration of current attempt (ms) */
  17237. } join_target_classification_info_v1_t;
  17238. /* ETD_ASSOC_STATE 12 */
  17239. typedef struct {
  17240. uint8 assoc_state; /* assoc type */
  17241. uint8 reserved [3]; /* padding to get 32 bits alignment */
  17242. } join_assoc_state_v1_t;
  17243. /* ETD_CHANNEL 13 tag */
  17244. typedef struct {
  17245. uint8 channel; /* last attempt channel */
  17246. uint8 reserved [3]; /* padding to get 32 bits alignment */
  17247. } join_channel_v1_t;
  17248. /* ETD_TOTAL_NUM_OF_JOIN_ATTEMPTS 14 */
  17249. typedef struct {
  17250. uint8 total_attempts_num; /* total number of join attempts (bss_retries) */
  17251. uint8 reserved [3]; /* padding to get 32 bits alignment */
  17252. } join_total_attempts_num_v1_t;
  17253. /* IOV_ROAM_CACHE structures */
  17254. enum wl_rmc_report_cmd_id {
  17255. WL_RMC_RPT_CMD_VER = 0,
  17256. WL_RMC_RPT_CMD_DATA = 1,
  17257. WL_RMC_RPT_CMD_LAST
  17258. };
  17259. enum wl_rmc_report_xtlv_id {
  17260. WL_RMC_RPT_XTLV_VER = 0x0,
  17261. WL_RMC_RPT_XTLV_BSS_INFO = 0x1,
  17262. WL_RMC_RPT_XTLV_CANDIDATE_INFO = 0x2
  17263. };
  17264. /* WL_RMC_RPT_XTLV_BSS_INFO */
  17265. typedef struct {
  17266. int16 rssi; /* current BSS RSSI */
  17267. uint8 reason; /* reason code for last full scan */
  17268. uint8 status; /* last status code for not roaming */
  17269. uint32 fullscan_count; /* number of full scans performed on current BSS */
  17270. uint32 time_full_scan; /* delta time (in ms) between cur time and full scan timestamp */
  17271. } rmc_bss_info_v1_t;
  17272. /* WL_RMC_RPT_XTLV_CANDIDATE_INFO */
  17273. typedef struct {
  17274. int16 rssi; /* last seen rssi */
  17275. uint16 ctl_channel; /* channel */
  17276. uint32 time_last_seen; /* delta time (in ms) between cur time and last seen timestamp */
  17277. uint16 bss_load; /* BSS load */
  17278. uint8 bssid [6]; /* padding to get 32 bits alignment */
  17279. } rmc_candidate_info_v1_t;
  17280. #define WL_FILTER_IE_VERSION 1
  17281. enum wl_filter_ie_options {
  17282. WL_FILTER_IE_CLEAR = 0, /* allow element id in packet.For suboption */
  17283. WL_FILTER_IE_SET = 1, /* filter element id in packet.For suboption */
  17284. WL_FILTER_IE_LIST = 2, /* list element ID's.Set as option */
  17285. WL_FILTER_IE_CLEAR_ALL = 3, /* clear all the element.Set as option */
  17286. WL_FILTER_IE_CHECK_SUB_OPTION = 4 /* check for suboptions.Set only as option */
  17287. };
  17288. typedef struct wl_filter_ie_tlv {
  17289. uint16 id;
  17290. uint16 len; /* sub option length + pattern length */
  17291. uint8 data[]; /* sub option + pattern matching(OUI,type,sub-type) */
  17292. } wl_filter_ie_tlv_t;
  17293. typedef struct wl_filter_ie_iov {
  17294. uint16 version; /* Structure version */
  17295. uint16 len; /* Total length of the structure */
  17296. uint16 fixed_length; /* Total length of fixed fields */
  17297. uint8 option; /* Filter action - check for suboption */
  17298. uint8 pad[1]; /* Align to 4 bytes */
  17299. uint32 pktflag; /* frame type */
  17300. uint8 tlvs[]; /* variable data (zero in for list ,clearall) */
  17301. } wl_filter_ie_iov_v1_t;
  17302. /* Event aggregation config */
  17303. #define EVENT_AGGR_CFG_VERSION 1
  17304. #define EVENT_AGGR_DISABLED 0x0
  17305. #define EVENT_AGGR_ENABLED 0x1
  17306. #define EVENT_AGGR_BUFSIZE_MAX 1512
  17307. #define EVENT_AGGR_BUFSIZE_MIN 512
  17308. #define EVENT_AGGR_FLUSH_TIMEOUT_DEFAULT 100
  17309. #define EVENT_AGGR_FLUSH_TIMEOUT_MAX 2000
  17310. #define EVENT_AGGR_NUM_EVENTS_FLUSH 5
  17311. typedef struct event_aggr_config {
  17312. uint16 version;
  17313. uint16 len;
  17314. uint16 flags; /* bit 0 to enable/disable the feature */
  17315. uint16 bufsize; /* Aggregate buffer size */
  17316. uint16 flush_timeout; /* Timeout for event flush */
  17317. uint16 num_events_flush; /* Number of events aggregated before flush */
  17318. } event_aggr_config_t;
  17319. #ifndef WL_TDMTX_TYPEDEF_HAS_ALIAS
  17320. typedef tdmtx_cnt_v1_t tdmtx_cnt_t;
  17321. typedef tdmtx_cnt_shm_v1_t tdmtx_cnt_shm_t;
  17322. typedef wl_tdmtx_ecounters_v1_t wl_tdmtx_ecounters_t;
  17323. #define WL_CNT_TDMTX_STRUCT_SZ (sizeof(tdmtx_cnt_t))
  17324. #define WL_CNT_TDMTX_SHM_SZ (sizeof(tdmtx_cnt_shm_t))
  17325. #endif // endif
  17326. /** chanctxt related statistics */
  17327. #define CHANCTXT_STATS_VERSION_1 1
  17328. #define CHANCTXT_STATS_CURRENT_VERSION CHANCTXT_STATS_VERSION_1
  17329. typedef struct wlc_chanctxt_stats {
  17330. uint32 excursionq_end_miss;
  17331. uint32 activeq_end_miss;
  17332. uint32 no_chanctxt_count;
  17333. uint32 txqueue_end_incomplete;
  17334. uint32 txqueue_start_incomplete;
  17335. } wlc_chanctxt_stats_core_t;
  17336. typedef struct chanctxt_stats {
  17337. uint16 version;
  17338. uint16 length;
  17339. wlc_chanctxt_stats_core_t corestats[MAX_NUM_D11CORES];
  17340. } wlc_chanctxt_stats_t;
  17341. typedef struct wl_txdc_ioc {
  17342. uint8 ver;
  17343. uint8 id; /* ID of the sub-command */
  17344. uint16 len; /* total length of all data[] */
  17345. uint8 data[]; /* var len payload */
  17346. } wl_txdc_ioc_t;
  17347. /*
  17348. * iovar subcommand ids
  17349. */
  17350. enum {
  17351. IOV_TXDC_ENB = 1,
  17352. IOV_TXDC_MODE = 2,
  17353. IOV_TXDC_DUMP = 3,
  17354. IOV_TXDC_LAST
  17355. };
  17356. /* WL_NAN_XTLV_SLOT_STATS */
  17357. /* WL_NAN_EVENT_SLOT_START, WL_NAN_EVENT_SLOT_END */
  17358. typedef struct nan_slot_event_data {
  17359. uint32 cur_slot_idx; /* current idx in channel schedule */
  17360. uint32 fw_time; /* target current time in microseconds */
  17361. uint32 band; /* current band (2G/5G) for which the event is received */
  17362. } nan_slot_event_data_t;
  17363. #ifndef BCMUTILS_ERR_CODES
  17364. /* SAE (Simultaneous Authentication of Equals) error codes.
  17365. * These error codes are local.
  17366. */
  17367. /* SAE status codes are reserved from -3072 to -4095 (1K) */
  17368. enum wl_sae_status {
  17369. WL_SAE_E_AUTH_FAILURE = -3072,
  17370. /* Discard silently */
  17371. WL_SAE_E_AUTH_DISCARD = -3073,
  17372. /* Authentication in progress */
  17373. WL_SAE_E_AUTH_CONTINUE = -3074,
  17374. /* Invalid scalar/elt */
  17375. WL_SAE_E_AUTH_COMMIT_INVALID = -3075,
  17376. /* Invalid confirm token */
  17377. WL_SAE_E_AUTH_CONFIRM_INVALID = -3076,
  17378. /* Peer scalar validation failure */
  17379. WL_SAE_E_CRYPTO_SCALAR_VALIDATION = -3077,
  17380. /* Peer element prime validation failure */
  17381. WL_SAE_E_CRYPTO_ELE_PRIME_VALIDATION = -3078,
  17382. /* Peer element is not on the curve */
  17383. WL_SAE_E_CRYPTO_ELE_NOT_ON_CURVE = -3079,
  17384. /* Generic EC error (eliptic curve related) */
  17385. WL_SAE_E_CRYPTO_EC_ERROR = -3080,
  17386. /* Both local and peer mac addrs are same */
  17387. WL_SAE_E_CRYPTO_EQUAL_MACADDRS = -3081,
  17388. /* Loop exceeded in deriving the scalar */
  17389. WL_SAE_E_CRYPTO_SCALAR_ITER_EXCEEDED = -3082,
  17390. /* ECC group is unsupported */
  17391. WL_SAE_E_CRYPTO_UNSUPPORTED_GROUP = -3083,
  17392. /* Exceeded the hunting-and-pecking counter */
  17393. WL_SAE_E_CRYPTO_PWE_COUNTER_EXCEEDED = -3084,
  17394. /* SAE crypto component is not initialized */
  17395. WL_SAE_E_CRYPTO_NOT_INITED = -3085,
  17396. /* bn_get has failed */
  17397. WL_SAE_E_CRYPTO_BN_GET_ERROR = -3086,
  17398. /* bn_set has failed */
  17399. WL_SAE_E_CRYPTO_BN_SET_ERROR = -3087,
  17400. /* PMK is not computed yet */
  17401. WL_SAE_E_CRYPTO_PMK_UNAVAILABLE = -3088,
  17402. /* Peer confirm did not match */
  17403. WL_SAE_E_CRYPTO_CONFIRM_MISMATCH = -3089,
  17404. /* Element K is at infinity no the curve */
  17405. WL_SAE_E_CRYPTO_KEY_AT_INFINITY = -3090,
  17406. /* SAE Crypto private data magic number mismatch */
  17407. WL_SAE_E_CRYPTO_PRIV_MAGIC_MISMATCH = -3091
  17408. };
  17409. /* PMK manager block. Event codes from -5120 to -6143 */
  17410. /* PSK hashing event codes */
  17411. typedef enum wlc_pmk_psk_hash_status {
  17412. WL_PMK_E_PSK_HASH_FAILED = -5120,
  17413. WL_PMK_E_PSK_HASH_DONE = -5121,
  17414. WL_PMK_E_PSK_HASH_RUNNING = -5122,
  17415. WL_PMK_E_PSK_INVALID = -5123,
  17416. WL_PMK_E_PSK_NOMEM = -5124
  17417. } wlc_pmk_psk_hash_status_t;
  17418. #endif /* BCMUTILS_ERR_CODES */
  17419. /* Block Channel */
  17420. #define WL_BLOCK_CHANNEL_VER_1 1u
  17421. typedef struct wl_block_ch_v1 {
  17422. uint16 version;
  17423. uint16 len;
  17424. uint32 band; /* Band select */
  17425. uint8 channel_num; /* The number of block channels in the selected band */
  17426. uint8 padding[3];
  17427. uint8 channel[]; /* Channel to block, Variable Length */
  17428. } wl_block_ch_v1_t;
  17429. typedef struct dma_wl_addr_region {
  17430. uint32 addr_low;
  17431. uint32 addr_high;
  17432. } dma_wl_addr_region_t;
  17433. #define WL_ROAMSTATS_IOV_VERSION 1
  17434. #define MAX_PREV_ROAM_EVENTS 16u
  17435. #define ROAMSTATS_UNKNOWN_CNT 0xFFFFu
  17436. /* roaming statistics counter structures */
  17437. typedef struct wlc_assoc_roamstats_event_msg_v1 {
  17438. uint32 event_type; /* Message (see below) */
  17439. uint32 status; /* Status code (see below) */
  17440. uint32 reason; /* Reason code (if applicable) */
  17441. uint32 timestamp; /* Timestamp of event */
  17442. } wlc_assoc_roamstats_event_msg_v1_t;
  17443. enum wl_roamstats_cmd_id {
  17444. WL_ROAMSTATS_XTLV_CMD_VER = 0,
  17445. WL_ROAMSTATS_XTLV_CMD_RESET = 1,
  17446. WL_ROAMSTATS_XTLV_CMD_STATUS = 2,
  17447. WL_ROAMSTATS_XTLV_CMD_LAST /* Keep this at the end */
  17448. };
  17449. enum wl_roamstats_xtlv_id {
  17450. WL_ROAMSTATS_XTLV_VER = 0x0,
  17451. WL_ROAMSTATS_XTLV_COUNTER_INFO = 0x1,
  17452. WL_ROAMSTATS_XTLV_PREV_ROAM_EVENTS = 0x2,
  17453. WL_ROAMSTATS_XTLV_REASON_INFO = 0x3
  17454. };
  17455. /* WL_ROAMSTATS_XTLV_COUNTER_INFO */
  17456. typedef struct {
  17457. uint32 initial_assoc_time;
  17458. uint32 prev_roam_time;
  17459. uint32 host_access_time;
  17460. uint16 roam_success_cnt;
  17461. uint16 roam_fail_cnt;
  17462. uint16 roam_attempt_cnt;
  17463. uint16 max_roam_target_cnt;
  17464. uint16 min_roam_target_cnt;
  17465. uint16 max_cached_ch_cnt;
  17466. uint16 min_cached_ch_cnt;
  17467. uint16 partial_roam_scan_cnt;
  17468. uint16 full_roam_scan_cnt;
  17469. } roamstats_counter_info_v1_t;
  17470. /* WL_ROAMSTATS_XTLV_PREV_ROAM_EVENTS */
  17471. typedef struct {
  17472. uint16 max;
  17473. uint16 pos;
  17474. wlc_assoc_roamstats_event_msg_v1_t roam_event[];
  17475. } roamstats_prev_roam_events_v1_t;
  17476. /* WL_ROAMSTATS_XTLV_REASON_INFO */
  17477. typedef struct {
  17478. uint16 max;
  17479. uint16 reason_cnt[];
  17480. } roamstats_reason_info_v1_t;
  17481. #ifdef HEALTH_CHECK_WLIOCTL
  17482. /* Health check status format:
  17483. * reporting status size = uint32
  17484. * 8 LSB bits are reserved for: WARN (0), ERROR (1), and other levels
  17485. * MSB 24 bits are reserved for client to fill in its specific status
  17486. */
  17487. #define HEALTH_CHECK_STATUS_OK 0
  17488. /* Bit positions. */
  17489. #define HEALTH_CHECK_STATUS_WARN 0x1
  17490. #define HEALTH_CHECK_STATUS_ERROR 0x2
  17491. #define HEALTH_CHECK_STATUS_TRAP 0x4
  17492. #define HEALTH_CHECK_STATUS_NOEVENT 0x8
  17493. /* Indication that required information is populated in log buffers */
  17494. #define HEALTH_CHECK_STATUS_INFO_LOG_BUF 0x80
  17495. #define HEALTH_CHECK_STATUS_MASK (0xFF)
  17496. #define HEALTH_CHECK_STATUS_MSB_SHIFT 8
  17497. #endif /* HEALTH_CHECK_WLIOCTL */
  17498. /** receive signal reporting module interface */
  17499. #define WL_RXSIG_IOV_MAJOR_VER (1u)
  17500. #define WL_RXSIG_IOV_MINOR_VER (1u)
  17501. #define WL_RXSIG_IOV_MAJOR_VER_SHIFT (8u)
  17502. #define WL_RXSIG_IOV_VERSION \
  17503. ((WL_RXSIG_IOV_MAJOR_VER << WL_RXSIG_IOV_MAJOR_VER_SHIFT) | WL_RXSIG_IOV_MINOR_VER)
  17504. #define WL_RXSIG_IOV_GET_MAJOR(x) (x >> WL_RXSIG_IOV_MAJOR_VER_SHIFT)
  17505. #define WL_RXSIG_IOV_GET_MINOR(x) (x & 0xFF)
  17506. enum wl_rxsig_cmd_rssi_mode {
  17507. WL_RXSIG_MODE_DB = 0x0,
  17508. WL_RXSIG_MODE_QDB = 0x1,
  17509. WL_RXSIG_MODE_LAST
  17510. };
  17511. /* structure defs for 'wl rxsig [cmd]' iovars */
  17512. enum wl_rxsig_iov_v1 {
  17513. WL_RXSIG_CMD_RSSI = 0x1, /**< combined rssi moving avg */
  17514. WL_RXSIG_CMD_SNR = 0x2, /**< combined snr moving avg */
  17515. WL_RXSIG_CMD_RSSIANT = 0x3, /**< rssi moving avg per-ant */
  17516. WL_RXSIG_CMD_SNRANT = 0x4, /**< snr moving avg per-snr */
  17517. WL_RXSIG_CMD_SMPLWIN = 0x5, /**< config for sampling window size */
  17518. WL_RXSIG_CMD_SMPLGRP = 0x7, /**< config for grouping of pkt type */
  17519. WL_RXSIG_CMD_STA_MA = 0x8,
  17520. WL_RXSIG_CMD_MAMODE = 0x9,
  17521. WL_RXSIG_CMD_MADIV = 0xa,
  17522. WL_RXSIG_CMD_DUMP = 0xb,
  17523. WL_RXSIG_CMD_DUMPWIN = 0xc,
  17524. WL_RXSIG_CMD_TOTAL
  17525. };
  17526. struct wl_rxsig_cfg_v1 {
  17527. uint16 version;
  17528. chanspec_t chan; /**< chanspec info for querying stats */
  17529. uint8 pmac[ETHER_ADDR_LEN]; /**< peer(link) mac address */
  17530. };
  17531. struct wl_rxsig_iov_rssi_v1 {
  17532. int8 rssi;
  17533. uint8 rssi_qdb;
  17534. uint8 pad[2];
  17535. };
  17536. struct wl_rxsig_iov_snr_v1 {
  17537. int16 snr;
  17538. uint16 pad;
  17539. };
  17540. struct wl_rxsig_iov_rssi_ant_v1 {
  17541. int8 deci[WL_RSSI_ANT_MAX];
  17542. uint8 frac[WL_RSSI_ANT_MAX];
  17543. uint8 rssi_mode; /**< MODE_DB or MODE_QDB */
  17544. uint8 num_of_ant; /**< total number of ants */
  17545. uint8 pad[2]; /**< padding for 32bit align */
  17546. };
  17547. #ifdef BCM_SDC
  17548. #define SDC_TRIGGER_CONFIG_VER_1 1
  17549. typedef struct {
  17550. uint16 version;
  17551. uint16 type;
  17552. uint8 activate;
  17553. uint8 pad;
  17554. } sdc_trigger_cfg_t;
  17555. typedef enum sdc_trigger_types {
  17556. SDC_TYPE_STA_ONBOARD_DEBUG = 1,
  17557. SDC_TYPE_SCAN_DEBUG = 2,
  17558. #ifdef SDC_TEST
  17559. /*
  17560. * This is for test purpose only. Don't assign specific value.
  17561. * Keep at the end
  17562. */
  17563. SDC_TYPE_TEST1,
  17564. SDC_TYPE_TEST2,
  17565. SDC_TYPE_TEST3,
  17566. #endif /* SDC_TEST */
  17567. SDC_TYPE_MAX_TRIGGER
  17568. } sdc_trigger_types_t;
  17569. /* *** SDC_TYPE_STA_ONBOARD_DEBUG specific ******* */
  17570. /* tlv IDs uniquely identifies tx and rx stats component */
  17571. enum wl_slice_hist_stats_xtlv_id {
  17572. WL_STATE_HIST_TX_TOSS_REASONS = 0x1,
  17573. WL_STATE_HIST_RX_TOSS_REASONS = 0x2
  17574. };
  17575. #ifndef WLC_HIST_TOSS_LEN
  17576. #define WLC_HIST_TOSS_LEN (8u)
  17577. #endif // endif
  17578. #define WL_HIST_COMPACT_TOSS_STATS_TX_VER_1 (1u)
  17579. #define WL_HIST_COMPACT_TOSS_STATS_RX_VER_1 (1u)
  17580. /* Format of running toss reasons with seq
  17581. * [see HIST_TOSS_xxxx macros]
  17582. * bits [7..0] : 8 bits : toss sts.
  17583. * [11..8] : cfgidx
  17584. * [15..12]: ac
  17585. * [31..16]: seq
  17586. */
  17587. #define HIST_TOSS_STS_POS (0u)
  17588. #define HIST_TOSS_STS_MASK (0x000000ffu)
  17589. #define HIST_TOSS_CFGIDX_POS (8u)
  17590. #define HIST_TOSS_CFGIDX_MASK (0x00000f00u)
  17591. #define HIST_TOSS_AC_POS (12u)
  17592. #define HIST_TOSS_AC_MASK (0x0000f000u)
  17593. #define HIST_TOSS_SEQ_POS (16u)
  17594. #define HIST_TOSS_SEQ_MASK (0xffff0000u)
  17595. /* Format of toss reasons with count
  17596. * bits [15..0] : 16 bits : toss reason
  17597. * bits [31..16]: 16 bits : count
  17598. */
  17599. #define HIST_TOSS_RC_REASON_POS (0u)
  17600. #define HIST_TOSS_RC_REASON_MASK (0xffffu)
  17601. #define HIST_TOSS_RC_COUNT_POS (16u)
  17602. #define HIST_TOSS_RC_COUNT_MASK (0xffff0000u)
  17603. typedef struct {
  17604. uint16 version;
  17605. uint8 hist_toss_type; /* from wl_slice_hist_XX_stats_xtlv_id */
  17606. uint8 hist_toss_num; /* number of elements in hist_toss_xxx */
  17607. uint32 hist_toss_cur_idx; /* latest data is in this index */
  17608. uint32 hist_toss_reasons[WLC_HIST_TOSS_LEN]; /* last 8 reasons along with seq, etc as
  17609. * per HIST_TOSS_xxx format
  17610. */
  17611. uint32 hist_toss_counts[WLC_HIST_TOSS_LEN]; /* toss counts corr to reasons */
  17612. } wl_hist_compact_toss_stats_v1_t;
  17613. #define WL_HIST_COMPACT_TOSS_STATS_TX_VER_2 (2u)
  17614. #define WL_HIST_COMPACT_TOSS_STATS_RX_VER_2 (2u)
  17615. typedef struct {
  17616. uint16 version;
  17617. uint8 htr_type; /* from wl_slice_hist_XX_stats_xtlv_id */
  17618. uint8 htr_num; /* number of elements in htr_running or htr_rc */
  17619. uint16 htr_rnidx; /* htr_running[rnidx-1] has latest data */
  17620. uint16 htr_rcidx; /* htr_rc[rcidx-1] has latest data */
  17621. uint32 htr_running[WLC_HIST_TOSS_LEN]; /* last 8 reasons along with seq, etc as
  17622. * per WLC_SDC_COMPACT_TOSS_REASON() format
  17623. */
  17624. uint32 htr_rn_ts[WLC_HIST_TOSS_LEN]; /* time stamps corr to htr_running data */
  17625. uint32 htr_rc[WLC_HIST_TOSS_LEN]; /* last 8 toss reasons and counts in
  17626. * WLC_SDC_COMPACT_TOSS_RC() format
  17627. */
  17628. uint32 htr_rc_ts[WLC_HIST_TOSS_LEN]; /* time stamps corr to htr_rc */
  17629. } wl_hist_compact_toss_stats_v2_t;
  17630. /* ***END of SDC_TYPE_STA_ONBOARD_DEBUG specific ******* */
  17631. #endif /* BCM_SDC */
  17632. typedef struct wl_avs_info_v1 {
  17633. uint16 version; /* Structure version */
  17634. uint16 equ_version; /* Equation Version */
  17635. uint32 RO; /* RO in OTP */
  17636. uint32 equ_csr; /* Equated CSR */
  17637. uint32 read_csr; /* Read Back CSR */
  17638. uint32 aging; /* aging setting in nvram */
  17639. } wl_avs_info_v1_t;
  17640. #define WL_AVS_INFO_VER_1 1
  17641. /* bitmap for clm_flags iovar */
  17642. #define WL_CLM_TXBF 0x01 /**< Flag for Tx beam forming */
  17643. #define WL_CLM_RED_EU 0x02 /* Flag for EU RED */
  17644. #define WL_CLM_EDCRS_EU 0x04 /**< Use EU post-2015 energy detect */
  17645. #define WL_CLM_DFS_TPC 0x08 /**< Flag for DFS TPC */
  17646. #define WL_CLM_RADAR_TYPE_EU 0x10 /**< Flag for EU */
  17647. #define WL_CLM_DFS_FCC WL_CLM_DFS_TPC /**< Flag for DFS FCC */
  17648. #define WL_CLM_DFS_EU (WL_CLM_DFS_TPC | WL_CLM_RADAR_TYPE_EU) /**< Flag for DFS EU */
  17649. /* SC (scan core) command IDs */
  17650. enum wl_sc_cmd {
  17651. WL_SC_CMD_DBG = 0,
  17652. WL_SC_CMD_CNX = 1,
  17653. WL_SC_CMD_CAP = 2,
  17654. WL_SC_CMD_CONFIG = 3,
  17655. WL_SC_CMD_LAST
  17656. };
  17657. /* WBUS sub-command IDs for unit test */
  17658. #define WL_WBUS_INA_SLOT_START 0x01u /**< Inactive slot start sub command ID. */
  17659. #define WL_WBUS_INA_SLOT_STOP 0x02u /**< Inactive slot stop sub command ID. */
  17660. /* WBUS (WiFi BT uniform scheduler) command IDs */
  17661. enum wl_wbus_cmd {
  17662. WL_WBUS_CMD_VER = 0,
  17663. WL_WBUS_CMD_STATS = 1,
  17664. WL_WBUS_CMD_UNIT_TEST = 2,
  17665. WL_WBUS_CMD_BT_TEST = 3,
  17666. WL_WBUS_CMD_LAST
  17667. };
  17668. #define WBUS_BT_SCHED_TEST_PARAMS_VER_1 1
  17669. typedef struct wbus_bt_sched_test_params_v1 {
  17670. uint16 version;
  17671. uint16 pad;
  17672. uint32 flags;
  17673. uint32 action;
  17674. uint32 duration;
  17675. uint32 interval;
  17676. } wbus_bt_sched_test_params_v1_t;
  17677. #define WBUS_BT_SCHED_ADD 0u
  17678. #define WBUS_BT_SCHED_REMOVE 1u
  17679. #define WBUS_BT_SCHED_INVALID 0xFFu
  17680. #define KEY_UPDATE_INFO_VER_V1 1
  17681. typedef struct key_update_info_v1
  17682. {
  17683. uint16 ver;
  17684. uint8 pad;
  17685. uint8 flags;
  17686. uint32 timestamp;
  17687. uint32 algo;
  17688. uint32 key_flags;
  17689. struct ether_addr ea;
  17690. struct ether_addr sa;
  17691. } key_update_info_v1_t;
  17692. /* Key update flag bit field */
  17693. #define KEY_UPD_FLAG_ADD_KEY 0x1 /* 0 - Removal, 1 - Add key */
  17694. #ifdef WLLLW
  17695. /* LLW Session */
  17696. #define LLW_VERSION 1
  17697. #define LLW_STATS_VERSION 1
  17698. /* LLW roles */
  17699. #define LLW_ROLE_SCHEDULER 0
  17700. #define LLW_ROLE_CLIENT 1
  17701. /* LLW modes */
  17702. #define LLW_MODE_GAPS 0
  17703. #define LLW_MODE_BACK_TO_BACK 1
  17704. /* LLW session max values */
  17705. #define LLW_MAX_SESSION_ID 10
  17706. #define LLW_MAX_FLOW_ID 40
  17707. #define LLW_MAX_CLIENT_NUM 15
  17708. #define LLW_MAX_GAPS_PERIOD 20
  17709. #define LLW_MAX_GAPS_VAR 3
  17710. #define LLW_MAX_RETX_CNT 10
  17711. #define LLW_MAX_AIFSN EDCF_AIFSN_MAX
  17712. #define LLW_MAX_CWMIN EDCF_ECW_MAX
  17713. #define LLW_MAX_CWMAX EDCF_ECW_MAX
  17714. #define LLW_MAX_PER_NUMERATOR 100
  17715. #define LLW_MAX_PER_DENOM 10000
  17716. #define LLW_MAX_CLIENT_ID 15
  17717. #define LLW_MAX_PKT_SIZE 1500
  17718. #define LLW_MAX_PKT_NUM 10
  17719. #define LLW_MAX_MCS 9
  17720. #define LLW_MAX_NUM_STREAMS 8
  17721. #define LLW_MAX_IBS 32
  17722. /* Per LLW session config */
  17723. /* WL_LLW_CMD_SESSION_CREATE, WL_LLW_CMD_SESSION_UPDATE */
  17724. typedef struct wl_llw_session_cfg {
  17725. uint8 session_id;
  17726. uint8 role;
  17727. uint8 mode;
  17728. uint8 client_id;
  17729. uint8 gaps_period;
  17730. uint8 gaps_var;
  17731. uint8 aifsn;
  17732. uint8 ecwmin; /* exponent value for minimum contention window */
  17733. uint8 ecwmax; /* exponent value for maximum contention window */
  17734. uint8 mcs;
  17735. uint8 num_streams;
  17736. uint8 ibs; /* interblock spacing in usecs, for spacing between Transaction Blocks */
  17737. uint16 ul_pkt_size;
  17738. uint16 dl_pkt_size;
  17739. uint16 per_denom; /* denominator for target PER */
  17740. uint8 per_numerator; /* this value divided by per_denom gives the target PER */
  17741. uint8 dl_pkt_num;
  17742. uint8 client_num;
  17743. uint8 retx_cnt;
  17744. uint8 pwr_save;
  17745. uint8 auto_ba; /* automatic RX/TX BA session setup (no negotiation needed) */
  17746. uint8 if_index;
  17747. uint8 padding[3];
  17748. struct ether_addr multicast_addr;
  17749. struct ether_addr scheduler_addr;
  17750. } wl_llw_session_cfg_t;
  17751. /* WL_LLW_CMD_SESSION_DELETE, WL_LLW_CMD_SESSION_ENABLE, WL_LLW_CMD_SESSION_DISABLE, */
  17752. /* WL_LLW_CMD_SESSION_GET */
  17753. typedef struct wl_llw_session_cmd {
  17754. uint8 session_id;
  17755. uint8 padding[3];
  17756. } wl_llw_session_cmd_t;
  17757. /* LLW client config */
  17758. /* WL_LLW_CMD_CLIENT_ADD, WL_LLW_CMD_CLIENT_DELETE, WL_LLW_CMD_CLIENT_GET */
  17759. typedef struct wl_llw_client_cfg {
  17760. uint8 session_id;
  17761. uint8 client_id;
  17762. struct ether_addr mac;
  17763. } wl_llw_client_cfg_t;
  17764. /* Get list of session IDs from FW */
  17765. /* WL_LLW_CMD_SESSION_ID */
  17766. typedef struct llw_session_id_list {
  17767. uint8 id_count; /* Number of session IDs */
  17768. uint8 list[]; /* list of session IDs */
  17769. } llw_session_id_list_t;
  17770. /* LLW XTLV structures */
  17771. typedef struct wl_llw_iov_cmd {
  17772. uint16 version;
  17773. uint8 cmd_cnt;
  17774. uint8 pad;
  17775. uint8 cmds[];
  17776. } wl_llw_iov_cmd_t;
  17777. typedef struct wl_llw_iov_sub_cmd {
  17778. uint16 type;
  17779. uint16 len;
  17780. union {
  17781. int32 status; /* Processed status - Set by FW */
  17782. uint32 options; /* Command Process Options - Set by Host */
  17783. } u;
  17784. uint8 data[];
  17785. } wl_llw_iov_sub_cmd_t;
  17786. /* to be used in type field of wl_llw_iov_sub_cmd_t structure while issuing LLW commands */
  17787. typedef enum wl_llw_sub_cmd_xtlv_id {
  17788. WL_LLW_CMD_SESSION_ID,
  17789. WL_LLW_CMD_SESSION_CREATE,
  17790. WL_LLW_CMD_SESSION_DELETE,
  17791. WL_LLW_CMD_SESSION_UPDATE,
  17792. WL_LLW_CMD_SESSION_ENABLE,
  17793. WL_LLW_CMD_SESSION_DISABLE,
  17794. WL_LLW_CMD_SESSION_GET,
  17795. WL_LLW_CMD_CLIENT_ADD,
  17796. WL_LLW_CMD_CLIENT_DELETE,
  17797. WL_LLW_CMD_CLIENT_GET,
  17798. WL_LLW_CMD_FLOW_ADD,
  17799. WL_LLW_CMD_FLOW_DELETE,
  17800. WL_LLW_CMD_FLOW_GET,
  17801. WL_LLW_CMD_STATS
  17802. } wl_llw_sub_cmd_xtlv_id_t;
  17803. /* LLW stats */
  17804. typedef enum wl_llw_xtlv {
  17805. WL_LLW_XTLV_STATS
  17806. } wl_llw_xtlv_t;
  17807. typedef struct wl_llw_stats {
  17808. uint32 txpackets;
  17809. uint32 txbytes;
  17810. uint32 txrts;
  17811. uint32 txnocts;
  17812. uint32 txnoack;
  17813. uint32 txfail;
  17814. uint32 txretry;
  17815. uint32 txdropped;
  17816. uint32 tx_avg_q_time;
  17817. uint32 tx_min_q_time;
  17818. uint32 tx_max_q_time;
  17819. uint32 tx_avg_rem_lifetime;
  17820. uint32 tx_min_rem_lifetime;
  17821. uint32 tx_max_rem_lifetime;
  17822. uint32 rxpackets;
  17823. uint32 rxbytes;
  17824. uint32 rxfail;
  17825. uint32 rxretry;
  17826. uint32 txschedfrm;
  17827. uint32 retxschedfrm;
  17828. } wl_llw_stats_t;
  17829. typedef struct wl_llw_stats_hdr {
  17830. uint16 version;
  17831. uint16 stats_cnt;
  17832. uint32 tot_len;
  17833. uint8 stat_xtlvs[];
  17834. } wl_llw_stats_hdr_t;
  17835. /* WL_LLW_XTLV_STATS */
  17836. typedef struct wl_llw_stats_xtlv {
  17837. uint16 type;
  17838. uint16 len;
  17839. uint8 stats[];
  17840. } wl_llw_stats_xtlv_t;
  17841. /* WL_LLW_CMD_STATS */
  17842. typedef struct wl_llw_stats_cmd {
  17843. uint8 session_id;
  17844. uint8 client_id;
  17845. uint16 padding;
  17846. } wl_llw_stats_cmd_t;
  17847. /* LLW flow ring ID config */
  17848. /* WL_LLW_CMD_FLOW_ADD, WL_LLW_CMD_FLOW_DELETE, WL_LLW_CMD_FLOW_GET */
  17849. typedef struct wl_llw_flow_cfg {
  17850. uint8 session_id;
  17851. uint8 flow_id;
  17852. uint16 padding;
  17853. } wl_llw_flow_cfg_t;
  17854. #endif /* End of LLW Session */
  17855. #define WL_OMI_CONFIG_VERSION_1 1u
  17856. /* values for valid_bm */
  17857. #define OMI_CONFIG_VALID_BMP_RXNSS 0x0001u
  17858. #define OMI_CONFIG_VALID_BMP_BW 0x0002u
  17859. #define OMI_CONFIG_VALID_BMP_ULMU_DISABLE 0x0004u
  17860. #define OMI_CONFIG_VALID_BMP_TXNSTS 0x0008u
  17861. #define OMI_CONFIG_VALID_BMP_ERSU_DISABLE 0x0010u
  17862. #define OMI_CONFIG_VALID_BMP_DLMU_RSD_RCM 0x0020u
  17863. #define OMI_CONFIG_VALID_BMP_ULMU_DATA_DISABLE 0x0040u
  17864. #define OMI_CONFIG_VALID_BMP_ALL 0x0FFFu
  17865. #define OMI_CONFIG_BW_MAX 3u
  17866. typedef struct wl_omi_config {
  17867. uint16 valid_bm; /* validity bitmask for each config */
  17868. uint8 rxnss;
  17869. uint8 bw;
  17870. uint8 ulmu_disable;
  17871. uint8 txnsts;
  17872. uint8 ersu_disable;
  17873. uint8 dlmu_resound_rec;
  17874. uint8 ulmu_data_disable;
  17875. uint8 pad[3];
  17876. } wl_omi_config_t;
  17877. typedef struct wl_omi_req {
  17878. uint16 version;
  17879. uint16 len;
  17880. wl_omi_config_t config;
  17881. } wl_omi_req_v1_t;
  17882. /* Bits for ULMU disable reason */
  17883. #define OMI_ULMU_DISABLED_HOST 0x01u /* Host has disabled through he omi */
  17884. #define OMI_ULMU_DISABLED_AWDL 0x02u /* Disabled due to AWDL enabled */
  17885. #define OMI_ULMU_DISABLED_NAN 0x04u /* Disabled due to NAN enabled */
  17886. #define OMI_ULMU_DISABLED_BTCOEX 0x08u /* Disabled while in BT Coex activity */
  17887. #define OMI_ULMU_DISABLED_LTECOEX 0x10u /* Disabled due to LTE Coex activity */
  17888. #define OMI_ULMU_DISABLED_NON11AX_CONN 0x20u /* Disabled due to not associated to 11ax AP */
  17889. #define OMI_ULMU_DISABLED_THROTTLE_ENABLE 0x40u /* Disabled due to throttle timer running */
  17890. #define OMI_ULMU_DISABLED_TXCHAIN_DOWNGRADE 0x80u /* Disabled due to Txchain downgrade */
  17891. /* Bits for DLMU Resound Recommendation reason */
  17892. #define OMI_DLMU_RSD_RCM_HOST (0x1u << 0u) /* Host directly set the bit */
  17893. #define OMI_DLMU_RSD_RCM_MPF (0x1u << 1u) /* Set on MPF state change */
  17894. #define WL_OMI_STATUS_VERSION_1 1u
  17895. typedef struct wl_omi_status {
  17896. uint16 version;
  17897. uint16 len;
  17898. wl_omi_config_t omi_pending; /* OMI requests pending */
  17899. uint16 omi_data; /* current OM Control field for completed OMI requests */
  17900. uint16 ulmu_disable_reason; /* Bits representing UL OFDMA disable reasons */
  17901. uint32 ulmu_disable_duration; /* Duration (ms) for which UL OFDMA is disabled */
  17902. } wl_omi_status_v1_t;
  17903. #define WL_OMI_STATUS_VERSION_2 2u
  17904. typedef struct wl_omi_status_v2 {
  17905. uint16 version;
  17906. uint16 len;
  17907. wl_omi_config_t omi_pending; /* OMI requests pending */
  17908. uint16 omi_data; /* Current OM Control field for completed OMI requests */
  17909. uint16 ulmu_disable_reason; /* Bits representing UL OFDMA disable reasons */
  17910. uint32 ulmu_disable_duration; /* Duration (ms) for which UL OFDMA is disabled */
  17911. uint32 dlmu_rsd_rcm_duration; /* Dur (ms) for which ResoundRecommentation is set */
  17912. uint16 dlmu_rsd_rcm_mpf_state; /* The MPF state value */
  17913. uint16 dlmu_rsd_rcm_reason; /* DL MU-MIMO recommendation reasons bitmap */
  17914. } wl_omi_status_v2_t;
  17915. #define WL_ULMU_DISABLE_STATS_VERSION_1 1u
  17916. typedef struct wl_ulmu_disable_stats {
  17917. uint16 version;
  17918. uint16 len;
  17919. uint32 ulmu_disable_ts; /* UL OFDMA disabled timestamp (ms) */
  17920. uint16 ulmu_disable_reason; /* Bits representing UL OFDMA disable reasons */
  17921. uint16 ulmu_disable_count; /* UL MU disable count during current infra association */
  17922. uint32 last_trig_rx_ts; /* Last trigger frame received timestamp (ms) */
  17923. uint16 trig_rx_count; /* No of trigger frames received after last UL OFDMA disable */
  17924. uint16 max_latency; /* Max latency by AP to re-act for UL OFDMA disable request (ms) */
  17925. uint16 min_latency; /* Min latency by AP to re-act for UL OFDMA disable request (ms) */
  17926. uint16 avg_latency; /* Avg latency by AP to re-act for UL OFDMA disable request (ms) */
  17927. } wl_ulmu_disable_stats_v1_t;
  17928. /* sub-xtlv IDs within WL_STATS_XTLV_WL_SLICE_TX_HISTOGRAMS */
  17929. enum wl_tx_histogram_id {
  17930. WL_TX_HIST_TXQ_ID = 1,
  17931. WL_TX_HIST_LOW_TXQ_ID = 2,
  17932. WL_TX_HIST_SCBQ_ID = 3,
  17933. WL_TX_HIST_EXCUR_TXQ_ID = 4,
  17934. WL_TX_HIST_EXCUR_LOW_TXQ_ID = 5
  17935. };
  17936. /* common tx histogram structure */
  17937. typedef struct wl_tx_hist {
  17938. uint16 hist_bmap; /* bit N indicates histogram follows for priority or fifo N */
  17939. uint16 hist_count; /* count of histograms in var len array */
  17940. uint32 hist[1]; /* var len array of histograms each prefix by hist length */
  17941. } wl_tx_hist_t;
  17942. #define WL_TX_HIST_FIXED_LEN (OFFSETOF(wl_tx_hist_t, hist))
  17943. #define WL_TX_HIST_FULL_LEN(num_hist, max_hist_size) \
  17944. (WL_TX_HIST_FIXED_LEN + (num_hist) * \
  17945. (max_hist_size + 1) * sizeof(uint32))
  17946. /* structure for WL_TX_HIST_TXQ, WL_TX_HIST_EXCUR_TXQ_ID */
  17947. typedef struct wl_tx_hist_txq {
  17948. uint32 bsscfg_bmap; /* bitmap of bsscfg indexes associated with this queue */
  17949. wl_tx_hist_t tx_hist; /* tx histograms */
  17950. } wl_tx_hist_txq_t;
  17951. #define WL_TX_HIST_TXQ_FIXED_LEN \
  17952. (OFFSETOF(wl_tx_hist_txq_t, tx_hist) + WL_TX_HIST_FIXED_LEN)
  17953. #define WL_TX_HIST_TXQ_FULL_LEN(num_hist, max_hist_size) \
  17954. (OFFSETOF(wl_tx_hist_txq_t, tx_hist) + \
  17955. WL_TX_HIST_FULL_LEN(num_hist, max_hist_size))
  17956. /* sub-xtlv IDs within WL_STATS_XTLV_WL_SLICE_TX_HISTOGRAMS */
  17957. enum wl_txq_stop_histogram_id {
  17958. WL_TXQ_STOP_HIST_SW = 1,
  17959. WL_TXQ_STOP_HIST_HW = 2,
  17960. WL_TXQ_STOP_HIST_PKTS_SW = 3,
  17961. WL_TXQ_STOP_HIST_PKTS_HW = 4,
  17962. WL_TXQ_STOP_HIST_MAX = WL_TXQ_STOP_HIST_PKTS_HW
  17963. };
  17964. /* common tx histogram structure */
  17965. typedef struct wl_txq_stop_hist {
  17966. wl_tx_hist_t tx_hist; /* tx histograms */
  17967. } wl_txq_stop_hist_t;
  17968. #define WL_TXQ_STOP_HIST_FIXED_LEN \
  17969. (OFFSETOF(wl_txq_stop_hist_t, tx_hist) + WL_TX_HIST_FIXED_LEN)
  17970. #define WL_TXQ_STOP_HIST_FULL_LEN(num_hist, max_hist_size) \
  17971. (OFFSETOF(wl_txq_stop_hist_t, tx_hist) + \
  17972. WL_TX_HIST_FULL_LEN(num_hist, max_hist_size))
  17973. /* structure for WL_TX_HIST_LOW_TXQ, WL_TX_HIST_EXCUR_LOW_TXQ_ID */
  17974. typedef struct wl_tx_hist_low_txq {
  17975. wl_tx_hist_t tx_hist; /* tx histograms */
  17976. } wl_tx_hist_low_txq_t;
  17977. #define WL_TX_HIST_LOW_TXQ_FIXED_LEN \
  17978. (OFFSETOF(wl_tx_hist_low_txq_t, tx_hist) + WL_TX_HIST_FIXED_LEN)
  17979. #define WL_TX_HIST_LOW_TXQ_FULL_LEN(num_hist, max_hist_size) \
  17980. (OFFSETOF(wl_tx_hist_low_txq_t, tx_hist) + \
  17981. WL_TX_HIST_FULL_LEN(num_hist, max_hist_size))
  17982. /* structure for WL_TX_HIST_SCBQ */
  17983. typedef struct wl_tx_hist_scbq {
  17984. struct ether_addr ea; /* ether addr of peer */
  17985. uint16 bsscfg_idx; /* bsscfg index */
  17986. wl_tx_hist_t tx_hist; /* tx histograms */
  17987. } wl_tx_hist_scbq_t;
  17988. #define WL_TX_HIST_SCBQ_FIXED_LEN \
  17989. (OFFSETOF(wl_tx_hist_scbq_t, tx_hist) + WL_TX_HIST_FIXED_LEN)
  17990. #define WL_TX_HIST_SCBQ_FULL_LEN(num_hist, max_hist_size) \
  17991. (OFFSETOF(wl_tx_hist_scbq_t, tx_hist) + \
  17992. WL_TX_HIST_FULL_LEN(num_hist, max_hist_size))
  17993. /* sub-xtlv IDs within WL_STATS_XTLV_WL_SLICE_TX_QUEUE_DEPTH */
  17994. enum wl_tx_queue_depth_id {
  17995. WL_TX_QUEUE_DEPTH_TXQ_ID = 1,
  17996. WL_TX_QUEUE_DEPTH_LOW_TXQ_ID = 2,
  17997. WL_TX_QUEUE_DEPTH_SCBQ_ID = 3,
  17998. WL_TX_QUEUE_DEPTH_EXCUR_TXQ_ID = 4,
  17999. WL_TX_QUEUE_DEPTH_EXCUR_LOW_TXQ_ID = 5
  18000. };
  18001. /* common tx queue depth structure */
  18002. typedef struct wl_tx_queue_depth {
  18003. uint16 queue_depth_bmap; /* bitmap of queue depth in var len array */
  18004. uint16 queue_depth_count; /* count of queue depth in var len array */
  18005. uint16 queue_depth[1]; /* var len array of queue depth */
  18006. } wl_tx_queue_depth_t;
  18007. #define WL_TX_QUEUE_DEPTH_FIXED_LEN (OFFSETOF(wl_tx_queue_depth_t, queue_depth))
  18008. #define WL_TX_QUEUE_DEPTH_FULL_LEN(num_queue_depth) \
  18009. (WL_TX_QUEUE_DEPTH_FIXED_LEN + (num_queue_depth) * \
  18010. sizeof(uint16))
  18011. /* structure for WL_TX_QUEUE_DEPTH_TXQ_ID, WL_TX_QUEUE_DEPTH_EXCUR_TXQ_ID */
  18012. typedef struct wl_tx_queue_depth_txq {
  18013. uint32 bsscfg_map; /* bitmap of bsscfg indexes associated with this queue */
  18014. wl_tx_queue_depth_t tx_queue_depth; /* queue depth */
  18015. } wl_tx_queue_depth_txq_t;
  18016. #define WL_TX_QUEUE_DEPTH_TXQ_FIXED_LEN \
  18017. (OFFSETOF(wl_tx_queue_depth_txq_t, tx_queue_depth) + WL_TX_QUEUE_DEPTH_FIXED_LEN)
  18018. #define WL_TX_QUEUE_DEPTH_TXQ_FULL_LEN(num_queue_depth) \
  18019. (OFFSETOF(wl_tx_queue_depth_txq_t, tx_queue_depth) + \
  18020. WL_TX_QUEUE_DEPTH_FULL_LEN(num_queue_depth))
  18021. /* structure for WL_TX_QUEUE_DEPTH_LOW_TXQ_ID, WL_TX_QUEUE_DEPTH_EXCUR_LOW_TXQ_ID */
  18022. typedef struct wl_tx_queue_depth_low_txq {
  18023. wl_tx_queue_depth_t tx_queue_depth; /* queue depth */
  18024. } wl_tx_queue_depth_low_txq_t;
  18025. #define WL_TX_QUEUE_DEPTH_LOW_TXQ_FIXED_LEN \
  18026. (OFFSETOF(wl_tx_queue_depth_low_txq_t, tx_queue_depth) + WL_TX_QUEUE_DEPTH_FIXED_LEN)
  18027. #define WL_TX_QUEUE_DEPTH_LOW_TXQ_FULL_LEN(num_queue_depth) \
  18028. (OFFSETOF(wl_tx_queue_depth_low_txq_t, tx_queue_depth) + \
  18029. WL_TX_QUEUE_DEPTH_FULL_LEN(num_queue_depth))
  18030. /* structure for WL_TX_QUEUE_DEPTH_SCBQ_ID */
  18031. typedef struct wl_tx_queue_depth_scbq {
  18032. struct ether_addr ea; /* ether addr of peer */
  18033. uint16 bsscfg_idx; /* bsscfg index */
  18034. wl_tx_queue_depth_t tx_queue_depth; /* queue depth */
  18035. } wl_tx_queue_depth_scbq_t;
  18036. #define WL_TX_QUEUE_DEPTH_SCBQ_FIXED_LEN \
  18037. (OFFSETOF(wl_tx_queue_depth_scbq_t, tx_queue_depth) + WL_TX_QUEUE_DEPTH_FIXED_LEN)
  18038. #define WL_TX_QUEUE_DEPTH_SCBQ_FULL_LEN(num_queue_depth) \
  18039. (OFFSETOF(wl_tx_queue_depth_scbq_t, tx_queue_depth) + \
  18040. WL_TX_QUEUE_DEPTH_FULL_LEN(num_queue_depth))
  18041. /* sub-xtlv IDs within WL_STATS_XTLV_BUS_PCIE_TX_HISTOGRAMS */
  18042. enum wl_pcie_tx_histogram_id {
  18043. WL_PCIE_TX_HIST_ID = 1
  18044. };
  18045. /* structure for PCIE_TX_HIST_ID */
  18046. typedef struct wl_pcie_tx_hist {
  18047. uint16 ring_id; /* PCIe ring id */
  18048. uint16 pad; /* 4-byte alignment */
  18049. wl_tx_hist_t tx_hist; /* hist_bmap:
  18050. * 0x1=tx histogram
  18051. * 0x2=tx status pending histogram
  18052. */
  18053. } wl_pcie_tx_hist_t;
  18054. #define WL_PCIE_TX_HIST_FIXED_LEN \
  18055. (OFFSETOF(wl_pcie_tx_hist_t, tx_hist) + WL_TX_HIST_FIXED_LEN)
  18056. #define WL_PCIE_TX_HIST_FULL_LEN(num_hist, max_hist_size) \
  18057. (OFFSETOF(wl_pcie_tx_hist_t, tx_hist) + \
  18058. WL_TX_HIST_FULL_LEN(num_hist, max_hist_size))
  18059. /* sub-xtlv IDs within WL_STATS_XTLV_BUS_PCIE_TX_QUEUE_DEPTH */
  18060. enum wl_pcie_tx_queue_depth_id {
  18061. WL_PCIE_TX_QUEUE_DEPTH_ID = 1
  18062. };
  18063. /* structure for WL_PCIE_TX_QUEUE_DEPTH_ID */
  18064. typedef struct wl_pcie_tx_queue_depth {
  18065. uint16 ring_id; /* PCIe ring id */
  18066. uint16 queue_depth; /* queue depth of ring id */
  18067. uint16 tx_status_pend; /* tx status pending of ring id */
  18068. uint16 pad; /* 4-byte alignment */
  18069. } wl_pcie_tx_queue_depth_t;
  18070. #define WL_PCIE_TX_QUEUE_DEPTH_FIXED_LEN sizeof(wl_pcie_tx_queue_depth_t)
  18071. #define WL_WSEC_DEL_PMK_VER_V1 1u
  18072. /* tlv ids for del pmk */
  18073. #define WL_DEL_PMK_TLV_ID 1u
  18074. #define WL_DEL_PMKID_TLV_ID 2u
  18075. #define WL_DEL_PEER_ADDR_TLV_ID 3u
  18076. typedef struct wl_wsec_del_pmk {
  18077. uint16 version;
  18078. uint16 length;
  18079. uint8 xtlvs[];
  18080. } wl_wsec_del_pmk_t;
  18081. #define WL_WSEC_DEL_PMK_FIXED_LEN_V1 OFFSETOF(wl_wsec_del_pmk_t, xtlvs)
  18082. #define WLC_SILENT_ROAM_VER_1 1
  18083. /* silent roam information struct */
  18084. typedef struct wlc_sroam_info_v1 {
  18085. /* Silent roam Set/Get value */
  18086. uint8 sroam_on; /* sroam on/off */
  18087. int8 sroam_min_rssi; /* minimum rssi threshold to activate the feature */
  18088. uint8 sroam_rssi_range; /* rssi tolerance to determine stationary status */
  18089. uint8 sroam_score_delta; /* roam score delta value to prune candidate ap */
  18090. uint8 sroam_period_time; /* required monitoring period to trigger roaming scan */
  18091. uint8 sroam_band; /* band setting of roaming scan (all, 5g, 2g) */
  18092. uint8 sroam_inact_cnt; /* tx/rx frame count threshold for checking inactivity */
  18093. /* Silent roam monitor value */
  18094. int8 sroam_ref_rssi; /* reference rssi which is picked when monitoring is
  18095. * started. it is updated to current rssi when it's
  18096. * out from rssi range
  18097. */
  18098. uint8 sroam_time_since; /* elapsed time since start monitoring */
  18099. uint8 pad[3];
  18100. uint32 sroam_txfrm_prev; /* save current tx frame counts */
  18101. uint32 sroam_rxfrm_prev; /* save current rx frame counts */
  18102. } wlc_sroam_info_v1_t;
  18103. typedef struct wlc_sroam {
  18104. uint16 ver;
  18105. uint16 len;
  18106. uint8 data[];
  18107. } wlc_sroam_t;
  18108. #define WLC_SILENT_ROAM_CUR_VER WLC_SILENT_ROAM_VER_1
  18109. #define SROAM_HDRLEN 4u
  18110. #define DEF_SROAM_OFF 0
  18111. #define DEF_SROAM_MIN_RSSI -65
  18112. #define DEF_SROAM_RSSI_RANGE 3u
  18113. #define DEF_SROAM_SCORE_DELTA 1u
  18114. #define DEF_SROAM_PERIOD_TIME 10u
  18115. #define DEF_SROAM_INACT_CNT 5u
  18116. #define MAX_SROAM_RSSI -70
  18117. #define MAX_SROAM_RSSI_RANGE 5u
  18118. #define MAX_SROAM_SCORE_DELTA 10u
  18119. #define MAX_SROAM_PERIOD_TIME 250u
  18120. #define SROAM_BAND_AUTO 3u
  18121. /* MACSMPL IOVAR parameters */
  18122. typedef enum wl_macdbg_macsmpl_iovar_id {
  18123. WL_MACSMPL_START = 0,
  18124. WL_MACSMPL_STOP = 1,
  18125. WL_MACSMPL_DUMP = 2,
  18126. WL_MACSMPL_STATUS = 3,
  18127. WL_MACSMPL_SIZE = 4
  18128. } wl_macdbg_macsmpl_iovar_id_t;
  18129. /* WL_MACSMPL_STATUS values */
  18130. typedef enum wl_macdbg_macsmpl_status {
  18131. WL_MACSMPL_STATUS_IDLE = 0,
  18132. WL_MACSMPL_STATUS_ACTIVE = 1,
  18133. WL_MACSMPL_STATUS_WAIT_FOR_TRIG = 2,
  18134. WL_MACSMPL_STATUS_TRIGGERED = 3
  18135. } wl_macdbg_macsmpl_status_t;
  18136. /* WL_MACSMPL_START_PARAM subcommand data */
  18137. typedef struct wl_macsmpl_start_param {
  18138. uint32 trig_condition; /* trigger condition */
  18139. uint16 gpio_mux; /* MACControl1 GPIOSel field */
  18140. uint8 pad[2]; /* 4-byte struct alignment */
  18141. } wl_macsmpl_param_start_t;
  18142. /* MAC SC fragment request data */
  18143. typedef struct wl_macsmpl_frag_req_param {
  18144. uint32 offset; /* requested MAC SC fragment offset */
  18145. uint32 size; /* requested MAC SC fragment size, bytes */
  18146. } wl_macsmpl_frag_req_param_t;
  18147. /* MAC SC fragment response data */
  18148. typedef struct wl_macsmpl_frag_resp_param {
  18149. uint32 offset; /* MAC SC response fragment offset */
  18150. uint32 size; /* MAC SC reponse fragment size, bytes */
  18151. uint8 data[]; /* MAC SC response fragment data, flexible array */
  18152. } wl_macsmpl_frag_resp_param_t;
  18153. /* MAC SC status data */
  18154. typedef struct wl_macsmpl_status {
  18155. uint32 maccontrol1; /* MACControl1 register value */
  18156. uint32 macsc_flags; /* M_MACSC_FLAGS SHM register value */
  18157. uint16 sc_play_ctrl; /* TXE SampleCollectPlayCtrl register value */
  18158. uint16 sc_cur_ptr; /* TXE SampleCollectCurPtr register value */
  18159. uint16 sc_start_ptr; /* TXE SampleCollectStartPtr register value */
  18160. uint16 sc_stop_ptr; /* TXE SampleCollectStopPtr register value */
  18161. } wl_macsmpl_status_t;
  18162. /* WL_MACSMPL parameters data */
  18163. typedef struct wl_macsmpl_param {
  18164. wl_macdbg_macsmpl_iovar_id_t subcmd_id;
  18165. union {
  18166. wl_macsmpl_param_start_t start;
  18167. wl_macsmpl_frag_req_param_t frag_req;
  18168. } u;
  18169. } wl_macsmpl_param_t;
  18170. /* High priority P2P */
  18171. #define WL_HP2P_COUNTERS_VER 2u
  18172. typedef struct hp2p_counters {
  18173. uint16 frames_queued;
  18174. uint16 frames_processed;
  18175. uint16 frames_exp;
  18176. uint16 frames_preempt;
  18177. uint16 frames_retried;
  18178. uint16 reserved; /* reserved, rsvd2 and rsvd3 are experimental counters */
  18179. uint16 rsvd2;
  18180. uint16 rsvd3;
  18181. } hp2p_counters_t;
  18182. typedef struct hp2p_counters_v2 {
  18183. uint32 frames_queued; /* Number of AMPDUs processed */
  18184. uint16 frames_exp; /* Number of Lifetime expiries */
  18185. uint16 edt_retry; /* Exceed due to - retry */
  18186. uint16 mpif_reconf; /* MPIF Reconfigure */
  18187. uint16 exceed_delay; /* Exceed delay threshold */
  18188. uint16 edt_nav_thresh; /* Exceed due to - NAV threshold */
  18189. uint16 edt_dc_def; /* Exceed due to - DC based deferral */
  18190. uint16 edt_tx_fifo_full; /* Exceed due to - Tx FIFO full */
  18191. uint16 edt_cts_thresh; /* Exceed due to - CTS threshold */
  18192. uint16 dbg1; /* dbgX are for internal debugging */
  18193. uint16 dbg2;
  18194. uint16 dbg3;
  18195. uint16 dbg4;
  18196. uint16 dbg5;
  18197. uint16 dbg6;
  18198. uint16 dbg7;
  18199. uint16 dbg8;
  18200. uint16 dbg9;
  18201. uint16 dbg10;
  18202. } hp2p_counters_v2_t;
  18203. typedef struct hp2p_counters_hdr {
  18204. uint16 version; /* version of hp2p_counters_t structure */
  18205. uint16 len;
  18206. uint16 slice_idx;
  18207. uint16 pad;
  18208. uint8 counters[];
  18209. } hp2p_counters_hdr_t;
  18210. /* TX enable flags */
  18211. #define WL_HP2P_TX_AMPDU 0x0001u
  18212. #define WL_HP2P_TX_AMSDU 0x0002u
  18213. #define WL_HP2P_TX_RDG 0x0004u
  18214. /* RX enable flags */
  18215. #define WL_HP2P_RX_AMPDU 0x0001u
  18216. #define WL_HP2P_RX_AMSDU 0x0002u
  18217. #define WL_HP2P_RX_RDG 0x0004u
  18218. #define WL_HP2P_RX_AMPDU_REORDER 0x0008u
  18219. /* Max/min values for configuration parameters to check validity */
  18220. #define WL_HP2P_MAX_RETRY_MAX 14u
  18221. #define WL_HP2P_MAX_RETRY_MIN 6u
  18222. #define WL_HP2P_LATENCY_TARGET_MAX 30u
  18223. #define WL_HP2P_BURST_INTERVAL_MAX 64u
  18224. #define WL_HP2P_MAX_FIFO 5u
  18225. #define WL_HP2P_MAX_UCODE_LATENCY_THR 500u
  18226. #define WL_HP2P_MAX_UCODE_RECOV_TO 500u
  18227. #define WL_HP2P_MAX_UCODE_NAV_THR 50000u
  18228. #define WL_HP2P_VERSION 1u
  18229. typedef struct hp2p_tx_config {
  18230. struct ether_addr peer_addr;
  18231. uint16 max_burst;
  18232. uint16 txop; /* stored in network order (ls octet first) */
  18233. uint16 flags; /* flags to enable/disable AMPDU, AMSDU, RDG */
  18234. uint8 aci;
  18235. uint8 ecw;
  18236. uint8 fifo;
  18237. uint8 tid;
  18238. uint8 burst_interval;
  18239. uint8 latency_target;
  18240. uint8 max_retry;
  18241. uint8 pad;
  18242. } hp2p_tx_config_t;
  18243. typedef struct hp2p_rx_config {
  18244. struct ether_addr peer_addr;
  18245. uint16 flags; /* flags to enable/disable AMPDU, AMSDU, RDG, AMPDU Reorder */
  18246. uint8 tid;
  18247. uint8 pad[3];
  18248. } hp2p_rx_config_t;
  18249. typedef struct hp2p_udbg_config {
  18250. uint16 recovery_timeout; /* multiples of 256 usecs */
  18251. uint16 latency_thresh; /* multiples of 256 usecs */
  18252. uint16 enable_trap; /* trap if ucode delay exceeds latency_thresh */
  18253. uint16 nav_thresh; /* in usec */
  18254. } hp2p_udbg_config_t;
  18255. typedef struct hp2p_cmd {
  18256. uint16 type;
  18257. uint16 len;
  18258. uint8 data[];
  18259. } hp2p_cmd_t;
  18260. typedef struct hp2p_cmd_hdr {
  18261. uint16 version;
  18262. uint16 slice_idx;
  18263. uint8 cmd[];
  18264. } hp2p_cmd_hdr_t;
  18265. /* to be used in type field of hp2p_cmd_t structure while issuing HP2P commands */
  18266. typedef enum hp2p_cmd_id {
  18267. WL_HP2P_CMD_ENABLE = 0,
  18268. WL_HP2P_CMD_TX_CONFIG = 1,
  18269. WL_HP2P_CMD_RX_CONFIG = 2,
  18270. WL_HP2P_CMD_COUNTERS = 3,
  18271. WL_HP2P_CMD_UDBG_CONFIG = 4
  18272. } hp2p_cmd_id_t;
  18273. typedef enum wl_rffe_cmd_type {
  18274. WL_RFFE_CMD_DEBUG_MODE = 0,
  18275. WL_RFFE_CMD_ELNABYP_MODE = 1,
  18276. WL_RFFE_CMD_REG = 2,
  18277. WL_RFFE_CMD_LAST
  18278. } wl_rffe_cmd_type_t;
  18279. /** RFFE struct passed through ioctl */
  18280. typedef struct {
  18281. uint32 regaddr; /**< rFEM_RegAddr */
  18282. uint32 antnum; /**< rFEM AntNum */
  18283. uint32 slaveid; /**< rFEM SlaveID */
  18284. uint32 value; /**< read/write value */
  18285. } rffe_reg_t;
  18286. #ifndef BCMUTILS_ERR_CODES
  18287. /*
  18288. * SOE (Security Offload Engine) status codes.
  18289. */
  18290. /* SOE status codes are reserved from -6144 to -7167 (1K) */
  18291. enum wl_soe_status {
  18292. /* Invalid operational context */
  18293. WL_SOE_E_BAD_OP_CONTEXT = -6144,
  18294. /* Invalid operational type */
  18295. WL_SOE_E_BAD_OP_TYPE = -6145,
  18296. /* Failure to get NAF3 encoded scalar */
  18297. WL_SOE_E_BN_GET_NAF3_ERROR = -6146,
  18298. /* Failure to get NAF3 params */
  18299. WL_SOE_E_ECG_GET_NAF3_PARAMS_ERROR = -6147,
  18300. /* FAILURE to get Montgomery params */
  18301. WL_SOE_E_MONT_PARAMS_GET_ERROR = -6148,
  18302. /* Invalid OSL handle */
  18303. WL_SOE_E_BAD_SI_OSH = -6149,
  18304. /* Invalid ECG group */
  18305. WL_SOE_E_BAD_ECG_GROUP = -6150,
  18306. /* Invalid BN context */
  18307. WL_SOE_E_BAD_BN_CTX = -6151,
  18308. /* Invalid SOE core register base address */
  18309. WL_SOE_E_BAD_SOE_REGBASE = -6152,
  18310. /* Invalid SOE context */
  18311. WL_SOE_E_BAD_SOE_CONTXT = -6153,
  18312. /* Number of words are too short (i.e., not enough
  18313. * room to encode the PKA sequence)
  18314. */
  18315. WL_SOE_E_PKA_SEQUENCE_WORDS_TOO_SHORT = -6154,
  18316. /* Generic bn_get error */
  18317. WL_SOE_E_PKA_BN_GET_ERROR = -6155,
  18318. /* Sequence buf too short for BN */
  18319. WL_SOE_E_PKA_BN_BUF_TOO_SHORT_BN = -6156,
  18320. /* Sequence buf too short for ECG prime */
  18321. WL_SOE_E_PKA_BN_BUF_TOO_SHORT_ECG_PRIME = -6157,
  18322. /* Sequence buf too short for Montgomery N' */
  18323. WL_SOE_E_PKA_SEQ_BUF_TOO_SHORT_MONT_PRIME = -6158,
  18324. /* Sequence buf too short for Accumulator registers */
  18325. WL_SOE_E_PKA_SEQ_BUF_TOO_SHORT_ACCM_REG = -6159,
  18326. /* Sequence buf too short for the point P */
  18327. WL_SOE_E_PKA_SEQ_BUF_TOO_SHORT_P = -6160,
  18328. /* Sequence buf too short for -P */
  18329. WL_SOE_E_PKA_SEQ_BUF_TOO_SHORT_PN = -6161,
  18330. /* Sequence buf too short for 3P */
  18331. WL_SOE_E_PKA_SEQ_BUF_TOO_SHORT_3P = -6162,
  18332. /* Sequence buf too short for -3P */
  18333. WL_SOE_E_PKA_SEQ_BUF_TOO_SHORT_3PN = -6163,
  18334. /* Sequence buf too short for NAF3 scalar */
  18335. WL_SOE_E_PKA_SEQ_BUF_TOO_SHORT_NAF3_SCALAR = -6164,
  18336. /* Sequence buf too short for load shift count */
  18337. WL_SOE_E_PKA_SEQ_BUF_TOO_SHORT_PRE_JMP = -6165,
  18338. /* SOE engine(SHA/PKA) failed to complete the operation */
  18339. WL_SOE_E_ENGINE_UNABLE_TO_COMPLETE = -6166,
  18340. /* Wrong LIR (Long Integer Register) type */
  18341. WL_SOE_E_PKA_BAD_LIR_TYPE = -6167,
  18342. /* Reference count has reached maximum */
  18343. WL_SOE_E_MAX_REF_COUNT_REACHED = -6168,
  18344. /* Failed to get the SOE context reference */
  18345. WL_SOE_E_GET_REF_FAILED = -6169,
  18346. /* Incoming digest length is invalid */
  18347. WL_SOE_E_SHA_WRONG_DIGEST_LEN = -6170
  18348. };
  18349. #endif /* BCMUTILS_ERR_CODES */
  18350. #define NR5GCX_STATUS_VER_1 1
  18351. /* NR coex status structures */
  18352. typedef struct wlc_nr5gcx_status_v1 {
  18353. uint16 version; /* version info */
  18354. uint16 len; /* status length */
  18355. uint32 mode; /* NR coex status */
  18356. uint32 nr_req_cnt; /* NR req number since last read */
  18357. uint32 nr_dur; /* NR duration since last read, us */
  18358. uint32 nr_duty_cycle; /* NR duty cycle since last read */
  18359. uint32 nr_max_dur; /* NR max duration in a single request */
  18360. uint32 wlan_crit_cnt; /* aggregated # of WLAN critical events */
  18361. uint32 wlan_crit_dur; /* aggregated WLAN critical event duration, ms */
  18362. uint32 wlan_crit_max_dur; /* Duration of the WLAN critical events whose dur is max */
  18363. uint16 wlan_crit_evt_bitmap; /* WLAN critical event occurrence bitmap,
  18364. * 1 event per bit.
  18365. */
  18366. uint16 wlan_crit_max_evt_type; /* The event type of the WLAN critical
  18367. * event whose dur is max
  18368. */
  18369. } wlc_nr5gcx_status_v1_t;
  18370. #endif /* _wlioctl_h_ */