Skip to contentSkip to conversation

usb-redir: Never return USB_RET_NAK for async handled packets

PATCH In review Hans de Goede 2 participants 2 messages Aug 17, 2012 – Aug 21, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb-redir: Never return USB_RET_NAK for async handled packets

USB_RET_NAK is not a valid response for async handled packets (and will trigger an assert as such).

Also drop the warning when receiving a status of cancelled for packets not cancelled by qemu itself, this can happen when a device gets unredirected by the usbredir-host while transfers are pending.

---
 hw/usb/redirect.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
hw/usb/redirect.c +6 -3
index 1460515..9ba964e 100644
@@ -1055,11 +1055,14 @@ static int usbredir_handle_status(USBRedirDevice *dev,
     case usb_redir_stall:
         return USB_RET_STALL;
     case usb_redir_cancelled:
-        WARNING("returning cancelled packet to HC?\n");
-        return USB_RET_NAK;
+        /*
+         * When the usbredir-host unredirects a device, it will report a status
+         * of cancelled for all pending packets, followed by a disconnect msg.
+         */
+        return USB_RET_IOERROR;
     case usb_redir_inval:
         WARNING("got invalid param error from usb-host?\n");
-        return USB_RET_NAK;
+        return USB_RET_IOERROR;
     case usb_redir_babble:
         return USB_RET_BABBLE;
     case usb_redir_ioerror:
Signature · 1 line
1.7.11.4
#1 lore raw
Quoted 6 lines · Hans de Goede

USB_RET_NAK is not a valid response for async handled packets (and will trigger an assert as such).

Also drop the warning when receiving a status of cancelled for packets not cancelled by qemu itself, this can happen when a device gets unredirected by the usbredir-host while transfers are pending.

Patch added to usb patch queue (2+3 from v1 too).

thanks,
Gerd