From patchwork Tue Jun 1 15:10:00 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: 451395 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870862jao; Tue, 1 Jun 2021 08:08:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDQaYdAledcz3yTioAIQAtlBi4JLjLviSbIMLsbbUpYRPDGCfI94BSaWPvDLTTSuNCD8ZC X-Received: by 2002:a17:90b:188f:: with SMTP id mn15mr25149366pjb.219.1622560121871; Tue, 01 Jun 2021 08:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560121; cv=none; d=google.com; s=arc-20160816; b=C1yNGkLfLsHZWw3CW+2rYeNKQN0QTDqm63Xkx6kaXyi9ULt30RmasTwWTrf5sT3RSv +HCNfNZlvkE0x7Q8TwSPysW6Hwvap0ZeS7WoBRWt6MikVVp1FdkzsOHxEEO5p54yoU1l m3SjDtmd++ehQvbh8Bv5cQRBTmk01j/Mjp7qFJUIegxCq9w5wG0NOXpwAO0jWnbRdK4c xsmj+ei0ZsxgfBNSviqn0fraL5+hm30iBjM7OS0X5vzOSyrK7ZaDJU+s9sjd+jYdPMyR ZXrv3QwJly2QYkVmcSRLSSH6WkLRIvLVml/Va4DCHK2QHkIQxfQotXOg+vQE4WADL7ks rWWg== 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=Wv8Ar6+Vz5jpHC/sWKGAgUcZ09GVf4UIN32oPoSuMGo=; b=wxTWd8v5kLHAtf4YKl+h9elnnT7cw4JxQXgL2wN1HyuFiCGyLH0682VafL+oy+wbGW A6wbuGclRjhBqBynQrMzCfV5wEVYhA6/8li1a4jQpm7mJRmSQQRiRq4D2vs+xMQ2fl/g 0Ro4nUbUm1aey3HbCogsDjg+xNql274ty/D6XfdcDdlpVaW7Ukp6w4UUTfmvPM92cSXP s3Fe1VRqeg3x5mOCoZQHi79jB2yDnnef1ruZ7ufTl673oNMLAzeiQytHY8h1mM519AQP 3aHq/oZdfbvPh/3nn64MzgO/jmaboYUTk3Cx1ThRLbuuRz8TPrt6zoQP5KmAmhZG0NEm A0JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=HKI7OVxv; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=mnLdL50I; 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 s1si4182178pjf.72.2021.06.01.08.08.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:41 -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=HKI7OVxv; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=mnLdL50I; 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=Wv8Ar6+Vz5jpHC/sWKGAgUcZ09GVf4UIN32oPoSuMGo=; b=HKI7OVxv2j7Tcc QBUEskzAcr88zaSONhi/jVup1XgqUhelF4tZOT4YEAk2PDAVUl8X/rsznLPOCF6G3NFK8/8uRXaFE g9xLagF/k+Q1IrBeqcNboER5DYshcQQWqDXWDCgTDo0e5Ie6DL/pCEE7SYK2rSRv93cDh+bv4rsoJ M7rwmFyCPOVlr4zxwRVm/bAgOUyl4uUH16aU/sc4dcP5EgY0DJ57/FJximNrsPdyEP4531bX/CoGY eeAZuhZnYB7AODOHFP795ujidvJmyHvAS8YGMAEZYKPwQimi94+Q/gmrFQCrBROIVv2uHkpx7qfMZ 4+mpOChUj7XbVDeAGdvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60W-00H7fu-MV; Tue, 01 Jun 2021 15:08:40 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60R-00H7aI-9a for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 15:08:36 +0000 Received: by mail-wr1-x42f.google.com with SMTP id n2so14779147wrm.0 for ; Tue, 01 Jun 2021 08:08:34 -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=mnLdL50IkTgsJjnm4vQ9aWLdaMvL47oT5L5dllPfEYcigA/J3Zf8iLVPI+8eR8pIfR Fplo/+NinlspP8L6xzFJH2pA2Ez/DAFrxzhdesyMYcjRCLpOuUIXxOSvU1qLeluBA7sf +kG5MX72k+XqSpSEtsmcqIdW3c+qt+I+FBM0IpNRInrzeryqoGG5HD/DhOdwB6mMzszj MFEHb+kngSSP5u4NYPIDMZ9L6vcNWAjg76dKY5lu5tHolbpimawduIEmdMfE/x4iddXA jcQHocUwqkv77wOxOH+Sqh8kXxo96LL6r8QA2GI11XZ0TN1RvmvuuEX9N7svnBc1txci AnVA== 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=aEHRAJLhpP3bzn0Xk+31Jk9w3umnwknrNGT33T9/7bttPWBt9m0tGY9XvOO2rrdSZ3 vRf23+zrNonjK4gdPv7nwM/XE4FUSSSmRxTcSVuIz0dK9Y5SfX6CJngMIBgtxALxdjjJ V2/M6YLUelh5MWE89EpsNATaqEH9U6nTxjJ+JDYGDdumzezWTw+KvDoPHIAEXsemhF1M 0tEcrGd9B9GAq5XOwNZxu9WRR9KQrVhip4/Aq3NSDLlb2tN6L02U8nkTtD8VJYcUD6fF QfvI2cJdegHZkYafElbeGvH7Okl9dEbCkIJ5n/Kqxa/PS7DMWB+LGKp4uXqw1V5ZVPkK NTKw== X-Gm-Message-State: AOAM532VY79Xea+vPBMkaZVfB3g1f263CuXELw1RbJXnMBzLxfAXYBcP XtHsWoomjnoiOK7umJGCGcKlSw== X-Received: by 2002:a5d:6da9:: with SMTP id u9mr28374308wrs.264.1622560113485; Tue, 01 Jun 2021 08:08:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:33 -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 11/12] wcn36xx: Add host resume request support Date: Tue, 1 Jun 2021 16:10:00 +0100 Message-Id: <20210601151001.1450540-12-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_080835_387444_E9DE8BB2 X-CRM114-Status: GOOD ( 14.11 ) 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: 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:42f 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 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 _______________________________________________ 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 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_ */