2020-04-29 14:58:16

by John Crispin

[permalink] [raw]
Subject: [PATCH V3 2/3] mac80211: add support for setting fixed HE rate/gi/ltf

From: Miles Hu <[email protected]>

With nl80211 now able to receive fixed HE rate/gi/ltf settings we want to
propagate these further down the stack into the mac80211 drivers. This
patch copies the values into the sdata struct.

Signed-off-by: Miles Hu <[email protected]>
Signed-off-by: John Crispin <[email protected]>
---
net/mac80211/cfg.c | 11 +++++++++++
net/mac80211/ieee80211_i.h | 3 +++
2 files changed, 14 insertions(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 0f72813fed53..ea3791a930e8 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2829,9 +2829,13 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
memcpy(sdata->rc_rateidx_vht_mcs_mask[i],
mask->control[i].vht_mcs,
sizeof(mask->control[i].vht_mcs));
+ memcpy(sdata->rc_rateidx_he_mcs_mask[i],
+ mask->control[i].he_mcs,
+ sizeof(mask->control[i].he_mcs));

sdata->rc_has_mcs_mask[i] = false;
sdata->rc_has_vht_mcs_mask[i] = false;
+ sdata->rc_has_he_mcs_mask[i] = false;
if (!sband)
continue;

@@ -2848,6 +2852,13 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
break;
}
}
+
+ for (j = 0; j < NL80211_HE_NSS_MAX; j++) {
+ if (~sdata->rc_rateidx_he_mcs_mask[i][j]) {
+ sdata->rc_has_he_mcs_mask[i] = true;
+ break;
+ }
+ }
}

return 0;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index f8ed4f621f7f..2502726d0a58 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -964,6 +964,9 @@ struct ieee80211_sub_if_data {
bool rc_has_vht_mcs_mask[NUM_NL80211_BANDS];
u16 rc_rateidx_vht_mcs_mask[NUM_NL80211_BANDS][NL80211_VHT_NSS_MAX];

+ bool rc_has_he_mcs_mask[NUM_NL80211_BANDS];
+ u16 rc_rateidx_he_mcs_mask[NUM_NL80211_BANDS][NL80211_HE_NSS_MAX];
+
union {
struct ieee80211_if_ap ap;
struct ieee80211_if_wds wds;
--
2.20.1