<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6617.47">
<TITLE>newhidups subdriver_matcher incorrectly matches USB hub</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<BR>
<P><FONT FACE="Times New Roman">I ran into the following issue today and would like some feedback from the group.</FONT>
</P>
<P><FONT FACE="Times New Roman">Setup:<BR>
I am using a MGE Pulsar Evolution 2200 UPS connected through a Belkin (F5U218-MOB) 4-Port USB Hub.<BR>
<BR>
Scenario:<BR>
The newhidups subdriver_matcher function calls belkin_subdriver->belkin_claim. The belkin_claim function in belkin-hid.c matches the VendorID of the hub to Belkin's VendorID (0x050d), causing the hub to be recognized as a UPS. The newhidups driver (libusb.c) then attempts to claim the device and detatches the kernel driver. When the hub fails to provide a HID descriptor, the newhidups driver moves on to the next device and correctly locates the MGE UPS. The problem is that the hub is now non-functional as the hub kernel driver has been detatched.<BR>
<BR>
Problem:<BR>
The belkin_claim function should not assume that because the VendorID is Belkin's the device is a UPS. Belkin makes several USB devices and starting newhidups with them connected could leave them inoperable until they are removed an reconnected. Even if the UPS is not connected through the hub, the hub can still get disabled if it is matched before the UPS.<BR>
<BR>
If MGE made a USB hub, the mge_claim function in mge-hid.c would have the same issue.<BR>
<BR>
<BR>
Output:<BR>
<BR>
:/tmp# /tmp/newhidups -DDD /dev/usb/hid/hiddev0<BR>
Network UPS Tools: New USB/HID UPS driver 0.28 (2.0.4)<BR>
<BR>
debug level is '3'<BR>
Checking device (0000/0000) (001/001)<BR>
- VendorID: 0000<BR>
- ProductID: 0000<BR>
- Manufacturer: unknown<BR>
- Product: USB OHCI Root Hub<BR>
- Serial Number: c64ffc00<BR>
- Bus: 001<BR>
Trying to match device<BR>
Device does not match - skipping<BR>
Checking device (050D/0218) (001/014)<BR>
- VendorID: 050d<BR>
- ProductID: 0218<BR>
- Manufacturer: unknown<BR>
- Product: unknown<BR>
- Serial Number: unknown<BR>
- Bus: 001<BR>
Trying to match device<BR>
Device matches<BR>
failed to claim USB device, trying 2 more time(s)...<BR>
detaching kernel driver from USB device...<BR>
trying again to claim USB device...<BR>
Unable to get HID descriptor (error sending control message: Broken pipe)<BR>
Checking device (0463/FFFF) (001/015)<BR>
- VendorID: 0463<BR>
- ProductID: ffff<BR>
- Manufacturer: MGE UPS SYSTEMS<BR>
- Product: Evolution<BR>
- Serial Number: AH2G10067<BR>
- Bus: 001<BR>
Trying to match device<BR>
Device matches<BR>
HID descriptor retrieved (Reportlen = 1620)<BR>
Size read for the report descriptor: 1620<BR>
Report descriptor retrieved (Reportlen = 1620)<BR>
Found HID device<BR>
Report Descriptor size = 1620<BR>
Report Descriptor: (200 bytes) => 05 84 09 04 A1 01 09 10 A1 00 85 01 09 11 75 08<BR>
Detected a UPS: MGE UPS SYSTEMS/Evolution<BR>
Using subdriver: MGE HID 0.9<BR>
......cut......<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>