|
From: James S. <jsi...@us...> - 2002-01-20 03:54:51
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char
In directory usw-pr-cvs1:/tmp/cvs-serv23561/drivers/char
Modified Files:
Config.in mem.c misc.c n_tty.c sysrq.c tty_io.c vc_screen.c
vt.c
Log Message:
Synced to 2.5.X.
Index: Config.in
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/Config.in,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- Config.in 2001/12/26 17:28:11 1.35
+++ Config.in 2002/01/20 03:54:46 1.36
@@ -23,7 +23,7 @@
tristate ' Dual serial port support' CONFIG_DUALSP_SERIAL
fi
fi
- if [ "$CONFIG_ACPI" = "y" ]; then
+ if [ "$CONFIG_ACPI" = "y" -a "$CONFIG_IA64" = "y" ]; then
bool ' Support for serial ports defined by ACPI tables' CONFIG_SERIAL_ACPI
fi
dep_mbool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED $CONFIG_SERIAL
Index: mem.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/mem.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- mem.c 2001/10/06 16:11:13 1.17
+++ mem.c 2002/01/20 03:54:46 1.18
@@ -532,7 +532,7 @@
static int memory_open(struct inode * inode, struct file * filp)
{
- switch (MINOR(inode->i_rdev)) {
+ switch (minor(inode->i_rdev)) {
case 1:
filp->f_op = &mem_fops;
break;
Index: misc.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/misc.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- misc.c 2001/11/13 19:38:22 1.16
+++ misc.c 2002/01/20 03:54:46 1.17
@@ -100,7 +100,7 @@
static int misc_open(struct inode * inode, struct file * file)
{
- int minor = MINOR(inode->i_rdev);
+ int minor = minor(inode->i_rdev);
struct miscdevice *c;
int err = -ENODEV;
struct file_operations *old_fops, *new_fops = NULL;
Index: n_tty.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/n_tty.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- n_tty.c 2001/10/17 17:00:13 1.5
+++ n_tty.c 2002/01/20 03:54:46 1.6
@@ -45,7 +45,7 @@
#include <asm/system.h>
#include <asm/bitops.h>
-#define SYSCONS_DEV MKDEV(TTYAUX_MAJOR,1)
+#define IS_SYSCONS_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,1))
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -954,7 +954,7 @@
/* NOTE: not yet done after every sleep pending a thorough
check of the logic of this change. -- jlc */
/* don't stop on /dev/console */
- if (file->f_dentry->d_inode->i_rdev != SYSCONS_DEV &&
+ if (!IS_SYSCONS_DEV(file->f_dentry->d_inode->i_rdev) &&
current->tty == tty) {
if (tty->pgrp <= 0)
printk("read_chan: tty->pgrp <= 0!\n");
@@ -1133,7 +1133,7 @@
/* Job control check -- must be done at start (POSIX.1 7.1.1.4). */
if (L_TOSTOP(tty) &&
- file->f_dentry->d_inode->i_rdev != SYSCONS_DEV) {
+ !IS_SYSCONS_DEV(file->f_dentry->d_inode->i_rdev)) {
retval = tty_check_change(tty);
if (retval)
return retval;
Index: sysrq.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/sysrq.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- sysrq.c 2001/10/29 00:10:59 1.16
+++ sysrq.c 2002/01/20 03:54:46 1.17
@@ -110,7 +110,7 @@
/* Guesses if the device is a local hard drive */
static int is_local_disk(kdev_t dev) {
unsigned int major;
- major = MAJOR(dev);
+ major = major(dev);
switch (major) {
case IDE0_MAJOR:
@@ -211,7 +211,7 @@
for (sb = sb_entry(super_blocks.next);
sb != sb_entry(&super_blocks);
sb = sb_entry(sb->s_list.next))
- if (!is_local_disk(sb->s_dev) && MAJOR(sb->s_dev))
+ if (!is_local_disk(sb->s_dev) && major(sb->s_dev))
go_sync(sb, remount_flag);
unlock_kernel();
Index: tty_io.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/tty_io.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- tty_io.c 2001/12/09 01:43:35 1.42
+++ tty_io.c 2002/01/20 03:54:46 1.43
@@ -95,16 +95,16 @@
#include <asm/system.h>
#include <asm/bitops.h>
-#include <linux/devfs_fs_kernel.h>
-#include <linux/kmod.h>
-
#ifdef CONFIG_VT
#include <linux/vt_kern.h>
#endif
+#include <linux/devfs_fs_kernel.h>
-#define TTY_DEV MKDEV(TTYAUX_MAJOR,0)
-#define SYSCONS_DEV MKDEV(TTYAUX_MAJOR,1)
-#define PTMX_DEV MKDEV(TTYAUX_MAJOR,2)
+#include <linux/kmod.h>
+
+#define IS_TTY_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,0))
+#define IS_SYSCONS_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,1))
+#define IS_PTMX_DEV(dev) (kdev_val(dev) == __mkdev(TTYAUX_MAJOR,2))
#undef TTY_DEBUG_HANGUP
@@ -183,7 +183,7 @@
static char *
_tty_make_name(struct tty_struct *tty, const char *name, char *buf)
{
- int idx = (tty)?MINOR(tty->device) - tty->driver.minor_start:0;
+ int idx = (tty)? minor(tty->device) - tty->driver.minor_start:0;
if (!tty) /* Hmm. NULL pointer. That's fun. */
strcpy(buf, "NULL tty");
@@ -194,7 +194,7 @@
return buf;
}
-#define TTY_NUMBER(tty) (MINOR((tty)->device) - (tty)->driver.minor_start + \
+#define TTY_NUMBER(tty) (minor((tty)->device) - (tty)->driver.minor_start + \
(tty)->driver.name_base)
char *tty_name(struct tty_struct *tty, char *buf)
@@ -329,8 +329,8 @@
int major, minor;
struct tty_driver *p;
- minor = MINOR(device);
- major = MAJOR(device);
+ minor = minor(device);
+ major = major(device);
for (p = tty_drivers; p; p = p->next) {
if (p->major != major)
@@ -440,7 +440,7 @@
file_list_lock();
for (l = tty->tty_files.next; l != &tty->tty_files; l = l->next) {
struct file * filp = list_entry(l, struct file, f_list);
- if (filp->f_dentry->d_inode->i_rdev == SYSCONS_DEV) {
+ if (IS_SYSCONS_DEV(filp->f_dentry->d_inode->i_rdev)) {
cons_filp = filp;
continue;
}
@@ -594,12 +594,6 @@
read_unlock(&tasklist_lock);
}
-void wait_for_keypress(void)
-{
- struct console *c = console_drivers;
- if (c) c->wait_key(c);
-}
-
void stop_tty(struct tty_struct *tty)
{
if (tty->stopped)
@@ -655,7 +649,7 @@
moved it to there. This should only be done for the N_TTY
line discipline, anyway. Same goes for write_chan(). -- jlc. */
#if 0
- if ((inode->i_rdev != SYSCONS_DEV) && /* don't stop on /dev/console */
+ if (!IS_SYSCONS_DEV(inode->i_rdev) && /* don't stop on /dev/console */
(tty->pgrp > 0) &&
(current->tty == tty) &&
(tty->pgrp != current->pgrp))
@@ -740,10 +734,10 @@
return -ESPIPE;
/*
- * For now, we redirect writes from /dev/console.
+ * For now, we redirect writes from /dev/console.
*/
inode = file->f_dentry->d_inode;
- is_console = (inode->i_rdev == SYSCONS_DEV);
+ is_console = IS_SYSCONS_DEV(inode->i_rdev);
if (is_console && redirect)
tty = redirect;
@@ -804,7 +798,7 @@
if (!driver)
return -ENODEV;
- idx = MINOR(device) - driver->minor_start;
+ idx = minor(device) - driver->minor_start;
/*
* Check whether we need to acquire the tty semaphore to avoid
@@ -858,7 +852,7 @@
if (!o_tty)
goto free_mem_out;
initialize_tty_struct(o_tty);
- o_tty->device = (kdev_t) MKDEV(driver->other->major,
+ o_tty->device = mk_kdev(driver->other->major,
driver->other->minor_start + idx);
o_tty->driver = *driver->other;
@@ -1050,7 +1044,7 @@
tty_fasync(-1, filp, 0);
- idx = MINOR(tty->device) - tty->driver.minor_start;
+ idx = minor(tty->device) - tty->driver.minor_start;
pty_master = (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
tty->driver.subtype == PTY_TYPE_MASTER);
o_tty = tty->link;
@@ -1286,15 +1280,14 @@
retry_open:
noctty = filp->f_flags & O_NOCTTY;
device = inode->i_rdev;
- if (device == TTY_DEV) {
+ if (IS_TTY_DEV(device)) {
if (!current->tty)
return -ENXIO;
device = current->tty->device;
filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */
/* noctty = 1; */
}
-
- if (device == SYSCONS_DEV) {
+ if (IS_SYSCONS_DEV(device)) {
struct console *c = console_drivers;
while(c && !c->device)
c = c->next;
@@ -1305,7 +1298,7 @@
noctty = 1;
}
- if (device == PTMX_DEV) {
+ if (IS_PTMX_DEV(device)) {
#ifdef CONFIG_UNIX98_PTYS
/* find a free pty. */
@@ -1319,7 +1312,7 @@
for (minor = driver->minor_start ;
minor < driver->minor_start + driver->num ;
minor++) {
- device = MKDEV(driver->major, minor);
+ device = mk_kdev(driver->major, minor);
if (!init_dev(device, &tty)) goto ptmx_found; /* ok! */
}
}
@@ -1327,8 +1320,8 @@
ptmx_found:
set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
minor -= driver->minor_start;
- devpts_pty_new(driver->other->name_base + minor, MKDEV(driver->other->major, minor + driver->other->minor_start));
- tty_register_devfs(&pts_driver[major], DEVFS_FL_NO_PERSISTENCE,
+ devpts_pty_new(driver->other->name_base + minor, mk_kdev(driver->other->major, minor + driver->other->minor_start));
+ tty_register_devfs(&pts_driver[major], DEVFS_FL_DEFAULT,
pts_driver[major].minor_start + minor);
noctty = 1;
goto init_dev_done;
@@ -1489,12 +1482,12 @@
if (!memcmp(&tmp_ws, &tty->winsize, sizeof(*arg)))
return 0;
#ifdef CONFIG_VT
- if (tty->driver.type == TTY_DRIVER_TYPE_CONSOLE) {
- struct vc_data *vc = (struct vc_data *) tty->driver_data;
+ if (tty->driver.type == TTY_DRIVER_TYPE_CONSOLE) {
+ struct vc_data *vc = (struct vc_data *) tty->driver_data;
- if (!vc || vc_resize(vc, tmp_ws.ws_col, tmp_ws.ws_row))
- return -ENXIO;
- }
+ if (!vc || vc_resize(vc, tmp_ws.ws_col, tmp_ws.ws_row))
+ return -ENXIO;
+ }
#endif
if (tty->pgrp > 0)
kill_pg(tty->pgrp, SIGWINCH, 1);
@@ -1508,7 +1501,7 @@
static int tioccons(struct inode *inode,
struct tty_struct *tty, struct tty_struct *real_tty)
{
- if (inode->i_rdev == SYSCONS_DEV) {
+ if (IS_SYSCONS_DEV(inode->i_rdev)) {
if (!suser())
return -EPERM;
redirect = NULL;
@@ -2004,19 +1997,15 @@
{
#ifdef CONFIG_DEVFS_FS
umode_t mode = S_IFCHR | S_IRUSR | S_IWUSR;
- kdev_t device = MKDEV (driver->major, minor);
+ kdev_t device = mk_kdev(driver->major, minor);
int idx = minor - driver->minor_start;
char buf[32];
- switch (device) {
- case TTY_DEV:
- case PTMX_DEV:
+ if (IS_TTY_DEV(device) || IS_PTMX_DEV(device))
+ mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+ else {
+ if (driver->major == PTY_MASTER_MAJOR)
mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
- break;
- default:
- if (driver->major == PTY_MASTER_MAJOR)
- mode |= S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
- break;
}
if ( (minor < driver->minor_start) ||
(minor >= driver->minor_start + driver->num) ) {
@@ -2082,7 +2071,7 @@
if (!driver->console) {
driver->tty_lock = kmalloc(sizeof(struct semaphore),GFP_KERNEL);
init_MUTEX(driver->tty_lock);
- } else
+ } else
driver->tty_lock = &driver->console->lock;
if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) {
@@ -2246,9 +2235,6 @@
*/
void __init tty_init(void)
{
- struct tty_driver *p;
- int i;
-
/*
* dev_tty_driver and dev_console_driver are actually magic
* devices which get redirected at open time. Nevertheless,
@@ -2280,33 +2266,23 @@
if (tty_register_driver(&dev_syscons_driver))
panic("Couldn't register /dev/console driver\n");
- /*
- * Some console calls tty_register_driver() before kmalloc() works.
- * Thus, we can't devfs_register() then. Do so now, instead.
- */
- for (p = tty_drivers; p; p = p->next) {
- if (p->flags && TTY_DRIVER_NO_DEVFS) {
- for (i = 0; i < p->num; i++)
- tty_register_devfs(p, DEVFS_FL_AOPEN_NOTIFY, p->minor_start + i);
- }
- }
-
#ifdef CONFIG_UNIX98_PTYS
dev_ptmx_driver = dev_tty_driver;
dev_ptmx_driver.driver_name = "/dev/ptmx";
dev_ptmx_driver.name = dev_ptmx_driver.driver_name + 5;
- dev_ptmx_driver.major= MAJOR(PTMX_DEV);
- dev_ptmx_driver.minor_start = MINOR(PTMX_DEV);
+ dev_ptmx_driver.major= TTYAUX_MAJOR;
+ dev_ptmx_driver.minor_start = 2;
dev_ptmx_driver.type = TTY_DRIVER_TYPE_SYSTEM;
dev_ptmx_driver.subtype = SYSTEM_TYPE_SYSPTMX;
if (tty_register_driver(&dev_ptmx_driver))
panic("Couldn't register /dev/ptmx driver\n");
#endif
-
+
#ifdef CONFIG_VT
- vty_init();
+ vty_init();
#endif
+
#ifdef CONFIG_ESPSERIAL /* init ESP before rs, so rs doesn't see the port */
espserial_init();
#endif
Index: vc_screen.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/vc_screen.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- vc_screen.c 2001/08/05 22:58:18 1.18
+++ vc_screen.c 2002/01/20 03:54:46 1.19
@@ -33,7 +33,7 @@
#include <linux/init.h>
#include <linux/vt_kern.h>
#include <linux/selection.h>
-#include <linux/console.h>
+#include <linux/kbd_kern.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
@@ -46,35 +46,35 @@
/* note the word offset */
unsigned short *screen_pos(struct vc_data *vc, int w_offset, int viewed)
{
- return screenpos(vc, 2 * w_offset, viewed);
+ return screenpos(vc, 2 * w_offset, viewed);
}
void getconsxy(struct vc_data *vc, char *p)
{
- p[0] = vc->vc_x;
- p[1] = vc->vc_y;
+ p[0] = vc->vc_x;
+ p[1] = vc->vc_y;
}
void putconsxy(struct vc_data *vc, char *p)
{
- gotoxy(vc, p[0], p[1]);
- set_cursor(vc);
+ gotoxy(vc, p[0], p[1]);
+ set_cursor(vc);
}
u16 vcs_scr_readw(struct vc_data *vc, const u16 *org)
{
- if ((unsigned long)org == vc->vc_pos && vc->display_fg->cursor_original != -1)
- return vc->display_fg->cursor_original;
- return scr_readw(org);
+ if ((unsigned long)org == vc->vc_pos && vc->display_fg->cursor_original != -1)
+ return vc->display_fg->cursor_original;
+ return scr_readw(org);
}
void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org)
{
- scr_writew(val, org);
- if ((unsigned long)org == vc->vc_pos) {
- vc->display_fg->cursor_original = -1;
- add_softcursor(vc);
- }
+ scr_writew(val, org);
+ if ((unsigned long)org == vc->vc_pos) {
+ vc->display_fg->cursor_original = -1;
+ add_softcursor(vc);
+ }
}
static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
@@ -89,11 +89,11 @@
return -ENXIO;
vc = vt_cons->fg_console;
}
-
+
size = vc->vc_rows * vc->vc_cols;
- if (MINOR(inode->i_rdev) & 128)
- size = 2*size + HEADER_SIZE;
+ if (minor(inode->i_rdev) & 128)
+ size = 2*size + HEADER_SIZE;
switch (orig) {
default:
@@ -112,14 +112,12 @@
return file->f_pos;
}
-#define CON_BUF_SIZE PAGE_SIZE
-
static ssize_t
vcs_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
struct vc_data *vc = (struct vc_data *) file->private_data;
struct inode *inode = file->f_dentry->d_inode;
- unsigned int currcons = MINOR(inode->i_rdev);
+ unsigned int currcons = minor(inode->i_rdev);
long pos = *ppos;
long viewed, attr, read;
int col, maxcol;
@@ -136,13 +134,12 @@
attr = (currcons & 128);
currcons = (currcons & 127);
if (currcons == 0) {
- vc = vt_cons->fg_console;
+ vc = vt_cons->fg_console;
viewed = 1;
- } else {
- vc = (struct vc_data *) file->private_data;
+ } else {
+ vc = (struct vc_data *) file->private_data;
viewed = 0;
- }
-
+ }
ret = -ENXIO;
if (!vc)
goto unlock_out;
@@ -163,8 +160,8 @@
* could sleep.
*/
size = vc->vc_rows * vc->vc_cols;
- if (MINOR(inode->i_rdev) & 128)
- size = 2*size + HEADER_SIZE;
+ if (minor(inode->i_rdev) & 128)
+ size = 2*size + HEADER_SIZE;
if (pos >= size)
break;
@@ -175,7 +172,7 @@
if (this_round > CON_BUF_SIZE)
this_round = CON_BUF_SIZE;
- /* Perform the whole read into the current VT's con_buf.
+ /* Perform the whole read into the current VC's con_buf.
* Then we can drop the console spinlock and safely
* attempt to move it to userspace.
*/
@@ -217,7 +214,7 @@
/* Advance state pointers and move on. */
this_round -= tmp_count;
p = HEADER_SIZE;
- con_buf0 = vc->display_fg->con_buf+HEADER_SIZE;
+ con_buf0 = vc->display_fg->con_buf + HEADER_SIZE;
/* If this_round >= 0, then p is even... */
} else if (p & 1) {
/* Skip first byte for output if start address is odd
@@ -258,9 +255,13 @@
}
}
- /* Finally, temporarily drop the console lock and push
+ /* Finally, release the console semaphore while we push
* all the data to userspace from our temporary buffer.
+ *
+ * AKPM: Even though it's a semaphore, we should drop it because
+ * the pagefault handling code may want to call printk().
*/
+
release_console_sem(vc->vc_tty->device);
ret = copy_to_user(buf, con_buf_start, orig_count);
acquire_console_sem(vc->vc_tty->device);
@@ -289,7 +290,7 @@
{
struct vc_data *vc = (struct vc_data *) file->private_data;
struct inode *inode = file->f_dentry->d_inode;
- unsigned int currcons = MINOR(inode->i_rdev);
+ unsigned int currcons = minor(inode->i_rdev);
long pos = *ppos;
long viewed, attr, size, written;
char *con_buf0;
@@ -308,20 +309,19 @@
currcons = (currcons & 127);
if (currcons == 0) {
- vc = vt_cons->fg_console;
+ vc = vt_cons->fg_console;
viewed = 1;
- } else {
- vc = (struct vc_data *) file->private_data;
+ } else {
+ vc = (struct vc_data *) file->private_data;
viewed = 0;
- }
-
+ }
ret = -ENXIO;
if (!vc)
goto unlock_out;
size = vc->vc_rows * vc->vc_cols;
- if (MINOR(inode->i_rdev) & 128)
- size = 2*size + HEADER_SIZE;
+ if (minor(inode->i_rdev) & 128)
+ size = 2*size + HEADER_SIZE;
ret = -EINVAL;
if (pos < 0 || pos > size)
@@ -357,13 +357,13 @@
}
}
- /* The vcs size might have changed while we slept to grab
+ /* The vcs_size might have changed while we slept to grab
* the user buffer, so recheck.
* Return data written up to now on failure.
*/
size = vc->vc_rows * vc->vc_cols;
- if (MINOR(inode->i_rdev) & 128)
- size = 2*size + HEADER_SIZE;
+ if (minor(inode->i_rdev) & 128)
+ size = 2*size + HEADER_SIZE;
if (pos >= size)
break;
@@ -387,7 +387,7 @@
unsigned char c = *con_buf0++;
this_round--;
- vcs_scr_writew(vc, (vcs_scr_readw(vc, org) & 0xff00) | c, org);
+ vcs_scr_writew(vc, (vcs_scr_readw(vc, org) & 0xff00) | c, org);
org++;
if (++col == maxcol) {
org = screen_pos(vc, p, viewed);
@@ -417,7 +417,8 @@
this_round--;
c = *con_buf0++;
#ifdef __BIG_ENDIAN
- vcs_scr_writew(vc, c | (vcs_scr_readw(vc, org) & 0xff00), org);
+ vcs_scr_writew(vc, c |
+ (vcs_scr_readw(vc, org) & 0xff00), org);
#else
vcs_scr_writew(vc, (c << 8) |
(vcs_scr_readw(vc, org) & 0xff), org);
@@ -475,7 +476,7 @@
static int
vcs_open(struct inode *inode, struct file *filp)
{
- unsigned int currcons = (MINOR(inode->i_rdev) & 127);
+ unsigned int currcons = (minor(inode->i_rdev) & 127);
struct vc_data *vc;
if (currcons) {
@@ -484,7 +485,7 @@
filp->private_data = vc;
else
return -ENXIO;
- }
+ }
return 0;
}
@@ -503,12 +504,15 @@
char name[8];
sprintf (name, "a%u", index + 1);
- if (unregister) {
- devfs_unregister ( devfs_find_handle (devfs_handle, name + 1, 0, 0,
+ if (unregister)
+ {
+ devfs_unregister ( devfs_find_handle (devfs_handle, name + 1, 0, 0,
DEVFS_SPECIAL_CHR, 0) );
- devfs_unregister ( devfs_find_handle (devfs_handle, name, 0, 0,
+ devfs_unregister ( devfs_find_handle (devfs_handle, name, 0, 0,
DEVFS_SPECIAL_CHR, 0) );
- } else {
+ }
+ else
+ {
devfs_register (devfs_handle, name + 1, DEVFS_FL_DEFAULT,
VCS_MAJOR, index + 1,
S_IFCHR | S_IRUSR | S_IWUSR, &vcs_fops, NULL);
Index: vt.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/vt.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- vt.c 2001/12/23 00:04:18 1.116
+++ vt.c 2002/01/20 03:54:46 1.117
@@ -1204,7 +1204,7 @@
/* Allocate the console screen memory. */
static int vt_open(struct tty_struct *tty, struct file * filp)
{
- unsigned int currcons = MINOR(tty->device);
+ unsigned int currcons = minor(tty->device);
struct vc_data *vc = (struct vc_data *) tty->driver_data;
if (!vc) {
@@ -1232,7 +1232,7 @@
if (!tty)
return;
if (tty->count != 1) return;
- vcs_make_devfs(MINOR(tty->device), 1);
+ vcs_make_devfs(minor(tty->device), 1);
tty->driver_data = 0;
}
@@ -1423,14 +1423,13 @@
static kdev_t vt_console_device(struct console *c)
{
- return MKDEV(TTY_MAJOR, c->index ? c->index : admin_vt->fg_console->vc_num);
+ return mk_dev(TTY_MAJOR, c->index ? c->index : admin_vt->fg_console->vc_num);
}
struct console vt_console_driver = {
name: "tty",
write: vt_console_print,
device: vt_console_device,
- wait_key: keyboard_wait_for_keypress,
flags: CON_PRINTBUFFER,
index: -1,
};
|