You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
===================================================================
[EMAIL PROTECTED], 2002-07-14 20:15:59+02:00, [EMAIL PROTECTED]
Get rid of #ifdefs in hid-core again. (For you, Greg.)
Move the uref generation code from hid-core to hiddev to make things cleaner.
drivers/usb/input/hid-core.c | 36 ++++------------------------------
drivers/usb/input/hiddev.c | 45 ++++++++++++++++++++++++++++++++++++++-----
include/linux/hiddev.h | 8 +++++--
3 files changed, 51 insertions(+), 38 deletions(-)
diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c Sun Jul 14 20:17:56 2002
+++ b/drivers/usb/input/hid-core.c Sun Jul 14 20:17:56 2002
@@ -740,22 +740,8 @@
hid_dump_input(usage, value);
if (hid->claimed & HID_CLAIMED_INPUT)
hidinput_hid_event(hid, field, usage, value);
-#ifdef CONFIG_USB_HIDDEV
- if (hid->claimed & HID_CLAIMED_HIDDEV) {
- struct hiddev_usage_ref uref;
- unsigned type = field->report_type;
- uref.report_type =
- (type == HID_INPUT_REPORT) ? HID_REPORT_TYPE_INPUT :
- ((type == HID_OUTPUT_REPORT) ? HID_REPORT_TYPE_OUTPUT :
- ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE:0));
- uref.report_id = field->report->id;
- uref.field_index = field->index;
- uref.usage_index = (usage - field->usage);
- uref.usage_code = usage->hid;
- uref.value = value;
- hiddev_hid_event(hid, &uref);
- }
-#endif
+ if (hid->claimed & HID_CLAIMED_HIDDEV)
+ hiddev_hid_event(hid, field, usage, value);
}
/*
@@ -851,27 +837,15 @@
return -1;
}
-#ifdef CONFIG_USB_HIDDEV
- /* Notify listeners that a report has been received */
- if (hid->claimed & HID_CLAIMED_HIDDEV) {
- struct hiddev_usage_ref uref;
- memset(&uref, 0, sizeof(uref));
- uref.report_type =
- (type == HID_INPUT_REPORT) ? HID_REPORT_TYPE_INPUT :
- ((type == HID_OUTPUT_REPORT) ? HID_REPORT_TYPE_OUTPUT :
- ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE:0));
- uref.report_id = report->id;
- uref.field_index = HID_FIELD_INDEX_NONE;
- hiddev_hid_event(hid, &uref);
- }
-#endif
-
size = ((report->size - 1) >> 3) + 1;
if (len < size) {
dbg("report %d is too short, (%d < %d)", report->id, len, size);
return -1;
}
+
+ if (hid->claimed & HID_CLAIMED_HIDDEV)
+ hiddev_report_event(hid, report);
for (n = 0; n < report->maxfield; n++)
hid_input_field(hid, report->field[n], data);
diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
--- a/drivers/usb/input/hiddev.c Sun Jul 14 20:17:56 2002
+++ b/drivers/usb/input/hiddev.c Sun Jul 14 20:17:56 2002
@@ -152,11 +152,8 @@
return NULL;
}
-/*
- * This is where hid.c calls into hiddev to pass an event that occurred over
- * the interrupt pipe
- */
-void hiddev_hid_event(struct hid_device *hid, struct hiddev_usage_ref *uref)
+static void hiddev_send_event(struct hid_device *hid,
+ struct hiddev_usage_ref *uref)
{
struct hiddev *hiddev = hid->hiddev;
struct hiddev_list *list = hiddev->list;
@@ -176,6 +173,44 @@
wake_up_interruptible(&hiddev->wait);
}
+/*
+ * This is where hid.c calls into hiddev to pass an event that occurred over
+ * the interrupt pipe
+ */
+void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
+ struct hid_usage *usage, __s32 value)
+{
+ unsigned type = field->report_type;
+ struct hiddev_usage_ref uref;
+
+ uref.report_type =
+ (type == HID_INPUT_REPORT) ? HID_REPORT_TYPE_INPUT :
+ ((type == HID_OUTPUT_REPORT) ? HID_REPORT_TYPE_OUTPUT :
+ ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE:0));
+ uref.report_id = field->report->id;
+ uref.field_index = field->index;
+ uref.usage_index = (usage - field->usage);
+ uref.usage_code = usage->hid;
+ uref.value = value;
+
+ hiddev_send_event(hid, &uref);
+}
+
+
+void hiddev_report_event(struct hid_device *hid, struct hid_report *report)
+{
+ unsigned type = report->type;
+ struct hiddev_usage_ref uref;
+
+ memset(&uref, 0, sizeof(uref));
+ uref.report_type =
+ (type == HID_INPUT_REPORT) ? HID_REPORT_TYPE_INPUT :
+ ((type == HID_OUTPUT_REPORT) ? HID_REPORT_TYPE_OUTPUT :
+ ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE:0));
+ uref.report_id = report->id;
+
+ hiddev_send_event(hid, &uref);
+}
/*
* fasync file op
*/
diff -Nru a/include/linux/hiddev.h b/include/linux/hiddev.h
--- a/include/linux/hiddev.h Sun Jul 14 20:17:56 2002
+++ b/include/linux/hiddev.h Sun Jul 14 20:17:56 2002
@@ -193,13 +193,17 @@
#ifdef CONFIG_USB_HIDDEV
int hiddev_connect(struct hid_device *);
void hiddev_disconnect(struct hid_device *);
-void hiddev_hid_event(struct hid_device *, struct hiddev_usage_ref *ref);
+void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
+ struct hid_usage *usage, __s32 value);
+void hiddev_report_event(struct hid_device *hid, struct hid_report *report);
int __init hiddev_init(void);
void __exit hiddev_exit(void);
#else
static inline void *hiddev_connect(struct hid_device *hid) { return NULL; }
static inline void hiddev_disconnect(struct hid_device *hid) { }
-static inline void hiddev_event(struct hid_device *hid, unsigned int usage, int
value) { }
+static inline void hiddev_hid_event(struct hid_device *hid, struct hid_field *field,
+ struct hid_usage *usage, __s32 value) { }
+static inline void hiddev_report_event(struct hid_device *hid, struct hid_report
+*report) { }
static inline int hiddev_init(void) { return 0; }
static inline void hiddev_exit(void) { }
#endif
===================================================================
This BitKeeper patch contains the following changesets:
+
## Wrapped with gzip_uu ##
begin 664 bkpatch30786
M'XL(`%3`,3T``]U8:6_;.!#];/Z*`0H4<1K+)"7J<.!LNXG;!MMN@FRRP`(%
M#%FB+&UL*="1]%#_^PXI.S[JN$Y3H,`Z"421,^2\X7L<.L_@JI!YKW6;_5O*
M(";/X&U6E+U6>9=,DG%<&E5P9P2?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5]1NI(J^"GH(%"Q?@E9$%1YCOS%?.9J,J5C=)-Y7MV@N),;
MB;U=L@QD(9D'<"R%/]2"@OU&5^1;?`TX!-8H;C@L3#[3'?E"6E5:).-4G2]X
MTX-^H\_.T4Q.JO.0M![*EDK6H5*K:AA+/C@1P4CVFG9?2_?TS_.KR^'%X/SL
MXK(-O^F^YFUX^<_YH!F'GO9;<3R[NMSNV1A`3Z^YYOQZ\.KRZF*PQ7MFT:-M
M/"M6D.".K"6D<Y2$<R,],$S24'Y<F.G7N463J+G%7K,1G;FI?FVOVNKBT6].
MQ\Y1O%A,;QB.Z*=.^;>DU\QXK@E\2+ZBS8<55JV<D#L0:U:1]F?GZ":RS).R
M*TVF<EK(<D_'>``4ETL^RRS:TS&O9_]_QJ-E`NVR?:IJ;;XK;ZY83[FLKW\+
MVW9'M_"'65BO:]-Q/4N7*^>;:F5]KUK9T.&_K%@UWR[6BM5FT#]4J#P;&-80
M?)B_Y&`__)G"Q]L9IUP!4@]S7GF3%!,EX5?`@R_P=4L83\2K9[__!XB^:Q?5
2M!^ZU+$BWR+_`1J%CCYW$0``
`
end
--
Vojtech Pavlik
SuSE Labs
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel