summaryrefslogtreecommitdiffstats
path: root/include/linux/hidraw.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-14 09:03:42 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-14 09:03:42 -0700
commit52d4e661ac92ab8e1a312fe527221a1311fe4cda (patch)
tree907f37beba526bac7dcffbef7253de3b445a2c1e /include/linux/hidraw.h
parentf248488b397d52717f6683e2e53200aa687ffc89 (diff)
parentd057fd4cb892087955568a139d15eae4115a0174 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (21 commits) HID: hidraw_connect() memleak fix HID: add hidraw interface USB HID: provide hook for hidraw write() HID: hiddev: Add 32bit ioctl compatibilty HID: Add GeneralTouch touchscreen to the blacklist HID: add support for Microsoft Wireless Laser Keyboard 6000 Input: add KEY_LOGOFF USBHID: report descriptor fix for MacBook JIS keyboard HID: trivial fixes in hid-debug HID: fix input mapping for Microsoft Ergonomic Keyboard HID: use hid-plff driver for GreenAsia 0e8f:0003 devices USBHID: Add HID_QUIRK_NOGET for ELO Touch Screen 2700 display HID: enable hiddev for the SantaRosa MacBookPro IR receiver USBHID: add CM109 device to blacklist HID: Report usage codes of keys as EV_MSC scancode events HID: ignore all non-LED usages in output fields in hid-input HID: fix whitespace damage HID: add support for Thrustmaster FGT Force Feedback wheel HID: minimal autosuspend support for USB HID devices HID: add support for Microsoft Natural Ergonomic Keyboard 4000 ...
Diffstat (limited to 'include/linux/hidraw.h')
-rw-r--r--include/linux/hidraw.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
new file mode 100644
index 00000000000..6676cd5e995
--- /dev/null
+++ b/include/linux/hidraw.h
@@ -0,0 +1,86 @@
+#ifndef _HIDRAW_H
+#define _HIDRAW_H
+
+/*
+ * Copyright (c) 2007 Jiri Kosina
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+struct hidraw_report_descriptor {
+ __u32 size;
+ __u8 *value;
+};
+
+struct hidraw_devinfo {
+ __u32 bustype;
+ __s16 vendor;
+ __s16 product;
+};
+
+/* ioctl interface */
+#define HIDIOCGRDESCSIZE _IOR('H', 0x01, int)
+#define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor)
+#define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo)
+
+#define HIDRAW_FIRST_MINOR 0
+#define HIDRAW_MAX_DEVICES 64
+/* number of reports to buffer */
+#define HIDRAW_BUFFER_SIZE 64
+
+
+/* kernel-only API declarations */
+#ifdef __KERNEL__
+
+#include <linux/hid.h>
+
+struct hidraw {
+ unsigned int minor;
+ int exist;
+ int open;
+ wait_queue_head_t wait;
+ struct hid_device *hid;
+ struct device *dev;
+ struct list_head list;
+};
+
+struct hidraw_report {
+ __u8 *value;
+ int len;
+};
+
+struct hidraw_list {
+ struct hidraw_report buffer[HIDRAW_BUFFER_SIZE];
+ int head;
+ int tail;
+ struct fasync_struct *fasync;
+ struct hidraw *hidraw;
+ struct list_head node;
+ struct mutex read_mutex;
+};
+
+#ifdef CONFIG_HIDRAW
+int hidraw_init(void);
+void hidraw_exit(void);
+void hidraw_report_event(struct hid_device *, u8 *, int);
+int hidraw_connect(struct hid_device *);
+void hidraw_disconnect(struct hid_device *);
+#else
+static inline int hidraw_init(void) { return 0; }
+static inline void hidraw_exit(void) { }
+static inline void hidraw_report_event(struct hid_device *hid, u8 *data, int len) { }
+static inline int hidraw_connect(struct hid_device *hid) { return -1; }
+static inline void hidraw_disconnect(struct hid_device *hid) { }
+#endif
+
+#endif
+
+#endif