1
2
3
4
5
6
7
8
9
10#ifndef _LINUX_SERIAL_H
11#define _LINUX_SERIAL_H
12
13#ifdef __KERNEL__
14#include <linux/types.h>
15#include <asm/page.h>
16
17
18
19
20
21struct async_icount {
22 __u32 cts, dsr, rng, dcd, tx, rx;
23 __u32 frame, parity, overrun, brk;
24 __u32 buf_overrun;
25};
26
27
28
29
30#define SERIAL_XMIT_SIZE PAGE_SIZE
31
32#endif
33
34struct serial_struct {
35 int type;
36 int line;
37 unsigned int port;
38 int irq;
39 int flags;
40 int xmit_fifo_size;
41 int custom_divisor;
42 int baud_base;
43 unsigned short close_delay;
44 char io_type;
45 char reserved_char[1];
46 int hub6;
47 unsigned short closing_wait;
48 unsigned short closing_wait2;
49 unsigned char *iomem_base;
50 unsigned short iomem_reg_shift;
51 unsigned int port_high;
52 unsigned long iomap_base;
53};
54
55
56
57
58
59#define ASYNC_CLOSING_WAIT_INF 0
60#define ASYNC_CLOSING_WAIT_NONE 65535
61
62
63
64
65#define PORT_UNKNOWN 0
66#define PORT_8250 1
67#define PORT_16450 2
68#define PORT_16550 3
69#define PORT_16550A 4
70#define PORT_CIRRUS 5
71#define PORT_16650 6
72#define PORT_16650V2 7
73#define PORT_16750 8
74#define PORT_STARTECH 9
75#define PORT_16C950 10
76#define PORT_16654 11
77#define PORT_16850 12
78#define PORT_RSA 13
79#define PORT_MAX 13
80
81#define SERIAL_IO_PORT 0
82#define SERIAL_IO_HUB6 1
83#define SERIAL_IO_MEM 2
84
85struct serial_uart_config {
86 char *name;
87 int dfl_xmit_fifo_size;
88 int flags;
89};
90
91#define UART_CLEAR_FIFO 0x01
92#define UART_USE_FIFO 0x02
93#define UART_STARTECH 0x04
94#define UART_NATSEMI 0x08
95
96
97
98
99#define ASYNC_HUP_NOTIFY 0x0001
100
101#define ASYNC_FOURPORT 0x0002
102#define ASYNC_SAK 0x0004
103#define ASYNC_SPLIT_TERMIOS 0x0008
104
105#define ASYNC_SPD_MASK 0x1030
106#define ASYNC_SPD_HI 0x0010
107
108#define ASYNC_SPD_VHI 0x0020
109#define ASYNC_SPD_CUST 0x0030
110
111#define ASYNC_SKIP_TEST 0x0040
112#define ASYNC_AUTO_IRQ 0x0080
113#define ASYNC_SESSION_LOCKOUT 0x0100
114#define ASYNC_PGRP_LOCKOUT 0x0200
115#define ASYNC_CALLOUT_NOHUP 0x0400
116
117#define ASYNC_HARDPPS_CD 0x0800
118
119#define ASYNC_SPD_SHI 0x1000
120#define ASYNC_SPD_WARP 0x1010
121
122#define ASYNC_LOW_LATENCY 0x2000
123
124#define ASYNC_BUGGY_UART 0x4000
125
126
127#define ASYNC_AUTOPROBE 0x8000
128
129#define ASYNC_FLAGS 0x7FFF
130#define ASYNC_USR_MASK 0x3430
131
132
133
134#define ASYNC_INITIALIZED 0x80000000
135#define ASYNC_NORMAL_ACTIVE 0x20000000
136#define ASYNC_BOOT_AUTOCONF 0x10000000
137#define ASYNC_CLOSING 0x08000000
138#define ASYNC_CTS_FLOW 0x04000000
139#define ASYNC_CHECK_CD 0x02000000
140#define ASYNC_SHARE_IRQ 0x01000000
141
142#define ASYNC_CONS_FLOW 0x00800000
143
144#define ASYNC_BOOT_ONLYMCA 0x00400000
145#define ASYNC_INTERNAL_FLAGS 0xFFC00000
146
147
148
149
150struct serial_multiport_struct {
151 int irq;
152 int port1;
153 unsigned char mask1, match1;
154 int port2;
155 unsigned char mask2, match2;
156 int port3;
157 unsigned char mask3, match3;
158 int port4;
159 unsigned char mask4, match4;
160 int port_monitor;
161 int reserved[32];
162};
163
164
165
166
167
168struct serial_icounter_struct {
169 int cts, dsr, rng, dcd;
170 int rx, tx;
171 int frame, overrun, parity, brk;
172 int buf_overrun;
173 int reserved[9];
174};
175
176
177#ifdef __KERNEL__
178#include <linux/compiler.h>
179
180#endif
181#endif
182