|
@@ -1732,10 +1732,31 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
+int iwl_cmd_echo_test(struct iwl_priv *priv)
|
|
|
+{
|
|
|
+ struct iwl_host_cmd cmd = {
|
|
|
+ .id = REPLY_ECHO,
|
|
|
+ .flags = CMD_SYNC,
|
|
|
+ };
|
|
|
+
|
|
|
+ return iwl_trans_send_cmd(trans(priv), &cmd);
|
|
|
+}
|
|
|
+
|
|
|
static inline int iwl_check_stuck_queue(struct iwl_priv *priv, int txq)
|
|
|
{
|
|
|
if (iwl_trans_check_stuck_queue(trans(priv), txq)) {
|
|
|
- int ret = iwl_force_reset(priv, IWL_FW_RESET, false);
|
|
|
+ int ret;
|
|
|
+ if (txq == priv->shrd->cmd_queue) {
|
|
|
+ /*
|
|
|
+ * validate command queue still working
|
|
|
+ * by sending "ECHO" command
|
|
|
+ */
|
|
|
+ if (!iwl_cmd_echo_test(priv))
|
|
|
+ return 0;
|
|
|
+ else
|
|
|
+ IWL_DEBUG_HC(priv, "echo testing fail\n");
|
|
|
+ }
|
|
|
+ ret = iwl_force_reset(priv, IWL_FW_RESET, false);
|
|
|
return (ret == -EAGAIN) ? 0 : 1;
|
|
|
}
|
|
|
return 0;
|