diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:58:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:58:21 -0400 |
commit | d6454706c382ab74e2ecad7803c434cc6bd30343 (patch) | |
tree | 2a380b28eb948d114c491f0b6799c10406030849 /drivers/hid/usbhid/usbhid.h | |
parent | 152a6a9da1bd3ed5dcbbf6ff17c7ebde0eb9a754 (diff) | |
parent | 11941a321d49cd2cafc8e64f66cbfed60fc1c691 (diff) |
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jikos/hid: (21 commits)
USB HID: don't warn on idVendor == 0
USB HID: add 'quirks' module parameter
USB HID: add support for dynamically-created quirks
USB HID: clarify static quirk handling as squirks
USB HID: encapsulate quirk handling into hid-quirks.c
USB HID: EMS USBII device needs HID_QUIRK_MULTI_INPUT
HID: update copyright and authorship macro
HID: introduce proper zeroing of unused bits in output reports
USB HID: add support for WiseGroup MP-8800 Quad Joypad
USB HID: add FF support for Logitech Force 3D Pro Joystick
USB HID: numlock quirk for dell W7658 keyboard
USB HID: Logitech MX3000 keyboard needs report descriptor quirk
USB HID: extend quirk for Logitech S510 keyboard
USB HID: usbkbd/usbmouse - handle errors when registering devices
USB HID: add QUIRK_HIDDEV for Belkin Flip KVM
HID: enable dead keys on a belkin wireless keyboard
USB HID: Thustmaster firestorm dual power v1 support
USB HID: specify explicit size for hid_blacklist.quirks
USB HID: fix retry & reset logic
USB HID: consolidate vendor/product ids
...
Diffstat (limited to 'drivers/hid/usbhid/usbhid.h')
-rw-r--r-- | drivers/hid/usbhid/usbhid.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h new file mode 100644 index 000000000000..0023f96d4294 --- /dev/null +++ b/drivers/hid/usbhid/usbhid.h | |||
@@ -0,0 +1,87 @@ | |||
1 | #ifndef __USBHID_H | ||
2 | #define __USBHID_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (c) 1999 Andreas Gal | ||
6 | * Copyright (c) 2000-2001 Vojtech Pavlik | ||
7 | * Copyright (c) 2006 Jiri Kosina | ||
8 | */ | ||
9 | |||
10 | /* | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | #include <linux/slab.h> | ||
29 | #include <linux/list.h> | ||
30 | #include <linux/timer.h> | ||
31 | #include <linux/workqueue.h> | ||
32 | #include <linux/input.h> | ||
33 | |||
34 | /* API provided by hid-core.c for USB HID drivers */ | ||
35 | int usbhid_wait_io(struct hid_device* hid); | ||
36 | void usbhid_close(struct hid_device *hid); | ||
37 | int usbhid_open(struct hid_device *hid); | ||
38 | void usbhid_init_reports(struct hid_device *hid); | ||
39 | void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, unsigned char dir); | ||
40 | |||
41 | /* | ||
42 | * USB-specific HID struct, to be pointed to | ||
43 | * from struct hid_device->driver_data | ||
44 | */ | ||
45 | |||
46 | struct usbhid_device { | ||
47 | struct hid_device *hid; /* pointer to corresponding HID dev */ | ||
48 | |||
49 | struct usb_interface *intf; /* USB interface */ | ||
50 | int ifnum; /* USB interface number */ | ||
51 | |||
52 | unsigned int bufsize; /* URB buffer size */ | ||
53 | |||
54 | struct urb *urbin; /* Input URB */ | ||
55 | char *inbuf; /* Input buffer */ | ||
56 | dma_addr_t inbuf_dma; /* Input buffer dma */ | ||
57 | spinlock_t inlock; /* Input fifo spinlock */ | ||
58 | |||
59 | struct urb *urbctrl; /* Control URB */ | ||
60 | struct usb_ctrlrequest *cr; /* Control request struct */ | ||
61 | dma_addr_t cr_dma; /* Control request struct dma */ | ||
62 | struct hid_control_fifo ctrl[HID_CONTROL_FIFO_SIZE]; /* Control fifo */ | ||
63 | unsigned char ctrlhead, ctrltail; /* Control fifo head & tail */ | ||
64 | char *ctrlbuf; /* Control buffer */ | ||
65 | dma_addr_t ctrlbuf_dma; /* Control buffer dma */ | ||
66 | spinlock_t ctrllock; /* Control fifo spinlock */ | ||
67 | |||
68 | struct urb *urbout; /* Output URB */ | ||
69 | struct hid_report *out[HID_CONTROL_FIFO_SIZE]; /* Output pipe fifo */ | ||
70 | unsigned char outhead, outtail; /* Output pipe fifo head & tail */ | ||
71 | char *outbuf; /* Output buffer */ | ||
72 | dma_addr_t outbuf_dma; /* Output buffer dma */ | ||
73 | spinlock_t outlock; /* Output fifo spinlock */ | ||
74 | |||
75 | unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */ | ||
76 | struct timer_list io_retry; /* Retry timer */ | ||
77 | unsigned long stop_retry; /* Time to give up, in jiffies */ | ||
78 | unsigned int retry_delay; /* Delay length in ms */ | ||
79 | struct work_struct reset_work; /* Task context for resets */ | ||
80 | |||
81 | }; | ||
82 | |||
83 | #define hid_to_usb_dev(hid_dev) \ | ||
84 | container_of(hid_dev->dev->parent, struct usb_device, dev) | ||
85 | |||
86 | #endif | ||
87 | |||