driver.h 163 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443
  1. /*
  2. * Driver interface definition
  3. * Copyright (c) 2003-2017, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. *
  8. * This file defines a driver interface used by both %wpa_supplicant and
  9. * hostapd. The first part of the file defines data structures used in various
  10. * driver operations. This is followed by the struct wpa_driver_ops that each
  11. * driver wrapper will beed to define with callback functions for requesting
  12. * driver operations. After this, there are definitions for driver event
  13. * reporting with wpa_supplicant_event() and some convenience helper functions
  14. * that can be used to report events.
  15. */
  16. #ifndef DRIVER_H
  17. #define DRIVER_H
  18. #define WPA_SUPPLICANT_DRIVER_VERSION 4
  19. #include "common/defs.h"
  20. #include "common/ieee802_11_defs.h"
  21. #include "common/wpa_common.h"
  22. #ifdef CONFIG_MACSEC
  23. #include "pae/ieee802_1x_kay.h"
  24. #endif /* CONFIG_MACSEC */
  25. #include "utils/list.h"
  26. #define HOSTAPD_CHAN_DISABLED 0x00000001
  27. #define HOSTAPD_CHAN_NO_IR 0x00000002
  28. #define HOSTAPD_CHAN_RADAR 0x00000008
  29. #define HOSTAPD_CHAN_HT40PLUS 0x00000010
  30. #define HOSTAPD_CHAN_HT40MINUS 0x00000020
  31. #define HOSTAPD_CHAN_HT40 0x00000040
  32. #define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080
  33. #define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
  34. #define HOSTAPD_CHAN_DFS_USABLE 0x00000100
  35. #define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
  36. #define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
  37. #define HOSTAPD_CHAN_DFS_MASK 0x00000300
  38. #define HOSTAPD_CHAN_VHT_10_70 0x00000800
  39. #define HOSTAPD_CHAN_VHT_30_50 0x00001000
  40. #define HOSTAPD_CHAN_VHT_50_30 0x00002000
  41. #define HOSTAPD_CHAN_VHT_70_10 0x00004000
  42. #define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
  43. #define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
  44. #define HOSTAPD_CHAN_VHT_10_150 0x00100000
  45. #define HOSTAPD_CHAN_VHT_30_130 0x00200000
  46. #define HOSTAPD_CHAN_VHT_50_110 0x00400000
  47. #define HOSTAPD_CHAN_VHT_70_90 0x00800000
  48. #define HOSTAPD_CHAN_VHT_90_70 0x01000000
  49. #define HOSTAPD_CHAN_VHT_110_50 0x02000000
  50. #define HOSTAPD_CHAN_VHT_130_30 0x04000000
  51. #define HOSTAPD_CHAN_VHT_150_10 0x08000000
  52. /* Filter gratuitous ARP */
  53. #define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
  54. /* Filter unsolicited Neighbor Advertisement */
  55. #define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
  56. /* Filter unicast IP packets encrypted using the GTK */
  57. #define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
  58. #define HOSTAPD_DFS_REGION_FCC 1
  59. #define HOSTAPD_DFS_REGION_ETSI 2
  60. #define HOSTAPD_DFS_REGION_JP 3
  61. /**
  62. * enum reg_change_initiator - Regulatory change initiator
  63. */
  64. enum reg_change_initiator {
  65. REGDOM_SET_BY_CORE,
  66. REGDOM_SET_BY_USER,
  67. REGDOM_SET_BY_DRIVER,
  68. REGDOM_SET_BY_COUNTRY_IE,
  69. REGDOM_BEACON_HINT,
  70. };
  71. /**
  72. * enum reg_type - Regulatory change types
  73. */
  74. enum reg_type {
  75. REGDOM_TYPE_UNKNOWN,
  76. REGDOM_TYPE_COUNTRY,
  77. REGDOM_TYPE_WORLD,
  78. REGDOM_TYPE_CUSTOM_WORLD,
  79. REGDOM_TYPE_INTERSECTION,
  80. };
  81. /**
  82. * struct hostapd_channel_data - Channel information
  83. */
  84. struct hostapd_channel_data {
  85. /**
  86. * chan - Channel number (IEEE 802.11)
  87. */
  88. short chan;
  89. /**
  90. * freq - Frequency in MHz
  91. */
  92. int freq;
  93. /**
  94. * flag - Channel flags (HOSTAPD_CHAN_*)
  95. */
  96. int flag;
  97. /**
  98. * max_tx_power - Regulatory transmit power limit in dBm
  99. */
  100. u8 max_tx_power;
  101. /**
  102. * survey_list - Linked list of surveys (struct freq_survey)
  103. */
  104. struct dl_list survey_list;
  105. /**
  106. * min_nf - Minimum observed noise floor, in dBm, based on all
  107. * surveyed channel data
  108. */
  109. s8 min_nf;
  110. #ifdef CONFIG_ACS
  111. /**
  112. * interference_factor - Computed interference factor on this
  113. * channel (used internally in src/ap/acs.c; driver wrappers do not
  114. * need to set this)
  115. */
  116. long double interference_factor;
  117. #endif /* CONFIG_ACS */
  118. /**
  119. * dfs_cac_ms - DFS CAC time in milliseconds
  120. */
  121. unsigned int dfs_cac_ms;
  122. };
  123. #define HE_MAX_NUM_SS 8
  124. #define HE_MAX_PHY_CAPAB_SIZE 3
  125. /**
  126. * struct he_ppe_threshold - IEEE 802.11ax HE PPE Threshold
  127. */
  128. struct he_ppe_threshold {
  129. u32 numss_m1;
  130. u32 ru_count;
  131. u32 ppet16_ppet8_ru3_ru0[HE_MAX_NUM_SS];
  132. };
  133. /**
  134. * struct he_capabilities - IEEE 802.11ax HE capabilities
  135. */
  136. struct he_capabilities {
  137. u8 he_supported;
  138. u32 phy_cap[HE_MAX_PHY_CAPAB_SIZE];
  139. u32 mac_cap;
  140. u32 mcs;
  141. struct he_ppe_threshold ppet;
  142. };
  143. #define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
  144. #define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
  145. /**
  146. * struct hostapd_hw_modes - Supported hardware mode information
  147. */
  148. struct hostapd_hw_modes {
  149. /**
  150. * mode - Hardware mode
  151. */
  152. enum hostapd_hw_mode mode;
  153. /**
  154. * num_channels - Number of entries in the channels array
  155. */
  156. int num_channels;
  157. /**
  158. * channels - Array of supported channels
  159. */
  160. struct hostapd_channel_data *channels;
  161. /**
  162. * num_rates - Number of entries in the rates array
  163. */
  164. int num_rates;
  165. /**
  166. * rates - Array of supported rates in 100 kbps units
  167. */
  168. int *rates;
  169. /**
  170. * ht_capab - HT (IEEE 802.11n) capabilities
  171. */
  172. u16 ht_capab;
  173. /**
  174. * mcs_set - MCS (IEEE 802.11n) rate parameters
  175. */
  176. u8 mcs_set[16];
  177. /**
  178. * a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
  179. */
  180. u8 a_mpdu_params;
  181. /**
  182. * vht_capab - VHT (IEEE 802.11ac) capabilities
  183. */
  184. u32 vht_capab;
  185. /**
  186. * vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
  187. */
  188. u8 vht_mcs_set[8];
  189. unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
  190. /**
  191. * he_capab - HE (IEEE 802.11ax) capabilities
  192. */
  193. struct he_capabilities he_capab;
  194. };
  195. #define IEEE80211_MODE_INFRA 0
  196. #define IEEE80211_MODE_IBSS 1
  197. #define IEEE80211_MODE_AP 2
  198. #define IEEE80211_MODE_MESH 5
  199. #define IEEE80211_CAP_ESS 0x0001
  200. #define IEEE80211_CAP_IBSS 0x0002
  201. #define IEEE80211_CAP_PRIVACY 0x0010
  202. #define IEEE80211_CAP_RRM 0x1000
  203. /* DMG (60 GHz) IEEE 802.11ad */
  204. /* type - bits 0..1 */
  205. #define IEEE80211_CAP_DMG_MASK 0x0003
  206. #define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
  207. #define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
  208. #define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */
  209. #define WPA_SCAN_QUAL_INVALID BIT(0)
  210. #define WPA_SCAN_NOISE_INVALID BIT(1)
  211. #define WPA_SCAN_LEVEL_INVALID BIT(2)
  212. #define WPA_SCAN_LEVEL_DBM BIT(3)
  213. #define WPA_SCAN_ASSOCIATED BIT(5)
  214. /**
  215. * struct wpa_scan_res - Scan result for an BSS/IBSS
  216. * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
  217. * @bssid: BSSID
  218. * @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
  219. * @beacon_int: beacon interval in TUs (host byte order)
  220. * @caps: capability information field in host byte order
  221. * @qual: signal quality
  222. * @noise: noise level
  223. * @level: signal level
  224. * @tsf: Timestamp
  225. * @age: Age of the information in milliseconds (i.e., how many milliseconds
  226. * ago the last Beacon or Probe Response frame was received)
  227. * @est_throughput: Estimated throughput in kbps (this is calculated during
  228. * scan result processing if left zero by the driver wrapper)
  229. * @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
  230. * @parent_tsf: Time when the Beacon/Probe Response frame was received in terms
  231. * of TSF of the BSS specified by %tsf_bssid.
  232. * @tsf_bssid: The BSS that %parent_tsf TSF time refers to.
  233. * @ie_len: length of the following IE field in octets
  234. * @beacon_ie_len: length of the following Beacon IE field in octets
  235. *
  236. * This structure is used as a generic format for scan results from the
  237. * driver. Each driver interface implementation is responsible for converting
  238. * the driver or OS specific scan results into this format.
  239. *
  240. * If the driver does not support reporting all IEs, the IE data structure is
  241. * constructed of the IEs that are available. This field will also need to
  242. * include SSID in IE format. All drivers are encouraged to be extended to
  243. * report all IEs to make it easier to support future additions.
  244. *
  245. * This structure data is followed by ie_len octets of IEs from Probe Response
  246. * frame (or if the driver does not indicate source of IEs, these may also be
  247. * from Beacon frame). After the first set of IEs, another set of IEs may follow
  248. * (with beacon_ie_len octets of data) if the driver provides both IE sets.
  249. */
  250. struct wpa_scan_res {
  251. unsigned int flags;
  252. u8 bssid[ETH_ALEN];
  253. int freq;
  254. u16 beacon_int;
  255. u16 caps;
  256. int qual;
  257. int noise;
  258. int level;
  259. u64 tsf;
  260. unsigned int age;
  261. unsigned int est_throughput;
  262. int snr;
  263. u64 parent_tsf;
  264. u8 tsf_bssid[ETH_ALEN];
  265. size_t ie_len;
  266. size_t beacon_ie_len;
  267. /* Followed by ie_len + beacon_ie_len octets of IE data */
  268. };
  269. /**
  270. * struct wpa_scan_results - Scan results
  271. * @res: Array of pointers to allocated variable length scan result entries
  272. * @num: Number of entries in the scan result array
  273. * @fetch_time: Time when the results were fetched from the driver
  274. */
  275. struct wpa_scan_results {
  276. struct wpa_scan_res **res;
  277. size_t num;
  278. struct os_reltime fetch_time;
  279. };
  280. /**
  281. * struct wpa_interface_info - Network interface information
  282. * @next: Pointer to the next interface or NULL if this is the last one
  283. * @ifname: Interface name that can be used with init() or init2()
  284. * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
  285. * not available
  286. * @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
  287. * is not an allocated copy, i.e., get_interfaces() caller will not free
  288. * this)
  289. */
  290. struct wpa_interface_info {
  291. struct wpa_interface_info *next;
  292. char *ifname;
  293. char *desc;
  294. const char *drv_name;
  295. };
  296. #define WPAS_MAX_SCAN_SSIDS 16
  297. /**
  298. * struct wpa_driver_scan_ssid - SSIDs to scan for
  299. * @ssid - specific SSID to scan for (ProbeReq)
  300. * %NULL or zero-length SSID is used to indicate active scan
  301. * with wildcard SSID.
  302. * @ssid_len - Length of the SSID in octets
  303. */
  304. struct wpa_driver_scan_ssid {
  305. const u8 *ssid;
  306. size_t ssid_len;
  307. };
  308. /**
  309. * struct wpa_driver_scan_params - Scan parameters
  310. * Data for struct wpa_driver_ops::scan2().
  311. */
  312. struct wpa_driver_scan_params {
  313. /**
  314. * ssids - SSIDs to scan for
  315. */
  316. struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
  317. /**
  318. * num_ssids - Number of entries in ssids array
  319. * Zero indicates a request for a passive scan.
  320. */
  321. size_t num_ssids;
  322. /**
  323. * extra_ies - Extra IE(s) to add into Probe Request or %NULL
  324. */
  325. const u8 *extra_ies;
  326. /**
  327. * extra_ies_len - Length of extra_ies in octets
  328. */
  329. size_t extra_ies_len;
  330. /**
  331. * freqs - Array of frequencies to scan or %NULL for all frequencies
  332. *
  333. * The frequency is set in MHz. The array is zero-terminated.
  334. */
  335. int *freqs;
  336. /**
  337. * filter_ssids - Filter for reporting SSIDs
  338. *
  339. * This optional parameter can be used to request the driver wrapper to
  340. * filter scan results to include only the specified SSIDs. %NULL
  341. * indicates that no filtering is to be done. This can be used to
  342. * reduce memory needs for scan results in environments that have large
  343. * number of APs with different SSIDs.
  344. *
  345. * The driver wrapper is allowed to take this allocated buffer into its
  346. * own use by setting the pointer to %NULL. In that case, the driver
  347. * wrapper is responsible for freeing the buffer with os_free() once it
  348. * is not needed anymore.
  349. */
  350. struct wpa_driver_scan_filter {
  351. u8 ssid[SSID_MAX_LEN];
  352. size_t ssid_len;
  353. } *filter_ssids;
  354. /**
  355. * num_filter_ssids - Number of entries in filter_ssids array
  356. */
  357. size_t num_filter_ssids;
  358. /**
  359. * filter_rssi - Filter by RSSI
  360. *
  361. * The driver may filter scan results in firmware to reduce host
  362. * wakeups and thereby save power. Specify the RSSI threshold in s32
  363. * dBm.
  364. */
  365. s32 filter_rssi;
  366. /**
  367. * p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
  368. *
  369. * When set, the driver is expected to remove rates 1, 2, 5.5, and 11
  370. * Mbps from the support rates element(s) in the Probe Request frames
  371. * and not to transmit the frames at any of those rates.
  372. */
  373. unsigned int p2p_probe:1;
  374. /**
  375. * only_new_results - Request driver to report only new results
  376. *
  377. * This is used to request the driver to report only BSSes that have
  378. * been detected after this scan request has been started, i.e., to
  379. * flush old cached BSS entries.
  380. */
  381. unsigned int only_new_results:1;
  382. /**
  383. * low_priority - Requests driver to use a lower scan priority
  384. *
  385. * This is used to request the driver to use a lower scan priority
  386. * if it supports such a thing.
  387. */
  388. unsigned int low_priority:1;
  389. /**
  390. * mac_addr_rand - Requests driver to randomize MAC address
  391. */
  392. unsigned int mac_addr_rand:1;
  393. /**
  394. * mac_addr - MAC address used with randomization. The address cannot be
  395. * a multicast one, i.e., bit 0 of byte 0 should not be set.
  396. */
  397. const u8 *mac_addr;
  398. /**
  399. * mac_addr_mask - MAC address mask used with randomization.
  400. *
  401. * Bits that are 0 in the mask should be randomized. Bits that are 1 in
  402. * the mask should be taken as is from mac_addr. The mask should not
  403. * allow the generation of a multicast address, i.e., bit 0 of byte 0
  404. * must be set.
  405. */
  406. const u8 *mac_addr_mask;
  407. /**
  408. * sched_scan_plans - Scan plans for scheduled scan
  409. *
  410. * Each scan plan consists of the number of iterations to scan and the
  411. * interval between scans. When a scan plan finishes (i.e., it was run
  412. * for the specified number of iterations), the next scan plan is
  413. * executed. The scan plans are executed in the order they appear in
  414. * the array (lower index first). The last scan plan will run infinitely
  415. * (until requested to stop), thus must not specify the number of
  416. * iterations. All other scan plans must specify the number of
  417. * iterations.
  418. */
  419. struct sched_scan_plan {
  420. u32 interval; /* In seconds */
  421. u32 iterations; /* Zero to run infinitely */
  422. } *sched_scan_plans;
  423. /**
  424. * sched_scan_plans_num - Number of scan plans in sched_scan_plans array
  425. */
  426. unsigned int sched_scan_plans_num;
  427. /**
  428. * sched_scan_start_delay - Delay to use before starting the first scan
  429. *
  430. * Delay (in seconds) before scheduling first scan plan cycle. The
  431. * driver may ignore this parameter and start immediately (or at any
  432. * other time), if this feature is not supported.
  433. */
  434. u32 sched_scan_start_delay;
  435. /**
  436. * bssid - Specific BSSID to scan for
  437. *
  438. * This optional parameter can be used to replace the default wildcard
  439. * BSSID with a specific BSSID to scan for if results are needed from
  440. * only a single BSS.
  441. */
  442. const u8 *bssid;
  443. /**
  444. * scan_cookie - Unique identification representing the scan request
  445. *
  446. * This scan_cookie carries a unique identification representing the
  447. * scan request if the host driver/kernel supports concurrent scan
  448. * requests. This cookie is returned from the corresponding driver
  449. * interface.
  450. *
  451. * Note: Unlike other parameters in this structure, scan_cookie is used
  452. * only to return information instead of setting parameters for the
  453. * scan.
  454. */
  455. u64 scan_cookie;
  456. /**
  457. * duration - Dwell time on each channel
  458. *
  459. * This optional parameter can be used to set the dwell time on each
  460. * channel. In TUs.
  461. */
  462. u16 duration;
  463. /**
  464. * duration_mandatory - Whether the specified duration is mandatory
  465. *
  466. * If this is set, the duration specified by the %duration field is
  467. * mandatory (and the driver should reject the scan request if it is
  468. * unable to comply with the specified duration), otherwise it is the
  469. * maximum duration and the actual duration may be shorter.
  470. */
  471. unsigned int duration_mandatory:1;
  472. /**
  473. * relative_rssi_set - Whether relative RSSI parameters are set
  474. */
  475. unsigned int relative_rssi_set:1;
  476. /**
  477. * relative_rssi - Relative RSSI for reporting better BSSs
  478. *
  479. * Amount of RSSI by which a BSS should be better than the current
  480. * connected BSS to report the new BSS to user space.
  481. */
  482. s8 relative_rssi;
  483. /**
  484. * relative_adjust_band - Band to which RSSI should be adjusted
  485. *
  486. * The relative_adjust_rssi should be added to the band specified
  487. * by relative_adjust_band.
  488. */
  489. enum set_band relative_adjust_band;
  490. /**
  491. * relative_adjust_rssi - RSSI to be added to relative_adjust_band
  492. *
  493. * An amount of relative_band_rssi should be added to the BSSs that
  494. * belong to the band specified by relative_adjust_band while comparing
  495. * with other bands for BSS reporting.
  496. */
  497. s8 relative_adjust_rssi;
  498. /*
  499. * NOTE: Whenever adding new parameters here, please make sure
  500. * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
  501. * matching changes.
  502. */
  503. };
  504. /**
  505. * struct wpa_driver_auth_params - Authentication parameters
  506. * Data for struct wpa_driver_ops::authenticate().
  507. */
  508. struct wpa_driver_auth_params {
  509. int freq;
  510. const u8 *bssid;
  511. const u8 *ssid;
  512. size_t ssid_len;
  513. int auth_alg;
  514. const u8 *ie;
  515. size_t ie_len;
  516. const u8 *wep_key[4];
  517. size_t wep_key_len[4];
  518. int wep_tx_keyidx;
  519. int local_state_change;
  520. /**
  521. * p2p - Whether this connection is a P2P group
  522. */
  523. int p2p;
  524. /**
  525. * auth_data - Additional elements for Authentication frame
  526. *
  527. * This buffer starts with the Authentication transaction sequence
  528. * number field. If no special handling of such elements is needed, this
  529. * pointer is %NULL. This is used with SAE and FILS.
  530. */
  531. const u8 *auth_data;
  532. /**
  533. * auth_data_len - Length of auth_data buffer in octets
  534. */
  535. size_t auth_data_len;
  536. };
  537. /**
  538. * enum wps_mode - WPS mode
  539. */
  540. enum wps_mode {
  541. /**
  542. * WPS_MODE_NONE - No WPS provisioning being used
  543. */
  544. WPS_MODE_NONE,
  545. /**
  546. * WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
  547. */
  548. WPS_MODE_OPEN,
  549. /**
  550. * WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
  551. */
  552. WPS_MODE_PRIVACY
  553. };
  554. /**
  555. * struct hostapd_freq_params - Channel parameters
  556. */
  557. struct hostapd_freq_params {
  558. /**
  559. * mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
  560. */
  561. enum hostapd_hw_mode mode;
  562. /**
  563. * freq - Primary channel center frequency in MHz
  564. */
  565. int freq;
  566. /**
  567. * channel - Channel number
  568. */
  569. int channel;
  570. /**
  571. * ht_enabled - Whether HT is enabled
  572. */
  573. int ht_enabled;
  574. /**
  575. * sec_channel_offset - Secondary channel offset for HT40
  576. *
  577. * 0 = HT40 disabled,
  578. * -1 = HT40 enabled, secondary channel below primary,
  579. * 1 = HT40 enabled, secondary channel above primary
  580. */
  581. int sec_channel_offset;
  582. /**
  583. * vht_enabled - Whether VHT is enabled
  584. */
  585. int vht_enabled;
  586. /**
  587. * center_freq1 - Segment 0 center frequency in MHz
  588. *
  589. * Valid for both HT and VHT.
  590. */
  591. int center_freq1;
  592. /**
  593. * center_freq2 - Segment 1 center frequency in MHz
  594. *
  595. * Non-zero only for bandwidth 80 and an 80+80 channel
  596. */
  597. int center_freq2;
  598. /**
  599. * bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
  600. */
  601. int bandwidth;
  602. };
  603. /**
  604. * struct wpa_driver_sta_auth_params - Authentication parameters
  605. * Data for struct wpa_driver_ops::sta_auth().
  606. */
  607. struct wpa_driver_sta_auth_params {
  608. /**
  609. * own_addr - Source address and BSSID for authentication frame
  610. */
  611. const u8 *own_addr;
  612. /**
  613. * addr - MAC address of the station to associate
  614. */
  615. const u8 *addr;
  616. /**
  617. * seq - authentication sequence number
  618. */
  619. u16 seq;
  620. /**
  621. * status - authentication response status code
  622. */
  623. u16 status;
  624. /**
  625. * ie - authentication frame ie buffer
  626. */
  627. const u8 *ie;
  628. /**
  629. * len - ie buffer length
  630. */
  631. size_t len;
  632. /**
  633. * fils_auth - Indicates whether FILS authentication is being performed
  634. */
  635. int fils_auth;
  636. /**
  637. * fils_anonce - ANonce (required for FILS)
  638. */
  639. u8 fils_anonce[WPA_NONCE_LEN];
  640. /**
  641. * fils_snonce - SNonce (required for FILS)
  642. */
  643. u8 fils_snonce[WPA_NONCE_LEN];
  644. /**
  645. * fils_kek - key for encryption (required for FILS)
  646. */
  647. u8 fils_kek[WPA_KEK_MAX_LEN];
  648. /**
  649. * fils_kek_len - Length of the fils_kek in octets (required for FILS)
  650. */
  651. size_t fils_kek_len;
  652. };
  653. /**
  654. * struct wpa_driver_associate_params - Association parameters
  655. * Data for struct wpa_driver_ops::associate().
  656. */
  657. struct wpa_driver_associate_params {
  658. /**
  659. * bssid - BSSID of the selected AP
  660. * This can be %NULL, if ap_scan=2 mode is used and the driver is
  661. * responsible for selecting with which BSS to associate. */
  662. const u8 *bssid;
  663. /**
  664. * bssid_hint - BSSID of a proposed AP
  665. *
  666. * This indicates which BSS has been found a suitable candidate for
  667. * initial association for drivers that use driver/firmwate-based BSS
  668. * selection. Unlike the @bssid parameter, @bssid_hint does not limit
  669. * the driver from selecting other BSSes in the ESS.
  670. */
  671. const u8 *bssid_hint;
  672. /**
  673. * ssid - The selected SSID
  674. */
  675. const u8 *ssid;
  676. /**
  677. * ssid_len - Length of the SSID (1..32)
  678. */
  679. size_t ssid_len;
  680. /**
  681. * freq - channel parameters
  682. */
  683. struct hostapd_freq_params freq;
  684. /**
  685. * freq_hint - Frequency of the channel the proposed AP is using
  686. *
  687. * This provides a channel on which a suitable BSS has been found as a
  688. * hint for the driver. Unlike the @freq parameter, @freq_hint does not
  689. * limit the driver from selecting other channels for
  690. * driver/firmware-based BSS selection.
  691. */
  692. int freq_hint;
  693. /**
  694. * bg_scan_period - Background scan period in seconds, 0 to disable
  695. * background scan, or -1 to indicate no change to default driver
  696. * configuration
  697. */
  698. int bg_scan_period;
  699. /**
  700. * beacon_int - Beacon interval for IBSS or 0 to use driver default
  701. */
  702. int beacon_int;
  703. /**
  704. * wpa_ie - WPA information element for (Re)Association Request
  705. * WPA information element to be included in (Re)Association
  706. * Request (including information element id and length). Use
  707. * of this WPA IE is optional. If the driver generates the WPA
  708. * IE, it can use pairwise_suite, group_suite, group_mgmt_suite, and
  709. * key_mgmt_suite to select proper algorithms. In this case,
  710. * the driver has to notify wpa_supplicant about the used WPA
  711. * IE by generating an event that the interface code will
  712. * convert into EVENT_ASSOCINFO data (see below).
  713. *
  714. * When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
  715. * instead. The driver can determine which version is used by
  716. * looking at the first byte of the IE (0xdd for WPA, 0x30 for
  717. * WPA2/RSN).
  718. *
  719. * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
  720. */
  721. const u8 *wpa_ie;
  722. /**
  723. * wpa_ie_len - length of the wpa_ie
  724. */
  725. size_t wpa_ie_len;
  726. /**
  727. * wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
  728. */
  729. unsigned int wpa_proto;
  730. /**
  731. * pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
  732. *
  733. * This is usually ignored if @wpa_ie is used.
  734. */
  735. unsigned int pairwise_suite;
  736. /**
  737. * group_suite - Selected group cipher suite (WPA_CIPHER_*)
  738. *
  739. * This is usually ignored if @wpa_ie is used.
  740. */
  741. unsigned int group_suite;
  742. /**
  743. * mgmt_group_suite - Selected group management cipher suite (WPA_CIPHER_*)
  744. *
  745. * This is usually ignored if @wpa_ie is used.
  746. */
  747. unsigned int mgmt_group_suite;
  748. /**
  749. * key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
  750. *
  751. * This is usually ignored if @wpa_ie is used.
  752. */
  753. unsigned int key_mgmt_suite;
  754. /**
  755. * auth_alg - Allowed authentication algorithms
  756. * Bit field of WPA_AUTH_ALG_*
  757. */
  758. int auth_alg;
  759. /**
  760. * mode - Operation mode (infra/ibss) IEEE80211_MODE_*
  761. */
  762. int mode;
  763. /**
  764. * wep_key - WEP keys for static WEP configuration
  765. */
  766. const u8 *wep_key[4];
  767. /**
  768. * wep_key_len - WEP key length for static WEP configuration
  769. */
  770. size_t wep_key_len[4];
  771. /**
  772. * wep_tx_keyidx - WEP TX key index for static WEP configuration
  773. */
  774. int wep_tx_keyidx;
  775. /**
  776. * mgmt_frame_protection - IEEE 802.11w management frame protection
  777. */
  778. enum mfp_options mgmt_frame_protection;
  779. /**
  780. * passphrase - RSN passphrase for PSK
  781. *
  782. * This value is made available only for WPA/WPA2-Personal (PSK) and
  783. * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
  784. * the 8..63 character ASCII passphrase, if available. Please note that
  785. * this can be %NULL if passphrase was not used to generate the PSK. In
  786. * that case, the psk field must be used to fetch the PSK.
  787. */
  788. const char *passphrase;
  789. /**
  790. * psk - RSN PSK (alternative for passphrase for PSK)
  791. *
  792. * This value is made available only for WPA/WPA2-Personal (PSK) and
  793. * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
  794. * the 32-octet (256-bit) PSK, if available. The driver wrapper should
  795. * be prepared to handle %NULL value as an error.
  796. */
  797. const u8 *psk;
  798. /**
  799. * drop_unencrypted - Enable/disable unencrypted frame filtering
  800. *
  801. * Configure the driver to drop all non-EAPOL frames (both receive and
  802. * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
  803. * still be allowed for key negotiation.
  804. */
  805. int drop_unencrypted;
  806. /**
  807. * prev_bssid - Previously used BSSID in this ESS
  808. *
  809. * When not %NULL, this is a request to use reassociation instead of
  810. * association.
  811. */
  812. const u8 *prev_bssid;
  813. /**
  814. * wps - WPS mode
  815. *
  816. * If the driver needs to do special configuration for WPS association,
  817. * this variable provides more information on what type of association
  818. * is being requested. Most drivers should not need ot use this.
  819. */
  820. enum wps_mode wps;
  821. /**
  822. * p2p - Whether this connection is a P2P group
  823. */
  824. int p2p;
  825. /**
  826. * uapsd - UAPSD parameters for the network
  827. * -1 = do not change defaults
  828. * AP mode: 1 = enabled, 0 = disabled
  829. * STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
  830. */
  831. int uapsd;
  832. /**
  833. * fixed_bssid - Whether to force this BSSID in IBSS mode
  834. * 1 = Fix this BSSID and prevent merges.
  835. * 0 = Do not fix BSSID.
  836. */
  837. int fixed_bssid;
  838. /**
  839. * fixed_freq - Fix control channel in IBSS mode
  840. * 0 = don't fix control channel (default)
  841. * 1 = fix control channel; this prevents IBSS merging with another
  842. * channel
  843. */
  844. int fixed_freq;
  845. /**
  846. * disable_ht - Disable HT (IEEE 802.11n) for this connection
  847. */
  848. int disable_ht;
  849. /**
  850. * htcaps - HT Capabilities over-rides
  851. *
  852. * Only bits set in the mask will be used, and not all values are used
  853. * by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
  854. *
  855. * Pointer to struct ieee80211_ht_capabilities.
  856. */
  857. const u8 *htcaps;
  858. /**
  859. * htcaps_mask - HT Capabilities over-rides mask
  860. *
  861. * Pointer to struct ieee80211_ht_capabilities.
  862. */
  863. const u8 *htcaps_mask;
  864. #ifdef CONFIG_VHT_OVERRIDES
  865. /**
  866. * disable_vht - Disable VHT for this connection
  867. */
  868. int disable_vht;
  869. /**
  870. * VHT capability overrides.
  871. */
  872. const struct ieee80211_vht_capabilities *vhtcaps;
  873. const struct ieee80211_vht_capabilities *vhtcaps_mask;
  874. #endif /* CONFIG_VHT_OVERRIDES */
  875. /**
  876. * req_key_mgmt_offload - Request key management offload for connection
  877. *
  878. * Request key management offload for this connection if the device
  879. * supports it.
  880. */
  881. int req_key_mgmt_offload;
  882. /**
  883. * Flag for indicating whether this association includes support for
  884. * RRM (Radio Resource Measurements)
  885. */
  886. int rrm_used;
  887. /**
  888. * pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
  889. * AP as usual. Valid for DMG network only.
  890. */
  891. int pbss;
  892. /**
  893. * fils_kek - KEK for FILS association frame protection (AES-SIV)
  894. */
  895. const u8 *fils_kek;
  896. /**
  897. * fils_kek_len: Length of fils_kek in bytes
  898. */
  899. size_t fils_kek_len;
  900. /**
  901. * fils_nonces - Nonces for FILS association frame protection
  902. * (AES-SIV AAD)
  903. */
  904. const u8 *fils_nonces;
  905. /**
  906. * fils_nonces_len: Length of fils_nonce in bytes
  907. */
  908. size_t fils_nonces_len;
  909. /**
  910. * fils_erp_username - Username part of keyName-NAI
  911. */
  912. const u8 *fils_erp_username;
  913. /**
  914. * fils_erp_username_len - Length of fils_erp_username in bytes
  915. */
  916. size_t fils_erp_username_len;
  917. /**
  918. * fils_erp_realm - Realm/domain name to use in FILS ERP
  919. */
  920. const u8 *fils_erp_realm;
  921. /**
  922. * fils_erp_realm_len - Length of fils_erp_realm in bytes
  923. */
  924. size_t fils_erp_realm_len;
  925. /**
  926. * fils_erp_next_seq_num - The next sequence number to use in FILS ERP
  927. * messages
  928. */
  929. u16 fils_erp_next_seq_num;
  930. /**
  931. * fils_erp_rrk - Re-authentication root key (rRK) for the keyName-NAI
  932. * specified by fils_erp_username@fils_erp_realm.
  933. */
  934. const u8 *fils_erp_rrk;
  935. /**
  936. * fils_erp_rrk_len - Length of fils_erp_rrk in bytes
  937. */
  938. size_t fils_erp_rrk_len;
  939. };
  940. enum hide_ssid {
  941. NO_SSID_HIDING,
  942. HIDDEN_SSID_ZERO_LEN,
  943. HIDDEN_SSID_ZERO_CONTENTS
  944. };
  945. struct wowlan_triggers {
  946. u8 any;
  947. u8 disconnect;
  948. u8 magic_pkt;
  949. u8 gtk_rekey_failure;
  950. u8 eap_identity_req;
  951. u8 four_way_handshake;
  952. u8 rfkill_release;
  953. };
  954. struct wpa_driver_ap_params {
  955. /**
  956. * head - Beacon head from IEEE 802.11 header to IEs before TIM IE
  957. */
  958. u8 *head;
  959. /**
  960. * head_len - Length of the head buffer in octets
  961. */
  962. size_t head_len;
  963. /**
  964. * tail - Beacon tail following TIM IE
  965. */
  966. u8 *tail;
  967. /**
  968. * tail_len - Length of the tail buffer in octets
  969. */
  970. size_t tail_len;
  971. /**
  972. * dtim_period - DTIM period
  973. */
  974. int dtim_period;
  975. /**
  976. * beacon_int - Beacon interval
  977. */
  978. int beacon_int;
  979. /**
  980. * basic_rates: -1 terminated array of basic rates in 100 kbps
  981. *
  982. * This parameter can be used to set a specific basic rate set for the
  983. * BSS. If %NULL, default basic rate set is used.
  984. */
  985. int *basic_rates;
  986. /**
  987. * beacon_rate: Beacon frame data rate
  988. *
  989. * This parameter can be used to set a specific Beacon frame data rate
  990. * for the BSS. The interpretation of this value depends on the
  991. * rate_type (legacy: in 100 kbps units, HT: HT-MCS, VHT: VHT-MCS). If
  992. * beacon_rate == 0 and rate_type == 0 (BEACON_RATE_LEGACY), the default
  993. * Beacon frame data rate is used.
  994. */
  995. unsigned int beacon_rate;
  996. /**
  997. * beacon_rate_type: Beacon data rate type (legacy/HT/VHT)
  998. */
  999. enum beacon_rate_type rate_type;
  1000. /**
  1001. * proberesp - Probe Response template
  1002. *
  1003. * This is used by drivers that reply to Probe Requests internally in
  1004. * AP mode and require the full Probe Response template.
  1005. */
  1006. u8 *proberesp;
  1007. /**
  1008. * proberesp_len - Length of the proberesp buffer in octets
  1009. */
  1010. size_t proberesp_len;
  1011. /**
  1012. * ssid - The SSID to use in Beacon/Probe Response frames
  1013. */
  1014. const u8 *ssid;
  1015. /**
  1016. * ssid_len - Length of the SSID (1..32)
  1017. */
  1018. size_t ssid_len;
  1019. /**
  1020. * hide_ssid - Whether to hide the SSID
  1021. */
  1022. enum hide_ssid hide_ssid;
  1023. /**
  1024. * pairwise_ciphers - WPA_CIPHER_* bitfield
  1025. */
  1026. unsigned int pairwise_ciphers;
  1027. /**
  1028. * group_cipher - WPA_CIPHER_*
  1029. */
  1030. unsigned int group_cipher;
  1031. /**
  1032. * key_mgmt_suites - WPA_KEY_MGMT_* bitfield
  1033. */
  1034. unsigned int key_mgmt_suites;
  1035. /**
  1036. * auth_algs - WPA_AUTH_ALG_* bitfield
  1037. */
  1038. unsigned int auth_algs;
  1039. /**
  1040. * wpa_version - WPA_PROTO_* bitfield
  1041. */
  1042. unsigned int wpa_version;
  1043. /**
  1044. * privacy - Whether privacy is used in the BSS
  1045. */
  1046. int privacy;
  1047. /**
  1048. * beacon_ies - WPS/P2P IE(s) for Beacon frames
  1049. *
  1050. * This is used to add IEs like WPS IE and P2P IE by drivers that do
  1051. * not use the full Beacon template.
  1052. */
  1053. const struct wpabuf *beacon_ies;
  1054. /**
  1055. * proberesp_ies - P2P/WPS IE(s) for Probe Response frames
  1056. *
  1057. * This is used to add IEs like WPS IE and P2P IE by drivers that
  1058. * reply to Probe Request frames internally.
  1059. */
  1060. const struct wpabuf *proberesp_ies;
  1061. /**
  1062. * assocresp_ies - WPS IE(s) for (Re)Association Response frames
  1063. *
  1064. * This is used to add IEs like WPS IE by drivers that reply to
  1065. * (Re)Association Request frames internally.
  1066. */
  1067. const struct wpabuf *assocresp_ies;
  1068. /**
  1069. * isolate - Whether to isolate frames between associated stations
  1070. *
  1071. * If this is non-zero, the AP is requested to disable forwarding of
  1072. * frames between associated stations.
  1073. */
  1074. int isolate;
  1075. /**
  1076. * cts_protect - Whether CTS protection is enabled
  1077. */
  1078. int cts_protect;
  1079. /**
  1080. * preamble - Whether short preamble is enabled
  1081. */
  1082. int preamble;
  1083. /**
  1084. * short_slot_time - Whether short slot time is enabled
  1085. *
  1086. * 0 = short slot time disable, 1 = short slot time enabled, -1 = do
  1087. * not set (e.g., when 802.11g mode is not in use)
  1088. */
  1089. int short_slot_time;
  1090. /**
  1091. * ht_opmode - HT operation mode or -1 if HT not in use
  1092. */
  1093. int ht_opmode;
  1094. /**
  1095. * interworking - Whether Interworking is enabled
  1096. */
  1097. int interworking;
  1098. /**
  1099. * hessid - Homogeneous ESS identifier or %NULL if not set
  1100. */
  1101. const u8 *hessid;
  1102. /**
  1103. * access_network_type - Access Network Type (0..15)
  1104. *
  1105. * This is used for filtering Probe Request frames when Interworking is
  1106. * enabled.
  1107. */
  1108. u8 access_network_type;
  1109. /**
  1110. * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
  1111. *
  1112. * This is used by driver which advertises this capability.
  1113. */
  1114. int ap_max_inactivity;
  1115. /**
  1116. * ctwindow - Client Traffic Window (in TUs)
  1117. */
  1118. u8 p2p_go_ctwindow;
  1119. /**
  1120. * smps_mode - SMPS mode
  1121. *
  1122. * SMPS mode to be used by the AP, specified as the relevant bits of
  1123. * ht_capab (i.e. HT_CAP_INFO_SMPS_*).
  1124. */
  1125. unsigned int smps_mode;
  1126. /**
  1127. * disable_dgaf - Whether group-addressed frames are disabled
  1128. */
  1129. int disable_dgaf;
  1130. /**
  1131. * osen - Whether OSEN security is enabled
  1132. */
  1133. int osen;
  1134. /**
  1135. * freq - Channel parameters for dynamic bandwidth changes
  1136. */
  1137. struct hostapd_freq_params *freq;
  1138. /**
  1139. * reenable - Whether this is to re-enable beaconing
  1140. */
  1141. int reenable;
  1142. /**
  1143. * pbss - Whether to start a PCP (in PBSS) instead of an AP in
  1144. * infrastructure BSS. Valid only for DMG network.
  1145. */
  1146. int pbss;
  1147. /**
  1148. * multicast_to_unicast - Whether to use multicast_to_unicast
  1149. *
  1150. * If this is non-zero, the AP is requested to perform multicast to
  1151. * unicast conversion for ARP, IPv4, and IPv6 frames (possibly within
  1152. * 802.1Q). If enabled, such frames are to be sent to each station
  1153. * separately, with the DA replaced by their own MAC address rather
  1154. * than the group address.
  1155. *
  1156. * Note that this may break certain expectations of the receiver, such
  1157. * as the ability to drop unicast IP packets received within multicast
  1158. * L2 frames, or the ability to not send ICMP destination unreachable
  1159. * messages for packets received in L2 multicast (which is required,
  1160. * but the receiver can't tell the difference if this new option is
  1161. * enabled.)
  1162. *
  1163. * This also doesn't implement the 802.11 DMS (directed multicast
  1164. * service).
  1165. */
  1166. int multicast_to_unicast;
  1167. };
  1168. struct wpa_driver_mesh_bss_params {
  1169. #define WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS 0x00000001
  1170. #define WPA_DRIVER_MESH_CONF_FLAG_PEER_LINK_TIMEOUT 0x00000002
  1171. #define WPA_DRIVER_MESH_CONF_FLAG_MAX_PEER_LINKS 0x00000004
  1172. #define WPA_DRIVER_MESH_CONF_FLAG_HT_OP_MODE 0x00000008
  1173. #define WPA_DRIVER_MESH_CONF_FLAG_RSSI_THRESHOLD 0x00000010
  1174. /*
  1175. * TODO: Other mesh configuration parameters would go here.
  1176. * See NL80211_MESHCONF_* for all the mesh config parameters.
  1177. */
  1178. unsigned int flags;
  1179. int auto_plinks;
  1180. int peer_link_timeout;
  1181. int max_peer_links;
  1182. int rssi_threshold;
  1183. u16 ht_opmode;
  1184. };
  1185. struct wpa_driver_mesh_join_params {
  1186. const u8 *meshid;
  1187. int meshid_len;
  1188. const int *basic_rates;
  1189. const u8 *ies;
  1190. int ie_len;
  1191. struct hostapd_freq_params freq;
  1192. int beacon_int;
  1193. int dtim_period;
  1194. struct wpa_driver_mesh_bss_params conf;
  1195. #define WPA_DRIVER_MESH_FLAG_USER_MPM 0x00000001
  1196. #define WPA_DRIVER_MESH_FLAG_DRIVER_MPM 0x00000002
  1197. #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
  1198. #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
  1199. unsigned int flags;
  1200. };
  1201. /**
  1202. * struct wpa_driver_capa - Driver capability information
  1203. */
  1204. struct wpa_driver_capa {
  1205. #define WPA_DRIVER_CAPA_KEY_MGMT_WPA 0x00000001
  1206. #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2 0x00000002
  1207. #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK 0x00000004
  1208. #define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK 0x00000008
  1209. #define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE 0x00000010
  1210. #define WPA_DRIVER_CAPA_KEY_MGMT_FT 0x00000020
  1211. #define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK 0x00000040
  1212. #define WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK 0x00000080
  1213. #define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B 0x00000100
  1214. #define WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192 0x00000200
  1215. #define WPA_DRIVER_CAPA_KEY_MGMT_OWE 0x00000400
  1216. #define WPA_DRIVER_CAPA_KEY_MGMT_DPP 0x00000800
  1217. #define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 0x00001000
  1218. #define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
  1219. #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
  1220. #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
  1221. /** Bitfield of supported key management suites */
  1222. unsigned int key_mgmt;
  1223. #define WPA_DRIVER_CAPA_ENC_WEP40 0x00000001
  1224. #define WPA_DRIVER_CAPA_ENC_WEP104 0x00000002
  1225. #define WPA_DRIVER_CAPA_ENC_TKIP 0x00000004
  1226. #define WPA_DRIVER_CAPA_ENC_CCMP 0x00000008
  1227. #define WPA_DRIVER_CAPA_ENC_WEP128 0x00000010
  1228. #define WPA_DRIVER_CAPA_ENC_GCMP 0x00000020
  1229. #define WPA_DRIVER_CAPA_ENC_GCMP_256 0x00000040
  1230. #define WPA_DRIVER_CAPA_ENC_CCMP_256 0x00000080
  1231. #define WPA_DRIVER_CAPA_ENC_BIP 0x00000100
  1232. #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_128 0x00000200
  1233. #define WPA_DRIVER_CAPA_ENC_BIP_GMAC_256 0x00000400
  1234. #define WPA_DRIVER_CAPA_ENC_BIP_CMAC_256 0x00000800
  1235. #define WPA_DRIVER_CAPA_ENC_GTK_NOT_USED 0x00001000
  1236. /** Bitfield of supported cipher suites */
  1237. unsigned int enc;
  1238. #define WPA_DRIVER_AUTH_OPEN 0x00000001
  1239. #define WPA_DRIVER_AUTH_SHARED 0x00000002
  1240. #define WPA_DRIVER_AUTH_LEAP 0x00000004
  1241. /** Bitfield of supported IEEE 802.11 authentication algorithms */
  1242. unsigned int auth;
  1243. /** Driver generated WPA/RSN IE */
  1244. #define WPA_DRIVER_FLAGS_DRIVER_IE 0x00000001
  1245. /** Driver needs static WEP key setup after association command */
  1246. #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC 0x00000002
  1247. /** Driver takes care of all DFS operations */
  1248. #define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
  1249. /** Driver takes care of RSN 4-way handshake internally; PMK is configured with
  1250. * struct wpa_driver_ops::set_key using alg = WPA_ALG_PMK */
  1251. #define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE 0x00000008
  1252. /** Driver is for a wired Ethernet interface */
  1253. #define WPA_DRIVER_FLAGS_WIRED 0x00000010
  1254. /** Driver provides separate commands for authentication and association (SME in
  1255. * wpa_supplicant). */
  1256. #define WPA_DRIVER_FLAGS_SME 0x00000020
  1257. /** Driver supports AP mode */
  1258. #define WPA_DRIVER_FLAGS_AP 0x00000040
  1259. /** Driver needs static WEP key setup after association has been completed */
  1260. #define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE 0x00000080
  1261. /** Driver supports dynamic HT 20/40 MHz channel changes during BSS lifetime */
  1262. #define WPA_DRIVER_FLAGS_HT_2040_COEX 0x00000100
  1263. /** Driver supports concurrent P2P operations */
  1264. #define WPA_DRIVER_FLAGS_P2P_CONCURRENT 0x00000200
  1265. /**
  1266. * Driver uses the initial interface as a dedicated management interface, i.e.,
  1267. * it cannot be used for P2P group operations or non-P2P purposes.
  1268. */
  1269. #define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400
  1270. /** This interface is P2P capable (P2P GO or P2P Client) */
  1271. #define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800
  1272. /** Driver supports station and key removal when stopping an AP */
  1273. #define WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT 0x00001000
  1274. /**
  1275. * Driver uses the initial interface for P2P management interface and non-P2P
  1276. * purposes (e.g., connect to infra AP), but this interface cannot be used for
  1277. * P2P group operations.
  1278. */
  1279. #define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00002000
  1280. /**
  1281. * Driver is known to use sane error codes, i.e., when it indicates that
  1282. * something (e.g., association) fails, there was indeed a failure and the
  1283. * operation does not end up getting completed successfully later.
  1284. */
  1285. #define WPA_DRIVER_FLAGS_SANE_ERROR_CODES 0x00004000
  1286. /** Driver supports off-channel TX */
  1287. #define WPA_DRIVER_FLAGS_OFFCHANNEL_TX 0x00008000
  1288. /** Driver indicates TX status events for EAPOL Data frames */
  1289. #define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS 0x00010000
  1290. /** Driver indicates TX status events for Deauth/Disassoc frames */
  1291. #define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS 0x00020000
  1292. /** Driver supports roaming (BSS selection) in firmware */
  1293. #define WPA_DRIVER_FLAGS_BSS_SELECTION 0x00040000
  1294. /** Driver supports operating as a TDLS peer */
  1295. #define WPA_DRIVER_FLAGS_TDLS_SUPPORT 0x00080000
  1296. /** Driver requires external TDLS setup/teardown/discovery */
  1297. #define WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP 0x00100000
  1298. /** Driver indicates support for Probe Response offloading in AP mode */
  1299. #define WPA_DRIVER_FLAGS_PROBE_RESP_OFFLOAD 0x00200000
  1300. /** Driver supports U-APSD in AP mode */
  1301. #define WPA_DRIVER_FLAGS_AP_UAPSD 0x00400000
  1302. /** Driver supports inactivity timer in AP mode */
  1303. #define WPA_DRIVER_FLAGS_INACTIVITY_TIMER 0x00800000
  1304. /** Driver expects user space implementation of MLME in AP mode */
  1305. #define WPA_DRIVER_FLAGS_AP_MLME 0x01000000
  1306. /** Driver supports SAE with user space SME */
  1307. #define WPA_DRIVER_FLAGS_SAE 0x02000000
  1308. /** Driver makes use of OBSS scan mechanism in wpa_supplicant */
  1309. #define WPA_DRIVER_FLAGS_OBSS_SCAN 0x04000000
  1310. /** Driver supports IBSS (Ad-hoc) mode */
  1311. #define WPA_DRIVER_FLAGS_IBSS 0x08000000
  1312. /** Driver supports radar detection */
  1313. #define WPA_DRIVER_FLAGS_RADAR 0x10000000
  1314. /** Driver supports a dedicated interface for P2P Device */
  1315. #define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x20000000
  1316. /** Driver supports QoS Mapping */
  1317. #define WPA_DRIVER_FLAGS_QOS_MAPPING 0x40000000
  1318. /** Driver supports CSA in AP mode */
  1319. #define WPA_DRIVER_FLAGS_AP_CSA 0x80000000
  1320. /** Driver supports mesh */
  1321. #define WPA_DRIVER_FLAGS_MESH 0x0000000100000000ULL
  1322. /** Driver support ACS offload */
  1323. #define WPA_DRIVER_FLAGS_ACS_OFFLOAD 0x0000000200000000ULL
  1324. /** Driver supports key management offload */
  1325. #define WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD 0x0000000400000000ULL
  1326. /** Driver supports TDLS channel switching */
  1327. #define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
  1328. /** Driver supports IBSS with HT datarates */
  1329. #define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
  1330. /** Driver supports IBSS with VHT datarates */
  1331. #define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
  1332. /** Driver supports automatic band selection */
  1333. #define WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY 0x0000004000000000ULL
  1334. /** Driver supports simultaneous off-channel operations */
  1335. #define WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS 0x0000008000000000ULL
  1336. /** Driver supports full AP client state */
  1337. #define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
  1338. /** Driver supports P2P Listen offload */
  1339. #define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
  1340. /** Driver supports FILS */
  1341. #define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
  1342. /** Driver supports Beacon frame TX rate configuration (legacy rates) */
  1343. #define WPA_DRIVER_FLAGS_BEACON_RATE_LEGACY 0x0000080000000000ULL
  1344. /** Driver supports Beacon frame TX rate configuration (HT rates) */
  1345. #define WPA_DRIVER_FLAGS_BEACON_RATE_HT 0x0000100000000000ULL
  1346. /** Driver supports Beacon frame TX rate configuration (VHT rates) */
  1347. #define WPA_DRIVER_FLAGS_BEACON_RATE_VHT 0x0000200000000000ULL
  1348. /** Driver supports mgmt_tx with random TX address in non-connected state */
  1349. #define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA 0x0000400000000000ULL
  1350. /** Driver supports mgmt_tx with random TX addr in connected state */
  1351. #define WPA_DRIVER_FLAGS_MGMT_TX_RANDOM_TA_CONNECTED 0x0000800000000000ULL
  1352. /** Driver supports better BSS reporting with sched_scan in connected mode */
  1353. #define WPA_DRIVER_FLAGS_SCHED_SCAN_RELATIVE_RSSI 0x0001000000000000ULL
  1354. /** Driver supports HE capabilities */
  1355. #define WPA_DRIVER_FLAGS_HE_CAPABILITIES 0x0002000000000000ULL
  1356. /** Driver supports FILS shared key offload */
  1357. #define WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD 0x0004000000000000ULL
  1358. /** Driver supports all OCE STA specific mandatory features */
  1359. #define WPA_DRIVER_FLAGS_OCE_STA 0x0008000000000000ULL
  1360. /** Driver supports all OCE AP specific mandatory features */
  1361. #define WPA_DRIVER_FLAGS_OCE_AP 0x0010000000000000ULL
  1362. /**
  1363. * Driver supports all OCE STA-CFON specific mandatory features only.
  1364. * If a driver sets this bit but not the %WPA_DRIVER_FLAGS_OCE_AP, the
  1365. * userspace shall assume that this driver may not support all OCE AP
  1366. * functionality but can support only OCE STA-CFON functionality.
  1367. */
  1368. #define WPA_DRIVER_FLAGS_OCE_STA_CFON 0x0020000000000000ULL
  1369. u64 flags;
  1370. #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
  1371. (drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)
  1372. #define WPA_DRIVER_SMPS_MODE_STATIC 0x00000001
  1373. #define WPA_DRIVER_SMPS_MODE_DYNAMIC 0x00000002
  1374. unsigned int smps_modes;
  1375. unsigned int wmm_ac_supported:1;
  1376. unsigned int mac_addr_rand_scan_supported:1;
  1377. unsigned int mac_addr_rand_sched_scan_supported:1;
  1378. /** Maximum number of supported active probe SSIDs */
  1379. int max_scan_ssids;
  1380. /** Maximum number of supported active probe SSIDs for sched_scan */
  1381. int max_sched_scan_ssids;
  1382. /** Maximum number of supported scan plans for scheduled scan */
  1383. unsigned int max_sched_scan_plans;
  1384. /** Maximum interval in a scan plan. In seconds */
  1385. u32 max_sched_scan_plan_interval;
  1386. /** Maximum number of iterations in a single scan plan */
  1387. u32 max_sched_scan_plan_iterations;
  1388. /** Whether sched_scan (offloaded scanning) is supported */
  1389. int sched_scan_supported;
  1390. /** Maximum number of supported match sets for sched_scan */
  1391. int max_match_sets;
  1392. /**
  1393. * max_remain_on_chan - Maximum remain-on-channel duration in msec
  1394. */
  1395. unsigned int max_remain_on_chan;
  1396. /**
  1397. * max_stations - Maximum number of associated stations the driver
  1398. * supports in AP mode
  1399. */
  1400. unsigned int max_stations;
  1401. /**
  1402. * probe_resp_offloads - Bitmap of supported protocols by the driver
  1403. * for Probe Response offloading.
  1404. */
  1405. /** Driver Probe Response offloading support for WPS ver. 1 */
  1406. #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS 0x00000001
  1407. /** Driver Probe Response offloading support for WPS ver. 2 */
  1408. #define WPA_DRIVER_PROBE_RESP_OFFLOAD_WPS2 0x00000002
  1409. /** Driver Probe Response offloading support for P2P */
  1410. #define WPA_DRIVER_PROBE_RESP_OFFLOAD_P2P 0x00000004
  1411. /** Driver Probe Response offloading support for IEEE 802.11u (Interworking) */
  1412. #define WPA_DRIVER_PROBE_RESP_OFFLOAD_INTERWORKING 0x00000008
  1413. unsigned int probe_resp_offloads;
  1414. unsigned int max_acl_mac_addrs;
  1415. /**
  1416. * Number of supported concurrent channels
  1417. */
  1418. unsigned int num_multichan_concurrent;
  1419. /**
  1420. * extended_capa - extended capabilities in driver/device
  1421. *
  1422. * Must be allocated and freed by driver and the pointers must be
  1423. * valid for the lifetime of the driver, i.e., freed in deinit()
  1424. */
  1425. const u8 *extended_capa, *extended_capa_mask;
  1426. unsigned int extended_capa_len;
  1427. struct wowlan_triggers wowlan_triggers;
  1428. /** Driver adds the DS Params Set IE in Probe Request frames */
  1429. #define WPA_DRIVER_FLAGS_DS_PARAM_SET_IE_IN_PROBES 0x00000001
  1430. /** Driver adds the WFA TPC IE in Probe Request frames */
  1431. #define WPA_DRIVER_FLAGS_WFA_TPC_IE_IN_PROBES 0x00000002
  1432. /** Driver handles quiet period requests */
  1433. #define WPA_DRIVER_FLAGS_QUIET 0x00000004
  1434. /**
  1435. * Driver is capable of inserting the current TX power value into the body of
  1436. * transmitted frames.
  1437. * Background: Some Action frames include a TPC Report IE. This IE contains a
  1438. * TX power field, which has to be updated by lower layers. One such Action
  1439. * frame is Link Measurement Report (part of RRM). Another is TPC Report (part
  1440. * of spectrum management). Note that this insertion takes place at a fixed
  1441. * offset, namely the 6th byte in the Action frame body.
  1442. */
  1443. #define WPA_DRIVER_FLAGS_TX_POWER_INSERTION 0x00000008
  1444. /**
  1445. * Driver supports RRM. With this support, the driver will accept to use RRM in
  1446. * (Re)Association Request frames, without supporting quiet period.
  1447. */
  1448. #define WPA_DRIVER_FLAGS_SUPPORT_RRM 0x00000010
  1449. /** Driver supports setting the scan dwell time */
  1450. #define WPA_DRIVER_FLAGS_SUPPORT_SET_SCAN_DWELL 0x00000020
  1451. /** Driver supports Beacon Report Measurement */
  1452. #define WPA_DRIVER_FLAGS_SUPPORT_BEACON_REPORT 0x00000040
  1453. u32 rrm_flags;
  1454. /* Driver concurrency capabilities */
  1455. unsigned int conc_capab;
  1456. /* Maximum number of concurrent channels on 2.4 GHz */
  1457. unsigned int max_conc_chan_2_4;
  1458. /* Maximum number of concurrent channels on 5 GHz */
  1459. unsigned int max_conc_chan_5_0;
  1460. /* Maximum number of supported CSA counters */
  1461. u16 max_csa_counters;
  1462. };
  1463. struct hostapd_data;
  1464. #define STA_DRV_DATA_TX_MCS BIT(0)
  1465. #define STA_DRV_DATA_RX_MCS BIT(1)
  1466. #define STA_DRV_DATA_TX_VHT_MCS BIT(2)
  1467. #define STA_DRV_DATA_RX_VHT_MCS BIT(3)
  1468. #define STA_DRV_DATA_TX_VHT_NSS BIT(4)
  1469. #define STA_DRV_DATA_RX_VHT_NSS BIT(5)
  1470. #define STA_DRV_DATA_TX_SHORT_GI BIT(6)
  1471. #define STA_DRV_DATA_RX_SHORT_GI BIT(7)
  1472. struct hostap_sta_driver_data {
  1473. unsigned long rx_packets, tx_packets;
  1474. unsigned long long rx_bytes, tx_bytes;
  1475. int bytes_64bit; /* whether 64-bit byte counters are supported */
  1476. unsigned long current_tx_rate;
  1477. unsigned long current_rx_rate;
  1478. unsigned long inactive_msec;
  1479. unsigned long flags; /* bitfield of STA_DRV_DATA_* */
  1480. unsigned long num_ps_buf_frames;
  1481. unsigned long tx_retry_failed;
  1482. unsigned long tx_retry_count;
  1483. int last_rssi;
  1484. int last_ack_rssi;
  1485. s8 signal;
  1486. u8 rx_vhtmcs;
  1487. u8 tx_vhtmcs;
  1488. u8 rx_mcs;
  1489. u8 tx_mcs;
  1490. u8 rx_vht_nss;
  1491. u8 tx_vht_nss;
  1492. };
  1493. struct hostapd_sta_add_params {
  1494. const u8 *addr;
  1495. u16 aid;
  1496. u16 capability;
  1497. const u8 *supp_rates;
  1498. size_t supp_rates_len;
  1499. u16 listen_interval;
  1500. const struct ieee80211_ht_capabilities *ht_capabilities;
  1501. const struct ieee80211_vht_capabilities *vht_capabilities;
  1502. int vht_opmode_enabled;
  1503. u8 vht_opmode;
  1504. u32 flags; /* bitmask of WPA_STA_* flags */
  1505. u32 flags_mask; /* unset bits in flags */
  1506. #ifdef CONFIG_MESH
  1507. enum mesh_plink_state plink_state;
  1508. u16 peer_aid;
  1509. #endif /* CONFIG_MESH */
  1510. int set; /* Set STA parameters instead of add */
  1511. u8 qosinfo;
  1512. const u8 *ext_capab;
  1513. size_t ext_capab_len;
  1514. const u8 *supp_channels;
  1515. size_t supp_channels_len;
  1516. const u8 *supp_oper_classes;
  1517. size_t supp_oper_classes_len;
  1518. int support_p2p_ps;
  1519. };
  1520. struct mac_address {
  1521. u8 addr[ETH_ALEN];
  1522. };
  1523. struct hostapd_acl_params {
  1524. u8 acl_policy;
  1525. unsigned int num_mac_acl;
  1526. struct mac_address mac_acl[0];
  1527. };
  1528. enum wpa_driver_if_type {
  1529. /**
  1530. * WPA_IF_STATION - Station mode interface
  1531. */
  1532. WPA_IF_STATION,
  1533. /**
  1534. * WPA_IF_AP_VLAN - AP mode VLAN interface
  1535. *
  1536. * This interface shares its address and Beacon frame with the main
  1537. * BSS.
  1538. */
  1539. WPA_IF_AP_VLAN,
  1540. /**
  1541. * WPA_IF_AP_BSS - AP mode BSS interface
  1542. *
  1543. * This interface has its own address and Beacon frame.
  1544. */
  1545. WPA_IF_AP_BSS,
  1546. /**
  1547. * WPA_IF_P2P_GO - P2P Group Owner
  1548. */
  1549. WPA_IF_P2P_GO,
  1550. /**
  1551. * WPA_IF_P2P_CLIENT - P2P Client
  1552. */
  1553. WPA_IF_P2P_CLIENT,
  1554. /**
  1555. * WPA_IF_P2P_GROUP - P2P Group interface (will become either
  1556. * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known)
  1557. */
  1558. WPA_IF_P2P_GROUP,
  1559. /**
  1560. * WPA_IF_P2P_DEVICE - P2P Device interface is used to indentify the
  1561. * abstracted P2P Device function in the driver
  1562. */
  1563. WPA_IF_P2P_DEVICE,
  1564. /*
  1565. * WPA_IF_MESH - Mesh interface
  1566. */
  1567. WPA_IF_MESH,
  1568. /*
  1569. * WPA_IF_TDLS - TDLS offchannel interface (used for pref freq only)
  1570. */
  1571. WPA_IF_TDLS,
  1572. /*
  1573. * WPA_IF_IBSS - IBSS interface (used for pref freq only)
  1574. */
  1575. WPA_IF_IBSS,
  1576. };
  1577. struct wpa_init_params {
  1578. void *global_priv;
  1579. const u8 *bssid;
  1580. const char *ifname;
  1581. const char *driver_params;
  1582. int use_pae_group_addr;
  1583. char **bridge;
  1584. size_t num_bridge;
  1585. u8 *own_addr; /* buffer for writing own MAC address */
  1586. };
  1587. struct wpa_bss_params {
  1588. /** Interface name (for multi-SSID/VLAN support) */
  1589. const char *ifname;
  1590. /** Whether IEEE 802.1X or WPA/WPA2 is enabled */
  1591. int enabled;
  1592. int wpa;
  1593. int ieee802_1x;
  1594. int wpa_group;
  1595. int wpa_pairwise;
  1596. int wpa_key_mgmt;
  1597. int rsn_preauth;
  1598. enum mfp_options ieee80211w;
  1599. };
  1600. #define WPA_STA_AUTHORIZED BIT(0)
  1601. #define WPA_STA_WMM BIT(1)
  1602. #define WPA_STA_SHORT_PREAMBLE BIT(2)
  1603. #define WPA_STA_MFP BIT(3)
  1604. #define WPA_STA_TDLS_PEER BIT(4)
  1605. #define WPA_STA_AUTHENTICATED BIT(5)
  1606. #define WPA_STA_ASSOCIATED BIT(6)
  1607. enum tdls_oper {
  1608. TDLS_DISCOVERY_REQ,
  1609. TDLS_SETUP,
  1610. TDLS_TEARDOWN,
  1611. TDLS_ENABLE_LINK,
  1612. TDLS_DISABLE_LINK,
  1613. TDLS_ENABLE,
  1614. TDLS_DISABLE
  1615. };
  1616. enum wnm_oper {
  1617. WNM_SLEEP_ENTER_CONFIRM,
  1618. WNM_SLEEP_ENTER_FAIL,
  1619. WNM_SLEEP_EXIT_CONFIRM,
  1620. WNM_SLEEP_EXIT_FAIL,
  1621. WNM_SLEEP_TFS_REQ_IE_ADD, /* STA requests driver to add TFS req IE */
  1622. WNM_SLEEP_TFS_REQ_IE_NONE, /* STA requests empty TFS req IE */
  1623. WNM_SLEEP_TFS_REQ_IE_SET, /* AP requests driver to set TFS req IE for
  1624. * a STA */
  1625. WNM_SLEEP_TFS_RESP_IE_ADD, /* AP requests driver to add TFS resp IE
  1626. * for a STA */
  1627. WNM_SLEEP_TFS_RESP_IE_NONE, /* AP requests empty TFS resp IE */
  1628. WNM_SLEEP_TFS_RESP_IE_SET, /* AP requests driver to set TFS resp IE
  1629. * for a STA */
  1630. WNM_SLEEP_TFS_IE_DEL /* AP delete the TFS IE */
  1631. };
  1632. /* enum chan_width - Channel width definitions */
  1633. enum chan_width {
  1634. CHAN_WIDTH_20_NOHT,
  1635. CHAN_WIDTH_20,
  1636. CHAN_WIDTH_40,
  1637. CHAN_WIDTH_80,
  1638. CHAN_WIDTH_80P80,
  1639. CHAN_WIDTH_160,
  1640. CHAN_WIDTH_UNKNOWN
  1641. };
  1642. /**
  1643. * struct wpa_signal_info - Information about channel signal quality
  1644. */
  1645. struct wpa_signal_info {
  1646. u32 frequency;
  1647. int above_threshold;
  1648. int current_signal;
  1649. int avg_signal;
  1650. int avg_beacon_signal;
  1651. int current_noise;
  1652. int current_txrate;
  1653. enum chan_width chanwidth;
  1654. int center_frq1;
  1655. int center_frq2;
  1656. };
  1657. /**
  1658. * struct beacon_data - Beacon data
  1659. * @head: Head portion of Beacon frame (before TIM IE)
  1660. * @tail: Tail portion of Beacon frame (after TIM IE)
  1661. * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
  1662. * @proberesp_ies: Extra information element(s) to add into Probe Response
  1663. * frames or %NULL
  1664. * @assocresp_ies: Extra information element(s) to add into (Re)Association
  1665. * Response frames or %NULL
  1666. * @probe_resp: Probe Response frame template
  1667. * @head_len: Length of @head
  1668. * @tail_len: Length of @tail
  1669. * @beacon_ies_len: Length of beacon_ies in octets
  1670. * @proberesp_ies_len: Length of proberesp_ies in octets
  1671. * @proberesp_ies_len: Length of proberesp_ies in octets
  1672. * @probe_resp_len: Length of probe response template (@probe_resp)
  1673. */
  1674. struct beacon_data {
  1675. u8 *head, *tail;
  1676. u8 *beacon_ies;
  1677. u8 *proberesp_ies;
  1678. u8 *assocresp_ies;
  1679. u8 *probe_resp;
  1680. size_t head_len, tail_len;
  1681. size_t beacon_ies_len;
  1682. size_t proberesp_ies_len;
  1683. size_t assocresp_ies_len;
  1684. size_t probe_resp_len;
  1685. };
  1686. /**
  1687. * struct csa_settings - Settings for channel switch command
  1688. * @cs_count: Count in Beacon frames (TBTT) to perform the switch
  1689. * @block_tx: 1 - block transmission for CSA period
  1690. * @freq_params: Next channel frequency parameter
  1691. * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
  1692. * @beacon_after: Next beacon/probe resp/asooc resp info
  1693. * @counter_offset_beacon: Offset to the count field in beacon's tail
  1694. * @counter_offset_presp: Offset to the count field in probe resp.
  1695. */
  1696. struct csa_settings {
  1697. u8 cs_count;
  1698. u8 block_tx;
  1699. struct hostapd_freq_params freq_params;
  1700. struct beacon_data beacon_csa;
  1701. struct beacon_data beacon_after;
  1702. u16 counter_offset_beacon[2];
  1703. u16 counter_offset_presp[2];
  1704. };
  1705. /* TDLS peer capabilities for send_tdls_mgmt() */
  1706. enum tdls_peer_capability {
  1707. TDLS_PEER_HT = BIT(0),
  1708. TDLS_PEER_VHT = BIT(1),
  1709. TDLS_PEER_WMM = BIT(2),
  1710. };
  1711. /* valid info in the wmm_params struct */
  1712. enum wmm_params_valid_info {
  1713. WMM_PARAMS_UAPSD_QUEUES_INFO = BIT(0),
  1714. };
  1715. /**
  1716. * struct wmm_params - WMM parameterss configured for this association
  1717. * @info_bitmap: Bitmap of valid wmm_params info; indicates what fields
  1718. * of the struct contain valid information.
  1719. * @uapsd_queues: Bitmap of ACs configured for uapsd (valid only if
  1720. * %WMM_PARAMS_UAPSD_QUEUES_INFO is set)
  1721. */
  1722. struct wmm_params {
  1723. u8 info_bitmap;
  1724. u8 uapsd_queues;
  1725. };
  1726. #ifdef CONFIG_MACSEC
  1727. struct macsec_init_params {
  1728. Boolean always_include_sci;
  1729. Boolean use_es;
  1730. Boolean use_scb;
  1731. };
  1732. #endif /* CONFIG_MACSEC */
  1733. enum drv_br_port_attr {
  1734. DRV_BR_PORT_ATTR_PROXYARP,
  1735. DRV_BR_PORT_ATTR_HAIRPIN_MODE,
  1736. };
  1737. enum drv_br_net_param {
  1738. DRV_BR_NET_PARAM_GARP_ACCEPT,
  1739. DRV_BR_MULTICAST_SNOOPING,
  1740. };
  1741. struct drv_acs_params {
  1742. /* Selected mode (HOSTAPD_MODE_*) */
  1743. enum hostapd_hw_mode hw_mode;
  1744. /* Indicates whether HT is enabled */
  1745. int ht_enabled;
  1746. /* Indicates whether HT40 is enabled */
  1747. int ht40_enabled;
  1748. /* Indicates whether VHT is enabled */
  1749. int vht_enabled;
  1750. /* Configured ACS channel width */
  1751. u16 ch_width;
  1752. /* ACS channel list info */
  1753. unsigned int ch_list_len;
  1754. const u8 *ch_list;
  1755. const int *freq_list;
  1756. };
  1757. struct wpa_bss_trans_info {
  1758. u8 mbo_transition_reason;
  1759. u8 n_candidates;
  1760. u8 *bssid;
  1761. };
  1762. struct wpa_bss_candidate_info {
  1763. u8 num;
  1764. struct candidate_list {
  1765. u8 bssid[ETH_ALEN];
  1766. u8 is_accept;
  1767. u32 reject_reason;
  1768. } *candidates;
  1769. };
  1770. struct wpa_pmkid_params {
  1771. const u8 *bssid;
  1772. const u8 *ssid;
  1773. size_t ssid_len;
  1774. const u8 *fils_cache_id;
  1775. const u8 *pmkid;
  1776. const u8 *pmk;
  1777. size_t pmk_len;
  1778. };
  1779. /* Mask used to specify which connection parameters have to be updated */
  1780. enum wpa_drv_update_connect_params_mask {
  1781. WPA_DRV_UPDATE_ASSOC_IES = BIT(0),
  1782. WPA_DRV_UPDATE_FILS_ERP_INFO = BIT(1),
  1783. WPA_DRV_UPDATE_AUTH_TYPE = BIT(2),
  1784. };
  1785. /**
  1786. * struct wpa_driver_ops - Driver interface API definition
  1787. *
  1788. * This structure defines the API that each driver interface needs to implement
  1789. * for core wpa_supplicant code. All driver specific functionality is captured
  1790. * in this wrapper.
  1791. */
  1792. struct wpa_driver_ops {
  1793. /** Name of the driver interface */
  1794. const char *name;
  1795. /** One line description of the driver interface */
  1796. const char *desc;
  1797. /**
  1798. * get_bssid - Get the current BSSID
  1799. * @priv: private driver interface data
  1800. * @bssid: buffer for BSSID (ETH_ALEN = 6 bytes)
  1801. *
  1802. * Returns: 0 on success, -1 on failure
  1803. *
  1804. * Query kernel driver for the current BSSID and copy it to bssid.
  1805. * Setting bssid to 00:00:00:00:00:00 is recommended if the STA is not
  1806. * associated.
  1807. */
  1808. int (*get_bssid)(void *priv, u8 *bssid);
  1809. /**
  1810. * get_ssid - Get the current SSID
  1811. * @priv: private driver interface data
  1812. * @ssid: buffer for SSID (at least 32 bytes)
  1813. *
  1814. * Returns: Length of the SSID on success, -1 on failure
  1815. *
  1816. * Query kernel driver for the current SSID and copy it to ssid.
  1817. * Returning zero is recommended if the STA is not associated.
  1818. *
  1819. * Note: SSID is an array of octets, i.e., it is not nul terminated and
  1820. * can, at least in theory, contain control characters (including nul)
  1821. * and as such, should be processed as binary data, not a printable
  1822. * string.
  1823. */
  1824. int (*get_ssid)(void *priv, u8 *ssid);
  1825. /**
  1826. * set_key - Configure encryption key
  1827. * @ifname: Interface name (for multi-SSID/VLAN support)
  1828. * @priv: private driver interface data
  1829. * @alg: encryption algorithm (%WPA_ALG_NONE, %WPA_ALG_WEP,
  1830. * %WPA_ALG_TKIP, %WPA_ALG_CCMP, %WPA_ALG_IGTK, %WPA_ALG_PMK,
  1831. * %WPA_ALG_GCMP, %WPA_ALG_GCMP_256, %WPA_ALG_CCMP_256,
  1832. * %WPA_ALG_BIP_GMAC_128, %WPA_ALG_BIP_GMAC_256,
  1833. * %WPA_ALG_BIP_CMAC_256);
  1834. * %WPA_ALG_NONE clears the key.
  1835. * @addr: Address of the peer STA (BSSID of the current AP when setting
  1836. * pairwise key in station mode), ff:ff:ff:ff:ff:ff for
  1837. * broadcast keys, %NULL for default keys that are used both for
  1838. * broadcast and unicast; when clearing keys, %NULL is used to
  1839. * indicate that both the broadcast-only and default key of the
  1840. * specified key index is to be cleared
  1841. * @key_idx: key index (0..3), usually 0 for unicast keys; 0..4095 for
  1842. * IGTK
  1843. * @set_tx: configure this key as the default Tx key (only used when
  1844. * driver does not support separate unicast/individual key
  1845. * @seq: sequence number/packet number, seq_len octets, the next
  1846. * packet number to be used for in replay protection; configured
  1847. * for Rx keys (in most cases, this is only used with broadcast
  1848. * keys and set to zero for unicast keys); %NULL if not set
  1849. * @seq_len: length of the seq, depends on the algorithm:
  1850. * TKIP: 6 octets, CCMP/GCMP: 6 octets, IGTK: 6 octets
  1851. * @key: key buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key,
  1852. * 8-byte Rx Mic Key
  1853. * @key_len: length of the key buffer in octets (WEP: 5 or 13,
  1854. * TKIP: 32, CCMP/GCMP: 16, IGTK: 16)
  1855. *
  1856. * Returns: 0 on success, -1 on failure
  1857. *
  1858. * Configure the given key for the kernel driver. If the driver
  1859. * supports separate individual keys (4 default keys + 1 individual),
  1860. * addr can be used to determine whether the key is default or
  1861. * individual. If only 4 keys are supported, the default key with key
  1862. * index 0 is used as the individual key. STA must be configured to use
  1863. * it as the default Tx key (set_tx is set) and accept Rx for all the
  1864. * key indexes. In most cases, WPA uses only key indexes 1 and 2 for
  1865. * broadcast keys, so key index 0 is available for this kind of
  1866. * configuration.
  1867. *
  1868. * Please note that TKIP keys include separate TX and RX MIC keys and
  1869. * some drivers may expect them in different order than wpa_supplicant
  1870. * is using. If the TX/RX keys are swapped, all TKIP encrypted packets
  1871. * will trigger Michael MIC errors. This can be fixed by changing the
  1872. * order of MIC keys by swapping te bytes 16..23 and 24..31 of the key
  1873. * in driver_*.c set_key() implementation, see driver_ndis.c for an
  1874. * example on how this can be done.
  1875. */
  1876. int (*set_key)(const char *ifname, void *priv, enum wpa_alg alg,
  1877. const u8 *addr, int key_idx, int set_tx,
  1878. const u8 *seq, size_t seq_len,
  1879. const u8 *key, size_t key_len);
  1880. /**
  1881. * init - Initialize driver interface
  1882. * @ctx: context to be used when calling wpa_supplicant functions,
  1883. * e.g., wpa_supplicant_event()
  1884. * @ifname: interface name, e.g., wlan0
  1885. *
  1886. * Returns: Pointer to private data, %NULL on failure
  1887. *
  1888. * Initialize driver interface, including event processing for kernel
  1889. * driver events (e.g., associated, scan results, Michael MIC failure).
  1890. * This function can allocate a private configuration data area for
  1891. * @ctx, file descriptor, interface name, etc. information that may be
  1892. * needed in future driver operations. If this is not used, non-NULL
  1893. * value will need to be returned because %NULL is used to indicate
  1894. * failure. The returned value will be used as 'void *priv' data for
  1895. * all other driver_ops functions.
  1896. *
  1897. * The main event loop (eloop.c) of wpa_supplicant can be used to
  1898. * register callback for read sockets (eloop_register_read_sock()).
  1899. *
  1900. * See below for more information about events and
  1901. * wpa_supplicant_event() function.
  1902. */
  1903. void * (*init)(void *ctx, const char *ifname);
  1904. /**
  1905. * deinit - Deinitialize driver interface
  1906. * @priv: private driver interface data from init()
  1907. *
  1908. * Shut down driver interface and processing of driver events. Free
  1909. * private data buffer if one was allocated in init() handler.
  1910. */
  1911. void (*deinit)(void *priv);
  1912. /**
  1913. * set_param - Set driver configuration parameters
  1914. * @priv: private driver interface data from init()
  1915. * @param: driver specific configuration parameters
  1916. *
  1917. * Returns: 0 on success, -1 on failure
  1918. *
  1919. * Optional handler for notifying driver interface about configuration
  1920. * parameters (driver_param).
  1921. */
  1922. int (*set_param)(void *priv, const char *param);
  1923. /**
  1924. * set_countermeasures - Enable/disable TKIP countermeasures
  1925. * @priv: private driver interface data
  1926. * @enabled: 1 = countermeasures enabled, 0 = disabled
  1927. *
  1928. * Returns: 0 on success, -1 on failure
  1929. *
  1930. * Configure TKIP countermeasures. When these are enabled, the driver
  1931. * should drop all received and queued frames that are using TKIP.
  1932. */
  1933. int (*set_countermeasures)(void *priv, int enabled);
  1934. /**
  1935. * deauthenticate - Request driver to deauthenticate
  1936. * @priv: private driver interface data
  1937. * @addr: peer address (BSSID of the AP)
  1938. * @reason_code: 16-bit reason code to be sent in the deauthentication
  1939. * frame
  1940. *
  1941. * Returns: 0 on success, -1 on failure
  1942. */
  1943. int (*deauthenticate)(void *priv, const u8 *addr, int reason_code);
  1944. /**
  1945. * associate - Request driver to associate
  1946. * @priv: private driver interface data
  1947. * @params: association parameters
  1948. *
  1949. * Returns: 0 on success, -1 on failure
  1950. */
  1951. int (*associate)(void *priv,
  1952. struct wpa_driver_associate_params *params);
  1953. /**
  1954. * add_pmkid - Add PMKSA cache entry to the driver
  1955. * @priv: private driver interface data
  1956. * @params: PMKSA parameters
  1957. *
  1958. * Returns: 0 on success, -1 on failure
  1959. *
  1960. * This function is called when a new PMK is received, as a result of
  1961. * either normal authentication or RSN pre-authentication. The PMKSA
  1962. * parameters are either a set of bssid, pmkid, and pmk; or a set of
  1963. * ssid, fils_cache_id, pmkid, and pmk.
  1964. *
  1965. * If the driver generates RSN IE, i.e., it does not use wpa_ie in
  1966. * associate(), add_pmkid() can be used to add new PMKSA cache entries
  1967. * in the driver. If the driver uses wpa_ie from wpa_supplicant, this
  1968. * driver_ops function does not need to be implemented. Likewise, if
  1969. * the driver does not support WPA, this function is not needed.
  1970. */
  1971. int (*add_pmkid)(void *priv, struct wpa_pmkid_params *params);
  1972. /**
  1973. * remove_pmkid - Remove PMKSA cache entry to the driver
  1974. * @priv: private driver interface data
  1975. * @params: PMKSA parameters
  1976. *
  1977. * Returns: 0 on success, -1 on failure
  1978. *
  1979. * This function is called when the supplicant drops a PMKSA cache
  1980. * entry for any reason. The PMKSA parameters are either a set of
  1981. * bssid and pmkid; or a set of ssid, fils_cache_id, and pmkid.
  1982. *
  1983. * If the driver generates RSN IE, i.e., it does not use wpa_ie in
  1984. * associate(), remove_pmkid() can be used to synchronize PMKSA caches
  1985. * between the driver and wpa_supplicant. If the driver uses wpa_ie
  1986. * from wpa_supplicant, this driver_ops function does not need to be
  1987. * implemented. Likewise, if the driver does not support WPA, this
  1988. * function is not needed.
  1989. */
  1990. int (*remove_pmkid)(void *priv, struct wpa_pmkid_params *params);
  1991. /**
  1992. * flush_pmkid - Flush PMKSA cache
  1993. * @priv: private driver interface data
  1994. *
  1995. * Returns: 0 on success, -1 on failure
  1996. *
  1997. * This function is called when the supplicant drops all PMKSA cache
  1998. * entries for any reason.
  1999. *
  2000. * If the driver generates RSN IE, i.e., it does not use wpa_ie in
  2001. * associate(), remove_pmkid() can be used to synchronize PMKSA caches
  2002. * between the driver and wpa_supplicant. If the driver uses wpa_ie
  2003. * from wpa_supplicant, this driver_ops function does not need to be
  2004. * implemented. Likewise, if the driver does not support WPA, this
  2005. * function is not needed.
  2006. */
  2007. int (*flush_pmkid)(void *priv);
  2008. /**
  2009. * get_capa - Get driver capabilities
  2010. * @priv: private driver interface data
  2011. *
  2012. * Returns: 0 on success, -1 on failure
  2013. *
  2014. * Get driver/firmware/hardware capabilities.
  2015. */
  2016. int (*get_capa)(void *priv, struct wpa_driver_capa *capa);
  2017. /**
  2018. * poll - Poll driver for association information
  2019. * @priv: private driver interface data
  2020. *
  2021. * This is an option callback that can be used when the driver does not
  2022. * provide event mechanism for association events. This is called when
  2023. * receiving WPA EAPOL-Key messages that require association
  2024. * information. The driver interface is supposed to generate associnfo
  2025. * event before returning from this callback function. In addition, the
  2026. * driver interface should generate an association event after having
  2027. * sent out associnfo.
  2028. */
  2029. void (*poll)(void *priv);
  2030. /**
  2031. * get_ifindex - Get interface index
  2032. * @priv: private driver interface data
  2033. *
  2034. * Returns: Interface index
  2035. */
  2036. unsigned int (*get_ifindex)(void *priv);
  2037. /**
  2038. * get_ifname - Get interface name
  2039. * @priv: private driver interface data
  2040. *
  2041. * Returns: Pointer to the interface name. This can differ from the
  2042. * interface name used in init() call. Init() is called first.
  2043. *
  2044. * This optional function can be used to allow the driver interface to
  2045. * replace the interface name with something else, e.g., based on an
  2046. * interface mapping from a more descriptive name.
  2047. */
  2048. const char * (*get_ifname)(void *priv);
  2049. /**
  2050. * get_mac_addr - Get own MAC address
  2051. * @priv: private driver interface data
  2052. *
  2053. * Returns: Pointer to own MAC address or %NULL on failure
  2054. *
  2055. * This optional function can be used to get the own MAC address of the
  2056. * device from the driver interface code. This is only needed if the
  2057. * l2_packet implementation for the OS does not provide easy access to
  2058. * a MAC address. */
  2059. const u8 * (*get_mac_addr)(void *priv);
  2060. /**
  2061. * set_operstate - Sets device operating state to DORMANT or UP
  2062. * @priv: private driver interface data
  2063. * @state: 0 = dormant, 1 = up
  2064. * Returns: 0 on success, -1 on failure
  2065. *
  2066. * This is an optional function that can be used on operating systems
  2067. * that support a concept of controlling network device state from user
  2068. * space applications. This function, if set, gets called with
  2069. * state = 1 when authentication has been completed and with state = 0
  2070. * when connection is lost.
  2071. */
  2072. int (*set_operstate)(void *priv, int state);
  2073. /**
  2074. * mlme_setprotection - MLME-SETPROTECTION.request primitive
  2075. * @priv: Private driver interface data
  2076. * @addr: Address of the station for which to set protection (may be
  2077. * %NULL for group keys)
  2078. * @protect_type: MLME_SETPROTECTION_PROTECT_TYPE_*
  2079. * @key_type: MLME_SETPROTECTION_KEY_TYPE_*
  2080. * Returns: 0 on success, -1 on failure
  2081. *
  2082. * This is an optional function that can be used to set the driver to
  2083. * require protection for Tx and/or Rx frames. This uses the layer
  2084. * interface defined in IEEE 802.11i-2004 clause 10.3.22.1
  2085. * (MLME-SETPROTECTION.request). Many drivers do not use explicit
  2086. * set protection operation; instead, they set protection implicitly
  2087. * based on configured keys.
  2088. */
  2089. int (*mlme_setprotection)(void *priv, const u8 *addr, int protect_type,
  2090. int key_type);
  2091. /**
  2092. * get_hw_feature_data - Get hardware support data (channels and rates)
  2093. * @priv: Private driver interface data
  2094. * @num_modes: Variable for returning the number of returned modes
  2095. * flags: Variable for returning hardware feature flags
  2096. * @dfs: Variable for returning DFS region (HOSTAPD_DFS_REGION_*)
  2097. * Returns: Pointer to allocated hardware data on success or %NULL on
  2098. * failure. Caller is responsible for freeing this.
  2099. */
  2100. struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
  2101. u16 *num_modes,
  2102. u16 *flags, u8 *dfs);
  2103. /**
  2104. * send_mlme - Send management frame from MLME
  2105. * @priv: Private driver interface data
  2106. * @data: IEEE 802.11 management frame with IEEE 802.11 header
  2107. * @data_len: Size of the management frame
  2108. * @noack: Do not wait for this frame to be acked (disable retries)
  2109. * @freq: Frequency (in MHz) to send the frame on, or 0 to let the
  2110. * driver decide
  2111. * @csa_offs: Array of CSA offsets or %NULL
  2112. * @csa_offs_len: Number of elements in csa_offs
  2113. * Returns: 0 on success, -1 on failure
  2114. */
  2115. int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
  2116. int noack, unsigned int freq, const u16 *csa_offs,
  2117. size_t csa_offs_len);
  2118. /**
  2119. * update_ft_ies - Update FT (IEEE 802.11r) IEs
  2120. * @priv: Private driver interface data
  2121. * @md: Mobility domain (2 octets) (also included inside ies)
  2122. * @ies: FT IEs (MDIE, FTIE, ...) or %NULL to remove IEs
  2123. * @ies_len: Length of FT IEs in bytes
  2124. * Returns: 0 on success, -1 on failure
  2125. *
  2126. * The supplicant uses this callback to let the driver know that keying
  2127. * material for FT is available and that the driver can use the
  2128. * provided IEs in the next message in FT authentication sequence.
  2129. *
  2130. * This function is only needed for driver that support IEEE 802.11r
  2131. * (Fast BSS Transition).
  2132. */
  2133. int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
  2134. size_t ies_len);
  2135. /**
  2136. * get_scan_results2 - Fetch the latest scan results
  2137. * @priv: private driver interface data
  2138. *
  2139. * Returns: Allocated buffer of scan results (caller is responsible for
  2140. * freeing the data structure) on success, NULL on failure
  2141. */
  2142. struct wpa_scan_results * (*get_scan_results2)(void *priv);
  2143. /**
  2144. * set_country - Set country
  2145. * @priv: Private driver interface data
  2146. * @alpha2: country to which to switch to
  2147. * Returns: 0 on success, -1 on failure
  2148. *
  2149. * This function is for drivers which support some form
  2150. * of setting a regulatory domain.
  2151. */
  2152. int (*set_country)(void *priv, const char *alpha2);
  2153. /**
  2154. * get_country - Get country
  2155. * @priv: Private driver interface data
  2156. * @alpha2: Buffer for returning country code (at least 3 octets)
  2157. * Returns: 0 on success, -1 on failure
  2158. */
  2159. int (*get_country)(void *priv, char *alpha2);
  2160. /**
  2161. * global_init - Global driver initialization
  2162. * @ctx: wpa_global pointer
  2163. * Returns: Pointer to private data (global), %NULL on failure
  2164. *
  2165. * This optional function is called to initialize the driver wrapper
  2166. * for global data, i.e., data that applies to all interfaces. If this
  2167. * function is implemented, global_deinit() will also need to be
  2168. * implemented to free the private data. The driver will also likely
  2169. * use init2() function instead of init() to get the pointer to global
  2170. * data available to per-interface initializer.
  2171. */
  2172. void * (*global_init)(void *ctx);
  2173. /**
  2174. * global_deinit - Global driver deinitialization
  2175. * @priv: private driver global data from global_init()
  2176. *
  2177. * Terminate any global driver related functionality and free the
  2178. * global data structure.
  2179. */
  2180. void (*global_deinit)(void *priv);
  2181. /**
  2182. * init2 - Initialize driver interface (with global data)
  2183. * @ctx: context to be used when calling wpa_supplicant functions,
  2184. * e.g., wpa_supplicant_event()
  2185. * @ifname: interface name, e.g., wlan0
  2186. * @global_priv: private driver global data from global_init()
  2187. * Returns: Pointer to private data, %NULL on failure
  2188. *
  2189. * This function can be used instead of init() if the driver wrapper
  2190. * uses global data.
  2191. */
  2192. void * (*init2)(void *ctx, const char *ifname, void *global_priv);
  2193. /**
  2194. * get_interfaces - Get information about available interfaces
  2195. * @global_priv: private driver global data from global_init()
  2196. * Returns: Allocated buffer of interface information (caller is
  2197. * responsible for freeing the data structure) on success, NULL on
  2198. * failure
  2199. */
  2200. struct wpa_interface_info * (*get_interfaces)(void *global_priv);
  2201. /**
  2202. * scan2 - Request the driver to initiate scan
  2203. * @priv: private driver interface data
  2204. * @params: Scan parameters
  2205. *
  2206. * Returns: 0 on success, -1 on failure
  2207. *
  2208. * Once the scan results are ready, the driver should report scan
  2209. * results event for wpa_supplicant which will eventually request the
  2210. * results with wpa_driver_get_scan_results2().
  2211. */
  2212. int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
  2213. /**
  2214. * authenticate - Request driver to authenticate
  2215. * @priv: private driver interface data
  2216. * @params: authentication parameters
  2217. * Returns: 0 on success, -1 on failure
  2218. *
  2219. * This is an optional function that can be used with drivers that
  2220. * support separate authentication and association steps, i.e., when
  2221. * wpa_supplicant can act as the SME. If not implemented, associate()
  2222. * function is expected to take care of IEEE 802.11 authentication,
  2223. * too.
  2224. */
  2225. int (*authenticate)(void *priv,
  2226. struct wpa_driver_auth_params *params);
  2227. /**
  2228. * set_ap - Set Beacon and Probe Response information for AP mode
  2229. * @priv: Private driver interface data
  2230. * @params: Parameters to use in AP mode
  2231. *
  2232. * This function is used to configure Beacon template and/or extra IEs
  2233. * to add for Beacon and Probe Response frames for the driver in
  2234. * AP mode. The driver is responsible for building the full Beacon
  2235. * frame by concatenating the head part with TIM IE generated by the
  2236. * driver/firmware and finishing with the tail part. Depending on the
  2237. * driver architectue, this can be done either by using the full
  2238. * template or the set of additional IEs (e.g., WPS and P2P IE).
  2239. * Similarly, Probe Response processing depends on the driver design.
  2240. * If the driver (or firmware) takes care of replying to Probe Request
  2241. * frames, the extra IEs provided here needs to be added to the Probe
  2242. * Response frames.
  2243. *
  2244. * Returns: 0 on success, -1 on failure
  2245. */
  2246. int (*set_ap)(void *priv, struct wpa_driver_ap_params *params);
  2247. /**
  2248. * set_acl - Set ACL in AP mode
  2249. * @priv: Private driver interface data
  2250. * @params: Parameters to configure ACL
  2251. * Returns: 0 on success, -1 on failure
  2252. *
  2253. * This is used only for the drivers which support MAC address ACL.
  2254. */
  2255. int (*set_acl)(void *priv, struct hostapd_acl_params *params);
  2256. /**
  2257. * hapd_init - Initialize driver interface (hostapd only)
  2258. * @hapd: Pointer to hostapd context
  2259. * @params: Configuration for the driver wrapper
  2260. * Returns: Pointer to private data, %NULL on failure
  2261. *
  2262. * This function is used instead of init() or init2() when the driver
  2263. * wrapper is used with hostapd.
  2264. */
  2265. void * (*hapd_init)(struct hostapd_data *hapd,
  2266. struct wpa_init_params *params);
  2267. /**
  2268. * hapd_deinit - Deinitialize driver interface (hostapd only)
  2269. * @priv: Private driver interface data from hapd_init()
  2270. */
  2271. void (*hapd_deinit)(void *priv);
  2272. /**
  2273. * set_ieee8021x - Enable/disable IEEE 802.1X support (AP only)
  2274. * @priv: Private driver interface data
  2275. * @params: BSS parameters
  2276. * Returns: 0 on success, -1 on failure
  2277. *
  2278. * This is an optional function to configure the kernel driver to
  2279. * enable/disable IEEE 802.1X support and set WPA/WPA2 parameters. This
  2280. * can be left undefined (set to %NULL) if IEEE 802.1X support is
  2281. * always enabled and the driver uses set_ap() to set WPA/RSN IE
  2282. * for Beacon frames.
  2283. *
  2284. * DEPRECATED - use set_ap() instead
  2285. */
  2286. int (*set_ieee8021x)(void *priv, struct wpa_bss_params *params);
  2287. /**
  2288. * set_privacy - Enable/disable privacy (AP only)
  2289. * @priv: Private driver interface data
  2290. * @enabled: 1 = privacy enabled, 0 = disabled
  2291. * Returns: 0 on success, -1 on failure
  2292. *
  2293. * This is an optional function to configure privacy field in the
  2294. * kernel driver for Beacon frames. This can be left undefined (set to
  2295. * %NULL) if the driver uses the Beacon template from set_ap().
  2296. *
  2297. * DEPRECATED - use set_ap() instead
  2298. */
  2299. int (*set_privacy)(void *priv, int enabled);
  2300. /**
  2301. * get_seqnum - Fetch the current TSC/packet number (AP only)
  2302. * @ifname: The interface name (main or virtual)
  2303. * @priv: Private driver interface data
  2304. * @addr: MAC address of the station or %NULL for group keys
  2305. * @idx: Key index
  2306. * @seq: Buffer for returning the latest used TSC/packet number
  2307. * Returns: 0 on success, -1 on failure
  2308. *
  2309. * This function is used to fetch the last used TSC/packet number for
  2310. * a TKIP, CCMP, GCMP, or BIP/IGTK key. It is mainly used with group
  2311. * keys, so there is no strict requirement on implementing support for
  2312. * unicast keys (i.e., addr != %NULL).
  2313. */
  2314. int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
  2315. int idx, u8 *seq);
  2316. /**
  2317. * flush - Flush all association stations (AP only)
  2318. * @priv: Private driver interface data
  2319. * Returns: 0 on success, -1 on failure
  2320. *
  2321. * This function requests the driver to disassociate all associated
  2322. * stations. This function does not need to be implemented if the
  2323. * driver does not process association frames internally.
  2324. */
  2325. int (*flush)(void *priv);
  2326. /**
  2327. * set_generic_elem - Add IEs into Beacon/Probe Response frames (AP)
  2328. * @priv: Private driver interface data
  2329. * @elem: Information elements
  2330. * @elem_len: Length of the elem buffer in octets
  2331. * Returns: 0 on success, -1 on failure
  2332. *
  2333. * This is an optional function to add information elements in the
  2334. * kernel driver for Beacon and Probe Response frames. This can be left
  2335. * undefined (set to %NULL) if the driver uses the Beacon template from
  2336. * set_ap().
  2337. *
  2338. * DEPRECATED - use set_ap() instead
  2339. */
  2340. int (*set_generic_elem)(void *priv, const u8 *elem, size_t elem_len);
  2341. /**
  2342. * read_sta_data - Fetch station data
  2343. * @priv: Private driver interface data
  2344. * @data: Buffer for returning station information
  2345. * @addr: MAC address of the station
  2346. * Returns: 0 on success, -1 on failure
  2347. */
  2348. int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
  2349. const u8 *addr);
  2350. /**
  2351. * hapd_send_eapol - Send an EAPOL packet (AP only)
  2352. * @priv: private driver interface data
  2353. * @addr: Destination MAC address
  2354. * @data: EAPOL packet starting with IEEE 802.1X header
  2355. * @data_len: Length of the EAPOL packet in octets
  2356. * @encrypt: Whether the frame should be encrypted
  2357. * @own_addr: Source MAC address
  2358. * @flags: WPA_STA_* flags for the destination station
  2359. *
  2360. * Returns: 0 on success, -1 on failure
  2361. */
  2362. int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
  2363. size_t data_len, int encrypt,
  2364. const u8 *own_addr, u32 flags);
  2365. /**
  2366. * sta_deauth - Deauthenticate a station (AP only)
  2367. * @priv: Private driver interface data
  2368. * @own_addr: Source address and BSSID for the Deauthentication frame
  2369. * @addr: MAC address of the station to deauthenticate
  2370. * @reason: Reason code for the Deauthentiation frame
  2371. * Returns: 0 on success, -1 on failure
  2372. *
  2373. * This function requests a specific station to be deauthenticated and
  2374. * a Deauthentication frame to be sent to it.
  2375. */
  2376. int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
  2377. int reason);
  2378. /**
  2379. * sta_disassoc - Disassociate a station (AP only)
  2380. * @priv: Private driver interface data
  2381. * @own_addr: Source address and BSSID for the Disassociation frame
  2382. * @addr: MAC address of the station to disassociate
  2383. * @reason: Reason code for the Disassociation frame
  2384. * Returns: 0 on success, -1 on failure
  2385. *
  2386. * This function requests a specific station to be disassociated and
  2387. * a Disassociation frame to be sent to it.
  2388. */
  2389. int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
  2390. int reason);
  2391. /**
  2392. * sta_remove - Remove a station entry (AP only)
  2393. * @priv: Private driver interface data
  2394. * @addr: MAC address of the station to be removed
  2395. * Returns: 0 on success, -1 on failure
  2396. */
  2397. int (*sta_remove)(void *priv, const u8 *addr);
  2398. /**
  2399. * hapd_get_ssid - Get the current SSID (AP only)
  2400. * @priv: Private driver interface data
  2401. * @buf: Buffer for returning the SSID
  2402. * @len: Maximum length of the buffer
  2403. * Returns: Length of the SSID on success, -1 on failure
  2404. *
  2405. * This function need not be implemented if the driver uses Beacon
  2406. * template from set_ap() and does not reply to Probe Request frames.
  2407. */
  2408. int (*hapd_get_ssid)(void *priv, u8 *buf, int len);
  2409. /**
  2410. * hapd_set_ssid - Set SSID (AP only)
  2411. * @priv: Private driver interface data
  2412. * @buf: SSID
  2413. * @len: Length of the SSID in octets
  2414. * Returns: 0 on success, -1 on failure
  2415. *
  2416. * DEPRECATED - use set_ap() instead
  2417. */
  2418. int (*hapd_set_ssid)(void *priv, const u8 *buf, int len);
  2419. /**
  2420. * hapd_set_countermeasures - Enable/disable TKIP countermeasures (AP)
  2421. * @priv: Private driver interface data
  2422. * @enabled: 1 = countermeasures enabled, 0 = disabled
  2423. * Returns: 0 on success, -1 on failure
  2424. *
  2425. * This need not be implemented if the driver does not take care of
  2426. * association processing.
  2427. */
  2428. int (*hapd_set_countermeasures)(void *priv, int enabled);
  2429. /**
  2430. * sta_add - Add a station entry
  2431. * @priv: Private driver interface data
  2432. * @params: Station parameters
  2433. * Returns: 0 on success, -1 on failure
  2434. *
  2435. * This function is used to add or set (params->set 1) a station
  2436. * entry in the driver. Adding STA entries is used only if the driver
  2437. * does not take care of association processing.
  2438. *
  2439. * With drivers that don't support full AP client state, this function
  2440. * is used to add a station entry to the driver once the station has
  2441. * completed association.
  2442. *
  2443. * With TDLS, this function is used to add or set (params->set 1)
  2444. * TDLS peer entries (even with drivers that do not support full AP
  2445. * client state).
  2446. */
  2447. int (*sta_add)(void *priv, struct hostapd_sta_add_params *params);
  2448. /**
  2449. * get_inact_sec - Get station inactivity duration (AP only)
  2450. * @priv: Private driver interface data
  2451. * @addr: Station address
  2452. * Returns: Number of seconds station has been inactive, -1 on failure
  2453. */
  2454. int (*get_inact_sec)(void *priv, const u8 *addr);
  2455. /**
  2456. * sta_clear_stats - Clear station statistics (AP only)
  2457. * @priv: Private driver interface data
  2458. * @addr: Station address
  2459. * Returns: 0 on success, -1 on failure
  2460. */
  2461. int (*sta_clear_stats)(void *priv, const u8 *addr);
  2462. /**
  2463. * set_freq - Set channel/frequency (AP only)
  2464. * @priv: Private driver interface data
  2465. * @freq: Channel parameters
  2466. * Returns: 0 on success, -1 on failure
  2467. */
  2468. int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
  2469. /**
  2470. * set_rts - Set RTS threshold
  2471. * @priv: Private driver interface data
  2472. * @rts: RTS threshold in octets
  2473. * Returns: 0 on success, -1 on failure
  2474. */
  2475. int (*set_rts)(void *priv, int rts);
  2476. /**
  2477. * set_frag - Set fragmentation threshold
  2478. * @priv: Private driver interface data
  2479. * @frag: Fragmentation threshold in octets
  2480. * Returns: 0 on success, -1 on failure
  2481. */
  2482. int (*set_frag)(void *priv, int frag);
  2483. /**
  2484. * sta_set_flags - Set station flags (AP only)
  2485. * @priv: Private driver interface data
  2486. * @addr: Station address
  2487. * @total_flags: Bitmap of all WPA_STA_* flags currently set
  2488. * @flags_or: Bitmap of WPA_STA_* flags to add
  2489. * @flags_and: Bitmap of WPA_STA_* flags to us as a mask
  2490. * Returns: 0 on success, -1 on failure
  2491. */
  2492. int (*sta_set_flags)(void *priv, const u8 *addr,
  2493. unsigned int total_flags, unsigned int flags_or,
  2494. unsigned int flags_and);
  2495. /**
  2496. * set_tx_queue_params - Set TX queue parameters
  2497. * @priv: Private driver interface data
  2498. * @queue: Queue number (0 = VO, 1 = VI, 2 = BE, 3 = BK)
  2499. * @aifs: AIFS
  2500. * @cw_min: cwMin
  2501. * @cw_max: cwMax
  2502. * @burst_time: Maximum length for bursting in 0.1 msec units
  2503. */
  2504. int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
  2505. int cw_max, int burst_time);
  2506. /**
  2507. * if_add - Add a virtual interface
  2508. * @priv: Private driver interface data
  2509. * @type: Interface type
  2510. * @ifname: Interface name for the new virtual interface
  2511. * @addr: Local address to use for the interface or %NULL to use the
  2512. * parent interface address
  2513. * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces
  2514. * @drv_priv: Pointer for overwriting the driver context or %NULL if
  2515. * not allowed (applies only to %WPA_IF_AP_BSS type)
  2516. * @force_ifname: Buffer for returning an interface name that the
  2517. * driver ended up using if it differs from the requested ifname
  2518. * @if_addr: Buffer for returning the allocated interface address
  2519. * (this may differ from the requested addr if the driver cannot
  2520. * change interface address)
  2521. * @bridge: Bridge interface to use or %NULL if no bridge configured
  2522. * @use_existing: Whether to allow existing interface to be used
  2523. * @setup_ap: Whether to setup AP for %WPA_IF_AP_BSS interfaces
  2524. * Returns: 0 on success, -1 on failure
  2525. */
  2526. int (*if_add)(void *priv, enum wpa_driver_if_type type,
  2527. const char *ifname, const u8 *addr, void *bss_ctx,
  2528. void **drv_priv, char *force_ifname, u8 *if_addr,
  2529. const char *bridge, int use_existing, int setup_ap);
  2530. /**
  2531. * if_remove - Remove a virtual interface
  2532. * @priv: Private driver interface data
  2533. * @type: Interface type
  2534. * @ifname: Interface name of the virtual interface to be removed
  2535. * Returns: 0 on success, -1 on failure
  2536. */
  2537. int (*if_remove)(void *priv, enum wpa_driver_if_type type,
  2538. const char *ifname);
  2539. /**
  2540. * set_sta_vlan - Bind a station into a specific interface (AP only)
  2541. * @priv: Private driver interface data
  2542. * @ifname: Interface (main or virtual BSS or VLAN)
  2543. * @addr: MAC address of the associated station
  2544. * @vlan_id: VLAN ID
  2545. * Returns: 0 on success, -1 on failure
  2546. *
  2547. * This function is used to bind a station to a specific virtual
  2548. * interface. It is only used if when virtual interfaces are supported,
  2549. * e.g., to assign stations to different VLAN interfaces based on
  2550. * information from a RADIUS server. This allows separate broadcast
  2551. * domains to be used with a single BSS.
  2552. */
  2553. int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
  2554. int vlan_id);
  2555. /**
  2556. * commit - Optional commit changes handler (AP only)
  2557. * @priv: driver private data
  2558. * Returns: 0 on success, -1 on failure
  2559. *
  2560. * This optional handler function can be registered if the driver
  2561. * interface implementation needs to commit changes (e.g., by setting
  2562. * network interface up) at the end of initial configuration. If set,
  2563. * this handler will be called after initial setup has been completed.
  2564. */
  2565. int (*commit)(void *priv);
  2566. /**
  2567. * send_ether - Send an ethernet packet (AP only)
  2568. * @priv: private driver interface data
  2569. * @dst: Destination MAC address
  2570. * @src: Source MAC address
  2571. * @proto: Ethertype
  2572. * @data: EAPOL packet starting with IEEE 802.1X header
  2573. * @data_len: Length of the EAPOL packet in octets
  2574. * Returns: 0 on success, -1 on failure
  2575. */
  2576. int (*send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto,
  2577. const u8 *data, size_t data_len);
  2578. /**
  2579. * set_radius_acl_auth - Notification of RADIUS ACL change
  2580. * @priv: Private driver interface data
  2581. * @mac: MAC address of the station
  2582. * @accepted: Whether the station was accepted
  2583. * @session_timeout: Session timeout for the station
  2584. * Returns: 0 on success, -1 on failure
  2585. */
  2586. int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
  2587. u32 session_timeout);
  2588. /**
  2589. * set_radius_acl_expire - Notification of RADIUS ACL expiration
  2590. * @priv: Private driver interface data
  2591. * @mac: MAC address of the station
  2592. * Returns: 0 on success, -1 on failure
  2593. */
  2594. int (*set_radius_acl_expire)(void *priv, const u8 *mac);
  2595. /**
  2596. * set_ap_wps_ie - Add WPS IE(s) into Beacon/Probe Response frames (AP)
  2597. * @priv: Private driver interface data
  2598. * @beacon: WPS IE(s) for Beacon frames or %NULL to remove extra IE(s)
  2599. * @proberesp: WPS IE(s) for Probe Response frames or %NULL to remove
  2600. * extra IE(s)
  2601. * @assocresp: WPS IE(s) for (Re)Association Response frames or %NULL
  2602. * to remove extra IE(s)
  2603. * Returns: 0 on success, -1 on failure
  2604. *
  2605. * This is an optional function to add WPS IE in the kernel driver for
  2606. * Beacon and Probe Response frames. This can be left undefined (set
  2607. * to %NULL) if the driver uses the Beacon template from set_ap()
  2608. * and does not process Probe Request frames. If the driver takes care
  2609. * of (Re)Association frame processing, the assocresp buffer includes
  2610. * WPS IE(s) that need to be added to (Re)Association Response frames
  2611. * whenever a (Re)Association Request frame indicated use of WPS.
  2612. *
  2613. * This will also be used to add P2P IE(s) into Beacon/Probe Response
  2614. * frames when operating as a GO. The driver is responsible for adding
  2615. * timing related attributes (e.g., NoA) in addition to the IEs
  2616. * included here by appending them after these buffers. This call is
  2617. * also used to provide Probe Response IEs for P2P Listen state
  2618. * operations for drivers that generate the Probe Response frames
  2619. * internally.
  2620. *
  2621. * DEPRECATED - use set_ap() instead
  2622. */
  2623. int (*set_ap_wps_ie)(void *priv, const struct wpabuf *beacon,
  2624. const struct wpabuf *proberesp,
  2625. const struct wpabuf *assocresp);
  2626. /**
  2627. * set_supp_port - Set IEEE 802.1X Supplicant Port status
  2628. * @priv: Private driver interface data
  2629. * @authorized: Whether the port is authorized
  2630. * Returns: 0 on success, -1 on failure
  2631. */
  2632. int (*set_supp_port)(void *priv, int authorized);
  2633. /**
  2634. * set_wds_sta - Bind a station into a 4-address WDS (AP only)
  2635. * @priv: Private driver interface data
  2636. * @addr: MAC address of the associated station
  2637. * @aid: Association ID
  2638. * @val: 1 = bind to 4-address WDS; 0 = unbind
  2639. * @bridge_ifname: Bridge interface to use for the WDS station or %NULL
  2640. * to indicate that bridge is not to be used
  2641. * @ifname_wds: Buffer to return the interface name for the new WDS
  2642. * station or %NULL to indicate name is not returned.
  2643. * Returns: 0 on success, -1 on failure
  2644. */
  2645. int (*set_wds_sta)(void *priv, const u8 *addr, int aid, int val,
  2646. const char *bridge_ifname, char *ifname_wds);
  2647. /**
  2648. * send_action - Transmit an Action frame
  2649. * @priv: Private driver interface data
  2650. * @freq: Frequency (in MHz) of the channel
  2651. * @wait: Time to wait off-channel for a response (in ms), or zero
  2652. * @dst: Destination MAC address (Address 1)
  2653. * @src: Source MAC address (Address 2)
  2654. * @bssid: BSSID (Address 3)
  2655. * @data: Frame body
  2656. * @data_len: data length in octets
  2657. @ @no_cck: Whether CCK rates must not be used to transmit this frame
  2658. * Returns: 0 on success, -1 on failure
  2659. *
  2660. * This command can be used to request the driver to transmit an action
  2661. * frame to the specified destination.
  2662. *
  2663. * If the %WPA_DRIVER_FLAGS_OFFCHANNEL_TX flag is set, the frame will
  2664. * be transmitted on the given channel and the device will wait for a
  2665. * response on that channel for the given wait time.
  2666. *
  2667. * If the flag is not set, the wait time will be ignored. In this case,
  2668. * if a remain-on-channel duration is in progress, the frame must be
  2669. * transmitted on that channel; alternatively the frame may be sent on
  2670. * the current operational channel (if in associated state in station
  2671. * mode or while operating as an AP.)
  2672. *
  2673. * If @src differs from the device MAC address, use of a random
  2674. * transmitter address is requested for this message exchange.
  2675. */
  2676. int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
  2677. const u8 *dst, const u8 *src, const u8 *bssid,
  2678. const u8 *data, size_t data_len, int no_cck);
  2679. /**
  2680. * send_action_cancel_wait - Cancel action frame TX wait
  2681. * @priv: Private driver interface data
  2682. *
  2683. * This command cancels the wait time associated with sending an action
  2684. * frame. It is only available when %WPA_DRIVER_FLAGS_OFFCHANNEL_TX is
  2685. * set in the driver flags.
  2686. */
  2687. void (*send_action_cancel_wait)(void *priv);
  2688. /**
  2689. * remain_on_channel - Remain awake on a channel
  2690. * @priv: Private driver interface data
  2691. * @freq: Frequency (in MHz) of the channel
  2692. * @duration: Duration in milliseconds
  2693. * Returns: 0 on success, -1 on failure
  2694. *
  2695. * This command is used to request the driver to remain awake on the
  2696. * specified channel for the specified duration and report received
  2697. * Action frames with EVENT_RX_MGMT events. Optionally, received
  2698. * Probe Request frames may also be requested to be reported by calling
  2699. * probe_req_report(). These will be reported with EVENT_RX_PROBE_REQ.
  2700. *
  2701. * The driver may not be at the requested channel when this function
  2702. * returns, i.e., the return code is only indicating whether the
  2703. * request was accepted. The caller will need to wait until the
  2704. * EVENT_REMAIN_ON_CHANNEL event indicates that the driver has
  2705. * completed the channel change. This may take some time due to other
  2706. * need for the radio and the caller should be prepared to timing out
  2707. * its wait since there are no guarantees on when this request can be
  2708. * executed.
  2709. */
  2710. int (*remain_on_channel)(void *priv, unsigned int freq,
  2711. unsigned int duration);
  2712. /**
  2713. * cancel_remain_on_channel - Cancel remain-on-channel operation
  2714. * @priv: Private driver interface data
  2715. *
  2716. * This command can be used to cancel a remain-on-channel operation
  2717. * before its originally requested duration has passed. This could be
  2718. * used, e.g., when remain_on_channel() is used to request extra time
  2719. * to receive a response to an Action frame and the response is
  2720. * received when there is still unneeded time remaining on the
  2721. * remain-on-channel operation.
  2722. */
  2723. int (*cancel_remain_on_channel)(void *priv);
  2724. /**
  2725. * probe_req_report - Request Probe Request frames to be indicated
  2726. * @priv: Private driver interface data
  2727. * @report: Whether to report received Probe Request frames
  2728. * Returns: 0 on success, -1 on failure (or if not supported)
  2729. *
  2730. * This command can be used to request the driver to indicate when
  2731. * Probe Request frames are received with EVENT_RX_PROBE_REQ events.
  2732. * Since this operation may require extra resources, e.g., due to less
  2733. * optimal hardware/firmware RX filtering, many drivers may disable
  2734. * Probe Request reporting at least in station mode. This command is
  2735. * used to notify the driver when the Probe Request frames need to be
  2736. * reported, e.g., during remain-on-channel operations.
  2737. */
  2738. int (*probe_req_report)(void *priv, int report);
  2739. /**
  2740. * deinit_ap - Deinitialize AP mode
  2741. * @priv: Private driver interface data
  2742. * Returns: 0 on success, -1 on failure (or if not supported)
  2743. *
  2744. * This optional function can be used to disable AP mode related
  2745. * configuration. If the interface was not dynamically added,
  2746. * change the driver mode to station mode to allow normal station
  2747. * operations like scanning to be completed.
  2748. */
  2749. int (*deinit_ap)(void *priv);
  2750. /**
  2751. * deinit_p2p_cli - Deinitialize P2P client mode
  2752. * @priv: Private driver interface data
  2753. * Returns: 0 on success, -1 on failure (or if not supported)
  2754. *
  2755. * This optional function can be used to disable P2P client mode. If the
  2756. * interface was not dynamically added, change the interface type back
  2757. * to station mode.
  2758. */
  2759. int (*deinit_p2p_cli)(void *priv);
  2760. /**
  2761. * suspend - Notification on system suspend/hibernate event
  2762. * @priv: Private driver interface data
  2763. */
  2764. void (*suspend)(void *priv);
  2765. /**
  2766. * resume - Notification on system resume/thaw event
  2767. * @priv: Private driver interface data
  2768. */
  2769. void (*resume)(void *priv);
  2770. /**
  2771. * signal_monitor - Set signal monitoring parameters
  2772. * @priv: Private driver interface data
  2773. * @threshold: Threshold value for signal change events; 0 = disabled
  2774. * @hysteresis: Minimum change in signal strength before indicating a
  2775. * new event
  2776. * Returns: 0 on success, -1 on failure (or if not supported)
  2777. *
  2778. * This function can be used to configure monitoring of signal strength
  2779. * with the current AP. Whenever signal strength drops below the
  2780. * %threshold value or increases above it, EVENT_SIGNAL_CHANGE event
  2781. * should be generated assuming the signal strength has changed at
  2782. * least %hysteresis from the previously indicated signal change event.
  2783. */
  2784. int (*signal_monitor)(void *priv, int threshold, int hysteresis);
  2785. /**
  2786. * send_frame - Send IEEE 802.11 frame (testing use only)
  2787. * @priv: Private driver interface data
  2788. * @data: IEEE 802.11 frame with IEEE 802.11 header
  2789. * @data_len: Size of the frame
  2790. * @encrypt: Whether to encrypt the frame (if keys are set)
  2791. * Returns: 0 on success, -1 on failure
  2792. *
  2793. * This function is only used for debugging purposes and is not
  2794. * required to be implemented for normal operations.
  2795. */
  2796. int (*send_frame)(void *priv, const u8 *data, size_t data_len,
  2797. int encrypt);
  2798. /**
  2799. * get_noa - Get current Notice of Absence attribute payload
  2800. * @priv: Private driver interface data
  2801. * @buf: Buffer for returning NoA
  2802. * @buf_len: Buffer length in octets
  2803. * Returns: Number of octets used in buf, 0 to indicate no NoA is being
  2804. * advertized, or -1 on failure
  2805. *
  2806. * This function is used to fetch the current Notice of Absence
  2807. * attribute value from GO.
  2808. */
  2809. int (*get_noa)(void *priv, u8 *buf, size_t buf_len);
  2810. /**
  2811. * set_noa - Set Notice of Absence parameters for GO (testing)
  2812. * @priv: Private driver interface data
  2813. * @count: Count
  2814. * @start: Start time in ms from next TBTT
  2815. * @duration: Duration in ms
  2816. * Returns: 0 on success or -1 on failure
  2817. *
  2818. * This function is used to set Notice of Absence parameters for GO. It
  2819. * is used only for testing. To disable NoA, all parameters are set to
  2820. * 0.
  2821. */
  2822. int (*set_noa)(void *priv, u8 count, int start, int duration);
  2823. /**
  2824. * set_p2p_powersave - Set P2P power save options
  2825. * @priv: Private driver interface data
  2826. * @legacy_ps: 0 = disable, 1 = enable, 2 = maximum PS, -1 = no change
  2827. * @opp_ps: 0 = disable, 1 = enable, -1 = no change
  2828. * @ctwindow: 0.. = change (msec), -1 = no change
  2829. * Returns: 0 on success or -1 on failure
  2830. */
  2831. int (*set_p2p_powersave)(void *priv, int legacy_ps, int opp_ps,
  2832. int ctwindow);
  2833. /**
  2834. * ampdu - Enable/disable aggregation
  2835. * @priv: Private driver interface data
  2836. * @ampdu: 1/0 = enable/disable A-MPDU aggregation
  2837. * Returns: 0 on success or -1 on failure
  2838. */
  2839. int (*ampdu)(void *priv, int ampdu);
  2840. /**
  2841. * get_radio_name - Get physical radio name for the device
  2842. * @priv: Private driver interface data
  2843. * Returns: Radio name or %NULL if not known
  2844. *
  2845. * The returned data must not be modified by the caller. It is assumed
  2846. * that any interface that has the same radio name as another is
  2847. * sharing the same physical radio. This information can be used to
  2848. * share scan results etc. information between the virtual interfaces
  2849. * to speed up various operations.
  2850. */
  2851. const char * (*get_radio_name)(void *priv);
  2852. /**
  2853. * send_tdls_mgmt - for sending TDLS management packets
  2854. * @priv: private driver interface data
  2855. * @dst: Destination (peer) MAC address
  2856. * @action_code: TDLS action code for the mssage
  2857. * @dialog_token: Dialog Token to use in the message (if needed)
  2858. * @status_code: Status Code or Reason Code to use (if needed)
  2859. * @peer_capab: TDLS peer capability (TDLS_PEER_* bitfield)
  2860. * @initiator: Is the current end the TDLS link initiator
  2861. * @buf: TDLS IEs to add to the message
  2862. * @len: Length of buf in octets
  2863. * Returns: 0 on success, negative (<0) on failure
  2864. *
  2865. * This optional function can be used to send packet to driver which is
  2866. * responsible for receiving and sending all TDLS packets.
  2867. */
  2868. int (*send_tdls_mgmt)(void *priv, const u8 *dst, u8 action_code,
  2869. u8 dialog_token, u16 status_code, u32 peer_capab,
  2870. int initiator, const u8 *buf, size_t len);
  2871. /**
  2872. * tdls_oper - Ask the driver to perform high-level TDLS operations
  2873. * @priv: Private driver interface data
  2874. * @oper: TDLS high-level operation. See %enum tdls_oper
  2875. * @peer: Destination (peer) MAC address
  2876. * Returns: 0 on success, negative (<0) on failure
  2877. *
  2878. * This optional function can be used to send high-level TDLS commands
  2879. * to the driver.
  2880. */
  2881. int (*tdls_oper)(void *priv, enum tdls_oper oper, const u8 *peer);
  2882. /**
  2883. * wnm_oper - Notify driver of the WNM frame reception
  2884. * @priv: Private driver interface data
  2885. * @oper: WNM operation. See %enum wnm_oper
  2886. * @peer: Destination (peer) MAC address
  2887. * @buf: Buffer for the driver to fill in (for getting IE)
  2888. * @buf_len: Return the len of buf
  2889. * Returns: 0 on success, negative (<0) on failure
  2890. */
  2891. int (*wnm_oper)(void *priv, enum wnm_oper oper, const u8 *peer,
  2892. u8 *buf, u16 *buf_len);
  2893. /**
  2894. * set_qos_map - Set QoS Map
  2895. * @priv: Private driver interface data
  2896. * @qos_map_set: QoS Map
  2897. * @qos_map_set_len: Length of QoS Map
  2898. */
  2899. int (*set_qos_map)(void *priv, const u8 *qos_map_set,
  2900. u8 qos_map_set_len);
  2901. /**
  2902. * br_add_ip_neigh - Add a neigh to the bridge ip neigh table
  2903. * @priv: Private driver interface data
  2904. * @version: IP version of the IP address, 4 or 6
  2905. * @ipaddr: IP address for the neigh entry
  2906. * @prefixlen: IP address prefix length
  2907. * @addr: Corresponding MAC address
  2908. * Returns: 0 on success, negative (<0) on failure
  2909. */
  2910. int (*br_add_ip_neigh)(void *priv, u8 version, const u8 *ipaddr,
  2911. int prefixlen, const u8 *addr);
  2912. /**
  2913. * br_delete_ip_neigh - Remove a neigh from the bridge ip neigh table
  2914. * @priv: Private driver interface data
  2915. * @version: IP version of the IP address, 4 or 6
  2916. * @ipaddr: IP address for the neigh entry
  2917. * Returns: 0 on success, negative (<0) on failure
  2918. */
  2919. int (*br_delete_ip_neigh)(void *priv, u8 version, const u8 *ipaddr);
  2920. /**
  2921. * br_port_set_attr - Set a bridge port attribute
  2922. * @attr: Bridge port attribute to set
  2923. * @val: Value to be set
  2924. * Returns: 0 on success, negative (<0) on failure
  2925. */
  2926. int (*br_port_set_attr)(void *priv, enum drv_br_port_attr attr,
  2927. unsigned int val);
  2928. /**
  2929. * br_port_set_attr - Set a bridge network parameter
  2930. * @param: Bridge parameter to set
  2931. * @val: Value to be set
  2932. * Returns: 0 on success, negative (<0) on failure
  2933. */
  2934. int (*br_set_net_param)(void *priv, enum drv_br_net_param param,
  2935. unsigned int val);
  2936. /**
  2937. * set_wowlan - Set wake-on-wireless triggers
  2938. * @priv: Private driver interface data
  2939. * @triggers: wowlan triggers
  2940. */
  2941. int (*set_wowlan)(void *priv, const struct wowlan_triggers *triggers);
  2942. /**
  2943. * signal_poll - Get current connection information
  2944. * @priv: Private driver interface data
  2945. * @signal_info: Connection info structure
  2946. */
  2947. int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
  2948. /**
  2949. * set_authmode - Set authentication algorithm(s) for static WEP
  2950. * @priv: Private driver interface data
  2951. * @authmode: 1=Open System, 2=Shared Key, 3=both
  2952. * Returns: 0 on success, -1 on failure
  2953. *
  2954. * This function can be used to set authentication algorithms for AP
  2955. * mode when static WEP is used. If the driver uses user space MLME/SME
  2956. * implementation, there is no need to implement this function.
  2957. *
  2958. * DEPRECATED - use set_ap() instead
  2959. */
  2960. int (*set_authmode)(void *priv, int authmode);
  2961. #ifdef ANDROID
  2962. /**
  2963. * driver_cmd - Execute driver-specific command
  2964. * @priv: Private driver interface data
  2965. * @cmd: Command to execute
  2966. * @buf: Return buffer
  2967. * @buf_len: Buffer length
  2968. * Returns: 0 on success, -1 on failure
  2969. */
  2970. int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
  2971. #endif /* ANDROID */
  2972. /**
  2973. * vendor_cmd - Execute vendor specific command
  2974. * @priv: Private driver interface data
  2975. * @vendor_id: Vendor id
  2976. * @subcmd: Vendor command id
  2977. * @data: Vendor command parameters (%NULL if no parameters)
  2978. * @data_len: Data length
  2979. * @buf: Return buffer (%NULL to ignore reply)
  2980. * Returns: 0 on success, negative (<0) on failure
  2981. *
  2982. * This function handles vendor specific commands that are passed to
  2983. * the driver/device. The command is identified by vendor id and
  2984. * command id. Parameters can be passed as argument to the command
  2985. * in the data buffer. Reply (if any) will be filled in the supplied
  2986. * return buffer.
  2987. *
  2988. * The exact driver behavior is driver interface and vendor specific. As
  2989. * an example, this will be converted to a vendor specific cfg80211
  2990. * command in case of the nl80211 driver interface.
  2991. */
  2992. int (*vendor_cmd)(void *priv, unsigned int vendor_id,
  2993. unsigned int subcmd, const u8 *data, size_t data_len,
  2994. struct wpabuf *buf);
  2995. /**
  2996. * set_rekey_info - Set rekey information
  2997. * @priv: Private driver interface data
  2998. * @kek: Current KEK
  2999. * @kek_len: KEK length in octets
  3000. * @kck: Current KCK
  3001. * @kck_len: KCK length in octets
  3002. * @replay_ctr: Current EAPOL-Key Replay Counter
  3003. *
  3004. * This optional function can be used to provide information for the
  3005. * driver/firmware to process EAPOL-Key frames in Group Key Handshake
  3006. * while the host (including wpa_supplicant) is sleeping.
  3007. */
  3008. void (*set_rekey_info)(void *priv, const u8 *kek, size_t kek_len,
  3009. const u8 *kck, size_t kck_len,
  3010. const u8 *replay_ctr);
  3011. /**
  3012. * sta_assoc - Station association indication
  3013. * @priv: Private driver interface data
  3014. * @own_addr: Source address and BSSID for association frame
  3015. * @addr: MAC address of the station to associate
  3016. * @reassoc: flag to indicate re-association
  3017. * @status: association response status code
  3018. * @ie: assoc response ie buffer
  3019. * @len: ie buffer length
  3020. * Returns: 0 on success, -1 on failure
  3021. *
  3022. * This function indicates the driver to send (Re)Association
  3023. * Response frame to the station.
  3024. */
  3025. int (*sta_assoc)(void *priv, const u8 *own_addr, const u8 *addr,
  3026. int reassoc, u16 status, const u8 *ie, size_t len);
  3027. /**
  3028. * sta_auth - Station authentication indication
  3029. * @priv: private driver interface data
  3030. * @params: Station authentication parameters
  3031. *
  3032. * Returns: 0 on success, -1 on failure
  3033. */
  3034. int (*sta_auth)(void *priv,
  3035. struct wpa_driver_sta_auth_params *params);
  3036. /**
  3037. * add_tspec - Add traffic stream
  3038. * @priv: Private driver interface data
  3039. * @addr: MAC address of the station to associate
  3040. * @tspec_ie: tspec ie buffer
  3041. * @tspec_ielen: tspec ie length
  3042. * Returns: 0 on success, -1 on failure
  3043. *
  3044. * This function adds the traffic steam for the station
  3045. * and fills the medium_time in tspec_ie.
  3046. */
  3047. int (*add_tspec)(void *priv, const u8 *addr, u8 *tspec_ie,
  3048. size_t tspec_ielen);
  3049. /**
  3050. * add_sta_node - Add a station node in the driver
  3051. * @priv: Private driver interface data
  3052. * @addr: MAC address of the station to add
  3053. * @auth_alg: authentication algorithm used by the station
  3054. * Returns: 0 on success, -1 on failure
  3055. *
  3056. * This function adds the station node in the driver, when
  3057. * the station gets added by FT-over-DS.
  3058. */
  3059. int (*add_sta_node)(void *priv, const u8 *addr, u16 auth_alg);
  3060. /**
  3061. * sched_scan - Request the driver to initiate scheduled scan
  3062. * @priv: Private driver interface data
  3063. * @params: Scan parameters
  3064. * Returns: 0 on success, -1 on failure
  3065. *
  3066. * This operation should be used for scheduled scan offload to
  3067. * the hardware. Every time scan results are available, the
  3068. * driver should report scan results event for wpa_supplicant
  3069. * which will eventually request the results with
  3070. * wpa_driver_get_scan_results2(). This operation is optional
  3071. * and if not provided or if it returns -1, we fall back to
  3072. * normal host-scheduled scans.
  3073. */
  3074. int (*sched_scan)(void *priv, struct wpa_driver_scan_params *params);
  3075. /**
  3076. * stop_sched_scan - Request the driver to stop a scheduled scan
  3077. * @priv: Private driver interface data
  3078. * Returns: 0 on success, -1 on failure
  3079. *
  3080. * This should cause the scheduled scan to be stopped and
  3081. * results should stop being sent. Must be supported if
  3082. * sched_scan is supported.
  3083. */
  3084. int (*stop_sched_scan)(void *priv);
  3085. /**
  3086. * poll_client - Probe (null data or such) the given station
  3087. * @priv: Private driver interface data
  3088. * @own_addr: MAC address of sending interface
  3089. * @addr: MAC address of the station to probe
  3090. * @qos: Indicates whether station is QoS station
  3091. *
  3092. * This function is used to verify whether an associated station is
  3093. * still present. This function does not need to be implemented if the
  3094. * driver provides such inactivity polling mechanism.
  3095. */
  3096. void (*poll_client)(void *priv, const u8 *own_addr,
  3097. const u8 *addr, int qos);
  3098. /**
  3099. * radio_disable - Disable/enable radio
  3100. * @priv: Private driver interface data
  3101. * @disabled: 1=disable 0=enable radio
  3102. * Returns: 0 on success, -1 on failure
  3103. *
  3104. * This optional command is for testing purposes. It can be used to
  3105. * disable the radio on a testbed device to simulate out-of-radio-range
  3106. * conditions.
  3107. */
  3108. int (*radio_disable)(void *priv, int disabled);
  3109. /**
  3110. * switch_channel - Announce channel switch and migrate the GO to the
  3111. * given frequency
  3112. * @priv: Private driver interface data
  3113. * @settings: Settings for CSA period and new channel
  3114. * Returns: 0 on success, -1 on failure
  3115. *
  3116. * This function is used to move the GO to the legacy STA channel to
  3117. * avoid frequency conflict in single channel concurrency.
  3118. */
  3119. int (*switch_channel)(void *priv, struct csa_settings *settings);
  3120. /**
  3121. * add_tx_ts - Add traffic stream
  3122. * @priv: Private driver interface data
  3123. * @tsid: Traffic stream ID
  3124. * @addr: Receiver address
  3125. * @user_prio: User priority of the traffic stream
  3126. * @admitted_time: Admitted time for this TS in units of
  3127. * 32 microsecond periods (per second).
  3128. * Returns: 0 on success, -1 on failure
  3129. */
  3130. int (*add_tx_ts)(void *priv, u8 tsid, const u8 *addr, u8 user_prio,
  3131. u16 admitted_time);
  3132. /**
  3133. * del_tx_ts - Delete traffic stream
  3134. * @priv: Private driver interface data
  3135. * @tsid: Traffic stream ID
  3136. * @addr: Receiver address
  3137. * Returns: 0 on success, -1 on failure
  3138. */
  3139. int (*del_tx_ts)(void *priv, u8 tsid, const u8 *addr);
  3140. /**
  3141. * Enable channel-switching with TDLS peer
  3142. * @priv: Private driver interface data
  3143. * @addr: MAC address of the TDLS peer
  3144. * @oper_class: Operating class of the switch channel
  3145. * @params: Channel specification
  3146. * Returns: 0 on success, -1 on failure
  3147. *
  3148. * The function indicates to driver that it can start switching to a
  3149. * different channel with a specified TDLS peer. The switching is
  3150. * assumed on until canceled with tdls_disable_channel_switch().
  3151. */
  3152. int (*tdls_enable_channel_switch)(
  3153. void *priv, const u8 *addr, u8 oper_class,
  3154. const struct hostapd_freq_params *params);
  3155. /**
  3156. * Disable channel switching with TDLS peer
  3157. * @priv: Private driver interface data
  3158. * @addr: MAC address of the TDLS peer
  3159. * Returns: 0 on success, -1 on failure
  3160. *
  3161. * This function indicates to the driver that it should stop switching
  3162. * with a given TDLS peer.
  3163. */
  3164. int (*tdls_disable_channel_switch)(void *priv, const u8 *addr);
  3165. /**
  3166. * start_dfs_cac - Listen for radar interference on the channel
  3167. * @priv: Private driver interface data
  3168. * @freq: Channel parameters
  3169. * Returns: 0 on success, -1 on failure
  3170. */
  3171. int (*start_dfs_cac)(void *priv, struct hostapd_freq_params *freq);
  3172. /**
  3173. * stop_ap - Removes beacon from AP
  3174. * @priv: Private driver interface data
  3175. * Returns: 0 on success, -1 on failure (or if not supported)
  3176. *
  3177. * This optional function can be used to disable AP mode related
  3178. * configuration. Unlike deinit_ap, it does not change to station
  3179. * mode.
  3180. */
  3181. int (*stop_ap)(void *priv);
  3182. /**
  3183. * get_survey - Retrieve survey data
  3184. * @priv: Private driver interface data
  3185. * @freq: If set, survey data for the specified frequency is only
  3186. * being requested. If not set, all survey data is requested.
  3187. * Returns: 0 on success, -1 on failure
  3188. *
  3189. * Use this to retrieve:
  3190. *
  3191. * - the observed channel noise floor
  3192. * - the amount of time we have spent on the channel
  3193. * - the amount of time during which we have spent on the channel that
  3194. * the radio has determined the medium is busy and we cannot
  3195. * transmit
  3196. * - the amount of time we have spent receiving data
  3197. * - the amount of time we have spent transmitting data
  3198. *
  3199. * This data can be used for spectrum heuristics. One example is
  3200. * Automatic Channel Selection (ACS). The channel survey data is
  3201. * kept on a linked list on the channel data, one entry is added
  3202. * for each survey. The min_nf of the channel is updated for each
  3203. * survey.
  3204. */
  3205. int (*get_survey)(void *priv, unsigned int freq);
  3206. /**
  3207. * status - Get driver interface status information
  3208. * @priv: Private driver interface data
  3209. * @buf: Buffer for printing tou the status information
  3210. * @buflen: Maximum length of the buffer
  3211. * Returns: Length of written status information or -1 on failure
  3212. */
  3213. int (*status)(void *priv, char *buf, size_t buflen);
  3214. /**
  3215. * roaming - Set roaming policy for driver-based BSS selection
  3216. * @priv: Private driver interface data
  3217. * @allowed: Whether roaming within ESS is allowed
  3218. * @bssid: Forced BSSID if roaming is disabled or %NULL if not set
  3219. * Returns: Length of written status information or -1 on failure
  3220. *
  3221. * This optional callback can be used to update roaming policy from the
  3222. * associate() command (bssid being set there indicates that the driver
  3223. * should not roam before getting this roaming() call to allow roaming.
  3224. * If the driver does not indicate WPA_DRIVER_FLAGS_BSS_SELECTION
  3225. * capability, roaming policy is handled within wpa_supplicant and there
  3226. * is no need to implement or react to this callback.
  3227. */
  3228. int (*roaming)(void *priv, int allowed, const u8 *bssid);
  3229. /**
  3230. * disable_fils - Enable/disable FILS feature
  3231. * @priv: Private driver interface data
  3232. * @disable: 0-enable and 1-disable FILS feature
  3233. * Returns: 0 on success, -1 on failure
  3234. *
  3235. * This callback can be used to configure driver and below layers to
  3236. * enable/disable all FILS features.
  3237. */
  3238. int (*disable_fils)(void *priv, int disable);
  3239. /**
  3240. * set_mac_addr - Set MAC address
  3241. * @priv: Private driver interface data
  3242. * @addr: MAC address to use or %NULL for setting back to permanent
  3243. * Returns: 0 on success, -1 on failure
  3244. */
  3245. int (*set_mac_addr)(void *priv, const u8 *addr);
  3246. #ifdef CONFIG_MACSEC
  3247. int (*macsec_init)(void *priv, struct macsec_init_params *params);
  3248. int (*macsec_deinit)(void *priv);
  3249. /**
  3250. * macsec_get_capability - Inform MKA of this driver's capability
  3251. * @priv: Private driver interface data
  3252. * @cap: Driver's capability
  3253. * Returns: 0 on success, -1 on failure
  3254. */
  3255. int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
  3256. /**
  3257. * enable_protect_frames - Set protect frames status
  3258. * @priv: Private driver interface data
  3259. * @enabled: TRUE = protect frames enabled
  3260. * FALSE = protect frames disabled
  3261. * Returns: 0 on success, -1 on failure (or if not supported)
  3262. */
  3263. int (*enable_protect_frames)(void *priv, Boolean enabled);
  3264. /**
  3265. * enable_encrypt - Set encryption status
  3266. * @priv: Private driver interface data
  3267. * @enabled: TRUE = encrypt outgoing traffic
  3268. * FALSE = integrity-only protection on outgoing traffic
  3269. * Returns: 0 on success, -1 on failure (or if not supported)
  3270. */
  3271. int (*enable_encrypt)(void *priv, Boolean enabled);
  3272. /**
  3273. * set_replay_protect - Set replay protect status and window size
  3274. * @priv: Private driver interface data
  3275. * @enabled: TRUE = replay protect enabled
  3276. * FALSE = replay protect disabled
  3277. * @window: replay window size, valid only when replay protect enabled
  3278. * Returns: 0 on success, -1 on failure (or if not supported)
  3279. */
  3280. int (*set_replay_protect)(void *priv, Boolean enabled, u32 window);
  3281. /**
  3282. * set_current_cipher_suite - Set current cipher suite
  3283. * @priv: Private driver interface data
  3284. * @cs: EUI64 identifier
  3285. * Returns: 0 on success, -1 on failure (or if not supported)
  3286. */
  3287. int (*set_current_cipher_suite)(void *priv, u64 cs);
  3288. /**
  3289. * enable_controlled_port - Set controlled port status
  3290. * @priv: Private driver interface data
  3291. * @enabled: TRUE = controlled port enabled
  3292. * FALSE = controlled port disabled
  3293. * Returns: 0 on success, -1 on failure (or if not supported)
  3294. */
  3295. int (*enable_controlled_port)(void *priv, Boolean enabled);
  3296. /**
  3297. * get_receive_lowest_pn - Get receive lowest pn
  3298. * @priv: Private driver interface data
  3299. * @sa: secure association
  3300. * Returns: 0 on success, -1 on failure (or if not supported)
  3301. */
  3302. int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
  3303. /**
  3304. * get_transmit_next_pn - Get transmit next pn
  3305. * @priv: Private driver interface data
  3306. * @sa: secure association
  3307. * Returns: 0 on success, -1 on failure (or if not supported)
  3308. */
  3309. int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
  3310. /**
  3311. * set_transmit_next_pn - Set transmit next pn
  3312. * @priv: Private driver interface data
  3313. * @sa: secure association
  3314. * Returns: 0 on success, -1 on failure (or if not supported)
  3315. */
  3316. int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
  3317. /**
  3318. * create_receive_sc - create secure channel for receiving
  3319. * @priv: Private driver interface data
  3320. * @sc: secure channel
  3321. * @conf_offset: confidentiality offset (0, 30, or 50)
  3322. * @validation: frame validation policy (0 = Disabled, 1 = Checked,
  3323. * 2 = Strict)
  3324. * Returns: 0 on success, -1 on failure (or if not supported)
  3325. */
  3326. int (*create_receive_sc)(void *priv, struct receive_sc *sc,
  3327. unsigned int conf_offset,
  3328. int validation);
  3329. /**
  3330. * delete_receive_sc - delete secure connection for receiving
  3331. * @priv: private driver interface data from init()
  3332. * @sc: secure channel
  3333. * Returns: 0 on success, -1 on failure
  3334. */
  3335. int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
  3336. /**
  3337. * create_receive_sa - create secure association for receive
  3338. * @priv: private driver interface data from init()
  3339. * @sa: secure association
  3340. * Returns: 0 on success, -1 on failure
  3341. */
  3342. int (*create_receive_sa)(void *priv, struct receive_sa *sa);
  3343. /**
  3344. * delete_receive_sa - Delete secure association for receive
  3345. * @priv: Private driver interface data from init()
  3346. * @sa: Secure association
  3347. * Returns: 0 on success, -1 on failure
  3348. */
  3349. int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
  3350. /**
  3351. * enable_receive_sa - enable the SA for receive
  3352. * @priv: private driver interface data from init()
  3353. * @sa: secure association
  3354. * Returns: 0 on success, -1 on failure
  3355. */
  3356. int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
  3357. /**
  3358. * disable_receive_sa - disable SA for receive
  3359. * @priv: private driver interface data from init()
  3360. * @sa: secure association
  3361. * Returns: 0 on success, -1 on failure
  3362. */
  3363. int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
  3364. /**
  3365. * create_transmit_sc - create secure connection for transmit
  3366. * @priv: private driver interface data from init()
  3367. * @sc: secure channel
  3368. * @conf_offset: confidentiality offset (0, 30, or 50)
  3369. * Returns: 0 on success, -1 on failure
  3370. */
  3371. int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
  3372. unsigned int conf_offset);
  3373. /**
  3374. * delete_transmit_sc - delete secure connection for transmit
  3375. * @priv: private driver interface data from init()
  3376. * @sc: secure channel
  3377. * Returns: 0 on success, -1 on failure
  3378. */
  3379. int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
  3380. /**
  3381. * create_transmit_sa - create secure association for transmit
  3382. * @priv: private driver interface data from init()
  3383. * @sa: secure association
  3384. * Returns: 0 on success, -1 on failure
  3385. */
  3386. int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
  3387. /**
  3388. * delete_transmit_sa - Delete secure association for transmit
  3389. * @priv: Private driver interface data from init()
  3390. * @sa: Secure association
  3391. * Returns: 0 on success, -1 on failure
  3392. */
  3393. int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
  3394. /**
  3395. * enable_transmit_sa - enable SA for transmit
  3396. * @priv: private driver interface data from init()
  3397. * @sa: secure association
  3398. * Returns: 0 on success, -1 on failure
  3399. */
  3400. int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
  3401. /**
  3402. * disable_transmit_sa - disable SA for transmit
  3403. * @priv: private driver interface data from init()
  3404. * @sa: secure association
  3405. * Returns: 0 on success, -1 on failure
  3406. */
  3407. int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
  3408. #endif /* CONFIG_MACSEC */
  3409. /**
  3410. * init_mesh - Driver specific initialization for mesh
  3411. * @priv: Private driver interface data
  3412. * Returns: 0 on success, -1 on failure
  3413. */
  3414. int (*init_mesh)(void *priv);
  3415. /**
  3416. * join_mesh - Join a mesh network
  3417. * @priv: Private driver interface data
  3418. * @params: Mesh configuration parameters
  3419. * Returns: 0 on success, -1 on failure
  3420. */
  3421. int (*join_mesh)(void *priv,
  3422. struct wpa_driver_mesh_join_params *params);
  3423. /**
  3424. * leave_mesh - Leave a mesh network
  3425. * @priv: Private driver interface data
  3426. * Returns 0 on success, -1 on failure
  3427. */
  3428. int (*leave_mesh)(void *priv);
  3429. /**
  3430. * do_acs - Automatically select channel
  3431. * @priv: Private driver interface data
  3432. * @params: Parameters for ACS
  3433. * Returns 0 on success, -1 on failure
  3434. *
  3435. * This command can be used to offload ACS to the driver if the driver
  3436. * indicates support for such offloading (WPA_DRIVER_FLAGS_ACS_OFFLOAD).
  3437. */
  3438. int (*do_acs)(void *priv, struct drv_acs_params *params);
  3439. /**
  3440. * set_band - Notify driver of band selection
  3441. * @priv: Private driver interface data
  3442. * @band: The selected band(s)
  3443. * Returns 0 on success, -1 on failure
  3444. */
  3445. int (*set_band)(void *priv, enum set_band band);
  3446. /**
  3447. * get_pref_freq_list - Get preferred frequency list for an interface
  3448. * @priv: Private driver interface data
  3449. * @if_type: Interface type
  3450. * @num: Number of channels
  3451. * @freq_list: Preferred channel frequency list encoded in MHz values
  3452. * Returns 0 on success, -1 on failure
  3453. *
  3454. * This command can be used to query the preferred frequency list from
  3455. * the driver specific to a particular interface type.
  3456. */
  3457. int (*get_pref_freq_list)(void *priv, enum wpa_driver_if_type if_type,
  3458. unsigned int *num, unsigned int *freq_list);
  3459. /**
  3460. * set_prob_oper_freq - Indicate probable P2P operating channel
  3461. * @priv: Private driver interface data
  3462. * @freq: Channel frequency in MHz
  3463. * Returns 0 on success, -1 on failure
  3464. *
  3465. * This command can be used to inform the driver of the operating
  3466. * frequency that an ongoing P2P group formation is likely to come up
  3467. * on. Local device is assuming P2P Client role.
  3468. */
  3469. int (*set_prob_oper_freq)(void *priv, unsigned int freq);
  3470. /**
  3471. * abort_scan - Request the driver to abort an ongoing scan
  3472. * @priv: Private driver interface data
  3473. * @scan_cookie: Cookie identifying the scan request. This is used only
  3474. * when the vendor interface QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
  3475. * was used to trigger scan. Otherwise, 0 is used.
  3476. * Returns 0 on success, -1 on failure
  3477. */
  3478. int (*abort_scan)(void *priv, u64 scan_cookie);
  3479. /**
  3480. * configure_data_frame_filters - Request to configure frame filters
  3481. * @priv: Private driver interface data
  3482. * @filter_flags: The type of frames to filter (bitfield of
  3483. * WPA_DATA_FRAME_FILTER_FLAG_*)
  3484. * Returns: 0 on success or -1 on failure
  3485. */
  3486. int (*configure_data_frame_filters)(void *priv, u32 filter_flags);
  3487. /**
  3488. * get_ext_capab - Get extended capabilities for the specified interface
  3489. * @priv: Private driver interface data
  3490. * @type: Interface type for which to get extended capabilities
  3491. * @ext_capab: Extended capabilities fetched
  3492. * @ext_capab_mask: Extended capabilities mask
  3493. * @ext_capab_len: Length of the extended capabilities
  3494. * Returns: 0 on success or -1 on failure
  3495. */
  3496. int (*get_ext_capab)(void *priv, enum wpa_driver_if_type type,
  3497. const u8 **ext_capab, const u8 **ext_capab_mask,
  3498. unsigned int *ext_capab_len);
  3499. /**
  3500. * p2p_lo_start - Start offloading P2P listen to device
  3501. * @priv: Private driver interface data
  3502. * @freq: Listening frequency (MHz) for P2P listen
  3503. * @period: Length of the listen operation in milliseconds
  3504. * @interval: Interval for running the listen operation in milliseconds
  3505. * @count: Number of times to run the listen operation
  3506. * @device_types: Device primary and secondary types
  3507. * @dev_types_len: Number of bytes for device_types
  3508. * @ies: P2P IE and WSC IE for Probe Response frames
  3509. * @ies_len: Length of ies in bytes
  3510. * Returns: 0 on success or -1 on failure
  3511. */
  3512. int (*p2p_lo_start)(void *priv, unsigned int freq,
  3513. unsigned int period, unsigned int interval,
  3514. unsigned int count,
  3515. const u8 *device_types, size_t dev_types_len,
  3516. const u8 *ies, size_t ies_len);
  3517. /**
  3518. * p2p_lo_stop - Stop P2P listen offload
  3519. * @priv: Private driver interface data
  3520. * Returns: 0 on success or -1 on failure
  3521. */
  3522. int (*p2p_lo_stop)(void *priv);
  3523. /**
  3524. * set_default_scan_ies - Set default scan IEs
  3525. * @priv: Private driver interface data
  3526. * @ies: Scan default IEs buffer
  3527. * @ies_len: Length of IEs in bytes
  3528. * Returns: 0 on success or -1 on failure
  3529. *
  3530. * The driver can use these by default when there are no scan IEs coming
  3531. * in the subsequent scan requests. Also in case of one or more of IEs
  3532. * given in set_default_scan_ies() are missing in the subsequent scan
  3533. * request, the driver should merge the missing scan IEs in the scan
  3534. * request from the IEs set by set_default_scan_ies() in the Probe
  3535. * Request frames sent.
  3536. */
  3537. int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
  3538. /**
  3539. * set_tdls_mode - Set TDLS trigger mode to the host driver
  3540. * @priv: Private driver interface data
  3541. * @tdls_external_control: Represents if TDLS external trigger control
  3542. * mode is enabled/disabled.
  3543. *
  3544. * This optional callback can be used to configure the TDLS external
  3545. * trigger control mode to the host driver.
  3546. */
  3547. int (*set_tdls_mode)(void *priv, int tdls_external_control);
  3548. /**
  3549. * get_bss_transition_status - Get candidate BSS's transition status
  3550. * @priv: Private driver interface data
  3551. * @params: Candidate BSS list
  3552. *
  3553. * Get the accept or reject reason code for a list of BSS transition
  3554. * candidates.
  3555. */
  3556. struct wpa_bss_candidate_info *
  3557. (*get_bss_transition_status)(void *priv,
  3558. struct wpa_bss_trans_info *params);
  3559. /**
  3560. * ignore_assoc_disallow - Configure driver to ignore assoc_disallow
  3561. * @priv: Private driver interface data
  3562. * @ignore_disallow: 0 to not ignore, 1 to ignore
  3563. * Returns: 0 on success, -1 on failure
  3564. */
  3565. int (*ignore_assoc_disallow)(void *priv, int ignore_disallow);
  3566. /**
  3567. * set_bssid_blacklist - Set blacklist of BSSIDs to the driver
  3568. * @priv: Private driver interface data
  3569. * @num_bssid: Number of blacklist BSSIDs
  3570. * @bssids: List of blacklisted BSSIDs
  3571. */
  3572. int (*set_bssid_blacklist)(void *priv, unsigned int num_bssid,
  3573. const u8 *bssid);
  3574. /**
  3575. * update_connect_params - Update the connection parameters
  3576. * @priv: Private driver interface data
  3577. * @params: Association parameters
  3578. * @mask: Bit mask indicating which parameters in @params have to be
  3579. * updated
  3580. * Returns: 0 on success, -1 on failure
  3581. *
  3582. * Update the connection parameters when in connected state so that the
  3583. * driver uses the updated parameters for subsequent roaming. This is
  3584. * used only with drivers that implement internal BSS selection and
  3585. * roaming.
  3586. */
  3587. int (*update_connect_params)(
  3588. void *priv, struct wpa_driver_associate_params *params,
  3589. enum wpa_drv_update_connect_params_mask mask);
  3590. };
  3591. /**
  3592. * enum wpa_event_type - Event type for wpa_supplicant_event() calls
  3593. */
  3594. enum wpa_event_type {
  3595. /**
  3596. * EVENT_ASSOC - Association completed
  3597. *
  3598. * This event needs to be delivered when the driver completes IEEE
  3599. * 802.11 association or reassociation successfully.
  3600. * wpa_driver_ops::get_bssid() is expected to provide the current BSSID
  3601. * after this event has been generated. In addition, optional
  3602. * EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide
  3603. * more information about the association. If the driver interface gets
  3604. * both of these events at the same time, it can also include the
  3605. * assoc_info data in EVENT_ASSOC call.
  3606. */
  3607. EVENT_ASSOC,
  3608. /**
  3609. * EVENT_DISASSOC - Association lost
  3610. *
  3611. * This event should be called when association is lost either due to
  3612. * receiving deauthenticate or disassociate frame from the AP or when
  3613. * sending either of these frames to the current AP. If the driver
  3614. * supports separate deauthentication event, EVENT_DISASSOC should only
  3615. * be used for disassociation and EVENT_DEAUTH for deauthentication.
  3616. * In AP mode, union wpa_event_data::disassoc_info is required.
  3617. */
  3618. EVENT_DISASSOC,
  3619. /**
  3620. * EVENT_MICHAEL_MIC_FAILURE - Michael MIC (TKIP) detected
  3621. *
  3622. * This event must be delivered when a Michael MIC error is detected by
  3623. * the local driver. Additional data for event processing is
  3624. * provided with union wpa_event_data::michael_mic_failure. This
  3625. * information is used to request new encyption key and to initiate
  3626. * TKIP countermeasures if needed.
  3627. */
  3628. EVENT_MICHAEL_MIC_FAILURE,
  3629. /**
  3630. * EVENT_SCAN_RESULTS - Scan results available
  3631. *
  3632. * This event must be called whenever scan results are available to be
  3633. * fetched with struct wpa_driver_ops::get_scan_results(). This event
  3634. * is expected to be used some time after struct wpa_driver_ops::scan()
  3635. * is called. If the driver provides an unsolicited event when the scan
  3636. * has been completed, this event can be used to trigger
  3637. * EVENT_SCAN_RESULTS call. If such event is not available from the
  3638. * driver, the driver wrapper code is expected to use a registered
  3639. * timeout to generate EVENT_SCAN_RESULTS call after the time that the
  3640. * scan is expected to be completed. Optional information about
  3641. * completed scan can be provided with union wpa_event_data::scan_info.
  3642. */
  3643. EVENT_SCAN_RESULTS,
  3644. /**
  3645. * EVENT_ASSOCINFO - Report optional extra information for association
  3646. *
  3647. * This event can be used to report extra association information for
  3648. * EVENT_ASSOC processing. This extra information includes IEs from
  3649. * association frames and Beacon/Probe Response frames in union
  3650. * wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before
  3651. * EVENT_ASSOC. Alternatively, the driver interface can include
  3652. * assoc_info data in the EVENT_ASSOC call if it has all the
  3653. * information available at the same point.
  3654. */
  3655. EVENT_ASSOCINFO,
  3656. /**
  3657. * EVENT_INTERFACE_STATUS - Report interface status changes
  3658. *
  3659. * This optional event can be used to report changes in interface
  3660. * status (interface added/removed) using union
  3661. * wpa_event_data::interface_status. This can be used to trigger
  3662. * wpa_supplicant to stop and re-start processing for the interface,
  3663. * e.g., when a cardbus card is ejected/inserted.
  3664. */
  3665. EVENT_INTERFACE_STATUS,
  3666. /**
  3667. * EVENT_PMKID_CANDIDATE - Report a candidate AP for pre-authentication
  3668. *
  3669. * This event can be used to inform wpa_supplicant about candidates for
  3670. * RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible
  3671. * for scan request (ap_scan=2 mode), this event is required for
  3672. * pre-authentication. If wpa_supplicant is performing scan request
  3673. * (ap_scan=1), this event is optional since scan results can be used
  3674. * to add pre-authentication candidates. union
  3675. * wpa_event_data::pmkid_candidate is used to report the BSSID of the
  3676. * candidate and priority of the candidate, e.g., based on the signal
  3677. * strength, in order to try to pre-authenticate first with candidates
  3678. * that are most likely targets for re-association.
  3679. *
  3680. * EVENT_PMKID_CANDIDATE can be called whenever the driver has updates
  3681. * on the candidate list. In addition, it can be called for the current
  3682. * AP and APs that have existing PMKSA cache entries. wpa_supplicant
  3683. * will automatically skip pre-authentication in cases where a valid
  3684. * PMKSA exists. When more than one candidate exists, this event should
  3685. * be generated once for each candidate.
  3686. *
  3687. * Driver will be notified about successful pre-authentication with
  3688. * struct wpa_driver_ops::add_pmkid() calls.
  3689. */
  3690. EVENT_PMKID_CANDIDATE,
  3691. /**
  3692. * EVENT_TDLS - Request TDLS operation
  3693. *
  3694. * This event can be used to request a TDLS operation to be performed.
  3695. */
  3696. EVENT_TDLS,
  3697. /**
  3698. * EVENT_FT_RESPONSE - Report FT (IEEE 802.11r) response IEs
  3699. *
  3700. * The driver is expected to report the received FT IEs from
  3701. * FT authentication sequence from the AP. The FT IEs are included in
  3702. * the extra information in union wpa_event_data::ft_ies.
  3703. */
  3704. EVENT_FT_RESPONSE,
  3705. /**
  3706. * EVENT_IBSS_RSN_START - Request RSN authentication in IBSS
  3707. *
  3708. * The driver can use this event to inform wpa_supplicant about a STA
  3709. * in an IBSS with which protected frames could be exchanged. This
  3710. * event starts RSN authentication with the other STA to authenticate
  3711. * the STA and set up encryption keys with it.
  3712. */
  3713. EVENT_IBSS_RSN_START,
  3714. /**
  3715. * EVENT_AUTH - Authentication result
  3716. *
  3717. * This event should be called when authentication attempt has been
  3718. * completed. This is only used if the driver supports separate
  3719. * authentication step (struct wpa_driver_ops::authenticate).
  3720. * Information about authentication result is included in
  3721. * union wpa_event_data::auth.
  3722. */
  3723. EVENT_AUTH,
  3724. /**
  3725. * EVENT_DEAUTH - Authentication lost
  3726. *
  3727. * This event should be called when authentication is lost either due
  3728. * to receiving deauthenticate frame from the AP or when sending that
  3729. * frame to the current AP.
  3730. * In AP mode, union wpa_event_data::deauth_info is required.
  3731. */
  3732. EVENT_DEAUTH,
  3733. /**
  3734. * EVENT_ASSOC_REJECT - Association rejected
  3735. *
  3736. * This event should be called when (re)association attempt has been
  3737. * rejected by the AP. Information about the association response is
  3738. * included in union wpa_event_data::assoc_reject.
  3739. */
  3740. EVENT_ASSOC_REJECT,
  3741. /**
  3742. * EVENT_AUTH_TIMED_OUT - Authentication timed out
  3743. */
  3744. EVENT_AUTH_TIMED_OUT,
  3745. /**
  3746. * EVENT_ASSOC_TIMED_OUT - Association timed out
  3747. */
  3748. EVENT_ASSOC_TIMED_OUT,
  3749. /**
  3750. * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
  3751. */
  3752. EVENT_WPS_BUTTON_PUSHED,
  3753. /**
  3754. * EVENT_TX_STATUS - Report TX status
  3755. */
  3756. EVENT_TX_STATUS,
  3757. /**
  3758. * EVENT_RX_FROM_UNKNOWN - Report RX from unknown STA
  3759. */
  3760. EVENT_RX_FROM_UNKNOWN,
  3761. /**
  3762. * EVENT_RX_MGMT - Report RX of a management frame
  3763. */
  3764. EVENT_RX_MGMT,
  3765. /**
  3766. * EVENT_REMAIN_ON_CHANNEL - Remain-on-channel duration started
  3767. *
  3768. * This event is used to indicate when the driver has started the
  3769. * requested remain-on-channel duration. Information about the
  3770. * operation is included in union wpa_event_data::remain_on_channel.
  3771. */
  3772. EVENT_REMAIN_ON_CHANNEL,
  3773. /**
  3774. * EVENT_CANCEL_REMAIN_ON_CHANNEL - Remain-on-channel timed out
  3775. *
  3776. * This event is used to indicate when the driver has completed
  3777. * remain-on-channel duration, i.e., may noot be available on the
  3778. * requested channel anymore. Information about the
  3779. * operation is included in union wpa_event_data::remain_on_channel.
  3780. */
  3781. EVENT_CANCEL_REMAIN_ON_CHANNEL,
  3782. /**
  3783. * EVENT_RX_PROBE_REQ - Indicate received Probe Request frame
  3784. *
  3785. * This event is used to indicate when a Probe Request frame has been
  3786. * received. Information about the received frame is included in
  3787. * union wpa_event_data::rx_probe_req. The driver is required to report
  3788. * these events only after successfully completed probe_req_report()
  3789. * commands to request the events (i.e., report parameter is non-zero)
  3790. * in station mode. In AP mode, Probe Request frames should always be
  3791. * reported.
  3792. */
  3793. EVENT_RX_PROBE_REQ,
  3794. /**
  3795. * EVENT_NEW_STA - New wired device noticed
  3796. *
  3797. * This event is used to indicate that a new device has been detected
  3798. * in a network that does not use association-like functionality (i.e.,
  3799. * mainly wired Ethernet). This can be used to start EAPOL
  3800. * authenticator when receiving a frame from a device. The address of
  3801. * the device is included in union wpa_event_data::new_sta.
  3802. */
  3803. EVENT_NEW_STA,
  3804. /**
  3805. * EVENT_EAPOL_RX - Report received EAPOL frame
  3806. *
  3807. * When in AP mode with hostapd, this event is required to be used to
  3808. * deliver the receive EAPOL frames from the driver.
  3809. */
  3810. EVENT_EAPOL_RX,
  3811. /**
  3812. * EVENT_SIGNAL_CHANGE - Indicate change in signal strength
  3813. *
  3814. * This event is used to indicate changes in the signal strength
  3815. * observed in frames received from the current AP if signal strength
  3816. * monitoring has been enabled with signal_monitor().
  3817. */
  3818. EVENT_SIGNAL_CHANGE,
  3819. /**
  3820. * EVENT_INTERFACE_ENABLED - Notify that interface was enabled
  3821. *
  3822. * This event is used to indicate that the interface was enabled after
  3823. * having been previously disabled, e.g., due to rfkill.
  3824. */
  3825. EVENT_INTERFACE_ENABLED,
  3826. /**
  3827. * EVENT_INTERFACE_DISABLED - Notify that interface was disabled
  3828. *
  3829. * This event is used to indicate that the interface was disabled,
  3830. * e.g., due to rfkill.
  3831. */
  3832. EVENT_INTERFACE_DISABLED,
  3833. /**
  3834. * EVENT_CHANNEL_LIST_CHANGED - Channel list changed
  3835. *
  3836. * This event is used to indicate that the channel list has changed,
  3837. * e.g., because of a regulatory domain change triggered by scan
  3838. * results including an AP advertising a country code.
  3839. */
  3840. EVENT_CHANNEL_LIST_CHANGED,
  3841. /**
  3842. * EVENT_INTERFACE_UNAVAILABLE - Notify that interface is unavailable
  3843. *
  3844. * This event is used to indicate that the driver cannot maintain this
  3845. * interface in its operation mode anymore. The most likely use for
  3846. * this is to indicate that AP mode operation is not available due to
  3847. * operating channel would need to be changed to a DFS channel when
  3848. * the driver does not support radar detection and another virtual
  3849. * interfaces caused the operating channel to change. Other similar
  3850. * resource conflicts could also trigger this for station mode
  3851. * interfaces. This event can be propagated when channel switching
  3852. * fails.
  3853. */
  3854. EVENT_INTERFACE_UNAVAILABLE,
  3855. /**
  3856. * EVENT_BEST_CHANNEL
  3857. *
  3858. * Driver generates this event whenever it detects a better channel
  3859. * (e.g., based on RSSI or channel use). This information can be used
  3860. * to improve channel selection for a new AP/P2P group.
  3861. */
  3862. EVENT_BEST_CHANNEL,
  3863. /**
  3864. * EVENT_UNPROT_DEAUTH - Unprotected Deauthentication frame received
  3865. *
  3866. * This event should be called when a Deauthentication frame is dropped
  3867. * due to it not being protected (MFP/IEEE 802.11w).
  3868. * union wpa_event_data::unprot_deauth is required to provide more
  3869. * details of the frame.
  3870. */
  3871. EVENT_UNPROT_DEAUTH,
  3872. /**
  3873. * EVENT_UNPROT_DISASSOC - Unprotected Disassociation frame received
  3874. *
  3875. * This event should be called when a Disassociation frame is dropped
  3876. * due to it not being protected (MFP/IEEE 802.11w).
  3877. * union wpa_event_data::unprot_disassoc is required to provide more
  3878. * details of the frame.
  3879. */
  3880. EVENT_UNPROT_DISASSOC,
  3881. /**
  3882. * EVENT_STATION_LOW_ACK
  3883. *
  3884. * Driver generates this event whenever it detected that a particular
  3885. * station was lost. Detection can be through massive transmission
  3886. * failures for example.
  3887. */
  3888. EVENT_STATION_LOW_ACK,
  3889. /**
  3890. * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
  3891. */
  3892. EVENT_IBSS_PEER_LOST,
  3893. /**
  3894. * EVENT_DRIVER_GTK_REKEY - Device/driver did GTK rekey
  3895. *
  3896. * This event carries the new replay counter to notify wpa_supplicant
  3897. * of the current EAPOL-Key Replay Counter in case the driver/firmware
  3898. * completed Group Key Handshake while the host (including
  3899. * wpa_supplicant was sleeping).
  3900. */
  3901. EVENT_DRIVER_GTK_REKEY,
  3902. /**
  3903. * EVENT_SCHED_SCAN_STOPPED - Scheduled scan was stopped
  3904. */
  3905. EVENT_SCHED_SCAN_STOPPED,
  3906. /**
  3907. * EVENT_DRIVER_CLIENT_POLL_OK - Station responded to poll
  3908. *
  3909. * This event indicates that the station responded to the poll
  3910. * initiated with @poll_client.
  3911. */
  3912. EVENT_DRIVER_CLIENT_POLL_OK,
  3913. /**
  3914. * EVENT_EAPOL_TX_STATUS - notify of EAPOL TX status
  3915. */
  3916. EVENT_EAPOL_TX_STATUS,
  3917. /**
  3918. * EVENT_CH_SWITCH - AP or GO decided to switch channels
  3919. *
  3920. * Described in wpa_event_data.ch_switch
  3921. * */
  3922. EVENT_CH_SWITCH,
  3923. /**
  3924. * EVENT_WNM - Request WNM operation
  3925. *
  3926. * This event can be used to request a WNM operation to be performed.
  3927. */
  3928. EVENT_WNM,
  3929. /**
  3930. * EVENT_CONNECT_FAILED_REASON - Connection failure reason in AP mode
  3931. *
  3932. * This event indicates that the driver reported a connection failure
  3933. * with the specified client (for example, max client reached, etc.) in
  3934. * AP mode.
  3935. */
  3936. EVENT_CONNECT_FAILED_REASON,
  3937. /**
  3938. * EVENT_DFS_RADAR_DETECTED - Notify of radar detection
  3939. *
  3940. * A radar has been detected on the supplied frequency, hostapd should
  3941. * react accordingly (e.g., change channel).
  3942. */
  3943. EVENT_DFS_RADAR_DETECTED,
  3944. /**
  3945. * EVENT_DFS_CAC_FINISHED - Notify that channel availability check has been completed
  3946. *
  3947. * After a successful CAC, the channel can be marked clear and used.
  3948. */
  3949. EVENT_DFS_CAC_FINISHED,
  3950. /**
  3951. * EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
  3952. *
  3953. * The CAC was not successful, and the channel remains in the previous
  3954. * state. This may happen due to a radar being detected or other
  3955. * external influences.
  3956. */
  3957. EVENT_DFS_CAC_ABORTED,
  3958. /**
  3959. * EVENT_DFS_NOP_FINISHED - Notify that non-occupancy period is over
  3960. *
  3961. * The channel which was previously unavailable is now available again.
  3962. */
  3963. EVENT_DFS_NOP_FINISHED,
  3964. /**
  3965. * EVENT_SURVEY - Received survey data
  3966. *
  3967. * This event gets triggered when a driver query is issued for survey
  3968. * data and the requested data becomes available. The returned data is
  3969. * stored in struct survey_results. The results provide at most one
  3970. * survey entry for each frequency and at minimum will provide one
  3971. * survey entry for one frequency. The survey data can be os_malloc()'d
  3972. * and then os_free()'d, so the event callback must only copy data.
  3973. */
  3974. EVENT_SURVEY,
  3975. /**
  3976. * EVENT_SCAN_STARTED - Scan started
  3977. *
  3978. * This indicates that driver has started a scan operation either based
  3979. * on a request from wpa_supplicant/hostapd or from another application.
  3980. * EVENT_SCAN_RESULTS is used to indicate when the scan has been
  3981. * completed (either successfully or by getting cancelled).
  3982. */
  3983. EVENT_SCAN_STARTED,
  3984. /**
  3985. * EVENT_AVOID_FREQUENCIES - Received avoid frequency range
  3986. *
  3987. * This event indicates a set of frequency ranges that should be avoided
  3988. * to reduce issues due to interference or internal co-existence
  3989. * information in the driver.
  3990. */
  3991. EVENT_AVOID_FREQUENCIES,
  3992. /**
  3993. * EVENT_NEW_PEER_CANDIDATE - new (unknown) mesh peer notification
  3994. */
  3995. EVENT_NEW_PEER_CANDIDATE,
  3996. /**
  3997. * EVENT_ACS_CHANNEL_SELECTED - Received selected channels by ACS
  3998. *
  3999. * Indicates a pair of primary and secondary channels chosen by ACS
  4000. * in device.
  4001. */
  4002. EVENT_ACS_CHANNEL_SELECTED,
  4003. /**
  4004. * EVENT_DFS_CAC_STARTED - Notify that channel availability check has
  4005. * been started.
  4006. *
  4007. * This event indicates that channel availability check has been started
  4008. * on a DFS frequency by a driver that supports DFS Offload.
  4009. */
  4010. EVENT_DFS_CAC_STARTED,
  4011. /**
  4012. * EVENT_P2P_LO_STOP - Notify that P2P listen offload is stopped
  4013. */
  4014. EVENT_P2P_LO_STOP,
  4015. /**
  4016. * EVENT_BEACON_LOSS - Beacon loss detected
  4017. *
  4018. * This event indicates that no Beacon frames has been received from
  4019. * the current AP. This may indicate that the AP is not anymore in
  4020. * range.
  4021. */
  4022. EVENT_BEACON_LOSS,
  4023. /**
  4024. * EVENT_DFS_PRE_CAC_EXPIRED - Notify that channel availability check
  4025. * done previously (Pre-CAC) on the channel has expired. This would
  4026. * normally be on a non-ETSI DFS regulatory domain. DFS state of the
  4027. * channel will be moved from available to usable. A new CAC has to be
  4028. * performed before start operating on this channel.
  4029. */
  4030. EVENT_DFS_PRE_CAC_EXPIRED,
  4031. };
  4032. /**
  4033. * struct freq_survey - Channel survey info
  4034. *
  4035. * @ifidx: Interface index in which this survey was observed
  4036. * @freq: Center of frequency of the surveyed channel
  4037. * @nf: Channel noise floor in dBm
  4038. * @channel_time: Amount of time in ms the radio spent on the channel
  4039. * @channel_time_busy: Amount of time in ms the radio detected some signal
  4040. * that indicated to the radio the channel was not clear
  4041. * @channel_time_rx: Amount of time the radio spent receiving data
  4042. * @channel_time_tx: Amount of time the radio spent transmitting data
  4043. * @filled: bitmask indicating which fields have been reported, see
  4044. * SURVEY_HAS_* defines.
  4045. * @list: Internal list pointers
  4046. */
  4047. struct freq_survey {
  4048. u32 ifidx;
  4049. unsigned int freq;
  4050. s8 nf;
  4051. u64 channel_time;
  4052. u64 channel_time_busy;
  4053. u64 channel_time_rx;
  4054. u64 channel_time_tx;
  4055. unsigned int filled;
  4056. struct dl_list list;
  4057. };
  4058. #define SURVEY_HAS_NF BIT(0)
  4059. #define SURVEY_HAS_CHAN_TIME BIT(1)
  4060. #define SURVEY_HAS_CHAN_TIME_BUSY BIT(2)
  4061. #define SURVEY_HAS_CHAN_TIME_RX BIT(3)
  4062. #define SURVEY_HAS_CHAN_TIME_TX BIT(4)
  4063. /**
  4064. * union wpa_event_data - Additional data for wpa_supplicant_event() calls
  4065. */
  4066. union wpa_event_data {
  4067. /**
  4068. * struct assoc_info - Data for EVENT_ASSOC and EVENT_ASSOCINFO events
  4069. *
  4070. * This structure is optional for EVENT_ASSOC calls and required for
  4071. * EVENT_ASSOCINFO calls. By using EVENT_ASSOC with this data, the
  4072. * driver interface does not need to generate separate EVENT_ASSOCINFO
  4073. * calls.
  4074. */
  4075. struct assoc_info {
  4076. /**
  4077. * reassoc - Flag to indicate association or reassociation
  4078. */
  4079. int reassoc;
  4080. /**
  4081. * req_ies - (Re)Association Request IEs
  4082. *
  4083. * If the driver generates WPA/RSN IE, this event data must be
  4084. * returned for WPA handshake to have needed information. If
  4085. * wpa_supplicant-generated WPA/RSN IE is used, this
  4086. * information event is optional.
  4087. *
  4088. * This should start with the first IE (fixed fields before IEs
  4089. * are not included).
  4090. */
  4091. const u8 *req_ies;
  4092. /**
  4093. * req_ies_len - Length of req_ies in bytes
  4094. */
  4095. size_t req_ies_len;
  4096. /**
  4097. * resp_ies - (Re)Association Response IEs
  4098. *
  4099. * Optional association data from the driver. This data is not
  4100. * required WPA, but may be useful for some protocols and as
  4101. * such, should be reported if this is available to the driver
  4102. * interface.
  4103. *
  4104. * This should start with the first IE (fixed fields before IEs
  4105. * are not included).
  4106. */
  4107. const u8 *resp_ies;
  4108. /**
  4109. * resp_ies_len - Length of resp_ies in bytes
  4110. */
  4111. size_t resp_ies_len;
  4112. /**
  4113. * resp_frame - (Re)Association Response frame
  4114. */
  4115. const u8 *resp_frame;
  4116. /**
  4117. * resp_frame_len - (Re)Association Response frame length
  4118. */
  4119. size_t resp_frame_len;
  4120. /**
  4121. * beacon_ies - Beacon or Probe Response IEs
  4122. *
  4123. * Optional Beacon/ProbeResp data: IEs included in Beacon or
  4124. * Probe Response frames from the current AP (i.e., the one
  4125. * that the client just associated with). This information is
  4126. * used to update WPA/RSN IE for the AP. If this field is not
  4127. * set, the results from previous scan will be used. If no
  4128. * data for the new AP is found, scan results will be requested
  4129. * again (without scan request). At this point, the driver is
  4130. * expected to provide WPA/RSN IE for the AP (if WPA/WPA2 is
  4131. * used).
  4132. *
  4133. * This should start with the first IE (fixed fields before IEs
  4134. * are not included).
  4135. */
  4136. const u8 *beacon_ies;
  4137. /**
  4138. * beacon_ies_len - Length of beacon_ies */
  4139. size_t beacon_ies_len;
  4140. /**
  4141. * freq - Frequency of the operational channel in MHz
  4142. */
  4143. unsigned int freq;
  4144. /**
  4145. * wmm_params - WMM parameters used in this association.
  4146. */
  4147. struct wmm_params wmm_params;
  4148. /**
  4149. * addr - Station address (for AP mode)
  4150. */
  4151. const u8 *addr;
  4152. /**
  4153. * The following is the key management offload information
  4154. * @authorized
  4155. * @key_replay_ctr
  4156. * @key_replay_ctr_len
  4157. * @ptk_kck
  4158. * @ptk_kek_len
  4159. * @ptk_kek
  4160. * @ptk_kek_len
  4161. */
  4162. /**
  4163. * authorized - Status of key management offload,
  4164. * 1 = successful
  4165. */
  4166. int authorized;
  4167. /**
  4168. * key_replay_ctr - Key replay counter value last used
  4169. * in a valid EAPOL-Key frame
  4170. */
  4171. const u8 *key_replay_ctr;
  4172. /**
  4173. * key_replay_ctr_len - The length of key_replay_ctr
  4174. */
  4175. size_t key_replay_ctr_len;
  4176. /**
  4177. * ptk_kck - The derived PTK KCK
  4178. */
  4179. const u8 *ptk_kck;
  4180. /**
  4181. * ptk_kek_len - The length of ptk_kck
  4182. */
  4183. size_t ptk_kck_len;
  4184. /**
  4185. * ptk_kek - The derived PTK KEK
  4186. * This is used in key management offload and also in FILS SK
  4187. * offload.
  4188. */
  4189. const u8 *ptk_kek;
  4190. /**
  4191. * ptk_kek_len - The length of ptk_kek
  4192. */
  4193. size_t ptk_kek_len;
  4194. /**
  4195. * subnet_status - The subnet status:
  4196. * 0 = unknown, 1 = unchanged, 2 = changed
  4197. */
  4198. u8 subnet_status;
  4199. /**
  4200. * The following information is used in FILS SK offload
  4201. * @fils_erp_next_seq_num
  4202. * @fils_pmk
  4203. * @fils_pmk_len
  4204. * @fils_pmkid
  4205. */
  4206. /**
  4207. * fils_erp_next_seq_num - The next sequence number to use in
  4208. * FILS ERP messages
  4209. */
  4210. u16 fils_erp_next_seq_num;
  4211. /**
  4212. * fils_pmk - A new PMK if generated in case of FILS
  4213. * authentication
  4214. */
  4215. const u8 *fils_pmk;
  4216. /**
  4217. * fils_pmk_len - Length of fils_pmk
  4218. */
  4219. size_t fils_pmk_len;
  4220. /**
  4221. * fils_pmkid - PMKID used or generated in FILS authentication
  4222. */
  4223. const u8 *fils_pmkid;
  4224. } assoc_info;
  4225. /**
  4226. * struct disassoc_info - Data for EVENT_DISASSOC events
  4227. */
  4228. struct disassoc_info {
  4229. /**
  4230. * addr - Station address (for AP mode)
  4231. */
  4232. const u8 *addr;
  4233. /**
  4234. * reason_code - Reason Code (host byte order) used in
  4235. * Deauthentication frame
  4236. */
  4237. u16 reason_code;
  4238. /**
  4239. * ie - Optional IE(s) in Disassociation frame
  4240. */
  4241. const u8 *ie;
  4242. /**
  4243. * ie_len - Length of ie buffer in octets
  4244. */
  4245. size_t ie_len;
  4246. /**
  4247. * locally_generated - Whether the frame was locally generated
  4248. */
  4249. int locally_generated;
  4250. } disassoc_info;
  4251. /**
  4252. * struct deauth_info - Data for EVENT_DEAUTH events
  4253. */
  4254. struct deauth_info {
  4255. /**
  4256. * addr - Station address (for AP mode)
  4257. */
  4258. const u8 *addr;
  4259. /**
  4260. * reason_code - Reason Code (host byte order) used in
  4261. * Deauthentication frame
  4262. */
  4263. u16 reason_code;
  4264. /**
  4265. * ie - Optional IE(s) in Deauthentication frame
  4266. */
  4267. const u8 *ie;
  4268. /**
  4269. * ie_len - Length of ie buffer in octets
  4270. */
  4271. size_t ie_len;
  4272. /**
  4273. * locally_generated - Whether the frame was locally generated
  4274. */
  4275. int locally_generated;
  4276. } deauth_info;
  4277. /**
  4278. * struct michael_mic_failure - Data for EVENT_MICHAEL_MIC_FAILURE
  4279. */
  4280. struct michael_mic_failure {
  4281. int unicast;
  4282. const u8 *src;
  4283. } michael_mic_failure;
  4284. /**
  4285. * struct interface_status - Data for EVENT_INTERFACE_STATUS
  4286. */
  4287. struct interface_status {
  4288. unsigned int ifindex;
  4289. char ifname[100];
  4290. enum {
  4291. EVENT_INTERFACE_ADDED, EVENT_INTERFACE_REMOVED
  4292. } ievent;
  4293. } interface_status;
  4294. /**
  4295. * struct pmkid_candidate - Data for EVENT_PMKID_CANDIDATE
  4296. */
  4297. struct pmkid_candidate {
  4298. /** BSSID of the PMKID candidate */
  4299. u8 bssid[ETH_ALEN];
  4300. /** Smaller the index, higher the priority */
  4301. int index;
  4302. /** Whether RSN IE includes pre-authenticate flag */
  4303. int preauth;
  4304. } pmkid_candidate;
  4305. /**
  4306. * struct tdls - Data for EVENT_TDLS
  4307. */
  4308. struct tdls {
  4309. u8 peer[ETH_ALEN];
  4310. enum {
  4311. TDLS_REQUEST_SETUP,
  4312. TDLS_REQUEST_TEARDOWN,
  4313. TDLS_REQUEST_DISCOVER,
  4314. } oper;
  4315. u16 reason_code; /* for teardown */
  4316. } tdls;
  4317. /**
  4318. * struct wnm - Data for EVENT_WNM
  4319. */
  4320. struct wnm {
  4321. u8 addr[ETH_ALEN];
  4322. enum {
  4323. WNM_OPER_SLEEP,
  4324. } oper;
  4325. enum {
  4326. WNM_SLEEP_ENTER,
  4327. WNM_SLEEP_EXIT
  4328. } sleep_action;
  4329. int sleep_intval;
  4330. u16 reason_code;
  4331. u8 *buf;
  4332. u16 buf_len;
  4333. } wnm;
  4334. /**
  4335. * struct ft_ies - FT information elements (EVENT_FT_RESPONSE)
  4336. *
  4337. * During FT (IEEE 802.11r) authentication sequence, the driver is
  4338. * expected to use this event to report received FT IEs (MDIE, FTIE,
  4339. * RSN IE, TIE, possible resource request) to the supplicant. The FT
  4340. * IEs for the next message will be delivered through the
  4341. * struct wpa_driver_ops::update_ft_ies() callback.
  4342. */
  4343. struct ft_ies {
  4344. const u8 *ies;
  4345. size_t ies_len;
  4346. int ft_action;
  4347. u8 target_ap[ETH_ALEN];
  4348. /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
  4349. const u8 *ric_ies;
  4350. /** Length of ric_ies buffer in octets */
  4351. size_t ric_ies_len;
  4352. } ft_ies;
  4353. /**
  4354. * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
  4355. */
  4356. struct ibss_rsn_start {
  4357. u8 peer[ETH_ALEN];
  4358. } ibss_rsn_start;
  4359. /**
  4360. * struct auth_info - Data for EVENT_AUTH events
  4361. */
  4362. struct auth_info {
  4363. u8 peer[ETH_ALEN];
  4364. u8 bssid[ETH_ALEN];
  4365. u16 auth_type;
  4366. u16 auth_transaction;
  4367. u16 status_code;
  4368. const u8 *ies;
  4369. size_t ies_len;
  4370. } auth;
  4371. /**
  4372. * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
  4373. */
  4374. struct assoc_reject {
  4375. /**
  4376. * bssid - BSSID of the AP that rejected association
  4377. */
  4378. const u8 *bssid;
  4379. /**
  4380. * resp_ies - (Re)Association Response IEs
  4381. *
  4382. * Optional association data from the driver. This data is not
  4383. * required WPA, but may be useful for some protocols and as
  4384. * such, should be reported if this is available to the driver
  4385. * interface.
  4386. *
  4387. * This should start with the first IE (fixed fields before IEs
  4388. * are not included).
  4389. */
  4390. const u8 *resp_ies;
  4391. /**
  4392. * resp_ies_len - Length of resp_ies in bytes
  4393. */
  4394. size_t resp_ies_len;
  4395. /**
  4396. * status_code - Status Code from (Re)association Response
  4397. */
  4398. u16 status_code;
  4399. /**
  4400. * timed_out - Whether failure is due to timeout (etc.) rather
  4401. * than explicit rejection response from the AP.
  4402. */
  4403. int timed_out;
  4404. /**
  4405. * timeout_reason - Reason for the timeout
  4406. */
  4407. const char *timeout_reason;
  4408. /**
  4409. * fils_erp_next_seq_num - The next sequence number to use in
  4410. * FILS ERP messages
  4411. */
  4412. u16 fils_erp_next_seq_num;
  4413. } assoc_reject;
  4414. struct timeout_event {
  4415. u8 addr[ETH_ALEN];
  4416. } timeout_event;
  4417. /**
  4418. * struct tx_status - Data for EVENT_TX_STATUS events
  4419. */
  4420. struct tx_status {
  4421. u16 type;
  4422. u16 stype;
  4423. const u8 *dst;
  4424. const u8 *data;
  4425. size_t data_len;
  4426. int ack;
  4427. } tx_status;
  4428. /**
  4429. * struct rx_from_unknown - Data for EVENT_RX_FROM_UNKNOWN events
  4430. */
  4431. struct rx_from_unknown {
  4432. const u8 *bssid;
  4433. const u8 *addr;
  4434. int wds;
  4435. } rx_from_unknown;
  4436. /**
  4437. * struct rx_mgmt - Data for EVENT_RX_MGMT events
  4438. */
  4439. struct rx_mgmt {
  4440. const u8 *frame;
  4441. size_t frame_len;
  4442. u32 datarate;
  4443. /**
  4444. * drv_priv - Pointer to store driver private BSS information
  4445. *
  4446. * If not set to NULL, this is used for comparison with
  4447. * hostapd_data->drv_priv to determine which BSS should process
  4448. * the frame.
  4449. */
  4450. void *drv_priv;
  4451. /**
  4452. * freq - Frequency (in MHz) on which the frame was received
  4453. */
  4454. int freq;
  4455. /**
  4456. * ssi_signal - Signal strength in dBm (or 0 if not available)
  4457. */
  4458. int ssi_signal;
  4459. } rx_mgmt;
  4460. /**
  4461. * struct remain_on_channel - Data for EVENT_REMAIN_ON_CHANNEL events
  4462. *
  4463. * This is also used with EVENT_CANCEL_REMAIN_ON_CHANNEL events.
  4464. */
  4465. struct remain_on_channel {
  4466. /**
  4467. * freq - Channel frequency in MHz
  4468. */
  4469. unsigned int freq;
  4470. /**
  4471. * duration - Duration to remain on the channel in milliseconds
  4472. */
  4473. unsigned int duration;
  4474. } remain_on_channel;
  4475. /**
  4476. * struct scan_info - Optional data for EVENT_SCAN_RESULTS events
  4477. * @aborted: Whether the scan was aborted
  4478. * @freqs: Scanned frequencies in MHz (%NULL = all channels scanned)
  4479. * @num_freqs: Number of entries in freqs array
  4480. * @ssids: Scanned SSIDs (%NULL or zero-length SSID indicates wildcard
  4481. * SSID)
  4482. * @num_ssids: Number of entries in ssids array
  4483. * @external_scan: Whether the scan info is for an external scan
  4484. * @nl_scan_event: 1 if the source of this scan event is a normal scan,
  4485. * 0 if the source of the scan event is a vendor scan
  4486. * @scan_start_tsf: Time when the scan started in terms of TSF of the
  4487. * BSS that the interface that requested the scan is connected to
  4488. * (if available).
  4489. * @scan_start_tsf_bssid: The BSSID according to which %scan_start_tsf
  4490. * is set.
  4491. */
  4492. struct scan_info {
  4493. int aborted;
  4494. const int *freqs;
  4495. size_t num_freqs;
  4496. struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
  4497. size_t num_ssids;
  4498. int external_scan;
  4499. int nl_scan_event;
  4500. u64 scan_start_tsf;
  4501. u8 scan_start_tsf_bssid[ETH_ALEN];
  4502. } scan_info;
  4503. /**
  4504. * struct rx_probe_req - Data for EVENT_RX_PROBE_REQ events
  4505. */
  4506. struct rx_probe_req {
  4507. /**
  4508. * sa - Source address of the received Probe Request frame
  4509. */
  4510. const u8 *sa;
  4511. /**
  4512. * da - Destination address of the received Probe Request frame
  4513. * or %NULL if not available
  4514. */
  4515. const u8 *da;
  4516. /**
  4517. * bssid - BSSID of the received Probe Request frame or %NULL
  4518. * if not available
  4519. */
  4520. const u8 *bssid;
  4521. /**
  4522. * ie - IEs from the Probe Request body
  4523. */
  4524. const u8 *ie;
  4525. /**
  4526. * ie_len - Length of ie buffer in octets
  4527. */
  4528. size_t ie_len;
  4529. /**
  4530. * signal - signal strength in dBm (or 0 if not available)
  4531. */
  4532. int ssi_signal;
  4533. } rx_probe_req;
  4534. /**
  4535. * struct new_sta - Data for EVENT_NEW_STA events
  4536. */
  4537. struct new_sta {
  4538. const u8 *addr;
  4539. } new_sta;
  4540. /**
  4541. * struct eapol_rx - Data for EVENT_EAPOL_RX events
  4542. */
  4543. struct eapol_rx {
  4544. const u8 *src;
  4545. const u8 *data;
  4546. size_t data_len;
  4547. } eapol_rx;
  4548. /**
  4549. * signal_change - Data for EVENT_SIGNAL_CHANGE events
  4550. */
  4551. struct wpa_signal_info signal_change;
  4552. /**
  4553. * struct best_channel - Data for EVENT_BEST_CHANNEL events
  4554. * @freq_24: Best 2.4 GHz band channel frequency in MHz
  4555. * @freq_5: Best 5 GHz band channel frequency in MHz
  4556. * @freq_overall: Best channel frequency in MHz
  4557. *
  4558. * 0 can be used to indicate no preference in either band.
  4559. */
  4560. struct best_channel {
  4561. int freq_24;
  4562. int freq_5;
  4563. int freq_overall;
  4564. } best_chan;
  4565. struct unprot_deauth {
  4566. const u8 *sa;
  4567. const u8 *da;
  4568. u16 reason_code;
  4569. } unprot_deauth;
  4570. struct unprot_disassoc {
  4571. const u8 *sa;
  4572. const u8 *da;
  4573. u16 reason_code;
  4574. } unprot_disassoc;
  4575. /**
  4576. * struct low_ack - Data for EVENT_STATION_LOW_ACK events
  4577. * @addr: station address
  4578. * @num_packets: Number of packets lost (consecutive packets not
  4579. * acknowledged)
  4580. */
  4581. struct low_ack {
  4582. u8 addr[ETH_ALEN];
  4583. u32 num_packets;
  4584. } low_ack;
  4585. /**
  4586. * struct ibss_peer_lost - Data for EVENT_IBSS_PEER_LOST
  4587. */
  4588. struct ibss_peer_lost {
  4589. u8 peer[ETH_ALEN];
  4590. } ibss_peer_lost;
  4591. /**
  4592. * struct driver_gtk_rekey - Data for EVENT_DRIVER_GTK_REKEY
  4593. */
  4594. struct driver_gtk_rekey {
  4595. const u8 *bssid;
  4596. const u8 *replay_ctr;
  4597. } driver_gtk_rekey;
  4598. /**
  4599. * struct client_poll - Data for EVENT_DRIVER_CLIENT_POLL_OK events
  4600. * @addr: station address
  4601. */
  4602. struct client_poll {
  4603. u8 addr[ETH_ALEN];
  4604. } client_poll;
  4605. /**
  4606. * struct eapol_tx_status
  4607. * @dst: Original destination
  4608. * @data: Data starting with IEEE 802.1X header (!)
  4609. * @data_len: Length of data
  4610. * @ack: Indicates ack or lost frame
  4611. *
  4612. * This corresponds to hapd_send_eapol if the frame sent
  4613. * there isn't just reported as EVENT_TX_STATUS.
  4614. */
  4615. struct eapol_tx_status {
  4616. const u8 *dst;
  4617. const u8 *data;
  4618. int data_len;
  4619. int ack;
  4620. } eapol_tx_status;
  4621. /**
  4622. * struct ch_switch
  4623. * @freq: Frequency of new channel in MHz
  4624. * @ht_enabled: Whether this is an HT channel
  4625. * @ch_offset: Secondary channel offset
  4626. * @ch_width: Channel width
  4627. * @cf1: Center frequency 1
  4628. * @cf2: Center frequency 2
  4629. */
  4630. struct ch_switch {
  4631. int freq;
  4632. int ht_enabled;
  4633. int ch_offset;
  4634. enum chan_width ch_width;
  4635. int cf1;
  4636. int cf2;
  4637. } ch_switch;
  4638. /**
  4639. * struct connect_failed - Data for EVENT_CONNECT_FAILED_REASON
  4640. * @addr: Remote client address
  4641. * @code: Reason code for connection failure
  4642. */
  4643. struct connect_failed_reason {
  4644. u8 addr[ETH_ALEN];
  4645. enum {
  4646. MAX_CLIENT_REACHED,
  4647. BLOCKED_CLIENT
  4648. } code;
  4649. } connect_failed_reason;
  4650. /**
  4651. * struct dfs_event - Data for radar detected events
  4652. * @freq: Frequency of the channel in MHz
  4653. */
  4654. struct dfs_event {
  4655. int freq;
  4656. int ht_enabled;
  4657. int chan_offset;
  4658. enum chan_width chan_width;
  4659. int cf1;
  4660. int cf2;
  4661. } dfs_event;
  4662. /**
  4663. * survey_results - Survey result data for EVENT_SURVEY
  4664. * @freq_filter: Requested frequency survey filter, 0 if request
  4665. * was for all survey data
  4666. * @survey_list: Linked list of survey data (struct freq_survey)
  4667. */
  4668. struct survey_results {
  4669. unsigned int freq_filter;
  4670. struct dl_list survey_list; /* struct freq_survey */
  4671. } survey_results;
  4672. /**
  4673. * channel_list_changed - Data for EVENT_CHANNEL_LIST_CHANGED
  4674. * @initiator: Initiator of the regulatory change
  4675. * @type: Regulatory change type
  4676. * @alpha2: Country code (or "" if not available)
  4677. */
  4678. struct channel_list_changed {
  4679. enum reg_change_initiator initiator;
  4680. enum reg_type type;
  4681. char alpha2[3];
  4682. } channel_list_changed;
  4683. /**
  4684. * freq_range - List of frequency ranges
  4685. *
  4686. * This is used as the data with EVENT_AVOID_FREQUENCIES.
  4687. */
  4688. struct wpa_freq_range_list freq_range;
  4689. /**
  4690. * struct mesh_peer
  4691. *
  4692. * @peer: Peer address
  4693. * @ies: Beacon IEs
  4694. * @ie_len: Length of @ies
  4695. *
  4696. * Notification of new candidate mesh peer.
  4697. */
  4698. struct mesh_peer {
  4699. const u8 *peer;
  4700. const u8 *ies;
  4701. size_t ie_len;
  4702. } mesh_peer;
  4703. /**
  4704. * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
  4705. * @pri_channel: Selected primary channel
  4706. * @sec_channel: Selected secondary channel
  4707. * @vht_seg0_center_ch: VHT mode Segment0 center channel
  4708. * @vht_seg1_center_ch: VHT mode Segment1 center channel
  4709. * @ch_width: Selected Channel width by driver. Driver may choose to
  4710. * change hostapd configured ACS channel width due driver internal
  4711. * channel restrictions.
  4712. * hw_mode: Selected band (used with hw_mode=any)
  4713. */
  4714. struct acs_selected_channels {
  4715. u8 pri_channel;
  4716. u8 sec_channel;
  4717. u8 vht_seg0_center_ch;
  4718. u8 vht_seg1_center_ch;
  4719. u16 ch_width;
  4720. enum hostapd_hw_mode hw_mode;
  4721. } acs_selected_channels;
  4722. /**
  4723. * struct p2p_lo_stop - Reason code for P2P Listen offload stop event
  4724. * @reason_code: Reason for stopping offload
  4725. * P2P_LO_STOPPED_REASON_COMPLETE: Listen offload finished as
  4726. * scheduled.
  4727. * P2P_LO_STOPPED_REASON_RECV_STOP_CMD: Host requested offload to
  4728. * be stopped.
  4729. * P2P_LO_STOPPED_REASON_INVALID_PARAM: Invalid listen offload
  4730. * parameters.
  4731. * P2P_LO_STOPPED_REASON_NOT_SUPPORTED: Listen offload not
  4732. * supported by device.
  4733. */
  4734. struct p2p_lo_stop {
  4735. enum {
  4736. P2P_LO_STOPPED_REASON_COMPLETE = 0,
  4737. P2P_LO_STOPPED_REASON_RECV_STOP_CMD,
  4738. P2P_LO_STOPPED_REASON_INVALID_PARAM,
  4739. P2P_LO_STOPPED_REASON_NOT_SUPPORTED,
  4740. } reason_code;
  4741. } p2p_lo_stop;
  4742. };
  4743. /**
  4744. * wpa_supplicant_event - Report a driver event for wpa_supplicant
  4745. * @ctx: Context pointer (wpa_s); this is the ctx variable registered
  4746. * with struct wpa_driver_ops::init()
  4747. * @event: event type (defined above)
  4748. * @data: possible extra data for the event
  4749. *
  4750. * Driver wrapper code should call this function whenever an event is received
  4751. * from the driver.
  4752. */
  4753. void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
  4754. union wpa_event_data *data);
  4755. /**
  4756. * wpa_supplicant_event_global - Report a driver event for wpa_supplicant
  4757. * @ctx: Context pointer (wpa_s); this is the ctx variable registered
  4758. * with struct wpa_driver_ops::init()
  4759. * @event: event type (defined above)
  4760. * @data: possible extra data for the event
  4761. *
  4762. * Same as wpa_supplicant_event(), but we search for the interface in
  4763. * wpa_global.
  4764. */
  4765. void wpa_supplicant_event_global(void *ctx, enum wpa_event_type event,
  4766. union wpa_event_data *data);
  4767. /*
  4768. * The following inline functions are provided for convenience to simplify
  4769. * event indication for some of the common events.
  4770. */
  4771. static inline void drv_event_assoc(void *ctx, const u8 *addr, const u8 *ie,
  4772. size_t ielen, int reassoc)
  4773. {
  4774. union wpa_event_data event;
  4775. os_memset(&event, 0, sizeof(event));
  4776. event.assoc_info.reassoc = reassoc;
  4777. event.assoc_info.req_ies = ie;
  4778. event.assoc_info.req_ies_len = ielen;
  4779. event.assoc_info.addr = addr;
  4780. wpa_supplicant_event(ctx, EVENT_ASSOC, &event);
  4781. }
  4782. static inline void drv_event_disassoc(void *ctx, const u8 *addr)
  4783. {
  4784. union wpa_event_data event;
  4785. os_memset(&event, 0, sizeof(event));
  4786. event.disassoc_info.addr = addr;
  4787. wpa_supplicant_event(ctx, EVENT_DISASSOC, &event);
  4788. }
  4789. static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
  4790. size_t data_len)
  4791. {
  4792. union wpa_event_data event;
  4793. os_memset(&event, 0, sizeof(event));
  4794. event.eapol_rx.src = src;
  4795. event.eapol_rx.data = data;
  4796. event.eapol_rx.data_len = data_len;
  4797. wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
  4798. }
  4799. /* driver_common.c */
  4800. void wpa_scan_results_free(struct wpa_scan_results *res);
  4801. /* Convert wpa_event_type to a string for logging */
  4802. const char * event_to_string(enum wpa_event_type event);
  4803. /* Convert chan_width to a string for logging and control interfaces */
  4804. const char * channel_width_to_string(enum chan_width width);
  4805. int ht_supported(const struct hostapd_hw_modes *mode);
  4806. int vht_supported(const struct hostapd_hw_modes *mode);
  4807. struct wowlan_triggers *
  4808. wpa_get_wowlan_triggers(const char *wowlan_triggers,
  4809. const struct wpa_driver_capa *capa);
  4810. /* Convert driver flag to string */
  4811. const char * driver_flag_to_string(u64 flag);
  4812. /* NULL terminated array of linked in driver wrappers */
  4813. extern const struct wpa_driver_ops *const wpa_drivers[];
  4814. /* Available drivers */
  4815. #ifdef CONFIG_DRIVER_WEXT
  4816. extern const struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
  4817. #endif /* CONFIG_DRIVER_WEXT */
  4818. #ifdef CONFIG_DRIVER_NL80211
  4819. /* driver_nl80211.c */
  4820. extern const struct wpa_driver_ops wpa_driver_nl80211_ops;
  4821. #endif /* CONFIG_DRIVER_NL80211 */
  4822. #ifdef CONFIG_DRIVER_HOSTAP
  4823. extern const struct wpa_driver_ops wpa_driver_hostap_ops; /* driver_hostap.c */
  4824. #endif /* CONFIG_DRIVER_HOSTAP */
  4825. #ifdef CONFIG_DRIVER_BSD
  4826. extern const struct wpa_driver_ops wpa_driver_bsd_ops; /* driver_bsd.c */
  4827. #endif /* CONFIG_DRIVER_BSD */
  4828. #ifdef CONFIG_DRIVER_OPENBSD
  4829. /* driver_openbsd.c */
  4830. extern const struct wpa_driver_ops wpa_driver_openbsd_ops;
  4831. #endif /* CONFIG_DRIVER_OPENBSD */
  4832. #ifdef CONFIG_DRIVER_NDIS
  4833. extern struct wpa_driver_ops wpa_driver_ndis_ops; /* driver_ndis.c */
  4834. #endif /* CONFIG_DRIVER_NDIS */
  4835. #ifdef CONFIG_DRIVER_WIRED
  4836. extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
  4837. #endif /* CONFIG_DRIVER_WIRED */
  4838. #ifdef CONFIG_DRIVER_MACSEC_QCA
  4839. /* driver_macsec_qca.c */
  4840. extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
  4841. #endif /* CONFIG_DRIVER_MACSEC_QCA */
  4842. #ifdef CONFIG_DRIVER_MACSEC_LINUX
  4843. /* driver_macsec_linux.c */
  4844. extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
  4845. #endif /* CONFIG_DRIVER_MACSEC_LINUX */
  4846. #ifdef CONFIG_DRIVER_ROBOSWITCH
  4847. /* driver_roboswitch.c */
  4848. extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
  4849. #endif /* CONFIG_DRIVER_ROBOSWITCH */
  4850. #ifdef CONFIG_DRIVER_ATHEROS
  4851. /* driver_atheros.c */
  4852. extern const struct wpa_driver_ops wpa_driver_atheros_ops;
  4853. #endif /* CONFIG_DRIVER_ATHEROS */
  4854. #ifdef CONFIG_DRIVER_NONE
  4855. extern const struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
  4856. #endif /* CONFIG_DRIVER_NONE */
  4857. #endif /* DRIVER_H */