[Nut-upsdev] SUN_LIBUSB

Charles Lepple clepple at gmail.com
Wed Dec 30 00:38:58 UTC 2009


On Tue, Dec 29, 2009 at 4:25 PM, Wallis, Chase Civ USAF AFMC 519
SMXS/MXDEA <Chase.Wallis at hill.af.mil> wrote:
> Hi all,
>
>
>
> I’ve been trying to get a TrippLite 700DV  communicating with nut in
> Solaris. The problem was that I would successfully send a message to the
> ups, but wouldn’t be able to receive anything. After some snooping around I
> found this bit of code in libusb.c libusb_get_interrupt().

Chase,

I am CC'ing Arnaud because I believe he was working with some folks at
Sun a while back on USB support.

Just to make sure we're on the same page, it sounds like you are using
the tripplite_usb driver, right?

Please let us know version numbers for the following:
 * NUT
 * libusb (I assume it's from Sun Freeware?)
 * Solaris

> #ifdef SUN_LIBUSB
>
> /*
>
>                 usleep(timeout * 1000);
>
>  */
>
>                 return 0;
>
> #else
>
>                 /* FIXME: hardcoded interrupt EP => need to get EP descr for
> IF descr */
>
>                 ret = usb_interrupt_read(udev, 0x81, (char *)buf, bufsize,
> timeout);
>
>                 if (ret > 0) {
>
>                                 upsdebugx(6, " ok");
>
>                 } else {
>
>                                 upsdebugx(6, " none (%i)", ret);
>
>                 }
>
>                 return ret;
>
> #endif
>
>
>
>
>
> It seems that when using Sun libusb, nut completely blocks out the read
> attempt. I removed the preprocessor directives and voila. Worked perfectly.
> There must have been a reason for this at some point, but I can’t find any
> comments on the issue. And it seems to be unnecessarily blocking out usb
> communication when using Sun libusb. Does anyone know the reason for this?
> Should I work around the issue in the tripplite_usb driver, or can it be
> fixed directly in libusb.c? Maybe other UPS drivers on SUN haven’t been
> working for this reason…
>
>
>
>
>
>
>
> Chase Wallis
>
> 519 SMXS / MXDEA
>
> Air Force Civilian
>
> Phone: (801) 586 5600
>
> Address: 6137 Wardleigh Road, Bldg. 1515 Rm 178, Hill AFB UT, 84056-5843
>
>
>
> _______________________________________________
> Nut-upsdev mailing list
> Nut-upsdev at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev
>



-- 
- Charles Lepple



More information about the Nut-upsdev mailing list