-
Notifications
You must be signed in to change notification settings - Fork 18
/
driver.h
4988 lines (4458 loc) · 150 KB
/
driver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Driver interface definition
* Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*
* This file defines a driver interface used by both %wpa_supplicant and
* hostapd. The first part of the file defines data structures used in various
* driver operations. This is followed by the struct wpa_driver_ops that each
* driver wrapper will beed to define with callback functions for requesting
* driver operations. After this, there are definitions for driver event
* reporting with wpa_supplicant_event() and some convenience helper functions
* that can be used to report events.
*/
#ifndef DRIVER_H
#define DRIVER_H
#define WPA_SUPPLICANT_DRIVER_VERSION 4
#include "common/defs.h"
#include "common/ieee802_11_defs.h"
#include "utils/list.h"
#define HOSTAPD_CHAN_DISABLED 0x00000001
#define HOSTAPD_CHAN_NO_IR 0x00000002
#define HOSTAPD_CHAN_RADAR 0x00000008
#define HOSTAPD_CHAN_HT40PLUS 0x00000010
#define HOSTAPD_CHAN_HT40MINUS 0x00000020
#define HOSTAPD_CHAN_HT40 0x00000040
#define HOSTAPD_CHAN_SURVEY_LIST_INITIALIZED 0x00000080
#define HOSTAPD_CHAN_DFS_UNKNOWN 0x00000000
#define HOSTAPD_CHAN_DFS_USABLE 0x00000100
#define HOSTAPD_CHAN_DFS_UNAVAILABLE 0x00000200
#define HOSTAPD_CHAN_DFS_AVAILABLE 0x00000300
#define HOSTAPD_CHAN_DFS_MASK 0x00000300
#define HOSTAPD_CHAN_VHT_10_70 0x00000800
#define HOSTAPD_CHAN_VHT_30_50 0x00001000
#define HOSTAPD_CHAN_VHT_50_30 0x00002000
#define HOSTAPD_CHAN_VHT_70_10 0x00004000
#define HOSTAPD_CHAN_INDOOR_ONLY 0x00010000
#define HOSTAPD_CHAN_GO_CONCURRENT 0x00020000
#define HOSTAPD_CHAN_VHT_10_150 0x00100000
#define HOSTAPD_CHAN_VHT_30_130 0x00200000
#define HOSTAPD_CHAN_VHT_50_110 0x00400000
#define HOSTAPD_CHAN_VHT_70_90 0x00800000
#define HOSTAPD_CHAN_VHT_90_70 0x01000000
#define HOSTAPD_CHAN_VHT_110_50 0x02000000
#define HOSTAPD_CHAN_VHT_130_30 0x04000000
#define HOSTAPD_CHAN_VHT_150_10 0x08000000
/* Filter gratuitous ARP */
#define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
/* Filter unsolicited Neighbor Advertisement */
#define WPA_DATA_FRAME_FILTER_FLAG_NA BIT(1)
/* Filter unicast IP packets encrypted using the GTK */
#define WPA_DATA_FRAME_FILTER_FLAG_GTK BIT(2)
/**
* enum reg_change_initiator - Regulatory change initiator
*/
enum reg_change_initiator {
REGDOM_SET_BY_CORE,
REGDOM_SET_BY_USER,
REGDOM_SET_BY_DRIVER,
REGDOM_SET_BY_COUNTRY_IE,
REGDOM_BEACON_HINT,
};
/**
* enum reg_type - Regulatory change types
*/
enum reg_type {
REGDOM_TYPE_UNKNOWN,
REGDOM_TYPE_COUNTRY,
REGDOM_TYPE_WORLD,
REGDOM_TYPE_CUSTOM_WORLD,
REGDOM_TYPE_INTERSECTION,
};
/**
* struct hostapd_channel_data - Channel information
*/
struct hostapd_channel_data {
/**
* chan - Channel number (IEEE 802.11)
*/
short chan;
/**
* freq - Frequency in MHz
*/
int freq;
/**
* flag - Channel flags (HOSTAPD_CHAN_*)
*/
int flag;
/**
* max_tx_power - Regulatory transmit power limit in dBm
*/
u8 max_tx_power;
/**
* survey_list - Linked list of surveys (struct freq_survey)
*/
struct dl_list survey_list;
/**
* min_nf - Minimum observed noise floor, in dBm, based on all
* surveyed channel data
*/
s8 min_nf;
#ifdef CONFIG_ACS
/**
* interference_factor - Computed interference factor on this
* channel (used internally in src/ap/acs.c; driver wrappers do not
* need to set this)
*/
long double interference_factor;
#endif /* CONFIG_ACS */
/**
* dfs_cac_ms - DFS CAC time in milliseconds
*/
unsigned int dfs_cac_ms;
};
#define HOSTAPD_MODE_FLAG_HT_INFO_KNOWN BIT(0)
#define HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN BIT(1)
/**
* struct hostapd_hw_modes - Supported hardware mode information
*/
struct hostapd_hw_modes {
/**
* mode - Hardware mode
*/
enum hostapd_hw_mode mode;
/**
* num_channels - Number of entries in the channels array
*/
int num_channels;
/**
* channels - Array of supported channels
*/
struct hostapd_channel_data *channels;
/**
* num_rates - Number of entries in the rates array
*/
int num_rates;
/**
* rates - Array of supported rates in 100 kbps units
*/
int *rates;
/**
* ht_capab - HT (IEEE 802.11n) capabilities
*/
u16 ht_capab;
/**
* mcs_set - MCS (IEEE 802.11n) rate parameters
*/
u8 mcs_set[16];
/**
* a_mpdu_params - A-MPDU (IEEE 802.11n) parameters
*/
u8 a_mpdu_params;
/**
* vht_capab - VHT (IEEE 802.11ac) capabilities
*/
u32 vht_capab;
/**
* vht_mcs_set - VHT MCS (IEEE 802.11ac) rate parameters
*/
u8 vht_mcs_set[8];
unsigned int flags; /* HOSTAPD_MODE_FLAG_* */
};
#define IEEE80211_MODE_INFRA 0
#define IEEE80211_MODE_IBSS 1
#define IEEE80211_MODE_AP 2
#define IEEE80211_MODE_MESH 5
#define IEEE80211_CAP_ESS 0x0001
#define IEEE80211_CAP_IBSS 0x0002
#define IEEE80211_CAP_PRIVACY 0x0010
#define IEEE80211_CAP_RRM 0x1000
/* DMG (60 GHz) IEEE 802.11ad */
/* type - bits 0..1 */
#define IEEE80211_CAP_DMG_MASK 0x0003
#define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
#define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
#define IEEE80211_CAP_DMG_AP 0x0003 /* Tx by: AP */
#define WPA_SCAN_QUAL_INVALID BIT(0)
#define WPA_SCAN_NOISE_INVALID BIT(1)
#define WPA_SCAN_LEVEL_INVALID BIT(2)
#define WPA_SCAN_LEVEL_DBM BIT(3)
#define WPA_SCAN_ASSOCIATED BIT(5)
/**
* struct wpa_scan_res - Scan result for an BSS/IBSS
* @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
* @bssid: BSSID
* @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
* @beacon_int: beacon interval in TUs (host byte order)
* @caps: capability information field in host byte order
* @qual: signal quality
* @noise: noise level
* @level: signal level
* @tsf: Timestamp
* @age: Age of the information in milliseconds (i.e., how many milliseconds
* ago the last Beacon or Probe Response frame was received)
* @est_throughput: Estimated throughput in kbps (this is calculated during
* scan result processing if left zero by the driver wrapper)
* @snr: Signal-to-noise ratio in dB (calculated during scan result processing)
* @ie_len: length of the following IE field in octets
* @beacon_ie_len: length of the following Beacon IE field in octets
*
* This structure is used as a generic format for scan results from the
* driver. Each driver interface implementation is responsible for converting
* the driver or OS specific scan results into this format.
*
* If the driver does not support reporting all IEs, the IE data structure is
* constructed of the IEs that are available. This field will also need to
* include SSID in IE format. All drivers are encouraged to be extended to
* report all IEs to make it easier to support future additions.
*
* This structure data is followed by ie_len octets of IEs from Probe Response
* frame (or if the driver does not indicate source of IEs, these may also be
* from Beacon frame). After the first set of IEs, another set of IEs may follow
* (with beacon_ie_len octets of data) if the driver provides both IE sets.
*/
struct wpa_scan_res {
unsigned int flags;
u8 bssid[ETH_ALEN];
int freq;
u16 beacon_int;
u16 caps;
int qual;
int noise;
int level;
u64 tsf;
unsigned int age;
unsigned int est_throughput;
int snr;
size_t ie_len;
size_t beacon_ie_len;
/* Followed by ie_len + beacon_ie_len octets of IE data */
};
/**
* struct wpa_scan_results - Scan results
* @res: Array of pointers to allocated variable length scan result entries
* @num: Number of entries in the scan result array
* @fetch_time: Time when the results were fetched from the driver
*/
struct wpa_scan_results {
struct wpa_scan_res **res;
size_t num;
struct os_reltime fetch_time;
};
/**
* struct wpa_interface_info - Network interface information
* @next: Pointer to the next interface or NULL if this is the last one
* @ifname: Interface name that can be used with init() or init2()
* @desc: Human readable adapter description (e.g., vendor/model) or NULL if
* not available
* @drv_name: struct wpa_driver_ops::name (note: unlike other strings, this one
* is not an allocated copy, i.e., get_interfaces() caller will not free
* this)
*/
struct wpa_interface_info {
struct wpa_interface_info *next;
char *ifname;
char *desc;
const char *drv_name;
};
#define WPAS_MAX_SCAN_SSIDS 16
/**
* struct wpa_driver_scan_ssid - SSIDs to scan for
* @ssid - specific SSID to scan for (ProbeReq)
* %NULL or zero-length SSID is used to indicate active scan
* with wildcard SSID.
* @ssid_len - Length of the SSID in octets
*/
struct wpa_driver_scan_ssid {
const u8 *ssid;
size_t ssid_len;
};
/**
* struct wpa_driver_scan_params - Scan parameters
* Data for struct wpa_driver_ops::scan2().
*/
struct wpa_driver_scan_params {
/**
* ssids - SSIDs to scan for
*/
struct wpa_driver_scan_ssid ssids[WPAS_MAX_SCAN_SSIDS];
/**
* num_ssids - Number of entries in ssids array
* Zero indicates a request for a passive scan.
*/
size_t num_ssids;
/**
* extra_ies - Extra IE(s) to add into Probe Request or %NULL
*/
const u8 *extra_ies;
/**
* extra_ies_len - Length of extra_ies in octets
*/
size_t extra_ies_len;
/**
* freqs - Array of frequencies to scan or %NULL for all frequencies
*
* The frequency is set in MHz. The array is zero-terminated.
*/
int *freqs;
/**
* filter_ssids - Filter for reporting SSIDs
*
* This optional parameter can be used to request the driver wrapper to
* filter scan results to include only the specified SSIDs. %NULL
* indicates that no filtering is to be done. This can be used to
* reduce memory needs for scan results in environments that have large
* number of APs with different SSIDs.
*
* The driver wrapper is allowed to take this allocated buffer into its
* own use by setting the pointer to %NULL. In that case, the driver
* wrapper is responsible for freeing the buffer with os_free() once it
* is not needed anymore.
*/
struct wpa_driver_scan_filter {
u8 ssid[SSID_MAX_LEN];
size_t ssid_len;
} *filter_ssids;
/**
* num_filter_ssids - Number of entries in filter_ssids array
*/
size_t num_filter_ssids;
/**
* filter_rssi - Filter by RSSI
*
* The driver may filter scan results in firmware to reduce host
* wakeups and thereby save power. Specify the RSSI threshold in s32
* dBm.
*/
s32 filter_rssi;
/**
* p2p_probe - Used to disable CCK (802.11b) rates for P2P probes
*
* When set, the driver is expected to remove rates 1, 2, 5.5, and 11
* Mbps from the support rates element(s) in the Probe Request frames
* and not to transmit the frames at any of those rates.
*/
unsigned int p2p_probe:1;
/**
* only_new_results - Request driver to report only new results
*
* This is used to request the driver to report only BSSes that have
* been detected after this scan request has been started, i.e., to
* flush old cached BSS entries.
*/
unsigned int only_new_results:1;
/**
* low_priority - Requests driver to use a lower scan priority
*
* This is used to request the driver to use a lower scan priority
* if it supports such a thing.
*/
unsigned int low_priority:1;
/**
* mac_addr_rand - Requests driver to randomize MAC address
*/
unsigned int mac_addr_rand:1;
/**
* mac_addr - MAC address used with randomization. The address cannot be
* a multicast one, i.e., bit 0 of byte 0 should not be set.
*/
const u8 *mac_addr;
/**
* mac_addr_mask - MAC address mask used with randomization.
*
* Bits that are 0 in the mask should be randomized. Bits that are 1 in
* the mask should be taken as is from mac_addr. The mask should not
* allow the generation of a multicast address, i.e., bit 0 of byte 0
* must be set.
*/
const u8 *mac_addr_mask;
/**
* sched_scan_plans - Scan plans for scheduled scan
*
* Each scan plan consists of the number of iterations to scan and the
* interval between scans. When a scan plan finishes (i.e., it was run
* for the specified number of iterations), the next scan plan is
* executed. The scan plans are executed in the order they appear in
* the array (lower index first). The last scan plan will run infinitely
* (until requested to stop), thus must not specify the number of
* iterations. All other scan plans must specify the number of
* iterations.
*/
struct sched_scan_plan {
u32 interval; /* In seconds */
u32 iterations; /* Zero to run infinitely */
} *sched_scan_plans;
/**
* sched_scan_plans_num - Number of scan plans in sched_scan_plans array
*/
unsigned int sched_scan_plans_num;
/**
* bssid - Specific BSSID to scan for
*
* This optional parameter can be used to replace the default wildcard
* BSSID with a specific BSSID to scan for if results are needed from
* only a single BSS.
*/
const u8 *bssid;
/*
* NOTE: Whenever adding new parameters here, please make sure
* wpa_scan_clone_params() and wpa_scan_free_params() get updated with
* matching changes.
*/
};
/**
* struct wpa_driver_auth_params - Authentication parameters
* Data for struct wpa_driver_ops::authenticate().
*/
struct wpa_driver_auth_params {
int freq;
const u8 *bssid;
const u8 *ssid;
size_t ssid_len;
int auth_alg;
const u8 *ie;
size_t ie_len;
const u8 *wep_key[4];
size_t wep_key_len[4];
int wep_tx_keyidx;
int local_state_change;
/**
* p2p - Whether this connection is a P2P group
*/
int p2p;
/**
* sae_data - SAE elements for Authentication frame
*
* This buffer starts with the Authentication transaction sequence
* number field. If SAE is not used, this pointer is %NULL.
*/
const u8 *sae_data;
/**
* sae_data_len - Length of sae_data buffer in octets
*/
size_t sae_data_len;
};
/**
* enum wps_mode - WPS mode
*/
enum wps_mode {
/**
* WPS_MODE_NONE - No WPS provisioning being used
*/
WPS_MODE_NONE,
/**
* WPS_MODE_OPEN - WPS provisioning with AP that is in open mode
*/
WPS_MODE_OPEN,
/**
* WPS_MODE_PRIVACY - WPS provisioning with AP that is using protection
*/
WPS_MODE_PRIVACY
};
/**
* struct hostapd_freq_params - Channel parameters
*/
struct hostapd_freq_params {
/**
* mode - Mode/band (HOSTAPD_MODE_IEEE80211A, ..)
*/
enum hostapd_hw_mode mode;
/**
* freq - Primary channel center frequency in MHz
*/
int freq;
/**
* channel - Channel number
*/
int channel;
/**
* ht_enabled - Whether HT is enabled
*/
int ht_enabled;
/**
* sec_channel_offset - Secondary channel offset for HT40
*
* 0 = HT40 disabled,
* -1 = HT40 enabled, secondary channel below primary,
* 1 = HT40 enabled, secondary channel above primary
*/
int sec_channel_offset;
/**
* vht_enabled - Whether VHT is enabled
*/
int vht_enabled;
/**
* center_freq1 - Segment 0 center frequency in MHz
*
* Valid for both HT and VHT.
*/
int center_freq1;
/**
* center_freq2 - Segment 1 center frequency in MHz
*
* Non-zero only for bandwidth 80 and an 80+80 channel
*/
int center_freq2;
/**
* bandwidth - Channel bandwidth in MHz (20, 40, 80, 160)
*/
int bandwidth;
};
/**
* struct wpa_driver_associate_params - Association parameters
* Data for struct wpa_driver_ops::associate().
*/
struct wpa_driver_associate_params {
/**
* bssid - BSSID of the selected AP
* This can be %NULL, if ap_scan=2 mode is used and the driver is
* responsible for selecting with which BSS to associate. */
const u8 *bssid;
/**
* bssid_hint - BSSID of a proposed AP
*
* This indicates which BSS has been found a suitable candidate for
* initial association for drivers that use driver/firmwate-based BSS
* selection. Unlike the @bssid parameter, @bssid_hint does not limit
* the driver from selecting other BSSes in the ESS.
*/
const u8 *bssid_hint;
/**
* ssid - The selected SSID
*/
const u8 *ssid;
/**
* ssid_len - Length of the SSID (1..32)
*/
size_t ssid_len;
/**
* freq - channel parameters
*/
struct hostapd_freq_params freq;
/**
* freq_hint - Frequency of the channel the proposed AP is using
*
* This provides a channel on which a suitable BSS has been found as a
* hint for the driver. Unlike the @freq parameter, @freq_hint does not
* limit the driver from selecting other channels for
* driver/firmware-based BSS selection.
*/
int freq_hint;
/**
* bg_scan_period - Background scan period in seconds, 0 to disable
* background scan, or -1 to indicate no change to default driver
* configuration
*/
int bg_scan_period;
/**
* beacon_int - Beacon interval for IBSS or 0 to use driver default
*/
int beacon_int;
/**
* wpa_ie - WPA information element for (Re)Association Request
* WPA information element to be included in (Re)Association
* Request (including information element id and length). Use
* of this WPA IE is optional. If the driver generates the WPA
* IE, it can use pairwise_suite, group_suite, and
* key_mgmt_suite to select proper algorithms. In this case,
* the driver has to notify wpa_supplicant about the used WPA
* IE by generating an event that the interface code will
* convert into EVENT_ASSOCINFO data (see below).
*
* When using WPA2/IEEE 802.11i, wpa_ie is used for RSN IE
* instead. The driver can determine which version is used by
* looking at the first byte of the IE (0xdd for WPA, 0x30 for
* WPA2/RSN).
*
* When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
*/
const u8 *wpa_ie;
/**
* wpa_ie_len - length of the wpa_ie
*/
size_t wpa_ie_len;
/**
* wpa_proto - Bitfield of WPA_PROTO_* values to indicate WPA/WPA2
*/
unsigned int wpa_proto;
/**
* pairwise_suite - Selected pairwise cipher suite (WPA_CIPHER_*)
*
* This is usually ignored if @wpa_ie is used.
*/
unsigned int pairwise_suite;
/**
* group_suite - Selected group cipher suite (WPA_CIPHER_*)
*
* This is usually ignored if @wpa_ie is used.
*/
unsigned int group_suite;
/**
* key_mgmt_suite - Selected key management suite (WPA_KEY_MGMT_*)
*
* This is usually ignored if @wpa_ie is used.
*/
unsigned int key_mgmt_suite;
/**
* auth_alg - Allowed authentication algorithms
* Bit field of WPA_AUTH_ALG_*
*/
int auth_alg;
/**
* mode - Operation mode (infra/ibss) IEEE80211_MODE_*
*/
int mode;
/**
* wep_key - WEP keys for static WEP configuration
*/
const u8 *wep_key[4];
/**
* wep_key_len - WEP key length for static WEP configuration
*/
size_t wep_key_len[4];
/**
* wep_tx_keyidx - WEP TX key index for static WEP configuration
*/
int wep_tx_keyidx;
/**
* mgmt_frame_protection - IEEE 802.11w management frame protection
*/
enum mfp_options mgmt_frame_protection;
/**
* ft_ies - IEEE 802.11r / FT information elements
* If the supplicant is using IEEE 802.11r (FT) and has the needed keys
* for fast transition, this parameter is set to include the IEs that
* are to be sent in the next FT Authentication Request message.
* update_ft_ies() handler is called to update the IEs for further
* FT messages in the sequence.
*
* The driver should use these IEs only if the target AP is advertising
* the same mobility domain as the one included in the MDIE here.
*
* In ap_scan=2 mode, the driver can use these IEs when moving to a new
* AP after the initial association. These IEs can only be used if the
* target AP is advertising support for FT and is using the same MDIE
* and SSID as the current AP.
*
* The driver is responsible for reporting the FT IEs received from the
* AP's response using wpa_supplicant_event() with EVENT_FT_RESPONSE
* type. update_ft_ies() handler will then be called with the FT IEs to
* include in the next frame in the authentication sequence.
*/
const u8 *ft_ies;
/**
* ft_ies_len - Length of ft_ies in bytes
*/
size_t ft_ies_len;
/**
* ft_md - FT Mobility domain (6 octets) (also included inside ft_ies)
*
* This value is provided to allow the driver interface easier access
* to the current mobility domain. This value is set to %NULL if no
* mobility domain is currently active.
*/
const u8 *ft_md;
/**
* passphrase - RSN passphrase for PSK
*
* This value is made available only for WPA/WPA2-Personal (PSK) and
* only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
* the 8..63 character ASCII passphrase, if available. Please note that
* this can be %NULL if passphrase was not used to generate the PSK. In
* that case, the psk field must be used to fetch the PSK.
*/
const char *passphrase;
/**
* psk - RSN PSK (alternative for passphrase for PSK)
*
* This value is made available only for WPA/WPA2-Personal (PSK) and
* only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
* the 32-octet (256-bit) PSK, if available. The driver wrapper should
* be prepared to handle %NULL value as an error.
*/
const u8 *psk;
/**
* drop_unencrypted - Enable/disable unencrypted frame filtering
*
* Configure the driver to drop all non-EAPOL frames (both receive and
* transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
* still be allowed for key negotiation.
*/
int drop_unencrypted;
/**
* prev_bssid - Previously used BSSID in this ESS
*
* When not %NULL, this is a request to use reassociation instead of
* association.
*/
const u8 *prev_bssid;
/**
* wps - WPS mode
*
* If the driver needs to do special configuration for WPS association,
* this variable provides more information on what type of association
* is being requested. Most drivers should not need ot use this.
*/
enum wps_mode wps;
/**
* p2p - Whether this connection is a P2P group
*/
int p2p;
/**
* uapsd - UAPSD parameters for the network
* -1 = do not change defaults
* AP mode: 1 = enabled, 0 = disabled
* STA mode: bits 0..3 UAPSD enabled for VO,VI,BK,BE
*/
int uapsd;
/**
* fixed_bssid - Whether to force this BSSID in IBSS mode
* 1 = Fix this BSSID and prevent merges.
* 0 = Do not fix BSSID.
*/
int fixed_bssid;
/**
* fixed_freq - Fix control channel in IBSS mode
* 0 = don't fix control channel (default)
* 1 = fix control channel; this prevents IBSS merging with another
* channel
*/
int fixed_freq;
/**
* disable_ht - Disable HT (IEEE 802.11n) for this connection
*/
int disable_ht;
/**
* htcaps - HT Capabilities over-rides
*
* Only bits set in the mask will be used, and not all values are used
* by the kernel anyway. Currently, MCS, MPDU and MSDU fields are used.
*
* Pointer to struct ieee80211_ht_capabilities.
*/
const u8 *htcaps;
/**
* htcaps_mask - HT Capabilities over-rides mask
*
* Pointer to struct ieee80211_ht_capabilities.
*/
const u8 *htcaps_mask;
#ifdef CONFIG_VHT_OVERRIDES
/**
* disable_vht - Disable VHT for this connection
*/
int disable_vht;
/**
* VHT capability overrides.
*/
const struct ieee80211_vht_capabilities *vhtcaps;
const struct ieee80211_vht_capabilities *vhtcaps_mask;
#endif /* CONFIG_VHT_OVERRIDES */
/**
* req_key_mgmt_offload - Request key management offload for connection
*
* Request key management offload for this connection if the device
* supports it.
*/
int req_key_mgmt_offload;
/**
* Flag for indicating whether this association includes support for
* RRM (Radio Resource Measurements)
*/
int rrm_used;
/**
* pbss - If set, connect to a PCP in a PBSS. Otherwise, connect to an
* AP as usual. Valid for DMG network only.
*/
int pbss;
};
enum hide_ssid {
NO_SSID_HIDING,
HIDDEN_SSID_ZERO_LEN,
HIDDEN_SSID_ZERO_CONTENTS
};
struct wowlan_triggers {
u8 any;
u8 disconnect;
u8 magic_pkt;
u8 gtk_rekey_failure;
u8 eap_identity_req;
u8 four_way_handshake;
u8 rfkill_release;
};
struct wpa_driver_ap_params {
/**
* head - Beacon head from IEEE 802.11 header to IEs before TIM IE
*/
u8 *head;
/**
* head_len - Length of the head buffer in octets
*/
size_t head_len;
/**
* tail - Beacon tail following TIM IE
*/
u8 *tail;
/**
* tail_len - Length of the tail buffer in octets
*/
size_t tail_len;
/**
* dtim_period - DTIM period
*/
int dtim_period;
/**
* beacon_int - Beacon interval
*/
int beacon_int;
/**
* basic_rates: -1 terminated array of basic rates in 100 kbps
*
* This parameter can be used to set a specific basic rate set for the
* BSS. If %NULL, default basic rate set is used.
*/
int *basic_rates;
/**
* proberesp - Probe Response template
*
* This is used by drivers that reply to Probe Requests internally in
* AP mode and require the full Probe Response template.
*/
u8 *proberesp;
/**
* proberesp_len - Length of the proberesp buffer in octets
*/
size_t proberesp_len;
/**
* ssid - The SSID to use in Beacon/Probe Response frames
*/
const u8 *ssid;
/**
* ssid_len - Length of the SSID (1..32)
*/
size_t ssid_len;
/**
* hide_ssid - Whether to hide the SSID
*/
enum hide_ssid hide_ssid;
/**
* pairwise_ciphers - WPA_CIPHER_* bitfield
*/
unsigned int pairwise_ciphers;
/**
* group_cipher - WPA_CIPHER_*
*/
unsigned int group_cipher;
/**
* key_mgmt_suites - WPA_KEY_MGMT_* bitfield
*/
unsigned int key_mgmt_suites;
/**
* auth_algs - WPA_AUTH_ALG_* bitfield
*/
unsigned int auth_algs;
/**
* wpa_version - WPA_PROTO_* bitfield
*/
unsigned int wpa_version;
/**
* privacy - Whether privacy is used in the BSS
*/
int privacy;
/**