diff options
author | Len Brown <len.brown@intel.com> | 2006-01-27 17:18:29 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-01-27 17:18:29 -0500 |
commit | 292dd876ee765c478b27c93cc51e93a558ed58bf (patch) | |
tree | 5b740e93253295baee2a9c414a6c66d03d44a9ef /drivers/s390/char | |
parent | d4ec6c7cc9a15a7a529719bc3b84f46812f9842e (diff) | |
parent | 9fdb62af92c741addbea15545f214a6e89460865 (diff) | |
download | linux-292dd876ee765c478b27c93cc51e93a558ed58bf.tar.gz linux-292dd876ee765c478b27c93cc51e93a558ed58bf.tar.bz2 linux-292dd876ee765c478b27c93cc51e93a558ed58bf.zip |
Pull release into acpica branch
Diffstat (limited to 'drivers/s390/char')
-rw-r--r-- | drivers/s390/char/con3215.c | 25 | ||||
-rw-r--r-- | drivers/s390/char/fs3270.c | 20 | ||||
-rw-r--r-- | drivers/s390/char/sclp_tty.c | 21 | ||||
-rw-r--r-- | drivers/s390/char/sclp_vt220.c | 12 | ||||
-rw-r--r-- | drivers/s390/char/tape_char.c | 20 |
5 files changed, 49 insertions, 49 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 75419cf9d353..1f060914cfa4 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c @@ -16,6 +16,7 @@ #include <linux/types.h> #include <linux/kdev_t.h> #include <linux/tty.h> +#include <linux/tty_flip.h> #include <linux/vt_kern.h> #include <linux/init.h> #include <linux/console.h> @@ -432,8 +433,6 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) if (count > slen) count = slen; } else - if (count >= TTY_FLIPBUF_SIZE - tty->flip.count) - count = TTY_FLIPBUF_SIZE - tty->flip.count - 1; EBCASC(raw->inbuf, count); cchar = ctrlchar_handle(raw->inbuf, count, tty); switch (cchar & CTRLCHAR_MASK) { @@ -441,28 +440,20 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) break; case CTRLCHAR_CTRL: - tty->flip.count++; - *tty->flip.flag_buf_ptr++ = TTY_NORMAL; - *tty->flip.char_buf_ptr++ = cchar; + tty_insert_flip_char(tty, cchar, TTY_NORMAL); tty_flip_buffer_push(raw->tty); break; case CTRLCHAR_NONE: - memcpy(tty->flip.char_buf_ptr, - raw->inbuf, count); if (count < 2 || - (strncmp(raw->inbuf+count-2, "^n", 2) && - strncmp(raw->inbuf+count-2, "\252n", 2)) ) { - /* don't add the auto \n */ - tty->flip.char_buf_ptr[count] = '\n'; - memset(tty->flip.flag_buf_ptr, - TTY_NORMAL, count + 1); + (strncmp(raw->inbuf+count-2, "\252n", 2) && + strncmp(raw->inbuf+count-2, "^n", 2)) ) { + /* add the auto \n */ + raw->inbuf[count] = '\n'; count++; } else - count-=2; - tty->flip.char_buf_ptr += count; - tty->flip.flag_buf_ptr += count; - tty->flip.count += count; + count -= 2; + tty_insert_flip_string(tty, raw->inbuf, count); tty_flip_buffer_push(raw->tty); break; } diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index 735a7fcdeff5..5f6fa4c67843 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c @@ -319,9 +319,8 @@ fs3270_write(struct file *filp, const char *data, size_t count, loff_t *off) /* * process ioctl commands for the tube driver */ -static int -fs3270_ioctl(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg) +static long +fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct fs3270 *fp; struct raw3270_iocb iocb; @@ -331,6 +330,7 @@ fs3270_ioctl(struct inode *inode, struct file *filp, if (!fp) return -ENODEV; rc = 0; + lock_kernel(); switch (cmd) { case TUBICMD: fp->read_command = arg; @@ -356,6 +356,7 @@ fs3270_ioctl(struct inode *inode, struct file *filp, rc = -EFAULT; break; } + unlock_kernel(); return rc; } @@ -491,12 +492,13 @@ fs3270_close(struct inode *inode, struct file *filp) } static struct file_operations fs3270_fops = { - .owner = THIS_MODULE, /* owner */ - .read = fs3270_read, /* read */ - .write = fs3270_write, /* write */ - .ioctl = fs3270_ioctl, /* ioctl */ - .open = fs3270_open, /* open */ - .release = fs3270_close, /* release */ + .owner = THIS_MODULE, /* owner */ + .read = fs3270_read, /* read */ + .write = fs3270_write, /* write */ + .unlocked_ioctl = fs3270_ioctl, /* ioctl */ + .compat_ioctl = fs3270_ioctl, /* ioctl */ + .open = fs3270_open, /* open */ + .release = fs3270_close, /* release */ }; /* diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c index a20d7c89341d..6cbf067f1a8f 100644 --- a/drivers/s390/char/sclp_tty.c +++ b/drivers/s390/char/sclp_tty.c @@ -13,6 +13,7 @@ #include <linux/kmod.h> #include <linux/tty.h> #include <linux/tty_driver.h> +#include <linux/tty_flip.h> #include <linux/sched.h> #include <linux/wait.h> #include <linux/slab.h> @@ -496,25 +497,19 @@ sclp_tty_input(unsigned char* buf, unsigned int count) case CTRLCHAR_SYSRQ: break; case CTRLCHAR_CTRL: - sclp_tty->flip.count++; - *sclp_tty->flip.flag_buf_ptr++ = TTY_NORMAL; - *sclp_tty->flip.char_buf_ptr++ = cchar; + tty_insert_flip_char(sclp_tty, cchar, TTY_NORMAL); tty_flip_buffer_push(sclp_tty); break; case CTRLCHAR_NONE: /* send (normal) input to line discipline */ - memcpy(sclp_tty->flip.char_buf_ptr, buf, count); if (count < 2 || - (strncmp ((const char *) buf + count - 2, "^n", 2) && - strncmp ((const char *) buf + count - 2, "\0252n", 2))) { - sclp_tty->flip.char_buf_ptr[count] = '\n'; - count++; + (strncmp((const char *) buf + count - 2, "^n", 2) && + strncmp((const char *) buf + count - 2, "\252n", 2))) { + /* add the auto \n */ + tty_insert_flip_string(sclp_tty, buf, count); + tty_insert_flip_char(sclp_tty, '\n', TTY_NORMAL); } else - count -= 2; - memset(sclp_tty->flip.flag_buf_ptr, TTY_NORMAL, count); - sclp_tty->flip.char_buf_ptr += count; - sclp_tty->flip.flag_buf_ptr += count; - sclp_tty->flip.count += count; + tty_insert_flip_string(sclp_tty, buf, count - 2); tty_flip_buffer_push(sclp_tty); break; } diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index 06bd85824d7b..9e02625c82cf 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c @@ -16,6 +16,7 @@ #include <linux/kernel.h> #include <linux/tty.h> #include <linux/tty_driver.h> +#include <linux/tty_flip.h> #include <linux/sched.h> #include <linux/errno.h> #include <linux/mm.h> @@ -482,16 +483,7 @@ sclp_vt220_receiver_fn(struct evbuf_header *evbuf) /* Send input to line discipline */ buffer++; count--; - /* Prevent buffer overrun by discarding input. Note that - * because buffer_push works asynchronously, we cannot wait - * for the buffer to be emptied. */ - if (count + sclp_vt220_tty->flip.count > TTY_FLIPBUF_SIZE) - count = TTY_FLIPBUF_SIZE - sclp_vt220_tty->flip.count; - memcpy(sclp_vt220_tty->flip.char_buf_ptr, buffer, count); - memset(sclp_vt220_tty->flip.flag_buf_ptr, TTY_NORMAL, count); - sclp_vt220_tty->flip.char_buf_ptr += count; - sclp_vt220_tty->flip.flag_buf_ptr += count; - sclp_vt220_tty->flip.count += count; + tty_insert_flip_string(sclp_vt220_tty, buffer, count); tty_flip_buffer_push(sclp_vt220_tty); break; } diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 86262a13f7c6..5ce7ca38ace0 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c @@ -37,6 +37,8 @@ static int tapechar_open(struct inode *,struct file *); static int tapechar_release(struct inode *,struct file *); static int tapechar_ioctl(struct inode *, struct file *, unsigned int, unsigned long); +static long tapechar_compat_ioctl(struct file *, unsigned int, + unsigned long); static struct file_operations tape_fops = { @@ -44,6 +46,7 @@ static struct file_operations tape_fops = .read = tapechar_read, .write = tapechar_write, .ioctl = tapechar_ioctl, + .compat_ioctl = tapechar_compat_ioctl, .open = tapechar_open, .release = tapechar_release, }; @@ -463,6 +466,23 @@ tapechar_ioctl(struct inode *inp, struct file *filp, return device->discipline->ioctl_fn(device, no, data); } +static long +tapechar_compat_ioctl(struct file *filp, unsigned int no, unsigned long data) +{ + struct tape_device *device = filp->private_data; + int rval = -ENOIOCTLCMD; + + if (device->discipline->ioctl_fn) { + lock_kernel(); + rval = device->discipline->ioctl_fn(device, no, data); + unlock_kernel(); + if (rval == -EINVAL) + rval = -ENOIOCTLCMD; + } + + return rval; +} + /* * Initialize character device frontend. */ |