diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 19e2fa940ac0..08a62acde8bf 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -335,7 +335,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
335 | adapter->ahw.pdev = pdev; | 335 | adapter->ahw.pdev = pdev; |
336 | adapter->ahw.pci_func = pci_func_id; | 336 | adapter->ahw.pci_func = pci_func_id; |
337 | spin_lock_init(&adapter->tx_lock); | 337 | spin_lock_init(&adapter->tx_lock); |
338 | spin_lock_init(&adapter->lock); | ||
339 | 338 | ||
340 | /* remap phys address */ | 339 | /* remap phys address */ |
341 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ | 340 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ |
@@ -895,8 +894,6 @@ static int netxen_nic_open(struct net_device *netdev) | |||
895 | 894 | ||
896 | /* Done here again so that even if phantom sw overwrote it, | 895 | /* Done here again so that even if phantom sw overwrote it, |
897 | * we set it */ | 896 | * we set it */ |
898 | if (adapter->macaddr_set) | ||
899 | adapter->macaddr_set(adapter, netdev->dev_addr); | ||
900 | if (adapter->init_port | 897 | if (adapter->init_port |
901 | && adapter->init_port(adapter, adapter->portnum) != 0) { | 898 | && adapter->init_port(adapter, adapter->portnum) != 0) { |
902 | del_timer_sync(&adapter->watchdog_timer); | 899 | del_timer_sync(&adapter->watchdog_timer); |
@@ -904,6 +901,8 @@ static int netxen_nic_open(struct net_device *netdev) | |||
904 | netxen_nic_driver_name, adapter->portnum); | 901 | netxen_nic_driver_name, adapter->portnum); |
905 | return -EIO; | 902 | return -EIO; |
906 | } | 903 | } |
904 | if (adapter->macaddr_set) | ||
905 | adapter->macaddr_set(adapter, netdev->dev_addr); | ||
907 | 906 | ||
908 | netxen_nic_set_link_parameters(adapter); | 907 | netxen_nic_set_link_parameters(adapter); |
909 | 908 | ||
@@ -930,6 +929,8 @@ static int netxen_nic_close(struct net_device *netdev) | |||
930 | netif_carrier_off(netdev); | 929 | netif_carrier_off(netdev); |
931 | netif_stop_queue(netdev); | 930 | netif_stop_queue(netdev); |
932 | 931 | ||
932 | netxen_nic_disable_int(adapter); | ||
933 | |||
933 | cmd_buff = adapter->cmd_buf_arr; | 934 | cmd_buff = adapter->cmd_buf_arr; |
934 | for (i = 0; i < adapter->max_tx_desc_count; i++) { | 935 | for (i = 0; i < adapter->max_tx_desc_count; i++) { |
935 | buffrag = cmd_buff->frag_array; | 936 | buffrag = cmd_buff->frag_array; |
@@ -1226,15 +1227,12 @@ static void netxen_tx_timeout_task(struct work_struct *work) | |||
1226 | { | 1227 | { |
1227 | struct netxen_adapter *adapter = | 1228 | struct netxen_adapter *adapter = |
1228 | container_of(work, struct netxen_adapter, tx_timeout_task); | 1229 | container_of(work, struct netxen_adapter, tx_timeout_task); |
1229 | unsigned long flags; | ||
1230 | 1230 | ||
1231 | printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", | 1231 | printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", |
1232 | netxen_nic_driver_name, adapter->netdev->name); | 1232 | netxen_nic_driver_name, adapter->netdev->name); |
1233 | 1233 | ||
1234 | spin_lock_irqsave(&adapter->lock, flags); | ||
1235 | netxen_nic_close(adapter->netdev); | 1234 | netxen_nic_close(adapter->netdev); |
1236 | netxen_nic_open(adapter->netdev); | 1235 | netxen_nic_open(adapter->netdev); |
1237 | spin_unlock_irqrestore(&adapter->lock, flags); | ||
1238 | adapter->netdev->trans_start = jiffies; | 1236 | adapter->netdev->trans_start = jiffies; |
1239 | netif_wake_queue(adapter->netdev); | 1237 | netif_wake_queue(adapter->netdev); |
1240 | } | 1238 | } |
@@ -1243,28 +1241,12 @@ static int | |||
1243 | netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) | 1241 | netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) |
1244 | { | 1242 | { |
1245 | u32 ret = 0; | 1243 | u32 ret = 0; |
1246 | u32 our_int = 0; | ||
1247 | 1244 | ||
1248 | DPRINTK(INFO, "Entered handle ISR\n"); | 1245 | DPRINTK(INFO, "Entered handle ISR\n"); |
1249 | adapter->stats.ints++; | 1246 | adapter->stats.ints++; |
1250 | 1247 | ||
1251 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | ||
1252 | our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); | ||
1253 | /* not our interrupt */ | ||
1254 | if ((our_int & (0x80 << adapter->portnum)) == 0) | ||
1255 | return ret; | ||
1256 | } | ||
1257 | |||
1258 | netxen_nic_disable_int(adapter); | 1248 | netxen_nic_disable_int(adapter); |
1259 | 1249 | ||
1260 | if (adapter->intr_scheme == INTR_SCHEME_PERPORT) { | ||
1261 | /* claim interrupt */ | ||
1262 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | ||
1263 | writel(our_int & ~((u32)(0x80 << adapter->portnum)), | ||
1264 | NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); | ||
1265 | } | ||
1266 | } | ||
1267 | |||
1268 | if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) { | 1250 | if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) { |
1269 | if (netif_rx_schedule_prep(netdev)) { | 1251 | if (netif_rx_schedule_prep(netdev)) { |
1270 | /* | 1252 | /* |
@@ -1298,6 +1280,7 @@ irqreturn_t netxen_intr(int irq, void *data) | |||
1298 | { | 1280 | { |
1299 | struct netxen_adapter *adapter; | 1281 | struct netxen_adapter *adapter; |
1300 | struct net_device *netdev; | 1282 | struct net_device *netdev; |
1283 | u32 our_int = 0; | ||
1301 | 1284 | ||
1302 | if (unlikely(!irq)) { | 1285 | if (unlikely(!irq)) { |
1303 | return IRQ_NONE; /* Not our interrupt */ | 1286 | return IRQ_NONE; /* Not our interrupt */ |
@@ -1305,7 +1288,22 @@ irqreturn_t netxen_intr(int irq, void *data) | |||
1305 | 1288 | ||
1306 | adapter = (struct netxen_adapter *)data; | 1289 | adapter = (struct netxen_adapter *)data; |
1307 | netdev = adapter->netdev; | 1290 | netdev = adapter->netdev; |
1308 | /* process our status queue (for all 4 ports) */ | 1291 | |
1292 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | ||
1293 | our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); | ||
1294 | /* not our interrupt */ | ||
1295 | if ((our_int & (0x80 << adapter->portnum)) == 0) | ||
1296 | return IRQ_NONE; | ||
1297 | } | ||
1298 | |||
1299 | if (adapter->intr_scheme == INTR_SCHEME_PERPORT) { | ||
1300 | /* claim interrupt */ | ||
1301 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | ||
1302 | writel(our_int & ~((u32)(0x80 << adapter->portnum)), | ||
1303 | NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); | ||
1304 | } | ||
1305 | } | ||
1306 | |||
1309 | if (netif_running(netdev)) | 1307 | if (netif_running(netdev)) |
1310 | netxen_handle_int(adapter, netdev); | 1308 | netxen_handle_int(adapter, netdev); |
1311 | 1309 | ||