Commit 0fd09502 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

iwlagn: advertise interface combinations

With this, iwlwifi will advertise the limits on
concurrency of virtual interfaces.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 93cce6f0
...@@ -2420,6 +2420,77 @@ static int iwl_mac_offchannel_tx_cancel_wait(struct ieee80211_hw *hw) ...@@ -2420,6 +2420,77 @@ static int iwl_mac_offchannel_tx_cancel_wait(struct ieee80211_hw *hw)
* *
*****************************************************************************/ *****************************************************************************/
static const struct ieee80211_iface_limit iwlagn_sta_ap_limits[] = {
{
.max = 1,
.types = BIT(NL80211_IFTYPE_STATION),
},
{
.max = 1,
.types = BIT(NL80211_IFTYPE_AP),
},
};
static const struct ieee80211_iface_limit iwlagn_2sta_limits[] = {
{
.max = 2,
.types = BIT(NL80211_IFTYPE_STATION),
},
};
static const struct ieee80211_iface_limit iwlagn_p2p_sta_go_limits[] = {
{
.max = 1,
.types = BIT(NL80211_IFTYPE_STATION),
},
{
.max = 1,
.types = BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_AP),
},
};
static const struct ieee80211_iface_limit iwlagn_p2p_2sta_limits[] = {
{
.max = 2,
.types = BIT(NL80211_IFTYPE_STATION),
},
{
.max = 1,
.types = BIT(NL80211_IFTYPE_P2P_CLIENT),
},
};
static const struct ieee80211_iface_combination
iwlagn_iface_combinations_dualmode[] = {
{ .num_different_channels = 1,
.max_interfaces = 2,
.beacon_int_infra_match = true,
.limits = iwlagn_sta_ap_limits,
.n_limits = ARRAY_SIZE(iwlagn_sta_ap_limits),
},
{ .num_different_channels = 1,
.max_interfaces = 2,
.limits = iwlagn_2sta_limits,
.n_limits = ARRAY_SIZE(iwlagn_2sta_limits),
},
};
static const struct ieee80211_iface_combination
iwlagn_iface_combinations_p2p[] = {
{ .num_different_channels = 1,
.max_interfaces = 2,
.beacon_int_infra_match = true,
.limits = iwlagn_p2p_sta_go_limits,
.n_limits = ARRAY_SIZE(iwlagn_p2p_sta_go_limits),
},
{ .num_different_channels = 1,
.max_interfaces = 2,
.limits = iwlagn_p2p_2sta_limits,
.n_limits = ARRAY_SIZE(iwlagn_p2p_2sta_limits),
},
};
/* /*
* Not a mac80211 entry point function, but it fits in with all the * Not a mac80211 entry point function, but it fits in with all the
* other mac80211 functions grouped here. * other mac80211 functions grouped here.
...@@ -2460,6 +2531,18 @@ static int iwl_mac_setup_register(struct iwl_priv *priv, ...@@ -2460,6 +2531,18 @@ static int iwl_mac_setup_register(struct iwl_priv *priv,
hw->wiphy->interface_modes |= ctx->exclusive_interface_modes; hw->wiphy->interface_modes |= ctx->exclusive_interface_modes;
} }
BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);
if (hw->wiphy->interface_modes & NL80211_IFTYPE_P2P_CLIENT) {
hw->wiphy->iface_combinations = iwlagn_iface_combinations_p2p;
hw->wiphy->n_iface_combinations =
ARRAY_SIZE(iwlagn_iface_combinations_p2p);
} else if (hw->wiphy->interface_modes & NL80211_IFTYPE_AP) {
hw->wiphy->iface_combinations = iwlagn_iface_combinations_dualmode;
hw->wiphy->n_iface_combinations =
ARRAY_SIZE(iwlagn_iface_combinations_dualmode);
}
hw->wiphy->max_remain_on_channel_duration = 1000; hw->wiphy->max_remain_on_channel_duration = 1000;
hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY | hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment