ChangeSet 1.808.2.15, 2002/10/28 11:46:49-08:00, greg@kroah.com USB: fix the usb input drivers due to interrupt urb no automatic resubmission change to the usb core. diff -Nru a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c --- a/drivers/usb/input/aiptek.c Mon Oct 28 13:53:38 2002 +++ b/drivers/usb/input/aiptek.c Mon Oct 28 13:53:38 2002 @@ -134,9 +134,22 @@ int y; int pressure; int proximity; + int retval; - if (urb->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 - nonzero urb status received: %d", __FUNCTION__, urb->status); + goto exit; + } if ((data[0] & 2) == 0) { dbg("received unknown report #%d", data[0]); @@ -165,6 +178,11 @@ input_sync(dev); +exit: + retval = usb_submit_urb (urb, GFP_ATOMIC); + if (retval) + err ("%s - usb_submit_urb failed with result %d", + __FUNCTION__, retval); } struct aiptek_features aiptek_features[] = { diff -Nru a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c --- a/drivers/usb/input/powermate.c Mon Oct 28 13:53:38 2002 +++ b/drivers/usb/input/powermate.c Mon Oct 28 13:53:38 2002 @@ -78,14 +78,33 @@ static void powermate_irq(struct urb *urb) { struct powermate_device *pm = urb->context; + int retval; - if (urb->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 - nonzero urb status received: %d", __FUNCTION__, urb->status); + goto exit; + } /* handle updates to device state */ input_report_key(&pm->input, BTN_0, pm->data[0] & 0x01); input_report_rel(&pm->input, REL_DIAL, pm->data[1]); input_sync(&pm->input); + +exit: + retval = usb_submit_urb (urb, GFP_ATOMIC); + if (retval) + err ("%s - usb_submit_urb failed with result %d", + __FUNCTION__, retval); } /* Decide if we need to issue a control message and do so. Must be called with pm->lock down */ diff -Nru a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c --- a/drivers/usb/input/wacom.c Mon Oct 28 13:53:38 2002 +++ b/drivers/usb/input/wacom.c Mon Oct 28 13:53:38 2002 @@ -108,8 +108,22 @@ unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; int prox, pressure; + int retval; - if (urb->status) return; + 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 - nonzero urb status received: %d", __FUNCTION__, urb->status); + goto exit; + } if (data[0] != 2) dbg("received unknown report #%d", data[0]); @@ -135,6 +149,12 @@ } input_sync(dev); + +exit: + retval = usb_submit_urb (urb, GFP_ATOMIC); + if (retval) + err ("%s - usb_submit_urb failed with result %d", + __FUNCTION__, retval); } static void wacom_penpartner_irq(struct urb *urb) @@ -142,8 +162,22 @@ struct wacom *wacom = urb->context; unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; + int retval; - if (urb->status) return; + 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 - nonzero urb status received: %d", __FUNCTION__, urb->status); + goto exit; + } input_report_key(dev, BTN_TOOL_PEN, 1); input_report_abs(dev, ABS_X, data[2] << 8 | data[1]); @@ -152,6 +186,12 @@ input_report_key(dev, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20)); input_report_key(dev, BTN_STYLUS, (data[5] & 0x40)); input_sync(dev); + +exit: + retval = usb_submit_urb (urb, GFP_ATOMIC); + if (retval) + err ("%s - usb_submit_urb failed with result %d", + __FUNCTION__, retval); } static void wacom_graphire_irq(struct urb *urb) @@ -160,8 +200,22 @@ unsigned char *data = wacom->data; struct input_dev *dev = &wacom->dev; int x, y; + int retval; - if (urb->status) return; + 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 - nonzero urb status received: %d", __FUNCTION__, urb->status); + goto exit; + } if (data[0] != 2) dbg("received unknown report #%d", data[0]); @@ -191,7 +245,7 @@ input_report_abs(dev, ABS_Y, y); input_sync(dev); - return; + goto exit; } if (data[1] & 0x80) { @@ -205,6 +259,12 @@ input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); input_sync(dev); + +exit: + retval = usb_submit_urb (urb, GFP_ATOMIC); + if (retval) + err ("%s - usb_submit_urb failed with result %d", + __FUNCTION__, retval); } static void wacom_intuos_irq(struct urb *urb) @@ -214,8 +274,22 @@ struct input_dev *dev = &wacom->dev; unsigned int t; int idx; + int retval; - if (urb->status) return; + 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 - nonzero urb status received: %d", __FUNCTION__, urb->status); + goto exit; + } if (data[0] != 2) dbg("received unknown report #%d", data[0]); @@ -253,13 +327,13 @@ input_report_key(dev, wacom->tool[idx], 1); input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); input_sync(dev); - return; + goto exit; } if ((data[1] & 0xfe) == 0x80) { /* Exit report */ input_report_key(dev, wacom->tool[idx], 0); input_sync(dev); - return; + goto exit; } input_report_abs(dev, ABS_X, ((__u32)data[2] << 8) | data[3]); @@ -323,6 +397,12 @@ } input_sync(dev); + +exit: + retval = usb_submit_urb (urb, GFP_ATOMIC); + if (retval) + err ("%s - usb_submit_urb failed with result %d", + __FUNCTION__, retval); } struct wacom_features wacom_features[] = { diff -Nru a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c --- a/drivers/usb/input/xpad.c Mon Oct 28 13:53:38 2002 +++ b/drivers/usb/input/xpad.c Mon Oct 28 13:53:38 2002 @@ -166,11 +166,30 @@ static void xpad_irq_in(struct urb *urb) { struct usb_xpad *xpad = urb->context; + int retval; - if (urb->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 - nonzero urb status received: %d", __FUNCTION__, urb->status); + goto exit; + } xpad_process_packet(xpad, 0, xpad->idata); + +exit: + retval = usb_submit_urb (urb, GFP_ATOMIC); + if (retval) + err ("%s - usb_submit_urb failed with result %d", + __FUNCTION__, retval); } static int xpad_open (struct input_dev *dev)