aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_isr.c
diff options
context:
space:
mode:
authorMithlesh Thukral <mithlesh@netxen.com>2007-06-11 06:30:58 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-12 18:58:58 -0400
commitc27e672172def41924ea8410398554c49c17b3c1 (patch)
tree9dbce89a10d6724ecfbfdc1078d3472c862be9d0 /drivers/net/netxen/netxen_nic_isr.c
parentca93ca428b8e09973f19e2725bf19cb3f1836034 (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.c24
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 b213b062eb56..b2de6b6c2a7f 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)
169 netxen_nic_isr_other(adapter); 169 netxen_nic_isr_other(adapter);
170} 170}
171 171
172int netxen_nic_link_ok(struct netxen_adapter *adapter)
173{
174 switch (adapter->ahw.board_type) {
175 case NETXEN_NIC_GBE:
176 return ((adapter->ahw.qg_linksup) & 1);
177
178 case NETXEN_NIC_XGBE:
179 return ((adapter->ahw.xg_linkup) & 1);
180
181 default:
182 printk(KERN_ERR"%s: Function: %s, Unknown board type\n",
183 netxen_nic_driver_name, __FUNCTION__);
184 break;
185 }
186
187 return 0;
188}
189
172void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) 190void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter)
173{ 191{
174 struct net_device *netdev = adapter->netdev; 192 struct net_device *netdev = adapter->netdev;
@@ -183,6 +201,10 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter)
183 printk(KERN_INFO "%s: %s NIC Link is down\n", 201 printk(KERN_INFO "%s: %s NIC Link is down\n",
184 netxen_nic_driver_name, netdev->name); 202 netxen_nic_driver_name, netdev->name);
185 adapter->ahw.xg_linkup = 0; 203 adapter->ahw.xg_linkup = 0;
204 if (netif_running(netdev)) {
205 netif_carrier_off(netdev);
206 netif_stop_queue(netdev);
207 }
186 /* read twice to clear sticky bits */ 208 /* read twice to clear sticky bits */
187 /* WINDOW = 0 */ 209 /* WINDOW = 0 */
188 netxen_nic_read_w0(adapter, NETXEN_NIU_XG_STATUS, &val1); 210 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)
196 printk(KERN_INFO "%s: %s NIC Link is up\n", 218 printk(KERN_INFO "%s: %s NIC Link is up\n",
197 netxen_nic_driver_name, netdev->name); 219 netxen_nic_driver_name, netdev->name);
198 adapter->ahw.xg_linkup = 1; 220 adapter->ahw.xg_linkup = 1;
221 netif_carrier_on(netdev);
222 netif_wake_queue(netdev);
199 } 223 }
200} 224}