Annotation of sys/dev/tc/tcvar.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: tcvar.h,v 1.12 2004/06/28 02:28:43 aaron Exp $ */
2: /* $NetBSD: tcvar.h,v 1.17 2000/06/04 19:15:15 cgd Exp $ */
3:
4: /*
5: * Copyright (c) 1995 Carnegie-Mellon University.
6: * All rights reserved.
7: *
8: * Author: Chris G. Demetriou
9: *
10: * Permission to use, copy, modify and distribute this software and
11: * its documentation is hereby granted, provided that both the copyright
12: * notice and this permission notice appear in all copies of the
13: * software, derivative works or modified versions, and any portions
14: * thereof, and that both notices appear in supporting documentation.
15: *
16: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18: * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19: *
20: * Carnegie Mellon requests users of this software to return to
21: *
22: * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23: * School of Computer Science
24: * Carnegie Mellon University
25: * Pittsburgh PA 15213-3890
26: *
27: * any improvements or extensions that they make and grant Carnegie the
28: * rights to redistribute these changes.
29: */
30:
31: #ifndef __DEV_TC_TCVAR_H__
32: #define __DEV_TC_TCVAR_H__
33:
34: /*
35: * Definitions for TURBOchannel autoconfiguration.
36: */
37:
38: #include <machine/bus.h>
39: #include <dev/tc/tcreg.h>
40:
41: /*
42: * Machine-dependent definitions.
43: */
44: #include <machine/tc_machdep.h>
45:
46: /*
47: * In the long run, the following block will go completely away.
48: * For now, the MI TC code still uses the old TC_IPL_ names
49: * and not the new IPL_ names.
50: */
51: #if 1
52: /*
53: * Map the new definitions to the old.
54: */
55: #include <machine/intr.h>
56:
57: #define tc_intrlevel_t int
58:
59: #define TC_IPL_NONE IPL_NONE
60: #define TC_IPL_BIO IPL_BIO
61: #define TC_IPL_NET IPL_NET
62: #define TC_IPL_TTY IPL_TTY
63: #define TC_IPL_CLOCK IPL_CLOCK
64: #endif /* 1 */
65:
66: struct tc_softc {
67: struct device sc_dv;
68:
69: int sc_speed;
70: int sc_nslots;
71: struct tc_slotdesc *sc_slots;
72:
73: void (*sc_intr_establish)(struct device *, void *,
74: int, int (*)(void *), void *);
75: void (*sc_intr_disestablish)(struct device *, void *);
76: bus_dma_tag_t (*sc_get_dma_tag)(int);
77: };
78:
79: /*
80: * Arguments used to attach TURBOchannel busses.
81: */
82: struct tcbus_attach_args {
83: char *tba_busname; /* XXX should be common */
84: bus_space_tag_t tba_memt;
85:
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;
92:
93:
94: /* TC bus resource management; XXX will move elsewhere eventually. */
95: void (*tba_intr_establish)(struct device *, void *,
96: int, int (*)(void *), void *);
97: void (*tba_intr_disestablish)(struct device *, void *);
98: bus_dma_tag_t (*tba_get_dma_tag)(int);
99: };
100:
101: /*
102: * Arguments used to attach TURBOchannel devices.
103: */
104: struct tc_attach_args {
105: bus_space_tag_t ta_memt;
106: bus_dma_tag_t ta_dmat;
107:
108: char ta_modname[TC_ROM_LLEN+1];
109: u_int ta_slot;
110: tc_offset_t ta_offset;
111: tc_addr_t ta_addr;
112: void *ta_cookie;
113: u_int ta_busspeed; /* see TC_SPEED_* below */
114: };
115:
116: /*
117: * Description of TURBOchannel slots, provided by machine-dependent
118: * code to the TURBOchannel bus driver.
119: */
120: struct tc_slotdesc {
121: tc_addr_t tcs_addr;
122: void *tcs_cookie;
123: int tcs_used;
124: };
125:
126: /*
127: * Description of built-in TURBOchannel devices, provided by
128: * machine-dependent code to the TURBOchannel bus driver.
129: */
130: struct tc_builtin {
131: char *tcb_modname;
132: u_int tcb_slot;
133: tc_offset_t tcb_offset;
134: void *tcb_cookie;
135: };
136:
137: /*
138: * Interrupt establishment functions.
139: */
140: int tc_checkslot(tc_addr_t, char *);
141: void tc_devinfo(const char *, char *, size_t);
142: void tcattach(struct device *, struct device *, void *);
143: void tc_intr_establish(struct device *, void *, int, int (*)(void *),
144: void *);
145: void tc_intr_disestablish(struct device *, void *);
146:
147: /*
148: * Easy to remember names for TURBOchannel device locators.
149: */
150: #define tccf_slot cf_loc[0] /* slot */
151: #define tccf_offset cf_loc[1] /* offset */
152:
153: #define TCCF_SLOT_UNKNOWN -1
154: #define TCCF_OFFSET_UNKNOWN -1
155:
156: /*
157: * Miscellaneous definitions.
158: */
159: #define TC_SPEED_12_5_MHZ 0 /* 12.5MHz TC bus */
160: #define TC_SPEED_25_MHZ 1 /* 25MHz TC bus */
161:
162: #endif /* __DEV_TC_TCVAR_H__ */
CVSweb