diff options
author | julian <julian@FreeBSD.org> | 1999-02-11 21:47:10 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-02-11 21:47:10 +0000 |
commit | 8662f3309ee82b8c186661c652cdc13bd09ca1b9 (patch) | |
tree | c0235824947158eb6aa73bbb9666e3374557ca93 /sys/pci/if_fxp.c | |
parent | 11fe28a14abeb56e8392a16d083c940ea2c8a387 (diff) | |
download | FreeBSD-src-8662f3309ee82b8c186661c652cdc13bd09ca1b9.zip FreeBSD-src-8662f3309ee82b8c186661c652cdc13bd09ca1b9.tar.gz |
Define more registers in the PHY unit and use them to report back
the result of the media auto negotiation.
Reviewed by: David Greenman <dg@freebsd.org>
Diffstat (limited to 'sys/pci/if_fxp.c')
-rw-r--r-- | sys/pci/if_fxp.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c index 6fd0666..c60fe39 100644 --- a/sys/pci/if_fxp.c +++ b/sys/pci/if_fxp.c @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_fxp.c,v 1.61 1999/01/28 00:57:53 dillon Exp $ + * $Id: if_fxp.c,v 1.62 1999/01/28 17:32:05 dillon Exp $ */ /* @@ -1494,9 +1494,26 @@ fxp_mediastatus(ifp, ifmr) case FXP_PHY_82555B: flags = fxp_mdi_read(sc, sc->phy_primary_addr, FXP_PHY_BMCR); ifmr->ifm_active = IFM_ETHER; - if (flags & FXP_PHY_BMCR_AUTOEN) - ifmr->ifm_active |= IFM_AUTO; - else { + if (flags & FXP_PHY_BMCR_AUTOEN) { + ifmr->ifm_active |= IFM_AUTO; /* XXX presently 0 */ + /* + * XXX Find the correct subset of chips that have + * the USC register.. + */ + if ((sc->phy_primary_device == FXP_PHY_82555) + || (sc->phy_primary_device == FXP_PHY_82555B)) { + flags = fxp_mdi_read(sc, + sc->phy_primary_addr, FXP_PHY_USC); + + if (flags & FXP_PHY_USC_SPEED) + ifmr->ifm_active |= IFM_100_TX; + else + ifmr->ifm_active |= IFM_10_T; + + if (flags & FXP_PHY_USC_DUPLEX) + ifmr->ifm_active |= IFM_FDX; + } + } else { if (flags & FXP_PHY_BMCR_SPEED_100M) ifmr->ifm_active |= IFM_100_TX; else |