wifi: iwlwifi: mvm: do not send STA_DISABLE_TX_CMD for newer firmware
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 7 Dec 2023 02:50:16 +0000 (04:50 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 12 Dec 2023 09:37:00 +0000 (10:37 +0100)
Newest firmware has completely offloaded this logic and this command
will be deprecated soon. Based on a capability bit advertised by the
firmware, skip this command.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231207044813.e64ef70c0133.I9f47cdef2ba45f1f383b70023857376973de3a8c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/file.h
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/sta.c

index 7bbc55ccc3ceffb74d50bf85b305c4e97feea0f0..c38e5194c55f0d75a72a1de1c6cffb9ce22b1362 100644 (file)
@@ -243,6 +243,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_api_t;
  *     version tables.
  * @IWL_UCODE_TLV_API_REDUCED_SCAN_CONFIG: This ucode supports v3 of
  *  SCAN_CONFIG_DB_CMD_API_S.
+ * @IWL_UCODE_TLV_API_NO_HOST_DISABLE_TX: Firmware offloaded the station disable tx
+ *     logic.
  *
  * @NUM_IWL_UCODE_TLV_API: number of bits used
  */
@@ -280,6 +282,7 @@ enum iwl_ucode_tlv_api {
        IWL_UCODE_TLV_API_ADWELL_HB_DEF_N_AP    = (__force iwl_ucode_tlv_api_t)57,
        IWL_UCODE_TLV_API_SCAN_EXT_CHAN_VER     = (__force iwl_ucode_tlv_api_t)58,
        IWL_UCODE_TLV_API_BAND_IN_RX_DATA       = (__force iwl_ucode_tlv_api_t)59,
+       IWL_UCODE_TLV_API_NO_HOST_DISABLE_TX    = (__force iwl_ucode_tlv_api_t)66,
 
        NUM_IWL_UCODE_TLV_API
 /*
index ca5e4fbcf8ce53108448b4fe338658e04b820398..d7a0ce2bb0f7b919f663e31ec8eaec7b90f81eb8 100644 (file)
@@ -872,6 +872,9 @@ void iwl_mvm_mld_sta_modify_disable_tx(struct iwl_mvm *mvm,
        cmd.sta_id = cpu_to_le32(mvmsta->deflink.sta_id);
        cmd.disable = cpu_to_le32(disable);
 
+       if (WARN_ON(iwl_mvm_has_no_host_disable_tx(mvm)))
+               return;
+
        ret = iwl_mvm_send_cmd_pdu(mvm,
                                   WIDE_ID(MAC_CONF_GROUP, STA_DISABLE_TX_CMD),
                                   CMD_ASYNC, sizeof(cmd), &cmd);
index b04485b7e1f6d09a3c26948c944e43e3c70188a5..40627961b834a2ee860445b4557cf19498f4e166 100644 (file)
@@ -1514,6 +1514,12 @@ static inline bool iwl_mvm_has_quota_low_latency(struct iwl_mvm *mvm)
                          IWL_UCODE_TLV_API_QUOTA_LOW_LATENCY);
 }
 
+static inline bool iwl_mvm_has_no_host_disable_tx(struct iwl_mvm *mvm)
+{
+       return fw_has_api(&mvm->fw->ucode_capa,
+                         IWL_UCODE_TLV_API_NO_HOST_DISABLE_TX);
+}
+
 static inline bool iwl_mvm_has_tlc_offload(const struct iwl_mvm *mvm)
 {
        return fw_has_capa(&mvm->fw->ucode_capa,
index 49542b3cb76ebdc5e032f51f291f3404684179a9..efe3e111ea0a783add43268d81b69ef6166165c0 100644 (file)
@@ -4150,7 +4150,8 @@ void iwl_mvm_sta_modify_disable_tx(struct iwl_mvm *mvm,
        int ret;
 
        if (mvm->mld_api_is_used) {
-               iwl_mvm_mld_sta_modify_disable_tx(mvm, mvmsta, disable);
+               if (!iwl_mvm_has_no_host_disable_tx(mvm))
+                       iwl_mvm_mld_sta_modify_disable_tx(mvm, mvmsta, disable);
                return;
        }
 
@@ -4167,7 +4168,8 @@ void iwl_mvm_sta_modify_disable_tx_ap(struct iwl_mvm *mvm,
        struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
 
        if (mvm->mld_api_is_used) {
-               iwl_mvm_mld_sta_modify_disable_tx_ap(mvm, sta, disable);
+               if (!iwl_mvm_has_no_host_disable_tx(mvm))
+                       iwl_mvm_mld_sta_modify_disable_tx_ap(mvm, sta, disable);
                return;
        }
 
@@ -4222,7 +4224,9 @@ void iwl_mvm_modify_all_sta_disable_tx(struct iwl_mvm *mvm,
        int i;
 
        if (mvm->mld_api_is_used) {
-               iwl_mvm_mld_modify_all_sta_disable_tx(mvm, mvmvif, disable);
+               if (!iwl_mvm_has_no_host_disable_tx(mvm))
+                       iwl_mvm_mld_modify_all_sta_disable_tx(mvm, mvmvif,
+                                                             disable);
                return;
        }