diff options
-rw-r--r-- | Documentation/serial/driver | 11 | ||||
-rw-r--r-- | drivers/serial/serial_core.c | 2 | ||||
-rw-r--r-- | include/linux/serial_core.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/serial/driver b/Documentation/serial/driver index 88ad615dd338..77ba0afbe4db 100644 --- a/Documentation/serial/driver +++ b/Documentation/serial/driver | |||
@@ -186,6 +186,17 @@ hardware. | |||
186 | Locking: port_sem taken. | 186 | Locking: port_sem taken. |
187 | Interrupts: caller dependent. | 187 | Interrupts: caller dependent. |
188 | 188 | ||
189 | flush_buffer(port) | ||
190 | Flush any write buffers, reset any DMA state and stop any | ||
191 | ongoing DMA transfers. | ||
192 | |||
193 | This will be called whenever the port->info->xmit circular | ||
194 | buffer is cleared. | ||
195 | |||
196 | Locking: port->lock taken. | ||
197 | Interrupts: locally disabled. | ||
198 | This call must not sleep | ||
199 | |||
189 | set_termios(port,termios,oldtermios) | 200 | set_termios(port,termios,oldtermios) |
190 | Change the port parameters, including word length, parity, stop | 201 | Change the port parameters, including word length, parity, stop |
191 | bits. Update read_status_mask and ignore_status_mask to indicate | 202 | bits. Update read_status_mask and ignore_status_mask to indicate |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 42d2e108b679..9884bc9eecb1 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -573,6 +573,8 @@ static void uart_flush_buffer(struct tty_struct *tty) | |||
573 | 573 | ||
574 | spin_lock_irqsave(&port->lock, flags); | 574 | spin_lock_irqsave(&port->lock, flags); |
575 | uart_circ_clear(&state->info->xmit); | 575 | uart_circ_clear(&state->info->xmit); |
576 | if (port->ops->flush_buffer) | ||
577 | port->ops->flush_buffer(port); | ||
576 | spin_unlock_irqrestore(&port->lock, flags); | 578 | spin_unlock_irqrestore(&port->lock, flags); |
577 | tty_wakeup(tty); | 579 | tty_wakeup(tty); |
578 | } | 580 | } |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index d8f31de632c5..1d2faa6592ae 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -190,6 +190,7 @@ struct uart_ops { | |||
190 | void (*break_ctl)(struct uart_port *, int ctl); | 190 | void (*break_ctl)(struct uart_port *, int ctl); |
191 | int (*startup)(struct uart_port *); | 191 | int (*startup)(struct uart_port *); |
192 | void (*shutdown)(struct uart_port *); | 192 | void (*shutdown)(struct uart_port *); |
193 | void (*flush_buffer)(struct uart_port *); | ||
193 | void (*set_termios)(struct uart_port *, struct ktermios *new, | 194 | void (*set_termios)(struct uart_port *, struct ktermios *new, |
194 | struct ktermios *old); | 195 | struct ktermios *old); |
195 | void (*set_ldisc)(struct uart_port *); | 196 | void (*set_ldisc)(struct uart_port *); |