diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-26 06:12:50 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-01-26 06:12:50 -0500 |
commit | bcb6d9161d1720cf68c7f4de0630e91cb95ee60c (patch) | |
tree | a4cd99ac0f3e4372687440b29d4a279abf0691c8 /drivers/net/wireless/ipw2x00/ipw2200.c | |
parent | c48730056f69db30c075236f4ee2bc9d3f4f9985 (diff) |
wireless/ipw2x00: use system_wq instead of dedicated workqueues
With cmwq, there's no reason to use separate workqueues in ipw2x00
drivers. Drop them and use system_wq instead. All used work items
are sync canceled on driver detach.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Diffstat (limited to 'drivers/net/wireless/ipw2x00/ipw2200.c')
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 196 |
1 files changed, 88 insertions, 108 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index ae438ed80c2f..160881f234cc 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -894,9 +894,8 @@ static void ipw_led_link_on(struct ipw_priv *priv) | |||
894 | 894 | ||
895 | /* If we aren't associated, schedule turning the LED off */ | 895 | /* If we aren't associated, schedule turning the LED off */ |
896 | if (!(priv->status & STATUS_ASSOCIATED)) | 896 | if (!(priv->status & STATUS_ASSOCIATED)) |
897 | queue_delayed_work(priv->workqueue, | 897 | schedule_delayed_work(&priv->led_link_off, |
898 | &priv->led_link_off, | 898 | LD_TIME_LINK_ON); |
899 | LD_TIME_LINK_ON); | ||
900 | } | 899 | } |
901 | 900 | ||
902 | spin_unlock_irqrestore(&priv->lock, flags); | 901 | spin_unlock_irqrestore(&priv->lock, flags); |
@@ -939,8 +938,8 @@ static void ipw_led_link_off(struct ipw_priv *priv) | |||
939 | * turning the LED on (blink while unassociated) */ | 938 | * turning the LED on (blink while unassociated) */ |
940 | if (!(priv->status & STATUS_RF_KILL_MASK) && | 939 | if (!(priv->status & STATUS_RF_KILL_MASK) && |
941 | !(priv->status & STATUS_ASSOCIATED)) | 940 | !(priv->status & STATUS_ASSOCIATED)) |
942 | queue_delayed_work(priv->workqueue, &priv->led_link_on, | 941 | schedule_delayed_work(&priv->led_link_on, |
943 | LD_TIME_LINK_OFF); | 942 | LD_TIME_LINK_OFF); |
944 | 943 | ||
945 | } | 944 | } |
946 | 945 | ||
@@ -980,13 +979,11 @@ static void __ipw_led_activity_on(struct ipw_priv *priv) | |||
980 | priv->status |= STATUS_LED_ACT_ON; | 979 | priv->status |= STATUS_LED_ACT_ON; |
981 | 980 | ||
982 | cancel_delayed_work(&priv->led_act_off); | 981 | cancel_delayed_work(&priv->led_act_off); |
983 | queue_delayed_work(priv->workqueue, &priv->led_act_off, | 982 | schedule_delayed_work(&priv->led_act_off, LD_TIME_ACT_ON); |
984 | LD_TIME_ACT_ON); | ||
985 | } else { | 983 | } else { |
986 | /* Reschedule LED off for full time period */ | 984 | /* Reschedule LED off for full time period */ |
987 | cancel_delayed_work(&priv->led_act_off); | 985 | cancel_delayed_work(&priv->led_act_off); |
988 | queue_delayed_work(priv->workqueue, &priv->led_act_off, | 986 | schedule_delayed_work(&priv->led_act_off, LD_TIME_ACT_ON); |
989 | LD_TIME_ACT_ON); | ||
990 | } | 987 | } |
991 | } | 988 | } |
992 | 989 | ||
@@ -1795,13 +1792,11 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio) | |||
1795 | if (disable_radio) { | 1792 | if (disable_radio) { |
1796 | priv->status |= STATUS_RF_KILL_SW; | 1793 | priv->status |= STATUS_RF_KILL_SW; |
1797 | 1794 | ||
1798 | if (priv->workqueue) { | 1795 | cancel_delayed_work(&priv->request_scan); |
1799 | cancel_delayed_work(&priv->request_scan); | 1796 | cancel_delayed_work(&priv->request_direct_scan); |
1800 | cancel_delayed_work(&priv->request_direct_scan); | 1797 | cancel_delayed_work(&priv->request_passive_scan); |
1801 | cancel_delayed_work(&priv->request_passive_scan); | 1798 | cancel_delayed_work(&priv->scan_event); |
1802 | cancel_delayed_work(&priv->scan_event); | 1799 | schedule_work(&priv->down); |
1803 | } | ||
1804 | queue_work(priv->workqueue, &priv->down); | ||
1805 | } else { | 1800 | } else { |
1806 | priv->status &= ~STATUS_RF_KILL_SW; | 1801 | priv->status &= ~STATUS_RF_KILL_SW; |
1807 | if (rf_kill_active(priv)) { | 1802 | if (rf_kill_active(priv)) { |
@@ -1809,10 +1804,10 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio) | |||
1809 | "disabled by HW switch\n"); | 1804 | "disabled by HW switch\n"); |
1810 | /* Make sure the RF_KILL check timer is running */ | 1805 | /* Make sure the RF_KILL check timer is running */ |
1811 | cancel_delayed_work(&priv->rf_kill); | 1806 | cancel_delayed_work(&priv->rf_kill); |
1812 | queue_delayed_work(priv->workqueue, &priv->rf_kill, | 1807 | schedule_delayed_work(&priv->rf_kill, |
1813 | round_jiffies_relative(2 * HZ)); | 1808 | round_jiffies_relative(2 * HZ)); |
1814 | } else | 1809 | } else |
1815 | queue_work(priv->workqueue, &priv->up); | 1810 | schedule_work(&priv->up); |
1816 | } | 1811 | } |
1817 | 1812 | ||
1818 | return 1; | 1813 | return 1; |
@@ -2063,7 +2058,7 @@ static void ipw_irq_tasklet(struct ipw_priv *priv) | |||
2063 | cancel_delayed_work(&priv->request_passive_scan); | 2058 | cancel_delayed_work(&priv->request_passive_scan); |
2064 | cancel_delayed_work(&priv->scan_event); | 2059 | cancel_delayed_work(&priv->scan_event); |
2065 | schedule_work(&priv->link_down); | 2060 | schedule_work(&priv->link_down); |
2066 | queue_delayed_work(priv->workqueue, &priv->rf_kill, 2 * HZ); | 2061 | schedule_delayed_work(&priv->rf_kill, 2 * HZ); |
2067 | handled |= IPW_INTA_BIT_RF_KILL_DONE; | 2062 | handled |= IPW_INTA_BIT_RF_KILL_DONE; |
2068 | } | 2063 | } |
2069 | 2064 | ||
@@ -2103,7 +2098,7 @@ static void ipw_irq_tasklet(struct ipw_priv *priv) | |||
2103 | priv->status &= ~STATUS_HCMD_ACTIVE; | 2098 | priv->status &= ~STATUS_HCMD_ACTIVE; |
2104 | wake_up_interruptible(&priv->wait_command_queue); | 2099 | wake_up_interruptible(&priv->wait_command_queue); |
2105 | 2100 | ||
2106 | queue_work(priv->workqueue, &priv->adapter_restart); | 2101 | schedule_work(&priv->adapter_restart); |
2107 | handled |= IPW_INTA_BIT_FATAL_ERROR; | 2102 | handled |= IPW_INTA_BIT_FATAL_ERROR; |
2108 | } | 2103 | } |
2109 | 2104 | ||
@@ -2323,11 +2318,6 @@ static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac) | |||
2323 | return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac); | 2318 | return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac); |
2324 | } | 2319 | } |
2325 | 2320 | ||
2326 | /* | ||
2327 | * NOTE: This must be executed from our workqueue as it results in udelay | ||
2328 | * being called which may corrupt the keyboard if executed on default | ||
2329 | * workqueue | ||
2330 | */ | ||
2331 | static void ipw_adapter_restart(void *adapter) | 2321 | static void ipw_adapter_restart(void *adapter) |
2332 | { | 2322 | { |
2333 | struct ipw_priv *priv = adapter; | 2323 | struct ipw_priv *priv = adapter; |
@@ -2368,13 +2358,13 @@ static void ipw_scan_check(void *data) | |||
2368 | IPW_DEBUG_SCAN("Scan completion watchdog resetting " | 2358 | IPW_DEBUG_SCAN("Scan completion watchdog resetting " |
2369 | "adapter after (%dms).\n", | 2359 | "adapter after (%dms).\n", |
2370 | jiffies_to_msecs(IPW_SCAN_CHECK_WATCHDOG)); | 2360 | jiffies_to_msecs(IPW_SCAN_CHECK_WATCHDOG)); |
2371 | queue_work(priv->workqueue, &priv->adapter_restart); | 2361 | schedule_work(&priv->adapter_restart); |
2372 | } else if (priv->status & STATUS_SCANNING) { | 2362 | } else if (priv->status & STATUS_SCANNING) { |
2373 | IPW_DEBUG_SCAN("Scan completion watchdog aborting scan " | 2363 | IPW_DEBUG_SCAN("Scan completion watchdog aborting scan " |
2374 | "after (%dms).\n", | 2364 | "after (%dms).\n", |
2375 | jiffies_to_msecs(IPW_SCAN_CHECK_WATCHDOG)); | 2365 | jiffies_to_msecs(IPW_SCAN_CHECK_WATCHDOG)); |
2376 | ipw_abort_scan(priv); | 2366 | ipw_abort_scan(priv); |
2377 | queue_delayed_work(priv->workqueue, &priv->scan_check, HZ); | 2367 | schedule_delayed_work(&priv->scan_check, HZ); |
2378 | } | 2368 | } |
2379 | } | 2369 | } |
2380 | 2370 | ||
@@ -3943,7 +3933,7 @@ static void ipw_send_disassociate(struct ipw_priv *priv, int quiet) | |||
3943 | 3933 | ||
3944 | if (priv->status & STATUS_ASSOCIATING) { | 3934 | if (priv->status & STATUS_ASSOCIATING) { |
3945 | IPW_DEBUG_ASSOC("Disassociating while associating.\n"); | 3935 | IPW_DEBUG_ASSOC("Disassociating while associating.\n"); |
3946 | queue_work(priv->workqueue, &priv->disassociate); | 3936 | schedule_work(&priv->disassociate); |
3947 | return; | 3937 | return; |
3948 | } | 3938 | } |
3949 | 3939 | ||
@@ -4360,8 +4350,7 @@ static void ipw_gather_stats(struct ipw_priv *priv) | |||
4360 | 4350 | ||
4361 | priv->quality = quality; | 4351 | priv->quality = quality; |
4362 | 4352 | ||
4363 | queue_delayed_work(priv->workqueue, &priv->gather_stats, | 4353 | schedule_delayed_work(&priv->gather_stats, IPW_STATS_INTERVAL); |
4364 | IPW_STATS_INTERVAL); | ||
4365 | } | 4354 | } |
4366 | 4355 | ||
4367 | static void ipw_bg_gather_stats(struct work_struct *work) | 4356 | static void ipw_bg_gather_stats(struct work_struct *work) |
@@ -4396,10 +4385,10 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv, | |||
4396 | IPW_DEBUG(IPW_DL_INFO | IPW_DL_NOTIF | | 4385 | IPW_DEBUG(IPW_DL_INFO | IPW_DL_NOTIF | |
4397 | IPW_DL_STATE, | 4386 | IPW_DL_STATE, |
4398 | "Aborting scan with missed beacon.\n"); | 4387 | "Aborting scan with missed beacon.\n"); |
4399 | queue_work(priv->workqueue, &priv->abort_scan); | 4388 | schedule_work(&priv->abort_scan); |
4400 | } | 4389 | } |
4401 | 4390 | ||
4402 | queue_work(priv->workqueue, &priv->disassociate); | 4391 | schedule_work(&priv->disassociate); |
4403 | return; | 4392 | return; |
4404 | } | 4393 | } |
4405 | 4394 | ||
@@ -4425,8 +4414,7 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv, | |||
4425 | if (!(priv->status & STATUS_ROAMING)) { | 4414 | if (!(priv->status & STATUS_ROAMING)) { |
4426 | priv->status |= STATUS_ROAMING; | 4415 | priv->status |= STATUS_ROAMING; |
4427 | if (!(priv->status & STATUS_SCANNING)) | 4416 | if (!(priv->status & STATUS_SCANNING)) |
4428 | queue_delayed_work(priv->workqueue, | 4417 | schedule_delayed_work(&priv->request_scan, 0); |
4429 | &priv->request_scan, 0); | ||
4430 | } | 4418 | } |
4431 | return; | 4419 | return; |
4432 | } | 4420 | } |
@@ -4439,7 +4427,7 @@ static void ipw_handle_missed_beacon(struct ipw_priv *priv, | |||
4439 | * channels..) */ | 4427 | * channels..) */ |
4440 | IPW_DEBUG(IPW_DL_INFO | IPW_DL_NOTIF | IPW_DL_STATE, | 4428 | IPW_DEBUG(IPW_DL_INFO | IPW_DL_NOTIF | IPW_DL_STATE, |
4441 | "Aborting scan with missed beacon.\n"); | 4429 | "Aborting scan with missed beacon.\n"); |
4442 | queue_work(priv->workqueue, &priv->abort_scan); | 4430 | schedule_work(&priv->abort_scan); |
4443 | } | 4431 | } |
4444 | 4432 | ||
4445 | IPW_DEBUG_NOTIF("Missed beacon: %d\n", missed_count); | 4433 | IPW_DEBUG_NOTIF("Missed beacon: %d\n", missed_count); |
@@ -4462,8 +4450,8 @@ static void handle_scan_event(struct ipw_priv *priv) | |||
4462 | /* Only userspace-requested scan completion events go out immediately */ | 4450 | /* Only userspace-requested scan completion events go out immediately */ |
4463 | if (!priv->user_requested_scan) { | 4451 | if (!priv->user_requested_scan) { |
4464 | if (!delayed_work_pending(&priv->scan_event)) | 4452 | if (!delayed_work_pending(&priv->scan_event)) |
4465 | queue_delayed_work(priv->workqueue, &priv->scan_event, | 4453 | schedule_delayed_work(&priv->scan_event, |
4466 | round_jiffies_relative(msecs_to_jiffies(4000))); | 4454 | round_jiffies_relative(msecs_to_jiffies(4000))); |
4467 | } else { | 4455 | } else { |
4468 | union iwreq_data wrqu; | 4456 | union iwreq_data wrqu; |
4469 | 4457 | ||
@@ -4516,20 +4504,17 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4516 | 4504 | ||
4517 | IPW_DEBUG_ASSOC | 4505 | IPW_DEBUG_ASSOC |
4518 | ("queueing adhoc check\n"); | 4506 | ("queueing adhoc check\n"); |
4519 | queue_delayed_work(priv-> | 4507 | schedule_delayed_work( |
4520 | workqueue, | 4508 | &priv->adhoc_check, |
4521 | &priv-> | 4509 | le16_to_cpu(priv-> |
4522 | adhoc_check, | 4510 | assoc_request. |
4523 | le16_to_cpu(priv-> | 4511 | beacon_interval)); |
4524 | assoc_request. | ||
4525 | beacon_interval)); | ||
4526 | break; | 4512 | break; |
4527 | } | 4513 | } |
4528 | 4514 | ||
4529 | priv->status &= ~STATUS_ASSOCIATING; | 4515 | priv->status &= ~STATUS_ASSOCIATING; |
4530 | priv->status |= STATUS_ASSOCIATED; | 4516 | priv->status |= STATUS_ASSOCIATED; |
4531 | queue_work(priv->workqueue, | 4517 | schedule_work(&priv->system_config); |
4532 | &priv->system_config); | ||
4533 | 4518 | ||
4534 | #ifdef CONFIG_IPW2200_QOS | 4519 | #ifdef CONFIG_IPW2200_QOS |
4535 | #define IPW_GET_PACKET_STYPE(x) WLAN_FC_GET_STYPE( \ | 4520 | #define IPW_GET_PACKET_STYPE(x) WLAN_FC_GET_STYPE( \ |
@@ -4792,43 +4777,37 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4792 | #ifdef CONFIG_IPW2200_MONITOR | 4777 | #ifdef CONFIG_IPW2200_MONITOR |
4793 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { | 4778 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { |
4794 | priv->status |= STATUS_SCAN_FORCED; | 4779 | priv->status |= STATUS_SCAN_FORCED; |
4795 | queue_delayed_work(priv->workqueue, | 4780 | schedule_delayed_work(&priv->request_scan, 0); |
4796 | &priv->request_scan, 0); | ||
4797 | break; | 4781 | break; |
4798 | } | 4782 | } |
4799 | priv->status &= ~STATUS_SCAN_FORCED; | 4783 | priv->status &= ~STATUS_SCAN_FORCED; |
4800 | #endif /* CONFIG_IPW2200_MONITOR */ | 4784 | #endif /* CONFIG_IPW2200_MONITOR */ |
4801 | 4785 | ||
4802 | /* Do queued direct scans first */ | 4786 | /* Do queued direct scans first */ |
4803 | if (priv->status & STATUS_DIRECT_SCAN_PENDING) { | 4787 | if (priv->status & STATUS_DIRECT_SCAN_PENDING) |
4804 | queue_delayed_work(priv->workqueue, | 4788 | schedule_delayed_work(&priv->request_direct_scan, 0); |
4805 | &priv->request_direct_scan, 0); | ||
4806 | } | ||
4807 | 4789 | ||
4808 | if (!(priv->status & (STATUS_ASSOCIATED | | 4790 | if (!(priv->status & (STATUS_ASSOCIATED | |
4809 | STATUS_ASSOCIATING | | 4791 | STATUS_ASSOCIATING | |
4810 | STATUS_ROAMING | | 4792 | STATUS_ROAMING | |
4811 | STATUS_DISASSOCIATING))) | 4793 | STATUS_DISASSOCIATING))) |
4812 | queue_work(priv->workqueue, &priv->associate); | 4794 | schedule_work(&priv->associate); |
4813 | else if (priv->status & STATUS_ROAMING) { | 4795 | else if (priv->status & STATUS_ROAMING) { |
4814 | if (x->status == SCAN_COMPLETED_STATUS_COMPLETE) | 4796 | if (x->status == SCAN_COMPLETED_STATUS_COMPLETE) |
4815 | /* If a scan completed and we are in roam mode, then | 4797 | /* If a scan completed and we are in roam mode, then |
4816 | * the scan that completed was the one requested as a | 4798 | * the scan that completed was the one requested as a |
4817 | * result of entering roam... so, schedule the | 4799 | * result of entering roam... so, schedule the |
4818 | * roam work */ | 4800 | * roam work */ |
4819 | queue_work(priv->workqueue, | 4801 | schedule_work(&priv->roam); |
4820 | &priv->roam); | ||
4821 | else | 4802 | else |
4822 | /* Don't schedule if we aborted the scan */ | 4803 | /* Don't schedule if we aborted the scan */ |
4823 | priv->status &= ~STATUS_ROAMING; | 4804 | priv->status &= ~STATUS_ROAMING; |
4824 | } else if (priv->status & STATUS_SCAN_PENDING) | 4805 | } else if (priv->status & STATUS_SCAN_PENDING) |
4825 | queue_delayed_work(priv->workqueue, | 4806 | schedule_delayed_work(&priv->request_scan, 0); |
4826 | &priv->request_scan, 0); | ||
4827 | else if (priv->config & CFG_BACKGROUND_SCAN | 4807 | else if (priv->config & CFG_BACKGROUND_SCAN |
4828 | && priv->status & STATUS_ASSOCIATED) | 4808 | && priv->status & STATUS_ASSOCIATED) |
4829 | queue_delayed_work(priv->workqueue, | 4809 | schedule_delayed_work(&priv->request_scan, |
4830 | &priv->request_scan, | 4810 | round_jiffies_relative(HZ)); |
4831 | round_jiffies_relative(HZ)); | ||
4832 | 4811 | ||
4833 | /* Send an empty event to user space. | 4812 | /* Send an empty event to user space. |
4834 | * We don't send the received data on the event because | 4813 | * We don't send the received data on the event because |
@@ -5192,7 +5171,7 @@ static void ipw_rx_queue_restock(struct ipw_priv *priv) | |||
5192 | /* If the pre-allocated buffer pool is dropping low, schedule to | 5171 | /* If the pre-allocated buffer pool is dropping low, schedule to |
5193 | * refill it */ | 5172 | * refill it */ |
5194 | if (rxq->free_count <= RX_LOW_WATERMARK) | 5173 | if (rxq->free_count <= RX_LOW_WATERMARK) |
5195 | queue_work(priv->workqueue, &priv->rx_replenish); | 5174 | schedule_work(&priv->rx_replenish); |
5196 | 5175 | ||
5197 | /* If we've added more space for the firmware to place data, tell it */ | 5176 | /* If we've added more space for the firmware to place data, tell it */ |
5198 | if (write != rxq->write) | 5177 | if (write != rxq->write) |
@@ -6133,8 +6112,8 @@ static void ipw_adhoc_check(void *data) | |||
6133 | return; | 6112 | return; |
6134 | } | 6113 | } |
6135 | 6114 | ||
6136 | queue_delayed_work(priv->workqueue, &priv->adhoc_check, | 6115 | schedule_delayed_work(&priv->adhoc_check, |
6137 | le16_to_cpu(priv->assoc_request.beacon_interval)); | 6116 | le16_to_cpu(priv->assoc_request.beacon_interval)); |
6138 | } | 6117 | } |
6139 | 6118 | ||
6140 | static void ipw_bg_adhoc_check(struct work_struct *work) | 6119 | static void ipw_bg_adhoc_check(struct work_struct *work) |
@@ -6523,8 +6502,7 @@ send_request: | |||
6523 | } else | 6502 | } else |
6524 | priv->status &= ~STATUS_SCAN_PENDING; | 6503 | priv->status &= ~STATUS_SCAN_PENDING; |
6525 | 6504 | ||
6526 | queue_delayed_work(priv->workqueue, &priv->scan_check, | 6505 | schedule_delayed_work(&priv->scan_check, IPW_SCAN_CHECK_WATCHDOG); |
6527 | IPW_SCAN_CHECK_WATCHDOG); | ||
6528 | done: | 6506 | done: |
6529 | mutex_unlock(&priv->mutex); | 6507 | mutex_unlock(&priv->mutex); |
6530 | return err; | 6508 | return err; |
@@ -6994,8 +6972,7 @@ static int ipw_qos_handle_probe_response(struct ipw_priv *priv, | |||
6994 | !memcmp(network->ssid, | 6972 | !memcmp(network->ssid, |
6995 | priv->assoc_network->ssid, | 6973 | priv->assoc_network->ssid, |
6996 | network->ssid_len)) { | 6974 | network->ssid_len)) { |
6997 | queue_work(priv->workqueue, | 6975 | schedule_work(&priv->merge_networks); |
6998 | &priv->merge_networks); | ||
6999 | } | 6976 | } |
7000 | } | 6977 | } |
7001 | 6978 | ||
@@ -7663,7 +7640,7 @@ static int ipw_associate(void *data) | |||
7663 | if (priv->status & STATUS_DISASSOCIATING) { | 7640 | if (priv->status & STATUS_DISASSOCIATING) { |
7664 | IPW_DEBUG_ASSOC("Not attempting association (in " | 7641 | IPW_DEBUG_ASSOC("Not attempting association (in " |
7665 | "disassociating)\n "); | 7642 | "disassociating)\n "); |
7666 | queue_work(priv->workqueue, &priv->associate); | 7643 | schedule_work(&priv->associate); |
7667 | return 0; | 7644 | return 0; |
7668 | } | 7645 | } |
7669 | 7646 | ||
@@ -7731,12 +7708,10 @@ static int ipw_associate(void *data) | |||
7731 | 7708 | ||
7732 | if (!(priv->status & STATUS_SCANNING)) { | 7709 | if (!(priv->status & STATUS_SCANNING)) { |
7733 | if (!(priv->config & CFG_SPEED_SCAN)) | 7710 | if (!(priv->config & CFG_SPEED_SCAN)) |
7734 | queue_delayed_work(priv->workqueue, | 7711 | schedule_delayed_work(&priv->request_scan, |
7735 | &priv->request_scan, | 7712 | SCAN_INTERVAL); |
7736 | SCAN_INTERVAL); | ||
7737 | else | 7713 | else |
7738 | queue_delayed_work(priv->workqueue, | 7714 | schedule_delayed_work(&priv->request_scan, 0); |
7739 | &priv->request_scan, 0); | ||
7740 | } | 7715 | } |
7741 | 7716 | ||
7742 | return 0; | 7717 | return 0; |
@@ -8899,7 +8874,7 @@ static int ipw_wx_set_mode(struct net_device *dev, | |||
8899 | 8874 | ||
8900 | priv->ieee->iw_mode = wrqu->mode; | 8875 | priv->ieee->iw_mode = wrqu->mode; |
8901 | 8876 | ||
8902 | queue_work(priv->workqueue, &priv->adapter_restart); | 8877 | schedule_work(&priv->adapter_restart); |
8903 | mutex_unlock(&priv->mutex); | 8878 | mutex_unlock(&priv->mutex); |
8904 | return err; | 8879 | return err; |
8905 | } | 8880 | } |
@@ -9598,7 +9573,7 @@ static int ipw_wx_set_scan(struct net_device *dev, | |||
9598 | 9573 | ||
9599 | IPW_DEBUG_WX("Start scan\n"); | 9574 | IPW_DEBUG_WX("Start scan\n"); |
9600 | 9575 | ||
9601 | queue_delayed_work(priv->workqueue, work, 0); | 9576 | schedule_delayed_work(work, 0); |
9602 | 9577 | ||
9603 | return 0; | 9578 | return 0; |
9604 | } | 9579 | } |
@@ -9937,7 +9912,7 @@ static int ipw_wx_set_monitor(struct net_device *dev, | |||
9937 | #else | 9912 | #else |
9938 | priv->net_dev->type = ARPHRD_IEEE80211; | 9913 | priv->net_dev->type = ARPHRD_IEEE80211; |
9939 | #endif | 9914 | #endif |
9940 | queue_work(priv->workqueue, &priv->adapter_restart); | 9915 | schedule_work(&priv->adapter_restart); |
9941 | } | 9916 | } |
9942 | 9917 | ||
9943 | ipw_set_channel(priv, parms[1]); | 9918 | ipw_set_channel(priv, parms[1]); |
@@ -9947,7 +9922,7 @@ static int ipw_wx_set_monitor(struct net_device *dev, | |||
9947 | return 0; | 9922 | return 0; |
9948 | } | 9923 | } |
9949 | priv->net_dev->type = ARPHRD_ETHER; | 9924 | priv->net_dev->type = ARPHRD_ETHER; |
9950 | queue_work(priv->workqueue, &priv->adapter_restart); | 9925 | schedule_work(&priv->adapter_restart); |
9951 | } | 9926 | } |
9952 | mutex_unlock(&priv->mutex); | 9927 | mutex_unlock(&priv->mutex); |
9953 | return 0; | 9928 | return 0; |
@@ -9961,7 +9936,7 @@ static int ipw_wx_reset(struct net_device *dev, | |||
9961 | { | 9936 | { |
9962 | struct ipw_priv *priv = libipw_priv(dev); | 9937 | struct ipw_priv *priv = libipw_priv(dev); |
9963 | IPW_DEBUG_WX("RESET\n"); | 9938 | IPW_DEBUG_WX("RESET\n"); |
9964 | queue_work(priv->workqueue, &priv->adapter_restart); | 9939 | schedule_work(&priv->adapter_restart); |
9965 | return 0; | 9940 | return 0; |
9966 | } | 9941 | } |
9967 | 9942 | ||
@@ -10551,7 +10526,7 @@ static int ipw_net_set_mac_address(struct net_device *dev, void *p) | |||
10551 | memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); | 10526 | memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); |
10552 | printk(KERN_INFO "%s: Setting MAC to %pM\n", | 10527 | printk(KERN_INFO "%s: Setting MAC to %pM\n", |
10553 | priv->net_dev->name, priv->mac_addr); | 10528 | priv->net_dev->name, priv->mac_addr); |
10554 | queue_work(priv->workqueue, &priv->adapter_restart); | 10529 | schedule_work(&priv->adapter_restart); |
10555 | mutex_unlock(&priv->mutex); | 10530 | mutex_unlock(&priv->mutex); |
10556 | return 0; | 10531 | return 0; |
10557 | } | 10532 | } |
@@ -10684,9 +10659,7 @@ static void ipw_rf_kill(void *adapter) | |||
10684 | 10659 | ||
10685 | if (rf_kill_active(priv)) { | 10660 | if (rf_kill_active(priv)) { |
10686 | IPW_DEBUG_RF_KILL("RF Kill active, rescheduling GPIO check\n"); | 10661 | IPW_DEBUG_RF_KILL("RF Kill active, rescheduling GPIO check\n"); |
10687 | if (priv->workqueue) | 10662 | schedule_delayed_work(&priv->rf_kill, 2 * HZ); |
10688 | queue_delayed_work(priv->workqueue, | ||
10689 | &priv->rf_kill, 2 * HZ); | ||
10690 | goto exit_unlock; | 10663 | goto exit_unlock; |
10691 | } | 10664 | } |
10692 | 10665 | ||
@@ -10697,7 +10670,7 @@ static void ipw_rf_kill(void *adapter) | |||
10697 | "device\n"); | 10670 | "device\n"); |
10698 | 10671 | ||
10699 | /* we can not do an adapter restart while inside an irq lock */ | 10672 | /* we can not do an adapter restart while inside an irq lock */ |
10700 | queue_work(priv->workqueue, &priv->adapter_restart); | 10673 | schedule_work(&priv->adapter_restart); |
10701 | } else | 10674 | } else |
10702 | IPW_DEBUG_RF_KILL("HW RF Kill deactivated. SW RF Kill still " | 10675 | IPW_DEBUG_RF_KILL("HW RF Kill deactivated. SW RF Kill still " |
10703 | "enabled\n"); | 10676 | "enabled\n"); |
@@ -10735,7 +10708,7 @@ static void ipw_link_up(struct ipw_priv *priv) | |||
10735 | notify_wx_assoc_event(priv); | 10708 | notify_wx_assoc_event(priv); |
10736 | 10709 | ||
10737 | if (priv->config & CFG_BACKGROUND_SCAN) | 10710 | if (priv->config & CFG_BACKGROUND_SCAN) |
10738 | queue_delayed_work(priv->workqueue, &priv->request_scan, HZ); | 10711 | schedule_delayed_work(&priv->request_scan, HZ); |
10739 | } | 10712 | } |
10740 | 10713 | ||
10741 | static void ipw_bg_link_up(struct work_struct *work) | 10714 | static void ipw_bg_link_up(struct work_struct *work) |
@@ -10764,7 +10737,7 @@ static void ipw_link_down(struct ipw_priv *priv) | |||
10764 | 10737 | ||
10765 | if (!(priv->status & STATUS_EXIT_PENDING)) { | 10738 | if (!(priv->status & STATUS_EXIT_PENDING)) { |
10766 | /* Queue up another scan... */ | 10739 | /* Queue up another scan... */ |
10767 | queue_delayed_work(priv->workqueue, &priv->request_scan, 0); | 10740 | schedule_delayed_work(&priv->request_scan, 0); |
10768 | } else | 10741 | } else |
10769 | cancel_delayed_work(&priv->scan_event); | 10742 | cancel_delayed_work(&priv->scan_event); |
10770 | } | 10743 | } |
@@ -10782,7 +10755,6 @@ static int __devinit ipw_setup_deferred_work(struct ipw_priv *priv) | |||
10782 | { | 10755 | { |
10783 | int ret = 0; | 10756 | int ret = 0; |
10784 | 10757 | ||
10785 | priv->workqueue = create_workqueue(DRV_NAME); | ||
10786 | init_waitqueue_head(&priv->wait_command_queue); | 10758 | init_waitqueue_head(&priv->wait_command_queue); |
10787 | init_waitqueue_head(&priv->wait_state); | 10759 | init_waitqueue_head(&priv->wait_state); |
10788 | 10760 | ||
@@ -11339,8 +11311,7 @@ static int ipw_up(struct ipw_priv *priv) | |||
11339 | IPW_WARNING("Radio Frequency Kill Switch is On:\n" | 11311 | IPW_WARNING("Radio Frequency Kill Switch is On:\n" |
11340 | "Kill switch must be turned off for " | 11312 | "Kill switch must be turned off for " |
11341 | "wireless networking to work.\n"); | 11313 | "wireless networking to work.\n"); |
11342 | queue_delayed_work(priv->workqueue, &priv->rf_kill, | 11314 | schedule_delayed_work(&priv->rf_kill, 2 * HZ); |
11343 | 2 * HZ); | ||
11344 | return 0; | 11315 | return 0; |
11345 | } | 11316 | } |
11346 | 11317 | ||
@@ -11350,8 +11321,7 @@ static int ipw_up(struct ipw_priv *priv) | |||
11350 | 11321 | ||
11351 | /* If configure to try and auto-associate, kick | 11322 | /* If configure to try and auto-associate, kick |
11352 | * off a scan. */ | 11323 | * off a scan. */ |
11353 | queue_delayed_work(priv->workqueue, | 11324 | schedule_delayed_work(&priv->request_scan, 0); |
11354 | &priv->request_scan, 0); | ||
11355 | 11325 | ||
11356 | return 0; | 11326 | return 0; |
11357 | } | 11327 | } |
@@ -11817,7 +11787,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11817 | err = request_irq(pdev->irq, ipw_isr, IRQF_SHARED, DRV_NAME, priv); | 11787 | err = request_irq(pdev->irq, ipw_isr, IRQF_SHARED, DRV_NAME, priv); |
11818 | if (err) { | 11788 | if (err) { |
11819 | IPW_ERROR("Error allocating IRQ %d\n", pdev->irq); | 11789 | IPW_ERROR("Error allocating IRQ %d\n", pdev->irq); |
11820 | goto out_destroy_workqueue; | 11790 | goto out_iounmap; |
11821 | } | 11791 | } |
11822 | 11792 | ||
11823 | SET_NETDEV_DEV(net_dev, &pdev->dev); | 11793 | SET_NETDEV_DEV(net_dev, &pdev->dev); |
@@ -11885,9 +11855,6 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11885 | sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); | 11855 | sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); |
11886 | out_release_irq: | 11856 | out_release_irq: |
11887 | free_irq(pdev->irq, priv); | 11857 | free_irq(pdev->irq, priv); |
11888 | out_destroy_workqueue: | ||
11889 | destroy_workqueue(priv->workqueue); | ||
11890 | priv->workqueue = NULL; | ||
11891 | out_iounmap: | 11858 | out_iounmap: |
11892 | iounmap(priv->hw_base); | 11859 | iounmap(priv->hw_base); |
11893 | out_pci_release_regions: | 11860 | out_pci_release_regions: |
@@ -11930,18 +11897,31 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev) | |||
11930 | kfree(priv->cmdlog); | 11897 | kfree(priv->cmdlog); |
11931 | priv->cmdlog = NULL; | 11898 | priv->cmdlog = NULL; |
11932 | } | 11899 | } |
11933 | /* ipw_down will ensure that there is no more pending work | 11900 | |
11934 | * in the workqueue's, so we can safely remove them now. */ | 11901 | /* make sure all works are inactive */ |
11935 | cancel_delayed_work(&priv->adhoc_check); | 11902 | cancel_delayed_work_sync(&priv->adhoc_check); |
11936 | cancel_delayed_work(&priv->gather_stats); | 11903 | cancel_work_sync(&priv->associate); |
11937 | cancel_delayed_work(&priv->request_scan); | 11904 | cancel_work_sync(&priv->disassociate); |
11938 | cancel_delayed_work(&priv->request_direct_scan); | 11905 | cancel_work_sync(&priv->system_config); |
11939 | cancel_delayed_work(&priv->request_passive_scan); | 11906 | cancel_work_sync(&priv->rx_replenish); |
11940 | cancel_delayed_work(&priv->scan_event); | 11907 | cancel_work_sync(&priv->adapter_restart); |
11941 | cancel_delayed_work(&priv->rf_kill); | 11908 | cancel_delayed_work_sync(&priv->rf_kill); |
11942 | cancel_delayed_work(&priv->scan_check); | 11909 | cancel_work_sync(&priv->up); |
11943 | destroy_workqueue(priv->workqueue); | 11910 | cancel_work_sync(&priv->down); |
11944 | priv->workqueue = NULL; | 11911 | cancel_delayed_work_sync(&priv->request_scan); |
11912 | cancel_delayed_work_sync(&priv->request_direct_scan); | ||
11913 | cancel_delayed_work_sync(&priv->request_passive_scan); | ||
11914 | cancel_delayed_work_sync(&priv->scan_event); | ||
11915 | cancel_delayed_work_sync(&priv->gather_stats); | ||
11916 | cancel_work_sync(&priv->abort_scan); | ||
11917 | cancel_work_sync(&priv->roam); | ||
11918 | cancel_delayed_work_sync(&priv->scan_check); | ||
11919 | cancel_work_sync(&priv->link_up); | ||
11920 | cancel_work_sync(&priv->link_down); | ||
11921 | cancel_delayed_work_sync(&priv->led_link_on); | ||
11922 | cancel_delayed_work_sync(&priv->led_link_off); | ||
11923 | cancel_delayed_work_sync(&priv->led_act_off); | ||
11924 | cancel_work_sync(&priv->merge_networks); | ||
11945 | 11925 | ||
11946 | /* Free MAC hash list for ADHOC */ | 11926 | /* Free MAC hash list for ADHOC */ |
11947 | for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) { | 11927 | for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) { |
@@ -12029,7 +12009,7 @@ static int ipw_pci_resume(struct pci_dev *pdev) | |||
12029 | priv->suspend_time = get_seconds() - priv->suspend_at; | 12009 | priv->suspend_time = get_seconds() - priv->suspend_at; |
12030 | 12010 | ||
12031 | /* Bring the device back up */ | 12011 | /* Bring the device back up */ |
12032 | queue_work(priv->workqueue, &priv->up); | 12012 | schedule_work(&priv->up); |
12033 | 12013 | ||
12034 | return 0; | 12014 | return 0; |
12035 | } | 12015 | } |