ChangeSet 1.1807.48.6, 2004/07/30 16:35:06-07:00, [EMAIL PROTECTED]

[PATCH] USB: Hackish fix for cyberjack driver

The following patch is in use by REINER-SCT customres for some time and
works for them in about 90% of all cases.  I would really appreciate
this going in before 2.6.8-final, since the device doesn't work at all
with current 2.6.x driver.

Changes:
- bump version number
- open interrupt endpoint in startup() rather than open


Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/serial/cyberjack.c |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)


diff -Nru a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
--- a/drivers/usb/serial/cyberjack.c    2004-08-23 13:21:48 -07:00
+++ b/drivers/usb/serial/cyberjack.c    2004-08-23 13:21:48 -07:00
@@ -44,7 +44,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.0"
+#define DRIVER_VERSION "v1.01"
 #define DRIVER_AUTHOR "Matthias Bruestle"
 #define DRIVER_DESC "REINER SCT cyberJack pinpad/e-com USB Chipcard Reader Driver"
 
@@ -128,6 +128,16 @@
 
        init_waitqueue_head(&serial->port[0]->write_wait);
 
+       for (i = 0; i < serial->num_ports; ++i) {
+               int result;
+               serial->port[i]->interrupt_in_urb->dev = serial->dev;
+               result = usb_submit_urb(serial->port[i]->interrupt_in_urb, 
+                                       GFP_KERNEL);
+               if (result)
+                       err(" usb_submit_urb(read int) failed");
+               dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
+       }
+
        return( 0 );
 }
 
@@ -138,6 +148,7 @@
        dbg("%s", __FUNCTION__);
 
        for (i=0; i < serial->num_ports; ++i) {
+               usb_unlink_urb (serial->port[i]->interrupt_in_urb);
                /* My special items, the standard routines free my urbs */
                kfree(usb_get_serial_port_data(serial->port[i]));
                usb_set_serial_port_data(serial->port[i], NULL);
@@ -168,17 +179,6 @@
        priv->wrsent = 0;
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       /* shutdown any bulk reads that might be going on */
-       usb_unlink_urb (port->write_urb);
-       usb_unlink_urb (port->read_urb);
-       usb_unlink_urb (port->interrupt_in_urb);
-
-       port->interrupt_in_urb->dev = port->serial->dev;
-       result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
-       if (result)
-               err(" usb_submit_urb(read int) failed");
-       dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
-
        return result;
 }
 
@@ -190,11 +190,6 @@
                /* shutdown any bulk reads that might be going on */
                usb_unlink_urb (port->write_urb);
                usb_unlink_urb (port->read_urb);
-               usb_unlink_urb (port->interrupt_in_urb);
-               dbg("%s - usb_clear_halt", __FUNCTION__ );
-               usb_clear_halt(port->serial->dev, port->write_urb->pipe);
-               usb_clear_halt(port->serial->dev, port->read_urb->pipe);
-               usb_clear_halt(port->serial->dev, port->interrupt_in_urb->pipe);
        }
 }
 
@@ -376,6 +371,10 @@
        }
 
        tty = port->tty;
+       if (!tty) {
+               dbg("%s - ignoring since device not open\n", __FUNCTION__);
+               return;
+       }
        if (urb->actual_length) {
                for (i = 0; i < urb->actual_length ; ++i) {
                        /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop 
them. */



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to