<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.632   -&gt; 1.633  
#	drivers/usb/serial/whiteheat.c	1.12    -&gt; 1.13   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/29	greg@kroah.com	1.633
# USB: whiteheat update due to usbserial core changes.
# --------------------------------------------
#
diff -Nru a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
--- a/drivers/usb/serial/whiteheat.c	Thu Aug 29 13:54:21 2002
+++ b/drivers/usb/serial/whiteheat.c	Thu Aug 29 13:54:21 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
@@ -133,36 +130,32 @@
 static void whiteheat_real_shutdown	(struct usb_serial *serial);
 
 static struct usb_serial_device_type whiteheat_fake_device = {
-	name:			"Connect Tech - WhiteHEAT - (prerenumeration)",
-	id_table:		id_table_prerenumeration,
-	needs_interrupt_in:	DONT_CARE,				/* don't have to have an interrupt in endpoint */
-	needs_bulk_in:		DONT_CARE,				/* don't have to have a bulk in endpoint */
-	needs_bulk_out:		DONT_CARE,				/* don't have to have a bulk out endpoint */
-	num_interrupt_in:	NUM_DONT_CARE,
-	num_bulk_in:		NUM_DONT_CARE,
-	num_bulk_out:		NUM_DONT_CARE,
-	num_ports:		1,
-	startup:		whiteheat_fake_startup,
+	.owner =		THIS_MODULE,
+	.name =			"Connect Tech - WhiteHEAT - (prerenumeration)",
+	.id_table =		id_table_prerenumeration,
+	.num_interrupt_in =	NUM_DONT_CARE,
+	.num_bulk_in =		NUM_DONT_CARE,
+	.num_bulk_out =		NUM_DONT_CARE,
+	.num_ports =		1,
+	.startup =		whiteheat_fake_startup,
 };
 
 static struct usb_serial_device_type whiteheat_device = {
-	name:			"Connect Tech - WhiteHEAT",
-	id_table:		id_table_std,
-	needs_interrupt_in:	DONT_CARE,				/* don't have to have an interrupt in endpoint */
-	needs_bulk_in:		DONT_CARE,				/* don't have to have a bulk in endpoint */
-	needs_bulk_out:		DONT_CARE,				/* don't have to have a bulk out endpoint */
-	num_interrupt_in:	NUM_DONT_CARE,
-	num_bulk_in:		NUM_DONT_CARE,
-	num_bulk_out:		NUM_DONT_CARE,
-	num_ports:		4,
-	open:			whiteheat_open,
-	close:			whiteheat_close,
-	throttle:		whiteheat_throttle,
-	unthrottle:		whiteheat_unthrottle,
-	ioctl:			whiteheat_ioctl,
-	set_termios:		whiteheat_set_termios,
-	startup:		whiteheat_real_startup,
-	shutdown:		whiteheat_real_shutdown,
+	.owner =		THIS_MODULE,
+	.name =			"Connect Tech - WhiteHEAT",
+	.id_table =		id_table_std,
+	.num_interrupt_in =	NUM_DONT_CARE,
+	.num_bulk_in =		NUM_DONT_CARE,
+	.num_bulk_out =		NUM_DONT_CARE,
+	.num_ports =		4,
+	.open =			whiteheat_open,
+	.close =		whiteheat_close,
+	.throttle =		whiteheat_throttle,
+	.unthrottle =		whiteheat_unthrottle,
+	.ioctl =		whiteheat_ioctl,
+	.set_termios =		whiteheat_set_termios,
+	.startup =		whiteheat_real_startup,
+	.shutdown =		whiteheat_real_shutdown,
 };
 
 struct whiteheat_private {
@@ -310,68 +303,49 @@
 
 	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;
-
-		/* set up some stuff for our command port */
-		command_port = &amp;port-&gt;serial-&gt;port[COMMAND_PORT];
-		if (command_port-&gt;private == NULL) {
-			info = (struct whiteheat_private *)kmalloc (sizeof(struct whiteheat_private), GFP_KERNEL);
-			if (info == NULL) {
-				err("%s - out of memory", __FUNCTION__);
-				retval = -ENOMEM;
-				goto error_exit;
-			}
-			
-			init_waitqueue_head(&amp;info-&gt;wait_command);
-			command_port-&gt;private = info;
-			command_port-&gt;write_urb-&gt;complete = command_port_write_callback;
-			command_port-&gt;read_urb-&gt;complete = command_port_read_callback;
-			command_port-&gt;read_urb-&gt;dev = port-&gt;serial-&gt;dev;
-			command_port-&gt;tty = port-&gt;tty;		/* need this to "fake" our our sanity check macros */
-			retval = usb_submit_urb (command_port-&gt;read_urb);
-			if (retval) {
-				err("%s - failed submitting read urb, error %d", __FUNCTION__, retval);
-				goto error_exit;
-			}
+	/* set up some stuff for our command port */
+	command_port = &amp;port-&gt;serial-&gt;port[COMMAND_PORT];
+	if (command_port-&gt;private == NULL) {
+		info = (struct whiteheat_private *)kmalloc (sizeof(struct whiteheat_private), GFP_KERNEL);
+		if (info == NULL) {
+			err("%s - out of memory", __FUNCTION__);
+			retval = -ENOMEM;
+			goto exit;
 		}
 		
-		/* Start reading from the device */
-		port-&gt;read_urb-&gt;dev = port-&gt;serial-&gt;dev;
-		retval = usb_submit_urb(port-&gt;read_urb);
+		init_waitqueue_head(&amp;info-&gt;wait_command);
+		command_port-&gt;private = info;
+		command_port-&gt;write_urb-&gt;complete = command_port_write_callback;
+		command_port-&gt;read_urb-&gt;complete = command_port_read_callback;
+		command_port-&gt;read_urb-&gt;dev = port-&gt;serial-&gt;dev;
+		command_port-&gt;tty = port-&gt;tty;		/* need this to "fake" our our sanity check macros */
+		retval = usb_submit_urb (command_port-&gt;read_urb);
 		if (retval) {
 			err("%s - failed submitting read urb, error %d", __FUNCTION__, retval);
-			goto error_exit;
+			goto exit;
 		}
+	}
 	
-		/* send an open port command */
-		/* firmware uses 1 based port numbering */
-		open_command.port = port-&gt;number - port-&gt;serial-&gt;minor + 1;
-		retval = whiteheat_send_cmd (port-&gt;serial, WHITEHEAT_OPEN, (__u8 *)&amp;open_command, sizeof(open_command));
-		if (retval)
-			goto error_exit;
-	
-		/* Need to do device specific setup here (control lines, baud rate, etc.) */
-		/* FIXME!!! */
+	/* Start reading from the device */
+	port-&gt;read_urb-&gt;dev = port-&gt;serial-&gt;dev;
+	retval = usb_submit_urb(port-&gt;read_urb);
+	if (retval) {
+		err("%s - failed submitting read urb, error %d", __FUNCTION__, retval);
+		goto exit;
 	}
 
-	dbg("%s - exit", __FUNCTION__);
-	up (&amp;port-&gt;sem);
-	
-	return retval;
+	/* send an open port command */
+	/* firmware uses 1 based port numbering */
+	open_command.port = port-&gt;number - port-&gt;serial-&gt;minor + 1;
+	retval = whiteheat_send_cmd (port-&gt;serial, WHITEHEAT_OPEN, (__u8 *)&amp;open_command, sizeof(open_command));
+	if (retval)
+		goto exit;
 
-error_exit:
-	--port-&gt;open_count;
-	MOD_DEC_USE_COUNT;
+	/* Need to do device specific setup here (control lines, baud rate, etc.) */
+	/* FIXME!!! */
 
-	dbg("%s - error_exit", __FUNCTION__);
-	up (&amp;port-&gt;sem);
-	
+exit:
+	dbg("%s - exit, retval = %d", __FUNCTION__, retval);
 	return retval;
 }
 
@@ -382,25 +356,17 @@
 	
 	dbg("%s - port %d", __FUNCTION__, port-&gt;number);
 	
-	down (&amp;port-&gt;sem);
-	--port-&gt;open_count;
+	/* send a close command to the port */
+	/* firmware uses 1 based port numbering */
+	close_command.port = port-&gt;number - port-&gt;serial-&gt;minor + 1;
+	whiteheat_send_cmd (port-&gt;serial, WHITEHEAT_CLOSE, (__u8 *)&amp;close_command, sizeof(close_command));
 
-	if (port-&gt;open_count &lt;= 0) {
-		/* send a close command to the port */
-		/* firmware uses 1 based port numbering */
-		close_command.port = port-&gt;number - port-&gt;serial-&gt;minor + 1;
-		whiteheat_send_cmd (port-&gt;serial, WHITEHEAT_CLOSE, (__u8 *)&amp;close_command, sizeof(close_command));
+	/* Need to change the control lines here */
+	/* FIXME */
 	
-		/* Need to change the control lines here */
-		/* FIXME */
-		
-		/* shutdown our bulk reads and writes */
-		usb_unlink_urb (port-&gt;write_urb);
-		usb_unlink_urb (port-&gt;read_urb);
-		port-&gt;active = 0;
-	}
-	MOD_DEC_USE_COUNT;
-	up (&amp;port-&gt;sem);
+	/* shutdown our bulk reads and writes */
+	usb_unlink_urb (port-&gt;write_urb);
+	usb_unlink_urb (port-&gt;read_urb);
 }
 
 
@@ -419,8 +385,6 @@
 
 	dbg("%s -port %d", __FUNCTION__, port-&gt;number);
 
-	down (&amp;port-&gt;sem);
-
 	if ((!port-&gt;tty) || (!port-&gt;tty-&gt;termios)) {
 		dbg("%s - no tty structures", __FUNCTION__);
 		goto exit;
@@ -501,7 +465,6 @@
 	whiteheat_send_cmd (port-&gt;serial, WHITEHEAT_SETUP_PORT, (__u8 *)&amp;port_settings, sizeof(port_settings));
 	
 exit:
-	up (&amp;port-&gt;sem);
 	return;
 }
 
@@ -541,7 +504,7 @@
  - device renumerated itself and comes up as new device id with all
    firmware download completed.
 */
-static int  whiteheat_fake_startup (struct usb_serial *serial)
+static int whiteheat_fake_startup (struct usb_serial *serial)
 {
 	int response;
 	const struct whiteheat_hex_record *record;
@@ -555,8 +518,8 @@
 		response = ezusb_writememory (serial, record-&gt;address, 
 				(unsigned char *)record-&gt;data, record-&gt;data_size, 0xa0);
 		if (response &lt; 0) {
-			err("%s - ezusb_writememory failed for loader (%d %04X %p %d)", __FUNCTION__, 
-				response, record-&gt;address, record-&gt;data, record-&gt;data_size);
+			err("%s - ezusb_writememory failed for loader (%d %04X %p %d)",
+				__FUNCTION__, response, record-&gt;address, record-&gt;data, record-&gt;data_size);
 			break;
 		}
 		++record;
@@ -572,8 +535,8 @@
 		response = ezusb_writememory (serial, record-&gt;address, 
 				(unsigned char *)record-&gt;data, record-&gt;data_size, 0xa3);
 		if (response &lt; 0) {
-			err("%s - ezusb_writememory failed for first firmware step (%d %04X %p %d)", __FUNCTION__, 
-				response, record-&gt;address, record-&gt;data, record-&gt;data_size);
+			err("%s - ezusb_writememory failed for first firmware step (%d %04X %p %d)", 
+				__FUNCTION__, response, record-&gt;address, record-&gt;data, record-&gt;data_size);
 			break;
 		}
 		++record;
@@ -586,8 +549,8 @@
 		response = ezusb_writememory (serial, record-&gt;address, 
 				(unsigned char *)record-&gt;data, record-&gt;data_size, 0xa0);
 		if (response &lt; 0) {
-			err("%s - ezusb_writememory failed for second firmware step (%d %04X %p %d)", __FUNCTION__, 
-				response, record-&gt;address, record-&gt;data, record-&gt;data_size);
+			err("%s - ezusb_writememory failed for second firmware step (%d %04X %p %d)", 
+				__FUNCTION__, response, record-&gt;address, record-&gt;data, record-&gt;data_size);
 			break;
 		}
 		++record;
@@ -662,16 +625,8 @@
 static void whiteheat_real_shutdown (struct usb_serial *serial)
 {
 	struct usb_serial_port *command_port;
-	int i;
 
 	dbg("%s", __FUNCTION__);
-
-	/* 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) {
-			whiteheat_close (&amp;serial-&gt;port[i], NULL);
-		}
-	}
 
 	/* free up our private data for our command port */
 	command_port = &amp;serial-&gt;port[COMMAND_PORT];
</pre></body></html>