diff options
author | Arik Nemtsov <arik@wizery.com> | 2015-03-23 14:32:53 +0200 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-04-02 09:26:46 +0300 |
commit | b6e160ab15c203fe77d13a121081b1a9bce7cbfe (patch) | |
tree | a8058247cf9a81c8aa2a07081ddf460683c36006 /drivers/net/wireless/iwlwifi | |
parent | 484b3d13b4ac3d721f3479433ad82100e1277580 (diff) |
iwlwifi: mvm: always reconfigure last MCC on init
Currently the last found MCC is reconfigured only in the recovery flow.
But it should always be used when available, for the ifdown/up or
RF-Kill/CT-Kill scenarios.
While at it, fix a couple of bugs in the init-from-last-MCC flow. Return
an error value when a current MCC is not found. Pass on the regdomain to
cfg80211 only if it was changed and don't ignore the return value from
the cfg80211-setter function.
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/nvm.c | 9 |
2 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 07344e11ce0a..0dd999ceed36 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c @@ -379,11 +379,13 @@ int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm) { enum iwl_mcc_source used_src; struct ieee80211_regdomain *regd; + int ret; + bool changed; const struct ieee80211_regdomain *r = rtnl_dereference(mvm->hw->wiphy->regd); if (!r) - return 0; + return -ENOENT; /* save the last source in case we overwrite it below */ used_src = mvm->mcc_src; @@ -395,14 +397,19 @@ int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm) } /* Now set our last stored MCC and source */ - regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, r->alpha2, used_src, NULL); + regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, r->alpha2, used_src, + &changed); if (IS_ERR_OR_NULL(regd)) return -EIO; - regulatory_set_wiphy_regd(mvm->hw->wiphy, regd); - kfree(regd); + /* update cfg80211 if the regdomain was changed */ + if (changed) + ret = regulatory_set_wiphy_regd_sync_rtnl(mvm->hw->wiphy, regd); + else + ret = 0; - return 0; + kfree(regd); + return ret; } int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) diff --git a/drivers/net/wireless/iwlwifi/mvm/nvm.c b/drivers/net/wireless/iwlwifi/mvm/nvm.c index 524ade241418..87b2a30a2308 100644 --- a/drivers/net/wireless/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/iwlwifi/mvm/nvm.c @@ -806,13 +806,12 @@ int iwl_mvm_init_mcc(struct iwl_mvm *mvm) return 0; /* - * During HW restart, only replay the last set MCC to FW. Otherwise, + * try to replay the last set MCC to FW. If it doesn't exist, * queue an update to cfg80211 to retrieve the default alpha2 from FW. */ - if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { - /* This should only be called during vif up and hold RTNL */ - return iwl_mvm_init_fw_regd(mvm); - } + retval = iwl_mvm_init_fw_regd(mvm); + if (retval != -ENOENT) + return retval; /* * Driver regulatory hint for initial update, this also informs the |