diff options
author | David Howells <dhowells@redhat.com> | 2006-12-05 14:36:26 -0500 |
---|---|---|
committer | David Howells <dhowells@warthog.cambridge.redhat.com> | 2006-12-05 14:36:26 -0500 |
commit | 6d5aefb8eaa38e44b5b8cf60c812aceafc02d924 (patch) | |
tree | 8945fd66a5f8a32f4daecf9799635ec5d7f86348 /drivers/net | |
parent | 9db73724453a9350e1c22dbe732d427e2939a5c9 (diff) |
WorkQueue: Fix up arch-specific work items where possible
Fix up arch-specific work items where possible to use the new work_struct and
delayed_work structs.
Three places that enqueue bits of their stack and then return have been marked
with #error as this is not permitted.
Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/chelsio/cphy.h | 2 | ||||
-rw-r--r-- | drivers/net/chelsio/my3126.c | 8 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 3 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 5 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 19 | ||||
-rw-r--r-- | drivers/net/smc91x.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.h | 4 |
8 files changed, 45 insertions, 34 deletions
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/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/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/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/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 44f3cfd4cc1d..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 | } |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h index 08d6b8c08e75..d4e8b870409d 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.h +++ b/drivers/net/wireless/zd1211rw/zd_mac.h | |||
@@ -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]; |