summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-10-05 17:36:14 +0000
committerwpaul <wpaul@FreeBSD.org>2000-10-05 17:36:14 +0000
commit094e009b7bf2f3229f20c0e9598169d008e309b1 (patch)
tree198194ff98d817ad854b208274fb8f632f9154ce /sys/dev/mii
parent7e5aee1a7c10c28ef486189e52d18db3426fc94a (diff)
downloadFreeBSD-src-094e009b7bf2f3229f20c0e9598169d008e309b1.zip
FreeBSD-src-094e009b7bf2f3229f20c0e9598169d008e309b1.tar.gz
Add support for parsing the media blocks from the SROM on 21143
adapters. This is necessary in order to make this driver work with the built-in ethernet on the alpha Miata machines. These systems have a 21143-PC chip on-board and optional daughtercards with either a 10/100 MII transceiver or a 10baseT/10base2 transceiver. In both cases, you need to twiddle the GPIO bits on the controller in order to turn the transceivers on, and you have to read the media info from the SROM in order to find out what bits to twiddle.
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/dcphy.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/mii/dcphy.c b/sys/dev/mii/dcphy.c
index 73e241e..ad2599c 100644
--- a/sys/dev/mii/dcphy.c
+++ b/sys/dev/mii/dcphy.c
@@ -179,12 +179,17 @@ static int dcphy_attach(dev)
sc->mii_capabilities = BMSR_ANEG|BMSR_10TFDX|BMSR_10THDX;
break;
default:
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP,
- sc->mii_inst), BMCR_LOOP|BMCR_S100);
-
- sc->mii_capabilities =
- BMSR_ANEG|BMSR_100TXFDX|BMSR_100TXHDX|
- BMSR_10TFDX|BMSR_10THDX;
+ if (dc_sc->dc_pmode == DC_PMODE_SIA) {
+ sc->mii_capabilities =
+ BMSR_ANEG|BMSR_10TFDX|BMSR_10THDX;
+ } else {
+ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP,
+ sc->mii_inst), BMCR_LOOP|BMCR_S100);
+
+ sc->mii_capabilities =
+ BMSR_ANEG|BMSR_100TXFDX|BMSR_100TXHDX|
+ BMSR_10TFDX|BMSR_10THDX;
+ }
break;
}
@@ -429,10 +434,11 @@ dcphy_status(sc)
}
skip:
- if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_SCRAMBLER)
- mii->mii_media_active |= IFM_100_TX;
- else
+
+ if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_SPEEDSEL)
mii->mii_media_active |= IFM_10_T;
+ else
+ mii->mii_media_active |= IFM_100_TX;
if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX)
mii->mii_media_active |= IFM_FDX;
OpenPOWER on IntegriCloud