iwlwifi: remove CMD_SYNC
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / iwlwifi / mvm / mac-ctxt.c
index 9ccec10bba166299cc91cf1706992937127d277a..d5f50afe942a6336821dc80cf77ee1312659ce65 100644 (file)
@@ -667,12 +667,9 @@ static void iwl_mvm_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
        if (vif->bss_conf.qos)
                cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA);
 
-       /* Don't use cts to self as the fw doesn't support it currently. */
        if (vif->bss_conf.use_cts_prot) {
                cmd->protection_flags |= cpu_to_le32(MAC_PROT_FLG_TGG_PROTECT);
-               if (IWL_UCODE_API(mvm->fw->ucode_ver) >= 8)
-                       cmd->protection_flags |=
-                               cpu_to_le32(MAC_PROT_FLG_SELF_CTS_EN);
+               cmd->protection_flags |= cpu_to_le32(MAC_PROT_FLG_SELF_CTS_EN);
        }
        IWL_DEBUG_RATE(mvm, "use_cts_prot %d, ht_operation_mode %d\n",
                       vif->bss_conf.use_cts_prot,
@@ -688,7 +685,7 @@ static void iwl_mvm_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
 static int iwl_mvm_mac_ctxt_send_cmd(struct iwl_mvm *mvm,
                                     struct iwl_mac_ctx_cmd *cmd)
 {
-       int ret = iwl_mvm_send_cmd_pdu(mvm, MAC_CONTEXT_CMD, CMD_SYNC,
+       int ret = iwl_mvm_send_cmd_pdu(mvm, MAC_CONTEXT_CMD, 0,
                                       sizeof(*cmd), cmd);
        if (ret)
                IWL_ERR(mvm, "Failed to send MAC context (action:%d): %d\n",
@@ -1214,7 +1211,7 @@ int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
                                                           mvmvif->color));
        cmd.action = cpu_to_le32(FW_CTXT_ACTION_REMOVE);
 
-       ret = iwl_mvm_send_cmd_pdu(mvm, MAC_CONTEXT_CMD, CMD_SYNC,
+       ret = iwl_mvm_send_cmd_pdu(mvm, MAC_CONTEXT_CMD, 0,
                                   sizeof(cmd), &cmd);
        if (ret) {
                IWL_ERR(mvm, "Failed to remove MAC context: %d\n", ret);
@@ -1240,11 +1237,23 @@ int iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,
        u32 rate __maybe_unused =
                le32_to_cpu(beacon->beacon_notify_hdr.initial_rate);
 
+       lockdep_assert_held(&mvm->mutex);
+
        IWL_DEBUG_RX(mvm, "beacon status %#x retries:%d tsf:0x%16llX rate:%d\n",
                     status & TX_STATUS_MSK,
                     beacon->beacon_notify_hdr.failure_frame,
                     le64_to_cpu(beacon->tsf),
                     rate);
+
+       if (unlikely(mvm->csa_vif && mvm->csa_vif->csa_active)) {
+               if (!ieee80211_csa_is_complete(mvm->csa_vif)) {
+                       iwl_mvm_mac_ctxt_beacon_changed(mvm, mvm->csa_vif);
+               } else {
+                       ieee80211_csa_finish(mvm->csa_vif);
+                       mvm->csa_vif = NULL;
+               }
+       }
+
        return 0;
 }