From: Johannes Berg Set the parameters advertised in the beacon in the BSS configuration as well. Note this is incomplete since it doesn't track updates. Signed-off-by: Johannes Berg --- net/mac80211/cfg.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8f8d860944a8..9f24a5fa5e75 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1724,10 +1724,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 && -- 2.53.0