Return-path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:39815 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755810Ab1LGNx5 (ORCPT ); Wed, 7 Dec 2011 08:53:57 -0500 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH 4/4] ath9k: Reconfigure tx power on regulatory update Date: Wed, 7 Dec 2011 19:23:21 +0530 Message-ID: <1323266001-12912-4-git-send-email-rmanohar@qca.qualcomm.com> (sfid-20111207_145404_839416_67268228) In-Reply-To: <1323266001-12912-1-git-send-email-rmanohar@qca.qualcomm.com> References: <1323266001-12912-1-git-send-email-rmanohar@qca.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org List-ID: Whenever the regulatory got updated by country IE for the world roaming cards, need to reconfigure the tx power immediately to increase the power level. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath9k/init.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 41b72fa..999fdc0 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -297,9 +297,22 @@ static int ath9k_reg_notifier(struct wiphy *wiphy, { struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); struct ath_softc *sc = hw->priv; - struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah); + struct ath_hw *ah = sc->sc_ah; + struct ath_regulatory *reg = ath9k_hw_regulatory(ah); + int ret; + + ret = ath_reg_notifier_apply(wiphy, request, reg); - return ath_reg_notifier_apply(wiphy, request, reg); + /* Set tx power */ + if (ah->curchan) + sc->config.txpowlimit = 2 * ah->curchan->chan->max_power; + + ath9k_ps_wakeup(sc); + ath9k_hw_set_txpowerlimit(ah, sc->config.txpowlimit, false); + sc->curtxpow = ath9k_hw_regulatory(ah)->power_limit; + ath9k_ps_restore(sc); + + return ret; } /* -- 1.7.8