Return-path: Received: from mail-pf0-f175.google.com ([209.85.192.175]:37821 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752970AbdLIAe4 (ORCPT ); Fri, 8 Dec 2017 19:34:56 -0500 Received: by mail-pf0-f175.google.com with SMTP id n6so8405917pfa.4 for ; Fri, 08 Dec 2017 16:34:56 -0800 (PST) Date: Fri, 8 Dec 2017 16:34:52 -0800 From: Bjorn Andersson To: Loic Poulain Cc: kvalo@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org, k.eugene.e@gmail.com Subject: Re: [PATCH] wcn36xx: Add hardware scan offload support Message-ID: <20171209003452.GA3441@builder> (sfid-20171209_013501_164954_6196C455) References: <1512725730-19188-1-git-send-email-loic.poulain@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1512725730-19188-1-git-send-email-loic.poulain@linaro.org> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri 08 Dec 01:35 PST 2017, Loic Poulain wrote: > Current hw_scan implementation does not trigger offloaded > hardware scan and seems to only put the device in a kind of > listening mode (beacon/probe-response) for software scan. > Since no probe request are generated by the software, current > scanning method is similar to a passive scan. > > This patch introduces support for 'true' hardware offloaded scan. > Hardware scan is configured and started via the start-scan-offload > firmware message. Once scan has been completed a scan indicator > message is received from firmware. > > Moreover, this patch includes support for directed probe-request, > allowing connection with hidden APs. It also fixes scan issues with > band-steering AP which are not 'visible' with passive scan (due to > hidden ssid in beacons). > I'm puzzled to why I didn't see this when I dumped the control channel that lead up to the initial hw_scan patch. But this looks good and with a related locking issue fixed this seems to work well. Acked-by: Bjorn Andersson > diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c [..] > +static int wcn36xx_smd_hw_scan_ind(struct wcn36xx *wcn, void *buf, size_t len) > +{ > + struct wcn36xx_hal_scan_offload_ind *rsp = buf; > + struct cfg80211_scan_info scan_info = {}; > + > + if (len != sizeof(*rsp)) { > + wcn36xx_warn("Corrupted delete scan indication\n"); > + return -EIO; > + } > + > + wcn36xx_dbg(WCN36XX_DBG_HAL, "scan indication (type %x)", rsp->type); > + > + switch (rsp->type) { > + case WCN36XX_HAL_SCAN_IND_FAILED: > + scan_info.aborted = true; > + case WCN36XX_HAL_SCAN_IND_COMPLETED: > + mutex_lock(&wcn->scan_lock); Grabbing this mutex with DEBUG_ATOMIC_SLEEP causes issues, but that's because the locking in ind_smd_work() is to excessive. Will reply with a fix for this. > + wcn->scan_req = NULL; > + mutex_unlock(&wcn->scan_lock); > + ieee80211_scan_completed(wcn->hw, &scan_info); > + break; Regards, Bjorn