[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240225151426.1342285-1-jonas.gorski@gmail.com>
Date: Sun, 25 Feb 2024 16:14:25 +0100
From: Jonas Gorski <jonas.gorski@...il.com>
To: linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Florian Fainelli <florian.fainelli@...adcom.com>
Subject: [PATCH 1/2] serial: core: introduce uart_port_tx_limited_flags()
Analogue to uart_port_tx_flags() introduced in commit 3ee07964d407
("serial: core: introduce uart_port_tx_flags()"), add a _flags variant
for uart_port_tx_limited().
Fixes: d11cc8c3c4b6 ("tty: serial: use uart_port_tx_limited()")
Signed-off-by: Jonas Gorski <jonas.gorski@...il.com>
---
include/linux/serial_core.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 55b1f3ba48ac..e25e20034a19 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -825,6 +825,24 @@ enum UART_TX_FLAGS {
__count--); \
})
+/**
+ * uart_port_tx_limited_flags -- transmit helper for uart_port with count limiting with flags
+ * @port: uart port
+ * @ch: variable to store a character to be written to the HW
+ * @flags: %UART_TX_NOSTOP or similar
+ * @count: a limit of characters to send
+ * @tx_ready: can HW accept more data function
+ * @put_char: function to write a character
+ * @tx_done: function to call after the loop is done
+ *
+ * See uart_port_tx_limited() for more details.
+ */
+#define uart_port_tx_limited_flags(port, ch, flags, count, tx_ready, put_char, tx_done) ({ \
+ unsigned int __count = (count); \
+ __uart_port_tx(port, ch, flags, tx_ready, put_char, tx_done, __count, \
+ __count--); \
+})
+
/**
* uart_port_tx -- transmit helper for uart_port
* @port: uart port
--
2.34.1
Powered by blists - more mailing lists