PKG_NAME:=mac80211
-PKG_VERSION:=4.19.85-1
+PKG_VERSION:=4.19.98-1
PKG_RELEASE:=1
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.85/
-PKG_HASH:=6a92df43e8c3e2410638d84dfd18773d667757532dd0a911227c9b7d65aee34d
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.98/
+PKG_HASH:=256d77e9cd3918d6a361e029850aba4568e8a00167ab3ed55495a359511c5bd2
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
adm8211 \
lib80211 \
mac80211-hwsim
-
+
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_kmod-mac80211 \
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -6612,6 +6612,11 @@ bool cfg80211_iftype_allowed(struct wiph
+@@ -6627,6 +6627,11 @@ bool cfg80211_iftype_allowed(struct wiph
#define wiphy_info(wiphy, format, args...) \
dev_info(&(wiphy)->dev, format, ##args)
--- a/local-symbols
+++ b/local-symbols
-@@ -305,6 +305,7 @@ RT2X00_LIB_FIRMWARE=
+@@ -303,6 +303,7 @@ RT2X00_LIB_FIRMWARE=
RT2X00_LIB_CRYPTO=
RT2X00_LIB_LEDS=
RT2X00_LIB_DEBUGFS=
-Used for AP+STA support in libreCMC - preserve AP mode keys across STA reconnects
+Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -2238,7 +2238,7 @@ static int ieee80211_scan(struct wiphy *
+@@ -2188,7 +2188,7 @@ static int ieee80211_scan(struct wiphy *
* the frames sent while scanning on other channel will be
* lost)
*/
#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1130,7 +1130,7 @@ minstrel_ht_update_caps(void *priv, stru
+@@ -1136,13 +1136,14 @@ minstrel_ht_update_caps(void *priv, stru
struct minstrel_ht_sta_priv *msp = priv_sta;
struct minstrel_ht_sta *mi = &msp->ht;
struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
- u16 sta_cap = sta->ht_cap.cap;
+ u16 ht_cap = sta->ht_cap.cap;
struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap;
- struct sta_info *sinfo = container_of(sta, struct sta_info, sta);
int use_vht;
-@@ -1138,6 +1138,7 @@ minstrel_ht_update_caps(void *priv, stru
+ int n_supported = 0;
int ack_dur;
int stbc;
int i;
/* fall back to the old minstrel for legacy stations */
if (!sta->ht_cap.ht_supported)
-@@ -1175,16 +1176,24 @@ minstrel_ht_update_caps(void *priv, stru
+@@ -1180,16 +1181,24 @@ minstrel_ht_update_caps(void *priv, stru
}
mi->sample_tries = 4;
for (i = 0; i < ARRAY_SIZE(mi->groups); i++) {
u32 gflags = minstrel_mcs_groups[i].flags;
int bw, nss;
-@@ -1197,10 +1206,10 @@ minstrel_ht_update_caps(void *priv, stru
+@@ -1202,10 +1211,10 @@ minstrel_ht_update_caps(void *priv, stru
if (gflags & IEEE80211_TX_RC_SHORT_GI) {
if (gflags & IEEE80211_TX_RC_40_MHZ_WIDTH) {
}
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1393,7 +1393,6 @@ static const struct rate_control_ops mac
+@@ -1397,7 +1397,6 @@ static const struct rate_control_ops mac
.free = minstrel_ht_free,
#ifdef CPTCFG_MAC80211_DEBUGFS
.add_sta_debugfs = minstrel_ht_add_sta_debugfs,
};
static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly;
-@@ -1146,12 +1142,10 @@ minstrel_ht_update_caps(void *priv, stru
+@@ -1151,12 +1147,10 @@ minstrel_ht_update_caps(void *priv, stru
BUILD_BUG_ON(ARRAY_SIZE(minstrel_mcs_groups) != MINSTREL_GROUPS_NB);
msp->is_ht = true;
memset(mi, 0, sizeof(*mi));
-@@ -1226,10 +1220,9 @@ minstrel_ht_update_caps(void *priv, stru
+@@ -1231,10 +1225,9 @@ minstrel_ht_update_caps(void *priv, stru
/* HT rate */
if (gflags & IEEE80211_TX_RC_MCS) {
mi->supported[i] = mcs->rx_mask[nss - 1];
if (mi->supported[i])
n_supported++;
-@@ -1349,16 +1342,88 @@ minstrel_ht_free_sta(void *priv, struct
+@@ -1353,16 +1346,88 @@ minstrel_ht_free_sta(void *priv, struct
kfree(msp);
}
}
static u32 minstrel_ht_get_expected_throughput(void *priv_sta)
-@@ -1417,14 +1482,14 @@ static void __init init_sample_table(voi
+@@ -1421,14 +1486,14 @@ static void __init init_sample_table(voi
}
int __init
-#define CCK_GROUP \
+#define CCK_GROUP(_s) \
[MINSTREL_CCK_GROUP] = { \
- .streams = 0, \
+ .streams = 1, \
.flags = 0, \
+ .shift = _s, \
.duration = { \
};
static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly;
-@@ -307,7 +310,8 @@ minstrel_ht_get_tp_avg(struct minstrel_h
+@@ -308,7 +311,8 @@ minstrel_ht_get_tp_avg(struct minstrel_h
if (group != MINSTREL_CCK_GROUP)
nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len);
/*
* For the throughput calculation, limit the probability value to 90% to
-@@ -755,12 +759,19 @@ minstrel_ht_tx_status(void *priv, struct
+@@ -756,12 +760,19 @@ minstrel_ht_tx_status(void *priv, struct
minstrel_ht_update_rates(mp, mi);
}
unsigned int tx_time, tx_time_rtscts, tx_time_data;
unsigned int cw = mp->cw_min;
unsigned int ctime = 0;
-@@ -779,8 +790,7 @@ minstrel_calc_retransmit(struct minstrel
+@@ -780,8 +791,7 @@ minstrel_calc_retransmit(struct minstrel
mrs->retry_count_rtscts = 2;
mrs->retry_updated = true;
/* Contention time for first 2 tries */
ctime = (t_slot * cw) >> 1;
-@@ -874,20 +884,24 @@ minstrel_ht_get_max_amsdu_len(struct min
+@@ -875,20 +885,24 @@ minstrel_ht_get_max_amsdu_len(struct min
int group = mi->max_prob_rate / MCS_GROUP_RATES;
const struct mcs_group *g = &minstrel_mcs_groups[group];
int rate = mi->max_prob_rate % MCS_GROUP_RATES;
return 1600;
/*
-@@ -895,7 +909,7 @@ minstrel_ht_get_max_amsdu_len(struct min
+@@ -896,7 +910,7 @@ minstrel_ht_get_max_amsdu_len(struct min
* rate success probability is less than 75%, limit A-MSDU to twice the usual
* data packet size
*/
(minstrel_ht_get_prob_ewma(mi, mi->max_tp_rate[0]) <
MINSTREL_FRAC(75, 100)))
return 3200;
-@@ -942,13 +956,6 @@ minstrel_ht_update_rates(struct minstrel
+@@ -943,13 +957,6 @@ minstrel_ht_update_rates(struct minstrel
rate_control_set_rates(mp->hw, mi->sta, rates);
}
+++ /dev/null
-From: Felix Fietkau <nbd@nbd.name>
-Date: Sat, 10 Feb 2018 13:43:07 +0100
-Subject: [PATCH] mac80211: minstrel: fix using short preamble CCK rates on
- HT clients
-
-mi->supported[MINSTREL_CCK_GROUP] needs to be updated
-
-Fixes: 782dda00ab8e ("mac80211: minstrel_ht: move short preamble check out of get_rate")
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1135,7 +1135,6 @@ minstrel_ht_update_caps(void *priv, stru
- struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
- u16 ht_cap = sta->ht_cap.cap;
- struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap;
-- struct sta_info *sinfo = container_of(sta, struct sta_info, sta);
- int use_vht;
- int n_supported = 0;
- int ack_dur;
-@@ -1267,8 +1266,7 @@ minstrel_ht_update_caps(void *priv, stru
- if (!n_supported)
- goto use_legacy;
-
-- if (test_sta_flag(sinfo, WLAN_STA_SHORT_PREAMBLE))
-- mi->cck_supported_short |= mi->cck_supported_short << 4;
-+ 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);
+++ /dev/null
-From: Felix Fietkau <nbd@nbd.name>
-Date: Thu, 1 Mar 2018 13:27:54 +0100
-Subject: [PATCH] mac80211: minstrel: fix CCK rate group streams value
-
-Fixes a harmless underflow issue when CCK rates are actively being used
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -131,7 +131,7 @@
-
- #define CCK_GROUP(_s) \
- [MINSTREL_CCK_GROUP] = { \
-- .streams = 0, \
-+ .streams = 1, \
- .flags = 0, \
- .shift = _s, \
- .duration = { \
+++ /dev/null
-From: Felix Fietkau <nbd@nbd.name>
-Date: Thu, 1 Mar 2018 13:28:48 +0100
-Subject: [PATCH] mac80211: minstrel: fix sampling/reporting of CCK rates
- in HT mode
-
-Long/short preamble selection cannot be sampled separately, since it
-depends on the BSS state. Because of that, sampling attempts to
-currently not used preamble modes are not counted in the statistics,
-which leads to CCK rates being sampled too often.
-
-Fix statistics accounting for long/short preamble by increasing the
-index where necessary.
-Fix excessive CCK rate sampling by dropping unsupported sample attempts.
-
-This improves throughput on 2.4 GHz channels
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -281,7 +281,8 @@ minstrel_ht_get_stats(struct minstrel_pr
- break;
-
- /* short preamble */
-- if (!(mi->supported[group] & BIT(idx)))
-+ if ((mi->supported[group] & BIT(idx + 4)) &&
-+ (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE))
- idx += 4;
- }
- return &mi->groups[group].rates[idx];
-@@ -1080,18 +1081,23 @@ minstrel_ht_get_rate(void *priv, struct
- return;
-
- sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES];
-+ sample_idx %= MCS_GROUP_RATES;
-+
-+ if (sample_group == &minstrel_mcs_groups[MINSTREL_CCK_GROUP] &&
-+ (sample_idx >= 4) != txrc->short_preamble)
-+ return;
-+
- info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
- rate->count = 1;
-
-- if (sample_idx / MCS_GROUP_RATES == MINSTREL_CCK_GROUP) {
-+ if (sample_group == &minstrel_mcs_groups[MINSTREL_CCK_GROUP]) {
- int idx = sample_idx % ARRAY_SIZE(mp->cck_rates);
- rate->idx = mp->cck_rates[idx];
- } else if (sample_group->flags & IEEE80211_TX_RC_VHT_MCS) {
- ieee80211_rate_set_vht(rate, sample_idx % MCS_GROUP_RATES,
- sample_group->streams);
- } else {
-- rate->idx = sample_idx % MCS_GROUP_RATES +
-- (sample_group->streams - 1) * 8;
-+ rate->idx = sample_idx + (sample_group->streams - 1) * 8;
- }
-
- rate->flags = sample_group->flags;
* The values are not guaranteed to be coherent with regard to each other, i.e.
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -1434,6 +1434,9 @@ static int sta_apply_parameters(struct i
+@@ -1390,6 +1390,9 @@ static int sta_apply_parameters(struct i
if (ieee80211_vif_is_mesh(&sdata->vif))
sta_apply_mesh_params(local, sta, params);
int sta_info_move_state(struct sta_info *sta,
enum ieee80211_sta_state new_state)
{
-@@ -2183,6 +2204,23 @@ void sta_set_sinfo(struct sta_info *sta,
+@@ -2187,6 +2208,23 @@ void sta_set_sinfo(struct sta_info *sta,
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_FAILED);
}
--- /dev/null
+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
+@@ -668,6 +668,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().
+@@ -681,6 +682,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),
+ };
+
+ /**
+@@ -697,6 +699,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.
+ *
+@@ -711,6 +714,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
+@@ -3693,6 +3693,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
+@@ -3709,6 +3711,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
+@@ -8367,6 +8367,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);
+
+++ /dev/null
-From: Felix Fietkau <nbd@nbd.name>
-Date: Wed, 8 Jan 2020 18:03:04 +0100
-Subject: [PATCH] cfg80211: fix memory leak in cfg80211_cqm_rssi_update
-
-The per-tid statistics need to be released after the call to rdev_get_station
-
-Cc: stable@vger.kernel.org
-Fixes: 8689c051a201 ("cfg80211: dynamically allocate per-tid stats for station info")
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -10346,6 +10346,7 @@ static int cfg80211_cqm_rssi_update(stru
- if (err)
- return err;
-
-+ cfg80211_sinfo_release_content(&sinfo);
- if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG))
- wdev->cqm_config->last_rssi_event_value =
- (s8) sinfo.rx_beacon_signal_avg;
+++ /dev/null
-From: Felix Fietkau <nbd@nbd.name>
-Date: Mon, 13 Jan 2020 18:34:31 +0100
-Subject: [PATCH] cfg80211: fix page refcount issue in A-MSDU decap
-
-The fragments attached to a skb can be part of a compound page. In that case,
-page_ref_inc will increment the refcount for the wrong page. Fix this by
-using get_page instead, which calls page_ref_inc on the compound head and
-also checks for overflow.
-
-Fixes: 2b67f944f88c ("cfg80211: reuse existing page fragments in A-MSDU rx")
-Cc: stable@vger.kernel.org
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/wireless/util.c
-+++ b/net/wireless/util.c
-@@ -537,7 +537,7 @@ __frame_add_frag(struct sk_buff *skb, st
- struct skb_shared_info *sh = skb_shinfo(skb);
- int page_offset;
-
-- page_ref_inc(page);
-+ get_page(page);
- page_offset = ptr - page_address(page);
- skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size);
- }
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -2968,6 +2968,7 @@ struct cfg80211_external_auth_params {
+@@ -2972,6 +2972,7 @@ struct cfg80211_external_auth_params {
* (as advertised by the nl80211 feature flag.)
* @get_tx_power: store the current TX power into the dbm variable;
* return 0 if successful
*
* @set_wds_peer: set the WDS peer for a WDS interface
*
-@@ -3268,6 +3269,7 @@ struct cfg80211_ops {
+@@ -3272,6 +3273,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);
__NL80211_ATTR_AFTER_LAST,
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -2506,6 +2506,19 @@ static int ieee80211_get_tx_power(struct
+@@ -2456,6 +2456,19 @@ static int ieee80211_get_tx_power(struct
return 0;
}
static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr)
{
-@@ -3873,6 +3886,7 @@ const struct cfg80211_ops mac80211_confi
+@@ -3823,6 +3836,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,