aboutsummaryrefslogtreecommitdiffstats
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 17:49:56 -0500
commitaef4e266964bc15861b5835c1f5b9d2ebc155c2a (patch)
tree49d606bc0843231942231b801dc3010ca32ab4f7 /drivers/usb/input/hid.h
parentfb669cc01ed778c4926f395e44a9b61644597d38 (diff)
[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 @@
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/list.h> 33#include <linux/list.h>
34#include <linux/timer.h>
35#include <linux/workqueue.h>
34 36
35/* 37/*
36 * USB HID (Human Interface Device) interface class code 38 * USB HID (Human Interface Device) interface class code
@@ -370,6 +372,9 @@ struct hid_control_fifo {
370 372
371#define HID_CTRL_RUNNING 1 373#define HID_CTRL_RUNNING 1
372#define HID_OUT_RUNNING 2 374#define HID_OUT_RUNNING 2
375#define HID_IN_RUNNING 3
376#define HID_RESET_PENDING 4
377#define HID_SUSPENDED 5
373 378
374struct hid_input { 379struct hid_input {
375 struct list_head list; 380 struct list_head list;
@@ -393,12 +398,17 @@ struct hid_device { /* device report descriptor */
393 int ifnum; /* USB interface number */ 398 int ifnum; /* USB interface number */
394 399
395 unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */ 400 unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
401 struct timer_list io_retry; /* Retry timer */
402 unsigned long stop_retry; /* Time to give up, in jiffies */
403 unsigned int retry_delay; /* Delay length in ms */
404 struct work_struct reset_work; /* Task context for resets */
396 405
397 unsigned int bufsize; /* URB buffer size */ 406 unsigned int bufsize; /* URB buffer size */
398 407
399 struct urb *urbin; /* Input URB */ 408 struct urb *urbin; /* Input URB */
400 char *inbuf; /* Input buffer */ 409 char *inbuf; /* Input buffer */
401 dma_addr_t inbuf_dma; /* Input buffer dma */ 410 dma_addr_t inbuf_dma; /* Input buffer dma */
411 spinlock_t inlock; /* Input fifo spinlock */
402 412
403 struct urb *urbctrl; /* Control URB */ 413 struct urb *urbctrl; /* Control URB */
404 struct usb_ctrlrequest *cr; /* Control request struct */ 414 struct usb_ctrlrequest *cr; /* Control request struct */