<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.617   -&gt; 1.618  
#	drivers/usb/serial/cyberjack.c	1.8     -&gt; 1.9    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/29	greg@kroah.com	1.618
# USB: cyberjack update due to usbserial core changes.
# --------------------------------------------
#
diff -Nru a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
--- a/drivers/usb/serial/cyberjack.c	Thu Aug 29 13:54:55 2002
+++ b/drivers/usb/serial/cyberjack.c	Thu Aug 29 13:54:55 2002
@@ -25,18 +25,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
@@ -77,23 +74,21 @@
 MODULE_DEVICE_TABLE (usb, id_table);
 
 static struct usb_serial_device_type cyberjack_device = {
-	name:			"Reiner SCT Cyberjack USB card reader",
-	id_table:		id_table,
-	needs_interrupt_in:	MUST_HAVE,
-	needs_bulk_in:		MUST_HAVE,
-	needs_bulk_out:		MUST_HAVE,
-	num_interrupt_in:	1,
-	num_bulk_in:		1,
-	num_bulk_out:		1,
-	num_ports:		1,
-	startup:		cyberjack_startup,
-	shutdown:		cyberjack_shutdown,
-	open:			cyberjack_open,
-	close:			cyberjack_close,
-	write:			cyberjack_write,
-	read_int_callback:	cyberjack_read_int_callback,
-	read_bulk_callback:	cyberjack_read_bulk_callback,
-	write_bulk_callback:	cyberjack_write_bulk_callback,
+	.owner =		THIS_MODULE,
+	.name =			"Reiner SCT Cyberjack USB card reader",
+	.id_table =		id_table,
+	.num_interrupt_in =	1,
+	.num_bulk_in =		1,
+	.num_bulk_out =		1,
+	.num_ports =		1,
+	.startup =		cyberjack_startup,
+	.shutdown =		cyberjack_shutdown,
+	.open =			cyberjack_open,
+	.close =		cyberjack_close,
+	.write =		cyberjack_write,
+	.read_int_callback =	cyberjack_read_int_callback,
+	.read_bulk_callback =	cyberjack_read_bulk_callback,
+	.write_bulk_callback =	cyberjack_write_bulk_callback,
 };
 
 struct cyberjack_private {
@@ -132,11 +127,7 @@
 	
 	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) {
-			cyberjack_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);
@@ -151,40 +142,29 @@
 	if (port_paranoia_check (port, __FUNCTION__))
 		return -ENODEV;
 
-	MOD_INC_USE_COUNT;
-
 	dbg("%s - port %d", __FUNCTION__, port-&gt;number);
 
-	down (&amp;port-&gt;sem);
-
-	++port-&gt;open_count;
-
-	if (!port-&gt;active) {
-		port-&gt;active = 1;
-		/* force low_latency on so that our tty_push actually forces
-		 * the data through, otherwise it is scheduled, and with high
-		 * data rates (like with OHCI) data can get lost.
-		 */
-		port-&gt;tty-&gt;low_latency = 1;
-
-		priv = (struct cyberjack_private *)port-&gt;private;
-		priv-&gt;rdtodo = 0;
-		priv-&gt;wrfilled = 0;
-		priv-&gt;wrsent = 0;
+	/* force low_latency on so that our tty_push actually forces
+	 * the data through, otherwise it is scheduled, and with high
+	 * data rates (like with OHCI) data can get lost.
+	 */
+	port-&gt;tty-&gt;low_latency = 1;
 
-		/* shutdown any bulk reads that might be going on */
-		usb_unlink_urb (port-&gt;write_urb);
-		usb_unlink_urb (port-&gt;read_urb);
-		usb_unlink_urb (port-&gt;interrupt_in_urb);
-
-		port-&gt;interrupt_in_urb-&gt;dev = port-&gt;serial-&gt;dev;
-		result = usb_submit_urb(port-&gt;interrupt_in_urb);
-		if (result)
-			err(" usb_submit_urb(read int) failed");
-		dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
-	}
+	priv = (struct cyberjack_private *)port-&gt;private;
+	priv-&gt;rdtodo = 0;
+	priv-&gt;wrfilled = 0;
+	priv-&gt;wrsent = 0;
 
-	up (&amp;port-&gt;sem);
+	/* shutdown any bulk reads that might be going on */
+	usb_unlink_urb (port-&gt;write_urb);
+	usb_unlink_urb (port-&gt;read_urb);
+	usb_unlink_urb (port-&gt;interrupt_in_urb);
+
+	port-&gt;interrupt_in_urb-&gt;dev = port-&gt;serial-&gt;dev;
+	result = usb_submit_urb(port-&gt;interrupt_in_urb);
+	if (result)
+		err(" usb_submit_urb(read int) failed");
+	dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
 
 	return result;
 }
@@ -193,24 +173,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 any bulk reads that might be going on */
-			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;
-		port-&gt;open_count = 0;
+	if (port-&gt;serial-&gt;dev) {
+		/* shutdown any bulk reads that might be going on */
+		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;
 }
 
 static int cyberjack_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count)
@@ -233,19 +201,15 @@
 		return (0);
 	}
 
-	down (&amp;port-&gt;sem);
-
 	if( (count+priv-&gt;wrfilled)&gt;sizeof(priv-&gt;wrbuf) ) {
 		/* To much data  for buffer. Reset buffer. */
 		priv-&gt;wrfilled=0;
-		up (&amp;port-&gt;sem);
 		return (0);
 	}
 
 	/* Copy data */
 	if (from_user) {
 		if (copy_from_user(priv-&gt;wrbuf+priv-&gt;wrfilled, buf, count)) {
-			up (&amp;port-&gt;sem);
 			return -EFAULT;
 		}
 	} else {
@@ -288,7 +252,6 @@
 			/* Throw away data. No better idea what to do with it. */
 			priv-&gt;wrfilled=0;
 			priv-&gt;wrsent=0;
-			up (&amp;port-&gt;sem);
 			return 0;
 		}
 
@@ -303,7 +266,6 @@
 		}
 	}
 
-	up (&amp;port-&gt;sem);
 	return (count);
 } 
 
@@ -443,8 +405,6 @@
 			return;
 		}
 
-		down (&amp;port-&gt;sem);
-
 		dbg("%s - transmitting data (frame n)", __FUNCTION__);
 
 		length = ((priv-&gt;wrfilled - priv-&gt;wrsent) &gt; port-&gt;bulk_out_size) ?
@@ -470,7 +430,6 @@
 			/* Throw away data. No better idea what to do with it. */
 			priv-&gt;wrfilled=0;
 			priv-&gt;wrsent=0;
-			up (&amp;port-&gt;sem);
 			queue_task(&amp;port-&gt;tqueue, &amp;tq_immediate);
 			mark_bh(IMMEDIATE_BH);
 			return;
@@ -488,7 +447,6 @@
 			priv-&gt;wrsent=0;
 		}
 
-		up (&amp;port-&gt;sem);
 		queue_task(&amp;port-&gt;tqueue, &amp;tq_immediate);
 		mark_bh(IMMEDIATE_BH);
 		return;
</pre></body></html>