mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
sim/rawgadget: don't push fifo if ioctl failed because it will cause busy read
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -629,6 +629,8 @@ static void *host_raw_ephandle(void *arg)
|
||||
|
||||
if (io)
|
||||
{
|
||||
int len;
|
||||
|
||||
if (entry->halted)
|
||||
{
|
||||
host_raw_epclearhalt(dev->fd, entry->raw_epid);
|
||||
@@ -638,8 +640,12 @@ static void *host_raw_ephandle(void *arg)
|
||||
io->inner.ep = entry->raw_epid;
|
||||
io->inner.flags = 0;
|
||||
io->inner.length = USB_RAW_EP_MAX_LEN;
|
||||
io->inner.length = host_raw_epread(dev->fd, &io->inner);
|
||||
USB_RAW_FIFO_PUSH(&entry->fifo);
|
||||
len = host_raw_epread(dev->fd, &io->inner);
|
||||
if (len > 0)
|
||||
{
|
||||
io->inner.length = len;
|
||||
USB_RAW_FIFO_PUSH(&entry->fifo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user