Skip to content

Commit

Permalink
ath6kl: Make sure wiphy is registered before calling regulatory_hint()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasanthakumar Thiagarajan authored and Kalle Valo committed Mar 1, 2012
1 parent b796f09 commit e5348a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/net/wireless/ath/ath6kl/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath6kl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ struct ath6kl {

bool p2p;

bool wiphy_registered;

#ifdef CONFIG_ATH6KL_DEBUG
struct {
struct sk_buff_head fwlog_queue;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath6kl/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit e5348a1

Please sign in to comment.