1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 #ifndef __DEV_TC_TCVAR_H__
32 #define __DEV_TC_TCVAR_H__
33
34
35
36
37
38 #include <machine/bus.h>
39 #include <dev/tc/tcreg.h>
40
41
42
43
44 #include <machine/tc_machdep.h>
45
46
47
48
49
50
51 #if 1
52
53
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
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
81
82 struct tcbus_attach_args {
83 char *tba_busname;
84 bus_space_tag_t tba_memt;
85
86
87 u_int tba_speed;
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
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
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;
114 };
115
116
117
118
119
120 struct tc_slotdesc {
121 tc_addr_t tcs_addr;
122 void *tcs_cookie;
123 int tcs_used;
124 };
125
126
127
128
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
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
149
150 #define tccf_slot cf_loc[0]
151 #define tccf_offset cf_loc[1]
152
153 #define TCCF_SLOT_UNKNOWN -1
154 #define TCCF_OFFSET_UNKNOWN -1
155
156
157
158
159 #define TC_SPEED_12_5_MHZ 0
160 #define TC_SPEED_25_MHZ 1
161
162 #endif