ath6kl: Make sure wiphy is registered before calling regulatory_hint()
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Sat, 25 Feb 2012 09:13:17 +0000 (14:43 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 1 Mar 2012 06:33:45 +0000 (08:33 +0200)
As regulatory events are processed even before the wiphy is registered,
calling regulatory_hint() at early stage should be fixed.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/ath6kl/core.h
drivers/net/wireless/ath/ath6kl/wmi.c

index bad92441b78a43258e847e74bdf25e6824c87b09..50b76d0a4c6a5b3823cb4494074be0dca53461c4 100644 (file)
@@ -3097,12 +3097,16 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
                return ret;
        }
 
+       ar->wiphy_registered = true;
+
        return 0;
 }
 
 void ath6kl_cfg80211_cleanup(struct ath6kl *ar)
 {
        wiphy_unregister(ar->wiphy);
+
+       ar->wiphy_registered = false;
 }
 
 struct ath6kl *ath6kl_cfg80211_create(void)
index 5bbc595f23d19acc85a72e0cebe2a92a3458d011..b6bdece63361165b192a938147483befffac54ac 100644 (file)
@@ -666,6 +666,8 @@ struct ath6kl {
 
        bool p2p;
 
+       bool wiphy_registered;
+
 #ifdef CONFIG_ATH6KL_DEBUG
        struct {
                struct sk_buff_head fwlog_queue;
index c0393b344a1f679ec31480f3429ead2d59ca1a1a..dc6230dea86cf71f68fef7acd2b41f0f56212f31 100644 (file)
@@ -914,7 +914,7 @@ static void ath6kl_wmi_regdomain_event(struct wmi *wmi, u8 *datap, int len)
                                regpair->regDmnEnum);
        }
 
-       if (country) {
+       if (country && wmi->parent_dev->wiphy_registered) {
                alpha2[0] = country->isoName[0];
                alpha2[1] = country->isoName[1];