diff options
author | Luciano Coelho <luciano.coelho@intel.com> | 2014-11-10 04:10:09 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-11-24 01:30:27 -0500 |
commit | 48a256e8aed05df3a90a0e9cdfcc558d139ec7f5 (patch) | |
tree | 2800b36e57f5ca06bfc10d837d7e87707aff7727 | |
parent | 50cc9574d60a507eff92537d8b01b9eb7b6a81bf (diff) |
iwlwifi: mvm: add support for CHANCTX_SWMODE_REASSIGN_VIF
Add support to reassign vif in switch_vif_chanctx. This is similar to
the existing CHANCTX_SWMODE_SWAP_CONTEXTS mode, but doesn't delete the
old context nor creates a new one, doing to switch between two
existing contexts.
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 1966a6096033..542e59f61d1c 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -3013,6 +3013,44 @@ out: | |||
3013 | return ret; | 3013 | return ret; |
3014 | } | 3014 | } |
3015 | 3015 | ||
3016 | static int | ||
3017 | iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm, | ||
3018 | struct ieee80211_vif_chanctx_switch *vifs) | ||
3019 | { | ||
3020 | int ret; | ||
3021 | |||
3022 | mutex_lock(&mvm->mutex); | ||
3023 | __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); | ||
3024 | |||
3025 | ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, | ||
3026 | true); | ||
3027 | if (ret) { | ||
3028 | IWL_ERR(mvm, | ||
3029 | "failed to assign new_ctx during channel switch\n"); | ||
3030 | goto out_reassign; | ||
3031 | } | ||
3032 | |||
3033 | goto out; | ||
3034 | |||
3035 | out_reassign: | ||
3036 | if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, | ||
3037 | true)) { | ||
3038 | IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); | ||
3039 | goto out_restart; | ||
3040 | } | ||
3041 | |||
3042 | goto out; | ||
3043 | |||
3044 | out_restart: | ||
3045 | /* things keep failing, better restart the hw */ | ||
3046 | iwl_mvm_nic_restart(mvm, false); | ||
3047 | |||
3048 | out: | ||
3049 | mutex_unlock(&mvm->mutex); | ||
3050 | |||
3051 | return ret; | ||
3052 | } | ||
3053 | |||
3016 | static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, | 3054 | static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, |
3017 | struct ieee80211_vif_chanctx_switch *vifs, | 3055 | struct ieee80211_vif_chanctx_switch *vifs, |
3018 | int n_vifs, | 3056 | int n_vifs, |
@@ -3030,7 +3068,7 @@ static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, | |||
3030 | ret = iwl_mvm_switch_vif_chanctx_swap(mvm, vifs); | 3068 | ret = iwl_mvm_switch_vif_chanctx_swap(mvm, vifs); |
3031 | break; | 3069 | break; |
3032 | case CHANCTX_SWMODE_REASSIGN_VIF: | 3070 | case CHANCTX_SWMODE_REASSIGN_VIF: |
3033 | ret = -EOPNOTSUPP; | 3071 | ret = iwl_mvm_switch_vif_chanctx_reassign(mvm, vifs); |
3034 | break; | 3072 | break; |
3035 | default: | 3073 | default: |
3036 | ret = -EOPNOTSUPP; | 3074 | ret = -EOPNOTSUPP; |