bus_teardown_intr(dev, sc->dc_irq, sc->dc_intrhand); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->dc_irq); bus_release_resource(dev, DC_RES, DC_RID, sc->dc_res);
void dc_attach_common(sc)	struct dc_softc *sc;{	struct ifnet		*ifp;	int			mac_offset;	dc_eeprom_width(sc);	/*	 * Get station address from the EEPROM.	 */	switch(sc->dc_type) {	case DC_TYPE_98713:	case DC_TYPE_98713A:	case DC_TYPE_987x5:	case DC_TYPE_PNICII:		dc_read_eeprom(sc, (caddr_t)&mac_offset,		    (DC_EE_NODEADDR_OFFSET / 2), 1, 0);		dc_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr,		    (mac_offset / 2), 3, 0);		break;	case DC_TYPE_PNIC:		dc_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr, 0, 3, 1);		break;	case DC_TYPE_DM9102:	case DC_TYPE_21143:	case DC_TYPE_ASIX:		dc_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr,			    DC_EE_NODEADDR, 3, 0);		break;	case DC_TYPE_AL981:	case DC_TYPE_AN983:		dc_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr,		    DC_AL_EE_NODEADDR, 3, 0);		break;	default:		dc_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr,		    DC_EE_NODEADDR, 3, 0);		break;	}	/*	 * A 21143 or clone chip was detected. Inform the world.	 */	printf(" address %s\n", ether_sprintf(sc->arpcom.ac_enaddr));	sc->dc_ldata_ptr = malloc(sizeof(struct dc_list_data), M_DEVBUF,				M_NOWAIT);	if (sc->dc_ldata_ptr == NULL) {		printf("%s: no memory for list buffers!\n", sc->dc_unit);		goto fail;	}	sc->dc_ldata = (struct dc_list_data *)sc->dc_ldata_ptr;	bzero(sc->dc_ldata, sizeof(struct dc_list_data));	ifp = &sc->arpcom.ac_if;	ifp->if_softc = sc;	ifp->if_mtu = ETHERMTU;	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;	ifp->if_ioctl = dc_ioctl;	ifp->if_output = ether_output;	ifp->if_start = dc_start;	ifp->if_watchdog = dc_watchdog;	ifp->if_baudrate = 10000000;	ifp->if_snd.ifq_maxlen = DC_TX_LIST_CNT - 1;	bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);	sc->sc_mii.mii_ifp = ifp;	sc->sc_mii.mii_readreg = dc_miibus_readreg;	sc->sc_mii.mii_writereg = dc_miibus_writereg;	sc->sc_mii.mii_statchg = dc_miibus_statchg;	ifmedia_init(&sc->sc_mii.mii_media, 0, dc_ifmedia_upd, dc_ifmedia_sts);	mii_phy_probe(&sc->sc_dev, &sc->sc_mii, 0xffffffff);	if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {		ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE, 0, NULL);		ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_NONE);	} else		ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER|IFM_AUTO);	if (DC_IS_DAVICOM(sc) && sc->dc_revision >= DC_REVISION_DM9102A)		ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_HPNA_1,0,NULL);	/* if (error && DC_IS_INTEL(sc)) {		sc->dc_pmode = DC_PMODE_SYM;		sc->dc_flags |= DC_21143_NWAY;		mii_phy_probe(dev, &sc->dc_miibus,		    dc_ifmedia_upd, dc_ifmedia_sts);		error = 0;	}	if (error) {		printf("dc%d: MII without any PHY!\n", sc->dc_unit);		bus_teardown_intr(dev, sc->dc_irq, sc->dc_intrhand);		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->dc_irq);		bus_release_resource(dev, DC_RES, DC_RID, sc->dc_res);		error = ENXIO;		goto fail;	} */	/*	 * Call MI attach routines.	 */	if_attach(ifp);	ether_ifattach(ifp);#if NBPFILTER > 0	bpfattach(&sc->arpcom.ac_if.if_bpf, ifp, DLT_EN10MB,	    sizeof(struct ether_header));#endif	shutdownhook_establish(dc_shutdown, sc);fail:	return;}