diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-09-25 10:22:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-09-25 10:22:13 +0300 |
commit | a12c689209185c1ad872723a644d0cd27e52d49c (patch) | |
tree | 11c01d147a9241561eb7a3ad5a999e234be2750c /include/linux/serial_core.h | |
parent | 4c8928850c9dc5c849ee37d89a79d44a283bdd87 (diff) | |
parent | 7e2cd21e02b35483ce8ea88da5732d4d3ec3a6c9 (diff) | |
download | linux-a12c689209185c1ad872723a644d0cd27e52d49c.tar.xz |
Merge 7e2cd21e02b3 ("Merge tag 'tty-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty") into tty-next
We need the tty fixes and api additions in this branch.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/serial_core.h')
-rw-r--r-- | include/linux/serial_core.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 9e0a9d379390..b4c21f84ad79 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -625,6 +625,23 @@ struct uart_state { /* number of characters left in xmit buffer before we ask for more */ #define WAKEUP_CHARS 256 +/** + * uart_xmit_advance - Advance xmit buffer and account Tx'ed chars + * @up: uart_port structure describing the port + * @chars: number of characters sent + * + * This function advances the tail of circular xmit buffer by the number of + * @chars transmitted and handles accounting of transmitted bytes (into + * @up's icount.tx). + */ +static inline void uart_xmit_advance(struct uart_port *up, unsigned int chars) +{ + struct circ_buf *xmit = &up->state->xmit; + + xmit->tail = (xmit->tail + chars) & (UART_XMIT_SIZE - 1); + up->icount.tx += chars; +} + struct module; struct tty_driver; |