From patchwork Mon Dec 28 16:28:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 352757 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp10027818ejs; Mon, 28 Dec 2020 08:27:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8IzQK8Ju7UMQeQuaFvlN248XqV5F+icxwhqYC7fhgpsAXFKnyXmaPVVhzpF9rUhKktiF6 X-Received: by 2002:a05:6602:20ca:: with SMTP id 10mr36819785ioz.51.1609172864295; Mon, 28 Dec 2020 08:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172864; cv=none; d=google.com; s=arc-20160816; b=RiAUiVqMvYYhrntUMajtua9Pjgg8hcznckbnrffl09riPzPwScD3qaW2xmnNpy9ggu f5ZRMS34XtF5KwSm9Dfj6AMi568fpMXYNbYCbjZzun9CQUlPIaIDCCi1POPXodde7Dnv H69szdegcFdOyyVaxOOxiidIa50f7gHMVBDjv+0AC4R833VwZU7qoFxmue6VVDejFMCv D6l/q7I3/fWWQgeXURWXsnqcKpDQL9vXmUDv+YWdU5ZdYxFXJhdUMzYOtNvogh/jJtu7 tQAkYrowqA1OoZ2PqI0vcBCyxg6eupEFiSBtX0swFtAeSSii9w71LQQDKxg/h8sseR5a /mVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=aoXY6EyZlYlZjQznkfzyeu2md8MyimdrmmKkBquG/pY=; b=tVcNwTDR7MsRCF7C32Neu7w6Lj065/HJ6NPFFIJFl3M+a+/eO5rU1IF8wl/pGMzKPc MEjDYiNLExvtDiy6hJdkTixOdaKoGEHMkSIjcCHUOM/Y97+7F6zFiTBnFmSwSNfcCo8b dk75z94h6snTf6f5bc4KwiND7eN6p/8WaOz0bJQvkolbuOhFeZfa3JGmVgW3qWEgvT3e F+qTpyKEGDcReIvH3JHWSiV2ulW5CqWdQ8yjJGlqNS5KtuCg5CZgBXpYQR9mDEOR1iUw oZsyVWL0VAqeJkKAhf1RRmz7aGbzPS2qeqP7L0BOirs22RP1iOrZOl42O5SygNUd1ULc DANQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=Z4Jr+Z+G; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BoOU0ANX; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 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 merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id r2si26735025ilc.77.2020.12.28.08.27.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=Z4Jr+Z+G; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BoOU0ANX; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aoXY6EyZlYlZjQznkfzyeu2md8MyimdrmmKkBquG/pY=; b=Z4Jr+Z+GNZ1mJkbBy9LCiRfXY unVIyPasE2onmlWqDrQs0wyCFaR/jeGPXRU8DCHn5tDF/3Xdvxzm0xQVtd5LfFPN+EEau2t6AFUk7 D7IgctyfDqFJp0xGv+im2pacEidjoOk3uIpld77dQa9/UwkQDtUYokDrgDN6o1etAUdfrOEku5WH2 fl/Q0UtERW05Uue8bX0tTSd6d2KFEhnSQcXj2Iydmerf/E7an/IbTVLqeuu/HamFkSGM/o8jHDvL8 U3rK7EcV05tY1sOWO6RCgrJRuBoUFy9IiNVORbCgtoeYeWML+obVXX1nOBL1JRrhtnImfqhsxug5L TazXC6K9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvMy-0004Yv-HJ; Mon, 28 Dec 2020 16:27:40 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvMv-0004Vf-1T for wcn36xx@lists.infradead.org; Mon, 28 Dec 2020 16:27:37 +0000 Received: by mail-wm1-x329.google.com with SMTP id a6so10711915wmc.2 for ; Mon, 28 Dec 2020 08:27:36 -0800 (PST) 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=iDdF3uI5gFdqmwiYK0tEjCdYV2ecZWcbZfnAQ4bZ1CA=; b=BoOU0ANX8yCDMe4XiOnt9LuvsQDVlam4Q/nxfCF1k7+Kk9LRsqNdl7KfphAdrXbyxO mdcbKdYjgPSSKwP7YjAdulk6A6l0YU3xHTuEnVor96EHNQhq7WtJholEDiR7dy6Lx+zW 1/AIZHqITSqC0H/CGq77GCnY5m3BG0MC8C4wDJq+dWOc9Uk/ansp+rYXm8HDag76Xzvt n0QcJZje5RY6H69oNCZsMYjYwoNMM0VA6gQCwVdSM6+sClQpb/hB2hTCBvUETmpPIYFh fG1Z+mVomRO6KBnR77XWEMIj7iMmiYRwT8Bq/RiOhWNfp7vgXMmpGSWRJJLWlG0MTBDU tqbQ== 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=iDdF3uI5gFdqmwiYK0tEjCdYV2ecZWcbZfnAQ4bZ1CA=; b=fSXMzGDom5LdEOqtx2TBaSA4OF0C/4inSPzvhu2OicRWzPFFAcOzc8vgzefXpYmu5/ X6n3qH3F9U0yKkbkAMkwAQvMG2o1EMMPUi/F/3wtOuFyMydTiIP7s/6jf6eKUYApSlbT /9IxlRPUcWWTet4jNa00xyWKuB7ErBRgbai/6KSsB5LBjoHhCDPdjUyQtAfvelsArmuq A3gkWeTTBqFkpaiNgPxvyNvp5UDhQdmDgY1UjM9OIcM0igEYwBa8jXQb43XYnUNEctwb QYXhDvyU/aWkw/iPvEtoNTYQyZ+gJKB7JxO0S+B5nVr8oBc5lQA4DAW3hqU31wCNIBfi IIPw== X-Gm-Message-State: AOAM5325vvlCgZg/CC6PjKnpnLZXoAVGvp/rHVxDWUwqCU7MzlC3JZQf 575E99MgK6uSptT4GZOPnL1v2w== X-Received: by 2002:a7b:cc0f:: with SMTP id f15mr21235738wmh.29.1609172855527; Mon, 28 Dec 2020 08:27:35 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id w21sm19523379wmi.45.2020.12.28.08.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:34 -0800 (PST) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH 05/13] wcn36xx: Add ipv6 address tracking Date: Mon, 28 Dec 2020 16:28:31 +0000 Message-Id: <20201228162839.369156-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228162839.369156-1-bryan.odonoghue@linaro.org> References: <20201228162839.369156-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-20201228_112737_097646_8B5F6693 X-CRM114-Status: GOOD ( 16.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:329 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_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org, benl@squareup.com 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.29.2 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx Reported-by: kernel test robot 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 745512a6ad83..af59638d696f 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" @@ -1215,6 +1216,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, @@ -1238,6 +1267,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; };