aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/zd1211rw/zd_usb.h
diff options
context:
space:
mode:
authorJussi Kivilinna2011-01-31 20:49:52 +0200
committerJohn W. Linville2011-02-04 16:29:51 -0500
commita0fd751f0924e0eefa36592f1d358c4ab18b44c5 (patch)
tree35505bb17a07f66dc18b0c456bd5086efe01918c /drivers/net/wireless/zd1211rw/zd_usb.h
parent212e1a5b9df0a51d54d7841467f3f01baa1b82f1 (diff)
zd1211rw: add TX watchdog and device resetting
When doing transfers at high speed for long time, tx queue can freeze. So add tx watchdog. TX-watchdog checks for locked tx-urbs and reset hardware when such is detected. Merely unlinking urb was not enough, device have to be reseted. Hw settings are restored so that any open link will stay on after reset. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_usb.h')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h
index 24db0dd68421..98f09c2dde7e 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.h
+++ b/drivers/net/wireless/zd1211rw/zd_usb.h
@@ -32,6 +32,9 @@
#define ZD_USB_TX_HIGH 5
#define ZD_USB_TX_LOW 2
+#define ZD_TX_TIMEOUT (HZ * 5)
+#define ZD_TX_WATCHDOG_INTERVAL round_jiffies_relative(HZ)
+
enum devicetype {
DEVICE_ZD1211 = 0,
DEVICE_ZD1211B = 1,
@@ -196,9 +199,11 @@ struct zd_usb_rx {
struct zd_usb_tx {
atomic_t enabled;
spinlock_t lock;
+ struct delayed_work watchdog_work;
+ struct sk_buff_head submitted_skbs;
struct usb_anchor submitted;
int submitted_urbs;
- int stopped;
+ u8 stopped:1, watchdog_enabled:1;
};
/* Contains the usb parts. The structure doesn't require a lock because intf
@@ -210,7 +215,7 @@ struct zd_usb {
struct zd_usb_tx tx;
struct usb_interface *intf;
u8 req_buf[64]; /* zd_usb_iowrite16v needs 62 bytes */
- u8 is_zd1211b:1, initialized:1;
+ u8 is_zd1211b:1, initialized:1, was_running:1;
};
#define zd_usb_dev(usb) (&usb->intf->dev)
@@ -237,6 +242,9 @@ void zd_usb_clear(struct zd_usb *usb);
int zd_usb_scnprint_id(struct zd_usb *usb, char *buffer, size_t size);
+void zd_tx_watchdog_enable(struct zd_usb *usb);
+void zd_tx_watchdog_disable(struct zd_usb *usb);
+
int zd_usb_enable_int(struct zd_usb *usb);
void zd_usb_disable_int(struct zd_usb *usb);