(patch 5 of 13)

Hi,

Here's a patch for the usb-serial keyspan driver against 2.2.20-pre2
that brings it up to the same logic level that is in 2.4.5.

thanks,

greg k-h
diff -Nru a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
--- a/drivers/usb/serial/keyspan.c      Tue Jun 12 22:34:40 2001
+++ b/drivers/usb/serial/keyspan.c      Tue Jun 12 22:34:40 2001
@@ -28,6 +28,9 @@
   open source projects.
 
   Change History
+   (04/08/2001) gb
+       Identify version on module load.
+   
     Tue Oct 10 23:15:33 EST 2000 Hugh
       Merged Paul's changes with my USA-49W mods.  Work in progress
       still...
@@ -46,6 +49,7 @@
 */
 
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
@@ -59,16 +63,24 @@
 #include <linux/tty_flip.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
-
-#define DEBUG
-/*  #ifdef CONFIG_USB_SERIAL_DEBUG */
-       #define DEBUG
-/*  #endif */
 #include <linux/usb.h>
 
+#ifdef CONFIG_USB_SERIAL_DEBUG
+       static int debug = 1;
+#else
+       static int debug;
+#endif
+
 #include "usb-serial.h"
 #include "keyspan.h"
 
+/*
+ * Version Information
+ */
+#define DRIVER_VERSION "v1.0.0"
+#define DRIVER_AUTHOR "Hugh Blemings <[EMAIL PROTECTED]>"
+#define DRIVER_DESC "Keyspan USB to Serial Converter Driver"
+
 #define INSTAT_BUFLEN  32
 #define GLOCONT_BUFLEN 64
 
@@ -161,6 +173,10 @@
        usb_serial_register (&keyspan_usa28_device);
        usb_serial_register (&keyspan_usa28x_device);
        usb_serial_register (&keyspan_usa49w_device);
+
+       info(DRIVER_VERSION " " DRIVER_AUTHOR);
+       info(DRIVER_DESC);
+
        return 0;
 }
 
@@ -1282,7 +1298,21 @@
                msg.setPrescaler = 0xff;
        }
 
-       msg.lcr = USA_DATABITS_8 | STOPBITS_5678_1;
+       msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1;
+       switch (p_priv->cflag & CSIZE) {
+       case CS5:
+               msg.lcr |= USA_DATABITS_5;
+               break;
+       case CS6:
+               msg.lcr |= USA_DATABITS_6;
+               break;
+       case CS7:
+               msg.lcr |= USA_DATABITS_7;
+               break;
+       case CS8:
+               msg.lcr |= USA_DATABITS_8;
+               break;
+       }
        if (p_priv->cflag & PARENB) {
                /* note USA_PARITY_NONE == 0 */
                msg.lcr |= (p_priv->cflag & PARODD)?
@@ -1475,7 +1505,21 @@
                //msg.setPrescaler = 0xff;
        }
 
-       msg.lcr = USA_DATABITS_8 | STOPBITS_5678_1;
+       msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1;
+       switch (p_priv->cflag & CSIZE) {
+       case CS5:
+               msg.lcr |= USA_DATABITS_5;
+               break;
+       case CS6:
+               msg.lcr |= USA_DATABITS_6;
+               break;
+       case CS7:
+               msg.lcr |= USA_DATABITS_7;
+               break;
+       case CS8:
+               msg.lcr |= USA_DATABITS_8;
+               break;
+       }
        if (p_priv->cflag & PARENB) {
                /* note USA_PARITY_NONE == 0 */
                msg.lcr |= (p_priv->cflag & PARODD)?
@@ -1668,3 +1712,10 @@
                kfree(port->private);
        }
 }
+
+MODULE_AUTHOR( DRIVER_AUTHOR );
+MODULE_DESCRIPTION( DRIVER_DESC );
+
+MODULE_PARM(debug, "i");
+MODULE_PARM_DESC(debug, "Debug enabled or not");
+

Reply via email to