summaryrefslogtreecommitdiff
path: root/Documentation/tty
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2021-11-26 09:16:09 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-26 16:27:43 +0100
commitf3e7614732b064942f56cdcee3bb23a9243c2e00 (patch)
tree24b655edd45e9b4ebbb510c0122e9911e6d3f30d /Documentation/tty
parent6f0535866199f8d9426b92c0e5c75866a49661fe (diff)
tty: more kernel-doc for tty_ldisc
Extend and highlight tty_ldisc documentation for kernel-doc even more. We don't need to describe tty_ldisc_ref* functions again. Instead, just include their kernel-doc from code. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20211126081611.11001-22-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/tty')
-rw-r--r--Documentation/tty/tty_ldisc.rst42
1 files changed, 19 insertions, 23 deletions
diff --git a/Documentation/tty/tty_ldisc.rst b/Documentation/tty/tty_ldisc.rst
index 69dee9ca6540..65885d97595c 100644
--- a/Documentation/tty/tty_ldisc.rst
+++ b/Documentation/tty/tty_ldisc.rst
@@ -28,6 +28,12 @@ enter and exit although this detail matters not).
.. kernel-doc:: drivers/tty/tty_ldisc.c
:identifiers: tty_register_ldisc tty_unregister_ldisc
+Other Functions
+===============
+
+.. kernel-doc:: drivers/tty/tty_ldisc.c
+ :identifiers: tty_set_ldisc tty_ldisc_flush
+
Line Discipline Operations Reference
====================================
@@ -53,31 +59,21 @@ Callers to the line discipline functions from the tty layer are required to
take line discipline locks. The same is true of calls from the driver side
but not yet enforced.
-Three calls are now provided::
-
- ldisc = tty_ldisc_ref(tty);
-
-takes a handle to the line discipline in the tty and returns it. If no ldisc
-is currently attached or the ldisc is being closed and re-opened at this
-point then NULL is returned. While this handle is held the ldisc will not
-change or go away::
-
- tty_ldisc_deref(ldisc)
-
-Returns the ldisc reference and allows the ldisc to be closed. Returning the
-reference takes away your right to call the ldisc functions until you take
-a new reference::
-
- ldisc = tty_ldisc_ref_wait(tty);
-
-Performs the same function as tty_ldisc_ref except that it will wait for an
-ldisc change to complete and then return a reference to the new ldisc.
+.. kernel-doc:: drivers/tty/tty_ldisc.c
+ :identifiers: tty_ldisc_ref_wait tty_ldisc_ref tty_ldisc_deref
While these functions are slightly slower than the old code they should have
minimal impact as most receive logic uses the flip buffers and they only
need to take a reference when they push bits up through the driver.
-A caution: The ldisc->open(), ldisc->close() and driver->set_ldisc
-functions are called with the ldisc unavailable. Thus tty_ldisc_ref will
-fail in this situation if used within these functions. Ldisc and driver
-code calling its own functions must be careful in this case.
+A caution: The :c:member:`tty_ldisc_ops.open()`,
+:c:member:`tty_ldisc_ops.close()` and :c:member:`tty_driver.set_ldisc()`
+functions are called with the ldisc unavailable. Thus tty_ldisc_ref() will fail
+in this situation if used within these functions. Ldisc and driver code
+calling its own functions must be careful in this case.
+
+Internal Functions
+==================
+
+.. kernel-doc:: drivers/tty/tty_ldisc.c
+ :internal: