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