diff options
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 5a7eca8fb78..426e95567de 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -854,6 +854,45 @@ void iwl_set_rxon_chain(struct iwl_priv *priv) | |||
854 | } | 854 | } |
855 | EXPORT_SYMBOL(iwl_set_rxon_chain); | 855 | EXPORT_SYMBOL(iwl_set_rxon_chain); |
856 | 856 | ||
857 | /* Return valid channel */ | ||
858 | u8 iwl_get_single_channel_number(struct iwl_priv *priv, | ||
859 | enum ieee80211_band band) | ||
860 | { | ||
861 | const struct iwl_channel_info *ch_info; | ||
862 | int i; | ||
863 | u8 channel = 0; | ||
864 | |||
865 | /* only scan single channel, good enough to reset the RF */ | ||
866 | /* pick the first valid not in-use channel */ | ||
867 | if (band == IEEE80211_BAND_5GHZ) { | ||
868 | for (i = 14; i < priv->channel_count; i++) { | ||
869 | if (priv->channel_info[i].channel != | ||
870 | le16_to_cpu(priv->staging_rxon.channel)) { | ||
871 | channel = priv->channel_info[i].channel; | ||
872 | ch_info = iwl_get_channel_info(priv, | ||
873 | band, channel); | ||
874 | if (is_channel_valid(ch_info)) | ||
875 | break; | ||
876 | } | ||
877 | } | ||
878 | } else { | ||
879 | for (i = 0; i < 14; i++) { | ||
880 | if (priv->channel_info[i].channel != | ||
881 | le16_to_cpu(priv->staging_rxon.channel)) { | ||
882 | channel = | ||
883 | priv->channel_info[i].channel; | ||
884 | ch_info = iwl_get_channel_info(priv, | ||
885 | band, channel); | ||
886 | if (is_channel_valid(ch_info)) | ||
887 | break; | ||
888 | } | ||
889 | } | ||
890 | } | ||
891 | |||
892 | return channel; | ||
893 | } | ||
894 | EXPORT_SYMBOL(iwl_get_single_channel_number); | ||
895 | |||
857 | /** | 896 | /** |
858 | * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON | 897 | * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON |
859 | * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz | 898 | * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz |