diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 |
2 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 0725603dbf1d..59d1968e6ae9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1732,10 +1732,31 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1732 | return err; | 1732 | return err; |
1733 | } | 1733 | } |
1734 | 1734 | ||
1735 | int iwl_cmd_echo_test(struct iwl_priv *priv) | ||
1736 | { | ||
1737 | struct iwl_host_cmd cmd = { | ||
1738 | .id = REPLY_ECHO, | ||
1739 | .flags = CMD_SYNC, | ||
1740 | }; | ||
1741 | |||
1742 | return iwl_trans_send_cmd(trans(priv), &cmd); | ||
1743 | } | ||
1744 | |||
1735 | static inline int iwl_check_stuck_queue(struct iwl_priv *priv, int txq) | 1745 | static inline int iwl_check_stuck_queue(struct iwl_priv *priv, int txq) |
1736 | { | 1746 | { |
1737 | if (iwl_trans_check_stuck_queue(trans(priv), txq)) { | 1747 | if (iwl_trans_check_stuck_queue(trans(priv), txq)) { |
1738 | int ret = iwl_force_reset(priv, IWL_FW_RESET, false); | 1748 | int ret; |
1749 | if (txq == priv->shrd->cmd_queue) { | ||
1750 | /* | ||
1751 | * validate command queue still working | ||
1752 | * by sending "ECHO" command | ||
1753 | */ | ||
1754 | if (!iwl_cmd_echo_test(priv)) | ||
1755 | return 0; | ||
1756 | else | ||
1757 | IWL_DEBUG_HC(priv, "echo testing fail\n"); | ||
1758 | } | ||
1759 | ret = iwl_force_reset(priv, IWL_FW_RESET, false); | ||
1739 | return (ret == -EAGAIN) ? 0 : 1; | 1760 | return (ret == -EAGAIN) ? 0 : 1; |
1740 | } | 1761 | } |
1741 | return 0; | 1762 | return 0; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index db50b650756c..080c35543881 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -266,6 +266,7 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw, | |||
266 | int iwl_mac_change_interface(struct ieee80211_hw *hw, | 266 | int iwl_mac_change_interface(struct ieee80211_hw *hw, |
267 | struct ieee80211_vif *vif, | 267 | struct ieee80211_vif *vif, |
268 | enum nl80211_iftype newtype, bool newp2p); | 268 | enum nl80211_iftype newtype, bool newp2p); |
269 | int iwl_cmd_echo_test(struct iwl_priv *priv); | ||
269 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 270 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
270 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); | 271 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); |
271 | void iwl_free_traffic_mem(struct iwl_priv *priv); | 272 | void iwl_free_traffic_mem(struct iwl_priv *priv); |