aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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
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')
-rw-r--r--drivers/net/netxen/netxen_nic.h1
-rw-r--r--drivers/net/netxen/netxen_nic_init.c21
-rw-r--r--drivers/net/netxen/netxen_nic_isr.c24
3 files changed, 38 insertions, 8 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 272f8c3c9546..91f25e0a638e 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -1049,6 +1049,7 @@ int netxen_rom_se(struct netxen_adapter *adapter, int addr);
1049int netxen_do_rom_se(struct netxen_adapter *adapter, int addr); 1049int netxen_do_rom_se(struct netxen_adapter *adapter, int addr);
1050 1050
1051/* Functions from netxen_nic_isr.c */ 1051/* Functions from netxen_nic_isr.c */
1052int netxen_nic_link_ok(struct netxen_adapter *adapter);
1052void netxen_nic_isr_other(struct netxen_adapter *adapter); 1053void netxen_nic_isr_other(struct netxen_adapter *adapter);
1053void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link); 1054void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link);
1054void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable); 1055void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable);
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 8e7c4a5bc26a..bb23f4c360db 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1037,18 +1037,23 @@ void netxen_watchdog_task(struct work_struct *work)
1037 if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter)) 1037 if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter))
1038 return; 1038 return;
1039 1039
1040 if (adapter->handle_phy_intr)
1041 adapter->handle_phy_intr(adapter);
1042
1040 netdev = adapter->netdev; 1043 netdev = adapter->netdev;
1041 if ((netif_running(netdev)) && !netif_carrier_ok(netdev)) { 1044 if ((netif_running(netdev)) && !netif_carrier_ok(netdev) &&
1042 printk(KERN_INFO "%s port %d, %s carrier is now ok\n", 1045 netxen_nic_link_ok(adapter) ) {
1043 netxen_nic_driver_name, adapter->portnum, netdev->name); 1046 printk(KERN_INFO "%s %s (port %d), Link is up\n",
1047 netxen_nic_driver_name, netdev->name, adapter->portnum);
1044 netif_carrier_on(netdev); 1048 netif_carrier_on(netdev);
1045 }
1046
1047 if (netif_queue_stopped(netdev))
1048 netif_wake_queue(netdev); 1049 netif_wake_queue(netdev);
1050 } else if(!(netif_running(netdev)) && netif_carrier_ok(netdev)) {
1051 printk(KERN_ERR "%s %s Link is Down\n",
1052 netxen_nic_driver_name, netdev->name);
1053 netif_carrier_off(netdev);
1054 netif_stop_queue(netdev);
1055 }
1049 1056
1050 if (adapter->handle_phy_intr)
1051 adapter->handle_phy_intr(adapter);
1052 mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ); 1057 mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ);
1053} 1058}
1054 1059
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}