mwifiex: separate interface combination for multichannel and DFS
authorAvinash Patil <patila@marvell.com>
Mon, 22 Jun 2015 13:36:22 +0000 (19:06 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 21 Jul 2015 13:40:40 +0000 (16:40 +0300)
Multichannel and DFS cannot be supported at same time. So when multichannel
operation is enabled by module parameter, we enable number of channel as 2
while registering wiphy. For all other cases we advertise DFS support to
cfg80211. Patch also adds support for radar detect widths parameter.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/cfg80211.c

index bc863e95114065ee889b3ae2be3795b1e4d1e819..93e40d0e908606be430e75b3cbe1a33959d4f372 100644 (file)
@@ -35,16 +35,33 @@ static const struct ieee80211_iface_limit mwifiex_ap_sta_limits[] = {
        },
 };
 
-static const struct ieee80211_iface_combination mwifiex_iface_comb_ap_sta = {
+static const struct ieee80211_iface_combination
+mwifiex_iface_comb_ap_sta = {
        .limits = mwifiex_ap_sta_limits,
        .num_different_channels = 1,
        .n_limits = ARRAY_SIZE(mwifiex_ap_sta_limits),
        .max_interfaces = MWIFIEX_MAX_BSS_NUM,
        .beacon_int_infra_match = true,
+       .radar_detect_widths =  BIT(NL80211_CHAN_WIDTH_20_NOHT) |
+                               BIT(NL80211_CHAN_WIDTH_20) |
+                               BIT(NL80211_CHAN_WIDTH_40),
+};
+
+static const struct ieee80211_iface_combination
+mwifiex_iface_comb_ap_sta_vht = {
+       .limits = mwifiex_ap_sta_limits,
+       .num_different_channels = 1,
+       .n_limits = ARRAY_SIZE(mwifiex_ap_sta_limits),
+       .max_interfaces = MWIFIEX_MAX_BSS_NUM,
+       .beacon_int_infra_match = true,
+       .radar_detect_widths =  BIT(NL80211_CHAN_WIDTH_20_NOHT) |
+                               BIT(NL80211_CHAN_WIDTH_20) |
+                               BIT(NL80211_CHAN_WIDTH_40) |
+                               BIT(NL80211_CHAN_WIDTH_80),
 };
 
 static const struct
-ieee80211_iface_combination mwifiex_drcs_iface_comb_ap_sta = {
+ieee80211_iface_combination mwifiex_iface_comb_ap_sta_drcs = {
        .limits = mwifiex_ap_sta_limits,
        .num_different_channels = 2,
        .n_limits = ARRAY_SIZE(mwifiex_ap_sta_limits),
@@ -3755,7 +3772,9 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
                wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
 
        if (adapter->drcs_enabled && ISSUPP_DRCS_ENABLED(adapter->fw_cap_info))
-               wiphy->iface_combinations = &mwifiex_drcs_iface_comb_ap_sta;
+               wiphy->iface_combinations = &mwifiex_iface_comb_ap_sta_drcs;
+       else if (adapter->is_hw_11ac_capable)
+               wiphy->iface_combinations = &mwifiex_iface_comb_ap_sta_vht;
        else
                wiphy->iface_combinations = &mwifiex_iface_comb_ap_sta;
        wiphy->n_iface_combinations = 1;