From 3abdc2e96b05dbbe30b506514e0d6110940b049b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 17 Dec 2015 01:17:08 +0100 Subject: [PATCH] move interface combinations back to individual drivers to deal with different maximum number of interfaces Signed-off-by: Felix Fietkau --- mac80211.c | 27 --------------------------- mt7603_init.c | 26 ++++++++++++++++++++++++++ mt76x2_init.c | 27 +++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 27 deletions(-) diff --git a/mac80211.c b/mac80211.c index c30d8a8d..971401c6 100644 --- a/mac80211.c +++ b/mac80211.c @@ -159,30 +159,6 @@ mt76_init_sband_5g(struct mt76_dev *dev, struct ieee80211_rate *rates, rates, n_rates, vht); } -static const struct ieee80211_iface_limit if_limits[] = { - { - .max = 1, - .types = BIT(NL80211_IFTYPE_ADHOC) - }, { - .max = 8, - .types = BIT(NL80211_IFTYPE_STATION) | -#ifdef CONFIG_MAC80211_MESH - BIT(NL80211_IFTYPE_MESH_POINT) | -#endif - BIT(NL80211_IFTYPE_AP) - }, -}; - -static const struct ieee80211_iface_combination if_comb[] = { - { - .limits = if_limits, - .n_limits = ARRAY_SIZE(if_limits), - .max_interfaces = 8, - .num_different_channels = 1, - .beacon_int_infra_match = true, - } -}; - int mt76_register_device(struct mt76_dev *dev, bool vht, struct ieee80211_rate *rates, int n_rates) { @@ -200,9 +176,6 @@ int mt76_register_device(struct mt76_dev *dev, bool vht, #endif BIT(NL80211_IFTYPE_ADHOC); - wiphy->iface_combinations = if_comb; - wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); - wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR; hw->txq_data_size = sizeof(struct mt76_txq); diff --git a/mt7603_init.c b/mt7603_init.c index 39fad5e1..aca74dcf 100644 --- a/mt7603_init.c +++ b/mt7603_init.c @@ -277,6 +277,29 @@ static struct ieee80211_rate mt7603_rates[] = { OFDM_RATE(12, 540), }; +static const struct ieee80211_iface_limit if_limits[] = { + { + .max = 1, + .types = BIT(NL80211_IFTYPE_ADHOC) + }, { + .max = 4, + .types = BIT(NL80211_IFTYPE_STATION) | +#ifdef CONFIG_MAC80211_MESH + BIT(NL80211_IFTYPE_MESH_POINT) | +#endif + BIT(NL80211_IFTYPE_AP) + }, +}; + +static const struct ieee80211_iface_combination if_comb[] = { + { + .limits = if_limits, + .n_limits = ARRAY_SIZE(if_limits), + .max_interfaces = 4, + .num_different_channels = 1, + .beacon_int_infra_match = true, + } +}; int mt7603_register_device(struct mt7603_dev *dev) { @@ -302,6 +325,9 @@ int mt7603_register_device(struct mt7603_dev *dev) SET_IEEE80211_PERM_ADDR(hw, dev->macaddr); + wiphy->iface_combinations = if_comb; + wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); + ret = mt76_register_device(&dev->mt76, true, mt7603_rates, ARRAY_SIZE(mt7603_rates)); if (ret) diff --git a/mt76x2_init.c b/mt76x2_init.c index 2229cd20..7b5e4f3a 100644 --- a/mt76x2_init.c +++ b/mt76x2_init.c @@ -609,6 +609,30 @@ static struct ieee80211_rate mt76x2_rates[] = { OFDM_RATE(7, 540), }; +static const struct ieee80211_iface_limit if_limits[] = { + { + .max = 1, + .types = BIT(NL80211_IFTYPE_ADHOC) + }, { + .max = 8, + .types = BIT(NL80211_IFTYPE_STATION) | +#ifdef CONFIG_MAC80211_MESH + BIT(NL80211_IFTYPE_MESH_POINT) | +#endif + BIT(NL80211_IFTYPE_AP) + }, +}; + +static const struct ieee80211_iface_combination if_comb[] = { + { + .limits = if_limits, + .n_limits = ARRAY_SIZE(if_limits), + .max_interfaces = 8, + .num_different_channels = 1, + .beacon_int_infra_match = true, + } +}; + int mt76x2_register_device(struct mt76x2_dev *dev) { struct ieee80211_hw *hw = mt76_hw(dev); @@ -654,6 +678,9 @@ int mt76x2_register_device(struct mt76x2_dev *dev) wiphy->addresses = dev->macaddr_list; wiphy->n_addresses = ARRAY_SIZE(dev->macaddr_list); + wiphy->iface_combinations = if_comb; + wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); + INIT_LIST_HEAD(&dev->txwi_cache); INIT_DELAYED_WORK(&dev->cal_work, mt76x2_phy_calibrate); INIT_DELAYED_WORK(&dev->mac_work, mt76x2_mac_work);