printf("%s: failed to read station address\n", sc->sc_dev.dv_xname);
printf(": failed to read station address\n");
void ste_attach(parent, self, aux)	struct device		*parent, *self;	void			*aux;{	const char		*intrstr = NULL;	pcireg_t		command;	struct ste_softc	*sc = (struct ste_softc *)self;	struct pci_attach_args	*pa = aux;	pci_chipset_tag_t	pc = pa->pa_pc;	pci_intr_handle_t	ih;	struct ifnet		*ifp;	bus_size_t		size;	/*	 * Handle power management nonsense.	 */	command = pci_conf_read(pc, pa->pa_tag, STE_PCI_CAPID) & 0x000000FF;	if (command == 0x01) {		command = pci_conf_read(pc, pa->pa_tag, STE_PCI_PWRMGMTCTRL);		if (command & STE_PSTATE_MASK) {			u_int32_t		iobase, membase, irq;			/* Save important PCI config data. */			iobase = pci_conf_read(pc, pa->pa_tag, STE_PCI_LOIO);			membase = pci_conf_read(pc, pa->pa_tag, STE_PCI_LOMEM);			irq = pci_conf_read(pc, pa->pa_tag, STE_PCI_INTLINE);			/* Reset the power state. */			printf("%s: chip is in D%d power mode -- setting to D0\n",				sc->sc_dev.dv_xname, command & STE_PSTATE_MASK);			command &= 0xFFFFFFFC;			pci_conf_write(pc, pa->pa_tag, STE_PCI_PWRMGMTCTRL, command);			/* Restore PCI config data. */			pci_conf_write(pc, pa->pa_tag, STE_PCI_LOIO, iobase);			pci_conf_write(pc, pa->pa_tag, STE_PCI_LOMEM, membase);			pci_conf_write(pc, pa->pa_tag, STE_PCI_INTLINE, irq);		}	}	/*	 * Only use one PHY since this chip reports multiple	 * Note on the DFE-550 the PHY is at 1 on the DFE-580	 * it is at 0 & 1.  It is rev 0x12.	 */	if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_DLINK &&	    PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DLINK_550TX &&	    PCI_REVISION(pa->pa_class) == 0x12)		sc->ste_one_phy = 1;	/*	 * Map control/status registers.	 */#ifdef STE_USEIOSPACE	if (pci_mapreg_map(pa, STE_PCI_LOIO,	    PCI_MAPREG_TYPE_IO, 0,	    &sc->ste_btag, &sc->ste_bhandle, NULL, &size, 0)) {		printf(": can't map i/o space\n");		return;	} #else	if (pci_mapreg_map(pa, STE_PCI_LOMEM,	    PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT, 0,	    &sc->ste_btag, &sc->ste_bhandle, NULL, &size, 0)) {		printf(": can't map mem space\n");		return;	}#endif	/* Allocate interrupt */	if (pci_intr_map(pa, &ih)) {		printf(": couldn't map interrupt\n");		goto fail_1;	}	intrstr = pci_intr_string(pc, ih);	sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, ste_intr, sc,	    self->dv_xname);	if (sc->sc_ih == NULL) {		printf(": couldn't establish interrupt");		if (intrstr != NULL)			printf(" at %s", intrstr);		printf("\n");		goto fail_1;	}	printf(": %s", intrstr);	/* Reset the adapter. */	ste_reset(sc);	/*	 * Get station address from the EEPROM.	 */	if (ste_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr,	    STE_EEADDR_NODE0, 3, 0)) {		printf("%s: failed to read station address\n",		    sc->sc_dev.dv_xname);		goto fail_2;	}	printf(", address %s\n", ether_sprintf(sc->arpcom.ac_enaddr));	sc->ste_ldata_ptr = malloc(sizeof(struct ste_list_data) + 8,	    M_DEVBUF, M_DONTWAIT);	if (sc->ste_ldata_ptr == NULL) {		printf("%s: no memory for list buffers!\n",		    sc->sc_dev.dv_xname);		goto fail_2;	}	sc->ste_ldata = (struct ste_list_data *)sc->ste_ldata_ptr;	bzero(sc->ste_ldata, sizeof(struct ste_list_data));	ifp = &sc->arpcom.ac_if;	ifp->if_softc = sc;	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;	ifp->if_ioctl = ste_ioctl;	ifp->if_start = ste_start;	ifp->if_watchdog = ste_watchdog;	ifp->if_baudrate = 10000000;	IFQ_SET_MAXLEN(&ifp->if_snd, STE_TX_LIST_CNT - 1);	IFQ_SET_READY(&ifp->if_snd);	bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);	ifp->if_capabilities = IFCAP_VLAN_MTU;	sc->ste_tx_thresh = STE_TXSTART_THRESH;	sc->sc_mii.mii_ifp = ifp;	sc->sc_mii.mii_readreg = ste_miibus_readreg;	sc->sc_mii.mii_writereg = ste_miibus_writereg;	sc->sc_mii.mii_statchg = ste_miibus_statchg;	ifmedia_init(&sc->sc_mii.mii_media, 0, ste_ifmedia_upd,ste_ifmedia_sts);	mii_attach(self, &sc->sc_mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY,	    0);	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);	/*	 * Call MI attach routines.	 */	if_attach(ifp);	ether_ifattach(ifp);	shutdownhook_establish(ste_shutdown, sc);	return;fail_2:	pci_intr_disestablish(pc, sc->sc_ih);fail_1:	bus_space_unmap(sc->ste_btag, sc->ste_bhandle, size);}