@@ -792,17 +792,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
*/
if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS))
return -EINVAL;
-
- /* DFS is not supported with multi-channel combinations yet */
- for (i = 0; i < local->hw.wiphy->n_iface_combinations; i++) {
- const struct ieee80211_iface_combination *comb;
-
- comb = &local->hw.wiphy->iface_combinations[i];
-
- if (comb->radar_detect_widths &&
- comb->num_different_channels > 1)
- return -EINVAL;
- }
}
/* Only HW csum features are currently compatible with mac80211 */
@@ -2625,6 +2625,9 @@ void ieee80211_dfs_radar_detected_work(struct work_struct *work)
if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER)
continue;
+ if (!ctx->conf.radar_enabled)
+ continue;
+
num_chanctx++;
chandef = ctx->conf.def;
}
@@ -453,7 +453,7 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
int i, j;
for (i = 0; i < wiphy->n_iface_combinations; i++) {
- u32 cnt = 0;
+ u32 cnt = 0, dfs_cnt = 0;
u16 all_iftypes = 0;
c = &wiphy->iface_combinations[i];
@@ -477,11 +477,6 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
CFG80211_MAX_NUM_DIFFERENT_CHANNELS))
return -EINVAL;
- /* DFS only works on one channel. */
- if (WARN_ON(c->radar_detect_widths &&
- (c->num_different_channels > 1)))
- return -EINVAL;
-
if (WARN_ON(!c->n_limits))
return -EINVAL;
@@ -505,6 +500,22 @@ static int wiphy_verify_combinations(struct wiphy *wiphy)
c->limits[j].max > 1))
return -EINVAL;
+ if (types & (BIT(NL80211_IFTYPE_AP) |
+ BIT(NL80211_IFTYPE_P2P_GO) |
+ BIT(NL80211_IFTYPE_ADHOC) |
+ BIT(NL80211_IFTYPE_MESH_POINT))) {
+ dfs_cnt += c->limits[j].max;
+
+ /*
+ * Multiple DFS masters on multiple channels
+ * are not supported yet.
+ */
+ if (WARN_ON(c->radar_detect_widths &&
+ c->num_different_channels > 1 &&
+ dfs_cnt > 1))
+ return -EINVAL;
+ }
+
cnt += c->limits[j].max;
/*
* Don't advertise an unsupported type
Allow some multi-channel interface combinations along with DFS master support, if there is only a single AP/GO. Allowing other interface types at the same time is fine (as long as the device supports them), and doesn't require additional code. Update ieee80211_dfs_radar_detected_work() to consider this case, and look specifically for the chanctx with radar_enabled. Signed-off-by: Eliad Peller <eliad@wizery.com> --- net/mac80211/main.c | 11 ----------- net/mac80211/util.c | 3 +++ net/wireless/core.c | 23 +++++++++++++++++------ 3 files changed, 20 insertions(+), 17 deletions(-)