All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] cfg80211: enable regulatory hints for strict custom settings
@ 2013-10-03  1:33 Luis R. Rodriguez
  2013-10-03  1:33 ` [PATCH 2/2] cfg80211: simplfy strict custom alpha2 regdomain check Luis R. Rodriguez
  2013-10-11 13:32 ` [PATCH 1/2] cfg80211: enable regulatory hints for strict custom settings Johannes Berg
  0 siblings, 2 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2013-10-03  1:33 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Luis R. Rodriguez, smihir, tushnimb

If we have a wiphy with an ISO3166-alpha2 regulatory domain
programmed with the strict flag set we wait until the wiphy
gets its wiphy->regd programmed before allowing regulatory
domains hints other than country IE hints from processing
on the wiphy. The existing check however discards the
possibility of custom regulatory domains having also used
the strict flag and these will not have the wiphy->regd
set. Custom strict regulatory domains never set the wiphy->regd
though as such currently all regulatory hints other than
country IE hints are being ignored on these wiphys.

All custom strict regulatory domains set the wiphy with the
WIPHY_FLAG_CUSTOM_REGULATORY and use wiphy_apply_custom_regulatory().
Enhance the check for the strict ISO3166-alpha2 regulatory domain
case by exempting the WIPHY_FLAG_CUSTOM_REGULATORY case. This
will enable other regulatory hints to be processed now for
these strict custom regulatory domains.

Cc: smihir@qti.qualcomm.com
Cc: tushnimb@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 net/wireless/reg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5164716..9b488c7 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -992,6 +992,7 @@ static bool ignore_reg_update(struct wiphy *wiphy,
 	 */
 	if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd &&
 	    initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
+	    !(wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) &&
 	    !is_world_regdom(lr->alpha2)) {
 		REG_DBG_PRINT("Ignoring regulatory request set by %s "
 			      "since the driver requires its own regulatory "
-- 
1.8.4.rc3


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

* [PATCH 2/2] cfg80211: simplfy strict custom alpha2 regdomain check
  2013-10-03  1:33 [PATCH 1/2] cfg80211: enable regulatory hints for strict custom settings Luis R. Rodriguez
@ 2013-10-03  1:33 ` Luis R. Rodriguez
  2013-10-11 13:32 ` [PATCH 1/2] cfg80211: enable regulatory hints for strict custom settings Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2013-10-03  1:33 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Luis R. Rodriguez, smihir, tushnimb

This makes it easier to read.

Cc: smihir@qti.qualcomm.com
Cc: tushnimb@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 net/wireless/reg.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 9b488c7..ec3d45e 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -964,6 +964,13 @@ static bool reg_dev_ignore_cell_hint(struct wiphy *wiphy)
 }
 #endif
 
+static bool wiphy_strict_alpha2_regd(struct wiphy *wiphy)
+{
+	if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY &&
+	    !(wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY))
+		return true;
+	return false;
+}
 
 static bool ignore_reg_update(struct wiphy *wiphy,
 			      enum nl80211_reg_initiator initiator)
@@ -990,9 +997,8 @@ static bool ignore_reg_update(struct wiphy *wiphy,
 	 * wiphy->regd will be set once the device has its own
 	 * desired regulatory domain set
 	 */
-	if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd &&
+	if (wiphy_strict_alpha2_regd(wiphy) && !wiphy->regd &&
 	    initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
-	    !(wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) &&
 	    !is_world_regdom(lr->alpha2)) {
 		REG_DBG_PRINT("Ignoring regulatory request set by %s "
 			      "since the driver requires its own regulatory "
-- 
1.8.4.rc3


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

* Re: [PATCH 1/2] cfg80211: enable regulatory hints for strict custom settings
  2013-10-03  1:33 [PATCH 1/2] cfg80211: enable regulatory hints for strict custom settings Luis R. Rodriguez
  2013-10-03  1:33 ` [PATCH 2/2] cfg80211: simplfy strict custom alpha2 regdomain check Luis R. Rodriguez
@ 2013-10-11 13:32 ` Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2013-10-11 13:32 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, smihir, tushnimb

APplied both, but there were issues (fuzz) - please check.

Also, fixed your typo in the subject :)

johannes


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

end of thread, other threads:[~2013-10-11 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-03  1:33 [PATCH 1/2] cfg80211: enable regulatory hints for strict custom settings Luis R. Rodriguez
2013-10-03  1:33 ` [PATCH 2/2] cfg80211: simplfy strict custom alpha2 regdomain check Luis R. Rodriguez
2013-10-11 13:32 ` [PATCH 1/2] cfg80211: enable regulatory hints for strict custom settings Johannes Berg

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.