diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2006-08-09 00:01:55 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2006-08-09 00:01:55 +0000 |
commit | a912777cf5c034fc0214dd747ce0f11d4df8e5f8 (patch) | |
tree | c2dd053a23b7fc58761fab2d00afd13c0582e797 /cpukit/libnetworking | |
parent | 2006-08-07 Chris Johns <chrisj@rtems.org> (diff) | |
download | rtems-a912777cf5c034fc0214dd747ce0f11d4df8e5f8.tar.bz2 |
* libnetworking/rtems/rtems_mii_ioctl_kern.c:
read ANER and include partner's autoneg
capability when determining active link parameters.
Diffstat (limited to 'cpukit/libnetworking')
-rw-r--r-- | cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c b/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c index 3d61f1901c..24ed2e5837 100644 --- a/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c +++ b/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c @@ -44,7 +44,7 @@ int rtems_mii_ioctl (struct rtems_mdio_info *info, void *uarg, int cmd, int *media) { - uint32_t bmcr, bmsr, bmcr2 = 0, bmsr2 = 0, anar, lpar; + uint32_t bmcr, bmsr, aner, bmcr2 = 0, bmsr2 = 0, anar, lpar; int phy = IFM_INST (*media); unsigned tmp; int subtype = 0, options = 0; @@ -61,6 +61,8 @@ rtems_mii_ioctl (struct rtems_mdio_info *info, void *uarg, int cmd, return EINVAL; if (info->mdio_r (phy, uarg, MII_BMSR, &bmsr)) return EINVAL; + if (info->mdio_r (phy, uarg, MII_ANER, &aner)) + return EINVAL; if (info->has_gmii) { if (info->mdio_r (phy, uarg, MII_1000TCR, &bmcr2)) return EINVAL; @@ -96,7 +98,16 @@ rtems_mii_ioctl (struct rtems_mdio_info *info, void *uarg, int cmd, } else if (!(BMSR_LINK & bmsr) || !(BMSR_ACOMP & bmsr)) { subtype = IFM_NONE; } else { - /* everything ok */ + /* everything ok on our side */ + + if ( ! (ANER_LPAN & aner) ) { + /* Link partner doesn't autonegotiate --> our settings are the + * result of 'parallel detect' (in particular: duplex status is HALF + * according to the standard!). + * Let them know that something's fishy... + */ + options |= IFM_ANEG_DIS; + } tmp = ((bmcr2 >> 2) & bmsr2) & (GTSR_LP_1000THDX | GTSR_LP_1000TFDX); if (tmp) { |