Home | History | Annotate | Line # | Download | only in dec
      1  1.12   msaitoh /*	$NetBSD: dzvar.h,v 1.12 2019/12/27 06:52:43 msaitoh Exp $	*/
      2   1.1        ad /*
      3   1.1        ad  * Copyright (c) 1992, 1993
      4   1.1        ad  *	The Regents of the University of California.  All rights reserved.
      5   1.6       agc  *
      6   1.6       agc  * This code is derived from software contributed to Berkeley by
      7   1.6       agc  * Ralph Campbell and Rick Macklem.
      8   1.6       agc  *
      9   1.6       agc  * Redistribution and use in source and binary forms, with or without
     10   1.6       agc  * modification, are permitted provided that the following conditions
     11   1.6       agc  * are met:
     12   1.6       agc  * 1. Redistributions of source code must retain the above copyright
     13   1.6       agc  *    notice, this list of conditions and the following disclaimer.
     14   1.6       agc  * 2. Redistributions in binary form must reproduce the above copyright
     15   1.6       agc  *    notice, this list of conditions and the following disclaimer in the
     16   1.6       agc  *    documentation and/or other materials provided with the distribution.
     17   1.6       agc  * 3. Neither the name of the University nor the names of its contributors
     18   1.6       agc  *    may be used to endorse or promote products derived from this software
     19   1.6       agc  *    without specific prior written permission.
     20   1.6       agc  *
     21   1.6       agc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     22   1.6       agc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23   1.6       agc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24   1.6       agc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     25   1.6       agc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26   1.6       agc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27   1.6       agc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28   1.6       agc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29   1.6       agc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30   1.6       agc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31   1.6       agc  * SUCH DAMAGE.
     32   1.6       agc  */
     33   1.6       agc 
     34   1.6       agc /*
     35   1.6       agc  * Copyright (c) 1996  Ken C. Wellsch.  All rights reserved.
     36   1.1        ad  *
     37   1.1        ad  * This code is derived from software contributed to Berkeley by
     38   1.1        ad  * Ralph Campbell and Rick Macklem.
     39   1.1        ad  *
     40   1.1        ad  * Redistribution and use in source and binary forms, with or without
     41   1.1        ad  * modification, are permitted provided that the following conditions
     42   1.1        ad  * are met:
     43   1.1        ad  * 1. Redistributions of source code must retain the above copyright
     44   1.1        ad  *    notice, this list of conditions and the following disclaimer.
     45   1.1        ad  * 2. Redistributions in binary form must reproduce the above copyright
     46   1.1        ad  *    notice, this list of conditions and the following disclaimer in the
     47   1.1        ad  *    documentation and/or other materials provided with the distribution.
     48   1.1        ad  * 3. All advertising materials mentioning features or use of this software
     49   1.1        ad  *    must display the following acknowledgement:
     50   1.1        ad  *	This product includes software developed by the University of
     51   1.1        ad  *	California, Berkeley and its contributors.
     52   1.1        ad  * 4. Neither the name of the University nor the names of its contributors
     53   1.1        ad  *    may be used to endorse or promote products derived from this software
     54   1.1        ad  *    without specific prior written permission.
     55   1.1        ad  *
     56   1.1        ad  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     57   1.1        ad  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     58   1.1        ad  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     59   1.1        ad  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     60   1.1        ad  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     61   1.1        ad  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     62   1.1        ad  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     63   1.1        ad  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     64   1.1        ad  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     65   1.1        ad  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     66   1.1        ad  * SUCH DAMAGE.
     67   1.1        ad  */
     68   1.1        ad 
     69   1.5      matt #ifndef _DEV_DEC_DZVAR_H_
     70   1.5      matt #define _DEV_DEC_DZVAR_H_
     71   1.5      matt 
     72   1.3        ad /* A DZ-11 has 8 ports while a DZV/DZQ-11 has only 4. */
     73   1.1        ad 
     74   1.1        ad #define	NDZLINE 	8
     75   1.1        ad 
     76   1.1        ad #define	DZ_DZ		8
     77   1.1        ad #define	DZ_DZV		4
     78   1.1        ad #define	DZ_DC		4
     79   1.1        ad 
     80   1.1        ad #define DZ_C2I(c)	((c)<<3)	/* convert controller # to index */
     81   1.1        ad #define DZ_I2C(c)	((c)>>3)	/* convert minor to controller # */
     82   1.1        ad #define DZ_PORT(u)	((u)&07)	/* extract the port # */
     83   1.1        ad 
     84   1.1        ad struct	dz_softc {
     85  1.10      matt 	device_t	sc_dev;		/* Autoconf blaha */
     86  1.12   msaitoh 	struct	evcnt	sc_rintrcnt;	/* receive interrupt counts */
     87   1.1        ad 	struct	evcnt	sc_tintrcnt;	/* transmit interrupt counts */
     88   1.1        ad 	struct	dz_regs	sc_dr;		/* reg pointers */
     89   1.1        ad 	bus_space_tag_t	sc_iot;
     90   1.1        ad 	bus_space_handle_t sc_ioh;
     91   1.1        ad 	int		sc_type;	/* DZ11 or DZV11? */
     92   1.4        ad 	int		sc_consline;	/* console line, or -1 */
     93   1.1        ad 	int		sc_rxint;	/* Receive interrupt count XXX */
     94   1.1        ad 	u_char		sc_brk;		/* Break asserted on some lines */
     95   1.1        ad 	u_char		sc_dsr;		/* DSR set bits if no mdm ctrl */
     96   1.1        ad 	struct dz_linestate {
     97   1.1        ad 		struct	dz_softc *dz_sc;	/* backpointer to softc */
     98   1.2        ad 		int		dz_line;	/* channel number */
     99   1.1        ad 		void		*dz_private;	/* sub-driver data pointer */
    100   1.7     perry 		int		(*dz_catch)(void *, int); /* Fast catch recv */
    101   1.1        ad 		struct	tty *	dz_tty;		/* what we work on */
    102   1.1        ad #ifdef notyet
    103   1.9  christos 		void *		dz_mem;		/* pointers to clist output */
    104   1.9  christos 		void *		dz_end;		/*   allowing pdma action */
    105   1.1        ad #endif
    106   1.1        ad 	} sc_dz[NDZLINE];
    107   1.1        ad };
    108   1.1        ad 
    109   1.4        ad void	dzattach(struct dz_softc *, struct evcnt *, int);
    110   1.1        ad void	dzrint(void *);
    111   1.1        ad void	dzxint(void *);
    112  1.11    cegger void	dzreset(device_t);
    113   1.5      matt 
    114   1.5      matt #endif /* _DEV_DEC_DZVAR_H_ */
    115