From patchwork Mon Dec 28 16:28:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 352763 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp10027910ejs; Mon, 28 Dec 2020 08:27:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/QK3uU32r/SOSQ7QRQDnDKFuDvkbQ7hIfPHwrNuoQk4P8opj4MPYy+rUjNDfIU8bzO4vh X-Received: by 2002:a92:da82:: with SMTP id u2mr44431776iln.137.1609172871800; Mon, 28 Dec 2020 08:27:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172871; cv=none; d=google.com; s=arc-20160816; b=KHMoAi+r+JbACETLHnyCwIaF7n15S4N7b1ox0nAh/CmFTfgk5FHhWq3g2boB7ejaap IeBn1thb1vUzOg2Vj6mdxjFlX8AqoAWeFrbfr8weozcIIFYDD1P04WpA/kgD12MJXhEb RO4dhX+ss7kKaNaHPPQCxXjRFJWmPkS/6wLRkGXnH0peDi+E7VA5yEGMuRP8HITe+Bpi KfY5rEGnWmGx3F1byjE6/YD1yzdfBF9Z7pukfnJPQVeVW9cZC8jAgVCnnOgCYj4N3p/T 3NRS9qQDGXAvrd6eCB2uLYJFXjZaFzGQayGYNhfuizRsfNBuAdKLOzYiHvuWkdb7EpkE gU/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=tUXECrSONwpDyiV/0P1CqFLsChonBx3/0WMVRhjPjJk=; b=PTcszOX178Wldx6/yFhIidyo6Js21DW/I8tYLOdOuNECilv4cR/+3H4WsxZMnfTxlW 0gx5/XwN0/U3PU3WJAfD97xaTDM9i1bQFLy9BIjjv2F9y8LRjEEvoUqV4emPk3378CkP s2lH44JwUjNGMh17G1B4o1XKHsxVCAx9VD9Rdw4+NbwJ/U+6fI2lYC4C2Xpmnxr4bO6U 3o/trOXfdM+nSOl8CogjWXyfE/4AZBQWPj4TrlLAfs40b4dW/fm411xt4bnqCQ8WlN7K +JaYEeYYHTEtsLB/vHzfKkJnUxZFKVgdIKKWMqi8hZfCpWN1OkoFjxsWnp+RF0kZsh94 QY9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=yBAG6KGH; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Pj7YzXBB; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 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 merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id w9si26443676ilm.94.2020.12.28.08.27.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=yBAG6KGH; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Pj7YzXBB; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tUXECrSONwpDyiV/0P1CqFLsChonBx3/0WMVRhjPjJk=; b=yBAG6KGHYRPPJeFjhPmx0beLd dfDnyYl/eyPbP+eL4aKKnLjsm/TuPQBvNUj2NEBl7DBmIPCt90hnJZ30P79JUR6YnqZXPWKtNSPFw 5DnNqkKxIfl8NGugoCN42YzARUftP9mOcVDsCUdOblvIvrzIpGiTzi78Nv1JtNRJ+0gXoGd1Ju4YY YiQN+P8cN0+nkMZyE5RK7VzdF1gC093xvav0VIH+C6e4RgSyeFKhqORcsyQQXuaAsXJQWXixT/BRK KRH+vNl60ghGH0SJ+80KjpteGkyS0HCOGF3dBWVx+/N+uHVU4Sn35i7AYMkYTwexCvmqKPgGSgF71 OPVui3tGQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvN5-0004ee-T0; Mon, 28 Dec 2020 16:27:47 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvN3-0004cB-1i for wcn36xx@lists.infradead.org; Mon, 28 Dec 2020 16:27:45 +0000 Received: by mail-wm1-x336.google.com with SMTP id c133so10723087wme.4 for ; Mon, 28 Dec 2020 08:27:44 -0800 (PST) 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=2/sf0TvCOSTx5tivsY1tuBdXidg386Du0OJP+4zFzuI=; b=Pj7YzXBBXro5Okt10fjB6pr1awWUU5epPF2T+flMBEuKCBKkDyiw2D46UhDr0UCC14 JKSkJVjCfcpJkkgr9Z+q1o4Oimy+OAk+OA7i1gyRkFgJPVj5vczFKrz6GgdCR8zAEPj1 DToBAE8FSA5yhdibErba20LK17cloNGREz+iDge38L9w6JIbt0AAuBqAVybD9fW2oqTO HHsKQOhn6Uo1zhaEnGZXrrBMfl6cZfHPql61r/aLY8Wsi60Z4/cePcR4ju/H7/J8DeoC azR4Z0hdiRta45ydB8TcOxmWlxtlfOEQHaJHJbplBgzgOsuIgVdWyvgZvdFEEvIFVU0L yShQ== 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=2/sf0TvCOSTx5tivsY1tuBdXidg386Du0OJP+4zFzuI=; b=OA8WZDZJJp9CLnwZ91qBjs8KRADn2Dw8CDGahLWwnNmyz0zaX+2RvtViGgkF1ThzqS AjpskiNIM+TvPRYoqmVcT5tbbaAAIXSQnVM4IWrq/zWS8XNBTydbMBQOmLeVvMeauMK/ aeEh8knLFmVXNAIr8OrHZPCTlS2UVXscY5vGrMxSeEslDiF2opCCBYdZfh8EC5HkBaYV ZPUDkPDYd3wCuhiqpnYR+5ZVb82hmz8Gz295sPrG0AlwSk78o9pPst3HPefBO4mf2V03 zyzZqQV4m7ujUxFRVROROMlviP+UYJT6LwJybArU08FndkoZpxs2cVXTfy1bAiZvLJFR 5ZEw== X-Gm-Message-State: AOAM530OozSYIb/4PRA8TOeZ5wOj1ISbbcXshk0NP3at/1NFewsguxJX AYhy5lIHFM49wttAX+eDn8LjEQ== X-Received: by 2002:a7b:cd90:: with SMTP id y16mr21524744wmj.115.1609172863690; Mon, 28 Dec 2020 08:27:43 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id w21sm19523379wmi.45.2020.12.28.08.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:43 -0800 (PST) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH 12/13] wcn36xx: Add Host suspend indication support Date: Mon, 28 Dec 2020 16:28:38 +0000 Message-Id: <20201228162839.369156-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228162839.369156-1-bryan.odonoghue@linaro.org> References: <20201228162839.369156-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-20201228_112745_145189_29D67D86 X-CRM114-Status: GOOD ( 13.58 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:336 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org, benl@squareup.com Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org In order to activate ipv4 ARP offload, ipv6 NS offload and firmware GTK offload we need to send a unidirectional indication from host to wcn indicating a transition to suspend. Once done, firmware will respond to ARP broadcasts, ipv6 NS lookups and perform GTK rekeys without waking the host. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 3 +++ drivers/net/wireless/ath/wcn36xx/smd.c | 19 +++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 2 ++ 3 files changed, 24 insertions(+) -- 2.29.2 _______________________________________________ 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 feb909192c8e..ec24b0cc5b8c 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1134,6 +1134,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 378282a93aa0..5450d56d8e1c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2970,6 +2970,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 3488abb201d0..77efcfa145ec 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, bool wcn36xx_smd_is_scanning(struct wcn36xx *wcn); +int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn); + #endif /* _SMD_H_ */