Import 2.3.6
[davej-history.git] / include / linux / serial.h
blob929618dd563be518dcfb1ac11c1921187658c9e3
1 /*
2 * include/linux/serial.h
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 */
10 #ifndef _LINUX_SERIAL_H
11 #define _LINUX_SERIAL_H
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 unsigned short closing_wait; /* time to wait before closing */
26 unsigned short closing_wait2; /* no longer used... */
27 int reserved[4];
31 * For the close wait times, 0 means wait forever for serial port to
32 * flush its output. 65535 means don't wait at all.
34 #define ASYNC_CLOSING_WAIT_INF 0
35 #define ASYNC_CLOSING_WAIT_NONE 65535
38 * These are the supported serial types.
40 #define PORT_UNKNOWN 0
41 #define PORT_8250 1
42 #define PORT_16450 2
43 #define PORT_16550 3
44 #define PORT_16550A 4
45 #define PORT_CIRRUS 5 /* usurped by cyclades.c */
46 #define PORT_16650 6
47 #define PORT_16650V2 7
48 #define PORT_16750 8
49 #define PORT_STARTECH 9 /* usurped by cyclades.c */
50 #define PORT_MAX 9
52 struct serial_uart_config {
53 char *name;
54 int dfl_xmit_fifo_size;
55 int flags;
58 #define UART_CLEAR_FIFO 0x01
59 #define UART_USE_FIFO 0x02
60 #define UART_STARTECH 0x04
63 * Definitions for async_struct (and serial_struct) flags field
65 #define ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes
66 on the callout port */
67 #define ASYNC_FOURPORT 0x0002 /* Set OU1, OUT2 per AST Fourport settings */
68 #define ASYNC_SAK 0x0004 /* Secure Attention Key (Orange book) */
69 #define ASYNC_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
71 #define ASYNC_SPD_MASK 0x1030
72 #define ASYNC_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */
74 #define ASYNC_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */
75 #define ASYNC_SPD_CUST 0x0030 /* Use user-specified divisor */
77 #define ASYNC_SKIP_TEST 0x0040 /* Skip UART test during autoconfiguration */
78 #define ASYNC_AUTO_IRQ 0x0080 /* Do automatic IRQ during autoconfiguration */
79 #define ASYNC_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
80 #define ASYNC_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */
81 #define ASYNC_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */
83 #define ASYNC_HARDPPS_CD 0x0800 /* Call hardpps when CD goes high */
85 #define ASYNC_SPD_SHI 0x1000 /* Use 230400 instead of 38400 bps */
86 #define ASYNC_SPD_WARP 0x1010 /* Use 460800 instead of 38400 bps */
88 #define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */
90 #define ASYNC_FLAGS 0x3FFF /* Possible legal async flags */
91 #define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged
92 * users can set or reset */
94 /* Internal flags used only by kernel/chr_drv/serial.c */
95 #define ASYNC_INITIALIZED 0x80000000 /* Serial port was initialized */
96 #define ASYNC_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */
97 #define ASYNC_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
98 #define ASYNC_BOOT_AUTOCONF 0x10000000 /* Autoconfigure port on bootup */
99 #define ASYNC_CLOSING 0x08000000 /* Serial port is closing */
100 #define ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */
101 #define ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */
102 #define ASYNC_SHARE_IRQ 0x01000000 /* for multifunction cards */
104 #define ASYNC_INTERNAL_FLAGS 0xFF000000 /* Internal flags */
107 * Multiport serial configuration structure --- external structure
109 struct serial_multiport_struct {
110 int irq;
111 int port1;
112 unsigned char mask1, match1;
113 int port2;
114 unsigned char mask2, match2;
115 int port3;
116 unsigned char mask3, match3;
117 int port4;
118 unsigned char mask4, match4;
119 int port_monitor;
120 int reserved[32];
124 * Serial input interrupt line counters -- external structure
125 * Four lines can interrupt: CTS, DSR, RI, DCD
127 struct serial_icounter_struct {
128 int cts, dsr, rng, dcd;
129 int rx, tx;
130 int frame, overrun, parity, brk;
131 int buf_overrun;
132 int reserved[9];
136 #ifdef __KERNEL__
137 /* Export to allow PCMCIA to use this - Dave Hinds */
138 extern int register_serial(struct serial_struct *req);
139 extern void unregister_serial(int line);
141 #endif /* __KERNEL__ */
142 #endif /* _LINUX_SERIAL_H */