From: Bruce Allan Date: Fri, 20 Nov 2009 23:24:30 +0000 (+0000) Subject: e1000e: Incorrect MII Link beat reporting. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b16a002e3da0357771433aa58a2521da00aa792a;p=linux-beck.git e1000e: Incorrect MII Link beat reporting. The driver was only updating MII stats when an LSC up was detected and the interface had not already been reported up to netdev. This meant MII stats returned in response to an SIOCGMIIREG ioctl would always show a link up if it had ever been up. This was misleading the networking daemon guessnet, which uses this ioctl, into making improper network port selections. This fix adds a call to e1000_phy_read_status() to actively read the mii stats before responding to the SIOCGMIIREG ioctl. Signed-off-by: Bruce Allan Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index e819f1997550..ff9f9f1725e3 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -4320,6 +4320,8 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, data->phy_id = adapter->hw.phy.addr; break; case SIOCGMIIREG: + e1000_phy_read_status(adapter); + switch (data->reg_num & 0x1F) { case MII_BMCR: data->val_out = adapter->phy_regs.bmcr;