From patchwork Fri Mar 19 16:15:13 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: 404813 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511139jai; Fri, 19 Mar 2021 09:14:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaIElFX9xZkLfi7VKj7DM+LW1I37FxG9fefvG15sKcphPIGrArgrLifDhuZLwjnBUCpmNB X-Received: by 2002:a5d:570c:: with SMTP id a12mr5363408wrv.209.1616170445571; 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=ZU+J5C09pxFhAnW8qEMc+jBHZs+YNiX1Ie0eQzhkSVexnluf8SiDopMzwYx5J/0oev AsyWTI32+2kdPR+bUkj2pElgwO+G5I6Y4N7iPjO8AQn7uLsmQdR74JTJrQZTIZSb5MuX HncJ9ycW8T4IUBTqoPXAjpNxasYCw57WZT/KJbgHsGE66l7VdTlnFaiVL6TJsltihIQZ Qxd4umkFbJ6/MyHDdQuODriU9vW5YBPtSMRmwnv6OErQxxtof6DCPC0OzqULaYdiZdoY e/OCVVZ3kuEDhz768cyqsaYOtlt51vLjzd6NqaHA7GaW3PrrwDXF6OAsoQZGI4581Xfz EX0A== 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=PhAFNzwfGgAps/ak19WmNeKPefWvHl7Ypa3WjvhlaRo=; b=mC6Uiggu2dMdKOvlegckeYnwv7NEnaUntX/aoQi/HrhjumUUeunrMPic9e1SwYodJE sbQv8g7tKsHtJKntJGN+dv7C5GOOa95qL7occ4Dy+/gUvfnzBD2WVrtchb3c5TjAeXp6 XD1F5V5vbBncQDK7uwH1dbhIBJdfRG9bTcDU1VX1u+hvzCzbdbf0fRu8LqF7oitTkSFw JS3BRAZnetww5/RC62fXWah+20+n0rV6RjdGg8nlEeUqJ+/FA8vDiPDCDd6S+OSM5bmC kCluQ78Hdu0DMuwRa9LhQYkWtSMqXJ0yoW3X9rMtt687gLvgffzIhNDTqj2yLT2iNNQq WgNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=A3V3PHt9; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d3SeIC8w; 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 a124si5640566wme.206.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=A3V3PHt9; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d3SeIC8w; 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=PhAFNzwfGgAps/ak19WmNeKPefWvHl7Ypa3WjvhlaRo=; b=A3V3PHt9KRosmhZH6Y2aGMk9V FWKvf4fA/JVA6WkzmC5vH9GkpqOAuqj8CcdLLtou3ffBQqkfG2ANe+W5sTvflMBwLZl2KnDwpnbjF tGBshqQRMKwcixi0EuM0DMM33kWFTI3D/tShhGEqUq44btxs6yzIpdBNjyVJvlRNsp6ww07wcGJf3 S03RO4zkHmCU7udlcET1AgOLQMyL0J40RpSGeV1ywjlkWZl+VBHEdCK4Q/IW11gJKyy1Shu7BK/Hc D29/RmCnMzWS4p5iucTU7T4SlXvi4/JBSw47/ImW4E+HWPpjri/ivEckdjvshUS3kzOGw2CHSZpfG ERlekCWsg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlD-007frd-KV; Fri, 19 Mar 2021 16:14:03 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl6-007fo8-Ul for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:13:58 +0000 Received: by mail-wr1-x435.google.com with SMTP id k8so9660793wrc.3 for ; Fri, 19 Mar 2021 09:13:56 -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=hRRlji5EKWlYATK4Q/JjFfGsjamjpBflBNA00LfXmj0=; b=d3SeIC8wJZTagoTB0RFGAK7HDK09lcNW1Bh7Zfo400OX69PoRt2glsIsnPMPtRVCmk M/mrAJEMJFBmvyWlElPxUr77ACGpSyib91ayQuLmosg3mXNOAoCIjAcoa20sxZkIF0bh cuuCzmLjYBci4wojx7p0Xt5qiBw/ATN2HjM7BNMNCPA89hNQ+1whHHGJHLJ3tU4NHc3x JjEekT/8LosKPYt8+NeZ+72ZpXcNqZK9a8YyBtTY2zA106dADTwzW4us/sB4dM6B4XYW ljpOUVWQQEfji2xCbgMUCXL7WZgJWu4pq8vyG6H7o/WMK7JAXTrzEAliwJha7OV6E9JM y+cw== 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=hRRlji5EKWlYATK4Q/JjFfGsjamjpBflBNA00LfXmj0=; b=cJ305rlhxIgOVb1DmH51A7FRJf4o/Lj7Sc8jwwbu9LjUuH/UT9NrCTeeacnxX0npwM Bs+ABc2IEpccDDQTE5k6kx2OwF8GlnJGmUQd364ERKTi/QVvxzKtSbj3Mu6ViFDIjqwt LXkdhDlG9HYFCmU+rTV3eVHLFAbfrnmOtNEcpIppN3POQOs4x2mg7zhC+JQgxOZo81f0 gRPMnzxbejuR8sprguvLBxrEJEHFmJJejLLbdA6RfBYbMYcwP6PDYLeIhohCnySRN04o ibJHXkVvvvLjEKWIC1iYIj9eB7RELDLCeXvPP/ybA8bWSJrSEWt2AljWr2pirHitJW7A A7Og== X-Gm-Message-State: AOAM532P+9MRt5Xx/WFxoVzt8B6IQKA/AOdglPVzre5wQnFvlY5v7OYr s1Bgi/IPkHEJYYxaCTYkmOfFw+YaA4E04FuE X-Received: by 2002:adf:ab52:: with SMTP id r18mr5276285wrc.65.1616170436678; Fri, 19 Mar 2021 09:13:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:56 -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 05/12] wcn36xx: Add ipv6 address tracking Date: Fri, 19 Mar 2021 16:15:13 +0000 Message-Id: <20210319161520.3590510-6-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_161357_063703_431B2768 X-CRM114-Status: GOOD ( 15.12 ) 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: Taking code from iwlwifi this commit adds a standard callback for ipv6_addr_change(). This callback allows wcn36xx to know the set of ipv6 addresses. Something we need to know in order to get wowlan working with ipv6. 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:435 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 Taking code from iwlwifi this commit adds a standard callback for ipv6_addr_change(). This callback allows wcn36xx to know the set of ipv6 addresses. Something we need to know in order to get wowlan working with ipv6. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 1 + drivers/net/wireless/ath/wcn36xx/main.c | 32 ++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 8 ++++++ 3 files changed, 41 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 b56c8292fa62..90333daed845 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -3466,6 +3466,7 @@ struct wcn36xx_hal_rem_bcn_filter_req { #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE 0x2 #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 struct wcn36xx_hal_ns_offload_params { u8 src_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 029c9952b4fb..93eff6563187 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "wcn36xx.h" #include "testmode.h" @@ -1216,6 +1217,34 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw, return ret; } +#if IS_ENABLED(CONFIG_IPV6) +void wcn36xx_ipv6_addr_change(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct inet6_dev *idev) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct inet6_ifaddr *ifa; + int idx = 0; + + memset(vif_priv->tentative_addrs, 0, sizeof(vif_priv->tentative_addrs)); + + read_lock_bh(&idev->lock); + list_for_each_entry(ifa, &idev->addr_list, if_list) { + vif_priv->target_ipv6_addrs[idx] = ifa->addr; + if (ifa->flags & IFA_F_TENTATIVE) + __set_bit(idx, vif_priv->tentative_addrs); + idx++; + if (idx >= WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX) + break; + wcn36xx_dbg(WCN36XX_DBG_MAC, "%pI6 %s\n", &ifa->addr, + (ifa->flags & IFA_F_TENTATIVE) ? "tentative" : NULL); + } + read_unlock_bh(&idev->lock); + + vif_priv->num_target_ipv6_addrs = idx; +} +#endif + static const struct ieee80211_ops wcn36xx_ops = { .start = wcn36xx_start, .stop = wcn36xx_stop, @@ -1239,6 +1268,9 @@ static const struct ieee80211_ops wcn36xx_ops = { .sta_add = wcn36xx_sta_add, .sta_remove = wcn36xx_sta_remove, .ampdu_action = wcn36xx_ampdu_action, +#if IS_ENABLED(CONFIG_IPV6) + .ipv6_addr_change = wcn36xx_ipv6_addr_change, +#endif CFG80211_TESTMODE_CMD(wcn36xx_tm_cmd) }; diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 71fa9992b118..5a5114660b18 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -18,6 +18,7 @@ #define _WCN36XX_H_ #include +#include #include #include #include @@ -136,6 +137,13 @@ struct wcn36xx_vif { u8 self_dpu_desc_index; u8 self_ucast_dpu_sign; +#if IS_ENABLED(CONFIG_IPV6) + /* IPv6 addresses for WoWLAN */ + struct in6_addr target_ipv6_addrs[WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX]; + unsigned long tentative_addrs[BITS_TO_LONGS(WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX)]; + int num_target_ipv6_addrs; +#endif + struct list_head sta_list; };