aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorWinkler, Tomas <tomas.winkler@intel.com>2009-01-19 18:30:23 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:00:54 -0500
commitaf0053d660f7c330ed1a5c6538938283fd79662f (patch)
tree0b2fb98a75afe61595aac400ad84485d15f1c1fa /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent42986796409a6293351207150edb7b4689b6013d (diff)
iwlwifi: kill iwl3945_scan_cancel and iwl3945_scan_cancel_timeout
This patch removes iwl3945_scan_cancel and iwl3945_scan_cancel_timeout because iwl_scan_cancel iwl_scan_cancel_timeout are just same. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c76
1 files changed, 12 insertions, 64 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 010df19d01e..d8cb94894d5 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1734,58 +1734,6 @@ static int iwl3945_send_power_mode(struct iwl_priv *priv, u32 mode)
1734 return rc; 1734 return rc;
1735} 1735}
1736 1736
1737/**
1738 * iwl3945_scan_cancel - Cancel any currently executing HW scan
1739 *
1740 * NOTE: priv->mutex is not required before calling this function
1741 */
1742static int iwl3945_scan_cancel(struct iwl_priv *priv)
1743{
1744 if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
1745 clear_bit(STATUS_SCANNING, &priv->status);
1746 return 0;
1747 }
1748
1749 if (test_bit(STATUS_SCANNING, &priv->status)) {
1750 if (!test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
1751 IWL_DEBUG_SCAN("Queuing scan abort.\n");
1752 set_bit(STATUS_SCAN_ABORTING, &priv->status);
1753 queue_work(priv->workqueue, &priv->abort_scan);
1754
1755 } else
1756 IWL_DEBUG_SCAN("Scan abort already in progress.\n");
1757
1758 return test_bit(STATUS_SCANNING, &priv->status);
1759 }
1760
1761 return 0;
1762}
1763
1764/**
1765 * iwl3945_scan_cancel_timeout - Cancel any currently executing HW scan
1766 * @ms: amount of time to wait (in milliseconds) for scan to abort
1767 *
1768 * NOTE: priv->mutex must be held before calling this function
1769 */
1770static int iwl3945_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
1771{
1772 unsigned long now = jiffies;
1773 int ret;
1774
1775 ret = iwl3945_scan_cancel(priv);
1776 if (ret && ms) {
1777 mutex_unlock(&priv->mutex);
1778 while (!time_after(jiffies, now + msecs_to_jiffies(ms)) &&
1779 test_bit(STATUS_SCANNING, &priv->status))
1780 msleep(1);
1781 mutex_lock(&priv->mutex);
1782
1783 return test_bit(STATUS_SCANNING, &priv->status);
1784 }
1785
1786 return ret;
1787}
1788
1789#define MAX_UCODE_BEACON_INTERVAL 1024 1737#define MAX_UCODE_BEACON_INTERVAL 1024
1790#define INTEL_CONN_LISTEN_INTERVAL __constant_cpu_to_le16(0xA) 1738#define INTEL_CONN_LISTEN_INTERVAL __constant_cpu_to_le16(0xA)
1791 1739
@@ -2022,7 +1970,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
2022 return -EAGAIN; 1970 return -EAGAIN;
2023 1971
2024 cancel_delayed_work(&priv->scan_check); 1972 cancel_delayed_work(&priv->scan_check);
2025 if (iwl3945_scan_cancel_timeout(priv, 100)) { 1973 if (iwl_scan_cancel_timeout(priv, 100)) {
2026 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n"); 1974 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
2027 IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); 1975 IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
2028 return -EAGAIN; 1976 return -EAGAIN;
@@ -2502,7 +2450,7 @@ static void iwl3945_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
2502 disable_radio ? "OFF" : "ON"); 2450 disable_radio ? "OFF" : "ON");
2503 2451
2504 if (disable_radio) { 2452 if (disable_radio) {
2505 iwl3945_scan_cancel(priv); 2453 iwl_scan_cancel(priv);
2506 /* FIXME: This is a workaround for AP */ 2454 /* FIXME: This is a workaround for AP */
2507 if (priv->iw_mode != NL80211_IFTYPE_AP) { 2455 if (priv->iw_mode != NL80211_IFTYPE_AP) {
2508 spin_lock_irqsave(&priv->lock, flags); 2456 spin_lock_irqsave(&priv->lock, flags);
@@ -3014,7 +2962,7 @@ static void iwl3945_rx_card_state_notif(struct iwl_priv *priv,
3014 else 2962 else
3015 clear_bit(STATUS_RF_KILL_SW, &priv->status); 2963 clear_bit(STATUS_RF_KILL_SW, &priv->status);
3016 2964
3017 iwl3945_scan_cancel(priv); 2965 iwl_scan_cancel(priv);
3018 2966
3019 if ((test_bit(STATUS_RF_KILL_HW, &status) != 2967 if ((test_bit(STATUS_RF_KILL_HW, &status) !=
3020 test_bit(STATUS_RF_KILL_HW, &priv->status)) || 2968 test_bit(STATUS_RF_KILL_HW, &priv->status)) ||
@@ -5800,7 +5748,7 @@ static void iwl3945_post_associate(struct iwl_priv *priv)
5800 if (!priv->vif || !priv->is_open) 5748 if (!priv->vif || !priv->is_open)
5801 return; 5749 return;
5802 5750
5803 iwl3945_scan_cancel_timeout(priv, 200); 5751 iwl_scan_cancel_timeout(priv, 200);
5804 5752
5805 conf = ieee80211_get_hw_conf(priv->hw); 5753 conf = ieee80211_get_hw_conf(priv->hw);
5806 5754
@@ -6001,7 +5949,7 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
6001 * RXON_FILTER_ASSOC_MSK BIT 5949 * RXON_FILTER_ASSOC_MSK BIT
6002 */ 5950 */
6003 mutex_lock(&priv->mutex); 5951 mutex_lock(&priv->mutex);
6004 iwl3945_scan_cancel_timeout(priv, 100); 5952 iwl_scan_cancel_timeout(priv, 100);
6005 mutex_unlock(&priv->mutex); 5953 mutex_unlock(&priv->mutex);
6006 } 5954 }
6007 5955
@@ -6279,7 +6227,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6279 !is_multicast_ether_addr(conf->bssid)) { 6227 !is_multicast_ether_addr(conf->bssid)) {
6280 /* If there is currently a HW scan going on in the background 6228 /* If there is currently a HW scan going on in the background
6281 * then we need to cancel it else the RXON below will fail. */ 6229 * then we need to cancel it else the RXON below will fail. */
6282 if (iwl3945_scan_cancel_timeout(priv, 100)) { 6230 if (iwl_scan_cancel_timeout(priv, 100)) {
6283 IWL_WARN(priv, "Aborted scan still in progress " 6231 IWL_WARN(priv, "Aborted scan still in progress "
6284 "after 100ms\n"); 6232 "after 100ms\n");
6285 IWL_DEBUG_MAC80211("leaving - scan abort failed.\n"); 6233 IWL_DEBUG_MAC80211("leaving - scan abort failed.\n");
@@ -6304,7 +6252,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6304 } 6252 }
6305 6253
6306 } else { 6254 } else {
6307 iwl3945_scan_cancel_timeout(priv, 100); 6255 iwl_scan_cancel_timeout(priv, 100);
6308 priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 6256 priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
6309 iwl3945_commit_rxon(priv); 6257 iwl3945_commit_rxon(priv);
6310 } 6258 }
@@ -6372,7 +6320,7 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
6372 mutex_lock(&priv->mutex); 6320 mutex_lock(&priv->mutex);
6373 6321
6374 if (iwl_is_ready_rf(priv)) { 6322 if (iwl_is_ready_rf(priv)) {
6375 iwl3945_scan_cancel_timeout(priv, 100); 6323 iwl_scan_cancel_timeout(priv, 100);
6376 priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 6324 priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
6377 iwl3945_commit_rxon(priv); 6325 iwl3945_commit_rxon(priv);
6378 } 6326 }
@@ -6520,7 +6468,7 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
6520 6468
6521 mutex_lock(&priv->mutex); 6469 mutex_lock(&priv->mutex);
6522 6470
6523 iwl3945_scan_cancel_timeout(priv, 100); 6471 iwl_scan_cancel_timeout(priv, 100);
6524 6472
6525 switch (cmd) { 6473 switch (cmd) {
6526 case SET_KEY: 6474 case SET_KEY:
@@ -6670,7 +6618,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
6670 * clear RXON_FILTER_ASSOC_MSK bit 6618 * clear RXON_FILTER_ASSOC_MSK bit
6671 */ 6619 */
6672 if (priv->iw_mode != NL80211_IFTYPE_AP) { 6620 if (priv->iw_mode != NL80211_IFTYPE_AP) {
6673 iwl3945_scan_cancel_timeout(priv, 100); 6621 iwl_scan_cancel_timeout(priv, 100);
6674 priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 6622 priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
6675 iwl3945_commit_rxon(priv); 6623 iwl3945_commit_rxon(priv);
6676 } 6624 }
@@ -6829,7 +6777,7 @@ static ssize_t store_flags(struct device *d,
6829 mutex_lock(&priv->mutex); 6777 mutex_lock(&priv->mutex);
6830 if (le32_to_cpu(priv->staging39_rxon.flags) != flags) { 6778 if (le32_to_cpu(priv->staging39_rxon.flags) != flags) {
6831 /* Cancel any currently running scans... */ 6779 /* Cancel any currently running scans... */
6832 if (iwl3945_scan_cancel_timeout(priv, 100)) 6780 if (iwl_scan_cancel_timeout(priv, 100))
6833 IWL_WARN(priv, "Could not cancel scan.\n"); 6781 IWL_WARN(priv, "Could not cancel scan.\n");
6834 else { 6782 else {
6835 IWL_DEBUG_INFO("Committing rxon.flags = 0x%04X\n", 6783 IWL_DEBUG_INFO("Committing rxon.flags = 0x%04X\n",
@@ -6864,7 +6812,7 @@ static ssize_t store_filter_flags(struct device *d,
6864 mutex_lock(&priv->mutex); 6812 mutex_lock(&priv->mutex);
6865 if (le32_to_cpu(priv->staging39_rxon.filter_flags) != filter_flags) { 6813 if (le32_to_cpu(priv->staging39_rxon.filter_flags) != filter_flags) {
6866 /* Cancel any currently running scans... */ 6814 /* Cancel any currently running scans... */
6867 if (iwl3945_scan_cancel_timeout(priv, 100)) 6815 if (iwl_scan_cancel_timeout(priv, 100))
6868 IWL_WARN(priv, "Could not cancel scan.\n"); 6816 IWL_WARN(priv, "Could not cancel scan.\n");
6869 else { 6817 else {
6870 IWL_DEBUG_INFO("Committing rxon.filter_flags = " 6818 IWL_DEBUG_INFO("Committing rxon.filter_flags = "