All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] d80211: Allow drivers to configure default regulatory domain
@ 2007-02-18  5:31 Michael Wu
  2007-02-19 19:49 ` Jiri Benc
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Wu @ 2007-02-18  5:31 UTC (permalink / raw)
  To: Jiri Benc; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 2382 bytes --]

d80211: Allow drivers to configure default regulatory domain

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@sourmilk.net>
---

 include/net/d80211.h   |    7 ++++++-
 net/d80211/ieee80211.c |    5 +++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/net/d80211.h b/include/net/d80211.h
index 25a4dca..e0180ec 100644
--- a/include/net/d80211.h
+++ b/include/net/d80211.h
@@ -54,7 +54,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 */
@@ -532,6 +534,9 @@ struct ieee80211_hw {
 	/* Do TKIP phase1 and phase2 key mixing in stack and send the generated
 	 * per-packet RC4 key with each TX frame when doing hwcrypto */
 #define IEEE80211_HW_TKIP_REQ_PHASE2_KEY (1<<14)
+	/* Channels are already configured to the default regulatory domain
+	 * specified in the device's EEPROM */
+#define IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED (1<<15)
 
 	u32 flags;			/* hardware flags defined above */
 
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 0e5f23f..5af42aa 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -4652,6 +4652,9 @@ int ieee80211_register_hw(struct ieee802
 	memcpy(local->mdev->dev_addr, local->hw.perm_addr, ETH_ALEN);
 	SET_NETDEV_DEV(local->mdev, local->hw.dev);
 
+	if (!(hw->flags & IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED))
+		ieee80211_init_client(local->mdev);
+
 	result = register_netdevice(local->mdev);
 	if (result < 0) {
 		rtnl_unlock();
@@ -4746,8 +4749,6 @@ int ieee80211_register_hwmode(struct iee
 		ieee80211_prepare_rates(local);
 	}
 
-	ieee80211_init_client(local->mdev);
-
 	return 0;
 }
 EXPORT_SYMBOL(ieee80211_register_hwmode);

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-19 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-18  5:31 [PATCH] d80211: Allow drivers to configure default regulatory domain Michael Wu
2007-02-19 19:49 ` Jiri Benc
2007-02-19 20:37   ` James Ketrenos
2007-02-19 20:59     ` Jiri Benc
2007-02-19 20:48   ` Michael Wu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.