Patchwork [net-next,3/4] be2net: change to show correct physical link status

login
register
mail settings
Submitter Ajit Khaparde
Date July 29, 2010, 4:17 p.m.
Message ID <20100729161707.GA15506@serverengines.com>
Download mbox | patch
Permalink /patch/60280/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ajit Khaparde - July 29, 2010, 4:17 p.m.
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>
---
 drivers/net/benet/be_ethtool.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
David Miller - July 31, 2010, 6:59 a.m.
From: Ajit Khaparde <ajitk@serverengines.com>
Date: Thu, 29 Jul 2010 21:47:17 +0530

> 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>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index c0ade24..cd16243 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -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;