diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-06-07 15:13:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-07 15:13:46 -0400 |
commit | 9d88477c41904127ab9ae1f3b5b4a39bf6474043 (patch) | |
tree | f50d5185ac89a9fd76d7cb087b952d5c55d5063b /drivers/net/wireless/iwlwifi/iwl-core.c | |
parent | 11b7c60988e5fbabb4e150612931cc068559af16 (diff) | |
parent | 35dd0509b21e4b5bab36b9eb80c8dab0322f5007 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-core.h
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 6cd8d207dd21..62c50bc0089a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -855,6 +855,45 @@ void iwl_set_rxon_chain(struct iwl_priv *priv) | |||
855 | } | 855 | } |
856 | EXPORT_SYMBOL(iwl_set_rxon_chain); | 856 | EXPORT_SYMBOL(iwl_set_rxon_chain); |
857 | 857 | ||
858 | /* Return valid channel */ | ||
859 | u8 iwl_get_single_channel_number(struct iwl_priv *priv, | ||
860 | enum ieee80211_band band) | ||
861 | { | ||
862 | const struct iwl_channel_info *ch_info; | ||
863 | int i; | ||
864 | u8 channel = 0; | ||
865 | |||
866 | /* only scan single channel, good enough to reset the RF */ | ||
867 | /* pick the first valid not in-use channel */ | ||
868 | if (band == IEEE80211_BAND_5GHZ) { | ||
869 | for (i = 14; i < priv->channel_count; i++) { | ||
870 | if (priv->channel_info[i].channel != | ||
871 | le16_to_cpu(priv->staging_rxon.channel)) { | ||
872 | channel = priv->channel_info[i].channel; | ||
873 | ch_info = iwl_get_channel_info(priv, | ||
874 | band, channel); | ||
875 | if (is_channel_valid(ch_info)) | ||
876 | break; | ||
877 | } | ||
878 | } | ||
879 | } else { | ||
880 | for (i = 0; i < 14; i++) { | ||
881 | if (priv->channel_info[i].channel != | ||
882 | le16_to_cpu(priv->staging_rxon.channel)) { | ||
883 | channel = | ||
884 | priv->channel_info[i].channel; | ||
885 | ch_info = iwl_get_channel_info(priv, | ||
886 | band, channel); | ||
887 | if (is_channel_valid(ch_info)) | ||
888 | break; | ||
889 | } | ||
890 | } | ||
891 | } | ||
892 | |||
893 | return channel; | ||
894 | } | ||
895 | EXPORT_SYMBOL(iwl_get_single_channel_number); | ||
896 | |||
858 | /** | 897 | /** |
859 | * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON | 898 | * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON |
860 | * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz | 899 | * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz |