From ddc2250c765146c6c60a2e05330de1b16141c66f Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 27 Apr 2011 05:19:34 -0700 Subject: [PATCH] --- yaml --- r: 247295 b: refs/heads/master c: ebf8dc8060e4b10e8e13abbf98544f5c6cc8b25e h: refs/heads/master i: 247293: 9d5cddd13c5310378887e61135abaf962599bf94 247291: 392d8966f9fa6ce66202e821c68aed8d363d8890 247287: ca973ab08dc399779cee44ac6efa36d27c864049 247279: 75b3b59bd6ee0a098b3d9c42f009fd521d9ea7a9 247263: 59e70fcd7072a387c96a61c77d1bcaebdffdbfc0 247231: c228e3f5b8fe7aadbee686684beec95d8450286a 247167: cd7fa911bfd68c4a8cc90a2421907e0b06f2e8ae 247039: 26842f26244e9660586b2337616aabfa1c4be766 246783: 817505d340ee4c20f1c75d9cb05fb2f60e3a249e v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/iwlwifi/iwl-core.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index cd1be42bcd59..d930c3614161 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c914ac26caf462567078f9615ffcedf1962087f2 +refs/heads/master: ebf8dc8060e4b10e8e13abbf98544f5c6cc8b25e diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c index 98cfbb6d2369..4653deada05b 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c @@ -1765,6 +1765,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, { struct iwl_priv *priv = hw->priv; struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); + struct iwl_rxon_context *bss_ctx = &priv->contexts[IWL_RXON_CTX_BSS]; struct iwl_rxon_context *tmp; u32 interface_modes; int err; @@ -1789,6 +1790,19 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, goto out; } + /* + * Refuse a change that should be done by moving from the PAN + * context to the BSS context instead, if the BSS context is + * available and can support the new interface type. + */ + if (ctx->ctxid == IWL_RXON_CTX_PAN && !bss_ctx->vif && + (bss_ctx->interface_modes & BIT(newtype) || + bss_ctx->exclusive_interface_modes & BIT(newtype))) { + BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2); + err = -EBUSY; + goto out; + } + if (ctx->exclusive_interface_modes & BIT(newtype)) { for_each_context(priv, tmp) { if (ctx == tmp)