Home | History | Annotate | Line # | Download | only in sbus
if_le_ledma.c revision 1.27.14.1
      1  1.27.14.1     joerg /*	$NetBSD: if_le_ledma.c,v 1.27.14.1 2007/10/26 15:47:32 joerg Exp $	*/
      2        1.1        pk 
      3        1.1        pk /*-
      4        1.1        pk  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
      5        1.1        pk  * All rights reserved.
      6        1.1        pk  *
      7        1.1        pk  * This code is derived from software contributed to The NetBSD Foundation
      8        1.1        pk  * by Charles M. Hannum; Jason R. Thorpe of the Numerical Aerospace
      9        1.1        pk  * Simulation Facility, NASA Ames Research Center; Paul Kranenburg.
     10        1.1        pk  *
     11        1.1        pk  * Redistribution and use in source and binary forms, with or without
     12        1.1        pk  * modification, are permitted provided that the following conditions
     13        1.1        pk  * are met:
     14        1.1        pk  * 1. Redistributions of source code must retain the above copyright
     15        1.1        pk  *    notice, this list of conditions and the following disclaimer.
     16        1.1        pk  * 2. Redistributions in binary form must reproduce the above copyright
     17        1.1        pk  *    notice, this list of conditions and the following disclaimer in the
     18        1.1        pk  *    documentation and/or other materials provided with the distribution.
     19        1.1        pk  * 3. All advertising materials mentioning features or use of this software
     20        1.1        pk  *    must display the following acknowledgement:
     21        1.1        pk  *	This product includes software developed by the NetBSD
     22        1.1        pk  *	Foundation, Inc. and its contributors.
     23        1.1        pk  * 4. Neither the name of The NetBSD Foundation nor the names of its
     24        1.1        pk  *    contributors may be used to endorse or promote products derived
     25        1.1        pk  *    from this software without specific prior written permission.
     26        1.1        pk  *
     27        1.1        pk  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     28        1.1        pk  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     29        1.1        pk  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     30        1.1        pk  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     31        1.1        pk  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     32        1.1        pk  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     33        1.1        pk  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     34        1.1        pk  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     35        1.1        pk  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     36        1.1        pk  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     37        1.1        pk  * POSSIBILITY OF SUCH DAMAGE.
     38        1.1        pk  */
     39       1.15     lukem 
     40       1.15     lukem #include <sys/cdefs.h>
     41  1.27.14.1     joerg __KERNEL_RCSID(0, "$NetBSD: if_le_ledma.c,v 1.27.14.1 2007/10/26 15:47:32 joerg Exp $");
     42        1.1        pk 
     43        1.1        pk #include "opt_inet.h"
     44        1.1        pk #include "bpfilter.h"
     45        1.1        pk 
     46        1.1        pk #include <sys/param.h>
     47        1.1        pk #include <sys/systm.h>
     48        1.1        pk #include <sys/mbuf.h>
     49        1.1        pk #include <sys/syslog.h>
     50        1.1        pk #include <sys/socket.h>
     51        1.1        pk #include <sys/device.h>
     52        1.1        pk #include <sys/malloc.h>
     53        1.1        pk 
     54        1.1        pk #include <net/if.h>
     55        1.1        pk #include <net/if_ether.h>
     56        1.1        pk #include <net/if_media.h>
     57        1.1        pk 
     58        1.1        pk #ifdef INET
     59        1.1        pk #include <netinet/in.h>
     60        1.1        pk #include <netinet/if_inarp.h>
     61        1.1        pk #endif
     62        1.1        pk 
     63  1.27.14.1     joerg #include <sys/bus.h>
     64  1.27.14.1     joerg #include <sys/intr.h>
     65       1.24        pk #include <machine/autoconf.h>
     66        1.1        pk 
     67        1.1        pk #include <dev/sbus/sbusvar.h>
     68        1.1        pk 
     69        1.1        pk #include <dev/ic/lsi64854reg.h>
     70        1.1        pk #include <dev/ic/lsi64854var.h>
     71        1.1        pk 
     72        1.1        pk #include <dev/ic/lancereg.h>
     73        1.1        pk #include <dev/ic/lancevar.h>
     74        1.1        pk #include <dev/ic/am7990reg.h>
     75        1.1        pk #include <dev/ic/am7990var.h>
     76        1.1        pk 
     77        1.1        pk /*
     78        1.1        pk  * LANCE registers.
     79        1.1        pk  */
     80        1.1        pk #define LEREG1_RDP	0	/* Register Data port */
     81        1.1        pk #define LEREG1_RAP	2	/* Register Address port */
     82        1.1        pk 
     83        1.1        pk struct	le_softc {
     84        1.1        pk 	struct	am7990_softc	sc_am7990;	/* glue to MI code */
     85        1.1        pk 	struct	sbusdev		sc_sd;		/* sbus device */
     86        1.1        pk 	bus_space_tag_t		sc_bustag;
     87        1.8        pk 	bus_dmamap_t		sc_dmamap;
     88        1.1        pk 	bus_space_handle_t	sc_reg;		/* LANCE registers */
     89        1.1        pk 	struct	lsi64854_softc	*sc_dma;	/* pointer to my dma */
     90        1.4       eeh 	u_int			sc_laddr;	/* LANCE DMA address */
     91        1.1        pk };
     92        1.1        pk 
     93        1.1        pk #define MEMSIZE		(16*1024)	/* LANCE memory size */
     94        1.1        pk #define LEDMA_BOUNDARY	(16*1024*1024)	/* must not cross 16MB boundary */
     95        1.1        pk 
     96       1.25     perry int	lematch_ledma(struct device *, struct cfdata *, void *);
     97       1.25     perry void	leattach_ledma(struct device *, struct device *, void *);
     98        1.1        pk 
     99        1.1        pk /*
    100        1.1        pk  * Media types supported by the Sun4m.
    101        1.1        pk  */
    102        1.1        pk static int lemedia[] = {
    103        1.1        pk 	IFM_ETHER|IFM_10_T,
    104        1.1        pk 	IFM_ETHER|IFM_10_5,
    105        1.1        pk 	IFM_ETHER|IFM_AUTO,
    106        1.1        pk };
    107        1.1        pk #define NLEMEDIA	(sizeof(lemedia) / sizeof(lemedia[0]))
    108        1.1        pk 
    109       1.25     perry void	lesetutp(struct lance_softc *);
    110       1.25     perry void	lesetaui(struct lance_softc *);
    111        1.1        pk 
    112       1.25     perry int	lemediachange(struct lance_softc *);
    113       1.25     perry void	lemediastatus(struct lance_softc *, struct ifmediareq *);
    114        1.1        pk 
    115       1.20   thorpej CFATTACH_DECL(le_ledma, sizeof(struct le_softc),
    116       1.21   thorpej     lematch_ledma, leattach_ledma, NULL, NULL);
    117        1.1        pk 
    118        1.1        pk extern struct cfdriver le_cd;
    119        1.1        pk 
    120       1.14       mrg #if defined(_KERNEL_OPT)
    121        1.1        pk #include "opt_ddb.h"
    122        1.1        pk #endif
    123        1.1        pk 
    124       1.25     perry static void lewrcsr(struct lance_softc *, u_int16_t, u_int16_t);
    125       1.25     perry static u_int16_t lerdcsr(struct lance_softc *, u_int16_t);
    126       1.25     perry static void lehwreset(struct lance_softc *);
    127       1.25     perry static void lehwinit(struct lance_softc *);
    128       1.25     perry static void lenocarrier(struct lance_softc *);
    129        1.1        pk 
    130        1.1        pk static void
    131        1.1        pk lewrcsr(sc, port, val)
    132        1.1        pk 	struct lance_softc *sc;
    133        1.1        pk 	u_int16_t port, val;
    134        1.1        pk {
    135        1.1        pk 	struct le_softc *lesc = (struct le_softc *)sc;
    136       1.23        pk 	bus_space_tag_t t = lesc->sc_bustag;
    137       1.23        pk 	bus_space_handle_t h = lesc->sc_reg;
    138        1.1        pk 
    139       1.23        pk 	bus_space_write_2(t, h, LEREG1_RAP, port);
    140       1.23        pk 	bus_space_write_2(t, h, LEREG1_RDP, val);
    141        1.1        pk 
    142        1.1        pk #if defined(SUN4M)
    143        1.1        pk 	/*
    144        1.1        pk 	 * We need to flush the Sbus->Mbus write buffers. This can most
    145        1.1        pk 	 * easily be accomplished by reading back the register that we
    146        1.1        pk 	 * just wrote (thanks to Chris Torek for this solution).
    147        1.1        pk 	 */
    148       1.23        pk 	(void)bus_space_read_2(t, h, LEREG1_RDP);
    149        1.1        pk #endif
    150        1.1        pk }
    151        1.1        pk 
    152        1.1        pk static u_int16_t
    153        1.1        pk lerdcsr(sc, port)
    154        1.1        pk 	struct lance_softc *sc;
    155        1.1        pk 	u_int16_t port;
    156        1.1        pk {
    157        1.1        pk 	struct le_softc *lesc = (struct le_softc *)sc;
    158       1.23        pk 	bus_space_tag_t t = lesc->sc_bustag;
    159       1.23        pk 	bus_space_handle_t h = lesc->sc_reg;
    160        1.1        pk 
    161       1.23        pk 	bus_space_write_2(t, h, LEREG1_RAP, port);
    162       1.23        pk 	return (bus_space_read_2(t, h, LEREG1_RDP));
    163        1.1        pk }
    164        1.1        pk 
    165        1.1        pk void
    166        1.1        pk lesetutp(sc)
    167        1.1        pk 	struct lance_softc *sc;
    168        1.1        pk {
    169        1.3        pk 	struct lsi64854_softc *dma = ((struct le_softc *)sc)->sc_dma;
    170        1.1        pk 	u_int32_t csr;
    171        1.1        pk 
    172        1.3        pk 	csr = L64854_GCSR(dma);
    173        1.1        pk 	csr |= E_TP_AUI;
    174        1.3        pk 	L64854_SCSR(dma, csr);
    175        1.1        pk 	delay(20000);	/* must not touch le for 20ms */
    176        1.1        pk }
    177        1.1        pk 
    178        1.1        pk void
    179        1.1        pk lesetaui(sc)
    180        1.1        pk 	struct lance_softc *sc;
    181        1.1        pk {
    182        1.3        pk 	struct lsi64854_softc *dma = ((struct le_softc *)sc)->sc_dma;
    183        1.1        pk 	u_int32_t csr;
    184        1.1        pk 
    185        1.3        pk 	csr = L64854_GCSR(dma);
    186        1.1        pk 	csr &= ~E_TP_AUI;
    187        1.3        pk 	L64854_SCSR(dma, csr);
    188        1.1        pk 	delay(20000);	/* must not touch le for 20ms */
    189        1.1        pk }
    190        1.1        pk 
    191        1.1        pk int
    192        1.1        pk lemediachange(sc)
    193        1.1        pk 	struct lance_softc *sc;
    194        1.1        pk {
    195        1.1        pk 	struct ifmedia *ifm = &sc->sc_media;
    196        1.1        pk 
    197        1.1        pk 	if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
    198        1.1        pk 		return (EINVAL);
    199        1.1        pk 
    200        1.1        pk 	/*
    201        1.1        pk 	 * Switch to the selected media.  If autoselect is
    202        1.1        pk 	 * set, we don't really have to do anything.  We'll
    203        1.1        pk 	 * switch to the other media when we detect loss of
    204        1.1        pk 	 * carrier.
    205        1.1        pk 	 */
    206        1.1        pk 	switch (IFM_SUBTYPE(ifm->ifm_media)) {
    207        1.1        pk 	case IFM_10_T:
    208        1.1        pk 		lesetutp(sc);
    209        1.1        pk 		break;
    210        1.1        pk 
    211        1.1        pk 	case IFM_10_5:
    212        1.1        pk 		lesetaui(sc);
    213        1.1        pk 		break;
    214        1.1        pk 
    215        1.1        pk 	case IFM_AUTO:
    216        1.1        pk 		break;
    217        1.1        pk 
    218        1.1        pk 	default:
    219        1.1        pk 		return (EINVAL);
    220        1.1        pk 	}
    221        1.1        pk 
    222        1.1        pk 	return (0);
    223        1.1        pk }
    224        1.1        pk 
    225        1.1        pk void
    226        1.1        pk lemediastatus(sc, ifmr)
    227        1.1        pk 	struct lance_softc *sc;
    228        1.1        pk 	struct ifmediareq *ifmr;
    229        1.1        pk {
    230        1.3        pk 	struct lsi64854_softc *dma = ((struct le_softc *)sc)->sc_dma;
    231        1.1        pk 
    232        1.1        pk 	/*
    233        1.1        pk 	 * Notify the world which media we're currently using.
    234        1.1        pk 	 */
    235        1.3        pk 	if (L64854_GCSR(dma) & E_TP_AUI)
    236        1.1        pk 		ifmr->ifm_active = IFM_ETHER|IFM_10_T;
    237        1.1        pk 	else
    238        1.1        pk 		ifmr->ifm_active = IFM_ETHER|IFM_10_5;
    239        1.1        pk }
    240        1.1        pk 
    241       1.23        pk static void
    242        1.1        pk lehwreset(sc)
    243        1.1        pk 	struct lance_softc *sc;
    244        1.1        pk {
    245        1.1        pk 	struct le_softc *lesc = (struct le_softc *)sc;
    246        1.1        pk 	struct lsi64854_softc *dma = lesc->sc_dma;
    247        1.1        pk 	u_int32_t csr;
    248        1.4       eeh 	u_int aui_bit;
    249        1.1        pk 
    250        1.1        pk 	/*
    251        1.1        pk 	 * Reset DMA channel.
    252        1.1        pk 	 */
    253        1.1        pk 	csr = L64854_GCSR(dma);
    254        1.1        pk 	aui_bit = csr & E_TP_AUI;
    255        1.1        pk 	DMA_RESET(dma);
    256        1.1        pk 
    257        1.1        pk 	/* Write bits 24-31 of Lance address */
    258        1.1        pk 	bus_space_write_4(dma->sc_bustag, dma->sc_regs, L64854_REG_ENBAR,
    259        1.1        pk 			  lesc->sc_laddr & 0xff000000);
    260        1.1        pk 
    261        1.1        pk 	DMA_ENINTR(dma);
    262        1.1        pk 
    263        1.1        pk 	/*
    264        1.1        pk 	 * Disable E-cache invalidates on chip writes.
    265        1.1        pk 	 * Retain previous cable selection bit.
    266        1.1        pk 	 */
    267        1.1        pk 	csr = L64854_GCSR(dma);
    268        1.1        pk 	csr |= (E_DSBL_WR_INVAL | aui_bit);
    269        1.1        pk 	L64854_SCSR(dma, csr);
    270        1.5        pk 	delay(20000);	/* must not touch le for 20ms */
    271        1.1        pk }
    272        1.1        pk 
    273       1.23        pk static void
    274        1.1        pk lehwinit(sc)
    275        1.1        pk 	struct lance_softc *sc;
    276        1.1        pk {
    277        1.1        pk 
    278        1.1        pk 	/*
    279        1.1        pk 	 * Make sure we're using the currently-enabled media type.
    280        1.1        pk 	 * XXX Actually, this is probably unnecessary, now.
    281        1.1        pk 	 */
    282        1.1        pk 	switch (IFM_SUBTYPE(sc->sc_media.ifm_cur->ifm_media)) {
    283        1.1        pk 	case IFM_10_T:
    284        1.1        pk 		lesetutp(sc);
    285        1.1        pk 		break;
    286        1.1        pk 
    287        1.1        pk 	case IFM_10_5:
    288        1.1        pk 		lesetaui(sc);
    289        1.1        pk 		break;
    290        1.1        pk 	}
    291        1.1        pk }
    292        1.1        pk 
    293       1.23        pk static void
    294        1.1        pk lenocarrier(sc)
    295        1.1        pk 	struct lance_softc *sc;
    296        1.1        pk {
    297        1.1        pk 	struct le_softc *lesc = (struct le_softc *)sc;
    298        1.1        pk 
    299        1.1        pk 	/*
    300        1.1        pk 	 * Check if the user has requested a certain cable type, and
    301        1.1        pk 	 * if so, honor that request.
    302        1.1        pk 	 */
    303        1.1        pk 	printf("%s: lost carrier on ", sc->sc_dev.dv_xname);
    304        1.1        pk 
    305        1.1        pk 	if (L64854_GCSR(lesc->sc_dma) & E_TP_AUI) {
    306        1.1        pk 		printf("UTP port");
    307        1.1        pk 		switch (IFM_SUBTYPE(sc->sc_media.ifm_media)) {
    308        1.1        pk 		case IFM_10_5:
    309        1.1        pk 		case IFM_AUTO:
    310        1.1        pk 			printf(", switching to AUI port");
    311        1.1        pk 			lesetaui(sc);
    312        1.1        pk 		}
    313        1.1        pk 	} else {
    314        1.1        pk 		printf("AUI port");
    315        1.1        pk 		switch (IFM_SUBTYPE(sc->sc_media.ifm_media)) {
    316        1.1        pk 		case IFM_10_T:
    317        1.1        pk 		case IFM_AUTO:
    318        1.1        pk 			printf(", switching to UTP port");
    319        1.1        pk 			lesetutp(sc);
    320        1.1        pk 		}
    321        1.1        pk 	}
    322        1.1        pk 	printf("\n");
    323        1.1        pk }
    324        1.1        pk 
    325        1.1        pk int
    326        1.1        pk lematch_ledma(parent, cf, aux)
    327        1.1        pk 	struct device *parent;
    328        1.1        pk 	struct cfdata *cf;
    329        1.1        pk 	void *aux;
    330        1.1        pk {
    331        1.1        pk 	struct sbus_attach_args *sa = aux;
    332        1.1        pk 
    333       1.18   thorpej 	return (strcmp(cf->cf_name, sa->sa_name) == 0);
    334        1.1        pk }
    335        1.1        pk 
    336        1.1        pk 
    337        1.1        pk void
    338        1.1        pk leattach_ledma(parent, self, aux)
    339        1.1        pk 	struct device *parent, *self;
    340        1.1        pk 	void *aux;
    341        1.1        pk {
    342        1.1        pk 	struct sbus_attach_args *sa = aux;
    343        1.1        pk 	struct le_softc *lesc = (struct le_softc *)self;
    344        1.1        pk 	struct lsi64854_softc *lsi = (struct lsi64854_softc *)parent;
    345        1.1        pk 	struct lance_softc *sc = &lesc->sc_am7990.lsc;
    346        1.8        pk 	bus_dma_tag_t dmatag = sa->sa_dmatag;
    347        1.1        pk 	bus_dma_segment_t seg;
    348        1.1        pk 	int rseg, error;
    349        1.1        pk 
    350        1.1        pk 	lesc->sc_bustag = sa->sa_bustag;
    351        1.1        pk 
    352        1.1        pk 	/* Establish link to `ledma' device */
    353        1.1        pk 	lesc->sc_dma = lsi;
    354        1.2        pk 	lesc->sc_dma->sc_client = lesc;
    355        1.1        pk 
    356        1.1        pk 	/* Map device registers */
    357       1.16        pk 	if (sbus_bus_map(sa->sa_bustag,
    358       1.16        pk 			 sa->sa_slot,
    359       1.16        pk 			 sa->sa_offset,
    360       1.16        pk 			 sa->sa_size,
    361       1.17       eeh 			 0, &lesc->sc_reg) != 0) {
    362        1.1        pk 		printf("%s @ ledma: cannot map registers\n", self->dv_xname);
    363        1.1        pk 		return;
    364        1.1        pk 	}
    365        1.1        pk 
    366        1.1        pk 	/* Allocate buffer memory */
    367        1.1        pk 	sc->sc_memsize = MEMSIZE;
    368        1.8        pk 
    369        1.9        pk 	/* Get a DMA handle */
    370        1.8        pk 	if ((error = bus_dmamap_create(dmatag, MEMSIZE, 1, MEMSIZE,
    371        1.8        pk 					LEDMA_BOUNDARY, BUS_DMA_NOWAIT,
    372        1.8        pk 					&lesc->sc_dmamap)) != 0) {
    373        1.8        pk 		printf("%s: DMA map create error %d\n", self->dv_xname, error);
    374        1.8        pk 		return;
    375        1.8        pk 	}
    376        1.8        pk 
    377        1.9        pk 	/* Allocate DMA buffer */
    378       1.10        pk 	if ((error = bus_dmamem_alloc(dmatag, MEMSIZE, 0, LEDMA_BOUNDARY,
    379        1.8        pk 				 &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
    380        1.1        pk 		printf("%s @ ledma: DMA buffer alloc error %d\n",
    381        1.1        pk 			self->dv_xname, error);
    382        1.1        pk 		return;
    383        1.1        pk 	}
    384        1.8        pk 
    385       1.12       mrg 	/* Map DMA buffer into kernel space */
    386       1.12       mrg 	if ((error = bus_dmamem_map(dmatag, &seg, rseg, MEMSIZE,
    387       1.27  christos 			       (void **)&sc->sc_mem,
    388       1.12       mrg 			       BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
    389       1.12       mrg 		printf("%s @ ledma: DMA buffer map error %d\n",
    390        1.1        pk 			self->dv_xname, error);
    391        1.8        pk 		bus_dmamem_free(dmatag, &seg, rseg);
    392        1.8        pk 		return;
    393        1.8        pk 	}
    394        1.8        pk 
    395       1.12       mrg 	/* Load DMA buffer */
    396       1.12       mrg 	if ((error = bus_dmamap_load(dmatag, lesc->sc_dmamap, sc->sc_mem,
    397       1.13       mrg 			MEMSIZE, NULL, BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
    398       1.12       mrg 		printf("%s: DMA buffer map load error %d\n",
    399        1.8        pk 			self->dv_xname, error);
    400        1.8        pk 		bus_dmamem_free(dmatag, &seg, rseg);
    401       1.12       mrg 		bus_dmamem_unmap(dmatag, sc->sc_mem, MEMSIZE);
    402        1.1        pk 		return;
    403        1.1        pk 	}
    404        1.1        pk 
    405        1.8        pk 	lesc->sc_laddr = lesc->sc_dmamap->dm_segs[0].ds_addr;
    406        1.8        pk 	sc->sc_addr = lesc->sc_laddr & 0xffffff;
    407        1.1        pk 	sc->sc_conf3 = LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON;
    408        1.1        pk 
    409        1.1        pk 
    410        1.1        pk 	/* Assume SBus is grandparent */
    411        1.1        pk 	lesc->sc_sd.sd_reset = (void *)lance_reset;
    412        1.1        pk 	sbus_establish(&lesc->sc_sd, parent);
    413        1.1        pk 
    414        1.1        pk 	sc->sc_mediachange = lemediachange;
    415        1.1        pk 	sc->sc_mediastatus = lemediastatus;
    416        1.1        pk 	sc->sc_supmedia = lemedia;
    417        1.1        pk 	sc->sc_nsupmedia = NLEMEDIA;
    418        1.1        pk 	sc->sc_defaultmedia = IFM_ETHER|IFM_AUTO;
    419        1.1        pk 
    420       1.24        pk 	prom_getether(sa->sa_node, sc->sc_enaddr);
    421        1.1        pk 
    422        1.1        pk 	sc->sc_copytodesc = lance_copytobuf_contig;
    423        1.1        pk 	sc->sc_copyfromdesc = lance_copyfrombuf_contig;
    424        1.1        pk 	sc->sc_copytobuf = lance_copytobuf_contig;
    425        1.1        pk 	sc->sc_copyfrombuf = lance_copyfrombuf_contig;
    426        1.1        pk 	sc->sc_zerobuf = lance_zerobuf_contig;
    427        1.1        pk 
    428        1.1        pk 	sc->sc_rdcsr = lerdcsr;
    429        1.1        pk 	sc->sc_wrcsr = lewrcsr;
    430        1.1        pk 	sc->sc_hwinit = lehwinit;
    431        1.1        pk 	sc->sc_nocarrier = lenocarrier;
    432        1.1        pk 	sc->sc_hwreset = lehwreset;
    433        1.1        pk 
    434        1.6        pk 	/* Establish interrupt handler */
    435        1.6        pk 	if (sa->sa_nintr != 0)
    436       1.22        pk 		(void)bus_intr_establish(sa->sa_bustag, sa->sa_pri, IPL_NET,
    437        1.6        pk 					 am7990_intr, sc);
    438        1.1        pk 
    439        1.1        pk 	am7990_config(&lesc->sc_am7990);
    440        1.1        pk 
    441        1.1        pk 	/* now initialize DMA */
    442        1.1        pk 	lehwreset(sc);
    443        1.1        pk }
    444