Home | History | Annotate | Line # | Download | only in tc
tcvar.h revision 1.1
      1 /*	$NetBSD: tcvar.h,v 1.1 1995/12/20 00:48:36 cgd 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_TCVAR_H__
     31 #define __DEV_TC_TCVAR_H__
     32 
     33 /*
     34  * TurboChannel autoconfiguration definitions.
     35  */
     36 
     37 #include <dev/tc/tcreg.h>
     38 #include <machine/tc_machdep.h>
     39 
     40 /*
     41  * Interrupt levels.  XXX should be common, elsewhere.
     42  */
     43 typedef enum {
     44 	TC_IPL_NONE,			/* block only this interrupt */
     45 	TC_IPL_BIO,			/* block disk interrupts */
     46 	TC_IPL_NET,			/* block network interrupts */
     47 	TC_IPL_TTY,			/* block terminal interrupts */
     48 	TC_IPL_CLOCK,			/* block clock interrupts */
     49 } tc_intrlevel_t;
     50 
     51 /*
     52  * Arguments used to attach TurboChannel busses.
     53  */
     54 struct tc_attach_args {
     55 	u_int	tca_nslots;
     56 	struct tc_slotdesc *tca_slots;
     57 
     58 	u_int	tca_nbuiltins;
     59 	const struct tc_builtin *tca_builtins;
     60 
     61 	void	(*tca_intr_establish) __P((struct device *, void *,
     62 		    tc_intrlevel_t, int (*)(void *), void *));
     63 	void	(*tca_intr_disestablish) __P((struct device *, void *));
     64 };
     65 
     66 /*
     67  * Arguments used to attach TurboChannel devices.
     68  */
     69 struct tcdev_attach_args {
     70 	char	tcda_modname[TC_ROM_LLEN+1];
     71 	u_int	tcda_slot;
     72 	tc_offset_t tcda_offset;
     73 	tc_addr_t tcda_addr;
     74 	void	*tcda_cookie;
     75 };
     76 
     77 /*
     78  * Description of TurboChannel slots, provided by machine-dependent
     79  * code to the TurboChannel bus driver.
     80  */
     81 struct tc_slotdesc {
     82 	tc_addr_t tcs_addr;
     83 	void	*tcs_cookie;
     84 	int	tcs_used;
     85 };
     86 
     87 /*
     88  * Description of built-in TurboChannel devices, provided by
     89  * machine-dependent code to the TurboChannel bus driver.
     90  */
     91 struct tc_builtin {
     92 	char	*tcb_modname;
     93 	u_int	tcb_slot;
     94 	tc_offset_t tcb_offset;
     95 	void	*tcb_cookie;
     96 };
     97 
     98 /*
     99  * Interrupt establishment functions.
    100  */
    101 void	tc_intr_establish __P((struct device *, void *, tc_intrlevel_t,
    102 	    int (*)(void *), void *));
    103 void	tc_intr_disestablish __P((struct device *, void *));
    104 
    105 /*
    106  * Easy to remember names for TurboChannel device locators.
    107  */
    108 #define	tccf_slot	cf_loc[0]		/* slot */
    109 #define	tccf_offset	cf_loc[1]		/* offset */
    110 
    111 #define	TCCF_SLOT_UNKNOWN	-1
    112 #define	TCCF_OFFSET_UNKNOWN	-1
    113 
    114 /*
    115  * The TurboChannel bus cfdriver, so that subdevices can more
    116  * easily tell what bus they're on.
    117  */
    118 extern struct cfdriver tccd;
    119 
    120 #endif /* __DEV_TC_TCVAR_H__ */
    121