From patchwork Fri Mar 19 16:15:15 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: 404814 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1511183jai; Fri, 19 Mar 2021 09:14:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfYcd/AiPJho63ZKHGyc6PX18jrcyMXLH4WYT7jpRyvTjozMpqiepAJxD+YYBjRysdBiAj X-Received: by 2002:a05:6000:1ce:: with SMTP id t14mr5211602wrx.85.1616170447980; Fri, 19 Mar 2021 09:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616170447; cv=none; d=google.com; s=arc-20160816; b=GI2fdg6wAP7HC/lUmJEQCdMWEOt+dNVJPJk9GhrOGdchu2fbJX/el6fuoS7UY/xNuD kTvIalE7uuNwfFPH6n6uat9NlVm225SPAwMrMmIfBYtEjmvcMqJL5s7Oo9eOGVlSsINh s4eVHbFBsagpikinzvdNfZZ9fCoZ63geLMTNIcKfk8zP+f2Dw7N6yfC02hRiCfe8d0XP Zo9avOe6jRnzymSNf3h+31+9BIEbMvC8tka28JOPoxWwgL+k4L2KL56rQVAo9gEpRsKN iKwcitaaVerVZHuu3oYCozeItQLsjJSWEfI5w3vse+b/Vcwh6v2VsHhRoF+aCKBLXNhc 3QJw== 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=BeBpqXK5nRFfMz7SkCda7ANPYKWQtyt2YpBgAwGLBds=; b=uSTCEZHHuJ+g3PZ3HcsOk0me1R4JHFX4SyBUvyaX3d9OBRyEh/QqnFKgqmL/EFGmyZ 9tMeTuEV+pWPSuF3Yyyq+LlV8xghm8kO63LLKWSD3D+jntlnlR/K8VHz6AaIJxoT3wLU B3wn9P/0FpKAN9OlQuARUoPVF7tTJP6s3lQVyRMcKQnwks/GRRF6axwJkd6tN8MwEEIR D/p7UrOj2defx6+vbNslHwlIeghx2ZYMb1TYv9Ohqx0zDh81lJ0dhQ/ePmGAihVm1+AJ WQ+m7vwKJi5mqNXWIrDweHbJDHJmpfdDvOt9ZAQJUiZFDX6QFxSzE+ldIfkAIx3OMOXV KOtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=jLk0FZDu; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y6B74L2e; 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 w11si5561359wmc.34.2021.03.19.09.14.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:14:07 -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=jLk0FZDu; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y6B74L2e; 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=BeBpqXK5nRFfMz7SkCda7ANPYKWQtyt2YpBgAwGLBds=; b=jLk0FZDu2veMUr0NIpvzRfIoZ OCwJHz9ebWbLbls33rjY8QydHdsQb/uFNYJ7v4QLDYFa5tvaj/o7ArS8ZAsqPCMIqMIhp8mkhfdkh RJhgNK8qxiocdTJBza3W0eckHoiCLy8SaEfmYLxSw7z6JlpePty2vzT3dGfy/IBQWSkzc8xdaeWTV 4+rm1wP3geAf996qO6vL12BtpBlq4nemRqczpXgWeyaBgGvAkT5EL1PNKBhdvLioCEuV+RVGeBvrV dPR0XzEk/cdvET7M9eCjdqQPTQBz7ybDYIRPhdzbQ4DGerBFG9Bk1VW8E7j6FEJmTdQwoU/iiyhi6 n7AI4Jx3w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lNHlF-007fsw-MJ; Fri, 19 Mar 2021 16:14:05 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNHl9-007foq-DH for wcn36xx@lists.infradead.org; Fri, 19 Mar 2021 16:14:01 +0000 Received: by mail-wm1-x32b.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so5541242wmj.2 for ; Fri, 19 Mar 2021 09:13:59 -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=myI1fQBtftwmddT3Z8jSGa9/PtOPEyQd6+p8HuZB9bg=; b=Y6B74L2e4fm8oZtZMB/O7rLhb25FVH9jdiY313JYjnYwG6OKa9+UFser9E8ozygAt+ CNurb+oGseS2vH8A7AT/wsMdflPhWj5gDynkeUqVMj4DWaLq2E0MAi7GnE0UyBFIWvZ4 jNOLdVrug6cSMRBFxOx/3iRUnVgbQq24JEbusI7FXNaPg9jyihK5U8V4QAILdLFofbSS TnqaYuDrQXoE2Xzo55ZnhR9KwYpX2S7Tn13ITiwXTu+Wshv0L7ndKyuXQg0maiB/SYQ/ 0WsBKL7lxz1qmEg54KttFYxaYB2n82CCz3JAVjHKxwgObPSlLOtEP6hRhxH7IJApE1mE JT5A== 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=myI1fQBtftwmddT3Z8jSGa9/PtOPEyQd6+p8HuZB9bg=; b=koeyvwmbRWocetgzaiSj7sVODR9130OqA2wN/p5aurjbTQnFAcBOkIjHLfWlpi18jD OYYTaMtKZKaOfgNB70yCV5a42fgE6Y0n/gdr0ANU5o4gF0bppu7LLB0OwMj0iYtqmUZe Oj/Ne5V8m9HBjVnLTYgE1v0wmOlxj2WLorRUW3FUmPfbpaB1ZYSHKLX54P1kDc98wyuD O9SRVaajTkxvhF+KX27L0wAB4aDpu1circQUVzOWR5Nvi2iYut+UUTLyVUFfnoZ1503L PveMML0nDw9+zJAG9ZfsCqIP/wJWnfbzEUtw3iI/oDw1pKrhWit9lWci7peWwlrqZMfz Wwdg== X-Gm-Message-State: AOAM532NeAa3W07IKXdji2WPHoWZ32DCtKUfoEVD/8dWUrc0H65hMUWC BtVZj86zNyXneTHFQTBS3pePnQ== X-Received: by 2002:a1c:9d0e:: with SMTP id g14mr4519547wme.30.1616170438837; Fri, 19 Mar 2021 09:13:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 09:13:58 -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 07/12] wcn36xx: Add set_rekey_data callback Date: Fri, 19 Mar 2021 16:15:15 +0000 Message-Id: <20210319161520.3590510-8-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_161359_616249_1D97A580 X-CRM114-Status: GOOD ( 10.57 ) 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: Add 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. 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:32b 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 Add 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.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 36cf771d8a20..6b0deed23c5a 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, @@ -1257,6 +1275,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; };