Search Linux Wireless

[PATCH] iwlwifi: honour regulatory restrictions in scan code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <johannes@xxxxxxxxxxxxxxxx>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    3 +++
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    3 +++
 2 files changed, 6 insertions(+)

--- everything.orig/drivers/net/wireless/iwlwifi/iwl3945-base.c	2008-04-03 18:52:45.000000000 +0200
+++ everything/drivers/net/wireless/iwlwifi/iwl3945-base.c	2008-04-03 18:53:07.000000000 +0200
@@ -4965,6 +4965,9 @@ static int iwl3945_get_channels_for_scan
 	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)) {
--- everything.orig/drivers/net/wireless/iwlwifi/iwl4965-base.c	2008-04-03 18:52:10.000000000 +0200
+++ everything/drivers/net/wireless/iwlwifi/iwl4965-base.c	2008-04-03 18:52:41.000000000 +0200
@@ -4828,6 +4828,9 @@ static int iwl4965_get_channels_for_scan
 	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 (iwl4965_is_associated(priv)) {


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux