aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys
diff options
context:
space:
mode:
Diffstat (limited to 'package/kernel/mac80211/patches/subsys')
-rw-r--r--package/kernel/mac80211/patches/subsys/030-mac80211_fix-scan-when-operating-on-DFS-channels-in-ETSI-domains.patch4
-rw-r--r--package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch6
-rw-r--r--package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch2
-rw-r--r--package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch2
-rw-r--r--package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch2
-rw-r--r--package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch6
-rw-r--r--package/kernel/mac80211/patches/subsys/210-ap_scan.patch2
-rw-r--r--package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch16
-rw-r--r--package/kernel/mac80211/patches/subsys/310-mac80211-minstrel_ht-fix-per-group-max-throughput-ra.patch22
-rw-r--r--package/kernel/mac80211/patches/subsys/311-mac80211-minstrel_ht-reduce-unnecessary-rate-probing.patch42
-rw-r--r--package/kernel/mac80211/patches/subsys/312-mac80211-minstrel_ht-fix-default-max-throughput-rate.patch46
-rw-r--r--package/kernel/mac80211/patches/subsys/313-mac80211-minstrel_ht-improve-rate-probing-for-device.patch481
-rw-r--r--package/kernel/mac80211/patches/subsys/314-mac80211-add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch58
-rw-r--r--package/kernel/mac80211/patches/subsys/315-mac80211-minstrel_ht-fix-infinite-loop-because-suppo.patch25
-rw-r--r--package/kernel/mac80211/patches/subsys/350-cfg80211-add-local-BSS-receive-time-to-survey-inform.patch77
-rw-r--r--package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch32
16 files changed, 36 insertions, 787 deletions
diff --git a/package/kernel/mac80211/patches/subsys/030-mac80211_fix-scan-when-operating-on-DFS-channels-in-ETSI-domains.patch b/package/kernel/mac80211/patches/subsys/030-mac80211_fix-scan-when-operating-on-DFS-channels-in-ETSI-domains.patch
index 7bba7176cb..560f8850df 100644
--- a/package/kernel/mac80211/patches/subsys/030-mac80211_fix-scan-when-operating-on-DFS-channels-in-ETSI-domains.patch
+++ b/package/kernel/mac80211/patches/subsys/030-mac80211_fix-scan-when-operating-on-DFS-channels-in-ETSI-domains.patch
@@ -25,7 +25,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -5451,6 +5451,14 @@ const struct ieee80211_reg_rule *freq_re
+@@ -5554,6 +5554,14 @@ const struct ieee80211_reg_rule *freq_re
const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
/**
@@ -91,7 +91,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
if (!ieee80211_can_scan(local, sdata)) {
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
-@@ -3866,6 +3866,7 @@ bool regulatory_pre_cac_allowed(struct w
+@@ -3883,6 +3883,7 @@ bool regulatory_pre_cac_allowed(struct w
return pre_cac_allowed;
}
diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
index f5ec895f0b..5fe7616143 100644
--- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
+++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
@@ -476,7 +476,7 @@
}
ieee80211_tx_result
-@@ -1124,9 +1125,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
+@@ -1128,9 +1129,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
struct ieee80211_key *key = tx->key;
struct ieee80211_mmie_16 *mmie;
struct ieee80211_hdr *hdr;
@@ -488,7 +488,7 @@
if (WARN_ON(skb_queue_len(&tx->skbs) != 1))
return TX_DROP;
-@@ -1172,7 +1173,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
+@@ -1176,7 +1177,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_key *key = rx->key;
struct ieee80211_mmie_16 *mmie;
@@ -687,7 +687,7 @@
#endif /* AES_GMAC_H */
--- a/net/mac80211/key.h
+++ b/net/mac80211/key.h
-@@ -87,7 +87,7 @@ struct ieee80211_key {
+@@ -88,7 +88,7 @@ struct ieee80211_key {
* Management frames.
*/
u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN];
diff --git a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
index dcc0ac4dfb..8e0fddd10a 100644
--- a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
+++ b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch
@@ -2,7 +2,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -1169,7 +1169,6 @@ static int ieee80211_stop_ap(struct wiph
+@@ -1172,7 +1172,6 @@ static int ieee80211_stop_ap(struct wiph
sdata->vif.bss_conf.ftmr_params = NULL;
__sta_info_flush(sdata, true);
diff --git a/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch b/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch
index 9830602ab0..02e523878e 100644
--- a/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch
+++ b/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch
@@ -188,7 +188,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif /* AES_CMAC_H */
--- a/net/mac80211/key.h
+++ b/net/mac80211/key.h
-@@ -92,7 +92,7 @@ struct ieee80211_key {
+@@ -93,7 +93,7 @@ struct ieee80211_key {
} ccmp;
struct {
u8 rx_pn[IEEE80211_CMAC_PN_LEN];
diff --git a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch
index 449179a962..e56b08d0fe 100644
--- a/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch
+++ b/package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch
@@ -1,6 +1,6 @@
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
-@@ -4012,6 +4012,12 @@ out:
+@@ -4015,6 +4015,12 @@ out:
netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
index 14ef714f68..ab845c04e5 100644
--- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
+++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
@@ -18,7 +18,7 @@
static int ieee80211_ifa6_changed(struct notifier_block *nb,
unsigned long data, void *arg)
{
-@@ -1269,14 +1269,14 @@ int ieee80211_register_hw(struct ieee802
+@@ -1264,14 +1264,14 @@ int ieee80211_register_hw(struct ieee802
rtnl_unlock();
@@ -35,7 +35,7 @@
local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
result = register_inet6addr_notifier(&local->ifa6_notifier);
if (result)
-@@ -1285,13 +1285,13 @@ int ieee80211_register_hw(struct ieee802
+@@ -1280,13 +1280,13 @@ int ieee80211_register_hw(struct ieee802
return 0;
@@ -52,7 +52,7 @@
fail_ifa:
#endif
rtnl_lock();
-@@ -1319,10 +1319,10 @@ void ieee80211_unregister_hw(struct ieee
+@@ -1314,10 +1314,10 @@ void ieee80211_unregister_hw(struct ieee
tasklet_kill(&local->tx_pending_tasklet);
tasklet_kill(&local->tasklet);
diff --git a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
index 11115f45bc..32f4ac07db 100644
--- a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
+++ b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch
@@ -1,6 +1,6 @@
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -2314,7 +2314,7 @@ static int ieee80211_scan(struct wiphy *
+@@ -2317,7 +2317,7 @@ static int ieee80211_scan(struct wiphy *
* the frames sent while scanning on other channel will be
* lost)
*/
diff --git a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch
index b0c527a68c..f4b7e8a1c3 100644
--- a/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch
+++ b/package/kernel/mac80211/patches/subsys/300-mac80211-optimize-skb-resizing.patch
@@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
-@@ -1779,6 +1779,9 @@ int ieee80211_tx_control_port(struct wip
+@@ -1782,6 +1782,9 @@ int ieee80211_tx_control_port(struct wip
const u8 *dest, __be16 proto, bool unencrypted);
int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
const u8 *buf, size_t len);
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
-@@ -655,6 +655,11 @@ void ieee80211_tx_monitor(struct ieee802
+@@ -815,6 +815,11 @@ void ieee80211_tx_monitor(struct ieee802
struct net_device *prev_dev = NULL;
int rtap_len;
@@ -46,11 +46,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ }
+
/* send frame to monitor interfaces now */
- rtap_len = ieee80211_tx_radiotap_len(info);
+ rtap_len = ieee80211_tx_radiotap_len(info, status);
if (WARN_ON_ONCE(skb_headroom(skb) < rtap_len)) {
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
-@@ -1936,37 +1936,53 @@ static bool ieee80211_tx(struct ieee8021
+@@ -1937,37 +1937,53 @@ static bool ieee80211_tx(struct ieee8021
}
/* device xmit handlers */
@@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
wiphy_debug(local->hw.wiphy,
"failed to reallocate TX buffer\n");
return -ENOMEM;
-@@ -1982,18 +1998,8 @@ void ieee80211_xmit(struct ieee80211_sub
+@@ -1983,18 +1999,8 @@ void ieee80211_xmit(struct ieee80211_sub
struct ieee80211_local *local = sdata->local;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_hdr *hdr;
@@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
ieee80211_free_txskb(&local->hw, skb);
return;
}
-@@ -2774,29 +2780,13 @@ static struct sk_buff *ieee80211_build_h
+@@ -2775,29 +2781,13 @@ static struct sk_buff *ieee80211_build_h
}
skb_pull(skb, skip_header_bytes);
@@ -179,7 +179,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
if (encaps_data)
-@@ -3411,7 +3401,6 @@ static bool ieee80211_xmit_fast(struct i
+@@ -3412,7 +3402,6 @@ static bool ieee80211_xmit_fast(struct i
struct ieee80211_local *local = sdata->local;
u16 ethertype = (skb->data[12] << 8) | skb->data[13];
int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2);
@@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct ethhdr eth;
struct ieee80211_tx_info *info;
struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
-@@ -3463,10 +3452,7 @@ static bool ieee80211_xmit_fast(struct i
+@@ -3464,10 +3453,7 @@ static bool ieee80211_xmit_fast(struct i
* as the may-encrypt argument for the resize to not account for
* more room than we already have in 'extra_head'
*/
diff --git a/package/kernel/mac80211/patches/subsys/310-mac80211-minstrel_ht-fix-per-group-max-throughput-ra.patch b/package/kernel/mac80211/patches/subsys/310-mac80211-minstrel_ht-fix-per-group-max-throughput-ra.patch
deleted file mode 100644
index d971d84178..0000000000
--- a/package/kernel/mac80211/patches/subsys/310-mac80211-minstrel_ht-fix-per-group-max-throughput-ra.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 14 Jun 2019 21:12:04 +0200
-Subject: [PATCH] mac80211: minstrel_ht: fix per-group max throughput rate
- initialization
-
-The group number needs to be multiplied by the number of rates per group
-to get the full rate index
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -575,7 +575,7 @@ minstrel_ht_update_stats(struct minstrel
-
- /* (re)Initialize group rate indexes */
- for(j = 0; j < MAX_THR_RATES; j++)
-- tmp_group_tp_rate[j] = group;
-+ tmp_group_tp_rate[j] = MCS_GROUP_RATES * group;
-
- for (i = 0; i < MCS_GROUP_RATES; i++) {
- if (!(mi->supported[group] & BIT(i)))
diff --git a/package/kernel/mac80211/patches/subsys/311-mac80211-minstrel_ht-reduce-unnecessary-rate-probing.patch b/package/kernel/mac80211/patches/subsys/311-mac80211-minstrel_ht-reduce-unnecessary-rate-probing.patch
deleted file mode 100644
index 11f6ead13d..0000000000
--- a/package/kernel/mac80211/patches/subsys/311-mac80211-minstrel_ht-reduce-unnecessary-rate-probing.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Wed, 5 Jun 2019 20:42:49 +0200
-Subject: [PATCH] mac80211: minstrel_ht: reduce unnecessary rate probing
- attempts
-
-On hardware with static fallback tables (e.g. mt76x2), rate probing attempts
-can be very expensive.
-On such devices, avoid sampling rates slower than the per-group max throughput
-rate, based on the assumption that the fallback table will take care of probing
-lower rates within that group if the higher rates fail.
-To make this work, this also fixes a wrong initialization in the previously
-unused per-group sorted rate array.
-To further reduce unnecessary probing attempts, skip duplicate attempts on
-rates slower than the max throughput rate.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1059,6 +1059,21 @@ minstrel_get_sample_rate(struct minstrel
- minstrel_get_duration(mi->max_prob_rate) * 3 < sample_dur)
- return -1;
-
-+
-+ /*
-+ * For devices with no configurable multi-rate retry, skip sampling
-+ * below the per-group max throughput rate, and only use one sampling
-+ * attempt per rate
-+ */
-+ if (mp->hw->max_rates == 1 &&
-+ (minstrel_get_duration(mg->max_group_tp_rate[0]) < sample_dur ||
-+ mrs->attempts))
-+ return -1;
-+
-+ /* Skip already sampled slow rates */
-+ if (sample_dur >= minstrel_get_duration(tp_rate1) && mrs->attempts)
-+ return -1;
-+
- /*
- * Make sure that lower rates get sampled only occasionally,
- * if the link is working perfectly.
diff --git a/package/kernel/mac80211/patches/subsys/312-mac80211-minstrel_ht-fix-default-max-throughput-rate.patch b/package/kernel/mac80211/patches/subsys/312-mac80211-minstrel_ht-fix-default-max-throughput-rate.patch
deleted file mode 100644
index 9855c35a5d..0000000000
--- a/package/kernel/mac80211/patches/subsys/312-mac80211-minstrel_ht-fix-default-max-throughput-rate.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 14 Jun 2019 21:14:22 +0200
-Subject: [PATCH] mac80211: minstrel_ht: fix default max throughput rate
- indexes
-
-Use the first supported rate instead of 0 (which can be invalid)
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -486,7 +486,7 @@ minstrel_ht_assign_best_tp_rates(struct
- tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_ewma;
- tmp_mcs_tp = minstrel_ht_get_tp_avg(mi, tmp_group, tmp_idx, tmp_prob);
-
-- if (tmp_cck_tp > tmp_mcs_tp) {
-+ if (tmp_cck_tp_rate && tmp_cck_tp > tmp_mcs_tp) {
- for(i = 0; i < MAX_THR_RATES; i++) {
- minstrel_ht_sort_best_tp_rates(mi, tmp_cck_tp_rate[i],
- tmp_mcs_tp_rate);
-@@ -558,11 +558,19 @@ minstrel_ht_update_stats(struct minstrel
- mi->sample_slow = 0;
- mi->sample_count = 0;
-
-- /* Initialize global rate indexes */
-- for(j = 0; j < MAX_THR_RATES; j++){
-- tmp_mcs_tp_rate[j] = 0;
-- tmp_cck_tp_rate[j] = 0;
-- }
-+ memset(tmp_mcs_tp_rate, 0, sizeof(tmp_mcs_tp_rate));
-+ memset(tmp_cck_tp_rate, 0, sizeof(tmp_cck_tp_rate));
-+ if (mi->supported[MINSTREL_CCK_GROUP])
-+ for (j = 0; j < ARRAY_SIZE(tmp_cck_tp_rate); j++)
-+ tmp_cck_tp_rate[j] = MINSTREL_CCK_GROUP * MCS_GROUP_RATES;
-+
-+ if (mi->supported[MINSTREL_VHT_GROUP_0])
-+ index = MINSTREL_VHT_GROUP_0 * MCS_GROUP_RATES;
-+ else
-+ index = MINSTREL_HT_GROUP_0 * MCS_GROUP_RATES;
-+
-+ for (j = 0; j < ARRAY_SIZE(tmp_mcs_tp_rate); j++)
-+ tmp_mcs_tp_rate[j] = index;
-
- /* Find best rate sets within all MCS groups*/
- for (group = 0; group < ARRAY_SIZE(minstrel_mcs_groups); group++) {
diff --git a/package/kernel/mac80211/patches/subsys/313-mac80211-minstrel_ht-improve-rate-probing-for-device.patch b/package/kernel/mac80211/patches/subsys/313-mac80211-minstrel_ht-improve-rate-probing-for-device.patch
deleted file mode 100644
index 5b8e608b0a..0000000000
--- a/package/kernel/mac80211/patches/subsys/313-mac80211-minstrel_ht-improve-rate-probing-for-device.patch
+++ /dev/null
@@ -1,481 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Fri, 14 Jun 2019 21:15:47 +0200
-Subject: [PATCH] mac80211: minstrel_ht: improve rate probing for devices
- with static fallback
-
-On some devices that only support static rate fallback tables sending rate
-control probing packets can be really expensive.
-Probing lower rates can already hurt throughput quite a bit. What hurts even
-more is the fact that on mt76x0/mt76x2, single probing packets can only be
-forced by directing packets at a different internal hardware queue, which
-causes some heavy reordering and extra latency.
-The reordering issue is mainly problematic while pushing lots of packets to
-a particular station. If there is little activity, the overhead of probing is
-neglegible.
-
-The static fallback behavior is designed to pretty much only handle rate
-control algorithms that use only a very limited set of rates on which the
-algorithm switches up/down based on packet error rate.
-
-In order to better support that kind of hardware, this patch implements a
-different approach to rate probing where it switches to a slightly higher rate,
-waits for tx status feedback, then updates the stats and switches back to
-the new max throughput rate. This only triggers above a packet rate of 100
-per stats interval (~50ms).
-For that kind of probing, the code has to reduce the set of probing rates
-a lot more compared to single packet probing, so it uses only one packet
-per MCS group which is either slightly faster, or as close as possible to
-the max throughput rate.
-This allows switching between similar rates with different numbers of
-streams. The algorithm assumes that the hardware will work its way lower
-within an MCS group in case of retransmissions, so that lower rates don't
-have to be probed by the high packets per second rate probing code.
-
-To further reduce the search space, it also does not probe rates with lower
-channel bandwidth than the max throughput rate.
-
-At the moment, these changes will only affect mt76x0/mt76x2.
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel.h
-+++ b/net/mac80211/rc80211_minstrel.h
-@@ -95,6 +95,7 @@ struct minstrel_sta_info {
- struct minstrel_priv {
- struct ieee80211_hw *hw;
- bool has_mrr;
-+ u32 sample_switch;
- unsigned int cw_min;
- unsigned int cw_max;
- unsigned int max_retry;
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -18,6 +18,8 @@
- #define AVG_AMPDU_SIZE 16
- #define AVG_PKT_SIZE 1200
-
-+#define SAMPLE_SWITCH_THR 100
-+
- /* Number of bits for an average sized packet */
- #define MCS_NBITS ((AVG_PKT_SIZE * AVG_AMPDU_SIZE) << 3)
-
-@@ -58,6 +60,7 @@
- [GROUP_IDX(_streams, _sgi, _ht40)] = { \
- .streams = _streams, \
- .shift = _s, \
-+ .bw = _ht40, \
- .flags = \
- IEEE80211_TX_RC_MCS | \
- (_sgi ? IEEE80211_TX_RC_SHORT_GI : 0) | \
-@@ -94,6 +97,7 @@
- [VHT_GROUP_IDX(_streams, _sgi, _bw)] = { \
- .streams = _streams, \
- .shift = _s, \
-+ .bw = _bw, \
- .flags = \
- IEEE80211_TX_RC_VHT_MCS | \
- (_sgi ? IEEE80211_TX_RC_SHORT_GI : 0) | \
-@@ -526,6 +530,133 @@ minstrel_ht_prob_rate_reduce_streams(str
- }
- }
-
-+static inline int
-+minstrel_get_duration(int index)
-+{
-+ const struct mcs_group *group = &minstrel_mcs_groups[index / MCS_GROUP_RATES];
-+ unsigned int duration = group->duration[index % MCS_GROUP_RATES];
-+ return duration << group->shift;
-+}
-+
-+static bool
-+minstrel_ht_probe_group(struct minstrel_ht_sta *mi, const struct mcs_group *tp_group,
-+ int tp_idx, const struct mcs_group *group)
-+{
-+ if (group->bw < tp_group->bw)
-+ return false;
-+
-+ if (group->streams == tp_group->streams)
-+ return true;
-+
-+ if (tp_idx < 4 && group->streams == tp_group->streams - 1)
-+ return true;
-+
-+ return group->streams == tp_group->streams + 1;
-+}
-+
-+static void
-+minstrel_ht_find_probe_rates(struct minstrel_ht_sta *mi, u16 *rates, int *n_rates,
-+ bool faster_rate)
-+{
-+ const struct mcs_group *group, *tp_group;
-+ int i, g, max_dur;
-+ int tp_idx;
-+
-+ tp_group = &minstrel_mcs_groups[mi->max_tp_rate[0] / MCS_GROUP_RATES];
-+ tp_idx = mi->max_tp_rate[0] % MCS_GROUP_RATES;
-+
-+ max_dur = minstrel_get_duration(mi->max_tp_rate[0]);
-+ if (faster_rate)
-+ max_dur -= max_dur / 16;
-+
-+ for (g = 0; g < MINSTREL_GROUPS_NB; g++) {
-+ u16 supported = mi->supported[g];
-+
-+ if (!supported)
-+ continue;
-+
-+ group = &minstrel_mcs_groups[g];
-+ if (!minstrel_ht_probe_group(mi, tp_group, tp_idx, group))
-+ continue;
-+
-+ for (i = 0; supported; supported >>= 1, i++) {
-+ int idx;
-+
-+ if (!(supported & 1))
-+ continue;
-+
-+ if ((group->duration[i] << group->shift) > max_dur)
-+ continue;
-+
-+ idx = g * MCS_GROUP_RATES + i;
-+ if (idx == mi->max_tp_rate[0])
-+ continue;
-+
-+ rates[(*n_rates)++] = idx;
-+ break;
-+ }
-+ }
-+}
-+
-+static void
-+minstrel_ht_rate_sample_switch(struct minstrel_priv *mp,
-+ struct minstrel_ht_sta *mi)
-+{
-+ struct minstrel_rate_stats *mrs;
-+ u16 rates[MINSTREL_GROUPS_NB];
-+ int n_rates = 0;
-+ int probe_rate = 0;
-+ bool faster_rate;
-+ int i;
-+ u8 random;
-+
-+ /*
-+ * Use rate switching instead of probing packets for devices with
-+ * little control over retry fallback behavior
-+ */
-+ if (mp->hw->max_rates > 1)
-+ return;
-+
-+ /*
-+ * If the current EWMA prob is >75%, look for a rate that's 6.25%
-+ * faster than the max tp rate.
-+ * If that fails, look again for a rate that is at least as fast
-+ */
-+ mrs = minstrel_get_ratestats(mi, mi->max_tp_rate[0]);
-+ faster_rate = mrs->prob_ewma > MINSTREL_FRAC(75, 100);
-+ minstrel_ht_find_probe_rates(mi, rates, &n_rates, faster_rate);
-+ if (!n_rates && faster_rate)
-+ minstrel_ht_find_probe_rates(mi, rates, &n_rates, false);
-+
-+ /* If no suitable rate was found, try to pick the next one in the group */
-+ if (!n_rates) {
-+ int g_idx = mi->max_tp_rate[0] / MCS_GROUP_RATES;
-+ u16 supported = mi->supported[g_idx];
-+
-+ supported >>= mi->max_tp_rate[0] % MCS_GROUP_RATES;
-+ for (i = 0; supported; i++) {
-+ if (!(supported & 1))
-+ continue;
-+
-+ probe_rate = mi->max_tp_rate[0] + i;
-+ goto out;
-+ }
-+
-+ return;
-+ }
-+
-+ i = 0;
-+ if (n_rates > 1) {
-+ random = prandom_u32();
-+ i = random % n_rates;
-+ }
-+ probe_rate = rates[i];
-+
-+out:
-+ mi->sample_rate = probe_rate;
-+ mi->sample_mode = MINSTREL_SAMPLE_ACTIVE;
-+}
-+
- /*
- * Update rate statistics and select new primary rates
- *
-@@ -536,7 +667,8 @@ minstrel_ht_prob_rate_reduce_streams(str
- * higher throughput rates, even if the probablity is a bit lower
- */
- static void
--minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
-+minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
-+ bool sample)
- {
- struct minstrel_mcs_group_data *mg;
- struct minstrel_rate_stats *mrs;
-@@ -544,6 +676,18 @@ minstrel_ht_update_stats(struct minstrel
- u16 tmp_mcs_tp_rate[MAX_THR_RATES], tmp_group_tp_rate[MAX_THR_RATES];
- u16 tmp_cck_tp_rate[MAX_THR_RATES], index;
-
-+ mi->sample_mode = MINSTREL_SAMPLE_IDLE;
-+
-+ if (sample) {
-+ mi->total_packets_cur = mi->total_packets -
-+ mi->total_packets_last;
-+ mi->total_packets_last = mi->total_packets;
-+ }
-+ if (!mp->sample_switch)
-+ sample = false;
-+ if (mi->total_packets_cur < SAMPLE_SWITCH_THR && mp->sample_switch != 1)
-+ sample = false;
-+
- if (mi->ampdu_packets > 0) {
- if (!ieee80211_hw_check(mp->hw, TX_STATUS_NO_AMPDU_LEN))
- mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len,
-@@ -630,12 +774,16 @@ minstrel_ht_update_stats(struct minstrel
- /* try to sample all available rates during each interval */
- mi->sample_count *= 8;
-
-+ if (sample)
-+ minstrel_ht_rate_sample_switch(mp, mi);
-+
- #ifdef CPTCFG_MAC80211_DEBUGFS
- /* use fixed index if set */
- if (mp->fixed_rate_idx != -1) {
- for (i = 0; i < 4; i++)
- mi->max_tp_rate[i] = mp->fixed_rate_idx;
- mi->max_prob_rate = mp->fixed_rate_idx;
-+ mi->sample_mode = MINSTREL_SAMPLE_IDLE;
- }
- #endif
-
-@@ -739,15 +887,17 @@ minstrel_ht_tx_status(void *priv, struct
- struct minstrel_ht_sta_priv *msp = priv_sta;
- struct minstrel_ht_sta *mi = &msp->ht;
- struct ieee80211_tx_rate *ar = info->status.rates;
-- struct minstrel_rate_stats *rate, *rate2;
-+ struct minstrel_rate_stats *rate, *rate2, *rate_sample = NULL;
- struct minstrel_priv *mp = priv;
- bool last, update = false;
-+ bool sample_status = false;
- int i;
-
- if (!msp->is_ht)
- return mac80211_minstrel.tx_status_ext(priv, sband,
- &msp->legacy, st);
-
-+
- /* This packet was aggregated but doesn't carry status info */
- if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
- !(info->flags & IEEE80211_TX_STAT_AMPDU))
-@@ -773,12 +923,17 @@ minstrel_ht_tx_status(void *priv, struct
- if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
- mi->sample_packets += info->status.ampdu_len;
-
-+ if (mi->sample_mode != MINSTREL_SAMPLE_IDLE)
-+ rate_sample = minstrel_get_ratestats(mi, mi->sample_rate);
-+
- last = !minstrel_ht_txstat_valid(mp, &ar[0]);
- for (i = 0; !last; i++) {
- last = (i == IEEE80211_TX_MAX_RATES - 1) ||
- !minstrel_ht_txstat_valid(mp, &ar[i + 1]);
-
- rate = minstrel_ht_get_stats(mp, mi, &ar[i]);
-+ if (rate == rate_sample)
-+ sample_status = true;
-
- if (last)
- rate->success += info->status.ampdu_ack_len;
-@@ -786,44 +941,60 @@ minstrel_ht_tx_status(void *priv, struct
- rate->attempts += ar[i].count * info->status.ampdu_len;
- }
-
-- /*
-- * check for sudden death of spatial multiplexing,
-- * downgrade to a lower number of streams if necessary.
-- */
-- rate = minstrel_get_ratestats(mi, mi->max_tp_rate[0]);
-- if (rate->attempts > 30 &&
-- MINSTREL_FRAC(rate->success, rate->attempts) <
-- MINSTREL_FRAC(20, 100)) {
-- minstrel_downgrade_rate(mi, &mi->max_tp_rate[0], true);
-+ switch (mi->sample_mode) {
-+ case MINSTREL_SAMPLE_IDLE:
-+ break;
-+
-+ case MINSTREL_SAMPLE_ACTIVE:
-+ if (!sample_status)
-+ break;
-+
-+ mi->sample_mode = MINSTREL_SAMPLE_PENDING;
- update = true;
-- }
-+ break;
-+
-+ case MINSTREL_SAMPLE_PENDING:
-+ if (sample_status)
-+ break;
-
-- rate2 = minstrel_get_ratestats(mi, mi->max_tp_rate[1]);
-- if (rate2->attempts > 30 &&
-- MINSTREL_FRAC(rate2->success, rate2->attempts) <
-- MINSTREL_FRAC(20, 100)) {
-- minstrel_downgrade_rate(mi, &mi->max_tp_rate[1], false);
- update = true;
-+ minstrel_ht_update_stats(mp, mi, false);
-+ break;
-+ }
-+
-+
-+ if (mp->hw->max_rates > 1) {
-+ /*
-+ * check for sudden death of spatial multiplexing,
-+ * downgrade to a lower number of streams if necessary.
-+ */
-+ rate = minstrel_get_ratestats(mi, mi->max_tp_rate[0]);
-+ if (rate->attempts > 30 &&
-+ MINSTREL_FRAC(rate->success, rate->attempts) <
-+ MINSTREL_FRAC(20, 100)) {
-+ minstrel_downgrade_rate(mi, &mi->max_tp_rate[0], true);
-+ update = true;
-+ }
-+
-+ rate2 = minstrel_get_ratestats(mi, mi->max_tp_rate[1]);
-+ if (rate2->attempts > 30 &&
-+ MINSTREL_FRAC(rate2->success, rate2->attempts) <
-+ MINSTREL_FRAC(20, 100)) {
-+ minstrel_downgrade_rate(mi, &mi->max_tp_rate[1], false);
-+ update = true;
-+ }
- }
-
- if (time_after(jiffies, mi->last_stats_update +
- (mp->update_interval / 2 * HZ) / 1000)) {
- update = true;
-- minstrel_ht_update_stats(mp, mi);
-+ minstrel_ht_update_stats(mp, mi, true);
- }
-
- if (update)
- minstrel_ht_update_rates(mp, mi);
- }
-
--static inline int
--minstrel_get_duration(int index)
--{
-- const struct mcs_group *group = &minstrel_mcs_groups[index / MCS_GROUP_RATES];
-- unsigned int duration = group->duration[index % MCS_GROUP_RATES];
-- return duration << group->shift;
--}
--
- static void
- minstrel_calc_retransmit(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
- int index)
-@@ -988,14 +1159,18 @@ static void
- minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
- {
- struct ieee80211_sta_rates *rates;
-+ u16 first_rate = mi->max_tp_rate[0];
- int i = 0;
-
-+ if (mi->sample_mode == MINSTREL_SAMPLE_ACTIVE)
-+ first_rate = mi->sample_rate;
-+
- rates = kzalloc(sizeof(*rates), GFP_ATOMIC);
- if (!rates)
- return;
-
- /* Start with max_tp_rate[0] */
-- minstrel_ht_set_rate(mp, mi, rates, i++, mi->max_tp_rate[0]);
-+ minstrel_ht_set_rate(mp, mi, rates, i++, first_rate);
-
- if (mp->hw->max_rates >= 3) {
- /* At least 3 tx rates supported, use max_tp_rate[1] next */
-@@ -1020,6 +1195,11 @@ minstrel_get_sample_rate(struct minstrel
- int tp_rate1, tp_rate2;
- int sample_idx = 0;
-
-+ if (mp->hw->max_rates == 1 && mp->sample_switch &&
-+ (mi->total_packets_cur >= SAMPLE_SWITCH_THR ||
-+ mp->sample_switch == 1))
-+ return -1;
-+
- if (mi->sample_wait > 0) {
- mi->sample_wait--;
- return -1;
-@@ -1341,7 +1521,7 @@ minstrel_ht_update_caps(void *priv, stru
- mi->supported[MINSTREL_CCK_GROUP] |= mi->cck_supported_short << 4;
-
- /* create an initial rate table with the lowest supported rates */
-- minstrel_ht_update_stats(mp, mi);
-+ minstrel_ht_update_stats(mp, mi, true);
- minstrel_ht_update_rates(mp, mi);
-
- return;
-@@ -1459,6 +1639,8 @@ minstrel_ht_alloc(struct ieee80211_hw *h
- if (!mp)
- return NULL;
-
-+ mp->sample_switch = -1;
-+
- /* contention window settings
- * Just an approximation. Using the per-queue values would complicate
- * the calculations and is probably unnecessary */
-@@ -1490,6 +1672,8 @@ minstrel_ht_alloc(struct ieee80211_hw *h
- mp->fixed_rate_idx = (u32) -1;
- debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
- &mp->fixed_rate_idx);
-+ debugfs_create_u32("sample_switch", S_IRUGO | S_IWUSR, debugfsdir,
-+ &mp->sample_switch);
- #endif
-
- minstrel_ht_init_cck_rates(mp);
---- a/net/mac80211/rc80211_minstrel_ht.h
-+++ b/net/mac80211/rc80211_minstrel_ht.h
-@@ -33,6 +33,7 @@ struct mcs_group {
- u16 flags;
- u8 streams;
- u8 shift;
-+ u8 bw;
- u16 duration[MCS_GROUP_RATES];
- };
-
-@@ -50,6 +51,12 @@ struct minstrel_mcs_group_data {
- struct minstrel_rate_stats rates[MCS_GROUP_RATES];
- };
-
-+enum minstrel_sample_mode {
-+ MINSTREL_SAMPLE_IDLE,
-+ MINSTREL_SAMPLE_ACTIVE,
-+ MINSTREL_SAMPLE_PENDING,
-+};
-+
- struct minstrel_ht_sta {
- struct ieee80211_sta *sta;
-
-@@ -71,6 +78,8 @@ struct minstrel_ht_sta {
- unsigned int overhead;
- unsigned int overhead_rtscts;
-
-+ unsigned int total_packets_last;
-+ unsigned int total_packets_cur;
- unsigned int total_packets;
- unsigned int sample_packets;
-
-@@ -82,6 +91,9 @@ struct minstrel_ht_sta {
- u8 sample_count;
- u8 sample_slow;
-
-+ enum minstrel_sample_mode sample_mode;
-+ u16 sample_rate;
-+
- /* current MCS group to be sampled */
- u8 sample_group;
-
diff --git a/package/kernel/mac80211/patches/subsys/314-mac80211-add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch b/package/kernel/mac80211/patches/subsys/314-mac80211-add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch
deleted file mode 100644
index f732345842..0000000000
--- a/package/kernel/mac80211/patches/subsys/314-mac80211-add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From: Lorenzo Bianconi <lorenzo@kernel.org>
-Date: Tue, 16 Jul 2019 00:09:19 +0200
-Subject: [PATCH] mac80211: add IEEE80211_KEY_FLAG_GENERATE_MMIE to
- ieee80211_key_flags
-
-Add IEEE80211_KEY_FLAG_GENERATE_MMIE flag to ieee80211_key_flags in order
-to allow the driver to notify mac80211 to generate MMIE and that it
-requires sequence number generation only.
-This is a preliminary patch to add BIP_CMAC_128 hw support to mt7615
-driver
-
-Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
-Link: https://lore.kernel.org/r/dfe275f9aa0f1cc6b33085f9efd5d8447f68ad13.1563228405.git.lorenzo@kernel.org
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
----
-
---- a/include/net/mac80211.h
-+++ b/include/net/mac80211.h
-@@ -1702,6 +1702,9 @@ struct wireless_dev *ieee80211_vif_to_wd
- * a TKIP key if it only requires MIC space. Do not set together with
- * @IEEE80211_KEY_FLAG_GENERATE_MMIC on the same key.
- * @IEEE80211_KEY_FLAG_NO_AUTO_TX: Key needs explicit Tx activation.
-+ * @IEEE80211_KEY_FLAG_GENERATE_MMIE: This flag should be set by the driver
-+ * for a AES_CMAC key to indicate that it requires sequence number
-+ * generation only
- */
- enum ieee80211_key_flags {
- IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0),
-@@ -1714,6 +1717,7 @@ enum ieee80211_key_flags {
- IEEE80211_KEY_FLAG_RESERVE_TAILROOM = BIT(7),
- IEEE80211_KEY_FLAG_PUT_MIC_SPACE = BIT(8),
- IEEE80211_KEY_FLAG_NO_AUTO_TX = BIT(9),
-+ IEEE80211_KEY_FLAG_GENERATE_MMIE = BIT(10),
- };
-
- /**
---- a/net/mac80211/wpa.c
-+++ b/net/mac80211/wpa.c
-@@ -947,7 +947,8 @@ ieee80211_crypto_aes_cmac_encrypt(struct
-
- info = IEEE80211_SKB_CB(skb);
-
-- if (info->control.hw_key)
-+ if (info->control.hw_key &&
-+ !(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIE))
- return TX_CONTINUE;
-
- if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie)))
-@@ -963,6 +964,9 @@ ieee80211_crypto_aes_cmac_encrypt(struct
-
- bip_ipn_set64(mmie->sequence_number, pn64);
-
-+ if (info->control.hw_key)
-+ return TX_CONTINUE;
-+
- bip_aad(skb, aad);
-
- /*
diff --git a/package/kernel/mac80211/patches/subsys/315-mac80211-minstrel_ht-fix-infinite-loop-because-suppo.patch b/package/kernel/mac80211/patches/subsys/315-mac80211-minstrel_ht-fix-infinite-loop-because-suppo.patch
deleted file mode 100644
index eb70d4d5d2..0000000000
--- a/package/kernel/mac80211/patches/subsys/315-mac80211-minstrel_ht-fix-infinite-loop-because-suppo.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Colin Ian King <colin.king@canonical.com>
-Date: Thu, 22 Aug 2019 13:20:34 +0100
-Subject: [PATCH] mac80211: minstrel_ht: fix infinite loop because supported is
- not being shifted
-
-Currently the for-loop will spin forever if variable supported is
-non-zero because supported is never changed. Fix this by adding in
-the missing right shift of supported.
-
-Addresses-Coverity: ("Infinite loop")
-Fixes: 48cb39522a9d ("mac80211: minstrel_ht: improve rate probing for devices with static fallback")
-Signed-off-by: Colin Ian King <colin.king@canonical.com>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -634,7 +634,7 @@ minstrel_ht_rate_sample_switch(struct mi
- u16 supported = mi->supported[g_idx];
-
- supported >>= mi->max_tp_rate[0] % MCS_GROUP_RATES;
-- for (i = 0; supported; i++) {
-+ for (i = 0; supported; supported >>= 1, i++) {
- if (!(supported & 1))
- continue;
-
diff --git a/package/kernel/mac80211/patches/subsys/350-cfg80211-add-local-BSS-receive-time-to-survey-inform.patch b/package/kernel/mac80211/patches/subsys/350-cfg80211-add-local-BSS-receive-time-to-survey-inform.patch
deleted file mode 100644
index 99b17faccd..0000000000
--- a/package/kernel/mac80211/patches/subsys/350-cfg80211-add-local-BSS-receive-time-to-survey-inform.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Felix Fietkau <nbd@nbd.name>
-Date: Wed, 28 Aug 2019 12:13:55 +0200
-Subject: [PATCH] cfg80211: add local BSS receive time to survey information
-
-This is useful for checking how much airtime is being used up by other
-transmissions on the channel, e.g. by calculating (time_rx - time_bss_rx)
-or (time_busy - time_bss_rx - time_tx)
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -682,6 +682,7 @@ ieee80211_chandef_max_power(struct cfg80
- * @SURVEY_INFO_TIME_RX: receive time was filled in
- * @SURVEY_INFO_TIME_TX: transmit time was filled in
- * @SURVEY_INFO_TIME_SCAN: scan time was filled in
-+ * @SURVEY_INFO_TIME_BSS_RX: local BSS receive time was filled in
- *
- * Used by the driver to indicate which info in &struct survey_info
- * it has filled in during the get_survey().
-@@ -695,6 +696,7 @@ enum survey_info_flags {
- SURVEY_INFO_TIME_RX = BIT(5),
- SURVEY_INFO_TIME_TX = BIT(6),
- SURVEY_INFO_TIME_SCAN = BIT(7),
-+ SURVEY_INFO_TIME_BSS_RX = BIT(8),
- };
-
- /**
-@@ -711,6 +713,7 @@ enum survey_info_flags {
- * @time_rx: amount of time the radio spent receiving data
- * @time_tx: amount of time the radio spent transmitting data
- * @time_scan: amount of time the radio spent for scanning
-+ * @time_bss_rx: amount of time the radio spent receiving data on a local BSS
- *
- * Used by dump_survey() to report back per-channel survey information.
- *
-@@ -725,6 +728,7 @@ struct survey_info {
- u64 time_rx;
- u64 time_tx;
- u64 time_scan;
-+ u64 time_bss_rx;
- u32 filled;
- s8 noise;
- };
---- a/include/uapi/linux/nl80211.h
-+++ b/include/uapi/linux/nl80211.h
-@@ -3836,6 +3836,8 @@ enum nl80211_user_reg_hint_type {
- * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
- * (on this channel or globally)
- * @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment
-+ * @NL80211_SURVEY_INFO_TIME_BSS_RX: amount of time the radio spent
-+ * receiving local BSS data
- * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
- * currently defined
- * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
-@@ -3852,6 +3854,7 @@ enum nl80211_survey_info {
- NL80211_SURVEY_INFO_TIME_TX,
- NL80211_SURVEY_INFO_TIME_SCAN,
- NL80211_SURVEY_INFO_PAD,
-+ NL80211_SURVEY_INFO_TIME_BSS_RX,
-
- /* keep last */
- __NL80211_SURVEY_INFO_AFTER_LAST,
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -8729,6 +8729,10 @@ static int nl80211_send_survey(struct sk
- nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_SCAN,
- survey->time_scan, NL80211_SURVEY_INFO_PAD))
- goto nla_put_failure;
-+ if ((survey->filled & SURVEY_INFO_TIME_BSS_RX) &&
-+ nla_put_u64_64bit(msg, NL80211_SURVEY_INFO_TIME_BSS_RX,
-+ survey->time_bss_rx, NL80211_SURVEY_INFO_PAD))
-+ goto nla_put_failure;
-
- nla_nest_end(msg, infoattr);
-
diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch
index 5977995b21..768cca6046 100644
--- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch
+++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch
@@ -1,6 +1,6 @@
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -3348,6 +3348,7 @@ struct cfg80211_update_owe_info {
+@@ -3447,6 +3447,7 @@ struct cfg80211_update_owe_info {
* (as advertised by the nl80211 feature flag.)
* @get_tx_power: store the current TX power into the dbm variable;
* return 0 if successful
@@ -8,7 +8,7 @@
*
* @set_wds_peer: set the WDS peer for a WDS interface
*
-@@ -3660,6 +3661,7 @@ struct cfg80211_ops {
+@@ -3759,6 +3760,7 @@ struct cfg80211_ops {
enum nl80211_tx_power_setting type, int mbm);
int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
int *dbm);
@@ -18,7 +18,7 @@
const u8 *addr);
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
-@@ -1476,6 +1476,7 @@ enum ieee80211_smps_mode {
+@@ -1484,6 +1484,7 @@ enum ieee80211_smps_mode {
*
* @power_level: requested transmit power (in dBm), backward compatibility
* value only that is set to the minimum of all interfaces
@@ -26,7 +26,7 @@
*
* @chandef: the channel definition to tune to
* @radar_enabled: whether radar detection is enabled
-@@ -1496,6 +1497,7 @@ enum ieee80211_smps_mode {
+@@ -1504,6 +1505,7 @@ enum ieee80211_smps_mode {
struct ieee80211_conf {
u32 flags;
int power_level, dynamic_ps_timeout;
@@ -36,9 +36,9 @@
u8 ps_dtim_period;
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
-@@ -2356,6 +2356,9 @@ enum nl80211_commands {
- *
- * @NL80211_ATTR_TWT_RESPONDER: Enable target wait time responder support.
+@@ -2373,6 +2373,9 @@ enum nl80211_commands {
+ * the allowed channel bandwidth configurations. (u8 attribute)
+ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
*
+ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
+ * transmit power to stay within regulatory limits. u32, dBi.
@@ -46,9 +46,9 @@
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -2813,6 +2816,8 @@ enum nl80211_attrs {
-
- NL80211_ATTR_TWT_RESPONDER,
+@@ -2835,6 +2838,8 @@ enum nl80211_attrs {
+ NL80211_ATTR_WIPHY_EDMG_CHANNELS,
+ NL80211_ATTR_WIPHY_EDMG_BW_CONFIG,
+ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
+
@@ -57,7 +57,7 @@
__NL80211_ATTR_AFTER_LAST,
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -2579,6 +2579,19 @@ static int ieee80211_get_tx_power(struct
+@@ -2582,6 +2582,19 @@ static int ieee80211_get_tx_power(struct
return 0;
}
@@ -77,7 +77,7 @@
static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr)
{
-@@ -3992,6 +4005,7 @@ const struct cfg80211_ops mac80211_confi
+@@ -3995,6 +4008,7 @@ const struct cfg80211_ops mac80211_confi
.set_wiphy_params = ieee80211_set_wiphy_params,
.set_tx_power = ieee80211_set_tx_power,
.get_tx_power = ieee80211_get_tx_power,
@@ -126,18 +126,18 @@
+ local->user_antenna_gain = 0;
local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
- local->user_power_level = IEEE80211_UNSET_POWER_LEVEL;
+ local->hw.max_mtu = IEEE80211_MAX_DATA_LEN;
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -607,6 +607,7 @@ const struct nla_policy nl80211_policy[N
- [NL80211_ATTR_SAE_PASSWORD] = { .type = NLA_BINARY,
+@@ -624,6 +624,7 @@ const struct nla_policy nl80211_policy[N
.len = SAE_PASSWORD_MAX_LEN },
[NL80211_ATTR_TWT_RESPONDER] = { .type = NLA_FLAG },
+ [NL80211_ATTR_HE_OBSS_PD] = NLA_POLICY_NESTED(he_obss_pd_policy),
+ [NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 },
};
/* policy for the key attributes */
-@@ -2904,6 +2905,20 @@ static int nl80211_set_wiphy(struct sk_b
+@@ -2988,6 +2989,20 @@ static int nl80211_set_wiphy(struct sk_b
if (result)
return result;
}