be2net: change to show correct physical link status
authorAjit Khaparde <ajitk@serverengines.com>
Thu, 29 Jul 2010 06:17:17 +0000 (06:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 31 Jul 2010 06:59:06 +0000 (23:59 -0700)
link status is wrongly displayed under certain circumstances.
This change fixes it.

Signed-off-by: Somnath K <somnathk@serverengines.com>
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/benet/be_ethtool.c

index c0ade242895d36b56412b94dfb3b85fcf9d7114c..cd16243c7c364a858d849ac3f70ac10bbbfcb966 100644 (file)
@@ -322,10 +322,11 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
        int status;
        u16 intf_type;
 
-       if (adapter->link_speed < 0) {
+       if ((adapter->link_speed < 0) || (!(netdev->flags & IFF_UP))) {
                status = be_cmd_link_status_query(adapter, &link_up,
                                                &mac_speed, &link_speed);
 
+               be_link_status_update(adapter, link_up);
                /* link_speed is in units of 10 Mbps */
                if (link_speed) {
                        ecmd->speed = link_speed*10;