diff options
Diffstat (limited to 'drivers/net/wireless/ath/carl9170/phy.c')
-rw-r--r-- | drivers/net/wireless/ath/carl9170/phy.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/carl9170/phy.c b/drivers/net/wireless/ath/carl9170/phy.c index aa147a9120b6..472efc7e3402 100644 --- a/drivers/net/wireless/ath/carl9170/phy.c +++ b/drivers/net/wireless/ath/carl9170/phy.c @@ -578,11 +578,10 @@ static int carl9170_init_phy(struct ar9170 *ar, enum ieee80211_band band) if (err) return err; - /* XXX: remove magic! */ - if (is_2ghz) - err = carl9170_write_reg(ar, AR9170_PWR_REG_PLL_ADDAC, 0x5163); - else - err = carl9170_write_reg(ar, AR9170_PWR_REG_PLL_ADDAC, 0x5143); + if (!ar->fw.hw_counters) { + err = carl9170_write_reg(ar, AR9170_PWR_REG_PLL_ADDAC, + is_2ghz ? 0x5163 : 0x5143); + } return err; } @@ -1574,6 +1573,9 @@ int carl9170_get_noisefloor(struct ar9170 *ar) AR9170_PHY_EXT_CCA_MIN_PWR, phy_res[i + 2]), 8); } + if (ar->channel) + ar->survey[ar->channel->hw_value].noise = ar->noise[0]; + return 0; } @@ -1766,10 +1768,6 @@ int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel, ar->chan_fail = 0; } - err = carl9170_get_noisefloor(ar); - if (err) - return err; - if (ar->heavy_clip) { err = carl9170_write_reg(ar, AR9170_PHY_REG_HEAVY_CLIP_ENABLE, 0x200 | ar->heavy_clip); |