diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 98bb84613cdf..1966a6096033 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -2954,18 +2954,12 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw, | |||
2954 | mutex_unlock(&mvm->mutex); | 2954 | mutex_unlock(&mvm->mutex); |
2955 | } | 2955 | } |
2956 | 2956 | ||
2957 | static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, | 2957 | static int |
2958 | struct ieee80211_vif_chanctx_switch *vifs, | 2958 | iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm, |
2959 | int n_vifs, | 2959 | struct ieee80211_vif_chanctx_switch *vifs) |
2960 | enum ieee80211_chanctx_switch_mode mode) | ||
2961 | { | 2960 | { |
2962 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
2963 | int ret; | 2961 | int ret; |
2964 | 2962 | ||
2965 | /* we only support SWAP_CONTEXTS and with a single-vif right now */ | ||
2966 | if (mode != CHANCTX_SWMODE_SWAP_CONTEXTS || n_vifs > 1) | ||
2967 | return -EOPNOTSUPP; | ||
2968 | |||
2969 | mutex_lock(&mvm->mutex); | 2963 | mutex_lock(&mvm->mutex); |
2970 | __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); | 2964 | __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); |
2971 | __iwl_mvm_remove_chanctx(mvm, vifs[0].old_ctx); | 2965 | __iwl_mvm_remove_chanctx(mvm, vifs[0].old_ctx); |
@@ -3015,6 +3009,34 @@ out_restart: | |||
3015 | 3009 | ||
3016 | out: | 3010 | out: |
3017 | mutex_unlock(&mvm->mutex); | 3011 | mutex_unlock(&mvm->mutex); |
3012 | |||
3013 | return ret; | ||
3014 | } | ||
3015 | |||
3016 | static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, | ||
3017 | struct ieee80211_vif_chanctx_switch *vifs, | ||
3018 | int n_vifs, | ||
3019 | enum ieee80211_chanctx_switch_mode mode) | ||
3020 | { | ||
3021 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
3022 | int ret; | ||
3023 | |||
3024 | /* we only support a single-vif right now */ | ||
3025 | if (n_vifs > 1) | ||
3026 | return -EOPNOTSUPP; | ||
3027 | |||
3028 | switch (mode) { | ||
3029 | case CHANCTX_SWMODE_SWAP_CONTEXTS: | ||
3030 | ret = iwl_mvm_switch_vif_chanctx_swap(mvm, vifs); | ||
3031 | break; | ||
3032 | case CHANCTX_SWMODE_REASSIGN_VIF: | ||
3033 | ret = -EOPNOTSUPP; | ||
3034 | break; | ||
3035 | default: | ||
3036 | ret = -EOPNOTSUPP; | ||
3037 | break; | ||
3038 | } | ||
3039 | |||
3018 | return ret; | 3040 | return ret; |
3019 | } | 3041 | } |
3020 | 3042 | ||