diff options
author | Zhu Yi <yi.zhu@intel.com> | 2007-12-20 01:10:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:07:54 -0500 |
commit | a0646470e8a965df59054a5c82e53e5572bf04a0 (patch) | |
tree | fe4b434a1b8f2accdcfd3e1055b903ffb20e5d8b | |
parent | 12342c475f5de17071eaf24ea2938ba8dfe285f2 (diff) |
iwlwifi: skip mac80211 conf during a hardware scan and replay it afterwards
This patch skips mac80211 configuration setting during a hardware scan
and replays it afterwards for the iwlwifi drivers.
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 32 |
4 files changed, 15 insertions, 51 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index f1aa4dc5aac4..e97f1fb48b97 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -406,6 +406,7 @@ struct iwl3945_rx_queue { | |||
406 | #define STATUS_SCAN_HW 14 | 406 | #define STATUS_SCAN_HW 14 |
407 | #define STATUS_POWER_PMI 15 | 407 | #define STATUS_POWER_PMI 15 |
408 | #define STATUS_FW_ERROR 16 | 408 | #define STATUS_FW_ERROR 16 |
409 | #define STATUS_CONF_PENDING 17 | ||
409 | 410 | ||
410 | #define MAX_TID_COUNT 9 | 411 | #define MAX_TID_COUNT 9 |
411 | 412 | ||
@@ -694,7 +695,6 @@ struct iwl3945_priv { | |||
694 | struct ieee80211_hw *hw; | 695 | struct ieee80211_hw *hw; |
695 | struct ieee80211_channel *ieee_channels; | 696 | struct ieee80211_channel *ieee_channels; |
696 | struct ieee80211_rate *ieee_rates; | 697 | struct ieee80211_rate *ieee_rates; |
697 | struct ieee80211_conf *cache_conf; | ||
698 | 698 | ||
699 | /* temporary frame storage list */ | 699 | /* temporary frame storage list */ |
700 | struct list_head free_frames; | 700 | struct list_head free_frames; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 9a975efc9460..241f4448a4ad 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h | |||
@@ -425,6 +425,7 @@ struct iwl4965_rx_queue { | |||
425 | #define STATUS_SCAN_HW 14 | 425 | #define STATUS_SCAN_HW 14 |
426 | #define STATUS_POWER_PMI 15 | 426 | #define STATUS_POWER_PMI 15 |
427 | #define STATUS_FW_ERROR 16 | 427 | #define STATUS_FW_ERROR 16 |
428 | #define STATUS_CONF_PENDING 17 | ||
428 | 429 | ||
429 | #define MAX_TID_COUNT 9 | 430 | #define MAX_TID_COUNT 9 |
430 | 431 | ||
@@ -1023,7 +1024,6 @@ struct iwl4965_priv { | |||
1023 | struct ieee80211_hw *hw; | 1024 | struct ieee80211_hw *hw; |
1024 | struct ieee80211_channel *ieee_channels; | 1025 | struct ieee80211_channel *ieee_channels; |
1025 | struct ieee80211_rate *ieee_rates; | 1026 | struct ieee80211_rate *ieee_rates; |
1026 | struct ieee80211_conf *cache_conf; | ||
1027 | 1027 | ||
1028 | /* temporary frame storage list */ | 1028 | /* temporary frame storage list */ |
1029 | struct list_head free_frames; | 1029 | struct list_head free_frames; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 40b69182e4dc..8d603257b926 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6888,8 +6888,8 @@ static void iwl3945_bg_scan_completed(struct work_struct *work) | |||
6888 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 6888 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
6889 | return; | 6889 | return; |
6890 | 6890 | ||
6891 | if (priv->cache_conf) | 6891 | if (test_bit(STATUS_CONF_PENDING, &priv->status)) |
6892 | iwl3945_mac_config(priv->hw, priv->cache_conf); | 6892 | iwl3945_mac_config(priv->hw, ieee80211_get_hw_conf(priv->hw)); |
6893 | 6893 | ||
6894 | ieee80211_scan_completed(priv->hw); | 6894 | ieee80211_scan_completed(priv->hw); |
6895 | 6895 | ||
@@ -7033,27 +7033,12 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co | |||
7033 | goto out; | 7033 | goto out; |
7034 | } | 7034 | } |
7035 | 7035 | ||
7036 | /* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only | ||
7037 | * what is exposed through include/ declarations */ | ||
7038 | if (unlikely(!iwl3945_param_disable_hw_scan && | 7036 | if (unlikely(!iwl3945_param_disable_hw_scan && |
7039 | test_bit(STATUS_SCANNING, &priv->status))) { | 7037 | test_bit(STATUS_SCANNING, &priv->status))) { |
7040 | 7038 | IWL_DEBUG_MAC80211("leave - scanning\n"); | |
7041 | if (priv->cache_conf) | 7039 | set_bit(STATUS_CONF_PENDING, &priv->status); |
7042 | IWL_DEBUG_MAC80211("leave - still scanning\n"); | ||
7043 | else { | ||
7044 | /* Cache the configuration now so that we can | ||
7045 | * replay it after the hardware scan is finished. */ | ||
7046 | priv->cache_conf = kmalloc(sizeof(*conf), GFP_KERNEL); | ||
7047 | if (priv->cache_conf) { | ||
7048 | memcpy(priv->cache_conf, conf, sizeof(*conf)); | ||
7049 | IWL_DEBUG_MAC80211("leave - scanning\n"); | ||
7050 | } else { | ||
7051 | IWL_DEBUG_MAC80211("leave - no memory\n"); | ||
7052 | ret = -ENOMEM; | ||
7053 | } | ||
7054 | } | ||
7055 | mutex_unlock(&priv->mutex); | 7040 | mutex_unlock(&priv->mutex); |
7056 | return ret; | 7041 | return 0; |
7057 | } | 7042 | } |
7058 | 7043 | ||
7059 | spin_lock_irqsave(&priv->lock, flags); | 7044 | spin_lock_irqsave(&priv->lock, flags); |
@@ -7110,10 +7095,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co | |||
7110 | IWL_DEBUG_MAC80211("leave\n"); | 7095 | IWL_DEBUG_MAC80211("leave\n"); |
7111 | 7096 | ||
7112 | out: | 7097 | out: |
7113 | if (priv->cache_conf) { | 7098 | clear_bit(STATUS_CONF_PENDING, &priv->status); |
7114 | kfree(priv->cache_conf); | ||
7115 | priv->cache_conf = NULL; | ||
7116 | } | ||
7117 | mutex_unlock(&priv->mutex); | 7099 | mutex_unlock(&priv->mutex); |
7118 | return ret; | 7100 | return ret; |
7119 | } | 7101 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 07089754b544..5a9fa42f999b 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -7332,8 +7332,8 @@ static void iwl4965_bg_scan_completed(struct work_struct *work) | |||
7332 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 7332 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
7333 | return; | 7333 | return; |
7334 | 7334 | ||
7335 | if (priv->cache_conf) | 7335 | if (test_bit(STATUS_CONF_PENDING, &priv->status)) |
7336 | iwl4965_mac_config(priv->hw, priv->cache_conf); | 7336 | iwl4965_mac_config(priv->hw, ieee80211_get_hw_conf(priv->hw)); |
7337 | 7337 | ||
7338 | ieee80211_scan_completed(priv->hw); | 7338 | ieee80211_scan_completed(priv->hw); |
7339 | 7339 | ||
@@ -7476,27 +7476,12 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co | |||
7476 | goto out; | 7476 | goto out; |
7477 | } | 7477 | } |
7478 | 7478 | ||
7479 | /* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only | ||
7480 | * what is exposed through include/ declarations */ | ||
7481 | if (unlikely(!iwl4965_param_disable_hw_scan && | 7479 | if (unlikely(!iwl4965_param_disable_hw_scan && |
7482 | test_bit(STATUS_SCANNING, &priv->status))) { | 7480 | test_bit(STATUS_SCANNING, &priv->status))) { |
7483 | 7481 | IWL_DEBUG_MAC80211("leave - scanning\n"); | |
7484 | if (unlikely(priv->cache_conf)) | 7482 | set_bit(STATUS_CONF_PENDING, &priv->status); |
7485 | IWL_DEBUG_MAC80211("leave - still scanning\n"); | ||
7486 | else { | ||
7487 | /* Cache the configuration now so that we can | ||
7488 | * replay it after the hardware scan is finished. */ | ||
7489 | priv->cache_conf = kmalloc(sizeof(*conf), GFP_KERNEL); | ||
7490 | if (priv->cache_conf) { | ||
7491 | memcpy(priv->cache_conf, conf, sizeof(*conf)); | ||
7492 | IWL_DEBUG_MAC80211("leave - scanning\n"); | ||
7493 | } else { | ||
7494 | IWL_DEBUG_MAC80211("leave - no memory\n"); | ||
7495 | ret = -ENOMEM; | ||
7496 | } | ||
7497 | } | ||
7498 | mutex_unlock(&priv->mutex); | 7483 | mutex_unlock(&priv->mutex); |
7499 | return ret; | 7484 | return 0; |
7500 | } | 7485 | } |
7501 | 7486 | ||
7502 | spin_lock_irqsave(&priv->lock, flags); | 7487 | spin_lock_irqsave(&priv->lock, flags); |
@@ -7564,12 +7549,9 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co | |||
7564 | 7549 | ||
7565 | IWL_DEBUG_MAC80211("leave\n"); | 7550 | IWL_DEBUG_MAC80211("leave\n"); |
7566 | 7551 | ||
7567 | out: | ||
7568 | if (priv->cache_conf) { | ||
7569 | kfree(priv->cache_conf); | ||
7570 | priv->cache_conf = NULL; | ||
7571 | } | ||
7572 | mutex_unlock(&priv->mutex); | 7552 | mutex_unlock(&priv->mutex); |
7553 | out: | ||
7554 | clear_bit(STATUS_CONF_PENDING, &priv->status); | ||
7573 | return ret; | 7555 | return ret; |
7574 | } | 7556 | } |
7575 | 7557 | ||