From patchwork Fri Oct 22 14:04:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 516139 Delivered-To: patch@linaro.org Received: by 2002:ac0:bf50:0:0:0:0:0 with SMTP id o16csp1117703imj; Fri, 22 Oct 2021 07:02:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMqD/B33ob3iA4XXk8IA2SPWrUn7XfUtRhkN9FS7XcyuMyd4XaaJoicUlkwRah+c+QlRhc X-Received: by 2002:a17:902:e801:b0:13f:255:9db5 with SMTP id u1-20020a170902e80100b0013f02559db5mr11316092plg.23.1634911375891; Fri, 22 Oct 2021 07:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634911375; cv=none; d=google.com; s=arc-20160816; b=lZiIDbKBBnFyA3sdfsjcjkOyp4UZjiw0+Pbv9Mu71UOZsZ//KDLQ3yoeRoC4cd3uz5 TZSMPnmng21nllTUdp0Oj+TU7rjnU7kFcP/1Z2zerkZukBT8QRYyPSnsD42utDqiY8kx kOBirJY3L4SRqSKZUSsnDzohY+EhVPqcybIv7FCEOT89yq+yG4Ik1GchlQGGHpWOtm+M VekENJGzNz7/IdJsXVJhcmPkdmWst0eNvcpNChCLEIhANiGaEkdO4bp0ALyyKXs31MuC wF8RKiJu8udh3vnH4Owi1VqFTjA5H67G8PFBtszbjVqUdIixTDjFvbr2hOrewxye1bPe LKcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=a/GR02LRvmhZXUNoP6yEw0D99vBY0DJlIDjtdAO/Ors=; b=VCLtCQ1XWkZva5SFqKqEKoOmSpJcVstzV5+Yar7gsxRYrOQhUYy2qtrU4HDep0phRE chQcJ9lzIaPwdVYBuPAygaFx2XRjeblMogIpXQdkHgqqBfuNL6oOuAAcxDu1Vrw78Eks QjSKSqj9Fqcmrjf8GNCT/7AF6rqAO7bTFyWwwKHIq26xP7C05eLpz7g+gEP6J+0Uco1o e2bBkli6+oN+HJboRnYH02uXUP3s8ucdvS0IHDbTKFZC1mpzDJTreJKVNI4T3iwWvPOE LSDte5TSKTdym/YxEiv0oMerOi0QchmS3KLIs+sqe+xoDRVBuhoB7UR8mDiZAtQ7ZTg1 LcXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=DOY970KN; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bHqRH1IA; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id r6si13744992pgv.247.2021.10.22.07.02.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 07:02:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=DOY970KN; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bHqRH1IA; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=a/GR02LRvmhZXUNoP6yEw0D99vBY0DJlIDjtdAO/Ors=; b=DOY970KNxlcJTr sXnDUaZeWwjrgxnCX0vDhpn04nhO55Dd9eCbCzBjkWI5UgIJmsKcfpmISkln7m9QCNhlitxbh9w8Y 0PtnXeoMzEpihBaly4eNXCerkbZxtUmiF/k0Ka440kNTNodjltCO1f/v9gci1CIwZ+QLeVWXVEhPZ FHI1gqC0AUFJu+ZobshrA5itrSKm4NE3NJ1KYdACcYNfNmRlyUFYAARR6NZAstyFyjKhoMsKG1t61 gdX9KnRRHdA49hXdXWSYT9tYfV+19BUmoyVf3IA9372lrq3DwqSNY0CKINSYfn+v7Y1wmRaR8vPaL nrT6fbexF2+DfiN1kVjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdv8I-00BBEJ-IU; Fri, 22 Oct 2021 14:02:54 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdv8G-00BBDe-07 for wcn36xx@lists.infradead.org; Fri, 22 Oct 2021 14:02:53 +0000 Received: by mail-wr1-x435.google.com with SMTP id d3so1069671wrh.8 for ; Fri, 22 Oct 2021 07:02:51 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=B/qiK0v1pop72OWfh2hJtPvJXhk79SaLDKolKRgysc8=; b=bHqRH1IA5Ys8EvtC3eMmKRwRSl3JC3R2DLrcpJxdn/B9lE6/+Ix/Xs8/KNAycE/JwX SwTE100gRo0KDStpiQPOSvTPYjpU00s6E6b3HPH/qqF10KIyzv5Wo4dCMCKdJSErUGUM wSfXh2zEwFamPlzU5csVynNItHy32i2MBFF9R+V/5V1RD9MHgNAQQ02YisQxeHR2BGNW wtBS4t0bglLv0rZfOFp1JhGf4eWjoy5nCP8sZi9SdQ+9M9hG+BX4Q1j6OCqfyFDD/Kp5 iG2IW64+qjUvJ/b6+9g4KDfNz5tCDopgjPOnAyBxIcwLjUptRbKtyiuFpFuw/xve9cyy JkKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B/qiK0v1pop72OWfh2hJtPvJXhk79SaLDKolKRgysc8=; b=fU/+tdh/RxQ9++TEsEUjK7wohmMDm/xu1Ono9Qwhxx+UCJVH/9hTODN6j+mzfNP5wP ItQknQr0cY4Nl2dD6Po02jYNB7U6vC0fwtPT0DdyWop4pcGjh0MB3jxmBXJXSmSjspiv TryvDV/FtnvzWOR7kJesbwXGXV5dcXQ+xUQRJTI+7v8RGF6tUi9AVVIx3WXFfDGExxpy jWv9mG4bRVHOKfvXrw3rSHjfCT0DSTWeaZuYS5piIS1/bRUN8aCMN32VF6N7PnahQhOy ElFezYtYe/oqQDl+XDV6mCA+9MA80AC8jCb9X9CVwNize9ly0NoGX9kpo3Y3h0IsTsmN XiDQ== X-Gm-Message-State: AOAM530CjSRURtrPHkLqAkFzVoQyJHyGUAKBU5p3K3n2eGfB5HIXvNAE URncURk3naGK25pNBfBopIW3Zw== X-Received: by 2002:adf:dc0d:: with SMTP id t13mr98023wri.158.1634911370204; Fri, 22 Oct 2021 07:02:50 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id u10sm4789913wrm.34.2021.10.22.07.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 07:02:49 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org Cc: loic.poulain@linaro.org, benl@squareup.com, daniel.thompson@linaro.org, bryan.odonoghue@linaro.org Subject: [PATCH 1/2] wcn36xx: Treat repeated BMPS entry fail as connection loss Date: Fri, 22 Oct 2021 15:04:46 +0100 Message-Id: <20211022140447.2846248-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211022140447.2846248-1-bryan.odonoghue@linaro.org> References: <20211022140447.2846248-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211022_070252_064618_17B5DAC9 X-CRM114-Status: GOOD ( 13.81 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On an open AP when you pull the plug on the AP, if we are not already in BMPS mode then the firmware will not generate a disconnection event. Instead we need to monitor for failure to enter BMPS and treat a string of failures as connection loss. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:435 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org On an open AP when you pull the plug on the AP, if we are not already in BMPS mode then the firmware will not generate a disconnection event. Instead we need to monitor for failure to enter BMPS and treat a string of failures as connection loss. Secure AP connections don't appear to demonstrate this behavior so the work-around is limited to open APs only. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/pmc.c | 9 +++++++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 ++ 2 files changed, 11 insertions(+) -- 2.33.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/pmc.c b/drivers/net/wireless/ath/wcn36xx/pmc.c index 2d0780fefd477..592a9416e51f9 100644 --- a/drivers/net/wireless/ath/wcn36xx/pmc.c +++ b/drivers/net/wireless/ath/wcn36xx/pmc.c @@ -18,6 +18,8 @@ #include "wcn36xx.h" +#define WCN36XX_BMPS_FAIL_THREHOLD 3 + int wcn36xx_pmc_enter_bmps_state(struct wcn36xx *wcn, struct ieee80211_vif *vif) { @@ -31,6 +33,7 @@ int wcn36xx_pmc_enter_bmps_state(struct wcn36xx *wcn, if (!ret) { wcn36xx_dbg(WCN36XX_DBG_PMC, "Entered BMPS\n"); vif_priv->pw_state = WCN36XX_BMPS; + vif_priv->bmps_fail_ct = 0; vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER; } else { /* @@ -39,6 +42,12 @@ int wcn36xx_pmc_enter_bmps_state(struct wcn36xx *wcn, * received just after auth complete */ wcn36xx_err("Can not enter BMPS!\n"); + + if (vif_priv->bmps_fail_ct++ == WCN36XX_BMPS_FAIL_THREHOLD) { + wcn36xx_err("BMPS fail exceeded connection loss\n"); + ieee80211_connection_loss(vif); + vif_priv->bmps_fail_ct = 0; + } } return ret; } diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 9469feed1475f..871aab7fd4e60 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -151,6 +151,8 @@ struct wcn36xx_vif { } rekey_data; struct list_head sta_list; + + int bmps_fail_ct; }; /**