diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 98cfbb6d2369..4653deada05b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1765,6 +1765,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1765 | { | 1765 | { |
1766 | struct iwl_priv *priv = hw->priv; | 1766 | struct iwl_priv *priv = hw->priv; |
1767 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); | 1767 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); |
1768 | struct iwl_rxon_context *bss_ctx = &priv->contexts[IWL_RXON_CTX_BSS]; | ||
1768 | struct iwl_rxon_context *tmp; | 1769 | struct iwl_rxon_context *tmp; |
1769 | u32 interface_modes; | 1770 | u32 interface_modes; |
1770 | int err; | 1771 | int err; |
@@ -1789,6 +1790,19 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1789 | goto out; | 1790 | goto out; |
1790 | } | 1791 | } |
1791 | 1792 | ||
1793 | /* | ||
1794 | * Refuse a change that should be done by moving from the PAN | ||
1795 | * context to the BSS context instead, if the BSS context is | ||
1796 | * available and can support the new interface type. | ||
1797 | */ | ||
1798 | if (ctx->ctxid == IWL_RXON_CTX_PAN && !bss_ctx->vif && | ||
1799 | (bss_ctx->interface_modes & BIT(newtype) || | ||
1800 | bss_ctx->exclusive_interface_modes & BIT(newtype))) { | ||
1801 | BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2); | ||
1802 | err = -EBUSY; | ||
1803 | goto out; | ||
1804 | } | ||
1805 | |||
1792 | if (ctx->exclusive_interface_modes & BIT(newtype)) { | 1806 | if (ctx->exclusive_interface_modes & BIT(newtype)) { |
1793 | for_each_context(priv, tmp) { | 1807 | for_each_context(priv, tmp) { |
1794 | if (ctx == tmp) | 1808 | if (ctx == tmp) |