Thread (3 messages) 3 messages, 3 authors, 2012-03-16

Re: [RFC 1/1] HID: User-space I/O driver support for HID subsystem

flat view

From: David Herrmann <hidden>
Date: 2012-03-16 18:51:21
Also in: linux-input

Hi Marcel

On Fri, Mar 16, 2012 at 5:00 PM, Marcel Holtmann [off-list ref] wrot=
e:
Hi David,

<snip>
quoted
new file mode 100644
index 0000000..1a7df0d
--- /dev/null
+++ b/include/linux/uhid.h
@@ -0,0 +1,71 @@
+#ifndef __UHID_H_
+#define __UHID_H_
+
+/*
+ * User-space I/O driver support for HID subsystem
+ * Copyright (c) 2012 David Herrmann
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify=
 it
quoted
+ * under the terms of the GNU General Public License as published by th=
e Free
quoted
+ * Software Foundation; either version 2 of the License, or (at your op=
tion)
quoted
+ * any later version.
+ */
+
+#include <linux/input.h>
+#include <linux/types.h>
+
+enum uhid_event_type {
+ =A0 =A0 UHID_CREATE,
+ =A0 =A0 UHID_DESTROY,
+ =A0 =A0 UHID_START,
+ =A0 =A0 UHID_STOP,
+ =A0 =A0 UHID_OPEN,
+ =A0 =A0 UHID_CLOSE,
+ =A0 =A0 UHID_OUTPUT,
+ =A0 =A0 UHID_OUTPUT_EV,
+ =A0 =A0 UHID_INPUT,
+};
+
+struct uhid_create_req {
+ =A0 =A0 __u8 __user name[128];
+ =A0 =A0 __u8 __user *rd_data;
+ =A0 =A0 __u16 rd_size;
+
we need the bus here as well. With HIDP it was implicit, but here it is
no longer implicit.
Uh, yeah, I will add that, thanks. I also need to find a proper way to
get a hid->dev.parent pointer.
quoted
+ =A0 =A0 __u16 vendor;
+ =A0 =A0 __u16 product;
+ =A0 =A0 __u16 version;
+ =A0 =A0 __u8 country;
What are we using country for these days?
I copied it from HIDP. If we don't need this, I can remove it. USBHID
doesn't use it as far as I can see.
quoted
+};
+
+#define UHID_DATA_MAX 4096
+
+enum uhid_report_type {
+ =A0 =A0 UHID_FEATURE_REPORT,
+ =A0 =A0 UHID_OUTPUT_REPORT,
+};
+
+struct uhid_data_req {
+ =A0 =A0 __u8 data[UHID_DATA_MAX];
+ =A0 =A0 __u16 size;
+ =A0 =A0 __u8 rtype;
+};
+
+struct uhid_data_ev_req {
+ =A0 =A0 __u16 type;
+ =A0 =A0 __u16 code;
+ =A0 =A0 __s32 value;
+};
+
+struct uhid_event {
+ =A0 =A0 __u32 type;
+
+ =A0 =A0 union {
+ =A0 =A0 =A0 =A0 =A0 =A0 struct uhid_create_req create;
+ =A0 =A0 =A0 =A0 =A0 =A0 struct uhid_data_req data;
+ =A0 =A0 =A0 =A0 =A0 =A0 struct input_event data_ev;
+ =A0 =A0 } u;
+};
+
+#endif /* __UHID_H_ */
Regards

Marcel
Thanks
David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help