linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add reg options for intel regulatory
@ 2008-11-08  2:01 Luis R. Rodriguez
  2008-11-08  2:01 ` [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions Luis R. Rodriguez
  2008-11-08  7:09 ` [PATCH 0/2] Add reg options for intel regulatory Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2008-11-08  2:01 UTC (permalink / raw)
  To: linville, johannes, linville, yi.zhu; +Cc: Luis R. Rodriguez, linux-wireless

As we discussed we can ignore the first hint for the
iwlwifi drivers. This adds that work. Please test and
let me know what you think.

These patches apply ontop of the 11d patches.

  Luis

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

* [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions
  2008-11-08  2:01 [PATCH 0/2] Add reg options for intel regulatory Luis R. Rodriguez
@ 2008-11-08  2:01 ` Luis R. Rodriguez
  2008-11-08  2:01   ` [PATCH 2/2] iwlwifi: enable custom fw regulatory solution Luis R. Rodriguez
  2008-11-10  1:58   ` [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions Zhu Yi
  2008-11-08  7:09 ` [PATCH 0/2] Add reg options for intel regulatory Johannes Berg
  1 sibling, 2 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2008-11-08  2:01 UTC (permalink / raw)
  To: linville, johannes, linville, yi.zhu; +Cc: Luis R. Rodriguez, linux-wireless

This adds API to cfg80211 to allow wireless drivers to inform
us if their firmware can handle regulatory considerations *and*
they cannot map these regulatory domains to an ISO / IEC 3166
alpha2. In these cases we skip the first regulatory hint instead
of expecting the driver to build their own regulatory structure,
providing us with an alpha2, or using the reg_notifier().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 include/net/wireless.h |    7 +++++++
 net/wireless/reg.c     |   13 ++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/include/net/wireless.h b/include/net/wireless.h
index 618b8aa..aedefa5 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -181,6 +181,11 @@ struct ieee80211_supported_band {
  * struct wiphy - wireless hardware description
  * @idx: the wiphy index assigned to this item
  * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
+ * @fw_handles_regulatory: tells us the firmware for this device
+ * 	has its own regulatory solution and cannot identify the
+ * 	ISO / IEC 3166 alpha2 it belongs to. When this is enabled
+ * 	we will disregard the first regulatory hint (when the
+ * 	initiator is %REGDOM_SET_BY_CORE).
  * @reg_notifier: the driver's regulatory notification callback
  */
 struct wiphy {
@@ -192,6 +197,8 @@ struct wiphy {
 	/* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
 	u16 interface_modes;
 
+	bool fw_handles_regulatory;
+
 	/* If multiple wiphys are registered and you're handed e.g.
 	 * a regular netdev with assigned ieee80211_ptr, you won't
 	 * know whether it points to a wiphy your driver has registered
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 4dab993..0990059 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -816,12 +816,23 @@ static void handle_band(struct ieee80211_supported_band *sband)
 		handle_channel(&sband->channels[i]);
 }
 
+static bool ignore_reg_update(struct wiphy *wiphy, enum reg_set_by setby)
+{
+	if (!last_request)
+		return true;
+	if (setby == REGDOM_SET_BY_CORE &&
+		  wiphy->fw_handles_regulatory)
+		return true;
+	return false;
+}
+
 static void update_all_wiphy_regulatory(enum reg_set_by setby)
 {
 	struct cfg80211_registered_device *drv;
 
 	list_for_each_entry(drv, &cfg80211_drv_list, list)
-		wiphy_update_regulatory(&drv->wiphy, setby);
+		if (!ignore_reg_update(&drv->wiphy, setby))
+			wiphy_update_regulatory(&drv->wiphy, setby);
 }
 
 void wiphy_update_regulatory(struct wiphy *wiphy, enum reg_set_by setby)
-- 
1.5.6.3


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

* [PATCH 2/2] iwlwifi: enable custom fw regulatory solution
  2008-11-08  2:01 ` [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions Luis R. Rodriguez
@ 2008-11-08  2:01   ` Luis R. Rodriguez
  2008-11-10  2:00     ` Zhu Yi
  2008-11-10  1:58   ` [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions Zhu Yi
  1 sibling, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2008-11-08  2:01 UTC (permalink / raw)
  To: linville, johannes, linville, yi.zhu; +Cc: Luis R. Rodriguez, linux-wireless

This enables the custom firmware regulatory solution option
on iwlwifi drivers. These devices are uncapable of mapping their
EEPROM regulatory domain to a specific ISO / IEC alpha2.
Although the new 11n devices (>= iwl 50000) have only
3 regultaory SKUs -- MOW, ABG (no N) and BG -- the older
devices (3945 and 4965) have a more complex SKU arrangement
and therefore its not practical to move this to the driver.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/iwlwifi/iwl-core.c     |    3 +++
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 8eb0203..053ac55 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -879,6 +879,9 @@ int iwl_setup_mac(struct iwl_priv *priv)
 		BIT(NL80211_IFTYPE_AP) |
 		BIT(NL80211_IFTYPE_STATION) |
 		BIT(NL80211_IFTYPE_ADHOC);
+
+	hw->wiphy->fw_handles_regulatory = true;
+
 	/* Default value; 4 EDCA QOS priorities */
 	hw->queues = 4;
 	/* queues to support 11n aggregation */
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 7222d7c..624a884 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -7839,6 +7839,8 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
 		BIT(NL80211_IFTYPE_STATION) |
 		BIT(NL80211_IFTYPE_ADHOC);
 
+	hw->wiphy->fw_handles_regulatory = true;
+
 	/* 4 EDCA QOS priorities */
 	hw->queues = 4;
 
-- 
1.5.6.3


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

* Re: [PATCH 0/2] Add reg options for intel regulatory
  2008-11-08  2:01 [PATCH 0/2] Add reg options for intel regulatory Luis R. Rodriguez
  2008-11-08  2:01 ` [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions Luis R. Rodriguez
@ 2008-11-08  7:09 ` Johannes Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2008-11-08  7:09 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linville, yi.zhu, linux-wireless

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

On Fri, 2008-11-07 at 18:01 -0800, Luis R. Rodriguez wrote:
> As we discussed we can ignore the first hint for the
> iwlwifi drivers. This adds that work. Please test and
> let me know what you think.

Looks good to me, thanks. Of course now we have to live with the slight
discrepancy here between hw, so rememember to ask for 'iw phy phy0 info'
output when something goes wrong :)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions
  2008-11-08  2:01 ` [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions Luis R. Rodriguez
  2008-11-08  2:01   ` [PATCH 2/2] iwlwifi: enable custom fw regulatory solution Luis R. Rodriguez
@ 2008-11-10  1:58   ` Zhu Yi
  1 sibling, 0 replies; 6+ messages in thread
From: Zhu Yi @ 2008-11-10  1:58 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linville@tuxdriver.com, johannes@sipsolutions.net,
	linux-wireless@vger.kernel.org

On Sat, 2008-11-08 at 10:01 +0800, Luis R. Rodriguez wrote:
> This adds API to cfg80211 to allow wireless drivers to inform
> us if their firmware can handle regulatory considerations *and*
> they cannot map these regulatory domains to an ISO / IEC 3166
> alpha2. In these cases we skip the first regulatory hint instead
> of expecting the driver to build their own regulatory structure,
> providing us with an alpha2, or using the reg_notifier().
> 
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>

Thanks!

Acked-by: Zhu Yi <yi.zhu@intel.com>

-yi


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

* Re: [PATCH 2/2] iwlwifi: enable custom fw regulatory solution
  2008-11-08  2:01   ` [PATCH 2/2] iwlwifi: enable custom fw regulatory solution Luis R. Rodriguez
@ 2008-11-10  2:00     ` Zhu Yi
  0 siblings, 0 replies; 6+ messages in thread
From: Zhu Yi @ 2008-11-10  2:00 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linville@tuxdriver.com, johannes@sipsolutions.net,
	linux-wireless@vger.kernel.org

On Sat, 2008-11-08 at 10:01 +0800, Luis R. Rodriguez wrote:
> This enables the custom firmware regulatory solution option
> on iwlwifi drivers. These devices are uncapable of mapping their
> EEPROM regulatory domain to a specific ISO / IEC alpha2.
> Although the new 11n devices (>= iwl 50000) have only
                                       ^^^^^
Should be 5000.

> 3 regultaory SKUs -- MOW, ABG (no N) and BG -- the older
> devices (3945 and 4965) have a more complex SKU arrangement
> and therefore its not practical to move this to the driver.
> 
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>

Acked-by: Zhu Yi <yi.zhu@intel.com>

Thanks,
-yi


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

end of thread, other threads:[~2008-11-10  1:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-08  2:01 [PATCH 0/2] Add reg options for intel regulatory Luis R. Rodriguez
2008-11-08  2:01 ` [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions Luis R. Rodriguez
2008-11-08  2:01   ` [PATCH 2/2] iwlwifi: enable custom fw regulatory solution Luis R. Rodriguez
2008-11-10  2:00     ` Zhu Yi
2008-11-10  1:58   ` [PATCH 1/2] cfg80211: add support for custom firmware regulatory solutions Zhu Yi
2008-11-08  7:09 ` [PATCH 0/2] Add reg options for intel regulatory Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).