summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_dc.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-06-07 17:07:44 +0000
committerwpaul <wpaul@FreeBSD.org>2000-06-07 17:07:44 +0000
commit1a139479c40396dc356af086b7dd46869350ddcd (patch)
tree0f7989e98f8136a96c0e2692b91ea7ba3bfa7302 /sys/pci/if_dc.c
parent88e918b47416cfebf4458df15357766f184c17cb (diff)
downloadFreeBSD-src-1a139479c40396dc356af086b7dd46869350ddcd.zip
FreeBSD-src-1a139479c40396dc356af086b7dd46869350ddcd.tar.gz
When I tweaked if_dc.c to alter the polling interval for non-MII
21143 chips, I accidentally removed the DC_MII_REDUCED_POLL flag for all 21143 cards. This caused problems with timer-instigated TCP retransmits, which happened to occur at the same time as an MII poll tick on MII-based cards (e.g. D-Link DFE-570TX). Fixed this, plus made some other cleanups. The autoneg fixes for the non-MII cards still work. Also tested the PNIC II now that I have one again.
Diffstat (limited to 'sys/pci/if_dc.c')
-rw-r--r--sys/pci/if_dc.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index 5b8a01b..af00514 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/if_dc.c
@@ -1203,6 +1203,8 @@ static void dc_setcfg(sc, media)
}
if (IFM_SUBTYPE(media) == IFM_100_TX) {
+ DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_SPEEDSEL);
+ DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_HEARTBEAT);
if (sc->dc_pmode == DC_PMODE_MII) {
DC_SETBIT(sc, DC_WATCHDOG, DC_WDOG_JABBERDIS);
DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_PCS|
@@ -1223,11 +1225,11 @@ static void dc_setcfg(sc, media)
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PCS);
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_SCRAMBLER);
}
- DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_SPEEDSEL);
- DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_HEARTBEAT);
}
if (IFM_SUBTYPE(media) == IFM_10_T) {
+ DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_SPEEDSEL);
+ DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_HEARTBEAT);
if (sc->dc_pmode == DC_PMODE_MII) {
DC_SETBIT(sc, DC_WATCHDOG, DC_WDOG_JABBERDIS);
DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_PCS|
@@ -1247,8 +1249,6 @@ static void dc_setcfg(sc, media)
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PCS);
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_SCRAMBLER);
}
- DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_SPEEDSEL);
- DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_HEARTBEAT);
}
/*
@@ -1514,7 +1514,7 @@ static int dc_attach(dev)
case DC_DEVICEID_21143:
sc->dc_type = DC_TYPE_21143;
sc->dc_flags |= DC_TX_POLL|DC_TX_USE_TX_INTR;
- sc->dc_flags |= DC_REDUCED_MII_POLL|DC_21143_NWAY;
+ sc->dc_flags |= DC_REDUCED_MII_POLL;
break;
case DC_DEVICEID_DM9100:
case DC_DEVICEID_DM9102:
@@ -1613,8 +1613,10 @@ static int dc_attach(dev)
DELAY(10000);
if (media & DC_CWUC_MII_ABILITY)
sc->dc_pmode = DC_PMODE_MII;
- if (media & DC_CWUC_SYM_ABILITY)
+ if (media & DC_CWUC_SYM_ABILITY) {
sc->dc_pmode = DC_PMODE_SYM;
+ sc->dc_flags |= DC_21143_NWAY;
+ }
/*
* If none of the bits are set, then this NIC
* isn't meant to support 'wake up LAN' mode.
@@ -1705,6 +1707,7 @@ static int dc_attach(dev)
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;
@@ -2265,8 +2268,10 @@ static void dc_tick(xsc)
} else {
r = CSR_READ_4(sc, DC_ISR);
if ((r & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT &&
- sc->dc_cdata.dc_tx_prod == 0)
+ sc->dc_cdata.dc_tx_cnt == 0)
mii_tick(mii);
+ if (!(mii->mii_media_status & IFM_ACTIVE))
+ sc->dc_link = 0;
}
} else
mii_tick(mii);
OpenPOWER on IntegriCloud