From patchwork Fri Mar 19 16:15:18 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: 404817 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511232jai; Fri, 19 Mar 2021 09:14:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/2xslZx5tHuDVSasrvx18DT1AkWRdJ42CUT/NfEFYl9lyFEfY2c2fUfYrAdJOlSmbIYHk X-Received: by 2002:a1c:b006:: with SMTP id z6mr4248585wme.19.1616170451206; Fri, 19 Mar 2021 09:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170451; cv=none; d=google.com; s=arc-20160816; b=ETmB9gsMj+X/KKrtIBT+8IPF8ksJYtiSjqp+eUMf495ECo5alRoY5WVtoruSJE62F+ ncnBk44PNH2C6aXjtDIjbEvQkhy7qTiI4Ks5CMdREHtxEgcp62BjH4+M07KYfyQeNU7M 4XtJQFpUCQTqSItu/BhKKC98vWPcL++ghYP/vi4si34uSDoZYAyOdS+BU2e02/vm0KeJ OGwqdeMc603a71HIqZRW47AWEm9K8DAF1J3hI79iRAuOlAtGoJ22H0JNvwsPvaOtlXYq 0GI66Mv0BTY4ZfHlBfTCQYQ7mqGZtQCK5X7oR471YzD6Ix7iFnqu8a8wwVrtvsuL4YlH fcpQ== 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=B/sTBNSDjFCjgHsf+Cg8iXSjnZ/nFOo2hrbDX7LholE=; b=Hb5pzJMD+/94l+bcDbFqg56/B+/msWfycF1+pzuMNKJDgW5ca+rqqP8jHg6CiCczaE 5j6q8JCNKLxuwLE3vdfk5FoW3ANo+MIWqpDe59Fve41VPyWajfnW9ECTWxHXZzCzDyoh As61OQ7VL6g3kDTWH7MQRFAN8fXrZezQxxBHpq63clasLoZoonEu1H6TXP86IHRo7Qkf mrvFUwWh/OFwTWZXlJn4pROyd+zCEGA6v4WGDN78AUwv5G0buB1oIzp9Jump9pBu2YBu H4J8k4NPPGDbiWuq9DdQEX4SW2QUH4gmU1OorGMtP2mwata/YmlDAuAePBnqhBq/nuh4 tSqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=jAHDocGw; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=yVCuNnhG; 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 w67si5502910wmb.123.2021.03.19.09.14.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:11 -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=jAHDocGw; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=yVCuNnhG; 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=B/sTBNSDjFCjgHsf+Cg8iXSjnZ/nFOo2hrbDX7LholE=; b=jAHDocGwS8Bvbv0BEdM9dULS+ JIkFDkivb+Xp7Urrrr5KtdkmE3duboMMulmX8D5J/wPw31DAa/JTncb9fc+tKqWLPp5OKZKxYhXgD Om3ZfydwuV7uBX14IntT2VWZ/kJfa+UJ/KI3cPHZGbEaZxSD/bdrUvBgFHSHeKcq9hwYrYyJ28raK 7r7UGNt4vwYxDfMKeIPdc3a6uugBQDvWOJQ3R9m7eFXhunO38Pu0tDcYEV/rTspajXwlSg2NwyfRg iDOGFD9GlzaXGTY0kMEMmGviSivoFdb0+LY3NUERxgOa5155YLu+lly8SNK+W2QfotO/3NN9hQLqG zHrQRB+ww==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlJ-007fu6-OU; Fri, 19 Mar 2021 16:14:09 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlC-007fqc-DA for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:04 +0000 Received: by mail-wm1-x32c.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so5552955wmj.1 for ; Fri, 19 Mar 2021 09:14:02 -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=gigI+obh4OgQAHcvn4ct7jEpV5/6/PU9YOe1h8WyUL4=; b=yVCuNnhGbRNZgUToUq8Y6pXPRQDfLgcKxQ87BQjtNvri+d363NoDhV0CLGWYBkDFWV qgjZGJJ36ilzUw+VyWjEhLD5biIUzjf74QBHp173bn6Hj/6rgucsgiNwUo9PAsEKB1Fc D5QfRR1G46EbW3PMbf4q4jBFSgE6uD3NeJej16mET3WOgkCtgqvH6+JgSidJ8cGwJve3 39iScW0RpBnFkjxcESbixqmctO1UGDk1Ub8xIM5Ti6VLZlHjccSsLbq5z9Kv79FhPWnP ZbSHAjUXJtLNR+tKwqSz/hLLG05GI+G9dQcKIOexTvnhhxHFj3ap13MmbzHRZEpJxXwz Q3mw== 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=gigI+obh4OgQAHcvn4ct7jEpV5/6/PU9YOe1h8WyUL4=; b=IqURwZWux58/Ph7uqwcmAedHqPQfS3pYbsYIeDevC4a/K63Gc89kClP3IQfUS+CuSe zmgABm8rFucybxpPcgytCzq/414YsVuH2mieQ1bkozh01kCTKanSwhDS7f6ayUoEy2+9 My4oeumwr0JPnTROaN5vf0lAbtFciocUxv/XL7Xo3Q+AksumjkgEs6rKQtyzTnyYXndh jmiPwY7LzEj/3ByiQ5PX9OpaCEIB13sMvcKuiWYtAWodsKC9A20WbjTyQ7aRzjb9BoTg MIJhgqJjYKWWRQZLrs4GQ3c0LOep73uUuNKLIs7+WEVaFtS1P5K3e9tE3x2jXhDYx+37 WDcA== X-Gm-Message-State: AOAM533jOgYaP/nwbfxhZq/tRS8mlX5yZ2ToNLE4CQCxaDgMrGRp0OB5 HiXb416E1bpDLJ3TB7PpxkwVvA== X-Received: by 2002:a1c:43c5:: with SMTP id q188mr4337744wma.94.1616170441863; Fri, 19 Mar 2021 09:14:01 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:01 -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 10/12] wcn36xx: Add Host suspend indication support Date: Fri, 19 Mar 2021 16:15:18 +0000 Message-Id: <20210319161520.3590510-11-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_161402_564312_D30E599C X-CRM114-Status: GOOD ( 12.46 ) 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: 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:32c 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 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 --- 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 a84128e04cc4..535e0d4245c3 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1127,6 +1127,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_ */