Search Linux Wireless

[PATCH 02/12] cfg80211: add helper to indicate when to follow the driver regd

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

 



This adds a helper which which tells us when we need to follow
the driver's own regulatory domain. This will later be expanded.

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 net/wireless/reg.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index ec8b3d9..1a5b37a 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -782,6 +782,16 @@ static u32 map_regdom_flags(u32 rd_flags)
 	return channel_flags;
 }
 
+/* Follow the driver's regulatory domain, if present, unless a country
+ * IE has been processed */
+static int reg_follow_driver_regd(struct wiphy *wiphy)
+{
+	if (last_request->initiator != REGDOM_SET_BY_COUNTRY_IE &&
+	    wiphy->regd)
+		return true;
+	return false;
+}
+
 /**
  * freq_reg_info - get regulatory information for the given frequency
  * @wiphy: the wiphy for which we want to process this rule for
@@ -813,10 +823,7 @@ static int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
 
 	regd = cfg80211_regdomain;
 
-	/* Follow the driver's regulatory domain, if present, unless a country
-	 * IE has been processed */
-	if (last_request->initiator != REGDOM_SET_BY_COUNTRY_IE &&
-	    wiphy->regd)
+	if (reg_follow_driver_regd(wiphy))
 		regd = wiphy->regd;
 
 	if (!regd)
-- 
1.6.1.rc3.51.g5832d

--
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