summaryrefslogtreecommitdiff
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
parent93c50d4770049df25c0c1fc0b9c6faea9c5a28ea (diff)
downloadrockbox-7baa52236487d39750fd2a3d910b8d956aa10d35.tar.gz
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
-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)
551static void request_handler_device_get_descriptor(struct usb_ctrlrequest* req) 551static void request_handler_device_get_descriptor(struct usb_ctrlrequest* req)
552{ 552{
553 int size; 553 int size;
554 bool handled = true;
555 const void* ptr = NULL; 554 const void* ptr = NULL;
556 int length = req->wLength; 555 int length = req->wLength;
557 int index = req->wValue & 0xff; 556 int index = req->wValue & 0xff;
@@ -621,7 +620,6 @@ static void request_handler_device_get_descriptor(struct usb_ctrlrequest* req)
621 620
622 default: 621 default:
623 logf("ctrl desc."); 622 logf("ctrl desc.");
624 handled = false;
625 control_request_handler_drivers(req); 623 control_request_handler_drivers(req);
626 break; 624 break;
627 } 625 }
@@ -697,6 +695,8 @@ static void request_handler_device(struct usb_ctrlrequest* req)
697 usb_drv_send(EP_CONTROL, response_data, 2); 695 usb_drv_send(EP_CONTROL, response_data, 2);
698 break; 696 break;
699 default: 697 default:
698 logf("bad req:desc %d:%d", req->bRequest, req->wValue);
699 usb_drv_stall(EP_CONTROL, true, true);
700 break; 700 break;
701 } 701 }
702} 702}
@@ -742,6 +742,9 @@ static void request_handler_interface(struct usb_ctrlrequest* req)
742 control_request_handler_drivers(req); 742 control_request_handler_drivers(req);
743 break; 743 break;
744 case USB_TYPE_VENDOR: 744 case USB_TYPE_VENDOR:
745 default:
746 logf("bad req:desc %d", req->bRequest);
747 usb_drv_stall(EP_CONTROL, true, true);
745 break; 748 break;
746 } 749 }
747} 750}
@@ -808,6 +811,8 @@ static void request_handler_endpoint(struct usb_ctrlrequest* req)
808 break; 811 break;
809 case USB_TYPE_VENDOR: 812 case USB_TYPE_VENDOR:
810 default: 813 default:
814 logf("bad req:desc %d", req->bRequest);
815 usb_drv_stall(EP_CONTROL, true, true);
811 break; 816 break;
812 } 817 }
813} 818}
@@ -841,6 +846,7 @@ static void usb_core_control_request_handler(struct usb_ctrlrequest* req)
841 break; 846 break;
842 case USB_RECIP_OTHER: 847 case USB_RECIP_OTHER:
843 logf("unsupported recipient"); 848 logf("unsupported recipient");
849 usb_drv_stall(EP_CONTROL, true, true);
844 break; 850 break;
845 } 851 }
846 //logf("control handled"); 852 //logf("control handled");