Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial_core: uart_set_ldisc infrastructure

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.

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@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alan Cox and committed by
Linus Torvalds
64e9159f 4b34fe15

+11
+10
drivers/serial/serial_core.c
··· 1165 1165 return ret; 1166 1166 } 1167 1167 1168 + static void uart_set_ldisc(struct tty_struct *tty, int ldisc) 1169 + { 1170 + struct uart_state *state = tty->driver_data; 1171 + struct uart_port *port = state->port; 1172 + 1173 + if (port->ops->set_ldisc) 1174 + port->ops->set_ldisc(port); 1175 + } 1176 + 1168 1177 static void uart_set_termios(struct tty_struct *tty, 1169 1178 struct ktermios *old_termios) 1170 1179 { ··· 2297 2288 .unthrottle = uart_unthrottle, 2298 2289 .send_xchar = uart_send_xchar, 2299 2290 .set_termios = uart_set_termios, 2291 + .set_ldisc = uart_set_ldisc, 2300 2292 .stop = uart_stop, 2301 2293 .start = uart_start, 2302 2294 .hangup = uart_hangup,
+1
include/linux/serial_core.h
··· 192 192 void (*shutdown)(struct uart_port *); 193 193 void (*set_termios)(struct uart_port *, struct ktermios *new, 194 194 struct ktermios *old); 195 + void (*set_ldisc)(struct uart_port *); 195 196 void (*pm)(struct uart_port *, unsigned int state, 196 197 unsigned int oldstate); 197 198 int (*set_wake)(struct uart_port *, unsigned int state);