mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-24 21:02:35 +00:00
113 lines
3.5 KiB
Diff
113 lines
3.5 KiB
Diff
From f7082761b35cde6e22d591d2ea7809e9fe706a91 Mon Sep 17 00:00:00 2001
|
|
From: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
|
|
Date: Tue, 20 Dec 2022 13:19:46 +0530
|
|
Subject: [PATCH] mac80211: Revert "mac80211: validate user rate mask before
|
|
configuring driver"
|
|
|
|
Ben reported that when the user rate mask is rejected for not
|
|
matching any basic rate, the driver had already been configured.
|
|
This is clearly an oversight in my original change, fix this by
|
|
doing the validation before calling the driver.
|
|
|
|
Change-Id: Ia474f80ebdc1f392068a62f2613b4aed40796b22
|
|
Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
|
|
---
|
|
net/mac80211/cfg.c | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
--- a/net/mac80211/cfg.c
|
|
+++ b/net/mac80211/cfg.c
|
|
@@ -2763,7 +2763,6 @@ static int ieee80211_change_bss(struct w
|
|
params->basic_rates_len,
|
|
&link->conf->basic_rates);
|
|
changed |= BSS_CHANGED_BASIC_RATES;
|
|
- ieee80211_check_rate_mask(link);
|
|
}
|
|
|
|
if (params->ap_isolate >= 0) {
|
|
@@ -3388,21 +3387,6 @@ static int ieee80211_set_bitrate_mask(st
|
|
if (!ieee80211_sdata_running(sdata))
|
|
return -ENETDOWN;
|
|
|
|
- /*
|
|
- * If active validate the setting and reject it if it doesn't leave
|
|
- * at least one basic rate usable, since we really have to be able
|
|
- * to send something, and if we're an AP we have to be able to do
|
|
- * so at a basic rate so that all clients can receive it.
|
|
- */
|
|
- if (rcu_access_pointer(sdata->vif.bss_conf.chanctx_conf) &&
|
|
- sdata->vif.bss_conf.chandef.chan) {
|
|
- u32 basic_rates = sdata->vif.bss_conf.basic_rates;
|
|
- enum nl80211_band band = sdata->vif.bss_conf.chandef.chan->band;
|
|
-
|
|
- if (!(mask->control[band].legacy & basic_rates))
|
|
- return -EINVAL;
|
|
- }
|
|
-
|
|
if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) {
|
|
ret = drv_set_bitrate_mask(local, sdata, mask);
|
|
if (ret)
|
|
--- a/net/mac80211/mlme.c
|
|
+++ b/net/mac80211/mlme.c
|
|
@@ -2673,8 +2673,6 @@ static u32 ieee80211_link_set_associated
|
|
bss->has_erp_value,
|
|
bss->erp_value);
|
|
|
|
- ieee80211_check_rate_mask(link);
|
|
-
|
|
link->u.mgd.bss = cbss;
|
|
memcpy(link->u.mgd.bssid, cbss->bssid, ETH_ALEN);
|
|
|
|
--- a/net/mac80211/rate.c
|
|
+++ b/net/mac80211/rate.c
|
|
@@ -270,38 +270,6 @@ static void rate_control_free(struct iee
|
|
kfree(ctrl_ref);
|
|
}
|
|
|
|
-void ieee80211_check_rate_mask(struct ieee80211_link_data *link)
|
|
-{
|
|
- struct ieee80211_sub_if_data *sdata = link->sdata;
|
|
- struct ieee80211_local *local = sdata->local;
|
|
- struct ieee80211_supported_band *sband;
|
|
- u32 user_mask, basic_rates = link->conf->basic_rates;
|
|
- enum nl80211_band band;
|
|
-
|
|
- if (WARN_ON(!link->conf->chandef.chan))
|
|
- return;
|
|
-
|
|
- band = link->conf->chandef.chan->band;
|
|
- if (band == NL80211_BAND_S1GHZ) {
|
|
- /* TODO */
|
|
- return;
|
|
- }
|
|
-
|
|
- if (WARN_ON_ONCE(!basic_rates))
|
|
- return;
|
|
-
|
|
- user_mask = sdata->rc_rateidx_mask[band];
|
|
- sband = local->hw.wiphy->bands[band];
|
|
-
|
|
- if (user_mask & basic_rates)
|
|
- return;
|
|
-
|
|
- sdata_dbg(sdata,
|
|
- "no overlap between basic rates (0x%x) and user mask (0x%x on band %d) - clearing the latter",
|
|
- basic_rates, user_mask, band);
|
|
- sdata->rc_rateidx_mask[band] = (1 << sband->n_bitrates) - 1;
|
|
-}
|
|
-
|
|
static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc)
|
|
{
|
|
struct sk_buff *skb = txrc->skb;
|
|
--- a/net/mac80211/rate.h
|
|
+++ b/net/mac80211/rate.h
|
|
@@ -85,8 +85,6 @@ static inline void rate_control_add_debu
|
|
#endif
|
|
}
|
|
|
|
-void ieee80211_check_rate_mask(struct ieee80211_link_data *link);
|
|
-
|
|
/* Get a reference to the rate control algorithm. If `name' is NULL, get the
|
|
* first available algorithm. */
|
|
int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local,
|