Search Linux Wireless

[PATCH 7/7] mac80211: Allow drivers to configure default regulatory domain

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

 



From: Michael Wu <flamingice@xxxxxxxxxxxx>

This patch allows drivers to configure the default set of channels if the
device reports its default regulatory domain.

Signed-off-by: Michael Wu <flamingice@xxxxxxxxxxxx>
---

 include/net/mac80211.h   |    8 ++++++--
 net/mac80211/ieee80211.c |    3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f0cfe88..96321be 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -52,7 +52,9 @@
  * freq, and val fields. Other fields will be filled in by 80211.o based on
  * hostapd information and low-level driver does not need to use them. The
  * limits for each channel will be provided in 'struct ieee80211_conf' when
- * configuring the low-level driver with hw->config callback. */
+ * configuring the low-level driver with hw->config callback. If a device has
+ * a default regulatory domain, IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED
+ * can be set to let the driver configure all fields */
 struct ieee80211_channel {
 	short chan; /* channel number (IEEE 802.11) */
 	short freq; /* frequency in MHz */
@@ -528,7 +530,9 @@ struct ieee80211_hw {
 	 * receive all probe responses while scanning */
 #define IEEE80211_HW_NO_PROBE_FILTERING (1<<10)
 
-	/* please fill this gap when adding new flags */
+	/* Channels are already configured to the default regulatory domain
+	 * specified in the device's EEPROM */
+#define IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED (1<<11)
 
 	/* calculate Michael MIC for an MSDU when doing hwcrypto */
 #define IEEE80211_HW_TKIP_INCLUDE_MMIC (1<<12)
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 2b6cb06..f609e6c 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -4837,7 +4837,8 @@ int ieee80211_register_hwmode(struct ieee80211_hw *hw,
 		local->hw.conf.chan = local->oper_channel;
 	}
 
-	ieee80211_init_client(local->mdev);
+	if (!(hw->flags & IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED))
+		ieee80211_init_client(local->mdev);
 
 	return 0;
 }

-
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