Home | History | Annotate | Line # | Download | only in sbus
if_le_ledma.c revision 1.8
      1  1.8   pk /*	$NetBSD: if_le_ledma.c,v 1.8 2000/05/09 22:51:34 pk 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.1   pk 
     40  1.1   pk #include "opt_inet.h"
     41  1.1   pk #include "bpfilter.h"
     42  1.1   pk 
     43  1.1   pk #include <sys/param.h>
     44  1.1   pk #include <sys/systm.h>
     45  1.1   pk #include <sys/mbuf.h>
     46  1.1   pk #include <sys/syslog.h>
     47  1.1   pk #include <sys/socket.h>
     48  1.1   pk #include <sys/device.h>
     49  1.1   pk #include <sys/malloc.h>
     50  1.1   pk 
     51  1.1   pk #include <net/if.h>
     52  1.1   pk #include <net/if_ether.h>
     53  1.1   pk #include <net/if_media.h>
     54  1.1   pk 
     55  1.1   pk #ifdef INET
     56  1.1   pk #include <netinet/in.h>
     57  1.1   pk #include <netinet/if_inarp.h>
     58  1.1   pk #endif
     59  1.1   pk 
     60  1.1   pk #include <machine/autoconf.h>
     61  1.1   pk #include <machine/cpu.h>
     62  1.1   pk 
     63  1.1   pk #include <dev/sbus/sbusvar.h>
     64  1.1   pk 
     65  1.1   pk #include <dev/ic/lsi64854reg.h>
     66  1.1   pk #include <dev/ic/lsi64854var.h>
     67  1.1   pk 
     68  1.1   pk #include <dev/ic/lancereg.h>
     69  1.1   pk #include <dev/ic/lancevar.h>
     70  1.1   pk #include <dev/ic/am7990reg.h>
     71  1.1   pk #include <dev/ic/am7990var.h>
     72  1.1   pk 
     73  1.1   pk /*
     74  1.1   pk  * LANCE registers.
     75  1.1   pk  */
     76  1.1   pk #define LEREG1_RDP	0	/* Register Data port */
     77  1.1   pk #define LEREG1_RAP	2	/* Register Address port */
     78  1.1   pk 
     79  1.1   pk struct	le_softc {
     80  1.1   pk 	struct	am7990_softc	sc_am7990;	/* glue to MI code */
     81  1.1   pk 	struct	sbusdev		sc_sd;		/* sbus device */
     82  1.1   pk 	bus_space_tag_t		sc_bustag;
     83  1.8   pk 	bus_dmamap_t		sc_dmamap;
     84  1.1   pk 	bus_space_handle_t	sc_reg;		/* LANCE registers */
     85  1.1   pk 	struct	lsi64854_softc	*sc_dma;	/* pointer to my dma */
     86  1.4  eeh 	u_int			sc_laddr;	/* LANCE DMA address */
     87  1.1   pk };
     88  1.1   pk 
     89  1.1   pk #define MEMSIZE		(16*1024)	/* LANCE memory size */
     90  1.1   pk #define LEDMA_BOUNDARY	(16*1024*1024)	/* must not cross 16MB boundary */
     91  1.1   pk 
     92  1.1   pk int	lematch_ledma __P((struct device *, struct cfdata *, void *));
     93  1.1   pk void	leattach_ledma __P((struct device *, struct device *, void *));
     94  1.1   pk 
     95  1.1   pk /*
     96  1.1   pk  * Media types supported by the Sun4m.
     97  1.1   pk  */
     98  1.1   pk static int lemedia[] = {
     99  1.1   pk 	IFM_ETHER|IFM_10_T,
    100  1.1   pk 	IFM_ETHER|IFM_10_5,
    101  1.1   pk 	IFM_ETHER|IFM_AUTO,
    102  1.1   pk };
    103  1.1   pk #define NLEMEDIA	(sizeof(lemedia) / sizeof(lemedia[0]))
    104  1.1   pk 
    105  1.1   pk void	lesetutp __P((struct lance_softc *));
    106  1.1   pk void	lesetaui __P((struct lance_softc *));
    107  1.1   pk 
    108  1.1   pk int	lemediachange __P((struct lance_softc *));
    109  1.1   pk void	lemediastatus __P((struct lance_softc *, struct ifmediareq *));
    110  1.1   pk 
    111  1.1   pk struct cfattach le_ledma_ca = {
    112  1.1   pk 	sizeof(struct le_softc), lematch_ledma, leattach_ledma
    113  1.1   pk };
    114  1.1   pk 
    115  1.1   pk extern struct cfdriver le_cd;
    116  1.1   pk 
    117  1.1   pk #if defined(_KERNEL) && !defined(_LKM)
    118  1.1   pk #include "opt_ddb.h"
    119  1.1   pk #endif
    120  1.1   pk 
    121  1.1   pk #ifdef DDB
    122  1.1   pk #define	integrate
    123  1.1   pk #define hide
    124  1.1   pk #else
    125  1.1   pk #define	integrate	static __inline
    126  1.1   pk #define hide		static
    127  1.1   pk #endif
    128  1.1   pk 
    129  1.1   pk static void lewrcsr __P((struct lance_softc *, u_int16_t, u_int16_t));
    130  1.1   pk static u_int16_t lerdcsr __P((struct lance_softc *, u_int16_t));
    131  1.1   pk hide void lehwreset __P((struct lance_softc *));
    132  1.1   pk hide void lehwinit __P((struct lance_softc *));
    133  1.1   pk hide void lenocarrier __P((struct lance_softc *));
    134  1.1   pk 
    135  1.1   pk static void
    136  1.1   pk lewrcsr(sc, port, val)
    137  1.1   pk 	struct lance_softc *sc;
    138  1.1   pk 	u_int16_t port, val;
    139  1.1   pk {
    140  1.1   pk 	struct le_softc *lesc = (struct le_softc *)sc;
    141  1.1   pk 
    142  1.1   pk 	bus_space_write_2(lesc->sc_bustag, lesc->sc_reg, LEREG1_RAP, port);
    143  1.1   pk 	bus_space_write_2(lesc->sc_bustag, lesc->sc_reg, LEREG1_RDP, val);
    144  1.1   pk 
    145  1.1   pk #if defined(SUN4M)
    146  1.1   pk 	/*
    147  1.1   pk 	 * We need to flush the Sbus->Mbus write buffers. This can most
    148  1.1   pk 	 * easily be accomplished by reading back the register that we
    149  1.1   pk 	 * just wrote (thanks to Chris Torek for this solution).
    150  1.1   pk 	 */
    151  1.1   pk 	if (CPU_ISSUN4M) {
    152  1.1   pk 		volatile u_int16_t discard;
    153  1.1   pk 		discard = bus_space_read_2(lesc->sc_bustag, lesc->sc_reg,
    154  1.1   pk 					   LEREG1_RDP);
    155  1.1   pk 	}
    156  1.1   pk #endif
    157  1.1   pk }
    158  1.1   pk 
    159  1.1   pk static u_int16_t
    160  1.1   pk lerdcsr(sc, port)
    161  1.1   pk 	struct lance_softc *sc;
    162  1.1   pk 	u_int16_t port;
    163  1.1   pk {
    164  1.1   pk 	struct le_softc *lesc = (struct le_softc *)sc;
    165  1.1   pk 
    166  1.1   pk 	bus_space_write_2(lesc->sc_bustag, lesc->sc_reg, LEREG1_RAP, port);
    167  1.1   pk 	return (bus_space_read_2(lesc->sc_bustag, lesc->sc_reg, LEREG1_RDP));
    168  1.1   pk }
    169  1.1   pk 
    170  1.1   pk void
    171  1.1   pk lesetutp(sc)
    172  1.1   pk 	struct lance_softc *sc;
    173  1.1   pk {
    174  1.3   pk 	struct lsi64854_softc *dma = ((struct le_softc *)sc)->sc_dma;
    175  1.1   pk 	u_int32_t csr;
    176  1.1   pk 
    177  1.3   pk 	csr = L64854_GCSR(dma);
    178  1.1   pk 	csr |= E_TP_AUI;
    179  1.3   pk 	L64854_SCSR(dma, csr);
    180  1.1   pk 	delay(20000);	/* must not touch le for 20ms */
    181  1.1   pk }
    182  1.1   pk 
    183  1.1   pk void
    184  1.1   pk lesetaui(sc)
    185  1.1   pk 	struct lance_softc *sc;
    186  1.1   pk {
    187  1.3   pk 	struct lsi64854_softc *dma = ((struct le_softc *)sc)->sc_dma;
    188  1.1   pk 	u_int32_t csr;
    189  1.1   pk 
    190  1.3   pk 	csr = L64854_GCSR(dma);
    191  1.1   pk 	csr &= ~E_TP_AUI;
    192  1.3   pk 	L64854_SCSR(dma, csr);
    193  1.1   pk 	delay(20000);	/* must not touch le for 20ms */
    194  1.1   pk }
    195  1.1   pk 
    196  1.1   pk int
    197  1.1   pk lemediachange(sc)
    198  1.1   pk 	struct lance_softc *sc;
    199  1.1   pk {
    200  1.1   pk 	struct ifmedia *ifm = &sc->sc_media;
    201  1.1   pk 
    202  1.1   pk 	if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
    203  1.1   pk 		return (EINVAL);
    204  1.1   pk 
    205  1.1   pk 	/*
    206  1.1   pk 	 * Switch to the selected media.  If autoselect is
    207  1.1   pk 	 * set, we don't really have to do anything.  We'll
    208  1.1   pk 	 * switch to the other media when we detect loss of
    209  1.1   pk 	 * carrier.
    210  1.1   pk 	 */
    211  1.1   pk 	switch (IFM_SUBTYPE(ifm->ifm_media)) {
    212  1.1   pk 	case IFM_10_T:
    213  1.1   pk 		lesetutp(sc);
    214  1.1   pk 		break;
    215  1.1   pk 
    216  1.1   pk 	case IFM_10_5:
    217  1.1   pk 		lesetaui(sc);
    218  1.1   pk 		break;
    219  1.1   pk 
    220  1.1   pk 	case IFM_AUTO:
    221  1.1   pk 		break;
    222  1.1   pk 
    223  1.1   pk 	default:
    224  1.1   pk 		return (EINVAL);
    225  1.1   pk 	}
    226  1.1   pk 
    227  1.1   pk 	return (0);
    228  1.1   pk }
    229  1.1   pk 
    230  1.1   pk void
    231  1.1   pk lemediastatus(sc, ifmr)
    232  1.1   pk 	struct lance_softc *sc;
    233  1.1   pk 	struct ifmediareq *ifmr;
    234  1.1   pk {
    235  1.3   pk 	struct lsi64854_softc *dma = ((struct le_softc *)sc)->sc_dma;
    236  1.1   pk 
    237  1.1   pk 	/*
    238  1.1   pk 	 * Notify the world which media we're currently using.
    239  1.1   pk 	 */
    240  1.3   pk 	if (L64854_GCSR(dma) & E_TP_AUI)
    241  1.1   pk 		ifmr->ifm_active = IFM_ETHER|IFM_10_T;
    242  1.1   pk 	else
    243  1.1   pk 		ifmr->ifm_active = IFM_ETHER|IFM_10_5;
    244  1.1   pk }
    245  1.1   pk 
    246  1.1   pk hide void
    247  1.1   pk lehwreset(sc)
    248  1.1   pk 	struct lance_softc *sc;
    249  1.1   pk {
    250  1.1   pk 	struct le_softc *lesc = (struct le_softc *)sc;
    251  1.1   pk 	struct lsi64854_softc *dma = lesc->sc_dma;
    252  1.1   pk 	u_int32_t csr;
    253  1.4  eeh 	u_int aui_bit;
    254  1.1   pk 
    255  1.1   pk 	/*
    256  1.1   pk 	 * Reset DMA channel.
    257  1.1   pk 	 */
    258  1.1   pk 	csr = L64854_GCSR(dma);
    259  1.1   pk 	aui_bit = csr & E_TP_AUI;
    260  1.1   pk 	DMA_RESET(dma);
    261  1.1   pk 
    262  1.1   pk 	/* Write bits 24-31 of Lance address */
    263  1.1   pk 	bus_space_write_4(dma->sc_bustag, dma->sc_regs, L64854_REG_ENBAR,
    264  1.1   pk 			  lesc->sc_laddr & 0xff000000);
    265  1.1   pk 
    266  1.1   pk 	DMA_ENINTR(dma);
    267  1.1   pk 
    268  1.1   pk 	/*
    269  1.1   pk 	 * Disable E-cache invalidates on chip writes.
    270  1.1   pk 	 * Retain previous cable selection bit.
    271  1.1   pk 	 */
    272  1.1   pk 	csr = L64854_GCSR(dma);
    273  1.1   pk 	csr |= (E_DSBL_WR_INVAL | aui_bit);
    274  1.1   pk 	L64854_SCSR(dma, csr);
    275  1.5   pk 	delay(20000);	/* must not touch le for 20ms */
    276  1.1   pk }
    277  1.1   pk 
    278  1.1   pk hide void
    279  1.1   pk lehwinit(sc)
    280  1.1   pk 	struct lance_softc *sc;
    281  1.1   pk {
    282  1.1   pk 
    283  1.1   pk 	/*
    284  1.1   pk 	 * Make sure we're using the currently-enabled media type.
    285  1.1   pk 	 * XXX Actually, this is probably unnecessary, now.
    286  1.1   pk 	 */
    287  1.1   pk 	switch (IFM_SUBTYPE(sc->sc_media.ifm_cur->ifm_media)) {
    288  1.1   pk 	case IFM_10_T:
    289  1.1   pk 		lesetutp(sc);
    290  1.1   pk 		break;
    291  1.1   pk 
    292  1.1   pk 	case IFM_10_5:
    293  1.1   pk 		lesetaui(sc);
    294  1.1   pk 		break;
    295  1.1   pk 	}
    296  1.1   pk }
    297  1.1   pk 
    298  1.1   pk hide void
    299  1.1   pk lenocarrier(sc)
    300  1.1   pk 	struct lance_softc *sc;
    301  1.1   pk {
    302  1.1   pk 	struct le_softc *lesc = (struct le_softc *)sc;
    303  1.1   pk 
    304  1.1   pk 	/*
    305  1.1   pk 	 * Check if the user has requested a certain cable type, and
    306  1.1   pk 	 * if so, honor that request.
    307  1.1   pk 	 */
    308  1.1   pk 	printf("%s: lost carrier on ", sc->sc_dev.dv_xname);
    309  1.1   pk 
    310  1.1   pk 	if (L64854_GCSR(lesc->sc_dma) & E_TP_AUI) {
    311  1.1   pk 		printf("UTP port");
    312  1.1   pk 		switch (IFM_SUBTYPE(sc->sc_media.ifm_media)) {
    313  1.1   pk 		case IFM_10_5:
    314  1.1   pk 		case IFM_AUTO:
    315  1.1   pk 			printf(", switching to AUI port");
    316  1.1   pk 			lesetaui(sc);
    317  1.1   pk 		}
    318  1.1   pk 	} else {
    319  1.1   pk 		printf("AUI port");
    320  1.1   pk 		switch (IFM_SUBTYPE(sc->sc_media.ifm_media)) {
    321  1.1   pk 		case IFM_10_T:
    322  1.1   pk 		case IFM_AUTO:
    323  1.1   pk 			printf(", switching to UTP port");
    324  1.1   pk 			lesetutp(sc);
    325  1.1   pk 		}
    326  1.1   pk 	}
    327  1.1   pk 	printf("\n");
    328  1.1   pk }
    329  1.1   pk 
    330  1.1   pk int
    331  1.1   pk lematch_ledma(parent, cf, aux)
    332  1.1   pk 	struct device *parent;
    333  1.1   pk 	struct cfdata *cf;
    334  1.1   pk 	void *aux;
    335  1.1   pk {
    336  1.1   pk 	struct sbus_attach_args *sa = aux;
    337  1.1   pk 
    338  1.1   pk 	return (strcmp(cf->cf_driver->cd_name, sa->sa_name) == 0);
    339  1.1   pk }
    340  1.1   pk 
    341  1.1   pk 
    342  1.1   pk void
    343  1.1   pk leattach_ledma(parent, self, aux)
    344  1.1   pk 	struct device *parent, *self;
    345  1.1   pk 	void *aux;
    346  1.1   pk {
    347  1.1   pk 	struct sbus_attach_args *sa = aux;
    348  1.1   pk 	struct le_softc *lesc = (struct le_softc *)self;
    349  1.1   pk 	struct lsi64854_softc *lsi = (struct lsi64854_softc *)parent;
    350  1.1   pk 	struct lance_softc *sc = &lesc->sc_am7990.lsc;
    351  1.8   pk 	bus_dma_tag_t dmatag = sa->sa_dmatag;
    352  1.1   pk 	bus_dma_segment_t seg;
    353  1.1   pk 	int rseg, error;
    354  1.1   pk 	/* XXX the following declarations should be elsewhere */
    355  1.1   pk 	extern void myetheraddr __P((u_char *));
    356  1.1   pk 
    357  1.1   pk 	lesc->sc_bustag = sa->sa_bustag;
    358  1.1   pk 
    359  1.1   pk 	/* Establish link to `ledma' device */
    360  1.1   pk 	lesc->sc_dma = lsi;
    361  1.2   pk 	lesc->sc_dma->sc_client = lesc;
    362  1.1   pk 
    363  1.1   pk 	/* Map device registers */
    364  1.1   pk 	if (bus_space_map2(sa->sa_bustag,
    365  1.1   pk 			   sa->sa_slot,
    366  1.1   pk 			   sa->sa_offset,
    367  1.1   pk 			   sa->sa_size,
    368  1.1   pk 			   BUS_SPACE_MAP_LINEAR,
    369  1.1   pk 			   0, &lesc->sc_reg) != 0) {
    370  1.1   pk 		printf("%s @ ledma: cannot map registers\n", self->dv_xname);
    371  1.1   pk 		return;
    372  1.1   pk 	}
    373  1.1   pk 
    374  1.1   pk 	/* Allocate buffer memory */
    375  1.1   pk 	sc->sc_memsize = MEMSIZE;
    376  1.8   pk 
    377  1.8   pk 	if ((error = bus_dmamap_create(dmatag, MEMSIZE, 1, MEMSIZE,
    378  1.8   pk 					LEDMA_BOUNDARY, BUS_DMA_NOWAIT,
    379  1.8   pk 					&lesc->sc_dmamap)) != 0) {
    380  1.8   pk 		printf("%s: DMA map create error %d\n", self->dv_xname, error);
    381  1.8   pk 		return;
    382  1.8   pk 	}
    383  1.8   pk 
    384  1.8   pk 	if ((error = bus_dmamem_alloc(dmatag, MEMSIZE, NBPG, LEDMA_BOUNDARY,
    385  1.8   pk 				 &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
    386  1.1   pk 		printf("%s @ ledma: DMA buffer alloc error %d\n",
    387  1.1   pk 			self->dv_xname, error);
    388  1.1   pk 		return;
    389  1.1   pk 	}
    390  1.8   pk 
    391  1.8   pk 	if ((error = bus_dmamem_map(dmatag, &seg, rseg, MEMSIZE,
    392  1.1   pk 			       (caddr_t *)&sc->sc_mem,
    393  1.8   pk 			       BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
    394  1.1   pk 		printf("%s @ ledma: DMA buffer map error %d\n",
    395  1.1   pk 			self->dv_xname, error);
    396  1.8   pk 		bus_dmamem_free(dmatag, &seg, rseg);
    397  1.8   pk 		return;
    398  1.8   pk 	}
    399  1.8   pk 
    400  1.8   pk 	if ((error = bus_dmamap_load_raw(dmatag, lesc->sc_dmamap,
    401  1.8   pk 				&seg, rseg, MEMSIZE, BUS_DMA_NOWAIT)) != 0) {
    402  1.8   pk 		printf("%s: DMA buffer map load error %d\n",
    403  1.8   pk 			self->dv_xname, error);
    404  1.8   pk 		bus_dmamem_unmap(dmatag, (caddr_t)sc->sc_mem, MEMSIZE);
    405  1.8   pk 		bus_dmamem_free(dmatag, &seg, rseg);
    406  1.1   pk 		return;
    407  1.1   pk 	}
    408  1.1   pk 
    409  1.8   pk 	lesc->sc_laddr = lesc->sc_dmamap->dm_segs[0].ds_addr;
    410  1.8   pk 	sc->sc_addr = lesc->sc_laddr & 0xffffff;
    411  1.1   pk 	sc->sc_conf3 = LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON;
    412  1.1   pk 
    413  1.1   pk 
    414  1.1   pk 	/* Assume SBus is grandparent */
    415  1.1   pk 	lesc->sc_sd.sd_reset = (void *)lance_reset;
    416  1.1   pk 	sbus_establish(&lesc->sc_sd, parent);
    417  1.1   pk 
    418  1.1   pk 	sc->sc_mediachange = lemediachange;
    419  1.1   pk 	sc->sc_mediastatus = lemediastatus;
    420  1.1   pk 	sc->sc_supmedia = lemedia;
    421  1.1   pk 	sc->sc_nsupmedia = NLEMEDIA;
    422  1.1   pk 	sc->sc_defaultmedia = IFM_ETHER|IFM_AUTO;
    423  1.1   pk 
    424  1.1   pk 	myetheraddr(sc->sc_enaddr);
    425  1.1   pk 
    426  1.1   pk 	sc->sc_copytodesc = lance_copytobuf_contig;
    427  1.1   pk 	sc->sc_copyfromdesc = lance_copyfrombuf_contig;
    428  1.1   pk 	sc->sc_copytobuf = lance_copytobuf_contig;
    429  1.1   pk 	sc->sc_copyfrombuf = lance_copyfrombuf_contig;
    430  1.1   pk 	sc->sc_zerobuf = lance_zerobuf_contig;
    431  1.1   pk 
    432  1.1   pk 	sc->sc_rdcsr = lerdcsr;
    433  1.1   pk 	sc->sc_wrcsr = lewrcsr;
    434  1.1   pk 	sc->sc_hwinit = lehwinit;
    435  1.1   pk 	sc->sc_nocarrier = lenocarrier;
    436  1.1   pk 	sc->sc_hwreset = lehwreset;
    437  1.1   pk 
    438  1.6   pk 	/* Establish interrupt handler */
    439  1.6   pk 	if (sa->sa_nintr != 0)
    440  1.6   pk 		(void)bus_intr_establish(sa->sa_bustag, sa->sa_pri, 0,
    441  1.6   pk 					 am7990_intr, sc);
    442  1.1   pk 
    443  1.1   pk 	am7990_config(&lesc->sc_am7990);
    444  1.1   pk 
    445  1.1   pk 	/* now initialize DMA */
    446  1.1   pk 	lehwreset(sc);
    447  1.1   pk }
    448