File: linux-2.4.20-killpower.patch

package info (click to toggle)
apcupsd 3.14.10-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 7,296 kB
  • sloc: ansic: 36,560; cpp: 7,912; sh: 3,981; makefile: 1,576; tcl: 368; objc: 276; php: 255
file content (31 lines) | stat: -rw-r--r-- 1,232 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
ChangeSet 1.1258, 2003/06/18 16:55:46-07:00, vsu@altlinux.ru

[PATCH] USB: HIDDEV / UPS patches


 drivers/usb/hid-core.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)


diff -Nru a/drivers/usb/hid-core.c b/drivers/usb/hid-core.c
--- a/drivers/usb/hid-core.c	Wed Jun 18 17:34:51 2003
+++ b/drivers/usb/hid-core.c	Wed Jun 18 17:34:51 2003
@@ -1067,10 +1067,16 @@
 
 void hid_write_report(struct hid_device *hid, struct hid_report *report)
 {
-	hid_output_report(report, hid->out[hid->outhead].buffer);
+	if (hid->report_enum[report->type].numbered) {
+		hid->out[hid->outhead].buffer[0] = report->id;
+		hid_output_report(report, hid->out[hid->outhead].buffer + 1);
+		hid->out[hid->outhead].dr.wLength = cpu_to_le16(((report->size + 7) >> 3) + 1);
+	} else {
+		hid_output_report(report, hid->out[hid->outhead].buffer);
+		hid->out[hid->outhead].dr.wLength = cpu_to_le16((report->size + 7) >> 3);
+	}
 
-	hid->out[hid->outhead].dr.wValue = cpu_to_le16(0x200 | report->id);
-	hid->out[hid->outhead].dr.wLength = cpu_to_le16((report->size + 7) >> 3);
+	hid->out[hid->outhead].dr.wValue = cpu_to_le16(((report->type + 1) << 8) | report->id);
 
 	hid->outhead = (hid->outhead + 1) & (HID_CONTROL_FIFO_SIZE - 1);