File: linux-usb-patch2-email.txt

package info (click to toggle)
apcupsd 3.12.4-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 41,116 kB
  • ctags: 6,199
  • sloc: ansic: 42,488; sh: 8,031; cpp: 3,740; makefile: 1,897; perl: 1,723; tcl: 368; php: 107; sed: 93
file content (146 lines) | stat: -rw-r--r-- 6,247 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
From apcupsd-users-admin@lists.sourceforge.net Tue Jul 8 11:59:49 2003
Return-Path: <apcupsd-users-admin@lists.sourceforge.net>
Received: from sc8-sf-list2.sourceforge.net (lists.sourceforge.net
	[66.35.250.206]) by matou.sibbald.com (8.11.6/8.11.6) with ESMTP id
	h689xn812370 for <kern@sibbald.com>; Tue, 8 Jul 2003 11:59:49 +0200
Received: from sc8-sf-list1-b.sourceforge.net ([10.3.1.13]
	helo=sc8-sf-list1.sourceforge.net) by sc8-sf-list2.sourceforge.net with
	esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 19ZpFI-0007ch-00; Tue, 08 Jul 2003
	02:58:48 -0700
Received: from mivlgu.ru ([81.18.140.87] helo=mail.mivlgu.ru) by
	sc8-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id
	19ZpES-0008QV-00 for <apcupsd-users@lists.sourceforge.net>; Tue, 08 Jul
	2003 02:57:57 -0700
Received: by mail.mivlgu.ru (Postfix, from userid 112) id 8D58581780; Tue, 
	8 Jul 2003 13:57:47 +0400 (MSD)
Received: from vcserver.mivlgu.local (vcserver.mivlgu.local
	[192.168.1.251]) by mail.mivlgu.ru (Postfix) with SMTP id 5B04381771; Tue, 
	8 Jul 2003 13:57:43 +0400 (MSD)
From: Sergey Vlasov <vsu@altlinux.ru>
To: "Ching-Hwa Yu" <cyu@SFIS.com>
Cc: apcupsd-users <apcupsd-users@lists.sourceforge.net>
Subject: Re: [Apcupsd-users] Problems using SmartUPS 1500 via USB w/3.10.5
Message-Id: <20030708135742.1aead379.vsu@altlinux.ru>
In-Reply-To: <CD8BAE4A2FEEBB4382745451096AA1BB053D4C@rice-a-roni.sfis.com>
References: <CD8BAE4A2FEEBB4382745451096AA1BB053D4C@rice-a-roni.sfis.com>
X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.10; i586-alt-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Sender: apcupsd-users-admin@lists.sourceforge.net
Errors-To: apcupsd-users-admin@lists.sourceforge.net
X-BeenThere: apcupsd-users@lists.sourceforge.net
X-Mailman-Version: 2.0.9-sf.net
Precedence: bulk
List-Help: <mailto:apcupsd-users-request@lists.sourceforge.net?subject=help>
List-Post: <mailto:apcupsd-users@lists.sourceforge.net>
List-Subscribe:
	<https://lists.sourceforge.net/lists/listinfo/apcupsd-users>,
	<mailto:apcupsd-users-request@lists.sourceforge.net?subject=subscribe>
List-Id: Apcupsd user's email list for support and discussions
	<apcupsd-users.lists.sourceforge.net>
List-Unsubscribe:
	<https://lists.sourceforge.net/lists/listinfo/apcupsd-users>,
	<mailto:apcupsd-users-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
	<http://sourceforge.net/mailarchive/forum.php?forum=apcupsd-users>
Date: Tue, 8 Jul 2003 13:57:42 +0400
Content-Transfer-Encoding: 8bit

On Mon, 7 Jul 2003 18:27:02 -0700
"Ching-Hwa Yu" <cyu@SFIS.com> wrote:

> T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  5 Spd=1.5 MxCh= 0
> D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=051d ProdID=0002 Rev= 0.06
> S:  Manufacturer=American Power Conversion
> S:  Product=Smart-UPS 1500 FW:601.3.D USB FW:1.5
> S:  SerialNumber=AS0236331657
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 30mA
> I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)
> E:  Ad=81(I) Atr=03(Int.) MxPS=   6 Ivl=100ms

This looks like a known bug in the HID driver - it does not recognize
the UPS as a valid HID device. It should be fixed by the following
kernel patch:

http://marc.theaimsgroup.com/?l=linux-usb-devel&m=105562727703359&w=2

=================================================================
Some UPSes have logical minimum and maximum value in HID descriptors the
same. The HID driver rejects such devices. This patch fixes this. Please
apply for 2.4, I'll take care of a 2.5 patch. 

ChangeSet@1.1202, 2003-06-14 23:38:54+02:00, vojtech@suse.cz
  Logical minumum and maximum may be the same value per spec.
  This fixes some UPSes not getting detected properly.


 hid-core.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/hid-core.c b/drivers/usb/hid-core.c
--- a/drivers/usb/hid-core.c	Sat Jun 14 23:39:05 2003
+++ b/drivers/usb/hid-core.c	Sat Jun 14 23:39:05 2003
@@ -202,7 +202,7 @@
 		return -1;
 	}
 
-	if (parser->global.logical_maximum <= parser->global.logical_minimum) {
+	if (parser->global.logical_maximum < parser->global.logical_minimum) {
 		dbg("logical range invalid %d %d", parser->global.logical_minimum, parser->global.logical_maximum);
 		return -1;
 	}


=================================================================

Also you will need to apply another patch to get killpower working:

=================================================================
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);
 


=================================================================


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Apcupsd-users mailing list
Apcupsd-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/apcupsd-users