As far as I know, this patch hasn't made it into any of the 2.4.21-pre kernels yet. He made a similar patch for 2.5 as well.
diff -u 2.4.21-pre3/drivers/usb/storage.orig/datafab.c
2.4.21-pre3/drivers/usb/storage/datafab.c
--- 2.4.21-pre3/drivers/usb/storage.orig/datafab.c Fri Aug 2 20:39:45 2002
+++ 2.4.21-pre3/drivers/usb/storage/datafab.c Mon Jan 27 09:55:04 2003
@@ -121,8 +121,8 @@
return US_BULK_TRANSFER_FAILED;
}
- // -ENOENT -- we canceled this transfer
- if (result == -ENOENT) {
+ // -ECONNRESET -- we canceled this transfer
+ if (result == -ECONNRESET) {
US_DEBUGP("datafab_raw_bulk: transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
diff -u 2.4.21-pre3/drivers/usb/storage.orig/freecom.c
2.4.21-pre3/drivers/usb/storage/freecom.c
--- 2.4.21-pre3/drivers/usb/storage.orig/freecom.c Thu Nov 28 18:53:15 2002
+++ 2.4.21-pre3/drivers/usb/storage/freecom.c Mon Jan 27 09:58:40 2003
@@ -198,7 +198,7 @@
result = usb_stor_bulk_msg (us, ideout, opipe,
FCM_PACKET_LENGTH, &partial);
if (result != 0) {
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return US_BULK_TRANSFER_ABORTED;
else
return USB_STOR_TRANSPORT_ERROR;
@@ -238,7 +238,7 @@
result = usb_stor_bulk_msg (us, idein, opipe,
FCM_PACKET_LENGTH, &partial);
if (result != 0) {
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return US_BULK_TRANSFER_ABORTED;
else
return USB_STOR_TRANSPORT_ERROR;
@@ -251,7 +251,7 @@
result = usb_stor_bulk_msg (us, buffer, ipipe,
desired_length, &partial);
if (result != 0) {
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return US_BULK_TRANSFER_ABORTED;
else
return USB_STOR_TRANSPORT_ERROR;
@@ -292,8 +292,8 @@
US_DEBUGP ("Freecom readdata xpot failure: r=%d, p=%d\n",
result, partial);
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("freecom_readdata(): transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
@@ -333,8 +333,8 @@
US_DEBUGP ("Freecom writedata xpot failure: r=%d, p=%d\n",
result, partial);
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("freecom_writedata(): transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
@@ -396,8 +396,8 @@
US_DEBUGP ("freecom xport failure: r=%d, p=%d\n",
result, partial);
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("freecom_transport(): transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
@@ -410,8 +410,8 @@
result = usb_stor_bulk_msg (us, fst, ipipe,
FCM_PACKET_LENGTH, &partial);
US_DEBUGP("foo Status result %d %d\n", result, partial);
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("freecom_transport(): transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
@@ -448,8 +448,8 @@
US_DEBUGP ("freecom xport failure: r=%d, p=%d\n",
result, partial);
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("freecom_transport(): transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
@@ -463,8 +463,8 @@
US_DEBUGP("bar Status result %d %d\n", result, partial);
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("freecom_transport(): transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
@@ -524,7 +524,7 @@
result = usb_stor_bulk_msg (us, fst, ipipe,
FCM_PACKET_LENGTH, &partial);
US_DEBUG(pdump ((void *) fst, partial));
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
US_DEBUGP ("freecom_transport: transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
@@ -552,7 +552,7 @@
US_DEBUGP("FCM: Waiting for status\n");
result = usb_stor_bulk_msg (us, fst, ipipe,
FCM_PACKET_LENGTH, &partial);
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
US_DEBUGP ("freecom_transport: transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
diff -u 2.4.21-pre3/drivers/usb/storage.orig/isd200.c
2.4.21-pre3/drivers/usb/storage/isd200.c
--- 2.4.21-pre3/drivers/usb/storage.orig/isd200.c Sat Jan 25 19:01:48 2003
+++ 2.4.21-pre3/drivers/usb/storage/isd200.c Mon Jan 27 09:59:29 2003
@@ -435,8 +435,8 @@
return ISD200_TRANSPORT_FAILED;
}
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("isd200_transfer_partial(): transfer aborted\n");
return ISD200_TRANSPORT_ABORTED;
}
@@ -574,7 +574,7 @@
&partial);
US_DEBUGP("Bulk command transfer result=%d\n", result);
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return ISD200_TRANSPORT_ABORTED;
else if (result == -EPIPE) {
/* if we stall, we need to clear it before we go on */
@@ -603,7 +603,7 @@
US_DEBUGP("Attempting to get CSW...\n");
result = usb_stor_bulk_msg(us, &bcs, pipe, US_BULK_CS_WRAP_LEN,
&partial);
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return ISD200_TRANSPORT_ABORTED;
/* did the attempt to read the CSW fail? */
@@ -617,7 +617,7 @@
US_BULK_CS_WRAP_LEN, &partial);
/* if the command was aborted, indicate that */
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return ISD200_TRANSPORT_ABORTED;
/* if it fails again, we need a reset and return an error*/
diff -u 2.4.21-pre3/drivers/usb/storage.orig/jumpshot.c
2.4.21-pre3/drivers/usb/storage/jumpshot.c
--- 2.4.21-pre3/drivers/usb/storage.orig/jumpshot.c Fri Aug 2 20:39:45 2002
+++ 2.4.21-pre3/drivers/usb/storage/jumpshot.c Mon Jan 27 09:59:58 2003
@@ -132,7 +132,7 @@
if (result < 0) {
/* if the command was aborted, indicate that */
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return USB_STOR_TRANSPORT_ABORTED;
/* a stall is a fatal condition from the device */
@@ -181,8 +181,8 @@
return US_BULK_TRANSFER_FAILED;
}
- // -ENOENT -- we canceled this transfer
- if (result == -ENOENT) {
+ // -ECONNRESET -- we canceled this transfer
+ if (result == -ECONNRESET) {
US_DEBUGP("jumpshot_raw_bulk: transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
diff -u 2.4.21-pre3/drivers/usb/storage.orig/sddr09.c
2.4.21-pre3/drivers/usb/storage/sddr09.c
--- 2.4.21-pre3/drivers/usb/storage.orig/sddr09.c Fri Aug 2 20:39:45 2002
+++ 2.4.21-pre3/drivers/usb/storage/sddr09.c Mon Jan 27 10:00:27 2003
@@ -110,7 +110,7 @@
if (result < 0) {
/* if the command was aborted, indicate that */
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return USB_STOR_TRANSPORT_ABORTED;
/* a stall is a fatal condition from the device */
@@ -161,8 +161,8 @@
return US_BULK_TRANSFER_FAILED;
}
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("usbat_raw_bulk():"
" transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
diff -u 2.4.21-pre3/drivers/usb/storage.orig/sddr55.c
2.4.21-pre3/drivers/usb/storage/sddr55.c
--- 2.4.21-pre3/drivers/usb/storage.orig/sddr55.c Thu Nov 28 18:53:15 2002
+++ 2.4.21-pre3/drivers/usb/storage/sddr55.c Mon Jan 27 10:00:51 2003
@@ -106,8 +106,8 @@
return US_BULK_TRANSFER_FAILED;
}
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("usbat_raw_bulk():"
" transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
diff -u 2.4.21-pre3/drivers/usb/storage.orig/shuttle_usbat.c
2.4.21-pre3/drivers/usb/storage/shuttle_usbat.c
--- 2.4.21-pre3/drivers/usb/storage.orig/shuttle_usbat.c Fri Aug 2 20:39:45
2002
+++ 2.4.21-pre3/drivers/usb/storage/shuttle_usbat.c Mon Jan 27 10:01:12 2003
@@ -104,7 +104,7 @@
if (result < 0) {
/* if the command was aborted, indicate that */
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return USB_STOR_TRANSPORT_ABORTED;
/* a stall is a fatal condition from the device */
@@ -155,8 +155,8 @@
return US_BULK_TRANSFER_FAILED;
}
- /* -ENOENT -- we canceled this transfer */
- if (result == -ENOENT) {
+ /* -ECONNRESET -- we canceled this transfer */
+ if (result == -ECONNRESET) {
US_DEBUGP("usbat_raw_bulk():"
" transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
diff -u 2.4.21-pre3/drivers/usb/storage.orig/transport.c
2.4.21-pre3/drivers/usb/storage/transport.c
--- 2.4.21-pre3/drivers/usb/storage.orig/transport.c Thu Nov 28 18:53:15 2002
+++ 2.4.21-pre3/drivers/usb/storage/transport.c Mon Jan 27 09:50:57 2003
@@ -520,7 +520,7 @@
}
/* did we abort this command? */
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
US_DEBUGP("usb_stor_transfer_partial(): transfer aborted\n");
return US_BULK_TRANSFER_ABORTED;
}
@@ -820,7 +820,7 @@
}
/* is the device removed? */
- if (urb->status == -ENOENT) {
+ if (urb->status == -ENODEV) {
US_DEBUGP("-- device has been removed\n");
return;
}
@@ -876,7 +876,7 @@
}
/* if the command was aborted, indicate that */
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return USB_STOR_TRANSPORT_ABORTED;
/* STALL must be cleared when it is detected */
@@ -886,7 +886,7 @@
usb_sndctrlpipe(us->pusb_dev, 0));
/* if the command was aborted, indicate that */
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return USB_STOR_TRANSPORT_ABORTED;
return USB_STOR_TRANSPORT_FAILED;
}
@@ -989,7 +989,7 @@
US_DEBUGP("Call to usb_stor_control_msg() returned %d\n", result);
if (result < 0) {
/* if the command was aborted, indicate that */
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return USB_STOR_TRANSPORT_ABORTED;
/* a stall is a fatal condition from the device */
@@ -999,7 +999,7 @@
usb_sndctrlpipe(us->pusb_dev, 0));
/* if the command was aborted, indicate that */
- if (result == -ENOENT)
+ if (result == -ECONNRESET)
return USB_STOR_TRANSPORT_ABORTED;
return USB_STOR_TRANSPORT_FAILED;
}
@@ -1129,7 +1129,7 @@
US_DEBUGP("Bulk command transfer result=%d\n", result);
/* if the command was aborted, indicate that */
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
ret = USB_STOR_TRANSPORT_ABORTED;
goto out;
}
@@ -1140,7 +1140,7 @@
result = usb_stor_clear_halt(us, pipe);
/* if the command was aborted, indicate that */
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
ret = USB_STOR_TRANSPORT_ABORTED;
goto out;
}
@@ -1180,7 +1180,7 @@
&partial);
/* if the command was aborted, indicate that */
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
ret = USB_STOR_TRANSPORT_ABORTED;
goto out;
}
@@ -1191,7 +1191,7 @@
result = usb_stor_clear_halt(us, pipe);
/* if the command was aborted, indicate that */
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
ret = USB_STOR_TRANSPORT_ABORTED;
goto out;
}
@@ -1202,7 +1202,7 @@
US_BULK_CS_WRAP_LEN, &partial);
/* if the command was aborted, indicate that */
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
ret = USB_STOR_TRANSPORT_ABORTED;
goto out;
}
@@ -1213,7 +1213,7 @@
result = usb_stor_clear_halt(us, pipe);
/* if the command was aborted, indicate that */
- if (result == -ENOENT) {
+ if (result == -ECONNRESET) {
ret = USB_STOR_TRANSPORT_ABORTED;
} else {
ret = USB_STOR_TRANSPORT_ERROR;
-- Tom Collins [EMAIL PROTECTED]
