Home | History | Annotate | Line # | Download | only in tc
      1 /*	$NetBSD: ioasicvar.h,v 1.23 2021/05/07 16:55:58 thorpej Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1995 Carnegie-Mellon University.
      5  * All rights reserved.
      6  *
      7  * Author: Chris G. Demetriou
      8  *
      9  * Permission to use, copy, modify and distribute this software and
     10  * its documentation is hereby granted, provided that both the copyright
     11  * notice and this permission notice appear in all copies of the
     12  * software, derivative works or modified versions, and any portions
     13  * thereof, and that both notices appear in supporting documentation.
     14  *
     15  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     16  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     17  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     18  *
     19  * Carnegie Mellon requests users of this software to return to
     20  *
     21  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     22  *  School of Computer Science
     23  *  Carnegie Mellon University
     24  *  Pittsburgh PA 15213-3890
     25  *
     26  * any improvements or extensions that they make and grant Carnegie the
     27  * rights to redistribute these changes.
     28  */
     29 
     30 #ifndef _DEV_TC_IOASICVAR_H_
     31 #define _DEV_TC_IOASICVAR_H_
     32 
     33 #include <sys/device.h>
     34 
     35 struct ioasic_dev {
     36 	const char	*iad_modname;
     37 	tc_offset_t	iad_offset;
     38 	void		*iad_cookie;
     39 	u_int32_t	iad_intrbits;
     40 };
     41 
     42 struct ioasicdev_attach_args {
     43 	char	iada_modname[TC_ROM_LLEN+1];
     44 	tc_offset_t iada_offset;
     45 	tc_addr_t iada_addr;
     46 	void	*iada_cookie;
     47 };
     48 
     49 struct ioasic_softc {
     50 	device_t sc_dev;
     51 	bus_space_tag_t sc_bst;
     52 	bus_space_handle_t sc_bsh;
     53 	bus_dma_tag_t sc_dmat;
     54 
     55 	tc_addr_t sc_base;		/* XXX offset XXX */
     56 };
     57 
     58 extern struct cfdriver ioasic_cd;
     59 
     60 /*
     61  * XXX Some drivers need direct access to IOASIC registers.
     62  */
     63 extern tc_addr_t ioasic_base;
     64 
     65 const struct evcnt *ioasic_intr_evcnt(device_t, void *);
     66 void    ioasic_intr_establish(device_t, void *,
     67 	    int, int (*)(void *), void *);
     68 void    ioasic_intr_disestablish(device_t, void *);
     69 void	ioasic_attach_devs(struct ioasic_softc *,
     70 	    const struct ioasic_dev *, int);
     71 
     72 #endif /* _DEV_TC_IOASICVAR_ */
     73