<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.628   -&gt; 1.629  
#	drivers/usb/serial/mct_u232.c	1.17    -&gt; 1.18   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/29	greg@kroah.com	1.629
# USB: mct_u232 update due to usbserial core changes.
# --------------------------------------------
#
diff -Nru a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
--- a/drivers/usb/serial/mct_u232.c	Thu Aug 29 13:54:29 2002
+++ b/drivers/usb/serial/mct_u232.c	Thu Aug 29 13:54:29 2002
@@ -61,18 +61,15 @@
 
 #include &lt;linux/config.h&gt;
 #include &lt;linux/kernel.h&gt;
-#include &lt;linux/sched.h&gt;
-#include &lt;linux/signal.h&gt;
 #include &lt;linux/errno.h&gt;
-#include &lt;linux/poll.h&gt;
 #include &lt;linux/init.h&gt;
 #include &lt;linux/slab.h&gt;
-#include &lt;linux/fcntl.h&gt;
 #include &lt;linux/tty.h&gt;
 #include &lt;linux/tty_driver.h&gt;
 #include &lt;linux/tty_flip.h&gt;
 #include &lt;linux/module.h&gt;
 #include &lt;linux/spinlock.h&gt;
+#include &lt;asm/uaccess.h&gt;
 #include &lt;linux/usb.h&gt;
 
 #ifdef CONFIG_USB_SERIAL_DEBUG
@@ -132,7 +129,7 @@
 /*
  * All of the device info needed for the MCT USB-RS232 converter.
  */
-static __devinitdata struct usb_device_id id_table_combined [] = {
+static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(MCT_U232_VID, MCT_U232_PID) },
 	{ USB_DEVICE(MCT_U232_VID, MCT_U232_SITECOM_PID) },
 	{ USB_DEVICE(MCT_U232_VID, MCT_U232_DU_H3SP_PID) },
@@ -140,99 +137,31 @@
 	{ }		/* Terminating entry */
 };
 
-static struct usb_device_id mct_u232_table [] = {
-        { USB_DEVICE(MCT_U232_VID, MCT_U232_PID) },
-	{ USB_DEVICE(MCT_U232_BELKIN_F5U109_VID, MCT_U232_BELKIN_F5U109_PID) },
-        { }                        /* Terminating entry */
-};
-
-static struct usb_device_id mct_u232_sitecom_table [] = {
-        { USB_DEVICE(MCT_U232_VID, MCT_U232_SITECOM_PID) },
-        { }                        /* Terminating entry */
-};
-
-static struct usb_device_id mct_u232_du_h3sp_table [] = {
-        { USB_DEVICE(MCT_U232_VID, MCT_U232_DU_H3SP_PID) },
-        { }                        /* Terminating entry */
-};
-
 MODULE_DEVICE_TABLE (usb, id_table_combined);
 
 
 static struct usb_serial_device_type mct_u232_device = {
-	name:		     "Magic Control Technology USB-RS232",
-	id_table:	     mct_u232_table,
-	needs_interrupt_in:  MUST_HAVE,	 /* 2 interrupt-in endpoints */
-	needs_bulk_in:	     MUST_HAVE_NOT,   /* no bulk-in endpoint */
-	needs_bulk_out:	     MUST_HAVE,	      /* 1 bulk-out endpoint */
-	num_interrupt_in:    2,
-	num_bulk_in:	     0,
-	num_bulk_out:	     1,
-	num_ports:	     1,
-	open:		     mct_u232_open,
-	close:		     mct_u232_close,
+	.owner =	     THIS_MODULE,
+	.name =		     "Magic Control Technology USB-RS232",
+	.id_table =	     id_table_combined,
+	.num_interrupt_in =  2,
+	.num_bulk_in =	     0,
+	.num_bulk_out =	     1,
+	.num_ports =	     1,
+	.open =		     mct_u232_open,
+	.close =	     mct_u232_close,
 #ifdef FIX_WRITE_RETURN_CODE_PROBLEM
-	write:		     mct_u232_write,
-	write_bulk_callback: mct_u232_write_bulk_callback,
+	.write =	     mct_u232_write,
+	.write_bulk_callback = mct_u232_write_bulk_callback,
 #endif
-	read_int_callback:   mct_u232_read_int_callback,
-	ioctl:		     mct_u232_ioctl,
-	set_termios:	     mct_u232_set_termios,
-	break_ctl:	     mct_u232_break_ctl,
-	startup:	     mct_u232_startup,
-	shutdown:	     mct_u232_shutdown,
+	.read_int_callback = mct_u232_read_int_callback,
+	.ioctl =	     mct_u232_ioctl,
+	.set_termios =	     mct_u232_set_termios,
+	.break_ctl =	     mct_u232_break_ctl,
+	.startup =	     mct_u232_startup,
+	.shutdown =	     mct_u232_shutdown,
 };
 
-static struct usb_serial_device_type mct_u232_sitecom_device = {
-	name:		     "MCT/Sitecom USB-RS232",
-	id_table:	     mct_u232_sitecom_table,
-	needs_interrupt_in:  MUST_HAVE,	 /* 2 interrupt-in endpoints */
-	needs_bulk_in:	     MUST_HAVE_NOT,   /* no bulk-in endpoint */
-	needs_bulk_out:	     MUST_HAVE,	      /* 1 bulk-out endpoint */
-	num_interrupt_in:    2,
-	num_bulk_in:	     0,
-	num_bulk_out:	     1,
-	num_ports:	     1,
-	open:		     mct_u232_open,
-	close:		     mct_u232_close,
-#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
-	write:		     mct_u232_write,
-	write_bulk_callback: mct_u232_write_bulk_callback,
-#endif
-	read_int_callback:   mct_u232_read_int_callback,
-	ioctl:		     mct_u232_ioctl,
-	set_termios:	     mct_u232_set_termios,
-	break_ctl:	     mct_u232_break_ctl,
-	startup:	     mct_u232_startup,
-	shutdown:	     mct_u232_shutdown,
-};
-
-static struct usb_serial_device_type mct_u232_du_h3sp_device = {
-        name:                "MCT/D-Link DU-H3SP USB BAY",
-        id_table:            mct_u232_du_h3sp_table,
-        needs_interrupt_in:  MUST_HAVE,  /* 2 interrupt-in endpoints */
-        needs_bulk_in:       MUST_HAVE_NOT,   /* no bulk-in endpoint */
-        needs_bulk_out:      MUST_HAVE,       /* 1 bulk-out endpoint */
-        num_interrupt_in:    2,
-        num_bulk_in:         0,
-        num_bulk_out:        1,
-        num_ports:           1,
-        open:                mct_u232_open,
-        close:               mct_u232_close,
-#ifdef FIX_WRITE_RETURN_CODE_PROBLEM
-        write:               mct_u232_write,
-        write_bulk_callback: mct_u232_write_bulk_callback,
-#endif
-        read_int_callback:   mct_u232_read_int_callback,
-        ioctl:               mct_u232_ioctl,
-        set_termios:         mct_u232_set_termios,
-        break_ctl:           mct_u232_break_ctl,
-        startup:             mct_u232_startup,
-        shutdown:            mct_u232_shutdown,
-};
-
-
-
 
 struct mct_u232_private {
 	unsigned long	     control_state; /* Modem Line Setting (TIOCM) */
@@ -392,9 +321,6 @@
 
 	/* stop reads and writes on all ports */
 	for (i=0; i &lt; serial-&gt;num_ports; ++i) {
-		while (serial-&gt;port[i].open_count &gt; 0) {
-			mct_u232_close (&amp;serial-&gt;port[i], NULL);
-		}
 		/* My special items, the standard routines free my urbs */
 		if (serial-&gt;port[i].private)
 			kfree(serial-&gt;port[i].private);
@@ -409,68 +335,56 @@
 
 	dbg("%s port %d", __FUNCTION__, port-&gt;number);
 
-	down (&amp;port-&gt;sem);
-	
-	++port-&gt;open_count;
-	MOD_INC_USE_COUNT;
-
-	if (!port-&gt;active) {
-		port-&gt;active = 1;
+	/* Compensate for a hardware bug: although the Sitecom U232-P25
+	 * device reports a maximum output packet size of 32 bytes,
+	 * it seems to be able to accept only 16 bytes (and that's what
+	 * SniffUSB says too...)
+	 */
+	if (serial-&gt;dev-&gt;descriptor.idProduct == MCT_U232_SITECOM_PID)
+		port-&gt;bulk_out_size = 16;
 
-		/* Compensate for a hardware bug: although the Sitecom U232-P25
-		 * device reports a maximum output packet size of 32 bytes,
-		 * it seems to be able to accept only 16 bytes (and that's what
-		 * SniffUSB says too...)
-		 */
-		if (serial-&gt;dev-&gt;descriptor.idProduct == MCT_U232_SITECOM_PID)
-			port-&gt;bulk_out_size = 16;
-
-		/* Do a defined restart: the normal serial device seems to 
-		 * always turn on DTR and RTS here, so do the same. I'm not
-		 * sure if this is really necessary. But it should not harm
-		 * either.
-		 */
-		if (port-&gt;tty-&gt;termios-&gt;c_cflag &amp; CBAUD)
-			priv-&gt;control_state = TIOCM_DTR | TIOCM_RTS;
-		else
-			priv-&gt;control_state = 0;
-		mct_u232_set_modem_ctrl(serial, priv-&gt;control_state);
-		
-		priv-&gt;last_lcr = (MCT_U232_DATA_BITS_8 | 
-				  MCT_U232_PARITY_NONE |
-				  MCT_U232_STOP_BITS_1);
-		mct_u232_set_line_ctrl(serial, priv-&gt;last_lcr);
+	/* Do a defined restart: the normal serial device seems to 
+	 * always turn on DTR and RTS here, so do the same. I'm not
+	 * sure if this is really necessary. But it should not harm
+	 * either.
+	 */
+	if (port-&gt;tty-&gt;termios-&gt;c_cflag &amp; CBAUD)
+		priv-&gt;control_state = TIOCM_DTR | TIOCM_RTS;
+	else
+		priv-&gt;control_state = 0;
+	mct_u232_set_modem_ctrl(serial, priv-&gt;control_state);
+	
+	priv-&gt;last_lcr = (MCT_U232_DATA_BITS_8 | 
+			  MCT_U232_PARITY_NONE |
+			  MCT_U232_STOP_BITS_1);
+	mct_u232_set_line_ctrl(serial, priv-&gt;last_lcr);
 
-		/* Read modem status and update control state */
-		mct_u232_get_modem_stat(serial, &amp;priv-&gt;last_msr);
-		mct_u232_msr_to_state(&amp;priv-&gt;control_state, priv-&gt;last_msr);
-
-		{
-			/* Puh, that's dirty */
-			struct usb_serial_port *rport;	
-			rport = &amp;serial-&gt;port[1];
-			rport-&gt;tty = port-&gt;tty;
-			rport-&gt;private = port-&gt;private;
-			port-&gt;read_urb = rport-&gt;interrupt_in_urb;
-		}
-
-		port-&gt;read_urb-&gt;dev = port-&gt;serial-&gt;dev;
-		retval = usb_submit_urb(port-&gt;read_urb);
-		if (retval) {
-			err("usb_submit_urb(read bulk) failed");
-			goto exit;
-		}
-
-		port-&gt;interrupt_in_urb-&gt;dev = port-&gt;serial-&gt;dev;
-		retval = usb_submit_urb(port-&gt;interrupt_in_urb);
-		if (retval)
-			err(" usb_submit_urb(read int) failed");
+	/* Read modem status and update control state */
+	mct_u232_get_modem_stat(serial, &amp;priv-&gt;last_msr);
+	mct_u232_msr_to_state(&amp;priv-&gt;control_state, priv-&gt;last_msr);
 
-	}
+	{
+		/* Puh, that's dirty */
+		struct usb_serial_port *rport;	
+		rport = &amp;serial-&gt;port[1];
+		rport-&gt;tty = port-&gt;tty;
+		rport-&gt;private = port-&gt;private;
+		port-&gt;read_urb = rport-&gt;interrupt_in_urb;
+	}
+
+	port-&gt;read_urb-&gt;dev = port-&gt;serial-&gt;dev;
+	retval = usb_submit_urb(port-&gt;read_urb);
+	if (retval) {
+		err("usb_submit_urb(read bulk) failed");
+		goto exit;
+	}
+
+	port-&gt;interrupt_in_urb-&gt;dev = port-&gt;serial-&gt;dev;
+	retval = usb_submit_urb(port-&gt;interrupt_in_urb);
+	if (retval)
+		err(" usb_submit_urb(read int) failed");
 
 exit:
-	up (&amp;port-&gt;sem);
-	
 	return 0;
 } /* mct_u232_open */
 
@@ -479,22 +393,12 @@
 {
 	dbg("%s port %d", __FUNCTION__, port-&gt;number);
 
-	down (&amp;port-&gt;sem);
-
-	--port-&gt;open_count;
-
-	if (port-&gt;open_count &lt;= 0) {
-		if (port-&gt;serial-&gt;dev) {
-			/* shutdown our urbs */
-			usb_unlink_urb (port-&gt;write_urb);
-			usb_unlink_urb (port-&gt;read_urb);
-			usb_unlink_urb (port-&gt;interrupt_in_urb);
-		}
-		port-&gt;active = 0;
+	if (port-&gt;serial-&gt;dev) {
+		/* shutdown our urbs */
+		usb_unlink_urb (port-&gt;write_urb);
+		usb_unlink_urb (port-&gt;read_urb);
+		usb_unlink_urb (port-&gt;interrupt_in_urb);
 	}
-	
-	up (&amp;port-&gt;sem);
-	MOD_DEC_USE_COUNT;
 } /* mct_u232_close */
 
 
@@ -526,16 +430,12 @@
 		
 	bytes_sent = 0;
 	while (count &gt; 0) {
-		
-		down (&amp;port-&gt;sem);
-		
 		size = (count &gt; port-&gt;bulk_out_size) ? port-&gt;bulk_out_size : count;
 		
 		usb_serial_debug_data (__FILE__, __FUNCTION__, size, buf);
 		
 		if (from_user) {
 			if (copy_from_user(port-&gt;write_urb-&gt;transfer_buffer, buf, size)) {
-				up (&amp;port-&gt;sem);
 				return -EFAULT;
 			}
 		}
@@ -557,12 +457,9 @@
 		result = usb_submit_urb(port-&gt;write_urb);
 		if (result) {
 			err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
-			up (&amp;port-&gt;sem);
 			return result;
 		}
 
-		up (&amp;port-&gt;sem);
-
 		bytes_sent += size;
 		if (write_blocking)
 			interruptible_sleep_on(&amp;port-&gt;write_wait);
@@ -885,9 +782,7 @@
 static int __init mct_u232_init (void)
 {
 	usb_serial_register (&amp;mct_u232_device);
-	usb_serial_register (&amp;mct_u232_sitecom_device);
-	usb_serial_register (&amp;mct_u232_du_h3sp_device);
-	info(DRIVER_VERSION ":" DRIVER_DESC);
+	info(DRIVER_DESC " " DRIVER_VERSION);
 	return 0;
 }
 
@@ -895,8 +790,6 @@
 static void __exit mct_u232_exit (void)
 {
 	usb_serial_deregister (&amp;mct_u232_device);
-	usb_serial_deregister (&amp;mct_u232_sitecom_device);
-	usb_serial_deregister (&amp;mct_u232_du_h3sp_device);
 }
 
 
</pre></body></html>