2 * include/linux/serial.h
4 * Copyright (C) 1992 by Theodore Ts'o.
6 * Redistribution of this file is permitted under the terms of the GNU
10 #ifndef _LINUX_SERIAL_H
11 #define _LINUX_SERIAL_H
13 #include <linux/types.h>
15 #include <linux/tty_flags.h>
22 * Counters of the input lines (CTS, DSR, RI, CD) interrupts
26 __u32 cts
, dsr
, rng
, dcd
, tx
, rx
;
27 __u32 frame
, parity
, overrun
, brk
;
32 * The size of the serial xmit buffer is 1 page, or 4096 bytes
34 #define SERIAL_XMIT_SIZE PAGE_SIZE
38 struct serial_struct
{
47 unsigned short close_delay
;
49 char reserved_char
[1];
51 unsigned short closing_wait
; /* time to wait before closing */
52 unsigned short closing_wait2
; /* no longer used... */
53 unsigned char *iomem_base
;
54 unsigned short iomem_reg_shift
;
55 unsigned int port_high
;
56 unsigned long iomap_base
; /* cookie passed into ioremap */
60 * For the close wait times, 0 means wait forever for serial port to
61 * flush its output. 65535 means don't wait at all.
63 #define ASYNC_CLOSING_WAIT_INF 0
64 #define ASYNC_CLOSING_WAIT_NONE 65535
67 * These are the supported serial types.
69 #define PORT_UNKNOWN 0
74 #define PORT_CIRRUS 5 /* usurped by cyclades.c */
76 #define PORT_16650V2 7
78 #define PORT_STARTECH 9 /* usurped by cyclades.c */
79 #define PORT_16C950 10 /* Oxford Semiconductor */
82 #define PORT_RSA 13 /* RSA-DV II/S card */
85 #define SERIAL_IO_PORT 0
86 #define SERIAL_IO_HUB6 1
87 #define SERIAL_IO_MEM 2
89 #define UART_CLEAR_FIFO 0x01
90 #define UART_USE_FIFO 0x02
91 #define UART_STARTECH 0x04
92 #define UART_NATSEMI 0x08
96 * Multiport serial configuration structure --- external structure
98 struct serial_multiport_struct
{
101 unsigned char mask1
, match1
;
103 unsigned char mask2
, match2
;
105 unsigned char mask3
, match3
;
107 unsigned char mask4
, match4
;
113 * Serial input interrupt line counters -- external structure
114 * Four lines can interrupt: CTS, DSR, RI, DCD
116 struct serial_icounter_struct
{
117 int cts
, dsr
, rng
, dcd
;
119 int frame
, overrun
, parity
, brk
;
125 * Serial interface for controlling RS485 settings on chips with suitable
126 * support. Set with TIOCSRS485 and get with TIOCGRS485 if supported by your
127 * platform. The set function returns the new state, with any unsupported bits
128 * reverted appropriately.
131 struct serial_rs485
{
132 __u32 flags
; /* RS485 feature flags */
133 #define SER_RS485_ENABLED (1 << 0) /* If enabled */
134 #define SER_RS485_RTS_ON_SEND (1 << 1) /* Logical level for
137 #define SER_RS485_RTS_AFTER_SEND (1 << 2) /* Logical level for
139 #define SER_RS485_RX_DURING_TX (1 << 4)
140 __u32 delay_rts_before_send
; /* Delay before send (milliseconds) */
141 __u32 delay_rts_after_send
; /* Delay after send (milliseconds) */
142 __u32 padding
[5]; /* Memory is cheap, new structs
143 are a royal PITA .. */
147 #include <linux/compiler.h>
149 #endif /* __KERNEL__ */
150 #endif /* _LINUX_SERIAL_H */