Re: reading USB data through usbdevfs

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

 



It would make things easier if you configure your email client to wrap 
lines after 72 columns or so.

On Wed, 23 Jun 2010, Viral Mehta 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.
> 
> 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.

Have you used usbmon to check the data being sent?

> 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. ??

I doubt it; more likely it's a bug in your program.  But I can't tell
where unless you post the code in more detail.

Alan Stern

--
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