Hi Rodrigo,<br><br><div><span class="gmail_quote">2006/7/6, 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;">
<br>Hi. I'm having trouble with nut-2.0.3 on a linux kernel 2.4.32 machine and a<br>MGE Evolution 3000. The problem is that I'm getting the following message,<br>repeatidly, on dmesg:<br><br>usbdevfs: usb_submit_urb returned -22
<br><br>(-22 means -EINVAL)<br><br>I traced the problem with newhidups -DDDDDD auto and found out that the -22<br>error appears in a line &quot;none (-22)&quot; of the output as:<br><br>----------<br>upsdrv_updateinfo...<br>
Waiting for notifications...<br> none (-22)<br>entering string_to_path()<br>parsing UPS<br>Looking up UPS<br>----------<br><br>The function calls in userspace are:<br><br>[newhidups.c] upsdrv_updateinfo()<br>&nbsp;&nbsp; [libhid.c] HIDGetEvents()
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[libusb.c] libusb_get_interrupt()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [libusb] usb_interrupt_read()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[libusb] usb_urb_transfer()<br><br>In the usb_urb_transfer() function one can find that<br><br>----------<br>&nbsp;&nbsp;&nbsp;&nbsp;urb.number_of_packets
 = 0;&nbsp;&nbsp;/* don't do isochronous yet */<br>&nbsp;&nbsp;&nbsp;&nbsp;urb.usercontext = NULL;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;ret = ioctl(dev-&gt;fd, IOCTL_USB_SUBMITURB, &amp;urb);<br>----------<br><br>and in the kernel code of linux/drivers/usb/host/uhci.c:<br><br>
----------<br>static int uhci_submit_urb(struct urb *urb)<br>[...]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case PIPE_ISOCHRONOUS:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (urb-&gt;bandwidth == 0) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* not yet checked/allocated<br>*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (urb-&gt;number_of_packets &lt;= 0) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret = -EINVAL;<br>----------<br><br>So it seems that setting number_of_packets to zero is directly related with<br>the kernel error.<br><br>What is going on here? Is it a bug in nut?<br>
</blockquote></div><br>a good try, and amount of effort.<br>Sadly, notifications are on the PIPE_INTERRUPT <br clear="all"><br>If everything's working fine otherwise (ie UPS status changes are seen), you should dig a bit more the code as it sound like a kernel regression.
<br><br>If something is not working, you can try to reset the communication: power off the UPS, then unplug its power cable, wait (at least) 10 seconds and replug/restart all.<br><br>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>