Hi Rodrigo,<br><br><div><span class="gmail_quote">2006/7/7, Rodrigo Ventura &lt;<a href="mailto:yoda@isr.ist.utl.pt">yoda@isr.ist.utl.pt</a>&gt;:</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>&gt; a good try, and amount of effort.<br>&gt; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (urb-&gt;transfer_buffer_length &gt; usb_maxpacket(urb-&gt;dev, urb-&gt;pipe,<br>usb_pipeout(urb-&gt;pipe)))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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=&nbsp;&nbsp;0mA<br>I:&nbsp;&nbsp;If#= 0 Alt= 0 #EPs= 1 Cls=09(hub&nbsp;&nbsp;) Sub=00 Prot=00 Driver=hub<br>E:&nbsp;&nbsp;Ad=81(I) Atr=03(Int.) MxPS=&nbsp;&nbsp; 8 Ivl=255ms
<br>T:&nbsp;&nbsp;Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=&nbsp;&nbsp;2 Spd=1.5 MxCh= 0<br>D:&nbsp;&nbsp;Ver= 1.10 Cls=00(&gt;ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=&nbsp;&nbsp;1<br>P:&nbsp;&nbsp;Vendor=0463 ProdID=ffff Rev= 1.00<br>S:&nbsp;&nbsp;Manufacturer=MGE UPS SYSTEMS<br>S:&nbsp;&nbsp;Product=Evolution
<br>S:&nbsp;&nbsp;SerialNumber=AF3G03062<br><br>C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 40mA<br>I:&nbsp;&nbsp;If#= 0 Alt= 0 #EPs= 1 Cls=03(HID&nbsp;&nbsp;) Sub=00 Prot=00 Driver=(none)<br>E:&nbsp;&nbsp;Ad=81(I) Atr=03(Int.) MxPS=&nbsp;&nbsp; 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.&nbsp;
<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;">&gt; If something is not working, you can try to reset the communication: power
<br>&gt; off the UPS, then unplug its power cable, wait (at least) 10 seconds and<br>&gt; 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&amp;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>