diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-12-07 15:48:15 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-12-07 15:48:15 -0500 |
commit | 34161db6b14d984fb9b06c735b7b42f8803f6851 (patch) | |
tree | 99656278b6697f1cde5b05894b7c0ee22c63a00e /drivers/net | |
parent | 5847e1f4d058677c5e46dc6c3e3c70e8855ea3ba (diff) | |
parent | 620034c84d1d939717bdfbe02c51a3fee43541c3 (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ into merge_linus
Conflicts:
include/linux/sunrpc/xprt.h
net/sunrpc/xprtsock.c
Fix up conflicts with the workqueue changes.
Diffstat (limited to 'drivers/net')
65 files changed, 525 insertions, 409 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index d02ed51abfcc..931028f672de 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -594,7 +594,7 @@ struct rtl8139_private { | |||
594 | u32 rx_config; | 594 | u32 rx_config; |
595 | struct rtl_extra_stats xstats; | 595 | struct rtl_extra_stats xstats; |
596 | 596 | ||
597 | struct work_struct thread; | 597 | struct delayed_work thread; |
598 | 598 | ||
599 | struct mii_if_info mii; | 599 | struct mii_if_info mii; |
600 | unsigned int regs_len; | 600 | unsigned int regs_len; |
@@ -636,8 +636,8 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev); | |||
636 | static void rtl8139_set_rx_mode (struct net_device *dev); | 636 | static void rtl8139_set_rx_mode (struct net_device *dev); |
637 | static void __set_rx_mode (struct net_device *dev); | 637 | static void __set_rx_mode (struct net_device *dev); |
638 | static void rtl8139_hw_start (struct net_device *dev); | 638 | static void rtl8139_hw_start (struct net_device *dev); |
639 | static void rtl8139_thread (void *_data); | 639 | static void rtl8139_thread (struct work_struct *work); |
640 | static void rtl8139_tx_timeout_task(void *_data); | 640 | static void rtl8139_tx_timeout_task(struct work_struct *work); |
641 | static const struct ethtool_ops rtl8139_ethtool_ops; | 641 | static const struct ethtool_ops rtl8139_ethtool_ops; |
642 | 642 | ||
643 | /* write MMIO register, with flush */ | 643 | /* write MMIO register, with flush */ |
@@ -1010,7 +1010,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
1010 | (debug < 0 ? RTL8139_DEF_MSG_ENABLE : ((1 << debug) - 1)); | 1010 | (debug < 0 ? RTL8139_DEF_MSG_ENABLE : ((1 << debug) - 1)); |
1011 | spin_lock_init (&tp->lock); | 1011 | spin_lock_init (&tp->lock); |
1012 | spin_lock_init (&tp->rx_lock); | 1012 | spin_lock_init (&tp->rx_lock); |
1013 | INIT_WORK(&tp->thread, rtl8139_thread, dev); | 1013 | INIT_DELAYED_WORK(&tp->thread, rtl8139_thread); |
1014 | tp->mii.dev = dev; | 1014 | tp->mii.dev = dev; |
1015 | tp->mii.mdio_read = mdio_read; | 1015 | tp->mii.mdio_read = mdio_read; |
1016 | tp->mii.mdio_write = mdio_write; | 1016 | tp->mii.mdio_write = mdio_write; |
@@ -1596,15 +1596,16 @@ static inline void rtl8139_thread_iter (struct net_device *dev, | |||
1596 | RTL_R8 (Config1)); | 1596 | RTL_R8 (Config1)); |
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | static void rtl8139_thread (void *_data) | 1599 | static void rtl8139_thread (struct work_struct *work) |
1600 | { | 1600 | { |
1601 | struct net_device *dev = _data; | 1601 | struct rtl8139_private *tp = |
1602 | struct rtl8139_private *tp = netdev_priv(dev); | 1602 | container_of(work, struct rtl8139_private, thread.work); |
1603 | struct net_device *dev = tp->mii.dev; | ||
1603 | unsigned long thr_delay = next_tick; | 1604 | unsigned long thr_delay = next_tick; |
1604 | 1605 | ||
1605 | if (tp->watchdog_fired) { | 1606 | if (tp->watchdog_fired) { |
1606 | tp->watchdog_fired = 0; | 1607 | tp->watchdog_fired = 0; |
1607 | rtl8139_tx_timeout_task(_data); | 1608 | rtl8139_tx_timeout_task(work); |
1608 | } else if (rtnl_trylock()) { | 1609 | } else if (rtnl_trylock()) { |
1609 | rtl8139_thread_iter (dev, tp, tp->mmio_addr); | 1610 | rtl8139_thread_iter (dev, tp, tp->mmio_addr); |
1610 | rtnl_unlock (); | 1611 | rtnl_unlock (); |
@@ -1646,10 +1647,11 @@ static inline void rtl8139_tx_clear (struct rtl8139_private *tp) | |||
1646 | /* XXX account for unsent Tx packets in tp->stats.tx_dropped */ | 1647 | /* XXX account for unsent Tx packets in tp->stats.tx_dropped */ |
1647 | } | 1648 | } |
1648 | 1649 | ||
1649 | static void rtl8139_tx_timeout_task (void *_data) | 1650 | static void rtl8139_tx_timeout_task (struct work_struct *work) |
1650 | { | 1651 | { |
1651 | struct net_device *dev = _data; | 1652 | struct rtl8139_private *tp = |
1652 | struct rtl8139_private *tp = netdev_priv(dev); | 1653 | container_of(work, struct rtl8139_private, thread.work); |
1654 | struct net_device *dev = tp->mii.dev; | ||
1653 | void __iomem *ioaddr = tp->mmio_addr; | 1655 | void __iomem *ioaddr = tp->mmio_addr; |
1654 | int i; | 1656 | int i; |
1655 | u8 tmp8; | 1657 | u8 tmp8; |
@@ -1695,7 +1697,7 @@ static void rtl8139_tx_timeout (struct net_device *dev) | |||
1695 | struct rtl8139_private *tp = netdev_priv(dev); | 1697 | struct rtl8139_private *tp = netdev_priv(dev); |
1696 | 1698 | ||
1697 | if (!tp->have_thread) { | 1699 | if (!tp->have_thread) { |
1698 | INIT_WORK(&tp->thread, rtl8139_tx_timeout_task, dev); | 1700 | INIT_DELAYED_WORK(&tp->thread, rtl8139_tx_timeout_task); |
1699 | schedule_delayed_work(&tp->thread, next_tick); | 1701 | schedule_delayed_work(&tp->thread, next_tick); |
1700 | } else | 1702 | } else |
1701 | tp->watchdog_fired = 1; | 1703 | tp->watchdog_fired = 1; |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index fc2f1d1c7ead..5bacb7587df4 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -4411,9 +4411,9 @@ bnx2_open(struct net_device *dev) | |||
4411 | } | 4411 | } |
4412 | 4412 | ||
4413 | static void | 4413 | static void |
4414 | bnx2_reset_task(void *data) | 4414 | bnx2_reset_task(struct work_struct *work) |
4415 | { | 4415 | { |
4416 | struct bnx2 *bp = data; | 4416 | struct bnx2 *bp = container_of(work, struct bnx2, reset_task); |
4417 | 4417 | ||
4418 | if (!netif_running(bp->dev)) | 4418 | if (!netif_running(bp->dev)) |
4419 | return; | 4419 | return; |
@@ -5702,7 +5702,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5702 | bp->pdev = pdev; | 5702 | bp->pdev = pdev; |
5703 | 5703 | ||
5704 | spin_lock_init(&bp->phy_lock); | 5704 | spin_lock_init(&bp->phy_lock); |
5705 | INIT_WORK(&bp->reset_task, bnx2_reset_task, bp); | 5705 | INIT_WORK(&bp->reset_task, bnx2_reset_task); |
5706 | 5706 | ||
5707 | dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0); | 5707 | dev->base_addr = dev->mem_start = pci_resource_start(pdev, 0); |
5708 | mem_len = MB_GET_CID_ADDR(TX_TSS_CID + 1); | 5708 | mem_len = MB_GET_CID_ADDR(TX_TSS_CID + 1); |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index fd2cc13f7d97..c8126484c2be 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -4066,9 +4066,9 @@ static int cas_alloc_rxds(struct cas *cp) | |||
4066 | return 0; | 4066 | return 0; |
4067 | } | 4067 | } |
4068 | 4068 | ||
4069 | static void cas_reset_task(void *data) | 4069 | static void cas_reset_task(struct work_struct *work) |
4070 | { | 4070 | { |
4071 | struct cas *cp = (struct cas *) data; | 4071 | struct cas *cp = container_of(work, struct cas, reset_task); |
4072 | #if 0 | 4072 | #if 0 |
4073 | int pending = atomic_read(&cp->reset_task_pending); | 4073 | int pending = atomic_read(&cp->reset_task_pending); |
4074 | #else | 4074 | #else |
@@ -5006,7 +5006,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev, | |||
5006 | atomic_set(&cp->reset_task_pending_spare, 0); | 5006 | atomic_set(&cp->reset_task_pending_spare, 0); |
5007 | atomic_set(&cp->reset_task_pending_mtu, 0); | 5007 | atomic_set(&cp->reset_task_pending_mtu, 0); |
5008 | #endif | 5008 | #endif |
5009 | INIT_WORK(&cp->reset_task, cas_reset_task, cp); | 5009 | INIT_WORK(&cp->reset_task, cas_reset_task); |
5010 | 5010 | ||
5011 | /* Default link parameters */ | 5011 | /* Default link parameters */ |
5012 | if (link_mode >= 0 && link_mode <= 6) | 5012 | if (link_mode >= 0 && link_mode <= 6) |
diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h index b265941e1372..74758d2c7af8 100644 --- a/drivers/net/chelsio/common.h +++ b/drivers/net/chelsio/common.h | |||
@@ -279,7 +279,7 @@ struct adapter { | |||
279 | struct petp *tp; | 279 | struct petp *tp; |
280 | 280 | ||
281 | struct port_info port[MAX_NPORTS]; | 281 | struct port_info port[MAX_NPORTS]; |
282 | struct work_struct stats_update_task; | 282 | struct delayed_work stats_update_task; |
283 | struct timer_list stats_update_timer; | 283 | struct timer_list stats_update_timer; |
284 | 284 | ||
285 | spinlock_t tpi_lock; | 285 | spinlock_t tpi_lock; |
diff --git a/drivers/net/chelsio/cphy.h b/drivers/net/chelsio/cphy.h index 60901f25014e..cf9143499882 100644 --- a/drivers/net/chelsio/cphy.h +++ b/drivers/net/chelsio/cphy.h | |||
@@ -91,7 +91,7 @@ struct cphy { | |||
91 | int state; /* Link status state machine */ | 91 | int state; /* Link status state machine */ |
92 | adapter_t *adapter; /* associated adapter */ | 92 | adapter_t *adapter; /* associated adapter */ |
93 | 93 | ||
94 | struct work_struct phy_update; | 94 | struct delayed_work phy_update; |
95 | 95 | ||
96 | u16 bmsr; | 96 | u16 bmsr; |
97 | int count; | 97 | int count; |
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index 53bec6739812..de48eadddbc4 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c | |||
@@ -953,10 +953,11 @@ static void t1_netpoll(struct net_device *dev) | |||
953 | * Periodic accumulation of MAC statistics. This is used only if the MAC | 953 | * Periodic accumulation of MAC statistics. This is used only if the MAC |
954 | * does not have any other way to prevent stats counter overflow. | 954 | * does not have any other way to prevent stats counter overflow. |
955 | */ | 955 | */ |
956 | static void mac_stats_task(void *data) | 956 | static void mac_stats_task(struct work_struct *work) |
957 | { | 957 | { |
958 | int i; | 958 | int i; |
959 | struct adapter *adapter = data; | 959 | struct adapter *adapter = |
960 | container_of(work, struct adapter, stats_update_task.work); | ||
960 | 961 | ||
961 | for_each_port(adapter, i) { | 962 | for_each_port(adapter, i) { |
962 | struct port_info *p = &adapter->port[i]; | 963 | struct port_info *p = &adapter->port[i]; |
@@ -977,9 +978,10 @@ static void mac_stats_task(void *data) | |||
977 | /* | 978 | /* |
978 | * Processes elmer0 external interrupts in process context. | 979 | * Processes elmer0 external interrupts in process context. |
979 | */ | 980 | */ |
980 | static void ext_intr_task(void *data) | 981 | static void ext_intr_task(struct work_struct *work) |
981 | { | 982 | { |
982 | struct adapter *adapter = data; | 983 | struct adapter *adapter = |
984 | container_of(work, struct adapter, ext_intr_handler_task); | ||
983 | 985 | ||
984 | t1_elmer0_ext_intr_handler(adapter); | 986 | t1_elmer0_ext_intr_handler(adapter); |
985 | 987 | ||
@@ -1113,9 +1115,9 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
1113 | spin_lock_init(&adapter->mac_lock); | 1115 | spin_lock_init(&adapter->mac_lock); |
1114 | 1116 | ||
1115 | INIT_WORK(&adapter->ext_intr_handler_task, | 1117 | INIT_WORK(&adapter->ext_intr_handler_task, |
1116 | ext_intr_task, adapter); | 1118 | ext_intr_task); |
1117 | INIT_WORK(&adapter->stats_update_task, mac_stats_task, | 1119 | INIT_DELAYED_WORK(&adapter->stats_update_task, |
1118 | adapter); | 1120 | mac_stats_task); |
1119 | 1121 | ||
1120 | pci_set_drvdata(pdev, netdev); | 1122 | pci_set_drvdata(pdev, netdev); |
1121 | } | 1123 | } |
diff --git a/drivers/net/chelsio/my3126.c b/drivers/net/chelsio/my3126.c index 0b90014d5b3e..c7731b6f9de3 100644 --- a/drivers/net/chelsio/my3126.c +++ b/drivers/net/chelsio/my3126.c | |||
@@ -93,9 +93,11 @@ static int my3126_interrupt_handler(struct cphy *cphy) | |||
93 | return cphy_cause_link_change; | 93 | return cphy_cause_link_change; |
94 | } | 94 | } |
95 | 95 | ||
96 | static void my3216_poll(void *arg) | 96 | static void my3216_poll(struct work_struct *work) |
97 | { | 97 | { |
98 | my3126_interrupt_handler(arg); | 98 | struct cphy *cphy = container_of(work, struct cphy, phy_update.work); |
99 | |||
100 | my3126_interrupt_handler(cphy); | ||
99 | } | 101 | } |
100 | 102 | ||
101 | static int my3126_set_loopback(struct cphy *cphy, int on) | 103 | static int my3126_set_loopback(struct cphy *cphy, int on) |
@@ -171,7 +173,7 @@ static struct cphy *my3126_phy_create(adapter_t *adapter, | |||
171 | if (cphy) | 173 | if (cphy) |
172 | cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops); | 174 | cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops); |
173 | 175 | ||
174 | INIT_WORK(&cphy->phy_update, my3216_poll, cphy); | 176 | INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll); |
175 | cphy->bmsr = 0; | 177 | cphy->bmsr = 0; |
176 | 178 | ||
177 | return (cphy); | 179 | return (cphy); |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 3a8df479cbda..03bf164f9e8d 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -2102,9 +2102,10 @@ static void e100_tx_timeout(struct net_device *netdev) | |||
2102 | schedule_work(&nic->tx_timeout_task); | 2102 | schedule_work(&nic->tx_timeout_task); |
2103 | } | 2103 | } |
2104 | 2104 | ||
2105 | static void e100_tx_timeout_task(struct net_device *netdev) | 2105 | static void e100_tx_timeout_task(struct work_struct *work) |
2106 | { | 2106 | { |
2107 | struct nic *nic = netdev_priv(netdev); | 2107 | struct nic *nic = container_of(work, struct nic, tx_timeout_task); |
2108 | struct net_device *netdev = nic->netdev; | ||
2108 | 2109 | ||
2109 | DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n", | 2110 | DPRINTK(TX_ERR, DEBUG, "scb.status=0x%02X\n", |
2110 | readb(&nic->csr->scb.status)); | 2111 | readb(&nic->csr->scb.status)); |
@@ -2637,8 +2638,7 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2637 | nic->blink_timer.function = e100_blink_led; | 2638 | nic->blink_timer.function = e100_blink_led; |
2638 | nic->blink_timer.data = (unsigned long)nic; | 2639 | nic->blink_timer.data = (unsigned long)nic; |
2639 | 2640 | ||
2640 | INIT_WORK(&nic->tx_timeout_task, | 2641 | INIT_WORK(&nic->tx_timeout_task, e100_tx_timeout_task); |
2641 | (void (*)(void *))e100_tx_timeout_task, netdev); | ||
2642 | 2642 | ||
2643 | if((err = e100_alloc(nic))) { | 2643 | if((err = e100_alloc(nic))) { |
2644 | DPRINTK(PROBE, ERR, "Cannot alloc driver memory, aborting.\n"); | 2644 | DPRINTK(PROBE, ERR, "Cannot alloc driver memory, aborting.\n"); |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 32dde0adb683..73f3a85fd238 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -190,7 +190,7 @@ void e1000_set_ethtool_ops(struct net_device *netdev); | |||
190 | static void e1000_enter_82542_rst(struct e1000_adapter *adapter); | 190 | static void e1000_enter_82542_rst(struct e1000_adapter *adapter); |
191 | static void e1000_leave_82542_rst(struct e1000_adapter *adapter); | 191 | static void e1000_leave_82542_rst(struct e1000_adapter *adapter); |
192 | static void e1000_tx_timeout(struct net_device *dev); | 192 | static void e1000_tx_timeout(struct net_device *dev); |
193 | static void e1000_reset_task(struct net_device *dev); | 193 | static void e1000_reset_task(struct work_struct *work); |
194 | static void e1000_smartspeed(struct e1000_adapter *adapter); | 194 | static void e1000_smartspeed(struct e1000_adapter *adapter); |
195 | static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, | 195 | static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, |
196 | struct sk_buff *skb); | 196 | struct sk_buff *skb); |
@@ -914,8 +914,7 @@ e1000_probe(struct pci_dev *pdev, | |||
914 | adapter->phy_info_timer.function = &e1000_update_phy_info; | 914 | adapter->phy_info_timer.function = &e1000_update_phy_info; |
915 | adapter->phy_info_timer.data = (unsigned long) adapter; | 915 | adapter->phy_info_timer.data = (unsigned long) adapter; |
916 | 916 | ||
917 | INIT_WORK(&adapter->reset_task, | 917 | INIT_WORK(&adapter->reset_task, e1000_reset_task); |
918 | (void (*)(void *))e1000_reset_task, netdev); | ||
919 | 918 | ||
920 | e1000_check_options(adapter); | 919 | e1000_check_options(adapter); |
921 | 920 | ||
@@ -3306,9 +3305,10 @@ e1000_tx_timeout(struct net_device *netdev) | |||
3306 | } | 3305 | } |
3307 | 3306 | ||
3308 | static void | 3307 | static void |
3309 | e1000_reset_task(struct net_device *netdev) | 3308 | e1000_reset_task(struct work_struct *work) |
3310 | { | 3309 | { |
3311 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3310 | struct e1000_adapter *adapter = |
3311 | container_of(work, struct e1000_adapter, reset_task); | ||
3312 | 3312 | ||
3313 | e1000_reinit_locked(adapter); | 3313 | e1000_reinit_locked(adapter); |
3314 | } | 3314 | } |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 6ad696101418..83fa32f72398 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -2224,11 +2224,12 @@ static int ehea_stop(struct net_device *dev) | |||
2224 | return ret; | 2224 | return ret; |
2225 | } | 2225 | } |
2226 | 2226 | ||
2227 | static void ehea_reset_port(void *data) | 2227 | static void ehea_reset_port(struct work_struct *work) |
2228 | { | 2228 | { |
2229 | int ret; | 2229 | int ret; |
2230 | struct net_device *dev = data; | 2230 | struct ehea_port *port = |
2231 | struct ehea_port *port = netdev_priv(dev); | 2231 | container_of(work, struct ehea_port, reset_task); |
2232 | struct net_device *dev = port->netdev; | ||
2232 | 2233 | ||
2233 | port->resets++; | 2234 | port->resets++; |
2234 | down(&port->port_lock); | 2235 | down(&port->port_lock); |
@@ -2379,7 +2380,7 @@ static int ehea_setup_single_port(struct ehea_port *port, | |||
2379 | dev->tx_timeout = &ehea_tx_watchdog; | 2380 | dev->tx_timeout = &ehea_tx_watchdog; |
2380 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; | 2381 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; |
2381 | 2382 | ||
2382 | INIT_WORK(&port->reset_task, ehea_reset_port, dev); | 2383 | INIT_WORK(&port->reset_task, ehea_reset_port); |
2383 | 2384 | ||
2384 | ehea_set_ethtool_ops(dev); | 2385 | ehea_set_ethtool_ops(dev); |
2385 | 2386 | ||
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 1ed9cccd3c11..3c33d6f6a6a6 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
@@ -168,8 +168,9 @@ struct baycom_state { | |||
168 | int magic; | 168 | int magic; |
169 | 169 | ||
170 | struct pardevice *pdev; | 170 | struct pardevice *pdev; |
171 | struct net_device *dev; | ||
171 | unsigned int work_running; | 172 | unsigned int work_running; |
172 | struct work_struct run_work; | 173 | struct delayed_work run_work; |
173 | unsigned int modem; | 174 | unsigned int modem; |
174 | unsigned int bitrate; | 175 | unsigned int bitrate; |
175 | unsigned char stat; | 176 | unsigned char stat; |
@@ -659,16 +660,18 @@ static int receive(struct net_device *dev, int cnt) | |||
659 | #define GETTICK(x) | 660 | #define GETTICK(x) |
660 | #endif /* __i386__ */ | 661 | #endif /* __i386__ */ |
661 | 662 | ||
662 | static void epp_bh(struct net_device *dev) | 663 | static void epp_bh(struct work_struct *work) |
663 | { | 664 | { |
665 | struct net_device *dev; | ||
664 | struct baycom_state *bc; | 666 | struct baycom_state *bc; |
665 | struct parport *pp; | 667 | struct parport *pp; |
666 | unsigned char stat; | 668 | unsigned char stat; |
667 | unsigned char tmp[2]; | 669 | unsigned char tmp[2]; |
668 | unsigned int time1 = 0, time2 = 0, time3 = 0; | 670 | unsigned int time1 = 0, time2 = 0, time3 = 0; |
669 | int cnt, cnt2; | 671 | int cnt, cnt2; |
670 | 672 | ||
671 | bc = netdev_priv(dev); | 673 | bc = container_of(work, struct baycom_state, run_work.work); |
674 | dev = bc->dev; | ||
672 | if (!bc->work_running) | 675 | if (!bc->work_running) |
673 | return; | 676 | return; |
674 | baycom_int_freq(bc); | 677 | baycom_int_freq(bc); |
@@ -889,7 +892,7 @@ static int epp_open(struct net_device *dev) | |||
889 | return -EBUSY; | 892 | return -EBUSY; |
890 | } | 893 | } |
891 | dev->irq = /*pp->irq*/ 0; | 894 | dev->irq = /*pp->irq*/ 0; |
892 | INIT_WORK(&bc->run_work, (void *)(void *)epp_bh, dev); | 895 | INIT_DELAYED_WORK(&bc->run_work, epp_bh); |
893 | bc->work_running = 1; | 896 | bc->work_running = 1; |
894 | bc->modem = EPP_CONVENTIONAL; | 897 | bc->modem = EPP_CONVENTIONAL; |
895 | if (eppconfig(bc)) | 898 | if (eppconfig(bc)) |
@@ -1213,6 +1216,7 @@ static void __init baycom_epp_dev_setup(struct net_device *dev) | |||
1213 | /* | 1216 | /* |
1214 | * initialize part of the baycom_state struct | 1217 | * initialize part of the baycom_state struct |
1215 | */ | 1218 | */ |
1219 | bc->dev = dev; | ||
1216 | bc->magic = BAYCOM_MAGIC; | 1220 | bc->magic = BAYCOM_MAGIC; |
1217 | bc->cfg.fclk = 19666600; | 1221 | bc->cfg.fclk = 19666600; |
1218 | bc->cfg.bps = 9600; | 1222 | bc->cfg.bps = 9600; |
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 0f8b9afd55b4..e6e721aff6f6 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c | |||
@@ -252,7 +252,7 @@ static inline void z8530_isr(struct scc_info *info); | |||
252 | static irqreturn_t scc_isr(int irq, void *dev_id); | 252 | static irqreturn_t scc_isr(int irq, void *dev_id); |
253 | static void rx_isr(struct scc_priv *priv); | 253 | static void rx_isr(struct scc_priv *priv); |
254 | static void special_condition(struct scc_priv *priv, int rc); | 254 | static void special_condition(struct scc_priv *priv, int rc); |
255 | static void rx_bh(void *arg); | 255 | static void rx_bh(struct work_struct *); |
256 | static void tx_isr(struct scc_priv *priv); | 256 | static void tx_isr(struct scc_priv *priv); |
257 | static void es_isr(struct scc_priv *priv); | 257 | static void es_isr(struct scc_priv *priv); |
258 | static void tm_isr(struct scc_priv *priv); | 258 | static void tm_isr(struct scc_priv *priv); |
@@ -579,7 +579,7 @@ static int __init setup_adapter(int card_base, int type, int n) | |||
579 | priv->param.clocks = TCTRxCP | RCRTxCP; | 579 | priv->param.clocks = TCTRxCP | RCRTxCP; |
580 | priv->param.persist = 256; | 580 | priv->param.persist = 256; |
581 | priv->param.dma = -1; | 581 | priv->param.dma = -1; |
582 | INIT_WORK(&priv->rx_work, rx_bh, priv); | 582 | INIT_WORK(&priv->rx_work, rx_bh); |
583 | dev->priv = priv; | 583 | dev->priv = priv; |
584 | sprintf(dev->name, "dmascc%i", 2 * n + i); | 584 | sprintf(dev->name, "dmascc%i", 2 * n + i); |
585 | dev->base_addr = card_base; | 585 | dev->base_addr = card_base; |
@@ -1272,9 +1272,9 @@ static void special_condition(struct scc_priv *priv, int rc) | |||
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | 1274 | ||
1275 | static void rx_bh(void *arg) | 1275 | static void rx_bh(struct work_struct *ugli_api) |
1276 | { | 1276 | { |
1277 | struct scc_priv *priv = arg; | 1277 | struct scc_priv *priv = container_of(ugli_api, struct scc_priv, rx_work); |
1278 | int i = priv->rx_tail; | 1278 | int i = priv->rx_tail; |
1279 | int cb; | 1279 | int cb; |
1280 | unsigned long flags; | 1280 | unsigned long flags; |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index b32c52ed19d7..f0c61f3b2a82 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -560,9 +560,9 @@ static inline int mcs_find_endpoints(struct mcs_cb *mcs, | |||
560 | return ret; | 560 | return ret; |
561 | } | 561 | } |
562 | 562 | ||
563 | static void mcs_speed_work(void *arg) | 563 | static void mcs_speed_work(struct work_struct *work) |
564 | { | 564 | { |
565 | struct mcs_cb *mcs = arg; | 565 | struct mcs_cb *mcs = container_of(work, struct mcs_cb, work); |
566 | struct net_device *netdev = mcs->netdev; | 566 | struct net_device *netdev = mcs->netdev; |
567 | 567 | ||
568 | mcs_speed_change(mcs); | 568 | mcs_speed_change(mcs); |
@@ -927,7 +927,7 @@ static int mcs_probe(struct usb_interface *intf, | |||
927 | irda_qos_bits_to_value(&mcs->qos); | 927 | irda_qos_bits_to_value(&mcs->qos); |
928 | 928 | ||
929 | /* Speed change work initialisation*/ | 929 | /* Speed change work initialisation*/ |
930 | INIT_WORK(&mcs->work, mcs_speed_work, mcs); | 930 | INIT_WORK(&mcs->work, mcs_speed_work); |
931 | 931 | ||
932 | /* Override the network functions we need to use */ | 932 | /* Override the network functions we need to use */ |
933 | ndev->hard_start_xmit = mcs_hard_xmit; | 933 | ndev->hard_start_xmit = mcs_hard_xmit; |
diff --git a/drivers/net/irda/sir-dev.h b/drivers/net/irda/sir-dev.h index 9fa294a546d6..2a57bc67ce35 100644 --- a/drivers/net/irda/sir-dev.h +++ b/drivers/net/irda/sir-dev.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | struct sir_fsm { | 23 | struct sir_fsm { |
24 | struct semaphore sem; | 24 | struct semaphore sem; |
25 | struct work_struct work; | 25 | struct delayed_work work; |
26 | unsigned state, substate; | 26 | unsigned state, substate; |
27 | int param; | 27 | int param; |
28 | int result; | 28 | int result; |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index 3b5854d10c17..17b0c3ab6201 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
@@ -100,9 +100,9 @@ static int sirdev_tx_complete_fsm(struct sir_dev *dev) | |||
100 | * Both must be unlocked/restarted on completion - but only on final exit. | 100 | * Both must be unlocked/restarted on completion - but only on final exit. |
101 | */ | 101 | */ |
102 | 102 | ||
103 | static void sirdev_config_fsm(void *data) | 103 | static void sirdev_config_fsm(struct work_struct *work) |
104 | { | 104 | { |
105 | struct sir_dev *dev = data; | 105 | struct sir_dev *dev = container_of(work, struct sir_dev, fsm.work.work); |
106 | struct sir_fsm *fsm = &dev->fsm; | 106 | struct sir_fsm *fsm = &dev->fsm; |
107 | int next_state; | 107 | int next_state; |
108 | int ret = -1; | 108 | int ret = -1; |
@@ -309,8 +309,8 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par | |||
309 | fsm->param = param; | 309 | fsm->param = param; |
310 | fsm->result = 0; | 310 | fsm->result = 0; |
311 | 311 | ||
312 | INIT_WORK(&fsm->work, sirdev_config_fsm, dev); | 312 | INIT_DELAYED_WORK(&fsm->work, sirdev_config_fsm); |
313 | queue_work(irda_sir_wq, &fsm->work); | 313 | queue_delayed_work(irda_sir_wq, &fsm->work, 0); |
314 | return 0; | 314 | return 0; |
315 | } | 315 | } |
316 | 316 | ||
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 2284e2ce1692..d6f4f185bf37 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -166,7 +166,7 @@ struct veth_msg { | |||
166 | 166 | ||
167 | struct veth_lpar_connection { | 167 | struct veth_lpar_connection { |
168 | HvLpIndex remote_lp; | 168 | HvLpIndex remote_lp; |
169 | struct work_struct statemachine_wq; | 169 | struct delayed_work statemachine_wq; |
170 | struct veth_msg *msgs; | 170 | struct veth_msg *msgs; |
171 | int num_events; | 171 | int num_events; |
172 | struct veth_cap_data local_caps; | 172 | struct veth_cap_data local_caps; |
@@ -456,7 +456,7 @@ static struct kobj_type veth_port_ktype = { | |||
456 | 456 | ||
457 | static inline void veth_kick_statemachine(struct veth_lpar_connection *cnx) | 457 | static inline void veth_kick_statemachine(struct veth_lpar_connection *cnx) |
458 | { | 458 | { |
459 | schedule_work(&cnx->statemachine_wq); | 459 | schedule_delayed_work(&cnx->statemachine_wq, 0); |
460 | } | 460 | } |
461 | 461 | ||
462 | static void veth_take_cap(struct veth_lpar_connection *cnx, | 462 | static void veth_take_cap(struct veth_lpar_connection *cnx, |
@@ -638,9 +638,11 @@ static int veth_process_caps(struct veth_lpar_connection *cnx) | |||
638 | } | 638 | } |
639 | 639 | ||
640 | /* FIXME: The gotos here are a bit dubious */ | 640 | /* FIXME: The gotos here are a bit dubious */ |
641 | static void veth_statemachine(void *p) | 641 | static void veth_statemachine(struct work_struct *work) |
642 | { | 642 | { |
643 | struct veth_lpar_connection *cnx = (struct veth_lpar_connection *)p; | 643 | struct veth_lpar_connection *cnx = |
644 | container_of(work, struct veth_lpar_connection, | ||
645 | statemachine_wq.work); | ||
644 | int rlp = cnx->remote_lp; | 646 | int rlp = cnx->remote_lp; |
645 | int rc; | 647 | int rc; |
646 | 648 | ||
@@ -827,7 +829,7 @@ static int veth_init_connection(u8 rlp) | |||
827 | 829 | ||
828 | cnx->remote_lp = rlp; | 830 | cnx->remote_lp = rlp; |
829 | spin_lock_init(&cnx->lock); | 831 | spin_lock_init(&cnx->lock); |
830 | INIT_WORK(&cnx->statemachine_wq, veth_statemachine, cnx); | 832 | INIT_DELAYED_WORK(&cnx->statemachine_wq, veth_statemachine); |
831 | 833 | ||
832 | init_timer(&cnx->ack_timer); | 834 | init_timer(&cnx->ack_timer); |
833 | cnx->ack_timer.function = veth_timed_ack; | 835 | cnx->ack_timer.function = veth_timed_ack; |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 7b127212e62b..e628126c9c49 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -106,7 +106,7 @@ static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter); | |||
106 | static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter); | 106 | static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter); |
107 | void ixgb_set_ethtool_ops(struct net_device *netdev); | 107 | void ixgb_set_ethtool_ops(struct net_device *netdev); |
108 | static void ixgb_tx_timeout(struct net_device *dev); | 108 | static void ixgb_tx_timeout(struct net_device *dev); |
109 | static void ixgb_tx_timeout_task(struct net_device *dev); | 109 | static void ixgb_tx_timeout_task(struct work_struct *work); |
110 | static void ixgb_vlan_rx_register(struct net_device *netdev, | 110 | static void ixgb_vlan_rx_register(struct net_device *netdev, |
111 | struct vlan_group *grp); | 111 | struct vlan_group *grp); |
112 | static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); | 112 | static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); |
@@ -489,8 +489,7 @@ ixgb_probe(struct pci_dev *pdev, | |||
489 | adapter->watchdog_timer.function = &ixgb_watchdog; | 489 | adapter->watchdog_timer.function = &ixgb_watchdog; |
490 | adapter->watchdog_timer.data = (unsigned long)adapter; | 490 | adapter->watchdog_timer.data = (unsigned long)adapter; |
491 | 491 | ||
492 | INIT_WORK(&adapter->tx_timeout_task, | 492 | INIT_WORK(&adapter->tx_timeout_task, ixgb_tx_timeout_task); |
493 | (void (*)(void *))ixgb_tx_timeout_task, netdev); | ||
494 | 493 | ||
495 | strcpy(netdev->name, "eth%d"); | 494 | strcpy(netdev->name, "eth%d"); |
496 | if((err = register_netdev(netdev))) | 495 | if((err = register_netdev(netdev))) |
@@ -1493,9 +1492,10 @@ ixgb_tx_timeout(struct net_device *netdev) | |||
1493 | } | 1492 | } |
1494 | 1493 | ||
1495 | static void | 1494 | static void |
1496 | ixgb_tx_timeout_task(struct net_device *netdev) | 1495 | ixgb_tx_timeout_task(struct work_struct *work) |
1497 | { | 1496 | { |
1498 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 1497 | struct ixgb_adapter *adapter = |
1498 | container_of(work, struct ixgb_adapter, tx_timeout_task); | ||
1499 | 1499 | ||
1500 | adapter->tx_timeout_count++; | 1500 | adapter->tx_timeout_count++; |
1501 | ixgb_down(adapter, TRUE); | 1501 | ixgb_down(adapter, TRUE); |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 9997081c6dae..d9f48bb04b05 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -277,9 +277,11 @@ static void mv643xx_eth_tx_timeout(struct net_device *dev) | |||
277 | * | 277 | * |
278 | * Actual routine to reset the adapter when a timeout on Tx has occurred | 278 | * Actual routine to reset the adapter when a timeout on Tx has occurred |
279 | */ | 279 | */ |
280 | static void mv643xx_eth_tx_timeout_task(struct net_device *dev) | 280 | static void mv643xx_eth_tx_timeout_task(struct work_struct *ugly) |
281 | { | 281 | { |
282 | struct mv643xx_private *mp = netdev_priv(dev); | 282 | struct mv643xx_private *mp = container_of(ugly, struct mv643xx_private, |
283 | tx_timeout_task); | ||
284 | struct net_device *dev = mp->mii.dev; /* yuck */ | ||
283 | 285 | ||
284 | if (!netif_running(dev)) | 286 | if (!netif_running(dev)) |
285 | return; | 287 | return; |
@@ -1360,8 +1362,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
1360 | #endif | 1362 | #endif |
1361 | 1363 | ||
1362 | /* Configure the timeout task */ | 1364 | /* Configure the timeout task */ |
1363 | INIT_WORK(&mp->tx_timeout_task, | 1365 | INIT_WORK(&mp->tx_timeout_task, mv643xx_eth_tx_timeout_task); |
1364 | (void (*)(void *))mv643xx_eth_tx_timeout_task, dev); | ||
1365 | 1366 | ||
1366 | spin_lock_init(&mp->lock); | 1367 | spin_lock_init(&mp->lock); |
1367 | 1368 | ||
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 36350e6db1c1..38df42802386 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -2615,9 +2615,10 @@ static u32 myri10ge_read_reboot(struct myri10ge_priv *mgp) | |||
2615 | * This watchdog is used to check whether the board has suffered | 2615 | * This watchdog is used to check whether the board has suffered |
2616 | * from a parity error and needs to be recovered. | 2616 | * from a parity error and needs to be recovered. |
2617 | */ | 2617 | */ |
2618 | static void myri10ge_watchdog(void *arg) | 2618 | static void myri10ge_watchdog(struct work_struct *work) |
2619 | { | 2619 | { |
2620 | struct myri10ge_priv *mgp = arg; | 2620 | struct myri10ge_priv *mgp = |
2621 | container_of(work, struct myri10ge_priv, watchdog_work); | ||
2621 | u32 reboot; | 2622 | u32 reboot; |
2622 | int status; | 2623 | int status; |
2623 | u16 cmd, vendor; | 2624 | u16 cmd, vendor; |
@@ -2887,7 +2888,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2887 | (unsigned long)mgp); | 2888 | (unsigned long)mgp); |
2888 | 2889 | ||
2889 | SET_ETHTOOL_OPS(netdev, &myri10ge_ethtool_ops); | 2890 | SET_ETHTOOL_OPS(netdev, &myri10ge_ethtool_ops); |
2890 | INIT_WORK(&mgp->watchdog_work, myri10ge_watchdog, mgp); | 2891 | INIT_WORK(&mgp->watchdog_work, myri10ge_watchdog); |
2891 | status = register_netdev(netdev); | 2892 | status = register_netdev(netdev); |
2892 | if (status != 0) { | 2893 | if (status != 0) { |
2893 | dev_err(&pdev->dev, "register_netdev failed: %d\n", status); | 2894 | dev_err(&pdev->dev, "register_netdev failed: %d\n", status); |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index d925053fe597..9c588af8ab74 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -714,6 +714,7 @@ struct netxen_adapter { | |||
714 | spinlock_t lock; | 714 | spinlock_t lock; |
715 | struct work_struct watchdog_task; | 715 | struct work_struct watchdog_task; |
716 | struct work_struct tx_timeout_task; | 716 | struct work_struct tx_timeout_task; |
717 | struct net_device *netdev; | ||
717 | struct timer_list watchdog_timer; | 718 | struct timer_list watchdog_timer; |
718 | 719 | ||
719 | u32 curr_window; | 720 | u32 curr_window; |
@@ -921,7 +922,7 @@ netxen_nic_do_ioctl(struct netxen_adapter *adapter, void *u_data, | |||
921 | struct netxen_port *port); | 922 | struct netxen_port *port); |
922 | int netxen_nic_rx_has_work(struct netxen_adapter *adapter); | 923 | int netxen_nic_rx_has_work(struct netxen_adapter *adapter); |
923 | int netxen_nic_tx_has_work(struct netxen_adapter *adapter); | 924 | int netxen_nic_tx_has_work(struct netxen_adapter *adapter); |
924 | void netxen_watchdog_task(unsigned long v); | 925 | void netxen_watchdog_task(struct work_struct *work); |
925 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, | 926 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, |
926 | u32 ringid); | 927 | u32 ringid); |
927 | void netxen_process_cmd_ring(unsigned long data); | 928 | void netxen_process_cmd_ring(unsigned long data); |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 0dca029bc3e5..eae18236aefa 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -710,12 +710,13 @@ static inline int netxen_nic_check_temp(struct netxen_adapter *adapter) | |||
710 | return rv; | 710 | return rv; |
711 | } | 711 | } |
712 | 712 | ||
713 | void netxen_watchdog_task(unsigned long v) | 713 | void netxen_watchdog_task(struct work_struct *work) |
714 | { | 714 | { |
715 | int port_num; | 715 | int port_num; |
716 | struct netxen_port *port; | 716 | struct netxen_port *port; |
717 | struct net_device *netdev; | 717 | struct net_device *netdev; |
718 | struct netxen_adapter *adapter = (struct netxen_adapter *)v; | 718 | struct netxen_adapter *adapter = |
719 | container_of(work, struct netxen_adapter, watchdog_task); | ||
719 | 720 | ||
720 | if (netxen_nic_check_temp(adapter)) | 721 | if (netxen_nic_check_temp(adapter)) |
721 | return; | 722 | return; |
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); | |||
64 | static int netxen_nic_close(struct net_device *netdev); | 64 | static int netxen_nic_close(struct net_device *netdev); |
65 | static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); | 65 | static int netxen_nic_xmit_frame(struct sk_buff *, struct net_device *); |
66 | static void netxen_tx_timeout(struct net_device *netdev); | 66 | static void netxen_tx_timeout(struct net_device *netdev); |
67 | static void netxen_tx_timeout_task(struct net_device *netdev); | 67 | static void netxen_tx_timeout_task(struct work_struct *work); |
68 | static void netxen_watchdog(unsigned long); | 68 | static void netxen_watchdog(unsigned long); |
69 | static int netxen_handle_int(struct netxen_adapter *, struct net_device *); | 69 | static int netxen_handle_int(struct netxen_adapter *, struct net_device *); |
70 | static int netxen_nic_ioctl(struct net_device *netdev, | 70 | static 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 | ||
941 | static void netxen_tx_timeout_task(struct net_device *netdev) | 940 | static 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 | } |
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index b0127c71a5b6..312e0e331712 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -427,6 +427,7 @@ struct ns83820 { | |||
427 | u8 __iomem *base; | 427 | u8 __iomem *base; |
428 | 428 | ||
429 | struct pci_dev *pci_dev; | 429 | struct pci_dev *pci_dev; |
430 | struct net_device *ndev; | ||
430 | 431 | ||
431 | #ifdef NS83820_VLAN_ACCEL_SUPPORT | 432 | #ifdef NS83820_VLAN_ACCEL_SUPPORT |
432 | struct vlan_group *vlgrp; | 433 | struct vlan_group *vlgrp; |
@@ -631,10 +632,10 @@ static void fastcall rx_refill_atomic(struct net_device *ndev) | |||
631 | } | 632 | } |
632 | 633 | ||
633 | /* REFILL */ | 634 | /* REFILL */ |
634 | static inline void queue_refill(void *_dev) | 635 | static inline void queue_refill(struct work_struct *work) |
635 | { | 636 | { |
636 | struct net_device *ndev = _dev; | 637 | struct ns83820 *dev = container_of(work, struct ns83820, tq_refill); |
637 | struct ns83820 *dev = PRIV(ndev); | 638 | struct net_device *ndev = dev->ndev; |
638 | 639 | ||
639 | rx_refill(ndev, GFP_KERNEL); | 640 | rx_refill(ndev, GFP_KERNEL); |
640 | if (dev->rx_info.up) | 641 | if (dev->rx_info.up) |
@@ -1841,6 +1842,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
1841 | 1842 | ||
1842 | ndev = alloc_etherdev(sizeof(struct ns83820)); | 1843 | ndev = alloc_etherdev(sizeof(struct ns83820)); |
1843 | dev = PRIV(ndev); | 1844 | dev = PRIV(ndev); |
1845 | dev->ndev = ndev; | ||
1844 | err = -ENOMEM; | 1846 | err = -ENOMEM; |
1845 | if (!dev) | 1847 | if (!dev) |
1846 | goto out; | 1848 | goto out; |
@@ -1853,7 +1855,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
1853 | SET_MODULE_OWNER(ndev); | 1855 | SET_MODULE_OWNER(ndev); |
1854 | SET_NETDEV_DEV(ndev, &pci_dev->dev); | 1856 | SET_NETDEV_DEV(ndev, &pci_dev->dev); |
1855 | 1857 | ||
1856 | INIT_WORK(&dev->tq_refill, queue_refill, ndev); | 1858 | INIT_WORK(&dev->tq_refill, queue_refill); |
1857 | tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)ndev); | 1859 | tasklet_init(&dev->rx_tasklet, rx_action, (unsigned long)ndev); |
1858 | 1860 | ||
1859 | err = pci_enable_device(pci_dev); | 1861 | err = pci_enable_device(pci_dev); |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 69813406782d..8478dca3d8d1 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -332,6 +332,7 @@ static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); | |||
332 | */ | 332 | */ |
333 | 333 | ||
334 | typedef struct local_info_t { | 334 | typedef struct local_info_t { |
335 | struct net_device *dev; | ||
335 | struct pcmcia_device *p_dev; | 336 | struct pcmcia_device *p_dev; |
336 | dev_node_t node; | 337 | dev_node_t node; |
337 | struct net_device_stats stats; | 338 | struct net_device_stats stats; |
@@ -353,7 +354,7 @@ typedef struct local_info_t { | |||
353 | */ | 354 | */ |
354 | static int do_start_xmit(struct sk_buff *skb, struct net_device *dev); | 355 | static int do_start_xmit(struct sk_buff *skb, struct net_device *dev); |
355 | static void do_tx_timeout(struct net_device *dev); | 356 | static void do_tx_timeout(struct net_device *dev); |
356 | static void xirc2ps_tx_timeout_task(void *data); | 357 | static void xirc2ps_tx_timeout_task(struct work_struct *work); |
357 | static struct net_device_stats *do_get_stats(struct net_device *dev); | 358 | static struct net_device_stats *do_get_stats(struct net_device *dev); |
358 | static void set_addresses(struct net_device *dev); | 359 | static void set_addresses(struct net_device *dev); |
359 | static void set_multicast_list(struct net_device *dev); | 360 | static void set_multicast_list(struct net_device *dev); |
@@ -567,6 +568,7 @@ xirc2ps_probe(struct pcmcia_device *link) | |||
567 | if (!dev) | 568 | if (!dev) |
568 | return -ENOMEM; | 569 | return -ENOMEM; |
569 | local = netdev_priv(dev); | 570 | local = netdev_priv(dev); |
571 | local->dev = dev; | ||
570 | local->p_dev = link; | 572 | local->p_dev = link; |
571 | link->priv = dev; | 573 | link->priv = dev; |
572 | 574 | ||
@@ -591,7 +593,7 @@ xirc2ps_probe(struct pcmcia_device *link) | |||
591 | #ifdef HAVE_TX_TIMEOUT | 593 | #ifdef HAVE_TX_TIMEOUT |
592 | dev->tx_timeout = do_tx_timeout; | 594 | dev->tx_timeout = do_tx_timeout; |
593 | dev->watchdog_timeo = TX_TIMEOUT; | 595 | dev->watchdog_timeo = TX_TIMEOUT; |
594 | INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task, dev); | 596 | INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task); |
595 | #endif | 597 | #endif |
596 | 598 | ||
597 | return xirc2ps_config(link); | 599 | return xirc2ps_config(link); |
@@ -1324,9 +1326,11 @@ xirc2ps_interrupt(int irq, void *dev_id) | |||
1324 | /*====================================================================*/ | 1326 | /*====================================================================*/ |
1325 | 1327 | ||
1326 | static void | 1328 | static void |
1327 | xirc2ps_tx_timeout_task(void *data) | 1329 | xirc2ps_tx_timeout_task(struct work_struct *work) |
1328 | { | 1330 | { |
1329 | struct net_device *dev = data; | 1331 | local_info_t *local = |
1332 | container_of(work, local_info_t, tx_timeout_task); | ||
1333 | struct net_device *dev = local->dev; | ||
1330 | /* reset the card */ | 1334 | /* reset the card */ |
1331 | do_reset(dev,1); | 1335 | do_reset(dev,1); |
1332 | dev->trans_start = jiffies; | 1336 | dev->trans_start = jiffies; |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 88237bdb5255..4044bb1ada86 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -397,7 +397,7 @@ out_unlock: | |||
397 | EXPORT_SYMBOL(phy_start_aneg); | 397 | EXPORT_SYMBOL(phy_start_aneg); |
398 | 398 | ||
399 | 399 | ||
400 | static void phy_change(void *data); | 400 | static void phy_change(struct work_struct *work); |
401 | static void phy_timer(unsigned long data); | 401 | static void phy_timer(unsigned long data); |
402 | 402 | ||
403 | /* phy_start_machine: | 403 | /* phy_start_machine: |
@@ -555,7 +555,7 @@ int phy_start_interrupts(struct phy_device *phydev) | |||
555 | { | 555 | { |
556 | int err = 0; | 556 | int err = 0; |
557 | 557 | ||
558 | INIT_WORK(&phydev->phy_queue, phy_change, phydev); | 558 | INIT_WORK(&phydev->phy_queue, phy_change); |
559 | 559 | ||
560 | if (request_irq(phydev->irq, phy_interrupt, | 560 | if (request_irq(phydev->irq, phy_interrupt, |
561 | IRQF_SHARED, | 561 | IRQF_SHARED, |
@@ -598,10 +598,11 @@ EXPORT_SYMBOL(phy_stop_interrupts); | |||
598 | 598 | ||
599 | 599 | ||
600 | /* Scheduled by the phy_interrupt/timer to handle PHY changes */ | 600 | /* Scheduled by the phy_interrupt/timer to handle PHY changes */ |
601 | static void phy_change(void *data) | 601 | static void phy_change(struct work_struct *work) |
602 | { | 602 | { |
603 | int err; | 603 | int err; |
604 | struct phy_device *phydev = data; | 604 | struct phy_device *phydev = |
605 | container_of(work, struct phy_device, phy_queue); | ||
605 | 606 | ||
606 | err = phy_disable_interrupts(phydev); | 607 | err = phy_disable_interrupts(phydev); |
607 | 608 | ||
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index 71afb274498f..6bb085f54437 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -138,9 +138,9 @@ static const unsigned int net_debug = NET_DEBUG; | |||
138 | #define PLIP_NIBBLE_WAIT 3000 | 138 | #define PLIP_NIBBLE_WAIT 3000 |
139 | 139 | ||
140 | /* Bottom halves */ | 140 | /* Bottom halves */ |
141 | static void plip_kick_bh(struct net_device *dev); | 141 | static void plip_kick_bh(struct work_struct *work); |
142 | static void plip_bh(struct net_device *dev); | 142 | static void plip_bh(struct work_struct *work); |
143 | static void plip_timer_bh(struct net_device *dev); | 143 | static void plip_timer_bh(struct work_struct *work); |
144 | 144 | ||
145 | /* Interrupt handler */ | 145 | /* Interrupt handler */ |
146 | static void plip_interrupt(int irq, void *dev_id); | 146 | static void plip_interrupt(int irq, void *dev_id); |
@@ -207,9 +207,10 @@ struct plip_local { | |||
207 | 207 | ||
208 | struct net_local { | 208 | struct net_local { |
209 | struct net_device_stats enet_stats; | 209 | struct net_device_stats enet_stats; |
210 | struct net_device *dev; | ||
210 | struct work_struct immediate; | 211 | struct work_struct immediate; |
211 | struct work_struct deferred; | 212 | struct delayed_work deferred; |
212 | struct work_struct timer; | 213 | struct delayed_work timer; |
213 | struct plip_local snd_data; | 214 | struct plip_local snd_data; |
214 | struct plip_local rcv_data; | 215 | struct plip_local rcv_data; |
215 | struct pardevice *pardev; | 216 | struct pardevice *pardev; |
@@ -306,11 +307,11 @@ plip_init_netdev(struct net_device *dev) | |||
306 | nl->nibble = PLIP_NIBBLE_WAIT; | 307 | nl->nibble = PLIP_NIBBLE_WAIT; |
307 | 308 | ||
308 | /* Initialize task queue structures */ | 309 | /* Initialize task queue structures */ |
309 | INIT_WORK(&nl->immediate, (void (*)(void *))plip_bh, dev); | 310 | INIT_WORK(&nl->immediate, plip_bh); |
310 | INIT_WORK(&nl->deferred, (void (*)(void *))plip_kick_bh, dev); | 311 | INIT_DELAYED_WORK(&nl->deferred, plip_kick_bh); |
311 | 312 | ||
312 | if (dev->irq == -1) | 313 | if (dev->irq == -1) |
313 | INIT_WORK(&nl->timer, (void (*)(void *))plip_timer_bh, dev); | 314 | INIT_DELAYED_WORK(&nl->timer, plip_timer_bh); |
314 | 315 | ||
315 | spin_lock_init(&nl->lock); | 316 | spin_lock_init(&nl->lock); |
316 | } | 317 | } |
@@ -319,9 +320,10 @@ plip_init_netdev(struct net_device *dev) | |||
319 | This routine is kicked by do_timer(). | 320 | This routine is kicked by do_timer(). |
320 | Request `plip_bh' to be invoked. */ | 321 | Request `plip_bh' to be invoked. */ |
321 | static void | 322 | static void |
322 | plip_kick_bh(struct net_device *dev) | 323 | plip_kick_bh(struct work_struct *work) |
323 | { | 324 | { |
324 | struct net_local *nl = netdev_priv(dev); | 325 | struct net_local *nl = |
326 | container_of(work, struct net_local, deferred.work); | ||
325 | 327 | ||
326 | if (nl->is_deferred) | 328 | if (nl->is_deferred) |
327 | schedule_work(&nl->immediate); | 329 | schedule_work(&nl->immediate); |
@@ -362,9 +364,9 @@ static const plip_func connection_state_table[] = | |||
362 | 364 | ||
363 | /* Bottom half handler of PLIP. */ | 365 | /* Bottom half handler of PLIP. */ |
364 | static void | 366 | static void |
365 | plip_bh(struct net_device *dev) | 367 | plip_bh(struct work_struct *work) |
366 | { | 368 | { |
367 | struct net_local *nl = netdev_priv(dev); | 369 | struct net_local *nl = container_of(work, struct net_local, immediate); |
368 | struct plip_local *snd = &nl->snd_data; | 370 | struct plip_local *snd = &nl->snd_data; |
369 | struct plip_local *rcv = &nl->rcv_data; | 371 | struct plip_local *rcv = &nl->rcv_data; |
370 | plip_func f; | 372 | plip_func f; |
@@ -372,20 +374,21 @@ plip_bh(struct net_device *dev) | |||
372 | 374 | ||
373 | nl->is_deferred = 0; | 375 | nl->is_deferred = 0; |
374 | f = connection_state_table[nl->connection]; | 376 | f = connection_state_table[nl->connection]; |
375 | if ((r = (*f)(dev, nl, snd, rcv)) != OK | 377 | if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK |
376 | && (r = plip_bh_timeout_error(dev, nl, snd, rcv, r)) != OK) { | 378 | && (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) { |
377 | nl->is_deferred = 1; | 379 | nl->is_deferred = 1; |
378 | schedule_delayed_work(&nl->deferred, 1); | 380 | schedule_delayed_work(&nl->deferred, 1); |
379 | } | 381 | } |
380 | } | 382 | } |
381 | 383 | ||
382 | static void | 384 | static void |
383 | plip_timer_bh(struct net_device *dev) | 385 | plip_timer_bh(struct work_struct *work) |
384 | { | 386 | { |
385 | struct net_local *nl = netdev_priv(dev); | 387 | struct net_local *nl = |
388 | container_of(work, struct net_local, timer.work); | ||
386 | 389 | ||
387 | if (!(atomic_read (&nl->kill_timer))) { | 390 | if (!(atomic_read (&nl->kill_timer))) { |
388 | plip_interrupt (-1, dev); | 391 | plip_interrupt (-1, nl->dev); |
389 | 392 | ||
390 | schedule_delayed_work(&nl->timer, 1); | 393 | schedule_delayed_work(&nl->timer, 1); |
391 | } | 394 | } |
@@ -1284,6 +1287,7 @@ static void plip_attach (struct parport *port) | |||
1284 | } | 1287 | } |
1285 | 1288 | ||
1286 | nl = netdev_priv(dev); | 1289 | nl = netdev_priv(dev); |
1290 | nl->dev = dev; | ||
1287 | nl->pardev = parport_register_device(port, name, plip_preempt, | 1291 | nl->pardev = parport_register_device(port, name, plip_preempt, |
1288 | plip_wakeup, plip_interrupt, | 1292 | plip_wakeup, plip_interrupt, |
1289 | 0, dev); | 1293 | 0, dev); |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index ec640f6229ae..d79d141a601d 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -2008,7 +2008,7 @@ static irqreturn_t ql3xxx_isr(int irq, void *dev_id) | |||
2008 | "%s: Another function issued a reset to the " | 2008 | "%s: Another function issued a reset to the " |
2009 | "chip. ISR value = %x.\n", ndev->name, value); | 2009 | "chip. ISR value = %x.\n", ndev->name, value); |
2010 | } | 2010 | } |
2011 | queue_work(qdev->workqueue, &qdev->reset_work); | 2011 | queue_delayed_work(qdev->workqueue, &qdev->reset_work, 0); |
2012 | spin_unlock(&qdev->adapter_lock); | 2012 | spin_unlock(&qdev->adapter_lock); |
2013 | } else if (value & ISP_IMR_DISABLE_CMPL_INT) { | 2013 | } else if (value & ISP_IMR_DISABLE_CMPL_INT) { |
2014 | ql_disable_interrupts(qdev); | 2014 | ql_disable_interrupts(qdev); |
@@ -3182,11 +3182,13 @@ static void ql3xxx_tx_timeout(struct net_device *ndev) | |||
3182 | /* | 3182 | /* |
3183 | * Wake up the worker to process this event. | 3183 | * Wake up the worker to process this event. |
3184 | */ | 3184 | */ |
3185 | queue_work(qdev->workqueue, &qdev->tx_timeout_work); | 3185 | queue_delayed_work(qdev->workqueue, &qdev->tx_timeout_work, 0); |
3186 | } | 3186 | } |
3187 | 3187 | ||
3188 | static void ql_reset_work(struct ql3_adapter *qdev) | 3188 | static void ql_reset_work(struct work_struct *work) |
3189 | { | 3189 | { |
3190 | struct ql3_adapter *qdev = | ||
3191 | container_of(work, struct ql3_adapter, reset_work.work); | ||
3190 | struct net_device *ndev = qdev->ndev; | 3192 | struct net_device *ndev = qdev->ndev; |
3191 | u32 value; | 3193 | u32 value; |
3192 | struct ql_tx_buf_cb *tx_cb; | 3194 | struct ql_tx_buf_cb *tx_cb; |
@@ -3278,9 +3280,12 @@ static void ql_reset_work(struct ql3_adapter *qdev) | |||
3278 | } | 3280 | } |
3279 | } | 3281 | } |
3280 | 3282 | ||
3281 | static void ql_tx_timeout_work(struct ql3_adapter *qdev) | 3283 | static void ql_tx_timeout_work(struct work_struct *work) |
3282 | { | 3284 | { |
3283 | ql_cycle_adapter(qdev,QL_DO_RESET); | 3285 | struct ql3_adapter *qdev = |
3286 | container_of(work, struct ql3_adapter, tx_timeout_work.work); | ||
3287 | |||
3288 | ql_cycle_adapter(qdev, QL_DO_RESET); | ||
3284 | } | 3289 | } |
3285 | 3290 | ||
3286 | static void ql_get_board_info(struct ql3_adapter *qdev) | 3291 | static void ql_get_board_info(struct ql3_adapter *qdev) |
@@ -3459,9 +3464,8 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev, | |||
3459 | netif_stop_queue(ndev); | 3464 | netif_stop_queue(ndev); |
3460 | 3465 | ||
3461 | qdev->workqueue = create_singlethread_workqueue(ndev->name); | 3466 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
3462 | INIT_WORK(&qdev->reset_work, (void (*)(void *))ql_reset_work, qdev); | 3467 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); |
3463 | INIT_WORK(&qdev->tx_timeout_work, | 3468 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); |
3464 | (void (*)(void *))ql_tx_timeout_work, qdev); | ||
3465 | 3469 | ||
3466 | init_timer(&qdev->adapter_timer); | 3470 | init_timer(&qdev->adapter_timer); |
3467 | qdev->adapter_timer.function = ql3xxx_timer; | 3471 | qdev->adapter_timer.function = ql3xxx_timer; |
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index 65da2c0bfda6..ea94de7fd071 100644 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h | |||
@@ -1186,8 +1186,8 @@ struct ql3_adapter { | |||
1186 | u32 numPorts; | 1186 | u32 numPorts; |
1187 | struct net_device_stats stats; | 1187 | struct net_device_stats stats; |
1188 | struct workqueue_struct *workqueue; | 1188 | struct workqueue_struct *workqueue; |
1189 | struct work_struct reset_work; | 1189 | struct delayed_work reset_work; |
1190 | struct work_struct tx_timeout_work; | 1190 | struct delayed_work tx_timeout_work; |
1191 | u32 max_frame_size; | 1191 | u32 max_frame_size; |
1192 | }; | 1192 | }; |
1193 | 1193 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 45d3ca431957..85a392fab5cc 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -424,6 +424,7 @@ struct ring_info { | |||
424 | struct rtl8169_private { | 424 | struct rtl8169_private { |
425 | void __iomem *mmio_addr; /* memory map physical address */ | 425 | void __iomem *mmio_addr; /* memory map physical address */ |
426 | struct pci_dev *pci_dev; /* Index of PCI device */ | 426 | struct pci_dev *pci_dev; /* Index of PCI device */ |
427 | struct net_device *dev; | ||
427 | struct net_device_stats stats; /* statistics of net device */ | 428 | struct net_device_stats stats; /* statistics of net device */ |
428 | spinlock_t lock; /* spin lock flag */ | 429 | spinlock_t lock; /* spin lock flag */ |
429 | u32 msg_enable; | 430 | u32 msg_enable; |
@@ -455,7 +456,7 @@ struct rtl8169_private { | |||
455 | void (*phy_reset_enable)(void __iomem *); | 456 | void (*phy_reset_enable)(void __iomem *); |
456 | unsigned int (*phy_reset_pending)(void __iomem *); | 457 | unsigned int (*phy_reset_pending)(void __iomem *); |
457 | unsigned int (*link_ok)(void __iomem *); | 458 | unsigned int (*link_ok)(void __iomem *); |
458 | struct work_struct task; | 459 | struct delayed_work task; |
459 | unsigned wol_enabled : 1; | 460 | unsigned wol_enabled : 1; |
460 | }; | 461 | }; |
461 | 462 | ||
@@ -1510,6 +1511,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1510 | SET_MODULE_OWNER(dev); | 1511 | SET_MODULE_OWNER(dev); |
1511 | SET_NETDEV_DEV(dev, &pdev->dev); | 1512 | SET_NETDEV_DEV(dev, &pdev->dev); |
1512 | tp = netdev_priv(dev); | 1513 | tp = netdev_priv(dev); |
1514 | tp->dev = dev; | ||
1513 | tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT); | 1515 | tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT); |
1514 | 1516 | ||
1515 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ | 1517 | /* enable device (incl. PCI PM wakeup and hotplug setup) */ |
@@ -1782,7 +1784,7 @@ static int rtl8169_open(struct net_device *dev) | |||
1782 | if (retval < 0) | 1784 | if (retval < 0) |
1783 | goto err_free_rx; | 1785 | goto err_free_rx; |
1784 | 1786 | ||
1785 | INIT_WORK(&tp->task, NULL, dev); | 1787 | INIT_DELAYED_WORK(&tp->task, NULL); |
1786 | 1788 | ||
1787 | rtl8169_hw_start(dev); | 1789 | rtl8169_hw_start(dev); |
1788 | 1790 | ||
@@ -2105,11 +2107,11 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp) | |||
2105 | tp->cur_tx = tp->dirty_tx = 0; | 2107 | tp->cur_tx = tp->dirty_tx = 0; |
2106 | } | 2108 | } |
2107 | 2109 | ||
2108 | static void rtl8169_schedule_work(struct net_device *dev, void (*task)(void *)) | 2110 | static void rtl8169_schedule_work(struct net_device *dev, work_func_t task) |
2109 | { | 2111 | { |
2110 | struct rtl8169_private *tp = netdev_priv(dev); | 2112 | struct rtl8169_private *tp = netdev_priv(dev); |
2111 | 2113 | ||
2112 | PREPARE_WORK(&tp->task, task, dev); | 2114 | PREPARE_DELAYED_WORK(&tp->task, task); |
2113 | schedule_delayed_work(&tp->task, 4); | 2115 | schedule_delayed_work(&tp->task, 4); |
2114 | } | 2116 | } |
2115 | 2117 | ||
@@ -2128,9 +2130,11 @@ static void rtl8169_wait_for_quiescence(struct net_device *dev) | |||
2128 | netif_poll_enable(dev); | 2130 | netif_poll_enable(dev); |
2129 | } | 2131 | } |
2130 | 2132 | ||
2131 | static void rtl8169_reinit_task(void *_data) | 2133 | static void rtl8169_reinit_task(struct work_struct *work) |
2132 | { | 2134 | { |
2133 | struct net_device *dev = _data; | 2135 | struct rtl8169_private *tp = |
2136 | container_of(work, struct rtl8169_private, task.work); | ||
2137 | struct net_device *dev = tp->dev; | ||
2134 | int ret; | 2138 | int ret; |
2135 | 2139 | ||
2136 | if (netif_running(dev)) { | 2140 | if (netif_running(dev)) { |
@@ -2153,10 +2157,11 @@ static void rtl8169_reinit_task(void *_data) | |||
2153 | } | 2157 | } |
2154 | } | 2158 | } |
2155 | 2159 | ||
2156 | static void rtl8169_reset_task(void *_data) | 2160 | static void rtl8169_reset_task(struct work_struct *work) |
2157 | { | 2161 | { |
2158 | struct net_device *dev = _data; | 2162 | struct rtl8169_private *tp = |
2159 | struct rtl8169_private *tp = netdev_priv(dev); | 2163 | container_of(work, struct rtl8169_private, task.work); |
2164 | struct net_device *dev = tp->dev; | ||
2160 | 2165 | ||
2161 | if (!netif_running(dev)) | 2166 | if (!netif_running(dev)) |
2162 | return; | 2167 | return; |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 33569ec9dbfc..250cdbeefdfd 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -5872,9 +5872,9 @@ static void s2io_tasklet(unsigned long dev_addr) | |||
5872 | * Description: Sets the link status for the adapter | 5872 | * Description: Sets the link status for the adapter |
5873 | */ | 5873 | */ |
5874 | 5874 | ||
5875 | static void s2io_set_link(unsigned long data) | 5875 | static void s2io_set_link(struct work_struct *work) |
5876 | { | 5876 | { |
5877 | nic_t *nic = (nic_t *) data; | 5877 | nic_t *nic = container_of(work, nic_t, set_link_task); |
5878 | struct net_device *dev = nic->dev; | 5878 | struct net_device *dev = nic->dev; |
5879 | XENA_dev_config_t __iomem *bar0 = nic->bar0; | 5879 | XENA_dev_config_t __iomem *bar0 = nic->bar0; |
5880 | register u64 val64; | 5880 | register u64 val64; |
@@ -6379,10 +6379,10 @@ static int s2io_card_up(nic_t * sp) | |||
6379 | * spin lock. | 6379 | * spin lock. |
6380 | */ | 6380 | */ |
6381 | 6381 | ||
6382 | static void s2io_restart_nic(unsigned long data) | 6382 | static void s2io_restart_nic(struct work_struct *work) |
6383 | { | 6383 | { |
6384 | struct net_device *dev = (struct net_device *) data; | 6384 | nic_t *sp = container_of(work, nic_t, rst_timer_task); |
6385 | nic_t *sp = dev->priv; | 6385 | struct net_device *dev = sp->dev; |
6386 | 6386 | ||
6387 | s2io_card_down(sp); | 6387 | s2io_card_down(sp); |
6388 | if (s2io_card_up(sp)) { | 6388 | if (s2io_card_up(sp)) { |
@@ -6992,10 +6992,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
6992 | 6992 | ||
6993 | dev->tx_timeout = &s2io_tx_watchdog; | 6993 | dev->tx_timeout = &s2io_tx_watchdog; |
6994 | dev->watchdog_timeo = WATCH_DOG_TIMEOUT; | 6994 | dev->watchdog_timeo = WATCH_DOG_TIMEOUT; |
6995 | INIT_WORK(&sp->rst_timer_task, | 6995 | INIT_WORK(&sp->rst_timer_task, s2io_restart_nic); |
6996 | (void (*)(void *)) s2io_restart_nic, dev); | 6996 | INIT_WORK(&sp->set_link_task, s2io_set_link); |
6997 | INIT_WORK(&sp->set_link_task, | ||
6998 | (void (*)(void *)) s2io_set_link, sp); | ||
6999 | 6997 | ||
7000 | pci_save_state(sp->pdev); | 6998 | pci_save_state(sp->pdev); |
7001 | 6999 | ||
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 12b719f4d00f..3b0bafd273c8 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -1000,7 +1000,7 @@ s2io_msix_fifo_handle(int irq, void *dev_id); | |||
1000 | static irqreturn_t s2io_isr(int irq, void *dev_id); | 1000 | static irqreturn_t s2io_isr(int irq, void *dev_id); |
1001 | static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); | 1001 | static int verify_xena_quiescence(nic_t *sp, u64 val64, int flag); |
1002 | static const struct ethtool_ops netdev_ethtool_ops; | 1002 | static const struct ethtool_ops netdev_ethtool_ops; |
1003 | static void s2io_set_link(unsigned long data); | 1003 | static void s2io_set_link(struct work_struct *work); |
1004 | static int s2io_set_swapper(nic_t * sp); | 1004 | static int s2io_set_swapper(nic_t * sp); |
1005 | static void s2io_card_down(nic_t *nic); | 1005 | static void s2io_card_down(nic_t *nic); |
1006 | static int s2io_card_up(nic_t *nic); | 1006 | static int s2io_card_up(nic_t *nic); |
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index aaba458584fb..b70ed79d4121 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -280,6 +280,7 @@ enum sis190_feature { | |||
280 | struct sis190_private { | 280 | struct sis190_private { |
281 | void __iomem *mmio_addr; | 281 | void __iomem *mmio_addr; |
282 | struct pci_dev *pci_dev; | 282 | struct pci_dev *pci_dev; |
283 | struct net_device *dev; | ||
283 | struct net_device_stats stats; | 284 | struct net_device_stats stats; |
284 | spinlock_t lock; | 285 | spinlock_t lock; |
285 | u32 rx_buf_sz; | 286 | u32 rx_buf_sz; |
@@ -897,10 +898,11 @@ static void sis190_hw_start(struct net_device *dev) | |||
897 | netif_start_queue(dev); | 898 | netif_start_queue(dev); |
898 | } | 899 | } |
899 | 900 | ||
900 | static void sis190_phy_task(void * data) | 901 | static void sis190_phy_task(struct work_struct *work) |
901 | { | 902 | { |
902 | struct net_device *dev = data; | 903 | struct sis190_private *tp = |
903 | struct sis190_private *tp = netdev_priv(dev); | 904 | container_of(work, struct sis190_private, phy_task); |
905 | struct net_device *dev = tp->dev; | ||
904 | void __iomem *ioaddr = tp->mmio_addr; | 906 | void __iomem *ioaddr = tp->mmio_addr; |
905 | int phy_id = tp->mii_if.phy_id; | 907 | int phy_id = tp->mii_if.phy_id; |
906 | u16 val; | 908 | u16 val; |
@@ -1047,7 +1049,7 @@ static int sis190_open(struct net_device *dev) | |||
1047 | if (rc < 0) | 1049 | if (rc < 0) |
1048 | goto err_free_rx_1; | 1050 | goto err_free_rx_1; |
1049 | 1051 | ||
1050 | INIT_WORK(&tp->phy_task, sis190_phy_task, dev); | 1052 | INIT_WORK(&tp->phy_task, sis190_phy_task); |
1051 | 1053 | ||
1052 | sis190_request_timer(dev); | 1054 | sis190_request_timer(dev); |
1053 | 1055 | ||
@@ -1436,6 +1438,7 @@ static struct net_device * __devinit sis190_init_board(struct pci_dev *pdev) | |||
1436 | SET_NETDEV_DEV(dev, &pdev->dev); | 1438 | SET_NETDEV_DEV(dev, &pdev->dev); |
1437 | 1439 | ||
1438 | tp = netdev_priv(dev); | 1440 | tp = netdev_priv(dev); |
1441 | tp->dev = dev; | ||
1439 | tp->msg_enable = netif_msg_init(debug.msg_enable, SIS190_MSG_DEFAULT); | 1442 | tp->msg_enable = netif_msg_init(debug.msg_enable, SIS190_MSG_DEFAULT); |
1440 | 1443 | ||
1441 | rc = pci_enable_device(pdev); | 1444 | rc = pci_enable_device(pdev); |
@@ -1798,7 +1801,7 @@ static int __devinit sis190_init_one(struct pci_dev *pdev, | |||
1798 | 1801 | ||
1799 | sis190_init_rxfilter(dev); | 1802 | sis190_init_rxfilter(dev); |
1800 | 1803 | ||
1801 | INIT_WORK(&tp->phy_task, sis190_phy_task, dev); | 1804 | INIT_WORK(&tp->phy_task, sis190_phy_task); |
1802 | 1805 | ||
1803 | dev->open = sis190_open; | 1806 | dev->open = sis190_open; |
1804 | dev->stop = sis190_close; | 1807 | dev->stop = sis190_close; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 5513907e8393..b60f0451f6cd 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -1327,10 +1327,11 @@ static void xm_check_link(struct net_device *dev) | |||
1327 | * Since internal PHY is wired to a level triggered pin, can't | 1327 | * Since internal PHY is wired to a level triggered pin, can't |
1328 | * get an interrupt when carrier is detected. | 1328 | * get an interrupt when carrier is detected. |
1329 | */ | 1329 | */ |
1330 | static void xm_link_timer(void *arg) | 1330 | static void xm_link_timer(struct work_struct *work) |
1331 | { | 1331 | { |
1332 | struct net_device *dev = arg; | 1332 | struct skge_port *skge = |
1333 | struct skge_port *skge = netdev_priv(arg); | 1333 | container_of(work, struct skge_port, link_thread.work); |
1334 | struct net_device *dev = skge->netdev; | ||
1334 | struct skge_hw *hw = skge->hw; | 1335 | struct skge_hw *hw = skge->hw; |
1335 | int port = skge->port; | 1336 | int port = skge->port; |
1336 | 1337 | ||
@@ -3072,9 +3073,9 @@ static void skge_error_irq(struct skge_hw *hw) | |||
3072 | * because accessing phy registers requires spin wait which might | 3073 | * because accessing phy registers requires spin wait which might |
3073 | * cause excess interrupt latency. | 3074 | * cause excess interrupt latency. |
3074 | */ | 3075 | */ |
3075 | static void skge_extirq(void *arg) | 3076 | static void skge_extirq(struct work_struct *work) |
3076 | { | 3077 | { |
3077 | struct skge_hw *hw = arg; | 3078 | struct skge_hw *hw = container_of(work, struct skge_hw, phy_work); |
3078 | int port; | 3079 | int port; |
3079 | 3080 | ||
3080 | mutex_lock(&hw->phy_mutex); | 3081 | mutex_lock(&hw->phy_mutex); |
@@ -3456,7 +3457,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, | |||
3456 | skge->port = port; | 3457 | skge->port = port; |
3457 | 3458 | ||
3458 | /* Only used for Genesis XMAC */ | 3459 | /* Only used for Genesis XMAC */ |
3459 | INIT_WORK(&skge->link_thread, xm_link_timer, dev); | 3460 | INIT_DELAYED_WORK(&skge->link_thread, xm_link_timer); |
3460 | 3461 | ||
3461 | if (hw->chip_id != CHIP_ID_GENESIS) { | 3462 | if (hw->chip_id != CHIP_ID_GENESIS) { |
3462 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | 3463 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; |
@@ -3543,7 +3544,7 @@ static int __devinit skge_probe(struct pci_dev *pdev, | |||
3543 | 3544 | ||
3544 | hw->pdev = pdev; | 3545 | hw->pdev = pdev; |
3545 | mutex_init(&hw->phy_mutex); | 3546 | mutex_init(&hw->phy_mutex); |
3546 | INIT_WORK(&hw->phy_work, skge_extirq, hw); | 3547 | INIT_WORK(&hw->phy_work, skge_extirq); |
3547 | spin_lock_init(&hw->hw_lock); | 3548 | spin_lock_init(&hw->hw_lock); |
3548 | 3549 | ||
3549 | hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); | 3550 | hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); |
diff --git a/drivers/net/skge.h b/drivers/net/skge.h index 537c0aaa1db8..23e5275d920c 100644 --- a/drivers/net/skge.h +++ b/drivers/net/skge.h | |||
@@ -2456,7 +2456,7 @@ struct skge_port { | |||
2456 | 2456 | ||
2457 | struct net_device_stats net_stats; | 2457 | struct net_device_stats net_stats; |
2458 | 2458 | ||
2459 | struct work_struct link_thread; | 2459 | struct delayed_work link_thread; |
2460 | enum pause_control flow_control; | 2460 | enum pause_control flow_control; |
2461 | enum pause_status flow_status; | 2461 | enum pause_status flow_status; |
2462 | u8 rx_csum; | 2462 | u8 rx_csum; |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 95b6478f55c6..e62a9586fb95 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -210,6 +210,7 @@ struct smc_local { | |||
210 | 210 | ||
211 | /* work queue */ | 211 | /* work queue */ |
212 | struct work_struct phy_configure; | 212 | struct work_struct phy_configure; |
213 | struct net_device *dev; | ||
213 | int work_pending; | 214 | int work_pending; |
214 | 215 | ||
215 | spinlock_t lock; | 216 | spinlock_t lock; |
@@ -1114,10 +1115,11 @@ static void smc_phy_check_media(struct net_device *dev, int init) | |||
1114 | * of autonegotiation.) If the RPC ANEG bit is cleared, the selection | 1115 | * of autonegotiation.) If the RPC ANEG bit is cleared, the selection |
1115 | * is controlled by the RPC SPEED and RPC DPLX bits. | 1116 | * is controlled by the RPC SPEED and RPC DPLX bits. |
1116 | */ | 1117 | */ |
1117 | static void smc_phy_configure(void *data) | 1118 | static void smc_phy_configure(struct work_struct *work) |
1118 | { | 1119 | { |
1119 | struct net_device *dev = data; | 1120 | struct smc_local *lp = |
1120 | struct smc_local *lp = netdev_priv(dev); | 1121 | container_of(work, struct smc_local, phy_configure); |
1122 | struct net_device *dev = lp->dev; | ||
1121 | void __iomem *ioaddr = lp->base; | 1123 | void __iomem *ioaddr = lp->base; |
1122 | int phyaddr = lp->mii.phy_id; | 1124 | int phyaddr = lp->mii.phy_id; |
1123 | int my_phy_caps; /* My PHY capabilities */ | 1125 | int my_phy_caps; /* My PHY capabilities */ |
@@ -1592,7 +1594,7 @@ smc_open(struct net_device *dev) | |||
1592 | 1594 | ||
1593 | /* Configure the PHY, initialize the link state */ | 1595 | /* Configure the PHY, initialize the link state */ |
1594 | if (lp->phy_type != 0) | 1596 | if (lp->phy_type != 0) |
1595 | smc_phy_configure(dev); | 1597 | smc_phy_configure(&lp->phy_configure); |
1596 | else { | 1598 | else { |
1597 | spin_lock_irq(&lp->lock); | 1599 | spin_lock_irq(&lp->lock); |
1598 | smc_10bt_check_media(dev, 1); | 1600 | smc_10bt_check_media(dev, 1); |
@@ -1972,7 +1974,8 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr) | |||
1972 | #endif | 1974 | #endif |
1973 | 1975 | ||
1974 | tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); | 1976 | tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); |
1975 | INIT_WORK(&lp->phy_configure, smc_phy_configure, dev); | 1977 | INIT_WORK(&lp->phy_configure, smc_phy_configure); |
1978 | lp->dev = dev; | ||
1976 | lp->mii.phy_id_mask = 0x1f; | 1979 | lp->mii.phy_id_mask = 0x1f; |
1977 | lp->mii.reg_num_mask = 0x1f; | 1980 | lp->mii.reg_num_mask = 0x1f; |
1978 | lp->mii.force_media = 0; | 1981 | lp->mii.force_media = 0; |
@@ -2322,7 +2325,7 @@ static int smc_drv_resume(struct platform_device *dev) | |||
2322 | smc_reset(ndev); | 2325 | smc_reset(ndev); |
2323 | smc_enable(ndev); | 2326 | smc_enable(ndev); |
2324 | if (lp->phy_type != 0) | 2327 | if (lp->phy_type != 0) |
2325 | smc_phy_configure(ndev); | 2328 | smc_phy_configure(&lp->phy_configure); |
2326 | netif_device_attach(ndev); | 2329 | netif_device_attach(ndev); |
2327 | } | 2330 | } |
2328 | } | 2331 | } |
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 13e0a43e423b..ebb6aa39f9c7 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1939,10 +1939,11 @@ spider_net_stop(struct net_device *netdev) | |||
1939 | * called as task when tx hangs, resets interface (if interface is up) | 1939 | * called as task when tx hangs, resets interface (if interface is up) |
1940 | */ | 1940 | */ |
1941 | static void | 1941 | static void |
1942 | spider_net_tx_timeout_task(void *data) | 1942 | spider_net_tx_timeout_task(struct work_struct *work) |
1943 | { | 1943 | { |
1944 | struct net_device *netdev = data; | 1944 | struct spider_net_card *card = |
1945 | struct spider_net_card *card = netdev_priv(netdev); | 1945 | container_of(work, struct spider_net_card, tx_timeout_task); |
1946 | struct net_device *netdev = card->netdev; | ||
1946 | 1947 | ||
1947 | if (!(netdev->flags & IFF_UP)) | 1948 | if (!(netdev->flags & IFF_UP)) |
1948 | goto out; | 1949 | goto out; |
@@ -2116,7 +2117,7 @@ spider_net_alloc_card(void) | |||
2116 | card = netdev_priv(netdev); | 2117 | card = netdev_priv(netdev); |
2117 | card->netdev = netdev; | 2118 | card->netdev = netdev; |
2118 | card->msg_enable = SPIDER_NET_DEFAULT_MSG; | 2119 | card->msg_enable = SPIDER_NET_DEFAULT_MSG; |
2119 | INIT_WORK(&card->tx_timeout_task, spider_net_tx_timeout_task, netdev); | 2120 | INIT_WORK(&card->tx_timeout_task, spider_net_tx_timeout_task); |
2120 | init_waitqueue_head(&card->waitq); | 2121 | init_waitqueue_head(&card->waitq); |
2121 | atomic_set(&card->tx_timeout_task_counter, 0); | 2122 | atomic_set(&card->tx_timeout_task_counter, 0); |
2122 | 2123 | ||
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index cf44e72399b9..785e4a535f9e 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -2282,9 +2282,9 @@ static void gem_do_stop(struct net_device *dev, int wol) | |||
2282 | } | 2282 | } |
2283 | } | 2283 | } |
2284 | 2284 | ||
2285 | static void gem_reset_task(void *data) | 2285 | static void gem_reset_task(struct work_struct *work) |
2286 | { | 2286 | { |
2287 | struct gem *gp = (struct gem *) data; | 2287 | struct gem *gp = container_of(work, struct gem, reset_task); |
2288 | 2288 | ||
2289 | mutex_lock(&gp->pm_mutex); | 2289 | mutex_lock(&gp->pm_mutex); |
2290 | 2290 | ||
@@ -3044,7 +3044,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev, | |||
3044 | gp->link_timer.function = gem_link_timer; | 3044 | gp->link_timer.function = gem_link_timer; |
3045 | gp->link_timer.data = (unsigned long) gp; | 3045 | gp->link_timer.data = (unsigned long) gp; |
3046 | 3046 | ||
3047 | INIT_WORK(&gp->reset_task, gem_reset_task, gp); | 3047 | INIT_WORK(&gp->reset_task, gem_reset_task); |
3048 | 3048 | ||
3049 | gp->lstate = link_down; | 3049 | gp->lstate = link_down; |
3050 | gp->timer_ticks = 0; | 3050 | gp->timer_ticks = 0; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index c20bb998e0e5..d9123c9adc1e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -3654,9 +3654,9 @@ static void tg3_poll_controller(struct net_device *dev) | |||
3654 | } | 3654 | } |
3655 | #endif | 3655 | #endif |
3656 | 3656 | ||
3657 | static void tg3_reset_task(void *_data) | 3657 | static void tg3_reset_task(struct work_struct *work) |
3658 | { | 3658 | { |
3659 | struct tg3 *tp = _data; | 3659 | struct tg3 *tp = container_of(work, struct tg3, reset_task); |
3660 | unsigned int restart_timer; | 3660 | unsigned int restart_timer; |
3661 | 3661 | ||
3662 | tg3_full_lock(tp, 0); | 3662 | tg3_full_lock(tp, 0); |
@@ -11734,7 +11734,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
11734 | #endif | 11734 | #endif |
11735 | spin_lock_init(&tp->lock); | 11735 | spin_lock_init(&tp->lock); |
11736 | spin_lock_init(&tp->indirect_lock); | 11736 | spin_lock_init(&tp->indirect_lock); |
11737 | INIT_WORK(&tp->reset_task, tg3_reset_task, tp); | 11737 | INIT_WORK(&tp->reset_task, tg3_reset_task); |
11738 | 11738 | ||
11739 | tp->regs = ioremap_nocache(tg3reg_base, tg3reg_len); | 11739 | tp->regs = ioremap_nocache(tg3reg_base, tg3reg_len); |
11740 | if (tp->regs == 0UL) { | 11740 | if (tp->regs == 0UL) { |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index e14f5a00f65a..f85f00251123 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -296,6 +296,7 @@ static void TLan_SetMulticastList( struct net_device *); | |||
296 | static int TLan_ioctl( struct net_device *dev, struct ifreq *rq, int cmd); | 296 | static int TLan_ioctl( struct net_device *dev, struct ifreq *rq, int cmd); |
297 | static int TLan_probe1( struct pci_dev *pdev, long ioaddr, int irq, int rev, const struct pci_device_id *ent); | 297 | static int TLan_probe1( struct pci_dev *pdev, long ioaddr, int irq, int rev, const struct pci_device_id *ent); |
298 | static void TLan_tx_timeout( struct net_device *dev); | 298 | static void TLan_tx_timeout( struct net_device *dev); |
299 | static void TLan_tx_timeout_work(struct work_struct *work); | ||
299 | static int tlan_init_one( struct pci_dev *pdev, const struct pci_device_id *ent); | 300 | static int tlan_init_one( struct pci_dev *pdev, const struct pci_device_id *ent); |
300 | 301 | ||
301 | static u32 TLan_HandleInvalid( struct net_device *, u16 ); | 302 | static u32 TLan_HandleInvalid( struct net_device *, u16 ); |
@@ -562,6 +563,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
562 | priv = netdev_priv(dev); | 563 | priv = netdev_priv(dev); |
563 | 564 | ||
564 | priv->pciDev = pdev; | 565 | priv->pciDev = pdev; |
566 | priv->dev = dev; | ||
565 | 567 | ||
566 | /* Is this a PCI device? */ | 568 | /* Is this a PCI device? */ |
567 | if (pdev) { | 569 | if (pdev) { |
@@ -634,7 +636,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
634 | 636 | ||
635 | /* This will be used when we get an adapter error from | 637 | /* This will be used when we get an adapter error from |
636 | * within our irq handler */ | 638 | * within our irq handler */ |
637 | INIT_WORK(&priv->tlan_tqueue, (void *)(void*)TLan_tx_timeout, dev); | 639 | INIT_WORK(&priv->tlan_tqueue, TLan_tx_timeout_work); |
638 | 640 | ||
639 | spin_lock_init(&priv->lock); | 641 | spin_lock_init(&priv->lock); |
640 | 642 | ||
@@ -1040,6 +1042,25 @@ static void TLan_tx_timeout(struct net_device *dev) | |||
1040 | } | 1042 | } |
1041 | 1043 | ||
1042 | 1044 | ||
1045 | /*************************************************************** | ||
1046 | * TLan_tx_timeout_work | ||
1047 | * | ||
1048 | * Returns: nothing | ||
1049 | * | ||
1050 | * Params: | ||
1051 | * work work item of device which timed out | ||
1052 | * | ||
1053 | **************************************************************/ | ||
1054 | |||
1055 | static void TLan_tx_timeout_work(struct work_struct *work) | ||
1056 | { | ||
1057 | TLanPrivateInfo *priv = | ||
1058 | container_of(work, TLanPrivateInfo, tlan_tqueue); | ||
1059 | |||
1060 | TLan_tx_timeout(priv->dev); | ||
1061 | } | ||
1062 | |||
1063 | |||
1043 | 1064 | ||
1044 | /*************************************************************** | 1065 | /*************************************************************** |
1045 | * TLan_StartTx | 1066 | * TLan_StartTx |
diff --git a/drivers/net/tlan.h b/drivers/net/tlan.h index a44e2f2ef62a..41ce0b665937 100644 --- a/drivers/net/tlan.h +++ b/drivers/net/tlan.h | |||
@@ -170,6 +170,7 @@ typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]; | |||
170 | typedef struct tlan_private_tag { | 170 | typedef struct tlan_private_tag { |
171 | struct net_device *nextDevice; | 171 | struct net_device *nextDevice; |
172 | struct pci_dev *pciDev; | 172 | struct pci_dev *pciDev; |
173 | struct net_device *dev; | ||
173 | void *dmaStorage; | 174 | void *dmaStorage; |
174 | dma_addr_t dmaStorageDMA; | 175 | dma_addr_t dmaStorageDMA; |
175 | unsigned int dmaSize; | 176 | unsigned int dmaSize; |
diff --git a/drivers/net/tulip/21142.c b/drivers/net/tulip/21142.c index fa3a2bb105ad..942b839ccc5b 100644 --- a/drivers/net/tulip/21142.c +++ b/drivers/net/tulip/21142.c | |||
@@ -26,10 +26,11 @@ static u16 t21142_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; | |||
26 | 26 | ||
27 | /* Handle the 21143 uniquely: do autoselect with NWay, not the EEPROM list | 27 | /* Handle the 21143 uniquely: do autoselect with NWay, not the EEPROM list |
28 | of available transceivers. */ | 28 | of available transceivers. */ |
29 | void t21142_media_task(void *data) | 29 | void t21142_media_task(struct work_struct *work) |
30 | { | 30 | { |
31 | struct net_device *dev = data; | 31 | struct tulip_private *tp = |
32 | struct tulip_private *tp = netdev_priv(dev); | 32 | container_of(work, struct tulip_private, media_work); |
33 | struct net_device *dev = tp->dev; | ||
33 | void __iomem *ioaddr = tp->base_addr; | 34 | void __iomem *ioaddr = tp->base_addr; |
34 | int csr12 = ioread32(ioaddr + CSR12); | 35 | int csr12 = ioread32(ioaddr + CSR12); |
35 | int next_tick = 60*HZ; | 36 | int next_tick = 60*HZ; |
diff --git a/drivers/net/tulip/timer.c b/drivers/net/tulip/timer.c index 066e5d6bcbd8..df326fe1cc8f 100644 --- a/drivers/net/tulip/timer.c +++ b/drivers/net/tulip/timer.c | |||
@@ -18,10 +18,11 @@ | |||
18 | #include "tulip.h" | 18 | #include "tulip.h" |
19 | 19 | ||
20 | 20 | ||
21 | void tulip_media_task(void *data) | 21 | void tulip_media_task(struct work_struct *work) |
22 | { | 22 | { |
23 | struct net_device *dev = data; | 23 | struct tulip_private *tp = |
24 | struct tulip_private *tp = netdev_priv(dev); | 24 | container_of(work, struct tulip_private, media_work); |
25 | struct net_device *dev = tp->dev; | ||
25 | void __iomem *ioaddr = tp->base_addr; | 26 | void __iomem *ioaddr = tp->base_addr; |
26 | u32 csr12 = ioread32(ioaddr + CSR12); | 27 | u32 csr12 = ioread32(ioaddr + CSR12); |
27 | int next_tick = 2*HZ; | 28 | int next_tick = 2*HZ; |
diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h index ad107f45c7b1..25f25da76917 100644 --- a/drivers/net/tulip/tulip.h +++ b/drivers/net/tulip/tulip.h | |||
@@ -44,7 +44,7 @@ struct tulip_chip_table { | |||
44 | int valid_intrs; /* CSR7 interrupt enable settings */ | 44 | int valid_intrs; /* CSR7 interrupt enable settings */ |
45 | int flags; | 45 | int flags; |
46 | void (*media_timer) (unsigned long); | 46 | void (*media_timer) (unsigned long); |
47 | void (*media_task) (void *); | 47 | work_func_t media_task; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | 50 | ||
@@ -392,6 +392,7 @@ struct tulip_private { | |||
392 | int csr12_shadow; | 392 | int csr12_shadow; |
393 | int pad0; /* Used for 8-byte alignment */ | 393 | int pad0; /* Used for 8-byte alignment */ |
394 | struct work_struct media_work; | 394 | struct work_struct media_work; |
395 | struct net_device *dev; | ||
395 | }; | 396 | }; |
396 | 397 | ||
397 | 398 | ||
@@ -406,7 +407,7 @@ struct eeprom_fixup { | |||
406 | 407 | ||
407 | /* 21142.c */ | 408 | /* 21142.c */ |
408 | extern u16 t21142_csr14[]; | 409 | extern u16 t21142_csr14[]; |
409 | void t21142_media_task(void *data); | 410 | void t21142_media_task(struct work_struct *work); |
410 | void t21142_start_nway(struct net_device *dev); | 411 | void t21142_start_nway(struct net_device *dev); |
411 | void t21142_lnk_change(struct net_device *dev, int csr5); | 412 | void t21142_lnk_change(struct net_device *dev, int csr5); |
412 | 413 | ||
@@ -444,7 +445,7 @@ void pnic_lnk_change(struct net_device *dev, int csr5); | |||
444 | void pnic_timer(unsigned long data); | 445 | void pnic_timer(unsigned long data); |
445 | 446 | ||
446 | /* timer.c */ | 447 | /* timer.c */ |
447 | void tulip_media_task(void *data); | 448 | void tulip_media_task(struct work_struct *work); |
448 | void mxic_timer(unsigned long data); | 449 | void mxic_timer(unsigned long data); |
449 | void comet_timer(unsigned long data); | 450 | void comet_timer(unsigned long data); |
450 | 451 | ||
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 0aee618f883c..5a35354aa523 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -1367,6 +1367,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1367 | * it is zeroed and aligned in alloc_etherdev | 1367 | * it is zeroed and aligned in alloc_etherdev |
1368 | */ | 1368 | */ |
1369 | tp = netdev_priv(dev); | 1369 | tp = netdev_priv(dev); |
1370 | tp->dev = dev; | ||
1370 | 1371 | ||
1371 | tp->rx_ring = pci_alloc_consistent(pdev, | 1372 | tp->rx_ring = pci_alloc_consistent(pdev, |
1372 | sizeof(struct tulip_rx_desc) * RX_RING_SIZE + | 1373 | sizeof(struct tulip_rx_desc) * RX_RING_SIZE + |
@@ -1389,7 +1390,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1389 | tp->timer.data = (unsigned long)dev; | 1390 | tp->timer.data = (unsigned long)dev; |
1390 | tp->timer.function = tulip_tbl[tp->chip_id].media_timer; | 1391 | tp->timer.function = tulip_tbl[tp->chip_id].media_timer; |
1391 | 1392 | ||
1392 | INIT_WORK(&tp->media_work, tulip_tbl[tp->chip_id].media_task, dev); | 1393 | INIT_WORK(&tp->media_work, tulip_tbl[tp->chip_id].media_task); |
1393 | 1394 | ||
1394 | dev->base_addr = (unsigned long)ioaddr; | 1395 | dev->base_addr = (unsigned long)ioaddr; |
1395 | 1396 | ||
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index 931cbdf6d791..b2a23aed4428 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c | |||
@@ -125,8 +125,8 @@ static int cpc_tty_write_room(struct tty_struct *tty); | |||
125 | static int cpc_tty_chars_in_buffer(struct tty_struct *tty); | 125 | static int cpc_tty_chars_in_buffer(struct tty_struct *tty); |
126 | static void cpc_tty_flush_buffer(struct tty_struct *tty); | 126 | static void cpc_tty_flush_buffer(struct tty_struct *tty); |
127 | static void cpc_tty_hangup(struct tty_struct *tty); | 127 | static void cpc_tty_hangup(struct tty_struct *tty); |
128 | static void cpc_tty_rx_work(void *data); | 128 | static void cpc_tty_rx_work(struct work_struct *work); |
129 | static void cpc_tty_tx_work(void *data); | 129 | static void cpc_tty_tx_work(struct work_struct *work); |
130 | static int cpc_tty_send_to_card(pc300dev_t *dev,void *buf, int len); | 130 | static int cpc_tty_send_to_card(pc300dev_t *dev,void *buf, int len); |
131 | static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx); | 131 | static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx); |
132 | static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char); | 132 | static void cpc_tty_signal_off(pc300dev_t *pc300dev, unsigned char); |
@@ -261,8 +261,8 @@ void cpc_tty_init(pc300dev_t *pc300dev) | |||
261 | cpc_tty->tty_minor = port + CPC_TTY_MINOR_START; | 261 | cpc_tty->tty_minor = port + CPC_TTY_MINOR_START; |
262 | cpc_tty->pc300dev = pc300dev; | 262 | cpc_tty->pc300dev = pc300dev; |
263 | 263 | ||
264 | INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work, (void *)cpc_tty); | 264 | INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work); |
265 | INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work, (void *)port); | 265 | INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work); |
266 | 266 | ||
267 | cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = NULL; | 267 | cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = NULL; |
268 | 268 | ||
@@ -659,21 +659,23 @@ static void cpc_tty_hangup(struct tty_struct *tty) | |||
659 | * o call the line disc. read | 659 | * o call the line disc. read |
660 | * o free memory | 660 | * o free memory |
661 | */ | 661 | */ |
662 | static void cpc_tty_rx_work(void * data) | 662 | static void cpc_tty_rx_work(struct work_struct *work) |
663 | { | 663 | { |
664 | st_cpc_tty_area *cpc_tty; | ||
664 | unsigned long port; | 665 | unsigned long port; |
665 | int i, j; | 666 | int i, j; |
666 | st_cpc_tty_area *cpc_tty; | ||
667 | volatile st_cpc_rx_buf *buf; | 667 | volatile st_cpc_rx_buf *buf; |
668 | char flags=0,flg_rx=1; | 668 | char flags=0,flg_rx=1; |
669 | struct tty_ldisc *ld; | 669 | struct tty_ldisc *ld; |
670 | 670 | ||
671 | if (cpc_tty_cnt == 0) return; | 671 | if (cpc_tty_cnt == 0) return; |
672 | |||
673 | 672 | ||
674 | for (i=0; (i < 4) && flg_rx ; i++) { | 673 | for (i=0; (i < 4) && flg_rx ; i++) { |
675 | flg_rx = 0; | 674 | flg_rx = 0; |
676 | port = (unsigned long)data; | 675 | |
676 | cpc_tty = container_of(work, st_cpc_tty_area, tty_rx_work); | ||
677 | port = cpc_tty - cpc_tty_area; | ||
678 | |||
677 | for (j=0; j < CPC_TTY_NPORTS; j++) { | 679 | for (j=0; j < CPC_TTY_NPORTS; j++) { |
678 | cpc_tty = &cpc_tty_area[port]; | 680 | cpc_tty = &cpc_tty_area[port]; |
679 | 681 | ||
@@ -882,9 +884,10 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
882 | * o if need call line discipline wakeup | 884 | * o if need call line discipline wakeup |
883 | * o call wake_up_interruptible | 885 | * o call wake_up_interruptible |
884 | */ | 886 | */ |
885 | static void cpc_tty_tx_work(void *data) | 887 | static void cpc_tty_tx_work(struct work_struct *work) |
886 | { | 888 | { |
887 | st_cpc_tty_area *cpc_tty = (st_cpc_tty_area *) data; | 889 | st_cpc_tty_area *cpc_tty = |
890 | container_of(work, st_cpc_tty_area, tty_tx_work); | ||
888 | struct tty_struct *tty; | 891 | struct tty_struct *tty; |
889 | 892 | ||
890 | CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); | 893 | CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h index 94dfb92fab5c..8286678513b9 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx.h | |||
@@ -819,7 +819,7 @@ struct bcm43xx_private { | |||
819 | struct tasklet_struct isr_tasklet; | 819 | struct tasklet_struct isr_tasklet; |
820 | 820 | ||
821 | /* Periodic tasks */ | 821 | /* Periodic tasks */ |
822 | struct work_struct periodic_work; | 822 | struct delayed_work periodic_work; |
823 | unsigned int periodic_state; | 823 | unsigned int periodic_state; |
824 | 824 | ||
825 | struct work_struct restart_work; | 825 | struct work_struct restart_work; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 5b3c27359a18..2ec2e5afce67 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -3215,9 +3215,10 @@ static void do_periodic_work(struct bcm43xx_private *bcm) | |||
3215 | schedule_delayed_work(&bcm->periodic_work, HZ * 15); | 3215 | schedule_delayed_work(&bcm->periodic_work, HZ * 15); |
3216 | } | 3216 | } |
3217 | 3217 | ||
3218 | static void bcm43xx_periodic_work_handler(void *d) | 3218 | static void bcm43xx_periodic_work_handler(struct work_struct *work) |
3219 | { | 3219 | { |
3220 | struct bcm43xx_private *bcm = d; | 3220 | struct bcm43xx_private *bcm = |
3221 | container_of(work, struct bcm43xx_private, periodic_work.work); | ||
3221 | struct net_device *net_dev = bcm->net_dev; | 3222 | struct net_device *net_dev = bcm->net_dev; |
3222 | unsigned long flags; | 3223 | unsigned long flags; |
3223 | u32 savedirqs = 0; | 3224 | u32 savedirqs = 0; |
@@ -3279,11 +3280,11 @@ void bcm43xx_periodic_tasks_delete(struct bcm43xx_private *bcm) | |||
3279 | 3280 | ||
3280 | void bcm43xx_periodic_tasks_setup(struct bcm43xx_private *bcm) | 3281 | void bcm43xx_periodic_tasks_setup(struct bcm43xx_private *bcm) |
3281 | { | 3282 | { |
3282 | struct work_struct *work = &(bcm->periodic_work); | 3283 | struct delayed_work *work = &bcm->periodic_work; |
3283 | 3284 | ||
3284 | assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); | 3285 | assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); |
3285 | INIT_WORK(work, bcm43xx_periodic_work_handler, bcm); | 3286 | INIT_DELAYED_WORK(work, bcm43xx_periodic_work_handler); |
3286 | schedule_work(work); | 3287 | schedule_delayed_work(work, 0); |
3287 | } | 3288 | } |
3288 | 3289 | ||
3289 | static void bcm43xx_security_init(struct bcm43xx_private *bcm) | 3290 | static void bcm43xx_security_init(struct bcm43xx_private *bcm) |
@@ -3635,7 +3636,7 @@ static int bcm43xx_init_board(struct bcm43xx_private *bcm) | |||
3635 | bcm43xx_periodic_tasks_setup(bcm); | 3636 | bcm43xx_periodic_tasks_setup(bcm); |
3636 | 3637 | ||
3637 | /*FIXME: This should be handled by softmac instead. */ | 3638 | /*FIXME: This should be handled by softmac instead. */ |
3638 | schedule_work(&bcm->softmac->associnfo.work); | 3639 | schedule_delayed_work(&bcm->softmac->associnfo.work, 0); |
3639 | 3640 | ||
3640 | out: | 3641 | out: |
3641 | mutex_unlock(&(bcm)->mutex); | 3642 | mutex_unlock(&(bcm)->mutex); |
@@ -4182,9 +4183,10 @@ static void __devexit bcm43xx_remove_one(struct pci_dev *pdev) | |||
4182 | /* Hard-reset the chip. Do not call this directly. | 4183 | /* Hard-reset the chip. Do not call this directly. |
4183 | * Use bcm43xx_controller_restart() | 4184 | * Use bcm43xx_controller_restart() |
4184 | */ | 4185 | */ |
4185 | static void bcm43xx_chip_reset(void *_bcm) | 4186 | static void bcm43xx_chip_reset(struct work_struct *work) |
4186 | { | 4187 | { |
4187 | struct bcm43xx_private *bcm = _bcm; | 4188 | struct bcm43xx_private *bcm = |
4189 | container_of(work, struct bcm43xx_private, restart_work); | ||
4188 | struct bcm43xx_phyinfo *phy; | 4190 | struct bcm43xx_phyinfo *phy; |
4189 | int err = -ENODEV; | 4191 | int err = -ENODEV; |
4190 | 4192 | ||
@@ -4211,7 +4213,7 @@ void bcm43xx_controller_restart(struct bcm43xx_private *bcm, const char *reason) | |||
4211 | if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) | 4213 | if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) |
4212 | return; | 4214 | return; |
4213 | printk(KERN_ERR PFX "Controller RESET (%s) ...\n", reason); | 4215 | printk(KERN_ERR PFX "Controller RESET (%s) ...\n", reason); |
4214 | INIT_WORK(&bcm->restart_work, bcm43xx_chip_reset, bcm); | 4216 | INIT_WORK(&bcm->restart_work, bcm43xx_chip_reset); |
4215 | schedule_work(&bcm->restart_work); | 4217 | schedule_work(&bcm->restart_work); |
4216 | } | 4218 | } |
4217 | 4219 | ||
diff --git a/drivers/net/wireless/hostap/hostap.h b/drivers/net/wireless/hostap/hostap.h index e663518bd570..e89c890d16fd 100644 --- a/drivers/net/wireless/hostap/hostap.h +++ b/drivers/net/wireless/hostap/hostap.h | |||
@@ -35,7 +35,7 @@ int hostap_80211_get_hdrlen(u16 fc); | |||
35 | struct net_device_stats *hostap_get_stats(struct net_device *dev); | 35 | struct net_device_stats *hostap_get_stats(struct net_device *dev); |
36 | void hostap_setup_dev(struct net_device *dev, local_info_t *local, | 36 | void hostap_setup_dev(struct net_device *dev, local_info_t *local, |
37 | int main_dev); | 37 | int main_dev); |
38 | void hostap_set_multicast_list_queue(void *data); | 38 | void hostap_set_multicast_list_queue(struct work_struct *work); |
39 | int hostap_set_hostapd(local_info_t *local, int val, int rtnl_locked); | 39 | int hostap_set_hostapd(local_info_t *local, int val, int rtnl_locked); |
40 | int hostap_set_hostapd_sta(local_info_t *local, int val, int rtnl_locked); | 40 | int hostap_set_hostapd_sta(local_info_t *local, int val, int rtnl_locked); |
41 | void hostap_cleanup(local_info_t *local); | 41 | void hostap_cleanup(local_info_t *local); |
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index ba13125024cb..08bc57a4b895 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -49,10 +49,10 @@ MODULE_PARM_DESC(autom_ap_wds, "Add WDS connections to other APs " | |||
49 | static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta); | 49 | static struct sta_info* ap_get_sta(struct ap_data *ap, u8 *sta); |
50 | static void hostap_event_expired_sta(struct net_device *dev, | 50 | static void hostap_event_expired_sta(struct net_device *dev, |
51 | struct sta_info *sta); | 51 | struct sta_info *sta); |
52 | static void handle_add_proc_queue(void *data); | 52 | static void handle_add_proc_queue(struct work_struct *work); |
53 | 53 | ||
54 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT | 54 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT |
55 | static void handle_wds_oper_queue(void *data); | 55 | static void handle_wds_oper_queue(struct work_struct *work); |
56 | static void prism2_send_mgmt(struct net_device *dev, | 56 | static void prism2_send_mgmt(struct net_device *dev, |
57 | u16 type_subtype, char *body, | 57 | u16 type_subtype, char *body, |
58 | int body_len, u8 *addr, u16 tx_cb_idx); | 58 | int body_len, u8 *addr, u16 tx_cb_idx); |
@@ -807,7 +807,7 @@ void hostap_init_data(local_info_t *local) | |||
807 | INIT_LIST_HEAD(&ap->sta_list); | 807 | INIT_LIST_HEAD(&ap->sta_list); |
808 | 808 | ||
809 | /* Initialize task queue structure for AP management */ | 809 | /* Initialize task queue structure for AP management */ |
810 | INIT_WORK(&local->ap->add_sta_proc_queue, handle_add_proc_queue, ap); | 810 | INIT_WORK(&local->ap->add_sta_proc_queue, handle_add_proc_queue); |
811 | 811 | ||
812 | ap->tx_callback_idx = | 812 | ap->tx_callback_idx = |
813 | hostap_tx_callback_register(local, hostap_ap_tx_cb, ap); | 813 | hostap_tx_callback_register(local, hostap_ap_tx_cb, ap); |
@@ -815,7 +815,7 @@ void hostap_init_data(local_info_t *local) | |||
815 | printk(KERN_WARNING "%s: failed to register TX callback for " | 815 | printk(KERN_WARNING "%s: failed to register TX callback for " |
816 | "AP\n", local->dev->name); | 816 | "AP\n", local->dev->name); |
817 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT | 817 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT |
818 | INIT_WORK(&local->ap->wds_oper_queue, handle_wds_oper_queue, local); | 818 | INIT_WORK(&local->ap->wds_oper_queue, handle_wds_oper_queue); |
819 | 819 | ||
820 | ap->tx_callback_auth = | 820 | ap->tx_callback_auth = |
821 | hostap_tx_callback_register(local, hostap_ap_tx_cb_auth, ap); | 821 | hostap_tx_callback_register(local, hostap_ap_tx_cb_auth, ap); |
@@ -1062,9 +1062,10 @@ static int prism2_sta_proc_read(char *page, char **start, off_t off, | |||
1062 | } | 1062 | } |
1063 | 1063 | ||
1064 | 1064 | ||
1065 | static void handle_add_proc_queue(void *data) | 1065 | static void handle_add_proc_queue(struct work_struct *work) |
1066 | { | 1066 | { |
1067 | struct ap_data *ap = (struct ap_data *) data; | 1067 | struct ap_data *ap = container_of(work, struct ap_data, |
1068 | add_sta_proc_queue); | ||
1068 | struct sta_info *sta; | 1069 | struct sta_info *sta; |
1069 | char name[20]; | 1070 | char name[20]; |
1070 | struct add_sta_proc_data *entry, *prev; | 1071 | struct add_sta_proc_data *entry, *prev; |
@@ -1952,9 +1953,11 @@ static void handle_pspoll(local_info_t *local, | |||
1952 | 1953 | ||
1953 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT | 1954 | #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT |
1954 | 1955 | ||
1955 | static void handle_wds_oper_queue(void *data) | 1956 | static void handle_wds_oper_queue(struct work_struct *work) |
1956 | { | 1957 | { |
1957 | local_info_t *local = data; | 1958 | struct ap_data *ap = container_of(work, struct ap_data, |
1959 | wds_oper_queue); | ||
1960 | local_info_t *local = ap->local; | ||
1958 | struct wds_oper_data *entry, *prev; | 1961 | struct wds_oper_data *entry, *prev; |
1959 | 1962 | ||
1960 | spin_lock_bh(&local->lock); | 1963 | spin_lock_bh(&local->lock); |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index ed00ebb6e7f4..c19e68636a1c 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -1645,9 +1645,9 @@ static void prism2_schedule_reset(local_info_t *local) | |||
1645 | 1645 | ||
1646 | /* Called only as scheduled task after noticing card timeout in interrupt | 1646 | /* Called only as scheduled task after noticing card timeout in interrupt |
1647 | * context */ | 1647 | * context */ |
1648 | static void handle_reset_queue(void *data) | 1648 | static void handle_reset_queue(struct work_struct *work) |
1649 | { | 1649 | { |
1650 | local_info_t *local = (local_info_t *) data; | 1650 | local_info_t *local = container_of(work, local_info_t, reset_queue); |
1651 | 1651 | ||
1652 | printk(KERN_DEBUG "%s: scheduled card reset\n", local->dev->name); | 1652 | printk(KERN_DEBUG "%s: scheduled card reset\n", local->dev->name); |
1653 | prism2_hw_reset(local->dev); | 1653 | prism2_hw_reset(local->dev); |
@@ -2896,9 +2896,10 @@ static void hostap_passive_scan(unsigned long data) | |||
2896 | 2896 | ||
2897 | /* Called only as a scheduled task when communications quality values should | 2897 | /* Called only as a scheduled task when communications quality values should |
2898 | * be updated. */ | 2898 | * be updated. */ |
2899 | static void handle_comms_qual_update(void *data) | 2899 | static void handle_comms_qual_update(struct work_struct *work) |
2900 | { | 2900 | { |
2901 | local_info_t *local = data; | 2901 | local_info_t *local = |
2902 | container_of(work, local_info_t, comms_qual_update); | ||
2902 | prism2_update_comms_qual(local->dev); | 2903 | prism2_update_comms_qual(local->dev); |
2903 | } | 2904 | } |
2904 | 2905 | ||
@@ -3050,9 +3051,9 @@ static int prism2_set_tim(struct net_device *dev, int aid, int set) | |||
3050 | } | 3051 | } |
3051 | 3052 | ||
3052 | 3053 | ||
3053 | static void handle_set_tim_queue(void *data) | 3054 | static void handle_set_tim_queue(struct work_struct *work) |
3054 | { | 3055 | { |
3055 | local_info_t *local = (local_info_t *) data; | 3056 | local_info_t *local = container_of(work, local_info_t, set_tim_queue); |
3056 | struct set_tim_data *entry; | 3057 | struct set_tim_data *entry; |
3057 | u16 val; | 3058 | u16 val; |
3058 | 3059 | ||
@@ -3209,15 +3210,15 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, | |||
3209 | local->scan_channel_mask = 0xffff; | 3210 | local->scan_channel_mask = 0xffff; |
3210 | 3211 | ||
3211 | /* Initialize task queue structures */ | 3212 | /* Initialize task queue structures */ |
3212 | INIT_WORK(&local->reset_queue, handle_reset_queue, local); | 3213 | INIT_WORK(&local->reset_queue, handle_reset_queue); |
3213 | INIT_WORK(&local->set_multicast_list_queue, | 3214 | INIT_WORK(&local->set_multicast_list_queue, |
3214 | hostap_set_multicast_list_queue, local->dev); | 3215 | hostap_set_multicast_list_queue); |
3215 | 3216 | ||
3216 | INIT_WORK(&local->set_tim_queue, handle_set_tim_queue, local); | 3217 | INIT_WORK(&local->set_tim_queue, handle_set_tim_queue); |
3217 | INIT_LIST_HEAD(&local->set_tim_list); | 3218 | INIT_LIST_HEAD(&local->set_tim_list); |
3218 | spin_lock_init(&local->set_tim_lock); | 3219 | spin_lock_init(&local->set_tim_lock); |
3219 | 3220 | ||
3220 | INIT_WORK(&local->comms_qual_update, handle_comms_qual_update, local); | 3221 | INIT_WORK(&local->comms_qual_update, handle_comms_qual_update); |
3221 | 3222 | ||
3222 | /* Initialize tasklets for handling hardware IRQ related operations | 3223 | /* Initialize tasklets for handling hardware IRQ related operations |
3223 | * outside hw IRQ handler */ | 3224 | * outside hw IRQ handler */ |
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c index 50f72d831cf4..5fd2b1ad7f5e 100644 --- a/drivers/net/wireless/hostap/hostap_info.c +++ b/drivers/net/wireless/hostap/hostap_info.c | |||
@@ -474,9 +474,9 @@ static void handle_info_queue_scanresults(local_info_t *local) | |||
474 | 474 | ||
475 | /* Called only as scheduled task after receiving info frames (used to avoid | 475 | /* Called only as scheduled task after receiving info frames (used to avoid |
476 | * pending too much time in HW IRQ handler). */ | 476 | * pending too much time in HW IRQ handler). */ |
477 | static void handle_info_queue(void *data) | 477 | static void handle_info_queue(struct work_struct *work) |
478 | { | 478 | { |
479 | local_info_t *local = (local_info_t *) data; | 479 | local_info_t *local = container_of(work, local_info_t, info_queue); |
480 | 480 | ||
481 | if (test_and_clear_bit(PRISM2_INFO_PENDING_LINKSTATUS, | 481 | if (test_and_clear_bit(PRISM2_INFO_PENDING_LINKSTATUS, |
482 | &local->pending_info)) | 482 | &local->pending_info)) |
@@ -493,7 +493,7 @@ void hostap_info_init(local_info_t *local) | |||
493 | { | 493 | { |
494 | skb_queue_head_init(&local->info_list); | 494 | skb_queue_head_init(&local->info_list); |
495 | #ifndef PRISM2_NO_STATION_MODES | 495 | #ifndef PRISM2_NO_STATION_MODES |
496 | INIT_WORK(&local->info_queue, handle_info_queue, local); | 496 | INIT_WORK(&local->info_queue, handle_info_queue); |
497 | #endif /* PRISM2_NO_STATION_MODES */ | 497 | #endif /* PRISM2_NO_STATION_MODES */ |
498 | } | 498 | } |
499 | 499 | ||
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 53374fcba77e..0796be9d9e77 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -767,14 +767,14 @@ static int prism2_set_mac_address(struct net_device *dev, void *p) | |||
767 | 767 | ||
768 | /* TODO: to be further implemented as soon as Prism2 fully supports | 768 | /* TODO: to be further implemented as soon as Prism2 fully supports |
769 | * GroupAddresses and correct documentation is available */ | 769 | * GroupAddresses and correct documentation is available */ |
770 | void hostap_set_multicast_list_queue(void *data) | 770 | void hostap_set_multicast_list_queue(struct work_struct *work) |
771 | { | 771 | { |
772 | struct net_device *dev = (struct net_device *) data; | 772 | local_info_t *local = |
773 | container_of(work, local_info_t, set_multicast_list_queue); | ||
774 | struct net_device *dev = local->dev; | ||
773 | struct hostap_interface *iface; | 775 | struct hostap_interface *iface; |
774 | local_info_t *local; | ||
775 | 776 | ||
776 | iface = netdev_priv(dev); | 777 | iface = netdev_priv(dev); |
777 | local = iface->local; | ||
778 | if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE, | 778 | if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE, |
779 | local->is_promisc)) { | 779 | local->is_promisc)) { |
780 | printk(KERN_INFO "%s: %sabling promiscuous mode failed\n", | 780 | printk(KERN_INFO "%s: %sabling promiscuous mode failed\n", |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 79607b8b877c..1bcd352a813b 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -316,7 +316,7 @@ static void ipw2100_release_firmware(struct ipw2100_priv *priv, | |||
316 | struct ipw2100_fw *fw); | 316 | struct ipw2100_fw *fw); |
317 | static int ipw2100_ucode_download(struct ipw2100_priv *priv, | 317 | static int ipw2100_ucode_download(struct ipw2100_priv *priv, |
318 | struct ipw2100_fw *fw); | 318 | struct ipw2100_fw *fw); |
319 | static void ipw2100_wx_event_work(struct ipw2100_priv *priv); | 319 | static void ipw2100_wx_event_work(struct work_struct *work); |
320 | static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev); | 320 | static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev); |
321 | static struct iw_handler_def ipw2100_wx_handler_def; | 321 | static struct iw_handler_def ipw2100_wx_handler_def; |
322 | 322 | ||
@@ -679,7 +679,8 @@ static void schedule_reset(struct ipw2100_priv *priv) | |||
679 | queue_delayed_work(priv->workqueue, &priv->reset_work, | 679 | queue_delayed_work(priv->workqueue, &priv->reset_work, |
680 | priv->reset_backoff * HZ); | 680 | priv->reset_backoff * HZ); |
681 | else | 681 | else |
682 | queue_work(priv->workqueue, &priv->reset_work); | 682 | queue_delayed_work(priv->workqueue, &priv->reset_work, |
683 | 0); | ||
683 | 684 | ||
684 | if (priv->reset_backoff < MAX_RESET_BACKOFF) | 685 | if (priv->reset_backoff < MAX_RESET_BACKOFF) |
685 | priv->reset_backoff++; | 686 | priv->reset_backoff++; |
@@ -1873,8 +1874,10 @@ static void ipw2100_down(struct ipw2100_priv *priv) | |||
1873 | netif_stop_queue(priv->net_dev); | 1874 | netif_stop_queue(priv->net_dev); |
1874 | } | 1875 | } |
1875 | 1876 | ||
1876 | static void ipw2100_reset_adapter(struct ipw2100_priv *priv) | 1877 | static void ipw2100_reset_adapter(struct work_struct *work) |
1877 | { | 1878 | { |
1879 | struct ipw2100_priv *priv = | ||
1880 | container_of(work, struct ipw2100_priv, reset_work.work); | ||
1878 | unsigned long flags; | 1881 | unsigned long flags; |
1879 | union iwreq_data wrqu = { | 1882 | union iwreq_data wrqu = { |
1880 | .ap_addr = { | 1883 | .ap_addr = { |
@@ -2071,9 +2074,9 @@ static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status) | |||
2071 | return; | 2074 | return; |
2072 | 2075 | ||
2073 | if (priv->status & STATUS_SECURITY_UPDATED) | 2076 | if (priv->status & STATUS_SECURITY_UPDATED) |
2074 | queue_work(priv->workqueue, &priv->security_work); | 2077 | queue_delayed_work(priv->workqueue, &priv->security_work, 0); |
2075 | 2078 | ||
2076 | queue_work(priv->workqueue, &priv->wx_event_work); | 2079 | queue_delayed_work(priv->workqueue, &priv->wx_event_work, 0); |
2077 | } | 2080 | } |
2078 | 2081 | ||
2079 | static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status) | 2082 | static void isr_indicate_rf_kill(struct ipw2100_priv *priv, u32 status) |
@@ -5524,8 +5527,11 @@ static int ipw2100_configure_security(struct ipw2100_priv *priv, int batch_mode) | |||
5524 | return err; | 5527 | return err; |
5525 | } | 5528 | } |
5526 | 5529 | ||
5527 | static void ipw2100_security_work(struct ipw2100_priv *priv) | 5530 | static void ipw2100_security_work(struct work_struct *work) |
5528 | { | 5531 | { |
5532 | struct ipw2100_priv *priv = | ||
5533 | container_of(work, struct ipw2100_priv, security_work.work); | ||
5534 | |||
5529 | /* If we happen to have reconnected before we get a chance to | 5535 | /* If we happen to have reconnected before we get a chance to |
5530 | * process this, then update the security settings--which causes | 5536 | * process this, then update the security settings--which causes |
5531 | * a disassociation to occur */ | 5537 | * a disassociation to occur */ |
@@ -5748,7 +5754,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p) | |||
5748 | 5754 | ||
5749 | priv->reset_backoff = 0; | 5755 | priv->reset_backoff = 0; |
5750 | mutex_unlock(&priv->action_mutex); | 5756 | mutex_unlock(&priv->action_mutex); |
5751 | ipw2100_reset_adapter(priv); | 5757 | ipw2100_reset_adapter(&priv->reset_work.work); |
5752 | return 0; | 5758 | return 0; |
5753 | 5759 | ||
5754 | done: | 5760 | done: |
@@ -5910,9 +5916,10 @@ static const struct ethtool_ops ipw2100_ethtool_ops = { | |||
5910 | .get_drvinfo = ipw_ethtool_get_drvinfo, | 5916 | .get_drvinfo = ipw_ethtool_get_drvinfo, |
5911 | }; | 5917 | }; |
5912 | 5918 | ||
5913 | static void ipw2100_hang_check(void *adapter) | 5919 | static void ipw2100_hang_check(struct work_struct *work) |
5914 | { | 5920 | { |
5915 | struct ipw2100_priv *priv = adapter; | 5921 | struct ipw2100_priv *priv = |
5922 | container_of(work, struct ipw2100_priv, hang_check.work); | ||
5916 | unsigned long flags; | 5923 | unsigned long flags; |
5917 | u32 rtc = 0xa5a5a5a5; | 5924 | u32 rtc = 0xa5a5a5a5; |
5918 | u32 len = sizeof(rtc); | 5925 | u32 len = sizeof(rtc); |
@@ -5952,9 +5959,10 @@ static void ipw2100_hang_check(void *adapter) | |||
5952 | spin_unlock_irqrestore(&priv->low_lock, flags); | 5959 | spin_unlock_irqrestore(&priv->low_lock, flags); |
5953 | } | 5960 | } |
5954 | 5961 | ||
5955 | static void ipw2100_rf_kill(void *adapter) | 5962 | static void ipw2100_rf_kill(struct work_struct *work) |
5956 | { | 5963 | { |
5957 | struct ipw2100_priv *priv = adapter; | 5964 | struct ipw2100_priv *priv = |
5965 | container_of(work, struct ipw2100_priv, rf_kill.work); | ||
5958 | unsigned long flags; | 5966 | unsigned long flags; |
5959 | 5967 | ||
5960 | spin_lock_irqsave(&priv->low_lock, flags); | 5968 | spin_lock_irqsave(&priv->low_lock, flags); |
@@ -6103,14 +6111,11 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev, | |||
6103 | 6111 | ||
6104 | priv->workqueue = create_workqueue(DRV_NAME); | 6112 | priv->workqueue = create_workqueue(DRV_NAME); |
6105 | 6113 | ||
6106 | INIT_WORK(&priv->reset_work, | 6114 | INIT_DELAYED_WORK(&priv->reset_work, ipw2100_reset_adapter); |
6107 | (void (*)(void *))ipw2100_reset_adapter, priv); | 6115 | INIT_DELAYED_WORK(&priv->security_work, ipw2100_security_work); |
6108 | INIT_WORK(&priv->security_work, | 6116 | INIT_DELAYED_WORK(&priv->wx_event_work, ipw2100_wx_event_work); |
6109 | (void (*)(void *))ipw2100_security_work, priv); | 6117 | INIT_DELAYED_WORK(&priv->hang_check, ipw2100_hang_check); |
6110 | INIT_WORK(&priv->wx_event_work, | 6118 | INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill); |
6111 | (void (*)(void *))ipw2100_wx_event_work, priv); | ||
6112 | INIT_WORK(&priv->hang_check, ipw2100_hang_check, priv); | ||
6113 | INIT_WORK(&priv->rf_kill, ipw2100_rf_kill, priv); | ||
6114 | 6119 | ||
6115 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) | 6120 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) |
6116 | ipw2100_irq_tasklet, (unsigned long)priv); | 6121 | ipw2100_irq_tasklet, (unsigned long)priv); |
@@ -8281,8 +8286,10 @@ static struct iw_handler_def ipw2100_wx_handler_def = { | |||
8281 | .get_wireless_stats = ipw2100_wx_wireless_stats, | 8286 | .get_wireless_stats = ipw2100_wx_wireless_stats, |
8282 | }; | 8287 | }; |
8283 | 8288 | ||
8284 | static void ipw2100_wx_event_work(struct ipw2100_priv *priv) | 8289 | static void ipw2100_wx_event_work(struct work_struct *work) |
8285 | { | 8290 | { |
8291 | struct ipw2100_priv *priv = | ||
8292 | container_of(work, struct ipw2100_priv, wx_event_work.work); | ||
8286 | union iwreq_data wrqu; | 8293 | union iwreq_data wrqu; |
8287 | int len = ETH_ALEN; | 8294 | int len = ETH_ALEN; |
8288 | 8295 | ||
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h index 55b7227198df..de7d384d38af 100644 --- a/drivers/net/wireless/ipw2100.h +++ b/drivers/net/wireless/ipw2100.h | |||
@@ -583,11 +583,11 @@ struct ipw2100_priv { | |||
583 | struct tasklet_struct irq_tasklet; | 583 | struct tasklet_struct irq_tasklet; |
584 | 584 | ||
585 | struct workqueue_struct *workqueue; | 585 | struct workqueue_struct *workqueue; |
586 | struct work_struct reset_work; | 586 | struct delayed_work reset_work; |
587 | struct work_struct security_work; | 587 | struct delayed_work security_work; |
588 | struct work_struct wx_event_work; | 588 | struct delayed_work wx_event_work; |
589 | struct work_struct hang_check; | 589 | struct delayed_work hang_check; |
590 | struct work_struct rf_kill; | 590 | struct delayed_work rf_kill; |
591 | 591 | ||
592 | u32 interrupts; | 592 | u32 interrupts; |
593 | int tx_interrupts; | 593 | int tx_interrupts; |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index c692d01a76ca..e82e56bb85e1 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -187,9 +187,9 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *); | |||
187 | static void ipw_rx_queue_free(struct ipw_priv *, struct ipw_rx_queue *); | 187 | static void ipw_rx_queue_free(struct ipw_priv *, struct ipw_rx_queue *); |
188 | static void ipw_rx_queue_replenish(void *); | 188 | static void ipw_rx_queue_replenish(void *); |
189 | static int ipw_up(struct ipw_priv *); | 189 | static int ipw_up(struct ipw_priv *); |
190 | static void ipw_bg_up(void *); | 190 | static void ipw_bg_up(struct work_struct *work); |
191 | static void ipw_down(struct ipw_priv *); | 191 | static void ipw_down(struct ipw_priv *); |
192 | static void ipw_bg_down(void *); | 192 | static void ipw_bg_down(struct work_struct *work); |
193 | static int ipw_config(struct ipw_priv *); | 193 | static int ipw_config(struct ipw_priv *); |
194 | static int init_supported_rates(struct ipw_priv *priv, | 194 | static int init_supported_rates(struct ipw_priv *priv, |
195 | struct ipw_supported_rates *prates); | 195 | struct ipw_supported_rates *prates); |
@@ -862,11 +862,12 @@ static void ipw_led_link_on(struct ipw_priv *priv) | |||
862 | spin_unlock_irqrestore(&priv->lock, flags); | 862 | spin_unlock_irqrestore(&priv->lock, flags); |
863 | } | 863 | } |
864 | 864 | ||
865 | static void ipw_bg_led_link_on(void *data) | 865 | static void ipw_bg_led_link_on(struct work_struct *work) |
866 | { | 866 | { |
867 | struct ipw_priv *priv = data; | 867 | struct ipw_priv *priv = |
868 | container_of(work, struct ipw_priv, led_link_on.work); | ||
868 | mutex_lock(&priv->mutex); | 869 | mutex_lock(&priv->mutex); |
869 | ipw_led_link_on(data); | 870 | ipw_led_link_on(priv); |
870 | mutex_unlock(&priv->mutex); | 871 | mutex_unlock(&priv->mutex); |
871 | } | 872 | } |
872 | 873 | ||
@@ -906,11 +907,12 @@ static void ipw_led_link_off(struct ipw_priv *priv) | |||
906 | spin_unlock_irqrestore(&priv->lock, flags); | 907 | spin_unlock_irqrestore(&priv->lock, flags); |
907 | } | 908 | } |
908 | 909 | ||
909 | static void ipw_bg_led_link_off(void *data) | 910 | static void ipw_bg_led_link_off(struct work_struct *work) |
910 | { | 911 | { |
911 | struct ipw_priv *priv = data; | 912 | struct ipw_priv *priv = |
913 | container_of(work, struct ipw_priv, led_link_off.work); | ||
912 | mutex_lock(&priv->mutex); | 914 | mutex_lock(&priv->mutex); |
913 | ipw_led_link_off(data); | 915 | ipw_led_link_off(priv); |
914 | mutex_unlock(&priv->mutex); | 916 | mutex_unlock(&priv->mutex); |
915 | } | 917 | } |
916 | 918 | ||
@@ -985,11 +987,12 @@ static void ipw_led_activity_off(struct ipw_priv *priv) | |||
985 | spin_unlock_irqrestore(&priv->lock, flags); | 987 | spin_unlock_irqrestore(&priv->lock, flags); |
986 | } | 988 | } |
987 | 989 | ||
988 | static void ipw_bg_led_activity_off(void *data) | 990 | static void ipw_bg_led_activity_off(struct work_struct *work) |
989 | { | 991 | { |
990 | struct ipw_priv *priv = data; | 992 | struct ipw_priv *priv = |
993 | container_of(work, struct ipw_priv, led_act_off.work); | ||
991 | mutex_lock(&priv->mutex); | 994 | mutex_lock(&priv->mutex); |
992 | ipw_led_activity_off(data); | 995 | ipw_led_activity_off(priv); |
993 | mutex_unlock(&priv->mutex); | 996 | mutex_unlock(&priv->mutex); |
994 | } | 997 | } |
995 | 998 | ||
@@ -2228,11 +2231,12 @@ static void ipw_adapter_restart(void *adapter) | |||
2228 | } | 2231 | } |
2229 | } | 2232 | } |
2230 | 2233 | ||
2231 | static void ipw_bg_adapter_restart(void *data) | 2234 | static void ipw_bg_adapter_restart(struct work_struct *work) |
2232 | { | 2235 | { |
2233 | struct ipw_priv *priv = data; | 2236 | struct ipw_priv *priv = |
2237 | container_of(work, struct ipw_priv, adapter_restart); | ||
2234 | mutex_lock(&priv->mutex); | 2238 | mutex_lock(&priv->mutex); |
2235 | ipw_adapter_restart(data); | 2239 | ipw_adapter_restart(priv); |
2236 | mutex_unlock(&priv->mutex); | 2240 | mutex_unlock(&priv->mutex); |
2237 | } | 2241 | } |
2238 | 2242 | ||
@@ -2249,11 +2253,12 @@ static void ipw_scan_check(void *data) | |||
2249 | } | 2253 | } |
2250 | } | 2254 | } |
2251 | 2255 | ||
2252 | static void ipw_bg_scan_check(void *data) | 2256 | static void ipw_bg_scan_check(struct work_struct *work) |
2253 | { | 2257 | { |
2254 | struct ipw_priv *priv = data; | 2258 | struct ipw_priv *priv = |
2259 | container_of(work, struct ipw_priv, scan_check.work); | ||
2255 | mutex_lock(&priv->mutex); | 2260 | mutex_lock(&priv->mutex); |
2256 | ipw_scan_check(data); | 2261 | ipw_scan_check(priv); |
2257 | mutex_unlock(&priv->mutex); | 2262 | mutex_unlock(&priv->mutex); |
2258 | } | 2263 | } |
2259 | 2264 | ||
@@ -3831,17 +3836,19 @@ static int ipw_disassociate(void *data) | |||
3831 | return 1; | 3836 | return 1; |
3832 | } | 3837 | } |
3833 | 3838 | ||
3834 | static void ipw_bg_disassociate(void *data) | 3839 | static void ipw_bg_disassociate(struct work_struct *work) |
3835 | { | 3840 | { |
3836 | struct ipw_priv *priv = data; | 3841 | struct ipw_priv *priv = |
3842 | container_of(work, struct ipw_priv, disassociate); | ||
3837 | mutex_lock(&priv->mutex); | 3843 | mutex_lock(&priv->mutex); |
3838 | ipw_disassociate(data); | 3844 | ipw_disassociate(priv); |
3839 | mutex_unlock(&priv->mutex); | 3845 | mutex_unlock(&priv->mutex); |
3840 | } | 3846 | } |
3841 | 3847 | ||
3842 | static void ipw_system_config(void *data) | 3848 | static void ipw_system_config(struct work_struct *work) |
3843 | { | 3849 | { |
3844 | struct ipw_priv *priv = data; | 3850 | struct ipw_priv *priv = |
3851 | container_of(work, struct ipw_priv, system_config); | ||
3845 | 3852 | ||
3846 | #ifdef CONFIG_IPW2200_PROMISCUOUS | 3853 | #ifdef CONFIG_IPW2200_PROMISCUOUS |
3847 | if (priv->prom_net_dev && netif_running(priv->prom_net_dev)) { | 3854 | if (priv->prom_net_dev && netif_running(priv->prom_net_dev)) { |
@@ -4208,11 +4215,12 @@ static void ipw_gather_stats(struct ipw_priv *priv) | |||
4208 | IPW_STATS_INTERVAL); | 4215 | IPW_STATS_INTERVAL); |
4209 | } | 4216 | } |
4210 | 4217 | ||
4211 | static void ipw_bg_gather_stats(void *data) | 4218 | static void ipw_bg_gather_stats(struct work_struct *work) |
4212 | { | 4219 | { |
4213 | struct ipw_priv *priv = data; | 4220 | struct ipw_priv *priv = |
4221 | container_of(work, struct ipw_priv, gather_stats.work); | ||
4214 | mutex_lock(&priv->mutex); | 4222 | mutex_lock(&priv->mutex); |
4215 | ipw_gather_stats(data); | 4223 | ipw_gather_stats(priv); |
4216 | mutex_unlock(&priv->mutex); | 4224 | mutex_unlock(&priv->mutex); |
4217 | } | 4225 | } |
4218 | 4226 | ||
@@ -4268,8 +4276,8 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv, | |||
4268 | if (!(priv->status & STATUS_ROAMING)) { | 4276 | if (!(priv->status & STATUS_ROAMING)) { |
4269 | priv->status |= STATUS_ROAMING; | 4277 | priv->status |= STATUS_ROAMING; |
4270 | if (!(priv->status & STATUS_SCANNING)) | 4278 | if (!(priv->status & STATUS_SCANNING)) |
4271 | queue_work(priv->workqueue, | 4279 | queue_delayed_work(priv->workqueue, |
4272 | &priv->request_scan); | 4280 | &priv->request_scan, 0); |
4273 | } | 4281 | } |
4274 | return; | 4282 | return; |
4275 | } | 4283 | } |
@@ -4607,8 +4615,8 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4607 | #ifdef CONFIG_IPW2200_MONITOR | 4615 | #ifdef CONFIG_IPW2200_MONITOR |
4608 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { | 4616 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { |
4609 | priv->status |= STATUS_SCAN_FORCED; | 4617 | priv->status |= STATUS_SCAN_FORCED; |
4610 | queue_work(priv->workqueue, | 4618 | queue_delayed_work(priv->workqueue, |
4611 | &priv->request_scan); | 4619 | &priv->request_scan, 0); |
4612 | break; | 4620 | break; |
4613 | } | 4621 | } |
4614 | priv->status &= ~STATUS_SCAN_FORCED; | 4622 | priv->status &= ~STATUS_SCAN_FORCED; |
@@ -4631,8 +4639,8 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4631 | /* Don't schedule if we aborted the scan */ | 4639 | /* Don't schedule if we aborted the scan */ |
4632 | priv->status &= ~STATUS_ROAMING; | 4640 | priv->status &= ~STATUS_ROAMING; |
4633 | } else if (priv->status & STATUS_SCAN_PENDING) | 4641 | } else if (priv->status & STATUS_SCAN_PENDING) |
4634 | queue_work(priv->workqueue, | 4642 | queue_delayed_work(priv->workqueue, |
4635 | &priv->request_scan); | 4643 | &priv->request_scan, 0); |
4636 | else if (priv->config & CFG_BACKGROUND_SCAN | 4644 | else if (priv->config & CFG_BACKGROUND_SCAN |
4637 | && priv->status & STATUS_ASSOCIATED) | 4645 | && priv->status & STATUS_ASSOCIATED) |
4638 | queue_delayed_work(priv->workqueue, | 4646 | queue_delayed_work(priv->workqueue, |
@@ -5055,11 +5063,12 @@ static void ipw_rx_queue_replenish(void *data) | |||
5055 | ipw_rx_queue_restock(priv); | 5063 | ipw_rx_queue_restock(priv); |
5056 | } | 5064 | } |
5057 | 5065 | ||
5058 | static void ipw_bg_rx_queue_replenish(void *data) | 5066 | static void ipw_bg_rx_queue_replenish(struct work_struct *work) |
5059 | { | 5067 | { |
5060 | struct ipw_priv *priv = data; | 5068 | struct ipw_priv *priv = |
5069 | container_of(work, struct ipw_priv, rx_replenish); | ||
5061 | mutex_lock(&priv->mutex); | 5070 | mutex_lock(&priv->mutex); |
5062 | ipw_rx_queue_replenish(data); | 5071 | ipw_rx_queue_replenish(priv); |
5063 | mutex_unlock(&priv->mutex); | 5072 | mutex_unlock(&priv->mutex); |
5064 | } | 5073 | } |
5065 | 5074 | ||
@@ -5489,9 +5498,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv, | |||
5489 | return 1; | 5498 | return 1; |
5490 | } | 5499 | } |
5491 | 5500 | ||
5492 | static void ipw_merge_adhoc_network(void *data) | 5501 | static void ipw_merge_adhoc_network(struct work_struct *work) |
5493 | { | 5502 | { |
5494 | struct ipw_priv *priv = data; | 5503 | struct ipw_priv *priv = |
5504 | container_of(work, struct ipw_priv, merge_networks); | ||
5495 | struct ieee80211_network *network = NULL; | 5505 | struct ieee80211_network *network = NULL; |
5496 | struct ipw_network_match match = { | 5506 | struct ipw_network_match match = { |
5497 | .network = priv->assoc_network | 5507 | .network = priv->assoc_network |
@@ -5948,11 +5958,12 @@ static void ipw_adhoc_check(void *data) | |||
5948 | priv->assoc_request.beacon_interval); | 5958 | priv->assoc_request.beacon_interval); |
5949 | } | 5959 | } |
5950 | 5960 | ||
5951 | static void ipw_bg_adhoc_check(void *data) | 5961 | static void ipw_bg_adhoc_check(struct work_struct *work) |
5952 | { | 5962 | { |
5953 | struct ipw_priv *priv = data; | 5963 | struct ipw_priv *priv = |
5964 | container_of(work, struct ipw_priv, adhoc_check.work); | ||
5954 | mutex_lock(&priv->mutex); | 5965 | mutex_lock(&priv->mutex); |
5955 | ipw_adhoc_check(data); | 5966 | ipw_adhoc_check(priv); |
5956 | mutex_unlock(&priv->mutex); | 5967 | mutex_unlock(&priv->mutex); |
5957 | } | 5968 | } |
5958 | 5969 | ||
@@ -6299,19 +6310,26 @@ done: | |||
6299 | return err; | 6310 | return err; |
6300 | } | 6311 | } |
6301 | 6312 | ||
6302 | static int ipw_request_passive_scan(struct ipw_priv *priv) { | 6313 | static void ipw_request_passive_scan(struct work_struct *work) |
6303 | return ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE); | 6314 | { |
6315 | struct ipw_priv *priv = | ||
6316 | container_of(work, struct ipw_priv, request_passive_scan); | ||
6317 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_PASSIVE); | ||
6304 | } | 6318 | } |
6305 | 6319 | ||
6306 | static int ipw_request_scan(struct ipw_priv *priv) { | 6320 | static void ipw_request_scan(struct work_struct *work) |
6307 | return ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE); | 6321 | { |
6322 | struct ipw_priv *priv = | ||
6323 | container_of(work, struct ipw_priv, request_scan.work); | ||
6324 | ipw_request_scan_helper(priv, IW_SCAN_TYPE_ACTIVE); | ||
6308 | } | 6325 | } |
6309 | 6326 | ||
6310 | static void ipw_bg_abort_scan(void *data) | 6327 | static void ipw_bg_abort_scan(struct work_struct *work) |
6311 | { | 6328 | { |
6312 | struct ipw_priv *priv = data; | 6329 | struct ipw_priv *priv = |
6330 | container_of(work, struct ipw_priv, abort_scan); | ||
6313 | mutex_lock(&priv->mutex); | 6331 | mutex_lock(&priv->mutex); |
6314 | ipw_abort_scan(data); | 6332 | ipw_abort_scan(priv); |
6315 | mutex_unlock(&priv->mutex); | 6333 | mutex_unlock(&priv->mutex); |
6316 | } | 6334 | } |
6317 | 6335 | ||
@@ -7084,9 +7102,10 @@ static int ipw_qos_set_tx_queue_command(struct ipw_priv *priv, | |||
7084 | /* | 7102 | /* |
7085 | * background support to run QoS activate functionality | 7103 | * background support to run QoS activate functionality |
7086 | */ | 7104 | */ |
7087 | static void ipw_bg_qos_activate(void *data) | 7105 | static void ipw_bg_qos_activate(struct work_struct *work) |
7088 | { | 7106 | { |
7089 | struct ipw_priv *priv = data; | 7107 | struct ipw_priv *priv = |
7108 | container_of(work, struct ipw_priv, qos_activate); | ||
7090 | 7109 | ||
7091 | if (priv == NULL) | 7110 | if (priv == NULL) |
7092 | return; | 7111 | return; |
@@ -7394,11 +7413,12 @@ static void ipw_roam(void *data) | |||
7394 | priv->status &= ~STATUS_ROAMING; | 7413 | priv->status &= ~STATUS_ROAMING; |
7395 | } | 7414 | } |
7396 | 7415 | ||
7397 | static void ipw_bg_roam(void *data) | 7416 | static void ipw_bg_roam(struct work_struct *work) |
7398 | { | 7417 | { |
7399 | struct ipw_priv *priv = data; | 7418 | struct ipw_priv *priv = |
7419 | container_of(work, struct ipw_priv, roam); | ||
7400 | mutex_lock(&priv->mutex); | 7420 | mutex_lock(&priv->mutex); |
7401 | ipw_roam(data); | 7421 | ipw_roam(priv); |
7402 | mutex_unlock(&priv->mutex); | 7422 | mutex_unlock(&priv->mutex); |
7403 | } | 7423 | } |
7404 | 7424 | ||
@@ -7479,8 +7499,8 @@ static int ipw_associate(void *data) | |||
7479 | &priv->request_scan, | 7499 | &priv->request_scan, |
7480 | SCAN_INTERVAL); | 7500 | SCAN_INTERVAL); |
7481 | else | 7501 | else |
7482 | queue_work(priv->workqueue, | 7502 | queue_delayed_work(priv->workqueue, |
7483 | &priv->request_scan); | 7503 | &priv->request_scan, 0); |
7484 | } | 7504 | } |
7485 | 7505 | ||
7486 | return 0; | 7506 | return 0; |
@@ -7491,11 +7511,12 @@ static int ipw_associate(void *data) | |||
7491 | return 1; | 7511 | return 1; |
7492 | } | 7512 | } |
7493 | 7513 | ||
7494 | static void ipw_bg_associate(void *data) | 7514 | static void ipw_bg_associate(struct work_struct *work) |
7495 | { | 7515 | { |
7496 | struct ipw_priv *priv = data; | 7516 | struct ipw_priv *priv = |
7517 | container_of(work, struct ipw_priv, associate); | ||
7497 | mutex_lock(&priv->mutex); | 7518 | mutex_lock(&priv->mutex); |
7498 | ipw_associate(data); | 7519 | ipw_associate(priv); |
7499 | mutex_unlock(&priv->mutex); | 7520 | mutex_unlock(&priv->mutex); |
7500 | } | 7521 | } |
7501 | 7522 | ||
@@ -9410,7 +9431,7 @@ static int ipw_wx_set_scan(struct net_device *dev, | |||
9410 | 9431 | ||
9411 | IPW_DEBUG_WX("Start scan\n"); | 9432 | IPW_DEBUG_WX("Start scan\n"); |
9412 | 9433 | ||
9413 | queue_work(priv->workqueue, &priv->request_scan); | 9434 | queue_delayed_work(priv->workqueue, &priv->request_scan, 0); |
9414 | 9435 | ||
9415 | return 0; | 9436 | return 0; |
9416 | } | 9437 | } |
@@ -10547,11 +10568,12 @@ static void ipw_rf_kill(void *adapter) | |||
10547 | spin_unlock_irqrestore(&priv->lock, flags); | 10568 | spin_unlock_irqrestore(&priv->lock, flags); |
10548 | } | 10569 | } |
10549 | 10570 | ||
10550 | static void ipw_bg_rf_kill(void *data) | 10571 | static void ipw_bg_rf_kill(struct work_struct *work) |
10551 | { | 10572 | { |
10552 | struct ipw_priv *priv = data; | 10573 | struct ipw_priv *priv = |
10574 | container_of(work, struct ipw_priv, rf_kill.work); | ||
10553 | mutex_lock(&priv->mutex); | 10575 | mutex_lock(&priv->mutex); |
10554 | ipw_rf_kill(data); | 10576 | ipw_rf_kill(priv); |
10555 | mutex_unlock(&priv->mutex); | 10577 | mutex_unlock(&priv->mutex); |
10556 | } | 10578 | } |
10557 | 10579 | ||
@@ -10582,11 +10604,12 @@ static void ipw_link_up(struct ipw_priv *priv) | |||
10582 | queue_delayed_work(priv->workqueue, &priv->request_scan, HZ); | 10604 | queue_delayed_work(priv->workqueue, &priv->request_scan, HZ); |
10583 | } | 10605 | } |
10584 | 10606 | ||
10585 | static void ipw_bg_link_up(void *data) | 10607 | static void ipw_bg_link_up(struct work_struct *work) |
10586 | { | 10608 | { |
10587 | struct ipw_priv *priv = data; | 10609 | struct ipw_priv *priv = |
10610 | container_of(work, struct ipw_priv, link_up); | ||
10588 | mutex_lock(&priv->mutex); | 10611 | mutex_lock(&priv->mutex); |
10589 | ipw_link_up(data); | 10612 | ipw_link_up(priv); |
10590 | mutex_unlock(&priv->mutex); | 10613 | mutex_unlock(&priv->mutex); |
10591 | } | 10614 | } |
10592 | 10615 | ||
@@ -10606,15 +10629,16 @@ static void ipw_link_down(struct ipw_priv *priv) | |||
10606 | 10629 | ||
10607 | if (!(priv->status & STATUS_EXIT_PENDING)) { | 10630 | if (!(priv->status & STATUS_EXIT_PENDING)) { |
10608 | /* Queue up another scan... */ | 10631 | /* Queue up another scan... */ |
10609 | queue_work(priv->workqueue, &priv->request_scan); | 10632 | queue_delayed_work(priv->workqueue, &priv->request_scan, 0); |
10610 | } | 10633 | } |
10611 | } | 10634 | } |
10612 | 10635 | ||
10613 | static void ipw_bg_link_down(void *data) | 10636 | static void ipw_bg_link_down(struct work_struct *work) |
10614 | { | 10637 | { |
10615 | struct ipw_priv *priv = data; | 10638 | struct ipw_priv *priv = |
10639 | container_of(work, struct ipw_priv, link_down); | ||
10616 | mutex_lock(&priv->mutex); | 10640 | mutex_lock(&priv->mutex); |
10617 | ipw_link_down(data); | 10641 | ipw_link_down(priv); |
10618 | mutex_unlock(&priv->mutex); | 10642 | mutex_unlock(&priv->mutex); |
10619 | } | 10643 | } |
10620 | 10644 | ||
@@ -10626,38 +10650,30 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv) | |||
10626 | init_waitqueue_head(&priv->wait_command_queue); | 10650 | init_waitqueue_head(&priv->wait_command_queue); |
10627 | init_waitqueue_head(&priv->wait_state); | 10651 | init_waitqueue_head(&priv->wait_state); |
10628 | 10652 | ||
10629 | INIT_WORK(&priv->adhoc_check, ipw_bg_adhoc_check, priv); | 10653 | INIT_DELAYED_WORK(&priv->adhoc_check, ipw_bg_adhoc_check); |
10630 | INIT_WORK(&priv->associate, ipw_bg_associate, priv); | 10654 | INIT_WORK(&priv->associate, ipw_bg_associate); |
10631 | INIT_WORK(&priv->disassociate, ipw_bg_disassociate, priv); | 10655 | INIT_WORK(&priv->disassociate, ipw_bg_disassociate); |
10632 | INIT_WORK(&priv->system_config, ipw_system_config, priv); | 10656 | INIT_WORK(&priv->system_config, ipw_system_config); |
10633 | INIT_WORK(&priv->rx_replenish, ipw_bg_rx_queue_replenish, priv); | 10657 | INIT_WORK(&priv->rx_replenish, ipw_bg_rx_queue_replenish); |
10634 | INIT_WORK(&priv->adapter_restart, ipw_bg_adapter_restart, priv); | 10658 | INIT_WORK(&priv->adapter_restart, ipw_bg_adapter_restart); |
10635 | INIT_WORK(&priv->rf_kill, ipw_bg_rf_kill, priv); | 10659 | INIT_DELAYED_WORK(&priv->rf_kill, ipw_bg_rf_kill); |
10636 | INIT_WORK(&priv->up, (void (*)(void *))ipw_bg_up, priv); | 10660 | INIT_WORK(&priv->up, ipw_bg_up); |
10637 | INIT_WORK(&priv->down, (void (*)(void *))ipw_bg_down, priv); | 10661 | INIT_WORK(&priv->down, ipw_bg_down); |
10638 | INIT_WORK(&priv->request_scan, | 10662 | INIT_DELAYED_WORK(&priv->request_scan, ipw_request_scan); |
10639 | (void (*)(void *))ipw_request_scan, priv); | 10663 | INIT_WORK(&priv->request_passive_scan, ipw_request_passive_scan); |
10640 | INIT_WORK(&priv->request_passive_scan, | 10664 | INIT_DELAYED_WORK(&priv->gather_stats, ipw_bg_gather_stats); |
10641 | (void (*)(void *))ipw_request_passive_scan, priv); | 10665 | INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan); |
10642 | INIT_WORK(&priv->gather_stats, | 10666 | INIT_WORK(&priv->roam, ipw_bg_roam); |
10643 | (void (*)(void *))ipw_bg_gather_stats, priv); | 10667 | INIT_DELAYED_WORK(&priv->scan_check, ipw_bg_scan_check); |
10644 | INIT_WORK(&priv->abort_scan, (void (*)(void *))ipw_bg_abort_scan, priv); | 10668 | INIT_WORK(&priv->link_up, ipw_bg_link_up); |
10645 | INIT_WORK(&priv->roam, ipw_bg_roam, priv); | 10669 | INIT_WORK(&priv->link_down, ipw_bg_link_down); |
10646 | INIT_WORK(&priv->scan_check, ipw_bg_scan_check, priv); | 10670 | INIT_DELAYED_WORK(&priv->led_link_on, ipw_bg_led_link_on); |
10647 | INIT_WORK(&priv->link_up, (void (*)(void *))ipw_bg_link_up, priv); | 10671 | INIT_DELAYED_WORK(&priv->led_link_off, ipw_bg_led_link_off); |
10648 | INIT_WORK(&priv->link_down, (void (*)(void *))ipw_bg_link_down, priv); | 10672 | INIT_DELAYED_WORK(&priv->led_act_off, ipw_bg_led_activity_off); |
10649 | INIT_WORK(&priv->led_link_on, (void (*)(void *))ipw_bg_led_link_on, | 10673 | INIT_WORK(&priv->merge_networks, ipw_merge_adhoc_network); |
10650 | priv); | ||
10651 | INIT_WORK(&priv->led_link_off, (void (*)(void *))ipw_bg_led_link_off, | ||
10652 | priv); | ||
10653 | INIT_WORK(&priv->led_act_off, (void (*)(void *))ipw_bg_led_activity_off, | ||
10654 | priv); | ||
10655 | INIT_WORK(&priv->merge_networks, | ||
10656 | (void (*)(void *))ipw_merge_adhoc_network, priv); | ||
10657 | 10674 | ||
10658 | #ifdef CONFIG_IPW2200_QOS | 10675 | #ifdef CONFIG_IPW2200_QOS |
10659 | INIT_WORK(&priv->qos_activate, (void (*)(void *))ipw_bg_qos_activate, | 10676 | INIT_WORK(&priv->qos_activate, ipw_bg_qos_activate); |
10660 | priv); | ||
10661 | #endif /* CONFIG_IPW2200_QOS */ | 10677 | #endif /* CONFIG_IPW2200_QOS */ |
10662 | 10678 | ||
10663 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) | 10679 | tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) |
@@ -11190,7 +11206,8 @@ static int ipw_up(struct ipw_priv *priv) | |||
11190 | 11206 | ||
11191 | /* If configure to try and auto-associate, kick | 11207 | /* If configure to try and auto-associate, kick |
11192 | * off a scan. */ | 11208 | * off a scan. */ |
11193 | queue_work(priv->workqueue, &priv->request_scan); | 11209 | queue_delayed_work(priv->workqueue, |
11210 | &priv->request_scan, 0); | ||
11194 | 11211 | ||
11195 | return 0; | 11212 | return 0; |
11196 | } | 11213 | } |
@@ -11211,11 +11228,12 @@ static int ipw_up(struct ipw_priv *priv) | |||
11211 | return -EIO; | 11228 | return -EIO; |
11212 | } | 11229 | } |
11213 | 11230 | ||
11214 | static void ipw_bg_up(void *data) | 11231 | static void ipw_bg_up(struct work_struct *work) |
11215 | { | 11232 | { |
11216 | struct ipw_priv *priv = data; | 11233 | struct ipw_priv *priv = |
11234 | container_of(work, struct ipw_priv, up); | ||
11217 | mutex_lock(&priv->mutex); | 11235 | mutex_lock(&priv->mutex); |
11218 | ipw_up(data); | 11236 | ipw_up(priv); |
11219 | mutex_unlock(&priv->mutex); | 11237 | mutex_unlock(&priv->mutex); |
11220 | } | 11238 | } |
11221 | 11239 | ||
@@ -11282,11 +11300,12 @@ static void ipw_down(struct ipw_priv *priv) | |||
11282 | ipw_led_radio_off(priv); | 11300 | ipw_led_radio_off(priv); |
11283 | } | 11301 | } |
11284 | 11302 | ||
11285 | static void ipw_bg_down(void *data) | 11303 | static void ipw_bg_down(struct work_struct *work) |
11286 | { | 11304 | { |
11287 | struct ipw_priv *priv = data; | 11305 | struct ipw_priv *priv = |
11306 | container_of(work, struct ipw_priv, down); | ||
11288 | mutex_lock(&priv->mutex); | 11307 | mutex_lock(&priv->mutex); |
11289 | ipw_down(data); | 11308 | ipw_down(priv); |
11290 | mutex_unlock(&priv->mutex); | 11309 | mutex_unlock(&priv->mutex); |
11291 | } | 11310 | } |
11292 | 11311 | ||
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h index dad5eedefbf1..626a240a87d8 100644 --- a/drivers/net/wireless/ipw2200.h +++ b/drivers/net/wireless/ipw2200.h | |||
@@ -1290,21 +1290,21 @@ struct ipw_priv { | |||
1290 | 1290 | ||
1291 | struct workqueue_struct *workqueue; | 1291 | struct workqueue_struct *workqueue; |
1292 | 1292 | ||
1293 | struct work_struct adhoc_check; | 1293 | struct delayed_work adhoc_check; |
1294 | struct work_struct associate; | 1294 | struct work_struct associate; |
1295 | struct work_struct disassociate; | 1295 | struct work_struct disassociate; |
1296 | struct work_struct system_config; | 1296 | struct work_struct system_config; |
1297 | struct work_struct rx_replenish; | 1297 | struct work_struct rx_replenish; |
1298 | struct work_struct request_scan; | 1298 | struct delayed_work request_scan; |
1299 | struct work_struct request_passive_scan; | 1299 | struct work_struct request_passive_scan; |
1300 | struct work_struct adapter_restart; | 1300 | struct work_struct adapter_restart; |
1301 | struct work_struct rf_kill; | 1301 | struct delayed_work rf_kill; |
1302 | struct work_struct up; | 1302 | struct work_struct up; |
1303 | struct work_struct down; | 1303 | struct work_struct down; |
1304 | struct work_struct gather_stats; | 1304 | struct delayed_work gather_stats; |
1305 | struct work_struct abort_scan; | 1305 | struct work_struct abort_scan; |
1306 | struct work_struct roam; | 1306 | struct work_struct roam; |
1307 | struct work_struct scan_check; | 1307 | struct delayed_work scan_check; |
1308 | struct work_struct link_up; | 1308 | struct work_struct link_up; |
1309 | struct work_struct link_down; | 1309 | struct work_struct link_down; |
1310 | 1310 | ||
@@ -1319,9 +1319,9 @@ struct ipw_priv { | |||
1319 | u32 led_ofdm_on; | 1319 | u32 led_ofdm_on; |
1320 | u32 led_ofdm_off; | 1320 | u32 led_ofdm_off; |
1321 | 1321 | ||
1322 | struct work_struct led_link_on; | 1322 | struct delayed_work led_link_on; |
1323 | struct work_struct led_link_off; | 1323 | struct delayed_work led_link_off; |
1324 | struct work_struct led_act_off; | 1324 | struct delayed_work led_act_off; |
1325 | struct work_struct merge_networks; | 1325 | struct work_struct merge_networks; |
1326 | 1326 | ||
1327 | struct ipw_cmd_log *cmdlog; | 1327 | struct ipw_cmd_log *cmdlog; |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 336cabac13b3..936c888e03e1 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -980,9 +980,11 @@ static void print_linkstatus(struct net_device *dev, u16 status) | |||
980 | } | 980 | } |
981 | 981 | ||
982 | /* Search scan results for requested BSSID, join it if found */ | 982 | /* Search scan results for requested BSSID, join it if found */ |
983 | static void orinoco_join_ap(struct net_device *dev) | 983 | static void orinoco_join_ap(struct work_struct *work) |
984 | { | 984 | { |
985 | struct orinoco_private *priv = netdev_priv(dev); | 985 | struct orinoco_private *priv = |
986 | container_of(work, struct orinoco_private, join_work); | ||
987 | struct net_device *dev = priv->ndev; | ||
986 | struct hermes *hw = &priv->hw; | 988 | struct hermes *hw = &priv->hw; |
987 | int err; | 989 | int err; |
988 | unsigned long flags; | 990 | unsigned long flags; |
@@ -1055,9 +1057,11 @@ static void orinoco_join_ap(struct net_device *dev) | |||
1055 | } | 1057 | } |
1056 | 1058 | ||
1057 | /* Send new BSSID to userspace */ | 1059 | /* Send new BSSID to userspace */ |
1058 | static void orinoco_send_wevents(struct net_device *dev) | 1060 | static void orinoco_send_wevents(struct work_struct *work) |
1059 | { | 1061 | { |
1060 | struct orinoco_private *priv = netdev_priv(dev); | 1062 | struct orinoco_private *priv = |
1063 | container_of(work, struct orinoco_private, wevent_work); | ||
1064 | struct net_device *dev = priv->ndev; | ||
1061 | struct hermes *hw = &priv->hw; | 1065 | struct hermes *hw = &priv->hw; |
1062 | union iwreq_data wrqu; | 1066 | union iwreq_data wrqu; |
1063 | int err; | 1067 | int err; |
@@ -1864,9 +1868,11 @@ __orinoco_set_multicast_list(struct net_device *dev) | |||
1864 | 1868 | ||
1865 | /* This must be called from user context, without locks held - use | 1869 | /* This must be called from user context, without locks held - use |
1866 | * schedule_work() */ | 1870 | * schedule_work() */ |
1867 | static void orinoco_reset(struct net_device *dev) | 1871 | static void orinoco_reset(struct work_struct *work) |
1868 | { | 1872 | { |
1869 | struct orinoco_private *priv = netdev_priv(dev); | 1873 | struct orinoco_private *priv = |
1874 | container_of(work, struct orinoco_private, reset_work); | ||
1875 | struct net_device *dev = priv->ndev; | ||
1870 | struct hermes *hw = &priv->hw; | 1876 | struct hermes *hw = &priv->hw; |
1871 | int err; | 1877 | int err; |
1872 | unsigned long flags; | 1878 | unsigned long flags; |
@@ -2434,9 +2440,9 @@ struct net_device *alloc_orinocodev(int sizeof_card, | |||
2434 | priv->hw_unavailable = 1; /* orinoco_init() must clear this | 2440 | priv->hw_unavailable = 1; /* orinoco_init() must clear this |
2435 | * before anything else touches the | 2441 | * before anything else touches the |
2436 | * hardware */ | 2442 | * hardware */ |
2437 | INIT_WORK(&priv->reset_work, (void (*)(void *))orinoco_reset, dev); | 2443 | INIT_WORK(&priv->reset_work, orinoco_reset); |
2438 | INIT_WORK(&priv->join_work, (void (*)(void *))orinoco_join_ap, dev); | 2444 | INIT_WORK(&priv->join_work, orinoco_join_ap); |
2439 | INIT_WORK(&priv->wevent_work, (void (*)(void *))orinoco_send_wevents, dev); | 2445 | INIT_WORK(&priv->wevent_work, orinoco_send_wevents); |
2440 | 2446 | ||
2441 | netif_carrier_off(dev); | 2447 | netif_carrier_off(dev); |
2442 | priv->last_linkstatus = 0xffff; | 2448 | priv->last_linkstatus = 0xffff; |
@@ -3608,7 +3614,7 @@ static int orinoco_ioctl_reset(struct net_device *dev, | |||
3608 | printk(KERN_DEBUG "%s: Forcing reset!\n", dev->name); | 3614 | printk(KERN_DEBUG "%s: Forcing reset!\n", dev->name); |
3609 | 3615 | ||
3610 | /* Firmware reset */ | 3616 | /* Firmware reset */ |
3611 | orinoco_reset(dev); | 3617 | orinoco_reset(&priv->reset_work); |
3612 | } else { | 3618 | } else { |
3613 | printk(KERN_DEBUG "%s: Force scheduling reset!\n", dev->name); | 3619 | printk(KERN_DEBUG "%s: Force scheduling reset!\n", dev->name); |
3614 | 3620 | ||
@@ -4154,7 +4160,7 @@ static int orinoco_ioctl_commit(struct net_device *dev, | |||
4154 | return 0; | 4160 | return 0; |
4155 | 4161 | ||
4156 | if (priv->broken_disableport) { | 4162 | if (priv->broken_disableport) { |
4157 | orinoco_reset(dev); | 4163 | orinoco_reset(&priv->reset_work); |
4158 | return 0; | 4164 | return 0; |
4159 | } | 4165 | } |
4160 | 4166 | ||
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 4a20e45de3ca..a87eb51886c8 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
@@ -157,8 +157,9 @@ prism54_mib_init(islpci_private *priv) | |||
157 | * schedule_work(), thus we can as well use sleeping semaphore | 157 | * schedule_work(), thus we can as well use sleeping semaphore |
158 | * locking */ | 158 | * locking */ |
159 | void | 159 | void |
160 | prism54_update_stats(islpci_private *priv) | 160 | prism54_update_stats(struct work_struct *work) |
161 | { | 161 | { |
162 | islpci_private *priv = container_of(work, islpci_private, stats_work); | ||
162 | char *data; | 163 | char *data; |
163 | int j; | 164 | int j; |
164 | struct obj_bss bss, *bss2; | 165 | struct obj_bss bss, *bss2; |
@@ -2493,9 +2494,10 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid, | |||
2493 | * interrupt context, no locks held. | 2494 | * interrupt context, no locks held. |
2494 | */ | 2495 | */ |
2495 | void | 2496 | void |
2496 | prism54_process_trap(void *data) | 2497 | prism54_process_trap(struct work_struct *work) |
2497 | { | 2498 | { |
2498 | struct islpci_mgmtframe *frame = data; | 2499 | struct islpci_mgmtframe *frame = |
2500 | container_of(work, struct islpci_mgmtframe, ws); | ||
2499 | struct net_device *ndev = frame->ndev; | 2501 | struct net_device *ndev = frame->ndev; |
2500 | enum oid_num_t n = mgt_oidtonum(frame->header->oid); | 2502 | enum oid_num_t n = mgt_oidtonum(frame->header->oid); |
2501 | 2503 | ||
diff --git a/drivers/net/wireless/prism54/isl_ioctl.h b/drivers/net/wireless/prism54/isl_ioctl.h index e8183d30c52e..bcfbfb9281d2 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.h +++ b/drivers/net/wireless/prism54/isl_ioctl.h | |||
@@ -31,12 +31,12 @@ | |||
31 | void prism54_mib_init(islpci_private *); | 31 | void prism54_mib_init(islpci_private *); |
32 | 32 | ||
33 | struct iw_statistics *prism54_get_wireless_stats(struct net_device *); | 33 | struct iw_statistics *prism54_get_wireless_stats(struct net_device *); |
34 | void prism54_update_stats(islpci_private *); | 34 | void prism54_update_stats(struct work_struct *); |
35 | 35 | ||
36 | void prism54_acl_init(struct islpci_acl *); | 36 | void prism54_acl_init(struct islpci_acl *); |
37 | void prism54_acl_clean(struct islpci_acl *); | 37 | void prism54_acl_clean(struct islpci_acl *); |
38 | 38 | ||
39 | void prism54_process_trap(void *); | 39 | void prism54_process_trap(struct work_struct *); |
40 | 40 | ||
41 | void prism54_wpa_bss_ie_init(islpci_private *priv); | 41 | void prism54_wpa_bss_ie_init(islpci_private *priv); |
42 | void prism54_wpa_bss_ie_clean(islpci_private *priv); | 42 | void prism54_wpa_bss_ie_clean(islpci_private *priv); |
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c index 1e0603ca436c..f057fd9fcd79 100644 --- a/drivers/net/wireless/prism54/islpci_dev.c +++ b/drivers/net/wireless/prism54/islpci_dev.c | |||
@@ -860,11 +860,10 @@ islpci_setup(struct pci_dev *pdev) | |||
860 | priv->state_off = 1; | 860 | priv->state_off = 1; |
861 | 861 | ||
862 | /* initialize workqueue's */ | 862 | /* initialize workqueue's */ |
863 | INIT_WORK(&priv->stats_work, | 863 | INIT_WORK(&priv->stats_work, prism54_update_stats); |
864 | (void (*)(void *)) prism54_update_stats, priv); | ||
865 | priv->stats_timestamp = 0; | 864 | priv->stats_timestamp = 0; |
866 | 865 | ||
867 | INIT_WORK(&priv->reset_task, islpci_do_reset_and_wake, priv); | 866 | INIT_WORK(&priv->reset_task, islpci_do_reset_and_wake); |
868 | priv->reset_task_pending = 0; | 867 | priv->reset_task_pending = 0; |
869 | 868 | ||
870 | /* allocate various memory areas */ | 869 | /* allocate various memory areas */ |
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c index 676d83813dc8..b1122912ee2d 100644 --- a/drivers/net/wireless/prism54/islpci_eth.c +++ b/drivers/net/wireless/prism54/islpci_eth.c | |||
@@ -480,9 +480,9 @@ islpci_eth_receive(islpci_private *priv) | |||
480 | } | 480 | } |
481 | 481 | ||
482 | void | 482 | void |
483 | islpci_do_reset_and_wake(void *data) | 483 | islpci_do_reset_and_wake(struct work_struct *work) |
484 | { | 484 | { |
485 | islpci_private *priv = data; | 485 | islpci_private *priv = container_of(work, islpci_private, reset_task); |
486 | 486 | ||
487 | islpci_reset(priv, 1); | 487 | islpci_reset(priv, 1); |
488 | priv->reset_task_pending = 0; | 488 | priv->reset_task_pending = 0; |
diff --git a/drivers/net/wireless/prism54/islpci_eth.h b/drivers/net/wireless/prism54/islpci_eth.h index 26789454067c..5bf820defbd0 100644 --- a/drivers/net/wireless/prism54/islpci_eth.h +++ b/drivers/net/wireless/prism54/islpci_eth.h | |||
@@ -67,6 +67,6 @@ void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *); | |||
67 | int islpci_eth_transmit(struct sk_buff *, struct net_device *); | 67 | int islpci_eth_transmit(struct sk_buff *, struct net_device *); |
68 | int islpci_eth_receive(islpci_private *); | 68 | int islpci_eth_receive(islpci_private *); |
69 | void islpci_eth_tx_timeout(struct net_device *); | 69 | void islpci_eth_tx_timeout(struct net_device *); |
70 | void islpci_do_reset_and_wake(void *data); | 70 | void islpci_do_reset_and_wake(struct work_struct *); |
71 | 71 | ||
72 | #endif /* _ISL_GEN_H */ | 72 | #endif /* _ISL_GEN_H */ |
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c index 036a875054c9..2246f7930b4e 100644 --- a/drivers/net/wireless/prism54/islpci_mgt.c +++ b/drivers/net/wireless/prism54/islpci_mgt.c | |||
@@ -386,7 +386,7 @@ islpci_mgt_receive(struct net_device *ndev) | |||
386 | 386 | ||
387 | /* Create work to handle trap out of interrupt | 387 | /* Create work to handle trap out of interrupt |
388 | * context. */ | 388 | * context. */ |
389 | INIT_WORK(&frame->ws, prism54_process_trap, frame); | 389 | INIT_WORK(&frame->ws, prism54_process_trap); |
390 | schedule_work(&frame->ws); | 390 | schedule_work(&frame->ws); |
391 | 391 | ||
392 | } else { | 392 | } else { |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 2696f95b9278..f1573a9c2336 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -32,8 +32,8 @@ | |||
32 | 32 | ||
33 | static void ieee_init(struct ieee80211_device *ieee); | 33 | static void ieee_init(struct ieee80211_device *ieee); |
34 | static void softmac_init(struct ieee80211softmac_device *sm); | 34 | static void softmac_init(struct ieee80211softmac_device *sm); |
35 | static void set_rts_cts_work(void *d); | 35 | static void set_rts_cts_work(struct work_struct *work); |
36 | static void set_basic_rates_work(void *d); | 36 | static void set_basic_rates_work(struct work_struct *work); |
37 | 37 | ||
38 | static void housekeeping_init(struct zd_mac *mac); | 38 | static void housekeeping_init(struct zd_mac *mac); |
39 | static void housekeeping_enable(struct zd_mac *mac); | 39 | static void housekeeping_enable(struct zd_mac *mac); |
@@ -48,8 +48,8 @@ int zd_mac_init(struct zd_mac *mac, | |||
48 | memset(mac, 0, sizeof(*mac)); | 48 | memset(mac, 0, sizeof(*mac)); |
49 | spin_lock_init(&mac->lock); | 49 | spin_lock_init(&mac->lock); |
50 | mac->netdev = netdev; | 50 | mac->netdev = netdev; |
51 | INIT_WORK(&mac->set_rts_cts_work, set_rts_cts_work, mac); | 51 | INIT_DELAYED_WORK(&mac->set_rts_cts_work, set_rts_cts_work); |
52 | INIT_WORK(&mac->set_basic_rates_work, set_basic_rates_work, mac); | 52 | INIT_DELAYED_WORK(&mac->set_basic_rates_work, set_basic_rates_work); |
53 | 53 | ||
54 | ieee_init(ieee); | 54 | ieee_init(ieee); |
55 | softmac_init(ieee80211_priv(netdev)); | 55 | softmac_init(ieee80211_priv(netdev)); |
@@ -366,9 +366,10 @@ static void try_enable_tx(struct zd_mac *mac) | |||
366 | spin_unlock_irqrestore(&mac->lock, flags); | 366 | spin_unlock_irqrestore(&mac->lock, flags); |
367 | } | 367 | } |
368 | 368 | ||
369 | static void set_rts_cts_work(void *d) | 369 | static void set_rts_cts_work(struct work_struct *work) |
370 | { | 370 | { |
371 | struct zd_mac *mac = d; | 371 | struct zd_mac *mac = |
372 | container_of(work, struct zd_mac, set_rts_cts_work.work); | ||
372 | unsigned long flags; | 373 | unsigned long flags; |
373 | u8 rts_rate; | 374 | u8 rts_rate; |
374 | unsigned int short_preamble; | 375 | unsigned int short_preamble; |
@@ -387,9 +388,10 @@ static void set_rts_cts_work(void *d) | |||
387 | try_enable_tx(mac); | 388 | try_enable_tx(mac); |
388 | } | 389 | } |
389 | 390 | ||
390 | static void set_basic_rates_work(void *d) | 391 | static void set_basic_rates_work(struct work_struct *work) |
391 | { | 392 | { |
392 | struct zd_mac *mac = d; | 393 | struct zd_mac *mac = |
394 | container_of(work, struct zd_mac, set_basic_rates_work.work); | ||
393 | unsigned long flags; | 395 | unsigned long flags; |
394 | u16 basic_rates; | 396 | u16 basic_rates; |
395 | 397 | ||
@@ -467,12 +469,13 @@ static void bssinfo_change(struct net_device *netdev, u32 changes) | |||
467 | if (need_set_rts_cts && !mac->updating_rts_rate) { | 469 | if (need_set_rts_cts && !mac->updating_rts_rate) { |
468 | mac->updating_rts_rate = 1; | 470 | mac->updating_rts_rate = 1; |
469 | netif_stop_queue(mac->netdev); | 471 | netif_stop_queue(mac->netdev); |
470 | queue_work(zd_workqueue, &mac->set_rts_cts_work); | 472 | queue_delayed_work(zd_workqueue, &mac->set_rts_cts_work, 0); |
471 | } | 473 | } |
472 | if (need_set_rates && !mac->updating_basic_rates) { | 474 | if (need_set_rates && !mac->updating_basic_rates) { |
473 | mac->updating_basic_rates = 1; | 475 | mac->updating_basic_rates = 1; |
474 | netif_stop_queue(mac->netdev); | 476 | netif_stop_queue(mac->netdev); |
475 | queue_work(zd_workqueue, &mac->set_basic_rates_work); | 477 | queue_delayed_work(zd_workqueue, &mac->set_basic_rates_work, |
478 | 0); | ||
476 | } | 479 | } |
477 | spin_unlock_irqrestore(&mac->lock, flags); | 480 | spin_unlock_irqrestore(&mac->lock, flags); |
478 | } | 481 | } |
@@ -1182,9 +1185,10 @@ struct iw_statistics *zd_mac_get_wireless_stats(struct net_device *ndev) | |||
1182 | 1185 | ||
1183 | #define LINK_LED_WORK_DELAY HZ | 1186 | #define LINK_LED_WORK_DELAY HZ |
1184 | 1187 | ||
1185 | static void link_led_handler(void *p) | 1188 | static void link_led_handler(struct work_struct *work) |
1186 | { | 1189 | { |
1187 | struct zd_mac *mac = p; | 1190 | struct zd_mac *mac = |
1191 | container_of(work, struct zd_mac, housekeeping.link_led_work.work); | ||
1188 | struct zd_chip *chip = &mac->chip; | 1192 | struct zd_chip *chip = &mac->chip; |
1189 | struct ieee80211softmac_device *sm = ieee80211_priv(mac->netdev); | 1193 | struct ieee80211softmac_device *sm = ieee80211_priv(mac->netdev); |
1190 | int is_associated; | 1194 | int is_associated; |
@@ -1205,7 +1209,7 @@ static void link_led_handler(void *p) | |||
1205 | 1209 | ||
1206 | static void housekeeping_init(struct zd_mac *mac) | 1210 | static void housekeeping_init(struct zd_mac *mac) |
1207 | { | 1211 | { |
1208 | INIT_WORK(&mac->housekeeping.link_led_work, link_led_handler, mac); | 1212 | INIT_DELAYED_WORK(&mac->housekeeping.link_led_work, link_led_handler); |
1209 | } | 1213 | } |
1210 | 1214 | ||
1211 | static void housekeeping_enable(struct zd_mac *mac) | 1215 | static void housekeeping_enable(struct zd_mac *mac) |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h index 5dcfb251f02e..d4e8b870409d 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.h +++ b/drivers/net/wireless/zd1211rw/zd_mac.h | |||
@@ -119,7 +119,7 @@ struct rx_status { | |||
119 | #define ZD_RX_ERROR 0x80 | 119 | #define ZD_RX_ERROR 0x80 |
120 | 120 | ||
121 | struct housekeeping { | 121 | struct housekeeping { |
122 | struct work_struct link_led_work; | 122 | struct delayed_work link_led_work; |
123 | }; | 123 | }; |
124 | 124 | ||
125 | #define ZD_MAC_STATS_BUFFER_SIZE 16 | 125 | #define ZD_MAC_STATS_BUFFER_SIZE 16 |
@@ -133,8 +133,8 @@ struct zd_mac { | |||
133 | struct iw_statistics iw_stats; | 133 | struct iw_statistics iw_stats; |
134 | 134 | ||
135 | struct housekeeping housekeeping; | 135 | struct housekeeping housekeeping; |
136 | struct work_struct set_rts_cts_work; | 136 | struct delayed_work set_rts_cts_work; |
137 | struct work_struct set_basic_rates_work; | 137 | struct delayed_work set_basic_rates_work; |
138 | 138 | ||
139 | unsigned int stats_count; | 139 | unsigned int stats_count; |
140 | u8 qual_buffer[ZD_MAC_STATS_BUFFER_SIZE]; | 140 | u8 qual_buffer[ZD_MAC_STATS_BUFFER_SIZE]; |