lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 3 Jun 2008 15:18:54 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	gyang <graf.yang@...log.com>
Cc:	Bryan Wu <cooloney@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	torvalds@...l.org
Subject: [PATCH] serial_core: uart_set_ldisc (Was Re: Blackfin Serial
 Driver: Enable IR function when user application (irattach /dev/ttyBFx -s)
 call TIOCSETD ioctl with line discipline N_IRDA)

On Tue, 03 Jun 2008 10:18:46 +0800
gyang <graf.yang@...log.com> wrote:

> Hi, Alan,
> 
> Have the set_ldisc operator been put into main tree?

It's been in for ages. The Uart level one seems to have gotten stuck. Let
me poke that again
--

The tty layer provides a callback that is used when the line discipline
is changed. Some hardware uses this to configure hardware specific
features such as IrDA mode on serial ports. Unfortunately the serial
layer does not provide this feature or pass it down to drivers.

Blackfin used to hack around this by rewriting the tty ops, but those are
now properly shared and const so the hack fails. Instead provide the
proper operations.

Linus: This change plus a follow up from the Blackfin guys is needed to
avoid blackfin losing features in this release.

Signed-off-by: Alan Cox <alan@...hat.com>

diff -u --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.26-rc2/drivers/serial/serial_core.c linux-2.6.26-rc2/drivers/serial/serial_core.c
--- linux.vanilla-2.6.26-rc2/drivers/serial/serial_core.c	2008-05-12 12:09:06.000000000 +0100
+++ linux-2.6.26-rc2/drivers/serial/serial_core.c	2008-06-03 15:09:52.000000000 +0100
@@ -1165,6 +1166,15 @@
 	return ret;
 }
 
+static void uart_set_ldisc(struct tty_struct *tty, int ldisc)
+{
+	struct uart_state *state = tty->driver_data;
+	struct uart_port *port = state->port;
+
+	if (port->ops->set_ldisc)
+		port->ops->set_ldisc(port);
+}
+
 static void uart_set_termios(struct tty_struct *tty,
 						struct ktermios *old_termios)
 {
@@ -2285,6 +2298,7 @@
 	.unthrottle	= uart_unthrottle,
 	.send_xchar	= uart_send_xchar,
 	.set_termios	= uart_set_termios,
+	.set_ldisc	= uart_set_ldisc,
 	.stop		= uart_stop,
 	.start		= uart_start,
 	.hangup		= uart_hangup,
diff -u --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.26-rc2/include/linux/serial_core.h linux-2.6.26-rc2/include/linux/serial_core.h
--- linux.vanilla-2.6.26-rc2/include/linux/serial_core.h	2008-05-12 12:09:08.000000000 +0100
+++ linux-2.6.26-rc2/include/linux/serial_core.h	2008-06-03 15:08:28.000000000 +0100
@@ -192,6 +192,7 @@
 	void		(*shutdown)(struct uart_port *);
 	void		(*set_termios)(struct uart_port *, struct ktermios *new,
 				       struct ktermios *old);
+	void		(*set_ldisc)(struct uart_port *);
 	void		(*pm)(struct uart_port *, unsigned int state,
 			      unsigned int oldstate);
 	int		(*set_wake)(struct uart_port *, unsigned int state);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ