summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2026-04-28 12:25:39 +0300
committerJohannes Berg <johannes.berg@intel.com>2026-05-05 15:49:03 +0300
commit12efcd79d6db52fd75fafada75f6505be529f65b (patch)
treea6f69ccf61920d4447b227bac0c76274782efd4e
parent5af8f06349d85824a32aa15949cb66b174e0f713 (diff)
downloadlinux-12efcd79d6db52fd75fafada75f6505be529f65b.tar.xz
wifi: mac80211: set AP NPCA parameters in bss_conf
Set the parameters advertised in the beacon in the BSS configuration as well. Note this is incomplete since it doesn't track updates. Link: https://patch.msgid.link/20260428112708.311609f2eedb.I3db62b48d6afefd23b50fd14663f863e6f9974ca@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/cfg.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7e9dcb02f9bd..0ebc58a768a4 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1725,10 +1725,42 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
}
if (params->beacon.uhr_oper) {
+ const struct ieee80211_uhr_npca_info *npca;
+ struct ieee80211_bss_npca_params npca_params = {};
+
if (!link_conf->eht_support)
return -EOPNOTSUPP;
link_conf->uhr_support = true;
+
+ npca = ieee80211_uhr_npca_info(params->beacon.uhr_oper);
+ if (!npca) {
+ chanreq.oper.npca_chan = NULL;
+ chanreq.oper.npca_punctured = 0;
+ } else {
+ npca_params.min_dur_thresh =
+ le32_get_bits(npca->params,
+ IEEE80211_UHR_NPCA_PARAMS_MIN_DUR_THRESH);
+ npca_params.switch_delay =
+ le32_get_bits(npca->params,
+ IEEE80211_UHR_NPCA_PARAMS_SWITCH_DELAY);
+ npca_params.switch_back_delay =
+ le32_get_bits(npca->params,
+ IEEE80211_UHR_NPCA_PARAMS_SWITCH_BACK_DELAY);
+ npca_params.init_qsrc =
+ le32_get_bits(npca->params,
+ IEEE80211_UHR_NPCA_PARAMS_INIT_QSRC);
+ npca_params.moplen =
+ le32_get_bits(npca->params,
+ IEEE80211_UHR_NPCA_PARAMS_MOPLEN);
+ npca_params.enabled = true;
+ }
+
+ if (memcmp(&npca_params, &link->conf->npca,
+ sizeof(npca_params))) {
+ link->conf->npca = npca_params;
+ changed |= BSS_CHANGED_NPCA;
+ }
}
if (sdata->vif.type == NL80211_IFTYPE_AP &&