<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.463   -&gt; 1.464  
#	drivers/usb/serial/usbserial.c	1.29    -&gt; 1.30   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/11	greg@kroah.com	1.464
# USB serial core
# 
# added /proc support through the tty layer.
# --------------------------------------------
#
diff -Nru a/drivers/usb/serial/usbserial.c b/drivers/usb/serial/usbserial.c
--- a/drivers/usb/serial/usbserial.c	Thu Apr 11 11:28:13 2002
+++ b/drivers/usb/serial/usbserial.c	Thu Apr 11 11:28:13 2002
@@ -15,6 +15,10 @@
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  *
+ * (04/10/2002) gkh
+ *	added serial_read_proc function which creates a
+ *	/proc/tty/driver/usb-serial file.
+ *
  * (03/27/2002) gkh
  *	Got USB serial console code working properly and merged into the main
  *	version of the tree.  Thanks to Randy Dunlap for the initial version
@@ -340,7 +344,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.4"
+#define DRIVER_VERSION "v1.5"
 #define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux-usb/"
 #define DRIVER_DESC "USB Serial Driver core"
 
@@ -844,6 +848,48 @@
 		generic_shutdown(serial);
 }
 
+static int serial_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+	struct usb_serial *serial;
+	int length = 0;
+	int i;
+	off_t begin = 0;
+	char tmp[40];
+
+	dbg(__FUNCTION__);
+	length += sprintf (page, "usbserinfo:1.0 driver:%s\n", DRIVER_VERSION);
+	for (i = 0; i &lt; SERIAL_TTY_MINORS &amp;&amp; length &lt; PAGE_SIZE; ++i) {
+		serial = get_serial_by_minor(i);
+		if (serial == NULL)
+			continue;
+
+		length += sprintf (page+length, "%d:", i);
+		if (serial-&gt;type-&gt;owner)
+			length += sprintf (page+length, " module:%s", serial-&gt;type-&gt;owner-&gt;name);
+		length += sprintf (page+length, " name:\"%s\"", serial-&gt;type-&gt;name);
+		length += sprintf (page+length, " vendor:%04x product:%04x", serial-&gt;vendor, serial-&gt;product);
+		length += sprintf (page+length, " num_ports:%d", serial-&gt;num_ports);
+		length += sprintf (page+length, " port:%d", i - serial-&gt;minor + 1);
+
+		usb_make_path(serial-&gt;dev, tmp, sizeof(tmp));
+		length += sprintf (page+length, " path:%s", tmp);
+			
+		length += sprintf (page+length, "\n");
+		if ((length + begin) &gt; (off + count))
+			goto done;
+		if ((length + begin) &lt; off) {
+			begin += length;
+			length = 0;
+		}
+	}
+	*eof = 1;
+done:
+	if (off &gt;= (length + begin))
+		return 0;
+	*start = page + (off-begin);
+	return ((count &lt; begin+length-off) ? count : begin+length-off);
+}
+
 /*****************************************************************************
  * generic devices specific driver functions
  *****************************************************************************/
@@ -1491,6 +1537,7 @@
 	unthrottle:		serial_unthrottle,
 	break_ctl:		serial_break,
 	chars_in_buffer:	serial_chars_in_buffer,
+	read_proc:		serial_read_proc,
 };
 
 
</pre></body></html>