[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201020071243.GA302394@wp.pl>
Date: Tue, 20 Oct 2020 09:12:43 +0200
From: Stanislaw Gruszka <stf_xl@...pl>
To: Марков Михаил Александрович <markov.mikhail@...h.ru>
Cc: "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
Helmut Schaa <helmut.schaa@...glemail.com>,
Kalle Valo <kvalo@...eaurora.org>,
"\"David S. Miller\"" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"illumin@...dex.ru" <illumin@...dex.ru>
Subject: Re: [PATCH] rt2x00: save survey for every channel visited
On Mon, Oct 19, 2020 at 07:06:47PM +0000, Марков Михаил Александрович wrote:
> rt2800 only gives you survey for current channel.
<snip>
> .watchdog = rt2800_watchdog,
> + .update_survey = rt2800_update_survey,
Since this feature is rt2800 specific, I would do not add new generic
callback. It could be fully done in rt2800* code, i.e ...
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
> index 8c6d3099b19d..8eff57132154 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
> @@ -1026,6 +1026,12 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,
> if (!rates)
> goto exit_free_channels;
>
> + rt2x00dev->chan_survey =
> + kcalloc(spec->num_channels, sizeof(struct rt2x00_chan_survey),
> + GFP_KERNEL);
> + if (!rt2x00dev->chan_survey)
> + goto exit_free_rates;
... this could be placed in rt2800_probe_hw_mode() just after
channel info array allocation ...
> @@ -316,6 +316,15 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
> if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
> return 0;
>
> + /*
> + * To provide correct survey data for survey-based ACS algorithm
> + * we have to save survey data for current channel before switching.
> + */
> + if (rt2x00dev->ops->lib->update_survey &&
> + (changed & IEEE80211_CONF_CHANGE_CHANNEL)) {
... and this in rt2800_config()
Thanks
Stanislaw
Powered by blists - more mailing lists