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_MAX 4
37
38
39
40
41 #define ASYNC_HUP_NOTIFY 0x0001
42
43 #define ASYNC_FOURPORT 0x0002
44 #define ASYNC_SAK 0x0004
45 #define ASYNC_SPLIT_TERMIOS 0x0008
46
47 #define ASYNC_SPD_MASK 0x0030
48 #define ASYNC_SPD_HI 0x0010
49
50 #define ASYNC_SPD_VHI 0x0020
51 #define ASYNC_SPD_CUST 0x0030
52
53 #define ASYNC_SKIP_TEST 0x0040
54 #define ASYNC_AUTO_IRQ 0x0080
55 #define ASYNC_SESSION_LOCKOUT 0x0100
56 #define ASYNC_PGRP_LOCKOUT 0x0200
57 #define ASYNC_CALLOUT_NOHUP 0x0400
58
59 #define ASYNC_FLAGS 0x0FFF
60 #define ASYNC_USR_MASK 0x0430
61
62
63
64 #define ASYNC_INITIALIZED 0x80000000
65 #define ASYNC_CALLOUT_ACTIVE 0x40000000
66 #define ASYNC_NORMAL_ACTIVE 0x20000000
67 #define ASYNC_BOOT_AUTOCONF 0x10000000
68 #define ASYNC_CLOSING 0x08000000
69 #define ASYNC_CTS_FLOW 0x04000000
70 #define ASYNC_CHECK_CD 0x02000000
71
72 #ifdef __KERNEL__
73
74
75
76
77
78
79
80
81
82 struct async_struct {
83 int magic;
84 int baud_base;
85 int port;
86 int irq;
87 int flags;
88 int hub6;
89 int type;
90 struct tty_struct *tty;
91 int read_status_mask;
92 int ignore_status_mask;
93 int timeout;
94 int xmit_fifo_size;
95 int custom_divisor;
96 int x_char;
97 int close_delay;
98 int IER;
99 int MCR;
100 int MCR_noint;
101 int event;
102 unsigned long last_active;
103 int line;
104 int count;
105 int blocked_open;
106 long session;
107 long pgrp;
108 unsigned char *xmit_buf;
109 int xmit_head;
110 int xmit_tail;
111 int xmit_cnt;
112 struct tq_struct tqueue;
113 struct termios normal_termios;
114 struct termios callout_termios;
115 struct wait_queue *open_wait;
116 struct wait_queue *close_wait;
117 struct async_struct *next_port;
118 struct async_struct *prev_port;
119 };
120
121 #define SERIAL_MAGIC 0x5301
122
123
124
125
126 #define SERIAL_XMIT_SIZE 4096
127
128
129
130
131
132 #define RS_EVENT_WRITE_WAKEUP 0
133 #define RS_EVENT_HANGUP 1
134
135
136 extern int register_serial(struct serial_struct *req);
137 extern void unregister_serial(int line);
138 #endif
139 #endif