XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions | Variables
serial_core.h File Reference
#include <linux/bitops.h>
#include <linux/compiler.h>
#include <linux/console.h>
#include <linux/interrupt.h>
#include <linux/lockdep.h>
#include <linux/printk.h>
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/mutex.h>
#include <linux/sysrq.h>
#include <linux/serial.h>
Include dependency graph for serial_core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uart_ops
 
struct  uart_icount
 
struct  uart_port
 
struct  uart_state
 
struct  uart_driver
 
struct  earlycon_device
 
struct  earlycon_id
 

Macros

#define _UAPILINUX_SERIAL_CORE_H
 
#define PORT_NS16550A   14
 
#define PORT_XSCALE   15
 
#define PORT_RM9000   16 /* PMC-Sierra RM9xxx internal UART */
 
#define PORT_OCTEON   17 /* Cavium OCTEON internal UART */
 
#define PORT_AR7   18 /* Texas Instruments AR7 internal UART */
 
#define PORT_U6_16550A   19 /* ST-Ericsson U6xxx internal UART */
 
#define PORT_TEGRA   20 /* NVIDIA Tegra internal UART */
 
#define PORT_XR17D15X   21 /* Exar XR17D15x UART */
 
#define PORT_LPC3220   22 /* NXP LPC32xx SoC "Standard" UART */
 
#define PORT_8250_CIR   23 /* CIR infrared port, has its own driver */
 
#define PORT_XR17V35X   24 /* Exar XR17V35x UARTs */
 
#define PORT_BRCM_TRUMANAGE   25
 
#define PORT_ALTR_16550_F32   26 /* Altera 16550 UART with 32 FIFOs */
 
#define PORT_ALTR_16550_F64   27 /* Altera 16550 UART with 64 FIFOs */
 
#define PORT_ALTR_16550_F128   28 /* Altera 16550 UART with 128 FIFOs */
 
#define PORT_RT2880   29 /* Ralink RT2880 internal UART */
 
#define PORT_16550A_FSL64   30 /* Freescale 16550 UART with 64 FIFOs */
 
#define PORT_PXA   31
 
#define PORT_AMBA   32
 
#define PORT_CLPS711X   33
 
#define PORT_SA1100   34
 
#define PORT_UART00   35
 
#define PORT_OWL   36
 
#define PORT_21285   37
 
#define PORT_SUNZILOG   38
 
#define PORT_SUNSAB   39
 
#define PORT_NPCM   40
 
#define PORT_TEGRA_TCU   41
 
#define PORT_ASPEED_VUART   42
 
#define PORT_PCH_8LINE   44
 
#define PORT_PCH_2LINE   45
 
#define PORT_DZ   46
 
#define PORT_ZS   47
 
#define PORT_MUX   48
 
#define PORT_ATMEL   49
 
#define PORT_MAC_ZILOG   50 /* m68k : not yet implemented */
 
#define PORT_PMAC_ZILOG   51
 
#define PORT_SCI   52
 
#define PORT_SCIF   53
 
#define PORT_IRDA   54
 
#define PORT_IP22ZILOG   56
 
#define PORT_CPM   58
 
#define PORT_MPC52xx   59
 
#define PORT_ICOM   60
 
#define PORT_IMX   62
 
#define PORT_TXX9   64
 
#define PORT_JSM   69
 
#define PORT_SUNHV   72
 
#define PORT_UARTLITE   74
 
#define PORT_BCM7271   76
 
#define PORT_SB1250_DUART   77
 
#define PORT_MCF   78
 
#define PORT_SC26XX   82
 
#define PORT_SCIFA   83
 
#define PORT_S3C6400   84
 
#define PORT_MAX3100   86
 
#define PORT_TIMBUART   87
 
#define PORT_MSM   88
 
#define PORT_BCM63XX   89
 
#define PORT_APBUART   90
 
#define PORT_ALTERA_JTAGUART   91
 
#define PORT_ALTERA_UART   92
 
#define PORT_SCIFB   93
 
#define PORT_MAX310X   94
 
#define PORT_DA830   95
 
#define PORT_OMAP   96
 
#define PORT_VT8500   97
 
#define PORT_XUARTPS   98
 
#define PORT_AR933X   99
 
#define PORT_MCHP16550A   100
 
#define PORT_ARC   101
 
#define PORT_RP2   102
 
#define PORT_LPUART   103
 
#define PORT_HSCIF   104
 
#define PORT_ASC   105
 
#define PORT_MEN_Z135   107
 
#define PORT_SC16IS7XX   108
 
#define PORT_MESON   109
 
#define PORT_DIGICOLOR   110
 
#define PORT_SPRD   111
 
#define PORT_STM32   113
 
#define PORT_MVEBU   114
 
#define PORT_PIC32   115
 
#define PORT_MPS2UART   116
 
#define PORT_MTK_BTIF   117
 
#define PORT_RDA   118
 
#define PORT_MLB_USIO   119
 
#define PORT_SIFIVE_V0   120
 
#define PORT_SUNIX   121
 
#define PORT_LINFLEXUART   122
 
#define PORT_SUNPLUS   123
 
#define PORT_GENERIC   (-1)
 
#define uart_console(port)   ({ (void)port; 0; })
 
#define NO_POLL_CHAR   0x00ff0000
 
#define UART_CONFIG_TYPE   (1 << 0)
 
#define UART_CONFIG_IRQ   (1 << 1)
 
#define UPQ_NO_TXEN_TEST   BIT(0)
 
#define UPF_FOURPORT   0
 
#define UPF_SAK   ((__force upf_t) ASYNC_SAK /* 2 */ )
 
#define UPF_SPD_HI   ((__force upf_t) ASYNC_SPD_HI /* 4 */ )
 
#define UPF_SPD_VHI   ((__force upf_t) ASYNC_SPD_VHI /* 5 */ )
 
#define UPF_SPD_CUST   ((__force upf_t) ASYNC_SPD_CUST /* 0x0030 */ )
 
#define UPF_SPD_WARP   ((__force upf_t) ASYNC_SPD_WARP /* 0x1010 */ )
 
#define UPF_SPD_MASK   ((__force upf_t) ASYNC_SPD_MASK /* 0x1030 */ )
 
#define UPF_SKIP_TEST   ((__force upf_t) ASYNC_SKIP_TEST /* 6 */ )
 
#define UPF_AUTO_IRQ   ((__force upf_t) ASYNC_AUTO_IRQ /* 7 */ )
 
#define UPF_HARDPPS_CD   ((__force upf_t) ASYNC_HARDPPS_CD /* 11 */ )
 
#define UPF_SPD_SHI   ((__force upf_t) ASYNC_SPD_SHI /* 12 */ )
 
#define UPF_LOW_LATENCY   ((__force upf_t) ASYNC_LOW_LATENCY /* 13 */ )
 
#define UPF_BUGGY_UART   ((__force upf_t) ASYNC_BUGGY_UART /* 14 */ )
 
#define UPF_MAGIC_MULTIPLIER   ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ )
 
#define UPF_NO_THRE_TEST   ((__force upf_t) BIT_ULL(19))
 
#define UPF_AUTO_CTS   ((__force upf_t) BIT_ULL(20))
 
#define UPF_AUTO_RTS   ((__force upf_t) BIT_ULL(21))
 
#define UPF_HARD_FLOW   ((__force upf_t) (UPF_AUTO_CTS | UPF_AUTO_RTS))
 
#define UPF_SOFT_FLOW   ((__force upf_t) BIT_ULL(22))
 
#define UPF_CONS_FLOW   ((__force upf_t) BIT_ULL(23))
 
#define UPF_SHARE_IRQ   ((__force upf_t) BIT_ULL(24))
 
#define UPF_EXAR_EFR   ((__force upf_t) BIT_ULL(25))
 
#define UPF_BUG_THRE   ((__force upf_t) BIT_ULL(26))
 
#define UPF_FIXED_TYPE   ((__force upf_t) BIT_ULL(27))
 
#define UPF_BOOT_AUTOCONF   ((__force upf_t) BIT_ULL(28))
 
#define UPF_FIXED_PORT   ((__force upf_t) BIT_ULL(29))
 
#define UPF_DEAD   ((__force upf_t) BIT_ULL(30))
 
#define UPF_IOREMAP   ((__force upf_t) BIT_ULL(31))
 
#define UPF_FULL_PROBE   ((__force upf_t) BIT_ULL(32))
 
#define __UPF_CHANGE_MASK   0x17fff
 
#define UPF_CHANGE_MASK   ((__force upf_t) __UPF_CHANGE_MASK)
 
#define UPF_USR_MASK   ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY))
 
#define UPSTAT_CTS_ENABLE   ((__force upstat_t) (1 << 0))
 
#define UPSTAT_DCD_ENABLE   ((__force upstat_t) (1 << 1))
 
#define UPSTAT_AUTORTS   ((__force upstat_t) (1 << 2))
 
#define UPSTAT_AUTOCTS   ((__force upstat_t) (1 << 3))
 
#define UPSTAT_AUTOXOFF   ((__force upstat_t) (1 << 4))
 
#define UPSTAT_SYNC_FIFO   ((__force upstat_t) (1 << 5))
 
#define UART_XMIT_SIZE   PAGE_SIZE
 
#define WAKEUP_CHARS   256
 
#define __uart_port_tx(uport, ch, flags, tx_ready, put_char, tx_done, for_test, for_post)
 
#define uart_port_tx_limited(port, ch, count, tx_ready, put_char, tx_done)
 
#define uart_port_tx_limited_flags(port, ch, flags, count, tx_ready, put_char, tx_done)
 
#define uart_port_tx(port, ch, tx_ready, put_char)    __uart_port_tx(port, ch, 0, tx_ready, put_char, ({}), true, ({}))
 
#define uart_port_tx_flags(port, ch, flags, tx_ready, put_char)    __uart_port_tx(port, ch, flags, tx_ready, put_char, ({}), true, ({}))
 
#define EARLYCON_USED_OR_UNUSED   __maybe_unused
 
#define OF_EARLYCON_DECLARE(_name, compat, fn)
 
#define EARLYCON_DECLARE(_name, fn)   OF_EARLYCON_DECLARE(_name, "", fn)
 
#define UART_ENABLE_MS(port, cflag)
 

Typedefs

typedef u64 __bitwise upf_t
 
typedef unsigned int __bitwise upstat_t
 

Enumerations

enum  uart_iotype {
  UPIO_UNKNOWN = -1 , UPIO_PORT = SERIAL_IO_PORT , UPIO_HUB6 = SERIAL_IO_HUB6 , UPIO_MEM = SERIAL_IO_MEM ,
  UPIO_MEM32 = SERIAL_IO_MEM32 , UPIO_AU = SERIAL_IO_AU , UPIO_TSI = SERIAL_IO_TSI , UPIO_MEM32BE = SERIAL_IO_MEM32BE ,
  UPIO_MEM16 = SERIAL_IO_MEM16
}
 
enum  uart_pm_state { UART_PM_STATE_ON = 0 , UART_PM_STATE_OFF = 3 , UART_PM_STATE_UNDEFINED }
 
enum  UART_TX_FLAGS { UART_TX_NOSTOP = BIT(0) }
 

Functions

 DEFINE_GUARD (uart_port_lock, struct uart_port *, uart_port_lock(_T), uart_port_unlock(_T))
 
 DEFINE_GUARD (uart_port_lock_irq, struct uart_port *, uart_port_lock_irq(_T), uart_port_unlock_irq(_T))
 
 DEFINE_LOCK_GUARD_1 (uart_port_lock_irqsave, struct uart_port, uart_port_lock_irqsave(_T->lock, &_T->flags), uart_port_unlock_irqrestore(_T->lock, _T->flags), unsigned long flags)
 
void uart_write_wakeup (struct uart_port *port)
 
void uart_update_timeout (struct uart_port *port, unsigned int cflag, unsigned int baud)
 
unsigned int uart_get_baud_rate (struct uart_port *port, struct ktermios *termios, const struct ktermios *old, unsigned int min, unsigned int max)
 
unsigned int uart_get_divisor (struct uart_port *port, unsigned int baud)
 
int of_setup_earlycon (const struct earlycon_id *match, unsigned long node, const char *options)
 
int uart_parse_earlycon (char *p, enum uart_iotype *iotype, resource_size_t *addr, char **options)
 
void uart_parse_options (const char *options, int *baud, int *parity, int *bits, int *flow)
 
int uart_set_options (struct uart_port *port, struct console *co, int baud, int parity, int bits, int flow)
 
struct tty_driver * uart_console_device (struct console *co, int *index)
 
void uart_console_write (struct uart_port *port, const char *s, unsigned int count, void(*putchar)(struct uart_port *, unsigned char))
 
int uart_register_driver (struct uart_driver *uart)
 
void uart_unregister_driver (struct uart_driver *uart)
 
int uart_add_one_port (struct uart_driver *reg, struct uart_port *port)
 
void uart_remove_one_port (struct uart_driver *reg, struct uart_port *port)
 
int uart_read_port_properties (struct uart_port *port)
 
int uart_read_and_validate_port_properties (struct uart_port *port)
 
bool uart_match_port (const struct uart_port *port1, const struct uart_port *port2)
 
int uart_suspend_port (struct uart_driver *reg, struct uart_port *port)
 
int uart_resume_port (struct uart_driver *reg, struct uart_port *port)
 
void uart_handle_dcd_change (struct uart_port *uport, bool active)
 
void uart_handle_cts_change (struct uart_port *uport, bool active)
 
void uart_insert_char (struct uart_port *port, unsigned int status, unsigned int overrun, u8 ch, u8 flag)
 
void uart_xchar_out (struct uart_port *uport, int offset)
 
 DEFINE_LOCK_GUARD_1 (uart_port_lock_check_sysrq_irqsave, struct uart_port, uart_port_lock_irqsave(_T->lock, &_T->flags), uart_unlock_and_check_sysrq_irqrestore(_T->lock, _T->flags), unsigned long flags)
 
int uart_get_rs485_mode (struct uart_port *port)
 

Variables

const struct earlycon_id __earlycon_table []
 
const struct earlycon_id __earlycon_table_end []
 

Macro Definition Documentation

◆ __uart_port_tx

#define __uart_port_tx (   uport,
  ch,
  flags,
  tx_ready,
  put_char,
  tx_done,
  for_test,
  for_post 
)

◆ __UPF_CHANGE_MASK

#define __UPF_CHANGE_MASK   0x17fff

◆ _UAPILINUX_SERIAL_CORE_H

#define _UAPILINUX_SERIAL_CORE_H

◆ EARLYCON_DECLARE

#define EARLYCON_DECLARE (   _name,
  fn 
)    OF_EARLYCON_DECLARE(_name, "", fn)

◆ EARLYCON_USED_OR_UNUSED

#define EARLYCON_USED_OR_UNUSED   __maybe_unused

◆ NO_POLL_CHAR

#define NO_POLL_CHAR   0x00ff0000

◆ OF_EARLYCON_DECLARE

#define OF_EARLYCON_DECLARE (   _name,
  compat,
  fn 
)
Value:
static const struct earlycon_id __UNIQUE_ID(__earlycon_##_name) \
EARLYCON_USED_OR_UNUSED __section("__earlycon_table") \
__aligned(__alignof__(struct earlycon_id)) \
= { .name = __stringify(_name), \
.compatible = compat, \
.setup = fn }
void * fn
Definition audrv.c:980
#define __section(section)
Definition compiler_attributes.h:330
#define __aligned(x)
Definition compiler_attributes.h:33
#define EARLYCON_USED_OR_UNUSED
Definition serial_core.h:1349
#define __stringify(x...)
Definition stringify.h:10
Definition serial_core.h:1336
char name[15]
Definition serial_core.h:1337

◆ PORT_16550A_FSL64

#define PORT_16550A_FSL64   30 /* Freescale 16550 UART with 64 FIFOs */

◆ PORT_21285

#define PORT_21285   37

◆ PORT_8250_CIR

#define PORT_8250_CIR   23 /* CIR infrared port, has its own driver */

◆ PORT_ALTERA_JTAGUART

#define PORT_ALTERA_JTAGUART   91

◆ PORT_ALTERA_UART

#define PORT_ALTERA_UART   92

◆ PORT_ALTR_16550_F128

#define PORT_ALTR_16550_F128   28 /* Altera 16550 UART with 128 FIFOs */

◆ PORT_ALTR_16550_F32

#define PORT_ALTR_16550_F32   26 /* Altera 16550 UART with 32 FIFOs */

◆ PORT_ALTR_16550_F64

#define PORT_ALTR_16550_F64   27 /* Altera 16550 UART with 64 FIFOs */

◆ PORT_AMBA

#define PORT_AMBA   32

◆ PORT_APBUART

#define PORT_APBUART   90

◆ PORT_AR7

#define PORT_AR7   18 /* Texas Instruments AR7 internal UART */

◆ PORT_AR933X

#define PORT_AR933X   99

◆ PORT_ARC

#define PORT_ARC   101

◆ PORT_ASC

#define PORT_ASC   105

◆ PORT_ASPEED_VUART

#define PORT_ASPEED_VUART   42

◆ PORT_ATMEL

#define PORT_ATMEL   49

◆ PORT_BCM63XX

#define PORT_BCM63XX   89

◆ PORT_BCM7271

#define PORT_BCM7271   76

◆ PORT_BRCM_TRUMANAGE

#define PORT_BRCM_TRUMANAGE   25

◆ PORT_CLPS711X

#define PORT_CLPS711X   33

◆ PORT_CPM

#define PORT_CPM   58

◆ PORT_DA830

#define PORT_DA830   95

◆ PORT_DIGICOLOR

#define PORT_DIGICOLOR   110

◆ PORT_DZ

#define PORT_DZ   46

◆ PORT_GENERIC

#define PORT_GENERIC   (-1)

◆ PORT_HSCIF

#define PORT_HSCIF   104

◆ PORT_ICOM

#define PORT_ICOM   60

◆ PORT_IMX

#define PORT_IMX   62

◆ PORT_IP22ZILOG

#define PORT_IP22ZILOG   56

◆ PORT_IRDA

#define PORT_IRDA   54

◆ PORT_JSM

#define PORT_JSM   69

◆ PORT_LINFLEXUART

#define PORT_LINFLEXUART   122

◆ PORT_LPC3220

#define PORT_LPC3220   22 /* NXP LPC32xx SoC "Standard" UART */

◆ PORT_LPUART

#define PORT_LPUART   103

◆ PORT_MAC_ZILOG

#define PORT_MAC_ZILOG   50 /* m68k : not yet implemented */

◆ PORT_MAX3100

#define PORT_MAX3100   86

◆ PORT_MAX310X

#define PORT_MAX310X   94

◆ PORT_MCF

#define PORT_MCF   78

◆ PORT_MCHP16550A

#define PORT_MCHP16550A   100

◆ PORT_MEN_Z135

#define PORT_MEN_Z135   107

◆ PORT_MESON

#define PORT_MESON   109

◆ PORT_MLB_USIO

#define PORT_MLB_USIO   119

◆ PORT_MPC52xx

#define PORT_MPC52xx   59

◆ PORT_MPS2UART

#define PORT_MPS2UART   116

◆ PORT_MSM

#define PORT_MSM   88

◆ PORT_MTK_BTIF

#define PORT_MTK_BTIF   117

◆ PORT_MUX

#define PORT_MUX   48

◆ PORT_MVEBU

#define PORT_MVEBU   114

◆ PORT_NPCM

#define PORT_NPCM   40

◆ PORT_NS16550A

#define PORT_NS16550A   14

◆ PORT_OCTEON

#define PORT_OCTEON   17 /* Cavium OCTEON internal UART */

◆ PORT_OMAP

#define PORT_OMAP   96

◆ PORT_OWL

#define PORT_OWL   36

◆ PORT_PCH_2LINE

#define PORT_PCH_2LINE   45

◆ PORT_PCH_8LINE

#define PORT_PCH_8LINE   44

◆ PORT_PIC32

#define PORT_PIC32   115

◆ PORT_PMAC_ZILOG

#define PORT_PMAC_ZILOG   51

◆ PORT_PXA

#define PORT_PXA   31

◆ PORT_RDA

#define PORT_RDA   118

◆ PORT_RM9000

#define PORT_RM9000   16 /* PMC-Sierra RM9xxx internal UART */

◆ PORT_RP2

#define PORT_RP2   102

◆ PORT_RT2880

#define PORT_RT2880   29 /* Ralink RT2880 internal UART */

◆ PORT_S3C6400

#define PORT_S3C6400   84

◆ PORT_SA1100

#define PORT_SA1100   34

◆ PORT_SB1250_DUART

#define PORT_SB1250_DUART   77

◆ PORT_SC16IS7XX

#define PORT_SC16IS7XX   108

◆ PORT_SC26XX

#define PORT_SC26XX   82

◆ PORT_SCI

#define PORT_SCI   52

◆ PORT_SCIF

#define PORT_SCIF   53

◆ PORT_SCIFA

#define PORT_SCIFA   83

◆ PORT_SCIFB

#define PORT_SCIFB   93

◆ PORT_SIFIVE_V0

#define PORT_SIFIVE_V0   120

◆ PORT_SPRD

#define PORT_SPRD   111

◆ PORT_STM32

#define PORT_STM32   113

◆ PORT_SUNHV

#define PORT_SUNHV   72

◆ PORT_SUNIX

#define PORT_SUNIX   121

◆ PORT_SUNPLUS

#define PORT_SUNPLUS   123

◆ PORT_SUNSAB

#define PORT_SUNSAB   39

◆ PORT_SUNZILOG

#define PORT_SUNZILOG   38

◆ PORT_TEGRA

#define PORT_TEGRA   20 /* NVIDIA Tegra internal UART */

◆ PORT_TEGRA_TCU

#define PORT_TEGRA_TCU   41

◆ PORT_TIMBUART

#define PORT_TIMBUART   87

◆ PORT_TXX9

#define PORT_TXX9   64

◆ PORT_U6_16550A

#define PORT_U6_16550A   19 /* ST-Ericsson U6xxx internal UART */

◆ PORT_UART00

#define PORT_UART00   35

◆ PORT_UARTLITE

#define PORT_UARTLITE   74

◆ PORT_VT8500

#define PORT_VT8500   97

◆ PORT_XR17D15X

#define PORT_XR17D15X   21 /* Exar XR17D15x UART */

◆ PORT_XR17V35X

#define PORT_XR17V35X   24 /* Exar XR17V35x UARTs */

◆ PORT_XSCALE

#define PORT_XSCALE   15

◆ PORT_XUARTPS

#define PORT_XUARTPS   98

◆ PORT_ZS

#define PORT_ZS   47

◆ UART_CONFIG_IRQ

#define UART_CONFIG_IRQ   (1 << 1)

◆ UART_CONFIG_TYPE

#define UART_CONFIG_TYPE   (1 << 0)

◆ uart_console

#define uart_console (   port)    ({ (void)port; 0; })

◆ UART_ENABLE_MS

#define UART_ENABLE_MS (   port,
  cflag 
)
Value:
((port)->flags & UPF_HARDPPS_CD || \
(cflag) & CRTSCTS || \
!((cflag) & CLOCAL))
uint8_t flags
Definition virtio.h:0
#define CLOCAL
Definition termios.h:146
#define CRTSCTS
Definition termios.h:167
#define UPF_HARDPPS_CD
Definition serial_core.h:786

◆ uart_port_tx

#define uart_port_tx (   port,
  ch,
  tx_ready,
  put_char 
)     __uart_port_tx(port, ch, 0, tx_ready, put_char, ({}), true, ({}))

uart_port_tx – transmit helper for uart_port @port: uart port @ch: variable to store a character to be written to the HW @tx_ready: can HW accept more data function @put_char: function to write a character

See uart_port_tx_limited() for more details.

◆ uart_port_tx_flags

#define uart_port_tx_flags (   port,
  ch,
  flags,
  tx_ready,
  put_char 
)     __uart_port_tx(port, ch, flags, tx_ready, put_char, ({}), true, ({}))

uart_port_tx_flags – transmit helper for uart_port with flags @port: uart port @ch: variable to store a character to be written to the HW @flags: UART_TX_NOSTOP or similar @tx_ready: can HW accept more data function @put_char: function to write a character

See uart_port_tx_limited() for more details.

◆ uart_port_tx_limited

#define uart_port_tx_limited (   port,
  ch,
  count,
  tx_ready,
  put_char,
  tx_done 
)
Value:
({ \
unsigned int __count = (count); \
__uart_port_tx(port, ch, 0, tx_ready, put_char, tx_done, __count, \
__count--); \
})

uart_port_tx_limited – transmit helper for uart_port with count limiting @port: uart port @ch: variable to store a character to be written to the HW @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

This helper transmits characters from the xmit buffer to the hardware using @put_char(). It does so until @count characters are sent and while @tx_ready evaluates to true.

Returns: the number of characters in the xmit buffer when done.

The expression in macro parameters shall be designed as follows:

  • tx_ready: should evaluate to true if the HW can accept more data to be sent. This parameter can be true, which means the HW is always ready.
  • put_char: shall write @ch to the device of @port.
  • tx_done: when the write loop is done, this can perform arbitrary action before potential invocation of ops->stop_tx() happens. If the driver does not need to do anything, use e.g. ({}).

For all of them, @port->lock is held, interrupts are locally disabled and the expressions must not sleep.

◆ uart_port_tx_limited_flags

#define uart_port_tx_limited_flags (   port,
  ch,
  flags,
  count,
  tx_ready,
  put_char,
  tx_done 
)
Value:
({ \
unsigned int __count = (count); \
__uart_port_tx(port, ch, flags, tx_ready, put_char, tx_done, __count, \
__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.

◆ UART_XMIT_SIZE

#define UART_XMIT_SIZE   PAGE_SIZE

◆ UPF_AUTO_CTS

#define UPF_AUTO_CTS   ((__force upf_t) BIT_ULL(20))

◆ UPF_AUTO_IRQ

#define UPF_AUTO_IRQ   ((__force upf_t) ASYNC_AUTO_IRQ /* 7 */ )

◆ UPF_AUTO_RTS

#define UPF_AUTO_RTS   ((__force upf_t) BIT_ULL(21))

◆ UPF_BOOT_AUTOCONF

#define UPF_BOOT_AUTOCONF   ((__force upf_t) BIT_ULL(28))

◆ UPF_BUG_THRE

#define UPF_BUG_THRE   ((__force upf_t) BIT_ULL(26))

◆ UPF_BUGGY_UART

#define UPF_BUGGY_UART   ((__force upf_t) ASYNC_BUGGY_UART /* 14 */ )

◆ UPF_CHANGE_MASK

#define UPF_CHANGE_MASK   ((__force upf_t) __UPF_CHANGE_MASK)

◆ UPF_CONS_FLOW

#define UPF_CONS_FLOW   ((__force upf_t) BIT_ULL(23))

◆ UPF_DEAD

#define UPF_DEAD   ((__force upf_t) BIT_ULL(30))

◆ UPF_EXAR_EFR

#define UPF_EXAR_EFR   ((__force upf_t) BIT_ULL(25))

◆ UPF_FIXED_PORT

#define UPF_FIXED_PORT   ((__force upf_t) BIT_ULL(29))

◆ UPF_FIXED_TYPE

#define UPF_FIXED_TYPE   ((__force upf_t) BIT_ULL(27))

◆ UPF_FOURPORT

#define UPF_FOURPORT   0

◆ UPF_FULL_PROBE

#define UPF_FULL_PROBE   ((__force upf_t) BIT_ULL(32))

◆ UPF_HARD_FLOW

#define UPF_HARD_FLOW   ((__force upf_t) (UPF_AUTO_CTS | UPF_AUTO_RTS))

◆ UPF_HARDPPS_CD

#define UPF_HARDPPS_CD   ((__force upf_t) ASYNC_HARDPPS_CD /* 11 */ )

◆ UPF_IOREMAP

#define UPF_IOREMAP   ((__force upf_t) BIT_ULL(31))

◆ UPF_LOW_LATENCY

#define UPF_LOW_LATENCY   ((__force upf_t) ASYNC_LOW_LATENCY /* 13 */ )

◆ UPF_MAGIC_MULTIPLIER

#define UPF_MAGIC_MULTIPLIER   ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ )

◆ UPF_NO_THRE_TEST

#define UPF_NO_THRE_TEST   ((__force upf_t) BIT_ULL(19))

◆ UPF_SAK

#define UPF_SAK   ((__force upf_t) ASYNC_SAK /* 2 */ )

◆ UPF_SHARE_IRQ

#define UPF_SHARE_IRQ   ((__force upf_t) BIT_ULL(24))

◆ UPF_SKIP_TEST

#define UPF_SKIP_TEST   ((__force upf_t) ASYNC_SKIP_TEST /* 6 */ )

◆ UPF_SOFT_FLOW

#define UPF_SOFT_FLOW   ((__force upf_t) BIT_ULL(22))

◆ UPF_SPD_CUST

#define UPF_SPD_CUST   ((__force upf_t) ASYNC_SPD_CUST /* 0x0030 */ )

◆ UPF_SPD_HI

#define UPF_SPD_HI   ((__force upf_t) ASYNC_SPD_HI /* 4 */ )

◆ UPF_SPD_MASK

#define UPF_SPD_MASK   ((__force upf_t) ASYNC_SPD_MASK /* 0x1030 */ )

◆ UPF_SPD_SHI

#define UPF_SPD_SHI   ((__force upf_t) ASYNC_SPD_SHI /* 12 */ )

◆ UPF_SPD_VHI

#define UPF_SPD_VHI   ((__force upf_t) ASYNC_SPD_VHI /* 5 */ )

◆ UPF_SPD_WARP

#define UPF_SPD_WARP   ((__force upf_t) ASYNC_SPD_WARP /* 0x1010 */ )

◆ UPF_USR_MASK

#define UPF_USR_MASK   ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY))

◆ UPQ_NO_TXEN_TEST

#define UPQ_NO_TXEN_TEST   BIT(0)

◆ UPSTAT_AUTOCTS

#define UPSTAT_AUTOCTS   ((__force upstat_t) (1 << 3))

◆ UPSTAT_AUTORTS

#define UPSTAT_AUTORTS   ((__force upstat_t) (1 << 2))

◆ UPSTAT_AUTOXOFF

#define UPSTAT_AUTOXOFF   ((__force upstat_t) (1 << 4))

◆ UPSTAT_CTS_ENABLE

#define UPSTAT_CTS_ENABLE   ((__force upstat_t) (1 << 0))

◆ UPSTAT_DCD_ENABLE

#define UPSTAT_DCD_ENABLE   ((__force upstat_t) (1 << 1))

◆ UPSTAT_SYNC_FIFO

#define UPSTAT_SYNC_FIFO   ((__force upstat_t) (1 << 5))

◆ WAKEUP_CHARS

#define WAKEUP_CHARS   256

Typedef Documentation

◆ upf_t

typedef u64 __bitwise upf_t

◆ upstat_t

typedef unsigned int __bitwise upstat_t

Enumeration Type Documentation

◆ uart_iotype

Enumerator
UPIO_UNKNOWN 
UPIO_PORT 
UPIO_HUB6 
UPIO_MEM 
UPIO_MEM32 
UPIO_AU 
UPIO_TSI 
UPIO_MEM32BE 
UPIO_MEM16 

◆ uart_pm_state

enum uart_pm_state - power states for UARTs @UART_PM_STATE_ON: UART is powered, up and operational @UART_PM_STATE_OFF: UART is powered off @UART_PM_STATE_UNDEFINED: sentinel

Enumerator
UART_PM_STATE_ON 
UART_PM_STATE_OFF 
UART_PM_STATE_UNDEFINED 

◆ UART_TX_FLAGS

enum UART_TX_FLAGS – flags for uart_port_tx_flags()

@UART_TX_NOSTOP: don't call port->ops->stop_tx() on empty buffer

Enumerator
UART_TX_NOSTOP 

Function Documentation

◆ DEFINE_GUARD() [1/2]

DEFINE_GUARD ( uart_port_lock  ,
struct uart_port *  ,
uart_port_lock(_T)  ,
uart_port_unlock(_T)   
)

◆ DEFINE_GUARD() [2/2]

DEFINE_GUARD ( uart_port_lock_irq  ,
struct uart_port *  ,
uart_port_lock_irq(_T)  ,
uart_port_unlock_irq(_T)   
)

◆ DEFINE_LOCK_GUARD_1() [1/2]

DEFINE_LOCK_GUARD_1 ( uart_port_lock_check_sysrq_irqsave  ,
struct uart_port  ,
uart_port_lock_irqsave(_T->lock, &_T->flags)  ,
uart_unlock_and_check_sysrq_irqrestore(_T->lock, _T->flags)  ,
unsigned long  flags 
)

◆ DEFINE_LOCK_GUARD_1() [2/2]

DEFINE_LOCK_GUARD_1 ( uart_port_lock_irqsave  ,
struct uart_port  ,
uart_port_lock_irqsave(_T->lock, &_T->flags)  ,
uart_port_unlock_irqrestore(_T->lock, _T->flags)  ,
unsigned long  flags 
)

◆ of_setup_earlycon()

int of_setup_earlycon ( const struct earlycon_id *  match,
unsigned long  node,
const char *  options 
)

◆ uart_add_one_port()

int uart_add_one_port ( struct uart_driver *  reg,
struct uart_port *  port 
)

◆ uart_console_device()

struct tty_driver * uart_console_device ( struct console *  co,
int *  index 
)

◆ uart_console_write()

void uart_console_write ( struct uart_port *  port,
const char *  s,
unsigned int  count,
void(*)(struct uart_port *, unsigned char)  putchar 
)

◆ uart_get_baud_rate()

unsigned int uart_get_baud_rate ( struct uart_port *  port,
struct ktermios *  termios,
const struct ktermios *  old,
unsigned int  min,
unsigned int  max 
)

◆ uart_get_divisor()

unsigned int uart_get_divisor ( struct uart_port *  port,
unsigned int  baud 
)

◆ uart_get_rs485_mode()

int uart_get_rs485_mode ( struct uart_port *  port)

◆ uart_handle_cts_change()

void uart_handle_cts_change ( struct uart_port *  uport,
bool  active 
)

◆ uart_handle_dcd_change()

void uart_handle_dcd_change ( struct uart_port *  uport,
bool  active 
)

◆ uart_insert_char()

void uart_insert_char ( struct uart_port *  port,
unsigned int  status,
unsigned int  overrun,
u8  ch,
u8  flag 
)

◆ uart_match_port()

bool uart_match_port ( const struct uart_port *  port1,
const struct uart_port *  port2 
)

◆ uart_parse_earlycon()

int uart_parse_earlycon ( char *  p,
enum uart_iotype *  iotype,
resource_size_t *  addr,
char **  options 
)

◆ uart_parse_options()

void uart_parse_options ( const char *  options,
int *  baud,
int *  parity,
int *  bits,
int *  flow 
)

◆ uart_read_and_validate_port_properties()

int uart_read_and_validate_port_properties ( struct uart_port *  port)

◆ uart_read_port_properties()

int uart_read_port_properties ( struct uart_port *  port)

◆ uart_register_driver()

int uart_register_driver ( struct uart_driver *  uart)

◆ uart_remove_one_port()

void uart_remove_one_port ( struct uart_driver *  reg,
struct uart_port *  port 
)

◆ uart_resume_port()

int uart_resume_port ( struct uart_driver *  reg,
struct uart_port *  port 
)

◆ uart_set_options()

int uart_set_options ( struct uart_port *  port,
struct console *  co,
int  baud,
int  parity,
int  bits,
int  flow 
)

◆ uart_suspend_port()

int uart_suspend_port ( struct uart_driver *  reg,
struct uart_port *  port 
)

◆ uart_unregister_driver()

void uart_unregister_driver ( struct uart_driver *  uart)

◆ uart_update_timeout()

void uart_update_timeout ( struct uart_port *  port,
unsigned int  cflag,
unsigned int  baud 
)

◆ uart_write_wakeup()

void uart_write_wakeup ( struct uart_port *  port)

◆ uart_xchar_out()

void uart_xchar_out ( struct uart_port *  uport,
int  offset 
)

Variable Documentation

◆ __earlycon_table

const struct earlycon_id __earlycon_table[]
extern

◆ __earlycon_table_end

const struct earlycon_id __earlycon_table_end[]
extern