1996-11-14 00:13:04 +03:00
|
|
|
/* $NetBSD: tcdsvar.h,v 1.5 1996/11/13 21:13:38 cgd Exp $ */
|
1995-12-20 03:40:21 +03:00
|
|
|
|
|
|
|
/*
|
1996-04-12 10:07:05 +04:00
|
|
|
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
|
1995-12-20 03:40:21 +03:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Author: Chris G. Demetriou
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify and distribute this software and
|
|
|
|
* its documentation is hereby granted, provided that both the copyright
|
|
|
|
* notice and this permission notice appear in all copies of the
|
|
|
|
* software, derivative works or modified versions, and any portions
|
|
|
|
* thereof, and that both notices appear in supporting documentation.
|
|
|
|
*
|
|
|
|
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
|
|
|
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
|
|
|
|
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* Carnegie Mellon requests users of this software to return to
|
|
|
|
*
|
|
|
|
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
|
|
|
* School of Computer Science
|
|
|
|
* Carnegie Mellon University
|
|
|
|
* Pittsburgh PA 15213-3890
|
|
|
|
*
|
|
|
|
* any improvements or extensions that they make and grant Carnegie the
|
|
|
|
* rights to redistribute these changes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct tcds_slotconfig {
|
|
|
|
/*
|
|
|
|
* Bookkeeping information
|
|
|
|
*/
|
|
|
|
int sc_slot;
|
|
|
|
struct tcds_softc *sc_tcds; /* to frob TCDS regs */
|
|
|
|
struct esp_softc *sc_esp; /* to frob child's regs */
|
|
|
|
int (*sc_intrhand) __P((void *)); /* intr. handler */
|
|
|
|
void *sc_intrarg; /* intr. handler arg. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Sets of bits in TCDS CIR and IMER that enable/check
|
|
|
|
* various things.
|
|
|
|
*/
|
|
|
|
u_int32_t sc_resetbits;
|
|
|
|
u_int32_t sc_intrmaskbits;
|
|
|
|
u_int32_t sc_intrbits;
|
|
|
|
u_int32_t sc_dmabits;
|
|
|
|
u_int32_t sc_errorbits;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pointers to slot-specific DMA resources.
|
|
|
|
*/
|
|
|
|
volatile u_int32_t *sc_sda;
|
|
|
|
volatile u_int32_t *sc_dic;
|
|
|
|
volatile u_int32_t *sc_dud0;
|
|
|
|
volatile u_int32_t *sc_dud1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* DMA bookkeeping information.
|
|
|
|
*/
|
|
|
|
int sc_active; /* DMA active ? */
|
|
|
|
int sc_iswrite; /* DMA into main memory? */
|
|
|
|
size_t sc_dmasize;
|
|
|
|
caddr_t *sc_dmaaddr;
|
|
|
|
size_t *sc_dmalen;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct tcdsdev_attach_args {
|
1996-04-12 05:31:43 +04:00
|
|
|
struct tc_attach_args tcdsda_ta;
|
1995-12-20 03:40:21 +03:00
|
|
|
struct tcds_slotconfig *tcdsda_sc;
|
|
|
|
u_int tcdsda_id;
|
|
|
|
u_int tcdsda_freq;
|
|
|
|
};
|
1996-04-12 05:31:43 +04:00
|
|
|
#define tcdsda_modname tcdsda_ta.ta_modname
|
|
|
|
#define tcdsda_slot tcdsda_ta.ta_slot
|
|
|
|
#define tcdsda_offset tcdsda_ta.ta_offset
|
|
|
|
#define tcdsda_addr tcdsda_ta.ta_addr
|
|
|
|
#define tcdsda_cookie tcdsda_ta.ta_cookie
|
1995-12-20 03:40:21 +03:00
|
|
|
|
|
|
|
#define TCDS_REG(base, off) \
|
|
|
|
(volatile u_int32_t *)TC_DENSE_TO_SPARSE((base) + (off))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* TCDS functions.
|
|
|
|
*/
|
|
|
|
void tcds_intr_establish __P((struct device *, void *, tc_intrlevel_t,
|
|
|
|
int (*)(void *), void *));
|
|
|
|
void tcds_intr_disestablish __P((struct device *, void *));
|
|
|
|
void tcds_dma_enable __P((struct tcds_slotconfig *, int));
|
|
|
|
void tcds_scsi_enable __P((struct tcds_slotconfig *, int));
|
1996-11-14 00:13:04 +03:00
|
|
|
int tcds_scsi_iserr __P((struct tcds_slotconfig *));
|
1995-12-20 03:40:21 +03:00
|
|
|
int tcds_scsi_isintr __P((struct tcds_slotconfig *, int));
|
|
|
|
void tcds_scsi_reset __P((struct tcds_slotconfig *));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* TCDS DMA functions (used the the 53c94 driver)
|
|
|
|
*/
|
|
|
|
int tcds_dma_isintr __P((struct tcds_slotconfig *));
|
1996-09-09 22:10:35 +04:00
|
|
|
void tcds_dma_reset __P((struct tcds_slotconfig *));
|
|
|
|
int tcds_dma_intr __P((struct tcds_slotconfig *));
|
|
|
|
int tcds_dma_setup __P((struct tcds_slotconfig *, caddr_t *, size_t *,
|
|
|
|
int, size_t *));
|
|
|
|
void tcds_dma_go __P((struct tcds_slotconfig *));
|
|
|
|
int tcds_dma_isactive __P((struct tcds_slotconfig *));
|
1995-12-20 03:40:21 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The TCDS (bus) cfdriver, so that subdevices can more
|
|
|
|
* easily tell what bus they're on.
|
|
|
|
*/
|
1996-04-12 05:31:43 +04:00
|
|
|
extern struct cfdriver tcds_cd;
|