patch-2.4.5 linux/drivers/usb/serial/keyspan.c

Next file: linux/drivers/usb/serial/keyspan_pda.c
Previous file: linux/drivers/usb/serial/io_edgeport.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/drivers/usb/serial/keyspan.c linux/drivers/usb/serial/keyspan.c
@@ -28,6 +28,9 @@
   open source projects.
 
   Change History
+   (04/08/2001) gb
+	Identify version on module load.
+   
    (11/01/2000) Adam J. Richter
 	usb_device_id table support.
    
@@ -74,6 +77,13 @@
 #include "usb-serial.h"
 #include "keyspan.h"
 
+/*
+ * Version Information
+ */
+#define DRIVER_VERSION "v1.0.0"
+#define DRIVER_AUTHOR "Hugh Blemings <hugh@linuxcare.com>"
+#define DRIVER_DESC "Keyspan USB to Serial Converter Driver"
+
 #define INSTAT_BUFLEN	32
 #define GLOCONT_BUFLEN	64
 
@@ -166,6 +176,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;
 }
 
@@ -1287,7 +1301,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)?
@@ -1480,7 +1508,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)?
@@ -1673,6 +1715,9 @@
 		kfree(port->private);
 	}
 }
+
+MODULE_AUTHOR( DRIVER_AUTHOR );
+MODULE_DESCRIPTION( DRIVER_DESC );
 
 MODULE_PARM(debug, "i");
 MODULE_PARM_DESC(debug, "Debug enabled or not");

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)