Deleted Added
full compact
siovar.h (85365) siovar.h (86909)
1/*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1/*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/sys/dev/sio/siovar.h 85365 2001-10-23 15:17:33Z imp $
33 * $FreeBSD: head/sys/dev/sio/siovar.h 86909 2001-11-26 07:39:51Z imp $
34 */
35
34 */
35
36#define SET_FLAG(dev, bit) device_set_flags(dev, device_get_flags(dev) | (bit))
37#define CLR_FLAG(dev, bit) device_set_flags(dev, device_get_flags(dev) & ~(bit))
38
39#define CE_NTYPES 3
40
41/* types. XXX - should be elsewhere */
42typedef u_int Port_t; /* hardware port */
43typedef u_char bool_t; /* boolean */
44
45/* queue of linear buffers */
46struct lbq {
47 u_char *l_head; /* next char to process */
48 u_char *l_tail; /* one past the last char to process */
49 struct lbq *l_next; /* next in queue */
50 bool_t l_queued; /* nonzero if queued */
51};
52
53/* com device structure */
54struct com_s {
55 u_int flags; /* Copy isa device flags */
56 u_char state; /* miscellaneous flag bits */
57 bool_t active_out; /* nonzero if the callout device is open */
58 u_char cfcr_image; /* copy of value written to CFCR */
59#ifdef COM_ESP
60 bool_t esp; /* is this unit a hayes esp board? */
61#endif
62 u_char extra_state; /* more flag bits, separate for order trick */
63 u_char fifo_image; /* copy of value written to FIFO */
64 bool_t hasfifo; /* nonzero for 16550 UARTs */
65 bool_t st16650a; /* Is a Startech 16650A or RTS/CTS compat */
66 bool_t loses_outints; /* nonzero if device loses output interrupts */
67 u_char mcr_image; /* copy of value written to MCR */
68#ifdef COM_MULTIPORT
69 bool_t multiport; /* is this unit part of a multiport device? */
70#endif /* COM_MULTIPORT */
71 bool_t no_irq; /* nonzero if irq is not attached */
72 bool_t gone; /* hardware disappeared */
73 bool_t poll; /* nonzero if polling is required */
74 bool_t poll_output; /* nonzero if polling for output is required */
75 int unit; /* unit number */
76 int dtr_wait; /* time to hold DTR down on close (* 1/hz) */
77 u_int tx_fifo_size;
78 u_int wopeners; /* # processes waiting for DCD in open() */
79
80 /*
81 * The high level of the driver never reads status registers directly
82 * because there would be too many side effects to handle conveniently.
83 * Instead, it reads copies of the registers stored here by the
84 * interrupt handler.
85 */
86 u_char last_modem_status; /* last MSR read by intr handler */
87 u_char prev_modem_status; /* last MSR handled by high level */
88
89 u_char hotchar; /* ldisc-specific char to be handled ASAP */
90 u_char *ibuf; /* start of input buffer */
91 u_char *ibufend; /* end of input buffer */
92 u_char *ibufold; /* old input buffer, to be freed */
93 u_char *ihighwater; /* threshold in input buffer */
94 u_char *iptr; /* next free spot in input buffer */
95 int ibufsize; /* size of ibuf (not include error bytes) */
96 int ierroff; /* offset of error bytes in ibuf */
97
98 struct lbq obufq; /* head of queue of output buffers */
99 struct lbq obufs[2]; /* output buffers */
100
101 bus_space_tag_t bst;
102 bus_space_handle_t bsh;
103
104 Port_t data_port; /* i/o ports */
105#ifdef COM_ESP
106 Port_t esp_port;
107#endif
108 Port_t int_id_port;
109 Port_t modem_ctl_port;
110 Port_t line_status_port;
111 Port_t modem_status_port;
112 Port_t intr_ctl_port; /* Ports of IIR register */
113
114 struct tty *tp; /* cross reference */
115
116 /* Initial state. */
117 struct termios it_in; /* should be in struct tty */
118 struct termios it_out;
119
120 /* Lock state. */
121 struct termios lt_in; /* should be in struct tty */
122 struct termios lt_out;
123
124 bool_t do_timestamp;
125 bool_t do_dcd_timestamp;
126 struct timeval timestamp;
127 struct timeval dcd_timestamp;
128 struct pps_state pps;
129
130 u_long bytes_in; /* statistics */
131 u_long bytes_out;
132 u_int delta_error_counts[CE_NTYPES];
133 u_long error_counts[CE_NTYPES];
134
135 struct resource *irqres;
136 struct resource *ioportres;
137 void *cookie;
138 dev_t devs[6];
139
140 /*
141 * Data area for output buffers. Someday we should build the output
142 * buffer queue without copying data.
143 */
144 u_char obuf1[256];
145 u_char obuf2[256];
146};
147
148int sioattach __P((device_t dev, int xrid));
149int siodetach __P((device_t dev));
150int sioprobe __P((device_t dev, int xrid, int noprobe));
151
152extern devclass_t sio_devclass;
153extern char sio_driver_name[];
36int sioattach __P((device_t dev, int xrid));
37int siodetach __P((device_t dev));
38int sioprobe __P((device_t dev, int xrid, int noprobe));
39
40extern devclass_t sio_devclass;
41extern char sio_driver_name[];