if (media & DC_CWUC_SYM_ABILITY)
if (media & DC_CWUC_SYM_ABILITY) {
void dc_pci_attach(parent, self, aux)	struct device *parent, *self;	void *aux;{	int			s;	const char		*intrstr = NULL;	u_int32_t		command;	struct dc_softc		*sc = (struct dc_softc *)self;	struct pci_attach_args	*pa = aux;	pci_chipset_tag_t	pc = pa->pa_pc;	pci_intr_handle_t	ih;	bus_addr_t		iobase;	bus_size_t		iosize;	u_int32_t		revision;	int			found = 0;	s = splimp();	sc->dc_unit = sc->sc_dev.dv_unit;	/*	 * Handle power management nonsense.	 */	dc_pci_acpi(self, aux);	/*	 * Map control/status registers.	 */	command = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);	command |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE |	    PCI_COMMAND_MASTER_ENABLE;	pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, command);	command = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);	sc->dc_csid = pci_conf_read(pc, pa->pa_tag, PCI_SUBSYS_ID_REG);#ifdef DC_USEIOSPACE	if (!(command & PCI_COMMAND_IO_ENABLE)) {		printf(": failed to enable I/O ports\n");		goto fail;	}	if (pci_io_find(pc, pa->pa_tag, DC_PCI_CFBIO, &iobase, &iosize)) {		printf(": can't find I/O space\n");		goto fail;	}	if (bus_space_map(pa->pa_iot, iobase, iosize, 0, &sc->dc_bhandle)) {		printf(": can't map I/O space\n");		goto fail;	}	sc->dc_btag = pa->pa_iot;#else	if (!(command & PCI_COMMAND_MEM_ENABLE)) {		printf(": failed to enable memory mapping\n");		goto fail;	}	if (pci_mem_find(pc, pa->pa_tag, DC_PCI_CFBMA, &iobase, &iosize, NULL)){		printf(": can't find mem space\n");		goto fail;	}	if (bus_space_map(pa->pa_memt, iobase, iosize, 0, &sc->dc_bhandle)) {		printf(": can't map mem space\n");		goto fail;	}	sc->dc_btag = pa->pa_memt;#endif	/* Allocate interrupt */	if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin, pa->pa_intrline,	    &ih)) {		printf(": couldn't map interrupt\n");		goto fail;	}	intrstr = pci_intr_string(pc, ih);	sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, dc_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;	}	printf(": %s", intrstr);	/* Need this info to decide on a chip type. */	sc->dc_revision = revision = PCI_REVISION(pa->pa_class);	switch (PCI_VENDOR(pa->pa_id)) {	case PCI_VENDOR_DEC:		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DEC_21142) {			found = 1;			sc->dc_type = DC_TYPE_21143;			sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;			sc->dc_flags |= DC_REDUCED_MII_POLL;		}		break;	case PCI_VENDOR_DAVICOM:		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DAVICOM_DM9100 ||		    PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DAVICOM_DM9102) {			found = 1;			sc->dc_type = DC_TYPE_DM9102;			sc->dc_flags |= DC_TX_COALESCE|DC_TX_USE_TX_INTR;			sc->dc_flags |= DC_REDUCED_MII_POLL;			sc->dc_pmode = DC_PMODE_MII;		}		break;	case PCI_VENDOR_ADMTEK:		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADMTEK_AL981) {			found = 1;			sc->dc_type = DC_TYPE_AL981;			sc->dc_flags |= DC_TX_USE_TX_INTR;			sc->dc_flags |= DC_TX_ADMTEK_WAR;			sc->dc_pmode = DC_PMODE_MII;		}		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADMTEK_AN983) {			found = 1;			sc->dc_type = DC_TYPE_AN983;			sc->dc_flags |= DC_TX_USE_TX_INTR;			sc->dc_flags |= DC_TX_ADMTEK_WAR;			sc->dc_pmode = DC_PMODE_MII;		}		break;	case PCI_VENDOR_MACRONIX:		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_MACRONIX_MX98713) {			found = 1;			if (revision < DC_REVISION_98713A) {				sc->dc_type = DC_TYPE_98713;				sc->dc_flags |= DC_REDUCED_MII_POLL;			}			if (revision >= DC_REVISION_98713A)				sc->dc_type = DC_TYPE_98713A;			sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;		}		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_MACRONIX_MX98715) {			found = 1;			sc->dc_type = DC_TYPE_987x5;			sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;		}		break;	case PCI_VENDOR_COMPEX:		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_COMPEX_98713) {			found = 1;			if (revision < DC_REVISION_98713A) {				sc->dc_type = DC_TYPE_98713;				sc->dc_flags |= DC_REDUCED_MII_POLL;			}			if (revision >= DC_REVISION_98713A)				sc->dc_type = DC_TYPE_98713A;			sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;		}		break;	case PCI_VENDOR_LITEON:		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_LITEON_PNICII) {			found = 1;			sc->dc_type = DC_TYPE_PNICII;			sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;		}		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_LITEON_PNIC) {			found = 1;			sc->dc_type = DC_TYPE_PNIC;			sc->dc_flags |= DC_TX_STORENFWD|DC_TX_INTR_ALWAYS;			sc->dc_flags |= DC_PNIC_RX_BUG_WAR;			sc->dc_pnic_rx_buf = malloc(DC_RXLEN * 5, M_DEVBUF,			    M_NOWAIT);			if (revision < DC_REVISION_82C169)				sc->dc_pmode = DC_PMODE_SYM;		}		break;	case PCI_VENDOR_ASIX:		if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ASIX_AX88140A) {			found = 1;			sc->dc_type = DC_TYPE_ASIX;			sc->dc_flags |= DC_TX_USE_TX_INTR|DC_TX_INTR_FIRSTFRAG;			sc->dc_flags |= DC_REDUCED_MII_POLL;			sc->dc_pmode = DC_PMODE_MII;		}		break;	}	if (found == 0) {		/* This shouldn't happen if probe has done it's job... */		printf(": unknown device: %x:%x\n",		    PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id));		goto fail;	}	/* Save the cache line size. */	if (DC_IS_DAVICOM(sc))		sc->dc_cachesize = 0;	else		sc->dc_cachesize = pci_conf_read(pc, pa->pa_tag,		    DC_PCI_CFLT) & 0xFF;	/* Reset the adapter. */	dc_reset(sc);	/* Take 21143 out of snooze mode */	if (DC_IS_INTEL(sc)) {		command = pci_conf_read(pc, pa->pa_tag, DC_PCI_CFDD);		command &= ~(DC_CFDD_SNOOZE_MODE|DC_CFDD_SLEEP_MODE);		pci_conf_write(pc, pa->pa_tag, DC_PCI_CFDD, command);	}	/*	 * Try to learn something about the supported media.	 * We know that ASIX and ADMtek and Davicom devices	 * will *always* be using MII media, so that's a no-brainer.	 * The tricky ones are the Macronix/PNIC II and the	 * Intel 21143.	 */	if (DC_IS_INTEL(sc)) {		u_int32_t		media, cwuc;		cwuc = pci_conf_read(pc, pa->pa_tag, DC_PCI_CWUC);		cwuc |= DC_CWUC_FORCE_WUL;		pci_conf_write(pc, pa->pa_tag, DC_PCI_CWUC, cwuc);		DELAY(10000);		media = pci_conf_read(pc, pa->pa_tag, DC_PCI_CWUC);		cwuc &= ~DC_CWUC_FORCE_WUL;		pci_conf_write(pc, pa->pa_tag, DC_PCI_CWUC, cwuc);		DELAY(10000);		if (media & DC_CWUC_MII_ABILITY)			sc->dc_pmode = DC_PMODE_MII;		if (media & DC_CWUC_SYM_ABILITY)			sc->dc_pmode = DC_PMODE_SYM;		/*		 * If none of the bits are set, then this NIC		 * isn't meant to support 'wake up LAN' mode.		 * This is usually only the case on multiport		 * cards, and these cards almost always have		 * MII transceivers.		 */		if (media == 0)			sc->dc_pmode = DC_PMODE_MII;	} else if (DC_IS_MACRONIX(sc) || DC_IS_PNICII(sc)) {		if (sc->dc_type == DC_TYPE_98713)			sc->dc_pmode = DC_PMODE_MII;		else			sc->dc_pmode = DC_PMODE_SYM;	} else if (!sc->dc_pmode)		sc->dc_pmode = DC_PMODE_MII;	dc_attach_common(sc);fail:	splx(s);}