1
2
3
4
5
6
7
8
9
10 #ifndef _LINUX_SERIAL_H
11 #define _LINUX_SERIAL_H
12
13 struct serial_struct {
14 int type;
15 int line;
16 int port;
17 int irq;
18 int flags;
19 int xmit_fifo_size;
20 int custom_divisor;
21 int baud_base;
22 unsigned short close_delay;
23 char reserved_char[2];
24 int hub6;
25 int reserved[5];
26 };
27
28
29
30
31 #define PORT_UNKNOWN 0
32 #define PORT_8250 1
33 #define PORT_16450 2
34 #define PORT_16550 3
35 #define PORT_16550A 4
36 #define PORT_CIRRUS 5
37 #define PORT_MAX 5
38
39
40
41
42 #define ASYNC_HUP_NOTIFY 0x0001
43
44 #define ASYNC_FOURPORT 0x0002
45 #define ASYNC_SAK 0x0004
46 #define ASYNC_SPLIT_TERMIOS 0x0008
47
48 #define ASYNC_SPD_MASK 0x0030
49 #define ASYNC_SPD_HI 0x0010
50
51 #define ASYNC_SPD_VHI 0x0020
52 #define ASYNC_SPD_CUST 0x0030
53
54 #define ASYNC_SKIP_TEST 0x0040
55 #define ASYNC_AUTO_IRQ 0x0080
56 #define ASYNC_SESSION_LOCKOUT 0x0100
57 #define ASYNC_PGRP_LOCKOUT 0x0200
58 #define ASYNC_CALLOUT_NOHUP 0x0400
59
60 #define ASYNC_FLAGS 0x0FFF
61 #define ASYNC_USR_MASK 0x0430
62
63
64
65 #define ASYNC_INITIALIZED 0x80000000
66 #define ASYNC_CALLOUT_ACTIVE 0x40000000
67 #define ASYNC_NORMAL_ACTIVE 0x20000000
68 #define ASYNC_BOOT_AUTOCONF 0x10000000
69 #define ASYNC_CLOSING 0x08000000
70 #define ASYNC_CTS_FLOW 0x04000000
71 #define ASYNC_CHECK_CD 0x02000000
72
73 #ifdef __KERNEL__
74
75
76
77
78
79
80
81
82
83 struct async_struct {
84 int magic;
85 int baud_base;
86 int port;
87 int irq;
88 int flags;
89 int hub6;
90 int type;
91 struct tty_struct *tty;
92 int read_status_mask;
93 int ignore_status_mask;
94 int timeout;
95 int xmit_fifo_size;
96 int custom_divisor;
97 int x_char;
98 int close_delay;
99 int IER;
100 int MCR;
101 int MCR_noint;
102 int event;
103 unsigned long last_active;
104 int line;
105 int count;
106 int blocked_open;
107 long session;
108 long pgrp;
109 unsigned char *xmit_buf;
110 int xmit_head;
111 int xmit_tail;
112 int xmit_cnt;
113 struct tq_struct tqueue;
114 struct termios normal_termios;
115 struct termios callout_termios;
116 struct wait_queue *open_wait;
117 struct wait_queue *close_wait;
118 struct async_struct *next_port;
119 struct async_struct *prev_port;
120 };
121
122 #define SERIAL_MAGIC 0x5301
123
124
125
126
127 #define SERIAL_XMIT_SIZE 4096
128
129
130
131
132
133 #define RS_EVENT_WRITE_WAKEUP 0
134 #define RS_EVENT_HANGUP 1
135
136
137 extern int register_serial(struct serial_struct *req);
138 extern void unregister_serial(int line);
139 #endif
140 #endif