No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / arm / ep93xx / epcomvar.h
blob731e35a151b1e34c571e583a67bb7ed5b6575150
1 /* $NetBSD: epcomvar.h,v 1.3 2005/12/11 12:16:45 christos Exp $ */
2 /*-
3 * Copyright (c) 2004 Jesse Off
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
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
28 #ifndef _EPCOMVAR_H_
29 #define _EPCOMVAR_H_
31 /* Hardware flag masks */
32 #define COM_HW_NOIEN 0x01
33 #define COM_HW_DEV_OK 0x20
34 #define COM_HW_CONSOLE 0x40
35 #define COM_HW_KGDB 0x80
37 #define RX_TTY_BLOCKED 0x01
38 #define RX_TTY_OVERFLOWED 0x02
39 #define RX_IBUF_BLOCKED 0x04
40 #define RX_IBUF_OVERFLOWED 0x08
41 #define RX_ANY_BLOCK 0x0f
43 #define EPCOM_RING_SIZE 2048
45 struct epcom_softc {
46 struct device sc_dev;
47 bus_addr_t sc_hwbase;
48 bus_space_tag_t sc_iot;
49 bus_space_handle_t sc_ioh;
51 void *sc_si;
53 struct tty *sc_tty;
55 u_char *sc_rbuf, *sc_ebuf;
57 u_char *sc_tba;
58 u_int sc_tbc;
60 u_char *volatile sc_rbget,
61 *volatile sc_rbput;
62 volatile u_int sc_rbavail;
64 /* status flags */
65 int sc_hwflags, sc_swflags;
67 volatile u_int sc_rx_flags,
68 sc_tx_busy,
69 sc_tx_done,
70 sc_tx_stopped,
71 sc_st_check,
72 sc_rx_ready;
74 /* control registers */
75 u_int sc_lcrlo;
76 u_int sc_lcrmid;
77 u_int sc_lcrhi;
78 u_int sc_ctrl;
80 /* power management hooks */
81 int (*enable)(struct epcom_softc *);
82 int (*disable)(struct epcom_softc *);
84 int enabled;
85 #if NRND > 0 && defined(RND_COM)
86 rndsource_element_t rnd_source;
87 #endif
90 void epcom_attach_subr(struct epcom_softc *);
92 int epcomintr(void* arg);
93 int epcomcnattach(bus_space_tag_t, bus_addr_t, bus_space_handle_t,
94 int, tcflag_t);
96 #endif /* _EPCOMVAR_H_ */