From patchwork Fri Mar 19 16:15:14 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: 404812 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511129jai; Fri, 19 Mar 2021 09:14:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQRkKS5Ks2YasYUQAfw5B9nWMOhB0cGJrD0G+rQnpRJm/XEXc031ThksBNcFGMjN3r0QEz X-Received: by 2002:a05:600c:4fcb:: with SMTP id o11mr4454077wmq.117.1616170445182; Fri, 19 Mar 2021 09:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170445; cv=none; d=google.com; s=arc-20160816; b=nsnN2JUYZyQBmqfMOYArWbMG7MFmDnlQDvBrA1yPnrfEgicQovc1qBXCX7HtUDdtyN y+rwzhbMv8p0DB+R95r+DhHtMTehZRbHs3ljtwbipnNmEfMClZyNGEm8Lm5b0vbNoipb DNTF0wLlFdV+iBg2DcWUY/317cbKYNB1YKIjd2vW4O1qPLaxVMyE/0pLE1m1+75WP+C1 T1z7YXScduIobE0TE2AZVP3uwFQzhWi56QQUzHMN5x30hikDd9CgiSjebATpclkMwy2+ atXZXr731rVI7cQnSex8e8qgvMVWzqriI0RNi1A/dhp9UW83rg3tf0ZIu+SeFfmzwc5G Cz2Q== 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=TJmAWomB0Ris5YNYuf4+KwdDJH/VCmqt9Aib6N2z45I=; b=noi9gkekHeT+Q+l1P1rRGWNRNeN8twZYxRyBVjKVdiIpTXaXBwAh7zptnVGaS+XSC7 R27Eky+DXdTX/t+UmM8Fwnv3KelYAAZytiRcfQQkkFNI7DfOCHV/h7HnrW5bhfc8ZeAy JkNlW4OAKe4O4riSdML/yZuHiEiWUuCTKlkpYA17KAYe4Qf9JVcVKQl0If3I0PslvU0n aaCNKmcTcQ38VK7gOCdK9T6fgOtrgxfRVMDcu9yzt6Of2Ik7I144qlw/wQungSdJ/x1J RXSTarVL/EgMNL7Txo7Ouw7/Y0iS896l++4XuxzLIN3wMbKDH9O01IAdY09tU+47ZboS CWBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=LJNzxAhO; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BWmbhp4a; 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 v9si5462912wml.4.2021.03.19.09.14.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:05 -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=LJNzxAhO; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BWmbhp4a; 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=TJmAWomB0Ris5YNYuf4+KwdDJH/VCmqt9Aib6N2z45I=; b=LJNzxAhOkkaGS9C3X7GfQRv0/ M/oxvIfnzL5s5G37ctITTSa5LCHTQqEEk53mgaH8UmNHktfd7UTQtqSNx8P3d/u0nNWrNdz82PIfk y5KyufE6LZDxWTWqIPUP8F0w83szarZ+4uarmH6MRx4XGHFGfzOvte/SFzRpoTEbJIKs50rFDSgJ1 Diuo2R+VFVb1PJgH6K2sFP9cLE/2faBsJre600vEdyxuV57LiDeQ9hWtoAzOTMql48XlEfcEBDgFR 9SdFSmyPly1TQhg9FbVylgpZy4ncKI3jfEX4Yov7LiMZc6NwEMRKFGt9lXzzJo/fAc8ArMWe5FW1Z 8dxh3nCJA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlE-007fs5-Ax; Fri, 19 Mar 2021 16:14:04 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl8-007foS-Ah for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:00 +0000 Received: by mail-wr1-x436.google.com with SMTP id e9so9670826wrw.10 for ; Fri, 19 Mar 2021 09:13:58 -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=FeymHFEw3VCwGiX+9p4pd8aUCryOvSHH6lc3lNOgB64=; b=BWmbhp4adjkCyZpeHNblIR9ZFApQJaR2+I03rojYwzpA62a+HMhwHi8xXJmcMPpXB1 7muUNz0pWzV/Spg/sojKKtdEHwwieOU+Ha5vAqvFJ+UOMyplmbFz61GC9k88y6Ho92b6 XlOc6JDNcOUegnp7RKvID+MZ4DblAdAbbw50ETIynE3aCmSwNnivLw7AxINhe6MusjZZ 14POzNurt00BUBAYvt5MIz20ToXDu1JcQ6xnjrlhJL+kUWui3mogHimWJB4tJhkDcxvr Htf8RTfXfOAWziHs1okVWWWw/boNTKrJhZtXbfc3pNK33ofMeD3haoDAi+xsb8CdQG/d 759g== 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=FeymHFEw3VCwGiX+9p4pd8aUCryOvSHH6lc3lNOgB64=; b=ACcM4eWTU9Uz8UcWF0JvUO7DjVJr09CnILTfd921XAFkMaH67mK2vnllTivV9mZ8zU 3wMM+3nLW6v6jmA4OLN+AU7e07ZZ8pDWIlQgbuAse2ggL+bw2ZGQ1BQLswbs6Irmxt2T qZkWeLSiiv2uI7TG3/3VJKorjUgSqIIJyZBHqKEy/t3bcZHEQXLqd8fMPQltIdHWHCNg QfRrIir8cXraW2xeXavZiPDYzrXBFDpjQrW0IEVYRQoJHFn34TrA72/IcsyzwWbG1pIZ G1Xuyv/72Nwk1hHpmQnn8kdjlvlRV/VhdMxpKMqSIHz88vYuKAl1tgRtEknHytUjzCxd g4BA== X-Gm-Message-State: AOAM533K/GWtcOZ4bJxBr0P/Yv929s9nX1vVN6Uy5c3VZCrjQmi+Ao8Z p7UstXQfhzCOvSY6WxbFb7xE5w== X-Received: by 2002:adf:fa08:: with SMTP id m8mr5414790wrr.12.1616170437724; Fri, 19 Mar 2021 09:13:57 -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.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:57 -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, kernel test robot Subject: [PATCH v3 06/12] wcn36xx: Add ipv6 namespace offload in suspend Date: Fri, 19 Mar 2021 16:15:14 +0000 Message-Id: <20210319161520.3590510-7-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_161358_461829_DE1234E9 X-CRM114-Status: GOOD ( 14.98 ) 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: We need to respond to ipv6 namespace lookups when in suspend. This patch adds the necessary changes to issue the appropriate firmware command on suspend and resume to enter/exit firmware offloaded ns [...] 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:436 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 We need to respond to ipv6 namespace lookups when in suspend. This patch adds the necessary changes to issue the appropriate firmware command on suspend and resume to enter/exit firmware offloaded ns lookup. Reported-by: kernel test robot Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 3 ++ drivers/net/wireless/ath/wcn36xx/main.c | 4 ++ drivers/net/wireless/ath/wcn36xx/smd.c | 63 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 3 ++ 4 files changed, 73 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/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 90333daed845..3b949b0b3792 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -3464,6 +3464,9 @@ struct wcn36xx_hal_rem_bcn_filter_req { #define WCN36XX_HAL_OFFLOAD_DISABLE 0 #define WCN36XX_HAL_OFFLOAD_ENABLE 1 #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE 0x2 +#define WCN36XX_HAL_OFFLOAD_MCAST_FILTER_ENABLE 0x4 +#define WCN36XX_HAL_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE \ + (WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_MCAST_FILTER_ENABLE) #define WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE \ (WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE) #define WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX 0x02 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 93eff6563187..36cf771d8a20 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1118,6 +1118,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) if (!vif_priv->sta_assoc) goto out; ret = wcn36xx_smd_arp_offload(wcn, vif, true); + if (ret) + goto out; + ret = wcn36xx_smd_ipv6_ns_offload(wcn, vif, true); if (ret) goto out; ret = wcn36xx_smd_set_power_params(wcn, true); @@ -1143,6 +1146,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) goto out; wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); } out: diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 478e363610e1..4a50e5f8456a 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2793,6 +2793,69 @@ int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +#if IS_ENABLED(CONFIG_IPV6) +int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_host_offload_req_msg msg_body; + struct wcn36xx_hal_ns_offload_params *ns_params; + struct wcn36xx_hal_host_offload_req *ho_params; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_OFFLOAD_REQ); + ho_params = &msg_body.host_offload_params; + ns_params = &msg_body.ns_offload_params; + + ho_params->offload_type = WCN36XX_HAL_IPV6_NS_OFFLOAD; + if (enable) { + ho_params->enable = + WCN36XX_HAL_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE; + if (vif_priv->num_target_ipv6_addrs) { + memcpy(&ho_params->u, + &vif_priv->target_ipv6_addrs[0].in6_u, + sizeof(struct in6_addr)); + memcpy(&ns_params->target_ipv6_addr1, + &vif_priv->target_ipv6_addrs[0].in6_u, + sizeof(struct in6_addr)); + ns_params->target_ipv6_addr1_valid = 1; + } + if (vif_priv->num_target_ipv6_addrs > 1) { + memcpy(&ns_params->target_ipv6_addr2, + &vif_priv->target_ipv6_addrs[1].in6_u, + sizeof(struct in6_addr)); + ns_params->target_ipv6_addr2_valid = 1; + } + } + memcpy(&ns_params->self_addr, vif->addr, ETH_ALEN); + ns_params->bss_index = vif_priv->bss_index; + + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); + if (ret) { + wcn36xx_err("Sending host_offload_arp failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("host_offload_arp failed err=%d\n", ret); + goto out; + } +out: + mutex_unlock(&wcn->hal_mutex); + return ret; +} +#else +int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable) +{ + return 0; +} +#endif + 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 6492a628ea6a..e03ab7878432 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -150,4 +150,7 @@ int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn, int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, bool enable); +int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable); + #endif /* _SMD_H_ */