]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mac80211_hwsim: fix overwriting of if_combination
authorJames Prestwood <james.prestwood@linux.intel.com>
Wed, 12 Dec 2018 00:52:14 +0000 (16:52 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 18 Dec 2018 12:13:32 +0000 (13:13 +0100)
Moved setting if_combination.num_different_channels/radar_detect_widths
into an else after use_chanctx. In the case of use_chanctx, these two
settings were getting overwritten.

Signed-off-by: James Prestwood <james.prestwood@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c

index 2a5a133f23cfe46913bd783b6f88cf9c8d335ae0..e4db8e2b2b548dec59bc26ed7299a59cab05799b 100644 (file)
@@ -2751,17 +2751,18 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
                hw->wiphy->max_remain_on_channel_duration = 1000;
                data->if_combination.radar_detect_widths = 0;
                data->if_combination.num_different_channels = data->channels;
-       }
-
-       data->if_combination.n_limits = n_limits;
-       data->if_combination.max_interfaces = 2048;
-       data->if_combination.num_different_channels = 1;
-       data->if_combination.radar_detect_widths =
+       } else {
+               data->if_combination.num_different_channels = 1;
+               data->if_combination.radar_detect_widths =
                                        BIT(NL80211_CHAN_WIDTH_20_NOHT) |
                                        BIT(NL80211_CHAN_WIDTH_20) |
                                        BIT(NL80211_CHAN_WIDTH_40) |
                                        BIT(NL80211_CHAN_WIDTH_80) |
                                        BIT(NL80211_CHAN_WIDTH_160);
+       }
+
+       data->if_combination.n_limits = n_limits;
+       data->if_combination.max_interfaces = 2048;
        data->if_combination.limits = data->if_limits;
 
        hw->wiphy->iface_combinations = &data->if_combination;