wifi: iwlwifi: mvm: cleanup iwl_mvm_get_wd_timeout
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Thu, 8 Aug 2024 20:22:46 +0000 (23:22 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Aug 2024 08:28:55 +0000 (10:28 +0200)
This used to extract the timeout from the debug TLV
(FW_DBG_TRIGGER_TXQ_TIMERS), which is not in use.
Cleanup iwl_mvm_get_wd_timeout to not consider the debug TLV.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20240808232017.7a6944bc2e38.I532b4b5487c6be9203ff4db9742d7cc5b148d502@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
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
drivers/net/wireless/intel/iwlwifi/mvm/utils.c

index d5a204e520764bdcd64a4829b6203650da6b4c50..071de9372843d0c76764b278ffd8cfe71ac33269 100644 (file)
@@ -216,7 +216,7 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        static const u8 _baddr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
        const u8 *baddr = _baddr;
        unsigned int wdg_timeout =
-               iwl_mvm_get_wd_timeout(mvm, vif, false, false);
+               iwl_mvm_get_wd_timeout(mvm, vif);
        u16 *queue;
 
        lockdep_assert_held(&mvm->mutex);
@@ -254,7 +254,7 @@ int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        struct iwl_mvm_int_sta *msta = &mvm_link->mcast_sta;
        static const u8 _maddr[] = {0x03, 0x00, 0x00, 0x00, 0x00, 0x00};
        const u8 *maddr = _maddr;
-       unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif, false, false);
+       unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif);
 
        lockdep_assert_held(&mvm->mutex);
 
index 65b66f01bef9855ed4ad77ee5647538db09a90ae..68464f892e85728ef90caa108ba90f9f445a729c 100644 (file)
@@ -2587,8 +2587,7 @@ u8 iwl_mvm_tcm_load_percentage(u32 airtime, u32 elapsed);
 
 void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error);
 unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,
-                                   struct ieee80211_vif *vif,
-                                   bool tdls, bool cmd_q);
+                                   struct ieee80211_vif *vif);
 void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                             const char *errmsg);
 void iwl_mvm_event_frame_timeout_callback(struct iwl_mvm *mvm,
index cf4d6425f63418be38c720b75ebfd52c1c60dc77..74bbeebe69d55f41fdd4898bc1dbc3120f2dd277 100644 (file)
@@ -900,7 +900,7 @@ static int iwl_mvm_sta_alloc_queue_tvqm(struct iwl_mvm *mvm,
        struct iwl_mvm_txq *mvmtxq =
                iwl_mvm_txq_from_tid(sta, tid);
        unsigned int wdg_timeout =
-               iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false);
+               iwl_mvm_get_wd_timeout(mvm, mvmsta->vif);
        int queue = -1;
 
        lockdep_assert_held(&mvm->mutex);
@@ -1080,7 +1080,7 @@ static void iwl_mvm_unshare_queue(struct iwl_mvm *mvm, int queue)
                return;
 
        mvmsta = iwl_mvm_sta_from_mac80211(sta);
-       wdg_timeout = iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false);
+       wdg_timeout = iwl_mvm_get_wd_timeout(mvm, mvmsta->vif);
 
        ssn = IEEE80211_SEQ_TO_SN(mvmsta->tid_data[tid].seq_number);
 
@@ -1330,7 +1330,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,
                .frame_limit = IWL_FRAME_LIMIT,
        };
        unsigned int wdg_timeout =
-               iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false);
+               iwl_mvm_get_wd_timeout(mvm, mvmsta->vif);
        int queue = -1;
        u16 queue_tmp;
        unsigned long disable_agg_tids = 0;
@@ -1622,7 +1622,7 @@ void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm,
 {
        struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
        unsigned int wdg =
-               iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif, false, false);
+               iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif);
        int i;
        struct iwl_trans_txq_scd_cfg cfg = {
                .sta_id = mvm_sta->deflink.sta_id,
@@ -2359,7 +2359,7 @@ int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
        int queue;
        int ret;
        unsigned int wdg_timeout =
-               iwl_mvm_get_wd_timeout(mvm, vif, false, false);
+               iwl_mvm_get_wd_timeout(mvm, vif);
        struct iwl_trans_txq_scd_cfg cfg = {
                .fifo = IWL_MVM_TX_FIFO_VO,
                .sta_id = mvmvif->deflink.bcast_sta.sta_id,
@@ -2568,7 +2568,7 @@ int iwl_mvm_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
                .aggregate = false,
                .frame_limit = IWL_FRAME_LIMIT,
        };
-       unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif, false, false);
+       unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif);
        int ret;
 
        lockdep_assert_held(&mvm->mutex);
@@ -3207,7 +3207,7 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
        struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid];
        unsigned int wdg_timeout =
-               iwl_mvm_get_wd_timeout(mvm, vif, sta->tdls, false);
+               iwl_mvm_get_wd_timeout(mvm, vif);
        int queue, ret;
        bool alloc_queue = true;
        enum iwl_mvm_queue_status queue_status;
@@ -4326,7 +4326,7 @@ int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        u16 queue;
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
        unsigned int wdg_timeout =
-               iwl_mvm_get_wd_timeout(mvm, vif, false, false);
+               iwl_mvm_get_wd_timeout(mvm, vif);
        bool mld = iwl_mvm_has_mld_api(mvm->fw);
        u32 type = mld ? STATION_TYPE_PEER : IWL_STA_LINK;
 
index edcc6e2cb76a84880cf1e72c14ad3e1ec24168cd..1d1364d03f028d50a8fb056c29219c8b97a4b7a1 100644 (file)
@@ -747,58 +747,20 @@ bool iwl_mvm_is_vif_assoc(struct iwl_mvm *mvm)
 }
 
 unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,
-                                   struct ieee80211_vif *vif,
-                                   bool tdls, bool cmd_q)
+                                   struct ieee80211_vif *vif)
 {
-       struct iwl_fw_dbg_trigger_tlv *trigger;
-       struct iwl_fw_dbg_trigger_txq_timer *txq_timer;
-       unsigned int default_timeout = cmd_q ?
-               IWL_DEF_WD_TIMEOUT :
+       unsigned int default_timeout =
                mvm->trans->trans_cfg->base_params->wd_timeout;
 
-       if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS)) {
-               /*
-                * We can't know when the station is asleep or awake, so we
-                * must disable the queue hang detection.
-                */
-               if (fw_has_capa(&mvm->fw->ucode_capa,
-                               IWL_UCODE_TLV_CAPA_STA_PM_NOTIF) &&
-                   vif && vif->type == NL80211_IFTYPE_AP)
-                       return IWL_WATCHDOG_DISABLED;
-               return default_timeout;
-       }
-
-       trigger = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS);
-       txq_timer = (void *)trigger->data;
-
-       if (tdls)
-               return le32_to_cpu(txq_timer->tdls);
-
-       if (cmd_q)
-               return le32_to_cpu(txq_timer->command_queue);
-
-       if (WARN_ON(!vif))
-               return default_timeout;
-
-       switch (ieee80211_vif_type_p2p(vif)) {
-       case NL80211_IFTYPE_ADHOC:
-               return le32_to_cpu(txq_timer->ibss);
-       case NL80211_IFTYPE_STATION:
-               return le32_to_cpu(txq_timer->bss);
-       case NL80211_IFTYPE_AP:
-               return le32_to_cpu(txq_timer->softap);
-       case NL80211_IFTYPE_P2P_CLIENT:
-               return le32_to_cpu(txq_timer->p2p_client);
-       case NL80211_IFTYPE_P2P_GO:
-               return le32_to_cpu(txq_timer->p2p_go);
-       case NL80211_IFTYPE_P2P_DEVICE:
-               return le32_to_cpu(txq_timer->p2p_device);
-       case NL80211_IFTYPE_MONITOR:
-               return default_timeout;
-       default:
-               WARN_ON(1);
-               return mvm->trans->trans_cfg->base_params->wd_timeout;
-       }
+       /*
+        * We can't know when the station is asleep or awake, so we
+        * must disable the queue hang detection.
+        */
+       if (fw_has_capa(&mvm->fw->ucode_capa,
+                       IWL_UCODE_TLV_CAPA_STA_PM_NOTIF) &&
+           vif->type == NL80211_IFTYPE_AP)
+               return IWL_WATCHDOG_DISABLED;
+       return default_timeout;
 }
 
 void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif,