From patchwork Mon Dec 28 16:28:39 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: 352765 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp10027937ejs; Mon, 28 Dec 2020 08:27:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9fDw/yJ/wLPA5r09aKbVWjPA++ey+c3dudjDdhNRklMD3n1O1PTaTDvNFuleVc2KDSkpq X-Received: by 2002:a92:ac08:: with SMTP id r8mr43058130ilh.166.1609172874081; Mon, 28 Dec 2020 08:27:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172874; cv=none; d=google.com; s=arc-20160816; b=g5s4I5OKIsXvWuKPWYa9ld/hWlh7KZ2ikiBaDZrCNzKUZBoCv+gVwjozcDE34HVtKC a4w+9hJuJuOCkACk/w4RVLCXo3CUSTS+jxxWeknSfDOZeBb+OuZUHJXvuw8XwGfutO4o swLxrSqP8xxPnrsaBz8f+22WS7+M2IYKsjgdQk5TE5vMBCpT+IQa9ldOyjb6GWQjqPiD F0PKXngHfQOBAYZb2V4jLGj13FmONVKs4BYZI8NRyWM0Rs2dzLg2Ol2ar5MftM8fjROy rJgJJ/DuvlbbM3t6Be8fFajOmTxgGfYTDrGMibdAb0boiP+c5WOsUanCgJsYwSquAstm /qSw== 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=WY+VLn1NTzhFvova0YzWJV7jFJtMsWguRj5MyOcKXAU=; b=QODwe2rhanibvrp5s1qz9mcr5f65A6VkcaiDL0jaj9jDC3/MVXtU2jZQBBiCPqx1sn IuKYWzE/Qg9yLoMW64j1AAvuGj64W4lL+jKewh9t0gDdIz9YOx2TTrCl7w/2jJ9Y+bth F+TndkvIP1ARvkTLMo01ksxodbf1cyphfY7lSD5vVl6VSbwOblp3LBlfhnItkDlGIM4V 5+YfA7ho8riVmAgV1Jzy1uPKR8GcYGSvchKCyqHI3b5MUuvBV9O+wC0UnGbE4sEMdL4y IoAva1JtTYSaqtM7ZRUp7fVUOOkoNXNWlLr2/csbVciwmG/eCfJItygpL+dAOgidhNPm 7TqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=AO23uI8Q; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VFpSv9qQ; 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 w82si25496290ili.80.2020.12.28.08.27.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:54 -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=AO23uI8Q; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VFpSv9qQ; 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=WY+VLn1NTzhFvova0YzWJV7jFJtMsWguRj5MyOcKXAU=; b=AO23uI8QSaKtviSX6V8fgDv+t 82bg8EsuZ4pOcVDqy+hpmFM6rmzauYbySEg9rgyTrH+PMYpQh1txhcc9rAIFCNAAEOZbWa9k+fQVV +u/2zls6pXMolDBP55p8k9BHMzGt0hO9J0//ujVYlJl+wKcb58Srb3jvQBMc0ur8PE8BmUfT8wGAX 6tHI13dQDpaQzJqorbUe0srxedhuN1WdBTBvMDBJcfc/PkljDNw8ypU6At9WFZxl5lGzR3l4zJYqv eTaVhR3Zx7MITWdJv27e4c/hKvajhyP5KIJ7NWr52uErK00h6DihHusC0Bnp627Z5L2od7gVOsLdh Md/YJsZWQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvN6-0004es-EM; Mon, 28 Dec 2020 16:27:48 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvN3-0004ca-P2 for wcn36xx@lists.infradead.org; Mon, 28 Dec 2020 16:27:46 +0000 Received: by mail-wr1-x42d.google.com with SMTP id i9so11768921wrc.4 for ; Mon, 28 Dec 2020 08:27:45 -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=VFlxfdScJISQHEQPsvwi72V6FodBvi35qoUUckJzFhM=; b=VFpSv9qQLSaccEYxNBJkiNrTDCkfCsp9QuL+zJp0/MY99xqzkBMsvIiyPEX1rx8hC2 jwYgblnt27v0Uz8yJblLwtM8z5QBumNrCBS+K9009X1wJjfqVwVyWQAU789vTbcR6rk2 prU+AzGwMIhXHx3ifpjTFR6zchlHJTAKQcKeGZXzOHAxeVjUa5MIPDJe6FOwNSp4N4du 7FUX6hdhIShN4jZkpMkVlF1u+IfiTgJ6QmnpBUOb+F3pUGMMPv7fRxcWONRBBl2ko7nA LwXrFOv0Qi4clbW3T1r8YlTBGCJCH1T6BJznt4xgLadEC06XFxwP6FzxVF6chhY2SKxK 5yRA== 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=VFlxfdScJISQHEQPsvwi72V6FodBvi35qoUUckJzFhM=; b=TiuDNTWxP/6QAczL/Xeo3C5kqOLGcGUbTbHsSIP8oiDIYU+5ylQS3AQ/0LZGal1sJr C3F/u8xazKo5rfJixKYzPa2zyfH4au0MJG2VILokjM4mfLf53T/kmvToZkUJrteFAgRs 1G5I0WIfv1abtdrYd8w+ttlm/WxUm6/Ley1GuOU974UTzm/eYwZ0AFy+LvsHCsy8ZQAj OVxsSu9QSKzv3MY0FbeVIAsSMk4iivE6uWYWTUWwvzJ5ElUnYBEGAvEmZj3siZI8vgWU Big+GHTzPQJXrIIj7R9B+IegP07gbZYlvVMj3Tr9gPksbfFf21QIo2kLRJI4PbLVJrSu PCMg== X-Gm-Message-State: AOAM531EcXwAAL93gmX9/cEzeE7K1O1Q2R7sOtHzdrDlN/VfX43p/202 6g7Zi+VlTRByV4J7wdYno8j72Q== X-Received: by 2002:adf:8184:: with SMTP id 4mr53093783wra.63.1609172864755; Mon, 28 Dec 2020 08:27:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:44 -0800 (PST) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH 13/13] wcn36xx: Add host resume request support Date: Mon, 28 Dec 2020 16:28:39 +0000 Message-Id: <20201228162839.369156-14-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_855672_41C5DC98 X-CRM114-Status: GOOD ( 14.94 ) 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:42d 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 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.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 ec24b0cc5b8c..9a2a6399c8a0 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1158,6 +1158,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 5450d56d8e1c..83452d7f4634 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2989,6 +2989,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) { @@ -3040,6 +3074,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 77efcfa145ec..6dfed8f386d9 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -163,4 +163,6 @@ bool wcn36xx_smd_is_scanning(struct wcn36xx *wcn); int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn); +int wcn36xx_smd_host_resume(struct wcn36xx *wcn); + #endif /* _SMD_H_ */