From 49bcf3530962c40857c510af431968960ba4bdc6 Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Wed, 24 Jul 2013 22:40:12 +0200 Subject: [PATCH] usb stack: add more verbose debug logf()s Change-Id: I087aefd2854978813c7e4ed7ef7da400f3692e39 --- firmware/usbstack/usb_core.c | 8 ++++++-- firmware/usbstack/usb_storage.c | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c index cc41e8b892..130111cdfe 100644 --- a/firmware/usbstack/usb_core.c +++ b/firmware/usbstack/usb_core.c @@ -440,7 +440,10 @@ void usb_core_handle_transfer_completion( switch(ep) { case EP_CONTROL: - logf("ctrl handled %ld",current_tick); + logf("ctrl handled %ld req=0x%x", + current_tick, + ((struct usb_ctrlrequest*)event->data)->bRequest); + usb_core_control_request_handler( (struct usb_ctrlrequest*)event->data); break; @@ -825,6 +828,7 @@ static void request_handler_endpoint_standard(struct usb_ctrlrequest* req) usb_drv_send(EP_CONTROL, NULL, 0); break; case USB_REQ_SET_FEATURE: + logf("usb_core: SET FEATURE (%d)", req->wValue); if(req->wValue == USB_ENDPOINT_HALT) usb_drv_stall(EP_NUM(req->wIndex), true, EP_DIR(req->wIndex)); @@ -959,7 +963,7 @@ void usb_core_control_request(struct usb_ctrlrequest* req) completion_event->data = (void*)req; completion_event->status = 0; completion_event->length = 0; - logf("ctrl received %ld", current_tick); + logf("ctrl received %ld, req=0x%x", current_tick, req->bRequest); usb_signal_transfer_completion(completion_event); } diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index 85a0e2b843..c51b0faa4c 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c @@ -753,6 +753,7 @@ static void handle_scsi(struct command_block_wrapper* cbw) unsigned int block_size_mult = 1; if(letoh32(cbw->signature) != CBW_SIGNATURE) { + logf("ums: bad cbw signature (%x)", cbw->signature); usb_drv_stall(ep_in, true,true); usb_drv_stall(ep_out, true,false); return;