Merge "ath10k: recal the txpower when removing interface"

This commit is contained in:
Linux Build Service Account 2017-04-13 02:19:02 -07:00 committed by Gerrit - the friendly Code Review server
commit b290a7a8e7

View file

@ -4671,7 +4671,8 @@ static int ath10k_mac_txpower_recalc(struct ath10k *ar)
lockdep_assert_held(&ar->conf_mutex); lockdep_assert_held(&ar->conf_mutex);
list_for_each_entry(arvif, &ar->arvifs, list) { list_for_each_entry(arvif, &ar->arvifs, list) {
WARN_ON(arvif->txpower < 0); if (arvif->txpower <= 0)
continue;
if (txpower == -1) if (txpower == -1)
txpower = arvif->txpower; txpower = arvif->txpower;
@ -4679,8 +4680,8 @@ static int ath10k_mac_txpower_recalc(struct ath10k *ar)
txpower = min(txpower, arvif->txpower); txpower = min(txpower, arvif->txpower);
} }
if (WARN_ON(txpower == -1)) if (txpower == -1)
return -EINVAL; return 0;
ret = ath10k_mac_txpower_setup(ar, txpower); ret = ath10k_mac_txpower_setup(ar, txpower);
if (ret) { if (ret) {
@ -5190,6 +5191,10 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw,
ath10k_warn(ar, "failed to recalc monitor: %d\n", ret); ath10k_warn(ar, "failed to recalc monitor: %d\n", ret);
} }
ret = ath10k_mac_txpower_recalc(ar);
if (ret)
ath10k_warn(ar, "failed to recalc tx power: %d\n", ret);
spin_lock_bh(&ar->htt.tx_lock); spin_lock_bh(&ar->htt.tx_lock);
ath10k_mac_vif_tx_unlock_all(arvif); ath10k_mac_vif_tx_unlock_all(arvif);
spin_unlock_bh(&ar->htt.tx_lock); spin_unlock_bh(&ar->htt.tx_lock);