Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
422 giacomo 1
/*
2
 * include/linux/serial.h
3
 *
4
 * Copyright (C) 1992 by Theodore Ts'o.
5
 *
6
 * Redistribution of this file is permitted under the terms of the GNU
7
 * Public License (GPL)
8
 */
9
 
10
#ifndef _LINUX_SERIAL_H
11
#define _LINUX_SERIAL_H
12
 
13
#ifdef __KERNEL__
14
#include <asm/page.h>
15
 
16
/*
17
 * Counters of the input lines (CTS, DSR, RI, CD) interrupts
18
 */
19
 
20
struct async_icount {
21
        __u32   cts, dsr, rng, dcd, tx, rx;
22
        __u32   frame, parity, overrun, brk;
23
        __u32   buf_overrun;
24
};
25
 
26
/*
27
 * The size of the serial xmit buffer is 1 page, or 4096 bytes
28
 */
29
#define SERIAL_XMIT_SIZE PAGE_SIZE
30
 
31
#endif
32
 
33
struct serial_struct {
34
        int     type;
35
        int     line;
36
        unsigned int    port;
37
        int     irq;
38
        int     flags;
39
        int     xmit_fifo_size;
40
        int     custom_divisor;
41
        int     baud_base;
42
        unsigned short  close_delay;
43
        char    io_type;
44
        char    reserved_char[1];
45
        int     hub6;
46
        unsigned short  closing_wait; /* time to wait before closing */
47
        unsigned short  closing_wait2; /* no longer used... */
48
        unsigned char   *iomem_base;
49
        unsigned short  iomem_reg_shift;
50
        unsigned int    port_high;
51
        unsigned long   iomap_base;     /* cookie passed into ioremap */
52
};
53
 
54
/*
55
 * For the close wait times, 0 means wait forever for serial port to
56
 * flush its output.  65535 means don't wait at all.
57
 */
58
#define ASYNC_CLOSING_WAIT_INF  0
59
#define ASYNC_CLOSING_WAIT_NONE 65535
60
 
61
/*
62
 * These are the supported serial types.
63
 */
64
#define PORT_UNKNOWN    0
65
#define PORT_8250       1
66
#define PORT_16450      2
67
#define PORT_16550      3
68
#define PORT_16550A     4
69
#define PORT_CIRRUS     5       /* usurped by cyclades.c */
70
#define PORT_16650      6
71
#define PORT_16650V2    7
72
#define PORT_16750      8
73
#define PORT_STARTECH   9       /* usurped by cyclades.c */
74
#define PORT_16C950     10      /* Oxford Semiconductor */
75
#define PORT_16654      11
76
#define PORT_16850      12
77
#define PORT_RSA        13      /* RSA-DV II/S card */
78
#define PORT_MAX        13
79
 
80
#define SERIAL_IO_PORT  0
81
#define SERIAL_IO_HUB6  1
82
#define SERIAL_IO_MEM   2
83
 
84
struct serial_uart_config {
85
        char    *name;
86
        int     dfl_xmit_fifo_size;
87
        int     flags;
88
};
89
 
90
#define UART_CLEAR_FIFO         0x01
91
#define UART_USE_FIFO           0x02
92
#define UART_STARTECH           0x04
93
#define UART_NATSEMI            0x08
94
 
95
/*
96
 * Definitions for async_struct (and serial_struct) flags field
97
 */
98
#define ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes 
99
                                   on the callout port */
100
#define ASYNC_FOURPORT  0x0002  /* Set OU1, OUT2 per AST Fourport settings */
101
#define ASYNC_SAK       0x0004  /* Secure Attention Key (Orange book) */
102
#define ASYNC_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
103
 
104
#define ASYNC_SPD_MASK  0x1030
105
#define ASYNC_SPD_HI    0x0010  /* Use 56000 instead of 38400 bps */
106
 
107
#define ASYNC_SPD_VHI   0x0020  /* Use 115200 instead of 38400 bps */
108
#define ASYNC_SPD_CUST  0x0030  /* Use user-specified divisor */
109
 
110
#define ASYNC_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */
111
#define ASYNC_AUTO_IRQ  0x0080 /* Do automatic IRQ during autoconfiguration */
112
#define ASYNC_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
113
#define ASYNC_PGRP_LOCKOUT    0x0200 /* Lock out cua opens based on pgrp */
114
#define ASYNC_CALLOUT_NOHUP   0x0400 /* Don't do hangups for cua device */
115
 
116
#define ASYNC_HARDPPS_CD        0x0800  /* Call hardpps when CD goes high  */
117
 
118
#define ASYNC_SPD_SHI   0x1000  /* Use 230400 instead of 38400 bps */
119
#define ASYNC_SPD_WARP  0x1010  /* Use 460800 instead of 38400 bps */
120
 
121
#define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */
122
 
123
#define ASYNC_BUGGY_UART  0x4000 /* This is a buggy UART, skip some safety
124
                                  * checks.  Note: can be dangerous! */
125
 
126
#define ASYNC_AUTOPROBE  0x8000 /* Port was autoprobed by PCI or PNP code */
127
 
128
#define ASYNC_FLAGS     0x7FFF  /* Possible legal async flags */
129
#define ASYNC_USR_MASK  0x3430  /* Legal flags that non-privileged
130
                                 * users can set or reset */
131
 
132
/* Internal flags used only by kernel/chr_drv/serial.c */
133
#define ASYNC_INITIALIZED       0x80000000 /* Serial port was initialized */
134
#define ASYNC_CALLOUT_ACTIVE    0x40000000 /* Call out device is active */
135
#define ASYNC_NORMAL_ACTIVE     0x20000000 /* Normal device is active */
136
#define ASYNC_BOOT_AUTOCONF     0x10000000 /* Autoconfigure port on bootup */
137
#define ASYNC_CLOSING           0x08000000 /* Serial port is closing */
138
#define ASYNC_CTS_FLOW          0x04000000 /* Do CTS flow control */
139
#define ASYNC_CHECK_CD          0x02000000 /* i.e., CLOCAL */
140
#define ASYNC_SHARE_IRQ         0x01000000 /* for multifunction cards
141
                                             --- no longer used */
142
#define ASYNC_CONS_FLOW         0x00800000 /* flow control for console  */
143
 
144
#define ASYNC_BOOT_ONLYMCA      0x00400000 /* Probe only if MCA bus */
145
#define ASYNC_INTERNAL_FLAGS    0xFFC00000 /* Internal flags */
146
 
147
/*
148
 * Multiport serial configuration structure --- external structure
149
 */
150
struct 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
 * Serial input interrupt line counters -- external structure
166
 * Four lines can interrupt: CTS, DSR, RI, DCD
167
 */
168
struct 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
/* Export to allow PCMCIA to use this - Dave Hinds */
179
extern int register_serial(struct serial_struct *req);
180
extern void unregister_serial(int line);
181
 
182
/* Allow architectures to override entries in serial8250_ports[] at run time: */
183
struct uart_port;       /* forward declaration */
184
extern int early_serial_setup(struct uart_port *port);
185
 
186
#endif /* __KERNEL__ */
187
#endif /* _LINUX_SERIAL_H */