summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-04-11 02:47:03 +0000
committerimp <imp@FreeBSD.org>2009-04-11 02:47:03 +0000
commit9cde3e407409ecc37e023b3d0a53c121ffb1cfc7 (patch)
treeb0d6699e2c9500faffbb27ef48b7b148c1434347 /sys/dev/ep/if_ep.c
parent4c9797d7424f1644af3085d5fb749437cd231303 (diff)
downloadFreeBSD-src-9cde3e407409ecc37e023b3d0a53c121ffb1cfc7.zip
FreeBSD-src-9cde3e407409ecc37e023b3d0a53c121ffb1cfc7.tar.gz
o Report ethernet status for at least 10BaseT media. Since I don't
have other media to test against, I've left that media reporting unchanged. o Enable the TX_PLL when we enable TX. This is harmless on most cards, but required to get the 3c1 CF card working. Power savings could be had by managing this better, but for now it gets my card working.
Diffstat (limited to 'sys/dev/ep/if_ep.c')
-rw-r--r--sys/dev/ep/if_ep.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index 3b91369..b6aac05 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -435,6 +435,7 @@ epinit_locked(struct ep_softc *sc)
if (!sc->epb.mii_trans)
ep_ifmedia_upd(ifp);
+ CSR_WRITE_2(sc, EP_COMMAND, TX_PLL_ENABLE);
CSR_WRITE_2(sc, EP_COMMAND, RX_ENABLE);
CSR_WRITE_2(sc, EP_COMMAND, TX_ENABLE);
@@ -895,8 +896,24 @@ static void
ep_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
{
struct ep_softc *sc = ifp->if_softc;
+ uint16_t ms;
- ifmr->ifm_active = sc->ifmedia.ifm_media;
+ switch (IFM_SUBTYPE(sc->ifmedia.ifm_media)) {
+ case IFM_10_T:
+ GO_WINDOW(sc, 4);
+ ms = CSR_READ_2(sc, EP_W4_MEDIA_TYPE);
+ GO_WINDOW(sc, 0);
+ ifmr->ifm_status = IFM_AVALID;
+ if (ms & MT_LB) {
+ ifmr->ifm_status |= IFM_ACTIVE;
+ ifmr->ifm_active = IFM_ETHER | IFM_10_T;
+ } else {
+ ifmr->ifm_active = IFM_ETHER | IFM_NONE;
+ }
+ default:
+ ifmr->ifm_active = sc->ifmedia.ifm_media;
+ break;
+ }
}
static int
OpenPOWER on IntegriCloud