hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/net/cfg80211.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 #ifndef __NET_CFG80211_H
23 #define __NET_CFG80211_H
34 /*
....@@ -6,11 +7,7 @@
67 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
78 * Copyright 2013-2014 Intel Mobile Communications GmbH
89 * Copyright 2015-2017 Intel Deutschland GmbH
9
- * Copyright (C) 2018-2019 Intel Corporation
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License version 2 as
13
- * published by the Free Software Foundation.
10
+ * Copyright (C) 2018-2020 Intel Corporation
1411 */
1512
1613 #include <linux/netdevice.h>
....@@ -23,10 +20,8 @@
2320 #include <linux/if_ether.h>
2421 #include <linux/ieee80211.h>
2522 #include <linux/net.h>
23
+#include <linux/android_kabi.h>
2624 #include <net/regulatory.h>
27
-
28
-/* Indicate support for including KEK length in rekey data */
29
-#define CFG80211_REKEY_DATA_KEK_LEN 1
3025
3126 /**
3227 * DOC: Introduction
....@@ -78,12 +73,12 @@
7873 *
7974 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
8075 * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes
81
- * sending probe requests or beaconing.
76
+ * sending probe requests or beaconing.
8277 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
8378 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
84
- * is not permitted.
79
+ * is not permitted.
8580 * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel
86
- * is not permitted.
81
+ * is not permitted.
8782 * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel.
8883 * @IEEE80211_CHAN_NO_80MHZ: If the driver supports 80 MHz on the band,
8984 * this flag indicates that an 80 MHz channel cannot use this
....@@ -101,6 +96,17 @@
10196 * on this channel.
10297 * @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted
10398 * on this channel.
99
+ * @IEEE80211_CHAN_NO_HE: HE operation is not permitted on this channel.
100
+ * @IEEE80211_CHAN_1MHZ: 1 MHz bandwidth is permitted
101
+ * on this channel.
102
+ * @IEEE80211_CHAN_2MHZ: 2 MHz bandwidth is permitted
103
+ * on this channel.
104
+ * @IEEE80211_CHAN_4MHZ: 4 MHz bandwidth is permitted
105
+ * on this channel.
106
+ * @IEEE80211_CHAN_8MHZ: 8 MHz bandwidth is permitted
107
+ * on this channel.
108
+ * @IEEE80211_CHAN_16MHZ: 16 MHz bandwidth is permitted
109
+ * on this channel.
104110 *
105111 */
106112 enum ieee80211_channel_flags {
....@@ -117,6 +123,12 @@
117123 IEEE80211_CHAN_IR_CONCURRENT = 1<<10,
118124 IEEE80211_CHAN_NO_20MHZ = 1<<11,
119125 IEEE80211_CHAN_NO_10MHZ = 1<<12,
126
+ IEEE80211_CHAN_NO_HE = 1<<13,
127
+ IEEE80211_CHAN_1MHZ = 1<<14,
128
+ IEEE80211_CHAN_2MHZ = 1<<15,
129
+ IEEE80211_CHAN_4MHZ = 1<<16,
130
+ IEEE80211_CHAN_8MHZ = 1<<17,
131
+ IEEE80211_CHAN_16MHZ = 1<<18,
120132 };
121133
122134 #define IEEE80211_CHAN_NO_HT40 \
....@@ -132,6 +144,7 @@
132144 * with cfg80211.
133145 *
134146 * @center_freq: center frequency in MHz
147
+ * @freq_offset: offset from @center_freq, in KHz
135148 * @hw_value: hardware-specific value for the channel
136149 * @flags: channel flags from &enum ieee80211_channel_flags.
137150 * @orig_flags: channel flags at registration time, used by regulatory
....@@ -152,7 +165,8 @@
152165 */
153166 struct ieee80211_channel {
154167 enum nl80211_band band;
155
- u16 center_freq;
168
+ u32 center_freq;
169
+ u16 freq_offset;
156170 u16 hw_value;
157171 u32 flags;
158172 int max_antenna_gain;
....@@ -253,6 +267,55 @@
253267 };
254268
255269 /**
270
+ * struct ieee80211_he_obss_pd - AP settings for spatial reuse
271
+ *
272
+ * @enable: is the feature enabled.
273
+ * @sr_ctrl: The SR Control field of SRP element.
274
+ * @non_srg_max_offset: non-SRG maximum tx power offset
275
+ * @min_offset: minimal tx power offset an associated station shall use
276
+ * @max_offset: maximum tx power offset an associated station shall use
277
+ * @bss_color_bitmap: bitmap that indicates the BSS color values used by
278
+ * members of the SRG
279
+ * @partial_bssid_bitmap: bitmap that indicates the partial BSSID values
280
+ * used by members of the SRG
281
+ */
282
+struct ieee80211_he_obss_pd {
283
+ bool enable;
284
+ u8 sr_ctrl;
285
+ u8 non_srg_max_offset;
286
+ u8 min_offset;
287
+ u8 max_offset;
288
+ u8 bss_color_bitmap[8];
289
+ u8 partial_bssid_bitmap[8];
290
+};
291
+
292
+/**
293
+ * struct cfg80211_he_bss_color - AP settings for BSS coloring
294
+ *
295
+ * @color: the current color.
296
+ * @enabled: HE BSS color is used
297
+ * @partial: define the AID equation.
298
+ */
299
+struct cfg80211_he_bss_color {
300
+ u8 color;
301
+ bool enabled;
302
+ bool partial;
303
+};
304
+
305
+/**
306
+ * struct ieee80211_he_bss_color - AP settings for BSS coloring
307
+ *
308
+ * @color: the current color.
309
+ * @disabled: is the feature disabled.
310
+ * @partial: define the AID equation.
311
+ */
312
+struct ieee80211_he_bss_color {
313
+ u8 color;
314
+ bool disabled;
315
+ bool partial;
316
+};
317
+
318
+/**
256319 * struct ieee80211_sta_ht_cap - STA's HT capabilities
257320 *
258321 * This structure describes most essential parameters needed
....@@ -317,10 +380,13 @@
317380 *
318381 * @types_mask: interface types mask
319382 * @he_cap: holds the HE capabilities
383
+ * @he_6ghz_capa: HE 6 GHz capabilities, must be filled in for a
384
+ * 6 GHz band channel (and 0 may be valid value).
320385 */
321386 struct ieee80211_sband_iftype_data {
322387 u16 types_mask;
323388 struct ieee80211_sta_he_cap he_cap;
389
+ struct ieee80211_he_6ghz_capa he_6ghz_capa;
324390 };
325391
326392 /**
....@@ -378,12 +444,28 @@
378444 };
379445
380446 /**
447
+ * struct ieee80211_sta_s1g_cap - STA's S1G capabilities
448
+ *
449
+ * This structure describes most essential parameters needed
450
+ * to describe 802.11ah S1G capabilities for a STA.
451
+ *
452
+ * @s1g_supported: is STA an S1G STA
453
+ * @cap: S1G capabilities information
454
+ * @nss_mcs: Supported NSS MCS set
455
+ */
456
+struct ieee80211_sta_s1g_cap {
457
+ bool s1g;
458
+ u8 cap[10]; /* use S1G_CAPAB_ */
459
+ u8 nss_mcs[5];
460
+};
461
+
462
+/**
381463 * struct ieee80211_supported_band - frequency band definition
382464 *
383465 * This structure describes a frequency band a wiphy
384466 * is able to operate in.
385467 *
386
- * @channels: Array of channels the hardware can operate in
468
+ * @channels: Array of channels the hardware can operate with
387469 * in this band.
388470 * @band: the band this structure represents
389471 * @n_channels: Number of channels in @channels
....@@ -393,7 +475,9 @@
393475 * @n_bitrates: Number of bitrates in @bitrates
394476 * @ht_cap: HT capabilities in this band
395477 * @vht_cap: VHT capabilities in this band
478
+ * @s1g_cap: S1G capabilities in this band
396479 * @edmg_cap: EDMG capabilities in this band
480
+ * @s1g_cap: S1G capabilities in this band (S1B band only, of course)
397481 * @n_iftype_data: number of iftype data entries
398482 * @iftype_data: interface type data entries. Note that the bits in
399483 * @types_mask inside this structure cannot overlap (i.e. only
....@@ -408,6 +492,7 @@
408492 int n_bitrates;
409493 struct ieee80211_sta_ht_cap ht_cap;
410494 struct ieee80211_sta_vht_cap vht_cap;
495
+ struct ieee80211_sta_s1g_cap s1g_cap;
411496 struct ieee80211_edmg edmg_cap;
412497 u16 n_iftype_data;
413498 const struct ieee80211_sband_iftype_data *iftype_data;
....@@ -429,6 +514,9 @@
429514 if (WARN_ON(iftype >= NL80211_IFTYPE_MAX))
430515 return NULL;
431516
517
+ if (iftype == NL80211_IFTYPE_AP_VLAN)
518
+ iftype = NL80211_IFTYPE_AP;
519
+
432520 for (i = 0; i < sband->n_iftype_data; i++) {
433521 const struct ieee80211_sband_iftype_data *data =
434522 &sband->iftype_data[i];
....@@ -436,6 +524,26 @@
436524 if (data->types_mask & BIT(iftype))
437525 return data;
438526 }
527
+
528
+ return NULL;
529
+}
530
+
531
+/**
532
+ * ieee80211_get_he_iftype_cap - return HE capabilities for an sband's iftype
533
+ * @sband: the sband to search for the iftype on
534
+ * @iftype: enum nl80211_iftype
535
+ *
536
+ * Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found
537
+ */
538
+static inline const struct ieee80211_sta_he_cap *
539
+ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *sband,
540
+ u8 iftype)
541
+{
542
+ const struct ieee80211_sband_iftype_data *data =
543
+ ieee80211_get_sband_iftype_data(sband, iftype);
544
+
545
+ if (data && data->he_cap.has_he)
546
+ return &data->he_cap;
439547
440548 return NULL;
441549 }
....@@ -449,13 +557,27 @@
449557 static inline const struct ieee80211_sta_he_cap *
450558 ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband)
451559 {
560
+ return ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_STATION);
561
+}
562
+
563
+/**
564
+ * ieee80211_get_he_6ghz_capa - return HE 6 GHz capabilities
565
+ * @sband: the sband to search for the STA on
566
+ * @iftype: the iftype to search for
567
+ *
568
+ * Return: the 6GHz capabilities
569
+ */
570
+static inline __le16
571
+ieee80211_get_he_6ghz_capa(const struct ieee80211_supported_band *sband,
572
+ enum nl80211_iftype iftype)
573
+{
452574 const struct ieee80211_sband_iftype_data *data =
453
- ieee80211_get_sband_iftype_data(sband, NL80211_IFTYPE_STATION);
575
+ ieee80211_get_sband_iftype_data(sband, iftype);
454576
455
- if (data && data->he_cap.has_he)
456
- return &data->he_cap;
577
+ if (WARN_ON(!data || !data->he_cap.has_he))
578
+ return 0;
457579
458
- return NULL;
580
+ return data->he_6ghz_capa.capa;
459581 }
460582
461583 /**
....@@ -544,13 +666,17 @@
544666 * with the get_key() callback, must be in little endian,
545667 * length given by @seq_len.
546668 * @seq_len: length of @seq.
669
+ * @vlan_id: vlan_id for VLAN group key (if nonzero)
670
+ * @mode: key install mode (RX_TX, NO_TX or SET_TX)
547671 */
548672 struct key_params {
549673 const u8 *key;
550674 const u8 *seq;
551675 int key_len;
552676 int seq_len;
677
+ u16 vlan_id;
553678 u32 cipher;
679
+ enum nl80211_key_mode mode;
554680 };
555681
556682 /**
....@@ -564,6 +690,7 @@
564690 * If edmg is requested (i.e. the .channels member is non-zero),
565691 * chan will define the primary channel and all other
566692 * parameters are ignored.
693
+ * @freq1_offset: offset from @center_freq1, in KHz
567694 */
568695 struct cfg80211_chan_def {
569696 struct ieee80211_channel *chan;
....@@ -571,6 +698,64 @@
571698 u32 center_freq1;
572699 u32 center_freq2;
573700 struct ieee80211_edmg edmg;
701
+ u16 freq1_offset;
702
+};
703
+
704
+/*
705
+ * cfg80211_bitrate_mask - masks for bitrate control
706
+ */
707
+struct cfg80211_bitrate_mask {
708
+ struct {
709
+ u32 legacy;
710
+ u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
711
+ u16 vht_mcs[NL80211_VHT_NSS_MAX];
712
+ u16 he_mcs[NL80211_HE_NSS_MAX];
713
+ enum nl80211_txrate_gi gi;
714
+ enum nl80211_he_gi he_gi;
715
+ enum nl80211_he_ltf he_ltf;
716
+ } control[NUM_NL80211_BANDS];
717
+};
718
+
719
+
720
+/**
721
+ * struct cfg80211_tid_cfg - TID specific configuration
722
+ * @config_override: Flag to notify driver to reset TID configuration
723
+ * of the peer.
724
+ * @tids: bitmap of TIDs to modify
725
+ * @mask: bitmap of attributes indicating which parameter changed,
726
+ * similar to &nl80211_tid_config_supp.
727
+ * @noack: noack configuration value for the TID
728
+ * @retry_long: retry count value
729
+ * @retry_short: retry count value
730
+ * @ampdu: Enable/Disable MPDU aggregation
731
+ * @rtscts: Enable/Disable RTS/CTS
732
+ * @amsdu: Enable/Disable MSDU aggregation
733
+ * @txrate_type: Tx bitrate mask type
734
+ * @txrate_mask: Tx bitrate to be applied for the TID
735
+ */
736
+struct cfg80211_tid_cfg {
737
+ bool config_override;
738
+ u8 tids;
739
+ u64 mask;
740
+ enum nl80211_tid_config noack;
741
+ u8 retry_long, retry_short;
742
+ enum nl80211_tid_config ampdu;
743
+ enum nl80211_tid_config rtscts;
744
+ enum nl80211_tid_config amsdu;
745
+ enum nl80211_tx_rate_setting txrate_type;
746
+ struct cfg80211_bitrate_mask txrate_mask;
747
+};
748
+
749
+/**
750
+ * struct cfg80211_tid_config - TID configuration
751
+ * @peer: Station's MAC address
752
+ * @n_tid_conf: Number of TID specific configurations to be applied
753
+ * @tid_conf: Configuration change info
754
+ */
755
+struct cfg80211_tid_config {
756
+ const u8 *peer;
757
+ u32 n_tid_conf;
758
+ struct cfg80211_tid_cfg tid_conf[];
574759 };
575760
576761 /**
....@@ -625,6 +810,7 @@
625810 return (chandef1->chan == chandef2->chan &&
626811 chandef1->width == chandef2->width &&
627812 chandef1->center_freq1 == chandef2->center_freq1 &&
813
+ chandef1->freq1_offset == chandef2->freq1_offset &&
628814 chandef1->center_freq2 == chandef2->center_freq2);
629815 }
630816
....@@ -745,6 +931,7 @@
745931 * @SURVEY_INFO_TIME_RX: receive time was filled in
746932 * @SURVEY_INFO_TIME_TX: transmit time was filled in
747933 * @SURVEY_INFO_TIME_SCAN: scan time was filled in
934
+ * @SURVEY_INFO_TIME_BSS_RX: local BSS receive time was filled in
748935 *
749936 * Used by the driver to indicate which info in &struct survey_info
750937 * it has filled in during the get_survey().
....@@ -758,6 +945,7 @@
758945 SURVEY_INFO_TIME_RX = BIT(5),
759946 SURVEY_INFO_TIME_TX = BIT(6),
760947 SURVEY_INFO_TIME_SCAN = BIT(7),
948
+ SURVEY_INFO_TIME_BSS_RX = BIT(8),
761949 };
762950
763951 /**
....@@ -774,6 +962,7 @@
774962 * @time_rx: amount of time the radio spent receiving data
775963 * @time_tx: amount of time the radio spent transmitting data
776964 * @time_scan: amount of time the radio spent for scanning
965
+ * @time_bss_rx: amount of time the radio spent receiving data on a local BSS
777966 *
778967 * Used by dump_survey() to report back per-channel survey information.
779968 *
....@@ -788,6 +977,7 @@
788977 u64 time_rx;
789978 u64 time_tx;
790979 u64 time_scan;
980
+ u64 time_bss_rx;
791981 u32 filled;
792982 s8 noise;
793983 };
....@@ -813,10 +1003,30 @@
8131003 * protocol frames.
8141004 * @control_port_over_nl80211: TRUE if userspace expects to exchange control
8151005 * port frames over NL80211 instead of the network interface.
1006
+ * @control_port_no_preauth: disables pre-auth rx over the nl80211 control
1007
+ * port for mac80211
8161008 * @wep_keys: static WEP keys, if not NULL points to an array of
8171009 * CFG80211_MAX_WEP_KEYS WEP keys
8181010 * @wep_tx_key: key index (0..3) of the default TX static WEP key
8191011 * @psk: PSK (for devices supporting 4-way-handshake offload)
1012
+ * @sae_pwd: password for SAE authentication (for devices supporting SAE
1013
+ * offload)
1014
+ * @sae_pwd_len: length of SAE password (for devices supporting SAE offload)
1015
+ * @sae_pwe: The mechanisms allowed for SAE PWE derivation:
1016
+ *
1017
+ * NL80211_SAE_PWE_UNSPECIFIED
1018
+ * Not-specified, used to indicate userspace did not specify any
1019
+ * preference. The driver should follow its internal policy in
1020
+ * such a scenario.
1021
+ *
1022
+ * NL80211_SAE_PWE_HUNT_AND_PECK
1023
+ * Allow hunting-and-pecking loop only
1024
+ *
1025
+ * NL80211_SAE_PWE_HASH_TO_ELEMENT
1026
+ * Allow hash-to-element only
1027
+ *
1028
+ * NL80211_SAE_PWE_BOTH
1029
+ * Allow either hunting-and-pecking loop or hash-to-element
8201030 */
8211031 struct cfg80211_crypto_settings {
8221032 u32 wpa_versions;
....@@ -829,9 +1039,15 @@
8291039 __be16 control_port_ethertype;
8301040 bool control_port_no_encrypt;
8311041 bool control_port_over_nl80211;
1042
+ bool control_port_no_preauth;
8321043 struct key_params *wep_keys;
8331044 int wep_tx_key;
8341045 const u8 *psk;
1046
+ const u8 *sae_pwd;
1047
+ u8 sae_pwd_len;
1048
+ enum nl80211_sae_pwe_mechanism sae_pwe;
1049
+
1050
+ ANDROID_KABI_RESERVE(1);
8351051 };
8361052
8371053 /**
....@@ -852,6 +1068,14 @@
8521068 * @assocresp_ies_len: length of assocresp_ies in octets
8531069 * @probe_resp_len: length of probe response template (@probe_resp)
8541070 * @probe_resp: probe response template (AP mode only)
1071
+ * @ftm_responder: enable FTM responder functionality; -1 for no change
1072
+ * (which also implies no change in LCI/civic location data)
1073
+ * @lci: Measurement Report element content, starting with Measurement Token
1074
+ * (measurement type 8)
1075
+ * @civicloc: Measurement Report element content, starting with Measurement
1076
+ * Token (measurement type 11)
1077
+ * @lci_len: LCI data length
1078
+ * @civicloc_len: Civic location data length
8551079 */
8561080 struct cfg80211_beacon_data {
8571081 const u8 *head, *tail;
....@@ -859,12 +1083,19 @@
8591083 const u8 *proberesp_ies;
8601084 const u8 *assocresp_ies;
8611085 const u8 *probe_resp;
1086
+ const u8 *lci;
1087
+ const u8 *civicloc;
1088
+ s8 ftm_responder;
8621089
8631090 size_t head_len, tail_len;
8641091 size_t beacon_ies_len;
8651092 size_t proberesp_ies_len;
8661093 size_t assocresp_ies_len;
8671094 size_t probe_resp_len;
1095
+ size_t lci_len;
1096
+ size_t civicloc_len;
1097
+
1098
+ ANDROID_KABI_RESERVE(1);
8681099 };
8691100
8701101 struct mac_address {
....@@ -887,16 +1118,37 @@
8871118 struct mac_address mac_addrs[];
8881119 };
8891120
890
-/*
891
- * cfg80211_bitrate_mask - masks for bitrate control
1121
+/**
1122
+ * struct cfg80211_fils_discovery - FILS discovery parameters from
1123
+ * IEEE Std 802.11ai-2016, Annex C.3 MIB detail.
1124
+ *
1125
+ * @min_interval: Minimum packet interval in TUs (0 - 10000)
1126
+ * @max_interval: Maximum packet interval in TUs (0 - 10000)
1127
+ * @tmpl_len: Template length
1128
+ * @tmpl: Template data for FILS discovery frame including the action
1129
+ * frame headers.
8921130 */
893
-struct cfg80211_bitrate_mask {
894
- struct {
895
- u32 legacy;
896
- u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
897
- u16 vht_mcs[NL80211_VHT_NSS_MAX];
898
- enum nl80211_txrate_gi gi;
899
- } control[NUM_NL80211_BANDS];
1131
+struct cfg80211_fils_discovery {
1132
+ u32 min_interval;
1133
+ u32 max_interval;
1134
+ size_t tmpl_len;
1135
+ const u8 *tmpl;
1136
+};
1137
+
1138
+/**
1139
+ * struct cfg80211_unsol_bcast_probe_resp - Unsolicited broadcast probe
1140
+ * response parameters in 6GHz.
1141
+ *
1142
+ * @interval: Packet interval in TUs. Maximum allowed is 20 TU, as mentioned
1143
+ * in IEEE P802.11ax/D6.0 26.17.2.3.2 - AP behavior for fast passive
1144
+ * scanning
1145
+ * @tmpl_len: Template length
1146
+ * @tmpl: Template data for probe response
1147
+ */
1148
+struct cfg80211_unsol_bcast_probe_resp {
1149
+ u32 interval;
1150
+ size_t tmpl_len;
1151
+ const u8 *tmpl;
9001152 };
9011153
9021154 /**
....@@ -937,9 +1189,17 @@
9371189 * @beacon_rate: bitrate to be used for beacons
9381190 * @ht_cap: HT capabilities (or %NULL if HT isn't enabled)
9391191 * @vht_cap: VHT capabilities (or %NULL if VHT isn't enabled)
1192
+ * @he_cap: HE capabilities (or %NULL if HE isn't enabled)
9401193 * @ht_required: stations must support HT
9411194 * @vht_required: stations must support VHT
1195
+ * @twt_responder: Enable Target Wait Time
1196
+ * @he_required: stations must support HE
9421197 * @flags: flags, as defined in enum cfg80211_ap_settings_flags
1198
+ * @he_obss_pd: OBSS Packet Detection settings
1199
+ * @he_bss_color: BSS Color settings
1200
+ * @he_oper: HE operation IE (or %NULL if HE isn't enabled)
1201
+ * @fils_discovery: FILS discovery transmission parameters
1202
+ * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
9431203 */
9441204 struct cfg80211_ap_settings {
9451205 struct cfg80211_chan_def chandef;
....@@ -963,8 +1223,17 @@
9631223
9641224 const struct ieee80211_ht_cap *ht_cap;
9651225 const struct ieee80211_vht_cap *vht_cap;
966
- bool ht_required, vht_required;
1226
+ const struct ieee80211_he_cap_elem *he_cap;
1227
+ const struct ieee80211_he_operation *he_oper;
1228
+ bool ht_required, vht_required, he_required;
1229
+ bool twt_responder;
9671230 u32 flags;
1231
+ struct ieee80211_he_obss_pd he_obss_pd;
1232
+ struct cfg80211_he_bss_color he_bss_color;
1233
+ struct cfg80211_fils_discovery fils_discovery;
1234
+ struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
1235
+
1236
+ ANDROID_KABI_RESERVE(1);
9681237 };
9691238
9701239 /**
....@@ -994,6 +1263,8 @@
9941263 bool radar_required;
9951264 bool block_tx;
9961265 u8 count;
1266
+
1267
+ ANDROID_KABI_RESERVE(1);
9971268 };
9981269
9991270 #define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10
....@@ -1035,6 +1306,27 @@
10351306 STATION_PARAM_APPLY_UAPSD = BIT(0),
10361307 STATION_PARAM_APPLY_CAPABILITY = BIT(1),
10371308 STATION_PARAM_APPLY_PLINK_STATE = BIT(2),
1309
+ STATION_PARAM_APPLY_STA_TXPOWER = BIT(3),
1310
+};
1311
+
1312
+/**
1313
+ * struct sta_txpwr - station txpower configuration
1314
+ *
1315
+ * Used to configure txpower for station.
1316
+ *
1317
+ * @power: tx power (in dBm) to be used for sending data traffic. If tx power
1318
+ * is not provided, the default per-interface tx power setting will be
1319
+ * overriding. Driver should be picking up the lowest tx power, either tx
1320
+ * power per-interface or per-station.
1321
+ * @type: In particular if TPC %type is NL80211_TX_POWER_LIMITED then tx power
1322
+ * will be less than or equal to specified from userspace, whereas if TPC
1323
+ * %type is NL80211_TX_POWER_AUTOMATIC then it indicates default tx power.
1324
+ * NL80211_TX_POWER_FIXED is not a valid configuration option for
1325
+ * per peer TPC.
1326
+ */
1327
+struct sta_txpwr {
1328
+ s16 power;
1329
+ enum nl80211_tx_power_setting type;
10381330 };
10391331
10401332 /**
....@@ -1052,6 +1344,7 @@
10521344 * (bitmask of BIT(%NL80211_STA_FLAG_...))
10531345 * @listen_interval: listen interval or -1 for no change
10541346 * @aid: AID or zero for no change
1347
+ * @vlan_id: VLAN ID for station (if nonzero)
10551348 * @peer_aid: mesh peer AID or zero for no change
10561349 * @plink_action: plink action to take
10571350 * @plink_state: set the peer link state for a station
....@@ -1078,6 +1371,9 @@
10781371 * @support_p2p_ps: information if station supports P2P PS mechanism
10791372 * @he_capa: HE capabilities of station
10801373 * @he_capa_len: the length of the HE capabilities
1374
+ * @airtime_weight: airtime scheduler weight for this station
1375
+ * @txpwr: transmit power for an associated station
1376
+ * @he_6ghz_capa: HE 6 GHz Band capabilities of station
10811377 */
10821378 struct station_parameters {
10831379 const u8 *supported_rates;
....@@ -1086,6 +1382,7 @@
10861382 u32 sta_modify_mask;
10871383 int listen_interval;
10881384 u16 aid;
1385
+ u16 vlan_id;
10891386 u16 peer_aid;
10901387 u8 supported_rates_len;
10911388 u8 plink_action;
....@@ -1107,6 +1404,11 @@
11071404 int support_p2p_ps;
11081405 const struct ieee80211_he_cap_elem *he_capa;
11091406 u8 he_capa_len;
1407
+ u16 airtime_weight;
1408
+ struct sta_txpwr txpwr;
1409
+ const struct ieee80211_he_6ghz_capa *he_6ghz_capa;
1410
+
1411
+ ANDROID_KABI_RESERVE(1);
11101412 };
11111413
11121414 /**
....@@ -1172,7 +1474,7 @@
11721474 enum cfg80211_station_type statype);
11731475
11741476 /**
1175
- * enum station_info_rate_flags - bitrate info flags
1477
+ * enum rate_info_flags - bitrate info flags
11761478 *
11771479 * Used by the driver to indicate the specific rate transmission
11781480 * type for 802.11n transmissions.
....@@ -1245,7 +1547,7 @@
12451547 };
12461548
12471549 /**
1248
- * enum station_info_rate_flags - bitrate info flags
1550
+ * enum bss_param_flags - bitrate info flags
12491551 *
12501552 * Used by the driver to indicate the specific rate transmission
12511553 * type for 802.11n transmissions.
....@@ -1337,6 +1639,7 @@
13371639 * indicate the relevant values in this struct for them
13381640 * @connected_time: time(in secs) since a station is last connected
13391641 * @inactive_time: time since last station activity (tx/rx) in milliseconds
1642
+ * @assoc_at: bootime (ns) of the last association
13401643 * @rx_bytes: bytes (size of MPDUs) received from this station
13411644 * @tx_bytes: bytes (size of MPDUs) transmitted to this station
13421645 * @llid: mesh local link id
....@@ -1377,7 +1680,10 @@
13771680 * @rx_beacon: number of beacons received from this peer
13781681 * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received
13791682 * from this peer
1683
+ * @connected_to_gate: true if mesh STA has a path to mesh gate
13801684 * @rx_duration: aggregate PPDU duration(usecs) for all the frames from a peer
1685
+ * @tx_duration: aggregate PPDU duration(usecs) for all the frames to a peer
1686
+ * @airtime_weight: current airtime scheduling weight
13811687 * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last
13821688 * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs.
13831689 * Note that this doesn't use the @filled bit, but is used if non-NULL.
....@@ -1388,11 +1694,14 @@
13881694 * @fcs_err_count: number of packets (MPDUs) received from this station with
13891695 * an FCS error. This counter should be incremented only when TA of the
13901696 * received packet with an FCS error matches the peer MAC address.
1697
+ * @airtime_link_metric: mesh airtime link metric.
1698
+ * @connected_to_as: true if mesh STA has a path to authentication server
13911699 */
13921700 struct station_info {
13931701 u64 filled;
13941702 u32 connected_time;
13951703 u32 inactive_time;
1704
+ u64 assoc_at;
13961705 u64 rx_bytes;
13971706 u64 tx_bytes;
13981707 u16 llid;
....@@ -1428,15 +1737,26 @@
14281737
14291738 u32 expected_throughput;
14301739
1431
- u64 rx_beacon;
1740
+ u64 tx_duration;
14321741 u64 rx_duration;
1742
+ u64 rx_beacon;
14331743 u8 rx_beacon_signal_avg;
1744
+ u8 connected_to_gate;
1745
+
14341746 struct cfg80211_tid_stats *pertid;
14351747 s8 ack_signal;
14361748 s8 avg_ack_signal;
14371749
1750
+ u16 airtime_weight;
1751
+
14381752 u32 rx_mpdu_count;
14391753 u32 fcs_err_count;
1754
+
1755
+ u32 airtime_link_metric;
1756
+
1757
+ u8 connected_to_as;
1758
+
1759
+ ANDROID_KABI_RESERVE(1);
14401760 };
14411761
14421762 #if IS_ENABLED(CONFIG_CFG80211)
....@@ -1498,6 +1818,8 @@
14981818 * @MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
14991819 * @MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled
15001820 * @MPATH_INFO_FLAGS: @flags filled
1821
+ * @MPATH_INFO_HOP_COUNT: @hop_count filled
1822
+ * @MPATH_INFO_PATH_CHANGE: @path_change_count filled
15011823 */
15021824 enum mpath_info_flags {
15031825 MPATH_INFO_FRAME_QLEN = BIT(0),
....@@ -1507,6 +1829,8 @@
15071829 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4),
15081830 MPATH_INFO_DISCOVERY_RETRIES = BIT(5),
15091831 MPATH_INFO_FLAGS = BIT(6),
1832
+ MPATH_INFO_HOP_COUNT = BIT(7),
1833
+ MPATH_INFO_PATH_CHANGE = BIT(8),
15101834 };
15111835
15121836 /**
....@@ -1526,6 +1850,8 @@
15261850 * This number should increase every time the list of mesh paths
15271851 * changes, i.e. when a station is added or removed, so that
15281852 * userspace can tell whether it got a consistent snapshot.
1853
+ * @hop_count: hops to destination
1854
+ * @path_change_count: total number of path changes to destination
15291855 */
15301856 struct mpath_info {
15311857 u32 filled;
....@@ -1536,6 +1862,8 @@
15361862 u32 discovery_timeout;
15371863 u8 discovery_retries;
15381864 u8 flags;
1865
+ u8 hop_count;
1866
+ u32 path_change_count;
15391867
15401868 int generation;
15411869 };
....@@ -1555,8 +1883,9 @@
15551883 * (or NULL for no change)
15561884 * @basic_rates_len: number of basic rates
15571885 * @ap_isolate: do not forward packets between connected stations
1886
+ * (0 = no, 1 = yes, -1 = do not change)
15581887 * @ht_opmode: HT Operation mode
1559
- * (u16 = opmode, -1 = do not change)
1888
+ * (u16 = opmode, -1 = do not change)
15601889 * @p2p_ctwindow: P2P CT Window (-1 = no change)
15611890 * @p2p_opp_ps: P2P opportunistic PS (-1 = no change)
15621891 */
....@@ -1640,6 +1969,15 @@
16401969 * @plink_timeout: If no tx activity is seen from a STA we've established
16411970 * peering with for longer than this time (in seconds), then remove it
16421971 * from the STA's list of peers. Default is 30 minutes.
1972
+ * @dot11MeshConnectedToMeshGate: if set to true, advertise that this STA is
1973
+ * connected to a mesh gate in mesh formation info. If false, the
1974
+ * value in mesh formation is determined by the presence of root paths
1975
+ * in the mesh path table
1976
+ * @dot11MeshNolearn: Try to avoid multi-hop path discovery (e.g. PREQ/PREP
1977
+ * for HWMP) if the destination is a direct neighbor. Note that this might
1978
+ * not be the optimal decision as a multi-hop route might be better. So
1979
+ * if using this setting you will likely also want to disable
1980
+ * dot11MeshForwarding and use another mesh routing protocol on top.
16431981 */
16441982 struct mesh_config {
16451983 u16 dot11MeshRetryTimeout;
....@@ -1659,6 +1997,8 @@
16591997 u16 dot11MeshHWMPperrMinInterval;
16601998 u16 dot11MeshHWMPnetDiameterTraversalTime;
16611999 u8 dot11MeshHWMPRootMode;
2000
+ bool dot11MeshConnectedToMeshGate;
2001
+ bool dot11MeshConnectedToAuthServer;
16622002 u16 dot11MeshHWMPRannInterval;
16632003 bool dot11MeshGateAnnouncementProtocol;
16642004 bool dot11MeshForwarding;
....@@ -1670,6 +2010,9 @@
16702010 enum nl80211_mesh_power_mode power_mode;
16712011 u16 dot11MeshAwakeWindowDuration;
16722012 u32 plink_timeout;
2013
+ bool dot11MeshNolearn;
2014
+
2015
+ ANDROID_KABI_RESERVE(1);
16732016 };
16742017
16752018 /**
....@@ -1719,6 +2062,8 @@
17192062 struct cfg80211_bitrate_mask beacon_rate;
17202063 bool userspace_handles_dfs;
17212064 bool control_port_over_nl80211;
2065
+
2066
+ ANDROID_KABI_RESERVE(1);
17222067 };
17232068
17242069 /**
....@@ -1798,6 +2143,27 @@
17982143 };
17992144
18002145 /**
2146
+ * struct cfg80211_scan_6ghz_params - relevant for 6 GHz only
2147
+ *
2148
+ * @short_bssid: short ssid to scan for
2149
+ * @bssid: bssid to scan for
2150
+ * @channel_idx: idx of the channel in the channel array in the scan request
2151
+ * which the above info relvant to
2152
+ * @unsolicited_probe: the AP transmits unsolicited probe response every 20 TU
2153
+ * @short_ssid_valid: short_ssid is valid and can be used
2154
+ * @psc_no_listen: when set, and the channel is a PSC channel, no need to wait
2155
+ * 20 TUs before starting to send probe requests.
2156
+ */
2157
+struct cfg80211_scan_6ghz_params {
2158
+ u32 short_ssid;
2159
+ u32 channel_idx;
2160
+ u8 bssid[ETH_ALEN];
2161
+ bool unsolicited_probe;
2162
+ bool short_ssid_valid;
2163
+ bool psc_no_listen;
2164
+};
2165
+
2166
+/**
18012167 * struct cfg80211_scan_request - scan request description
18022168 *
18032169 * @ssids: SSIDs to scan for (active scan only)
....@@ -1824,6 +2190,10 @@
18242190 * @mac_addr_mask: MAC address mask used with randomisation, bits that
18252191 * are 0 in the mask should be randomised, bits that are 1 should
18262192 * be taken from the @mac_addr
2193
+ * @scan_6ghz: relevant for split scan request only,
2194
+ * true if this is the second scan request
2195
+ * @n_6ghz_params: number of 6 GHz params
2196
+ * @scan_6ghz_params: 6 GHz params
18272197 * @bssid: BSSID to scan for (most commonly, the wildcard BSSID)
18282198 */
18292199 struct cfg80211_scan_request {
....@@ -1851,9 +2221,14 @@
18512221 struct cfg80211_scan_info info;
18522222 bool notified;
18532223 bool no_cck;
2224
+ bool scan_6ghz;
2225
+ u32 n_6ghz_params;
2226
+ struct cfg80211_scan_6ghz_params *scan_6ghz_params;
2227
+
2228
+ ANDROID_KABI_RESERVE(1);
18542229
18552230 /* keep last */
1856
- struct ieee80211_channel *channels[0];
2231
+ struct ieee80211_channel *channels[];
18572232 };
18582233
18592234 static inline void get_random_mask_addr(u8 *buf, const u8 *addr, const u8 *mask)
....@@ -1875,11 +2250,19 @@
18752250 * @bssid: BSSID to be matched; may be all-zero BSSID in case of SSID match
18762251 * or no match (RSSI only)
18772252 * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
2253
+ * @per_band_rssi_thold: Minimum rssi threshold for each band to be applied
2254
+ * for filtering out scan results received. Drivers advertize this support
2255
+ * of band specific rssi based filtering through the feature capability
2256
+ * %NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD. These band
2257
+ * specific rssi thresholds take precedence over rssi_thold, if specified.
2258
+ * If not specified for any band, it will be assigned with rssi_thold of
2259
+ * corresponding matchset.
18782260 */
18792261 struct cfg80211_match_set {
18802262 struct cfg80211_ssid ssid;
18812263 u8 bssid[ETH_ALEN];
18822264 s32 rssi_thold;
2265
+ s32 per_band_rssi_thold[NUM_NL80211_BANDS];
18832266 };
18842267
18852268 /**
....@@ -1919,8 +2302,8 @@
19192302 * @ie_len: length of ie in octets
19202303 * @flags: bit field of flags controlling operation
19212304 * @match_sets: sets of parameters to be matched for a scan result
1922
- * entry to be considered valid and to be passed to the host
1923
- * (others are filtered out).
2305
+ * entry to be considered valid and to be passed to the host
2306
+ * (others are filtered out).
19242307 * If ommited, all results are passed.
19252308 * @n_match_sets: number of match sets
19262309 * @report_results: indicates that results were reported for this request
....@@ -1990,8 +2373,10 @@
19902373 bool nl_owner_dead;
19912374 struct list_head list;
19922375
2376
+ ANDROID_KABI_RESERVE(1);
2377
+
19932378 /* keep last */
1994
- struct ieee80211_channel *channels[0];
2379
+ struct ieee80211_channel *channels[];
19952380 };
19962381
19972382 /**
....@@ -2018,7 +2403,7 @@
20182403 * received by the device (not just by the host, in case it was
20192404 * buffered on the device) and be accurate to about 10ms.
20202405 * If the frame isn't buffered, just passing the return value of
2021
- * ktime_get_boot_ns() is likely appropriate.
2406
+ * ktime_get_boottime_ns() is likely appropriate.
20222407 * @parent_tsf: the time at the start of reception of the first octet of the
20232408 * timestamp field of the frame. The time is the TSF of the BSS specified
20242409 * by %parent_bssid.
....@@ -2078,6 +2463,10 @@
20782463 * a BSS that hides the SSID in its beacon, this points to the BSS struct
20792464 * that holds the beacon data. @beacon_ies is still valid, of course, and
20802465 * points to the same data as hidden_beacon_bss->beacon_ies in that case.
2466
+ * @transmitted_bss: pointer to the transmitted BSS, if this is a
2467
+ * non-transmitted one (multi-BSSID support)
2468
+ * @nontrans_list: list of non-transmitted BSS, if this is a transmitted one
2469
+ * (multi-BSSID support)
20812470 * @signal: signal strength value (type depends on the wiphy's signal_type)
20822471 * @chains: bitmask for filled values in @chain_signal.
20832472 * @chain_signal: per-chain signal strength of last received BSS in dBm.
....@@ -2109,19 +2498,35 @@
21092498 u8 bssid_index;
21102499 u8 max_bssid_indicator;
21112500
2112
- u8 priv[0] __aligned(sizeof(void *));
2501
+ ANDROID_KABI_RESERVE(1);
2502
+
2503
+ u8 priv[] __aligned(sizeof(void *));
21132504 };
21142505
21152506 /**
2116
- * ieee80211_bss_get_ie - find IE with given ID
2507
+ * ieee80211_bss_get_elem - find element with given ID
21172508 * @bss: the bss to search
2118
- * @ie: the IE ID
2509
+ * @id: the element ID
21192510 *
21202511 * Note that the return value is an RCU-protected pointer, so
21212512 * rcu_read_lock() must be held when calling this function.
21222513 * Return: %NULL if not found.
21232514 */
2124
-const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
2515
+const struct element *ieee80211_bss_get_elem(struct cfg80211_bss *bss, u8 id);
2516
+
2517
+/**
2518
+ * ieee80211_bss_get_ie - find IE with given ID
2519
+ * @bss: the bss to search
2520
+ * @id: the element ID
2521
+ *
2522
+ * Note that the return value is an RCU-protected pointer, so
2523
+ * rcu_read_lock() must be held when calling this function.
2524
+ * Return: %NULL if not found.
2525
+ */
2526
+static inline const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 id)
2527
+{
2528
+ return (void *)ieee80211_bss_get_elem(bss, id);
2529
+}
21252530
21262531
21272532 /**
....@@ -2204,6 +2609,8 @@
22042609 * @fils_nonces: FILS nonces (part of AAD) for protecting (Re)Association
22052610 * Request/Response frame or %NULL if FILS is not used. This field starts
22062611 * with 16 octets of STA Nonce followed by 16 octets of AP Nonce.
2612
+ * @s1g_capa: S1G capability override
2613
+ * @s1g_capa_mask: S1G capability override mask
22072614 */
22082615 struct cfg80211_assoc_request {
22092616 struct cfg80211_bss *bss;
....@@ -2218,6 +2625,9 @@
22182625 const u8 *fils_kek;
22192626 size_t fils_kek_len;
22202627 const u8 *fils_nonces;
2628
+ struct ieee80211_s1g_cap s1g_capa, s1g_capa_mask;
2629
+
2630
+ ANDROID_KABI_RESERVE(1);
22212631 };
22222632
22232633 /**
....@@ -2295,7 +2705,7 @@
22952705 * will be used in ht_capa. Un-supported values will be ignored.
22962706 * @ht_capa_mask: The bits of ht_capa which are to be used.
22972707 * @wep_keys: static WEP keys, if not NULL points to an array of
2298
- * CFG80211_MAX_WEP_KEYS WEP keys
2708
+ * CFG80211_MAX_WEP_KEYS WEP keys
22992709 * @wep_tx_key: key index (0..3) of the default TX static WEP key
23002710 */
23012711 struct cfg80211_ibss_params {
....@@ -2316,6 +2726,8 @@
23162726 struct ieee80211_ht_cap ht_capa_mask;
23172727 struct key_params *wep_keys;
23182728 int wep_tx_key;
2729
+
2730
+ ANDROID_KABI_RESERVE(1);
23192731 };
23202732
23212733 /**
....@@ -2430,6 +2842,8 @@
24302842 size_t fils_erp_rrk_len;
24312843 bool want_1x;
24322844 struct ieee80211_edmg edmg;
2845
+
2846
+ ANDROID_KABI_RESERVE(1);
24332847 };
24342848
24352849 /**
....@@ -2473,6 +2887,15 @@
24732887 WIPHY_PARAM_TXQ_QUANTUM = 1 << 8,
24742888 };
24752889
2890
+#define IEEE80211_DEFAULT_AIRTIME_WEIGHT 256
2891
+
2892
+/* The per TXQ device queue limit in airtime */
2893
+#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L 5000
2894
+#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H 12000
2895
+
2896
+/* The per interface airtime threshold to switch to lower queue limit */
2897
+#define IEEE80211_AQL_THRESHOLD 24000
2898
+
24762899 /**
24772900 * struct cfg80211_pmksa - PMK Security Association
24782901 *
....@@ -2491,6 +2914,17 @@
24912914 * @cache_id: 2-octet cache identifier advertized by a FILS AP identifying the
24922915 * scope of PMKSA. This is valid only if @ssid_len is non-zero (may be
24932916 * %NULL).
2917
+ * @pmk_lifetime: Maximum lifetime for PMKSA in seconds
2918
+ * (dot11RSNAConfigPMKLifetime) or 0 if not specified.
2919
+ * The configured PMKSA must not be used for PMKSA caching after
2920
+ * expiration and any keys derived from this PMK become invalid on
2921
+ * expiration, i.e., the current association must be dropped if the PMK
2922
+ * used for it expires.
2923
+ * @pmk_reauth_threshold: Threshold time for reauthentication (percentage of
2924
+ * PMK lifetime, dot11RSNAConfigPMKReauthThreshold) or 0 if not specified.
2925
+ * Drivers are expected to trigger a full authentication instead of using
2926
+ * this PMKSA for caching when reassociating to a new BSS after this
2927
+ * threshold to generate a new PMK before the current one expires.
24942928 */
24952929 struct cfg80211_pmksa {
24962930 const u8 *bssid;
....@@ -2500,6 +2934,8 @@
25002934 const u8 *ssid;
25012935 size_t ssid_len;
25022936 const u8 *cache_id;
2937
+ u32 pmk_lifetime;
2938
+ u8 pmk_reauth_threshold;
25032939 };
25042940
25052941 /**
....@@ -2674,14 +3110,17 @@
26743110
26753111 /**
26763112 * struct cfg80211_gtk_rekey_data - rekey data
2677
- * @kek: key encryption key
2678
- * @kck: key confirmation key (NL80211_KCK_LEN bytes)
3113
+ * @kek: key encryption key (@kek_len bytes)
3114
+ * @kck: key confirmation key (@kck_len bytes)
26793115 * @replay_ctr: replay counter (NL80211_REPLAY_CTR_LEN bytes)
2680
- * @kek_len: Length of @kek in octets
3116
+ * @kek_len: length of kek
3117
+ * @kck_len length of kck
3118
+ * @akm: akm (oui, id)
26813119 */
26823120 struct cfg80211_gtk_rekey_data {
26833121 const u8 *kek, *kck, *replay_ctr;
2684
- size_t kek_len;
3122
+ u32 akm;
3123
+ u8 kek_len, kck_len;
26853124 };
26863125
26873126 /**
....@@ -2862,6 +3301,8 @@
28623301 u8 num_rx_filters;
28633302 u8 instance_id;
28643303 u64 cookie;
3304
+
3305
+ ANDROID_KABI_RESERVE(1);
28653306 };
28663307
28673308 /**
....@@ -2911,6 +3352,234 @@
29113352 };
29123353
29133354 /**
3355
+ * struct cfg80211_ftm_responder_stats - FTM responder statistics
3356
+ *
3357
+ * @filled: bitflag of flags using the bits of &enum nl80211_ftm_stats to
3358
+ * indicate the relevant values in this struct for them
3359
+ * @success_num: number of FTM sessions in which all frames were successfully
3360
+ * answered
3361
+ * @partial_num: number of FTM sessions in which part of frames were
3362
+ * successfully answered
3363
+ * @failed_num: number of failed FTM sessions
3364
+ * @asap_num: number of ASAP FTM sessions
3365
+ * @non_asap_num: number of non-ASAP FTM sessions
3366
+ * @total_duration_ms: total sessions durations - gives an indication
3367
+ * of how much time the responder was busy
3368
+ * @unknown_triggers_num: number of unknown FTM triggers - triggers from
3369
+ * initiators that didn't finish successfully the negotiation phase with
3370
+ * the responder
3371
+ * @reschedule_requests_num: number of FTM reschedule requests - initiator asks
3372
+ * for a new scheduling although it already has scheduled FTM slot
3373
+ * @out_of_window_triggers_num: total FTM triggers out of scheduled window
3374
+ */
3375
+struct cfg80211_ftm_responder_stats {
3376
+ u32 filled;
3377
+ u32 success_num;
3378
+ u32 partial_num;
3379
+ u32 failed_num;
3380
+ u32 asap_num;
3381
+ u32 non_asap_num;
3382
+ u64 total_duration_ms;
3383
+ u32 unknown_triggers_num;
3384
+ u32 reschedule_requests_num;
3385
+ u32 out_of_window_triggers_num;
3386
+};
3387
+
3388
+/**
3389
+ * struct cfg80211_pmsr_ftm_result - FTM result
3390
+ * @failure_reason: if this measurement failed (PMSR status is
3391
+ * %NL80211_PMSR_STATUS_FAILURE), this gives a more precise
3392
+ * reason than just "failure"
3393
+ * @burst_index: if reporting partial results, this is the index
3394
+ * in [0 .. num_bursts-1] of the burst that's being reported
3395
+ * @num_ftmr_attempts: number of FTM request frames transmitted
3396
+ * @num_ftmr_successes: number of FTM request frames acked
3397
+ * @busy_retry_time: if failure_reason is %NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
3398
+ * fill this to indicate in how many seconds a retry is deemed possible
3399
+ * by the responder
3400
+ * @num_bursts_exp: actual number of bursts exponent negotiated
3401
+ * @burst_duration: actual burst duration negotiated
3402
+ * @ftms_per_burst: actual FTMs per burst negotiated
3403
+ * @lci_len: length of LCI information (if present)
3404
+ * @civicloc_len: length of civic location information (if present)
3405
+ * @lci: LCI data (may be %NULL)
3406
+ * @civicloc: civic location data (may be %NULL)
3407
+ * @rssi_avg: average RSSI over FTM action frames reported
3408
+ * @rssi_spread: spread of the RSSI over FTM action frames reported
3409
+ * @tx_rate: bitrate for transmitted FTM action frame response
3410
+ * @rx_rate: bitrate of received FTM action frame
3411
+ * @rtt_avg: average of RTTs measured (must have either this or @dist_avg)
3412
+ * @rtt_variance: variance of RTTs measured (note that standard deviation is
3413
+ * the square root of the variance)
3414
+ * @rtt_spread: spread of the RTTs measured
3415
+ * @dist_avg: average of distances (mm) measured
3416
+ * (must have either this or @rtt_avg)
3417
+ * @dist_variance: variance of distances measured (see also @rtt_variance)
3418
+ * @dist_spread: spread of distances measured (see also @rtt_spread)
3419
+ * @num_ftmr_attempts_valid: @num_ftmr_attempts is valid
3420
+ * @num_ftmr_successes_valid: @num_ftmr_successes is valid
3421
+ * @rssi_avg_valid: @rssi_avg is valid
3422
+ * @rssi_spread_valid: @rssi_spread is valid
3423
+ * @tx_rate_valid: @tx_rate is valid
3424
+ * @rx_rate_valid: @rx_rate is valid
3425
+ * @rtt_avg_valid: @rtt_avg is valid
3426
+ * @rtt_variance_valid: @rtt_variance is valid
3427
+ * @rtt_spread_valid: @rtt_spread is valid
3428
+ * @dist_avg_valid: @dist_avg is valid
3429
+ * @dist_variance_valid: @dist_variance is valid
3430
+ * @dist_spread_valid: @dist_spread is valid
3431
+ */
3432
+struct cfg80211_pmsr_ftm_result {
3433
+ const u8 *lci;
3434
+ const u8 *civicloc;
3435
+ unsigned int lci_len;
3436
+ unsigned int civicloc_len;
3437
+ enum nl80211_peer_measurement_ftm_failure_reasons failure_reason;
3438
+ u32 num_ftmr_attempts, num_ftmr_successes;
3439
+ s16 burst_index;
3440
+ u8 busy_retry_time;
3441
+ u8 num_bursts_exp;
3442
+ u8 burst_duration;
3443
+ u8 ftms_per_burst;
3444
+ s32 rssi_avg;
3445
+ s32 rssi_spread;
3446
+ struct rate_info tx_rate, rx_rate;
3447
+ s64 rtt_avg;
3448
+ s64 rtt_variance;
3449
+ s64 rtt_spread;
3450
+ s64 dist_avg;
3451
+ s64 dist_variance;
3452
+ s64 dist_spread;
3453
+
3454
+ u16 num_ftmr_attempts_valid:1,
3455
+ num_ftmr_successes_valid:1,
3456
+ rssi_avg_valid:1,
3457
+ rssi_spread_valid:1,
3458
+ tx_rate_valid:1,
3459
+ rx_rate_valid:1,
3460
+ rtt_avg_valid:1,
3461
+ rtt_variance_valid:1,
3462
+ rtt_spread_valid:1,
3463
+ dist_avg_valid:1,
3464
+ dist_variance_valid:1,
3465
+ dist_spread_valid:1;
3466
+
3467
+ ANDROID_KABI_RESERVE(1);
3468
+};
3469
+
3470
+/**
3471
+ * struct cfg80211_pmsr_result - peer measurement result
3472
+ * @addr: address of the peer
3473
+ * @host_time: host time (use ktime_get_boottime() adjust to the time when the
3474
+ * measurement was made)
3475
+ * @ap_tsf: AP's TSF at measurement time
3476
+ * @status: status of the measurement
3477
+ * @final: if reporting partial results, mark this as the last one; if not
3478
+ * reporting partial results always set this flag
3479
+ * @ap_tsf_valid: indicates the @ap_tsf value is valid
3480
+ * @type: type of the measurement reported, note that we only support reporting
3481
+ * one type at a time, but you can report multiple results separately and
3482
+ * they're all aggregated for userspace.
3483
+ */
3484
+struct cfg80211_pmsr_result {
3485
+ u64 host_time, ap_tsf;
3486
+ enum nl80211_peer_measurement_status status;
3487
+
3488
+ u8 addr[ETH_ALEN];
3489
+
3490
+ u8 final:1,
3491
+ ap_tsf_valid:1;
3492
+
3493
+ enum nl80211_peer_measurement_type type;
3494
+
3495
+ union {
3496
+ struct cfg80211_pmsr_ftm_result ftm;
3497
+ };
3498
+};
3499
+
3500
+/**
3501
+ * struct cfg80211_pmsr_ftm_request_peer - FTM request data
3502
+ * @requested: indicates FTM is requested
3503
+ * @preamble: frame preamble to use
3504
+ * @burst_period: burst period to use
3505
+ * @asap: indicates to use ASAP mode
3506
+ * @num_bursts_exp: number of bursts exponent
3507
+ * @burst_duration: burst duration
3508
+ * @ftms_per_burst: number of FTMs per burst
3509
+ * @ftmr_retries: number of retries for FTM request
3510
+ * @request_lci: request LCI information
3511
+ * @request_civicloc: request civic location information
3512
+ * @trigger_based: use trigger based ranging for the measurement
3513
+ * If neither @trigger_based nor @non_trigger_based is set,
3514
+ * EDCA based ranging will be used.
3515
+ * @non_trigger_based: use non trigger based ranging for the measurement
3516
+ * If neither @trigger_based nor @non_trigger_based is set,
3517
+ * EDCA based ranging will be used.
3518
+ *
3519
+ * See also nl80211 for the respective attribute documentation.
3520
+ */
3521
+struct cfg80211_pmsr_ftm_request_peer {
3522
+ enum nl80211_preamble preamble;
3523
+ u16 burst_period;
3524
+ u8 requested:1,
3525
+ asap:1,
3526
+ request_lci:1,
3527
+ request_civicloc:1,
3528
+ trigger_based:1,
3529
+ non_trigger_based:1;
3530
+ u8 num_bursts_exp;
3531
+ u8 burst_duration;
3532
+ u8 ftms_per_burst;
3533
+ u8 ftmr_retries;
3534
+};
3535
+
3536
+/**
3537
+ * struct cfg80211_pmsr_request_peer - peer data for a peer measurement request
3538
+ * @addr: MAC address
3539
+ * @chandef: channel to use
3540
+ * @report_ap_tsf: report the associated AP's TSF
3541
+ * @ftm: FTM data, see &struct cfg80211_pmsr_ftm_request_peer
3542
+ */
3543
+struct cfg80211_pmsr_request_peer {
3544
+ u8 addr[ETH_ALEN];
3545
+ struct cfg80211_chan_def chandef;
3546
+ u8 report_ap_tsf:1;
3547
+ struct cfg80211_pmsr_ftm_request_peer ftm;
3548
+};
3549
+
3550
+/**
3551
+ * struct cfg80211_pmsr_request - peer measurement request
3552
+ * @cookie: cookie, set by cfg80211
3553
+ * @nl_portid: netlink portid - used by cfg80211
3554
+ * @drv_data: driver data for this request, if required for aborting,
3555
+ * not otherwise freed or anything by cfg80211
3556
+ * @mac_addr: MAC address used for (randomised) request
3557
+ * @mac_addr_mask: MAC address mask used for randomisation, bits that
3558
+ * are 0 in the mask should be randomised, bits that are 1 should
3559
+ * be taken from the @mac_addr
3560
+ * @list: used by cfg80211 to hold on to the request
3561
+ * @timeout: timeout (in milliseconds) for the whole operation, if
3562
+ * zero it means there's no timeout
3563
+ * @n_peers: number of peers to do measurements with
3564
+ * @peers: per-peer measurement request data
3565
+ */
3566
+struct cfg80211_pmsr_request {
3567
+ u64 cookie;
3568
+ void *drv_data;
3569
+ u32 n_peers;
3570
+ u32 nl_portid;
3571
+
3572
+ u32 timeout;
3573
+
3574
+ u8 mac_addr[ETH_ALEN] __aligned(2);
3575
+ u8 mac_addr_mask[ETH_ALEN] __aligned(2);
3576
+
3577
+ struct list_head list;
3578
+
3579
+ struct cfg80211_pmsr_request_peer peers[];
3580
+};
3581
+
3582
+/**
29143583 * struct cfg80211_update_owe_info - OWE Information
29153584 *
29163585 * This structure provides information needed for the drivers to offload OWE
....@@ -2934,6 +3603,21 @@
29343603 u16 status;
29353604 const u8 *ie;
29363605 size_t ie_len;
3606
+};
3607
+
3608
+/**
3609
+ * struct mgmt_frame_regs - management frame registrations data
3610
+ * @global_stypes: bitmap of management frame subtypes registered
3611
+ * for the entire device
3612
+ * @interface_stypes: bitmap of management frame subtypes registered
3613
+ * for the given interface
3614
+ * @global_mcast_rx: mcast RX is needed globally for these subtypes
3615
+ * @interface_mcast_stypes: mcast RX is needed on this interface
3616
+ * for these subtypes
3617
+ */
3618
+struct mgmt_frame_regs {
3619
+ u32 global_stypes, interface_stypes;
3620
+ u32 global_mcast_stypes, interface_mcast_stypes;
29373621 };
29383622
29393623 /**
....@@ -2983,7 +3667,7 @@
29833667 * @set_default_key: set the default key on an interface
29843668 *
29853669 * @set_default_mgmt_key: set the default management frame key on an interface
2986
-
3670
+ *
29873671 * @set_default_beacon_key: set the default Beacon frame key on an interface
29883672 *
29893673 * @set_rekey_data: give the data necessary for GTK rekeying to the driver
....@@ -3160,8 +3844,8 @@
31603844 * The driver should not call cfg80211_sched_scan_stopped() for a requested
31613845 * stop (when this method returns 0).
31623846 *
3163
- * @mgmt_frame_register: Notify driver that a management frame type was
3164
- * registered. The callback is allowed to sleep.
3847
+ * @update_mgmt_frame_registrations: Notify the driver that management frame
3848
+ * registrations were updated. The callback is allowed to sleep.
31653849 *
31663850 * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device.
31673851 * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may
....@@ -3274,9 +3958,21 @@
32743958 * @tx_control_port: TX a control port frame (EAPoL). The noencrypt parameter
32753959 * tells the driver that the frame should not be encrypted.
32763960 *
3961
+ * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available.
3962
+ * Statistics should be cumulative, currently no way to reset is provided.
3963
+ * @start_pmsr: start peer measurement (e.g. FTM)
3964
+ * @abort_pmsr: abort peer measurement
3965
+ *
32773966 * @update_owe_info: Provide updated OWE info to driver. Driver implementing SME
32783967 * but offloading OWE processing to the user space will get the updated
32793968 * DH IE through this interface.
3969
+ *
3970
+ * @probe_mesh_link: Probe direct Mesh peer's link quality by sending data frame
3971
+ * and overrule HWMP path selection algorithm.
3972
+ * @set_tid_config: TID specific configuration, this can be peer or BSS specific
3973
+ * This callback may sleep.
3974
+ * @reset_tid_config: Reset TID specific configuration for the peer, for the
3975
+ * given TIDs. This callback may sleep.
32803976 */
32813977 struct cfg80211_ops {
32823978 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
....@@ -3419,11 +4115,13 @@
34194115
34204116 void (*rfkill_poll)(struct wiphy *wiphy);
34214117
4118
+#ifdef CONFIG_NL80211_TESTMODE
34224119 int (*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev,
34234120 void *data, int len);
34244121 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
34254122 struct netlink_callback *cb,
34264123 void *data, int len);
4124
+#endif
34274125
34284126 int (*set_bitrate_mask)(struct wiphy *wiphy,
34294127 struct net_device *dev,
....@@ -3470,9 +4168,9 @@
34704168 struct net_device *dev,
34714169 u32 rate, u32 pkts, u32 intvl);
34724170
3473
- void (*mgmt_frame_register)(struct wiphy *wiphy,
3474
- struct wireless_dev *wdev,
3475
- u16 frame_type, bool reg);
4171
+ void (*update_mgmt_frame_registrations)(struct wiphy *wiphy,
4172
+ struct wireless_dev *wdev,
4173
+ struct mgmt_frame_regs *upd);
34764174
34774175 int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
34784176 int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant);
....@@ -3584,9 +4282,29 @@
35844282 struct net_device *dev,
35854283 const u8 *buf, size_t len,
35864284 const u8 *dest, const __be16 proto,
3587
- const bool noencrypt);
4285
+ const bool noencrypt,
4286
+ u64 *cookie);
4287
+
4288
+ int (*get_ftm_responder_stats)(struct wiphy *wiphy,
4289
+ struct net_device *dev,
4290
+ struct cfg80211_ftm_responder_stats *ftm_stats);
4291
+
4292
+ int (*start_pmsr)(struct wiphy *wiphy, struct wireless_dev *wdev,
4293
+ struct cfg80211_pmsr_request *request);
4294
+ void (*abort_pmsr)(struct wiphy *wiphy, struct wireless_dev *wdev,
4295
+ struct cfg80211_pmsr_request *request);
35884296 int (*update_owe_info)(struct wiphy *wiphy, struct net_device *dev,
35894297 struct cfg80211_update_owe_info *owe_info);
4298
+ int (*probe_mesh_link)(struct wiphy *wiphy, struct net_device *dev,
4299
+ const u8 *buf, size_t len);
4300
+ int (*set_tid_config)(struct wiphy *wiphy, struct net_device *dev,
4301
+ struct cfg80211_tid_config *tid_conf);
4302
+ int (*reset_tid_config)(struct wiphy *wiphy, struct net_device *dev,
4303
+ const u8 *peer, u8 tids);
4304
+ ANDROID_KABI_RESERVE(1);
4305
+ ANDROID_KABI_RESERVE(2);
4306
+ ANDROID_KABI_RESERVE(3);
4307
+ ANDROID_KABI_RESERVE(4);
35904308 };
35914309
35924310 /*
....@@ -3597,6 +4315,8 @@
35974315 /**
35984316 * enum wiphy_flags - wiphy capability flags
35994317 *
4318
+ * @WIPHY_FLAG_SPLIT_SCAN_6GHZ: if set to true, the scan request will be split
4319
+ * into two, first for legacy bands and second for UHB.
36004320 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
36014321 * wiphy at all
36024322 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
....@@ -3635,11 +4355,12 @@
36354355 * beaconing mode (AP, IBSS, Mesh, ...).
36364356 * @WIPHY_FLAG_HAS_STATIC_WEP: The device supports static WEP key installation
36374357 * before connection.
4358
+ * @WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK: The device supports bigger kek and kck keys
36384359 */
36394360 enum wiphy_flags {
3640
- /* use hole at 0 */
4361
+ WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0),
36414362 /* use hole at 1 */
3642
- /* use hole at 2 */
4363
+ WIPHY_FLAG_SPLIT_SCAN_6GHZ = BIT(2),
36434364 WIPHY_FLAG_NETNS_OK = BIT(3),
36444365 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
36454366 WIPHY_FLAG_4ADDR_AP = BIT(5),
....@@ -3917,6 +4638,8 @@
39174638 u8 rx_nss;
39184639 };
39194640
4641
+#define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)(long)(-ENODATA))
4642
+
39204643 /**
39214644 * struct wiphy_vendor_command - vendor command definition
39224645 * @info: vendor command identifying information, as used in nl80211
....@@ -3927,6 +4650,10 @@
39274650 * @dumpit: dump callback, for transferring bigger/multiple items. The
39284651 * @storage points to cb->args[5], ie. is preserved over the multiple
39294652 * dumpit calls.
4653
+ * @policy: policy pointer for attributes within %NL80211_ATTR_VENDOR_DATA.
4654
+ * Set this to %VENDOR_CMD_RAW_DATA if no policy can be given and the
4655
+ * attribute is just raw data (e.g. a firmware command).
4656
+ * @maxattr: highest attribute number in policy
39304657 * It's recommended to not have the same sub command with both @doit and
39314658 * @dumpit, so that userspace can assume certain ones are get and others
39324659 * are used with dump requests.
....@@ -3939,6 +4666,10 @@
39394666 int (*dumpit)(struct wiphy *wiphy, struct wireless_dev *wdev,
39404667 struct sk_buff *skb, const void *data, int data_len,
39414668 unsigned long *storage);
4669
+ const struct nla_policy *policy;
4670
+ unsigned int maxattr;
4671
+
4672
+ ANDROID_KABI_RESERVE(1);
39424673 };
39434674
39444675 /**
....@@ -3957,6 +4688,46 @@
39574688 const u8 *extended_capabilities;
39584689 const u8 *extended_capabilities_mask;
39594690 u8 extended_capabilities_len;
4691
+};
4692
+
4693
+/**
4694
+ * struct cfg80211_pmsr_capabilities - cfg80211 peer measurement capabilities
4695
+ * @max_peers: maximum number of peers in a single measurement
4696
+ * @report_ap_tsf: can report assoc AP's TSF for radio resource measurement
4697
+ * @randomize_mac_addr: can randomize MAC address for measurement
4698
+ * @ftm.supported: FTM measurement is supported
4699
+ * @ftm.asap: ASAP-mode is supported
4700
+ * @ftm.non_asap: non-ASAP-mode is supported
4701
+ * @ftm.request_lci: can request LCI data
4702
+ * @ftm.request_civicloc: can request civic location data
4703
+ * @ftm.preambles: bitmap of preambles supported (&enum nl80211_preamble)
4704
+ * @ftm.bandwidths: bitmap of bandwidths supported (&enum nl80211_chan_width)
4705
+ * @ftm.max_bursts_exponent: maximum burst exponent supported
4706
+ * (set to -1 if not limited; note that setting this will necessarily
4707
+ * forbid using the value 15 to let the responder pick)
4708
+ * @ftm.max_ftms_per_burst: maximum FTMs per burst supported (set to 0 if
4709
+ * not limited)
4710
+ * @ftm.trigger_based: trigger based ranging measurement is supported
4711
+ * @ftm.non_trigger_based: non trigger based ranging measurement is supported
4712
+ */
4713
+struct cfg80211_pmsr_capabilities {
4714
+ unsigned int max_peers;
4715
+ u8 report_ap_tsf:1,
4716
+ randomize_mac_addr:1;
4717
+
4718
+ struct {
4719
+ u32 preambles;
4720
+ u32 bandwidths;
4721
+ s8 max_bursts_exponent;
4722
+ u8 max_ftms_per_burst;
4723
+ u8 supported:1,
4724
+ asap:1,
4725
+ non_asap:1,
4726
+ request_lci:1,
4727
+ request_civicloc:1,
4728
+ trigger_based:1,
4729
+ non_trigger_based:1;
4730
+ } ftm;
39604731 };
39614732
39624733 /**
....@@ -3980,12 +4751,16 @@
39804751 * note that if your driver uses wiphy_apply_custom_regulatory()
39814752 * the reg_notifier's request can be passed as NULL
39824753 * @regd: the driver's regulatory domain, if one was requested via
3983
- * the regulatory_hint() API. This can be used by the driver
4754
+ * the regulatory_hint() API. This can be used by the driver
39844755 * on the reg_notifier() if it chooses to ignore future
39854756 * regulatory domain changes caused by other drivers.
39864757 * @signal_type: signal type reported in &struct cfg80211_bss.
39874758 * @cipher_suites: supported cipher suites
39884759 * @n_cipher_suites: number of supported cipher suites
4760
+ * @akm_suites: supported AKM suites. These are the default AKMs supported if
4761
+ * the supported AKMs not advertized for a specific interface type in
4762
+ * iftype_akm_suites.
4763
+ * @n_akm_suites: number of supported AKM suites
39894764 * @iftype_akm_suites: array of supported akm suites info per interface type.
39904765 * Note that the bits in @iftypes_mask inside this structure cannot
39914766 * overlap (i.e. only one occurrence of each type is allowed across all
....@@ -4012,10 +4787,11 @@
40124787 * the same number of arbitrary MAC addresses.
40134788 * @registered: protects ->resume and ->suspend sysfs callbacks against
40144789 * unregister hardware
4015
- * @debugfsdir: debugfs directory used for this wiphy, will be renamed
4016
- * automatically on wiphy renames
4017
- * @dev: (virtual) struct device for this wiphy
4018
- * @registered: helps synchronize suspend/resume with wiphy unregister
4790
+ * @debugfsdir: debugfs directory used for this wiphy (ieee80211/<wiphyname>).
4791
+ * It will be renamed automatically on wiphy renames
4792
+ * @dev: (virtual) struct device for this wiphy. The item in
4793
+ * /sys/class/ieee80211/ points to this. You need use set_wiphy_dev()
4794
+ * (see below).
40194795 * @wext: wireless extension handlers
40204796 * @priv: driver private data (sized according to wiphy_new() parameter)
40214797 * @interface_modes: bitmask of interfaces types valid for this wiphy,
....@@ -4126,17 +4902,10 @@
41264902 * and probe responses. This value should be set if the driver
41274903 * wishes to limit the number of csa counters. Default (0) means
41284904 * infinite.
4129
- * @max_adj_channel_rssi_comp: max offset of between the channel on which the
4130
- * frame was sent and the channel on which the frame was heard for which
4131
- * the reported rssi is still valid. If a driver is able to compensate the
4132
- * low rssi when a frame is heard on different channel, then it should set
4133
- * this variable to the maximal offset for which it can compensate.
4134
- * This value should be set in MHz.
41354905 * @bss_select_support: bitmask indicating the BSS selection criteria supported
41364906 * by the driver in the .connect() callback. The bit position maps to the
41374907 * attribute indices defined in &enum nl80211_bss_select_attr.
41384908 *
4139
- * @cookie_counter: unique generic cookie counter, used to identify objects.
41404909 * @nan_supported_bands: bands supported by the device in NAN mode, a
41414910 * bitmap of &enum nl80211_band values. For instance, for
41424911 * NL80211_BAND_2GHZ, bit 0 would be set
....@@ -4146,15 +4915,32 @@
41464915 * @txq_memory_limit: configuration internal TX queue memory limit
41474916 * @txq_quantum: configuration of internal TX queue scheduler quantum
41484917 *
4918
+ * @tx_queue_len: allow setting transmit queue len for drivers not using
4919
+ * wake_tx_queue
4920
+ *
41494921 * @support_mbssid: can HW support association with nontransmitted AP
41504922 * @support_only_he_mbssid: don't parse MBSSID elements if it is not
41514923 * HE AP, in order to avoid compatibility issues.
41524924 * @support_mbssid must be set for this to have any effect.
4925
+ *
4926
+ * @pmsr_capa: peer measurement capabilities
4927
+ *
4928
+ * @tid_config_support: describes the per-TID config support that the
4929
+ * device has
4930
+ * @tid_config_support.vif: bitmap of attributes (configurations)
4931
+ * supported by the driver for each vif
4932
+ * @tid_config_support.peer: bitmap of attributes (configurations)
4933
+ * supported by the driver for each peer
4934
+ * @tid_config_support.max_retry: maximum supported retry count for
4935
+ * long/short retry configuration
4936
+ *
4937
+ * @max_data_retry_count: maximum supported per TID retry count for
4938
+ * configuration through the %NL80211_TID_CONFIG_ATTR_RETRY_SHORT and
4939
+ * %NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes
41534940 */
41544941 struct wiphy {
41554942 /* assign these fields before you register the wiphy */
41564943
4157
- /* permanent MAC address(es) */
41584944 u8 perm_addr[ETH_ALEN];
41594945 u8 addr_mask[ETH_ALEN];
41604946
....@@ -4194,6 +4980,9 @@
41944980 int n_cipher_suites;
41954981 const u32 *cipher_suites;
41964982
4983
+ int n_akm_suites;
4984
+ const u32 *akm_suites;
4985
+
41974986 const struct wiphy_iftype_akm_suites *iftype_akm_suites;
41984987 unsigned int num_iftype_akm_suites;
41994988
....@@ -4218,11 +5007,6 @@
42185007 u32 available_antennas_tx;
42195008 u32 available_antennas_rx;
42205009
4221
- /*
4222
- * Bitmap of supported protocols for probe response offloading
4223
- * see &enum nl80211_probe_resp_offload_support_attr. Only valid
4224
- * when the wiphy flag @WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD is set.
4225
- */
42265010 u32 probe_resp_offload;
42275011
42285012 const u8 *extended_capabilities, *extended_capabilities_mask;
....@@ -4231,16 +5015,10 @@
42315015 const struct wiphy_iftype_ext_capab *iftype_ext_capab;
42325016 unsigned int num_iftype_ext_capab;
42335017
4234
- /* If multiple wiphys are registered and you're handed e.g.
4235
- * a regular netdev with assigned ieee80211_ptr, you won't
4236
- * know whether it points to a wiphy your driver has registered
4237
- * or not. Assign this to something global to your driver to
4238
- * help determine whether you own this wiphy or not. */
42395018 const void *privid;
42405019
42415020 struct ieee80211_supported_band *bands[NUM_NL80211_BANDS];
42425021
4243
- /* Lets us get back the wiphy on the callback */
42445022 void (*reg_notifier)(struct wiphy *wiphy,
42455023 struct regulatory_request *request);
42465024
....@@ -4248,14 +5026,10 @@
42485026
42495027 const struct ieee80211_regdomain __rcu *regd;
42505028
4251
- /* the item in /sys/class/ieee80211/ points to this,
4252
- * you need use set_wiphy_dev() (see below) */
42535029 struct device dev;
42545030
4255
- /* protects ->resume, ->suspend sysfs callbacks against unregister hw */
42565031 bool registered;
42575032
4258
- /* dir in debugfs: ieee80211/<wiphyname> */
42595033 struct dentry *debugfsdir;
42605034
42615035 const struct ieee80211_ht_cap *ht_capa_mod_mask;
....@@ -4263,7 +5037,6 @@
42635037
42645038 struct list_head wdev_list;
42655039
4266
- /* the network namespace this phy lives in currently */
42675040 possible_net_t _net;
42685041
42695042 #ifdef CONFIG_CFG80211_WEXT
....@@ -4279,11 +5052,8 @@
42795052 u16 max_ap_assoc_sta;
42805053
42815054 u8 max_num_csa_counters;
4282
- u8 max_adj_channel_rssi_comp;
42835055
42845056 u32 bss_select_support;
4285
-
4286
- u64 cookie_counter;
42875057
42885058 u8 nan_supported_bands;
42895059
....@@ -4291,10 +5061,23 @@
42915061 u32 txq_memory_limit;
42925062 u32 txq_quantum;
42935063
5064
+ unsigned long tx_queue_len;
5065
+
42945066 u8 support_mbssid:1,
42955067 support_only_he_mbssid:1;
42965068
4297
- char priv[0] __aligned(NETDEV_ALIGN);
5069
+ const struct cfg80211_pmsr_capabilities *pmsr_capa;
5070
+
5071
+ struct {
5072
+ u64 peer, vif;
5073
+ u8 max_retry;
5074
+ } tid_config_support;
5075
+
5076
+ u8 max_data_retry_count;
5077
+
5078
+ ANDROID_KABI_RESERVE(1);
5079
+
5080
+ char priv[] __aligned(NETDEV_ALIGN);
42985081 };
42995082
43005083 static inline struct net *wiphy_net(struct wiphy *wiphy)
....@@ -4463,12 +5246,24 @@
44635246 * @mesh_id_len: (private) Used by the internal configuration code
44645247 * @mesh_id_up_len: (private) Used by the internal configuration code
44655248 * @wext: (private) Used by the internal wireless extensions compat code
5249
+ * @wext.ibss: (private) IBSS data part of wext handling
5250
+ * @wext.connect: (private) connection handling data
5251
+ * @wext.keys: (private) (WEP) key data
5252
+ * @wext.ie: (private) extra elements for association
5253
+ * @wext.ie_len: (private) length of extra elements
5254
+ * @wext.bssid: (private) selected network BSSID
5255
+ * @wext.ssid: (private) selected network SSID
5256
+ * @wext.default_key: (private) selected default key index
5257
+ * @wext.default_mgmt_key: (private) selected default management key index
5258
+ * @wext.prev_bssid: (private) previous BSSID for reassociation
5259
+ * @wext.prev_bssid_valid: (private) previous BSSID validity
44665260 * @use_4addr: indicates 4addr mode is used on this interface, must be
44675261 * set by driver (if supported) on add_interface BEFORE registering the
44685262 * netdev and may otherwise be used by driver read-only, will be update
44695263 * by cfg80211 on change_interface
44705264 * @mgmt_registrations: list of registrations for management frames
4471
- * @mgmt_registrations_lock: lock for the list
5265
+ * @mgmt_registrations_need_update: mgmt registrations were updated,
5266
+ * need to propagate the update to the driver
44725267 * @mtx: mutex used to lock data in this struct, may be used by drivers
44735268 * and some API functions require it held
44745269 * @beacon_interval: beacon interval used on this device for transmitting
....@@ -4496,6 +5291,11 @@
44965291 * @owner_nlportid: (private) owner socket port ID
44975292 * @nl_owner_dead: (private) owner socket went away
44985293 * @cqm_config: (private) nl80211 RSSI monitor state
5294
+ * @pmsr_list: (private) peer measurement requests
5295
+ * @pmsr_lock: (private) peer measurements requests/results lock
5296
+ * @pmsr_free_wk: (private) peer measurements cleanup work
5297
+ * @unprot_beacon_reported: (private) timestamp of last
5298
+ * unprotected beacon report
44995299 */
45005300 struct wireless_dev {
45015301 struct wiphy *wiphy;
....@@ -4508,7 +5308,14 @@
45085308 u32 identifier;
45095309
45105310 struct list_head mgmt_registrations;
5311
+ /*
5312
+ * ANDROID: mgmt_registrations_lock was restored to preserve ABI in
5313
+ * 5.10.77 due to backport of 09b1d5dc6ce1 ("cfg80211: fix management
5314
+ * registrations locking") but it is not used for anything so do not
5315
+ * touch this variable!
5316
+ */
45115317 spinlock_t mgmt_registrations_lock;
5318
+ u8 mgmt_registrations_need_update:1;
45125319
45135320 struct mutex mtx;
45145321
....@@ -4559,7 +5366,8 @@
45595366 struct cfg80211_cached_keys *keys;
45605367 const u8 *ie;
45615368 size_t ie_len;
4562
- u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
5369
+ u8 bssid[ETH_ALEN];
5370
+ u8 prev_bssid[ETH_ALEN];
45635371 u8 ssid[IEEE80211_MAX_SSID_LEN];
45645372 s8 default_key, default_mgmt_key;
45655373 bool prev_bssid_valid;
....@@ -4567,6 +5375,15 @@
45675375 #endif
45685376
45695377 struct cfg80211_cqm_config *cqm_config;
5378
+
5379
+ struct list_head pmsr_list;
5380
+ spinlock_t pmsr_lock;
5381
+ struct work_struct pmsr_free_wk;
5382
+
5383
+ unsigned long unprot_beacon_reported;
5384
+
5385
+ ANDROID_KABI_RESERVE(1);
5386
+ ANDROID_KABI_RESERVE(2);
45705387 };
45715388
45725389 static inline u8 *wdev_address(struct wireless_dev *wdev)
....@@ -4602,29 +5419,116 @@
46025419 */
46035420
46045421 /**
5422
+ * ieee80211_channel_equal - compare two struct ieee80211_channel
5423
+ *
5424
+ * @a: 1st struct ieee80211_channel
5425
+ * @b: 2nd struct ieee80211_channel
5426
+ * Return: true if center frequency of @a == @b
5427
+ */
5428
+static inline bool
5429
+ieee80211_channel_equal(struct ieee80211_channel *a,
5430
+ struct ieee80211_channel *b)
5431
+{
5432
+ return (a->center_freq == b->center_freq &&
5433
+ a->freq_offset == b->freq_offset);
5434
+}
5435
+
5436
+/**
5437
+ * ieee80211_channel_to_khz - convert ieee80211_channel to frequency in KHz
5438
+ * @chan: struct ieee80211_channel to convert
5439
+ * Return: The corresponding frequency (in KHz)
5440
+ */
5441
+static inline u32
5442
+ieee80211_channel_to_khz(const struct ieee80211_channel *chan)
5443
+{
5444
+ return MHZ_TO_KHZ(chan->center_freq) + chan->freq_offset;
5445
+}
5446
+
5447
+/**
5448
+ * ieee80211_s1g_channel_width - get allowed channel width from @chan
5449
+ *
5450
+ * Only allowed for band NL80211_BAND_S1GHZ
5451
+ * @chan: channel
5452
+ * Return: The allowed channel width for this center_freq
5453
+ */
5454
+enum nl80211_chan_width
5455
+ieee80211_s1g_channel_width(const struct ieee80211_channel *chan);
5456
+
5457
+/**
5458
+ * ieee80211_channel_to_freq_khz - convert channel number to frequency
5459
+ * @chan: channel number
5460
+ * @band: band, necessary due to channel number overlap
5461
+ * Return: The corresponding frequency (in KHz), or 0 if the conversion failed.
5462
+ */
5463
+u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band);
5464
+
5465
+/**
46055466 * ieee80211_channel_to_frequency - convert channel number to frequency
46065467 * @chan: channel number
46075468 * @band: band, necessary due to channel number overlap
46085469 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed.
46095470 */
4610
-int ieee80211_channel_to_frequency(int chan, enum nl80211_band band);
5471
+static inline int
5472
+ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
5473
+{
5474
+ return KHZ_TO_MHZ(ieee80211_channel_to_freq_khz(chan, band));
5475
+}
5476
+
5477
+/**
5478
+ * ieee80211_freq_khz_to_channel - convert frequency to channel number
5479
+ * @freq: center frequency in KHz
5480
+ * Return: The corresponding channel, or 0 if the conversion failed.
5481
+ */
5482
+int ieee80211_freq_khz_to_channel(u32 freq);
46115483
46125484 /**
46135485 * ieee80211_frequency_to_channel - convert frequency to channel number
4614
- * @freq: center frequency
5486
+ * @freq: center frequency in MHz
46155487 * Return: The corresponding channel, or 0 if the conversion failed.
46165488 */
4617
-int ieee80211_frequency_to_channel(int freq);
5489
+static inline int
5490
+ieee80211_frequency_to_channel(int freq)
5491
+{
5492
+ return ieee80211_freq_khz_to_channel(MHZ_TO_KHZ(freq));
5493
+}
5494
+
5495
+/**
5496
+ * ieee80211_get_channel_khz - get channel struct from wiphy for specified
5497
+ * frequency
5498
+ * @wiphy: the struct wiphy to get the channel for
5499
+ * @freq: the center frequency (in KHz) of the channel
5500
+ * Return: The channel struct from @wiphy at @freq.
5501
+ */
5502
+struct ieee80211_channel *
5503
+ieee80211_get_channel_khz(struct wiphy *wiphy, u32 freq);
46185504
46195505 /**
46205506 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
46215507 *
46225508 * @wiphy: the struct wiphy to get the channel for
4623
- * @freq: the center frequency of the channel
4624
- *
5509
+ * @freq: the center frequency (in MHz) of the channel
46255510 * Return: The channel struct from @wiphy at @freq.
46265511 */
4627
-struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy, int freq);
5512
+static inline struct ieee80211_channel *
5513
+ieee80211_get_channel(struct wiphy *wiphy, int freq)
5514
+{
5515
+ return ieee80211_get_channel_khz(wiphy, MHZ_TO_KHZ(freq));
5516
+}
5517
+
5518
+/**
5519
+ * cfg80211_channel_is_psc - Check if the channel is a 6 GHz PSC
5520
+ * @chan: control channel to check
5521
+ *
5522
+ * The Preferred Scanning Channels (PSC) are defined in
5523
+ * Draft IEEE P802.11ax/D5.0, 26.17.2.3.3
5524
+ */
5525
+static inline bool cfg80211_channel_is_psc(struct ieee80211_channel *chan)
5526
+{
5527
+ if (chan->band != NL80211_BAND_6GHZ)
5528
+ return false;
5529
+
5530
+ return ieee80211_frequency_to_channel(chan->center_freq) % 16 == 5;
5531
+}
46285532
46295533 /**
46305534 * ieee80211_get_response_rate - get basic rate for a given rate
....@@ -4657,7 +5561,7 @@
46575561 * Radiotap parsing functions -- for controlled injection support
46585562 *
46595563 * Implemented in net/wireless/radiotap.c
4660
- * Documentation in Documentation/networking/radiotap-headers.txt
5564
+ * Documentation in Documentation/networking/radiotap-headers.rst
46615565 */
46625566
46635567 struct radiotap_align_size {
....@@ -4812,7 +5716,7 @@
48125716 *
48135717 * @skb: The input A-MSDU frame without any headers.
48145718 * @list: The output list of 802.3 frames. It must be allocated and
4815
- * initialized by by the caller.
5719
+ * initialized by the caller.
48165720 * @addr: The device MAC address.
48175721 * @iftype: The device interface type.
48185722 * @extra_headroom: The hardware extra headroom for SKBs in the @list.
....@@ -4832,6 +5736,33 @@
48325736 */
48335737 unsigned int cfg80211_classify8021d(struct sk_buff *skb,
48345738 struct cfg80211_qos_map *qos_map);
5739
+
5740
+/**
5741
+ * cfg80211_find_elem_match - match information element and byte array in data
5742
+ *
5743
+ * @eid: element ID
5744
+ * @ies: data consisting of IEs
5745
+ * @len: length of data
5746
+ * @match: byte array to match
5747
+ * @match_len: number of bytes in the match array
5748
+ * @match_offset: offset in the IE data where the byte array should match.
5749
+ * Note the difference to cfg80211_find_ie_match() which considers
5750
+ * the offset to start from the element ID byte, but here we take
5751
+ * the data portion instead.
5752
+ *
5753
+ * Return: %NULL if the element ID could not be found or if
5754
+ * the element is invalid (claims to be longer than the given
5755
+ * data) or if the byte array doesn't match; otherwise return the
5756
+ * requested element struct.
5757
+ *
5758
+ * Note: There are no checks on the element length other than
5759
+ * having to fit into the given data and being large enough for the
5760
+ * byte array to match.
5761
+ */
5762
+const struct element *
5763
+cfg80211_find_elem_match(u8 eid, const u8 *ies, unsigned int len,
5764
+ const u8 *match, unsigned int match_len,
5765
+ unsigned int match_offset);
48355766
48365767 /**
48375768 * cfg80211_find_ie_match - match information element and byte array in data
....@@ -4857,9 +5788,44 @@
48575788 * having to fit into the given data and being large enough for the
48585789 * byte array to match.
48595790 */
4860
-const u8 *cfg80211_find_ie_match(u8 eid, const u8 *ies, int len,
4861
- const u8 *match, int match_len,
4862
- int match_offset);
5791
+static inline const u8 *
5792
+cfg80211_find_ie_match(u8 eid, const u8 *ies, unsigned int len,
5793
+ const u8 *match, unsigned int match_len,
5794
+ unsigned int match_offset)
5795
+{
5796
+ /* match_offset can't be smaller than 2, unless match_len is
5797
+ * zero, in which case match_offset must be zero as well.
5798
+ */
5799
+ if (WARN_ON((match_len && match_offset < 2) ||
5800
+ (!match_len && match_offset)))
5801
+ return NULL;
5802
+
5803
+ return (void *)cfg80211_find_elem_match(eid, ies, len,
5804
+ match, match_len,
5805
+ match_offset ?
5806
+ match_offset - 2 : 0);
5807
+}
5808
+
5809
+/**
5810
+ * cfg80211_find_elem - find information element in data
5811
+ *
5812
+ * @eid: element ID
5813
+ * @ies: data consisting of IEs
5814
+ * @len: length of data
5815
+ *
5816
+ * Return: %NULL if the element ID could not be found or if
5817
+ * the element is invalid (claims to be longer than the given
5818
+ * data) or if the byte array doesn't match; otherwise return the
5819
+ * requested element struct.
5820
+ *
5821
+ * Note: There are no checks on the element length other than
5822
+ * having to fit into the given data.
5823
+ */
5824
+static inline const struct element *
5825
+cfg80211_find_elem(u8 eid, const u8 *ies, int len)
5826
+{
5827
+ return cfg80211_find_elem_match(eid, ies, len, NULL, 0, 0);
5828
+}
48635829
48645830 /**
48655831 * cfg80211_find_ie - find information element in data
....@@ -4879,6 +5845,28 @@
48795845 static inline const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len)
48805846 {
48815847 return cfg80211_find_ie_match(eid, ies, len, NULL, 0, 0);
5848
+}
5849
+
5850
+/**
5851
+ * cfg80211_find_ext_elem - find information element with EID Extension in data
5852
+ *
5853
+ * @ext_eid: element ID Extension
5854
+ * @ies: data consisting of IEs
5855
+ * @len: length of data
5856
+ *
5857
+ * Return: %NULL if the etended element could not be found or if
5858
+ * the element is invalid (claims to be longer than the given
5859
+ * data) or if the byte array doesn't match; otherwise return the
5860
+ * requested element struct.
5861
+ *
5862
+ * Note: There are no checks on the element length other than
5863
+ * having to fit into the given data.
5864
+ */
5865
+static inline const struct element *
5866
+cfg80211_find_ext_elem(u8 ext_eid, const u8 *ies, int len)
5867
+{
5868
+ return cfg80211_find_elem_match(WLAN_EID_EXTENSION, ies, len,
5869
+ &ext_eid, 1, 0);
48825870 }
48835871
48845872 /**
....@@ -4903,6 +5891,25 @@
49035891 }
49045892
49055893 /**
5894
+ * cfg80211_find_vendor_elem - find vendor specific information element in data
5895
+ *
5896
+ * @oui: vendor OUI
5897
+ * @oui_type: vendor-specific OUI type (must be < 0xff), negative means any
5898
+ * @ies: data consisting of IEs
5899
+ * @len: length of data
5900
+ *
5901
+ * Return: %NULL if the vendor specific element ID could not be found or if the
5902
+ * element is invalid (claims to be longer than the given data); otherwise
5903
+ * return the element structure for the requested element.
5904
+ *
5905
+ * Note: There are no checks on the element length other than having to fit into
5906
+ * the given data.
5907
+ */
5908
+const struct element *cfg80211_find_vendor_elem(unsigned int oui, int oui_type,
5909
+ const u8 *ies,
5910
+ unsigned int len);
5911
+
5912
+/**
49065913 * cfg80211_find_vendor_ie - find vendor specific information element in data
49075914 *
49085915 * @oui: vendor OUI
....@@ -4918,8 +5925,12 @@
49185925 * Note: There are no checks on the element length other than having to fit into
49195926 * the given data.
49205927 */
4921
-const u8 *cfg80211_find_vendor_ie(unsigned int oui, int oui_type,
4922
- const u8 *ies, int len);
5928
+static inline const u8 *
5929
+cfg80211_find_vendor_ie(unsigned int oui, int oui_type,
5930
+ const u8 *ies, unsigned int len)
5931
+{
5932
+ return (void *)cfg80211_find_vendor_elem(oui, oui_type, ies, len);
5933
+}
49235934
49245935 /**
49255936 * cfg80211_send_layer2_update - send layer 2 update frame
....@@ -4943,9 +5954,9 @@
49435954 * @wiphy: the wireless device giving the hint (used only for reporting
49445955 * conflicts)
49455956 * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain
4946
- * should be in. If @rd is set this should be NULL. Note that if you
4947
- * set this to NULL you should still set rd->alpha2 to some accepted
4948
- * alpha2.
5957
+ * should be in. If @rd is set this should be NULL. Note that if you
5958
+ * set this to NULL you should still set rd->alpha2 to some accepted
5959
+ * alpha2.
49495960 *
49505961 * Wireless drivers can use this function to hint to the wireless core
49515962 * what it believes should be the current regulatory domain by
....@@ -5040,6 +6051,14 @@
50406051 * proper string representation.
50416052 */
50426053 const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
6054
+
6055
+/**
6056
+ * regulatory_pre_cac_allowed - check if pre-CAC allowed in the current regdom
6057
+ * @wiphy: wiphy for which pre-CAC capability is checked.
6058
+ *
6059
+ * Pre-CAC is allowed only in some regdomains (notable ETSI).
6060
+ */
6061
+bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
50436062
50446063 /**
50456064 * DOC: Internal regulatory db functions
....@@ -5186,6 +6205,28 @@
51866205 }
51876206
51886207 /**
6208
+ * cfg80211_is_element_inherited - returns if element ID should be inherited
6209
+ * @element: element to check
6210
+ * @non_inherit_element: non inheritance element
6211
+ */
6212
+bool cfg80211_is_element_inherited(const struct element *element,
6213
+ const struct element *non_inherit_element);
6214
+
6215
+/**
6216
+ * cfg80211_merge_profile - merges a MBSSID profile if it is split between IEs
6217
+ * @ie: ies
6218
+ * @ielen: length of IEs
6219
+ * @mbssid_elem: current MBSSID element
6220
+ * @sub_elem: current MBSSID subelement (profile)
6221
+ * @merged_ie: location of the merged profile
6222
+ * @max_copy_len: max merged profile length
6223
+ */
6224
+size_t cfg80211_merge_profile(const u8 *ie, size_t ielen,
6225
+ const struct element *mbssid_elem,
6226
+ const struct element *sub_elem,
6227
+ u8 *merged_ie, size_t max_copy_len);
6228
+
6229
+/**
51896230 * enum cfg80211_bss_frame_type - frame type that the BSS data came from
51906231 * @CFG80211_BSS_FTYPE_UNKNOWN: driver doesn't know whether the data is
51916232 * from a beacon or probe response
....@@ -5321,6 +6362,26 @@
53216362 */
53226363 void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
53236364
6365
+/**
6366
+ * cfg80211_bss_iter - iterate all BSS entries
6367
+ *
6368
+ * This function iterates over the BSS entries associated with the given wiphy
6369
+ * and calls the callback for the iterated BSS. The iterator function is not
6370
+ * allowed to call functions that might modify the internal state of the BSS DB.
6371
+ *
6372
+ * @wiphy: the wiphy
6373
+ * @chandef: if given, the iterator function will be called only if the channel
6374
+ * of the currently iterated BSS is a subset of the given channel.
6375
+ * @iter: the iterator function to call
6376
+ * @iter_data: an argument to the iterator function
6377
+ */
6378
+void cfg80211_bss_iter(struct wiphy *wiphy,
6379
+ struct cfg80211_chan_def *chandef,
6380
+ void (*iter)(struct wiphy *wiphy,
6381
+ struct cfg80211_bss *bss,
6382
+ void *data),
6383
+ void *iter_data);
6384
+
53246385 static inline enum nl80211_bss_scan_width
53256386 cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef)
53266387 {
....@@ -5370,10 +6431,12 @@
53706431 * @dev: network device
53716432 * @bss: the BSS that association was requested with, ownership of the pointer
53726433 * moves to cfg80211 in this call
5373
- * @buf: authentication frame (header + body)
6434
+ * @buf: (Re)Association Response frame (header + body)
53746435 * @len: length of the frame data
53756436 * @uapsd_queues: bitmap of queues configured for uapsd. Same format
53766437 * as the AC bitmap in the QoS info field
6438
+ * @req_ies: information elements from the (Re)Association Request frame
6439
+ * @req_ies_len: length of req_ies data
53776440 *
53786441 * After being asked to associate via cfg80211_ops::assoc() the driver must
53796442 * call either this function or cfg80211_auth_timeout().
....@@ -5383,7 +6446,8 @@
53836446 void cfg80211_rx_assoc_resp(struct net_device *dev,
53846447 struct cfg80211_bss *bss,
53856448 const u8 *buf, size_t len,
5386
- int uapsd_queues);
6449
+ int uapsd_queues,
6450
+ const u8 *req_ies, size_t req_ies_len);
53876451
53886452 /**
53896453 * cfg80211_assoc_timeout - notification of timed out association
....@@ -5421,12 +6485,16 @@
54216485 /**
54226486 * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame
54236487 * @dev: network device
5424
- * @buf: deauthentication frame (header + body)
6488
+ * @buf: received management frame (header + body)
54256489 * @len: length of the frame data
54266490 *
54276491 * This function is called whenever a received deauthentication or dissassoc
54286492 * frame has been dropped in station mode because of MFP being used but the
5429
- * frame was not protected. This function may sleep.
6493
+ * frame was not protected. This is also used to notify reception of a Beacon
6494
+ * frame that was dropped because it did not include a valid MME MIC while
6495
+ * beacon protection was enabled (BIGTK configured in station mode).
6496
+ *
6497
+ * This function may sleep.
54306498 */
54316499 void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev,
54326500 const u8 *buf, size_t len);
....@@ -5467,12 +6535,13 @@
54676535 struct ieee80211_channel *channel, gfp_t gfp);
54686536
54696537 /**
5470
- * cfg80211_notify_new_candidate - notify cfg80211 of a new mesh peer candidate
6538
+ * cfg80211_notify_new_peer_candidate - notify cfg80211 of a new mesh peer
6539
+ * candidate
54716540 *
54726541 * @dev: network device
54736542 * @macaddr: the MAC address of the new candidate
54746543 * @ie: information elements advertised by the peer candidate
5475
- * @ie_len: lenght of the information elements buffer
6544
+ * @ie_len: length of the information elements buffer
54766545 * @gfp: allocation flags
54776546 *
54786547 * This function notifies cfg80211 that the mesh peer candidate has been
....@@ -5480,7 +6549,8 @@
54806549 * cfg80211 then sends a notification to userspace.
54816550 */
54826551 void cfg80211_notify_new_peer_candidate(struct net_device *dev,
5483
- const u8 *macaddr, const u8 *ie, u8 ie_len, gfp_t gfp);
6552
+ const u8 *macaddr, const u8 *ie, u8 ie_len,
6553
+ int sig_dbm, gfp_t gfp);
54846554
54856555 /**
54866556 * DOC: RFkill integration
....@@ -5544,6 +6614,7 @@
55446614 struct wireless_dev *wdev,
55456615 enum nl80211_commands cmd,
55466616 enum nl80211_attrs attr,
6617
+ unsigned int portid,
55476618 int vendor_event_idx,
55486619 int approxlen, gfp_t gfp);
55496620
....@@ -5594,6 +6665,15 @@
55946665 int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
55956666
55966667 /**
6668
+ * cfg80211_vendor_cmd_get_sender
6669
+ * @wiphy: the wiphy
6670
+ *
6671
+ * Return the current netlink port ID in a vendor command handler.
6672
+ * Valid to call only there.
6673
+ */
6674
+unsigned int cfg80211_vendor_cmd_get_sender(struct wiphy *wiphy);
6675
+
6676
+/**
55976677 * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
55986678 * @wiphy: the wiphy
55996679 * @wdev: the wireless device
....@@ -5620,7 +6700,42 @@
56206700 {
56216701 return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
56226702 NL80211_ATTR_VENDOR_DATA,
5623
- event_idx, approxlen, gfp);
6703
+ 0, event_idx, approxlen, gfp);
6704
+}
6705
+
6706
+/**
6707
+ * cfg80211_vendor_event_alloc_ucast - alloc unicast vendor-specific event skb
6708
+ * @wiphy: the wiphy
6709
+ * @wdev: the wireless device
6710
+ * @event_idx: index of the vendor event in the wiphy's vendor_events
6711
+ * @portid: port ID of the receiver
6712
+ * @approxlen: an upper bound of the length of the data that will
6713
+ * be put into the skb
6714
+ * @gfp: allocation flags
6715
+ *
6716
+ * This function allocates and pre-fills an skb for an event to send to
6717
+ * a specific (userland) socket. This socket would previously have been
6718
+ * obtained by cfg80211_vendor_cmd_get_sender(), and the caller MUST take
6719
+ * care to register a netlink notifier to see when the socket closes.
6720
+ *
6721
+ * If wdev != NULL, both the ifindex and identifier of the specified
6722
+ * wireless device are added to the event message before the vendor data
6723
+ * attribute.
6724
+ *
6725
+ * When done filling the skb, call cfg80211_vendor_event() with the
6726
+ * skb to send the event.
6727
+ *
6728
+ * Return: An allocated and pre-filled skb. %NULL if any errors happen.
6729
+ */
6730
+static inline struct sk_buff *
6731
+cfg80211_vendor_event_alloc_ucast(struct wiphy *wiphy,
6732
+ struct wireless_dev *wdev,
6733
+ unsigned int portid, int approxlen,
6734
+ int event_idx, gfp_t gfp)
6735
+{
6736
+ return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
6737
+ NL80211_ATTR_VENDOR_DATA,
6738
+ portid, event_idx, approxlen, gfp);
56246739 }
56256740
56266741 /**
....@@ -5720,7 +6835,7 @@
57206835 cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp)
57216836 {
57226837 return __cfg80211_alloc_event_skb(wiphy, NULL, NL80211_CMD_TESTMODE,
5723
- NL80211_ATTR_TESTDATA, -1,
6838
+ NL80211_ATTR_TESTDATA, 0, -1,
57246839 approxlen, gfp);
57256840 }
57266841
....@@ -5986,7 +7101,7 @@
59867101 * time it is accessed in __cfg80211_roamed() due to delay in scheduling
59877102 * rdev->event_work. In case of any failures, the reference is released
59887103 * either in cfg80211_roamed() or in __cfg80211_romed(), Otherwise, it will be
5989
- * released while diconneting from the current bss.
7104
+ * released while disconnecting from the current bss.
59907105 */
59917106 void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
59927107 gfp_t gfp);
....@@ -6048,6 +7163,16 @@
60487163 void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
60497164 struct ieee80211_channel *chan,
60507165 gfp_t gfp);
7166
+
7167
+/**
7168
+ * cfg80211_tx_mgmt_expired - tx_mgmt duration expired
7169
+ * @wdev: wireless device
7170
+ * @cookie: the requested cookie
7171
+ * @chan: The current channel (from tx_mgmt request)
7172
+ * @gfp: allocation flags
7173
+ */
7174
+void cfg80211_tx_mgmt_expired(struct wireless_dev *wdev, u64 cookie,
7175
+ struct ieee80211_channel *chan, gfp_t gfp);
60517176
60527177 /**
60537178 * cfg80211_sinfo_alloc_tid_stats - allocate per-tid statistics.
....@@ -6124,6 +7249,26 @@
61247249 gfp_t gfp);
61257250
61267251 /**
7252
+ * cfg80211_rx_mgmt_khz - notification of received, unprocessed management frame
7253
+ * @wdev: wireless device receiving the frame
7254
+ * @freq: Frequency on which the frame was received in KHz
7255
+ * @sig_dbm: signal strength in dBm, or 0 if unknown
7256
+ * @buf: Management frame (header + body)
7257
+ * @len: length of the frame data
7258
+ * @flags: flags, as defined in enum nl80211_rxmgmt_flags
7259
+ *
7260
+ * This function is called whenever an Action frame is received for a station
7261
+ * mode interface, but is not processed in kernel.
7262
+ *
7263
+ * Return: %true if a user space application has registered for this frame.
7264
+ * For action frames, that makes it responsible for rejecting unrecognized
7265
+ * action frames; %false otherwise, in which case for action frames the
7266
+ * driver is responsible for rejecting the frame.
7267
+ */
7268
+bool cfg80211_rx_mgmt_khz(struct wireless_dev *wdev, int freq, int sig_dbm,
7269
+ const u8 *buf, size_t len, u32 flags);
7270
+
7271
+/**
61277272 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
61287273 * @wdev: wireless device receiving the frame
61297274 * @freq: Frequency on which the frame was received in MHz
....@@ -6140,8 +7285,13 @@
61407285 * action frames; %false otherwise, in which case for action frames the
61417286 * driver is responsible for rejecting the frame.
61427287 */
6143
-bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
6144
- const u8 *buf, size_t len, u32 flags);
7288
+static inline bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq,
7289
+ int sig_dbm, const u8 *buf, size_t len,
7290
+ u32 flags)
7291
+{
7292
+ return cfg80211_rx_mgmt_khz(wdev, MHZ_TO_KHZ(freq), sig_dbm, buf, len,
7293
+ flags);
7294
+}
61457295
61467296 /**
61477297 * cfg80211_mgmt_tx_status - notification of TX status for management frame
....@@ -6159,6 +7309,23 @@
61597309 void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
61607310 const u8 *buf, size_t len, bool ack, gfp_t gfp);
61617311
7312
+/**
7313
+ * cfg80211_control_port_tx_status - notification of TX status for control
7314
+ * port frames
7315
+ * @wdev: wireless device receiving the frame
7316
+ * @cookie: Cookie returned by cfg80211_ops::tx_control_port()
7317
+ * @buf: Data frame (header + body)
7318
+ * @len: length of the frame data
7319
+ * @ack: Whether frame was acknowledged
7320
+ * @gfp: context flags
7321
+ *
7322
+ * This function is called whenever a control port frame was requested to be
7323
+ * transmitted with cfg80211_ops::tx_control_port() to report the TX status of
7324
+ * the transmission attempt.
7325
+ */
7326
+void cfg80211_control_port_tx_status(struct wireless_dev *wdev, u64 cookie,
7327
+ const u8 *buf, size_t len, bool ack,
7328
+ gfp_t gfp);
61627329
61637330 /**
61647331 * cfg80211_rx_control_port - notification about a received control port frame
....@@ -6340,6 +7507,21 @@
63407507 bool is_valid_ack_signal, gfp_t gfp);
63417508
63427509 /**
7510
+ * cfg80211_report_obss_beacon_khz - report beacon from other APs
7511
+ * @wiphy: The wiphy that received the beacon
7512
+ * @frame: the frame
7513
+ * @len: length of the frame
7514
+ * @freq: frequency the frame was received on in KHz
7515
+ * @sig_dbm: signal strength in dBm, or 0 if unknown
7516
+ *
7517
+ * Use this function to report to userspace when a beacon was
7518
+ * received. It is not useful to call this when there is no
7519
+ * netdev that is in AP/GO mode.
7520
+ */
7521
+void cfg80211_report_obss_beacon_khz(struct wiphy *wiphy, const u8 *frame,
7522
+ size_t len, int freq, int sig_dbm);
7523
+
7524
+/**
63437525 * cfg80211_report_obss_beacon - report beacon from other APs
63447526 * @wiphy: The wiphy that received the beacon
63457527 * @frame: the frame
....@@ -6351,9 +7533,13 @@
63517533 * received. It is not useful to call this when there is no
63527534 * netdev that is in AP/GO mode.
63537535 */
6354
-void cfg80211_report_obss_beacon(struct wiphy *wiphy,
6355
- const u8 *frame, size_t len,
6356
- int freq, int sig_dbm);
7536
+static inline void cfg80211_report_obss_beacon(struct wiphy *wiphy,
7537
+ const u8 *frame, size_t len,
7538
+ int freq, int sig_dbm)
7539
+{
7540
+ cfg80211_report_obss_beacon_khz(wiphy, frame, len, MHZ_TO_KHZ(freq),
7541
+ sig_dbm);
7542
+}
63577543
63587544 /**
63597545 * cfg80211_reg_can_beacon - check if beaconing is allowed
....@@ -6432,6 +7618,19 @@
64327618 bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef,
64337619 u8 *op_class);
64347620
7621
+/**
7622
+ * ieee80211_chandef_to_khz - convert chandef to frequency in KHz
7623
+ *
7624
+ * @chandef: the chandef to convert
7625
+ *
7626
+ * Returns the center frequency of chandef (1st segment) in KHz.
7627
+ */
7628
+static inline u32
7629
+ieee80211_chandef_to_khz(const struct cfg80211_chan_def *chandef)
7630
+{
7631
+ return MHZ_TO_KHZ(chandef->center_freq1) + chandef->freq1_offset;
7632
+}
7633
+
64357634 /*
64367635 * cfg80211_tdls_oper_request - request userspace to perform TDLS operation
64377636 * @dev: the device on which the operation is requested
....@@ -6476,7 +7675,7 @@
64767675 void cfg80211_unregister_wdev(struct wireless_dev *wdev);
64777676
64787677 /**
6479
- * struct cfg80211_ft_event - FT Information Elements
7678
+ * struct cfg80211_ft_event_params - FT Information Elements
64807679 * @ies: FT IEs
64817680 * @ies_len: length of the FT IE in bytes
64827681 * @target_ap: target AP's MAC address
....@@ -6608,13 +7807,6 @@
66087807 * by .crit_proto_start() has expired.
66097808 */
66107809 void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
6611
-
6612
-/**
6613
- * cfg80211_ap_stopped - notify userspace that AP mode stopped
6614
- * @netdev: network device
6615
- * @gfp: context flags
6616
- */
6617
-void cfg80211_ap_stopped(struct net_device *netdev, gfp_t gfp);
66187810
66197811 /**
66207812 * ieee80211_get_num_supported_channels - get number of channels device has
....@@ -6797,6 +7989,31 @@
67977989 gfp_t gfp);
67987990
67997991 /**
7992
+ * cfg80211_pmsr_report - report peer measurement result data
7993
+ * @wdev: the wireless device reporting the measurement
7994
+ * @req: the original measurement request
7995
+ * @result: the result data
7996
+ * @gfp: allocation flags
7997
+ */
7998
+void cfg80211_pmsr_report(struct wireless_dev *wdev,
7999
+ struct cfg80211_pmsr_request *req,
8000
+ struct cfg80211_pmsr_result *result,
8001
+ gfp_t gfp);
8002
+
8003
+/**
8004
+ * cfg80211_pmsr_complete - report peer measurement completed
8005
+ * @wdev: the wireless device reporting the measurement
8006
+ * @req: the original measurement request
8007
+ * @gfp: allocation flags
8008
+ *
8009
+ * Report that the entire measurement completed, after this
8010
+ * the request pointer will no longer be valid.
8011
+ */
8012
+void cfg80211_pmsr_complete(struct wireless_dev *wdev,
8013
+ struct cfg80211_pmsr_request *req,
8014
+ gfp_t gfp);
8015
+
8016
+/**
68008017 * cfg80211_iftype_allowed - check whether the interface can be allowed
68018018 * @wiphy: the wiphy
68028019 * @iftype: interface type
....@@ -6832,6 +8049,11 @@
68328049 #define wiphy_info(wiphy, format, args...) \
68338050 dev_info(&(wiphy)->dev, format, ##args)
68348051
8052
+#define wiphy_err_ratelimited(wiphy, format, args...) \
8053
+ dev_err_ratelimited(&(wiphy)->dev, format, ##args)
8054
+#define wiphy_warn_ratelimited(wiphy, format, args...) \
8055
+ dev_warn_ratelimited(&(wiphy)->dev, format, ##args)
8056
+
68358057 #define wiphy_debug(wiphy, format, args...) \
68368058 wiphy_printk(KERN_DEBUG, wiphy, format, ##args)
68378059
....@@ -6867,4 +8089,10 @@
68678089 struct cfg80211_update_owe_info *owe_info,
68688090 gfp_t gfp);
68698091
8092
+/**
8093
+ * cfg80211_bss_flush - resets all the scan entries
8094
+ * @wiphy: the wiphy
8095
+ */
8096
+void cfg80211_bss_flush(struct wiphy *wiphy);
8097
+
68708098 #endif /* __NET_CFG80211_H */