diff options
| author | Al Borchers <alborchers@steinerpoint.com> | 2004-09-03 18:29:45 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2004-09-03 18:29:45 +0200 |
| commit | 66d2dc06414f5e975f4a27213806d4e71091c827 (patch) | |
| tree | 9eb955e34f8c09cff8b0c5101c1bb275da2684e7 /include/linux/usbdevice_fs.h | |
| parent | cf59b8531ba7787a3e9871c96c699399aa06450e (diff) | |
[PATCH] USB: close waits for drain in pl2303
Here is an additional patch for pl2303 in 2.6.9-rc1,
to be applied after my previous circular buffer patch.
This patch waits for the buffer to drain on close and
then clears the buffer. In addition to the obvious
features, this also fixes a bug where closing a port
with a full buffer would accidentally disable writes
when the port was re-opened.
The original pl2303 could lose data that was still going
out the port on close, and even this patch only solves
the problem completely for data rates of 1200 bps and
above.
Waiting for data to drain from the circular buffer is
easy, but the problem is waiting for data to drain from
the 256 byte hardware buffer on the device. I don't know
how much data is in the hardware buffer, so I just wait
long enough for a potentially full hardware buffer to
drain, but I don't want to wait that long for low data
rates if the buffer isn't full. There is probably some
way to query the pl2303 to find out how much data is in
its hardware buffer, maybe snooping would reveal that.
- Added a wait for data to drain from the driver
write buffer when closing.
- Added a wait for the data to drain from the
device hardware buffer when closing.
- Cleared the driver write buffer when closing.
Signed-off-by: Al Borchers <alborchers@steinerpoint.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'include/linux/usbdevice_fs.h')
0 files changed, 0 insertions, 0 deletions
