From: Johannes Berg Date: Fri, 4 Apr 2008 08:41:56 +0000 (+0200) Subject: iwlwifi: honour regulatory restrictions in scan code X-Git-Tag: v2.6.26-rc1~1138^2~169 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=182e2e66ca56f750845f5314708434c286edd6e4;p=linux-2.6 iwlwifi: honour regulatory restrictions in scan code When doing firmware-assisted scanning, iwlwifi drivers do not honour the regulatory control code that might disable channels that are enabled in the EEPROM, for example when the user is visiting another country and adjusted the regulatory domain accordingly. This patch fixes that. Signed-off-by: Johannes Berg Acked-by: Reinette Chatre Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index d4daa04465..5e51cfcda3 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -4965,6 +4965,9 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv, passive_dwell = iwl3945_get_passive_dwell_time(priv, band); for (i = 0, added = 0; i < sband->n_channels; i++) { + if (channels[i].flags & IEEE80211_CHAN_DISABLED) + continue; + if (channels[i].hw_value == le16_to_cpu(priv->active_rxon.channel)) { if (iwl3945_is_associated(priv)) { diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 4517e4ce3a..b043871d53 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c @@ -4794,6 +4794,9 @@ static int iwl4965_get_channels_for_scan(struct iwl_priv *priv, passive_dwell = iwl4965_get_passive_dwell_time(priv, band); for (i = 0, added = 0; i < sband->n_channels; i++) { + if (channels[i].flags & IEEE80211_CHAN_DISABLED) + continue; + if (ieee80211_frequency_to_channel(channels[i].center_freq) == le16_to_cpu(priv->active_rxon.channel)) { if (iwl_is_associated(priv)) {