Skip to content

Commit 1ae2fc2

Browse files
jmberg-intellinvjw
authored andcommitted
mac80211_hwsim: advertise interface combinations
Enforcing interface combinations broke uses of hwsim with multiple virtual interfaces. Advertise that all combinations are possible to fix this. Reported-by: Nirav Shah <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent bd34ab6 commit 1ae2fc2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/net/wireless/mac80211_hwsim.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,24 @@ static void hwsim_exit_netlink(void)
17211721
"unregister family %i\n", ret);
17221722
}
17231723

1724+
static const struct ieee80211_iface_limit hwsim_if_limits[] = {
1725+
{ .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
1726+
{ .max = 2048, .types = BIT(NL80211_IFTYPE_STATION) |
1727+
BIT(NL80211_IFTYPE_P2P_CLIENT) |
1728+
#ifdef CONFIG_MAC80211_MESH
1729+
BIT(NL80211_IFTYPE_MESH_POINT) |
1730+
#endif
1731+
BIT(NL80211_IFTYPE_AP) |
1732+
BIT(NL80211_IFTYPE_P2P_GO) },
1733+
};
1734+
1735+
static const struct ieee80211_iface_combination hwsim_if_comb = {
1736+
.limits = hwsim_if_limits,
1737+
.n_limits = ARRAY_SIZE(hwsim_if_limits),
1738+
.max_interfaces = 2048,
1739+
.num_different_channels = 1,
1740+
};
1741+
17241742
static int __init init_mac80211_hwsim(void)
17251743
{
17261744
int i, err = 0;
@@ -1782,6 +1800,9 @@ static int __init init_mac80211_hwsim(void)
17821800
hw->wiphy->n_addresses = 2;
17831801
hw->wiphy->addresses = data->addresses;
17841802

1803+
hw->wiphy->iface_combinations = &hwsim_if_comb;
1804+
hw->wiphy->n_iface_combinations = 1;
1805+
17851806
if (fake_hw_scan) {
17861807
hw->wiphy->max_scan_ssids = 255;
17871808
hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;

0 commit comments

Comments
 (0)