aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
diff options
context:
space:
mode:
authorAmit S. Kale <amitkale@netxen.com>2006-12-18 08:53:36 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-26 16:46:05 -0500
commit6c5866441669ab71f6297556ea281a6bcbfd13db (patch)
tree6deccde9df7c483d8c2a0172b3a45b76d836c249 /drivers/net/netxen
parentd2378e89720f364ccf3a57b26f1827923d3464f2 (diff)
NetXen: work queue fixes.
Signed-off-by: Amit S. Kale <amitkale@netxen.com> netxen_nic.h | 3 +-- netxen_nic_init.c | 2 +- netxen_nic_main.c | 15 +++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r--drivers/net/netxen/netxen_nic.h3
-rw-r--r--drivers/net/netxen/netxen_nic_init.c2
-rw-r--r--drivers/net/netxen/netxen_nic_main.c15
3 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 421a07425442..86dcd52683da 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -852,8 +852,6 @@ struct netxen_adapter {
852 spinlock_t tx_lock; 852 spinlock_t tx_lock;
853 spinlock_t lock; 853 spinlock_t lock;
854 struct work_struct watchdog_task; 854 struct work_struct watchdog_task;
855 struct work_struct tx_timeout_task;
856 struct net_device *netdev;
857 struct timer_list watchdog_timer; 855 struct timer_list watchdog_timer;
858 856
859 u32 curr_window; 857 u32 curr_window;
@@ -949,6 +947,7 @@ struct netxen_port {
949 struct pci_dev *pdev; 947 struct pci_dev *pdev;
950 struct net_device_stats net_stats; 948 struct net_device_stats net_stats;
951 struct netxen_port_stats stats; 949 struct netxen_port_stats stats;
950 struct work_struct tx_timeout_task;
952}; 951};
953 952
954#define PCI_OFFSET_FIRST_RANGE(adapter, off) \ 953#define PCI_OFFSET_FIRST_RANGE(adapter, off) \
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 869725f0bb18..c147943a9f54 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1023,7 +1023,7 @@ int netxen_process_cmd_ring(unsigned long data)
1023 && netif_carrier_ok(port->netdev)) 1023 && netif_carrier_ok(port->netdev))
1024 && ((jiffies - port->netdev->trans_start) > 1024 && ((jiffies - port->netdev->trans_start) >
1025 port->netdev->watchdog_timeo)) { 1025 port->netdev->watchdog_timeo)) {
1026 SCHEDULE_WORK(&port->adapter->tx_timeout_task); 1026 SCHEDULE_WORK(&port->tx_timeout_task);
1027 } 1027 }
1028 1028
1029 last_consumer = get_next_index(last_consumer, 1029 last_consumer = get_next_index(last_consumer,
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 926ead774f58..bc08d21adc47 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -424,8 +424,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
424 netdev->dev_addr); 424 netdev->dev_addr);
425 } 425 }
426 } 426 }
427 adapter->netdev = netdev; 427 INIT_WORK(&port->tx_timeout_task, netxen_tx_timeout_task);
428 INIT_WORK(&adapter->tx_timeout_task, netxen_tx_timeout_task);
429 netif_carrier_off(netdev); 428 netif_carrier_off(netdev);
430 netif_stop_queue(netdev); 429 netif_stop_queue(netdev);
431 430
@@ -966,23 +965,23 @@ static void netxen_tx_timeout(struct net_device *netdev)
966{ 965{
967 struct netxen_port *port = (struct netxen_port *)netdev_priv(netdev); 966 struct netxen_port *port = (struct netxen_port *)netdev_priv(netdev);
968 967
969 SCHEDULE_WORK(&port->adapter->tx_timeout_task); 968 SCHEDULE_WORK(&port->tx_timeout_task);
970} 969}
971 970
972static void netxen_tx_timeout_task(struct work_struct *work) 971static void netxen_tx_timeout_task(struct work_struct *work)
973{ 972{
974 struct netxen_adapter *adapter = 973 struct netxen_port *port =
975 container_of(work, struct netxen_adapter, tx_timeout_task); 974 container_of(work, struct netxen_port, tx_timeout_task);
976 struct net_device *netdev = adapter->netdev; 975 struct net_device *netdev = port->netdev;
977 unsigned long flags; 976 unsigned long flags;
978 977
979 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", 978 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n",
980 netxen_nic_driver_name, netdev->name); 979 netxen_nic_driver_name, netdev->name);
981 980
982 spin_lock_irqsave(&adapter->lock, flags); 981 spin_lock_irqsave(&port->adapter->lock, flags);
983 netxen_nic_close(netdev); 982 netxen_nic_close(netdev);
984 netxen_nic_open(netdev); 983 netxen_nic_open(netdev);
985 spin_unlock_irqrestore(&adapter->lock, flags); 984 spin_unlock_irqrestore(&port->adapter->lock, flags);
986 netdev->trans_start = jiffies; 985 netdev->trans_start = jiffies;
987 netif_wake_queue(netdev); 986 netif_wake_queue(netdev);
988} 987}