summaryrefslogtreecommitdiff
path: root/drivers/usb/input/hid.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-01-31 12:58:38 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 14:49:56 -0800
commitaef4e266964bc15861b5835c1f5b9d2ebc155c2a (patch)
tree49d606bc0843231942231b801dc3010ca32ab4f7 /drivers/usb/input/hid.h
parentfb669cc01ed778c4926f395e44a9b61644597d38 (diff)
downloadlinux-aef4e266964bc15861b5835c1f5b9d2ebc155c2a.tar.gz
linux-aef4e266964bc15861b5835c1f5b9d2ebc155c2a.tar.xz
[PATCH] usbhid: add error handling
This patch (as628c) adds error handling to the USB HID core. When an error is reported for an interrupt URB, the driver will do delayed retries, at increasing intervals, for up to one second. If that doesn't work, it will try to reset the device. Testing by users has shown that both the retries and the resets end up getting used. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/input/hid.h')
-rw-r--r--drivers/usb/input/hid.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
index 8b0d4346ce9c..4e1b784fe527 100644
--- a/drivers/usb/input/hid.h
+++ b/drivers/usb/input/hid.h
@@ -31,6 +31,8 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/list.h>
+#include <linux/timer.h>
+#include <linux/workqueue.h>
/*
* USB HID (Human Interface Device) interface class code
@@ -370,6 +372,9 @@ struct hid_control_fifo {
#define HID_CTRL_RUNNING 1
#define HID_OUT_RUNNING 2
+#define HID_IN_RUNNING 3
+#define HID_RESET_PENDING 4
+#define HID_SUSPENDED 5
struct hid_input {
struct list_head list;
@@ -393,12 +398,17 @@ struct hid_device { /* device report descriptor */
int ifnum; /* USB interface number */
unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
+ struct timer_list io_retry; /* Retry timer */
+ unsigned long stop_retry; /* Time to give up, in jiffies */
+ unsigned int retry_delay; /* Delay length in ms */
+ struct work_struct reset_work; /* Task context for resets */
unsigned int bufsize; /* URB buffer size */
struct urb *urbin; /* Input URB */
char *inbuf; /* Input buffer */
dma_addr_t inbuf_dma; /* Input buffer dma */
+ spinlock_t inlock; /* Input fifo spinlock */
struct urb *urbctrl; /* Control URB */
struct usb_ctrlrequest *cr; /* Control request struct */