OSDN Git Service

reg: qcom: call regulatory callback for self managed hints
authorAmar Singhal <asinghal@codeaurora.org>
Thu, 4 May 2017 21:24:08 +0000 (14:24 -0700)
committerAmar Singhal <asinghal@codeaurora.org>
Sun, 4 Feb 2018 17:28:38 +0000 (09:28 -0800)
Currently, kernel ignores the regulatory hint if wiphy flag
REGULATORY_WIPHY_SELF_MANAGED is set. This would lead to drop of
hints sent directly to kernel from user-space. To fix, call the driver
callback with the request.

CRs-Fixed: 2183721
Change-Id: Ic6d17ce8c3e9b889f618f3494672020bb1c98c42
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
net/wireless/reg.c

index 26ac0a4..f3fc9a3 100644 (file)
@@ -2247,7 +2247,7 @@ out_free:
        reg_free_request(reg_request);
 }
 
-static bool reg_only_self_managed_wiphys(void)
+static bool reg_only_self_managed_wiphys(struct regulatory_request *reg_request)
 {
        struct cfg80211_registered_device *rdev;
        struct wiphy *wiphy;
@@ -2257,10 +2257,12 @@ static bool reg_only_self_managed_wiphys(void)
 
        list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
                wiphy = &rdev->wiphy;
-               if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED)
+               if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) {
                        self_managed_found = true;
-               else
+                       reg_call_notifier(wiphy, reg_request);
+               } else {
                        return false;
+               }
        }
 
        /* make sure at least one self-managed wiphy exists */
@@ -2298,7 +2300,7 @@ static void reg_process_pending_hints(void)
 
        spin_unlock(&reg_requests_lock);
 
-       if (reg_only_self_managed_wiphys()) {
+       if (reg_only_self_managed_wiphys(reg_request)) {
                reg_free_request(reg_request);
                return;
        }