summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2010-09-20 14:18:14 +0000
committerAmaury Pouly <pamaury@rockbox.org>2010-09-20 14:18:14 +0000
commit7baa52236487d39750fd2a3d910b8d956aa10d35 (patch)
treed74d9ab9e18f8f340c0235fe497fb583b1082c10 /firmware/usbstack
parent93c50d4770049df25c0c1fc0b9c6faea9c5a28ea (diff)
downloadrockbox-7baa52236487d39750fd2a3d910b8d956aa10d35.tar.gz
rockbox-7baa52236487d39750fd2a3d910b8d956aa10d35.tar.bz2
rockbox-7baa52236487d39750fd2a3d910b8d956aa10d35.zip
usb: remove unused variable and correctly stall on unhandled control requests
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28121 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack')
-rw-r--r--firmware/usbstack/usb_core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index 4988800dad..2ff3f325a2 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -551,7 +551,6 @@ static void control_request_handler_drivers(struct usb_ctrlrequest* req)
static void request_handler_device_get_descriptor(struct usb_ctrlrequest* req)
{
int size;
- bool handled = true;
const void* ptr = NULL;
int length = req->wLength;
int index = req->wValue & 0xff;
@@ -621,7 +620,6 @@ static void request_handler_device_get_descriptor(struct usb_ctrlrequest* req)
default:
logf("ctrl desc.");
- handled = false;
control_request_handler_drivers(req);
break;
}
@@ -697,6 +695,8 @@ static void request_handler_device(struct usb_ctrlrequest* req)
usb_drv_send(EP_CONTROL, response_data, 2);
break;
default:
+ logf("bad req:desc %d:%d", req->bRequest, req->wValue);
+ usb_drv_stall(EP_CONTROL, true, true);
break;
}
}
@@ -742,6 +742,9 @@ static void request_handler_interface(struct usb_ctrlrequest* req)
control_request_handler_drivers(req);
break;
case USB_TYPE_VENDOR:
+ default:
+ logf("bad req:desc %d", req->bRequest);
+ usb_drv_stall(EP_CONTROL, true, true);
break;
}
}
@@ -808,6 +811,8 @@ static void request_handler_endpoint(struct usb_ctrlrequest* req)
break;
case USB_TYPE_VENDOR:
default:
+ logf("bad req:desc %d", req->bRequest);
+ usb_drv_stall(EP_CONTROL, true, true);
break;
}
}
@@ -841,6 +846,7 @@ static void usb_core_control_request_handler(struct usb_ctrlrequest* req)
break;
case USB_RECIP_OTHER:
logf("unsupported recipient");
+ usb_drv_stall(EP_CONTROL, true, true);
break;
}
//logf("control handled");