aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-11-12 17:22:03 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-25 16:41:27 -0500
commit14b9815af3f4fe0e171ee0c4325c31d2a2c1570b (patch)
tree4666e3bac9367e0b3cd07d6237de44bcc27274df
parent3f2355cb9111ac04e7ae06a4d7044da2ae813863 (diff)
cfg80211: add support for custom firmware regulatory solutions
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> Acked-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/wireless.h7
-rw-r--r--net/wireless/reg.c13
2 files changed, 19 insertions, 1 deletions
diff --git a/include/net/wireless.h b/include/net/wireless.h
index c85fa0ea5c51..21c5d966142d 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -181,6 +181,11 @@ struct ieee80211_supported_band {
181 * struct wiphy - wireless hardware description 181 * struct wiphy - wireless hardware description
182 * @idx: the wiphy index assigned to this item 182 * @idx: the wiphy index assigned to this item
183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
184 * @fw_handles_regulatory: tells us the firmware for this device
185 * has its own regulatory solution and cannot identify the
186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
187 * we will disregard the first regulatory hint (when the
188 * initiator is %REGDOM_SET_BY_CORE).
184 * @reg_notifier: the driver's regulatory notification callback 189 * @reg_notifier: the driver's regulatory notification callback
185 */ 190 */
186struct wiphy { 191struct wiphy {
@@ -192,6 +197,8 @@ struct wiphy {
192 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 197 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
193 u16 interface_modes; 198 u16 interface_modes;
194 199
200 bool fw_handles_regulatory;
201
195 /* If multiple wiphys are registered and you're handed e.g. 202 /* If multiple wiphys are registered and you're handed e.g.
196 * a regular netdev with assigned ieee80211_ptr, you won't 203 * a regular netdev with assigned ieee80211_ptr, you won't
197 * know whether it points to a wiphy your driver has registered 204 * know whether it points to a wiphy your driver has registered
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 4dab993ea488..0990059f7e48 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -816,12 +816,23 @@ static void handle_band(struct ieee80211_supported_band *sband)
816 handle_channel(&sband->channels[i]); 816 handle_channel(&sband->channels[i]);
817} 817}
818 818
819static bool ignore_reg_update(struct wiphy *wiphy, enum reg_set_by setby)
820{
821 if (!last_request)
822 return true;
823 if (setby == REGDOM_SET_BY_CORE &&
824 wiphy->fw_handles_regulatory)
825 return true;
826 return false;
827}
828
819static void update_all_wiphy_regulatory(enum reg_set_by setby) 829static void update_all_wiphy_regulatory(enum reg_set_by setby)
820{ 830{
821 struct cfg80211_registered_device *drv; 831 struct cfg80211_registered_device *drv;
822 832
823 list_for_each_entry(drv, &cfg80211_drv_list, list) 833 list_for_each_entry(drv, &cfg80211_drv_list, list)
824 wiphy_update_regulatory(&drv->wiphy, setby); 834 if (!ignore_reg_update(&drv->wiphy, setby))
835 wiphy_update_regulatory(&drv->wiphy, setby);
825} 836}
826 837
827void wiphy_update_regulatory(struct wiphy *wiphy, enum reg_set_by setby) 838void wiphy_update_regulatory(struct wiphy *wiphy, enum reg_set_by setby)