提交 afaae084 编写于 作者: A Alan Cox 提交者: Greg Kroah-Hartman

hci_ath: Fix the mess in this driver

Was this exploitable - who knows, but it was certainly totally broken
Signed-of-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 8d075b19
...@@ -51,32 +51,32 @@ struct ath_struct { ...@@ -51,32 +51,32 @@ struct ath_struct {
static int ath_wakeup_ar3k(struct tty_struct *tty) static int ath_wakeup_ar3k(struct tty_struct *tty)
{ {
struct termios settings; struct ktermios ktermios;
int status = tty->driver->ops->tiocmget(tty, NULL); int status = tty->driver->ops->tiocmget(tty);
if (status & TIOCM_CTS) if (status & TIOCM_CTS)
return status; return status;
/* Disable Automatic RTSCTS */ /* Disable Automatic RTSCTS */
n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings); memcpy(&ktermios, tty->termios, sizeof(ktermios));
settings.c_cflag &= ~CRTSCTS; ktermios.c_cflag &= ~CRTSCTS;
n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings); tty_set_termios(tty, &ktermios);
/* Clear RTS first */ /* Clear RTS first */
status = tty->driver->ops->tiocmget(tty, NULL); status = tty->driver->ops->tiocmget(tty);
tty->driver->ops->tiocmset(tty, NULL, 0x00, TIOCM_RTS); tty->driver->ops->tiocmset(tty, 0x00, TIOCM_RTS);
mdelay(20); mdelay(20);
/* Set RTS, wake up board */ /* Set RTS, wake up board */
status = tty->driver->ops->tiocmget(tty, NULL); status = tty->driver->ops->tiocmget(tty);
tty->driver->ops->tiocmset(tty, NULL, TIOCM_RTS, 0x00); tty->driver->ops->tiocmset(tty, TIOCM_RTS, 0x00);
mdelay(20); mdelay(20);
status = tty->driver->ops->tiocmget(tty, NULL); status = tty->driver->ops->tiocmget(tty);
n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings); /* Disable Automatic RTSCTS */
settings.c_cflag |= CRTSCTS; ktermios.c_cflag |= CRTSCTS;
n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings); status = tty_set_termios(tty, &ktermios);
return status; return status;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册