Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / dev / tc / tcvar.h
blobf0b2a3ab2c30eb662598b820f822c1375facdf5c
1 /* $NetBSD: tcvar.h,v 1.23 2007/10/19 12:01:20 ad Exp $ */
3 /*
4 * Copyright (c) 1995 Carnegie-Mellon University.
5 * All rights reserved.
7 * Author: Chris G. Demetriou
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.
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.
19 * Carnegie Mellon requests users of this software to return to
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
30 #ifndef __DEV_TC_TCVAR_H__
31 #define __DEV_TC_TCVAR_H__
34 * Definitions for TURBOchannel autoconfiguration.
37 #include <sys/bus.h>
38 #include <dev/tc/tcreg.h>
41 * Machine-dependent definitions.
43 #include <machine/tc_machdep.h>
46 * In the long run, the following block will go completely away.
47 * For now, the MI TC code still uses the old TC_IPL_ names
48 * and not the new IPL_ names.
50 #if 1
52 * Map the new definitions to the old.
54 #include <sys/intr.h>
56 #define tc_intrlevel_t int
58 #define TC_IPL_NONE IPL_NONE
59 #define TC_IPL_BIO IPL_BIO
60 #define TC_IPL_NET IPL_NET
61 #define TC_IPL_TTY IPL_TTY
62 #define TC_IPL_CLOCK IPL_CLOCK
63 #endif /* 1 */
65 struct tc_softc {
66 struct device sc_dv;
68 int sc_speed;
69 int sc_nslots;
70 struct tc_slotdesc *sc_slots;
72 const struct evcnt *(*sc_intr_evcnt)(device_t, void *);
73 void (*sc_intr_establish)(device_t, void *,
74 int, int (*)(void *), void *);
75 void (*sc_intr_disestablish)(device_t, void *);
76 bus_dma_tag_t (*sc_get_dma_tag)(int);
80 * Arguments used to attach TURBOchannel busses.
82 struct tcbus_attach_args {
83 const char *tba_busname; /* XXX should be common */
84 bus_space_tag_t tba_memt;
86 /* Bus information */
87 u_int tba_speed; /* see TC_SPEED_* below */
88 u_int tba_nslots;
89 struct tc_slotdesc *tba_slots;
90 u_int tba_nbuiltins;
91 const struct tc_builtin *tba_builtins;
94 /* TC bus resource management; XXX will move elsewhere eventually. */
95 const struct evcnt *(*tba_intr_evcnt)(device_t, void *);
96 void (*tba_intr_establish)(device_t, void *,
97 int, int (*)(void *), void *);
98 void (*tba_intr_disestablish)(device_t, void *);
99 bus_dma_tag_t (*tba_get_dma_tag)(int);
103 * Arguments used to attach TURBOchannel devices.
105 struct tc_attach_args {
106 bus_space_tag_t ta_memt;
107 bus_dma_tag_t ta_dmat;
109 char ta_modname[TC_ROM_LLEN+1];
110 u_int ta_slot;
111 tc_offset_t ta_offset;
112 tc_addr_t ta_addr;
113 void *ta_cookie;
114 u_int ta_busspeed; /* see TC_SPEED_* below */
118 * Description of TURBOchannel slots, provided by machine-dependent
119 * code to the TURBOchannel bus driver.
121 struct tc_slotdesc {
122 tc_addr_t tcs_addr;
123 void *tcs_cookie;
124 int tcs_used;
128 * Description of built-in TURBOchannel devices, provided by
129 * machine-dependent code to the TURBOchannel bus driver.
131 struct tc_builtin {
132 const char *tcb_modname;
133 u_int tcb_slot;
134 tc_offset_t tcb_offset;
135 void *tcb_cookie;
139 * Interrupt establishment functions.
141 int tc_checkslot(tc_addr_t, char *);
142 void tcattach(device_t, device_t, void *);
143 const struct evcnt *tc_intr_evcnt(device_t, void *);
144 void tc_intr_establish(device_t, void *, int, int (*)(void *),
145 void *);
146 void tc_intr_disestablish(device_t, void *);
149 * Miscellaneous definitions.
151 #define TC_SPEED_12_5_MHZ 0 /* 12.5MHz TC bus */
152 #define TC_SPEED_25_MHZ 1 /* 25MHz TC bus */
154 #endif /* __DEV_TC_TCVAR_H__ */