diff options
| -rw-r--r-- | drivers/bluetooth/hci_usb.c | 30 | ||||
| -rw-r--r-- | drivers/input/joystick/iforce/iforce-usb.c | 25 | ||||
| -rw-r--r-- | drivers/isdn/hisax/st5481_usb.c | 30 |
3 files changed, 72 insertions, 13 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) diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c index b5b07ca56cba..673ed522f1cf 100644 --- a/drivers/input/joystick/iforce/iforce-usb.c +++ b/drivers/input/joystick/iforce/iforce-usb.c @@ -77,9 +77,32 @@ void iforce_usb_xmit(struct iforce *iforce) 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 --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c index 1a03312607b7..be2d213318b8 100644 --- a/drivers/isdn/hisax/st5481_usb.c +++ b/drivers/isdn/hisax/st5481_usb.c @@ -182,21 +182,28 @@ static void usb_int_complete(struct urb *urb) 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 @@ static void usb_int_complete(struct urb *urb) 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); } /* ====================================================================== |
