mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-21 11:22:50 +00:00
130 lines
4.9 KiB
Diff
130 lines
4.9 KiB
Diff
From 53164decc4f113ce948944c28d4e138fcba7ff54 Mon Sep 17 00:00:00 2001
|
|
From: Sivashankari Madhavan <quic_sivamadh@quicinc.com>
|
|
Date: Fri, 21 Apr 2023 15:43:37 +0530
|
|
Subject: [PATCH] Fix the incorrect value of station dump fields in SLO/MLO
|
|
mode
|
|
|
|
While connecting the AP with a station in SLO/MLO mode observe
|
|
the Dtim period and Beacon Interval as 0 in the station dump.
|
|
|
|
During the start AP, these fields are updated in the specific
|
|
link config. But when setting the station info, it's referring
|
|
to the sdata bss config. Due to this, observing the issue.
|
|
|
|
Fix it by updating these fields with corresponding link config data
|
|
per link.
|
|
|
|
Signed-off-by: Sivashankari Madhavan <quic_sivamadh@quicinc.com>
|
|
---
|
|
net/mac80211/sta_info.c | 15 +++++++++++++--
|
|
1 file changed, 13 insertions(+), 2 deletions(-)
|
|
|
|
Index: backports-20220822-5.4.213-ef7197996efe/net/mac80211/sta_info.c
|
|
===================================================================
|
|
--- backports-20220822-5.4.213-ef7197996efe.orig/net/mac80211/sta_info.c
|
|
+++ backports-20220822-5.4.213-ef7197996efe/net/mac80211/sta_info.c
|
|
@@ -2547,8 +2547,12 @@ void sta_set_sinfo(struct sta_info *sta,
|
|
struct ieee80211_local *local = sdata->local;
|
|
u32 thr = 0;
|
|
int i, ac, link_id = 0;
|
|
+ u16 beacon_interval;
|
|
+ u8 dtim_period;
|
|
struct ieee80211_sta_rx_stats *last_rxstats;
|
|
struct link_sta_info *link_sta = NULL;
|
|
+ struct ieee80211_link_data *link;
|
|
+ struct ieee80211_bss_conf *link_conf;
|
|
|
|
last_rxstats = sta_get_last_rx_stats(sta);
|
|
|
|
@@ -2600,11 +2604,22 @@ void sta_set_sinfo(struct sta_info *sta,
|
|
link_sta_filled |= link_sta_set_info(link_sta, sinfo,
|
|
init);
|
|
init = false;
|
|
+
|
|
+ link = sdata_dereference(sdata->link[link_id], sdata);
|
|
+
|
|
+ if (link) {
|
|
+ link_conf = link->conf;
|
|
+
|
|
+ sinfo->links[link_id].dtim_period = link_conf->dtim_period;
|
|
+ sinfo->links[link_id].beacon_interval = link_conf->beacon_int;
|
|
+ }
|
|
rcu_read_unlock();
|
|
}
|
|
|
|
sinfo->filled |= link_sta_filled;
|
|
} else {
|
|
+ dtim_period = sdata->deflink.conf->dtim_period;
|
|
+ beacon_interval = sdata->deflink.conf->beacon_int;
|
|
sinfo->filled |= link_sta_set_info(&sta->deflink, sinfo, true);
|
|
}
|
|
|
|
@@ -2718,8 +2733,8 @@ void sta_set_sinfo(struct sta_info *sta,
|
|
sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE;
|
|
if (sdata->vif.bss_conf.use_short_slot)
|
|
sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
|
|
- sinfo->bss_param.dtim_period = sdata->vif.bss_conf.dtim_period;
|
|
- sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int;
|
|
+ sinfo->bss_param.dtim_period = dtim_period;
|
|
+ sinfo->bss_param.beacon_interval = beacon_interval;
|
|
|
|
sinfo->sta_flags.set = 0;
|
|
sinfo->sta_flags.mask = BIT(NL80211_STA_FLAG_AUTHORIZED) |
|
|
Index: backports-20220822-5.4.213-ef7197996efe/include/net/cfg80211.h
|
|
===================================================================
|
|
--- backports-20220822-5.4.213-ef7197996efe.orig/include/net/cfg80211.h
|
|
+++ backports-20220822-5.4.213-ef7197996efe/include/net/cfg80211.h
|
|
@@ -1994,6 +1994,8 @@ struct cfg80211_tid_stats {
|
|
|
|
struct link_station_info {
|
|
u8 addr[ETH_ALEN] __aligned(2);
|
|
+ u8 dtim_period;
|
|
+ u16 beacon_interval;
|
|
/* TODO: packet stats */
|
|
};
|
|
|
|
Index: backports-20220822-5.4.213-ef7197996efe/net/wireless/nl80211.c
|
|
===================================================================
|
|
--- backports-20220822-5.4.213-ef7197996efe.orig/net/wireless/nl80211.c
|
|
+++ backports-20220822-5.4.213-ef7197996efe/net/wireless/nl80211.c
|
|
@@ -7170,16 +7170,34 @@ static int nl80211_send_station(struct s
|
|
if (!bss_param)
|
|
goto nla_put_failure;
|
|
|
|
+ link_id = 0;
|
|
+ if (sinfo->valid_links) {
|
|
+ for_each_valid_link(sinfo, link_id) {
|
|
+ link = nla_nest_start(msg, link_id + 1);
|
|
+ if (nla_put_u8(msg, NL80211_STA_BSS_PARAM_DTIM_PERIOD,
|
|
+ sinfo->links[link_id].dtim_period))
|
|
+ goto nla_put_failure;
|
|
+ if (nla_put_u16(msg, NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
|
|
+ sinfo->links[link_id].beacon_interval))
|
|
+ goto nla_put_failure;
|
|
+
|
|
+ nla_nest_end(msg, link);
|
|
+ }
|
|
+ } else {
|
|
+ if (nla_put_u8(msg, NL80211_STA_BSS_PARAM_DTIM_PERIOD,
|
|
+ sinfo->bss_param.dtim_period) ||
|
|
+ nla_put_u16(msg, NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
|
|
+ sinfo->bss_param.beacon_interval)) {
|
|
+ goto nla_put_failure;
|
|
+ }
|
|
+ }
|
|
+
|
|
if (((sinfo->bss_param.flags & BSS_PARAM_FLAGS_CTS_PROT) &&
|
|
nla_put_flag(msg, NL80211_STA_BSS_PARAM_CTS_PROT)) ||
|
|
((sinfo->bss_param.flags & BSS_PARAM_FLAGS_SHORT_PREAMBLE) &&
|
|
nla_put_flag(msg, NL80211_STA_BSS_PARAM_SHORT_PREAMBLE)) ||
|
|
((sinfo->bss_param.flags & BSS_PARAM_FLAGS_SHORT_SLOT_TIME) &&
|
|
- nla_put_flag(msg, NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME)) ||
|
|
- nla_put_u8(msg, NL80211_STA_BSS_PARAM_DTIM_PERIOD,
|
|
- sinfo->bss_param.dtim_period) ||
|
|
- nla_put_u16(msg, NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
|
|
- sinfo->bss_param.beacon_interval))
|
|
+ nla_put_flag(msg, NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME)))
|
|
goto nla_put_failure;
|
|
|
|
nla_nest_end(msg, bss_param);
|