diff options
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 21 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_isr.c | 24 |
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); | |||
1049 | int netxen_do_rom_se(struct netxen_adapter *adapter, int addr); | 1049 | int 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 */ |
1052 | int netxen_nic_link_ok(struct netxen_adapter *adapter); | ||
1052 | void netxen_nic_isr_other(struct netxen_adapter *adapter); | 1053 | void netxen_nic_isr_other(struct netxen_adapter *adapter); |
1053 | void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link); | 1054 | void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link); |
1054 | void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable); | 1055 | void 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 | ||
172 | int 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 | |||
172 | void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) | 190 | void 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 | } |