diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2006-01-31 18:58:38 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-20 23:49:56 +0100 |
commit | aef4e266964bc15861b5835c1f5b9d2ebc155c2a (patch) | |
tree | 49d606bc0843231942231b801dc3010ca32ab4f7 /drivers/usb/input/hid.h | |
parent | [PATCH] USB: remove usbcore-specific wakeup flags (diff) | |
download | linux-aef4e266964bc15861b5835c1f5b9d2ebc155c2a.tar.xz linux-aef4e266964bc15861b5835c1f5b9d2ebc155c2a.zip |
[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.h | 10 |
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 */ |