From patchwork Mon Dec 28 16:28:34 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: 352760 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp10027866ejs; Mon, 28 Dec 2020 08:27:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJytSAxKjZjBgAqk7hPhPCmOippd0k1PaEDIzmtqXcqgzuQLyDsblmYRlXmsAnuRXdIUjy+L X-Received: by 2002:a05:6e02:1a04:: with SMTP id s4mr44366325ild.8.1609172867122; Mon, 28 Dec 2020 08:27:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172867; cv=none; d=google.com; s=arc-20160816; b=1K5y3TtdTJFXzP/fwGaXjASzIlSNlVay0hQYqtrrO0pXGC0q961Bb6okTKY3Muh0Is BDOcdOIzn+6t+sbY9n2EVIlyBy0Ubrb4ibw2EnF3temZ0PtV618JEqwIpfeTxP814Sj7 R/Pij7rQN5XT6FiqzLZRbV3EE1tj7aD/qRIj1mQENZl5i79Ty1wvTDApbETvUI2D9Qah 19RehBBNC1L2aEAvc7d1eU+XC4GMctMROAmBx/3ypAELZcJL0sqkJXa3Kgqu9KWO8lxO HWrrARgqIBfQTiBGEZT8N/zLwVZ8T3HiK3Dv+mG6cqcdjN4ZPew0LtSb6JKAepEqt5rm /dWQ== 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=XlQxnn08e24DZBuHTjzhSoC5MVaR+jhWW/cbRly9mjI=; b=iVNiojNj7+CFW8cFZENfTWiJ3lgrAeMOSAinkxPN51etAmLafs0nNb1Ib+6ePhYudP h1CHQ9eQUQlhjb8c8EbXK/wYCL79j5fuRGF3MVUor6lfCwUZx7W0v+W/5AUDgvXOeMd6 XULBi5LsAXD/wTKldLmnNHwqH/aex0cYIzF8ayTw03bO/GBT8poLJcAryxTm5aycTo5H 0sMpQpN86b3L8xtNd0W0ZtxigQJeNnkxxSl+OXeGFBL+09HW0XdmeLJ97vzEmvbmJ7F/ 0Y/RBusS8V9jtEUnSZKLZ+LvdZyekGnY5WDVTqDPjJ3ERQ0vhcfsQvFgIr1i27m/HoSW OC6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=ekru19YZ; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=sBv7gYlC; 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 q5si22649790jar.4.2020.12.28.08.27.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:47 -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=ekru19YZ; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=sBv7gYlC; 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=XlQxnn08e24DZBuHTjzhSoC5MVaR+jhWW/cbRly9mjI=; b=ekru19YZJ4YQrHrc4pI0OkBev 3bqBmRlj+308C0c3NKpHzgGLSUp2nGPXtJUuhWgR9bWxlef1rV1E9kSj34J8QSamV+ZZ1oQdF0A3W dfSo5VPS6K3pq+fZmmdKLdguUSmYqWPNOluZWRF/KIbUOB/UFX1uVJd8ziYHzytEVK2VGxHocWI9Y G19oIpS0QUoI/QGRO6IQuJkXC5VnG8JYeBM/zaeWWQrczfAbsZHkCidAQlBVyuUyejuUTV11xQK+5 8G1Q3C/EzWsB+bNE/fMthj0iHuSMMrFgSDhTDtUyh/bk5tGV32yZKMN1qXi1wcAuEFbap48zbk5Rq gyH6+9Qnw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvN1-0004bM-AW; Mon, 28 Dec 2020 16:27:43 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktvMy-0004YT-Kb for wcn36xx@lists.infradead.org; Mon, 28 Dec 2020 16:27:41 +0000 Received: by mail-wr1-x42c.google.com with SMTP id y17so11738782wrr.10 for ; Mon, 28 Dec 2020 08:27:40 -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=3RYdIFmmEj5YWYc3o4ND5KeefyrBxeCm6bmJ8jzGapI=; b=sBv7gYlC5bwoIjuph34kxZMbuxPUbZIfw1OmJfrwhOXDfPje0X7xRUHPRJjIvxuiMB xVlg9Afvzp+bZiv/4dc/ZYP7vJGyvYlAaSTbcg7qtyf7eqPJDrzF6vI9nz0twKMbBM/g vO0t6SVPa3PhKn1AZQPHDbva4KJs4FpXKKmG9BeQ7kGEmY7GJ4YsaM03ikiKBmeLKiEz +9jL7eml+wdEQ22QDH2AFb9qhncK+oOJ025/6a9x7fknF0AWSsPyTusylh2gYRcXsqhM Y815//TB/Ns3uj15lFr/C86FzicCdc8ZveLsGCGhNyv7tR2xHX2Ak9e+JHmOzlODYVue wujA== 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=3RYdIFmmEj5YWYc3o4ND5KeefyrBxeCm6bmJ8jzGapI=; b=LqbQXruvFOAnXOs89X3X4gW2nY7IRPhnr/E97h1RG0UOTLzyrm1i3eL5vNTfE29Tfb l2Hw/oy0UHIOekiESu3JgWf8iKDkYnKAnewAXJ9vnNC1W4OyirjMBSiRHEEwHKyt+0PX /tyguIRmDCcVUnkYVq2HrIwo0Ca+vE1Hc8Bt2v+fkxfM55hoHuU6KgWM23LTSl2tjbS6 CteEajgGaaNw8MjSr5k+ccDmFi2n4+my3KU2GiqvTId7+l6VqBD6tQ2m+UaBDtAJayGX AzFrHZBn0RnfyjY7Pbwh3BQiX4o9SGR3t4U1UpkncMC9HTHCGdhOGNh5GNbTRZQaZNXG IUiQ== X-Gm-Message-State: AOAM5312INxtZHJCbdzlKVfA/IvFTklFNewfaD4G7ERd6+kLt+0wioTl lnlNclqYH81p7bvwR2j9CU25ig== X-Received: by 2002:adf:d238:: with SMTP id k24mr15458581wrh.414.1609172859208; Mon, 28 Dec 2020 08:27:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 08:27:38 -0800 (PST) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH 08/13] wcn36xx: Add set_rekey_data callback Date: Mon, 28 Dec 2020 16:28:34 +0000 Message-Id: <20201228162839.369156-9-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_112740_773336_DB9A9982 X-CRM114-Status: GOOD ( 11.79 ) 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:42c 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 This commit adds a callback for Group Temporal Key tracking as provided by the standard WiFi ops structure. We track the key to integrate GTK offloading into the WoWLAN suspend path later on. Code comes from the Intel iwlwifi driver with minimal name changes. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 19 +++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 6 ++++++ 2 files changed, 25 insertions(+) -- 2.29.2 _______________________________________________ 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 cfa2e2d20a20..b3388e4a76d2 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1155,6 +1155,24 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) return 0; } +void wcn36xx_set_rekey_data(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct cfg80211_gtk_rekey_data *data) +{ + struct wcn36xx *wcn = hw->priv; + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + + mutex_lock(&wcn->conf_mutex); + + memcpy(vif_priv->rekey_data.kek, data->kek, NL80211_KEK_LEN); + memcpy(vif_priv->rekey_data.kck, data->kck, NL80211_KCK_LEN); + vif_priv->rekey_data.replay_ctr = + cpu_to_le64(be64_to_cpup((__be64 *)data->replay_ctr)); + vif_priv->rekey_data.valid = true; + + mutex_unlock(&wcn->conf_mutex); +} + #endif static int wcn36xx_ampdu_action(struct ieee80211_hw *hw, @@ -1256,6 +1274,7 @@ static const struct ieee80211_ops wcn36xx_ops = { #ifdef CONFIG_PM .suspend = wcn36xx_suspend, .resume = wcn36xx_resume, + .set_rekey_data = wcn36xx_set_rekey_data, #endif .config = wcn36xx_config, .prepare_multicast = wcn36xx_prepare_multicast, diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 5a5114660b18..6121d8a5641a 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -143,6 +143,12 @@ struct wcn36xx_vif { unsigned long tentative_addrs[BITS_TO_LONGS(WCN36XX_HAL_IPV6_OFFLOAD_ADDR_MAX)]; int num_target_ipv6_addrs; #endif + /* WoWLAN GTK rekey data */ + struct { + u8 kck[NL80211_KCK_LEN], kek[NL80211_KEK_LEN]; + __le64 replay_ctr; + bool valid; + } rekey_data; struct list_head sta_list; };