Home | History | Annotate | Line # | Download | only in ep93xx
epcomvar.h revision 1.2.4.2
      1  1.2.4.2  skrll /*      $NetBSD: epcomvar.h,v 1.2.4.2 2005/01/17 19:29:12 skrll Exp $        */
      2  1.2.4.2  skrll /*-
      3  1.2.4.2  skrll  * Copyright (c) 2004 Jesse Off
      4  1.2.4.2  skrll  *
      5  1.2.4.2  skrll  * Redistribution and use in source and binary forms, with or without
      6  1.2.4.2  skrll  * modification, are permitted provided that the following conditions
      7  1.2.4.2  skrll  * are met:
      8  1.2.4.2  skrll  * 1. Redistributions of source code must retain the above copyright
      9  1.2.4.2  skrll  *    notice, this list of conditions and the following disclaimer.
     10  1.2.4.2  skrll  * 2. Redistributions in binary form must reproduce the above copyright
     11  1.2.4.2  skrll  *    notice, this list of conditions and the following disclaimer in the
     12  1.2.4.2  skrll  *    documentation and/or other materials provided with the distribution.
     13  1.2.4.2  skrll  * 3. All advertising materials mentioning features or use of this software
     14  1.2.4.2  skrll  *    must display the following acknowledgement:
     15  1.2.4.2  skrll  *      This product includes software developed by the NetBSD
     16  1.2.4.2  skrll  *      Foundation, Inc. and its contributors.
     17  1.2.4.2  skrll  * 4. Neither the name of The NetBSD Foundation nor the names of its
     18  1.2.4.2  skrll  *    contributors may be used to endorse or promote products derived
     19  1.2.4.2  skrll  *    from this software without specific prior written permission.
     20  1.2.4.2  skrll  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     21  1.2.4.2  skrll  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22  1.2.4.2  skrll  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23  1.2.4.2  skrll  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     24  1.2.4.2  skrll  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     25  1.2.4.2  skrll  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     26  1.2.4.2  skrll  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27  1.2.4.2  skrll  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     28  1.2.4.2  skrll  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     29  1.2.4.2  skrll  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     30  1.2.4.2  skrll  * SUCH DAMAGE.
     31  1.2.4.2  skrll  *
     32  1.2.4.2  skrll  */
     33  1.2.4.2  skrll 
     34  1.2.4.2  skrll #ifndef _EPCOMVAR_H_
     35  1.2.4.2  skrll #define _EPCOMVAR_H_
     36  1.2.4.2  skrll 
     37  1.2.4.2  skrll /* Hardware flag masks */
     38  1.2.4.2  skrll #define COM_HW_NOIEN		0x01
     39  1.2.4.2  skrll #define COM_HW_DEV_OK		0x20
     40  1.2.4.2  skrll #define COM_HW_CONSOLE		0x40
     41  1.2.4.2  skrll #define COM_HW_KGDB		0x80
     42  1.2.4.2  skrll 
     43  1.2.4.2  skrll #define RX_TTY_BLOCKED		0x01
     44  1.2.4.2  skrll #define RX_TTY_OVERFLOWED	0x02
     45  1.2.4.2  skrll #define RX_IBUF_BLOCKED		0x04
     46  1.2.4.2  skrll #define RX_IBUF_OVERFLOWED	0x08
     47  1.2.4.2  skrll #define RX_ANY_BLOCK		0x0f
     48  1.2.4.2  skrll 
     49  1.2.4.2  skrll #define EPCOM_RING_SIZE	2048
     50  1.2.4.2  skrll 
     51  1.2.4.2  skrll struct epcom_softc {
     52  1.2.4.2  skrll 	struct device		sc_dev;
     53  1.2.4.2  skrll 	bus_addr_t		sc_hwbase;
     54  1.2.4.2  skrll 	bus_space_tag_t		sc_iot;
     55  1.2.4.2  skrll 	bus_space_handle_t 	sc_ioh;
     56  1.2.4.2  skrll 
     57  1.2.4.2  skrll 	void			*sc_si;
     58  1.2.4.2  skrll 
     59  1.2.4.2  skrll 	struct tty		*sc_tty;
     60  1.2.4.2  skrll 
     61  1.2.4.2  skrll 	u_char			*sc_rbuf, *sc_ebuf;
     62  1.2.4.2  skrll 
     63  1.2.4.2  skrll  	u_char			*sc_tba;
     64  1.2.4.2  skrll  	u_int			sc_tbc;
     65  1.2.4.2  skrll 
     66  1.2.4.2  skrll 	u_char			*volatile sc_rbget,
     67  1.2.4.2  skrll 				*volatile sc_rbput;
     68  1.2.4.2  skrll  	volatile u_int		sc_rbavail;
     69  1.2.4.2  skrll 
     70  1.2.4.2  skrll 	/* status flags */
     71  1.2.4.2  skrll 	int			sc_hwflags, sc_swflags;
     72  1.2.4.2  skrll 
     73  1.2.4.2  skrll 	volatile u_int		sc_rx_flags,
     74  1.2.4.2  skrll 				sc_tx_busy,
     75  1.2.4.2  skrll 				sc_tx_done,
     76  1.2.4.2  skrll 				sc_tx_stopped,
     77  1.2.4.2  skrll 				sc_st_check,
     78  1.2.4.2  skrll 				sc_rx_ready;
     79  1.2.4.2  skrll 
     80  1.2.4.2  skrll 	/* control registers */
     81  1.2.4.2  skrll 	u_int			sc_lcrlo;
     82  1.2.4.2  skrll 	u_int			sc_lcrmid;
     83  1.2.4.2  skrll 	u_int			sc_lcrhi;
     84  1.2.4.2  skrll 	u_int			sc_ctrl;
     85  1.2.4.2  skrll 
     86  1.2.4.2  skrll 	/* power management hooks */
     87  1.2.4.2  skrll 	int			(*enable)(struct epcom_softc *);
     88  1.2.4.2  skrll 	int			(*disable)(struct epcom_softc *);
     89  1.2.4.2  skrll 
     90  1.2.4.2  skrll 	int			enabled;
     91  1.2.4.2  skrll #if NRND > 0 && defined(RND_COM)
     92  1.2.4.2  skrll 	rndsource_element_t  rnd_source;
     93  1.2.4.2  skrll #endif
     94  1.2.4.2  skrll };
     95  1.2.4.2  skrll 
     96  1.2.4.2  skrll void	epcom_attach_subr(struct epcom_softc *);
     97  1.2.4.2  skrll 
     98  1.2.4.2  skrll int	epcomintr(void* arg);
     99  1.2.4.2  skrll int	epcomcnattach(bus_space_tag_t, bus_addr_t, bus_space_handle_t,
    100  1.2.4.2  skrll 		       int, tcflag_t);
    101  1.2.4.2  skrll 
    102  1.2.4.2  skrll #endif /* _EPCOMVAR_H_ */
    103