1
0
Fork 0
forked from len0rd/rockbox

usb: Partial revert of previous commit

...A rebase gone wrong led to a bunch of extra crap in the commit.

Change-Id: Id8f0e33b9fba0949594701fbc574da58e74fa776
This commit is contained in:
Solomon Peachy 2025-10-05 15:56:00 -04:00
parent 43ec77f84c
commit 5a4030cb35

View file

@ -598,38 +598,8 @@ static void control_request_handler_drivers(struct usb_ctrlrequest* req, void* r
if(drivers[i].enabled &&
drivers[i].control_request &&
drivers[i].first_interface <= interface &&
drivers[i].last_interface > interface) {
/* Check for SET_INTERFACE and GET_INTERFACE */
if((req->bRequestType & USB_RECIP_MASK) == USB_RECIP_INTERFACE &&
(req->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
if(req->bRequest == USB_REQ_SET_INTERFACE) {
logf("usb_core: SET INTERFACE 0x%x 0x%x", req->wValue, req->wIndex);
if(drivers[i].set_interface &&
drivers[i].set_interface(req->wIndex, req->wValue) >= 0) {
sleep(1);
usb_drv_control_response(USB_CONTROL_ACK, NULL, 0);
handled = true;
}
break;
}
else if(req->bRequest == USB_REQ_GET_INTERFACE) {
int alt = -1;
logf("usb_core: GET INTERFACE 0x%x", req->wIndex);
if(drivers[i].get_interface)
alt = drivers[i].get_interface(req->wIndex);
if(alt >= 0 && alt < 255) {
response_data[0] = alt;
usb_drv_control_response(USB_CONTROL_ACK, response_data, 1);
handled = true;
}
break;
}
/* fallback */
}
drivers[i].last_interface > interface)
{
handled = drivers[i].control_request(req, reqdata, response_data);
if(handled)
break;