ChangeSet 1.808.2.22, 2002/10/28 11:52:34-08:00, [EMAIL PROTECTED]
USB: fix the usb drivers outside the drivers/usb tree due to interrupt urb no
automatic resubmission change to the usb core.
diff -Nru a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
--- a/drivers/bluetooth/hci_usb.c Mon Oct 28 13:52:13 2002
+++ b/drivers/bluetooth/hci_usb.c Mon Oct 28 13:52:13 2002
@@ -438,16 +438,34 @@
__u8 *data = urb->transfer_buffer;
int count = urb->actual_length;
int len = HCI_EVENT_HDR_SIZE;
+ int status;
BT_DBG("%s urb %p count %d", husb->hdev.name, urb, count);
if (!test_bit(HCI_RUNNING, &husb->hdev.flags))
return;
- if (urb->status || !count) {
+ switch (urb->status) {
+ case 0:
+ /* success */
+ break;
+ case -ECONNRESET:
+ case -ENOENT:
+ case -ESHUTDOWN:
+ /* this urb is terminated, clean up */
+ BT_DBG("%s urb shutting down with status: %d",
+ husb->hdev.name, urb->status);
+ return;
+ default:
+ BT_ERR("%s nonzero urb status received: %d",
+ husb->hdev.name, urb->status);
+ goto exit;
+ }
+
+ if (!count) {
BT_DBG("%s intr status %d, count %d",
husb->hdev.name, urb->status, count);
- return;
+ goto exit;
}
read_lock(&husb->completion_lock);
@@ -499,12 +517,18 @@
done:
read_unlock(&husb->completion_lock);
- return;
+ goto exit;
bad_len:
BT_ERR("%s bad frame len %d expected %d", husb->hdev.name, count, len);
husb->hdev.stat.err_rx++;
read_unlock(&husb->completion_lock);
+
+exit:
+ status = usb_submit_urb (urb, GFP_ATOMIC);
+ if (status)
+ BT_ERR ("%s usb_submit_urb failed with result %d",
+ husb->hdev.name, status);
}
static void hci_usb_tx_complete(struct urb *urb)
diff -Nru a/drivers/input/joystick/iforce/iforce-usb.c
b/drivers/input/joystick/iforce/iforce-usb.c
--- a/drivers/input/joystick/iforce/iforce-usb.c Mon Oct 28 13:52:13 2002
+++ b/drivers/input/joystick/iforce/iforce-usb.c Mon Oct 28 13:52:13 2002
@@ -77,9 +77,32 @@
static void iforce_usb_irq(struct urb *urb)
{
struct iforce *iforce = urb->context;
- if (urb->status) return;
+ int status;
+
+ switch (urb->status) {
+ case 0:
+ /* success */
+ break;
+ case -ECONNRESET:
+ case -ENOENT:
+ case -ESHUTDOWN:
+ /* this urb is terminated, clean up */
+ dbg("%s - urb shutting down with status: %d",
+ __FUNCTION__, urb->status);
+ return;
+ default:
+ dbg("%s - urb has status of: %d", __FUNCTION__, urb->status);
+ goto exit;
+ }
+
iforce_process_packet(iforce,
(iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1);
+
+exit:
+ status = usb_submit_urb (urb, GFP_ATOMIC);
+ if (status)
+ err ("%s - usb_submit_urb failed with result %d",
+ __FUNCTION__, status);
}
static void iforce_usb_out(struct urb *urb)
diff -Nru a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c
--- a/drivers/isdn/hisax/st5481_usb.c Mon Oct 28 13:52:13 2002
+++ b/drivers/isdn/hisax/st5481_usb.c Mon Oct 28 13:52:13 2002
@@ -182,21 +182,28 @@
u_char irqbyte;
struct st5481_adapter *adapter = urb->context;
int j;
+ int status;
- if (urb->status < 0) {
- if (urb->status != -ENOENT) {
- WARN("urb status %d",urb->status);
- urb->actual_length = 0;
- } else {
- DBG(1,"urb killed");
- return; // Give up
- }
+ switch (urb->status) {
+ case 0:
+ /* success */
+ break;
+ case -ECONNRESET:
+ case -ENOENT:
+ case -ESHUTDOWN:
+ /* this urb is terminated, clean up */
+ DBG(1, "urb shutting down with status: %d", urb->status);
+ return;
+ default:
+ WARN("nonzero urb status received: %d", urb->status);
+ goto exit;
}
+
DBG_PACKET(1, data, INT_PKT_SIZE);
if (urb->actual_length == 0) {
- return;
+ goto exit;
}
irqbyte = data[MPINT];
@@ -221,6 +228,11 @@
adapter->bcs[j].b_out.flow_event |= data[FFINT_B1 + j];
urb->actual_length = 0;
+
+exit:
+ status = usb_submit_urb (urb, GFP_ATOMIC);
+ if (status)
+ WARN("usb_submit_urb failed with result %d", status);
}
/* ======================================================================
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel