Re: reading USB data through usbdevfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 23, 2010 at 7:24 PM, Viral Mehta
<Viral.Mehta@xxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I am writing USB user space driver on Host side. It is not following any class but a vendor specific.
> It is doing Bulk IN and OUT transfers. Device side gadget driver is doing Bulk Write and Host is waiting for the data.
>

Why not try libusb ?

> Now, on the host side I am doing in the userspace,
> {
>    For loop for 1024 times
>    {...
>        Fill urb struct
>        urb->buffer_length = len;
>
>        ioctl(h->desc, USBDEVFS_SUBMITURB, urb);
>
>        ioctl(h->desc, USBDEVFS_REAPURB, &urb_reap);
>    }
> }
>
> However, everytime I reaped URB, it gets the same data. For all 1024 times. And the data is the part (of length = urb->buffer_length) of first URB submitted from gadget side. All urb struct and buffers are maintained properly.
>
> Interestingly, if I change length (urb->buffer_length = len) such that it matches with what gadget side driver is sending (or doing urb_submit), I start getting proper data each time.
>
> Looks like a Bug somewhere in usbdevfs. ??
>
> Thanks,
> Viral Mehta
>
>
> This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
>
> ______________________________________________________________________
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux