From patchwork Tue Jun 1 15:09:59 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: 451392 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870808jao; Tue, 1 Jun 2021 08:08:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI8NwMMoojn6mrlcuvEQQJhBpwpKYNKTgorTFoIFDM/F+6vT2WNzBRXgfYqTUY3QYZBtwo X-Received: by 2002:a17:902:bd01:b029:fd:924f:b10d with SMTP id p1-20020a170902bd01b02900fd924fb10dmr26080930pls.74.1622560119416; Tue, 01 Jun 2021 08:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560119; cv=none; d=google.com; s=arc-20160816; b=aBK0gfGg59JiNxPEsAB68/EdK7KQG+wFhmMaft7kCR3hdjUJR17FDpUxTm6uDpj3Uf T3zUC8VkOSyMQPN/OKeX678rSMUOAHRQfvZ2ug0woYLW0wl2q4eeEsApx3YgUe/3+RpU bUqRr9xCJeHFKtyAZQ/i3xhZZucjnSLTmJtUSMJzCaB970BDVQlhd/Bxp96GsOZIH7+B sKSxJxDfxZyuMMBG8lGpqWtOZA4TuShQa8yrASHL8kkt2ly2+kZCPnXUlT2kKhXcm9Eo knMyW30J0e9ew72pBlOAyBlCTcFcEztWTuMjGvdzLklfNNGCADU8KJ1q9nsF/YDs23YZ APDg== 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=PKJVVvSezOZV8d7YhR4ADDlNM8zZ4cOc2F5ggHfo8ig=; b=U/wvEA+UFG4sBVG+C/+XIbeNzpsCNYo8ZUfRBgmYQi/34Q9YBC6mDgWJwAsd04EeC1 amyF17a+LkGeh9t70lsFixccsDvUexC/W7JXCt4AlQFEzdQgW3oWDqtdoXKQjDVZJBwi NnTTkr8HCgq1JxKFclb+IQHLLQkPdJo7yR2jPXqjKTjGMQXx9LFx8c0lB8xv4X3Piy1F AIDyWZSsyhdS4gAiyGLLrw/DMas6UApsBvNrSeJj3HfBt7omxaRAwXC/d7Aumre4UQc7 /OLvGokW40bUuVjxSSiFIn0JkuJ2xfoJHZZtxOXjIVG7Hbr6TWS+f6TACG7l5xwaKxBH 1fFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=kcxZ2DvH; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MpsmmDjy; 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 c5si21694641pfr.226.2021.06.01.08.08.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:39 -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=kcxZ2DvH; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MpsmmDjy; 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=PKJVVvSezOZV8d7YhR4ADDlNM8zZ4cOc2F5ggHfo8ig=; b=kcxZ2DvHL/d5E/ loZNGDt56V7ySLwXBr0zfKswQxaoTNfqncdfiGYYogRUKv3ozl2N1ffDFzzMaCu8GcLiP3lS89A4D 2luq97GBYd2a9cTT2+5ZG7RfansXxYNhhVqLCBUZyOrqjIhsTg8J/UE15cEPkoccP6lxtrIBebKWs ujlYb+/0XyQboFaaZKGVbhlPmqSjYL48xN2I31xmHWK65FGMHvsias3lEc5eUiLgpU1HUH6f6nSVC NAa0oOXVa/1cHZDg7ie6k+vqB+V8fVP7ljU4I4dK1vlfukbDsfmmDtEzc7pvWHD6+iHZoMdRbjTqJ rSJREoasNoTuFsEsUXng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60T-00H7dv-UH; Tue, 01 Jun 2021 15:08:37 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60P-00H7Yt-LG for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 15:08:35 +0000 Received: by mail-wr1-x42a.google.com with SMTP id g17so14658867wrs.13 for ; Tue, 01 Jun 2021 08:08:33 -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=MpsmmDjyujoAEL7TQVSjXsylzBeOrzk0pG8I0ioGr/FwgfXmYzFGl+j/tHWyp7s7eW eBgw8D3+rbXlBLEh1NfZUOc+k4RxiWgKcvQx1Xcdoyw8ezo1cwR1TvCIntomq1LEVLeL AnZjMc4xuC1qUxiZD2wRZEtD75AsSqrZijWnqJif3fbj1aXOeSRnhHoABGxq3p4N9Asz 8rgN6l+dHw1beIwqBl14gD/KMUGMrpe+MsJAaA75j/UwXjAmEB7ZGvdsQlGlrGMlWt9G SFFRpMqkAnzM6zdZg9FkEMP+OQZDalcgqqq+8FjKOeJ050kwPjaZ7ro/JlOl2Mo/0ol0 8bWQ== 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=uVOGOPtDdly8WeigpafqgixhQYs6u3PKcKYAjNpLWUUe2BA/F9f5VuV58GCx27iw00 FGNL+ne38KCR0Vg4r7TpCmLUOH07cpgK7lGpqWBokzH1XYYSGK3eJZO4mA81Q37pPVCT QulWMZ8FTSsItdwVAKLVH1UkVeyGReCcsTJgAaE06gw4/3ICyw2O6f0WwPIK1JzZLwYU vx92UMU2qmwRIuJ8c+mbx+vuw12Op1brZuWY7kBccftcKpm5Hhsm8s0GS6M9GrpZUkjY 5uG3Om57ls2tLslFyAM/XwynwYuHTKYTcofrbwr/CPbO+IBvwfMaiPcC16bgze5P/YHN uE2w== X-Gm-Message-State: AOAM531anfgGFr6mto1rhxAWB2z1V+eH+udGlZgUMLbR/qRHx78fhUqw KoaNRGhwm3lsYdHEqjGZ6DvBlA== X-Received: by 2002:adf:ee50:: with SMTP id w16mr1761317wro.187.1622560112316; Tue, 01 Jun 2021 08:08:32 -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 o129sm2822237wmo.22.2021.06.01.08.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:31 -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 v5 10/12] wcn36xx: Add Host suspend indication support Date: Tue, 1 Jun 2021 16:09:59 +0100 Message-Id: <20210601151001.1450540-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-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-20210601_080833_742771_7EA62125 X-CRM114-Status: GOOD ( 13.30 ) 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: In order to activate ipv4 ARP offload, ipv6 NS offload and firmware GTK offload we need to send a unidirectional indication from host to wcn indicating a transition to suspend. Once done, firmware will respond to ARP broadcasts, ipv6 NS lookups and perform GTK rekeys without waking the host. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_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 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 _______________________________________________ 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 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_ */