Ejemplo n.º 1
0
void
ebattach(struct device *parent, struct device *self, void *aux)
{
	struct eb_softc *sc = device_private(self);
	struct podulebus_attach_args *pa = aux;
	u_int8_t myaddr[ETHER_ADDR_LEN];

/*	dprintf(("Attaching %s...\n", device_xname(&sc->sc_dev)));*/

	/* Set the address of the controller for easy access */
	podulebus_shift_tag(pa->pa_mod_t, EB_8004_SHIFT, &sc->sc_8005.sc_iot);
	bus_space_map(sc->sc_8005.sc_iot, pa->pa_mod_base + EB_8004_BASE,
	    /* XXX */ 0, 0, &sc->sc_8005.sc_ioh);

	/*
	 * Build the address from the machine id.
	 */
	netslot_ea(myaddr);

	printf(":");
	seeq8005_attach(&sc->sc_8005, myaddr, NULL, 0, 0);

	/* Claim a podule interrupt */

	evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
	    device_xname(self), "intr");
	sc->sc_ih = podulebus_irq_establish(pa->pa_ih, IPL_NET, seeq8005intr,
	    sc, &sc->sc_intrcnt);
}
/*
 * em_ea()
 *
 * return the ethernet address for an EtherM netslot interface.
 * The EtherM interface uses the machines ethernet address so just
 * fill it out
 */
static uint8_t *
em_ea(struct ne_pbus_softc *sc, uint8_t *buffer)
{
	/*
	 * Use the podulebus netslot_ea() function to get the netslot
	 * ethernet address. This is generated from the machine ID.
	 */

	netslot_ea(buffer);
	return(buffer);
}