From 8efeb60aa05b60da9cb8a3af9974f64b0d4fdf68 Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Sat, 23 Jul 2016 18:30:06 -0700 Subject: [PATCH] Fixing lsusb error messages - Instead of stalling at Device Qualification and Debug descriptors, return 0 --- Bootloader/usb.c | 7 +++++++ Bootloader/usb.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Bootloader/usb.c b/Bootloader/usb.c index 344a02a..942aeab 100644 --- a/Bootloader/usb.c +++ b/Bootloader/usb.c @@ -465,6 +465,13 @@ static void usb_handle_control(void *data, ssize_t len, void *cbdata) default: fail = -1; break; + + // Cleanup lsusb errors, just return 0 instead of stalling + case USB_DESC_DEVQUAL: + case USB_DESC_DEBUG: + usb_ep0_tx_cp(&zero16, sizeof(zero16), req->wLength, NULL, NULL); + fail = 0; + break; } /* we set fail already, so we can go directly to `err' */ goto err; diff --git a/Bootloader/usb.h b/Bootloader/usb.h index e7c4067..d00a8b7 100644 --- a/Bootloader/usb.h +++ b/Bootloader/usb.h @@ -79,7 +79,9 @@ enum usb_desc_type { USB_DESC_EP = 5, USB_DESC_DEVQUAL = 6, USB_DESC_OTHERSPEED = 7, - USB_DESC_POWER = 8 + USB_DESC_POWER = 8, + USB_DESC_OTG = 9, + USB_DESC_DEBUG = 10, }; struct usb_desc_type_t {