* [PATCH] ath9k: reset survey of current channel after a scan started
@ 2023-08-17 9:29 Hancheng Yang
2023-08-17 13:26 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 4+ messages in thread
From: Hancheng Yang @ 2023-08-17 9:29 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Hancheng Yang
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.
Log of hostapd:
[2023-08-17 11:21:51] ACS: Survey analysis for channel 1 (2412 MHz)
[2023-08-17 11:21:51] ACS: 1: min_nf=-90 interference_factor=0.569833 nf=-89 time=36194 busy=20908 rx=16200
[2023-08-17 11:21:51] ACS: 2: min_nf=-90 interference_factor=0.572018 nf=-89 time=36539 busy=21183 rx=16425
[2023-08-17 11:21:51] ACS: 3: min_nf=-90 interference_factor=0.574311 nf=-90 time=36885 busy=21464 rx=16659
[2023-08-17 11:21:51] ACS: 4: min_nf=-90 interference_factor=0.5773 nf=-89 time=37231 busy=21772 rx=16924
[2023-08-17 11:21:51] ACS: 5: min_nf=-90 interference_factor=0.580108 nf=-89 time=37578 busy=22076 rx=17189
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.
Or there's better approach?
Signed-off-by: Hancheng Yang <hyang@freebox.fr>
---
drivers/net/wireless/ath/ath9k/main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index fa5a87f021e2..3e4a711c96bb 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2382,7 +2382,22 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw,
{
struct ath_softc *sc = hw->priv;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct cfg80211_chan_def *chandef = &sc->cur_chan->chandef;
+ struct ieee80211_channel *chan = chandef->chan;
+ int pos = chan->hw_value;
set_bit(ATH_OP_SCANNING, &common->op_flags);
+
+ /* Reset current survey */
+ if (!sc->cur_chan->offchannel) {
+ if (sc->cur_survey != &sc->survey[pos]) {
+ if (sc->cur_survey)
+ sc->cur_survey->filled &= ~SURVEY_INFO_IN_USE;
+ sc->cur_survey = &sc->survey[pos];
+ }
+
+ memset(sc->cur_survey, 0, sizeof(struct survey_info));
+ sc->cur_survey->filled |= SURVEY_INFO_IN_USE;
+ }
}
static void ath9k_sw_scan_complete(struct ieee80211_hw *hw,
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] ath9k: reset survey of current channel after a scan started
2023-08-17 9:29 [PATCH] ath9k: reset survey of current channel after a scan started Hancheng Yang
@ 2023-08-17 13:26 ` Toke Høiland-Jørgensen
2023-09-01 10:43 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2023-08-17 13:26 UTC (permalink / raw)
To: Hancheng Yang, kvalo, Johannes Berg, Jouni Malinen
Cc: linux-wireless, Hancheng Yang
Hancheng Yang <hyang@freebox.fr> writes:
> 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.
> Log of hostapd:
> [2023-08-17 11:21:51] ACS: Survey analysis for channel 1 (2412 MHz)
> [2023-08-17 11:21:51] ACS: 1: min_nf=-90 interference_factor=0.569833 nf=-89 time=36194 busy=20908 rx=16200
> [2023-08-17 11:21:51] ACS: 2: min_nf=-90 interference_factor=0.572018 nf=-89 time=36539 busy=21183 rx=16425
> [2023-08-17 11:21:51] ACS: 3: min_nf=-90 interference_factor=0.574311 nf=-90 time=36885 busy=21464 rx=16659
> [2023-08-17 11:21:51] ACS: 4: min_nf=-90 interference_factor=0.5773 nf=-89 time=37231 busy=21772 rx=16924
> [2023-08-17 11:21:51] ACS: 5: min_nf=-90 interference_factor=0.580108 nf=-89 time=37578 busy=22076 rx=17189
>
>
> 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.
>
> Or there's better approach?
Johannes, Jouni, any thoughts? :)
-Toke
>
> Signed-off-by: Hancheng Yang <hyang@freebox.fr>
> ---
> drivers/net/wireless/ath/ath9k/main.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index fa5a87f021e2..3e4a711c96bb 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -2382,7 +2382,22 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw,
> {
> struct ath_softc *sc = hw->priv;
> struct ath_common *common = ath9k_hw_common(sc->sc_ah);
> + struct cfg80211_chan_def *chandef = &sc->cur_chan->chandef;
> + struct ieee80211_channel *chan = chandef->chan;
> + int pos = chan->hw_value;
> set_bit(ATH_OP_SCANNING, &common->op_flags);
> +
> + /* Reset current survey */
> + if (!sc->cur_chan->offchannel) {
> + if (sc->cur_survey != &sc->survey[pos]) {
> + if (sc->cur_survey)
> + sc->cur_survey->filled &= ~SURVEY_INFO_IN_USE;
> + sc->cur_survey = &sc->survey[pos];
> + }
> +
> + memset(sc->cur_survey, 0, sizeof(struct survey_info));
> + sc->cur_survey->filled |= SURVEY_INFO_IN_USE;
> + }
> }
>
> static void ath9k_sw_scan_complete(struct ieee80211_hw *hw,
> --
> 2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] ath9k: reset survey of current channel after a scan started
2023-08-17 13:26 ` Toke Høiland-Jørgensen
@ 2023-09-01 10:43 ` Toke Høiland-Jørgensen
[not found] ` <CAO6a22UrmZ4b+7gBSYnsUU3qUScKwQmBGA_vB3gDfh2C+=1BWA@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2023-09-01 10:43 UTC (permalink / raw)
To: Hancheng Yang, kvalo, Johannes Berg, Jouni Malinen
Cc: linux-wireless, Hancheng Yang
Toke Høiland-Jørgensen <toke@kernel.org> writes:
> Hancheng Yang <hyang@freebox.fr> writes:
>
>> 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.
>> Log of hostapd:
>> [2023-08-17 11:21:51] ACS: Survey analysis for channel 1 (2412 MHz)
>> [2023-08-17 11:21:51] ACS: 1: min_nf=-90 interference_factor=0.569833 nf=-89 time=36194 busy=20908 rx=16200
>> [2023-08-17 11:21:51] ACS: 2: min_nf=-90 interference_factor=0.572018 nf=-89 time=36539 busy=21183 rx=16425
>> [2023-08-17 11:21:51] ACS: 3: min_nf=-90 interference_factor=0.574311 nf=-90 time=36885 busy=21464 rx=16659
>> [2023-08-17 11:21:51] ACS: 4: min_nf=-90 interference_factor=0.5773 nf=-89 time=37231 busy=21772 rx=16924
>> [2023-08-17 11:21:51] ACS: 5: min_nf=-90 interference_factor=0.580108 nf=-89 time=37578 busy=22076 rx=17189
>>
>>
>> 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.
>>
>> Or there's better approach?
>
> Johannes, Jouni, any thoughts? :)
Ping?
>>
>> Signed-off-by: Hancheng Yang <hyang@freebox.fr>
>> ---
>> drivers/net/wireless/ath/ath9k/main.c | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
>> index fa5a87f021e2..3e4a711c96bb 100644
>> --- a/drivers/net/wireless/ath/ath9k/main.c
>> +++ b/drivers/net/wireless/ath/ath9k/main.c
>> @@ -2382,7 +2382,22 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw,
>> {
>> struct ath_softc *sc = hw->priv;
>> struct ath_common *common = ath9k_hw_common(sc->sc_ah);
>> + struct cfg80211_chan_def *chandef = &sc->cur_chan->chandef;
>> + struct ieee80211_channel *chan = chandef->chan;
>> + int pos = chan->hw_value;
>> set_bit(ATH_OP_SCANNING, &common->op_flags);
>> +
>> + /* Reset current survey */
>> + if (!sc->cur_chan->offchannel) {
>> + if (sc->cur_survey != &sc->survey[pos]) {
>> + if (sc->cur_survey)
>> + sc->cur_survey->filled &= ~SURVEY_INFO_IN_USE;
>> + sc->cur_survey = &sc->survey[pos];
>> + }
>> +
>> + memset(sc->cur_survey, 0, sizeof(struct survey_info));
>> + sc->cur_survey->filled |= SURVEY_INFO_IN_USE;
>> + }
>> }
>>
>> static void ath9k_sw_scan_complete(struct ieee80211_hw *hw,
>> --
>> 2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-05 13:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 9:29 [PATCH] ath9k: reset survey of current channel after a scan started Hancheng Yang
2023-08-17 13:26 ` Toke Høiland-Jørgensen
2023-09-01 10:43 ` Toke Høiland-Jørgensen
[not found] ` <CAO6a22UrmZ4b+7gBSYnsUU3qUScKwQmBGA_vB3gDfh2C+=1BWA@mail.gmail.com>
[not found] ` <87wmx1m2mf.fsf@toke.dk>
[not found] ` <CAO6a22XGGZrja47_M6vQBh0sOw3gMR83H8TcAE8FBJ=Zsd6+ow@mail.gmail.com>
2023-12-05 13:51 ` Toke Høiland-Jørgensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).