aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/uart/uart_if.m
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2024-01-12 22:27:07 +0000
committerMarius Strobl <marius@FreeBSD.org>2024-01-18 20:14:46 +0000
commit8595e76a9f1a5bcf057afe6d28846099287a26b7 (patch)
tree59dd420bfc59a2db53bbc90d3f76d0323b586bce /sys/dev/uart/uart_if.m
parent6d150c4c3f0258b7d0fbaf0375b328b6ae84a169 (diff)
Diffstat (limited to 'sys/dev/uart/uart_if.m')
-rw-r--r--sys/dev/uart/uart_if.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_if.m b/sys/dev/uart/uart_if.m
index 516e8b0811df..7efe63a10248 100644
--- a/sys/dev/uart/uart_if.m
+++ b/sys/dev/uart/uart_if.m
@@ -38,6 +38,17 @@
INTERFACE uart;
+CODE {
+ static uart_txbusy_t uart_default_txbusy;
+
+ static bool
+ uart_default_txbusy(struct uart_softc *this __unused)
+ {
+
+ return (false);
+ }
+};
+
# attach() - attach hardware.
# This method is called when the device is being attached. All resources
# have been allocated. The transmit and receive buffers exist, but no
@@ -141,6 +152,16 @@ METHOD int transmit {
struct uart_softc *this;
};
+# txbusy() - report if Tx is still busy.
+# This method is called by the tty glue for reporting upward that output is
+# still being drained despite sc_txbusy unset. Non-DEFAULT implementations
+# allow for extra checks, i. e. beyond what can be determined in ipend(),
+# that the Tx path actually is idle. For example, whether the last character
+# has left the transmit shift register in addition to the FIFO being empty.
+METHOD bool txbusy {
+ struct uart_softc *this;
+} DEFAULT uart_default_txbusy;
+
# grab() - Up call from the console to the upper layers of the driver when
# the kernel asks to grab the console. This is valid only for console
# drivers. This method is responsible for transitioning the hardware