2 * Private header file for the (dumb) serial driver
4 * Copyright (C) 1997 by Theodore Ts'o.
6 * Redistribution of this file is permitted under the terms of the GNU
10 #ifndef _LINUX_SERIALP_H
11 #define _LINUX_SERIALP_H
14 * This is our internal structure for each serial port's state.
16 * Many fields are paralleled by the structure used by the serial_struct
19 * For definitions of the flags field, see tty.h
22 #include <linux/termios.h>
23 #include <linux/workqueue.h>
24 #include <linux/interrupt.h>
25 #include <linux/circ_buf.h>
26 #include <linux/wait.h>
37 int revision
; /* Chip revision (950) */
43 unsigned short close_delay
;
44 unsigned short closing_wait
; /* time to wait before closing */
45 struct async_icount icount
;
47 struct async_struct
*info
;
57 struct serial_state
*state
;
58 struct tty_struct
*tty
;
60 int ignore_status_mask
;
63 int x_char
; /* xon/xoff character */
65 unsigned short closing_wait
;
66 unsigned short closing_wait2
; /* obsolete */
67 int IER
; /* Interrupt Enable Register */
68 int MCR
; /* Modem control register */
69 int LCR
; /* Line control register */
70 int ACR
; /* 16950 Additional Control Reg. */
72 unsigned long last_active
;
74 int blocked_open
; /* # of blocked opens */
80 struct work_struct work
;
81 struct tasklet_struct tlet
;
82 #ifdef DECLARE_WAITQUEUE
83 wait_queue_head_t open_wait
;
84 wait_queue_head_t close_wait
;
85 wait_queue_head_t delta_msr_wait
;
87 struct wait_queue
*open_wait
;
88 struct wait_queue
*close_wait
;
89 struct wait_queue
*delta_msr_wait
;
91 struct async_struct
*next_port
; /* For the linked list */
92 struct async_struct
*prev_port
;
95 #define CONFIGURED_SERIAL_PORT(info) ((info)->port || ((info)->iomem_base))
97 #define SERIAL_MAGIC 0x5301
98 #define SSTATE_MAGIC 0x5302
101 * Events are used to schedule things to happen at timer-interrupt
102 * time, instead of at rs interrupt time.
104 #define RS_EVENT_WRITE_WAKEUP 0
107 * Multiport serial configuration structure --- internal structure
109 struct rs_multiport_struct
{
111 unsigned char mask1
, match1
;
113 unsigned char mask2
, match2
;
115 unsigned char mask3
, match3
;
117 unsigned char mask4
, match4
;
121 #if defined(__alpha__) && !defined(CONFIG_PCI)
123 * Digital did something really horribly wrong with the OUT1 and OUT2
124 * lines on at least some ALPHA's. The failure mode is that if either
125 * is cleared, the machine locks up with endless interrupts.
127 * This is still used by arch/mips/au1000/common/serial.c for some weird
128 * reason (mips != alpha!)
130 #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1)
131 #elif defined(CONFIG_SBC8560)
133 * WindRiver did something similarly broken on their SBC8560 board. The
134 * UART tristates its IRQ output while OUT2 is clear, but they pulled
135 * the interrupt line _up_ instead of down, so if we register the IRQ
136 * while the UART is in that state, we die in an IRQ storm. */
137 #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2)
139 #define ALPHA_KLUDGE_MCR 0
142 #endif /* _LINUX_SERIAL_H */