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