hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
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;
....@@ -441,6 +526,26 @@
441526 }
442527
443528 /**
529
+ * ieee80211_get_he_iftype_cap - return HE capabilities for an sband's iftype
530
+ * @sband: the sband to search for the iftype on
531
+ * @iftype: enum nl80211_iftype
532
+ *
533
+ * Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found
534
+ */
535
+static inline const struct ieee80211_sta_he_cap *
536
+ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *sband,
537
+ u8 iftype)
538
+{
539
+ const struct ieee80211_sband_iftype_data *data =
540
+ ieee80211_get_sband_iftype_data(sband, iftype);
541
+
542
+ if (data && data->he_cap.has_he)
543
+ return &data->he_cap;
544
+
545
+ return NULL;
546
+}
547
+
548
+/**
444549 * ieee80211_get_he_sta_cap - return HE capabilities for an sband's STA
445550 * @sband: the sband to search for the STA on
446551 *
....@@ -449,13 +554,27 @@
449554 static inline const struct ieee80211_sta_he_cap *
450555 ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband)
451556 {
557
+ return ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_STATION);
558
+}
559
+
560
+/**
561
+ * ieee80211_get_he_6ghz_capa - return HE 6 GHz capabilities
562
+ * @sband: the sband to search for the STA on
563
+ * @iftype: the iftype to search for
564
+ *
565
+ * Return: the 6GHz capabilities
566
+ */
567
+static inline __le16
568
+ieee80211_get_he_6ghz_capa(const struct ieee80211_supported_band *sband,
569
+ enum nl80211_iftype iftype)
570
+{
452571 const struct ieee80211_sband_iftype_data *data =
453
- ieee80211_get_sband_iftype_data(sband, NL80211_IFTYPE_STATION);
572
+ ieee80211_get_sband_iftype_data(sband, iftype);
454573
455
- if (data && data->he_cap.has_he)
456
- return &data->he_cap;
574
+ if (WARN_ON(!data || !data->he_cap.has_he))
575
+ return 0;
457576
458
- return NULL;
577
+ return data->he_6ghz_capa.capa;
459578 }
460579
461580 /**
....@@ -544,13 +663,17 @@
544663 * with the get_key() callback, must be in little endian,
545664 * length given by @seq_len.
546665 * @seq_len: length of @seq.
666
+ * @vlan_id: vlan_id for VLAN group key (if nonzero)
667
+ * @mode: key install mode (RX_TX, NO_TX or SET_TX)
547668 */
548669 struct key_params {
549670 const u8 *key;
550671 const u8 *seq;
551672 int key_len;
552673 int seq_len;
674
+ u16 vlan_id;
553675 u32 cipher;
676
+ enum nl80211_key_mode mode;
554677 };
555678
556679 /**
....@@ -564,6 +687,7 @@
564687 * If edmg is requested (i.e. the .channels member is non-zero),
565688 * chan will define the primary channel and all other
566689 * parameters are ignored.
690
+ * @freq1_offset: offset from @center_freq1, in KHz
567691 */
568692 struct cfg80211_chan_def {
569693 struct ieee80211_channel *chan;
....@@ -571,6 +695,64 @@
571695 u32 center_freq1;
572696 u32 center_freq2;
573697 struct ieee80211_edmg edmg;
698
+ u16 freq1_offset;
699
+};
700
+
701
+/*
702
+ * cfg80211_bitrate_mask - masks for bitrate control
703
+ */
704
+struct cfg80211_bitrate_mask {
705
+ struct {
706
+ u32 legacy;
707
+ u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
708
+ u16 vht_mcs[NL80211_VHT_NSS_MAX];
709
+ u16 he_mcs[NL80211_HE_NSS_MAX];
710
+ enum nl80211_txrate_gi gi;
711
+ enum nl80211_he_gi he_gi;
712
+ enum nl80211_he_ltf he_ltf;
713
+ } control[NUM_NL80211_BANDS];
714
+};
715
+
716
+
717
+/**
718
+ * struct cfg80211_tid_cfg - TID specific configuration
719
+ * @config_override: Flag to notify driver to reset TID configuration
720
+ * of the peer.
721
+ * @tids: bitmap of TIDs to modify
722
+ * @mask: bitmap of attributes indicating which parameter changed,
723
+ * similar to &nl80211_tid_config_supp.
724
+ * @noack: noack configuration value for the TID
725
+ * @retry_long: retry count value
726
+ * @retry_short: retry count value
727
+ * @ampdu: Enable/Disable MPDU aggregation
728
+ * @rtscts: Enable/Disable RTS/CTS
729
+ * @amsdu: Enable/Disable MSDU aggregation
730
+ * @txrate_type: Tx bitrate mask type
731
+ * @txrate_mask: Tx bitrate to be applied for the TID
732
+ */
733
+struct cfg80211_tid_cfg {
734
+ bool config_override;
735
+ u8 tids;
736
+ u64 mask;
737
+ enum nl80211_tid_config noack;
738
+ u8 retry_long, retry_short;
739
+ enum nl80211_tid_config ampdu;
740
+ enum nl80211_tid_config rtscts;
741
+ enum nl80211_tid_config amsdu;
742
+ enum nl80211_tx_rate_setting txrate_type;
743
+ struct cfg80211_bitrate_mask txrate_mask;
744
+};
745
+
746
+/**
747
+ * struct cfg80211_tid_config - TID configuration
748
+ * @peer: Station's MAC address
749
+ * @n_tid_conf: Number of TID specific configurations to be applied
750
+ * @tid_conf: Configuration change info
751
+ */
752
+struct cfg80211_tid_config {
753
+ const u8 *peer;
754
+ u32 n_tid_conf;
755
+ struct cfg80211_tid_cfg tid_conf[];
574756 };
575757
576758 /**
....@@ -625,6 +807,7 @@
625807 return (chandef1->chan == chandef2->chan &&
626808 chandef1->width == chandef2->width &&
627809 chandef1->center_freq1 == chandef2->center_freq1 &&
810
+ chandef1->freq1_offset == chandef2->freq1_offset &&
628811 chandef1->center_freq2 == chandef2->center_freq2);
629812 }
630813
....@@ -745,6 +928,7 @@
745928 * @SURVEY_INFO_TIME_RX: receive time was filled in
746929 * @SURVEY_INFO_TIME_TX: transmit time was filled in
747930 * @SURVEY_INFO_TIME_SCAN: scan time was filled in
931
+ * @SURVEY_INFO_TIME_BSS_RX: local BSS receive time was filled in
748932 *
749933 * Used by the driver to indicate which info in &struct survey_info
750934 * it has filled in during the get_survey().
....@@ -758,6 +942,7 @@
758942 SURVEY_INFO_TIME_RX = BIT(5),
759943 SURVEY_INFO_TIME_TX = BIT(6),
760944 SURVEY_INFO_TIME_SCAN = BIT(7),
945
+ SURVEY_INFO_TIME_BSS_RX = BIT(8),
761946 };
762947
763948 /**
....@@ -774,6 +959,7 @@
774959 * @time_rx: amount of time the radio spent receiving data
775960 * @time_tx: amount of time the radio spent transmitting data
776961 * @time_scan: amount of time the radio spent for scanning
962
+ * @time_bss_rx: amount of time the radio spent receiving data on a local BSS
777963 *
778964 * Used by dump_survey() to report back per-channel survey information.
779965 *
....@@ -788,6 +974,7 @@
788974 u64 time_rx;
789975 u64 time_tx;
790976 u64 time_scan;
977
+ u64 time_bss_rx;
791978 u32 filled;
792979 s8 noise;
793980 };
....@@ -813,10 +1000,30 @@
8131000 * protocol frames.
8141001 * @control_port_over_nl80211: TRUE if userspace expects to exchange control
8151002 * port frames over NL80211 instead of the network interface.
1003
+ * @control_port_no_preauth: disables pre-auth rx over the nl80211 control
1004
+ * port for mac80211
8161005 * @wep_keys: static WEP keys, if not NULL points to an array of
8171006 * CFG80211_MAX_WEP_KEYS WEP keys
8181007 * @wep_tx_key: key index (0..3) of the default TX static WEP key
8191008 * @psk: PSK (for devices supporting 4-way-handshake offload)
1009
+ * @sae_pwd: password for SAE authentication (for devices supporting SAE
1010
+ * offload)
1011
+ * @sae_pwd_len: length of SAE password (for devices supporting SAE offload)
1012
+ * @sae_pwe: The mechanisms allowed for SAE PWE derivation:
1013
+ *
1014
+ * NL80211_SAE_PWE_UNSPECIFIED
1015
+ * Not-specified, used to indicate userspace did not specify any
1016
+ * preference. The driver should follow its internal policy in
1017
+ * such a scenario.
1018
+ *
1019
+ * NL80211_SAE_PWE_HUNT_AND_PECK
1020
+ * Allow hunting-and-pecking loop only
1021
+ *
1022
+ * NL80211_SAE_PWE_HASH_TO_ELEMENT
1023
+ * Allow hash-to-element only
1024
+ *
1025
+ * NL80211_SAE_PWE_BOTH
1026
+ * Allow either hunting-and-pecking loop or hash-to-element
8201027 */
8211028 struct cfg80211_crypto_settings {
8221029 u32 wpa_versions;
....@@ -829,9 +1036,15 @@
8291036 __be16 control_port_ethertype;
8301037 bool control_port_no_encrypt;
8311038 bool control_port_over_nl80211;
1039
+ bool control_port_no_preauth;
8321040 struct key_params *wep_keys;
8331041 int wep_tx_key;
8341042 const u8 *psk;
1043
+ const u8 *sae_pwd;
1044
+ u8 sae_pwd_len;
1045
+ enum nl80211_sae_pwe_mechanism sae_pwe;
1046
+
1047
+ ANDROID_KABI_RESERVE(1);
8351048 };
8361049
8371050 /**
....@@ -852,6 +1065,14 @@
8521065 * @assocresp_ies_len: length of assocresp_ies in octets
8531066 * @probe_resp_len: length of probe response template (@probe_resp)
8541067 * @probe_resp: probe response template (AP mode only)
1068
+ * @ftm_responder: enable FTM responder functionality; -1 for no change
1069
+ * (which also implies no change in LCI/civic location data)
1070
+ * @lci: Measurement Report element content, starting with Measurement Token
1071
+ * (measurement type 8)
1072
+ * @civicloc: Measurement Report element content, starting with Measurement
1073
+ * Token (measurement type 11)
1074
+ * @lci_len: LCI data length
1075
+ * @civicloc_len: Civic location data length
8551076 */
8561077 struct cfg80211_beacon_data {
8571078 const u8 *head, *tail;
....@@ -859,12 +1080,19 @@
8591080 const u8 *proberesp_ies;
8601081 const u8 *assocresp_ies;
8611082 const u8 *probe_resp;
1083
+ const u8 *lci;
1084
+ const u8 *civicloc;
1085
+ s8 ftm_responder;
8621086
8631087 size_t head_len, tail_len;
8641088 size_t beacon_ies_len;
8651089 size_t proberesp_ies_len;
8661090 size_t assocresp_ies_len;
8671091 size_t probe_resp_len;
1092
+ size_t lci_len;
1093
+ size_t civicloc_len;
1094
+
1095
+ ANDROID_KABI_RESERVE(1);
8681096 };
8691097
8701098 struct mac_address {
....@@ -887,16 +1115,37 @@
8871115 struct mac_address mac_addrs[];
8881116 };
8891117
890
-/*
891
- * cfg80211_bitrate_mask - masks for bitrate control
1118
+/**
1119
+ * struct cfg80211_fils_discovery - FILS discovery parameters from
1120
+ * IEEE Std 802.11ai-2016, Annex C.3 MIB detail.
1121
+ *
1122
+ * @min_interval: Minimum packet interval in TUs (0 - 10000)
1123
+ * @max_interval: Maximum packet interval in TUs (0 - 10000)
1124
+ * @tmpl_len: Template length
1125
+ * @tmpl: Template data for FILS discovery frame including the action
1126
+ * frame headers.
8921127 */
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];
1128
+struct cfg80211_fils_discovery {
1129
+ u32 min_interval;
1130
+ u32 max_interval;
1131
+ size_t tmpl_len;
1132
+ const u8 *tmpl;
1133
+};
1134
+
1135
+/**
1136
+ * struct cfg80211_unsol_bcast_probe_resp - Unsolicited broadcast probe
1137
+ * response parameters in 6GHz.
1138
+ *
1139
+ * @interval: Packet interval in TUs. Maximum allowed is 20 TU, as mentioned
1140
+ * in IEEE P802.11ax/D6.0 26.17.2.3.2 - AP behavior for fast passive
1141
+ * scanning
1142
+ * @tmpl_len: Template length
1143
+ * @tmpl: Template data for probe response
1144
+ */
1145
+struct cfg80211_unsol_bcast_probe_resp {
1146
+ u32 interval;
1147
+ size_t tmpl_len;
1148
+ const u8 *tmpl;
9001149 };
9011150
9021151 /**
....@@ -937,9 +1186,17 @@
9371186 * @beacon_rate: bitrate to be used for beacons
9381187 * @ht_cap: HT capabilities (or %NULL if HT isn't enabled)
9391188 * @vht_cap: VHT capabilities (or %NULL if VHT isn't enabled)
1189
+ * @he_cap: HE capabilities (or %NULL if HE isn't enabled)
9401190 * @ht_required: stations must support HT
9411191 * @vht_required: stations must support VHT
1192
+ * @twt_responder: Enable Target Wait Time
1193
+ * @he_required: stations must support HE
9421194 * @flags: flags, as defined in enum cfg80211_ap_settings_flags
1195
+ * @he_obss_pd: OBSS Packet Detection settings
1196
+ * @he_bss_color: BSS Color settings
1197
+ * @he_oper: HE operation IE (or %NULL if HE isn't enabled)
1198
+ * @fils_discovery: FILS discovery transmission parameters
1199
+ * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
9431200 */
9441201 struct cfg80211_ap_settings {
9451202 struct cfg80211_chan_def chandef;
....@@ -963,8 +1220,17 @@
9631220
9641221 const struct ieee80211_ht_cap *ht_cap;
9651222 const struct ieee80211_vht_cap *vht_cap;
966
- bool ht_required, vht_required;
1223
+ const struct ieee80211_he_cap_elem *he_cap;
1224
+ const struct ieee80211_he_operation *he_oper;
1225
+ bool ht_required, vht_required, he_required;
1226
+ bool twt_responder;
9671227 u32 flags;
1228
+ struct ieee80211_he_obss_pd he_obss_pd;
1229
+ struct cfg80211_he_bss_color he_bss_color;
1230
+ struct cfg80211_fils_discovery fils_discovery;
1231
+ struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
1232
+
1233
+ ANDROID_KABI_RESERVE(1);
9681234 };
9691235
9701236 /**
....@@ -994,6 +1260,8 @@
9941260 bool radar_required;
9951261 bool block_tx;
9961262 u8 count;
1263
+
1264
+ ANDROID_KABI_RESERVE(1);
9971265 };
9981266
9991267 #define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10
....@@ -1035,6 +1303,27 @@
10351303 STATION_PARAM_APPLY_UAPSD = BIT(0),
10361304 STATION_PARAM_APPLY_CAPABILITY = BIT(1),
10371305 STATION_PARAM_APPLY_PLINK_STATE = BIT(2),
1306
+ STATION_PARAM_APPLY_STA_TXPOWER = BIT(3),
1307
+};
1308
+
1309
+/**
1310
+ * struct sta_txpwr - station txpower configuration
1311
+ *
1312
+ * Used to configure txpower for station.
1313
+ *
1314
+ * @power: tx power (in dBm) to be used for sending data traffic. If tx power
1315
+ * is not provided, the default per-interface tx power setting will be
1316
+ * overriding. Driver should be picking up the lowest tx power, either tx
1317
+ * power per-interface or per-station.
1318
+ * @type: In particular if TPC %type is NL80211_TX_POWER_LIMITED then tx power
1319
+ * will be less than or equal to specified from userspace, whereas if TPC
1320
+ * %type is NL80211_TX_POWER_AUTOMATIC then it indicates default tx power.
1321
+ * NL80211_TX_POWER_FIXED is not a valid configuration option for
1322
+ * per peer TPC.
1323
+ */
1324
+struct sta_txpwr {
1325
+ s16 power;
1326
+ enum nl80211_tx_power_setting type;
10381327 };
10391328
10401329 /**
....@@ -1052,6 +1341,7 @@
10521341 * (bitmask of BIT(%NL80211_STA_FLAG_...))
10531342 * @listen_interval: listen interval or -1 for no change
10541343 * @aid: AID or zero for no change
1344
+ * @vlan_id: VLAN ID for station (if nonzero)
10551345 * @peer_aid: mesh peer AID or zero for no change
10561346 * @plink_action: plink action to take
10571347 * @plink_state: set the peer link state for a station
....@@ -1078,6 +1368,9 @@
10781368 * @support_p2p_ps: information if station supports P2P PS mechanism
10791369 * @he_capa: HE capabilities of station
10801370 * @he_capa_len: the length of the HE capabilities
1371
+ * @airtime_weight: airtime scheduler weight for this station
1372
+ * @txpwr: transmit power for an associated station
1373
+ * @he_6ghz_capa: HE 6 GHz Band capabilities of station
10811374 */
10821375 struct station_parameters {
10831376 const u8 *supported_rates;
....@@ -1086,6 +1379,7 @@
10861379 u32 sta_modify_mask;
10871380 int listen_interval;
10881381 u16 aid;
1382
+ u16 vlan_id;
10891383 u16 peer_aid;
10901384 u8 supported_rates_len;
10911385 u8 plink_action;
....@@ -1107,6 +1401,11 @@
11071401 int support_p2p_ps;
11081402 const struct ieee80211_he_cap_elem *he_capa;
11091403 u8 he_capa_len;
1404
+ u16 airtime_weight;
1405
+ struct sta_txpwr txpwr;
1406
+ const struct ieee80211_he_6ghz_capa *he_6ghz_capa;
1407
+
1408
+ ANDROID_KABI_RESERVE(1);
11101409 };
11111410
11121411 /**
....@@ -1172,7 +1471,7 @@
11721471 enum cfg80211_station_type statype);
11731472
11741473 /**
1175
- * enum station_info_rate_flags - bitrate info flags
1474
+ * enum rate_info_flags - bitrate info flags
11761475 *
11771476 * Used by the driver to indicate the specific rate transmission
11781477 * type for 802.11n transmissions.
....@@ -1245,7 +1544,7 @@
12451544 };
12461545
12471546 /**
1248
- * enum station_info_rate_flags - bitrate info flags
1547
+ * enum bss_param_flags - bitrate info flags
12491548 *
12501549 * Used by the driver to indicate the specific rate transmission
12511550 * type for 802.11n transmissions.
....@@ -1337,6 +1636,7 @@
13371636 * indicate the relevant values in this struct for them
13381637 * @connected_time: time(in secs) since a station is last connected
13391638 * @inactive_time: time since last station activity (tx/rx) in milliseconds
1639
+ * @assoc_at: bootime (ns) of the last association
13401640 * @rx_bytes: bytes (size of MPDUs) received from this station
13411641 * @tx_bytes: bytes (size of MPDUs) transmitted to this station
13421642 * @llid: mesh local link id
....@@ -1377,7 +1677,10 @@
13771677 * @rx_beacon: number of beacons received from this peer
13781678 * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received
13791679 * from this peer
1680
+ * @connected_to_gate: true if mesh STA has a path to mesh gate
13801681 * @rx_duration: aggregate PPDU duration(usecs) for all the frames from a peer
1682
+ * @tx_duration: aggregate PPDU duration(usecs) for all the frames to a peer
1683
+ * @airtime_weight: current airtime scheduling weight
13811684 * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last
13821685 * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs.
13831686 * Note that this doesn't use the @filled bit, but is used if non-NULL.
....@@ -1388,11 +1691,14 @@
13881691 * @fcs_err_count: number of packets (MPDUs) received from this station with
13891692 * an FCS error. This counter should be incremented only when TA of the
13901693 * received packet with an FCS error matches the peer MAC address.
1694
+ * @airtime_link_metric: mesh airtime link metric.
1695
+ * @connected_to_as: true if mesh STA has a path to authentication server
13911696 */
13921697 struct station_info {
13931698 u64 filled;
13941699 u32 connected_time;
13951700 u32 inactive_time;
1701
+ u64 assoc_at;
13961702 u64 rx_bytes;
13971703 u64 tx_bytes;
13981704 u16 llid;
....@@ -1428,15 +1734,26 @@
14281734
14291735 u32 expected_throughput;
14301736
1431
- u64 rx_beacon;
1737
+ u64 tx_duration;
14321738 u64 rx_duration;
1739
+ u64 rx_beacon;
14331740 u8 rx_beacon_signal_avg;
1741
+ u8 connected_to_gate;
1742
+
14341743 struct cfg80211_tid_stats *pertid;
14351744 s8 ack_signal;
14361745 s8 avg_ack_signal;
14371746
1747
+ u16 airtime_weight;
1748
+
14381749 u32 rx_mpdu_count;
14391750 u32 fcs_err_count;
1751
+
1752
+ u32 airtime_link_metric;
1753
+
1754
+ u8 connected_to_as;
1755
+
1756
+ ANDROID_KABI_RESERVE(1);
14401757 };
14411758
14421759 #if IS_ENABLED(CONFIG_CFG80211)
....@@ -1498,6 +1815,8 @@
14981815 * @MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
14991816 * @MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled
15001817 * @MPATH_INFO_FLAGS: @flags filled
1818
+ * @MPATH_INFO_HOP_COUNT: @hop_count filled
1819
+ * @MPATH_INFO_PATH_CHANGE: @path_change_count filled
15011820 */
15021821 enum mpath_info_flags {
15031822 MPATH_INFO_FRAME_QLEN = BIT(0),
....@@ -1507,6 +1826,8 @@
15071826 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4),
15081827 MPATH_INFO_DISCOVERY_RETRIES = BIT(5),
15091828 MPATH_INFO_FLAGS = BIT(6),
1829
+ MPATH_INFO_HOP_COUNT = BIT(7),
1830
+ MPATH_INFO_PATH_CHANGE = BIT(8),
15101831 };
15111832
15121833 /**
....@@ -1526,6 +1847,8 @@
15261847 * This number should increase every time the list of mesh paths
15271848 * changes, i.e. when a station is added or removed, so that
15281849 * userspace can tell whether it got a consistent snapshot.
1850
+ * @hop_count: hops to destination
1851
+ * @path_change_count: total number of path changes to destination
15291852 */
15301853 struct mpath_info {
15311854 u32 filled;
....@@ -1536,6 +1859,8 @@
15361859 u32 discovery_timeout;
15371860 u8 discovery_retries;
15381861 u8 flags;
1862
+ u8 hop_count;
1863
+ u32 path_change_count;
15391864
15401865 int generation;
15411866 };
....@@ -1555,8 +1880,9 @@
15551880 * (or NULL for no change)
15561881 * @basic_rates_len: number of basic rates
15571882 * @ap_isolate: do not forward packets between connected stations
1883
+ * (0 = no, 1 = yes, -1 = do not change)
15581884 * @ht_opmode: HT Operation mode
1559
- * (u16 = opmode, -1 = do not change)
1885
+ * (u16 = opmode, -1 = do not change)
15601886 * @p2p_ctwindow: P2P CT Window (-1 = no change)
15611887 * @p2p_opp_ps: P2P opportunistic PS (-1 = no change)
15621888 */
....@@ -1640,6 +1966,15 @@
16401966 * @plink_timeout: If no tx activity is seen from a STA we've established
16411967 * peering with for longer than this time (in seconds), then remove it
16421968 * from the STA's list of peers. Default is 30 minutes.
1969
+ * @dot11MeshConnectedToMeshGate: if set to true, advertise that this STA is
1970
+ * connected to a mesh gate in mesh formation info. If false, the
1971
+ * value in mesh formation is determined by the presence of root paths
1972
+ * in the mesh path table
1973
+ * @dot11MeshNolearn: Try to avoid multi-hop path discovery (e.g. PREQ/PREP
1974
+ * for HWMP) if the destination is a direct neighbor. Note that this might
1975
+ * not be the optimal decision as a multi-hop route might be better. So
1976
+ * if using this setting you will likely also want to disable
1977
+ * dot11MeshForwarding and use another mesh routing protocol on top.
16431978 */
16441979 struct mesh_config {
16451980 u16 dot11MeshRetryTimeout;
....@@ -1659,6 +1994,8 @@
16591994 u16 dot11MeshHWMPperrMinInterval;
16601995 u16 dot11MeshHWMPnetDiameterTraversalTime;
16611996 u8 dot11MeshHWMPRootMode;
1997
+ bool dot11MeshConnectedToMeshGate;
1998
+ bool dot11MeshConnectedToAuthServer;
16621999 u16 dot11MeshHWMPRannInterval;
16632000 bool dot11MeshGateAnnouncementProtocol;
16642001 bool dot11MeshForwarding;
....@@ -1670,6 +2007,9 @@
16702007 enum nl80211_mesh_power_mode power_mode;
16712008 u16 dot11MeshAwakeWindowDuration;
16722009 u32 plink_timeout;
2010
+ bool dot11MeshNolearn;
2011
+
2012
+ ANDROID_KABI_RESERVE(1);
16732013 };
16742014
16752015 /**
....@@ -1719,6 +2059,8 @@
17192059 struct cfg80211_bitrate_mask beacon_rate;
17202060 bool userspace_handles_dfs;
17212061 bool control_port_over_nl80211;
2062
+
2063
+ ANDROID_KABI_RESERVE(1);
17222064 };
17232065
17242066 /**
....@@ -1798,6 +2140,27 @@
17982140 };
17992141
18002142 /**
2143
+ * struct cfg80211_scan_6ghz_params - relevant for 6 GHz only
2144
+ *
2145
+ * @short_bssid: short ssid to scan for
2146
+ * @bssid: bssid to scan for
2147
+ * @channel_idx: idx of the channel in the channel array in the scan request
2148
+ * which the above info relvant to
2149
+ * @unsolicited_probe: the AP transmits unsolicited probe response every 20 TU
2150
+ * @short_ssid_valid: short_ssid is valid and can be used
2151
+ * @psc_no_listen: when set, and the channel is a PSC channel, no need to wait
2152
+ * 20 TUs before starting to send probe requests.
2153
+ */
2154
+struct cfg80211_scan_6ghz_params {
2155
+ u32 short_ssid;
2156
+ u32 channel_idx;
2157
+ u8 bssid[ETH_ALEN];
2158
+ bool unsolicited_probe;
2159
+ bool short_ssid_valid;
2160
+ bool psc_no_listen;
2161
+};
2162
+
2163
+/**
18012164 * struct cfg80211_scan_request - scan request description
18022165 *
18032166 * @ssids: SSIDs to scan for (active scan only)
....@@ -1824,6 +2187,10 @@
18242187 * @mac_addr_mask: MAC address mask used with randomisation, bits that
18252188 * are 0 in the mask should be randomised, bits that are 1 should
18262189 * be taken from the @mac_addr
2190
+ * @scan_6ghz: relevant for split scan request only,
2191
+ * true if this is the second scan request
2192
+ * @n_6ghz_params: number of 6 GHz params
2193
+ * @scan_6ghz_params: 6 GHz params
18272194 * @bssid: BSSID to scan for (most commonly, the wildcard BSSID)
18282195 */
18292196 struct cfg80211_scan_request {
....@@ -1851,9 +2218,14 @@
18512218 struct cfg80211_scan_info info;
18522219 bool notified;
18532220 bool no_cck;
2221
+ bool scan_6ghz;
2222
+ u32 n_6ghz_params;
2223
+ struct cfg80211_scan_6ghz_params *scan_6ghz_params;
2224
+
2225
+ ANDROID_KABI_RESERVE(1);
18542226
18552227 /* keep last */
1856
- struct ieee80211_channel *channels[0];
2228
+ struct ieee80211_channel *channels[];
18572229 };
18582230
18592231 static inline void get_random_mask_addr(u8 *buf, const u8 *addr, const u8 *mask)
....@@ -1875,11 +2247,19 @@
18752247 * @bssid: BSSID to be matched; may be all-zero BSSID in case of SSID match
18762248 * or no match (RSSI only)
18772249 * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
2250
+ * @per_band_rssi_thold: Minimum rssi threshold for each band to be applied
2251
+ * for filtering out scan results received. Drivers advertize this support
2252
+ * of band specific rssi based filtering through the feature capability
2253
+ * %NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD. These band
2254
+ * specific rssi thresholds take precedence over rssi_thold, if specified.
2255
+ * If not specified for any band, it will be assigned with rssi_thold of
2256
+ * corresponding matchset.
18782257 */
18792258 struct cfg80211_match_set {
18802259 struct cfg80211_ssid ssid;
18812260 u8 bssid[ETH_ALEN];
18822261 s32 rssi_thold;
2262
+ s32 per_band_rssi_thold[NUM_NL80211_BANDS];
18832263 };
18842264
18852265 /**
....@@ -1919,8 +2299,8 @@
19192299 * @ie_len: length of ie in octets
19202300 * @flags: bit field of flags controlling operation
19212301 * @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).
2302
+ * entry to be considered valid and to be passed to the host
2303
+ * (others are filtered out).
19242304 * If ommited, all results are passed.
19252305 * @n_match_sets: number of match sets
19262306 * @report_results: indicates that results were reported for this request
....@@ -1990,8 +2370,10 @@
19902370 bool nl_owner_dead;
19912371 struct list_head list;
19922372
2373
+ ANDROID_KABI_RESERVE(1);
2374
+
19932375 /* keep last */
1994
- struct ieee80211_channel *channels[0];
2376
+ struct ieee80211_channel *channels[];
19952377 };
19962378
19972379 /**
....@@ -2018,7 +2400,7 @@
20182400 * received by the device (not just by the host, in case it was
20192401 * buffered on the device) and be accurate to about 10ms.
20202402 * If the frame isn't buffered, just passing the return value of
2021
- * ktime_get_boot_ns() is likely appropriate.
2403
+ * ktime_get_boottime_ns() is likely appropriate.
20222404 * @parent_tsf: the time at the start of reception of the first octet of the
20232405 * timestamp field of the frame. The time is the TSF of the BSS specified
20242406 * by %parent_bssid.
....@@ -2078,6 +2460,10 @@
20782460 * a BSS that hides the SSID in its beacon, this points to the BSS struct
20792461 * that holds the beacon data. @beacon_ies is still valid, of course, and
20802462 * points to the same data as hidden_beacon_bss->beacon_ies in that case.
2463
+ * @transmitted_bss: pointer to the transmitted BSS, if this is a
2464
+ * non-transmitted one (multi-BSSID support)
2465
+ * @nontrans_list: list of non-transmitted BSS, if this is a transmitted one
2466
+ * (multi-BSSID support)
20812467 * @signal: signal strength value (type depends on the wiphy's signal_type)
20822468 * @chains: bitmask for filled values in @chain_signal.
20832469 * @chain_signal: per-chain signal strength of last received BSS in dBm.
....@@ -2109,19 +2495,35 @@
21092495 u8 bssid_index;
21102496 u8 max_bssid_indicator;
21112497
2112
- u8 priv[0] __aligned(sizeof(void *));
2498
+ ANDROID_KABI_RESERVE(1);
2499
+
2500
+ u8 priv[] __aligned(sizeof(void *));
21132501 };
21142502
21152503 /**
2116
- * ieee80211_bss_get_ie - find IE with given ID
2504
+ * ieee80211_bss_get_elem - find element with given ID
21172505 * @bss: the bss to search
2118
- * @ie: the IE ID
2506
+ * @id: the element ID
21192507 *
21202508 * Note that the return value is an RCU-protected pointer, so
21212509 * rcu_read_lock() must be held when calling this function.
21222510 * Return: %NULL if not found.
21232511 */
2124
-const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
2512
+const struct element *ieee80211_bss_get_elem(struct cfg80211_bss *bss, u8 id);
2513
+
2514
+/**
2515
+ * ieee80211_bss_get_ie - find IE with given ID
2516
+ * @bss: the bss to search
2517
+ * @id: the element ID
2518
+ *
2519
+ * Note that the return value is an RCU-protected pointer, so
2520
+ * rcu_read_lock() must be held when calling this function.
2521
+ * Return: %NULL if not found.
2522
+ */
2523
+static inline const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 id)
2524
+{
2525
+ return (void *)ieee80211_bss_get_elem(bss, id);
2526
+}
21252527
21262528
21272529 /**
....@@ -2204,6 +2606,8 @@
22042606 * @fils_nonces: FILS nonces (part of AAD) for protecting (Re)Association
22052607 * Request/Response frame or %NULL if FILS is not used. This field starts
22062608 * with 16 octets of STA Nonce followed by 16 octets of AP Nonce.
2609
+ * @s1g_capa: S1G capability override
2610
+ * @s1g_capa_mask: S1G capability override mask
22072611 */
22082612 struct cfg80211_assoc_request {
22092613 struct cfg80211_bss *bss;
....@@ -2218,6 +2622,9 @@
22182622 const u8 *fils_kek;
22192623 size_t fils_kek_len;
22202624 const u8 *fils_nonces;
2625
+ struct ieee80211_s1g_cap s1g_capa, s1g_capa_mask;
2626
+
2627
+ ANDROID_KABI_RESERVE(1);
22212628 };
22222629
22232630 /**
....@@ -2295,7 +2702,7 @@
22952702 * will be used in ht_capa. Un-supported values will be ignored.
22962703 * @ht_capa_mask: The bits of ht_capa which are to be used.
22972704 * @wep_keys: static WEP keys, if not NULL points to an array of
2298
- * CFG80211_MAX_WEP_KEYS WEP keys
2705
+ * CFG80211_MAX_WEP_KEYS WEP keys
22992706 * @wep_tx_key: key index (0..3) of the default TX static WEP key
23002707 */
23012708 struct cfg80211_ibss_params {
....@@ -2316,6 +2723,8 @@
23162723 struct ieee80211_ht_cap ht_capa_mask;
23172724 struct key_params *wep_keys;
23182725 int wep_tx_key;
2726
+
2727
+ ANDROID_KABI_RESERVE(1);
23192728 };
23202729
23212730 /**
....@@ -2430,6 +2839,8 @@
24302839 size_t fils_erp_rrk_len;
24312840 bool want_1x;
24322841 struct ieee80211_edmg edmg;
2842
+
2843
+ ANDROID_KABI_RESERVE(1);
24332844 };
24342845
24352846 /**
....@@ -2473,6 +2884,15 @@
24732884 WIPHY_PARAM_TXQ_QUANTUM = 1 << 8,
24742885 };
24752886
2887
+#define IEEE80211_DEFAULT_AIRTIME_WEIGHT 256
2888
+
2889
+/* The per TXQ device queue limit in airtime */
2890
+#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L 5000
2891
+#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H 12000
2892
+
2893
+/* The per interface airtime threshold to switch to lower queue limit */
2894
+#define IEEE80211_AQL_THRESHOLD 24000
2895
+
24762896 /**
24772897 * struct cfg80211_pmksa - PMK Security Association
24782898 *
....@@ -2491,6 +2911,17 @@
24912911 * @cache_id: 2-octet cache identifier advertized by a FILS AP identifying the
24922912 * scope of PMKSA. This is valid only if @ssid_len is non-zero (may be
24932913 * %NULL).
2914
+ * @pmk_lifetime: Maximum lifetime for PMKSA in seconds
2915
+ * (dot11RSNAConfigPMKLifetime) or 0 if not specified.
2916
+ * The configured PMKSA must not be used for PMKSA caching after
2917
+ * expiration and any keys derived from this PMK become invalid on
2918
+ * expiration, i.e., the current association must be dropped if the PMK
2919
+ * used for it expires.
2920
+ * @pmk_reauth_threshold: Threshold time for reauthentication (percentage of
2921
+ * PMK lifetime, dot11RSNAConfigPMKReauthThreshold) or 0 if not specified.
2922
+ * Drivers are expected to trigger a full authentication instead of using
2923
+ * this PMKSA for caching when reassociating to a new BSS after this
2924
+ * threshold to generate a new PMK before the current one expires.
24942925 */
24952926 struct cfg80211_pmksa {
24962927 const u8 *bssid;
....@@ -2500,6 +2931,8 @@
25002931 const u8 *ssid;
25012932 size_t ssid_len;
25022933 const u8 *cache_id;
2934
+ u32 pmk_lifetime;
2935
+ u8 pmk_reauth_threshold;
25032936 };
25042937
25052938 /**
....@@ -2674,14 +3107,17 @@
26743107
26753108 /**
26763109 * struct cfg80211_gtk_rekey_data - rekey data
2677
- * @kek: key encryption key
2678
- * @kck: key confirmation key (NL80211_KCK_LEN bytes)
3110
+ * @kek: key encryption key (@kek_len bytes)
3111
+ * @kck: key confirmation key (@kck_len bytes)
26793112 * @replay_ctr: replay counter (NL80211_REPLAY_CTR_LEN bytes)
2680
- * @kek_len: Length of @kek in octets
3113
+ * @kek_len: length of kek
3114
+ * @kck_len length of kck
3115
+ * @akm: akm (oui, id)
26813116 */
26823117 struct cfg80211_gtk_rekey_data {
26833118 const u8 *kek, *kck, *replay_ctr;
2684
- size_t kek_len;
3119
+ u32 akm;
3120
+ u8 kek_len, kck_len;
26853121 };
26863122
26873123 /**
....@@ -2862,6 +3298,8 @@
28623298 u8 num_rx_filters;
28633299 u8 instance_id;
28643300 u64 cookie;
3301
+
3302
+ ANDROID_KABI_RESERVE(1);
28653303 };
28663304
28673305 /**
....@@ -2911,6 +3349,234 @@
29113349 };
29123350
29133351 /**
3352
+ * struct cfg80211_ftm_responder_stats - FTM responder statistics
3353
+ *
3354
+ * @filled: bitflag of flags using the bits of &enum nl80211_ftm_stats to
3355
+ * indicate the relevant values in this struct for them
3356
+ * @success_num: number of FTM sessions in which all frames were successfully
3357
+ * answered
3358
+ * @partial_num: number of FTM sessions in which part of frames were
3359
+ * successfully answered
3360
+ * @failed_num: number of failed FTM sessions
3361
+ * @asap_num: number of ASAP FTM sessions
3362
+ * @non_asap_num: number of non-ASAP FTM sessions
3363
+ * @total_duration_ms: total sessions durations - gives an indication
3364
+ * of how much time the responder was busy
3365
+ * @unknown_triggers_num: number of unknown FTM triggers - triggers from
3366
+ * initiators that didn't finish successfully the negotiation phase with
3367
+ * the responder
3368
+ * @reschedule_requests_num: number of FTM reschedule requests - initiator asks
3369
+ * for a new scheduling although it already has scheduled FTM slot
3370
+ * @out_of_window_triggers_num: total FTM triggers out of scheduled window
3371
+ */
3372
+struct cfg80211_ftm_responder_stats {
3373
+ u32 filled;
3374
+ u32 success_num;
3375
+ u32 partial_num;
3376
+ u32 failed_num;
3377
+ u32 asap_num;
3378
+ u32 non_asap_num;
3379
+ u64 total_duration_ms;
3380
+ u32 unknown_triggers_num;
3381
+ u32 reschedule_requests_num;
3382
+ u32 out_of_window_triggers_num;
3383
+};
3384
+
3385
+/**
3386
+ * struct cfg80211_pmsr_ftm_result - FTM result
3387
+ * @failure_reason: if this measurement failed (PMSR status is
3388
+ * %NL80211_PMSR_STATUS_FAILURE), this gives a more precise
3389
+ * reason than just "failure"
3390
+ * @burst_index: if reporting partial results, this is the index
3391
+ * in [0 .. num_bursts-1] of the burst that's being reported
3392
+ * @num_ftmr_attempts: number of FTM request frames transmitted
3393
+ * @num_ftmr_successes: number of FTM request frames acked
3394
+ * @busy_retry_time: if failure_reason is %NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
3395
+ * fill this to indicate in how many seconds a retry is deemed possible
3396
+ * by the responder
3397
+ * @num_bursts_exp: actual number of bursts exponent negotiated
3398
+ * @burst_duration: actual burst duration negotiated
3399
+ * @ftms_per_burst: actual FTMs per burst negotiated
3400
+ * @lci_len: length of LCI information (if present)
3401
+ * @civicloc_len: length of civic location information (if present)
3402
+ * @lci: LCI data (may be %NULL)
3403
+ * @civicloc: civic location data (may be %NULL)
3404
+ * @rssi_avg: average RSSI over FTM action frames reported
3405
+ * @rssi_spread: spread of the RSSI over FTM action frames reported
3406
+ * @tx_rate: bitrate for transmitted FTM action frame response
3407
+ * @rx_rate: bitrate of received FTM action frame
3408
+ * @rtt_avg: average of RTTs measured (must have either this or @dist_avg)
3409
+ * @rtt_variance: variance of RTTs measured (note that standard deviation is
3410
+ * the square root of the variance)
3411
+ * @rtt_spread: spread of the RTTs measured
3412
+ * @dist_avg: average of distances (mm) measured
3413
+ * (must have either this or @rtt_avg)
3414
+ * @dist_variance: variance of distances measured (see also @rtt_variance)
3415
+ * @dist_spread: spread of distances measured (see also @rtt_spread)
3416
+ * @num_ftmr_attempts_valid: @num_ftmr_attempts is valid
3417
+ * @num_ftmr_successes_valid: @num_ftmr_successes is valid
3418
+ * @rssi_avg_valid: @rssi_avg is valid
3419
+ * @rssi_spread_valid: @rssi_spread is valid
3420
+ * @tx_rate_valid: @tx_rate is valid
3421
+ * @rx_rate_valid: @rx_rate is valid
3422
+ * @rtt_avg_valid: @rtt_avg is valid
3423
+ * @rtt_variance_valid: @rtt_variance is valid
3424
+ * @rtt_spread_valid: @rtt_spread is valid
3425
+ * @dist_avg_valid: @dist_avg is valid
3426
+ * @dist_variance_valid: @dist_variance is valid
3427
+ * @dist_spread_valid: @dist_spread is valid
3428
+ */
3429
+struct cfg80211_pmsr_ftm_result {
3430
+ const u8 *lci;
3431
+ const u8 *civicloc;
3432
+ unsigned int lci_len;
3433
+ unsigned int civicloc_len;
3434
+ enum nl80211_peer_measurement_ftm_failure_reasons failure_reason;
3435
+ u32 num_ftmr_attempts, num_ftmr_successes;
3436
+ s16 burst_index;
3437
+ u8 busy_retry_time;
3438
+ u8 num_bursts_exp;
3439
+ u8 burst_duration;
3440
+ u8 ftms_per_burst;
3441
+ s32 rssi_avg;
3442
+ s32 rssi_spread;
3443
+ struct rate_info tx_rate, rx_rate;
3444
+ s64 rtt_avg;
3445
+ s64 rtt_variance;
3446
+ s64 rtt_spread;
3447
+ s64 dist_avg;
3448
+ s64 dist_variance;
3449
+ s64 dist_spread;
3450
+
3451
+ u16 num_ftmr_attempts_valid:1,
3452
+ num_ftmr_successes_valid:1,
3453
+ rssi_avg_valid:1,
3454
+ rssi_spread_valid:1,
3455
+ tx_rate_valid:1,
3456
+ rx_rate_valid:1,
3457
+ rtt_avg_valid:1,
3458
+ rtt_variance_valid:1,
3459
+ rtt_spread_valid:1,
3460
+ dist_avg_valid:1,
3461
+ dist_variance_valid:1,
3462
+ dist_spread_valid:1;
3463
+
3464
+ ANDROID_KABI_RESERVE(1);
3465
+};
3466
+
3467
+/**
3468
+ * struct cfg80211_pmsr_result - peer measurement result
3469
+ * @addr: address of the peer
3470
+ * @host_time: host time (use ktime_get_boottime() adjust to the time when the
3471
+ * measurement was made)
3472
+ * @ap_tsf: AP's TSF at measurement time
3473
+ * @status: status of the measurement
3474
+ * @final: if reporting partial results, mark this as the last one; if not
3475
+ * reporting partial results always set this flag
3476
+ * @ap_tsf_valid: indicates the @ap_tsf value is valid
3477
+ * @type: type of the measurement reported, note that we only support reporting
3478
+ * one type at a time, but you can report multiple results separately and
3479
+ * they're all aggregated for userspace.
3480
+ */
3481
+struct cfg80211_pmsr_result {
3482
+ u64 host_time, ap_tsf;
3483
+ enum nl80211_peer_measurement_status status;
3484
+
3485
+ u8 addr[ETH_ALEN];
3486
+
3487
+ u8 final:1,
3488
+ ap_tsf_valid:1;
3489
+
3490
+ enum nl80211_peer_measurement_type type;
3491
+
3492
+ union {
3493
+ struct cfg80211_pmsr_ftm_result ftm;
3494
+ };
3495
+};
3496
+
3497
+/**
3498
+ * struct cfg80211_pmsr_ftm_request_peer - FTM request data
3499
+ * @requested: indicates FTM is requested
3500
+ * @preamble: frame preamble to use
3501
+ * @burst_period: burst period to use
3502
+ * @asap: indicates to use ASAP mode
3503
+ * @num_bursts_exp: number of bursts exponent
3504
+ * @burst_duration: burst duration
3505
+ * @ftms_per_burst: number of FTMs per burst
3506
+ * @ftmr_retries: number of retries for FTM request
3507
+ * @request_lci: request LCI information
3508
+ * @request_civicloc: request civic location information
3509
+ * @trigger_based: use trigger based ranging for the measurement
3510
+ * If neither @trigger_based nor @non_trigger_based is set,
3511
+ * EDCA based ranging will be used.
3512
+ * @non_trigger_based: use non 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
+ *
3516
+ * See also nl80211 for the respective attribute documentation.
3517
+ */
3518
+struct cfg80211_pmsr_ftm_request_peer {
3519
+ enum nl80211_preamble preamble;
3520
+ u16 burst_period;
3521
+ u8 requested:1,
3522
+ asap:1,
3523
+ request_lci:1,
3524
+ request_civicloc:1,
3525
+ trigger_based:1,
3526
+ non_trigger_based:1;
3527
+ u8 num_bursts_exp;
3528
+ u8 burst_duration;
3529
+ u8 ftms_per_burst;
3530
+ u8 ftmr_retries;
3531
+};
3532
+
3533
+/**
3534
+ * struct cfg80211_pmsr_request_peer - peer data for a peer measurement request
3535
+ * @addr: MAC address
3536
+ * @chandef: channel to use
3537
+ * @report_ap_tsf: report the associated AP's TSF
3538
+ * @ftm: FTM data, see &struct cfg80211_pmsr_ftm_request_peer
3539
+ */
3540
+struct cfg80211_pmsr_request_peer {
3541
+ u8 addr[ETH_ALEN];
3542
+ struct cfg80211_chan_def chandef;
3543
+ u8 report_ap_tsf:1;
3544
+ struct cfg80211_pmsr_ftm_request_peer ftm;
3545
+};
3546
+
3547
+/**
3548
+ * struct cfg80211_pmsr_request - peer measurement request
3549
+ * @cookie: cookie, set by cfg80211
3550
+ * @nl_portid: netlink portid - used by cfg80211
3551
+ * @drv_data: driver data for this request, if required for aborting,
3552
+ * not otherwise freed or anything by cfg80211
3553
+ * @mac_addr: MAC address used for (randomised) request
3554
+ * @mac_addr_mask: MAC address mask used for randomisation, bits that
3555
+ * are 0 in the mask should be randomised, bits that are 1 should
3556
+ * be taken from the @mac_addr
3557
+ * @list: used by cfg80211 to hold on to the request
3558
+ * @timeout: timeout (in milliseconds) for the whole operation, if
3559
+ * zero it means there's no timeout
3560
+ * @n_peers: number of peers to do measurements with
3561
+ * @peers: per-peer measurement request data
3562
+ */
3563
+struct cfg80211_pmsr_request {
3564
+ u64 cookie;
3565
+ void *drv_data;
3566
+ u32 n_peers;
3567
+ u32 nl_portid;
3568
+
3569
+ u32 timeout;
3570
+
3571
+ u8 mac_addr[ETH_ALEN] __aligned(2);
3572
+ u8 mac_addr_mask[ETH_ALEN] __aligned(2);
3573
+
3574
+ struct list_head list;
3575
+
3576
+ struct cfg80211_pmsr_request_peer peers[];
3577
+};
3578
+
3579
+/**
29143580 * struct cfg80211_update_owe_info - OWE Information
29153581 *
29163582 * This structure provides information needed for the drivers to offload OWE
....@@ -2934,6 +3600,21 @@
29343600 u16 status;
29353601 const u8 *ie;
29363602 size_t ie_len;
3603
+};
3604
+
3605
+/**
3606
+ * struct mgmt_frame_regs - management frame registrations data
3607
+ * @global_stypes: bitmap of management frame subtypes registered
3608
+ * for the entire device
3609
+ * @interface_stypes: bitmap of management frame subtypes registered
3610
+ * for the given interface
3611
+ * @global_mcast_rx: mcast RX is needed globally for these subtypes
3612
+ * @interface_mcast_stypes: mcast RX is needed on this interface
3613
+ * for these subtypes
3614
+ */
3615
+struct mgmt_frame_regs {
3616
+ u32 global_stypes, interface_stypes;
3617
+ u32 global_mcast_stypes, interface_mcast_stypes;
29373618 };
29383619
29393620 /**
....@@ -2983,7 +3664,7 @@
29833664 * @set_default_key: set the default key on an interface
29843665 *
29853666 * @set_default_mgmt_key: set the default management frame key on an interface
2986
-
3667
+ *
29873668 * @set_default_beacon_key: set the default Beacon frame key on an interface
29883669 *
29893670 * @set_rekey_data: give the data necessary for GTK rekeying to the driver
....@@ -3160,8 +3841,8 @@
31603841 * The driver should not call cfg80211_sched_scan_stopped() for a requested
31613842 * stop (when this method returns 0).
31623843 *
3163
- * @mgmt_frame_register: Notify driver that a management frame type was
3164
- * registered. The callback is allowed to sleep.
3844
+ * @update_mgmt_frame_registrations: Notify the driver that management frame
3845
+ * registrations were updated. The callback is allowed to sleep.
31653846 *
31663847 * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device.
31673848 * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may
....@@ -3274,9 +3955,21 @@
32743955 * @tx_control_port: TX a control port frame (EAPoL). The noencrypt parameter
32753956 * tells the driver that the frame should not be encrypted.
32763957 *
3958
+ * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available.
3959
+ * Statistics should be cumulative, currently no way to reset is provided.
3960
+ * @start_pmsr: start peer measurement (e.g. FTM)
3961
+ * @abort_pmsr: abort peer measurement
3962
+ *
32773963 * @update_owe_info: Provide updated OWE info to driver. Driver implementing SME
32783964 * but offloading OWE processing to the user space will get the updated
32793965 * DH IE through this interface.
3966
+ *
3967
+ * @probe_mesh_link: Probe direct Mesh peer's link quality by sending data frame
3968
+ * and overrule HWMP path selection algorithm.
3969
+ * @set_tid_config: TID specific configuration, this can be peer or BSS specific
3970
+ * This callback may sleep.
3971
+ * @reset_tid_config: Reset TID specific configuration for the peer, for the
3972
+ * given TIDs. This callback may sleep.
32803973 */
32813974 struct cfg80211_ops {
32823975 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
....@@ -3419,11 +4112,13 @@
34194112
34204113 void (*rfkill_poll)(struct wiphy *wiphy);
34214114
4115
+#ifdef CONFIG_NL80211_TESTMODE
34224116 int (*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev,
34234117 void *data, int len);
34244118 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
34254119 struct netlink_callback *cb,
34264120 void *data, int len);
4121
+#endif
34274122
34284123 int (*set_bitrate_mask)(struct wiphy *wiphy,
34294124 struct net_device *dev,
....@@ -3470,9 +4165,9 @@
34704165 struct net_device *dev,
34714166 u32 rate, u32 pkts, u32 intvl);
34724167
3473
- void (*mgmt_frame_register)(struct wiphy *wiphy,
3474
- struct wireless_dev *wdev,
3475
- u16 frame_type, bool reg);
4168
+ void (*update_mgmt_frame_registrations)(struct wiphy *wiphy,
4169
+ struct wireless_dev *wdev,
4170
+ struct mgmt_frame_regs *upd);
34764171
34774172 int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
34784173 int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant);
....@@ -3584,9 +4279,29 @@
35844279 struct net_device *dev,
35854280 const u8 *buf, size_t len,
35864281 const u8 *dest, const __be16 proto,
3587
- const bool noencrypt);
4282
+ const bool noencrypt,
4283
+ u64 *cookie);
4284
+
4285
+ int (*get_ftm_responder_stats)(struct wiphy *wiphy,
4286
+ struct net_device *dev,
4287
+ struct cfg80211_ftm_responder_stats *ftm_stats);
4288
+
4289
+ int (*start_pmsr)(struct wiphy *wiphy, struct wireless_dev *wdev,
4290
+ struct cfg80211_pmsr_request *request);
4291
+ void (*abort_pmsr)(struct wiphy *wiphy, struct wireless_dev *wdev,
4292
+ struct cfg80211_pmsr_request *request);
35884293 int (*update_owe_info)(struct wiphy *wiphy, struct net_device *dev,
35894294 struct cfg80211_update_owe_info *owe_info);
4295
+ int (*probe_mesh_link)(struct wiphy *wiphy, struct net_device *dev,
4296
+ const u8 *buf, size_t len);
4297
+ int (*set_tid_config)(struct wiphy *wiphy, struct net_device *dev,
4298
+ struct cfg80211_tid_config *tid_conf);
4299
+ int (*reset_tid_config)(struct wiphy *wiphy, struct net_device *dev,
4300
+ const u8 *peer, u8 tids);
4301
+ ANDROID_KABI_RESERVE(1);
4302
+ ANDROID_KABI_RESERVE(2);
4303
+ ANDROID_KABI_RESERVE(3);
4304
+ ANDROID_KABI_RESERVE(4);
35904305 };
35914306
35924307 /*
....@@ -3597,6 +4312,8 @@
35974312 /**
35984313 * enum wiphy_flags - wiphy capability flags
35994314 *
4315
+ * @WIPHY_FLAG_SPLIT_SCAN_6GHZ: if set to true, the scan request will be split
4316
+ * into two, first for legacy bands and second for UHB.
36004317 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
36014318 * wiphy at all
36024319 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
....@@ -3635,11 +4352,12 @@
36354352 * beaconing mode (AP, IBSS, Mesh, ...).
36364353 * @WIPHY_FLAG_HAS_STATIC_WEP: The device supports static WEP key installation
36374354 * before connection.
4355
+ * @WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK: The device supports bigger kek and kck keys
36384356 */
36394357 enum wiphy_flags {
3640
- /* use hole at 0 */
4358
+ WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0),
36414359 /* use hole at 1 */
3642
- /* use hole at 2 */
4360
+ WIPHY_FLAG_SPLIT_SCAN_6GHZ = BIT(2),
36434361 WIPHY_FLAG_NETNS_OK = BIT(3),
36444362 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
36454363 WIPHY_FLAG_4ADDR_AP = BIT(5),
....@@ -3917,6 +4635,8 @@
39174635 u8 rx_nss;
39184636 };
39194637
4638
+#define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)(long)(-ENODATA))
4639
+
39204640 /**
39214641 * struct wiphy_vendor_command - vendor command definition
39224642 * @info: vendor command identifying information, as used in nl80211
....@@ -3927,6 +4647,10 @@
39274647 * @dumpit: dump callback, for transferring bigger/multiple items. The
39284648 * @storage points to cb->args[5], ie. is preserved over the multiple
39294649 * dumpit calls.
4650
+ * @policy: policy pointer for attributes within %NL80211_ATTR_VENDOR_DATA.
4651
+ * Set this to %VENDOR_CMD_RAW_DATA if no policy can be given and the
4652
+ * attribute is just raw data (e.g. a firmware command).
4653
+ * @maxattr: highest attribute number in policy
39304654 * It's recommended to not have the same sub command with both @doit and
39314655 * @dumpit, so that userspace can assume certain ones are get and others
39324656 * are used with dump requests.
....@@ -3939,6 +4663,10 @@
39394663 int (*dumpit)(struct wiphy *wiphy, struct wireless_dev *wdev,
39404664 struct sk_buff *skb, const void *data, int data_len,
39414665 unsigned long *storage);
4666
+ const struct nla_policy *policy;
4667
+ unsigned int maxattr;
4668
+
4669
+ ANDROID_KABI_RESERVE(1);
39424670 };
39434671
39444672 /**
....@@ -3957,6 +4685,46 @@
39574685 const u8 *extended_capabilities;
39584686 const u8 *extended_capabilities_mask;
39594687 u8 extended_capabilities_len;
4688
+};
4689
+
4690
+/**
4691
+ * struct cfg80211_pmsr_capabilities - cfg80211 peer measurement capabilities
4692
+ * @max_peers: maximum number of peers in a single measurement
4693
+ * @report_ap_tsf: can report assoc AP's TSF for radio resource measurement
4694
+ * @randomize_mac_addr: can randomize MAC address for measurement
4695
+ * @ftm.supported: FTM measurement is supported
4696
+ * @ftm.asap: ASAP-mode is supported
4697
+ * @ftm.non_asap: non-ASAP-mode is supported
4698
+ * @ftm.request_lci: can request LCI data
4699
+ * @ftm.request_civicloc: can request civic location data
4700
+ * @ftm.preambles: bitmap of preambles supported (&enum nl80211_preamble)
4701
+ * @ftm.bandwidths: bitmap of bandwidths supported (&enum nl80211_chan_width)
4702
+ * @ftm.max_bursts_exponent: maximum burst exponent supported
4703
+ * (set to -1 if not limited; note that setting this will necessarily
4704
+ * forbid using the value 15 to let the responder pick)
4705
+ * @ftm.max_ftms_per_burst: maximum FTMs per burst supported (set to 0 if
4706
+ * not limited)
4707
+ * @ftm.trigger_based: trigger based ranging measurement is supported
4708
+ * @ftm.non_trigger_based: non trigger based ranging measurement is supported
4709
+ */
4710
+struct cfg80211_pmsr_capabilities {
4711
+ unsigned int max_peers;
4712
+ u8 report_ap_tsf:1,
4713
+ randomize_mac_addr:1;
4714
+
4715
+ struct {
4716
+ u32 preambles;
4717
+ u32 bandwidths;
4718
+ s8 max_bursts_exponent;
4719
+ u8 max_ftms_per_burst;
4720
+ u8 supported:1,
4721
+ asap:1,
4722
+ non_asap:1,
4723
+ request_lci:1,
4724
+ request_civicloc:1,
4725
+ trigger_based:1,
4726
+ non_trigger_based:1;
4727
+ } ftm;
39604728 };
39614729
39624730 /**
....@@ -3980,12 +4748,16 @@
39804748 * note that if your driver uses wiphy_apply_custom_regulatory()
39814749 * the reg_notifier's request can be passed as NULL
39824750 * @regd: the driver's regulatory domain, if one was requested via
3983
- * the regulatory_hint() API. This can be used by the driver
4751
+ * the regulatory_hint() API. This can be used by the driver
39844752 * on the reg_notifier() if it chooses to ignore future
39854753 * regulatory domain changes caused by other drivers.
39864754 * @signal_type: signal type reported in &struct cfg80211_bss.
39874755 * @cipher_suites: supported cipher suites
39884756 * @n_cipher_suites: number of supported cipher suites
4757
+ * @akm_suites: supported AKM suites. These are the default AKMs supported if
4758
+ * the supported AKMs not advertized for a specific interface type in
4759
+ * iftype_akm_suites.
4760
+ * @n_akm_suites: number of supported AKM suites
39894761 * @iftype_akm_suites: array of supported akm suites info per interface type.
39904762 * Note that the bits in @iftypes_mask inside this structure cannot
39914763 * overlap (i.e. only one occurrence of each type is allowed across all
....@@ -4012,10 +4784,11 @@
40124784 * the same number of arbitrary MAC addresses.
40134785 * @registered: protects ->resume and ->suspend sysfs callbacks against
40144786 * 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
4787
+ * @debugfsdir: debugfs directory used for this wiphy (ieee80211/<wiphyname>).
4788
+ * It will be renamed automatically on wiphy renames
4789
+ * @dev: (virtual) struct device for this wiphy. The item in
4790
+ * /sys/class/ieee80211/ points to this. You need use set_wiphy_dev()
4791
+ * (see below).
40194792 * @wext: wireless extension handlers
40204793 * @priv: driver private data (sized according to wiphy_new() parameter)
40214794 * @interface_modes: bitmask of interfaces types valid for this wiphy,
....@@ -4126,17 +4899,10 @@
41264899 * and probe responses. This value should be set if the driver
41274900 * wishes to limit the number of csa counters. Default (0) means
41284901 * 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.
41354902 * @bss_select_support: bitmask indicating the BSS selection criteria supported
41364903 * by the driver in the .connect() callback. The bit position maps to the
41374904 * attribute indices defined in &enum nl80211_bss_select_attr.
41384905 *
4139
- * @cookie_counter: unique generic cookie counter, used to identify objects.
41404906 * @nan_supported_bands: bands supported by the device in NAN mode, a
41414907 * bitmap of &enum nl80211_band values. For instance, for
41424908 * NL80211_BAND_2GHZ, bit 0 would be set
....@@ -4146,15 +4912,32 @@
41464912 * @txq_memory_limit: configuration internal TX queue memory limit
41474913 * @txq_quantum: configuration of internal TX queue scheduler quantum
41484914 *
4915
+ * @tx_queue_len: allow setting transmit queue len for drivers not using
4916
+ * wake_tx_queue
4917
+ *
41494918 * @support_mbssid: can HW support association with nontransmitted AP
41504919 * @support_only_he_mbssid: don't parse MBSSID elements if it is not
41514920 * HE AP, in order to avoid compatibility issues.
41524921 * @support_mbssid must be set for this to have any effect.
4922
+ *
4923
+ * @pmsr_capa: peer measurement capabilities
4924
+ *
4925
+ * @tid_config_support: describes the per-TID config support that the
4926
+ * device has
4927
+ * @tid_config_support.vif: bitmap of attributes (configurations)
4928
+ * supported by the driver for each vif
4929
+ * @tid_config_support.peer: bitmap of attributes (configurations)
4930
+ * supported by the driver for each peer
4931
+ * @tid_config_support.max_retry: maximum supported retry count for
4932
+ * long/short retry configuration
4933
+ *
4934
+ * @max_data_retry_count: maximum supported per TID retry count for
4935
+ * configuration through the %NL80211_TID_CONFIG_ATTR_RETRY_SHORT and
4936
+ * %NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes
41534937 */
41544938 struct wiphy {
41554939 /* assign these fields before you register the wiphy */
41564940
4157
- /* permanent MAC address(es) */
41584941 u8 perm_addr[ETH_ALEN];
41594942 u8 addr_mask[ETH_ALEN];
41604943
....@@ -4194,6 +4977,9 @@
41944977 int n_cipher_suites;
41954978 const u32 *cipher_suites;
41964979
4980
+ int n_akm_suites;
4981
+ const u32 *akm_suites;
4982
+
41974983 const struct wiphy_iftype_akm_suites *iftype_akm_suites;
41984984 unsigned int num_iftype_akm_suites;
41994985
....@@ -4218,11 +5004,6 @@
42185004 u32 available_antennas_tx;
42195005 u32 available_antennas_rx;
42205006
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
- */
42265007 u32 probe_resp_offload;
42275008
42285009 const u8 *extended_capabilities, *extended_capabilities_mask;
....@@ -4231,16 +5012,10 @@
42315012 const struct wiphy_iftype_ext_capab *iftype_ext_capab;
42325013 unsigned int num_iftype_ext_capab;
42335014
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. */
42395015 const void *privid;
42405016
42415017 struct ieee80211_supported_band *bands[NUM_NL80211_BANDS];
42425018
4243
- /* Lets us get back the wiphy on the callback */
42445019 void (*reg_notifier)(struct wiphy *wiphy,
42455020 struct regulatory_request *request);
42465021
....@@ -4248,14 +5023,10 @@
42485023
42495024 const struct ieee80211_regdomain __rcu *regd;
42505025
4251
- /* the item in /sys/class/ieee80211/ points to this,
4252
- * you need use set_wiphy_dev() (see below) */
42535026 struct device dev;
42545027
4255
- /* protects ->resume, ->suspend sysfs callbacks against unregister hw */
42565028 bool registered;
42575029
4258
- /* dir in debugfs: ieee80211/<wiphyname> */
42595030 struct dentry *debugfsdir;
42605031
42615032 const struct ieee80211_ht_cap *ht_capa_mod_mask;
....@@ -4263,7 +5034,6 @@
42635034
42645035 struct list_head wdev_list;
42655036
4266
- /* the network namespace this phy lives in currently */
42675037 possible_net_t _net;
42685038
42695039 #ifdef CONFIG_CFG80211_WEXT
....@@ -4279,11 +5049,8 @@
42795049 u16 max_ap_assoc_sta;
42805050
42815051 u8 max_num_csa_counters;
4282
- u8 max_adj_channel_rssi_comp;
42835052
42845053 u32 bss_select_support;
4285
-
4286
- u64 cookie_counter;
42875054
42885055 u8 nan_supported_bands;
42895056
....@@ -4291,10 +5058,23 @@
42915058 u32 txq_memory_limit;
42925059 u32 txq_quantum;
42935060
5061
+ unsigned long tx_queue_len;
5062
+
42945063 u8 support_mbssid:1,
42955064 support_only_he_mbssid:1;
42965065
4297
- char priv[0] __aligned(NETDEV_ALIGN);
5066
+ const struct cfg80211_pmsr_capabilities *pmsr_capa;
5067
+
5068
+ struct {
5069
+ u64 peer, vif;
5070
+ u8 max_retry;
5071
+ } tid_config_support;
5072
+
5073
+ u8 max_data_retry_count;
5074
+
5075
+ ANDROID_KABI_RESERVE(1);
5076
+
5077
+ char priv[] __aligned(NETDEV_ALIGN);
42985078 };
42995079
43005080 static inline struct net *wiphy_net(struct wiphy *wiphy)
....@@ -4463,12 +5243,24 @@
44635243 * @mesh_id_len: (private) Used by the internal configuration code
44645244 * @mesh_id_up_len: (private) Used by the internal configuration code
44655245 * @wext: (private) Used by the internal wireless extensions compat code
5246
+ * @wext.ibss: (private) IBSS data part of wext handling
5247
+ * @wext.connect: (private) connection handling data
5248
+ * @wext.keys: (private) (WEP) key data
5249
+ * @wext.ie: (private) extra elements for association
5250
+ * @wext.ie_len: (private) length of extra elements
5251
+ * @wext.bssid: (private) selected network BSSID
5252
+ * @wext.ssid: (private) selected network SSID
5253
+ * @wext.default_key: (private) selected default key index
5254
+ * @wext.default_mgmt_key: (private) selected default management key index
5255
+ * @wext.prev_bssid: (private) previous BSSID for reassociation
5256
+ * @wext.prev_bssid_valid: (private) previous BSSID validity
44665257 * @use_4addr: indicates 4addr mode is used on this interface, must be
44675258 * set by driver (if supported) on add_interface BEFORE registering the
44685259 * netdev and may otherwise be used by driver read-only, will be update
44695260 * by cfg80211 on change_interface
44705261 * @mgmt_registrations: list of registrations for management frames
4471
- * @mgmt_registrations_lock: lock for the list
5262
+ * @mgmt_registrations_need_update: mgmt registrations were updated,
5263
+ * need to propagate the update to the driver
44725264 * @mtx: mutex used to lock data in this struct, may be used by drivers
44735265 * and some API functions require it held
44745266 * @beacon_interval: beacon interval used on this device for transmitting
....@@ -4496,6 +5288,11 @@
44965288 * @owner_nlportid: (private) owner socket port ID
44975289 * @nl_owner_dead: (private) owner socket went away
44985290 * @cqm_config: (private) nl80211 RSSI monitor state
5291
+ * @pmsr_list: (private) peer measurement requests
5292
+ * @pmsr_lock: (private) peer measurements requests/results lock
5293
+ * @pmsr_free_wk: (private) peer measurements cleanup work
5294
+ * @unprot_beacon_reported: (private) timestamp of last
5295
+ * unprotected beacon report
44995296 */
45005297 struct wireless_dev {
45015298 struct wiphy *wiphy;
....@@ -4508,7 +5305,14 @@
45085305 u32 identifier;
45095306
45105307 struct list_head mgmt_registrations;
5308
+ /*
5309
+ * ANDROID: mgmt_registrations_lock was restored to preserve ABI in
5310
+ * 5.10.77 due to backport of 09b1d5dc6ce1 ("cfg80211: fix management
5311
+ * registrations locking") but it is not used for anything so do not
5312
+ * touch this variable!
5313
+ */
45115314 spinlock_t mgmt_registrations_lock;
5315
+ u8 mgmt_registrations_need_update:1;
45125316
45135317 struct mutex mtx;
45145318
....@@ -4559,7 +5363,8 @@
45595363 struct cfg80211_cached_keys *keys;
45605364 const u8 *ie;
45615365 size_t ie_len;
4562
- u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
5366
+ u8 bssid[ETH_ALEN];
5367
+ u8 prev_bssid[ETH_ALEN];
45635368 u8 ssid[IEEE80211_MAX_SSID_LEN];
45645369 s8 default_key, default_mgmt_key;
45655370 bool prev_bssid_valid;
....@@ -4567,6 +5372,15 @@
45675372 #endif
45685373
45695374 struct cfg80211_cqm_config *cqm_config;
5375
+
5376
+ struct list_head pmsr_list;
5377
+ spinlock_t pmsr_lock;
5378
+ struct work_struct pmsr_free_wk;
5379
+
5380
+ unsigned long unprot_beacon_reported;
5381
+
5382
+ ANDROID_KABI_RESERVE(1);
5383
+ ANDROID_KABI_RESERVE(2);
45705384 };
45715385
45725386 static inline u8 *wdev_address(struct wireless_dev *wdev)
....@@ -4602,29 +5416,116 @@
46025416 */
46035417
46045418 /**
5419
+ * ieee80211_channel_equal - compare two struct ieee80211_channel
5420
+ *
5421
+ * @a: 1st struct ieee80211_channel
5422
+ * @b: 2nd struct ieee80211_channel
5423
+ * Return: true if center frequency of @a == @b
5424
+ */
5425
+static inline bool
5426
+ieee80211_channel_equal(struct ieee80211_channel *a,
5427
+ struct ieee80211_channel *b)
5428
+{
5429
+ return (a->center_freq == b->center_freq &&
5430
+ a->freq_offset == b->freq_offset);
5431
+}
5432
+
5433
+/**
5434
+ * ieee80211_channel_to_khz - convert ieee80211_channel to frequency in KHz
5435
+ * @chan: struct ieee80211_channel to convert
5436
+ * Return: The corresponding frequency (in KHz)
5437
+ */
5438
+static inline u32
5439
+ieee80211_channel_to_khz(const struct ieee80211_channel *chan)
5440
+{
5441
+ return MHZ_TO_KHZ(chan->center_freq) + chan->freq_offset;
5442
+}
5443
+
5444
+/**
5445
+ * ieee80211_s1g_channel_width - get allowed channel width from @chan
5446
+ *
5447
+ * Only allowed for band NL80211_BAND_S1GHZ
5448
+ * @chan: channel
5449
+ * Return: The allowed channel width for this center_freq
5450
+ */
5451
+enum nl80211_chan_width
5452
+ieee80211_s1g_channel_width(const struct ieee80211_channel *chan);
5453
+
5454
+/**
5455
+ * ieee80211_channel_to_freq_khz - convert channel number to frequency
5456
+ * @chan: channel number
5457
+ * @band: band, necessary due to channel number overlap
5458
+ * Return: The corresponding frequency (in KHz), or 0 if the conversion failed.
5459
+ */
5460
+u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band);
5461
+
5462
+/**
46055463 * ieee80211_channel_to_frequency - convert channel number to frequency
46065464 * @chan: channel number
46075465 * @band: band, necessary due to channel number overlap
46085466 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed.
46095467 */
4610
-int ieee80211_channel_to_frequency(int chan, enum nl80211_band band);
5468
+static inline int
5469
+ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
5470
+{
5471
+ return KHZ_TO_MHZ(ieee80211_channel_to_freq_khz(chan, band));
5472
+}
5473
+
5474
+/**
5475
+ * ieee80211_freq_khz_to_channel - convert frequency to channel number
5476
+ * @freq: center frequency in KHz
5477
+ * Return: The corresponding channel, or 0 if the conversion failed.
5478
+ */
5479
+int ieee80211_freq_khz_to_channel(u32 freq);
46115480
46125481 /**
46135482 * ieee80211_frequency_to_channel - convert frequency to channel number
4614
- * @freq: center frequency
5483
+ * @freq: center frequency in MHz
46155484 * Return: The corresponding channel, or 0 if the conversion failed.
46165485 */
4617
-int ieee80211_frequency_to_channel(int freq);
5486
+static inline int
5487
+ieee80211_frequency_to_channel(int freq)
5488
+{
5489
+ return ieee80211_freq_khz_to_channel(MHZ_TO_KHZ(freq));
5490
+}
5491
+
5492
+/**
5493
+ * ieee80211_get_channel_khz - get channel struct from wiphy for specified
5494
+ * frequency
5495
+ * @wiphy: the struct wiphy to get the channel for
5496
+ * @freq: the center frequency (in KHz) of the channel
5497
+ * Return: The channel struct from @wiphy at @freq.
5498
+ */
5499
+struct ieee80211_channel *
5500
+ieee80211_get_channel_khz(struct wiphy *wiphy, u32 freq);
46185501
46195502 /**
46205503 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
46215504 *
46225505 * @wiphy: the struct wiphy to get the channel for
4623
- * @freq: the center frequency of the channel
4624
- *
5506
+ * @freq: the center frequency (in MHz) of the channel
46255507 * Return: The channel struct from @wiphy at @freq.
46265508 */
4627
-struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy, int freq);
5509
+static inline struct ieee80211_channel *
5510
+ieee80211_get_channel(struct wiphy *wiphy, int freq)
5511
+{
5512
+ return ieee80211_get_channel_khz(wiphy, MHZ_TO_KHZ(freq));
5513
+}
5514
+
5515
+/**
5516
+ * cfg80211_channel_is_psc - Check if the channel is a 6 GHz PSC
5517
+ * @chan: control channel to check
5518
+ *
5519
+ * The Preferred Scanning Channels (PSC) are defined in
5520
+ * Draft IEEE P802.11ax/D5.0, 26.17.2.3.3
5521
+ */
5522
+static inline bool cfg80211_channel_is_psc(struct ieee80211_channel *chan)
5523
+{
5524
+ if (chan->band != NL80211_BAND_6GHZ)
5525
+ return false;
5526
+
5527
+ return ieee80211_frequency_to_channel(chan->center_freq) % 16 == 5;
5528
+}
46285529
46295530 /**
46305531 * ieee80211_get_response_rate - get basic rate for a given rate
....@@ -4657,7 +5558,7 @@
46575558 * Radiotap parsing functions -- for controlled injection support
46585559 *
46595560 * Implemented in net/wireless/radiotap.c
4660
- * Documentation in Documentation/networking/radiotap-headers.txt
5561
+ * Documentation in Documentation/networking/radiotap-headers.rst
46615562 */
46625563
46635564 struct radiotap_align_size {
....@@ -4812,7 +5713,7 @@
48125713 *
48135714 * @skb: The input A-MSDU frame without any headers.
48145715 * @list: The output list of 802.3 frames. It must be allocated and
4815
- * initialized by by the caller.
5716
+ * initialized by the caller.
48165717 * @addr: The device MAC address.
48175718 * @iftype: The device interface type.
48185719 * @extra_headroom: The hardware extra headroom for SKBs in the @list.
....@@ -4832,6 +5733,33 @@
48325733 */
48335734 unsigned int cfg80211_classify8021d(struct sk_buff *skb,
48345735 struct cfg80211_qos_map *qos_map);
5736
+
5737
+/**
5738
+ * cfg80211_find_elem_match - match information element and byte array in data
5739
+ *
5740
+ * @eid: element ID
5741
+ * @ies: data consisting of IEs
5742
+ * @len: length of data
5743
+ * @match: byte array to match
5744
+ * @match_len: number of bytes in the match array
5745
+ * @match_offset: offset in the IE data where the byte array should match.
5746
+ * Note the difference to cfg80211_find_ie_match() which considers
5747
+ * the offset to start from the element ID byte, but here we take
5748
+ * the data portion instead.
5749
+ *
5750
+ * Return: %NULL if the element ID could not be found or if
5751
+ * the element is invalid (claims to be longer than the given
5752
+ * data) or if the byte array doesn't match; otherwise return the
5753
+ * requested element struct.
5754
+ *
5755
+ * Note: There are no checks on the element length other than
5756
+ * having to fit into the given data and being large enough for the
5757
+ * byte array to match.
5758
+ */
5759
+const struct element *
5760
+cfg80211_find_elem_match(u8 eid, const u8 *ies, unsigned int len,
5761
+ const u8 *match, unsigned int match_len,
5762
+ unsigned int match_offset);
48355763
48365764 /**
48375765 * cfg80211_find_ie_match - match information element and byte array in data
....@@ -4857,9 +5785,44 @@
48575785 * having to fit into the given data and being large enough for the
48585786 * byte array to match.
48595787 */
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);
5788
+static inline const u8 *
5789
+cfg80211_find_ie_match(u8 eid, const u8 *ies, unsigned int len,
5790
+ const u8 *match, unsigned int match_len,
5791
+ unsigned int match_offset)
5792
+{
5793
+ /* match_offset can't be smaller than 2, unless match_len is
5794
+ * zero, in which case match_offset must be zero as well.
5795
+ */
5796
+ if (WARN_ON((match_len && match_offset < 2) ||
5797
+ (!match_len && match_offset)))
5798
+ return NULL;
5799
+
5800
+ return (void *)cfg80211_find_elem_match(eid, ies, len,
5801
+ match, match_len,
5802
+ match_offset ?
5803
+ match_offset - 2 : 0);
5804
+}
5805
+
5806
+/**
5807
+ * cfg80211_find_elem - find information element in data
5808
+ *
5809
+ * @eid: element ID
5810
+ * @ies: data consisting of IEs
5811
+ * @len: length of data
5812
+ *
5813
+ * Return: %NULL if the element ID could not be found or if
5814
+ * the element is invalid (claims to be longer than the given
5815
+ * data) or if the byte array doesn't match; otherwise return the
5816
+ * requested element struct.
5817
+ *
5818
+ * Note: There are no checks on the element length other than
5819
+ * having to fit into the given data.
5820
+ */
5821
+static inline const struct element *
5822
+cfg80211_find_elem(u8 eid, const u8 *ies, int len)
5823
+{
5824
+ return cfg80211_find_elem_match(eid, ies, len, NULL, 0, 0);
5825
+}
48635826
48645827 /**
48655828 * cfg80211_find_ie - find information element in data
....@@ -4879,6 +5842,28 @@
48795842 static inline const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len)
48805843 {
48815844 return cfg80211_find_ie_match(eid, ies, len, NULL, 0, 0);
5845
+}
5846
+
5847
+/**
5848
+ * cfg80211_find_ext_elem - find information element with EID Extension in data
5849
+ *
5850
+ * @ext_eid: element ID Extension
5851
+ * @ies: data consisting of IEs
5852
+ * @len: length of data
5853
+ *
5854
+ * Return: %NULL if the etended element could not be found or if
5855
+ * the element is invalid (claims to be longer than the given
5856
+ * data) or if the byte array doesn't match; otherwise return the
5857
+ * requested element struct.
5858
+ *
5859
+ * Note: There are no checks on the element length other than
5860
+ * having to fit into the given data.
5861
+ */
5862
+static inline const struct element *
5863
+cfg80211_find_ext_elem(u8 ext_eid, const u8 *ies, int len)
5864
+{
5865
+ return cfg80211_find_elem_match(WLAN_EID_EXTENSION, ies, len,
5866
+ &ext_eid, 1, 0);
48825867 }
48835868
48845869 /**
....@@ -4903,6 +5888,25 @@
49035888 }
49045889
49055890 /**
5891
+ * cfg80211_find_vendor_elem - find vendor specific information element in data
5892
+ *
5893
+ * @oui: vendor OUI
5894
+ * @oui_type: vendor-specific OUI type (must be < 0xff), negative means any
5895
+ * @ies: data consisting of IEs
5896
+ * @len: length of data
5897
+ *
5898
+ * Return: %NULL if the vendor specific element ID could not be found or if the
5899
+ * element is invalid (claims to be longer than the given data); otherwise
5900
+ * return the element structure for the requested element.
5901
+ *
5902
+ * Note: There are no checks on the element length other than having to fit into
5903
+ * the given data.
5904
+ */
5905
+const struct element *cfg80211_find_vendor_elem(unsigned int oui, int oui_type,
5906
+ const u8 *ies,
5907
+ unsigned int len);
5908
+
5909
+/**
49065910 * cfg80211_find_vendor_ie - find vendor specific information element in data
49075911 *
49085912 * @oui: vendor OUI
....@@ -4918,8 +5922,12 @@
49185922 * Note: There are no checks on the element length other than having to fit into
49195923 * the given data.
49205924 */
4921
-const u8 *cfg80211_find_vendor_ie(unsigned int oui, int oui_type,
4922
- const u8 *ies, int len);
5925
+static inline const u8 *
5926
+cfg80211_find_vendor_ie(unsigned int oui, int oui_type,
5927
+ const u8 *ies, unsigned int len)
5928
+{
5929
+ return (void *)cfg80211_find_vendor_elem(oui, oui_type, ies, len);
5930
+}
49235931
49245932 /**
49255933 * cfg80211_send_layer2_update - send layer 2 update frame
....@@ -4943,9 +5951,9 @@
49435951 * @wiphy: the wireless device giving the hint (used only for reporting
49445952 * conflicts)
49455953 * @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.
5954
+ * should be in. If @rd is set this should be NULL. Note that if you
5955
+ * set this to NULL you should still set rd->alpha2 to some accepted
5956
+ * alpha2.
49495957 *
49505958 * Wireless drivers can use this function to hint to the wireless core
49515959 * what it believes should be the current regulatory domain by
....@@ -5040,6 +6048,14 @@
50406048 * proper string representation.
50416049 */
50426050 const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
6051
+
6052
+/**
6053
+ * regulatory_pre_cac_allowed - check if pre-CAC allowed in the current regdom
6054
+ * @wiphy: wiphy for which pre-CAC capability is checked.
6055
+ *
6056
+ * Pre-CAC is allowed only in some regdomains (notable ETSI).
6057
+ */
6058
+bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
50436059
50446060 /**
50456061 * DOC: Internal regulatory db functions
....@@ -5186,6 +6202,28 @@
51866202 }
51876203
51886204 /**
6205
+ * cfg80211_is_element_inherited - returns if element ID should be inherited
6206
+ * @element: element to check
6207
+ * @non_inherit_element: non inheritance element
6208
+ */
6209
+bool cfg80211_is_element_inherited(const struct element *element,
6210
+ const struct element *non_inherit_element);
6211
+
6212
+/**
6213
+ * cfg80211_merge_profile - merges a MBSSID profile if it is split between IEs
6214
+ * @ie: ies
6215
+ * @ielen: length of IEs
6216
+ * @mbssid_elem: current MBSSID element
6217
+ * @sub_elem: current MBSSID subelement (profile)
6218
+ * @merged_ie: location of the merged profile
6219
+ * @max_copy_len: max merged profile length
6220
+ */
6221
+size_t cfg80211_merge_profile(const u8 *ie, size_t ielen,
6222
+ const struct element *mbssid_elem,
6223
+ const struct element *sub_elem,
6224
+ u8 *merged_ie, size_t max_copy_len);
6225
+
6226
+/**
51896227 * enum cfg80211_bss_frame_type - frame type that the BSS data came from
51906228 * @CFG80211_BSS_FTYPE_UNKNOWN: driver doesn't know whether the data is
51916229 * from a beacon or probe response
....@@ -5321,6 +6359,26 @@
53216359 */
53226360 void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
53236361
6362
+/**
6363
+ * cfg80211_bss_iter - iterate all BSS entries
6364
+ *
6365
+ * This function iterates over the BSS entries associated with the given wiphy
6366
+ * and calls the callback for the iterated BSS. The iterator function is not
6367
+ * allowed to call functions that might modify the internal state of the BSS DB.
6368
+ *
6369
+ * @wiphy: the wiphy
6370
+ * @chandef: if given, the iterator function will be called only if the channel
6371
+ * of the currently iterated BSS is a subset of the given channel.
6372
+ * @iter: the iterator function to call
6373
+ * @iter_data: an argument to the iterator function
6374
+ */
6375
+void cfg80211_bss_iter(struct wiphy *wiphy,
6376
+ struct cfg80211_chan_def *chandef,
6377
+ void (*iter)(struct wiphy *wiphy,
6378
+ struct cfg80211_bss *bss,
6379
+ void *data),
6380
+ void *iter_data);
6381
+
53246382 static inline enum nl80211_bss_scan_width
53256383 cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef)
53266384 {
....@@ -5370,10 +6428,12 @@
53706428 * @dev: network device
53716429 * @bss: the BSS that association was requested with, ownership of the pointer
53726430 * moves to cfg80211 in this call
5373
- * @buf: authentication frame (header + body)
6431
+ * @buf: (Re)Association Response frame (header + body)
53746432 * @len: length of the frame data
53756433 * @uapsd_queues: bitmap of queues configured for uapsd. Same format
53766434 * as the AC bitmap in the QoS info field
6435
+ * @req_ies: information elements from the (Re)Association Request frame
6436
+ * @req_ies_len: length of req_ies data
53776437 *
53786438 * After being asked to associate via cfg80211_ops::assoc() the driver must
53796439 * call either this function or cfg80211_auth_timeout().
....@@ -5383,7 +6443,8 @@
53836443 void cfg80211_rx_assoc_resp(struct net_device *dev,
53846444 struct cfg80211_bss *bss,
53856445 const u8 *buf, size_t len,
5386
- int uapsd_queues);
6446
+ int uapsd_queues,
6447
+ const u8 *req_ies, size_t req_ies_len);
53876448
53886449 /**
53896450 * cfg80211_assoc_timeout - notification of timed out association
....@@ -5421,12 +6482,16 @@
54216482 /**
54226483 * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame
54236484 * @dev: network device
5424
- * @buf: deauthentication frame (header + body)
6485
+ * @buf: received management frame (header + body)
54256486 * @len: length of the frame data
54266487 *
54276488 * This function is called whenever a received deauthentication or dissassoc
54286489 * frame has been dropped in station mode because of MFP being used but the
5429
- * frame was not protected. This function may sleep.
6490
+ * frame was not protected. This is also used to notify reception of a Beacon
6491
+ * frame that was dropped because it did not include a valid MME MIC while
6492
+ * beacon protection was enabled (BIGTK configured in station mode).
6493
+ *
6494
+ * This function may sleep.
54306495 */
54316496 void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev,
54326497 const u8 *buf, size_t len);
....@@ -5467,12 +6532,13 @@
54676532 struct ieee80211_channel *channel, gfp_t gfp);
54686533
54696534 /**
5470
- * cfg80211_notify_new_candidate - notify cfg80211 of a new mesh peer candidate
6535
+ * cfg80211_notify_new_peer_candidate - notify cfg80211 of a new mesh peer
6536
+ * candidate
54716537 *
54726538 * @dev: network device
54736539 * @macaddr: the MAC address of the new candidate
54746540 * @ie: information elements advertised by the peer candidate
5475
- * @ie_len: lenght of the information elements buffer
6541
+ * @ie_len: length of the information elements buffer
54766542 * @gfp: allocation flags
54776543 *
54786544 * This function notifies cfg80211 that the mesh peer candidate has been
....@@ -5480,7 +6546,8 @@
54806546 * cfg80211 then sends a notification to userspace.
54816547 */
54826548 void cfg80211_notify_new_peer_candidate(struct net_device *dev,
5483
- const u8 *macaddr, const u8 *ie, u8 ie_len, gfp_t gfp);
6549
+ const u8 *macaddr, const u8 *ie, u8 ie_len,
6550
+ int sig_dbm, gfp_t gfp);
54846551
54856552 /**
54866553 * DOC: RFkill integration
....@@ -5544,6 +6611,7 @@
55446611 struct wireless_dev *wdev,
55456612 enum nl80211_commands cmd,
55466613 enum nl80211_attrs attr,
6614
+ unsigned int portid,
55476615 int vendor_event_idx,
55486616 int approxlen, gfp_t gfp);
55496617
....@@ -5594,6 +6662,15 @@
55946662 int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
55956663
55966664 /**
6665
+ * cfg80211_vendor_cmd_get_sender
6666
+ * @wiphy: the wiphy
6667
+ *
6668
+ * Return the current netlink port ID in a vendor command handler.
6669
+ * Valid to call only there.
6670
+ */
6671
+unsigned int cfg80211_vendor_cmd_get_sender(struct wiphy *wiphy);
6672
+
6673
+/**
55976674 * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
55986675 * @wiphy: the wiphy
55996676 * @wdev: the wireless device
....@@ -5620,7 +6697,42 @@
56206697 {
56216698 return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
56226699 NL80211_ATTR_VENDOR_DATA,
5623
- event_idx, approxlen, gfp);
6700
+ 0, event_idx, approxlen, gfp);
6701
+}
6702
+
6703
+/**
6704
+ * cfg80211_vendor_event_alloc_ucast - alloc unicast vendor-specific event skb
6705
+ * @wiphy: the wiphy
6706
+ * @wdev: the wireless device
6707
+ * @event_idx: index of the vendor event in the wiphy's vendor_events
6708
+ * @portid: port ID of the receiver
6709
+ * @approxlen: an upper bound of the length of the data that will
6710
+ * be put into the skb
6711
+ * @gfp: allocation flags
6712
+ *
6713
+ * This function allocates and pre-fills an skb for an event to send to
6714
+ * a specific (userland) socket. This socket would previously have been
6715
+ * obtained by cfg80211_vendor_cmd_get_sender(), and the caller MUST take
6716
+ * care to register a netlink notifier to see when the socket closes.
6717
+ *
6718
+ * If wdev != NULL, both the ifindex and identifier of the specified
6719
+ * wireless device are added to the event message before the vendor data
6720
+ * attribute.
6721
+ *
6722
+ * When done filling the skb, call cfg80211_vendor_event() with the
6723
+ * skb to send the event.
6724
+ *
6725
+ * Return: An allocated and pre-filled skb. %NULL if any errors happen.
6726
+ */
6727
+static inline struct sk_buff *
6728
+cfg80211_vendor_event_alloc_ucast(struct wiphy *wiphy,
6729
+ struct wireless_dev *wdev,
6730
+ unsigned int portid, int approxlen,
6731
+ int event_idx, gfp_t gfp)
6732
+{
6733
+ return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
6734
+ NL80211_ATTR_VENDOR_DATA,
6735
+ portid, event_idx, approxlen, gfp);
56246736 }
56256737
56266738 /**
....@@ -5720,7 +6832,7 @@
57206832 cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp)
57216833 {
57226834 return __cfg80211_alloc_event_skb(wiphy, NULL, NL80211_CMD_TESTMODE,
5723
- NL80211_ATTR_TESTDATA, -1,
6835
+ NL80211_ATTR_TESTDATA, 0, -1,
57246836 approxlen, gfp);
57256837 }
57266838
....@@ -5782,8 +6894,11 @@
57826894 * case.
57836895 * @bssid: The BSSID of the AP (may be %NULL)
57846896 * @bss: Entry of bss to which STA got connected to, can be obtained through
5785
- * cfg80211_get_bss() (may be %NULL). Only one parameter among @bssid and
5786
- * @bss needs to be specified.
6897
+ * cfg80211_get_bss() (may be %NULL). But it is recommended to store the
6898
+ * bss from the connect_request and hold a reference to it and return
6899
+ * through this param to avoid a warning if the bss is expired during the
6900
+ * connection, esp. for those drivers implementing connect op.
6901
+ * Only one parameter among @bssid and @bss needs to be specified.
57876902 * @req_ie: Association request IEs (may be %NULL)
57886903 * @req_ie_len: Association request IEs length
57896904 * @resp_ie: Association response IEs (may be %NULL)
....@@ -5831,8 +6946,12 @@
58316946 *
58326947 * @dev: network device
58336948 * @bssid: the BSSID of the AP
5834
- * @bss: entry of bss to which STA got connected to, can be obtained
5835
- * through cfg80211_get_bss (may be %NULL)
6949
+ * @bss: Entry of bss to which STA got connected to, can be obtained through
6950
+ * cfg80211_get_bss() (may be %NULL). But it is recommended to store the
6951
+ * bss from the connect_request and hold a reference to it and return
6952
+ * through this param to avoid a warning if the bss is expired during the
6953
+ * connection, esp. for those drivers implementing connect op.
6954
+ * Only one parameter among @bssid and @bss needs to be specified.
58366955 * @req_ie: association request IEs (maybe be %NULL)
58376956 * @req_ie_len: association request IEs length
58386957 * @resp_ie: association response IEs (may be %NULL)
....@@ -5979,7 +7098,7 @@
59797098 * time it is accessed in __cfg80211_roamed() due to delay in scheduling
59807099 * rdev->event_work. In case of any failures, the reference is released
59817100 * either in cfg80211_roamed() or in __cfg80211_romed(), Otherwise, it will be
5982
- * released while diconneting from the current bss.
7101
+ * released while disconnecting from the current bss.
59837102 */
59847103 void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
59857104 gfp_t gfp);
....@@ -6041,6 +7160,16 @@
60417160 void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
60427161 struct ieee80211_channel *chan,
60437162 gfp_t gfp);
7163
+
7164
+/**
7165
+ * cfg80211_tx_mgmt_expired - tx_mgmt duration expired
7166
+ * @wdev: wireless device
7167
+ * @cookie: the requested cookie
7168
+ * @chan: The current channel (from tx_mgmt request)
7169
+ * @gfp: allocation flags
7170
+ */
7171
+void cfg80211_tx_mgmt_expired(struct wireless_dev *wdev, u64 cookie,
7172
+ struct ieee80211_channel *chan, gfp_t gfp);
60447173
60457174 /**
60467175 * cfg80211_sinfo_alloc_tid_stats - allocate per-tid statistics.
....@@ -6117,6 +7246,26 @@
61177246 gfp_t gfp);
61187247
61197248 /**
7249
+ * cfg80211_rx_mgmt_khz - notification of received, unprocessed management frame
7250
+ * @wdev: wireless device receiving the frame
7251
+ * @freq: Frequency on which the frame was received in KHz
7252
+ * @sig_dbm: signal strength in dBm, or 0 if unknown
7253
+ * @buf: Management frame (header + body)
7254
+ * @len: length of the frame data
7255
+ * @flags: flags, as defined in enum nl80211_rxmgmt_flags
7256
+ *
7257
+ * This function is called whenever an Action frame is received for a station
7258
+ * mode interface, but is not processed in kernel.
7259
+ *
7260
+ * Return: %true if a user space application has registered for this frame.
7261
+ * For action frames, that makes it responsible for rejecting unrecognized
7262
+ * action frames; %false otherwise, in which case for action frames the
7263
+ * driver is responsible for rejecting the frame.
7264
+ */
7265
+bool cfg80211_rx_mgmt_khz(struct wireless_dev *wdev, int freq, int sig_dbm,
7266
+ const u8 *buf, size_t len, u32 flags);
7267
+
7268
+/**
61207269 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
61217270 * @wdev: wireless device receiving the frame
61227271 * @freq: Frequency on which the frame was received in MHz
....@@ -6133,8 +7282,13 @@
61337282 * action frames; %false otherwise, in which case for action frames the
61347283 * driver is responsible for rejecting the frame.
61357284 */
6136
-bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
6137
- const u8 *buf, size_t len, u32 flags);
7285
+static inline bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq,
7286
+ int sig_dbm, const u8 *buf, size_t len,
7287
+ u32 flags)
7288
+{
7289
+ return cfg80211_rx_mgmt_khz(wdev, MHZ_TO_KHZ(freq), sig_dbm, buf, len,
7290
+ flags);
7291
+}
61387292
61397293 /**
61407294 * cfg80211_mgmt_tx_status - notification of TX status for management frame
....@@ -6152,6 +7306,23 @@
61527306 void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
61537307 const u8 *buf, size_t len, bool ack, gfp_t gfp);
61547308
7309
+/**
7310
+ * cfg80211_control_port_tx_status - notification of TX status for control
7311
+ * port frames
7312
+ * @wdev: wireless device receiving the frame
7313
+ * @cookie: Cookie returned by cfg80211_ops::tx_control_port()
7314
+ * @buf: Data frame (header + body)
7315
+ * @len: length of the frame data
7316
+ * @ack: Whether frame was acknowledged
7317
+ * @gfp: context flags
7318
+ *
7319
+ * This function is called whenever a control port frame was requested to be
7320
+ * transmitted with cfg80211_ops::tx_control_port() to report the TX status of
7321
+ * the transmission attempt.
7322
+ */
7323
+void cfg80211_control_port_tx_status(struct wireless_dev *wdev, u64 cookie,
7324
+ const u8 *buf, size_t len, bool ack,
7325
+ gfp_t gfp);
61557326
61567327 /**
61577328 * cfg80211_rx_control_port - notification about a received control port frame
....@@ -6333,6 +7504,21 @@
63337504 bool is_valid_ack_signal, gfp_t gfp);
63347505
63357506 /**
7507
+ * cfg80211_report_obss_beacon_khz - report beacon from other APs
7508
+ * @wiphy: The wiphy that received the beacon
7509
+ * @frame: the frame
7510
+ * @len: length of the frame
7511
+ * @freq: frequency the frame was received on in KHz
7512
+ * @sig_dbm: signal strength in dBm, or 0 if unknown
7513
+ *
7514
+ * Use this function to report to userspace when a beacon was
7515
+ * received. It is not useful to call this when there is no
7516
+ * netdev that is in AP/GO mode.
7517
+ */
7518
+void cfg80211_report_obss_beacon_khz(struct wiphy *wiphy, const u8 *frame,
7519
+ size_t len, int freq, int sig_dbm);
7520
+
7521
+/**
63367522 * cfg80211_report_obss_beacon - report beacon from other APs
63377523 * @wiphy: The wiphy that received the beacon
63387524 * @frame: the frame
....@@ -6344,9 +7530,13 @@
63447530 * received. It is not useful to call this when there is no
63457531 * netdev that is in AP/GO mode.
63467532 */
6347
-void cfg80211_report_obss_beacon(struct wiphy *wiphy,
6348
- const u8 *frame, size_t len,
6349
- int freq, int sig_dbm);
7533
+static inline void cfg80211_report_obss_beacon(struct wiphy *wiphy,
7534
+ const u8 *frame, size_t len,
7535
+ int freq, int sig_dbm)
7536
+{
7537
+ cfg80211_report_obss_beacon_khz(wiphy, frame, len, MHZ_TO_KHZ(freq),
7538
+ sig_dbm);
7539
+}
63507540
63517541 /**
63527542 * cfg80211_reg_can_beacon - check if beaconing is allowed
....@@ -6425,6 +7615,19 @@
64257615 bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef,
64267616 u8 *op_class);
64277617
7618
+/**
7619
+ * ieee80211_chandef_to_khz - convert chandef to frequency in KHz
7620
+ *
7621
+ * @chandef: the chandef to convert
7622
+ *
7623
+ * Returns the center frequency of chandef (1st segment) in KHz.
7624
+ */
7625
+static inline u32
7626
+ieee80211_chandef_to_khz(const struct cfg80211_chan_def *chandef)
7627
+{
7628
+ return MHZ_TO_KHZ(chandef->center_freq1) + chandef->freq1_offset;
7629
+}
7630
+
64287631 /*
64297632 * cfg80211_tdls_oper_request - request userspace to perform TDLS operation
64307633 * @dev: the device on which the operation is requested
....@@ -6469,7 +7672,7 @@
64697672 void cfg80211_unregister_wdev(struct wireless_dev *wdev);
64707673
64717674 /**
6472
- * struct cfg80211_ft_event - FT Information Elements
7675
+ * struct cfg80211_ft_event_params - FT Information Elements
64737676 * @ies: FT IEs
64747677 * @ies_len: length of the FT IE in bytes
64757678 * @target_ap: target AP's MAC address
....@@ -6601,13 +7804,6 @@
66017804 * by .crit_proto_start() has expired.
66027805 */
66037806 void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
6604
-
6605
-/**
6606
- * cfg80211_ap_stopped - notify userspace that AP mode stopped
6607
- * @netdev: network device
6608
- * @gfp: context flags
6609
- */
6610
-void cfg80211_ap_stopped(struct net_device *netdev, gfp_t gfp);
66117807
66127808 /**
66137809 * ieee80211_get_num_supported_channels - get number of channels device has
....@@ -6790,6 +7986,31 @@
67907986 gfp_t gfp);
67917987
67927988 /**
7989
+ * cfg80211_pmsr_report - report peer measurement result data
7990
+ * @wdev: the wireless device reporting the measurement
7991
+ * @req: the original measurement request
7992
+ * @result: the result data
7993
+ * @gfp: allocation flags
7994
+ */
7995
+void cfg80211_pmsr_report(struct wireless_dev *wdev,
7996
+ struct cfg80211_pmsr_request *req,
7997
+ struct cfg80211_pmsr_result *result,
7998
+ gfp_t gfp);
7999
+
8000
+/**
8001
+ * cfg80211_pmsr_complete - report peer measurement completed
8002
+ * @wdev: the wireless device reporting the measurement
8003
+ * @req: the original measurement request
8004
+ * @gfp: allocation flags
8005
+ *
8006
+ * Report that the entire measurement completed, after this
8007
+ * the request pointer will no longer be valid.
8008
+ */
8009
+void cfg80211_pmsr_complete(struct wireless_dev *wdev,
8010
+ struct cfg80211_pmsr_request *req,
8011
+ gfp_t gfp);
8012
+
8013
+/**
67938014 * cfg80211_iftype_allowed - check whether the interface can be allowed
67948015 * @wiphy: the wiphy
67958016 * @iftype: interface type
....@@ -6825,6 +8046,11 @@
68258046 #define wiphy_info(wiphy, format, args...) \
68268047 dev_info(&(wiphy)->dev, format, ##args)
68278048
8049
+#define wiphy_err_ratelimited(wiphy, format, args...) \
8050
+ dev_err_ratelimited(&(wiphy)->dev, format, ##args)
8051
+#define wiphy_warn_ratelimited(wiphy, format, args...) \
8052
+ dev_warn_ratelimited(&(wiphy)->dev, format, ##args)
8053
+
68288054 #define wiphy_debug(wiphy, format, args...) \
68298055 wiphy_printk(KERN_DEBUG, wiphy, format, ##args)
68308056
....@@ -6860,4 +8086,10 @@
68608086 struct cfg80211_update_owe_info *owe_info,
68618087 gfp_t gfp);
68628088
8089
+/**
8090
+ * cfg80211_bss_flush - resets all the scan entries
8091
+ * @wiphy: the wiphy
8092
+ */
8093
+void cfg80211_bss_flush(struct wiphy *wiphy);
8094
+
68638095 #endif /* __NET_CFG80211_H */