Home | History | Annotate | Line # | Download | only in mca
if_le_mca.c revision 1.17.2.1
      1  1.17.2.1      yamt /*	$NetBSD: if_le_mca.c,v 1.17.2.1 2008/05/18 12:34:09 yamt Exp $	*/
      2       1.1  jdolecek 
      3       1.1  jdolecek /*-
      4       1.1  jdolecek  * Copyright (c) 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 Jaromir Dolecek.
      9       1.1  jdolecek  *
     10       1.1  jdolecek  * Redistribution and use in source and binary forms, with or without
     11       1.1  jdolecek  * modification, are permitted provided that the following conditions
     12       1.1  jdolecek  * are met:
     13       1.1  jdolecek  * 1. Redistributions of source code must retain the above copyright
     14       1.1  jdolecek  *    notice, this list of conditions and the following disclaimer.
     15       1.1  jdolecek  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1  jdolecek  *    notice, this list of conditions and the following disclaimer in the
     17       1.1  jdolecek  *    documentation and/or other materials provided with the distribution.
     18       1.1  jdolecek  *
     19       1.1  jdolecek  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20       1.1  jdolecek  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21       1.1  jdolecek  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22       1.1  jdolecek  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23       1.1  jdolecek  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24       1.1  jdolecek  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25       1.1  jdolecek  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26       1.1  jdolecek  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27       1.1  jdolecek  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28       1.1  jdolecek  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29       1.1  jdolecek  * POSSIBILITY OF SUCH DAMAGE.
     30       1.1  jdolecek  */
     31       1.1  jdolecek 
     32       1.1  jdolecek /*
     33       1.1  jdolecek  * Driver for SKNET Personal and MC2+ cards, which are AMD Lance 7990 based
     34       1.1  jdolecek  * cards made by Syskonnect, former Schneider & Koch Datensysteme GmbH.
     35       1.1  jdolecek  *
     36       1.1  jdolecek  * Syskonnect was very helpful and provided docs for these cards promptly.
     37       1.1  jdolecek  * I wish all vendors would be like that!
     38       1.1  jdolecek  * I'd like to thank to Alfred Arnold, author of the Linux driver, for
     39       1.1  jdolecek  * giving me contact to The Right Syskonnect person, too :-)
     40       1.9     perry  *
     41       1.1  jdolecek  * Sources:
     42       1.1  jdolecek  * SKNET MC+ Technical Manual, version 1.1, July 21 1993
     43       1.1  jdolecek  * SKNET personal Technisches Manual, version 1.2, April 14 1988
     44       1.1  jdolecek  * SKNET junior Technisches Manual, version 1.0, July 14 1987
     45       1.1  jdolecek  */
     46       1.3     lukem 
     47       1.3     lukem #include <sys/cdefs.h>
     48  1.17.2.1      yamt __KERNEL_RCSID(0, "$NetBSD: if_le_mca.c,v 1.17.2.1 2008/05/18 12:34:09 yamt Exp $");
     49       1.1  jdolecek 
     50       1.1  jdolecek #include <sys/param.h>
     51       1.1  jdolecek #include <sys/systm.h>
     52       1.1  jdolecek #include <sys/mbuf.h>
     53       1.1  jdolecek #include <sys/syslog.h>
     54       1.1  jdolecek #include <sys/socket.h>
     55       1.1  jdolecek #include <sys/device.h>
     56       1.1  jdolecek 
     57       1.1  jdolecek #include <uvm/uvm_extern.h>
     58       1.1  jdolecek 
     59       1.1  jdolecek #include <net/if.h>
     60       1.1  jdolecek #include <net/if_ether.h>
     61       1.1  jdolecek #include <net/if_media.h>
     62       1.1  jdolecek 
     63      1.16        ad #include <sys/cpu.h>
     64      1.16        ad #include <sys/intr.h>
     65      1.16        ad #include <sys/bus.h>
     66       1.1  jdolecek 
     67       1.1  jdolecek #include <dev/ic/lancereg.h>
     68       1.1  jdolecek #include <dev/ic/lancevar.h>
     69       1.1  jdolecek #include <dev/ic/am7990reg.h>
     70       1.1  jdolecek #include <dev/ic/am7990var.h>
     71       1.1  jdolecek 
     72       1.1  jdolecek #include <dev/mca/mcareg.h>
     73       1.1  jdolecek #include <dev/mca/mcavar.h>
     74       1.1  jdolecek #include <dev/mca/mcadevs.h>
     75       1.1  jdolecek 
     76       1.1  jdolecek #include <dev/mca/if_lereg.h>
     77       1.1  jdolecek 
     78      1.17   tsutsui int 	le_mca_match(device_t, cfdata_t, void *);
     79      1.17   tsutsui void	le_mca_attach(device_t, device_t, void *);
     80       1.1  jdolecek 
     81       1.1  jdolecek struct le_mca_softc {
     82       1.1  jdolecek 	struct	am7990_softc sc_am7990;	/* glue to MI code */
     83       1.1  jdolecek 
     84       1.1  jdolecek 	void	*sc_ih;
     85       1.1  jdolecek 	bus_space_tag_t sc_memt;
     86       1.1  jdolecek 	bus_space_handle_t sc_memh;
     87       1.1  jdolecek };
     88       1.1  jdolecek 
     89      1.17   tsutsui static void le_mca_wrcsr(struct lance_softc *, uint16_t, uint16_t);
     90      1.17   tsutsui static uint16_t le_mca_rdcsr(struct lance_softc *, uint16_t);
     91       1.8     perry static void le_mca_hwreset(struct lance_softc *);
     92       1.8     perry static int le_mca_intredge(void *);
     93       1.1  jdolecek 
     94       1.1  jdolecek static void	le_mca_copytobuf(struct lance_softc *, void *, int, int);
     95       1.1  jdolecek static void	le_mca_copyfrombuf(struct lance_softc *, void *, int, int);
     96       1.1  jdolecek static void	le_mca_zerobuf(struct lance_softc *, int, int);
     97       1.1  jdolecek 
     98      1.12     perry static inline void le_mca_wrreg(struct le_mca_softc *, int, int);
     99       1.1  jdolecek #define le_mca_set_RAP(sc, reg_number) \
    100       1.1  jdolecek 		le_mca_wrreg(sc, reg_number, RAP | REGWRITE)
    101       1.1  jdolecek 
    102      1.17   tsutsui CFATTACH_DECL_NEW(le_mca, sizeof(struct le_mca_softc),
    103       1.6   thorpej     le_mca_match, le_mca_attach, NULL, NULL);
    104       1.1  jdolecek 
    105       1.1  jdolecek /* SKNET MC+ POS mapping */
    106       1.1  jdolecek static const u_int8_t sknet_mcp_irq[] = {
    107       1.1  jdolecek 	3, 5, 10, 11
    108       1.1  jdolecek };
    109       1.1  jdolecek static const u_int8_t sknet_mcp_media[] = {
    110       1.1  jdolecek 	IFM_ETHER|IFM_10_2,
    111       1.1  jdolecek 	IFM_ETHER|IFM_10_T,
    112       1.1  jdolecek 	IFM_ETHER|IFM_10_5,
    113       1.1  jdolecek 	0
    114       1.1  jdolecek };
    115       1.1  jdolecek 
    116       1.1  jdolecek int
    117      1.17   tsutsui le_mca_match(device_t parent, cfdata_t cf, void *aux)
    118       1.1  jdolecek {
    119       1.1  jdolecek 	struct mca_attach_args *ma = aux;
    120       1.1  jdolecek 
    121       1.1  jdolecek 	switch(ma->ma_id) {
    122       1.1  jdolecek 	case MCA_PRODUCT_SKNETPER:
    123       1.1  jdolecek 	case MCA_PRODUCT_SKNETG:
    124       1.1  jdolecek 		return (1);
    125       1.1  jdolecek 	}
    126       1.1  jdolecek 
    127       1.1  jdolecek 	return (0);
    128       1.1  jdolecek }
    129       1.1  jdolecek 
    130       1.1  jdolecek void
    131      1.17   tsutsui le_mca_attach(device_t parent, device_t self, void *aux)
    132       1.1  jdolecek {
    133      1.13   thorpej 	struct le_mca_softc *lesc = device_private(self);
    134       1.1  jdolecek 	struct lance_softc *sc = &lesc->sc_am7990.lsc;
    135       1.1  jdolecek 	struct mca_attach_args *ma = aux;
    136       1.1  jdolecek 	int i, pos2, pos3, pos4, irq, membase, supmedia=0;
    137       1.1  jdolecek 	const char *typestr;
    138       1.1  jdolecek 
    139      1.17   tsutsui 	sc->sc_dev = self;
    140      1.17   tsutsui 
    141       1.1  jdolecek 	/*
    142       1.1  jdolecek 	 * SKNET Personal:
    143       1.1  jdolecek 	 *
    144       1.1  jdolecek 	 * POS register 2: (adf pos0)
    145       1.9     perry 	 *
    146       1.1  jdolecek 	 * 7 6 5 4 3 2 1 0
    147       1.1  jdolecek 	 *       | \___/ \__ enable: 0=adapter disabled, 1=adapter enabled
    148       1.1  jdolecek 	 *        \    \____ Memory: 0xC0000-0xC3FFF + XX*0x4000
    149       1.1  jdolecek 	 *         \________ IRQ: 0=10 1=11
    150       1.1  jdolecek 	 *
    151       1.1  jdolecek 	 *
    152       1.1  jdolecek 	 * SKNET MC+:
    153       1.1  jdolecek 	 * POS register 2: (adf pos0)
    154       1.9     perry 	 *
    155       1.1  jdolecek 	 * 7 6 5 4 3 2 1 0
    156       1.1  jdolecek 	 *       \___/ \ \__ enable: 0=adapter disabled, 1=adapter enabled
    157       1.1  jdolecek 	 *           \  \___ BootEPROM disable
    158       1.1  jdolecek 	 *            \_____ BootEPROM start address: 0xC0000 + XX*0x4000
    159       1.1  jdolecek 	 *
    160       1.1  jdolecek 	 * POS register 3: (adf pos1)
    161       1.9     perry 	 *
    162       1.1  jdolecek 	 * 7 6 5 4 3 2 1 0
    163       1.1  jdolecek 	 * 0 0 1 1 \_____/
    164       1.1  jdolecek 	 *               \__ RAM: 0xC0000 + XX*0x4000
    165       1.1  jdolecek 	 *
    166       1.1  jdolecek 	 * POS register 4: (adf pos2)
    167       1.9     perry 	 *
    168       1.1  jdolecek 	 * 7 6 5 4 3 2 1 0
    169       1.1  jdolecek 	 * \_/     \_/ \_/
    170       1.1  jdolecek 	 *   \       \   \__ Need to be reset to 0 0 after boot
    171       1.1  jdolecek 	 *    \       \_____ IRQ: 00=3 01=5 10=10 11=11
    172       1.1  jdolecek 	 *     \____________ Medium: 00=BNC 01=UTP 10=AUI 11=not allowed
    173       1.9     perry 	 */
    174       1.1  jdolecek 
    175       1.1  jdolecek 	switch (ma->ma_id) {
    176       1.1  jdolecek 	case MCA_PRODUCT_SKNETPER:
    177       1.1  jdolecek 		typestr = "Personal MC2";
    178       1.1  jdolecek 
    179       1.1  jdolecek 		pos2 = mca_conf_read(ma->ma_mc, ma->ma_slot, 2);
    180       1.1  jdolecek 		irq = (pos2 & (1<<4)) ? 11 : 10;
    181       1.1  jdolecek 		membase = 0xc0000 + ((pos2 & 0x0e) >> 1) * 0x4000;
    182       1.1  jdolecek 		break;
    183       1.1  jdolecek 	case MCA_PRODUCT_SKNETG:
    184       1.1  jdolecek 		typestr = "MC2+";
    185       1.1  jdolecek 
    186       1.1  jdolecek 		/*
    187       1.1  jdolecek 		 * SKNET MC+ needs the driver to clear 0, 1 bits of pos4
    188       1.1  jdolecek 		 * and explicitly set the enable bit. Somebody at Syskonnect
    189       1.1  jdolecek 		 * was obviously misguided when the card was designed ...
    190       1.1  jdolecek 		 */
    191       1.1  jdolecek 		pos3 = mca_conf_read(ma->ma_mc, ma->ma_slot, 3);
    192       1.1  jdolecek 		pos4 = mca_conf_read(ma->ma_mc, ma->ma_slot, 4);
    193       1.1  jdolecek 		if ((pos4 & 0x03) != 0) {
    194       1.1  jdolecek 			/* clear the bits 0, 1 */
    195       1.1  jdolecek 			mca_conf_write(ma->ma_mc, ma->ma_slot, 4,
    196       1.1  jdolecek 				pos4 & ~0x03);
    197       1.1  jdolecek 		}
    198       1.1  jdolecek 
    199       1.1  jdolecek 		pos2 = mca_conf_read(ma->ma_mc, ma->ma_slot, 2);
    200       1.1  jdolecek 		if ((pos2 & 0x01) == 0) {
    201       1.1  jdolecek 			/* enable the card */
    202       1.1  jdolecek 			mca_conf_write(ma->ma_mc, ma->ma_slot, 2, pos2 | 0x01);
    203       1.1  jdolecek 		}
    204       1.1  jdolecek 
    205       1.1  jdolecek 		/* get irq and memory base */
    206       1.1  jdolecek 		irq = sknet_mcp_irq[(pos4 & 0x0c) >> 2];
    207       1.1  jdolecek 		membase = 0xc0000 + ((pos3 & 0x0f) * 0x4000);
    208       1.1  jdolecek 
    209       1.1  jdolecek 		/* Get configured media type */
    210       1.1  jdolecek 		supmedia = sknet_mcp_media[(pos4 & 0xc0) >> 6];
    211       1.1  jdolecek 		break;
    212       1.7  christos 	default:
    213      1.17   tsutsui 		aprint_error(": unknown product %d\n", ma->ma_id);
    214       1.7  christos 		return;
    215       1.1  jdolecek 	}
    216       1.1  jdolecek 
    217       1.1  jdolecek 	lesc->sc_memt = ma->ma_memt;
    218       1.1  jdolecek 
    219       1.1  jdolecek 	if (bus_space_map(lesc->sc_memt, membase, LE_MCA_MEMSIZE,
    220       1.1  jdolecek 		0, &lesc->sc_memh)) {
    221      1.17   tsutsui 		aprint_error(": can't map memory\n");
    222       1.1  jdolecek 		return;
    223       1.1  jdolecek 	}
    224       1.1  jdolecek 
    225      1.17   tsutsui 	aprint_normal(" slot %d irq %d: SKNET %s Ethernet\n",
    226       1.1  jdolecek 		ma->ma_slot + 1, irq, typestr);
    227       1.1  jdolecek 
    228       1.1  jdolecek 	/*
    229       1.1  jdolecek 	 * Extract the physical MAC address from the ROM.
    230       1.1  jdolecek 	 */
    231       1.1  jdolecek 	for (i = 0; i < ETHER_ADDR_LEN; i++)
    232       1.1  jdolecek 		sc->sc_enaddr[i] = bus_space_read_1(lesc->sc_memt,
    233      1.17   tsutsui 				lesc->sc_memh, LE_PROMOFF + i * 2);
    234       1.1  jdolecek 
    235       1.1  jdolecek 	sc->sc_conf3 = LE_C3_ACON;
    236       1.1  jdolecek 	sc->sc_addr = 0;
    237       1.1  jdolecek 	sc->sc_memsize = LE_MCA_RAMSIZE;
    238       1.1  jdolecek 
    239       1.1  jdolecek 	sc->sc_copytodesc = le_mca_copytobuf;
    240       1.1  jdolecek 	sc->sc_copyfromdesc = le_mca_copyfrombuf;
    241       1.1  jdolecek 	sc->sc_copytobuf = le_mca_copytobuf;
    242       1.1  jdolecek 	sc->sc_copyfrombuf = le_mca_copyfrombuf;
    243       1.1  jdolecek 	sc->sc_zerobuf = le_mca_zerobuf;
    244       1.1  jdolecek 
    245       1.1  jdolecek 	sc->sc_rdcsr = le_mca_rdcsr;
    246       1.1  jdolecek 	sc->sc_wrcsr = le_mca_wrcsr;
    247       1.1  jdolecek 	sc->sc_hwinit = NULL;
    248       1.1  jdolecek 
    249       1.1  jdolecek 	sc->sc_hwreset = le_mca_hwreset;
    250       1.1  jdolecek 
    251       1.1  jdolecek 	/*
    252       1.1  jdolecek 	 * This is merely cosmetic since it's not possible to switch
    253       1.1  jdolecek 	 * the media anyway, even for MC2+.
    254       1.1  jdolecek 	 */
    255       1.1  jdolecek 	if (supmedia != 0) {
    256       1.1  jdolecek 		sc->sc_supmedia = &supmedia;
    257       1.1  jdolecek 		sc->sc_nsupmedia = 1;
    258       1.1  jdolecek 		sc->sc_defaultmedia = supmedia;
    259       1.1  jdolecek 	}
    260       1.1  jdolecek 
    261       1.1  jdolecek 	lesc->sc_ih = mca_intr_establish(ma->ma_mc, irq, IPL_NET,
    262       1.1  jdolecek 			le_mca_intredge, sc);
    263       1.1  jdolecek 	if (lesc->sc_ih == NULL) {
    264      1.17   tsutsui 		aprint_error_dev(self,
    265      1.17   tsutsui 		    "couldn't establish interrupt handler\n");
    266       1.1  jdolecek 		return;
    267       1.1  jdolecek 	}
    268       1.1  jdolecek 
    269      1.17   tsutsui 	aprint_normal("%s", device_xname(self));
    270       1.1  jdolecek 	am7990_config(&lesc->sc_am7990);
    271       1.1  jdolecek }
    272       1.1  jdolecek 
    273       1.1  jdolecek /*
    274       1.1  jdolecek  * Controller interrupt.
    275       1.1  jdolecek  */
    276       1.1  jdolecek int
    277      1.17   tsutsui le_mca_intredge(void *arg)
    278       1.1  jdolecek {
    279      1.17   tsutsui 
    280       1.1  jdolecek 	/*
    281       1.1  jdolecek 	 * We could check the IRQ bit of LE_PORT, but it seems to be unset
    282       1.1  jdolecek 	 * at this time anyway.
    283       1.1  jdolecek 	 */
    284       1.1  jdolecek 
    285      1.10  jdolecek 	if (am7990_intr(arg) == 0)
    286       1.1  jdolecek 		return (0);
    287       1.1  jdolecek 	for(;;)
    288       1.1  jdolecek 		if (am7990_intr(arg) == 0)
    289       1.1  jdolecek 			return (1);
    290       1.1  jdolecek }
    291       1.1  jdolecek 
    292       1.1  jdolecek /*
    293       1.1  jdolecek  * Push a value to LANCE controller.
    294       1.1  jdolecek  */
    295      1.12     perry static inline void
    296      1.17   tsutsui le_mca_wrreg(struct le_mca_softc *sc, int val, int type)
    297       1.1  jdolecek {
    298      1.17   tsutsui 
    299       1.1  jdolecek 	/*
    300       1.1  jdolecek 	 * This follows steps in SKNET Personal/MC2+ docs:
    301       1.1  jdolecek 	 * 1. write reg. number to LANCE register
    302       1.1  jdolecek 	 * 2. write value RESET | type to port
    303       1.1  jdolecek 	 * 3. flag REGDO
    304       1.1  jdolecek 	 * 4. wait until REGREQ is cleared
    305       1.1  jdolecek 	 */
    306       1.1  jdolecek 	if ((type & REGREAD) == 0)
    307       1.1  jdolecek 		bus_space_write_2(sc->sc_memt, sc->sc_memh, LE_LANCEREG, val);
    308       1.1  jdolecek 	bus_space_write_1(sc->sc_memt, sc->sc_memh, LE_PORT,
    309       1.1  jdolecek 		RESET | type);
    310       1.1  jdolecek 	bus_space_write_1(sc->sc_memt, sc->sc_memh, LE_REGIO,
    311       1.1  jdolecek 		REGDO);
    312       1.1  jdolecek 	/* Delay here doesn't seem to be necessary */
    313       1.1  jdolecek 	/* delay(1);  */
    314      1.17   tsutsui 	while (bus_space_read_1(sc->sc_memt, sc->sc_memh, LE_PORT) & REGREQ)
    315       1.1  jdolecek 		;
    316       1.1  jdolecek }
    317       1.1  jdolecek 
    318       1.1  jdolecek static void
    319      1.17   tsutsui le_mca_wrcsr(struct lance_softc *sc, uint16_t port, uint16_t val)
    320       1.1  jdolecek {
    321       1.1  jdolecek 	struct le_mca_softc *lsc = (struct le_mca_softc *)sc;
    322       1.1  jdolecek 
    323       1.1  jdolecek 	le_mca_set_RAP(lsc, port);
    324       1.1  jdolecek 	le_mca_wrreg(lsc, val, RDATA | REGWRITE);
    325       1.1  jdolecek }
    326       1.1  jdolecek 
    327      1.17   tsutsui static uint16_t
    328      1.17   tsutsui le_mca_rdcsr(struct lance_softc *sc, uint16_t port)
    329       1.1  jdolecek {
    330       1.1  jdolecek 	struct le_mca_softc *lsc = (struct le_mca_softc *)sc;
    331       1.1  jdolecek 
    332       1.1  jdolecek 	le_mca_set_RAP(lsc, port);
    333       1.1  jdolecek 	le_mca_wrreg(lsc, 0, RDATA | REGREAD);
    334       1.1  jdolecek 
    335       1.1  jdolecek 	return (bus_space_read_2(lsc->sc_memt, lsc->sc_memh, LE_LANCEREG));
    336       1.1  jdolecek }
    337       1.1  jdolecek 
    338       1.1  jdolecek static void
    339      1.17   tsutsui le_mca_hwreset(struct lance_softc *sc)
    340       1.1  jdolecek {
    341       1.1  jdolecek 	struct le_mca_softc *lsc = (struct le_mca_softc *)sc;
    342       1.1  jdolecek 
    343       1.1  jdolecek 	bus_space_write_1(lsc->sc_memt, lsc->sc_memh, LE_PORT, 0);
    344       1.1  jdolecek 	delay(5);	/* Delay >= 5 microseconds */
    345       1.1  jdolecek 	bus_space_write_1(lsc->sc_memt, lsc->sc_memh, LE_PORT, RESET);
    346       1.1  jdolecek }
    347       1.1  jdolecek 
    348       1.1  jdolecek static void
    349       1.1  jdolecek le_mca_copytobuf(struct lance_softc *sc, void *from, int boff, int len)
    350       1.1  jdolecek {
    351      1.17   tsutsui 	struct le_mca_softc *lsc = (struct le_mca_softc *)sc;
    352       1.1  jdolecek 
    353      1.17   tsutsui 	bus_space_write_region_1(lsc->sc_memt, lsc->sc_memh, boff,
    354       1.1  jdolecek 	    from, len);
    355       1.1  jdolecek }
    356       1.1  jdolecek 
    357       1.1  jdolecek static void
    358       1.1  jdolecek le_mca_copyfrombuf(struct lance_softc *sc, void *to, int boff, int len)
    359       1.1  jdolecek {
    360      1.17   tsutsui 	struct le_mca_softc *lsc = (struct le_mca_softc *)sc;
    361       1.1  jdolecek 
    362      1.17   tsutsui 	bus_space_read_region_1(lsc->sc_memt, lsc->sc_memh, boff,
    363       1.1  jdolecek 	    to, len);
    364       1.1  jdolecek }
    365       1.1  jdolecek 
    366       1.1  jdolecek static void
    367       1.1  jdolecek le_mca_zerobuf(struct lance_softc *sc, int boff, int len)
    368       1.1  jdolecek {
    369      1.17   tsutsui 	struct le_mca_softc *lsc = (struct le_mca_softc *)sc;
    370       1.1  jdolecek 
    371      1.17   tsutsui 	bus_space_set_region_1(lsc->sc_memt, lsc->sc_memh, boff,
    372       1.1  jdolecek 	    0x00, len);
    373       1.1  jdolecek }
    374