From patchwork Fri Jul 31 02:01:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 247292 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2917507ilg; Thu, 30 Jul 2020 19:01:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJqMDiaRuDlpRYxowV+WhUr9dPa0hINoVbUq/uE9ZnZckLDwRzb4DBPrPlIYVrT4aR6IQj X-Received: by 2002:aa7:da8c:: with SMTP id q12mr1853688eds.126.1596160877280; Thu, 30 Jul 2020 19:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596160877; cv=none; d=google.com; s=arc-20160816; b=M57epGY2izPitvyawFak+VEi9La29IqHZbYxxfVoqoN/YszRkhPibYE5KFeudAjwhp ieVp4dxRxbpviOOGF/km+oxmfarCRdzfi2hOlpW+BJB5ZaVLA+coHMdsqvQUzSOWEH1t eYDV8Foj2Snmmr/ZB/79uDXl4uH8sN6mI/oLJNmNzYP2NZeuNLLLg6bGz4OjOFpVvGks KCFgfKQa7ozwRDP+6SZyfP9uaxQ7KziuLuxclBzmiqLhI+4AOEXACgPULkzvJAo3XU2+ 4vHBUyb8BONo1jlxVBCRQJKR5wgrsk3Z0Yfp5n5aRui0OFKLAhIofDBcsIJ6c5NaUnm7 r8Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hPTOwu7UHWpC3pZFTpj5ZOQFP25apNpGMtND+wg3zXg=; b=VEJBs1yTimDKVt9+9n5MwQXbKoYOhkX7ySq5VEfAlfCmIzHuR8qnzriEudhlwJhCse vHVYqLRlCbgTj7v8Hg9LGHs0vqIX8cVLG3r/CYQ0up2F9REDL7+9ZMwvj1ouefkynMGP nWcLf3L3AGZ4Kiq/XeFbsdLyTVZtvhyY0H/9RDFgVooSfYgQlhbjBWXyZH0wdQmUo9bp 1SfvJ7l0x8GB34wGSg2mNEs/aRWx5Vw5Eym2TVHDR+5Hq9aPrZy0ODIgeoUI0aci/NRR eaPlKAqxpitHHl3WOl/tjRCQ/Vfd9jQdyAuQc7Q0iFB4xoPnaq3SApgfwuSwWGFQKJBB Krww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lj41+Xir; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf25si1466917ejb.618.2020.07.30.19.01.17; Thu, 30 Jul 2020 19:01:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lj41+Xir; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731068AbgGaCBP (ORCPT + 2 others); Thu, 30 Jul 2020 22:01:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731043AbgGaCBO (ORCPT ); Thu, 30 Jul 2020 22:01:14 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48FCFC061574 for ; Thu, 30 Jul 2020 19:01:14 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id t14so2675256wmi.3 for ; Thu, 30 Jul 2020 19:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hPTOwu7UHWpC3pZFTpj5ZOQFP25apNpGMtND+wg3zXg=; b=lj41+XirH/QLRS46SNN6bQxxdThnpuov9wqjQSyOqUHFSRocWesW40WoVTx2HDlVmU lrKWlKAjRRMtap8dGBFve/ld33JEJsZ+LNiDni5JjPFZ+qVEeYqzIKt+zjzCp85Re9UC oLtO7QJvNbfXn/02c36U5XFm/EcF9JQT1MydvG8jY8kA1QotnpJsHK0QJjSumOhwKCC7 Qra4drvA8RYtCTVY6FR2Fbihc3LTJq5s8k1Ovjfjp/lG/WUmVk5B6FMcHfIrkEeR2Qbv St+g9zx5WL9tEmIXwRF8LeVj2LuKsPs/KrHEZG4xHFlwpUzd91oXWj+P+vR0VSqGfyev MQrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hPTOwu7UHWpC3pZFTpj5ZOQFP25apNpGMtND+wg3zXg=; b=RIIXjFU30AkwlOzBXBRhs+mK0cWM/R595+rp4uv6aOBRFBsGQteemAaNA7HgZRQ9oR bITdNcgOGsIAR4dorfhHMB0RiB9AF9mHN6QEzVsSynwGFMWwHdjFkSdauNFy5iIEM1qD TPBkC641L2/ggMixaPBraa//AMgMZHDSoQ6+MUe+DTP01mUJcmPHYU+8UOtLqQ68GcoU E1Qk2dgiiECj8wbiyBFA84MNo3O9bKv/Zt2YOSvc8MayHC1jCht0eQBUYgUN60G2gvYh 4fzgkuEHFX1Js2atr5y9/UNMjnBWh6GwmfSxJlq/pMk2/Kz+QgZNle4plPbTQ/Ylu4vU XY4A== X-Gm-Message-State: AOAM532fpUQChnLGqgnkJ2hvKN2ZxDMxREhw44Sf4a0E8JKhhXHvYp4a yt6zn0BPi4QLUnT6SiSWvvna2w== X-Received: by 2002:a7b:c953:: with SMTP id i19mr1589422wml.103.1596160872870; Thu, 30 Jul 2020 19:01:12 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id a10sm11566954wrx.15.2020.07.30.19.01.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 19:01:11 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, loic.poulain@linaro.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org Subject: [PATCH] wcn36xx: Set sw-scan chan to 0 when not associated Date: Fri, 31 Jul 2020 03:01:57 +0100 Message-Id: <20200731020157.744145-1-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org A patch in ath/pending rewrites the software scan for the wcn36xx to accommodate multiplexing with data, link monitoring and so on. However if a device disassociates from an AP then the last operating channel will not be re-scanned. After some discussion and testing on this topic https://www.spinics.net/lists/linux-wireless/msg201242.html https://www.spinics.net/lists/linux-wireless/msg201254.html this patch implements a relatively simple fix. It sets the initial software scan channel to 0 if we are not associated with an AP or to the current operating channel if we are assciated with an AP. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.27.0 Reviewed-by: Loic Poulain diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index fb8978a3c11e..87fdc073c957 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -697,10 +697,14 @@ static void wcn36xx_sw_scan_start(struct ieee80211_hw *hw, const u8 *mac_addr) { struct wcn36xx *wcn = hw->priv; + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); wcn->sw_scan = true; wcn->sw_scan_vif = vif; - wcn->sw_scan_opchannel = WCN36XX_HW_CHANNEL(wcn); + if (vif_priv->sta_assoc) + wcn->sw_scan_opchannel = WCN36XX_HW_CHANNEL(wcn); + else + wcn->sw_scan_opchannel = 0; } static void wcn36xx_sw_scan_complete(struct ieee80211_hw *hw,