summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/main.h
diff options
context:
space:
mode:
authorAshok Nagarajan <asnagarajan@chromium.org>2013-03-08 10:58:45 -0800
committerJohn W. Linville <linville@tuxdriver.com>2013-03-08 16:02:48 -0500
commit8908c7d5392671610a2d80107845d4aeee92d9c1 (patch)
tree5434b6c0f94bdcb7b5106b238c4905623eb93433 /drivers/net/wireless/mwifiex/main.h
parente6146c5cefedefe69676ab6b2c28a40c2d749ec2 (diff)
mwifiex: Trigger a card reset on reaching tx_timeout threshold
tx_timeout doesn't always lead to a cmd_timeout. There are occurrences where cmd_timeout never gets triggered for a long time and we encounter a kernel crash. In this patch, we track the consecutive timeouts (tx_timeout_cnt). When tx_timeout_cnt exceeds the threshold, trigger a card reset thereby avoiding a kernel crash. Signed-off-by: Ashok Nagarajan <asnagarajan@chromium.org> Signed-off-by: Paul Stewart <pstew@chromium.org> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/main.h')
-rw-r--r--drivers/net/wireless/mwifiex/main.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 560cf7312d08..920657587fff 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -130,6 +130,9 @@ enum {
#define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE
#define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE
+/* Threshold for tx_timeout_cnt before we trigger a card reset */
+#define TX_TIMEOUT_THRESHOLD 6
+
struct mwifiex_dbg {
u32 num_cmd_host_to_card_failure;
u32 num_cmd_sleep_cfm_host_to_card_failure;
@@ -394,6 +397,8 @@ struct mwifiex_private {
u8 curr_addr[ETH_ALEN];
u8 media_connected;
u32 num_tx_timeout;
+ /* track consecutive timeout */
+ u8 tx_timeout_cnt;
struct net_device *netdev;
struct net_device_stats stats;
u16 curr_pkt_filter;