[Nut-upsdev] support for newer mustek powermust model 06da:0003

Timo Lindfors timo.lindfors at iki.fi
Mon Nov 26 19:26:57 UTC 2007


Arjen de Korte <nut+devel at de-korte.org> writes:
>> for both devices. If you do 256-byte read then should libusb or kernel
>> split it into 8-byte packets?
> That's how it is supposed to work.

usb_interrupt_read() in libusb calls usb_urb_transfer() which does

do {
    requested = size - bytesdone;
    urb.buffer_length = requested;
    ret = ioctl(dev->fd, IOCTL_USB_SUBMITURB, &urb);
  } while ((ret == 0 || urb.usercontext) && bytesdone < size && urb.actual_length == requested);

thus passing 256 first to ioctl and doing smaller reads only if it
gets partial data. Do you have any idea where the kernel would split
this 256-byte read into 8-byte chunks?

After "case USBDEVFS_SUBMITURB" linux calls proc_do_submiturb() which
calls usb_submit_urb which in turn calls op->submit_urb which I guess
is hcd_submit_urb in my case. I did not spot anything that'd split the
interrupt read into 8-byte chunks, did I miss something or is it
happening on an even lower level?

best regards,
Timo Lindfors

More information about the Nut-upsdev mailing list