ath9k: Fix noisefloor calibration
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Mon, 10 Jun 2013 08:19:39 +0000 (13:49 +0530)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 27 Jul 2013 04:34:10 +0000 (05:34 +0100)
commitdf8c1e2ba1f2f31f6ed28ba3cc4c14a69358404c
tree4f7ca0257e14b314bb165cba528337d7e023548f
parent9990a882ec3cb26b4f9dc15febb769c34846e2a8
ath9k: Fix noisefloor calibration

commit 696df78509d1f81b651dd98ecdc1aecab616db6b upstream.

The commits,

"ath9k: Fix regression in channelwidth switch at the same channel"
"ath9k: Fix invalid noisefloor reading due to channel update"

attempted to fix noisefloor calibration when a channel switch
happens due to HT20/HT40 bandwidth change. This is causing invalid
readings resulting in messages like:

"ath: phy16: NF[0] (-45) > MAX (-95), correcting to MAX".

This results in an incorrect noise being used initially for reporting
the signal level of received packets, until NF calibration is done
and the history buffer is updated via the ANI timer, which happens
much later.

When a bandwidth change happens, it is appropriate to reset
the internal history data for the channel. Do this correctly in the
reset() routine by checking the "chanmode" variable.

Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2: adjust context, indentation]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/main.c