diff options
author | Mithlesh Thukral <mithlesh@netxen.com> | 2007-06-11 03:30:58 -0700 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-06-12 18:58:58 -0400 |
commit | c27e672172def41924ea8410398554c49c17b3c1 (patch) | |
tree | 9dbce89a10d6724ecfbfdc1078d3472c862be9d0 /drivers/net/netxen/netxen_nic_isr.c | |
parent | ca93ca428b8e09973f19e2725bf19cb3f1836034 (diff) |
NetXen: Fix link status messages
NetXen: Fix incorrect link status even with switch turned OFF.
NetXen driver failed to accurately indicate when a link is up or down.
This was encountered during failover testing, when the first port
indicated that the link was up even when the 10G switch it was assigned
to in the Bladecenter was turned off completely.
Signed-off by: Wen Xiong <wenxiong@us.ibm.com>
Signed-off by: Mithlesh Thukral <mithlesh@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_isr.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_isr.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c index b213b062eb5..b2de6b6c2a7 100644 --- a/drivers/net/netxen/netxen_nic_isr.c +++ b/drivers/net/netxen/netxen_nic_isr.c @@ -169,6 +169,24 @@ void netxen_nic_gbe_handle_phy_intr(struct netxen_adapter *adapter) netxen_nic_isr_other(adapter); } +int netxen_nic_link_ok(struct netxen_adapter *adapter) +{ + switch (adapter->ahw.board_type) { + case NETXEN_NIC_GBE: + return ((adapter->ahw.qg_linksup) & 1); + + case NETXEN_NIC_XGBE: + return ((adapter->ahw.xg_linkup) & 1); + + default: + printk(KERN_ERR"%s: Function: %s, Unknown board type\n", + netxen_nic_driver_name, __FUNCTION__); + break; + } + + return 0; +} + void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) { struct net_device *netdev = adapter->netdev; @@ -183,6 +201,10 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) printk(KERN_INFO "%s: %s NIC Link is down\n", netxen_nic_driver_name, netdev->name); adapter->ahw.xg_linkup = 0; + if (netif_running(netdev)) { + netif_carrier_off(netdev); + netif_stop_queue(netdev); + } /* read twice to clear sticky bits */ /* WINDOW = 0 */ netxen_nic_read_w0(adapter, NETXEN_NIU_XG_STATUS, &val1); @@ -196,5 +218,7 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) printk(KERN_INFO "%s: %s NIC Link is up\n", netxen_nic_driver_name, netdev->name); adapter->ahw.xg_linkup = 1; + netif_carrier_on(netdev); + netif_wake_queue(netdev); } } |