iwlwifi: mvm: implement CSA abort
authorSara Sharon <sara.sharon@intel.com>
Sun, 25 Nov 2018 11:42:29 +0000 (13:42 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 22 Mar 2019 10:59:39 +0000 (12:59 +0200)
In case we receive abort operation for CSA, clean up
our state.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

index 1bdc27d07d748426ab97a884d80db36913b7929f..b5a9e83cc034c28cd1536bdecc727b72fdd5168d 100644 (file)
@@ -4631,6 +4631,29 @@ out_unlock:
        return ret;
 }
 
+static void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw,
+                                        struct ieee80211_vif *vif)
+{
+       struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+       struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+       struct iwl_chan_switch_te_cmd cmd = {
+               .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id,
+                                                         mvmvif->color)),
+               .action = cpu_to_le32(FW_CTXT_ACTION_REMOVE),
+       };
+
+       IWL_DEBUG_MAC80211(mvm, "Abort CSA on mac %d\n", mvmvif->id);
+
+       mutex_lock(&mvm->mutex);
+       WARN_ON(iwl_mvm_send_cmd_pdu(mvm,
+                                    WIDE_ID(MAC_CONF_GROUP,
+                                            CHANNEL_SWITCH_TIME_EVENT_CMD),
+                                    0, sizeof(cmd), &cmd));
+       mutex_unlock(&mvm->mutex);
+
+       WARN_ON(iwl_mvm_post_channel_switch(hw, vif));
+}
+
 static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop)
 {
        int i;
@@ -5087,6 +5110,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = {
        .channel_switch = iwl_mvm_channel_switch,
        .pre_channel_switch = iwl_mvm_pre_channel_switch,
        .post_channel_switch = iwl_mvm_post_channel_switch,
+       .abort_channel_switch = iwl_mvm_abort_channel_switch,
 
        .tdls_channel_switch = iwl_mvm_tdls_channel_switch,
        .tdls_cancel_channel_switch = iwl_mvm_tdls_cancel_channel_switch,