summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHarald Koerfgen <hkoerfg@web.de>2000-12-18 19:57:52 +0000
committerHarald Koerfgen <hkoerfg@web.de>2000-12-18 19:57:52 +0000
commit5cad05408e1fd657196e5b2fac3e1d64e28efba5 (patch)
treee4a64b968ba3b75a3423233c79608808c0bb0c1f /drivers
parente9d9699abfb7e06b08a16349017fac3425bb389b (diff)
serial fixes and enhancements from Maciej and Karel
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/dz.c19
-rw-r--r--drivers/tc/zs.c10
2 files changed, 22 insertions, 7 deletions
diff --git a/drivers/char/dz.c b/drivers/char/dz.c
index da018374d..9c0afa2c6 100644
--- a/drivers/char/dz.c
+++ b/drivers/char/dz.c
@@ -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 @@ static void show_serial_version (void)
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 @@ int __init dz_init(void)
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 @@ int __init dz_init(void)
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 @@ int __init dz_init(void)
* 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 @@ int __init dz_init(void)
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 */
diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index 1b3bb65c7..a8707ffb9 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -404,7 +404,8 @@ static _INLINE_ void receive_chars(struct dec_serial *info,
*tty->flip.char_buf_ptr++ = ch;
ignore_char:
}
- tty_flip_buffer_push(tty);
+ if (tty)
+ tty_flip_buffer_push(tty);
}
static void transmit_chars(struct dec_serial *info)
@@ -421,7 +422,8 @@ static void transmit_chars(struct dec_serial *info)
return;
}
- if ((info->xmit_cnt <= 0) || info->tty->stopped || info->tx_stopped) {
+ if ((info->xmit_cnt <= 0) || (info->tty && info->tty->stopped)
+ || info->tx_stopped) {
write_zsreg(info->zs_channel, R0, RES_Tx_P);
return;
}
@@ -455,8 +457,7 @@ static _INLINE_ void status_handle(struct dec_serial *info)
if (stat & DCD) {
wake_up_interruptible(&info->open_wait);
} else if (!(info->flags & ZILOG_CALLOUT_ACTIVE)) {
- if (info->tty)
- tty_hangup(info->tty);
+ tty_hangup(info->tty);
}
}
@@ -2154,3 +2155,4 @@ void __init zs_kgdb_hook(int tty_num)
set_debug_traps(); /* init stub */
}
#endif /* ifdef CONFIG_KGDB */
+