Hi Rodrigo,<br><br><div><span class="gmail_quote">2006/7/7, Rodrigo Ventura <<a href="mailto:yoda@isr.ist.utl.pt">yoda@isr.ist.utl.pt</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thursday 06 July 2006 20:15, Arnaud Quette wrote:<br>> a good try, and amount of effort.<br>> Sadly, notifications are on the PIPE_INTERRUPT<br><br>Ok, let's do it again.<br><br>HIDGetEvents() calls libusb_get_interrupt() with size=20 (hardcoded), which
<br>calls usb_interrupt_read(), then usb_urb_transfer(), which sets<br>urb.buffer_length=20, going down the ioctl (as uurb), where the kernel urb<br>struct gets urb.transfer_buffer_length=20. Then, uhci_submit_interrupt()
<br>checks that field with<br><br>--------------------<br> if (urb->transfer_buffer_length > usb_maxpacket(urb->dev, urb->pipe,<br>usb_pipeout(urb->pipe)))<br> return -EINVAL;<br>--------------------
<br><br>What is the endpoint max packet size? According to /proc/bus/usb/devices<br><br>C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA<br>I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub<br>E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
<br>T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0<br>D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1<br>P: Vendor=0463 ProdID=ffff Rev= 1.00<br>S: Manufacturer=MGE UPS SYSTEMS<br>S: Product=Evolution
<br>S: SerialNumber=AF3G03062<br><br>C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 40mA<br>I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=(none)<br>E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=20ms<br><br>Assuming that MxPS means max packet size, it seems to be 8, which is
<br>lower than 20, and therefore it looks like the EINVAL error comes from<br>there. Am I going in the right direction this time?</blockquote><div><br>your guess seems right.<br>The best to validate your guess is to modify the 20 to 8 in get_interrupt() and to recompile nut.
<br></div><br>Let me know the result, and I'll fix that for 2.0.4-pre2 next week.<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> If something is not working, you can try to reset the communication: power
<br>> off the UPS, then unplug its power cable, wait (at least) 10 seconds and<br>> replug/restart all.<br><br>Well, that's something I'd like to avoid, since all the institution servers<br>are fed by the UPS.<br></blockquote>
</div><br>I understand<br><br clear="all">Arnaud<br>-- <br>Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt<br>Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/">http://www.networkupstools.org/
</a><br>Debian Developer - <a href="http://people.debian.org/~aquette/">http://people.debian.org/~aquette/</a><br>OpenSource Developer - <a href="http://arnaud.quette.free.fr/">http://arnaud.quette.free.fr/</a>