/* stalled */
case -EPIPE:
- /* for control endpoints, a stall indicates a protocol error */
+ /* for control endpoints, (used by CB[I]) a stall indicates
+ * a failed command */
if (usb_pipecontrol(pipe)) {
US_DEBUGP("-- stall on control pipe\n");
- return USB_STOR_XFER_ERROR;
+ return USB_STOR_XFER_STALLED;
}
/* for other sorts of endpoint, clear the stall */
/* check the return code for the command */
US_DEBUGP("Call to usb_stor_ctrl_transfer() returned %d\n", result);
+
+ /* if we stalled the command, it means command failed */
+ if (result == USB_STOR_XFER_STALLED) {
+ return USB_STOR_TRANSPORT_FAILED;
+ }
+
+ /* Uh oh... serious problem here */
if (result != USB_STOR_XFER_GOOD) {
- /* Uh oh... serious problem here */
return USB_STOR_TRANSPORT_ERROR;
}
/* check the return code for the command */
US_DEBUGP("Call to usb_stor_ctrl_transfer() returned %d\n", result);
+
+ /* if we stalled the command, it means command failed */
+ if (result == USB_STOR_XFER_STALLED) {
+ return USB_STOR_TRANSPORT_FAILED;
+ }
+
+ /* Uh oh... serious problem here */
if (result != USB_STOR_XFER_GOOD) {
- /* Uh oh... serious problem here */
return USB_STOR_TRANSPORT_ERROR;
}