Corrected the last issues
Signed-off-by: Sander van Ginkel <sander@van-ginkel.eu>
===================================================================
diff -pru linux-2.6.25-rc8.orig/drivers/char/pty.c
linux-2.6.25-rc8/drivers/char/pty.c
--- linux-2.6.25-rc8.orig/drivers/char/pty.c 2008-04-01
21:44:26.000000000 +0200
+++ linux-2.6.25-rc8/drivers/char/pty.c 2008-04-14 23:01:56.000000000
+0200
@@ -196,6 +196,7 @@ static void pty_flush_buffer(struct tty_
static int pty_open(struct tty_struct *tty, struct file * filp)
{
+ unsigned int *mcrmsr;
int retval = -ENODEV;
if (!tty || !tty->link)
@@ -212,11 +213,50 @@ static int pty_open(struct tty_struct *t
clear_bit(TTY_OTHER_CLOSED, &tty->link->flags);
set_bit(TTY_THROTTLED, &tty->flags);
set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
+
+ /* first time accessing this device, let's create it */
+
+ mcrmsr = kzalloc(sizeof(*mcrmsr), GFP_KERNEL);
+
+ if (mcrmsr != NULL) {
+
+ /* save our data within the tty structure */
+
+ *mcrmsr=0;
+
+ tty->driver_data = mcrmsr;
+ tty->link->driver_data = mcrmsr;
+ }
+ else
+ {
+ goto out;
+ }
+
retval = 0;
+
out:
return retval;
}
+static int pty_tiocmget(struct tty_struct *tty, struct file *file)
+{
+ unsigned int *mcrmsr;
+
+ mcrmsr = tty->driver_data;
+
+ return *mcrmsr;
+}
+
+static int pty_tiocmset(struct tty_struct *tty, struct file
*file,unsigned int set, unsigned int clear)
+{
+ unsigned int *mcrmsr;
+
+ mcrmsr = tty->driver_data;
+ *mcrmsr=set;
+
+ return 0;
+}
+
static void pty_set_termios(struct tty_struct *tty, struct ktermios
*old_termios)
{
tty->termios->c_cflag &= ~(CSIZE | PARENB);
@@ -232,6 +272,8 @@ static const struct tty_operations pty_o
.chars_in_buffer = pty_chars_in_buffer,
.unthrottle = pty_unthrottle,
.set_termios = pty_set_termios,
+ .tiocmget = pty_tiocmget,
+ .tiocmset = pty_tiocmset,
};
/* Traditional BSD devices */
@@ -364,11 +406,26 @@ static struct ctl_table pty_root_table[]
static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg)
{
+ unsigned int value;
+ unsigned int *mcrmsr;
+
+ mcrmsr=tty->driver_data;
+
switch (cmd) {
case TIOCSPTLCK: /* Set PT Lock (disallow slave open) */
return pty_set_lock(tty, (int __user *)arg);
case TIOCGPTN: /* Get PT Number */
return put_user(tty->index, (unsigned int __user *)arg);
+
+ case VMCRMSR: /* Set all of the handshake line, even the normally
read only */
+ {
+ if (copy_from_user(&value,(unsigned int *)arg,sizeof(unsigned
int)))
+ return -EFAULT;
+
+ *mcrmsr=value;
+
+ return 0;
+ }
}
return -ENOIOCTLCMD;
--
| Peter Zijlstra | Re: [15/17] SLUB: Support virtual fallback via SLAB_VFALLBACK |
| Christoph Lameter | Re: crash in kmem_cache_init |
| Greg Kroah-Hartman | [PATCH 017/196] aoechr: Convert from class_device to device |
| David Miller | Re: [patch 0/7] [RFC] SLUB: Improve allocpercpu to reduce per cpu access overhead |
git: | |
| Raimund Bauer | [wishlist] graphical diff |
| Johannes Schindelin | Re: A tour of git: the basics (and notes on some unfriendly messages) |
| Pazu | qgit on Mac OS X |
| pradeep singh rautela | Re: Why does git track directory listed in .gitignore/".git/info/exclude"? |
| Stephen Pierce | SLS |
| Theodore Ts'o | Re: demand paging: proposal |
| Dong Liu | Re: CXterm for LINUX |
| Marc G Fournier | Re: Reducing traffic on c.o.l.; splitting c.o.l |
| Markus Wernig | host to host ipsec link |
| Beavis | mutiple pptp pass-through PF |
| Todd Pytel | IDE or SCSI virtual disks for VMWare image? |
| Sam Fourman Jr. | Asus Striker Extreme does not support 4GB memory |
| magical mounts | 13 hours ago | Linux kernel |
| Problem in scim in Fedora 9 | 14 hours ago | Linux general |
| The new Western Digital power saving drives | 14 hours ago | Hardware |
| Battery Maximizer Software | 1 day ago | Linux kernel |
| windows folder creation surprise | 1 day ago | Windows |
| Firewall | 2 days ago | OpenBSD |
| IP layer send packet | 2 days ago | Linux kernel |
| dtrace for linux available | 3 days ago | Linux kernel |
| Unable to mount ramdisk image using UBoot while upgrading to 2.6.15 kernel for a MPC8540 based target | 3 days ago | Linux kernel |
| RealTek RTL8169 - can't connect | 3 days ago | NetBSD |
