summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2009-04-15 03:44:41 +0000
committerTill Straumann <strauman@slac.stanford.edu>2009-04-15 03:44:41 +0000
commitdb93c2ffe0548c25d3eb2def1909fad4b68850e8 (patch)
tree596de277a4ea77e951010f667999673a507342b9 /cpukit/libnetworking
parentRegenerate. (diff)
downloadrtems-db93c2ffe0548c25d3eb2def1909fad4b68850e8.tar.bz2
2009-04-14 Till Straumann <strauman@slac.stanford.edu>
* libnetworking/rtems/rtems_mii_ioctl_kern.c: poll BMSR twice to clear latched link-status low.
Diffstat (limited to 'cpukit/libnetworking')
-rw-r--r--cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c b/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c
index c1a202ce7c..1b036d6a96 100644
--- a/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c
+++ b/cpukit/libnetworking/rtems/rtems_mii_ioctl_kern.c
@@ -102,6 +102,9 @@ rtems_mii_ioctl (struct rtems_mdio_info *info, void *uarg, int cmd,
case SIOCGIFMEDIA:
if (info->mdio_r (phy, uarg, MII_BMCR, &bmcr))
return EINVAL;
+ /* read BMSR twice to clear latched link status low */
+ if (info->mdio_r (phy, uarg, MII_BMSR, &bmsr))
+ return EINVAL;
if (info->mdio_r (phy, uarg, MII_BMSR, &bmsr))
return EINVAL;
if (info->mdio_r (phy, uarg, MII_ANER, &aner))
@@ -216,6 +219,15 @@ rtems_mii_ioctl (struct rtems_mdio_info *info, void *uarg, int cmd,
if (!(bmsr2 & (tmp ? EXTSR_1000TFDX : EXTSR_1000THDX)))
return EOPNOTSUPP;
+
+ /* NOTE: gige standard demands auto-negotiation for gige links.
+ * Disabling autoneg did NOT work on the PHYs I tried
+ * (BCM5421S, intel 82540).
+ * I've seen drivers that simply change what they advertise
+ * to the desired gig mode and re-negotiate.
+ * We could do that here, too, but we don't see the point -
+ * If autoneg works fine then we can as well use it.
+ */
bmcr = BMCR_S1000;
break;