Skip to content

Commit

Permalink
tty: Update serial core API documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Kevin Cernekee authored and Greg Kroah-Hartman committed Jan 16, 2013
1 parent ef4f527 commit e759d7c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
39 changes: 39 additions & 0 deletions Documentation/serial/driver
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ hardware.
Interrupts: locally disabled.
This call must not sleep

send_xchar(port,ch)
Transmit a high priority character, even if the port is stopped.
This is used to implement XON/XOFF flow control and tcflow(). If
the serial driver does not implement this function, the tty core
will append the character to the circular buffer and then call
start_tx() / stop_tx() to flush the data out.

Locking: none.
Interrupts: caller dependent.

stop_rx(port)
Stop receiving characters; the port is in the process of
being closed.
Expand Down Expand Up @@ -254,6 +264,10 @@ hardware.
Locking: none.
Interrupts: caller dependent.

set_wake(port,state)
Enable/disable power management wakeup on serial activity. Not
currently implemented.

type(port)
Return a pointer to a string constant describing the specified
port, or return NULL, in which case the string 'unknown' is
Expand Down Expand Up @@ -306,6 +320,31 @@ hardware.
Locking: none.
Interrupts: caller dependent.

poll_init(port)
Called by kgdb to perform the minimal hardware initialization needed
to support poll_put_char() and poll_get_char(). Unlike ->startup()
this should not request interrupts.

Locking: tty_mutex and tty_port->mutex taken.
Interrupts: n/a.

poll_put_char(port,ch)
Called by kgdb to write a single character directly to the serial
port. It can and should block until there is space in the TX FIFO.

Locking: none.
Interrupts: caller dependent.
This call must not sleep

poll_get_char(port)
Called by kgdb to read a single character directly from the serial
port. If data is available, it should be returned; otherwise
the function should return NO_POLL_CHAR immediately.

Locking: none.
Interrupts: caller dependent.
This call must not sleep

Other functions
---------------

Expand Down
8 changes: 4 additions & 4 deletions include/linux/serial_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ struct serial_struct;
struct device;

/*
* This structure describes all the operations that can be
* done on the physical hardware.
* This structure describes all the operations that can be done on the
* physical hardware. See Documentation/serial/driver for details.
*/
struct uart_ops {
unsigned int (*tx_empty)(struct uart_port *);
Expand All @@ -65,7 +65,7 @@ struct uart_ops {
/*
* Return a string describing the type of the port
*/
const char *(*type)(struct uart_port *);
const char *(*type)(struct uart_port *);

/*
* Release IO and memory resources used by the port.
Expand All @@ -83,7 +83,7 @@ struct uart_ops {
int (*ioctl)(struct uart_port *, unsigned int, unsigned long);
#ifdef CONFIG_CONSOLE_POLL
int (*poll_init)(struct uart_port *);
void (*poll_put_char)(struct uart_port *, unsigned char);
void (*poll_put_char)(struct uart_port *, unsigned char);
int (*poll_get_char)(struct uart_port *);
#endif
};
Expand Down

0 comments on commit e759d7c

Please sign in to comment.