X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Flinux%2Fserial_core.h;h=b4c21f84ad79c36d196227f25463778994498e28;hb=a12c689209185c1ad872723a644d0cd27e52d49c;hp=9e0a9d3793908072645ceb5b7e93cb9ceb2d283c;hpb=4c8928850c9dc5c849ee37d89a79d44a283bdd87;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 9e0a9d3..b4c21f8 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;