From: johann d. <jd...@us...> - 2002-06-02 17:19:24
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb/input In directory usw-pr-cvs1:/tmp/cvs-serv1034/drivers/usb/input Modified Files: hid-core.c Log Message: Unlink failed URBs in hid_init_reports. Index: hid-core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/input/hid-core.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- hid-core.c 28 May 2002 17:16:25 -0000 1.3 +++ hid-core.c 2 Jun 2002 17:19:21 -0000 1.4 @@ -1159,7 +1159,7 @@ add_wait_queue(&hid->wait, &wait); while (timeout && (test_bit(HID_CTRL_RUNNING, &hid->iofl) || - test_bit(HID_OUT_RUNNING, &hid->iofl))) + test_bit(HID_OUT_RUNNING, &hid->iofl))) timeout = schedule_timeout(timeout); set_current_state(TASK_RUNNING); @@ -1210,6 +1210,7 @@ struct hid_report *report; struct list_head *list; int len; + int err, ret; report_enum = hid->report_enum + HID_INPUT_REPORT; list = report_enum->report_list.next; @@ -1227,7 +1228,16 @@ list = list->next; } - if (hid_wait_io(hid)) { + err = 0; + while (ret = hid_wait_io(hid)) { + err |= ret; + if (test_bit(HID_CTRL_RUNNING, &hid->iofl)) + usb_unlink_urb(hid->urbctrl); + if (test_bit(HID_OUT_RUNNING, &hid->iofl)) + usb_unlink_urb(hid->urbout); + } + + if (err) { warn("timeout initializing reports\n"); return; } @@ -1346,6 +1356,7 @@ goto fail; pipe = usb_sndbulkpipe(dev, endpoint->bEndpointAddress); FILL_BULK_URB(hid->urbout, dev, pipe, hid->outbuf, 0, hid_irq_out, hid); + hid->urbout->transfer_flags |= USB_ASYNC_UNLINK; } } @@ -1386,6 +1397,7 @@ hid->urbctrl = usb_alloc_urb(0, GFP_KERNEL); FILL_CONTROL_URB(hid->urbctrl, dev, 0, (void*) &hid->cr, hid->ctrlbuf, 1, hid_ctrl, hid); + hid->urbctrl->transfer_flags |= USB_ASYNC_UNLINK; return hid; |