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_ */