Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Karel van Houten <K.H.C.vanHouten@kpn.com>
To: MIPS Linux list <linux-mips@oss.sgi.com>,
	"MIPS Linux list (FNET)" <linux-mips@fnet.fr>
Subject: Kernel patch to make DECStation serial devfs aware.
Date: Sun, 17 Dec 2000 19:06:18 +0100	[thread overview]
Message-ID: <3A3D009A.CC605186@kpn.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Hi all,

I've attached a small patch to the DECStation serial drivers (zs.c and
dz.c)
in order to make them devfs aware. 

Would you please test this patch, and report any resulting problems?

-- 
Karel van Houten
----------------------------------------------------------
The box said "Requires Windows 95 or better."
I can't understand why it won't work on my Linux computer.

[-- Attachment #2: dec-devfs.patch --]
[-- Type: text/plain, Size: 3579 bytes --]

--- drivers/tc/zs.c.orig	Sun Dec 17 15:59:21 2000
+++ drivers/tc/zs.c	Sun Dec 17 12:30:07 2000
@@ -18,6 +18,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/version.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -1720,7 +1721,11 @@
 
 	memset(&serial_driver, 0, sizeof(struct tty_driver));
 	serial_driver.magic = TTY_DRIVER_MAGIC;
+#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
+	serial_driver.name = "tts/%d";
+#else
 	serial_driver.name = "ttyS";
+#endif
 	serial_driver.major = TTY_MAJOR;
 	serial_driver.minor_start = 64;
 	serial_driver.num = zs_channels_found;
@@ -1730,7 +1735,7 @@
 
 	serial_driver.init_termios.c_cflag =
 		B9600 | CS8 | CREAD | HUPCL | CLOCAL;
-	serial_driver.flags = TTY_DRIVER_REAL_RAW;
+	serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
 	serial_driver.refcount = &serial_refcount;
 	serial_driver.table = serial_table;
 	serial_driver.termios = serial_termios;
@@ -1758,7 +1763,11 @@
 	 * major number and the subtype code.
 	 */
 	callout_driver = serial_driver;
+#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
+	callout_driver.name = "cua/%d";
+#else
 	callout_driver.name = "cua";
+#endif
 	callout_driver.major = TTYAUX_MAJOR;
 	callout_driver.subtype = SERIAL_TYPE_CALLOUT;
 
@@ -1820,6 +1829,11 @@
 		printk("ttyS%02d at 0x%08x (irq = %d)", info->line, 
 		       info->port, info->irq);
 		printk(" is a Z85C30 SCC\n");
+		tty_register_devfs(&serial_driver, 0,
+				   serial_driver.minor_start + info->line);
+		tty_register_devfs(&callout_driver, 0,
+				   callout_driver.minor_start + info->line);
+
 	}
 
 	restore_flags(flags);
--- drivers/char/dz.c.orig	Sun Dec 17 15:59:36 2000
+++ drivers/char/dz.c	Sun Dec 17 16:59:57 2000
@@ -21,9 +21,9 @@
 
 #define DEBUG_DZ 1
 
+#include <linux/version.h>
 #ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
 #else
 #define MOD_INC_USE_COUNT
 #define MOD_DEC_USE_COUNT
@@ -1290,7 +1290,7 @@
 
 int __init dz_init(void)
 {
-  int i, flags;
+  int i, flags, tmp;
   struct dz_serial *info;
 
   /* Setup base handler, and timer table. */
@@ -1300,7 +1300,11 @@
 
   memset(&serial_driver, 0, sizeof(struct tty_driver));
   serial_driver.magic = TTY_DRIVER_MAGIC;
+#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
   serial_driver.name = "ttyS";
+#else
+  serial_driver.name = "tts/%d";
+#endif
   serial_driver.major = TTY_MAJOR;
   serial_driver.minor_start = 64;
   serial_driver.num = DZ_NB_PORT;
@@ -1309,7 +1313,7 @@
   serial_driver.init_termios = tty_std_termios;
 
   serial_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
-  serial_driver.flags = TTY_DRIVER_REAL_RAW;
+  serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
   serial_driver.refcount = &serial_refcount;
   serial_driver.table = serial_table;
   serial_driver.termios = serial_termios;
@@ -1336,7 +1340,11 @@
    * major number and the subtype code.
    */
   callout_driver = serial_driver;
+#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
   callout_driver.name = "cua";
+#else
+  callout_driver.name = "cua/%d";
+#endif
   callout_driver.major = TTYAUX_MAJOR;
   callout_driver.subtype = SERIAL_TYPE_CALLOUT;
 
@@ -1380,6 +1388,11 @@
       return 0;
 
     printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line, info->port, SERIAL);
+
+    tty_register_devfs(&serial_driver, 0,
+			serial_driver.minor_start + info->line);
+    tty_register_devfs(&callout_driver, 0,
+			callout_driver.minor_start + info->line);
   }
 
   /* reset the chip */

                 reply	other threads:[~2000-12-17 18:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A3D009A.CC605186@kpn.com \
    --to=k.h.c.vanhouten@kpn.com \
    --cc=linux-mips@fnet.fr \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox