sc->sc_addr = kvtop((vaddr_t)sc->sc_mem); if (sc->sc_addr == 0L) { printf("\n%s: kvtop() failed!\n", sc->sc_dev.dv_xname); return; }
sc->sc_addr = (paddr_t)addr & 0x00ffffff;
leattach(parent, self, aux)	struct device *parent;	struct device *self;	void *aux;{	register struct le_softc *lesc = (struct le_softc *)self;	struct am7990_softc *sc = &lesc->sc_am7990;	struct confargs *ca = aux;	caddr_t addr;	int card;	bus_space_tag_t iot = ca->ca_iot;	bus_space_handle_t ioh;	if (ca->ca_vec < 0) {		printf(": no more interrupts!\n");		return;	}	if (ca->ca_ipl < 0)		ca->ca_ipl = IPL_NET;	if (bus_space_map(iot, ca->ca_paddr, PAGE_SIZE, 0, &ioh) != 0) {		printf(": can't map registers!\n");		return;	}	/* Are we the boot device? */	if (ca->ca_paddr == bootaddr)		bootdv = self;	/* 	 * get the first available etherbuf.  MVME376 uses its own dual-ported 	 * RAM for etherbuf.  It is set by dip switches on board.  We support 	 * the six Motorola address locations, however, the board can be set up	 * at any other address.	 * XXX These physical addresses should be mapped in extio!!!	 */	switch (ca->ca_paddr) {	case 0xffff1200:		card = 0;		break;	case 0xffff1400:		card = 1;		break;	case 0xffff1600:		card = 2;		break;	case 0xffff5400:		card = 3;		break;	case 0xffff5600:		card = 4;		break;	case 0xffffa400:		card = 5;		break;	default:		printf(": unsupported address\n");		return;	}	addr = (caddr_t)(VLEMEMBASE - (card * VLEMEMSIZE));	sc->sc_mem = (void *)mapiodev(addr, VLEMEMSIZE);	if (sc->sc_mem == NULL) {		printf("\n%s: no more memory in external I/O map\n",		    sc->sc_dev.dv_xname);		return;	}	sc->sc_addr = kvtop((vaddr_t)sc->sc_mem);	if (sc->sc_addr == 0L) {		printf("\n%s: kvtop() failed!\n", sc->sc_dev.dv_xname);		return;	}	lesc->sc_r1 = (void *)bus_space_vaddr(iot, ioh);	lesc->sc_ipl = ca->ca_ipl;	lesc->sc_vec = ca->ca_vec;	sc->sc_memsize = VLEMEMSIZE;	sc->sc_conf3 = LE_C3_BSWP;	sc->sc_hwreset = vlereset;	sc->sc_rdcsr = vlerdcsr;	sc->sc_wrcsr = vlewrcsr;	sc->sc_hwinit = vleinit;	sc->sc_copytodesc = vle_copytobuf_contig;	sc->sc_copyfromdesc = vle_copyfrombuf_contig;	sc->sc_copytobuf = vle_copytobuf_contig;	sc->sc_copyfrombuf = vle_copyfrombuf_contig;	sc->sc_zerobuf = vle_zerobuf_contig;	/* get ether address */	vleetheraddr(sc);	evcnt_attach(&sc->sc_dev, "intr", &lesc->sc_intrcnt);	evcnt_attach(&sc->sc_dev, "errs", &lesc->sc_errcnt);	am7990_config(sc);	/* connect the interrupt */	lesc->sc_ih.ih_fn = vle_intr;	lesc->sc_ih.ih_arg = sc;	lesc->sc_ih.ih_ipl = ca->ca_ipl;	vmeintr_establish(ca->ca_vec + 0, &lesc->sc_ih);}