qtnfmac: regulatory configuration for self-managed setup
authorSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Thu, 27 Jul 2017 23:06:44 +0000 (02:06 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 3 Aug 2017 09:58:10 +0000 (12:58 +0300)
Regdomain information needs to be registered with cfg80211
for devices with REGULATORY_WIPHY_SELF_MANAGED flag set.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Avinash Patil <avinashp@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

index 7f70b0a..e288b1d 100644 (file)
@@ -873,6 +873,15 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac)
        }
 
        ret = wiphy_register(wiphy);
+       if (ret < 0)
+               goto out;
+
+       if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED)
+               ret = regulatory_set_wiphy_regd(wiphy, hw_info->rd);
+       else if (isalpha(hw_info->rd->alpha2[0]) &&
+                isalpha(hw_info->rd->alpha2[1]))
+               ret = regulatory_hint(wiphy, hw_info->rd->alpha2);
+
 out:
        if (ret) {
                kfree(iface_comb);