Don't fail if device stalls on SetIdle command (*cough* Logitech mice)

USG_1.0
Robert Fisk 8 years ago
parent c68151698b
commit 12a576b5af

@ -577,18 +577,10 @@ USBH_StatusTypeDef USBH_CtlReq (USBH_HandleTypeDef *phost,
case CMD_WAIT: case CMD_WAIT:
status = USBH_HandleControl(phost); status = USBH_HandleControl(phost);
if (status == USBH_OK) if (status != USBH_BUSY)
{ {
/* Commands successfully sent and Response Received */
phost->RequestState = CMD_SEND; phost->RequestState = CMD_SEND;
phost->Control.state = CTRL_IDLE; phost->Control.state = CTRL_IDLE;
status = USBH_OK;
}
else if (status == USBH_FAIL)
{
/* Failure Mode */
phost->RequestState = CMD_SEND;
status = USBH_FAIL;
} }
break; break;
@ -701,8 +693,8 @@ static USBH_StatusTypeDef USBH_HandleControl (USBH_HandleTypeDef *phost)
/* manage error cases*/ /* manage error cases*/
if (URB_Status == USBH_URB_STALL) if (URB_Status == USBH_URB_STALL)
{ {
//Retry transaction //Command not supported, report to callee
phost->Control.state = CTRL_ERROR; status = USBH_NOT_SUPPORTED;
} }
else if (URB_Status == USBH_URB_ERROR) else if (URB_Status == USBH_URB_ERROR)
{ {
@ -737,8 +729,8 @@ static USBH_StatusTypeDef USBH_HandleControl (USBH_HandleTypeDef *phost)
/* handle error cases */ /* handle error cases */
else if (URB_Status == USBH_URB_STALL) else if (URB_Status == USBH_URB_STALL)
{ {
//Retry transaction //Command not supported, report to callee
phost->Control.state = CTRL_ERROR; status = USBH_NOT_SUPPORTED;
} }
else if (URB_Status == USBH_URB_NOTREADY) else if (URB_Status == USBH_URB_NOTREADY)
{ {
@ -784,8 +776,8 @@ static USBH_StatusTypeDef USBH_HandleControl (USBH_HandleTypeDef *phost)
} }
else if(URB_Status == USBH_URB_STALL) else if(URB_Status == USBH_URB_STALL)
{ {
//Retry transaction //Command not supported, report to callee
phost->Control.state = CTRL_ERROR; status = USBH_NOT_SUPPORTED;
} }
if ((int32_t)(phost->Timer - phost->Control.timer) >= USBH_CTRL_TRANSACTION_TIMEOUT_MS) if ((int32_t)(phost->Timer - phost->Control.timer) >= USBH_CTRL_TRANSACTION_TIMEOUT_MS)

Loading…
Cancel
Save