driver.h 159 KB

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