if_we_mca.c revision 1.1.2.3 1 1.1.2.3 bouyer /* $NetBSD: if_we_mca.c,v 1.1.2.3 2001/04/21 17:48:54 bouyer Exp $ */
2 1.1.2.2 bouyer
3 1.1.2.2 bouyer /*-
4 1.1.2.3 bouyer * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
5 1.1.2.2 bouyer * All rights reserved.
6 1.1.2.2 bouyer *
7 1.1.2.2 bouyer * This code is derived from software contributed to The NetBSD Foundation
8 1.1.2.2 bouyer * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 1.1.2.2 bouyer * NASA Ames Research Center, and Jaromir Dolecek.
10 1.1.2.2 bouyer *
11 1.1.2.2 bouyer * Redistribution and use in source and binary forms, with or without
12 1.1.2.2 bouyer * modification, are permitted provided that the following conditions
13 1.1.2.2 bouyer * are met:
14 1.1.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
15 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer.
16 1.1.2.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
17 1.1.2.2 bouyer * notice, this list of conditions and the following disclaimer in the
18 1.1.2.2 bouyer * documentation and/or other materials provided with the distribution.
19 1.1.2.2 bouyer * 3. All advertising materials mentioning features or use of this software
20 1.1.2.2 bouyer * must display the following acknowledgement:
21 1.1.2.2 bouyer * This product includes software developed by the NetBSD
22 1.1.2.2 bouyer * Foundation, Inc. and its contributors.
23 1.1.2.2 bouyer * 4. Neither the name of The NetBSD Foundation nor the names of its
24 1.1.2.2 bouyer * contributors may be used to endorse or promote products derived
25 1.1.2.2 bouyer * from this software without specific prior written permission.
26 1.1.2.2 bouyer *
27 1.1.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 1.1.2.2 bouyer * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 1.1.2.2 bouyer * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 1.1.2.2 bouyer * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 1.1.2.2 bouyer * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 1.1.2.2 bouyer * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 1.1.2.2 bouyer * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 1.1.2.2 bouyer * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 1.1.2.2 bouyer * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 1.1.2.2 bouyer * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 1.1.2.2 bouyer * POSSIBILITY OF SUCH DAMAGE.
38 1.1.2.2 bouyer */
39 1.1.2.2 bouyer
40 1.1.2.2 bouyer /*
41 1.1.2.2 bouyer * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
42 1.1.2.2 bouyer * adapters.
43 1.1.2.2 bouyer *
44 1.1.2.2 bouyer * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
45 1.1.2.2 bouyer *
46 1.1.2.2 bouyer * Copyright (C) 1993, David Greenman. This software may be used, modified,
47 1.1.2.2 bouyer * copied, distributed, and sold, in both source and binary form provided that
48 1.1.2.2 bouyer * the above copyright and these terms are retained. Under no circumstances is
49 1.1.2.2 bouyer * the author responsible for the proper functioning of this software, nor does
50 1.1.2.2 bouyer * the author assume any responsibility for damages incurred with its use.
51 1.1.2.2 bouyer */
52 1.1.2.2 bouyer
53 1.1.2.2 bouyer /*
54 1.1.2.2 bouyer * Device driver for the Western Digital/SMC 8003 and 8013 series,
55 1.1.2.2 bouyer * and the SMC Elite Ultra (8216).
56 1.1.2.2 bouyer *
57 1.1.2.2 bouyer * Currently only tested with WD8003W/A. Other WD8003-based cards
58 1.1.2.2 bouyer * should work without problems, the SMC Elite based ones hopefully too.
59 1.1.2.2 bouyer */
60 1.1.2.2 bouyer
61 1.1.2.2 bouyer #include <sys/param.h>
62 1.1.2.2 bouyer #include <sys/systm.h>
63 1.1.2.2 bouyer #include <sys/device.h>
64 1.1.2.2 bouyer #include <sys/socket.h>
65 1.1.2.2 bouyer #include <sys/mbuf.h>
66 1.1.2.2 bouyer
67 1.1.2.2 bouyer #include <net/if.h>
68 1.1.2.2 bouyer #include <net/if_types.h>
69 1.1.2.2 bouyer #include <net/if_media.h>
70 1.1.2.2 bouyer #include <net/if_ether.h>
71 1.1.2.2 bouyer
72 1.1.2.2 bouyer #include <machine/bus.h>
73 1.1.2.2 bouyer
74 1.1.2.2 bouyer #include <dev/mca/mcareg.h>
75 1.1.2.2 bouyer #include <dev/mca/mcavar.h>
76 1.1.2.2 bouyer #include <dev/mca/mcadevs.h>
77 1.1.2.2 bouyer
78 1.1.2.2 bouyer #include <dev/ic/dp8390reg.h>
79 1.1.2.2 bouyer #include <dev/ic/dp8390var.h>
80 1.1.2.2 bouyer #include <dev/ic/wereg.h>
81 1.1.2.2 bouyer #include <dev/ic/wevar.h>
82 1.1.2.2 bouyer
83 1.1.2.2 bouyer #define WD_8003 0x01
84 1.1.2.2 bouyer #define WD_ELITE 0x02
85 1.1.2.2 bouyer #define WD_MEMSIZE 16384 /* all supported cards have 16K Bytes memory */
86 1.1.2.2 bouyer
87 1.1.2.2 bouyer int we_mca_probe __P((struct device *, struct cfdata *, void *));
88 1.1.2.2 bouyer void we_mca_attach __P((struct device *, struct device *, void *));
89 1.1.2.2 bouyer void we_mca_init_hook __P((struct we_softc *));
90 1.1.2.2 bouyer
91 1.1.2.2 bouyer struct cfattach we_mca_ca = {
92 1.1.2.2 bouyer sizeof(struct we_softc), we_mca_probe, we_mca_attach
93 1.1.2.2 bouyer };
94 1.1.2.2 bouyer
95 1.1.2.2 bouyer /*
96 1.1.2.2 bouyer * The types for some cards may not be correct; hopefully it's close
97 1.1.2.2 bouyer * enough.
98 1.1.2.2 bouyer */
99 1.1.2.2 bouyer static const struct we_mca_product {
100 1.1.2.2 bouyer u_int32_t we_id;
101 1.1.2.2 bouyer const char *we_name;
102 1.1.2.2 bouyer int we_flag;
103 1.1.2.2 bouyer int we_type;
104 1.1.2.2 bouyer const char *we_typestr;
105 1.1.2.2 bouyer } we_mca_products[] = {
106 1.1.2.2 bouyer { MCA_PRODUCT_WD_8013EP, "EtherCard PLUS Elite/A (8013EP/A)",
107 1.1.2.2 bouyer WD_ELITE, WE_TYPE_WD8013EP, "WD8013EP/A" },
108 1.1.2.2 bouyer { MCA_PRODUCT_WD_8013WP, "EtherCard PLUS Elite 10T/A (8013WP/A)",
109 1.1.2.2 bouyer WD_ELITE, WE_TYPE_WD8013EP, "WD8013WP/A" }, /* XXX */
110 1.1.2.2 bouyer { MCA_PRODUCT_IBM_WD_2,"IBM PS/2 Adapter/A for Ethernet Networks (UTP)",
111 1.1.2.2 bouyer WD_ELITE, WE_TYPE_WD8013EP, "WD8013WP/A"}, /* XXX */
112 1.1.2.2 bouyer { MCA_PRODUCT_IBM_WD_T,"IBM PS/2 Adapter/A for Ethernet Networks (BNC)",
113 1.1.2.2 bouyer WD_ELITE, WE_TYPE_WD8013EP, "WD8013WP/A"}, /* XXX */
114 1.1.2.2 bouyer { MCA_PRODUCT_WD_8003E, "WD EtherCard PLUS/A (WD8003E/A or WD8003ET/A)",
115 1.1.2.2 bouyer WD_8003, WE_TYPE_WD8003E, "WD8003E/A or WD8003ET/A" },
116 1.1.2.2 bouyer { MCA_PRODUCT_WD_8003ST,"WD StarCard PLUS/A (WD8003ST/A)",
117 1.1.2.2 bouyer WD_8003, WE_TYPE_WD8003W, "WD8003ST/A" }, /* XXX */
118 1.1.2.2 bouyer { MCA_PRODUCT_WD_8003W, "WD EtherCard PLUS 10T/A (WD8003W/A)",
119 1.1.2.2 bouyer WD_8003, WE_TYPE_WD8003W, "WD8003W/A" },
120 1.1.2.2 bouyer { MCA_PRODUCT_IBM_WD_O, "IBM PS/2 Adapter/A for Ethernet Networks",
121 1.1.2.2 bouyer WD_8003, WE_TYPE_WD8003W, "IBM PS/2 Adapter/A" },/*XXX*/
122 1.1.2.2 bouyer { 0x0000, NULL },
123 1.1.2.2 bouyer };
124 1.1.2.2 bouyer
125 1.1.2.2 bouyer /* see POS description in we_mca_attach() */
126 1.1.2.2 bouyer static const int we_mca_irq[] = {
127 1.1.2.2 bouyer 3, 4, 10, 15,
128 1.1.2.2 bouyer };
129 1.1.2.2 bouyer
130 1.1.2.2 bouyer /* memory position and shared RAM sizes for WD8013-type of cards */
131 1.1.2.2 bouyer static const struct {
132 1.1.2.2 bouyer u_int8_t id;
133 1.1.2.2 bouyer int maddr;
134 1.1.2.2 bouyer int memsize;
135 1.1.2.2 bouyer } we_mca_elite_mem[] = {
136 1.1.2.2 bouyer { 0x10, 0x0C0000, 16384 },
137 1.1.2.2 bouyer { 0x12, 0x0C4000, 16384 },
138 1.1.2.2 bouyer { 0x14, 0x0C8000, 16384 },
139 1.1.2.2 bouyer { 0x16, 0x0CC000, 16384 },
140 1.1.2.2 bouyer { 0x18, 0x0D0000, 16384 },
141 1.1.2.2 bouyer { 0x1A, 0x0D4000, 16384 },
142 1.1.2.2 bouyer { 0x1C, 0x0D8000, 16384 },
143 1.1.2.2 bouyer { 0x1E, 0x0DC000, 16384 },
144 1.1.2.2 bouyer { 0x90, 0xFC0000, 16384 },
145 1.1.2.2 bouyer { 0x94, 0xFC8000, 16384 },
146 1.1.2.2 bouyer { 0x98, 0xFD0000, 16384 },
147 1.1.2.2 bouyer { 0x9C, 0x0C0000, 16384 },
148 1.1.2.2 bouyer { 0x00, 0x0C0000, 8192 },
149 1.1.2.2 bouyer { 0x01, 0x0C2000, 8192 },
150 1.1.2.2 bouyer { 0x10, 0x0C4000, 8192 },
151 1.1.2.2 bouyer { 0x11, 0x0C6000, 8192 },
152 1.1.2.2 bouyer { 0x00, 0x000000, 0 },
153 1.1.2.2 bouyer };
154 1.1.2.2 bouyer
155 1.1.2.2 bouyer
156 1.1.2.2 bouyer static const struct we_mca_product *we_mca_lookup __P((int));
157 1.1.2.2 bouyer
158 1.1.2.2 bouyer static const struct we_mca_product *
159 1.1.2.2 bouyer we_mca_lookup(id)
160 1.1.2.2 bouyer int id;
161 1.1.2.2 bouyer {
162 1.1.2.2 bouyer const struct we_mca_product *wep;
163 1.1.2.2 bouyer
164 1.1.2.2 bouyer for(wep = we_mca_products; wep->we_name; wep++)
165 1.1.2.2 bouyer if (wep->we_id == id)
166 1.1.2.2 bouyer return (wep);
167 1.1.2.2 bouyer
168 1.1.2.2 bouyer return (NULL);
169 1.1.2.2 bouyer }
170 1.1.2.2 bouyer
171 1.1.2.2 bouyer int
172 1.1.2.2 bouyer we_mca_probe(parent, cf, aux)
173 1.1.2.2 bouyer struct device *parent;
174 1.1.2.2 bouyer struct cfdata *cf;
175 1.1.2.2 bouyer void *aux;
176 1.1.2.2 bouyer {
177 1.1.2.2 bouyer struct mca_attach_args *ma = aux;
178 1.1.2.2 bouyer
179 1.1.2.2 bouyer return (we_mca_lookup(ma->ma_id) != NULL);
180 1.1.2.2 bouyer }
181 1.1.2.2 bouyer
182 1.1.2.2 bouyer void
183 1.1.2.2 bouyer we_mca_attach(parent, self, aux)
184 1.1.2.2 bouyer struct device *parent, *self;
185 1.1.2.2 bouyer void *aux;
186 1.1.2.2 bouyer {
187 1.1.2.2 bouyer struct we_softc *wsc = (struct we_softc *)self;
188 1.1.2.2 bouyer struct dp8390_softc *sc = &wsc->sc_dp8390;
189 1.1.2.2 bouyer struct mca_attach_args *ma = aux;
190 1.1.2.2 bouyer const struct we_mca_product *wep;
191 1.1.2.2 bouyer bus_space_tag_t nict, asict, memt;
192 1.1.2.2 bouyer bus_space_handle_t nich, asich, memh;
193 1.1.2.2 bouyer const char *typestr;
194 1.1.2.2 bouyer int irq, iobase, maddr;
195 1.1.2.2 bouyer int pos2, pos3, pos5;
196 1.1.2.2 bouyer
197 1.1.2.2 bouyer pos2 = mca_conf_read(ma->ma_mc, ma->ma_slot, 2);
198 1.1.2.2 bouyer pos3 = mca_conf_read(ma->ma_mc, ma->ma_slot, 3);
199 1.1.2.2 bouyer pos5 = mca_conf_read(ma->ma_mc, ma->ma_slot, 5);
200 1.1.2.2 bouyer
201 1.1.2.2 bouyer /*
202 1.1.2.2 bouyer * POS registers differ much between 8003 and 8013, so they are
203 1.1.2.2 bouyer * divided to two sections.
204 1.1.2.2 bouyer *
205 1.1.2.2 bouyer * 8003: POS register 2: (adf pos0)
206 1.1.2.2 bouyer * 7 6 5 4 3 2 1 0
207 1.1.2.2 bouyer * 0 0 1 \___/ \__ enable: 0=adapter disabled, 1=adapter enabled
208 1.1.2.2 bouyer * \_____ Adapter IO Space: 0x200-0x29F + XX*0x20
209 1.1.2.2 bouyer *
210 1.1.2.2 bouyer * 8003: POS register 3: (adf pos1)
211 1.1.2.2 bouyer * 7 6 5 4 3 2 1 0
212 1.1.2.2 bouyer * 1 1 0 \__/ 1 X
213 1.1.2.2 bouyer * \______ Shared Ram Space (16K Bytes):
214 1.1.2.2 bouyer * 0xC0000-0xC3FFF + XX * 0x4000
215 1.1.2.2 bouyer *
216 1.1.2.2 bouyer * 8003: POS register 5: (adf pos3)
217 1.1.2.2 bouyer * 7 6 5 4 3 2 1 0
218 1.1.2.2 bouyer * \_/
219 1.1.2.2 bouyer * \__ Interrupt Level: 00=3 01=4 10=10 11=15
220 1.1.2.2 bouyer *
221 1.1.2.2 bouyer * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
222 1.1.2.2 bouyer *
223 1.1.2.2 bouyer * 8013: POS register 2: (adf pos0)
224 1.1.2.2 bouyer * 7 6 5 4 3 2 1 0
225 1.1.2.2 bouyer * \____/ \__ enable: 0=adapter disabled, 1=adapter enabled
226 1.1.2.2 bouyer * \___________ Adapter I/O Space: 0x0800-0x081F + XX * 0x1000
227 1.1.2.2 bouyer *
228 1.1.2.2 bouyer * 8013: POS register 3: (adf pos1)
229 1.1.2.2 bouyer * 7 6 5 4 3 2 1 0
230 1.1.2.2 bouyer * X 0 Shared Ram Base Address - mask 0x9f
231 1.1.2.2 bouyer * see wd_elite_mem[] array for details
232 1.1.2.2 bouyer *
233 1.1.2.2 bouyer * 8013: POS register 5: (adf pos3)
234 1.1.2.2 bouyer * 7 6 5 4 3 2 1 0
235 1.1.2.2 bouyer * \_/ \_/
236 1.1.2.2 bouyer * \ \__ Media Select: 00=TwPr (no link) 10=BNC
237 1.1.2.2 bouyer * \ 01=AUI|AUI or 10BaseT
238 1.1.2.2 bouyer * \____ Interrupt Level: 00=3 01=4 10=10 11=14
239 1.1.2.2 bouyer */
240 1.1.2.2 bouyer
241 1.1.2.2 bouyer wep = we_mca_lookup(ma->ma_id);
242 1.1.2.2 bouyer #ifdef DIAGNOSTIC
243 1.1.2.2 bouyer if (wep == NULL) {
244 1.1.2.2 bouyer printf("\n%s: where did the card go?\n", sc->sc_dev.dv_xname);
245 1.1.2.2 bouyer return;
246 1.1.2.2 bouyer }
247 1.1.2.2 bouyer #endif
248 1.1.2.2 bouyer
249 1.1.2.2 bouyer if (wep->we_flag & WD_8003) {
250 1.1.2.2 bouyer /* WD8003 based */
251 1.1.2.2 bouyer iobase = 0x200 + (((pos2 & 0x0e) >> 1) * 0x020);
252 1.1.2.2 bouyer maddr = 0xC0000 + (((pos3 & 0x1c) >> 2) * 0x04000);
253 1.1.2.2 bouyer irq = we_mca_irq[(pos5 & 0x03)];
254 1.1.2.2 bouyer sc->mem_size = WD_MEMSIZE;
255 1.1.2.2 bouyer } else {
256 1.1.2.2 bouyer /* SMC Elite */
257 1.1.2.2 bouyer int i, id;
258 1.1.2.2 bouyer
259 1.1.2.2 bouyer iobase = 0x800 + (((pos2 & 0xf0) >> 4) * 0x1000);
260 1.1.2.2 bouyer irq = we_mca_irq[(pos5 & 0x06) >> 2];
261 1.1.2.2 bouyer
262 1.1.2.2 bouyer /* find location of shared mem and it's size */
263 1.1.2.2 bouyer id = (pos3 & 0x9f);
264 1.1.2.2 bouyer for(i=0; we_mca_elite_mem[i].maddr; i++)
265 1.1.2.2 bouyer if (we_mca_elite_mem[i].id == id)
266 1.1.2.2 bouyer break;
267 1.1.2.2 bouyer if (we_mca_elite_mem[i].maddr == 0) {
268 1.1.2.2 bouyer printf("\n%s: cannot find Shared Ram Base Address\n",
269 1.1.2.2 bouyer sc->sc_dev.dv_xname);
270 1.1.2.2 bouyer return;
271 1.1.2.2 bouyer }
272 1.1.2.2 bouyer
273 1.1.2.2 bouyer maddr = we_mca_elite_mem[i].maddr;
274 1.1.2.2 bouyer sc->mem_size = we_mca_elite_mem[i].memsize;
275 1.1.2.2 bouyer }
276 1.1.2.2 bouyer
277 1.1.2.2 bouyer nict = asict = ma->ma_iot;
278 1.1.2.2 bouyer memt = ma->ma_memt;
279 1.1.2.2 bouyer
280 1.1.2.2 bouyer printf(" slot %d: %s\n", ma->ma_slot + 1, wep->we_name);
281 1.1.2.2 bouyer
282 1.1.2.2 bouyer /* Map the device. */
283 1.1.2.2 bouyer if (bus_space_map(asict, iobase, WE_NPORTS, 0, &asich)) {
284 1.1.2.2 bouyer printf("%s: can't map nic i/o space\n",
285 1.1.2.2 bouyer sc->sc_dev.dv_xname);
286 1.1.2.2 bouyer return;
287 1.1.2.2 bouyer }
288 1.1.2.2 bouyer
289 1.1.2.2 bouyer if (bus_space_subregion(asict, asich, WE_NIC_OFFSET, WE_NIC_NPORTS,
290 1.1.2.2 bouyer &nich)) {
291 1.1.2.2 bouyer printf("%s: can't subregion i/o space\n",
292 1.1.2.2 bouyer sc->sc_dev.dv_xname);
293 1.1.2.2 bouyer return;
294 1.1.2.2 bouyer }
295 1.1.2.2 bouyer
296 1.1.2.2 bouyer wsc->sc_type = wep->we_type;
297 1.1.2.2 bouyer wsc->sc_16bitp = 1; /* all cards we support are 16bit */
298 1.1.2.2 bouyer sc->is790 = 0;
299 1.1.2.2 bouyer typestr = wep->we_typestr;
300 1.1.2.2 bouyer
301 1.1.2.2 bouyer /*
302 1.1.2.2 bouyer * Map memory space.
303 1.1.2.2 bouyer */
304 1.1.2.2 bouyer if (bus_space_map(memt, maddr, sc->mem_size, 0, &memh)) {
305 1.1.2.2 bouyer printf("%s: can't map shared memory\n",
306 1.1.2.2 bouyer sc->sc_dev.dv_xname);
307 1.1.2.2 bouyer return;
308 1.1.2.2 bouyer }
309 1.1.2.2 bouyer
310 1.1.2.2 bouyer wsc->sc_asict = asict;
311 1.1.2.2 bouyer wsc->sc_asich = asich;
312 1.1.2.2 bouyer
313 1.1.2.2 bouyer sc->sc_regt = nict;
314 1.1.2.2 bouyer sc->sc_regh = nich;
315 1.1.2.2 bouyer
316 1.1.2.2 bouyer sc->sc_buft = memt;
317 1.1.2.2 bouyer sc->sc_bufh = memh;
318 1.1.2.2 bouyer
319 1.1.2.2 bouyer wsc->sc_maddr = maddr;
320 1.1.2.2 bouyer
321 1.1.2.2 bouyer /* Interface is always enabled. */
322 1.1.2.2 bouyer sc->sc_enabled = 1;
323 1.1.2.2 bouyer
324 1.1.2.2 bouyer wsc->sc_init_hook = we_mca_init_hook;
325 1.1.2.2 bouyer
326 1.1.2.2 bouyer if (we_config(self, wsc, typestr))
327 1.1.2.2 bouyer return;
328 1.1.2.2 bouyer
329 1.1.2.2 bouyer /* Map and establish the interrupt. */
330 1.1.2.2 bouyer wsc->sc_ih = mca_intr_establish(ma->ma_mc, irq,
331 1.1.2.2 bouyer IPL_NET, dp8390_intr, sc);
332 1.1.2.2 bouyer if (wsc->sc_ih == NULL) {
333 1.1.2.2 bouyer printf("%s: can't establish interrupt\n", sc->sc_dev.dv_xname);
334 1.1.2.2 bouyer return;
335 1.1.2.2 bouyer }
336 1.1.2.2 bouyer printf("%s: interrupting at irq %d\n", sc->sc_dev.dv_xname, irq);
337 1.1.2.2 bouyer }
338 1.1.2.2 bouyer
339 1.1.2.2 bouyer void
340 1.1.2.2 bouyer we_mca_init_hook(wsc)
341 1.1.2.2 bouyer struct we_softc *wsc;
342 1.1.2.2 bouyer {
343 1.1.2.2 bouyer /*
344 1.1.2.2 bouyer * This quirk really needs to be here, at least for WD8003W/A. Without
345 1.1.2.2 bouyer * this, the card doesn't send any interrupts in 16bit mode. The quirk
346 1.1.2.2 bouyer * was taken from Linux smc-mca.c driver.
347 1.1.2.2 bouyer * I do not know why it's necessary. I don't want to know. It works
348 1.1.2.2 bouyer * and that is enough for me.
349 1.1.2.2 bouyer */
350 1.1.2.2 bouyer bus_space_write_1(wsc->sc_asict, wsc->sc_asich, WE_LAAR, 0x04);
351 1.1.2.2 bouyer wsc->sc_laar_proto |= 0x04;
352 1.1.2.2 bouyer }
353