On 7/1/2024 7:43 PM, Felix Fietkau wrote:
Add support for counting global and per-radio max/current number of
channels, as well as checking radio-specific interface combinations.
Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>
---
net/mac80211/cfg.c | 7 +-
net/mac80211/chan.c | 17 +++--
net/mac80211/ibss.c | 2 +-
net/mac80211/ieee80211_i.h | 5 +-
net/mac80211/iface.c | 2 +-
net/mac80211/util.c | 126 ++++++++++++++++++++++++++------------
6 files changed, 108 insertions(+), 51 deletions(-)
...
@@ -3982,6 +4062,8 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
if (iftype != NL80211_IFTYPE_UNSPECIFIED)
params.iftype_num[iftype] = 1;
+ ieee80211_fill_ifcomb_params(local, ¶ms, shared ? chandef : NULL,
+ sdata);
list_for_each_entry(ctx, &local->chanctx_list, list) {
if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED)
continue;
@@ -3991,28 +4073,9 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
params.num_different_channels++;
continue;
}
- if (chandef && chanmode == IEEE80211_CHANCTX_SHARED &&
- cfg80211_chandef_compatible(chandef,
- &ctx->conf.def))
- continue;
params.num_different_channels++;
}
- list_for_each_entry_rcu(sdata_iter, &local->interfaces, list) {
- struct wireless_dev *wdev_iter;
-
- wdev_iter = &sdata_iter->wdev;
-
- if (sdata_iter == sdata ||
- !ieee80211_sdata_running(sdata_iter) ||
- cfg80211_iftype_allowed(local->hw.wiphy,
- wdev_iter->iftype, 0, 1))
- continue;
-
- params.iftype_num[wdev_iter->iftype]++;
- total++;
- }
-
if (total == 1 && !params.radar_detect)
Here, total is always 1. no ?
return 0;
--
Karthikeyan Periyasamy
--
கார்த்திகேயன் பெரியசாமி