Re: First bulk write often doesn't seem to reach device.

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

 



On Mon, 23 Mar 2009, Dave Mielke wrote:

> I'm using usbfs. There's another odd thing I've seen often enough to make me 
> suspicious that I'm doing something wrong. After opening a device and doing a 
> few control requests to it, the first bulk write seems to work yet doesn't seem 
> to reach the device. The ioctl() [USBDEVFS_BULK] returns the correct byte count 
> yet the device doesn't respond. All subsequent bulk writes do work properly.
> 
> Has anything like this been observed before? Does it perhaps mean that the 
> output endpoint is in some sort of undesirable state, and, if so, is this a 
> relatively common occurrence? Is there some way to prepare the device and/or 
> endpoint so make the first bulk write more reliable?

It could be that the device's endpoint toggle is set wrong.  If that's
the case, the problem might be fixable by doing a clear-halt before
writing any bulk data.

If that doesn't fix the problem, there is of course a simple
work-around: Write a 0-length message before starting your real output.

This is not a common occurrence.  Most devices work properly.

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