From patchwork Fri Mar 19 16:15:09 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: 404807 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511040jai; Fri, 19 Mar 2021 09:13:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZLmaScgYDPDzZvKnccZghCDVnuTPBqsjwVW6JlYYKDpWWyN47QhlJQuhB8WTBozjHPy3c X-Received: by 2002:a1c:4b0a:: with SMTP id y10mr4326760wma.141.1616170439546; Fri, 19 Mar 2021 09:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170439; cv=none; d=google.com; s=arc-20160816; b=MhKA54sgRPUpuLmQVBJkgVqONf+h9YMvPZNYgb/NA6GwBjGBmseQv93Aw1ySq7PRR5 MT+CXaoHA09OpryOOJj3zAFGbdasxKfnSfk7mpid47lZZGGAtqktefMF/NrZ/eTJPTN7 ZpwEc62UmOArw7qAORUkPV+zsETos0Wrqh9/wFrxuvkIT6iRK5FmswU/UqIbWA3hmt8+ XRrg1j9KSajPq2+Va7PWQWGSdHrBw839vxr0kMBT97K8b5VrdDWX6BKaRHn/egG9ONxX nKL0ZZqpQtmqyBa0EP83+dwlMvXN06McFi7ghYs8k9d8pqdZZgrK7rCZLa9zL32ANS9K RURg== 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=Uhh6/zDuhVKLgIbB0ELzpssNRJSmxCYu2IUG+rFgHI0=; b=M9Le7tRrI++1wnuSuYLiZzp8Ckp4VhQiBpCn8CBULCrcwU34ujlWtWIWe86OTA+LAG EuSwEaxWdg4l77e477GeftzAgT22xr31Fo8r2n0kq6YML7y1J457sqcl2BYKeSamuES6 +BLcop3Trd3q8AxzEMFVlgyqE3suTsV89HlhQ2bXgCPdol1zyOjpUn0/L4utM6AoKS2Z 048ddLIY+CriBrZGCYK+VdDONL20I+owFgbp6gXQY/9YHXyVP+6LyC1Ar3ner0pAuiwN Y1XJi2O3hqMth3lBSOWL7lwDXE0EC7B+Q/Ek2VmummnlVljyGKKc9/cJMcuHV/unFqo3 Puyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=aK1r4h4C; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AedZuECw; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id q136si5838135wme.149.2021.03.19.09.13.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=aK1r4h4C; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AedZuECw; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=Uhh6/zDuhVKLgIbB0ELzpssNRJSmxCYu2IUG+rFgHI0=; b=aK1r4h4CbAtCNXKNqZQ5Ekp2/ vMkY2YMBvaBGcy+DMPxaycpI6gcZdecBIFY2YI7+7ZmunUJymXA3vZWobmj1Wmuhk1/K70U1SboC5 Z7We3bNfHv27Pt9GMV/AlLtsjo8nzbNPxbR7x9M+4KWl+s5XlbxzeA9zblrSGTnuc3ylSuWvB/DWd vB7nOA1aAbwJN34sasmK+SUEViW96uYBjgaERp8+xX3yUDML9cbHFluBV5zqtRuLi0CR3/fkkwM20 f+OvnYEJl3AEGoV9tTjaNA2skOvHxn0qFKZcCEr71dLtIRxumMqCDm7xA9Ti17yMxW9sXy/DPuYr6 fIJPLalmA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl8-007foT-0H; Fri, 19 Mar 2021 16:13:58 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl3-007fmp-UC for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:13:56 +0000 Received: by mail-wm1-x329.google.com with SMTP id t5-20020a1c77050000b029010e62cea9deso5569169wmi.0 for ; Fri, 19 Mar 2021 09:13:52 -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=NYk+e0v1fIIJdNtGGm5pPGaN1woGIuYcsbVccpj5KvM=; b=AedZuECwrE33A9fA14xe/DNOpQSLgC2xQd0+gzgZtl/EXoSdLBYT0E5lfUPXcsElFs ilctEP2k15ssyFmiSYbGwAxIQz1eYRO0cWJoMR8MW5mPTyrqLbKDC6wTcKksMV9TXLbU AZ9yNYJ5yVIP54nNEEEhd62iKsAiB1La7JDOmFV+yQvDmPing/dYR1nt+SaQ7zCuRBiK XCp9aiCh3QxsYRkOkdQ8pl2oVSLU5aiY4qChREh6vhj0i9Zqz2Zhrk9W4ptwRMR4X4xP dr9LTlMq9PAA8tZdr/j8UmH5ce3fahaUaBU26nQHyPJIXvNwfVp+XWgmUHD7wWYf2H/c m3Mw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NYk+e0v1fIIJdNtGGm5pPGaN1woGIuYcsbVccpj5KvM=; b=rOtWRJvcNxGbM/ashAVjOLAW9iKrne8mIXtYtrNOKPg9b9DLdFG0x19BwwhJqxWVjG Ai6uHV1uB1+8XmxZnNp/Br655oaMUMTYXnF2qi1iATkwq2Cwz6WJRzPVMeZgzfvdpPp0 PKkTi++joKUTW4t+pV4T0eccBfOUZdVRMTVYgyBl9TfJzkRxv0+MEmH02GVfwIaIHFLm L2VHhw4XM6NCKdUr2e+hqhQl0qWPCwJ47VvNGe1i7Zvfymuk25Mq/JnrZm6Nn6LQK1tY t7Sl2dkTBko1GpcOVqjOyTcVmZrnTs5XiTHIKJID0RgCwnMGI/sZe+NLUf21xBJ7nj2j wdHg== X-Gm-Message-State: AOAM533ygZyJejn3lBZIZF3mCFnwbe8BetyWzl1/NpNBIqeEEpBto4ci /JJVNaKWx0U1NCMAnqDmme/M370nNM/hVcgL X-Received: by 2002:a1c:65c2:: with SMTP id z185mr4468920wmb.2.1616170432596; Fri, 19 Mar 2021 09:13:52 -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 h8sm8432495wrt.94.2021.03.19.09.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:52 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 01/12] wcn36xx: Return result of set_power_params in suspend Date: Fri, 19 Mar 2021 16:15:09 +0000 Message-Id: <20210319161520.3590510-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161354_060510_666A9448 X-CRM114-Status: GOOD ( 11.48 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: wcn36xx_smd_set_power_params() can return an error. For the purposes of entering into suspend we need the suspend() function to trap and report errors up the stack. First step in this process is reporting the existing result code for wcn36xx_smd_set_power_params(). 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:329 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 wcn36xx_smd_set_power_params() can return an error. For the purposes of entering into suspend we need the suspend() function to trap and report errors up the stack. First step in this process is reporting the existing result code for wcn36xx_smd_set_power_params(). Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index afb4877eaad8..b361e40697a6 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1091,12 +1091,14 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) { struct wcn36xx *wcn = hw->priv; + int ret; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac suspend\n"); flush_workqueue(wcn->hal_ind_wq); - wcn36xx_smd_set_power_params(wcn, true); - return 0; + ret = wcn36xx_smd_set_power_params(wcn, true); + + return ret; } static int wcn36xx_resume(struct ieee80211_hw *hw) From patchwork Fri Mar 19 16:15:10 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: 404808 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511050jai; Fri, 19 Mar 2021 09:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW/tVHbxlEyJ5rMDGe49X8AVZ2cp48e2hxjGdcsfTEYfCvzaL3WwjaNBZevQUHkoCuXBec X-Received: by 2002:a1c:4b15:: with SMTP id y21mr4554274wma.94.1616170440995; Fri, 19 Mar 2021 09:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170440; cv=none; d=google.com; s=arc-20160816; b=RAKQ75fPHhb8AtZMEcTJoRpePrEDemRhf0u0JPXzKwXEkofwRhHdRnWW3GS4WMEI1K ddSXw5AidaydS1LiUTzBmLFcEW3+zq287HjpbpTVbqewfEpDFjdlc3CkczapFKMon5+b Ec08XhZ3lgRPUaUFXPFkSpURAUHSyt5dkcsNy+vthCeZDZxD5bs0sLIZDjAC6Tt10Wru Ssjkt6C+YwnUlsNXD6GEZvs6TYFwcj+0ZDpxJMAxpUvGjtEl8D7kl1sfS+9ZVayhZMob zrWnIfHWZa04QU0JwfkRjj4+HVbmpaP9pGCVB0HiuEuGy30Ib4YSu0t4txLezIlq2AfL p3ag== 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=o8fAenoFlnSlV36U48yb6QP9ENkXDuWvkUY+yXUw1LI=; b=J2k7Yg3YEC6kI166gn7Cuzngqa4fzPGbgFBQukZ6sHBNBT27j1ndLj4/ZBlJZoz0vD XDY6Y4c1Er8bRq9g34QQa5eWnnKf7jGfMd9xrRPU5PqPe6BfOBbwU9KToIsVyRvgi7k5 LHpXjMAyJzl4Bv1fKA9QGwDZVjaxe9pwmncFJ9U6gXUOLcrbGuVuRWRkQiZ7+BKK3Kbh 76E8Cr93sLZeiLDwQBU+gk7/Y5BXx4edOjI7OcGgY5gZmII11vWQfjMrKnl9l+9jjTJ+ fqnbbo8Ylzp1pKm2b7sRAZfYKDUT7f1nwWE20+pH6IO6r3WkI7Pesv4rv+XF5OIvzQC9 GBmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=KEsc+Kda; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=k3FG7wJB; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id p25si11210985wmi.2.2021.03.19.09.14.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=KEsc+Kda; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=k3FG7wJB; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=o8fAenoFlnSlV36U48yb6QP9ENkXDuWvkUY+yXUw1LI=; b=KEsc+KdacZLqKfxEGGSg3EuF0 Ows8vAE8H4cKIlSIH69moLD8dsl6aKuoACnh0L337cZAnx3bQPhxiDKS9zKw+lOTEBrPxMb7CNohz 3T1Fn2j+KVtTQslLpgmO4eJKSiDrh1WLcgeVbdEFV0XlWyzelh/6Btkr4KlzcaZRBCkIm8g54gDUc lT6kGmBdY2XDlqIOsPzlF5kS4A9OgnYM1Y22rVhS59N0LWswuJyU5cRioKb84iavh3SjbsRoovgAt 82GvkJYN42M14q8fKz2Xlarr8qc7HTuEFG6uv+9uB+WKUD6TRuekVNtRB/YXMc05DuZMbLwDLQXF1 0ERYZm/Ew==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlA-007fpQ-1y; Fri, 19 Mar 2021 16:14:00 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl4-007fn4-5W for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:13:57 +0000 Received: by mail-wr1-x435.google.com with SMTP id v4so9659128wrp.13 for ; Fri, 19 Mar 2021 09:13:53 -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=jZ3WKCazIuoUxdRWj4Ban4JPE+r27UOCDH/EMw86Dwc=; b=k3FG7wJBZz1iduVEW3wZy1SPnWvZELKBBbQbcDV//CRTtVHBesiBTWh9RaTdZ0rymx 9Tk8VAswPI8ggFJLzgvbDSV+7+sRTpAhjTcNOQylgw6PVOt/ehUHty+4OBEp0SPWuCp9 FM/9KDPz6SgqR3IA+NlsAR0cgwiy+fgM2s9VNdafH0Rp1/urcy+afUY+hilSkIybj8nH liRyMCRS4SPW6HGl1733KuaXJ3k3hFyV04+oxwzXWJCSe+ZxP2+7ICOwrUCX9tfpaY2T ZFa07xcMgKOB9ysCz0m06qDDq0y7+HPhThMgIp5QqhTUju/S1XzlNgGp9BZ3hktEhWCT Jh/g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jZ3WKCazIuoUxdRWj4Ban4JPE+r27UOCDH/EMw86Dwc=; b=nbGv4p7WyLeEcLb1FLbb+rI0GHbHWSnRi065Q9xxXNDw17Iw9AkbcXkb/j2h1duREG 38vZRRFzQnjVgTZP9+0Ckn8c7MslsPLeeE+vESXFGHXuWLLAhwTZ59Kf3KvmSxNiAd+Q svLyx2HwTxcxIfChlV/8X+xoC9oqWAKtquFdM6xLwWyAs0l7DAsacttqMeW6TNhAZoC0 KstiuoyExwHP+fVpPCN0HEYRElkNCor94btNZoNrTitnfUD3y9OcKami43LRexhrilUH qkyRbalZpPY94RjYHqe6Hf72fspFGKMcZvWYUcDBFrR3+PwSBvEXBrgJGk2icJHmJSNM hM9A== X-Gm-Message-State: AOAM532uUfZchqGJ1p5n347g3X31ECmk88rrfqZvWsR7txV2j0USmUIS pfsWsJMuhcYwhtYj4naW3ETrTz43xygsBmWr X-Received: by 2002:adf:f648:: with SMTP id x8mr5331023wrp.157.1616170433548; Fri, 19 Mar 2021 09:13:53 -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 h8sm8432495wrt.94.2021.03.19.09.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:53 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 02/12] wcn36xx: Run suspend for the first ieee80211_vif Date: Fri, 19 Mar 2021 16:15:10 +0000 Message-Id: <20210319161520.3590510-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161354_405281_292A5930 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: A subsequent set of patches will extend out suspend/resume support in this driver, we cannot set the firmware up for multiple ipv4/ipv6 addresses and as such we can't iterate through a list of ieee802 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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] 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 A subsequent set of patches will extend out suspend/resume support in this driver, we cannot set the firmware up for multiple ipv4/ipv6 addresses and as such we can't iterate through a list of ieee80211_vif. Constrain the interaction with the firmware to the first ieee80211_vif on the suspend/resume/wowlan path. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 43 +++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index b361e40697a6..c0c1ea18864f 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1088,15 +1088,39 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, #ifdef CONFIG_PM +struct ieee80211_vif *wcn36xx_get_first_vif(struct wcn36xx *wcn) +{ + struct wcn36xx_vif *tmp; + struct ieee80211_vif *vif = NULL; + + list_for_each_entry(tmp, &wcn->vif_list, list) { + vif = wcn36xx_priv_to_vif(tmp); + if (vif) + break; + } + return vif; +} + static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) { struct wcn36xx *wcn = hw->priv; - int ret; + struct ieee80211_vif *vif = NULL; + struct wcn36xx_vif *vif_priv = NULL; + int ret = 0; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac suspend\n"); flush_workqueue(wcn->hal_ind_wq); - ret = wcn36xx_smd_set_power_params(wcn, true); + mutex_lock(&wcn->conf_mutex); + vif = wcn36xx_get_first_vif(wcn); + if (vif) { + vif_priv = wcn36xx_vif_to_priv(vif); + if (!vif_priv->sta_assoc) + goto out; + ret = wcn36xx_smd_set_power_params(wcn, true); + } +out: + mutex_unlock(&wcn->conf_mutex); return ret; } @@ -1104,11 +1128,24 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) static int wcn36xx_resume(struct ieee80211_hw *hw) { struct wcn36xx *wcn = hw->priv; + struct ieee80211_vif *vif = NULL; + struct wcn36xx_vif *vif_priv = NULL; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac resume\n"); flush_workqueue(wcn->hal_ind_wq); - wcn36xx_smd_set_power_params(wcn, false); + mutex_lock(&wcn->conf_mutex); + vif = wcn36xx_get_first_vif(wcn); + if (vif) { + vif_priv = wcn36xx_vif_to_priv(vif); + if (!vif_priv->sta_assoc) + goto out; + + wcn36xx_smd_set_power_params(wcn, false); + } +out: + mutex_unlock(&wcn->conf_mutex); + return 0; } From patchwork Fri Mar 19 16:15:11 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: 404810 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511071jai; Fri, 19 Mar 2021 09:14:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCbwxTFGlL3jiv+qEf/UuWAQ+dtHjgMDA8pmQOA9EktNEMsqjI4dIvq2Frl0rah/WscK2f X-Received: by 2002:a1c:22c2:: with SMTP id i185mr4391460wmi.99.1616170442366; Fri, 19 Mar 2021 09:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170442; cv=none; d=google.com; s=arc-20160816; b=dhRUhSGnAykjqYjxaiOqf6+z6PTJyEdPimYBH3swoUPC+gtBZ4E59iBhEtx9p2R3R1 zhxuz0hdhj26fFXrgar+Q1VJ2Q89wDn5O08flA8i+VaXIX4fGwO2fB9WqCFnWGSDc5bi L0pKOaaZHdZi3FuPnv5c3TbYWmA++MeFJtdvFXlwjHJa2vVMIWM2XMlIC6OltLhKrrG8 xFvkV1zhAf5XDNRWbl8CEQJUWWIR9unaIHqi4i8bWyose8pXTOqmE4FFVX6UcgA1r4bq 0+bcU8zHTs+ojNsUc+MXSds+8O6dHpzfaLuuzyi3Kg1FhsnYjX5UUWWUTBlNcDlsrpZy q6Fw== 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=Uc9yR4U+SsfQ2cG78qNkRSLZXJR44TKlwJox0BbAwVo=; b=Yf+0WZIBzUzteoA6JFNVPBXjfA6Yw0lXRTpuOSXQXbeWkBfR1yzUND9thA9YZ2i0Xt 5jyeHpIymidcTsqF5tjGnlPyxduUM7jtZ8ZhGZ+pBl3bF78DunW//XHJHSxHVB/EzP8k kL2L6SLl5djkfyKgmGtNrj2/8gi9wiLjQIgll5yXnnVHEYMxESeFPsuifO5YUWgssERF HZ/7MdcrcF9pQbY3EgtZVCrAOmJkBN3HGrDlmOenFmUyF5CNwWPmejwpp82U5Da/6dqF YBQnYT0RL6vj0v8k3PfCJAdHsvGYLVfymEuNUgFkjPvvPTiVFB7wIMN1Ms4y6lomq0pT Voog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=WGO2D7rh; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TZNWcdmY; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id y23si6670990wmq.106.2021.03.19.09.14.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=WGO2D7rh; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TZNWcdmY; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=Uc9yR4U+SsfQ2cG78qNkRSLZXJR44TKlwJox0BbAwVo=; b=WGO2D7rhYFKzMGTr34o3/mpGh oQ1IKEMeZOThz4PWU+oOzyuvBX2xyYVtzAejjU/TXeDwifnuVyM0WQAzNDJivUUZpIvpgOYPl2rRC KEq3Y1ST0ILPtDsKhnfVbgpV8NVk+o3pnBF83K8nfkEzRHFqxA3a68BVQhzRoKoMF1/fpmLrjDqgq jnR/l0ujXbDl9AAKwoqglXBPrZeM8iUtVxZAmzmVEqTK/yTIl0rW0LmCT1MQwlx0vHgVUV3Z7FYjE Rij/wM3/fvK1hecsJDeLXejEkiPcjxDk+zL89I9XhF9Rl1DqC3IPJyGAMlUhr2NjKsmoTKgI5y05x xG07R25Gg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlB-007fqY-Ls; Fri, 19 Mar 2021 16:14:01 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl5-007fnV-6T for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:13:58 +0000 Received: by mail-wr1-x429.google.com with SMTP id b9so9675007wrt.8 for ; Fri, 19 Mar 2021 09:13:54 -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=GoM6r0aQNFv6P86Jh2bARDY3W042U1bUTvbdF/AjcU4=; b=TZNWcdmYEv08+34PvPBQAY7RzSTbI+8VlO6tgYiQz/firqfWoC21Sr1exlbRXbSMC1 PT5xvNUQA69BcdlOL1JicFDS+93OlwUn74W7uMf1l/LsQaOjpDfJe3rYvagvJLLiP34+ JELybyx8i332BlJkWIXi2f3xhzFWEFnfWGd4LiTqzeQpG6+jS3YdhE/f05KGgUuEJrei AK0tLBW8atzVt5Q49A2Kb6dZ0XnWIfITlEceMKVD5BbiyqrlWR07EoeflUWdjj3l6Xoh ubSWr54dVqjqzqBx4iXLm1nGUKotsVz98pd+AsJtB0hX0oHnf+Cd6j6B1PoF9zDWPo85 CIww== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=GoM6r0aQNFv6P86Jh2bARDY3W042U1bUTvbdF/AjcU4=; b=nZUTx5NGek4qVjiJwN7dZ6HQBlSuUSJGzxtZhab6wJRPKU8yvgc6roSOqCi3xc6Z1P DlQ7U/16m1f8F5t1KqhRxVjUSzd0S68ELmNvOB40/ujkdOry/9KAHI5GGawaRxTd+PR4 kPgKrXwHLD8tvadQbulceUCZnfIdTxithXbMng+xyoq8X5XHAxk8OLOfuvv/A8F8KpWR x/nMh37Xlgd0fJD0qrogCM8GNvREc7mYBTHrpERYfO7G+u4RRc4FfZ8RuvVjeU2RUK5/ kA2vmU4xwLmggG56T7RbJ4Clxwfzs5mmm8YZCI6E71Q+2iBzjPwAwnwMhZeJvJ1M7ZBl PRoQ== X-Gm-Message-State: AOAM532o5zbCxt0ntvAYMYQT53Fwj+DAz0mz2cmNcGw0eMChS/oWRv2M A0u2myOZHS9xXbGueJnqSC+jfd/anhFBtWWX X-Received: by 2002:a5d:6406:: with SMTP id z6mr5360069wru.264.1616170434676; Fri, 19 Mar 2021 09:13:54 -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 h8sm8432495wrt.94.2021.03.19.09.13.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:54 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 03/12] wcn36xx: Add ipv4 ARP offload support in suspend Date: Fri, 19 Mar 2021 16:15:11 +0000 Message-Id: <20210319161520.3590510-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161355_346643_BECA28FC X-CRM114-Status: GOOD ( 16.10 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Add ARP offload support. Firmware is capable of responding to ARP requests for a single ipv4 address only. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 10 +++---- drivers/net/wireless/ath/wcn36xx/main.c | 5 +++- drivers/net/wireless/ath/wcn36xx/s [...] 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:429 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 Add ARP offload support. Firmware is capable of responding to ARP requests for a single ipv4 address only. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 10 +++---- drivers/net/wireless/ath/wcn36xx/main.c | 5 +++- drivers/net/wireless/ath/wcn36xx/smd.c | 38 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 4 +++ 4 files changed, 51 insertions(+), 6 deletions(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 65ef893f2736..b56c8292fa62 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -3465,7 +3465,7 @@ struct wcn36xx_hal_rem_bcn_filter_req { #define WCN36XX_HAL_OFFLOAD_ENABLE 1 #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE 0x2 #define WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE \ - (HAL_OFFLOAD_ENABLE|HAL_OFFLOAD_BCAST_FILTER_ENABLE) + (WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE) struct wcn36xx_hal_ns_offload_params { u8 src_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; @@ -3487,10 +3487,10 @@ struct wcn36xx_hal_ns_offload_params { /* slot index for this offload */ u32 slot_index; u8 bss_index; -}; +} __packed; struct wcn36xx_hal_host_offload_req { - u8 offload_Type; + u8 offload_type; /* enable or disable */ u8 enable; @@ -3499,13 +3499,13 @@ struct wcn36xx_hal_host_offload_req { u8 host_ipv4_addr[4]; u8 host_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; } u; -}; +} __packed; struct wcn36xx_hal_host_offload_req_msg { struct wcn36xx_hal_msg_header header; struct wcn36xx_hal_host_offload_req host_offload_params; struct wcn36xx_hal_ns_offload_params ns_offload_params; -}; +} __packed; /* Packet Types. */ #define WCN36XX_HAL_KEEP_ALIVE_NULL_PKT 1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index c0c1ea18864f..f95103706100 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1117,11 +1117,13 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) vif_priv = wcn36xx_vif_to_priv(vif); if (!vif_priv->sta_assoc) goto out; + ret = wcn36xx_smd_arp_offload(wcn, vif, true); + if (ret) + goto out; ret = wcn36xx_smd_set_power_params(wcn, true); } out: mutex_unlock(&wcn->conf_mutex); - return ret; } @@ -1142,6 +1144,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) goto out; wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_arp_offload(wcn, vif, false); } out: mutex_unlock(&wcn->conf_mutex); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index d0c3a1557e8d..478e363610e1 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2756,6 +2756,43 @@ int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn, return ret; } +int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_host_offload_req_msg msg_body; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_OFFLOAD_REQ); + msg_body.host_offload_params.offload_type = + WCN36XX_HAL_IPV4_ARP_REPLY_OFFLOAD; + if (enable) { + msg_body.host_offload_params.enable = + WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE; + memcpy(&msg_body.host_offload_params.u, + &vif->bss_conf.arp_addr_list[0], sizeof(__be32)); + } + msg_body.ns_offload_params.bss_index = vif_priv->bss_index; + + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); + if (ret) { + wcn36xx_err("Sending host_offload_arp failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("host_offload_arp failed err=%d\n", ret); + goto out; + } +out: + mutex_unlock(&wcn->hal_mutex); + return ret; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -2804,6 +2841,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_8023_MULTICAST_LIST_RSP: case WCN36XX_HAL_START_SCAN_OFFLOAD_RSP: case WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP: + case WCN36XX_HAL_HOST_OFFLOAD_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 462860572e1f..6492a628ea6a 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -146,4 +146,8 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct wcn36xx_hal_rcv_flt_mc_addr_list_type *fp); + +int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable); + #endif /* _SMD_H_ */ From patchwork Fri Mar 19 16:15:12 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: 404811 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511109jai; Fri, 19 Mar 2021 09:14:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+0/5lvzfnq2tdOXKuZQafMmXTlOW4dv5dDP88Sw+E0z6PKVWIKNLyXO4iLy1h8yz4cfcP X-Received: by 2002:a5d:4312:: with SMTP id h18mr5284780wrq.193.1616170444172; Fri, 19 Mar 2021 09:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170444; cv=none; d=google.com; s=arc-20160816; b=usjEToyrCKvGwJ9ypsf2rq7TY8phOu5ng7DWbIkjxWimOaL4svIgMXHoru4gcuKK6z YLLQOBeHp1CNqsBQaqBWTjCQ7nEPEZxhn9p693nBq1ZhQL4rt8O2jODdR5hZVkmNNYgG ul/k809XRAFyDmpH2bKNxcLuWwDSwORHYdZX3JUuT5vTJYAmA+xor9Y+0UFzVBUOyWfA yBiMpOBNIVZ/ermT5qGlmzuhUB5nkVfAMiC6Fltm57TOSbsLBJpXG/Pp2BGbd9qLf0t4 pI0Q8D0+ftWdJmuLyippYbhxrmy9MEXDI5bqA/s3t9hiCWSNGoj+b5v02IIBBY9lSkXS Smmg== 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=ONM5GkB5kPcy3a4NGrSsd/sk7+A5jPjRWQtEmYfbyNA=; b=wv2G1xuHoo9hFHc+1RzUjkBMZZhuAFkq3xSukriWyEb2E+/FJsrfBlUFT06Zq7JeCK KDiJT5f2Id7im8Ig/avLc87DyM6aTwL9yVgiVy1PBhBSjxnJCONR1D0/Q3UxloHxK+68 SPOyp9nEEytwBSKUZYr+SS3APG6C0WHOfBV+2exJbtZ6aZbgQBLxQ3FCpp7l0N7jRA8b rlSIhKCO0x+kmC17jmC4SFH1X7qcp+SCG+dWX5RC290Z3aoZBW9VpQK9M47miVijoO8d 26yyXNL1EHA2MWC0kFcQb/LY4lItlt41Oa7qoVrHWeAjC7zKA6ml01SMRJYHW96Niscz voxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b="i/6UyIwF"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LSnkFoSV; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id o34si5275886wmp.201.2021.03.19.09.14.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b="i/6UyIwF"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LSnkFoSV; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=ONM5GkB5kPcy3a4NGrSsd/sk7+A5jPjRWQtEmYfbyNA=; b=i/6UyIwFcKfyUJsRgmBY6O+1T 4JU+H95DOIZc/kUWq9fKKdwxLuLsbVgFTXKHFuPI4/q/LtXrPztvMaEffVxugsvO5Ff33sSkhJy+G VXTAuj2yjGCD5u/e4MSFcg6kJ3O2r4Wxhk1w2Pf28fJImjo0QEvE/qCaBKSUAFQdjYX0RvgokdZGM Qqt14StQTma7ufzQdja2ytlf1qJrC9nnZtzl5UTSm81X0OqEczfWjFr1eJEBqut0lXP7o39o9v0QT Nc8LW0T/ul+MRWY3gD8XbFge/zUr9ZMcqzF3K/YU3WCx0bbAbdR1Ov15IH5IuW1we7MQBY60fcemj Q/pWGHRgw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlC-007fqt-IU; Fri, 19 Mar 2021 16:14:02 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl6-007fnm-7y for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:13:58 +0000 Received: by mail-wr1-x434.google.com with SMTP id o16so9685572wrn.0 for ; Fri, 19 Mar 2021 09:13:55 -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=PK1ysPzp6vM3CYkwLCzyPDUUfmW5NdD9G7dghbyOwwQ=; b=LSnkFoSVtANfomNnx6mRhQic961DuP46T62YwfvYO0LHO6hp+6mOmR6MwM+7ZIxaO3 xRqB63p2KLjViOS2v4dl4ixH6pNsxKHk4QNvzpYuu7a5UNBwdYmWEe7YngT2v2GyG/56 9CG17xbss42HWIbzm8/DCUqT05sVSB98L4vrBzXR5Myl7JLECgfdeUhxNk0A35JVcb5c VPr8pMcpvoF9QKECpd0JtDmp+A0xKNI0cKp/HTeRWT1KyFqxZKLki6JA6khNBF0erC3R pqQT3yarx3eTiPARa8m70DL9Q1QEcLrm+jVstH7PEt6SoQL8yhDwaqrzpVtmc3/rWqIG plRA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=PK1ysPzp6vM3CYkwLCzyPDUUfmW5NdD9G7dghbyOwwQ=; b=kFMtbNod/ASi+qraSKwKKDV/zPy5m3lZ7Ycas6/9fqCvto7uotxPHIx7SSyRFmJ7v1 42yBRTnAoU9cNy7Il+STboef5X4HUAIP8EcRF1UUN+MKe330tWtpipomOSOPE7gXdMRb 7xNRyi9j7cDT/Cg8YGopJbSJHaZGTvr5oRrTxkae0zCIJVLF1x6dnWUhEsPa+u2A0UzQ E/0PGcNJN8dg89ncJWuABch55pf/tUK42cs2Kk0oAtMi1OcaWEu6AKpV62eqBURXTsd/ kjSBwHU77Vps9TrlhA7Md8Vug1GfFDiszKXmupaFdjv9o5J0qVja6WFML9M6xJKXJkEe xtfw== X-Gm-Message-State: AOAM533znNkMvFoK4WSJNfyDG/EKeNOe8QsBz3tu5TnZW3RWfKv39QS8 cQP+HI5MJhxcuGDj9oGeDmhbbg== X-Received: by 2002:a5d:4203:: with SMTP id n3mr5266334wrq.116.1616170435727; Fri, 19 Mar 2021 09:13:55 -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 h8sm8432495wrt.94.2021.03.19.09.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:55 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 04/12] wcn36xx: Do not flush indication queue on suspend/resume Date: Fri, 19 Mar 2021 16:15:12 +0000 Message-Id: <20210319161520.3590510-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161356_445320_4B8794A2 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Testing on Android reveals that the flush on both suspend and resume of the firmware indication work-queue can stall indefinitely. Given this code path doesn't appear to have been exercised up until now, removing this flush to unblock this situation. 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:434 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 Testing on Android reveals that the flush on both suspend and resume of the firmware indication work-queue can stall indefinitely. Given this code path doesn't appear to have been exercised up until now, removing this flush to unblock this situation. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 2 -- 1 file changed, 2 deletions(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index f95103706100..029c9952b4fb 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1110,7 +1110,6 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) wcn36xx_dbg(WCN36XX_DBG_MAC, "mac suspend\n"); - flush_workqueue(wcn->hal_ind_wq); mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_vif(wcn); if (vif) { @@ -1135,7 +1134,6 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) wcn36xx_dbg(WCN36XX_DBG_MAC, "mac resume\n"); - flush_workqueue(wcn->hal_ind_wq); mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_vif(wcn); if (vif) { From patchwork Fri Mar 19 16:15:13 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: 404813 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511139jai; Fri, 19 Mar 2021 09:14:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaIElFX9xZkLfi7VKj7DM+LW1I37FxG9fefvG15sKcphPIGrArgrLifDhuZLwjnBUCpmNB X-Received: by 2002:a5d:570c:: with SMTP id a12mr5363408wrv.209.1616170445571; Fri, 19 Mar 2021 09:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170445; cv=none; d=google.com; s=arc-20160816; b=ZU+J5C09pxFhAnW8qEMc+jBHZs+YNiX1Ie0eQzhkSVexnluf8SiDopMzwYx5J/0oev AsyWTI32+2kdPR+bUkj2pElgwO+G5I6Y4N7iPjO8AQn7uLsmQdR74JTJrQZTIZSb5MuX HncJ9ycW8T4IUBTqoPXAjpNxasYCw57WZT/KJbgHsGE66l7VdTlnFaiVL6TJsltihIQZ Qxd4umkFbJ6/MyHDdQuODriU9vW5YBPtSMRmwnv6OErQxxtof6DCPC0OzqULaYdiZdoY e/OCVVZ3kuEDhz768cyqsaYOtlt51vLjzd6NqaHA7GaW3PrrwDXF6OAsoQZGI4581Xfz EX0A== 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=PhAFNzwfGgAps/ak19WmNeKPefWvHl7Ypa3WjvhlaRo=; b=mC6Uiggu2dMdKOvlegckeYnwv7NEnaUntX/aoQi/HrhjumUUeunrMPic9e1SwYodJE sbQv8g7tKsHtJKntJGN+dv7C5GOOa95qL7occ4Dy+/gUvfnzBD2WVrtchb3c5TjAeXp6 XD1F5V5vbBncQDK7uwH1dbhIBJdfRG9bTcDU1VX1u+hvzCzbdbf0fRu8LqF7oitTkSFw JS3BRAZnetww5/RC62fXWah+20+n0rV6RjdGg8nlEeUqJ+/FA8vDiPDCDd6S+OSM5bmC kCluQ78Hdu0DMuwRa9LhQYkWtSMqXJ0yoW3X9rMtt687gLvgffzIhNDTqj2yLT2iNNQq WgNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=A3V3PHt9; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d3SeIC8w; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id a124si5640566wme.206.2021.03.19.09.14.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=A3V3PHt9; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d3SeIC8w; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=PhAFNzwfGgAps/ak19WmNeKPefWvHl7Ypa3WjvhlaRo=; b=A3V3PHt9KRosmhZH6Y2aGMk9V FWKvf4fA/JVA6WkzmC5vH9GkpqOAuqj8CcdLLtou3ffBQqkfG2ANe+W5sTvflMBwLZl2KnDwpnbjF tGBshqQRMKwcixi0EuM0DMM33kWFTI3D/tShhGEqUq44btxs6yzIpdBNjyVJvlRNsp6ww07wcGJf3 S03RO4zkHmCU7udlcET1AgOLQMyL0J40RpSGeV1ywjlkWZl+VBHEdCK4Q/IW11gJKyy1Shu7BK/Hc D29/RmCnMzWS4p5iucTU7T4SlXvi4/JBSw47/ImW4E+HWPpjri/ivEckdjvshUS3kzOGw2CHSZpfG ERlekCWsg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlD-007frd-KV; Fri, 19 Mar 2021 16:14:03 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl6-007fo8-Ul for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:13:58 +0000 Received: by mail-wr1-x435.google.com with SMTP id k8so9660793wrc.3 for ; Fri, 19 Mar 2021 09:13:56 -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=hRRlji5EKWlYATK4Q/JjFfGsjamjpBflBNA00LfXmj0=; b=d3SeIC8wJZTagoTB0RFGAK7HDK09lcNW1Bh7Zfo400OX69PoRt2glsIsnPMPtRVCmk M/mrAJEMJFBmvyWlElPxUr77ACGpSyib91ayQuLmosg3mXNOAoCIjAcoa20sxZkIF0bh cuuCzmLjYBci4wojx7p0Xt5qiBw/ATN2HjM7BNMNCPA89hNQ+1whHHGJHLJ3tU4NHc3x JjEekT/8LosKPYt8+NeZ+72ZpXcNqZK9a8YyBtTY2zA106dADTwzW4us/sB4dM6B4XYW ljpOUVWQQEfji2xCbgMUCXL7WZgJWu4pq8vyG6H7o/WMK7JAXTrzEAliwJha7OV6E9JM y+cw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=hRRlji5EKWlYATK4Q/JjFfGsjamjpBflBNA00LfXmj0=; b=cJ305rlhxIgOVb1DmH51A7FRJf4o/Lj7Sc8jwwbu9LjUuH/UT9NrCTeeacnxX0npwM Bs+ABc2IEpccDDQTE5k6kx2OwF8GlnJGmUQd364ERKTi/QVvxzKtSbj3Mu6ViFDIjqwt LXkdhDlG9HYFCmU+rTV3eVHLFAbfrnmOtNEcpIppN3POQOs4x2mg7zhC+JQgxOZo81f0 gRPMnzxbejuR8sprguvLBxrEJEHFmJJejLLbdA6RfBYbMYcwP6PDYLeIhohCnySRN04o ibJHXkVvvvLjEKWIC1iYIj9eB7RELDLCeXvPP/ybA8bWSJrSEWt2AljWr2pirHitJW7A A7Og== X-Gm-Message-State: AOAM532P+9MRt5Xx/WFxoVzt8B6IQKA/AOdglPVzre5wQnFvlY5v7OYr s1Bgi/IPkHEJYYxaCTYkmOfFw+YaA4E04FuE X-Received: by 2002:adf:ab52:: with SMTP id r18mr5276285wrc.65.1616170436678; Fri, 19 Mar 2021 09:13:56 -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 h8sm8432495wrt.94.2021.03.19.09.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:56 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 05/12] wcn36xx: Add ipv6 address tracking Date: Fri, 19 Mar 2021 16:15:13 +0000 Message-Id: <20210319161520.3590510-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161357_063703_431B2768 X-CRM114-Status: GOOD ( 15.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Taking code from iwlwifi this commit adds a standard callback for ipv6_addr_change(). This callback allows wcn36xx to know the set of ipv6 addresses. Something we need to know in order to get wowlan working with ipv6. 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 Taking code from iwlwifi this commit adds a standard callback for ipv6_addr_change(). This callback allows wcn36xx to know the set of ipv6 addresses. Something we need to know in order to get wowlan working with ipv6. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 1 + drivers/net/wireless/ath/wcn36xx/main.c | 32 ++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 8 ++++++ 3 files changed, 41 insertions(+) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index b56c8292fa62..90333daed845 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -3466,6 +3466,7 @@ struct wcn36xx_hal_rem_bcn_filter_req { #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE 0x2 #define WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE \ (WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE) +#define WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX 0x02 struct wcn36xx_hal_ns_offload_params { u8 src_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 029c9952b4fb..93eff6563187 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "wcn36xx.h" #include "testmode.h" @@ -1216,6 +1217,34 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw, return ret; } +#if IS_ENABLED(CONFIG_IPV6) +void wcn36xx_ipv6_addr_change(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct inet6_dev *idev) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct inet6_ifaddr *ifa; + int idx = 0; + + memset(vif_priv->tentative_addrs, 0, sizeof(vif_priv->tentative_addrs)); + + read_lock_bh(&idev->lock); + list_for_each_entry(ifa, &idev->addr_list, if_list) { + vif_priv->target_ipv6_addrs[idx] = ifa->addr; + if (ifa->flags & IFA_F_TENTATIVE) + __set_bit(idx, vif_priv->tentative_addrs); + idx++; + if (idx >= WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX) + break; + wcn36xx_dbg(WCN36XX_DBG_MAC, "%pI6 %s\n", &ifa->addr, + (ifa->flags & IFA_F_TENTATIVE) ? "tentative" : NULL); + } + read_unlock_bh(&idev->lock); + + vif_priv->num_target_ipv6_addrs = idx; +} +#endif + static const struct ieee80211_ops wcn36xx_ops = { .start = wcn36xx_start, .stop = wcn36xx_stop, @@ -1239,6 +1268,9 @@ static const struct ieee80211_ops wcn36xx_ops = { .sta_add = wcn36xx_sta_add, .sta_remove = wcn36xx_sta_remove, .ampdu_action = wcn36xx_ampdu_action, +#if IS_ENABLED(CONFIG_IPV6) + .ipv6_addr_change = wcn36xx_ipv6_addr_change, +#endif CFG80211_TESTMODE_CMD(wcn36xx_tm_cmd) }; diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 71fa9992b118..5a5114660b18 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -18,6 +18,7 @@ #define _WCN36XX_H_ #include +#include #include #include #include @@ -136,6 +137,13 @@ struct wcn36xx_vif { u8 self_dpu_desc_index; u8 self_ucast_dpu_sign; +#if IS_ENABLED(CONFIG_IPV6) + /* IPv6 addresses for WoWLAN */ + struct in6_addr target_ipv6_addrs[WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX]; + unsigned long tentative_addrs[BITS_TO_LONGS(WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX)]; + int num_target_ipv6_addrs; +#endif + struct list_head sta_list; }; From patchwork Fri Mar 19 16:15:14 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: 404812 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511129jai; Fri, 19 Mar 2021 09:14:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQRkKS5Ks2YasYUQAfw5B9nWMOhB0cGJrD0G+rQnpRJm/XEXc031ThksBNcFGMjN3r0QEz X-Received: by 2002:a05:600c:4fcb:: with SMTP id o11mr4454077wmq.117.1616170445182; Fri, 19 Mar 2021 09:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170445; cv=none; d=google.com; s=arc-20160816; b=nsnN2JUYZyQBmqfMOYArWbMG7MFmDnlQDvBrA1yPnrfEgicQovc1qBXCX7HtUDdtyN y+rwzhbMv8p0DB+R95r+DhHtMTehZRbHs3ljtwbipnNmEfMClZyNGEm8Lm5b0vbNoipb DNTF0wLlFdV+iBg2DcWUY/317cbKYNB1YKIjd2vW4O1qPLaxVMyE/0pLE1m1+75WP+C1 T1z7YXScduIobE0TE2AZVP3uwFQzhWi56QQUzHMN5x30hikDd9CgiSjebATpclkMwy2+ atXZXr731rVI7cQnSex8e8qgvMVWzqriI0RNi1A/dhp9UW83rg3tf0ZIu+SeFfmzwc5G Cz2Q== 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=TJmAWomB0Ris5YNYuf4+KwdDJH/VCmqt9Aib6N2z45I=; b=noi9gkekHeT+Q+l1P1rRGWNRNeN8twZYxRyBVjKVdiIpTXaXBwAh7zptnVGaS+XSC7 R27Eky+DXdTX/t+UmM8Fwnv3KelYAAZytiRcfQQkkFNI7DfOCHV/h7HnrW5bhfc8ZeAy JkNlW4OAKe4O4riSdML/yZuHiEiWUuCTKlkpYA17KAYe4Qf9JVcVKQl0If3I0PslvU0n aaCNKmcTcQ38VK7gOCdK9T6fgOtrgxfRVMDcu9yzt6Of2Ik7I144qlw/wQungSdJ/x1J RXSTarVL/EgMNL7Txo7Ouw7/Y0iS896l++4XuxzLIN3wMbKDH9O01IAdY09tU+47ZboS CWBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=LJNzxAhO; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BWmbhp4a; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id v9si5462912wml.4.2021.03.19.09.14.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=LJNzxAhO; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BWmbhp4a; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=TJmAWomB0Ris5YNYuf4+KwdDJH/VCmqt9Aib6N2z45I=; b=LJNzxAhOkkaGS9C3X7GfQRv0/ M/oxvIfnzL5s5G37ctITTSa5LCHTQqEEk53mgaH8UmNHktfd7UTQtqSNx8P3d/u0nNWrNdz82PIfk y5KyufE6LZDxWTWqIPUP8F0w83szarZ+4uarmH6MRx4XGHFGfzOvte/SFzRpoTEbJIKs50rFDSgJ1 Diuo2R+VFVb1PJgH6K2sFP9cLE/2faBsJre600vEdyxuV57LiDeQ9hWtoAzOTMql48XlEfcEBDgFR 9SdFSmyPly1TQhg9FbVylgpZy4ncKI3jfEX4Yov7LiMZc6NwEMRKFGt9lXzzJo/fAc8ArMWe5FW1Z 8dxh3nCJA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlE-007fs5-Ax; Fri, 19 Mar 2021 16:14:04 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl8-007foS-Ah for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:00 +0000 Received: by mail-wr1-x436.google.com with SMTP id e9so9670826wrw.10 for ; Fri, 19 Mar 2021 09:13:58 -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=FeymHFEw3VCwGiX+9p4pd8aUCryOvSHH6lc3lNOgB64=; b=BWmbhp4adjkCyZpeHNblIR9ZFApQJaR2+I03rojYwzpA62a+HMhwHi8xXJmcMPpXB1 7muUNz0pWzV/Spg/sojKKtdEHwwieOU+Ha5vAqvFJ+UOMyplmbFz61GC9k88y6Ho92b6 XlOc6JDNcOUegnp7RKvID+MZ4DblAdAbbw50ETIynE3aCmSwNnivLw7AxINhe6MusjZZ 14POzNurt00BUBAYvt5MIz20ToXDu1JcQ6xnjrlhJL+kUWui3mogHimWJB4tJhkDcxvr Htf8RTfXfOAWziHs1okVWWWw/boNTKrJhZtXbfc3pNK33ofMeD3haoDAi+xsb8CdQG/d 759g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=FeymHFEw3VCwGiX+9p4pd8aUCryOvSHH6lc3lNOgB64=; b=ACcM4eWTU9Uz8UcWF0JvUO7DjVJr09CnILTfd921XAFkMaH67mK2vnllTivV9mZ8zU 3wMM+3nLW6v6jmA4OLN+AU7e07ZZ8pDWIlQgbuAse2ggL+bw2ZGQ1BQLswbs6Irmxt2T qZkWeLSiiv2uI7TG3/3VJKorjUgSqIIJyZBHqKEy/t3bcZHEQXLqd8fMPQltIdHWHCNg QfRrIir8cXraW2xeXavZiPDYzrXBFDpjQrW0IEVYRQoJHFn34TrA72/IcsyzwWbG1pIZ G1Xuyv/72Nwk1hHpmQnn8kdjlvlRV/VhdMxpKMqSIHz88vYuKAl1tgRtEknHytUjzCxd g4BA== X-Gm-Message-State: AOAM533K/GWtcOZ4bJxBr0P/Yv929s9nX1vVN6Uy5c3VZCrjQmi+Ao8Z p7UstXQfhzCOvSY6WxbFb7xE5w== X-Received: by 2002:adf:fa08:: with SMTP id m8mr5414790wrr.12.1616170437724; Fri, 19 Mar 2021 09:13:57 -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 h8sm8432495wrt.94.2021.03.19.09.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:57 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org, kernel test robot Subject: [PATCH v3 06/12] wcn36xx: Add ipv6 namespace offload in suspend Date: Fri, 19 Mar 2021 16:15:14 +0000 Message-Id: <20210319161520.3590510-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161358_461829_DE1234E9 X-CRM114-Status: GOOD ( 14.98 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: We need to respond to ipv6 namespace lookups when in suspend. This patch adds the necessary changes to issue the appropriate firmware command on suspend and resume to enter/exit firmware offloaded ns [...] 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:436 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 We need to respond to ipv6 namespace lookups when in suspend. This patch adds the necessary changes to issue the appropriate firmware command on suspend and resume to enter/exit firmware offloaded ns lookup. Reported-by: kernel test robot Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 3 ++ drivers/net/wireless/ath/wcn36xx/main.c | 4 ++ drivers/net/wireless/ath/wcn36xx/smd.c | 63 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 3 ++ 4 files changed, 73 insertions(+) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 90333daed845..3b949b0b3792 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -3464,6 +3464,9 @@ struct wcn36xx_hal_rem_bcn_filter_req { #define WCN36XX_HAL_OFFLOAD_DISABLE 0 #define WCN36XX_HAL_OFFLOAD_ENABLE 1 #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE 0x2 +#define WCN36XX_HAL_OFFLOAD_MCAST_FILTER_ENABLE 0x4 +#define WCN36XX_HAL_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE \ + (WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_MCAST_FILTER_ENABLE) #define WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE \ (WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE) #define WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX 0x02 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 93eff6563187..36cf771d8a20 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1118,6 +1118,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) if (!vif_priv->sta_assoc) goto out; ret = wcn36xx_smd_arp_offload(wcn, vif, true); + if (ret) + goto out; + ret = wcn36xx_smd_ipv6_ns_offload(wcn, vif, true); if (ret) goto out; ret = wcn36xx_smd_set_power_params(wcn, true); @@ -1143,6 +1146,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) goto out; wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); } out: diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 478e363610e1..4a50e5f8456a 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2793,6 +2793,69 @@ int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +#if IS_ENABLED(CONFIG_IPV6) +int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_host_offload_req_msg msg_body; + struct wcn36xx_hal_ns_offload_params *ns_params; + struct wcn36xx_hal_host_offload_req *ho_params; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_OFFLOAD_REQ); + ho_params = &msg_body.host_offload_params; + ns_params = &msg_body.ns_offload_params; + + ho_params->offload_type = WCN36XX_HAL_IPV6_NS_OFFLOAD; + if (enable) { + ho_params->enable = + WCN36XX_HAL_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE; + if (vif_priv->num_target_ipv6_addrs) { + memcpy(&ho_params->u, + &vif_priv->target_ipv6_addrs[0].in6_u, + sizeof(struct in6_addr)); + memcpy(&ns_params->target_ipv6_addr1, + &vif_priv->target_ipv6_addrs[0].in6_u, + sizeof(struct in6_addr)); + ns_params->target_ipv6_addr1_valid = 1; + } + if (vif_priv->num_target_ipv6_addrs > 1) { + memcpy(&ns_params->target_ipv6_addr2, + &vif_priv->target_ipv6_addrs[1].in6_u, + sizeof(struct in6_addr)); + ns_params->target_ipv6_addr2_valid = 1; + } + } + memcpy(&ns_params->self_addr, vif->addr, ETH_ALEN); + ns_params->bss_index = vif_priv->bss_index; + + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); + if (ret) { + wcn36xx_err("Sending host_offload_arp failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("host_offload_arp failed err=%d\n", ret); + goto out; + } +out: + mutex_unlock(&wcn->hal_mutex); + return ret; +} +#else +int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable) +{ + return 0; +} +#endif + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 6492a628ea6a..e03ab7878432 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -150,4 +150,7 @@ int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn, int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, bool enable); +int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable); + #endif /* _SMD_H_ */ From patchwork Fri Mar 19 16:15:15 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: 404814 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511183jai; Fri, 19 Mar 2021 09:14:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfYcd/AiPJho63ZKHGyc6PX18jrcyMXLH4WYT7jpRyvTjozMpqiepAJxD+YYBjRysdBiAj X-Received: by 2002:a05:6000:1ce:: with SMTP id t14mr5211602wrx.85.1616170447980; Fri, 19 Mar 2021 09:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170447; cv=none; d=google.com; s=arc-20160816; b=GI2fdg6wAP7HC/lUmJEQCdMWEOt+dNVJPJk9GhrOGdchu2fbJX/el6fuoS7UY/xNuD kTvIalE7uuNwfFPH6n6uat9NlVm225SPAwMrMmIfBYtEjmvcMqJL5s7Oo9eOGVlSsINh s4eVHbFBsagpikinzvdNfZZ9fCoZ63geLMTNIcKfk8zP+f2Dw7N6yfC02hRiCfe8d0XP Zo9avOe6jRnzymSNf3h+31+9BIEbMvC8tka28JOPoxWwgL+k4L2KL56rQVAo9gEpRsKN iKwcitaaVerVZHuu3oYCozeItQLsjJSWEfI5w3vse+b/Vcwh6v2VsHhRoF+aCKBLXNhc 3QJw== 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=BeBpqXK5nRFfMz7SkCda7ANPYKWQtyt2YpBgAwGLBds=; b=uSTCEZHHuJ+g3PZ3HcsOk0me1R4JHFX4SyBUvyaX3d9OBRyEh/QqnFKgqmL/EFGmyZ 9tMeTuEV+pWPSuF3Yyyq+LlV8xghm8kO63LLKWSD3D+jntlnlR/K8VHz6AaIJxoT3wLU B3wn9P/0FpKAN9OlQuARUoPVF7tTJP6s3lQVyRMcKQnwks/GRRF6axwJkd6tN8MwEEIR D/p7UrOj2defx6+vbNslHwlIeghx2ZYMb1TYv9Ohqx0zDh81lJ0dhQ/ePmGAihVm1+AJ WQ+m7vwKJi5mqNXWIrDweHbJDHJmpfdDvOt9ZAQJUiZFDX6QFxSzE+ldIfkAIx3OMOXV KOtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=jLk0FZDu; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y6B74L2e; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id w11si5561359wmc.34.2021.03.19.09.14.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=jLk0FZDu; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y6B74L2e; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=BeBpqXK5nRFfMz7SkCda7ANPYKWQtyt2YpBgAwGLBds=; b=jLk0FZDu2veMUr0NIpvzRfIoZ OCwJHz9ebWbLbls33rjY8QydHdsQb/uFNYJ7v4QLDYFa5tvaj/o7ArS8ZAsqPCMIqMIhp8mkhfdkh RJhgNK8qxiocdTJBza3W0eckHoiCLy8SaEfmYLxSw7z6JlpePty2vzT3dGfy/IBQWSkzc8xdaeWTV 4+rm1wP3geAf996qO6vL12BtpBlq4nemRqczpXgWeyaBgGvAkT5EL1PNKBhdvLioCEuV+RVGeBvrV dPR0XzEk/cdvET7M9eCjdqQPTQBz7ybDYIRPhdzbQ4DGerBFG9Bk1VW8E7j6FEJmTdQwoU/iiyhi6 n7AI4Jx3w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlF-007fsw-MJ; Fri, 19 Mar 2021 16:14:05 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl9-007foq-DH for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:01 +0000 Received: by mail-wm1-x32b.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so5541242wmj.2 for ; Fri, 19 Mar 2021 09:13:59 -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=myI1fQBtftwmddT3Z8jSGa9/PtOPEyQd6+p8HuZB9bg=; b=Y6B74L2e4fm8oZtZMB/O7rLhb25FVH9jdiY313JYjnYwG6OKa9+UFser9E8ozygAt+ CNurb+oGseS2vH8A7AT/wsMdflPhWj5gDynkeUqVMj4DWaLq2E0MAi7GnE0UyBFIWvZ4 jNOLdVrug6cSMRBFxOx/3iRUnVgbQq24JEbusI7FXNaPg9jyihK5U8V4QAILdLFofbSS TnqaYuDrQXoE2Xzo55ZnhR9KwYpX2S7Tn13ITiwXTu+Wshv0L7ndKyuXQg0maiB/SYQ/ 0WsBKL7lxz1qmEg54KttFYxaYB2n82CCz3JAVjHKxwgObPSlLOtEP6hRhxH7IJApE1mE JT5A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=myI1fQBtftwmddT3Z8jSGa9/PtOPEyQd6+p8HuZB9bg=; b=koeyvwmbRWocetgzaiSj7sVODR9130OqA2wN/p5aurjbTQnFAcBOkIjHLfWlpi18jD OYYTaMtKZKaOfgNB70yCV5a42fgE6Y0n/gdr0ANU5o4gF0bppu7LLB0OwMj0iYtqmUZe Oj/Ne5V8m9HBjVnLTYgE1v0wmOlxj2WLorRUW3FUmPfbpaB1ZYSHKLX54P1kDc98wyuD O9SRVaajTkxvhF+KX27L0wAB4aDpu1circQUVzOWR5Nvi2iYut+UUTLyVUFfnoZ1503L PveMML0nDw9+zJAG9ZfsCqIP/wJWnfbzEUtw3iI/oDw1pKrhWit9lWci7peWwlrqZMfz Wwdg== X-Gm-Message-State: AOAM532NeAa3W07IKXdji2WPHoWZ32DCtKUfoEVD/8dWUrc0H65hMUWC BtVZj86zNyXneTHFQTBS3pePnQ== X-Received: by 2002:a1c:9d0e:: with SMTP id g14mr4519547wme.30.1616170438837; Fri, 19 Mar 2021 09:13:58 -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 h8sm8432495wrt.94.2021.03.19.09.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:58 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 07/12] wcn36xx: Add set_rekey_data callback Date: Fri, 19 Mar 2021 16:15:15 +0000 Message-Id: <20210319161520.3590510-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161359_616249_1D97A580 X-CRM114-Status: GOOD ( 10.57 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Add a callback for Group Temporal Key tracking as provided by the standard WiFi ops structure. We track the key to integrate GTK offloading into the WoWLAN suspend path later on. Code comes from the Intel iwlwifi driver with minimal name changes. 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:32b listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 Add a callback for Group Temporal Key tracking as provided by the standard WiFi ops structure. We track the key to integrate GTK offloading into the WoWLAN suspend path later on. Code comes from the Intel iwlwifi driver with minimal name changes. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 19 +++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 6 ++++++ 2 files changed, 25 insertions(+) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 36cf771d8a20..6b0deed23c5a 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1155,6 +1155,24 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) return 0; } +void wcn36xx_set_rekey_data(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct cfg80211_gtk_rekey_data *data) +{ + struct wcn36xx *wcn = hw->priv; + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + + mutex_lock(&wcn->conf_mutex); + + memcpy(vif_priv->rekey_data.kek, data->kek, NL80211_KEK_LEN); + memcpy(vif_priv->rekey_data.kck, data->kck, NL80211_KCK_LEN); + vif_priv->rekey_data.replay_ctr = + cpu_to_le64(be64_to_cpup((__be64 *)data->replay_ctr)); + vif_priv->rekey_data.valid = true; + + mutex_unlock(&wcn->conf_mutex); +} + #endif static int wcn36xx_ampdu_action(struct ieee80211_hw *hw, @@ -1257,6 +1275,7 @@ static const struct ieee80211_ops wcn36xx_ops = { #ifdef CONFIG_PM .suspend = wcn36xx_suspend, .resume = wcn36xx_resume, + .set_rekey_data = wcn36xx_set_rekey_data, #endif .config = wcn36xx_config, .prepare_multicast = wcn36xx_prepare_multicast, diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 5a5114660b18..6121d8a5641a 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -143,6 +143,12 @@ struct wcn36xx_vif { unsigned long tentative_addrs[BITS_TO_LONGS(WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX)]; int num_target_ipv6_addrs; #endif + /* WoWLAN GTK rekey data */ + struct { + u8 kck[NL80211_KCK_LEN], kek[NL80211_KEK_LEN]; + __le64 replay_ctr; + bool valid; + } rekey_data; struct list_head sta_list; }; From patchwork Fri Mar 19 16:15:16 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: 404815 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511210jai; Fri, 19 Mar 2021 09:14:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIPcNxIlfmwvDczQJyHXCZ0Hx+tk1F20ibxhZPHStGOthDvKQhvJ2jXWW3TipyqzF2tueI X-Received: by 2002:adf:d1cd:: with SMTP id b13mr5294051wrd.47.1616170449847; Fri, 19 Mar 2021 09:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170449; cv=none; d=google.com; s=arc-20160816; b=BYTCFnXlKigxaqOYaXKD0lneVaCk5YS4ytAjvqS2P5uFttlcO/lyv8TAxeUt0aq84f gLyF81isxi4NbHeBELW8aKphJm+p3P7NkwNCoOPWCKfD8ND+9zhZY8rPIhc5Wd8Dbu3M uBGpkGjyiqOWUI5dM0fy3mCGnAcNxLdRj4KKG1Ol5+xG15Cb7735ckizswm98awNhX3P 9SwhOVD+V+iZDcVo7pnd+52aPxBAcXuUfRhkZlBD9MU9NR9V1WP/t0vBtbuEKeQlxhXw rzjjA/cjyQxj3f1AeivyZPrt1gJY3yAe5UvRVEPK8L9HHqgeX77zGWd2Qqok2RQSzsvI wtvA== 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=Wu1TfqE1oaaSxOa7sLol/NRAKmHkKglMaygHJMWNyLw=; b=eoQ5o5Vvjn+Xl2B1of++Xnbi2rgkusWQy+cC33xUN+makwz7kNjfLn7eO2wCVCLLjb 6Jlw/9vgHyEls7orx0o/fRr1qNkK4Gx2G60Wh4IakTH6+WNnSNM5274hgPcibuT6RSak 5uUh1WiCBkiRpiKDk+5jxtWpa5D7bJrL0aMS7poQsB6DWdaxAanSiK7qQaGyx9ZfQ/TJ OIN8FlHl3SZlXVMYTGjtC4HPzc6FZWCamCxRNwC4wDQQ6DJVHBOHB7WOB8zu2Iqi0lr1 fQrz11ltQqk4msQIUVOKuozjOGpTIImkZaFEnJmCk6QDomysoqQ5xXLZsRsXXSm2fbTf D6Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=AHf31vX8; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=x6fhiApw; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id z4si5260261wrm.178.2021.03.19.09.14.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=AHf31vX8; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=x6fhiApw; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=Wu1TfqE1oaaSxOa7sLol/NRAKmHkKglMaygHJMWNyLw=; b=AHf31vX8Jzh88AFGQSLSHzUzC 6gKsv1eHQRW8ypv2v+YwIhXlLcxIRRZ/umuuU463TpodipmRpdKieaCvdgU82XdM+cfdr7kZBgPLb U/b0CqbCfgX40P285o763X5OeEczU+hkcu2FJTZtZYH9YQgr/z436ASsDhol8LymI3+UeA1HtCz4o nBboyvxEPGC21dmhHFlKtNfx0WRVZgI1o4LKxk9KHG6ozh/kn1apx37xUbPEnGYfhmrAmch+6PKHW lGlQlpRL/gd0Ef0FMKg3b8X2azhPa+qQudEadtre//ZcTuwesqXVxHI9VuURRNSUNTnjgNlV50YOA M7untYkmQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlI-007ftQ-0h; Fri, 19 Mar 2021 16:14:08 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlA-007fpO-47 for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:01 +0000 Received: by mail-wm1-x329.google.com with SMTP id r10-20020a05600c35cab029010c946c95easo5535316wmq.4 for ; Fri, 19 Mar 2021 09:14:00 -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=hfX1Ogv73uurEKmswylGOfrhr0B3EvW2dgqtNPTZVyA=; b=x6fhiApwghFo1P2OHZClb8jBXq6clJVd/jv+8668GVtKRifHQ5cJZIkTjYjC1+bqEJ 9nHC5nciZRhNZRpl0E2T368UlWuete+VtHRO0k8/rbDdjc3jila9WqPXQzVSeEJ6ED8D yPUGx/dww5nAfdx+b1D5U2Bc/XY5Xi4Iih7UTmuwSvVmpDgggrv/rl1+93xqALbOXVs3 WenkbQxpK34ECDxoPKXr6J9bCPBmDtC3ukcKvWKNEQ+6kY5t/QVjYTE0G6FilYcrd8tN tT8k8U7PSqBnDz27WmaxjpFFGLEdd5BPJJZ4ZXlf3mZUoCc2f3Hf2rvNh9TWDlPZ/iOJ Mj3A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=hfX1Ogv73uurEKmswylGOfrhr0B3EvW2dgqtNPTZVyA=; b=jQuscQPlz5ZuKUSK1OTNIjxViKHxqY1rqRNqgX+dxFs1Up6o7Tv6AYj6h46gRnrNAg tQkda4/jpHgy8E5/VKFH5WCnzqeJyLkfS87A1oTsOL6N4WFB01CoO37UOd3ZZ6spDJ9F iffpGRWA2ADCCe/qECZk950Ax2MYPhPE4RibSCYHQxujxpljvKi/RovkP3VQ7iuI5Im3 YhEIGQnPZbom+M9Hnixd/eHevY9NQCvUu1ZXn1I8XOy06y7c2URkTRZs3bFswRcW2btI +psD30tjbEkw/hIvJ7WZNo21t81yHm8SsSsR10odpg/CZj/hipL6/kRadtzoNN/xE9WY hjJA== X-Gm-Message-State: AOAM531DnqCSRLhJjCvEI0tHZN2fOgwfLBu13B8ZfcThFaA2jRYemq3l B6vEOMt4k9CfkTtxyLzSqIxBtQ== X-Received: by 2002:a05:600c:4154:: with SMTP id h20mr4477888wmm.149.1616170439786; Fri, 19 Mar 2021 09:13:59 -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 h8sm8432495wrt.94.2021.03.19.09.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:59 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 08/12] wcn36xx: Add GTK offload to WoWLAN path Date: Fri, 19 Mar 2021 16:15:16 +0000 Message-Id: <20210319161520.3590510-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161400_265427_479964E9 X-CRM114-Status: GOOD ( 15.33 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Using previously set GTK KCK and KEK material this commit adds GTK rekeying to the WoWLAN suspend/resume path. A small error in the packing of the up to now unused command structure is fixed as we go. 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:329 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 Using previously set GTK KCK and KEK material this commit adds GTK rekeying to the WoWLAN suspend/resume path. A small error in the packing of the up to now unused command structure is fixed as we go. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 2 +- drivers/net/wireless/ath/wcn36xx/main.c | 4 +++ drivers/net/wireless/ath/wcn36xx/smd.c | 38 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 3 ++ 4 files changed, 46 insertions(+), 1 deletion(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 3b949b0b3792..1f3c2e840232 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -4905,7 +4905,7 @@ struct wcn36xx_hal_gtk_offload_req_msg { u64 key_replay_counter; u8 bss_index; -}; +} __packed; struct wcn36xx_hal_gtk_offload_rsp_msg { struct wcn36xx_hal_msg_header header; diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 6b0deed23c5a..a138b84d0aec 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1121,6 +1121,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) if (ret) goto out; ret = wcn36xx_smd_ipv6_ns_offload(wcn, vif, true); + if (ret) + goto out; + ret = wcn36xx_smd_gtk_offload(wcn, vif, true); if (ret) goto out; ret = wcn36xx_smd_set_power_params(wcn, true); @@ -1146,6 +1149,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) goto out; wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_gtk_offload(wcn, vif, false); wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); } diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 4a50e5f8456a..f74cb16327d0 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2856,6 +2856,43 @@ int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, } #endif +int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_gtk_offload_req_msg msg_body; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_GTK_OFFLOAD_REQ); + + if (enable) { + memcpy(&msg_body.kek, vif_priv->rekey_data.kek, NL80211_KEK_LEN); + memcpy(&msg_body.kck, vif_priv->rekey_data.kck, NL80211_KCK_LEN); + msg_body.key_replay_counter = vif_priv->rekey_data.replay_ctr; + msg_body.bss_index = vif_priv->bss_index; + } else { + msg_body.flags = WCN36XX_HAL_GTK_OFFLOAD_FLAGS_DISABLE; + } + + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); + if (ret) { + wcn36xx_err("Sending host_offload_arp failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("host_offload_arp failed err=%d\n", ret); + goto out; + } +out: + mutex_unlock(&wcn->hal_mutex); + return ret; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -2905,6 +2942,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_START_SCAN_OFFLOAD_RSP: case WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP: case WCN36XX_HAL_HOST_OFFLOAD_RSP: + case WCN36XX_HAL_GTK_OFFLOAD_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index e03ab7878432..cdf4231efe26 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -153,4 +153,7 @@ int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, bool enable); +int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable); + #endif /* _SMD_H_ */ From patchwork Fri Mar 19 16:15:17 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: 404816 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511223jai; Fri, 19 Mar 2021 09:14:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrwtX3owTwUCVJOaL5B5cX+qKxyg20DPO/JINA92BMVMqPe6zhhjVtA2e43WhCMpjh+wX8 X-Received: by 2002:a5d:6411:: with SMTP id z17mr5202345wru.119.1616170450599; Fri, 19 Mar 2021 09:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170450; cv=none; d=google.com; s=arc-20160816; b=JOHTttaZPjcnn4qQAq/LTZ8R3ueq3xDkm/gd5cFDXS0RDjoFMxyI8cL9cIt8zNyQ5r cr4eGA/U7fksNXiuIINZn0Yxt6LSPG9N6/oemlCM8wwTOxlBzwRide9xwWGSyM74lF1Z 112u2jTBB4+4cwPsA9Q8Rtz6SKkpH7z3IefSg/mIN/PW4lPJOfDPSfZQjXtfSBTEvc1v vZIC1sKO6Bg9FWSrc0P24g7xt0ZDUIlScdaGYjCtriO3Xo7hhazGc76VPPUeNnFld6oY qUME8zMBuvSEzqaYVT9CDuBhQsRc53z65PYfzuqLtvAHW7jLhTKAK1VGyXBIFonLwNtv GP2A== 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=siF7nM7yk0LFL2IMYx8tEu2VpRalzldI2ErsYk7P1IU=; b=NPLAG/Xg48mQ1YiB1MeSpVoUFXVSEriAAS0D9yBfp/Aewnyp3HpJw9hFwsjrKAqRy3 hy6EgLr5wkWI5VTLrgXBHyPr2gA3lMaAdZLEh2DbVgYqGwOxCh6peL+SgecT2adgs2J8 7UmYR+iBwwUUIn04gXKZcPcXbPDpPDgnBWmAOyRj14xDTc+njiNnKrHxNBHgkXbi8l+6 GZjISS8CQZ3gX99Z2vN4OCzdn/zBH0X4DXWqeEG5RxrGYPK5e0yA1wZn2RKuD9ZNS0lJ BXuH8yqJkiGhS/G8ILoMUTC5qWSAdfoU+N08sKFrcmkkdbawXojTwSf2UJSW4cKoPjq8 RDRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=igPYlbls; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BHfvpxbc; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id w2si5635047wmc.188.2021.03.19.09.14.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=igPYlbls; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BHfvpxbc; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=siF7nM7yk0LFL2IMYx8tEu2VpRalzldI2ErsYk7P1IU=; b=igPYlbls9iLUZ154eamLrQE3p WvNNbctLoN8e7MpQFYn8CAk1rqzd8KOo3/dDlY4f4fnZCIt/4u2yZZfLrz7AFrqkIToYJt62T2m9b X/GXKA1Yb95NFPeERLir+qQIrCxuYB8/5zrk0wGHiBqf77UmKkAeahjpUueFr304Qaf51+j5EDQMK 3ia0NrPrxZeQ6mkrBkxPsaiq7P2QsNnvp1DJrrBiXW/ejkx4n+BwN/4gWw5/qH6cghfvQc4dLflKh +HgfOnuqtreUfxIKdUqxgvGgD9L9wjZeriJkq6g+mHYGKK2FeyKN81CJ6irMlMc1SKd2+AvAn8lrT iaPfewbSA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlI-007ftn-PM; Fri, 19 Mar 2021 16:14:08 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlB-007fq3-DV for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:03 +0000 Received: by mail-wm1-x32d.google.com with SMTP id p19so5768449wmq.1 for ; Fri, 19 Mar 2021 09:14:01 -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=sWDQcCwP5xmFNCU8WV7XgYW43kOv4yOkxdnbhU++6lo=; b=BHfvpxbcOPIY/A0xOGaovHN8XLjdEjtPVvjfCw85NHFstblJDe3eJ8MOegilC7+P4h 4he9nq6vWO1tlK/aGgwwBwraRm0vbFMeahI/LEgRnzT23BR8bULob53rhB9ivj2Heu3S PNbGPC2IzTyigt1onr6CttfX+jFlB0w6T2IXlZLHkb1c5TwZvtRoppdjeuySlMjph+74 ImfZ36DZ+6BSG3b+c3muPfGvfGhDoBLnTE86+pW7qX2WqZlA2GZ9XyraTazX7bc+BjtW DEy08F0Y8C035Uky0JyelJTs+rzGc/qropXcgc9YfgktTFm5JRhZrekKEF6/SX9S7HpH SxTA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=sWDQcCwP5xmFNCU8WV7XgYW43kOv4yOkxdnbhU++6lo=; b=EwrMvBqpsz5GMNRr3cCp6WI1k4rvp9aHziMT1dXm/AX/TJB83zSyg0SJ5KnGVxB+H0 oO0CP2WFkkldWCM9R8YV9dhNqW6qFgczsFkcLvEWegyjTAkRdHjw+b8EWc6GcW9cv3Tc iR374uJAMGaOns9FXMBc8+k698vGXUilNNQj3PuF6hgb0DBRV/krClleuuIkWbCFGmc8 /PWGrqCK2E0MKFRd0Jz0vSt0m4s0VPslUCvm1AYzr6mg9/UA7mHY0zXcTom5AEdsEQzy qhsdHZWnUY6UJol9f2tsmNsYr3YRTqfd/QfoFfbxbl4HgsGDmonLKUvyEf0w37i+n4Jc Xpcw== X-Gm-Message-State: AOAM532tH7jHVx+l7/AZ5aO29169yrkdFyByYn5fBiQ9VV7qbk0F/+wt rpM8Wa5S32esvRFqAh9yroQSjQ== X-Received: by 2002:a05:600c:4844:: with SMTP id j4mr4401141wmo.179.1616170440786; Fri, 19 Mar 2021 09:14:00 -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 h8sm8432495wrt.94.2021.03.19.09.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:00 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 09/12] wcn36xx: Add GTK offload info to WoWLAN resume Date: Fri, 19 Mar 2021 16:15:17 +0000 Message-Id: <20210319161520.3590510-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161401_573738_264EE341 X-CRM114-Status: GOOD ( 16.26 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Having enabled GTK rekey in suspend, we need to extract the replay counter from the firmware on resume and perform a ieee80211_gtk_rekey_notify() so that the STA remains verified from the perspective [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32d listed in] [list.dnswl.org] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 Having enabled GTK rekey in suspend, we need to extract the replay counter from the firmware on resume and perform a ieee80211_gtk_rekey_notify() so that the STA remains verified from the perspective of the AP. In order to enable the SMD command and response we need to pack the existing command/response structures. Given these structures are currently unused, there's no need to backport this as a fix. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 4 +- drivers/net/wireless/ath/wcn36xx/main.c | 1 + drivers/net/wireless/ath/wcn36xx/smd.c | 72 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 3 ++ 4 files changed, 78 insertions(+), 2 deletions(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 1f3c2e840232..455143c4164e 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -4919,7 +4919,7 @@ struct wcn36xx_hal_gtk_offload_rsp_msg { struct wcn36xx_hal_gtk_offload_get_info_req_msg { struct wcn36xx_hal_msg_header header; u8 bss_index; -}; +} __packed; struct wcn36xx_hal_gtk_offload_get_info_rsp_msg { struct wcn36xx_hal_msg_header header; @@ -4943,7 +4943,7 @@ struct wcn36xx_hal_gtk_offload_get_info_rsp_msg { u32 igtk_rekey_count; u8 bss_index; -}; +} __packed; struct dhcp_info { /* Indicates the device mode which indicates about the DHCP activity */ diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index a138b84d0aec..a84128e04cc4 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1149,6 +1149,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) goto out; wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_gtk_offload_get_info(wcn, vif); wcn36xx_smd_gtk_offload(wcn, vif, false); wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index f74cb16327d0..e249971c4ef7 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2893,6 +2893,77 @@ int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +static int wcn36xx_smd_gtk_offload_get_info_rsp(struct wcn36xx *wcn, + struct ieee80211_vif *vif) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_gtk_offload_get_info_rsp_msg *rsp; + __be64 replay_ctr; + + if (wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len)) + return -EIO; + + rsp = (struct wcn36xx_hal_gtk_offload_get_info_rsp_msg *)wcn->hal_buf; + + if (rsp->bss_index != vif_priv->bss_index) { + wcn36xx_err("gtk_offload_info invalid response bss index %d\n", + rsp->bss_index); + return -ENOENT; + } + + replay_ctr = cpu_to_be64(le64_to_cpu(rsp->key_replay_counter)); + if (vif_priv->rekey_data.replay_ctr != rsp->key_replay_counter) { + vif_priv->rekey_data.replay_ctr = rsp->key_replay_counter; + ieee80211_gtk_rekey_notify(vif, vif->bss_conf.bssid, + (void *)&replay_ctr, GFP_KERNEL); + wcn36xx_dbg(WCN36XX_DBG_HAL, + "GTK replay counter increment %llu\n", + rsp->key_replay_counter); + } + + wcn36xx_dbg(WCN36XX_DBG_HAL, + "gtk offload info status %d last_rekey_status %d " + "replay_counter %llu total_rekey_count %d gtk_rekey_count %d " + "igtk_rekey_count %d bss_index %d\n", + rsp->status, rsp->last_rekey_status, + rsp->key_replay_counter, rsp->total_rekey_count, + rsp->gtk_rekey_count, rsp->igtk_rekey_count, + rsp->bss_index); + + return 0; +} + +int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, + struct ieee80211_vif *vif) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_gtk_offload_get_info_req_msg msg_body; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_GTK_OFFLOAD_GETINFO_REQ); + + msg_body.bss_index = vif_priv->bss_index; + + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); + if (ret) { + wcn36xx_err("Sending gtk_offload_get_info failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("gtk_offload_get_info failed err=%d\n", ret); + goto out; + } + ret = wcn36xx_smd_gtk_offload_get_info_rsp(wcn, vif); +out: + mutex_unlock(&wcn->hal_mutex); + return ret; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -2943,6 +3014,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP: case WCN36XX_HAL_HOST_OFFLOAD_RSP: case WCN36XX_HAL_GTK_OFFLOAD_RSP: + case WCN36XX_HAL_GTK_OFFLOAD_GETINFO_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index cdf4231efe26..90c7faea0ef6 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -156,4 +156,7 @@ int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, bool enable); +int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, + struct ieee80211_vif *vif); + #endif /* _SMD_H_ */ From patchwork Fri Mar 19 16:15:18 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: 404817 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511232jai; Fri, 19 Mar 2021 09:14:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/2xslZx5tHuDVSasrvx18DT1AkWRdJ42CUT/NfEFYl9lyFEfY2c2fUfYrAdJOlSmbIYHk X-Received: by 2002:a1c:b006:: with SMTP id z6mr4248585wme.19.1616170451206; Fri, 19 Mar 2021 09:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170451; cv=none; d=google.com; s=arc-20160816; b=ETmB9gsMj+X/KKrtIBT+8IPF8ksJYtiSjqp+eUMf495ECo5alRoY5WVtoruSJE62F+ ncnBk44PNH2C6aXjtDIjbEvQkhy7qTiI4Ks5CMdREHtxEgcp62BjH4+M07KYfyQeNU7M 4XtJQFpUCQTqSItu/BhKKC98vWPcL++ghYP/vi4si34uSDoZYAyOdS+BU2e02/vm0KeJ OGwqdeMc603a71HIqZRW47AWEm9K8DAF1J3hI79iRAuOlAtGoJ22H0JNvwsPvaOtlXYq 0GI66Mv0BTY4ZfHlBfTCQYQ7mqGZtQCK5X7oR471YzD6Ix7iFnqu8a8wwVrtvsuL4YlH fcpQ== 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=B/sTBNSDjFCjgHsf+Cg8iXSjnZ/nFOo2hrbDX7LholE=; b=Hb5pzJMD+/94l+bcDbFqg56/B+/msWfycF1+pzuMNKJDgW5ca+rqqP8jHg6CiCczaE 5j6q8JCNKLxuwLE3vdfk5FoW3ANo+MIWqpDe59Fve41VPyWajfnW9ECTWxHXZzCzDyoh As61OQ7VL6g3kDTWH7MQRFAN8fXrZezQxxBHpq63clasLoZoonEu1H6TXP86IHRo7Qkf mrvFUwWh/OFwTWZXlJn4pROyd+zCEGA6v4WGDN78AUwv5G0buB1oIzp9Jump9pBu2YBu H4J8k4NPPGDbiWuq9DdQEX4SW2QUH4gmU1OorGMtP2mwata/YmlDAuAePBnqhBq/nuh4 tSqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=jAHDocGw; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=yVCuNnhG; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id w67si5502910wmb.123.2021.03.19.09.14.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=jAHDocGw; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=yVCuNnhG; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=B/sTBNSDjFCjgHsf+Cg8iXSjnZ/nFOo2hrbDX7LholE=; b=jAHDocGwS8Bvbv0BEdM9dULS+ JIkFDkivb+Xp7Urrrr5KtdkmE3duboMMulmX8D5J/wPw31DAa/JTncb9fc+tKqWLPp5OKZKxYhXgD Om3ZfydwuV7uBX14IntT2VWZ/kJfa+UJ/KI3cPHZGbEaZxSD/bdrUvBgFHSHeKcq9hwYrYyJ28raK 7r7UGNt4vwYxDfMKeIPdc3a6uugBQDvWOJQ3R9m7eFXhunO38Pu0tDcYEV/rTspajXwlSg2NwyfRg iDOGFD9GlzaXGTY0kMEMmGviSivoFdb0+LY3NUERxgOa5155YLu+lly8SNK+W2QfotO/3NN9hQLqG zHrQRB+ww==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlJ-007fu6-OU; Fri, 19 Mar 2021 16:14:09 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlC-007fqc-DA for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:04 +0000 Received: by mail-wm1-x32c.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so5552955wmj.1 for ; Fri, 19 Mar 2021 09:14:02 -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=gigI+obh4OgQAHcvn4ct7jEpV5/6/PU9YOe1h8WyUL4=; b=yVCuNnhGbRNZgUToUq8Y6pXPRQDfLgcKxQ87BQjtNvri+d363NoDhV0CLGWYBkDFWV qgjZGJJ36ilzUw+VyWjEhLD5biIUzjf74QBHp173bn6Hj/6rgucsgiNwUo9PAsEKB1Fc D5QfRR1G46EbW3PMbf4q4jBFSgE6uD3NeJej16mET3WOgkCtgqvH6+JgSidJ8cGwJve3 39iScW0RpBnFkjxcESbixqmctO1UGDk1Ub8xIM5Ti6VLZlHjccSsLbq5z9Kv79FhPWnP ZbSHAjUXJtLNR+tKwqSz/hLLG05GI+G9dQcKIOexTvnhhxHFj3ap13MmbzHRZEpJxXwz Q3mw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gigI+obh4OgQAHcvn4ct7jEpV5/6/PU9YOe1h8WyUL4=; b=IqURwZWux58/Ph7uqwcmAedHqPQfS3pYbsYIeDevC4a/K63Gc89kClP3IQfUS+CuSe zmgABm8rFucybxpPcgytCzq/414YsVuH2mieQ1bkozh01kCTKanSwhDS7f6ayUoEy2+9 My4oeumwr0JPnTROaN5vf0lAbtFciocUxv/XL7Xo3Q+AksumjkgEs6rKQtyzTnyYXndh jmiPwY7LzEj/3ByiQ5PX9OpaCEIB13sMvcKuiWYtAWodsKC9A20WbjTyQ7aRzjb9BoTg MIJhgqJjYKWWRQZLrs4GQ3c0LOep73uUuNKLIs7+WEVaFtS1P5K3e9tE3x2jXhDYx+37 WDcA== X-Gm-Message-State: AOAM533jOgYaP/nwbfxhZq/tRS8mlX5yZ2ToNLE4CQCxaDgMrGRp0OB5 HiXb416E1bpDLJ3TB7PpxkwVvA== X-Received: by 2002:a1c:43c5:: with SMTP id q188mr4337744wma.94.1616170441863; Fri, 19 Mar 2021 09:14:01 -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 h8sm8432495wrt.94.2021.03.19.09.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:01 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 10/12] wcn36xx: Add Host suspend indication support Date: Fri, 19 Mar 2021 16:15:18 +0000 Message-Id: <20210319161520.3590510-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161402_564312_D30E599C X-CRM114-Status: GOOD ( 12.46 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: In order to activate ipv4 ARP offload, ipv6 NS offload and firmware GTK offload we need to send a unidirectional indication from host to wcn indicating a transition to suspend. Once done, firmware will respond to ARP broadcasts, ipv6 NS lookups and perform GTK rekeys without waking the host. 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:32c listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 In order to activate ipv4 ARP offload, ipv6 NS offload and firmware GTK offload we need to send a unidirectional indication from host to wcn indicating a transition to suspend. Once done, firmware will respond to ARP broadcasts, ipv6 NS lookups and perform GTK rekeys without waking the host. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 3 +++ drivers/net/wireless/ath/wcn36xx/smd.c | 19 +++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 2 ++ 3 files changed, 24 insertions(+) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index a84128e04cc4..535e0d4245c3 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1127,6 +1127,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) if (ret) goto out; ret = wcn36xx_smd_set_power_params(wcn, true); + if (ret) + goto out; + ret = wcn36xx_smd_wlan_host_suspend_ind(wcn); } out: mutex_unlock(&wcn->conf_mutex); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index e249971c4ef7..302877d23ecf 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2964,6 +2964,25 @@ int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, return ret; } +int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn) +{ + struct wcn36xx_hal_wlan_host_suspend_ind_msg msg_body; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_SUSPEND_IND); + msg_body.configured_mcst_bcst_filter_setting = 0; + msg_body.active_session_count = 1; + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = rpmsg_send(wcn->smd_channel, wcn->hal_buf, msg_body.header.len); + + mutex_unlock(&wcn->hal_mutex); + + return ret; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 90c7faea0ef6..2909facdb100 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -159,4 +159,6 @@ int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, struct ieee80211_vif *vif); +int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn); + #endif /* _SMD_H_ */ From patchwork Fri Mar 19 16:15:19 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: 404818 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511256jai; Fri, 19 Mar 2021 09:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6V/XJbXlpyHNlDSjUYzjXrRI/CCEj+og/AAT6EK/ZTzSHGpcr1nx0uzmchc4O3cijmThe X-Received: by 2002:a05:600c:290a:: with SMTP id i10mr4450048wmd.91.1616170452222; Fri, 19 Mar 2021 09:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170452; cv=none; d=google.com; s=arc-20160816; b=AYjokeo8LgXBezQYxG+yJBLv8BNGyE1YnC5sAAcv4v2Sj1NDcp0GpMFZrjGCS6oNXX 5m/FeXpnF/xVNURlna74MPwI6aT2n19VMhze5qgTSomqbmkgHQ6tTAuuwEasQKxIupc/ xPnvZy1OlZrxfucz/MwQw9s74JBC0BE1ZD41tPWF08QgRVHW4CCwpgS98XtyOApiOFvf DH6nDm4G3CC32XUMED52IkZYjSS2NHMJHIcTUqsQhl3usU/djG21Q+ddv7ZHSEXmdscn 2i5g6QuKP8BloAZP32HzkURKqcJylXBS3akvNJpwA0UMgrli73Bbe3WQl0kq0qmKW0bo 4Vrg== 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=IgyAt5Zy9UNhmGNh+v2Rq58sLmuBTRsvEeb3Qs/ypoo=; b=sFof8Id+HYcU/iJIE4ZOW/+CJxOQtbU5xWkGrmP7OPjKAR7WoSpWOciLS/nuTlfeTu dvA2pFSmNsFtJBCIF7RB1fFFIq384th2D0/iVx8/s/b9uyliGAod2blxcgryxGO6UQ8J caIwK0x2dzBCdDXZFOqoCJ+kWUr3IpFaGf7+oZ5SFQwgovXZWS2suzcnm27hgbpOVNoD kO9Yj5mC3gdS3kzyM//0HNwgOk9jUwyceP7ThRKoVeAmOCCZTaXo7cL7cLAUuZ/WkU4D kAnlUOu97UETPxAa7g5S4BUiMTgEfNBK73j0UdwGJcN0NIv2gtGHOHH7QsZVgAaeODoZ x/3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=LxUZiMKJ; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MbvTpQjD; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id l7si5908266wmg.107.2021.03.19.09.14.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=LxUZiMKJ; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MbvTpQjD; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=IgyAt5Zy9UNhmGNh+v2Rq58sLmuBTRsvEeb3Qs/ypoo=; b=LxUZiMKJEjjUM5as4dTLuT6Ob hyRUdRkAZ5mskBCQFp6n2VKXKo6TL2Grq/oariWSoemgYSb5+hhPOlNgabrZsvMb8NKw/rATlZTJU WiZMGXNUrc1VA6ydHjoca6m72zE5RS/plTzMFvnw3pMsXpUkxa7K7LrkO1RH+AqnbNhQxWoKoyFDS d9bwVh5oYrzefNZJbh7lc8NCt4nAPSJyW0UNVdX04I56EJOjuiL+HIAMuwABlIiyiHOxbjwOME+Ln 2ivG41epnyDuGehyroobK2mbCtn41qlHwtAJaBWJ4llfmvb7bn2rWR5mnXBGSv6B/TdW5a/PtWSpn Fm7goCYMw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlK-007fuc-Oy; Fri, 19 Mar 2021 16:14:10 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlD-007frE-D5 for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:05 +0000 Received: by mail-wm1-x32e.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so5552980wmj.1 for ; Fri, 19 Mar 2021 09:14:03 -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=xhoTMgCF+XvAHv8UavGI2Q1mjtQ3p6Q77CqaQwfEbCI=; b=MbvTpQjD5IuW3Jhust42HF4Y1LXfxdhB4PJAMSzJz4+MlIRExIDqGVcllfQHG9I8gl c0iMSclQJAcHZl+bn00W/PnN2kfVOiMfGcwjpJPNbcFN/zMNYpli4MXIyud2BK1vsXn9 W6mJrnGt9qIOTVZYIaT/z6Ia9Z2X7s/bEO9O4SbsWraWP2iDxQ7oqHEU7A5UU/N9pbsa xpKBd+r4Myp6tTbY54ypv4RACdsauOVzAo+jiQzbFa8hnosqStvEaMzlQSglxxFMecW1 2cZ4gHs2OSGh2PSm4jjYpl/9ELuvdJwfjzxY56yyXh04ega5cXus5Nn+W0HiKQtEkJej dwQg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xhoTMgCF+XvAHv8UavGI2Q1mjtQ3p6Q77CqaQwfEbCI=; b=ogaiXtgoYeArabVlFAx+slbpPLI0vp4yt/jOPnMxVF/Gn5r3440ZsaSgPjDzl3kEiy OnRlaK26xeinC379cTyABd2QdKbh3WSekWFAKw2v1uSbUSpbhrJ/C0jZvclEVif6Mw0X 0peyMW3OgPajKjYSUK3D0qwLl7SuB7ddmOqu74Z9H9+HWz6AOAtZ1zZ7oXnhYTLqkpI2 P25UKBKFP2gMbwy6svMZsqpbxSSdxFMB7cCEK/J6NL1+hfI7+gKheVYAu/EppjjCVX94 MCZbs4Vv6r4ExpcXaECvcnnzr/KJ89A0WM5Zt4g7VCwhn5PqW5U8Sso0NpREMP4U6lR9 gDnQ== X-Gm-Message-State: AOAM532clj52bjIjtpeD6HOQD/BsxygBXT7nHvD5FJQjagUPLeXosxr9 C8f9JzmYbxXX7oWLEWzniUVDaw== X-Received: by 2002:a1c:804e:: with SMTP id b75mr4496759wmd.113.1616170442807; Fri, 19 Mar 2021 09:14:02 -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 h8sm8432495wrt.94.2021.03.19.09.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:02 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 11/12] wcn36xx: Add host resume request support Date: Fri, 19 Mar 2021 16:15:19 +0000 Message-Id: <20210319161520.3590510-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161403_589460_A2E42942 X-CRM114-Status: GOOD ( 13.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: This commit is the corresponding resume() path request to the firmware when resuming. Unlike the suspend() version which is a unidirectional indication, the resume version is a standard request/respon [...] 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:32e listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 This commit is the corresponding resume() path request to the firmware when resuming. Unlike the suspend() version which is a unidirectional indication, the resume version is a standard request/response. Once the resume() request completes ipv4 ARP, ipv6 NS and GTK rekey offload stop working and can subsequently be rolled back. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 1 + drivers/net/wireless/ath/wcn36xx/smd.c | 35 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 2 ++ 3 files changed, 38 insertions(+) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 535e0d4245c3..ddfc60e02389 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1151,6 +1151,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) if (!vif_priv->sta_assoc) goto out; + wcn36xx_smd_host_resume(wcn); wcn36xx_smd_set_power_params(wcn, false); wcn36xx_smd_gtk_offload_get_info(wcn, vif); wcn36xx_smd_gtk_offload(wcn, vif, false); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 302877d23ecf..de0f630a82be 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2983,6 +2983,40 @@ int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn) return ret; } +int wcn36xx_smd_host_resume(struct wcn36xx *wcn) +{ + struct wcn36xx_hal_wlan_host_resume_req_msg msg_body; + struct wcn36xx_hal_host_resume_rsp_msg *rsp; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_RESUME_REQ); + msg_body.configured_mcst_bcst_filter_setting = 0; + + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); + if (ret) { + wcn36xx_err("Sending wlan_host_resume failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("wlan_host_resume err=%d\n", ret); + goto out; + } + + rsp = (struct wcn36xx_hal_host_resume_rsp_msg *)wcn->hal_buf; + if (rsp->status) + wcn36xx_warn("wlan_host_resume status=%d\n", rsp->status); + +out: + mutex_unlock(&wcn->hal_mutex); + + return ret; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -3034,6 +3068,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_HOST_OFFLOAD_RSP: case WCN36XX_HAL_GTK_OFFLOAD_RSP: case WCN36XX_HAL_GTK_OFFLOAD_GETINFO_RSP: + case WCN36XX_HAL_HOST_RESUME_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 2909facdb100..d8bded03945d 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -161,4 +161,6 @@ int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn); +int wcn36xx_smd_host_resume(struct wcn36xx *wcn); + #endif /* _SMD_H_ */ From patchwork Fri Mar 19 16:15:20 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: 404819 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511264jai; Fri, 19 Mar 2021 09:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIG//YX/CAVdM1DqYG16+XHRLNhWUWKrsgk8oFSL5PXVGA35hKhrkzdf0NSpVomtcai+v8 X-Received: by 2002:a1c:9d96:: with SMTP id g144mr3297903wme.46.1616170452820; Fri, 19 Mar 2021 09:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170452; cv=none; d=google.com; s=arc-20160816; b=ePswK7yA/dN5wQmg+QnFaIUhaVxd1yvklNn6CGf70XNXIDzPfJVFF9c3+Z7D5b6Mqh z6lsQ5zvbDCpsjaCyzgxqVIUzDxUgBcN5PsN4VknVnvCdmwjGWKY+HZ+KHzgKd/ctWuc BQLSwreJXUpiERpNFKkV5b3gmOcr+fLQ2MWRwQl1Sg1AZob71QcHxkqAH5hP/5t6u3JJ KWzKSNqDV36zw2GiqvPHMOBUJtjcJa2lDki/4DhG+6gZsQ37xPhV5MwmYu03tN2NbQbS F+YAKLyF6O0pRf+N0SyXj5eaA/Mvucesg6V97KsBLgOtH5xQJwJ+mcyvkINd1VqHE/jM 3apA== 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=7g6v3y4EqVt8ZvdJTfK/Xnvz6OTFe7L+f9gyq+Sp+vc=; b=EWxaqerZjJTpVV7ZHfq3Pd2ZbkbYXGqOv/n5Arb/PSL7ZGrgWi0DT0pvsAhn4k3FBJ aU7jxNKYNyfNgFdvIJIWlMDlokk5VlZw0dAuEu9LvSk/vUawRYbOIhk7oRr2S/3zZ7Gr /xcUvK9CztvP1FlGbsGyIilXG2VSYQZA/rq+WS2Uh7ISgxDtJAmcYu3M2+wv8H7VamE6 ATOBQRZkGJ5i/RNaiBibBP3Y0wqkzxPhTU63lzQYJqDKRlQn/iBtDSMfjTvic1nGp23i uFFVoMNt4IfgX0aoHkST8JG1xsjSI3ac4bjwXaRl6sRqc8TP8w2D6cjP4R9zvzY2HaOl XbWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=ordyNJ0L; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FJSdSqNZ; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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 desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id k6si5225429wrl.254.2021.03.19.09.14.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=ordyNJ0L; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FJSdSqNZ; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 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=desiato.20200630; 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=7g6v3y4EqVt8ZvdJTfK/Xnvz6OTFe7L+f9gyq+Sp+vc=; b=ordyNJ0LQZqq7eMC//KdqAdNl iF9QV0PriECy+/RMdkanypS0AzEMYbpGIE6RsIHTRG5hofvQol3vYTGyqXC56n/tVkju61zq3usQq pTAHk9ZIziUfWrMfWyq6/cbXVH8WMr/McK1CxC8FsMHQ9ZCg7xiSiFdNMNGAUFRX01hig78tEpPsU bXHcF0oFbp2Ars9NakCPzZSN56/8kOIb4/heOf85mwESDFPK91f8em3ordZA+wLac1WZPACziv4Gw 5vkJ5D6CuVyZzJOiZkZHM5a2qAJeR70G9674GmGuUZEprJr2eD1zxhyAShWZsd336Fuw7EkIN8mDI KVcAwwa8Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlL-007fuy-LX; Fri, 19 Mar 2021 16:14:11 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlE-007frw-Ag for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:06 +0000 Received: by mail-wr1-x42a.google.com with SMTP id t9so9655327wrn.11 for ; Fri, 19 Mar 2021 09:14:04 -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=mV90VGp68UpB1XdgClwAqFevTATKxZfnnJBOM1WpO7w=; b=FJSdSqNZFiH/vI0np1Ctn/xVLQ06o4mNg6aH3Vi5uniaZ/nzoLLNuKdqM9yD/W2EtI 6ARINNL0XzrXZcH6tToNhW5WJMaEwDsNcDVgGGSFl/AG07lRbzalSF4MczRPxsYMFWgz 45Pc6pz7T6kitwbeidHuIqi/SWML0xGXyyzij5kW5FsMO17I/upT+R3CulJSbQsPXc6U 8XOSddWHB1TjZrcj1rz4gXAl/6RZsj1PapanvEGrB6K0u0JsItdMCqAPmUKN543y3T+a Sb73QVjRMX71wKIusaCmGYCrMRssfU2s3Zubsn5FL7OkfX1FpAUJSCQYzK1KJWNuqn/H oWuw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=mV90VGp68UpB1XdgClwAqFevTATKxZfnnJBOM1WpO7w=; b=KrJDQueNhJRF/RQqXeUkLiZ09JPTQFFFYoCf4Ev4yjXZYZypdLkXMtqehv+uZ7hHK8 KqlJuXiseLxwbQSFC2YFl8ConUqX/Op3PUU6gMD8+bEB8yckajnXkf+N76PRLJHGEA5z crEZp5pbmQkc32byOXg3vlBI1wXdN9yl3RLVEwoSRLfwRLPNFyAEwMZSKIQBdqTiK4yl D3Nauamo/R17ldRneY53eexJLN4DTP2eH8u42jjeTtjFRt5h4/emYpzu2c9tuBYL7CI3 pclc4qrWin2tz9xact9GBwfQ9phctf4XwjEjb7wR6i5epJU4n8vbCUuga3lEBN04hAKW yytA== X-Gm-Message-State: AOAM532ReI6j78w9L1hSibgzuP0TPST7YzH+xR5UxiA3v0TgLtvUuPl6 w7CmVRuxJZSo8fVZFG4NSJvykA== X-Received: by 2002:adf:ef4c:: with SMTP id c12mr5413318wrp.112.1616170443791; Fri, 19 Mar 2021 09:14:03 -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 h8sm8432495wrt.94.2021.03.19.09.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:03 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 12/12] wcn36xx: Enable WOWLAN flags Date: Fri, 19 Mar 2021 16:15:20 +0000 Message-Id: <20210319161520.3590510-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-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-20210319_161404_475368_FD859DAB X-CRM114-Status: GOOD ( 12.87 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Enable flags for - Magic packet - GTK rekey Previous patches implemented the necessary code to switch these two on. Standalone magic packet absent GTK rekey is pretty useless, so it makes sense to flag both at once. 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:42a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's 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 Enable flags for - Magic packet - GTK rekey Previous patches implemented the necessary code to switch these two on. Standalone magic packet absent GTK rekey is pretty useless, so it makes sense to flag both at once. Once done it is possible for wcn36xx firmware to 1. Respond to ipv4 and ipv6 ARP/NS lookup requests 2. Bring the system out of suspend when a magic packet is received. Magic in our case is a simple ipv4 or ipv6 unicast. 3. GTK rekey whilst in suspend Once we wake from suspend the GTK will be updated as necessary Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index ddfc60e02389..7838d2056e54 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -173,7 +173,9 @@ static struct ieee80211_supported_band wcn_band_5ghz = { #ifdef CONFIG_PM static const struct wiphy_wowlan_support wowlan_support = { - .flags = WIPHY_WOWLAN_ANY + .flags = WIPHY_WOWLAN_ANY | + WIPHY_WOWLAN_MAGIC_PKT | + WIPHY_WOWLAN_SUPPORTS_GTK_REKEY }; #endif