Home | History | Annotate | Line # | Download | only in tc
      1  1.6    cegger /* $NetBSD: tcdsvar.h,v 1.6 2009/05/12 14:47:04 cegger Exp $ */
      2  1.1  nisimura 
      3  1.1  nisimura /*
      4  1.1  nisimura  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
      5  1.1  nisimura  * All rights reserved.
      6  1.1  nisimura  *
      7  1.1  nisimura  * Author: Chris G. Demetriou
      8  1.4     perry  *
      9  1.1  nisimura  * Permission to use, copy, modify and distribute this software and
     10  1.1  nisimura  * its documentation is hereby granted, provided that both the copyright
     11  1.1  nisimura  * notice and this permission notice appear in all copies of the
     12  1.1  nisimura  * software, derivative works or modified versions, and any portions
     13  1.1  nisimura  * thereof, and that both notices appear in supporting documentation.
     14  1.4     perry  *
     15  1.4     perry  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     16  1.4     perry  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     17  1.1  nisimura  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     18  1.4     perry  *
     19  1.1  nisimura  * Carnegie Mellon requests users of this software to return to
     20  1.1  nisimura  *
     21  1.1  nisimura  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     22  1.1  nisimura  *  School of Computer Science
     23  1.1  nisimura  *  Carnegie Mellon University
     24  1.1  nisimura  *  Pittsburgh PA 15213-3890
     25  1.1  nisimura  *
     26  1.1  nisimura  * any improvements or extensions that they make and grant Carnegie the
     27  1.1  nisimura  * rights to redistribute these changes.
     28  1.1  nisimura  */
     29  1.1  nisimura 
     30  1.1  nisimura struct tcds_slotconfig {
     31  1.1  nisimura 	/*
     32  1.1  nisimura 	 * Bookkeeping information
     33  1.1  nisimura 	 */
     34  1.1  nisimura 	int	sc_slot;
     35  1.1  nisimura 
     36  1.1  nisimura 	bus_space_tag_t sc_bst;			/* to frob TCDS regs */
     37  1.1  nisimura 	bus_space_handle_t sc_bsh;
     38  1.1  nisimura 
     39  1.3     perry 	int	(*sc_intrhand)(void *);	/* intr. handler */
     40  1.1  nisimura 	void	*sc_intrarg;			/* intr. handler arg. */
     41  1.1  nisimura 	struct evcnt sc_evcnt;			/* intr. count */
     42  1.2  nisimura 	char	sc_name[8];			/* ev_name */
     43  1.1  nisimura 
     44  1.1  nisimura 	/*
     45  1.1  nisimura 	 * Sets of bits in TCDS CIR and IMER that enable/check
     46  1.1  nisimura 	 * various things.
     47  1.1  nisimura 	 */
     48  1.1  nisimura 	u_int32_t sc_resetbits;
     49  1.1  nisimura 	u_int32_t sc_intrmaskbits;
     50  1.1  nisimura 	u_int32_t sc_intrbits;
     51  1.1  nisimura 	u_int32_t sc_dmabits;
     52  1.1  nisimura 	u_int32_t sc_errorbits;
     53  1.1  nisimura 
     54  1.1  nisimura 	/*
     55  1.1  nisimura 	 * Offsets to slot-specific DMA resources.
     56  1.1  nisimura 	 */
     57  1.1  nisimura 	bus_size_t sc_sda;
     58  1.1  nisimura 	bus_size_t sc_dic;
     59  1.1  nisimura 	bus_size_t sc_dud0;
     60  1.1  nisimura 	bus_size_t sc_dud1;
     61  1.1  nisimura };
     62  1.1  nisimura 
     63  1.1  nisimura struct tcdsdev_attach_args {
     64  1.1  nisimura 	bus_space_tag_t tcdsda_bst;		/* bus space tag */
     65  1.1  nisimura 	bus_space_handle_t tcdsda_bsh;		/* bus space handle */
     66  1.1  nisimura 	bus_dma_tag_t tcdsda_dmat;		/* bus dma tag */
     67  1.1  nisimura 	struct tcds_slotconfig *tcdsda_sc;	/* slot configuration */
     68  1.1  nisimura 	int	tcdsda_chip;			/* chip number */
     69  1.1  nisimura 	int	tcdsda_id;			/* SCSI ID */
     70  1.1  nisimura 	u_int	tcdsda_freq;			/* chip frequency */
     71  1.1  nisimura 	int	tcdsda_period;			/* min. sync period */
     72  1.1  nisimura 	int	tcdsda_variant;			/* NCR chip variant */
     73  1.1  nisimura 	int	tcdsda_fast;			/* chip does Fast mode */
     74  1.1  nisimura };
     75  1.1  nisimura 
     76  1.1  nisimura /*
     77  1.1  nisimura  * TCDS functions.
     78  1.1  nisimura  */
     79  1.6    cegger void	tcds_intr_establish(device_t, int, int (*)(void *), void *);
     80  1.6    cegger void	tcds_intr_disestablish(device_t, int);
     81  1.3     perry void	tcds_dma_enable(struct tcds_slotconfig *, int);
     82  1.3     perry void	tcds_scsi_enable(struct tcds_slotconfig *, int);
     83  1.3     perry int	tcds_scsi_iserr(struct tcds_slotconfig *);
     84  1.3     perry int	tcds_scsi_isintr(struct tcds_slotconfig *, int);
     85  1.3     perry void	tcds_scsi_reset(struct tcds_slotconfig *);
     86