Commit 3e391afe authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.28pre1

parent 9334eab8
This diff is collapsed.
......@@ -142,6 +142,7 @@ BUSLOGIC SCSI DRIVER
P: Leonard N. Zubkoff
M: Leonard N. Zubkoff <lnz@dandelion.com>
L: linux-scsi@vger.rutgers.edu
W: http://www.dandelion.com/Linux/
S: Maintained
CYCLADES ASYNC MUX DRIVER
......@@ -303,6 +304,12 @@ M: ecd@skynet.be
L: sparclinux@vger.rutgers.edu
S: Maintained
SCSI SUBSYSTEM
P: Leonard N. Zubkoff
M: Leonard N. Zubkoff <lnz@dandelion.com>
L: linux-scsi@vger.rutgers.edu
S: Maintained
SVGA HANDLING:
P: Martin Mares
M: mj@k332.feld.cvut.cz
......
VERSION = 2
PATCHLEVEL = 1
SUBLEVEL = 27
SUBLEVEL = 28
ARCH = i386
......
......@@ -125,7 +125,7 @@ entInt:
lda $0,intr_count
ldl $1,0($0)
addq $1,1,$1
stq $1,0($0)
stl $1,0($0)
/* set up the arguments to the C interrupt handler */
ldq $8,current_set
jsr $26,do_entInt
......@@ -133,7 +133,7 @@ entInt:
lda $0,intr_count
ldl $1,0($0)
subq $1,1,$1
stq $1,0($0)
stl $1,0($0)
br $31,ret_from_sys_call
.end entInt
......@@ -710,7 +710,7 @@ sys_call_table:
/*0*/ .quad do_entSys, sys_exit, sys_fork, sys_read, sys_write
.quad do_entSys, sys_close, sys_wait4, do_entSys, sys_link
.quad sys_unlink, do_entSys, sys_chdir, sys_fchdir, sys_mknod
.quad sys_chmod, sys_chown, sys_brk, do_entSys, sys_lseek
.quad sys_chmod, sys_chown, osf_brk, do_entSys, sys_lseek
.quad sys_getxpid, osf_mount, osf_umount, sys_setuid, sys_getxuid
.quad do_entSys, sys_ptrace, do_entSys, do_entSys, do_entSys
.quad do_entSys, do_entSys, do_entSys, sys_access, do_entSys
......
......@@ -47,6 +47,20 @@ extern asmlinkage int sys_umount(char *);
extern asmlinkage int sys_swapon(const char *specialfile, int swap_flags);
extern asmlinkage unsigned long sys_brk(unsigned long);
/*
* Brk needs to return an error. Still support Linux's brk(0) query idiom,
* which OSF programs just shouldn't be doing. We're still not quite
* identical to OSF as we don't return 0 on success, but doing otherwise
* would require changes to libc. Hopefully this is good enough.
*/
asmlinkage unsigned long osf_brk(unsigned long brk)
{
unsigned long retval = sys_brk(brk);
if (brk && brk != retval)
retval = -ENOMEM;
return retval;
}
/*
* This is pure guess-work..
*/
......
......@@ -304,20 +304,14 @@ csum_partial_cfu_unaligned(unsigned long * src, unsigned long * dst,
return checksum;
}
unsigned int
csum_partial_copy_from_user(int *errp, char *src, char *dst,
int len, unsigned int sum)
static unsigned int
do_csum_partial_copy_from_user(char *src, char *dst, int len,
unsigned int sum, int *errp)
{
unsigned long checksum = (unsigned) sum;
unsigned long soff = 7 & (unsigned long) src;
unsigned long doff = 7 & (unsigned long) dst;
if (!access_ok(src, len, VERIFY_READ)) {
*errp = -EFAULT;
memset(dst, 0, len);
return checksum;
}
if (len) {
if (!doff) {
if (!soff)
......@@ -357,13 +351,26 @@ csum_partial_copy_from_user(int *errp, char *src, char *dst,
return checksum;
}
unsigned int
csum_partial_copy_from_user(char *src, char *dst, int len,
unsigned int sum, int *errp)
{
if (!access_ok(src, len, VERIFY_READ)) {
*errp = -EFAULT;
memset(dst, 0, len);
return sum;
}
return do_csum_partial_copy_from_user(src, dst, len, sum, errp);
}
unsigned int
csum_partial_copy (const char *src, char *dst, int len, unsigned int sum)
{
unsigned int ret;
int error = 0;
ret = csum_partial_copy_from_user(&error, src, dst, len, sum);
ret = do_csum_partial_copy_from_user(src, dst, len, sum, &error);
if (error)
printk("csum_partial_copy_old(): tell mingo to convert me!\n");
......
......@@ -120,6 +120,7 @@ CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_AM53C974 is not set
CONFIG_SCSI_BUSLOGIC=y
CONFIG_SCSI_OMIT_FLASHPOINT=y
# CONFIG_SCSI_DTC3280 is not set
# CONFIG_SCSI_EATA_DMA is not set
# CONFIG_SCSI_EATA_PIO is not set
......@@ -201,11 +202,8 @@ CONFIG_ISO9660_FS=y
# Character devices
#
CONFIG_SERIAL=y
# CONFIG_DIGI is not set
# CONFIG_CYCLADES is not set
# CONFIG_STALDRV is not set
# CONFIG_RISCOM8 is not set
# CONFIG_ESPSERIAL is not set
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_PRINTER is not set
CONFIG_MOUSE=y
# CONFIG_ATIXL_BUSMOUSE is not set
......
......@@ -349,7 +349,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
int do_random = 0;
lock_kernel();
intr_count++;
atomic_inc(&intr_count);
#ifdef __SMP__
if(smp_threads_ready && active_kernel_processor!=smp_processor_id())
panic("IRQ %d: active processor set wrongly(%d not %d).\n", irq, active_kernel_processor, smp_processor_id());
......@@ -366,7 +366,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
}
if (do_random & SA_SAMPLE_RANDOM)
add_interrupt_randomness(irq);
intr_count--;
atomic_dec(&intr_count);
unlock_kernel();
}
......
Thu Feb 27 01:53:08 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* serial.c (change_speed): Add support for the termios flag
CMSPAR, which allows the user to select stick parity.
(i.e, if PARODD is set, the the parity bit is always 1; if
PARRODD is not set, then the parity bit is always 0).
Wed Feb 26 19:03:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* serial.c (cleanup_module): Fix memory leak when using the serial
driver as a module; make sure tmp_buf gets freed!
Tue Feb 25 11:01:59 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* serial.c (set_modem_info): Add support for setting and clearing
the OUT1 and OUT2 bits. (For special case UART's, usually
for half-duplex.)
(autoconfig, change_speed): Fix TI 16750 support.
Sun Feb 16 00:14:43 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* tty_io.c (release_dev): Add sanity check to make sure there are
no waiters on tty->read_wait or tty->write_wait.
* serial.c (rs_init): Don't autoconfig a device if the I/O region
is already reserved.
* serial.c (serial_proc_info): Add support for /proc/serial.
Thu Feb 13 00:49:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* serial.c (receive_chars): When the UART repotrs an overrun
condition, it does so with a valid character. Changed to
not throw away the valid character, but instead report the
overrun after the valid character.
* serial.c: Added new #ifdef's for some of the advanced serial
driver features. A minimal driver that only supports COM
1/2/3/4 without sharing serial interrupts only takes 17k;
the full driver takes 32k.
Wed Feb 12 14:50:44 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
* vt.c:
* pty.c:
* tty_ioctl.c:
* serial.c: Update routines to use the new 2.1 memory access
routines.
Wed Dec 4 07:51:52 1996 Theodre Ts'o <tytso@localhost.mit.edu>
* serial.c (change_speed): Use save_flags(); cli() and
......
......@@ -4,19 +4,29 @@
mainmenu_option next_comment
comment 'Character devices'
tristate 'Standard/generic serial support' CONFIG_SERIAL
bool 'Digiboard PC/Xx Support' CONFIG_DIGI
tristate 'Cyclades async mux support' CONFIG_CYCLADES
bool 'Stallion multiport serial support' CONFIG_STALDRV
if [ "$CONFIG_STALDRV" = "y" ]; then
tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION
tristate ' Stallion EC8/64, ONboard, Brumby support' CONFIG_ISTALLION
tristate 'Standard/generic (dumb) serial support' CONFIG_SERIAL
bool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED
if [ "$CONFIG_SERIAL_EXTENDED" = "y" ]; then
bool ' Support more than 4 serial ports' CONFIG_SERIAL_MANY_PORTS
bool ' Support for sharing serial interrupts' CONFIG_SERIAL_SHARE_IRQ
bool ' Support special multiport boards' CONFIG_SERIAL_MULTIPORT
bool ' Support the Bell Technologies HUB6 card' CONFIG_HUB6
fi
tristate 'SDL RISCom/8 card support' CONFIG_RISCOM8
tristate 'Hayes ESP serial port support' CONFIG_ESPSERIAL
if [ "$CONFIG_ESPSERIAL" = "y" -o "$CONFIG_ESPSERIAL" = "m" ]; then
int ' DMA channel' CONFIG_ESPSERIAL_DMA_CHANNEL 1
int ' FIFO trigger level' CONFIG_ESPSERIAL_TRIGGER_LEVEL 768
bool 'Non-standard serial port support' CONFIG_SERIAL_NONSTANDARD
if [ "$CONFIG_SERIAL_NONSTANDARD" = "y" ]; then
bool 'Digiboard PC/Xx Support' CONFIG_DIGI
tristate 'Cyclades async mux support' CONFIG_CYCLADES
bool 'Stallion multiport serial support' CONFIG_STALDRV
if [ "$CONFIG_STALDRV" = "y" ]; then
tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION
tristate ' Stallion EC8/64, ONboard, Brumby support' CONFIG_ISTALLION
fi
tristate 'SDL RISCom/8 card support' CONFIG_RISCOM8
tristate 'Hayes ESP serial port support' CONFIG_ESPSERIAL
if [ "$CONFIG_ESPSERIAL" = "y" -o "$CONFIG_ESPSERIAL" = "m" ]; then
int ' DMA channel' CONFIG_ESPSERIAL_DMA_CHANNEL 1
int ' FIFO trigger level' CONFIG_ESPSERIAL_TRIGGER_LEVEL 768
fi
fi
tristate 'Parallel printer support' CONFIG_PRINTER
......
......@@ -1010,6 +1010,7 @@ static unsigned int normal_poll(struct tty_struct * tty, struct file * file, pol
struct tty_ldisc tty_ldisc_N_TTY = {
TTY_LDISC_MAGIC, /* magic */
"n_tty", /* name */
0, /* num */
0, /* flags */
n_tty_open, /* open */
......
......@@ -4,14 +4,6 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*/
/*
* pty.c
*
* This module exports the following pty function:
*
* int pty_open(struct tty_struct * tty, struct file * filp);
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
......@@ -47,8 +39,8 @@ struct pty_struct {
static unsigned char *tmp_buf;
static struct semaphore tmp_buf_sem = MUTEX;
struct tty_driver pty_driver, pty_slave_driver;
struct tty_driver old_pty_driver, old_pty_slave_driver;
static struct tty_driver pty_driver, pty_slave_driver;
static struct tty_driver old_pty_driver, old_pty_slave_driver;
static int pty_refcount;
static struct tty_struct *pty_table[NR_PTYS];
......@@ -74,8 +66,10 @@ static void pty_close(struct tty_struct * tty, struct file * filp)
}
wake_up_interruptible(&tty->read_wait);
wake_up_interruptible(&tty->write_wait);
tty->packet = 0;
if (!tty->link)
return;
tty->link->packet = 0;
wake_up_interruptible(&tty->link->read_wait);
wake_up_interruptible(&tty->link->write_wait);
set_bit(TTY_OTHER_CLOSED, &tty->link->flags);
......@@ -125,7 +119,12 @@ static int pty_write(struct tty_struct * tty, int from_user,
((tty->driver.subtype-1) * PTY_BUF_SIZE);
while (count > 0) {
n = MIN(count, PTY_BUF_SIZE);
copy_from_user(temp_buffer, buf, n);
n -= copy_from_user(temp_buffer, buf, n);
if (!n) {
if (!c)
c = -EFAULT;
break;
}
r = to->ldisc.receive_room(to);
if (r <= 0)
break;
......@@ -179,7 +178,7 @@ static void pty_flush_buffer(struct tty_struct *tty)
}
}
int pty_open(struct tty_struct *tty, struct file * filp)
static int pty_open(struct tty_struct *tty, struct file * filp)
{
int retval;
int line;
......@@ -230,6 +229,7 @@ int pty_init(void)
memset(&pty_state, 0, sizeof(pty_state));
memset(&pty_driver, 0, sizeof(struct tty_driver));
pty_driver.magic = TTY_DRIVER_MAGIC;
pty_driver.driver_name = "pty_master";
pty_driver.name = "pty";
pty_driver.major = PTY_MASTER_MAJOR;
pty_driver.minor_start = 0;
......@@ -258,6 +258,8 @@ int pty_init(void)
pty_driver.set_termios = pty_set_termios;
pty_slave_driver = pty_driver;
pty_slave_driver.driver_name = "pty_slave";
pty_slave_driver.proc_entry = 0;
pty_slave_driver.name = "ttyp";
pty_slave_driver.subtype = PTY_TYPE_SLAVE;
pty_slave_driver.major = PTY_SLAVE_MAJOR;
......@@ -270,12 +272,16 @@ int pty_init(void)
pty_slave_driver.other = &pty_driver;
old_pty_driver = pty_driver;
old_pty_driver.driver_name = "compat_pty_master";
old_pty_driver.proc_entry = 0;
old_pty_driver.major = TTY_MAJOR;
old_pty_driver.minor_start = 128;
old_pty_driver.num = (NR_PTYS > 64) ? 64 : NR_PTYS;
old_pty_driver.other = &old_pty_slave_driver;
old_pty_slave_driver = pty_slave_driver;
old_pty_slave_driver.driver_name = "compat_pty_slave";
old_pty_slave_driver.proc_entry = 0;
old_pty_slave_driver.major = TTY_MAJOR;
old_pty_slave_driver.minor_start = 192;
old_pty_slave_driver.num = (NR_PTYS > 64) ? 64 : NR_PTYS;
......
This diff is collapsed.
This diff is collapsed.
......@@ -63,6 +63,9 @@
#include <linux/string.h>
#include <linux/malloc.h>
#include <linux/poll.h>
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h>
#endif
#include <asm/uaccess.h>
#include <asm/system.h>
......@@ -1134,6 +1137,25 @@ static void release_dev(struct file * filp)
if (tty->count)
return;
/*
* Sanity check --- if tty->count is zero, there shouldn't be
* any waiters on tty->read_wait or tty->write_wait. But just
* in case....
*/
while (1) {
if (waitqueue_active(&tty->read_wait)) {
printk("release_dev: %s: read_wait active?!?\n",
tty_name(tty));
wake_up(&tty->read_wait);
} else if (waitqueue_active(&tty->write_wait)) {
printk("release_dev: %s: write_wait active?!?\n",
tty_name(tty));
wake_up(&tty->write_wait);
} else
break;
schedule();
}
/*
* We're committed; at this point, we must not block!
*/
......@@ -1232,7 +1254,9 @@ static int tty_open(struct inode * inode, struct file * filp)
int minor;
int noctty, retval;
kdev_t device;
unsigned short saved_flags;
saved_flags = filp->f_flags;
retry_open:
noctty = filp->f_flags & O_NOCTTY;
device = inode->i_rdev;
......@@ -1240,6 +1264,7 @@ static int tty_open(struct inode * inode, struct file * filp)
if (!current->tty)
return -ENXIO;
device = current->tty->device;
filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */
/* noctty = 1; */
}
if (device == CONSOLE_DEV) {
......@@ -1263,6 +1288,7 @@ static int tty_open(struct inode * inode, struct file * filp)
retval = tty->driver.open(tty, filp);
else
retval = -ENODEV;
filp->f_flags = saved_flags;
if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) && !suser())
retval = -EBUSY;
......@@ -1830,6 +1856,10 @@ int tty_register_driver(struct tty_driver *driver)
driver->next = tty_drivers;
if (tty_drivers) tty_drivers->prev = driver;
tty_drivers = driver;
#ifdef CONFIG_PROC_FS
proc_tty_register_driver(driver);
#endif
return error;
}
......@@ -1871,6 +1901,9 @@ int tty_unregister_driver(struct tty_driver *driver)
if (driver->next)
driver->next->prev = driver->prev;
#ifdef CONFIG_PROC_FS
proc_tty_unregister_driver(driver);
#endif
return 0;
}
......@@ -1925,18 +1958,24 @@ int tty_init(void)
*/
memset(&dev_tty_driver, 0, sizeof(struct tty_driver));
dev_tty_driver.magic = TTY_DRIVER_MAGIC;
dev_tty_driver.name = "tty";
dev_tty_driver.driver_name = "/dev/tty";
dev_tty_driver.name = dev_tty_driver.driver_name + 5;
dev_tty_driver.name_base = 0;
dev_tty_driver.major = TTY_MAJOR;
dev_tty_driver.minor_start = 0;
dev_tty_driver.num = 1;
dev_tty_driver.type = TTY_DRIVER_TYPE_SYSTEM;
dev_tty_driver.subtype = SYSTEM_TYPE_TTY;
if (tty_register_driver(&dev_tty_driver))
panic("Couldn't register /dev/tty driver\n");
dev_console_driver = dev_tty_driver;
dev_console_driver.name = "console";
dev_console_driver.driver_name = "/dev/console";
dev_console_driver.name = dev_console_driver.driver_name + 5;
dev_console_driver.major = TTYAUX_MAJOR;
dev_console_driver.type = TTY_DRIVER_TYPE_SYSTEM;
dev_console_driver.subtype = SYSTEM_TYPE_CONSOLE;
if (tty_register_driver(&dev_console_driver))
panic("Couldn't register /dev/console driver\n");
......
......@@ -163,10 +163,10 @@ static int set_termios(struct tty_struct * tty, unsigned long arg, int opt)
memcpy(&tmp_termios, tty->termios, sizeof(struct termios));
user_termio_to_kernel_termios(&tmp_termios, (struct termio *) arg);
} else {
retval = verify_area(VERIFY_READ, (void *) arg, sizeof(struct termios));
retval = user_termios_to_kernel_termios
(&tmp_termios, (struct termios *) arg);
if (retval)
return retval;
user_termios_to_kernel_termios(&tmp_termios, (struct termios *) arg);
}
if ((opt & TERMIOS_FLUSH) && tty->ldisc.flush_buffer)
......@@ -240,15 +240,13 @@ static int get_sgttyb(struct tty_struct * tty, struct sgttyb * sgttyb)
int retval;
struct sgttyb tmp;
retval = verify_area(VERIFY_WRITE, sgttyb, sizeof(struct sgttyb));
if (retval)
return retval;
tmp.sg_ispeed = 0;
tmp.sg_ospeed = 0;
tmp.sg_erase = tty->termios->c_cc[VERASE];
tmp.sg_kill = tty->termios->c_cc[VKILL];
tmp.sg_flags = get_sgflags(tty);
copy_to_user(sgttyb, &tmp, sizeof(tmp));
if (copy_to_user(sgttyb, &tmp, sizeof(tmp)))
return -EFAULT;
return 0;
}
......@@ -283,14 +281,12 @@ static int set_sgttyb(struct tty_struct * tty, struct sgttyb * sgttyb)
struct sgttyb tmp;
struct termios termios;
retval = verify_area(VERIFY_READ, sgttyb, sizeof(struct sgttyb));
if (retval)
return retval;
retval = tty_check_change(tty);
if (retval)
return retval;
termios = *tty->termios;
copy_from_user(&tmp, sgttyb, sizeof(tmp));
if (copy_from_user(&tmp, sgttyb, sizeof(tmp)))
return -EFAULT;
termios.c_cc[VERASE] = tmp.sg_erase;
termios.c_cc[VKILL] = tmp.sg_kill;
set_sgflags(&termios, tmp.sg_flags);
......@@ -305,16 +301,14 @@ static int get_tchars(struct tty_struct * tty, struct tchars * tchars)
int retval;
struct tchars tmp;
retval = verify_area(VERIFY_WRITE, tchars, sizeof(struct tchars));
if (retval)
return retval;
tmp.t_intrc = tty->termios->c_cc[VINTR];
tmp.t_quitc = tty->termios->c_cc[VQUIT];
tmp.t_startc = tty->termios->c_cc[VSTART];
tmp.t_stopc = tty->termios->c_cc[VSTOP];
tmp.t_eofc = tty->termios->c_cc[VEOF];
tmp.t_brkc = tty->termios->c_cc[VEOL2]; /* what is brkc anyway? */
copy_to_user(tchars, &tmp, sizeof(tmp));
if (copy_to_user(tchars, &tmp, sizeof(tmp)))
return -EFAULT;
return 0;
}
......@@ -323,10 +317,8 @@ static int set_tchars(struct tty_struct * tty, struct tchars * tchars)
int retval;
struct tchars tmp;
retval = verify_area(VERIFY_READ, tchars, sizeof(struct tchars));
if (retval)
return retval;
copy_from_user(&tmp, tchars, sizeof(tmp));
if (copy_from_user(&tmp, tchars, sizeof(tmp)))
return -EFAULT;
tty->termios->c_cc[VINTR] = tmp.t_intrc;
tty->termios->c_cc[VQUIT] = tmp.t_quitc;
tty->termios->c_cc[VSTART] = tmp.t_startc;
......@@ -343,16 +335,14 @@ static int get_ltchars(struct tty_struct * tty, struct ltchars * ltchars)
int retval;
struct ltchars tmp;
retval = verify_area(VERIFY_WRITE, ltchars, sizeof(struct ltchars));
if (retval)
return retval;
tmp.t_suspc = tty->termios->c_cc[VSUSP];
tmp.t_dsuspc = tty->termios->c_cc[VSUSP]; /* what is dsuspc anyway? */
tmp.t_rprntc = tty->termios->c_cc[VREPRINT];
tmp.t_flushc = tty->termios->c_cc[VEOL2]; /* what is flushc anyway? */
tmp.t_werasc = tty->termios->c_cc[VWERASE];
tmp.t_lnextc = tty->termios->c_cc[VLNEXT];
copy_to_user(ltchars, &tmp, sizeof(tmp));
if (copy_to_user(ltchars, &tmp, sizeof(tmp)))
return -EFAULT;
return 0;
}
......@@ -361,10 +351,9 @@ static int set_ltchars(struct tty_struct * tty, struct ltchars * ltchars)
int retval;
struct ltchars tmp;
retval = verify_area(VERIFY_READ, ltchars, sizeof(struct ltchars));
if (retval)
return retval;
copy_from_user(&tmp, ltchars, sizeof(tmp));
if (copy_from_user(&tmp, ltchars, sizeof(tmp)))
return -EFAULT;
tty->termios->c_cc[VSUSP] = tmp.t_suspc;
tty->termios->c_cc[VEOL2] = tmp.t_dsuspc; /* what is dsuspc anyway? */
tty->termios->c_cc[VREPRINT] = tmp.t_rprntc;
......@@ -427,13 +416,9 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
return set_ltchars(real_tty, (struct ltchars *) arg);
#endif
case TCGETS:
retval = verify_area(VERIFY_WRITE, (void *) arg,
sizeof (struct termios));
if (retval)
return retval;
kernel_termios_to_user_termios((struct termios *)arg,
real_tty->termios);
return 0;
return kernel_termios_to_user_termios
((struct termios *)arg,
real_tty->termios);
case TCSETSF:
opt |= TERMIOS_FLUSH;
case TCSETSW:
......@@ -499,53 +484,31 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
}
return 0;
case TIOCOUTQ:
retval = verify_area(VERIFY_WRITE, (void *) arg,
sizeof (int));
if (retval)
return retval;
if (tty->driver.chars_in_buffer)
put_user(tty->driver.chars_in_buffer(tty),
(int *) arg);
else
put_user(0, (int *) arg);
return 0;
return put_user(tty->driver.chars_in_buffer ?
tty->driver.chars_in_buffer(tty) : 0,
(int *) arg);
case TIOCINQ:
retval = verify_area(VERIFY_WRITE, (void *) arg,
sizeof (unsigned int));
if (retval)
return retval;
retval = tty->read_cnt;
if (L_ICANON(tty))
retval = inq_canon(tty);
put_user(retval, (unsigned int *) arg);
return 0;
return put_user(retval, (unsigned int *) arg);
case TIOCGLCKTRMIOS:
retval = verify_area(VERIFY_WRITE, (void *) arg,
sizeof (struct termios));
if (retval)
return retval;
kernel_termios_to_user_termios((struct termios *)arg,
real_tty->termios_locked);
return 0;
return kernel_termios_to_user_termios
((struct termios *)arg,
real_tty->termios_locked);
case TIOCSLCKTRMIOS:
if (!suser())
return -EPERM;
retval = verify_area(VERIFY_READ, (void *) arg,
sizeof (struct termios));
if (retval)
return retval;
user_termios_to_kernel_termios(real_tty->termios_locked,
(struct termios *) arg);
return 0;
return user_termios_to_kernel_termios
(real_tty->termios_locked,
(struct termios *) arg);
case TIOCPKT:
if (tty->driver.type != TTY_DRIVER_TYPE_PTY ||
tty->driver.subtype != PTY_TYPE_MASTER)
return -ENOTTY;
retval = verify_area(VERIFY_READ, (void *) arg,
sizeof (int));
retval = get_user(retval, (int *) arg);
if (retval)
return retval;
get_user(retval, (int *) arg);
if (retval) {
if (!tty->packet) {
tty->packet = 1;
......
......@@ -358,6 +358,7 @@ ppp_first_time (void)
*/
(void) memset (&ppp_ldisc, 0, sizeof (ppp_ldisc));
ppp_ldisc.magic = TTY_LDISC_MAGIC;
ppp_ldisc.name = "ppp";
ppp_ldisc.open = ppp_tty_open;
ppp_ldisc.close = ppp_tty_close;
ppp_ldisc.read = ppp_tty_read;
......
......@@ -1120,6 +1120,7 @@ int slip_init_ctrl_dev(struct device *dummy)
/* Fill in our line protocol discipline, and register it */
memset(&sl_ldisc, 0, sizeof(sl_ldisc));
sl_ldisc.magic = TTY_LDISC_MAGIC;
sl_ldisc.name = "slip";
sl_ldisc.flags = 0;
sl_ldisc.open = slip_open;
sl_ldisc.close = slip_close;
......
......@@ -917,29 +917,47 @@ static unsigned int scan_bus(struct pci_bus *bus, unsigned long *mem_startp)
pcibios_write_config_word(bus->number, devfn,
PCI_STATUS, 0xffff);
/*
* Configure the bus numbers for this bridge:
* Read the existing primary/secondary/subordinate bus
* number configuration to determine if the PCI bridge
* has already been configured by the system. If so,
* do not modify the configuration, merely note it.
*/
pcibios_read_config_dword(bus->number, devfn, 0x18,
&buses);
buses &= 0xff000000;
buses |= (((unsigned int)(child->primary) << 0) |
((unsigned int)(child->secondary) << 8) |
((unsigned int)(child->subordinate) << 16));
pcibios_write_config_dword(bus->number, devfn, 0x18,
buses);
/*
* Now we can scan all subordinate buses:
*/
max = scan_bus(child, mem_startp);
/*
* Set the subordinate bus number to its real
* value:
*/
child->subordinate = max;
buses = (buses & 0xff00ffff)
| ((unsigned int)(child->subordinate) << 16);
pcibios_write_config_dword(bus->number, devfn, 0x18,
buses);
if ((buses & 0xFFFFFF) != 0)
{
child->primary = buses & 0xFF;
child->secondary = (buses >> 8) & 0xFF;
child->subordinate = (buses >> 16) & 0xFF;
child->number = child->secondary;
max = scan_bus(child, mem_startp);
}
else
{
/*
* Configure the bus numbers for this bridge:
*/
buses &= 0xff000000;
buses |=
(((unsigned int)(child->primary) << 0) |
((unsigned int)(child->secondary) << 8) |
((unsigned int)(child->subordinate) << 16));
pcibios_write_config_dword(bus->number, devfn, 0x18,
buses);
/*
* Now we can scan all subordinate buses:
*/
max = scan_bus(child, mem_startp);
/*
* Set the subordinate bus number to its real
* value:
*/
child->subordinate = max;
buses = (buses & 0xff00ffff)
| ((unsigned int)(child->subordinate) << 16);
pcibios_write_config_dword(bus->number, devfn, 0x18,
buses);
}
pcibios_write_config_word(bus->number, devfn,
PCI_COMMAND, cr);
}
......
......@@ -684,6 +684,7 @@ AM53C974_write_8(CNTLREG1, CNTLREG1_DISR | instance->this_id);
AM53C974_write_8(CMDREG, CMDREG_RBUS); /* reset SCSI bus */
udelay(10);
AM53C974_config_after_reset(instance);
udelay(500000);
return(1);
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -26,6 +26,9 @@ dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI
dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI
dep_tristate 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974 $CONFIG_SCSI
dep_tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC $CONFIG_SCSI
if [ "$CONFIG_SCSI_BUSLOGIC" != "n" ]; then
bool ' Omit FlashPoint support' CONFIG_SCSI_OMIT_FLASHPOINT
fi
dep_tristate 'DTC3180/3280 SCSI support' CONFIG_SCSI_DTC3280 $CONFIG_SCSI
dep_tristate 'EATA-DMA (DPT, NEC, AT&T, SNI, AST, Olivetti, Alphatronix) support' CONFIG_SCSI_EATA_DMA $CONFIG_SCSI
dep_tristate 'EATA-PIO (old DPT PM2001, PM2012A) support' CONFIG_SCSI_EATA_PIO $CONFIG_SCSI
......
This diff is collapsed.
FlashPoint Driver Developer's Kit
Version 1.0
Copyright 1995-1996 by Mylex Corporation
All Rights Reserved
This program is free software; you may redistribute and/or modify it under
the terms of either:
a) the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version,
or
b) the "BSD-style License" included below.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public
License or the BSD-style License below for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
The BSD-style License is as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain this LICENSE.FlashPoint
file, without modification, this list of conditions, and the following
disclaimer. The following copyright notice must appear immediately at
the beginning of all source files:
Copyright 1995-1996 by Mylex Corporation. All Rights Reserved
This file is available under both the GNU General Public License
and a BSD-style copyright; see LICENSE.FlashPoint for details.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of Mylex Corporation may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY MYLEX CORP. ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
......@@ -381,6 +381,12 @@ endif
include $(TOPDIR)/Rules.make
BusLogic.o: BusLogic.c FlashPoint.c
$(CC) $(CFLAGS) -c BusLogic.c -o BusLogic.O
$(CC) $(CFLAGS) -c FlashPoint.c -o FlashPoint.O
$(LD) -r -o BusLogic.o BusLogic.O FlashPoint.O
rm -f BusLogic.O FlashPoint.O
aha152x.o: aha152x.c
$(CC) $(CFLAGS) $(AHA152X) -c aha152x.c
......
This diff is collapsed.
The BusLogic FlashPoint SCSI host adapters are now supported on Linux 2.0.x.
See http://www.dandelion.com/Linux/ for the beta test BusLogic driver which
includes FlashPoint support. The upgrade program described below will remain
available through the end of 1996.
The BusLogic FlashPoint SCSI Host Adapters are now supported on Linux. The
upgrade program described below will remain available through March 1997.
......
......@@ -13,6 +13,9 @@
* controller).
* Modified by Matti Aarnio
* Accept parameters from LILO cmd-line. -- 1-Oct-94
* Modified by Mike McLagan <mike.mclagan@linux.org>
* Recognise extended mode on AHA1542CP, different bit than 1542CF
* 1-Jan-97
*/
#include <linux/module.h>
......@@ -813,7 +816,9 @@ static int aha1542_mbenable(int base)
mbenable_cmd[0]=CMD_MBENABLE;
mbenable_cmd[1]=0;
mbenable_cmd[2]=mbenable_result[1];
if(mbenable_result[1] & 1) retval = BIOS_TRANSLATION_25563;
if(mbenable_result[1] & 0x03) retval = BIOS_TRANSLATION_25563;
aha1542_out(base,mbenable_cmd,3);
WAIT(INTRFLAGS(base),INTRMASK,HACC,0);
};
......
......@@ -247,8 +247,12 @@ static int ioctl_command(Scsi_Device *dev, Scsi_Ioctl_Command *sic)
retries = 1;
break;
case START_STOP:
timeout = 2 * 60 * HZ; /* 2 minutes */
retries = 1;
break;
case MOVE_MEDIUM:
timeout = 60 * HZ; /* 60 seconds */
case READ_ELEMENT_STATUS:
timeout = 5 * 60 * HZ; /* 5 minutes */
retries = 1;
break;
default:
......
......@@ -1210,6 +1210,7 @@ static int sd_init_onedisk(int i)
printk ("scsi : deleting disk entry.\n");
rscsi_disks[i].device = NULL;
sd_template.nr_dev--;
sd_gendisk.nr_real--;
return i;
}
}
......
......@@ -629,7 +629,6 @@ scsi_tape_open(struct inode * inode, struct file * filp)
if ((STp->buffer)->last_result_fatal != 0) {
if ((SCpnt->sense_buffer[0] & 0x70) == 0x70 &&
(SCpnt->sense_buffer[2] & 0x0f) == NO_TAPE) {
printk(KERN_NOTICE "st%d: No tape.\n", dev);
STp->ready = ST_NO_TAPE;
} else
STp->ready = ST_NOT_READY;
......
......@@ -8,7 +8,8 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := proc.o
O_OBJS := inode.o root.o base.o mem.o link.o fd.o array.o kmsg.o net.o scsi.o
O_OBJS := inode.o root.o base.o generic.o mem.o link.o fd.o array.o \
kmsg.o net.o scsi.o proc_tty.o
OX_OBJS := procfs_syms.o
M_OBJS :=
......
/*
* proc/fs/generic.c --- generic routines for the proc-fs
*
* This file contains generic proc-fs routines for handling
* directories and files.
*
* Copyright (C) 1991, 1992 Linus Torvalds.
* Copyright (C) 1997 Theodore Ts'o
*/
#include <asm/uaccess.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/config.h>
#include <asm/bitops.h>
static long proc_file_read(struct inode * inode, struct file * file,
char * buf, unsigned long nbytes);
static long proc_file_write(struct inode * inode, struct file * file,
const char * buffer, unsigned long count);
static long long proc_file_lseek(struct inode * inode, struct file * file,
long long offset, int orig);
static struct file_operations proc_file_operations = {
proc_file_lseek, /* lseek */
proc_file_read, /* read */
proc_file_write, /* write */
NULL, /* readdir */
NULL, /* poll */
NULL, /* ioctl */
NULL, /* mmap */
NULL, /* no special open code */
NULL, /* no special release code */
NULL /* can't fsync */
};
/*
* proc files can do almost nothing..
*/
struct inode_operations proc_file_inode_operations = {
&proc_file_operations, /* default scsi directory file-ops */
NULL, /* create */
NULL, /* lookup */
NULL, /* link */
NULL, /* unlink */
NULL, /* symlink */
NULL, /* mkdir */
NULL, /* rmdir */
NULL, /* mknod */
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
NULL, /* bmap */
NULL, /* truncate */
NULL /* permission */
};
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
/* 4K page size but our output routines use some slack for overruns */
#define PROC_BLOCK_SIZE (3*1024)
static long proc_file_read(struct inode * inode, struct file * file,
char * buf, unsigned long nbytes)
{
char *page;
int retval=0;
int n;
char *start;
struct proc_dir_entry * dp;
if (nbytes < 0)
return -EINVAL;
dp = (struct proc_dir_entry *) inode->u.generic_ip;
if (!(page = (char*) __get_free_page(GFP_KERNEL)))
return -ENOMEM;
while (nbytes > 0)
{
n = MIN(PROC_BLOCK_SIZE, nbytes);
if (dp->get_info) {
/*
* Handle backwards compatibility with the old net
* routines.
*
* XXX What gives with the file->f_flags & O_ACCMODE
* test? Seems stupid to me....
*/
n = dp->get_info(page, &start, file->f_pos, n,
(file->f_flags & O_ACCMODE) == O_RDWR);
} else if (dp->read_proc) {
n = dp->read_proc(page, &start, file->f_pos,
n, dp->data);
} else
break;
if (n == 0)
break; /* End of file */
if (n < 0) {
if (retval == 0)
retval = n;
break;
}
n -= copy_to_user(buf, start, n);
if (n == 0) {
if (retval == 0)
retval = -EFAULT;
break;
}
file->f_pos += n; /* Move down the file */
nbytes -= n;
buf += n;
retval += n;
}
free_page((unsigned long) page);
return retval;
}
static long
proc_file_write(struct inode * inode, struct file * file,
const char * buffer, unsigned long count)
{
struct proc_dir_entry * dp;
char *page;
if (count < 0)
return -EINVAL;
dp = (struct proc_dir_entry *) inode->u.generic_ip;
if (!(page = (char*) __get_free_page(GFP_KERNEL)))
return -ENOMEM;
if (!dp->write_proc)
return -EIO;
return dp->write_proc(file, buffer, count, dp->data);
}
static long long proc_file_lseek(struct inode * inode, struct file * file,
long long offset, int orig)
{
switch (orig) {
case 0:
file->f_pos = offset;
return(file->f_pos);
case 1:
file->f_pos += offset;
return(file->f_pos);
case 2:
return(-EINVAL);
default:
return(-EINVAL);
}
}
struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent)
{
struct proc_dir_entry *ent;
ent = kmalloc(sizeof(struct proc_dir_entry), GFP_KERNEL);
if (!ent)
return NULL;
memset(ent, 0, sizeof(struct proc_dir_entry));
if (mode == S_IFDIR)
mode |= S_IRUGO | S_IXUGO;
else if (mode == 0)
mode = S_IFREG | S_IRUGO;
ent->name = name;
ent->namelen = strlen(ent->name);
ent->mode = mode;
if (S_ISDIR(mode))
ent->nlink = 2;
else
ent->nlink = 1;
if (parent)
proc_register(parent, ent);
return ent;
}
......@@ -81,6 +81,7 @@ static int parse_options(char *options,uid_t *uid,gid_t *gid)
struct inode * proc_get_inode(struct super_block * s, int ino, struct proc_dir_entry * de)
{
struct inode * inode = iget(s, ino);
struct task_struct *p;
#ifdef CONFIG_SUN_OPENPROMFS_MODULE
if ((inode->i_ino >= PROC_OPENPROM_FIRST)
......@@ -106,6 +107,14 @@ struct inode * proc_get_inode(struct super_block * s, int ino, struct proc_dir_e
de->fill_inode(inode);
}
}
/*
* Fixup the root inode's nlink value
*/
if (inode->i_ino == PROC_ROOT_INO) {
for_each_task(p)
if (p && p->pid)
inode->i_nlink++;
}
return inode;
}
......@@ -162,93 +171,20 @@ void proc_read_inode(struct inode * inode)
inode->i_nlink = 1;
inode->i_size = 0;
pid = ino >> 16;
if (!pid)
return;
p = task[0];
for (i = 0; i < NR_TASKS ; i++)
if ((p = task[i]) && (p->pid == pid))
break;
if (!p || i >= NR_TASKS)
return;
if (ino == PROC_ROOT_INO) {
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO;
inode->i_nlink = 2;
for (i = 1 ; i < NR_TASKS ; i++)
if (task[i])
inode->i_nlink++;
return;
}
if (!pid) {
switch (ino) {
case PROC_KMSG:
inode->i_mode = S_IFREG | S_IRUSR;
inode->i_op = &proc_kmsg_inode_operations;
break;
case PROC_NET:
inode->i_nlink = 2;
break;
case PROC_SCSI:
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO;
inode->i_nlink = 2;
inode->i_op = &proc_scsi_inode_operations;
break;
case PROC_KCORE:
inode->i_mode = S_IFREG | S_IRUSR;
inode->i_op = &proc_kcore_inode_operations;
inode->i_size = (MAP_NR(high_memory) << PAGE_SHIFT) + PAGE_SIZE;
break;
case PROC_PROFILE:
inode->i_mode = S_IFREG | S_IRUGO | S_IWUSR;
inode->i_op = &proc_profile_inode_operations;
inode->i_size = (1+prof_len) * sizeof(unsigned long);
break;
default:
inode->i_mode = S_IFREG | S_IRUGO;
inode->i_op = &proc_array_inode_operations;
break;
}
return;
}
ino &= 0x0000ffff;
if (ino == PROC_PID_INO || p->dumpable) {
inode->i_uid = p->euid;
inode->i_gid = p->egid;
}
switch (ino) {
case PROC_PID_INO:
inode->i_nlink = 4;
return;
case PROC_PID_MEM:
inode->i_op = &proc_mem_inode_operations;
inode->i_mode = S_IFREG | S_IRUSR | S_IWUSR;
return;
case PROC_PID_CWD:
case PROC_PID_ROOT:
case PROC_PID_EXE:
inode->i_op = &proc_link_inode_operations;
inode->i_size = 64;
inode->i_mode = S_IFLNK | S_IRWXU;
return;
case PROC_PID_FD:
inode->i_mode = S_IFDIR | S_IRUSR | S_IXUSR;
inode->i_op = &proc_fd_inode_operations;
inode->i_nlink = 2;
return;
case PROC_PID_ENVIRON:
inode->i_mode = S_IFREG | S_IRUSR;
inode->i_op = &proc_array_inode_operations;
return;
case PROC_PID_CMDLINE:
case PROC_PID_STATUS:
case PROC_PID_STAT:
case PROC_PID_STATM:
inode->i_mode = S_IFREG | S_IRUGO;
inode->i_op = &proc_array_inode_operations;
return;
case PROC_PID_MAPS:
inode->i_mode = S_IFIFO | S_IRUGO;
inode->i_op = &proc_arraylong_inode_operations;
return;
}
switch (ino >> 8) {
case PROC_PID_FD_DIR:
ino &= 0xff;
......
/*
* proc_tty.c -- handles /proc/tty
*
* Copyright 1997, Theodore Ts'o
*/
#include <asm/uaccess.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/tty.h>
#include <linux/config.h>
#include <asm/bitops.h>
extern struct tty_driver *tty_drivers; /* linked list of tty drivers */
extern struct tty_ldisc ldiscs[];
static int tty_drivers_read_proc(char *page, char **start, off_t off,
int count, void *data);
static int tty_ldiscs_read_proc(char *page, char **start, off_t off,
int count, void *data);
/*
* The /proc/tty directory inodes...
*/
static struct proc_dir_entry *proc_tty, *proc_tty_ldisc, *proc_tty_driver;
/*
* This is the handler for /proc/tty/drivers
*/
static int tty_drivers_read_proc(char *page, char **start, off_t off,
int count, void *data)
{
int len = 0;
off_t begin = 0;
struct tty_driver *p;
char range[20], deftype[20];
char *type;
for (p = tty_drivers; p; p = p->next) {
if (p->num > 1)
sprintf(range, "%d-%d", p->minor_start,
p->minor_start + p->num - 1);
else
sprintf(range, "%d", p->minor_start);
switch (p->type) {
case TTY_DRIVER_TYPE_SYSTEM:
if (p->subtype == SYSTEM_TYPE_TTY)
type = "system:/dev/tty";
else if (p->subtype == SYSTEM_TYPE_CONSOLE)
type = "system:console";
else
type = "system";
break;
case TTY_DRIVER_TYPE_CONSOLE:
type = "console";
break;
case TTY_DRIVER_TYPE_SERIAL:
if (p->subtype == 2)
type = "serial:callout";
else
type = "serial";
break;
case TTY_DRIVER_TYPE_PTY:
if (p->subtype == PTY_TYPE_MASTER)
type = "pty:master";
else if (p->subtype == PTY_TYPE_SLAVE)
type = "pty:slave";
else
type = "pty";
break;
default:
sprintf(deftype, "type:%d.%d", p->type, p->subtype);
type = deftype;
break;
}
len += sprintf(page+len, "%-20s /dev/%-8s %3d %7s %s\n",
p->driver_name ? p->driver_name : "",
p->name, p->major, range, type);
if (len+begin > off+count)
break;
if (len+begin < off) {
begin += len;
len = 0;
}
}
if (off >= len+begin)
return 0;
*start = page + (begin-off);
return ((count < begin+len-off) ? count : begin+len-off);
}
/*
* This is the handler for /proc/tty/ldiscs
*/
static int tty_ldiscs_read_proc(char *page, char **start, off_t off,
int count, void *data)
{
int i;
int len = 0;
off_t begin = 0;
for (i=0; i < NR_LDISCS; i++) {
if (!(ldiscs[i].flags & LDISC_FLAG_DEFINED))
continue;
len += sprintf(page+len, "%-10s %2d\n",
ldiscs[i].name ? ldiscs[i].name : "???", i);
if (len+begin > off+count)
break;
if (len+begin < off) {
begin += len;
len = 0;
}
}
if (off >= len+begin)
return 0;
*start = page + (begin-off);
return ((count < begin+len-off) ? count : begin+len-off);
}
/*
* Thsi function is called by register_tty_driver() to handle
* registering the driver's /proc handler into /proc/tty/driver/<foo>
*/
void proc_tty_register_driver(struct tty_driver *driver)
{
struct proc_dir_entry *ent;
if ((!driver->read_proc && !driver->write_proc) ||
!driver->driver_name ||
driver->proc_entry)
return;
ent = create_proc_entry(driver->driver_name, 0, proc_tty_driver);
if (!ent)
return;
ent->read_proc = driver->read_proc;
ent->write_proc = driver->write_proc;
ent->data = driver;
driver->proc_entry = ent;
}
/*
* This function is called by unregister_tty_driver()
*/
void proc_tty_unregister_driver(struct tty_driver *driver)
{
struct proc_dir_entry *ent;
ent = driver->proc_entry;
if (!ent)
return;
proc_unregister(proc_tty_driver, ent->low_ino);
driver->proc_entry = 0;
kfree(ent);
}
/*
* Called by proc_root_init() to initialize the /proc/tty subtree
*/
void proc_tty_init(void)
{
struct proc_dir_entry *ent;
proc_tty = create_proc_entry("tty", S_IFDIR, &proc_root);
if (!proc_tty)
return;
proc_tty_ldisc = create_proc_entry("ldisc", S_IFDIR, proc_tty);
proc_tty_driver = create_proc_entry("driver", S_IFDIR, proc_tty);
ent = create_proc_entry("ldiscs", 0, proc_tty);
ent->read_proc = tty_ldiscs_read_proc;
ent = create_proc_entry("drivers", 0, proc_tty);
ent->read_proc = tty_drivers_read_proc;
}
This diff is collapsed.
......@@ -53,7 +53,7 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int
* this is a new version of the above that records errors it finds in *errp,
* but continues and zeros the rest of the buffer.
*/
unsigned int csum_partial_copy_from_user(int *errp, char *src, char *dst, int len, unsigned int sum);
unsigned int csum_partial_copy_from_user(char *src, char *dst, int len, unsigned int sum, int *errp);
/*
* this routine is used for miscellaneous IP-like checksums, mainly
......
......@@ -122,6 +122,7 @@ struct termios {
#define B230400 0010003
#define B460800 0010004
#define CIBAUD 002003600000 /* input baud rate (not used) */
#define CMSPAR 010000000000 /* mark or space (stick) parity */
#define CRTSCTS 020000000000 /* flow control */
/* c_lflag bits */
......
......@@ -33,6 +33,8 @@ struct termio {
#define TIOCM_DSR 0x100
#define TIOCM_CD TIOCM_CAR
#define TIOCM_RI TIOCM_RNG
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
......
......@@ -223,6 +223,10 @@ struct proc_dir_entry {
void (*fill_inode)(struct inode *);
struct proc_dir_entry *next, *parent, *subdir;
void *data;
int (*read_proc)(char *page, char **start, off_t off,
int count, void *data);
int (*write_proc)(struct file *file, const char *buffer,
unsigned long count, void *data);
};
extern int (* dispatch_scsi_info_ptr) (int ino, char *buffer, char **start,
......@@ -327,6 +331,7 @@ extern int proc_openprom_regdev(struct openpromfs_dev *);
extern int proc_openprom_unregdev(struct openpromfs_dev *);
extern struct inode_operations proc_dir_inode_operations;
extern struct inode_operations proc_file_inode_operations;
extern struct inode_operations proc_net_inode_operations;
extern struct inode_operations proc_netdir_inode_operations;
extern struct inode_operations proc_scsi_inode_operations;
......@@ -344,3 +349,16 @@ extern struct inode_operations proc_fd_inode_operations;
extern struct inode_operations proc_ringbuf_inode_operations;
#endif
#endif
/*
* generic.c
*/
struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
struct proc_dir_entry *parent);
/*
* proc_tty.c
*/
extern void proc_tty_init(void);
extern void proc_tty_register_driver(struct tty_driver *driver);
extern void proc_tty_unregister_driver(struct tty_driver *driver);
......@@ -123,7 +123,10 @@ struct serial_multiport_struct {
*/
struct serial_icounter_struct {
int cts, dsr, rng, dcd;
int reserved[16];
int rx, tx;
int frame, overrun, parity, brk;
int buf_overrun;
int reserved[9];
};
......@@ -144,7 +147,9 @@ struct serial_icounter_struct {
* Counters of the input lines (CTS, DSR, RI, CD) interrupts
*/
struct async_icount {
__u32 cts, dsr, rng, dcd;
__u32 cts, dsr, rng, dcd, tx, rx;
__u32 frame, parity, overrun, brk;
__u32 buf_overrun;
};
struct serial_state {
......@@ -178,6 +183,7 @@ struct async_struct {
int read_status_mask;
int ignore_status_mask;
int timeout;
int quot;
int x_char; /* xon/xoff character */
int close_delay;
unsigned short closing_wait;
......@@ -235,5 +241,6 @@ struct rs_multiport_struct {
/* Export to allow PCMCIA to use this - Dave Hinds */
extern int register_serial(struct serial_struct *req);
extern void unregister_serial(int line);
#endif /* __KERNEL__ */
#endif /* _LINUX_SERIAL_H */
......@@ -328,13 +328,8 @@ extern struct tty_ldisc tty_ldisc_N_TTY;
extern int n_tty_ioctl(struct tty_struct * tty, struct file * file,
unsigned int cmd, unsigned long arg);
/* serial.c */
/* pcxx.c */
extern int rs_open(struct tty_struct * tty, struct file * filp);
/* pty.c */
extern int pty_open(struct tty_struct * tty, struct file * filp);
extern int pcxe_open(struct tty_struct *tty, struct file *filp);
/* console.c */
......
This diff is collapsed.
......@@ -102,6 +102,7 @@
struct tty_ldisc {
int magic;
char *name;
int num;
int flags;
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment