From patchwork Tue Jun 1 02:49: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: 451344 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331361jao; Mon, 31 May 2021 19:47:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+Joq04cMBx4lcwG8vEY1fNrSta96bBRcEJlGFwx5zN9BC55R4zC0neDUstoPWJXojYA82 X-Received: by 2002:a63:7e0a:: with SMTP id z10mr24971269pgc.12.1622515665044; Mon, 31 May 2021 19:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515665; cv=none; d=google.com; s=arc-20160816; b=h3okyUf9/2CDXFWLE1m316uLXYSI1t26Y/KJ02Tm1QbGGnMhWSOCQ23eGGjusUpJ0n 5DtsYEf2SZ//Moj+PUbpD3EKCN2GZguMzb9sL1cA9m8iyfde1hi+4esVT1kCb9D7vEL/ ElELKOcwuquaBvk8S2LPohIec/wKCGoIW5LCjr6Mnp9ZvY/53PnFGKd98Xd4kafYkKxn 3a3dJ/fksB5gHyUFiG4IBNu6x82va3g5HZHD7jGSWSIh2yBMoyVgQbkfJSA/WhbZKkv1 6dOfMQSD/QJzh7H2IPOn5M1wJ6IMh/IwI1tP/u7gFYrIpuQi8kXZ5xOaB8XAE6s3CZ/B mROA== 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=0Gdkz/KEJhTM811+R87TrXaVHrhiO9JtPO+d5cM13yM=; b=G9e25hFR2VJ6YzlHZZBWgFx438ba+/iHtlGOfTbmYIQ7oBho+fSS+N+1vUF5z63JDr +3kfWgwGtg8ADWD2iNicdxGccCYS+1n2DE8LtGESUtJ1/65rTC4mg3UKfwUxT/Sop7E2 lHgVhOg5N5UWOdQ+UDHvYTlDtDIsASzoT97XXM+kNEIH1vgWQfe2TkRaXO+6N2UUaEpf oWjkygIOEnZhXQHa+K29s9rKf+vot22/ehSoBRgGeGS6RBpv/drlBS6ZecoMC6lTApf6 u+CpNr5xG+i1mkwRVnFWPzcDjS1ofTJnZezq2//3M4lgvamdBVyxhAZY5sy7ufKOZgwu +h5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=KrnqyBrf; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Lo4bik+T; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id j125si18104580pgc.368.2021.05.31.19.47.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=KrnqyBrf; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Lo4bik+T; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0Gdkz/KEJhTM811+R87TrXaVHrhiO9JtPO+d5cM13yM=; b=KrnqyBrfRU1z+X fyIhibpYESkfRIsyjq7zujTdjInLMnJATXvQs6xj47cgMtC3KNTTLyRETwgEdBxaM5VGGdOmKn9j6 6gcYbp+IoZK5l09M96KQR3Bw9Yggv+bXSsb6d/iG+3YXX2tAK1lZcv9tB7L1FjRWNCTQwAHWbP+jz 6+03Y+DoNOzOsxhV8sbE2NkMjV0z5L/f5cQBUCDDSuc23gEuna4VNUcu+8w7ahaiGrwVMD4SDxMHh Ec7sAvEczQFFQzSVlrdxkErE3ohXVE4Oi/PTRoP89GWngLACakkDa+jTViPaIsQtZkz+4s7j7224Q 57C+rCdoyysmE/AlTIYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnuRS-00EJFj-If; Tue, 01 Jun 2021 02:47:42 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnuRP-00EJE0-KA for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 02:47:40 +0000 Received: by mail-wm1-x32f.google.com with SMTP id z137-20020a1c7e8f0000b02901774f2a7dc4so612608wmc.0 for ; Mon, 31 May 2021 19:47:39 -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=/kuNaO+3BN/9XKW0uTC+mnQ6gznoI5jFyk7Mscc9K1Y=; b=Lo4bik+TZIU7M/QWJWM5fLz+7AXZQdnBL5yFb4HyrbKXHXnK1j8SQPO6Ww6AFOyK5M SQz9EzE2DK0StDXBpy8EjrT+KR/WHy4LxvTkD+HTUP4NcltISAbw6mn/jRBjDyVkrf5U D5AqLZRtV+sPhTEi5FhYQTij1fnwsVagHf6d0yQd9dXzjrpWjuyG+POHeFAiiFerR4oG 7+KMYjjpmLOnMCztYQYN0m4VOnRN53WdQ03I1KnrEKKIl04ck+uBIm6uxVepm81dlP5K 5XleGfmZUBNMPPjoEGHI0SmUefj4k4h/tfLqI0cK0FGi2WqSNFtFsFreRgnIrGqyHH4u VjdQ== 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=/kuNaO+3BN/9XKW0uTC+mnQ6gznoI5jFyk7Mscc9K1Y=; b=raNEZC4XMjbmscL9bUqPaKuSdGM23HChm2P1haibmSxicp5HyEu1cuJhljHZZfDqQG /afSuvhecD/Z2C6QcMzGWuRFnW1TJoY5jea0Fb4mDVaOJqVgP5WA1XXeOU69jysUImYj 7hjfPZg2dOc25W41rxRFbzYM0OeJ3WowPNVxRom1/H3QU+XMdzqLdEdhn2dga0o4oDic tyx0mEeKCROXLzA5ShJUaoI0RQV78ky8HOXF9vHT0I3TLdM9BFBb6bknh5UDC6iQxdd1 cG2WVYuvfZr2ZuGUuQIP9Sdstp9mSLshFqIY1L6S0MEiSWJi3jhrUsDzXNeqAj0V1EFR cOeQ== X-Gm-Message-State: AOAM53077Yh/BeQIxIOEmIEOqiSQ5RzRnE8q0IWzvtvuWVnw7HhXYvpJ Ytx1EcpkdY8JEsvDkZAkLoRK3A== X-Received: by 2002:a05:600c:2301:: with SMTP id 1mr1823494wmo.180.1622515658225; Mon, 31 May 2021 19:47:38 -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 e22sm16774014wme.48.2021.05.31.19.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:37 -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 v4 01/12] wcn36xx: Return result of set_power_params in suspend Date: Tue, 1 Jun 2021 03:49:09 +0100 Message-Id: <20210601024920.1424144-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-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-20210531_194739_698976_13573694 X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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:32f 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_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org 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 Tested-by: Benjamin Li --- 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 Tue Jun 1 02:49: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: 451343 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331359jao; Mon, 31 May 2021 19:47:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd6FgN1aPy+ISnj1buDd+qUp+z2ICVO11iujjFvPPpaiQwjzM5Q0uWL9MLQmlbtCzMTS6F X-Received: by 2002:a17:90a:5405:: with SMTP id z5mr2219724pjh.38.1622515664570; Mon, 31 May 2021 19:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515664; cv=none; d=google.com; s=arc-20160816; b=CtvzyFQTyWkLVSCndf1YREwPXMeUgMtHlSGL2XcYakwH6A17Xc6hs0c1PJNNArjlsb F0W0Lrc6uDCbmSuPu190ibXb2kGLmZQG/WZhOS0btms0vZsmhszQ4g6cRO0UY97MKPms HfwRQ/qaezmoX0wrzaJ30p2NN9VytteFaDfJmMEL6e2hAQy0GRk+QVyIsLVkwLpjuRjm Y4uH3HrNq5KH5L8EZWSKeZIdxOXZlHFVzpEiUAltMoC4x4orSsjhnf8ENzSqIOGAYzJm 46LszF4Hc7juzOXTEQuTCbDImepknufLSP8ZqDqDUfo0zzXxSb76GOk1v7NByAJMk1PA R87g== 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=up/pnq+Lq2vqkduyQD9YNvjePSJBYaAKyFSoDkItQNo=; b=c+Am8oRBGzB3Z99KK3ls2QuahbryHsnnEgsrQPI/su3IUbLwCVKaTNrNn9HBYPPm3E LwCqU9RQgJqEAkTc94I7Fy9NRB/vW2sCUVsJ6dvu9/AZAIt3tLPpO4+eDAWf8SwBLx0w 8xDTcBVmGWP2WCCn2D6K1ZcgmRc3+AmSX4CtTG3fD8tbR50+CtFDdR4Jqzmrkd4dpXCF TrybY3llr1io83q6JuJJXe/ESlpJJJMjzFsNL9r1+4yaO9vti9UGme+gES2QJMjTvCxn 0EVYbGDgdaFw2QU+nOfe3wv1U2CUE0UjQ7rU4G/qo8reoe1aBfwoFqhYbSEEUaXdFi8e bQ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=aEYmcHuf; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KPXxiBTA; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id c3si18784174pgv.41.2021.05.31.19.47.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=aEYmcHuf; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KPXxiBTA; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=up/pnq+Lq2vqkduyQD9YNvjePSJBYaAKyFSoDkItQNo=; b=aEYmcHuf4N1rlh zogdtOrJ6VgRKsVO9vw08PLxK2WPZatYaQ+tnA1hMP7ni6I4DjyNPiyAuspGiqss32EEleaGFk41F SlqXZuWPUKEAFIOFa1skCQjmjCsAFzGmALJICYgsnbSxRCnfR063veV1Pl1EoIuiiTZvvHLObjAI0 qyTRs0dzBQw474lELTYdyblHZmmfxv9U/3olntTdLXeNs3GaR2TCun17LRCds3seGOAYJtHX9fYXJ pu6DKmJY2pmN1rxemyjm3irTs+zMVIhQ5Hz0OmR+avot6Xtf6GqWBLZXyBPf/goSqWRMpRArKxdbI 2aWZ1acAHfbG72LTE0SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnuRT-00EJGu-Tu; Tue, 01 Jun 2021 02:47:43 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnuRQ-00EJEU-MM for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 02:47:42 +0000 Received: by mail-wm1-x332.google.com with SMTP id g204so3946680wmf.5 for ; Mon, 31 May 2021 19:47:40 -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=ONbc2ptFm/dZBx8XWwy/A/AaOhsPLbrPaqAnpZ4ZWqg=; b=KPXxiBTA8FxhMKM8KZz+vK8VjkqSPmQiNujL5TY+RPM5AHVzbRSuWPP90/09WzX4I7 ArL14S5OhYZgTICy1tZ5GtDi7CtDmshzwk7yi97HG7w3ZMMSaposNJk70digd9mF8i+f 5KU06iHAWwrKJgQ2SfvqF2YvA8uDs0UzqeE+3CHeEadj6X/t+QhZjhor6hAjoBXwKN9x hBj9kZwg83yfYjMkyYZzjjHVvGomG2mu2Sa3vMAHdwlaqULnEfTZYQs7aVqz+sknz5f/ cuAYC2vUjlxeuk+Ait4jfMO+3nohBq2bYx+aUj5l+rWoxdpUx4/sg26KXcGm3nmHN1rV E/Ag== 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=ONbc2ptFm/dZBx8XWwy/A/AaOhsPLbrPaqAnpZ4ZWqg=; b=MFcXuVK9SV4WYZI457E63okkpQVlNJY4VKRTCskxhx01UNBfHHPTv8VLDqmCWX9AA/ NtiK5xki0YQvvd37LB7h/6tTTFXgKpLwJC2XbVNMaKjbCmkRGWqyPpWfLLBWHpUCR8xP YPtgIQ7uqAe7nD4ELSvhFxatdiVR6rAW70SABKjYZr6DAU0y2MIrjwqutDO6vqAqxAOV 9RQL4RrH4uP1u86rf02sLouFaAP77mfQX3op/4aV/sA1aPDUwe76DsdR2aC6ZC6p35vt aozTRvGj9y0DaUQvnDh0goOM5Y7qXh3cH/tiO7EvM52uSZidBO940IQRXRmg5EaAr9So 3cxQ== X-Gm-Message-State: AOAM530Ww5HYzS1p1b3w7sroABhslhp2veaog89Njb7vre4RJgMTKYCc Fu2m3NygE5ktQ69FDVXSZLBzqQ== X-Received: by 2002:a1c:e343:: with SMTP id a64mr3209594wmh.114.1622515659249; Mon, 31 May 2021 19:47:39 -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 e22sm16774014wme.48.2021.05.31.19.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:38 -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 v4 02/12] wcn36xx: Run suspend for the first ieee80211_vif Date: Tue, 1 Jun 2021 03:49:10 +0100 Message-Id: <20210601024920.1424144-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-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-20210531_194740_751857_D8C36888 X-CRM114-Status: GOOD ( 13.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:332 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_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org 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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/main.c | 30 ++++++++++++++++++++++--- 1 file changed, 27 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..6802dce2a02b 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1088,15 +1088,34 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, #ifdef CONFIG_PM +static struct ieee80211_vif *wcn36xx_get_first_assoc_vif(struct wcn36xx *wcn) +{ + struct wcn36xx_vif *vif_priv = NULL; + struct ieee80211_vif *vif = NULL; + + list_for_each_entry(vif_priv, &wcn->vif_list, list) { + if (vif_priv->sta_assoc) { + vif = wcn36xx_priv_to_vif(vif_priv); + 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; + 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_assoc_vif(wcn); + if (vif) + ret = wcn36xx_smd_set_power_params(wcn, true); + mutex_unlock(&wcn->conf_mutex); return ret; } @@ -1104,11 +1123,16 @@ 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; 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_assoc_vif(wcn); + if (vif) + wcn36xx_smd_set_power_params(wcn, false); + return 0; } From patchwork Tue Jun 1 02:49: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: 451346 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331392jao; Mon, 31 May 2021 19:47:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIEBdJE/EqwlkPU5CXyBuQYX+4FZ1y2609heW3k9if3/E8DlgVZjJ5iThhttNzbCj595nI X-Received: by 2002:a05:6602:1223:: with SMTP id z3mr19450543iot.97.1622515666844; Mon, 31 May 2021 19:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515666; cv=none; d=google.com; s=arc-20160816; b=I9kgOrO+6Nwl86pri/6VBRuKhnZYndSXAqdFXzBV+FIG2cPR2RrhsJZ3MF5cY0HAjS gbOZSAl2AOlHiciMqS+Woi6gMhAp4DaSaKmeLZtE2NcUTEhn1OVpdjd51mNZMhKmaBhc +qJgDKR6mx9c7lmovyDMSWpwDUq5EOJqMLDFFhM2tVArIHD7j67lvtHRcgoF8ACOe+BQ aSad3nVOATc4mIt0Wb/BFqZgjki4umfj0mNeyzWHJU4vdchFeEwZXOyMBXv6VY0y9rEt Ypwl7cAgBEP7iO4eJg0des13utEa236RilKz/PV9xsRGJM/AX6Br8M76UKMELiGDSkf9 K5pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KsNT4vuAeu6cKVvNObaXWqMoOE4c0iCL7hd7Q0QF6h0=; b=aPfO1bZDIFzkXQCQdKzfg7AbhBXflo/F4BQ2rH/ETXkNXbQksQ3hcKbR+MZO1SL1xG dBb5WsvcACUmCoE0u8Vk2zDvKXh3/lvmXwDw/u/1PvRZhvrxwlldZewZjZnApkGSm1mS d83ylF3anAdEapkPoPqZHRsQVriwh+M9ERDxQMMRAInxbnNxvQEBnIeAv5V8aH3vAK5Z 7yF4U6X3gb3GlFNCf8Bq8i5A7g+Zc8d55a5rc9NRWj+FcIVlPoyoWkIpDs8UarQQaocb KgcH0Uzfa4yxuE5YoKjrvohly0koheejCxceBI7PC4tSfu2H0y6Dhy6+elbNjxs0zfD8 hE8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AnXIbX4L; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.46; Mon, 31 May 2021 19:47:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AnXIbX4L; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232622AbhFACtX (ORCPT + 2 others); Mon, 31 May 2021 22:49:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232515AbhFACtX (ORCPT ); Mon, 31 May 2021 22:49:23 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEA20C061574 for ; Mon, 31 May 2021 19:47:41 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id o2-20020a05600c4fc2b029019a0a8f959dso953292wmq.1 for ; Mon, 31 May 2021 19:47:41 -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=KsNT4vuAeu6cKVvNObaXWqMoOE4c0iCL7hd7Q0QF6h0=; b=AnXIbX4LadPjlIYy7pY99/w63HuWjEMTUdrZwlMdb4htPQ2sYy0caaAbR5ZgsPKqYU ALIuFVYl5DUE90fjFKfBW19i5FYje1lWGgGM0+qNUz7w5lhIzHlCVktZ5oqOnJVMmMmD CPll/rKr0BAH+786YChFPZb+TVMuidClFMi/Xo+QF8m8KVllM98JOTtooFVWe9kdo0Kh TNuY7ce+uX4RN/xHOfw98PPLpYzk5NzC9//C14usv/LREeG4gO53F97JM9NtAPIs3XaT 1HRBZesp+oqe+72JbCfzvJUm0t6u7NYMdB0H4bRuPFBHs/r9peHvUhcXEL6rJrucwbfE J9PA== 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=KsNT4vuAeu6cKVvNObaXWqMoOE4c0iCL7hd7Q0QF6h0=; b=Tf9MQpMJo38YjOhKeTzN69STviH1E7szun1Jt7+kjNDBX73arOQVkJAcxKDrQWXd5W zvE90BBVtt9ye4iv27N0GEBU0kycSM72JkYfWMjnC45Ifwplx8Mhhl6xY8sfrafwZkvw ZNhGP3UUt1BQKvDeAQ/IFfcUw5kg7ToZe+fxxD1zXFmecPkXTnVHDHMJcEjuVflRe7d+ k+gwR7bv4BsVP55q9RDAL6ZvfmMDzmhg/9CFoFyQZY6HEbtUaXFqPLEEhwwhQZdK90Eq F+RWwTqiTMFbvUZaTdv58pJxSYdWHS9mV6H0mQbWrw6pgsfumesbofTHh9HX8z9P8va1 Jb4Q== X-Gm-Message-State: AOAM532QLwQLrdMUcEL5limk7GUQwleMfYZJmNmXfHHUp86CGuk1/Kkp 74w1I5ygiEgkbwOnaqUZWmxH2XFvjqiP2Q== X-Received: by 2002:a1c:cc12:: with SMTP id h18mr1789554wmb.179.1622515660448; Mon, 31 May 2021 19:47:40 -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 e22sm16774014wme.48.2021.05.31.19.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:40 -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 v4 03/12] wcn36xx: Add ipv4 ARP offload support in suspend Date: Tue, 1 Jun 2021 03:49:11 +0100 Message-Id: <20210601024920.1424144-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/hal.h | 10 +++---- drivers/net/wireless/ath/wcn36xx/main.c | 14 +++++++-- drivers/net/wireless/ath/wcn36xx/smd.c | 38 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 4 +++ 4 files changed, 58 insertions(+), 8 deletions(-) -- 2.30.1 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 6802dce2a02b..0da123660fa1 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1112,11 +1112,16 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) flush_workqueue(wcn->hal_ind_wq); mutex_lock(&wcn->conf_mutex); + vif = wcn36xx_get_first_assoc_vif(wcn); - if (vif) + if (vif) { + 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; } @@ -1130,8 +1135,11 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) flush_workqueue(wcn->hal_ind_wq); mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_assoc_vif(wcn); - if (vif) + if (vif) { wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_arp_offload(wcn, vif, false); + } + mutex_unlock(&wcn->conf_mutex); return 0; } 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 Tue Jun 1 02:49: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: 451345 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331394jao; Mon, 31 May 2021 19:47:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAB3ii2Iqavff3tx7rcCTH8hWOfVm2gzNP+Tna8Eh9w+2DEjTM1jNB3jNR5kbabKRpwmbV X-Received: by 2002:a5d:9a97:: with SMTP id c23mr19411046iom.38.1622515667030; Mon, 31 May 2021 19:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515667; cv=none; d=google.com; s=arc-20160816; b=BHvCxfx7nYOli9LDXefBSJs2MDYRiMHy2DcmhqdbLLmhvqyksPFg3Ka2CDQUbn93it Y2f1iVWuwUDbYqI3HJ46O72ua/DQRF9wzHKAWzwwzJh6fi5t9akBOYYeK1Kxgk4SwBqP zcUwIapFojdrqMXMdHH0c3tqXUtvEHQu/CZA3eb+76WJOioXrdA5SW0fZSdA5hDyPK3m FpDPuHkx3R4zMYk5F3J3N4kruxBlLgJaJLuw6pgGdP4MCNAa1YadyiVBMRzK3PUkTr8r Ik79/Geow5G8bykBhGFHucmqC2IrncsY+FIapmBurzcedcuWVqBcvA8IiZQdHEyn3cbz cfEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SquAaKfKT+XFRM7MHN5IY0d9iler2O6E6du+Hc36euc=; b=J/462T1etrpLVEV4RIGmLMFIq7m+VLL671FAgJDvqY4UzPrI0oLdq6Nt2z+7zUE0xY ByGR9yUzkZ0SvDOy2t07QgZWyvzer++Oqd2MfksOj6QPsJ+/Xd50IEXiP06xR4qIR6ga c9vdEPH+7qsnqtX1pzuo4Fr6Nrtd4b2BD2j0EFLh8WmY2gtU9DZaebVJ97+herT/yEQA /bCjxPLETlQd5CMi3VQhKohM9G9cTUQ7GsIKh589iGBb8GePU/+Jnf3VHjiF+uDOX8pc 5qAsxo1NlXh+W6EC9PoZj1MIvIfOLl5xUh0GaKdBwKbb1kdO3aK11QNYvneCjGD7ofEu QfuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZpgO2MP1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.46; Mon, 31 May 2021 19:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZpgO2MP1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232633AbhFACtY (ORCPT + 2 others); Mon, 31 May 2021 22:49:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232598AbhFACtX (ORCPT ); Mon, 31 May 2021 22:49:23 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE808C06174A for ; Mon, 31 May 2021 19:47:42 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id f20-20020a05600c4e94b0290181f6edda88so553061wmq.2 for ; Mon, 31 May 2021 19:47:42 -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=SquAaKfKT+XFRM7MHN5IY0d9iler2O6E6du+Hc36euc=; b=ZpgO2MP1KriQSIbxmw/bWEOAHcTegnidOVBirFpHKEIP++ugodrKda0zumw8j6B/fG 5x4Rg4oXGbrV6FSE7i8k5NLNelUVoEEiL2Y6IKnz5KZrJ1zFWpXNTeiXY/bOpsrYueNw 738HVPkdnaAStWJUwAl5wX6sjXHuciIZgzwqV/E1JMOmlDby2t3EODjDCrUhFsDUAl1r jNfd6tWrs3hZtpLpWIqvN10DYxwtG1QsrPv+k6rynslpa0q9eMR2vFoRnLl5ddh6jh9D gOUU9gGDZzE/RyuELg4vA+7Mjx9MWBYNdsJihQtV6rBTjZzq52T6FgdP6wlaR+d9qMne kwAQ== 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=SquAaKfKT+XFRM7MHN5IY0d9iler2O6E6du+Hc36euc=; b=I20Dg6wr1nh39aczGW9QOgRM1CFfw72wioeV0cnfSQ9XYgwI9S4SnZRDImGiSocNuP pIJHkUDxY/7+Ni0zPmaox64tS8o8jfIjfllsDm29HgCWByRv/ggelohwT8Jrj0hUIbhF ReXkpOu1eNZsEJ3d86H1Exq3ZeCOlXjSuyeAHSQ1hfHeND3LIMPpp7OxI+W4wVeTJCZm 180EPY1kEUSc2dtplsmrERbjot7YYtn2kQlvx4h0fDvRRPEyC9d32u/Lkp7OLOqRR5v6 4IAxjDPQycX87iszyPeIT/yCjmzlUazN5P0/rfg07/fqQ5zFudPeQfdZKblPUhVhkqhC 3ahA== X-Gm-Message-State: AOAM530kbeIVENfKRlITaMT07dbVq5J6ZwwiArv2r5SzsCwfi1wqgt9K k6YcfhIkoVIfdCSqREbOgq5L3A== X-Received: by 2002:a05:600c:3592:: with SMTP id p18mr23608352wmq.44.1622515661410; Mon, 31 May 2021 19:47:41 -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 e22sm16774014wme.48.2021.05.31.19.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:41 -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 v4 04/12] wcn36xx: Do not flush indication queue on suspend/resume Date: Tue, 1 Jun 2021 03:49:12 +0100 Message-Id: <20210601024920.1424144-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/main.c | 2 -- 1 file changed, 2 deletions(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 0da123660fa1..9731fcbe2e7f 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_assoc_vif(wcn); @@ -1132,7 +1131,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_assoc_vif(wcn); if (vif) { From patchwork Tue Jun 1 02:49: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: 451347 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331396jao; Mon, 31 May 2021 19:47:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjsOBdCVoPbGlN/LclDXWKQXHTgYrV9gQGdu9TG6xUFL4ytiokgKaPyMhYcdwP3OcQwAHS X-Received: by 2002:a92:c989:: with SMTP id y9mr2016260iln.228.1622515667327; Mon, 31 May 2021 19:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515667; cv=none; d=google.com; s=arc-20160816; b=TdCYyGWQMyqro/71N1Y5pQx6GdgcV3f5jUZi24No2k8i+W+GPK/pyukD5Uz7EDh64I uwsVGxO78koGGon5pVTWEohtprvh5MZGx0H9eQZnxCLURvrZa5kbp+nmOruapubClCES 57M0RXGy1E58AcAQetpV7ptIctPjohvO/YJ8UviqMViB64YLume0mTLNbrieE4hi8fUL hDL/WHEA86FMQC0OWxtw5kT842t21yn++CdipDUnOlp3jY8N2qion3hS3XD7se5MiQIn 0Z31/X/TVvIGY6bd+jSMKd633zOgv5TS13DUcjDXW3iumj7iz3VQE8i3efB96ubqKzG+ RTJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W+UYnqbXmGpOtA5im0JIGu1QFL9pMS49kWTkIpsAbWs=; b=wl0Ze3eyn5HwHtJdikWoP6KN0ghs7hE+zxwRD0YRcq/qQ6Ubl81yb7jtY2yFg1s0/R a0GDgeGLII6ifi+c9uX4v+Taaf10N9pgfcKLj367XKkgTf8XYizz+7/RD+DfwXeSCsmh 6ekbhbMtVZA2FNZPPXPA7GAPObljz0SFq367c0sI3lY60E6Ii8GZyVpgoLmNbmH52OMM vBRZ6V91Gu3Z8n+FXV/UgUaiG/LQRrfhZMUsaEkZIRB0k9tzaksVEQhjCe1y5eMfhRey W97Q9Di/8wpKHyTgjLyGKuVkW/C2OXOIXNvSh8eWPUysyn+EiilagEc+3+stbaiISvPq DO6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FmNnnm8l; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.47; Mon, 31 May 2021 19:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FmNnnm8l; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232644AbhFACtZ (ORCPT + 2 others); Mon, 31 May 2021 22:49:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232635AbhFACtY (ORCPT ); Mon, 31 May 2021 22:49:24 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB1B6C061574 for ; Mon, 31 May 2021 19:47:43 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id f17so5759167wmf.2 for ; Mon, 31 May 2021 19:47:43 -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=W+UYnqbXmGpOtA5im0JIGu1QFL9pMS49kWTkIpsAbWs=; b=FmNnnm8lmFjeLCGy1WiL2iD7uc1zwahc9GphBEZf4CtBa+2XLm9uF3QJ6Y58PupRUX cBI8Krv5BRJ1EVRnwJRv1tNS0W2UOSjUlnr9DK2xswpFgRwvl7XXedgSUTpa42T907zZ 5vMjv59Xz6Z4HtmDosWdSSUHBx5ecCKzMALDviJIT/8tRuaDaBiCt7s4fma958cRJCwF VwtmcnewEFEqeS/MJ6wQNyVLSea9VrojUxE7oTu3UcgQqw6iJ72A592TPeCZKHyMlqRM QeVygx6kVWL3t0cc+XETVaniea+94iCeJeyWUixhAn21/GpOFDUOHpmLyrODTGriFQHP 38ng== 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=W+UYnqbXmGpOtA5im0JIGu1QFL9pMS49kWTkIpsAbWs=; b=WQfUUltjLalkMC6G0hJ4ZwcgJ0n4t37yslg/NO5gVIiikBJBbX+W9WoeR8BYZT50wV QzzmIJSTPvuxQKLV1GkvdtWIpwNrpWAIazxmi81xnvOlTsvi6KEReSgT+QXQa7+W8KML eLkW3vUcUUPAlTenpuyojqJpVLDSdTDo/oN5xUC1WsBpmhPvgqrlzRtQG54+Vr7OQvaX YDCPHc0kicnHps/sqJtUNnt2L9xJFKuxqzKt2YbqQAIqmy93LdoaiJLa766Plw77vV5M Tj2MA0UN0WVI2ETri0uM4MSHohqi/FjyOEFh7IXsmt6dGrk8UiYLJpGCVELdlzDXH6QV z1Rw== X-Gm-Message-State: AOAM531R9Kj8YIdFG9SA2Cj8G0IhIJaBg4pVQ51bBgYV/V6V+7QOKxmE YLfZufZD4yBolwUa6jQf8pNj7Q== X-Received: by 2002:a7b:c847:: with SMTP id c7mr24117006wml.168.1622515662356; Mon, 31 May 2021 19:47:42 -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 e22sm16774014wme.48.2021.05.31.19.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:41 -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 v4 05/12] wcn36xx: Add ipv6 address tracking Date: Tue, 1 Jun 2021 03:49:13 +0100 Message-Id: <20210601024920.1424144-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- 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 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 9731fcbe2e7f..240ecdd52f81 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" @@ -1208,6 +1209,34 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw, return ret; } +#if IS_ENABLED(CONFIG_IPV6) +static 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, @@ -1231,6 +1260,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 Tue Jun 1 02:49: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: 451348 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331402jao; Mon, 31 May 2021 19:47:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGXA/0wnzsuBAPozpLtP1k4mQUttKyNH+DmhmuGVBeV/rb5vOsgeJ2JYiTcgHFoqcEdg5X X-Received: by 2002:a92:db4e:: with SMTP id w14mr10831135ilq.232.1622515667660; Mon, 31 May 2021 19:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515667; cv=none; d=google.com; s=arc-20160816; b=tdeMd0vWHZxduDxBg1738bZFnI09g6xj+RmmhincOXEPj9rku5mc16CDsXfxcd0q+x 15ovCV1zX13zC+7ebnF6X1fcblanZieagc4O8K1/JiHpz6HvH9WJ//c4LI6y+r75o8WD 7Hy9K1EJmTCVKIU5+rKyW1moRpskGwwXXkN+Vt+DzkaS5V0YLgunVKZO29D7FY5LpQr6 jxxkoyaHh3j7ZkEWweFJgQy0eTXrwHuVLrnippp4jRzMn5LscUEPcMAMH237ZaMm167H B2jlSM+OaqTgNUVSTDp6zd4rbpmG1uIKDJLVYK5PkzlFRz4OifSkwcRbFNpq6AvY2J6m QpIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RACFcUJtiWm8MN8W1vtslkiqbwIBEQgKrtcO2mZsrAw=; b=lTVM3gm8ELxqgMwQrYdDphBtUHMy4pzyBvqLUqHZ2sMcy25H3tTaMoe9P6YnlQaq+f kuXJQyv/AE3pnF2yCzWCI4g9AXtWEOWsQO7OzHq0yEGBQwOrFoiYqWuiw6fNFfjGed5/ mOFVaLRQH9Rr0skCG6fZ4dMDmOdM9NpPlbT8efG2x1wSEMtZCgngUJorUViUY/o65Z6q geQFRgOVxdzgBTx9Mbwp+S63Hb2n4XQm0o+fV1XPDgIqd6Y4nPCqG6eOSca1f3gNcU+Z Iji+R1nYSEkSphowRkbNHFz3Q21JMeHKdHWFKe7aYxMRxmVjluopvRP6pz7hNf+37pFj 0bTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cOF0m11F; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.47; Mon, 31 May 2021 19:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cOF0m11F; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232356AbhFACt1 (ORCPT + 2 others); Mon, 31 May 2021 22:49:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232503AbhFACt0 (ORCPT ); Mon, 31 May 2021 22:49:26 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC08AC061574 for ; Mon, 31 May 2021 19:47:44 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id r13so6696043wmq.1 for ; Mon, 31 May 2021 19:47:44 -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=RACFcUJtiWm8MN8W1vtslkiqbwIBEQgKrtcO2mZsrAw=; b=cOF0m11FkBVDzMfncBsd7LzLkKEZUYeWC0NvZV1RYRg0WgjmDo4aJMmBmHJY3zHyW0 ld2wa+l9G6p7J4O741biGzu8PqhlWj9wF+gZqBl3B8eSlyB7AfcU3MpFugZHRgLKtMbX x1xo2rfup82dWaX+Mj/PpXzd1O2oz6SCursbIKwbRjxgWSzlZx7sZqCX7+E081v33tmM FfyFW7XSsfXnNZJDVwJBb0KARZiGp4vEDTaxMcQa8aCJ/x+DguyGvX6KsuDuK01W0lRT RI5hbNDsVn4dcCr02N4JqoShCzL1R/1ubsWCDK1pEshrA2kbN7uKJohulzzeH7jBhXgN oYGQ== 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=RACFcUJtiWm8MN8W1vtslkiqbwIBEQgKrtcO2mZsrAw=; b=p/dD7OM5/ThoiW1Xiqcg5fqtDUqmdYKJa7arYRFiMkx+R3ZN3JpbCg21RfvNSqd0sk 0fUuNkb4qy4kj4jkOjuEn8bWv5lhPhir7TMC5LYtM5WT/DgTVxdSFtHLH+A/HuMA2io9 wX934E0Jh/IPaytrbOBEzTUYkSA4Em8mP8vBpH59ztDOHm3AkmHqxKsRAwsjVDYNN9mF nE9/CrgWJ7ssABcPlRJB7GabGiCQhSk34SYwABV+C0I3o9xwIRXWWSypu6bb3LG7YHoD lGW5AvI/WUC17JdN694UUChi0K+ojrhuvj9eQMQbJ8g33MFBCot70nnhaCg6wu8grdmP cqTw== X-Gm-Message-State: AOAM530U+umC7W7JOndidB5c7RNOlQ8zHdho3TpLKNqK9OtHwrvKHM7C AaK1+D9CQmQuMDwEeWS2BDo6Qg== X-Received: by 2002:a05:600c:4f95:: with SMTP id n21mr1836829wmq.74.1622515663462; Mon, 31 May 2021 19:47:43 -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 e22sm16774014wme.48.2021.05.31.19.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:43 -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 v4 06/12] wcn36xx: Add ipv6 namespace offload in suspend Date: Tue, 1 Jun 2021 03:49:14 +0100 Message-Id: <20210601024920.1424144-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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. Signed-off-by: Bryan O'Donoghue Reported-by: kernel test robot Tested-by: Benjamin Li --- 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 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 240ecdd52f81..09e22f829682 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1116,6 +1116,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { 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); @@ -1136,6 +1139,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); } mutex_unlock(&wcn->conf_mutex); 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 Tue Jun 1 02:49: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: 451349 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331410jao; Mon, 31 May 2021 19:47:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd7SSjdlWgwtdTX5Tnv03jngNxHelsO/Vy68iXsqC+vCLvfTjCz+Hgh0Fy/hBusa+enwiv X-Received: by 2002:a5d:9c58:: with SMTP id 24mr19954132iof.153.1622515668620; Mon, 31 May 2021 19:47:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515668; cv=none; d=google.com; s=arc-20160816; b=kgA9mRJsooURx+5CEVdnlMMhimeHVX65PGZ9ZUo5rHstkqK4+uU6yaWqg8BzbAUfhx R6O8DSxaqHoqMLcuHkTrm6X8hx5e1TaL0ZFlE3ZbwukZveKPtZcUm9SfA0NmJ7z78f9S OguNNBkqnWhA+VCxgaypNXYzq0OeTdLMn6zltqXXghn0H7XiB/yqw/xEWrk9+g2I3/A7 vB00yLW2tlOSjoRfF+RgIfCyi28NLFtsaJrUDSMq85ZHSnlQnOjtYq82lr/4cRiyiml/ xgVMEv00Wv6ruuPvfsPX6mnjsfoiFzY+MNIC7EwiHqnSKVceK81e8xhfgGl06MG0Usea QGAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EqMw+TK1CU976V2wAL6yPr0zVt+M7GcrRHHt2Qzbk6I=; b=AC0K7eHWqPnpvyGgjArNHvTV+ZvcOuWn7WoTbj5y0IVAp28rrNk+sDapq8cFCMndHa a9GQxc5k3Hh7kOzA7ktn0VmGWwe6V3gwk6Se4XKWp+en4l7WusZo+rqkXHqZB3YsbocQ pIWsCUIw7RKbI6D4nEUfiZSK3DvV+CN+fDRtPqjl0iz+uvVlxp5dNBRoEjscqfOYXaOt /pGPvsbjgHnrRSENLDRtqyt/yKmiQ09B7+UT8qLDUVMiXfgeBcyTYQCggyFlTXVe3zor w0/p/iai7e5X7HNdYzrB2Kyr+rtghukcru2qbfcathOmiN31lqiTs0u+F1pSy8Su5WuZ iHwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E+9DcNRa; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.48; Mon, 31 May 2021 19:47:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E+9DcNRa; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232656AbhFACt1 (ORCPT + 2 others); Mon, 31 May 2021 22:49:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232635AbhFACt0 (ORCPT ); Mon, 31 May 2021 22:49:26 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CADAFC06174A for ; Mon, 31 May 2021 19:47:45 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id f17so5759193wmf.2 for ; Mon, 31 May 2021 19:47:45 -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=EqMw+TK1CU976V2wAL6yPr0zVt+M7GcrRHHt2Qzbk6I=; b=E+9DcNRaXyopiRpXg0r8Us3pzCipide1qA0z4FYbcPo1NUlmx/nn+XnUPevsXGKbgc ZzYWfPj1J9vLm1CMAaW1obVZz0mZHwe6Ns6xhxHNqwPa51Q8t5AG4cGpk/0rb/yckf4w sDtqd3EhsDuhzEe+5QBVXpI8GY+chMpe+DiM0BycUkNpJ0zb6RxlZlwcOBu4FUFEvd14 5XeszdJQhOh/IW/Se2fQkmZKlh7yCMRY+KLJp9uzxy2H+sTlyHHzHQm2CplRkMTHrN9y w+WBh3s5FXb4corndBbAJ+u/B6aUazfR+Z6HNjn+jk0bnH6Embx0wTR6tnJcl/IlNj9c IFEA== 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=EqMw+TK1CU976V2wAL6yPr0zVt+M7GcrRHHt2Qzbk6I=; b=d87AIu8iUEaxuC3wnBnMpqB5rzkdR5ZSAHrZc9CpqdQjMJxnm5ZQi0pWHlKSNYwuV9 JSx7a+b7SB9LXj97g2CmQJ4OSDBRvD2ntOUKPOTV2XcP080eqDmIF3Z5e49Plq7lYApo w4Bx86AwTN0yD8AxATmqkp+ZsaTw/IyceRSXPlhosUZu9dCR7iPNWI5bwXONV7akbQET qGOyTAz7vI9uq2cyyS7HGqO+VoAAzW1eY0n7kzXstkZy9zadkieUhCuv1eds8EVO7va4 ftbw0KEyX+rxRsbGuKgFhEPaA7J1px29D7LaK6+tLDsGByRGXewRXiHTv1EmBuDOt0ay qILA== X-Gm-Message-State: AOAM532av71oywYaiLTFnrsmwMVTCXp8NtOcjBrqK4+864/AQrANdx1H oYRdiKYp1lgba5SAIo0ifTX68PAScwOgig== X-Received: by 2002:a7b:cb1a:: with SMTP id u26mr1774142wmj.125.1622515664518; Mon, 31 May 2021 19:47:44 -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 e22sm16774014wme.48.2021.05.31.19.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:44 -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 v4 07/12] wcn36xx: Add set_rekey_data callback Date: Tue, 1 Jun 2021 03:49:15 +0100 Message-Id: <20210601024920.1424144-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/main.c | 19 +++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 6 ++++++ 2 files changed, 25 insertions(+) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 09e22f829682..ec32b8b0067d 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1147,6 +1147,24 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) return 0; } +static 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, @@ -1249,6 +1267,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 Tue Jun 1 02:49: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: 451350 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331417jao; Mon, 31 May 2021 19:47:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfc8FPHAghYaAKyxZVzWdTD1eerSMB6phcuj7xvXZce92JaRknIgAEdwCAae74+kjcC8x+ X-Received: by 2002:a92:d1c3:: with SMTP id u3mr4583998ilg.190.1622515669151; Mon, 31 May 2021 19:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515669; cv=none; d=google.com; s=arc-20160816; b=ngIrOcOPFarMc7s9UYrwU139kB4ByL6+H56IsnsRJQuVJJ3JZuLh7SHT2Ff/xOYgBG Jn0GEU2RtxLpwIIc/t6J1jfMW51Qf5AGu4YebvbVn5tCK/TeAMww33pheIbkvYu/59DV kA9gaJQ3D8NEceOYdMV/gPQd8f5S2xaCgJdREp9DeH/+qVix6XaA1oruL4uW2iZg4p5T wwezuo4/RMmpXqUVODMoXXnRMMc258RnKrccMaDyY3sWw074F5G4hDjYoE2epL8EMO2v 5MxFm5KxRedFGT5g3GvQLTwrfC5jvzc6N68CkLNcTL2Wm5+aimtoGyfByg80VIFeLzyp D/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CJNEkd9odSJS4sHsW2fkqbqVW7PMvd2b9q+phGy9YsI=; b=Msf4jZNIvMHKUXwfJaZfpZm2pu37KBh2bWfiIo1fE+rGQ2OPS1jtzeUanC6WWRCpFh wUg5FXNEsZbXljsf/zOGiIxEPx53N/u3g2fymk0gtVvhjYHNAZY7dk+WUJgFY5kZNnjS k8IYqOSpGmCwmGBRliCZZi0tjRz2vD//aInqMUCv4OxkrPW4YI2T/6TTbg0nShXofgUf p7PJcQ0HJo98850CR+XBYQIN7JbxbJ3L+zYteunHpQQRxkFuhlYPYpcHsafDf3EScvo7 xHBR0vNuh8KdmeCuzTc0w8/pkWbuAAyBiNS9lg7cTG1Dl6hCE3TwszjtiCBGcXS9mH2M KRaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WNY3d5b2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.49; Mon, 31 May 2021 19:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WNY3d5b2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232731AbhFACt2 (ORCPT + 2 others); Mon, 31 May 2021 22:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232691AbhFACt1 (ORCPT ); Mon, 31 May 2021 22:49:27 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C13DCC061574 for ; Mon, 31 May 2021 19:47:46 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id n5-20020a1c72050000b0290192e1f9a7e1so949770wmc.2 for ; Mon, 31 May 2021 19:47:46 -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=CJNEkd9odSJS4sHsW2fkqbqVW7PMvd2b9q+phGy9YsI=; b=WNY3d5b2XfAqZwc3npFOEnbJiCzmBkCHr8VspurAkD1f0X+3PN/TOYFXREcUnRZjOF 4fkKEKrDvoof6HayMy0qswsVwMk2wpTRVGpA6oAwT+NjUiHKgNg/aRbq5gvKyiHnpZdc zuKLCRuAo9It7Lu3iwL5gIE+yo93XY9ux6l4rQlHhPia89wegVNHjDuJJmpd0uuR+nZQ C/5Eg/RYYlfYD1nFl0ZxCGgsIGyIO8Q3+I4hasav2BfN5TgnVFl+Mm3jn/C2rrbs/6hJ c8CXFvBopJxQ7hwqtcKC6S2GYFy9x4EIsN86p533XH01/S/4HSTV4ptl6zBCnNeItviO /CdA== 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=CJNEkd9odSJS4sHsW2fkqbqVW7PMvd2b9q+phGy9YsI=; b=cW1CzSoglgDHgZTvmIo1TbEVciTjPkv+0EcXdD3LH8wKHZDnQc7/pvv+arw8InBseJ XHl2i9949tIXjW4ENK3diVsJRsEI0vo8EeMT6wHD8bNr3tb0zSXBlR+6byF2Z6lj2xSo mTy8JNq4L8ykbxkv9rhvPeMn5OsC/kJ/w051QDEB/3iNvt435GZK/JltdQ5tBbd52mVn hv91VWbsaLFI7kYLRtXdNHKO5UVqP1XLFE+UwYTEu8TOfzmaAqQ23Yx75QpSt1KVgUzW wDjPCGA0RC1o/fGcn9B132GymXUc+itFIeonyiSYaYTFknCKefs4FwnMJDB2S7EwovFD PcWA== X-Gm-Message-State: AOAM530YXSLQoTngw/3jWQ7h1CTNZz825B7FesvZAWANlqOYWlMVF/Ty bmc6Xk+O8tE6iFA7jddkVnwX6Q== X-Received: by 2002:a7b:c92e:: with SMTP id h14mr3960939wml.51.1622515665432; Mon, 31 May 2021 19:47:45 -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 e22sm16774014wme.48.2021.05.31.19.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:45 -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 v4 08/12] wcn36xx: Add GTK offload to WoWLAN path Date: Tue, 1 Jun 2021 03:49:16 +0100 Message-Id: <20210601024920.1424144-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- 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 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 ec32b8b0067d..db1528a14757 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1119,6 +1119,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); @@ -1139,6 +1142,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { 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 Tue Jun 1 02:49: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: 451351 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331425jao; Mon, 31 May 2021 19:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxymkSVVA3eEauXp3KTmlFcp4RHqfaylUK/eLrYyByCH79mfNgbRYj8LSZJ7p/QrTEyqLor X-Received: by 2002:a92:bf10:: with SMTP id z16mr21417805ilh.304.1622515669985; Mon, 31 May 2021 19:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515669; cv=none; d=google.com; s=arc-20160816; b=ezNuEh0AEeoqWyJzFm+smY5d3hSHsjxgic+/AuYSf8NMc0TCmMX/+KLnaEmFeuRuob n3FibEXp2ApGWpZZ4h4qeniJ3f5UIGj1mZbOki2oMYmoej5g0A2/ZrohOs3B9HMsA7hH cT+TDLC4ikFmTYcAM/KyKg7AUbHpBIqwSyqLa8uUTaeDBvK01zY+kreZdOzcxbISbxjV G9R/V9CC8df5be95upc58FD5kRbZLU+fYJyvR0yOp+EghSsidchsBle7Lb0G0zIEYFTZ /xDL5CasUxhNvoQbfgwUbDosA68QwFIid2OMxS6dqTpot1fUT2F6RN3axBfg6caKjnVf JTbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SzCu0Os7QusVy/mnoUQrDSZnGR8B3iHYzezmZSLH1gs=; b=wP31mXm5CWqR4q0M9OW/iwTYJEb2/8nuHxz8cJTKzP2lxUevw1a24J2HdGjUzL6+g2 GDds6ENbJfi58JF6Sims5B6kB2XYWEcXjcW1nm5FHQgE+XQCWvnmXNLHyMpB9FSRqUbm ArKy3bTu31KrD9zshiM6UAtBfPwcr+QS+CJUPelACgpMtPXlWm91ExQgVHk0xZK3Pq2s mBXd33UK2rsI1pFrjXsvhK8T9MjjUSje5IN2UWqAVw4DH1LW7pj9AxoiUNfnvje86YuE qOPDykeWS4ExwDNr8UDjLkH8/zH1aFMDu5zAeTrGHd+tsGO5kDyk82MOCMMLQ1COvKSH T7sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PlzwALJj; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.49; Mon, 31 May 2021 19:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PlzwALJj; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232741AbhFACt3 (ORCPT + 2 others); Mon, 31 May 2021 22:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232726AbhFACt2 (ORCPT ); Mon, 31 May 2021 22:49:28 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B182AC061574 for ; Mon, 31 May 2021 19:47:47 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso542760wmh.4 for ; Mon, 31 May 2021 19:47:47 -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=SzCu0Os7QusVy/mnoUQrDSZnGR8B3iHYzezmZSLH1gs=; b=PlzwALJjIHlluBvG2dDSGygs7LmpdYu7BlvDDUHP/calXA4fQGs72CrewHwwbuCuPW 5L1+m8H+BdaqqpYx+OM/gHhn0Jfso8WmwpcCE+pJmNuqG2aT4/e16hbG31UAYsK7IH/l +mkP0xRBiLiU5hL7WoKPY1UQAAJscGv5ycxCgqttwVCWl+ErnoZR0DtBStXr9hFrwmBy 4k5wj+GYdgu8XJyX7tgB6EoBeqiYvzhc0pa3Ufl25FGN7CuNKB63+kISLWTnZwWVFFhP Sg5mgfboytDttJcVdDhIptktGxcMQlTbWwHsl4EOs+wj/AgFsXRK9pq5Z5MeItv4dqOC Rh3A== 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=SzCu0Os7QusVy/mnoUQrDSZnGR8B3iHYzezmZSLH1gs=; b=GSRvq332sTLP35PCyqbc4rgPOg10uvDRuNzAgqPxrUeKlh2xH3mfRhQK+AZ2VHZoWz E31HPE02vamFr8eUlrVDwRPlADaSDtL8ePgF4VoUnH8cv1AD/or+5rsoaVMljHdcoZI8 b1O+fm3SSGgAIKP8a6u8It3km7esYuxjXivIAvuJ8NCbCsiWMuj2ORIkg4wzSNPPFTSC maqrzRSQNBmF9muC7hpUxcx2rLZU9dVf7wUc8F859Xjs34DHiOjCSS3imVp/jPQSKoEL txIKk7lScOmX4Ihr0mBRSTG2bUoS0/1LKIIGPjo/VrS2OR9v7Ei955YEyEIdByzqLxi2 PqJA== X-Gm-Message-State: AOAM5332g+vpSPraDV8FSXL0VmQr1Grl+dK4KFDF8YGa1pbB2xyTHCEx SBnumNEP5dXJQJdG5yIOVQgxyA== X-Received: by 2002:a05:600c:4fd6:: with SMTP id o22mr23680953wmq.83.1622515666386; Mon, 31 May 2021 19:47:46 -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 e22sm16774014wme.48.2021.05.31.19.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:45 -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 v4 09/12] wcn36xx: Add GTK offload info to WoWLAN resume Date: Tue, 1 Jun 2021 03:49:17 +0100 Message-Id: <20210601024920.1424144-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- 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 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 db1528a14757..8e5d8326d551 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1142,6 +1142,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { 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 Tue Jun 1 02:49: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: 451352 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331434jao; Mon, 31 May 2021 19:47:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxthfb0NgGG0jleccEiGV0NWfa7zHwkEUh0GVubmDwE0c8nUXfRfV1OqQRLek04WXeGT1gI X-Received: by 2002:a05:6638:76d:: with SMTP id y13mr22627989jad.25.1622515671212; Mon, 31 May 2021 19:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515671; cv=none; d=google.com; s=arc-20160816; b=XUYyUb7sq/241bgFZHEGevI0P2gIxDlhyXX/z0e3PFYVU9YNLZhskByZQ+iyJAvrfT ZNdkJrl88CpmtxtRCBnYjM+T/r9pWOSS4kSc2fcsnunliJdRsakGpirOGeVLB4TTHZGG q7ZA4dK5/KruRJOEJmavBr09pMwDDvkfxQINgyDqy/L+c23rVfQjoWz4lqVQxjoypRhu X2q4+rzMUDOYO1e+8XpKOXyhDQvg0Woca1b4p3zOmoPFXghDZLX5V/YV9gvTT+9U+spn GBMlxC9cu9IF+tmMHyUMMbbakS4IZu3oemTtUaYl8YEblNw2qBtKXmWArAWx5T7M4OV+ kJww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=m7tgQqGtDFs1RDJ68kf8vBszyeLOJelji2axp1aENbQ=; b=d7Lli0hycNh8/H7eBAZ9C0A+XdZMDvxuZKqLK9lZ/g12kAqTCcZpXDnCLECEWI6lNP wsDvSLY0aq0neXCmU6O1z6THYVeqt0RIaWw5XabD3osCV+4a71TVfvd6rCkfyKkmTpLv SvUfu+KA5YMb0VEHPmFmaoOP0hkzplHnTsXhiDaeNGG+TYdCrqIIdmfIllTxAIIekP6b wHlzDFY+fTpjyZ05VYAQX3DyX/qhwBdQ3iRcoRqQlnEYx56RuZ2NfkBNrm4K1M/x/ZA8 q/0MIcSXsOvEGngz6oW9kH8RXv5AFYByXSJ3R1uu3DUlVOO77pVcIDSrhlOop/8RqTE3 aTlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AVGYpXFb; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.51; Mon, 31 May 2021 19:47:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AVGYpXFb; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232769AbhFACta (ORCPT + 2 others); Mon, 31 May 2021 22:49:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232707AbhFACt3 (ORCPT ); Mon, 31 May 2021 22:49:29 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D903C06174A for ; Mon, 31 May 2021 19:47:48 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id f20-20020a05600c4e94b0290181f6edda88so553156wmq.2 for ; Mon, 31 May 2021 19:47:48 -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=m7tgQqGtDFs1RDJ68kf8vBszyeLOJelji2axp1aENbQ=; b=AVGYpXFbDaAJdRho/4pg7qfMPZvEQIPAHvwvnEi9TenBRbEeqp6VWR5NndblkL4gKa nfnh8/BW0w849hdul8AvTOrp+M/PUszANqWRfdCumGrDcvzkwb1EbpkEOmB5GE5iyTC0 +Z+Q0+Le2/9x/35xQWKWH492L95mUhKWJcQ33BJr4842zbpoXK/2RmMtH3tKdZpQVmx5 sM7bbdTH3vvw3F96nJ16YEkN/WQ3yBLPq77OtmK6Mj6xX2WszBmvZLYohqTtHGDl9hig ZpRQM8hWCE7u77SNgWl4Ettg4IOAYyCXFjzZzT8TmPjZFhQuS6HUEZX/byEOCM/wVeDQ dljg== 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=m7tgQqGtDFs1RDJ68kf8vBszyeLOJelji2axp1aENbQ=; b=TlJapx/F4DwQOjXU8qiLEyCUYer0FcSc2rdUKrLIi7X65Wmy76WuttiKJPBe1A+O9v gDBML6IBoLLsr4K0tHUls3nrATswaWEuL1RS0LDSYlW1CsrAT3L1DETqzYzs+TMwW2aq LvcK/opwxVCxBVIrxal7NePT1yUJzgrVg8+odVlYJsAJpRUpz1hCRBisggd2YO/R7MQR lzIr5E7aeQ3TOG+jOA2QTF+iMS6B11xv9tGdquqbmbhSjghkZjXyU7ujoqyLaRRpBmnw jHAbytqU/JNUMRWw4/Yubu6ZBQ77KrbpsVwCUawhHd1OGUHrO68q4XCmGnKEMKU7/GFw eYFw== X-Gm-Message-State: AOAM530Au4VHJGF6hCOxn6OL0QQzS0FQymrBRhJveXY/pSW5PuJYeglu 11a9wPSyITqrKWRDRJh74hnjKA== X-Received: by 2002:a05:600c:4f15:: with SMTP id l21mr23688001wmq.37.1622515667331; Mon, 31 May 2021 19:47:47 -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 e22sm16774014wme.48.2021.05.31.19.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:46 -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 v4 10/12] wcn36xx: Add Host suspend indication support Date: Tue, 1 Jun 2021 03:49:18 +0100 Message-Id: <20210601024920.1424144-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- 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 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 8e5d8326d551..e4d5e4d597f9 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1125,6 +1125,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 Tue Jun 1 02:49: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: 451354 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1332141jao; Mon, 31 May 2021 19:49:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwks8N2oxDia6IK67P7peRBVxytIGVbvI16wHKVFlU5j+HNkjAqzo/gcSS6wjxIUvuo1HzQ X-Received: by 2002:a05:6638:1482:: with SMTP id j2mr23235069jak.63.1622515673439; Mon, 31 May 2021 19:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515673; cv=none; d=google.com; s=arc-20160816; b=wu89leyQhPvE5VOspw0FZTUL7d4AOSK06zjqQkYWWVX8UDxR2sSPs+tHFLKbMzTJbr AgGbgOGZznTqA8KEsqRZnaw8GjN53kTpkV8SDwfTtub6o8L0fSDnePnKXyLheM9EyGcf duDXBfGj2jjyPvyR3U2pBthlvYAASC5yMw65dvhZQ1lNEnX/EsDxyGe/PYOuQmFL6Fk8 KYp1RckmN+9t3q86HeYJXDeuhcYqTW5GS6uj9wQvQ6y9AXsTIRTFy9thqbr+x/iIdMVJ /vqTnABQfOidbA47jl4zKSEQoBJdRWJ2QBlmKucfDLfqAXAjQFua8snUaBKoUAo8Dz21 uqog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=A4tsdVSzTEyTW8xfDSUd84WZI63N7G22QirTh+/x9MM=; b=fSNLR26UG2AaJL977evSKoYPgsLEhsoS706Psw4nZC86ITn77+Uhho4zub4J4whA37 FJScjSEKhfAY/cKWbNbHFlp4E0aq3oqD9J3QrILinVGSiYHehJ1AnutEYuo5CMAEWcEj PbRak3wWTKhcnc4uRTno8RdB+Rsfs5pcub3Tqk5JvFT4mkQ/oC+c3W8FhJOtJKd6fFDo qhnKCUzh8UU3umFRo8wCmTDMiPgzmDenc1wjnlwIE4ipNxjNuNJnQKehilIR1DsBNIT8 0n6JohZxKSGtH9IVxFZhOuic1Rz8M3Zz0+R2JiutBciBl7TDsdHPHkdUXUwjuOKSmkdr aYMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NaxWwqJ4; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.53; Mon, 31 May 2021 19:47:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NaxWwqJ4; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232573AbhFACtc (ORCPT + 2 others); Mon, 31 May 2021 22:49:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232772AbhFACtb (ORCPT ); Mon, 31 May 2021 22:49:31 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F7CAC061574 for ; Mon, 31 May 2021 19:47:49 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id g204so3946768wmf.5 for ; Mon, 31 May 2021 19:47:49 -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=A4tsdVSzTEyTW8xfDSUd84WZI63N7G22QirTh+/x9MM=; b=NaxWwqJ4kuAqQ6YBlZSP/XPMSGMrQNRtKWlcZPWmh88K164CJkr4NkRXJTFDTgxWDZ fUkvRfP4BGU92DNnpZ+TBMDljZnV45prUoiLgz6u62BQ2WcLC0szDk7DP8NdllczN3UU icqEkdVqRx+9BXvXkSSh+5UZSf9O0SFNXPobIBmTtklc0X5AmZF9HzU5Eq2pgPYB8rFu SdAgAiCVvgWQ+1tTFNN2KComT6zEGz/3Xal9dOzLjYs58VvafJF1tRD2h1HJ60pPp4Ck R4wES8IsnCEdFRojN5M0elXlZT0QCaCuq8nziH0R8hHRLBfX4IXMvLKxMTGu8rOoqXFb 3iMA== 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=A4tsdVSzTEyTW8xfDSUd84WZI63N7G22QirTh+/x9MM=; b=HY2bUky7ddZK9L6S4TDcnSOa8LdDPRETxOwJ07jM2ZYE1w772Onm5fFn54JNwGgBxU nNsUH7Hv5DPMj9C66EBB0DTKnSdWNyjAVeWPQtkRkSO8AmWRedyn4g5Xccgpp/3w90Nv U3sLHhUGb8fg0gZd83alB1SMDN+o0p2AvwvYW6wnzicAlf7R+iZZboY4LZFeCr4hTqHZ mnBiSJTnH1+RSLyVYjJjTYO1Ep6iG5QdzL8xpNet0SjRwRUjsw6DvTgwDgr+F278iLiL 9+LFLZ/lruPhZJnEVHXwdXX3Cg8o8Njf8hWANeRVGqucbl0J+cGaBq8mK1g9c39wgMXT dKfQ== X-Gm-Message-State: AOAM531txa9KM/dR7hD3iB2xSoELayWkV3EdvkH8iypA/ZQhxnQEfFHe AD32Os4OXueaw8pj2T44UWu/8Q== X-Received: by 2002:a1c:4d13:: with SMTP id o19mr1839389wmh.100.1622515668263; Mon, 31 May 2021 19:47:48 -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 e22sm16774014wme.48.2021.05.31.19.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:47 -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 v4 11/12] wcn36xx: Add host resume request support Date: Tue, 1 Jun 2021 03:49:19 +0100 Message-Id: <20210601024920.1424144-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- 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 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index e4d5e4d597f9..c697b9f3633a 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1144,6 +1144,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { + 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 Tue Jun 1 02:49: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: 451353 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1331459jao; Mon, 31 May 2021 19:47:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7b/2oYjr9bC+TzU/FP28owp0dCg+1Q+0S9LqwZWfWABas/+hsZTcV5LNo+k0Lnt4aYBjp X-Received: by 2002:a02:354c:: with SMTP id y12mr23083754jae.144.1622515674058; Mon, 31 May 2021 19:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622515674; cv=none; d=google.com; s=arc-20160816; b=P+tRjY+ZWxOw4OOSWUSY8lTjFFYwrgD3eARkI4pDosGScyrtP5fXbjGFjaqzd617bp n3XyF95OsmR7G7co9chjZ2bk7Hc/w9HDUUXvM7JBunLbYkWxI+4T7TaOnVFlbv2LUGHj ErqqsWVunrzP90RhvPhoWFxl2xbtXHPNXZDTELeVYQ5cxBlLl2ZsCdI4G3FQ7gEFMgfu hOyhBaPxohEFShZjmmrq+207tBpa1nH9WZ5834aM2zPtTmKdOQyKzsvUpnfBGCPMdSMP GKVK7mC0OkExMpiVLxi4WqCHkxPBOzIx6oAhxBKKl0kPSY2BbowHhSPNdxc2v+qVhSOt JBaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oAnhL/rLVHOlPObR2Xdk1DvWetZIgbSOpJEsqp74oTI=; b=kW6TXunjvG6KRunRf57G58Nk1ZvWjgiYEN7VA7ZgwO9RtUPDbwPe7xSnI/FhpGiVxW nuD4bKRGPQxoc7AwzrqQlssnmhPnjSUBtWf2e9umXx8n5MwOHEy22LK6EpE7nqQ4ybmk bS8H+yJU4F3f6CnYO3gha3dwpCL/rzP8wmJAjWzXNrMQUvsLqzrIf4d4XyMElr4uz+iM pCK/SKs8D+KT/AeN8InTUJceylrWUHOFgkLFEDSMvQrrCKQU1Kw7+W7G9Brt6WI4hRw/ YAKSNLC/l1PNaBYuMyBDYHuwajBqR4LoKLo92UFfy6e7F58T7CaqvQk1ir8hIIibXUMS DKOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OA4gCqTb; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si15617795jam.34.2021.05.31.19.47.53; Mon, 31 May 2021 19:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OA4gCqTb; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232597AbhFACtd (ORCPT + 2 others); Mon, 31 May 2021 22:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232635AbhFACtb (ORCPT ); Mon, 31 May 2021 22:49:31 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7E53C06174A for ; Mon, 31 May 2021 19:47:50 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id c3so12565100wrp.8 for ; Mon, 31 May 2021 19:47:50 -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=oAnhL/rLVHOlPObR2Xdk1DvWetZIgbSOpJEsqp74oTI=; b=OA4gCqTbsLsEhcNO2pZR8L33MzGKjL2SwFaNq0vX/cqVDr+/OBPjmYEctfBgnZ+OA8 DZYJOLlF0Do8ORsMYvT9sVktR+SsV328n1nZeajNtvF1+vluI0BHz7qm6W9Cygw96Fmu vZffYz7a4Qta79uwB82EihYFs58ARqmsnM05vlQ1d2PbYhFAXF6IJlBtuOptUln1ftvG jKmfjgHSJl0pAoQn5f/gukCgb49CgiNpDcifKDIHsGheCLcaTvuddOGoycxED49pIoa7 TYbLdgY/q3E38Hw+560ZZYqm3UBzLkZPXj4KhA1msA/tJuMXV0epiXH1OQ3XRnYjtogP KlOA== 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=oAnhL/rLVHOlPObR2Xdk1DvWetZIgbSOpJEsqp74oTI=; b=SHMcc9xc9H6lEYmd9YJgjh86LOeitBkwCBvrD4Umc+rTq05mivDYpPL1iaNgLYtr/7 grXZRdopbAfjqu4J6Jk/ZU4dWNfJNCUMJ+dNbhzfDctDTk0Vj4wuX/rla6Ipcp9iSoqu cNPzX/xNGVZ522rbeY5IgFLd9VUZ0FxYNqYoMzF7gpYGWh2OqFMXeBaiK/NWN2UkBJk6 uP2FpqPfqfxEQnce+ij3LGhGmrTJdh0yMkdRx02YQLEBk/0Gey87gaPUTX00pjbqWK7T q4Fex6tbtk++sOSzbUXJ2a4gR4NN3odsOHoxCavVeHnT4vBFe9MJdUN+lTzDA/VxR7Ud LLqg== X-Gm-Message-State: AOAM531ddzMzxSYKI7qMsFIxJdYbnqr5/ogU7PfLfzn2NMf3O5WFQpDv yeNCphFRQTQEWvOM9XmI0346mA== X-Received: by 2002:adf:f805:: with SMTP id s5mr6707222wrp.231.1622515669309; Mon, 31 May 2021 19:47:49 -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 e22sm16774014wme.48.2021.05.31.19.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 19:47:48 -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 v4 12/12] wcn36xx: Enable WOWLAN flags Date: Tue, 1 Jun 2021 03:49:20 +0100 Message-Id: <20210601024920.1424144-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> References: <20210601024920.1424144-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index c697b9f3633a..3a4e383b3a6c 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