@@ -748,8 +748,17 @@ struct uart_driver {
748
748
749
749
void uart_write_wakeup (struct uart_port * port );
750
750
751
- #define __uart_port_tx (uport , ch , tx_ready , put_char , tx_done , for_test , \
752
- for_post ) \
751
+ /**
752
+ * enum UART_TX_FLAGS -- flags for uart_port_tx_flags()
753
+ *
754
+ * @UART_TX_NOSTOP: don't call port->ops->stop_tx() on empty buffer
755
+ */
756
+ enum UART_TX_FLAGS {
757
+ UART_TX_NOSTOP = BIT (0 ),
758
+ };
759
+
760
+ #define __uart_port_tx (uport , ch , flags , tx_ready , put_char , tx_done , \
761
+ for_test , for_post ) \
753
762
({ \
754
763
struct uart_port *__port = (uport); \
755
764
struct circ_buf *xmit = &__port->state->xmit; \
@@ -777,7 +786,7 @@ void uart_write_wakeup(struct uart_port *port);
777
786
if (pending < WAKEUP_CHARS) { \
778
787
uart_write_wakeup(__port); \
779
788
\
780
- if (pending == 0) \
789
+ if (!((flags) & UART_TX_NOSTOP) && pending == 0) \
781
790
__port->ops->stop_tx(__port); \
782
791
} \
783
792
\
@@ -812,7 +821,7 @@ void uart_write_wakeup(struct uart_port *port);
812
821
*/
813
822
#define uart_port_tx_limited (port , ch , count , tx_ready , put_char , tx_done ) ({ \
814
823
unsigned int __count = (count); \
815
- __uart_port_tx(port, ch, tx_ready, put_char, tx_done, __count, \
824
+ __uart_port_tx(port, ch, 0, tx_ready, put_char, tx_done, __count, \
816
825
__count--); \
817
826
})
818
827
@@ -826,8 +835,21 @@ void uart_write_wakeup(struct uart_port *port);
826
835
* See uart_port_tx_limited() for more details.
827
836
*/
828
837
#define uart_port_tx (port , ch , tx_ready , put_char ) \
829
- __uart_port_tx(port, ch, tx_ready, put_char, ({}), true, ({}))
838
+ __uart_port_tx(port, ch, 0, tx_ready, put_char, ({}), true, ({}))
839
+
830
840
841
+ /**
842
+ * uart_port_tx_flags -- transmit helper for uart_port with flags
843
+ * @port: uart port
844
+ * @ch: variable to store a character to be written to the HW
845
+ * @flags: %UART_TX_NOSTOP or similar
846
+ * @tx_ready: can HW accept more data function
847
+ * @put_char: function to write a character
848
+ *
849
+ * See uart_port_tx_limited() for more details.
850
+ */
851
+ #define uart_port_tx_flags (port , ch , flags , tx_ready , put_char ) \
852
+ __uart_port_tx(port, ch, flags, tx_ready, put_char, ({}), true, ({}))
831
853
/*
832
854
* Baud rate helpers.
833
855
*/
0 commit comments