Skip to content

Commit 4fadce8

Browse files
Hancheng Yangkvalo
authored andcommitted
wifi: ath9k: reset survey of current channel after a scan started
In the `ath_set_channel()` function, we only reset surveys that are not from the current channel. This leads to the accumulation of survey data for the current channel indefinitely. This may not be the most optimal approach, as we want the ACS to rely on the most recent survey. So reset the survey data for the current channel at the start of each scan. Signed-off-by: Hancheng Yang <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7133b07 commit 4fadce8

File tree

1 file changed

+15
-0
lines changed
  • drivers/net/wireless/ath/ath9k

1 file changed

+15
-0
lines changed

drivers/net/wireless/ath/ath9k/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,22 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw,
23832383
{
23842384
struct ath_softc *sc = hw->priv;
23852385
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
2386+
struct cfg80211_chan_def *chandef = &sc->cur_chan->chandef;
2387+
struct ieee80211_channel *chan = chandef->chan;
2388+
int pos = chan->hw_value;
23862389
set_bit(ATH_OP_SCANNING, &common->op_flags);
2390+
2391+
/* Reset current survey */
2392+
if (!sc->cur_chan->offchannel) {
2393+
if (sc->cur_survey != &sc->survey[pos]) {
2394+
if (sc->cur_survey)
2395+
sc->cur_survey->filled &= ~SURVEY_INFO_IN_USE;
2396+
sc->cur_survey = &sc->survey[pos];
2397+
}
2398+
2399+
memset(sc->cur_survey, 0, sizeof(struct survey_info));
2400+
sc->cur_survey->filled |= SURVEY_INFO_IN_USE;
2401+
}
23872402
}
23882403

23892404
static void ath9k_sw_scan_complete(struct ieee80211_hw *hw,

0 commit comments

Comments
 (0)