aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hid.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r--include/linux/hid.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 898103b401f1..6e35b92b1d2c 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -29,13 +29,6 @@
29 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic 29 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
30 */ 30 */
31 31
32#include <linux/types.h>
33#include <linux/slab.h>
34#include <linux/list.h>
35#include <linux/timer.h>
36#include <linux/workqueue.h>
37#include <linux/input.h>
38
39/* 32/*
40 * USB HID (Human Interface Device) interface class code 33 * USB HID (Human Interface Device) interface class code
41 */ 34 */
@@ -69,6 +62,17 @@
69#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02) 62#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
70#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03) 63#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
71 64
65#define HID_MAX_DESCRIPTOR_SIZE 4096
66
67#ifdef __KERNEL__
68
69#include <linux/types.h>
70#include <linux/slab.h>
71#include <linux/list.h>
72#include <linux/timer.h>
73#include <linux/workqueue.h>
74#include <linux/input.h>
75
72/* 76/*
73 * We parse each description item into this structure. Short items data 77 * We parse each description item into this structure. Short items data
74 * values are expanded to 32-bit signed int, long items contain a pointer 78 * values are expanded to 32-bit signed int, long items contain a pointer
@@ -276,6 +280,7 @@ struct hid_item {
276#define HID_QUIRK_HIDINPUT 0x00200000 280#define HID_QUIRK_HIDINPUT 0x00200000
277#define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 281#define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000
278#define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 282#define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000
283#define HID_QUIRK_IGNORE_HIDINPUT 0x01000000
279 284
280/* 285/*
281 * Separate quirks for runtime report descriptor fixup 286 * Separate quirks for runtime report descriptor fixup
@@ -285,6 +290,7 @@ struct hid_item {
285#define HID_QUIRK_RDESC_LOGITECH 0x00000002 290#define HID_QUIRK_RDESC_LOGITECH 0x00000002
286#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004 291#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004
287#define HID_QUIRK_RDESC_PETALYNX 0x00000008 292#define HID_QUIRK_RDESC_PETALYNX 0x00000008
293#define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010
288 294
289/* 295/*
290 * This is the global environment of the parser. This information is 296 * This is the global environment of the parser. This information is
@@ -309,7 +315,6 @@ struct hid_global {
309 * This is the local environment. It is persistent up the next main-item. 315 * This is the local environment. It is persistent up the next main-item.
310 */ 316 */
311 317
312#define HID_MAX_DESCRIPTOR_SIZE 4096
313#define HID_MAX_USAGES 8192 318#define HID_MAX_USAGES 8192
314#define HID_DEFAULT_NUM_COLLECTIONS 16 319#define HID_DEFAULT_NUM_COLLECTIONS 16
315 320
@@ -403,6 +408,7 @@ struct hid_control_fifo {
403 408
404#define HID_CLAIMED_INPUT 1 409#define HID_CLAIMED_INPUT 1
405#define HID_CLAIMED_HIDDEV 2 410#define HID_CLAIMED_HIDDEV 2
411#define HID_CLAIMED_HIDRAW 4
406 412
407#define HID_CTRL_RUNNING 1 413#define HID_CTRL_RUNNING 1
408#define HID_OUT_RUNNING 2 414#define HID_OUT_RUNNING 2
@@ -438,6 +444,7 @@ struct hid_device { /* device report descriptor */
438 444
439 struct list_head inputs; /* The list of inputs */ 445 struct list_head inputs; /* The list of inputs */
440 void *hiddev; /* The hiddev structure */ 446 void *hiddev; /* The hiddev structure */
447 void *hidraw;
441 int minor; /* Hiddev minor number */ 448 int minor; /* Hiddev minor number */
442 449
443 wait_queue_head_t wait; /* For sleeping */ 450 wait_queue_head_t wait; /* For sleeping */
@@ -458,9 +465,12 @@ struct hid_device { /* device report descriptor */
458 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, 465 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
459 struct hid_usage *, __s32); 466 struct hid_usage *, __s32);
460 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); 467 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
468
469 /* handler for raw output data, used by hidraw */
470 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
461#ifdef CONFIG_USB_HIDINPUT_POWERBOOK 471#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
462 unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; 472 unsigned long pb_pressed_fn[BITS_TO_LONGS(KEY_CNT)];
463 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; 473 unsigned long pb_pressed_numlock[BITS_TO_LONGS(KEY_CNT)];
464#endif 474#endif
465}; 475};
466 476
@@ -553,4 +563,5 @@ static inline int hid_ff_init(struct hid_device *hid) { return -1; }
553#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 563#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
554 __FILE__ , ## arg) 564 __FILE__ , ## arg)
555#endif 565#endif
566#endif
556 567