aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-12-05 14:36:26 -0500
committerDavid Howells <dhowells@warthog.cambridge.redhat.com>2006-12-05 14:36:26 -0500
commit6d5aefb8eaa38e44b5b8cf60c812aceafc02d924 (patch)
tree8945fd66a5f8a32f4daecf9799635ec5d7f86348 /drivers/net/netxen/netxen_nic_main.c
parent9db73724453a9350e1c22dbe732d427e2939a5c9 (diff)
WorkQueue: Fix up arch-specific work items where possible
Fix up arch-specific work items where possible to use the new work_struct and delayed_work structs. Three places that enqueue bits of their stack and then return have been marked with #error as this is not permitted. Signed-Off-By: David Howells <dhowells@redhat.com>
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 1cb662d5bd76..df0bb36a1cfb 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -64,7 +64,7 @@ static int netxen_nic_open(struct net_device *netdev);
64static int netxen_nic_close(struct net_device *netdev); 64static int netxen_nic_close(struct net_device *netdev);
65static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); 65static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *);
66static void netxen_tx_timeout(struct net_device *netdev); 66static void netxen_tx_timeout(struct net_device *netdev);
67static void netxen_tx_timeout_task(struct net_device *netdev); 67static void netxen_tx_timeout_task(struct work_struct *work);
68static void netxen_watchdog(unsigned long); 68static void netxen_watchdog(unsigned long);
69static int netxen_handle_int(struct netxen_adapter *, struct net_device *); 69static int netxen_handle_int(struct netxen_adapter *, struct net_device *);
70static int netxen_nic_ioctl(struct net_device *netdev, 70static int netxen_nic_ioctl(struct net_device *netdev,
@@ -274,8 +274,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
274 adapter->ahw.xg_linkup = 0; 274 adapter->ahw.xg_linkup = 0;
275 adapter->watchdog_timer.function = &netxen_watchdog; 275 adapter->watchdog_timer.function = &netxen_watchdog;
276 adapter->watchdog_timer.data = (unsigned long)adapter; 276 adapter->watchdog_timer.data = (unsigned long)adapter;
277 INIT_WORK(&adapter->watchdog_task, 277 INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task);
278 (void (*)(void *))netxen_watchdog_task, adapter);
279 adapter->ahw.pdev = pdev; 278 adapter->ahw.pdev = pdev;
280 adapter->proc_cmd_buf_counter = 0; 279 adapter->proc_cmd_buf_counter = 0;
281 pci_read_config_byte(pdev, PCI_REVISION_ID, &adapter->ahw.revision_id); 280 pci_read_config_byte(pdev, PCI_REVISION_ID, &adapter->ahw.revision_id);
@@ -379,8 +378,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
379 dev_addr); 378 dev_addr);
380 } 379 }
381 } 380 }
382 INIT_WORK(&adapter->tx_timeout_task, 381 adapter->netdev = netdev;
383 (void (*)(void *))netxen_tx_timeout_task, netdev); 382 INIT_WORK(&adapter->tx_timeout_task, netxen_tx_timeout_task);
384 netif_carrier_off(netdev); 383 netif_carrier_off(netdev);
385 netif_stop_queue(netdev); 384 netif_stop_queue(netdev);
386 385
@@ -938,18 +937,20 @@ static void netxen_tx_timeout(struct net_device *netdev)
938 schedule_work(&adapter->tx_timeout_task); 937 schedule_work(&adapter->tx_timeout_task);
939} 938}
940 939
941static void netxen_tx_timeout_task(struct net_device *netdev) 940static void netxen_tx_timeout_task(struct work_struct *work)
942{ 941{
943 struct netxen_port *port = (struct netxen_port *)netdev_priv(netdev); 942 struct netxen_adapter *adapter =
943 container_of(work, struct netxen_adapter, tx_timeout_task);
944 struct net_device *netdev = adapter->netdev;
944 unsigned long flags; 945 unsigned long flags;
945 946
946 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", 947 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n",
947 netxen_nic_driver_name, netdev->name); 948 netxen_nic_driver_name, netdev->name);
948 949
949 spin_lock_irqsave(&port->adapter->lock, flags); 950 spin_lock_irqsave(&adapter->lock, flags);
950 netxen_nic_close(netdev); 951 netxen_nic_close(netdev);
951 netxen_nic_open(netdev); 952 netxen_nic_open(netdev);
952 spin_unlock_irqrestore(&port->adapter->lock, flags); 953 spin_unlock_irqrestore(&adapter->lock, flags);
953 netdev->trans_start = jiffies; 954 netdev->trans_start = jiffies;
954 netif_wake_queue(netdev); 955 netif_wake_queue(netdev);
955} 956}