[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r1d5krz3.fsf@codeaurora.org>
Date: Fri, 01 Oct 2021 12:35:28 +0300
From: Kalle Valo <kvalo@...eaurora.org>
To: Jerome Pouiller <Jerome.Pouiller@...abs.com>
Cc: linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"David S . Miller" <davem@...emloft.net>,
devicetree@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
linux-mmc@...r.kernel.org,
Pali Rohár <pali@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH v7 20/24] wfx: add scan.c/scan.h
Jerome Pouiller <Jerome.Pouiller@...abs.com> writes:
> From: Jérôme Pouiller <jerome.pouiller@...abs.com>
>
> Signed-off-by: Jérôme Pouiller <jerome.pouiller@...abs.com>
[...]
> +/* It is not really necessary to run scan request asynchronously. However,
> + * there is a bug in "iw scan" when ieee80211_scan_completed() is called before
> + * wfx_hw_scan() return
> + */
> +void wfx_hw_scan_work(struct work_struct *work)
> +{
> + struct wfx_vif *wvif = container_of(work, struct wfx_vif, scan_work);
> + struct ieee80211_scan_request *hw_req = wvif->scan_req;
> + int chan_cur, ret, err;
> +
> + mutex_lock(&wvif->wdev->conf_mutex);
> + mutex_lock(&wvif->scan_lock);
> + if (wvif->join_in_progress) {
> + dev_info(wvif->wdev->dev, "abort in-progress REQ_JOIN");
> + wfx_reset(wvif);
> + }
> + update_probe_tmpl(wvif, &hw_req->req);
> + chan_cur = 0;
> + err = 0;
> + do {
> + ret = send_scan_req(wvif, &hw_req->req, chan_cur);
> + if (ret > 0) {
> + chan_cur += ret;
> + err = 0;
> + }
> + if (!ret)
> + err++;
> + if (err > 2) {
> + dev_err(wvif->wdev->dev, "scan has not been able to start\n");
> + ret = -ETIMEDOUT;
> + }
> + } while (ret >= 0 && chan_cur < hw_req->req.n_channels);
> + mutex_unlock(&wvif->scan_lock);
> + mutex_unlock(&wvif->wdev->conf_mutex);
> + __ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0);
> +}
> +
> +int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
> + struct ieee80211_scan_request *hw_req)
> +{
> + struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
> +
> + WARN_ON(hw_req->req.n_channels > HIF_API_MAX_NB_CHANNELS);
> + wvif->scan_req = hw_req;
> + schedule_work(&wvif->scan_work);
> + return 0;
> +}
This scan logic looks fishy to me, but no time to investigate in detail.
Though not a blocker.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Powered by blists - more mailing lists