diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-12-07 04:57:19 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-07 04:57:19 -0500 |
commit | 8d1413b28033c49c7f1a4d320e815d7a5531acee (patch) | |
tree | b37281abef014cd60803b81c100388d7a475d49e /drivers/net/netxen | |
parent | ed25ffa16434724f5ed825aa48734c7f3aefa203 (diff) | |
parent | 620034c84d1d939717bdfbe02c51a3fee43541c3 (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')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 5 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 5 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 19 |
3 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 3151aaa7906e..b5410bee5f21 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -852,7 +852,8 @@ 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[NETXEN_MAX_PORTS]; | 855 | struct work_struct tx_timeout_task; |
856 | struct net_device *netdev; | ||
856 | struct timer_list watchdog_timer; | 857 | struct timer_list watchdog_timer; |
857 | 858 | ||
858 | u32 curr_window; | 859 | u32 curr_window; |
@@ -1071,7 +1072,7 @@ netxen_nic_do_ioctl(struct netxen_adapter *adapter, void *u_data, | |||
1071 | struct netxen_port *port); | 1072 | struct netxen_port *port); |
1072 | int netxen_nic_rx_has_work(struct netxen_adapter *adapter); | 1073 | int netxen_nic_rx_has_work(struct netxen_adapter *adapter); |
1073 | int netxen_nic_tx_has_work(struct netxen_adapter *adapter); | 1074 | int netxen_nic_tx_has_work(struct netxen_adapter *adapter); |
1074 | void netxen_watchdog_task(unsigned long v); | 1075 | void netxen_watchdog_task(struct work_struct *work); |
1075 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, | 1076 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, |
1076 | u32 ringid); | 1077 | u32 ringid); |
1077 | void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, u32 ctx, | 1078 | void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, u32 ctx, |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index f78668030ec6..290145ec08e7 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -746,12 +746,13 @@ static inline int netxen_nic_check_temp(struct netxen_adapter *adapter) | |||
746 | return rv; | 746 | return rv; |
747 | } | 747 | } |
748 | 748 | ||
749 | void netxen_watchdog_task(unsigned long v) | 749 | void netxen_watchdog_task(struct work_struct *work) |
750 | { | 750 | { |
751 | int port_num; | 751 | int port_num; |
752 | struct netxen_port *port; | 752 | struct netxen_port *port; |
753 | struct net_device *netdev; | 753 | struct net_device *netdev; |
754 | struct netxen_adapter *adapter = (struct netxen_adapter *)v; | 754 | struct netxen_adapter *adapter = |
755 | container_of(work, struct netxen_adapter, watchdog_task); | ||
755 | 756 | ||
756 | if (netxen_nic_check_temp(adapter)) | 757 | if (netxen_nic_check_temp(adapter)) |
757 | return; | 758 | return; |
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); | |||
72 | static int netxen_nic_close(struct net_device *netdev); | 72 | static int netxen_nic_close(struct net_device *netdev); |
73 | static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); | 73 | static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); |
74 | static void netxen_tx_timeout(struct net_device *netdev); | 74 | static void netxen_tx_timeout(struct net_device *netdev); |
75 | static void netxen_tx_timeout_task(struct net_device *netdev); | 75 | static void netxen_tx_timeout_task(struct work_struct *work); |
76 | static void netxen_watchdog(unsigned long); | 76 | static void netxen_watchdog(unsigned long); |
77 | static int netxen_handle_int(struct netxen_adapter *, struct net_device *); | 77 | static int netxen_handle_int(struct netxen_adapter *, struct net_device *); |
78 | static int netxen_nic_ioctl(struct net_device *netdev, | 78 | static 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 | ||
976 | static void netxen_tx_timeout_task(struct net_device *netdev) | 975 | static 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 | } |