driver.h 160 KB

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