aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-12-07 04:57:19 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-07 04:57:19 -0500
commit8d1413b28033c49c7f1a4d320e815d7a5531acee (patch)
treeb37281abef014cd60803b81c100388d7a475d49e /drivers/net/netxen/netxen_nic_main.c
parented25ffa16434724f5ed825aa48734c7f3aefa203 (diff)
parent620034c84d1d939717bdfbe02c51a3fee43541c3 (diff)
Merge branch 'master' into upstream
Conflicts: drivers/net/netxen/netxen_nic.h drivers/net/netxen/netxen_nic_main.c
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 06c4778f5200..913e8147114f 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -72,7 +72,7 @@ static int netxen_nic_open(struct net_device *netdev);
72static int netxen_nic_close(struct net_device *netdev); 72static int netxen_nic_close(struct net_device *netdev);
73static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); 73static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *);
74static void netxen_tx_timeout(struct net_device *netdev); 74static void netxen_tx_timeout(struct net_device *netdev);
75static void netxen_tx_timeout_task(struct net_device *netdev); 75static void netxen_tx_timeout_task(struct work_struct *work);
76static void netxen_watchdog(unsigned long); 76static void netxen_watchdog(unsigned long);
77static int netxen_handle_int(struct netxen_adapter *, struct net_device *); 77static int netxen_handle_int(struct netxen_adapter *, struct net_device *);
78static int netxen_nic_ioctl(struct net_device *netdev, 78static int netxen_nic_ioctl(struct net_device *netdev,
@@ -318,8 +318,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
318 adapter->ahw.xg_linkup = 0; 318 adapter->ahw.xg_linkup = 0;
319 adapter->watchdog_timer.function = &netxen_watchdog; 319 adapter->watchdog_timer.function = &netxen_watchdog;
320 adapter->watchdog_timer.data = (unsigned long)adapter; 320 adapter->watchdog_timer.data = (unsigned long)adapter;
321 INIT_WORK(&adapter->watchdog_task, 321 INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task);
322 (void (*)(void *))netxen_watchdog_task, adapter);
323 adapter->ahw.pdev = pdev; 322 adapter->ahw.pdev = pdev;
324 adapter->proc_cmd_buf_counter = 0; 323 adapter->proc_cmd_buf_counter = 0;
325 adapter->ahw.revision_id = nx_p2_id; 324 adapter->ahw.revision_id = nx_p2_id;
@@ -429,8 +428,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
429 netdev->dev_addr); 428 netdev->dev_addr);
430 } 429 }
431 } 430 }
432 INIT_WORK(adapter->tx_timeout_task + i, 431 adapter->netdev = netdev;
433 (void (*)(void *))netxen_tx_timeout_task, netdev); 432 INIT_WORK(&adapter->tx_timeout_task, netxen_tx_timeout_task);
434 netif_carrier_off(netdev); 433 netif_carrier_off(netdev);
435 netif_stop_queue(netdev); 434 netif_stop_queue(netdev);
436 435
@@ -973,18 +972,20 @@ static void netxen_tx_timeout(struct net_device *netdev)
973 SCHEDULE_WORK(port->adapter->tx_timeout_task + port->portnum); 972 SCHEDULE_WORK(port->adapter->tx_timeout_task + port->portnum);
974} 973}
975 974
976static void netxen_tx_timeout_task(struct net_device *netdev) 975static void netxen_tx_timeout_task(struct work_struct *work)
977{ 976{
978 struct netxen_port *port = (struct netxen_port *)netdev_priv(netdev); 977 struct netxen_adapter *adapter =
978 container_of(work, struct netxen_adapter, tx_timeout_task);
979 struct net_device *netdev = adapter->netdev;
979 unsigned long flags; 980 unsigned long flags;
980 981
981 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", 982 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n",
982 netxen_nic_driver_name, netdev->name); 983 netxen_nic_driver_name, netdev->name);
983 984
984 spin_lock_irqsave(&port->adapter->lock, flags); 985 spin_lock_irqsave(&adapter->lock, flags);
985 netxen_nic_close(netdev); 986 netxen_nic_close(netdev);
986 netxen_nic_open(netdev); 987 netxen_nic_open(netdev);
987 spin_unlock_irqrestore(&port->adapter->lock, flags); 988 spin_unlock_irqrestore(&adapter->lock, flags);
988 netdev->trans_start = jiffies; 989 netdev->trans_start = jiffies;
989 netif_wake_queue(netdev); 990 netif_wake_queue(netdev);
990} 991}