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:
parent
14446677d3
commit
ddc2c62aa8
@ -629,6 +629,8 @@ static void *host_raw_ephandle(void *arg)
|
|||||||
|
|
||||||
if (io)
|
if (io)
|
||||||
{
|
{
|
||||||
|
int len;
|
||||||
|
|
||||||
if (entry->halted)
|
if (entry->halted)
|
||||||
{
|
{
|
||||||
host_raw_epclearhalt(dev->fd, entry->raw_epid);
|
host_raw_epclearhalt(dev->fd, entry->raw_epid);
|
||||||
@ -638,9 +640,13 @@ static void *host_raw_ephandle(void *arg)
|
|||||||
io->inner.ep = entry->raw_epid;
|
io->inner.ep = entry->raw_epid;
|
||||||
io->inner.flags = 0;
|
io->inner.flags = 0;
|
||||||
io->inner.length = USB_RAW_EP_MAX_LEN;
|
io->inner.length = USB_RAW_EP_MAX_LEN;
|
||||||
io->inner.length = host_raw_epread(dev->fd, &io->inner);
|
len = host_raw_epread(dev->fd, &io->inner);
|
||||||
|
if (len > 0)
|
||||||
|
{
|
||||||
|
io->inner.length = len;
|
||||||
USB_RAW_FIFO_PUSH(&entry->fifo);
|
USB_RAW_FIFO_PUSH(&entry->fifo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!entry->halted)
|
if (!entry->halted)
|
||||||
|
Loading…
Reference in New Issue
Block a user