summaryrefslogtreecommitdiff
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2002-10-27 19:52:34 -0800
committerGreg Kroah-Hartman <greg@kroah.com>2002-10-27 19:52:34 -0800
commitee4c95a2c878aaf3782854aa6ca51300cb18aaa1 (patch)
tree7862bd86cd1fa9c2a0efbd4ed1856e3afeedfd69 /drivers/bluetooth
parent4416fcb0d0aff5c1cfbd2e4de5e477d07a54cee2 (diff)
USB: fix the usb drivers outside the drivers/usb tree due to interrupt urb no automatic resubmission change to the usb core.
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_usb.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 31019ddd0244..ce6f9da59efc 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -438,16 +438,34 @@ static void hci_usb_interrupt(struct urb *urb)
__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 @@ static void hci_usb_interrupt(struct urb *urb)
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)