From patchwork Fri Mar 19 16:15:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 404818 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511256jai; Fri, 19 Mar 2021 09:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6V/XJbXlpyHNlDSjUYzjXrRI/CCEj+og/AAT6EK/ZTzSHGpcr1nx0uzmchc4O3cijmThe X-Received: by 2002:a05:600c:290a:: with SMTP id i10mr4450048wmd.91.1616170452222; Fri, 19 Mar 2021 09:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170452; cv=none; d=google.com; s=arc-20160816; b=AYjokeo8LgXBezQYxG+yJBLv8BNGyE1YnC5sAAcv4v2Sj1NDcp0GpMFZrjGCS6oNXX 5m/FeXpnF/xVNURlna74MPwI6aT2n19VMhze5qgTSomqbmkgHQ6tTAuuwEasQKxIupc/ xPnvZy1OlZrxfucz/MwQw9s74JBC0BE1ZD41tPWF08QgRVHW4CCwpgS98XtyOApiOFvf DH6nDm4G3CC32XUMED52IkZYjSS2NHMJHIcTUqsQhl3usU/djG21Q+ddv7ZHSEXmdscn 2i5g6QuKP8BloAZP32HzkURKqcJylXBS3akvNJpwA0UMgrli73Bbe3WQl0kq0qmKW0bo 4Vrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=IgyAt5Zy9UNhmGNh+v2Rq58sLmuBTRsvEeb3Qs/ypoo=; b=sFof8Id+HYcU/iJIE4ZOW/+CJxOQtbU5xWkGrmP7OPjKAR7WoSpWOciLS/nuTlfeTu dvA2pFSmNsFtJBCIF7RB1fFFIq384th2D0/iVx8/s/b9uyliGAod2blxcgryxGO6UQ8J caIwK0x2dzBCdDXZFOqoCJ+kWUr3IpFaGf7+oZ5SFQwgovXZWS2suzcnm27hgbpOVNoD kO9Yj5mC3gdS3kzyM//0HNwgOk9jUwyceP7ThRKoVeAmOCCZTaXo7cL7cLAUuZ/WkU4D kAnlUOu97UETPxAa7g5S4BUiMTgEfNBK73j0UdwGJcN0NIv2gtGHOHH7QsZVgAaeODoZ x/3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=LxUZiMKJ; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MbvTpQjD; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id l7si5908266wmg.107.2021.03.19.09.14.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=LxUZiMKJ; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MbvTpQjD; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IgyAt5Zy9UNhmGNh+v2Rq58sLmuBTRsvEeb3Qs/ypoo=; b=LxUZiMKJEjjUM5as4dTLuT6Ob hyRUdRkAZ5mskBCQFp6n2VKXKo6TL2Grq/oariWSoemgYSb5+hhPOlNgabrZsvMb8NKw/rATlZTJU WiZMGXNUrc1VA6ydHjoca6m72zE5RS/plTzMFvnw3pMsXpUkxa7K7LrkO1RH+AqnbNhQxWoKoyFDS d9bwVh5oYrzefNZJbh7lc8NCt4nAPSJyW0UNVdX04I56EJOjuiL+HIAMuwABlIiyiHOxbjwOME+Ln 2ivG41epnyDuGehyroobK2mbCtn41qlHwtAJaBWJ4llfmvb7bn2rWR5mnXBGSv6B/TdW5a/PtWSpn Fm7goCYMw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlK-007fuc-Oy; Fri, 19 Mar 2021 16:14:10 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlD-007frE-D5 for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:05 +0000 Received: by mail-wm1-x32e.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so5552980wmj.1 for ; Fri, 19 Mar 2021 09:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xhoTMgCF+XvAHv8UavGI2Q1mjtQ3p6Q77CqaQwfEbCI=; b=MbvTpQjD5IuW3Jhust42HF4Y1LXfxdhB4PJAMSzJz4+MlIRExIDqGVcllfQHG9I8gl c0iMSclQJAcHZl+bn00W/PnN2kfVOiMfGcwjpJPNbcFN/zMNYpli4MXIyud2BK1vsXn9 W6mJrnGt9qIOTVZYIaT/z6Ia9Z2X7s/bEO9O4SbsWraWP2iDxQ7oqHEU7A5UU/N9pbsa xpKBd+r4Myp6tTbY54ypv4RACdsauOVzAo+jiQzbFa8hnosqStvEaMzlQSglxxFMecW1 2cZ4gHs2OSGh2PSm4jjYpl/9ELuvdJwfjzxY56yyXh04ega5cXus5Nn+W0HiKQtEkJej dwQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xhoTMgCF+XvAHv8UavGI2Q1mjtQ3p6Q77CqaQwfEbCI=; b=ogaiXtgoYeArabVlFAx+slbpPLI0vp4yt/jOPnMxVF/Gn5r3440ZsaSgPjDzl3kEiy OnRlaK26xeinC379cTyABd2QdKbh3WSekWFAKw2v1uSbUSpbhrJ/C0jZvclEVif6Mw0X 0peyMW3OgPajKjYSUK3D0qwLl7SuB7ddmOqu74Z9H9+HWz6AOAtZ1zZ7oXnhYTLqkpI2 P25UKBKFP2gMbwy6svMZsqpbxSSdxFMB7cCEK/J6NL1+hfI7+gKheVYAu/EppjjCVX94 MCZbs4Vv6r4ExpcXaECvcnnzr/KJ89A0WM5Zt4g7VCwhn5PqW5U8Sso0NpREMP4U6lR9 gDnQ== X-Gm-Message-State: AOAM532clj52bjIjtpeD6HOQD/BsxygBXT7nHvD5FJQjagUPLeXosxr9 C8f9JzmYbxXX7oWLEWzniUVDaw== X-Received: by 2002:a1c:804e:: with SMTP id b75mr4496759wmd.113.1616170442807; Fri, 19 Mar 2021 09:14:02 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id h8sm8432495wrt.94.2021.03.19.09.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:02 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, benl@squareup.com, loic.poulain@linaro.org, bjorn.andersson@linaro.org Subject: [PATCH v3 11/12] wcn36xx: Add host resume request support Date: Fri, 19 Mar 2021 16:15:19 +0000 Message-Id: <20210319161520.3590510-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> References: <20210319161520.3590510-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_161403_589460_A2E42942 X-CRM114-Status: GOOD ( 13.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This commit is the corresponding resume() path request to the firmware when resuming. Unlike the suspend() version which is a unidirectional indication, the resume version is a standard request/respon [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32e listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org This commit is the corresponding resume() path request to the firmware when resuming. Unlike the suspend() version which is a unidirectional indication, the resume version is a standard request/response. Once the resume() request completes ipv4 ARP, ipv6 NS and GTK rekey offload stop working and can subsequently be rolled back. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 1 + drivers/net/wireless/ath/wcn36xx/smd.c | 35 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 2 ++ 3 files changed, 38 insertions(+) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 535e0d4245c3..ddfc60e02389 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1151,6 +1151,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) if (!vif_priv->sta_assoc) goto out; + wcn36xx_smd_host_resume(wcn); wcn36xx_smd_set_power_params(wcn, false); wcn36xx_smd_gtk_offload_get_info(wcn, vif); wcn36xx_smd_gtk_offload(wcn, vif, false); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 302877d23ecf..de0f630a82be 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2983,6 +2983,40 @@ int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn) return ret; } +int wcn36xx_smd_host_resume(struct wcn36xx *wcn) +{ + struct wcn36xx_hal_wlan_host_resume_req_msg msg_body; + struct wcn36xx_hal_host_resume_rsp_msg *rsp; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_RESUME_REQ); + msg_body.configured_mcst_bcst_filter_setting = 0; + + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); + if (ret) { + wcn36xx_err("Sending wlan_host_resume failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("wlan_host_resume err=%d\n", ret); + goto out; + } + + rsp = (struct wcn36xx_hal_host_resume_rsp_msg *)wcn->hal_buf; + if (rsp->status) + wcn36xx_warn("wlan_host_resume status=%d\n", rsp->status); + +out: + mutex_unlock(&wcn->hal_mutex); + + return ret; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -3034,6 +3068,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_HOST_OFFLOAD_RSP: case WCN36XX_HAL_GTK_OFFLOAD_RSP: case WCN36XX_HAL_GTK_OFFLOAD_GETINFO_RSP: + case WCN36XX_HAL_HOST_RESUME_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 2909facdb100..d8bded03945d 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -161,4 +161,6 @@ int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn); +int wcn36xx_smd_host_resume(struct wcn36xx *wcn); + #endif /* _SMD_H_ */