From: johann d. <jd...@us...> - 2002-02-08 00:35:36
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce In directory usw-pr-cvs1:/tmp/cvs-serv7484 Modified Files: iforce-packets.c iforce-usb.c Log Message: Fixes to the asynchronous sending of packets. USB should be less terrible than it used to be, RS232 is certainly broken. Index: iforce-packets.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce-packets.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- iforce-packets.c 2 Feb 2002 19:28:35 -0000 1.9 +++ iforce-packets.c 8 Feb 2002 00:35:34 -0000 1.10 @@ -1,8 +1,8 @@ /* * $Id$ * - * Copyright (c) 2000-2001 Vojtech Pavlik <vo...@uc...> - * Copyright (c) 2001 Johann Deneux <de...@if...> + * Copyright (c) 2000-2002 Vojtech Pavlik <vo...@uc...> + * Copyright (c) 2001-2002 Johann Deneux <de...@if...> * * USB/RS232 I-Force joysticks and wheels. */ @@ -110,9 +110,9 @@ #ifdef IFORCE_USB case IFORCE_USB: - /* FIXME: iforce->out.status should not be checked outside - * the completion handler */ - if (iforce->usbdev && empty && !iforce->out.status) { + if (iforce->usbdev && empty && + !test_and_set_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flag s)) { + iforce_usb_xmit(iforce); } break; Index: iforce-usb.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce-usb.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- iforce-usb.c 3 Feb 2002 19:37:37 -0000 1.11 +++ iforce-usb.c 8 Feb 2002 00:35:34 -0000 1.12 @@ -37,6 +37,7 @@ spin_lock_irqsave(&iforce->xmit_lock, flags); if (iforce->xmit.head == iforce->xmit.tail) { + clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); spin_unlock_irqrestore(&iforce->xmit_lock, flags); return; } @@ -46,7 +47,7 @@ n = iforce->xmit.buf[iforce->xmit.tail]; XMIT_INC(iforce->xmit.tail, 1); - iforce->out.transfer_buffer_length = n + 2; + iforce->out.transfer_buffer_length = n + 1; iforce->out.dev = iforce->usbdev; /* Copy rest of data then */ @@ -67,6 +68,9 @@ printk(KERN_WARNING "iforce.c: iforce_usb_xmit: usb_submit_urb failed %d\n", n); } + /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended. + * As long as the urb completion handler is not called, the transmiting + * is considered to be running */ spin_unlock_irqrestore(&iforce->xmit_lock, flags); } |