From patchwork Mon Mar 15 12:09:26 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: 400401 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356522jai; Mon, 15 Mar 2021 05:09:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmzSqS3JSk4OJdywUA5jsWMsxyPuO44fr9ChHRNCKk3l+j5KyOqk81KIW2JX2G/bhFhBOC X-Received: by 2002:a1c:7415:: with SMTP id p21mr26083441wmc.187.1615810149003; Mon, 15 Mar 2021 05:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810149; cv=none; d=google.com; s=arc-20160816; b=Ub345XHVswyRQPDs3t9YInTHlnfdtjn5+anHCLZcV2uclLuFXpqvacB2bvr6rVi8yZ rXjQj4hM/wcdmBCBBhMTtzqJFpbMcGZWRHigL1nBc8AHP8J3o5nSP7qS3vDH2AMP0JOX DRfeMHNBbilUUWyFv4JoOyxkly9i+9GAAzduc8gAsZ+wCFXN2Px3S/7XgZHsF511KBgz Al7aZbzYaLSZ6vO6NDM34jUoIo7tpRiaZiQtKRbcGfSFfxJsYLsXAzBSp2G2Xw9jzgLw CY2DrUySiOhVWpvYp9UAT7v4vRGfQynSe6Ugp+SgLG3SwipSCcmWnK67vApcxeppaUoQ lj9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NYk+e0v1fIIJdNtGGm5pPGaN1woGIuYcsbVccpj5KvM=; b=trD4RSufePThFkmyLTb8JVMEczogxch7QkjJDnsFcOWJrTs8BG9Camxnct85NVlQnp lK4rGxExYkZT3d+HYH0XfKDv4m2CREG09FhnMQkZ1iypehz36uq9XpRG4CXU40VpSbnq inELTVK27BXjQQQtSUkdoNFpMXPSYFi0ebfZqr+WeYSAjOjG6JI6dqD/9sDu45nMv9dC cYqcUuDxyWPuh+ttwMnvoFU9MrNJPYbz9C3TmCEeL4JV293czlfGb403E/b2MvxTgKEC q/llunaDCUkJqo11GSsbPtvOTD0dgi8+1iQsVONCFQAjMEOeHVMNAXtIkpy5GJwPicw1 CDDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="oya9sOt/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.08; Mon, 15 Mar 2021 05:09:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="oya9sOt/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230504AbhCOMIf (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230447AbhCOMIK (ORCPT ); Mon, 15 Mar 2021 08:08:10 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73209C061574 for ; Mon, 15 Mar 2021 05:08:10 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id 61so5561799wrm.12 for ; Mon, 15 Mar 2021 05:08:10 -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=NYk+e0v1fIIJdNtGGm5pPGaN1woGIuYcsbVccpj5KvM=; b=oya9sOt/bAjZrmfhepm42rnPxi5a5a1YbgczIWnqr3NVQHKh4zkohqiPs+b1BpSnP/ AD2Yv+U9vl+aasOW8+ZyH9dBEg5HFEENgt3kb1YmZPOsEGbDuEs/JcVNFXTUeDJ2jL+W LUderY90kDpe3ursrWzOiPDasNlDRFPEkKbsD1jdvB8DC43o2YduOB9v8wRNJp8fA2cq dZmh+0yzIrC/24k61gWoO0gx2EGX/CVBWHZBOjTJra8oE04UAg5u2t8P/6RbM/mkYTLO yANta9uVaw0BJbXpbTCAE3X3VXYMGqV9IMsn+2RppxaCm3nFHjR74M1WpYVssiyRJ0+B K6MA== 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=NYk+e0v1fIIJdNtGGm5pPGaN1woGIuYcsbVccpj5KvM=; b=l4YqEP/1k77jB0CJL1zEAnZVHMN9Zzr0aFUULnzUCz+RZ7Dy3bq5kIcK2V5bgTW9/U Xd2jgqxWzXI2ZSIcB1Cys0NArkaj12hVGj2mlKAcDRLNKaMkhmMJzk9NdJy41OTBYTe5 okeyWmFX0cvmGu3PV8HGjITxydPmyjBn7ZUp0aJU4ZxfUVzyE8RWG4Dozo+D2Tu6IrnO 10BROvOWq/PUfP+/JRdQLux4asxsqb2Uq+64fLYpfjfJHGARketaBDEm257wlQ02ckT6 5EFOsoTovAHQmRdXSKV4f5xZcYEl5mfXCuz58G55bSXtC5sS50u8fTTvi2OgeDzR9m9j cJwA== X-Gm-Message-State: AOAM531DurAm+h/8aS64EaKILpZztCbSo9bv0cTWKbgJtlWluIUli9M8 2nV0kQ2zvM08LxCoLb5JFOQjiQ== X-Received: by 2002:a5d:4587:: with SMTP id p7mr27250214wrq.205.1615810089036; Mon, 15 Mar 2021 05:08:09 -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 c18sm29239891wmk.0.2021.03.15.05.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:08 -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 v2 01/12] wcn36xx: Return result of set_power_params in suspend Date: Mon, 15 Mar 2021 12:09:26 +0000 Message-Id: <20210315120937.2512341-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org wcn36xx_smd_set_power_params() can return an error. For the purposes of entering into suspend we need the suspend() function to trap and report errors up the stack. First step in this process is reporting the existing result code for wcn36xx_smd_set_power_params(). Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index afb4877eaad8..b361e40697a6 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1091,12 +1091,14 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) { struct wcn36xx *wcn = hw->priv; + int ret; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac suspend\n"); flush_workqueue(wcn->hal_ind_wq); - wcn36xx_smd_set_power_params(wcn, true); - return 0; + ret = wcn36xx_smd_set_power_params(wcn, true); + + return ret; } static int wcn36xx_resume(struct ieee80211_hw *hw) From patchwork Mon Mar 15 12:09:27 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: 400404 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356571jai; Mon, 15 Mar 2021 05:09:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7njPVLsMsOMC/95GmdlRCX+toNTD2Pv6S+rgULuXfh2SQlz6kOEnJVSkU+jAwVujQoDdX X-Received: by 2002:a1c:7ed4:: with SMTP id z203mr24556660wmc.89.1615810151155; Mon, 15 Mar 2021 05:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810151; cv=none; d=google.com; s=arc-20160816; b=ez6qOAT0O8oBEFjEH8+WEDDYeBhGeRFirbTSf+DXVjPsVipjdwOPk9M8hikUrQxPWA lTc3HHm10Tznx2PN/PaPNDfKJ4LDzx7C7HIOrv+0s8Ni/Gtrb3A5tlIvy2NFp+FtcvoD GzTCfLbVEAI5NE3XQ0rDzb3TXRUxTm5QdWsC4aweJLBV0g5MBxsv6AVGjHV2YcSZbHSp 23Mm7+FWcrl3nD/q1uV9zcN3VrEnDh/jKXIJpLmbn+9+tF/maxtQrYRwE7CyzHVI8JwR 8j3LaNchkBBVRsmzFbfD2dkXyHaKSmdHajluD7kmQmSAe2LyW2YyByhHiLPYqT4XPtdq Ys+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jZ3WKCazIuoUxdRWj4Ban4JPE+r27UOCDH/EMw86Dwc=; b=0Edjgp5zuWg56SK8W/X1V9u5lc0Or4oi6+EbaYb5Wk15TobCtnBPNkz4D0Rfw/eRHf oQdghl7aXZjZtxjuKpJ4IzkG4drR4IH1js87l640IR843WX64Gk/AsSPXh9rJUEzki98 bBXzeOhNG6un5+AiXyt/Y83TZDfl2mk3wv49DArvt1sgHfisJ/d+0bmyDeKwi77atYiZ cwS4UhcNhLQp6v2iIh4l8lClaxyAU4ei9pmrSZT0yMp1MWiEaRJS7KOfCy9g4Lxw3ekD QcJfr9QZuuZjjgLUZJULKJV/sfOFiE3sIbIqIjYfgdI8VKvzvYTazVr1B2TzboFWVo81 hpMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a9K4toRB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.10; Mon, 15 Mar 2021 05:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a9K4toRB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbhCOMIg (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230449AbhCOMIL (ORCPT ); Mon, 15 Mar 2021 08:08:11 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52598C061574 for ; Mon, 15 Mar 2021 05:08:11 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id b9so5570511wrt.8 for ; Mon, 15 Mar 2021 05:08:11 -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=jZ3WKCazIuoUxdRWj4Ban4JPE+r27UOCDH/EMw86Dwc=; b=a9K4toRB7jQlVdt6mKJ4d0L0yJ+9ZNwc4VgeWjc8VuYvomYeF+bjJTpSfd1lhb3gLc 8veu4Wf339Luv5hxRw7kWFoIVM9L5z7lVLDskBhowx0D1+fmsyFpFkPKm/domr0nwmoq q9HOUoMy06yz+3/EwsKAK7G4lD3in+aqMSHp99TZVtEkkTC+OVybFjDHzTR7CApc28Tb 0S5H3lxb89PMQSRLX6vGbsw50cQi8WNztFdDlekKABh8jebfU6uDf1U3lnS/CtDM1Qqd REvxIcUxmaW6jg5CxXROEcpQHtzyir4ny9/UQbZkmOq6dAxawpl3+nMGU7vLjYnaFjq9 lrPg== 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=jZ3WKCazIuoUxdRWj4Ban4JPE+r27UOCDH/EMw86Dwc=; b=W0qMLeMkD8D4ne3G+4tUgg+EK2THyh0jeNYm3YvaLAslYnpW1ZKxqwL0bxGyzbwP7R J+HjrODRoB4ydBzCB8zEaIphFO+YbhgXjS+9W6ieI8kIA/f58q+o6xGyEiBh9IVs58TR Q/x4ItgjJ3acVduy4prTR3/kGKvMFzPXjUXp5MScuhwvJyDYvIndBtM3/OaCks+DSXAf YW4WG7UTf2ai811XtIr9gySdsew2iGTCQlTEx4w8cOly3rTc+uQlu4WPnQr1/rV6UvXd MjB1OsY9l8VJisMio1gCwne8x64219aeqC3zJ7aaaJuVaUmMqa29u/giqkW9O4LVcDpV 0FYg== X-Gm-Message-State: AOAM5325+U/mEgILYurrEBAOsuGhdNkYhjWGCGzgoxCMoQpYDS5LQtqX VCHO7D3CLy3hd9bWS7F/Gx+k3Q== X-Received: by 2002:a5d:5088:: with SMTP id a8mr27501854wrt.294.1615810090038; Mon, 15 Mar 2021 05:08:10 -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 c18sm29239891wmk.0.2021.03.15.05.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:09 -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 v2 02/12] wcn36xx: Run suspend for the first ieee80211_vif Date: Mon, 15 Mar 2021 12:09:27 +0000 Message-Id: <20210315120937.2512341-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org A subsequent set of patches will extend out suspend/resume support in this driver, we cannot set the firmware up for multiple ipv4/ipv6 addresses and as such we can't iterate through a list of ieee80211_vif. Constrain the interaction with the firmware to the first ieee80211_vif on the suspend/resume/wowlan path. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 43 +++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index b361e40697a6..c0c1ea18864f 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1088,15 +1088,39 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, #ifdef CONFIG_PM +struct ieee80211_vif *wcn36xx_get_first_vif(struct wcn36xx *wcn) +{ + struct wcn36xx_vif *tmp; + struct ieee80211_vif *vif = NULL; + + list_for_each_entry(tmp, &wcn->vif_list, list) { + vif = wcn36xx_priv_to_vif(tmp); + if (vif) + break; + } + return vif; +} + static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) { struct wcn36xx *wcn = hw->priv; - int ret; + struct ieee80211_vif *vif = NULL; + struct wcn36xx_vif *vif_priv = NULL; + int ret = 0; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac suspend\n"); flush_workqueue(wcn->hal_ind_wq); - ret = wcn36xx_smd_set_power_params(wcn, true); + mutex_lock(&wcn->conf_mutex); + vif = wcn36xx_get_first_vif(wcn); + if (vif) { + vif_priv = wcn36xx_vif_to_priv(vif); + if (!vif_priv->sta_assoc) + goto out; + ret = wcn36xx_smd_set_power_params(wcn, true); + } +out: + mutex_unlock(&wcn->conf_mutex); return ret; } @@ -1104,11 +1128,24 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) static int wcn36xx_resume(struct ieee80211_hw *hw) { struct wcn36xx *wcn = hw->priv; + struct ieee80211_vif *vif = NULL; + struct wcn36xx_vif *vif_priv = NULL; wcn36xx_dbg(WCN36XX_DBG_MAC, "mac resume\n"); flush_workqueue(wcn->hal_ind_wq); - wcn36xx_smd_set_power_params(wcn, false); + mutex_lock(&wcn->conf_mutex); + vif = wcn36xx_get_first_vif(wcn); + if (vif) { + vif_priv = wcn36xx_vif_to_priv(vif); + if (!vif_priv->sta_assoc) + goto out; + + wcn36xx_smd_set_power_params(wcn, false); + } +out: + mutex_unlock(&wcn->conf_mutex); + return 0; } From patchwork Mon Mar 15 12:09:28 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: 400402 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356534jai; Mon, 15 Mar 2021 05:09:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmEBTjdi6ehDhKTLKqEB/F5FFazoxEIoNRcayO3glJL36Cm36YrKpnVnC2ZJvhVDvE39wd X-Received: by 2002:a5d:564b:: with SMTP id j11mr27485014wrw.326.1615810149482; Mon, 15 Mar 2021 05:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810149; cv=none; d=google.com; s=arc-20160816; b=ZtSSr6jsnBAShOxFEGofKpax++OJ3Th+WsYP40+5R61hVf2Pip5J11g0W0puOHTmRG j7D3j1OdTliVQ9QEJGtd3gL3JfC6+hE0vbVTmxxZ+u+H0xYHyXSx694G9rBWGOuyhDau jNLvmcVkfgJh1m878ylrD005VYmcNv/iffoosFnHu4PPkJzK4uB7MxPdQghSMPDMmAC0 EwgEOAYYfbZElf3y4lMY590xkxvPil9CXibkddnkrP1S/XFg1DtAkNQh6lUJ2hSKU93Y P60fFzLJTNaUuKibqd47VTqXIR1IVIGkH8AJaz8Fm3JalU9H8g2pMI3MiCIY2ZHPezQm QCfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GoM6r0aQNFv6P86Jh2bARDY3W042U1bUTvbdF/AjcU4=; b=frnZSOIPLER+Za4IGBD6gwAa4KsbmWnWljdXh9VBy4YFrkO16DuncLW6L2BzVgAukJ XzYZlKKHCxh5W4qzabBgIOx2l0H5smvajE/Rf8g/zgu/Nq43z6LbSdlRxfnHK2vXuZ0I UZLXt1sSGEviNVNHyWlc11QBJ5zhyq8iCdwKbFhCxyu9pMit0GtAjy/IYNmhlOXN7iXl vfy5b//uJB1c4Ss+oSVPPidIUVGdkbiro2/1H9SMTF9L7Ts7ckI9og7PQfsNnFVsGZX7 1gqOwRCgb8faQnzWRwo1M4go7ISV4yfWgb1Kq7HIxA2J8nwuwAHUoUByb591xQoOdhSq DiaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNVEh20c; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.09; Mon, 15 Mar 2021 05:09:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNVEh20c; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230520AbhCOMIh (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230452AbhCOMIN (ORCPT ); Mon, 15 Mar 2021 08:08:13 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D67C7C061574 for ; Mon, 15 Mar 2021 05:08:12 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id a18so8530982wrc.13 for ; Mon, 15 Mar 2021 05:08:12 -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=GoM6r0aQNFv6P86Jh2bARDY3W042U1bUTvbdF/AjcU4=; b=XNVEh20cIrQnryK4qPBNcAkK7p3E9OSmEDiZnM52sZCD6L/1M4fW1dwW/ugYUBXe6R j11OLv1Y4eLxxAbZdAgfPj7Hu4heDs3xP5NIAemRRe2HbetO427BUJ2YTH9SUo4QS+8x CN93zzqkptfkqN/mV36Ezx9VlnURttrQLYRDIuVDPuHRY9LjItNQME8SqYHpBkqbBx6Z vtBVM80aQwQdf43cHNX0+MXHHcVmRrVbmnhNVlRIirCf7KjCA+YK7Fe9XmnzhxeIVe0M LyqWIH+kwd/amvnS+hFXNICUgqPNkg/5f9zZP+/vurwbP5nlMYWdHigIU/alMSKi0IVb 51VQ== 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=GoM6r0aQNFv6P86Jh2bARDY3W042U1bUTvbdF/AjcU4=; b=WWrPzVOYxeny/48/Vs+JnTmIBlJWNR087ZPIOg/H/R0vHiH29Ns966vGWM0loD4sWM /68wt602AkdXBsQb4vIcgDKeXPnJhCzWBz+cWlPqk/doBQJKCH7h4ea/dMA6mH/RuHrF bUO23H398ZMyYaFPCt6tr00xtZG2Ci6V4Y2FXLVmXgJPkX4GY8R2OjG7k1XywKnB5d6b 59HLfZs8Yq99+n/6RU6SQ8eQOJj4fG5exgfM9Tbfr7mkSJ2bQhEY+vpFwyH5p/73tRYY Lep0r1AitvqBl8/2gTBElNBN+WSvF4DX34J0BsH1tE/JkEfC1i4yAZeKihkdi/6rDqpZ Qj9Q== X-Gm-Message-State: AOAM531n0AeVxGaRChpNGqKCNu8sbM5S/MQRKOsT2c8JPCd2ZH4Mytu3 P5tSTzhIB/MDDlyGmIJZ3vmWpQ== X-Received: by 2002:a05:6000:1ca:: with SMTP id t10mr27272945wrx.45.1615810091428; Mon, 15 Mar 2021 05:08:11 -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 c18sm29239891wmk.0.2021.03.15.05.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:10 -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 v2 03/12] wcn36xx: Add ipv4 ARP offload support in suspend Date: Mon, 15 Mar 2021 12:09:28 +0000 Message-Id: <20210315120937.2512341-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add ARP offload support. Firmware is capable of responding to ARP requests for a single ipv4 address only. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 10 +++---- drivers/net/wireless/ath/wcn36xx/main.c | 5 +++- drivers/net/wireless/ath/wcn36xx/smd.c | 38 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 4 +++ 4 files changed, 51 insertions(+), 6 deletions(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 65ef893f2736..b56c8292fa62 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -3465,7 +3465,7 @@ struct wcn36xx_hal_rem_bcn_filter_req { #define WCN36XX_HAL_OFFLOAD_ENABLE 1 #define WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE 0x2 #define WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE \ - (HAL_OFFLOAD_ENABLE|HAL_OFFLOAD_BCAST_FILTER_ENABLE) + (WCN36XX_HAL_OFFLOAD_ENABLE | WCN36XX_HAL_OFFLOAD_BCAST_FILTER_ENABLE) struct wcn36xx_hal_ns_offload_params { u8 src_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; @@ -3487,10 +3487,10 @@ struct wcn36xx_hal_ns_offload_params { /* slot index for this offload */ u32 slot_index; u8 bss_index; -}; +} __packed; struct wcn36xx_hal_host_offload_req { - u8 offload_Type; + u8 offload_type; /* enable or disable */ u8 enable; @@ -3499,13 +3499,13 @@ struct wcn36xx_hal_host_offload_req { u8 host_ipv4_addr[4]; u8 host_ipv6_addr[WCN36XX_HAL_IPV6_ADDR_LEN]; } u; -}; +} __packed; struct wcn36xx_hal_host_offload_req_msg { struct wcn36xx_hal_msg_header header; struct wcn36xx_hal_host_offload_req host_offload_params; struct wcn36xx_hal_ns_offload_params ns_offload_params; -}; +} __packed; /* Packet Types. */ #define WCN36XX_HAL_KEEP_ALIVE_NULL_PKT 1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index c0c1ea18864f..f95103706100 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1117,11 +1117,13 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) vif_priv = wcn36xx_vif_to_priv(vif); if (!vif_priv->sta_assoc) goto out; + ret = wcn36xx_smd_arp_offload(wcn, vif, true); + if (ret) + goto out; ret = wcn36xx_smd_set_power_params(wcn, true); } out: mutex_unlock(&wcn->conf_mutex); - return ret; } @@ -1142,6 +1144,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) goto out; wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_arp_offload(wcn, vif, false); } out: mutex_unlock(&wcn->conf_mutex); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index d0c3a1557e8d..478e363610e1 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2756,6 +2756,43 @@ int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn, return ret; } +int wcn36xx_smd_arp_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; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_OFFLOAD_REQ); + msg_body.host_offload_params.offload_type = + WCN36XX_HAL_IPV4_ARP_REPLY_OFFLOAD; + if (enable) { + msg_body.host_offload_params.enable = + WCN36XX_HAL_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE; + memcpy(&msg_body.host_offload_params.u, + &vif->bss_conf.arp_addr_list[0], sizeof(__be32)); + } + msg_body.ns_offload_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; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -2804,6 +2841,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_8023_MULTICAST_LIST_RSP: case WCN36XX_HAL_START_SCAN_OFFLOAD_RSP: case WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP: + case WCN36XX_HAL_HOST_OFFLOAD_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 462860572e1f..6492a628ea6a 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -146,4 +146,8 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, int wcn36xx_smd_set_mc_list(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct wcn36xx_hal_rcv_flt_mc_addr_list_type *fp); + +int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable); + #endif /* _SMD_H_ */ From patchwork Mon Mar 15 12:09:29 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: 400403 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356553jai; Mon, 15 Mar 2021 05:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtFP353vVtnIZc/D4/PS91dLbopsh9eExkHKzrKVpA7zPHv+EshuljfayPQf/7EFS1CvVe X-Received: by 2002:adf:f083:: with SMTP id n3mr26370354wro.134.1615810150423; Mon, 15 Mar 2021 05:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810150; cv=none; d=google.com; s=arc-20160816; b=G0mrExqdMPUhH3t0mC0xGLMQ9QxcmvoPchSHvmO7X55Kawt6ui/DsCzH2oxh1wXsYR PCvNvlDLHCDMlCGUHhxLZ/jX9cvCtPYPqKizRtFK9quBfJsPtibvfyvUqy/l+9SxMzzr CX6fnrg1nDLOZgKBrCauLRFrDh+bHSg8s9EGav7hlW3kEzl6gQOuHaBb6Du3QUzVwY+H SsOYDK0RFy63CbBchnwCwg79yrhS8wfK/IJezI7n06KcSJdAxcZ+DxFctTdn3c9d+Uqi EfMi6wjwpjlSkgki0FBLqh9S5yHNPbu+BT1QRquoUZ/EQQObJDRlB25RTqGdlXt6qmcY 6SXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PK1ysPzp6vM3CYkwLCzyPDUUfmW5NdD9G7dghbyOwwQ=; b=Pm0dEfBaRRppEKJFXcPs3HvMqbFthO0h3XsNbERMefAWgT5UFx1dfqyZXlSTinltjn 5A2QUTMXPj6vc1sRQuFMHWsHj5oKMvRQilrI9gL6WBuLDAPVsKpsTgjJe+sJWKSml8h1 dxKdeKzLU7EPr5cvW+cb6E0usN9NElpMD2+pBd24RKoWI+Oegi1iLvPkQaU5K/r/D7Qp G1zO5oFUdqvH0Pvx/jzoHKojldux3t02o7T/ZdIVLEb2MuHj2JSvwvD6nK3r/o2/Mrt0 TLamLZ7R+o9r/1dntRv3tFJT7xXwtzaNGB6FhE275uTdBQ8aTa5Eypy8/+qGbyqiYSj1 bOzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dn2aLoSl; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.10; Mon, 15 Mar 2021 05:09:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dn2aLoSl; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231131AbhCOMIi (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230453AbhCOMIO (ORCPT ); Mon, 15 Mar 2021 08:08:14 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D33DAC061574 for ; Mon, 15 Mar 2021 05:08:13 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id g8so7978021wmd.4 for ; Mon, 15 Mar 2021 05:08:13 -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=PK1ysPzp6vM3CYkwLCzyPDUUfmW5NdD9G7dghbyOwwQ=; b=Dn2aLoSlYFaM1HqnkLdAGbnG612XxzqF/xX71Q5KWCoYaQx4klRO6lfxideNihhAgO ltim+K8CNj1Qa1daR7Vt2rvE9vx7OwOxiRruuRO5Oqrg6ARbdnzYQcsT90hJPaI93MR4 7MUGfI8A4ni3dEOlQbszOkGKD3EY+f68/18Ggr5XGn4tlSIdyM1IhK+hQnWqz7Uqmo6A oITYXD3/BztB8ge/QFeqcJ0VOZCQ4INi9ApBx+sFRQpWs0TXs0gYrX5gMx0Imb33ENCW buFIkYEEmcK+Q9ACDHFB/k7mRMdo8if11bNGcL6zDFn3BndMeSUH0RbjrK+SG6539Ghu mbeQ== 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=PK1ysPzp6vM3CYkwLCzyPDUUfmW5NdD9G7dghbyOwwQ=; b=Xfpm68dIDSmXhH1nReKasabeXJaCaO8wCMrrmIyxn01nIXuJ/JIzw1hzoBfh9gmWK3 Mfd7tv1pDM5byLdspCu4M6qKGxAZYKG3sr+VDKLflIdCh8GTnBvrVVF7QNdyJOW+aQvS Vh+7h1mb9t2bKmc49QiFby0tRgfCKSw9D0oOvEDTkymB1LlnJsa2ONdx4MXyHL6Pvvps zU4k+zj7yQuKpWn8f8m7M1lApqEVkJapLEXYP3538P0/bLqEgAMsGVe4aJ0a1kL0aSm8 REQVqXEZDigXk1paTPjVD+ZXVFik6SAiPr2v/uJqPXZwND2YSyWq0/OTLoFRwxzuWa5k fXUw== X-Gm-Message-State: AOAM5321ljHP4yvfyJ75OOjEgyx0GV08E7h47cSrVznD9z0XDVgGVAtk uVDLcFWbQUvGuebK2GCSXzmhVg== X-Received: by 2002:a1c:195:: with SMTP id 143mr26052009wmb.147.1615810092491; Mon, 15 Mar 2021 05:08:12 -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 c18sm29239891wmk.0.2021.03.15.05.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:12 -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 v2 04/12] wcn36xx: Do not flush indication queue on suspend/resume Date: Mon, 15 Mar 2021 12:09:29 +0000 Message-Id: <20210315120937.2512341-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Testing on Android reveals that the flush on both suspend and resume of the firmware indication work-queue can stall indefinitely. Given this code path doesn't appear to have been exercised up until now, removing this flush to unblock this situation. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 2 -- 1 file changed, 2 deletions(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index f95103706100..029c9952b4fb 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1110,7 +1110,6 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) wcn36xx_dbg(WCN36XX_DBG_MAC, "mac suspend\n"); - flush_workqueue(wcn->hal_ind_wq); mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_vif(wcn); if (vif) { @@ -1135,7 +1134,6 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) wcn36xx_dbg(WCN36XX_DBG_MAC, "mac resume\n"); - flush_workqueue(wcn->hal_ind_wq); mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_vif(wcn); if (vif) { From patchwork Mon Mar 15 12:09:30 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: 400405 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356581jai; Mon, 15 Mar 2021 05:09:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytnNxjSxVNwNEvullu42Q4o577HLQeR/xOonxhxCpVTe68xgvMbLRUn13bQkebWr8CxAj3 X-Received: by 2002:a05:600c:4ba2:: with SMTP id e34mr25717442wmp.121.1615810151546; Mon, 15 Mar 2021 05:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810151; cv=none; d=google.com; s=arc-20160816; b=f63R0QO8L6I52/hStHYCFdb0s64cOrU/8JGBcG7XF+HEJt4jP7PGamiEvG/lPm8vJ1 VXd4SKy1HIEeFrbr29ecxXvvKGBpjJcXO3ZRL5kmkI9D0W7uZmIpX2PR90No9hPTBAfN HSydUQ/rQY/TIT1plUME6N+hdKMKFVBidRnkhT6jeHnQuYgrx8PMv8DS9zsLjzy1ZTuw UB6CICG+mZ+KhYTzZzmw3vuqBaLm+x9dSZRzMBRE3ljNkLEC6f7uZG1bhzvX/fImIbV/ tsDw0bWKLzwfzs6/Yy2ar8Xv2gtkgSfeay+9/UzDny12ulw3KAt8DqUvy+8E/hvc+v34 xYdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hRRlji5EKWlYATK4Q/JjFfGsjamjpBflBNA00LfXmj0=; b=ZD2QO2IczaF6I1/yjr0H4Xv3M4MCVAvDTxZk9XN76Clr5CgvIZqmOg7g6YZPerJfNA 1klfe7mCeylV4JdUD+9uceI4yVSF4wQZXaVfogUqR63jmFLHZ06Ih0G78/ckKUBCtJwh 6zZjb9g/yka5nGeB9G6CLlqFDsysbzyi92OXgt7TX3sFxNONM6p3nGFVK6scQoF8QSDE yTeaU9+qmVHvd4U0z3K4470raX94OFOe5p8QeUjHwdk0zYWOpo4GJ930F2qmAmHwtvc8 lpQiOr3eX1X5jfSOS/PdPmkU7YxgzcEUshWenNhImkbBYODu+UOiXI0DDC+ngCvQtJhE huIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YZqpE03E; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.11; Mon, 15 Mar 2021 05:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YZqpE03E; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231138AbhCOMIj (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbhCOMIP (ORCPT ); Mon, 15 Mar 2021 08:08:15 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C068C061574 for ; Mon, 15 Mar 2021 05:08:15 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id o16so5559958wrn.0 for ; Mon, 15 Mar 2021 05:08:15 -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=YZqpE03EMFC7BQsTcb0yXpV5B+qYqZpLGqtANWl8+aM8Rx/Hh9UZVdKyRFlqeVjoNp 2xXnd7axQW1Bn6oxYCNvJhGyoasnczo2Rn2XvQBd2Gtce38rGq2HFORgJRA5EwNDL9UZ JyvVCYGEWxPLyiORwTLXzE1uv1NgELeDD/TEKDO2WiEEdYBSEc7ncsuGTeMT3yqdl76T Ulx8aHDYWVEYC/ZzA1gFthpkuw7Lw56DciMjh9scBzh9OkNevW5woIh1fSpwq4Pg0eaX dlxlnP0WgIGU3qkoTBcCvwJXPhflwSfjTixsCXd2mJQKF4cJn6+votTU9DYWA9F2PBxB +KsA== 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=qehp+XUdZL1Qfu8Gvuih/hneXY6zCH4vVTfcWnSBzleXu7ryhtgS5WhA32UvrxAfXG LIL8gKiphgER8ta2umGYpgmnSlopIG0y9LmUaTmU1wtlVQ6N06GF9BHklb57ANWRWpiN y5TsEUAPJr+9Uq9p0B0Qgd0XJFpJzIFUSQoUWaVCqB3NX2mkIVMxk3zAR24zPmXMNNa/ XaugYEvMXuP5/WWMUeKGxJs3btHoW57h+mRZIM88ZwQbg6Poeewnf1Zo73F7KX9L1sO4 ejrn4mMHLbSUVghxVZqEQMCSfkUqFhiVY6psaI0mf/NJ7esc9jyU33E2XusEgCuUvHba 3xjg== X-Gm-Message-State: AOAM533h8AfsLCj0MJHWac6rO59R6NEkpZ89Tl0V+JJutyZDjRb1KPN0 95ucIwtyKY6bf3tkdiA7/WMgrQ== X-Received: by 2002:adf:ffc8:: with SMTP id x8mr26760500wrs.384.1615810093799; Mon, 15 Mar 2021 05:08:13 -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 c18sm29239891wmk.0.2021.03.15.05.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:13 -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 v2 05/12] wcn36xx: Add ipv6 address tracking Date: Mon, 15 Mar 2021 12:09:30 +0000 Message-Id: <20210315120937.2512341-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 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; }; From patchwork Mon Mar 15 12:09:31 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: 400406 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356587jai; Mon, 15 Mar 2021 05:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpEVOs5SdUEa3aGo+/ARXXIUuuADlaSrn+3OxDEgva+GleU4nCB16TUTZO+ijQuJDxaKHz X-Received: by 2002:a5d:4b50:: with SMTP id w16mr26268193wrs.34.1615810151970; Mon, 15 Mar 2021 05:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810151; cv=none; d=google.com; s=arc-20160816; b=gbs3khzon9tMgLBjkSRy4+edrjTWmTcCEL5dAEGfZ3LOl2GLEDBjvo1ACeWdJ3nXKN I2NATjDWjuMkYaPPl2t6E/vXdJ9q0V2KHeRUYktHM53dSAFaav63TScXOnDaunXKcM1F XRtq/SZA4zII5NOQb+uEWTTLIBmr2VfCXCrs3xRUV4KAKfaZBQYX6NSahb9YS+xx8XIE t2akki96jKdR+on3vUVRxvwOlIZDBBMV2l0Yp+0jVdzQqmXtlEanvcQzCqjPT2bqD/th jNfWv2v6IYqsbsZnPGEJNqb3+gG2jfwSgyqPLj9tOpZvhVtNXgbeBDtY9MNWaow+AdXM 90aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6qutEc60H9wCR07iM9g6HgTz+6eNxuy1VbVCy8wFcL8=; b=rGeLlU7pHgWSbRho56Z8eHTJpnJftG6YEctv0vH1372pX3UeOhDt0w4VQ8UBHB/AaK jA+8YIXPuQRH8EaHOBTzw0VSsm6KwVTMcGNOlCmuSxf8ckfnRQq2vyexhZsOnqGdyvzF XILXOlhri/mbla2P9MO3LTvy8RM3d1NfrDWMtyMhgkwyV9YtQC3+gmB15R9iCy6aXCmH m5Ymj3wm6vayj95sKCT9Qm3CIB6wf97etqMGqtn23SendHqTYATgzs5shsSPLd+IcJoa 2/aRJX0dqRQ1EKVhZpNqJ/9Kv+55aV9b6CdmwNbTlc/6F5qL+5J+Xbhtv878WE7gUp+2 V/8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lVWFkG4C; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.11; Mon, 15 Mar 2021 05:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lVWFkG4C; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231150AbhCOMIl (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbhCOMIQ (ORCPT ); Mon, 15 Mar 2021 08:08:16 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43DEBC061574 for ; Mon, 15 Mar 2021 05:08:16 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id k8so5556790wrc.3 for ; Mon, 15 Mar 2021 05:08:16 -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=6qutEc60H9wCR07iM9g6HgTz+6eNxuy1VbVCy8wFcL8=; b=lVWFkG4CtrWtruhRHf33z0oTGi0K1eL2DuynyWjiDZkzfuZfd9q7fxwU+qk7hGkSIu 8zOvcenVXhb8fPpITB/iMmJMbsydw9R5n7/Re4sS0IfDYxYej3DnS79bTKqzvFa0d0HF dCzPOhwtXETIltpRCn6tEhN9Z5f950nBUrbU87k78WrkvgalHjRzSBBKqYssUhLkBeQu nUZXANVEYuTtCZglAumrx8M8BQWDNrmT8vHbIitAhNnjGLDW0kK88xNF0P3FusB0sXh+ shaPdFfc+hkBhw9b9B6ZrrhXOS1tTilnL28vCtxSdr3OeQH/6y29kkbXOmc6cJ3jPUSg nEUg== 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=6qutEc60H9wCR07iM9g6HgTz+6eNxuy1VbVCy8wFcL8=; b=MbuD0aKWdTm8ihsWJfeIQXrM85cFOpxr+b++tgUHnzquEWb1Xni9Z2/h6C6S3zsRVc 4MsCrOv0mYeUVz5m8c9mQqJk5ygfk/XwAirCERFWPU9kQYZJsGbB87oz7M8aLDKwOruA RZ6plzZbGLbwr83JQEwqsAED3vnoVSG2GLC6dQ2o4HNupEYxeFH+HQZxmZVZM1wDqFo6 Rpjw55OqS8nFXmqR32uhw5WZpDqhiq2fY2GI2UVuPjC4EugGCDzw2tdAPqW510wyQ57W MbQYFOL8qUQkj3KVnOftrIVJXswYEIQ2nO6ZWUZM9GUxdXvfBsauL5mWU6XUTZa4lUCJ xM3w== X-Gm-Message-State: AOAM533/jZj6OzGLkddlsouxePf+9LT2K7IaHkKvZRdgl2hd+WLOb8Oc +A4LIe2zcwvj//grp4dox+oSLQ== X-Received: by 2002:adf:a1d8:: with SMTP id v24mr26212887wrv.378.1615810094932; Mon, 15 Mar 2021 05:08:14 -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 c18sm29239891wmk.0.2021.03.15.05.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:14 -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 v2 06/12] wcn36xx: Add ipv6 namespace offload in suspend Date: Mon, 15 Mar 2021 12:09:31 +0000 Message-Id: <20210315120937.2512341-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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. 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 | 55 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 3 ++ 4 files changed, 65 insertions(+) -- 2.30.1 Reported-by: kernel test robot 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..c3095d800c32 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2793,6 +2793,61 @@ int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +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; +} + 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_ */ From patchwork Mon Mar 15 12:09:32 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: 400408 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356607jai; Mon, 15 Mar 2021 05:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf1CRtklUDMBpq8oK3otfEGnAxuNez9ePf8onLU/OgL0SE3zEvR3jc/ifM+o5eq2qeXXe5 X-Received: by 2002:a5d:4002:: with SMTP id n2mr27488907wrp.148.1615810152817; Mon, 15 Mar 2021 05:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810152; cv=none; d=google.com; s=arc-20160816; b=fio3GQfAOOfKHBSLeOIF2pAMeIyvV+1Vdk9Aym4Phd0H0FjVexKuIfW95Wsxjby74G yKGasjp+W6Z+xVA93ENqItnDYyfES1JUxVa8G82H5v62R3F2lTVDSMZPqFrQ4XSqXU3S xfj/36AjahwJZL5p2jyMqOGtY6ibDq1q/eZUWebxjXUiq9euy/YJ2Vwe7escCi0wpYTS LBAn965P2wfRNmLBN+v9Ybh/E0Nivknzqx+w0B/idtxWkZJ9YzUFUS6qftD6NthfrAsf nqgh+QikRgrCuEwSqR89Mjg4/Yb9GxSHkRG3TTNgijG7iE2TGVV6DlTy4oS8FJ0bmB10 aaDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=myI1fQBtftwmddT3Z8jSGa9/PtOPEyQd6+p8HuZB9bg=; b=wKtQFGV9PMY9syGr9tSuRoHgpQxPGEKvYV/WeVExdGHWbezHPDhUeA6tnJ5IjhDpC2 xz+L17ftNNSPkDAGJW91QR8BfgGZlzlTb2EMwzshmNRaeHL2D/tkpybo2nnpB6e0+3vd QJblhah54mA+AdWfTHf9pnDsN19MEg+OftanDtcxepor95zbU2Npt2llIRJ7tCXEQp60 V+IpCP94ol67EWLCouWjWUIVBZVZTmGmYoUU55dmlfuOBZ0ai3aTUg5vwMX9+Tm+081+ XylALlVeeBZ2mcCHyATWItWFBwWWlDNbsSRRKhZLDIjH5aIgKuw58loxQOotbdwueZJy hPkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FaGEdBtC; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.12; Mon, 15 Mar 2021 05:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FaGEdBtC; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231164AbhCOMIn (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230455AbhCOMIR (ORCPT ); Mon, 15 Mar 2021 08:08:17 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A1BBC061574 for ; Mon, 15 Mar 2021 05:08:17 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id v4so5563719wrp.13 for ; Mon, 15 Mar 2021 05:08:17 -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=FaGEdBtCOwGt2P+UfQLoPfJ2euzcbontoAyFJSSt3H5hzLEpRyZVygMuC0Zhp+fhsA 6lanCSlEmUgjNaK3Vts/UTVixXpQNLUk1zAs5QK0TZPh0kra+KSjPHs8Qz0JKoi23b0U cdLRSmSxNggMqEI8EoD3AD7pxS11VsXM3fu7uGIA3pheXJTOAyxW8O1niZr4Eo8GGRWA ZNBKwLgvqtY+U10ru+hhgbm3maAB6V1/R1yYfP3mbiQQSwa3eqAuz4L7Wz+pWX2g5mqI r7Q2bk1FJiq/M8swSgXFqxe05kVtDbT2VwF/ytq5FDQfXkeTydEOXmxxPUlGXD9JOe53 ZFTQ== 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=N/mdMp6GEIAZ5/s4002CQt546/0rguSHDwJ6UlYqw1J+rbkTy6NgOghAhXCEkdYTLd 1RQ6ZAetCY8K1s38sJrI1JJhWYY/+yygD0i5dqMjm1AtkdDE38rb3Gzt/V1KZPJ/S1uY hnDDHRoGxEIl1MjNY/4cr9a/eLn65WoU2YOWd0SDBfCbD77aDWHcQAS9ixpRhqnpIuwn Jl1NgUi2lz3QxetOreOsJ42fINR3yGZE5D1QTLJt5XHuJDYPhPWh9HfiBRKg0HOZ4YXW S0sOKltNDOGzmxJUxyTC+gJF1h8Xmuc4Liz0M2hPFTsSbS8QgEbNzZP7G3oN1rw2g+7k aXPg== X-Gm-Message-State: AOAM532TSyqyZHsyCdp2iWdXGvZX26ItQQI1ojXaAdx21BPgcARt2iGw R32+dhMmxu/kZJSZHpzba6UkvQ== X-Received: by 2002:adf:e60e:: with SMTP id p14mr27058883wrm.221.1615810096189; Mon, 15 Mar 2021 05:08:16 -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 c18sm29239891wmk.0.2021.03.15.05.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:15 -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 v2 07/12] wcn36xx: Add set_rekey_data callback Date: Mon, 15 Mar 2021 12:09:32 +0000 Message-Id: <20210315120937.2512341-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 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; }; From patchwork Mon Mar 15 12:09:33 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: 400407 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356596jai; Mon, 15 Mar 2021 05:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/PrWfJWj3eSaIN0uQwhCyV2oc7ljR26MpVkLN/Y0fCwZAZWWAq16Diy6Z1VALVC/D4l8P X-Received: by 2002:a7b:c214:: with SMTP id x20mr25827790wmi.186.1615810152392; Mon, 15 Mar 2021 05:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810152; cv=none; d=google.com; s=arc-20160816; b=wqcUDE2ZjRu+7lsFjLE6+sT+gvSblukMhkNknGUn5j47bZg7QQ2x0tvMz5ztu8xxof WEr2KUx+oc7AXi1ANSKMSG53ZRdIC+s2ly9CGMX3CXROtt1/En07tG6K6SpuJQ0rlW70 BJNYnxXKD1rU7gXYeN0W/8m23DV0CHy0H1xbXengRLr/dGSxdrOZpL8hoDZkymfIllEf J93oOzSmXHSW/k9sXkVs6w6nKncvtg5TofECM9NEStKkiVsa3NdFrE4kFmQqQUb6hWNO FUDQyysTnRTWN/C1w6jku5UzebkYGYl3vwS/wZ7K4K8iSBFoG2sx6Q6AUV9yCFQJPk9e YQJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gxxDO1NJ8u6G4hS3KD+56T8rWCBlJMNlPkegzoBkaT0=; b=Jmbfvex/vOCSHv5Yy7Zn6Fs5I64dFru5j/B6GpHmkR6tQ7BvSqwS2f+/vepRvRTeV3 tL0vGtDu0HD17/V1jqiJtqemTlf6HbfpYJZWr9B1UVnfw0QVcixppd7cMC4EZSXcXiha 6eaX/IJTwiBjy/bAd9df044ngFf8QxOaUlZdm8TsP4uMsVtHQRVWcObqMD5Hfqvrh9JZ AwrWlxGVeMUUd/iX/g/mchHo9zw09J0Ajx0jqt9c9er4vjHb9s8CrDxjvLvn/hlVdf/N H41CjL+/bhPOrewS7pYX7xPzykKam2j+a7zU1/YD8hpmNZqeF7wpH5SQ37oz0iigG4DL S+Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MKhERGu2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.12; Mon, 15 Mar 2021 05:09:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MKhERGu2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbhCOMIn (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbhCOMIS (ORCPT ); Mon, 15 Mar 2021 08:08:18 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D89EC061574 for ; Mon, 15 Mar 2021 05:08:18 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id v11so5561440wro.7 for ; Mon, 15 Mar 2021 05:08:18 -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=gxxDO1NJ8u6G4hS3KD+56T8rWCBlJMNlPkegzoBkaT0=; b=MKhERGu2EsTCYzKCc5r6ZhvW0Oaepfw9gJeqV7i5zekg2QXNT8zs3q3srYgIfbn9GD 9vnTiGYz/6xrskVEzMEJgra9W8jD+6FLwFvxt6sks70Rd73lWYEoTCesgTJdT5nZIQq+ 8XR2IEahoxpzSGbctEi5TbvU0MqbCzQW69W2mgcHR91ev1qoLv0A5yKJhodAXes1iBVg BtkvKM6xaae3f8CZUApVi2hxFNUOCUyc7vXX7Wec7zkiKXxEsjdHro1MgOjSLPJaO0Fo IQaBeie9ZMeNN+ExdxBMlTGi7gmZhzBHhsPLezGo7ZlGxTk8LugYQLQK7ayyPG9aIxkv 7tkA== 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=gxxDO1NJ8u6G4hS3KD+56T8rWCBlJMNlPkegzoBkaT0=; b=me/Nys+vqMppCz6pItSe9cPQ7sPrqVq3xO/JH3zRL6SV4HxXWYUkMVmEo7tGc1xFEK hJCHjj2dWYlQuaBu7zHz2kpKiuqWFF9Pi0YohiwPUWAn/D0qU3VcQFVS28lZe8HJTDgl ksi1tYpPZTsuRoMkGLJUith54y819GbemsMTXywMPYsuY/zUj8gsqCzIY3oX4si/dvaB +HKqwxznD6L4fWTXF/25gJrhtmGYxq78sJLzqus4gy8Re2wKd3xOYUCWKUDtUwTQQzZE 9LK/cYJnQGIlGhPixrcOjbTTHM2JoqEUGIQs7tcapeboC3frHIgg+9RUtNq08wDp5YO2 QvbQ== X-Gm-Message-State: AOAM532IOgRnXf/cb/l9hNO0K7X1+YNB9fUOJeOnksB5sUxyO3YMbYL0 2kjHKejWy4mdkI4FgUIB5rdjNA== X-Received: by 2002:a5d:424c:: with SMTP id s12mr27641213wrr.161.1615810097236; Mon, 15 Mar 2021 05:08:17 -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 c18sm29239891wmk.0.2021.03.15.05.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:16 -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 v2 08/12] wcn36xx: Add GTK offload to WoWLAN path Date: Mon, 15 Mar 2021 12:09:33 +0000 Message-Id: <20210315120937.2512341-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Using previously set GTK KCK and KEK material this commit adds GTK rekeying to the WoWLAN suspend/resume path. A small error in the packing of the up to now unused command structure is fixed as we go. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 2 +- drivers/net/wireless/ath/wcn36xx/main.c | 4 +++ drivers/net/wireless/ath/wcn36xx/smd.c | 38 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 3 ++ 4 files changed, 46 insertions(+), 1 deletion(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 3b949b0b3792..1f3c2e840232 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -4905,7 +4905,7 @@ struct wcn36xx_hal_gtk_offload_req_msg { u64 key_replay_counter; u8 bss_index; -}; +} __packed; struct wcn36xx_hal_gtk_offload_rsp_msg { struct wcn36xx_hal_msg_header header; diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 6b0deed23c5a..a138b84d0aec 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1121,6 +1121,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) if (ret) goto out; ret = wcn36xx_smd_ipv6_ns_offload(wcn, vif, true); + if (ret) + goto out; + ret = wcn36xx_smd_gtk_offload(wcn, vif, true); if (ret) goto out; ret = wcn36xx_smd_set_power_params(wcn, true); @@ -1146,6 +1149,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) goto out; wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_gtk_offload(wcn, vif, false); wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); } diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index c3095d800c32..c3e384803141 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2848,6 +2848,43 @@ int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_gtk_offload_req_msg msg_body; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_GTK_OFFLOAD_REQ); + + if (enable) { + memcpy(&msg_body.kek, vif_priv->rekey_data.kek, NL80211_KEK_LEN); + memcpy(&msg_body.kck, vif_priv->rekey_data.kck, NL80211_KCK_LEN); + msg_body.key_replay_counter = vif_priv->rekey_data.replay_ctr; + msg_body.bss_index = vif_priv->bss_index; + } else { + msg_body.flags = WCN36XX_HAL_GTK_OFFLOAD_FLAGS_DISABLE; + } + + 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; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -2897,6 +2934,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_START_SCAN_OFFLOAD_RSP: case WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP: case WCN36XX_HAL_HOST_OFFLOAD_RSP: + case WCN36XX_HAL_GTK_OFFLOAD_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index e03ab7878432..cdf4231efe26 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -153,4 +153,7 @@ int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, bool enable); +int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable); + #endif /* _SMD_H_ */ From patchwork Mon Mar 15 12:09:34 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: 400411 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356675jai; Mon, 15 Mar 2021 05:09:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeY9k7V9ry/X/Pb452L7OkCHZC0OAa1U+KAIieRHLmzyH7eec+mXkPtnlrTlmg2Kr+c0et X-Received: by 2002:a1c:7415:: with SMTP id p21mr26083867wmc.187.1615810154972; Mon, 15 Mar 2021 05:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810154; cv=none; d=google.com; s=arc-20160816; b=HjntoK/uTuVlIXY4uBsbu4ZWXl7sQqt27mM4JBbuX1HTwHaNAnASSQf1S7sW07rWpf GHcoihpOj/KpNecBxjDY5noLHthpLEYxia8JW1bUI/Ziv8hV/AisquVuLRASgXcnJOnd a+Lg/1Nv816LpMDPQB5sPjUDBUrbto17hF9ryMbqm/deVSkX/gSe1+YVviSOs8HoO90s VwjyC+3VR2TrLrksOqPhzV6OjXNS+3FWa36b7WHcyzl8QUC5wzu9iXAtSQSSv1iCXr/g /YU1E3BSEZPmjAN68k0khlQj2ZJVHzEPrwkkLYCFW/Ph21suiTXYI83v4Oe6SmICiGhW M8Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M+2k43GlohQyEEjWyLFfl9zhuXIM/JV216tEQnXkr3c=; b=DDURHS9gZYX1kd2MM5EZw80fKnqLayKSuqKpWMukE0qX3ZkBaH8NFm1sZbJS/Kv27s dsKDM96Z5HoRZpJQY9Y2m/ebga/Q2aFRuQVQ6ujjlvTuV7gy+c5rUQXoajBd/OYYffcr wbFiQ3UFQ37o7W5iB7tTR+N1r6raTA+SO85W8fc5qi9lFVHLJ6vIn1Fw0WmmEkaju2uB 94Ohn4YPxTCkFHTrx1zE5kCyaQPbrQq94ZIebPtoGvU8gFu5kIEoorLCBQBp1f86nBXf hyTDsNjxRljNBxyLwWQ+jxXKqfIUxu4/MZV4kYtxLSspk4oAIT4A3y6qgYrGQt1cu5pe mfag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qsCCd5/w"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.14; Mon, 15 Mar 2021 05:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qsCCd5/w"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231172AbhCOMIo (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230457AbhCOMIU (ORCPT ); Mon, 15 Mar 2021 08:08:20 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A277C061574 for ; Mon, 15 Mar 2021 05:08:19 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id j2so8539905wrx.9 for ; Mon, 15 Mar 2021 05:08:19 -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=M+2k43GlohQyEEjWyLFfl9zhuXIM/JV216tEQnXkr3c=; b=qsCCd5/w2qa9aPQxKdSYxAW8VueU/zTY1aV0pC1xA2cmHNR0KXfBH7XFCjv3FHlcMP fXmHxObrZsWEyHpRHm/UyNP/uIB74S5y1v+/QGErtf3q6NDRZ+5DiVbj1/LkoL4KixYf C4JGDEGUsFs0xGD0czwrbwJzP5jDFuC4fOKA3fjI+3010VR7uC482ijE/9Qb8qUw+wAr KBHbKZyx1FpkJBUAJZZdOxYCOS0w/Lk2YszK2FN0aNls4UN6m+naNqsioGzKmw8tK+Z9 EVKv+zBCvWV0BzWgxI93/VoYYxil4Vu7hLm+CPUx0X9vrcla/C/p3uk45cUwlfr79h5y QOfw== 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=M+2k43GlohQyEEjWyLFfl9zhuXIM/JV216tEQnXkr3c=; b=cIn2rDP6YC7TYEwpDQ4PtGQ3OAjZXFYyMhwngiPoacL+PniDYz5O08kOEGIkljK5p5 bhNeF8Sg4FFVnUVeCcGEQTTPDOH9hsi1WDCCsHtGRh43JK6fIzCj8be9sQabbXtqSQuJ lF9oI4hf6zdiU7eEeuBge22BAjaVUlwvBieC0/C0i8NZFcYqA3WBFU9T1Kee4wu1+uQJ 9MDQXR/OyLIAKLTzbOtua20DwLln68jKdM7cH2gCdSU6xMmBMqsmkX4o1qxRDIhZRDBO eJx7XBJedBuQubASo9D186vwlgMkfpZF1OghTxaacIgjYhJJaX+4oTYx628cX5dQx6Dq gDaA== X-Gm-Message-State: AOAM530k/CcpLhGt6+//V46EotRikGkQhvhlMuf48TDO+dOvG/j30xbT sZT4ZkFJCJqYnmQZtpNQ0x54+79WLHoo8ZXh X-Received: by 2002:adf:e5cf:: with SMTP id a15mr26409527wrn.226.1615810098384; Mon, 15 Mar 2021 05:08:18 -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 c18sm29239891wmk.0.2021.03.15.05.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:17 -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 v2 09/12] wcn36xx: Add GTK offload info to WoWLAN resume Date: Mon, 15 Mar 2021 12:09:34 +0000 Message-Id: <20210315120937.2512341-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Having enabled GTK rekey in suspend, we need to extract the replay counter from the firmware on resume and perform a ieee80211_gtk_rekey_notify() so that the STA remains verified from the perspective of the AP. In order to enable the SMD command and response we need to pack the existing command/response structures. Given these structures are currently unused, there's no need to backport this as a fix. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 4 +- drivers/net/wireless/ath/wcn36xx/main.c | 1 + drivers/net/wireless/ath/wcn36xx/smd.c | 72 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 3 ++ 4 files changed, 78 insertions(+), 2 deletions(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 1f3c2e840232..455143c4164e 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -4919,7 +4919,7 @@ struct wcn36xx_hal_gtk_offload_rsp_msg { struct wcn36xx_hal_gtk_offload_get_info_req_msg { struct wcn36xx_hal_msg_header header; u8 bss_index; -}; +} __packed; struct wcn36xx_hal_gtk_offload_get_info_rsp_msg { struct wcn36xx_hal_msg_header header; @@ -4943,7 +4943,7 @@ struct wcn36xx_hal_gtk_offload_get_info_rsp_msg { u32 igtk_rekey_count; u8 bss_index; -}; +} __packed; struct dhcp_info { /* Indicates the device mode which indicates about the DHCP activity */ diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index a138b84d0aec..a84128e04cc4 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1149,6 +1149,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) goto out; wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_gtk_offload_get_info(wcn, vif); wcn36xx_smd_gtk_offload(wcn, vif, false); wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index c3e384803141..6064fdef69ac 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2885,6 +2885,77 @@ int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +static int wcn36xx_smd_gtk_offload_get_info_rsp(struct wcn36xx *wcn, + struct ieee80211_vif *vif) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_gtk_offload_get_info_rsp_msg *rsp; + __be64 replay_ctr; + + if (wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len)) + return -EIO; + + rsp = (struct wcn36xx_hal_gtk_offload_get_info_rsp_msg *)wcn->hal_buf; + + if (rsp->bss_index != vif_priv->bss_index) { + wcn36xx_err("gtk_offload_info invalid response bss index %d\n", + rsp->bss_index); + return -ENOENT; + } + + replay_ctr = cpu_to_be64(le64_to_cpu(rsp->key_replay_counter)); + if (vif_priv->rekey_data.replay_ctr != rsp->key_replay_counter) { + vif_priv->rekey_data.replay_ctr = rsp->key_replay_counter; + ieee80211_gtk_rekey_notify(vif, vif->bss_conf.bssid, + (void *)&replay_ctr, GFP_KERNEL); + wcn36xx_dbg(WCN36XX_DBG_HAL, + "GTK replay counter increment %llu\n", + rsp->key_replay_counter); + } + + wcn36xx_dbg(WCN36XX_DBG_HAL, + "gtk offload info status %d last_rekey_status %d " + "replay_counter %llu total_rekey_count %d gtk_rekey_count %d " + "igtk_rekey_count %d bss_index %d\n", + rsp->status, rsp->last_rekey_status, + rsp->key_replay_counter, rsp->total_rekey_count, + rsp->gtk_rekey_count, rsp->igtk_rekey_count, + rsp->bss_index); + + return 0; +} + +int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, + struct ieee80211_vif *vif) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_gtk_offload_get_info_req_msg msg_body; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_GTK_OFFLOAD_GETINFO_REQ); + + msg_body.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 gtk_offload_get_info failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("gtk_offload_get_info failed err=%d\n", ret); + goto out; + } + ret = wcn36xx_smd_gtk_offload_get_info_rsp(wcn, vif); +out: + mutex_unlock(&wcn->hal_mutex); + return ret; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -2935,6 +3006,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP: case WCN36XX_HAL_HOST_OFFLOAD_RSP: case WCN36XX_HAL_GTK_OFFLOAD_RSP: + case WCN36XX_HAL_GTK_OFFLOAD_GETINFO_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index cdf4231efe26..90c7faea0ef6 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -156,4 +156,7 @@ int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, bool enable); +int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, + struct ieee80211_vif *vif); + #endif /* _SMD_H_ */ From patchwork Mon Mar 15 12:09:35 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: 400410 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356659jai; Mon, 15 Mar 2021 05:09:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoX+enybY1jq2/FxayHiNGc7fp+lmD1uYr3RQoIMMT8iID4uhNhVwoxV6Dt0GPq/mJSPgw X-Received: by 2002:a1c:17:: with SMTP id 23mr25819960wma.6.1615810154549; Mon, 15 Mar 2021 05:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810154; cv=none; d=google.com; s=arc-20160816; b=KOq4SITIH2aWg5syIrHIY1ZO6mi+75MDgpzK2WXFObO4LamsXzvloNTyaprEn5ThIt ogMqmpal1EQugnW6UCdlC4Q6BQ9b3lV6Xh4kQX646M+SktpcQENCBDn6MnDtZkbT0jEP 06I+Jn5J7OxIj5FZKv4OvTMR0wiQG5hWQfdc7ZrEwqG8DozdFhSIH3DNJc1Bg4IGH0Ve wbOcGSMnQBqWJydt5AeSRmnU4lcaequCd0uEbWmd9ydPYFUf3rwFFSi4hEApM5ypaI5k Em73HVZ+/2a3vdQc0obhdvmQP4iUOtZIz9a2w2U7YSF+P+9bImQx3Etur7W2NbgnuEb5 d/vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ONHI2fbjYbzj5/3JjsXCEhoFBnrzZ23MWIBVbw21Y74=; b=y+I6PO45eoauZ1t+g+za/MQbo3dmEiR0Zfmi1vyzfFPPiKJeJIDN8Q4kedm+QVc8ei htl4G8Ds2w1rxmxF2laBAlxKYMjlj+kZ/zVEWHYCoTb8lQPQV1NmnEdbJTjUIuFng4TA JzwjI06WH2BWP2SX7D/kkzU2+KCo6tLFsNbaigMfAlTG7zgnWxIsm6QD31QYSK+z5nym jBOIzg8TkWaaCI8zOVX6Lv3ew84xS0/8ZRxhQsfzujG0cAkk5tu1Fi84bQEFcgM7VICk AKUyQ8pQX6E7Bl/iCE3LYHwAvEw38Mtk7gr1DloQmcNVCdJlIiUBi75mpAqX1/JrJV1S /3MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NZ/Q8ih8"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.14; Mon, 15 Mar 2021 05:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NZ/Q8ih8"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231174AbhCOMIp (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbhCOMIV (ORCPT ); Mon, 15 Mar 2021 08:08:21 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C98F9C061574 for ; Mon, 15 Mar 2021 05:08:20 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id b9so5570767wrt.8 for ; Mon, 15 Mar 2021 05:08:20 -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=ONHI2fbjYbzj5/3JjsXCEhoFBnrzZ23MWIBVbw21Y74=; b=NZ/Q8ih8IXuf5m3Kre++BHd/PI1vVkgmFcOxFjfAtkIj7LMYQP0mw7PeywlPdbUdrM rmX7xLZ7/h6SCrgKiNangiElTGr10No1S5a0VuuwAa4HbNkLb39OIOfyZRd9MHQXPuLK t7YP5hQFztyGpwDSljtgjCUB5o09tq5953LujmVt6710jO3n6ioG36UyEXMZrcoqM45Y twxEBqS0HvQDRX8FfHMQZaw7MgGMx0iax9wXLAA4wYcgVC42JWWbccC1AgqCWRZhus3u MuRHiROvXwKtJfmJJTi1BnnHbjrAlLCT4Q4WO//weaGVZ/Ym2TPQnZ4SmbWPSBBKnMvO G1wg== 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=ONHI2fbjYbzj5/3JjsXCEhoFBnrzZ23MWIBVbw21Y74=; b=j0M6yLSnl8cYR5iUJNM3Vkrg9TVgCC80klsjqbQjEYRlDkrR9cSPOvL/CVS28PoQ0Y LxUuLTItrxdWbg3v3Esuzrq4gQb8DigGQ5gjKCoskIQW3R/Xgah2F5uZr530EMhVkIhy ihqq8zW1lvmbGMYalNuGoNtiDefLO8td7NJcYivmiJFh30uze/ZJA6GmQeEGzk500k+h Hejh/d1r9uMwFn5BPHn20J8gz9EIj7D58y4BwrL6d6rXKR+IxW2FWmsoNIYmNYTMRV4F YN9m+2dfYZBPeH0st+EOZCN7FffdmsAhiLbCmHqirmUK9CuwCex9lgGKA/qq32yI0le7 eBzw== X-Gm-Message-State: AOAM530I402JhWYeaqL8TrM1ylXCfGdLkxOSBScB29hWf9LHcP8fYy/d fp9F40WDap9/J/72m2qqcY1uPw== X-Received: by 2002:a5d:4cc7:: with SMTP id c7mr2243031wrt.164.1615810099476; Mon, 15 Mar 2021 05:08:19 -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 c18sm29239891wmk.0.2021.03.15.05.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:19 -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 v2 10/12] wcn36xx: Add Host suspend indication support Date: Mon, 15 Mar 2021 12:09:35 +0000 Message-Id: <20210315120937.2512341-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In order to activate ipv4 ARP offload, ipv6 NS offload and firmware GTK offload we need to send a unidirectional indication from host to wcn indicating a transition to suspend. Once done, firmware will respond to ARP broadcasts, ipv6 NS lookups and perform GTK rekeys without waking the host. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 3 +++ drivers/net/wireless/ath/wcn36xx/smd.c | 19 +++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 2 ++ 3 files changed, 24 insertions(+) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index a84128e04cc4..535e0d4245c3 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1127,6 +1127,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) if (ret) goto out; ret = wcn36xx_smd_set_power_params(wcn, true); + if (ret) + goto out; + ret = wcn36xx_smd_wlan_host_suspend_ind(wcn); } out: mutex_unlock(&wcn->conf_mutex); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 6064fdef69ac..dbc5c9902794 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2956,6 +2956,25 @@ int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, return ret; } +int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn) +{ + struct wcn36xx_hal_wlan_host_suspend_ind_msg msg_body; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_SUSPEND_IND); + msg_body.configured_mcst_bcst_filter_setting = 0; + msg_body.active_session_count = 1; + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = rpmsg_send(wcn->smd_channel, wcn->hal_buf, msg_body.header.len); + + mutex_unlock(&wcn->hal_mutex); + + return ret; +} + 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 90c7faea0ef6..2909facdb100 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -159,4 +159,6 @@ int wcn36xx_smd_gtk_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, struct ieee80211_vif *vif); +int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn); + #endif /* _SMD_H_ */ From patchwork Mon Mar 15 12:09:36 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: 400409 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356645jai; Mon, 15 Mar 2021 05:09:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4Ao8YpaXKkCFOXN2iHOEPTO8pNoICDR1StXR0cyt3Fagh3us7leUnKaXVOAsH7zGW+X+R X-Received: by 2002:a05:600c:4f4f:: with SMTP id m15mr25565531wmq.29.1615810154136; Mon, 15 Mar 2021 05:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810154; cv=none; d=google.com; s=arc-20160816; b=xSBUqfYb4hYVU05NFHFpBia2oBOHkx+98uTXHU0oQnt9d+impXv+a2ep7zogq+oDV6 la/jEyat8lqySF1W/6LUjuo8dbZF4NXrNqEXSa79KAoYNOR6X18RpDQ1QwuJnE7UpOsv QK+Hh1LUS8HPzJZ0ufFwOVBebK6XUQNO+r/HPVCV34nrZ7xpO3sVAtrIviu8vLJtNAri jcwUmwMBmFV3980qlJq8rgobQOjgngQN1sxHC81KTKtLKcW+mdNdrfaT+/SeLrHlQ/gO 6Tpb4WDK2iy7aYonMSJSyR2t/vy87ZB6pMr1isVjFCvsG8dv/vZHSW8ojzkmTEiOcqny v8Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bJ1ZueOKyXwKXk4LQeIQW096JlG5XtA4DUY7VcQGNfg=; b=BfF2K9L5dpm7s8RVYRiKGMOAlHRFi0nw/gL45iq+6rxWoFQJ9pWr3RG/cj1B5kzA2y 9dHfC1+SeI27/LqFsbjYF7++kFC4X0hmJ9nE6lKM5BAO9oVBcxyo2d9UCkXCrBT623+I QzcMMgHl+ZmF0J/0YW4oDk1VtMwhMMOm59DwUtV7ufrdnK0oP8wHV7Bg+f1PhlFVJWpe J2j7NixZVdJYt6vwE+4CTHaCzloRSfpwKJlvAL1gOGbbMgAKPqs9LfvHzO4l2JonnqcV 9YujHJ3z+zHDFBDj9W54AGgpWku/vJGzBHuIWha3rWY77nOVHnozW0zZm0wh4H1Z9+YS JDkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qEjK4AR8; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.13; Mon, 15 Mar 2021 05:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qEjK4AR8; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231175AbhCOMIp (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230460AbhCOMIW (ORCPT ); Mon, 15 Mar 2021 08:08:22 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8DB6C061574 for ; Mon, 15 Mar 2021 05:08:21 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id v11so5561543wro.7 for ; Mon, 15 Mar 2021 05:08:21 -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=bJ1ZueOKyXwKXk4LQeIQW096JlG5XtA4DUY7VcQGNfg=; b=qEjK4AR8/bxurzgIl87bjus+vUgq+JYaQbBGFV3crA8jZ6aPYxY+KkHRx5rWG5JljV EF0TJGvunz82xbfyTUSmKGblFnJwB2pTk8Frdwjd8HI0K/vaO/yNdFlY5EjVAihddBca F97AJhE1qwbgiceFNGUFHbUWdAqYUkda/O2OcsCTrP+j+0Xm8uqrb5cYh7bMMtOGIm21 +Y0W6ms5ulzvMt4nQBXHf0j2ZW2bCEICYifNCOlTxHiWEU6UIpm0k+J5u6Dqemz6uqlZ f1ts64W8bNzkQDN/p7Ap/Gy+z5SmTFYq93Drm+JTXC7J4YKK5zXL0LZZ5/eljloDiVOl zX2g== 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=bJ1ZueOKyXwKXk4LQeIQW096JlG5XtA4DUY7VcQGNfg=; b=LWx0KwT0dBd0irAq1nDByOM2TVe15yUHWiX906MAMhBaRPuPTz3jRQoBBVr12cYiHI XXOXQErAqZxhtf7O/V2g8S9DzMVK1QuCxdoBmXHfN01dlRfGeZawC7S483IqFcM07MIK ZWh5ggF2r1ly6vAxZVVbq77yRnZFsYrX1Fku0JgXpUupQQu6h4UDjMM5TSZkt6UT22KM nmvT5srw3hFZs+bBet/BHAVjcwVzJr6on87ong6aSikgMCTiF6+J+qFPSSeExDZoxuOM lEhX/Uu4ThibYIRXFQakxAlaLPeJ028JTS7aQoaPBztDlT7fMYzS/71tqbxkdLOfjRfR 0ZRg== X-Gm-Message-State: AOAM532/aSnaf1aWoFegg9XcNFzLmndTNAOxXMYMHcTkF03x/Yw1gMqT UcG1BIXlVeBk7wbLQVlc65VibQ== X-Received: by 2002:a5d:4686:: with SMTP id u6mr26848364wrq.60.1615810100562; Mon, 15 Mar 2021 05:08:20 -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 c18sm29239891wmk.0.2021.03.15.05.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:20 -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 v2 11/12] wcn36xx: Add host resume request support Date: Mon, 15 Mar 2021 12:09:36 +0000 Message-Id: <20210315120937.2512341-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This commit is the corresponding resume() path request to the firmware when resuming. Unlike the suspend() version which is a unidirectional indication, the resume version is a standard request/response. Once the resume() request completes ipv4 ARP, ipv6 NS and GTK rekey offload stop working and can subsequently be rolled back. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 1 + drivers/net/wireless/ath/wcn36xx/smd.c | 35 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 2 ++ 3 files changed, 38 insertions(+) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 535e0d4245c3..ddfc60e02389 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1151,6 +1151,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) if (!vif_priv->sta_assoc) goto out; + wcn36xx_smd_host_resume(wcn); wcn36xx_smd_set_power_params(wcn, false); wcn36xx_smd_gtk_offload_get_info(wcn, vif); wcn36xx_smd_gtk_offload(wcn, vif, false); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index dbc5c9902794..f222f3d4d5ce 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2975,6 +2975,40 @@ int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn) return ret; } +int wcn36xx_smd_host_resume(struct wcn36xx *wcn) +{ + struct wcn36xx_hal_wlan_host_resume_req_msg msg_body; + struct wcn36xx_hal_host_resume_rsp_msg *rsp; + int ret; + + mutex_lock(&wcn->hal_mutex); + + INIT_HAL_MSG(msg_body, WCN36XX_HAL_HOST_RESUME_REQ); + msg_body.configured_mcst_bcst_filter_setting = 0; + + PREPARE_HAL_BUF(wcn->hal_buf, msg_body); + + ret = wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); + if (ret) { + wcn36xx_err("Sending wlan_host_resume failed\n"); + goto out; + } + ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); + if (ret) { + wcn36xx_err("wlan_host_resume err=%d\n", ret); + goto out; + } + + rsp = (struct wcn36xx_hal_host_resume_rsp_msg *)wcn->hal_buf; + if (rsp->status) + wcn36xx_warn("wlan_host_resume status=%d\n", rsp->status); + +out: + mutex_unlock(&wcn->hal_mutex); + + return ret; +} + int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, void *buf, int len, void *priv, u32 addr) { @@ -3026,6 +3060,7 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev, case WCN36XX_HAL_HOST_OFFLOAD_RSP: case WCN36XX_HAL_GTK_OFFLOAD_RSP: case WCN36XX_HAL_GTK_OFFLOAD_GETINFO_RSP: + case WCN36XX_HAL_HOST_RESUME_RSP: memcpy(wcn->hal_buf, buf, len); wcn->hal_rsp_len = len; complete(&wcn->hal_rsp_compl); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index 2909facdb100..d8bded03945d 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h @@ -161,4 +161,6 @@ int wcn36xx_smd_gtk_offload_get_info(struct wcn36xx *wcn, int wcn36xx_smd_wlan_host_suspend_ind(struct wcn36xx *wcn); +int wcn36xx_smd_host_resume(struct wcn36xx *wcn); + #endif /* _SMD_H_ */ From patchwork Mon Mar 15 12:09:37 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: 400412 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3356687jai; Mon, 15 Mar 2021 05:09:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjmLFIG2gGeSkybR20QMc/03kHHBIQNZrI+xN/SE7dRoqF2iIoLqul9+v6Muk2v1lQMFNj X-Received: by 2002:adf:e791:: with SMTP id n17mr26877197wrm.322.1615810155402; Mon, 15 Mar 2021 05:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615810155; cv=none; d=google.com; s=arc-20160816; b=AGNzMa2EKjFVck9/w163OK1RzQlOoaCp4ziSAl9dZ0PGLquytJnrz+3YBmb4iqf3w5 /2IpSrZX7//z2b3YGD2S9/f81ZbTh15EXe83P2QNDbncPNjyvT+Kwmp3Yyb3jf1w5IDV f4LKXo03sDTQnur1VVy4JYqswqHhXzWybBE16BDK4wlj4xTAjNiIFu0HhP2mzy12tP3v 0DsPLEUw7YDYk9hZU2SsKqb3OhPf/COHo+8nkHQhsuQg4v3BjVcQd5IvoqfY+QkupIgD DyoN7vLuJxkHJiqLXE7bDdTzsAK1bHYAHyGfSMUSsfF2/YXKG0uFmOHT0PhkFdCUwr7L p7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mV90VGp68UpB1XdgClwAqFevTATKxZfnnJBOM1WpO7w=; b=t9LDDOXYOL/qXqJINtDwTgZnpmuqiXqDz4wDlEr7qie8uwhCaWK5zYo6ShWX7SuzKO WS8QD2PwLNM6+OezKVI0G+RT+5PU1+KJyVxzQDRGMBdB7/eZbHMVlFM1GwG/sCYdp+bY 7vGFonZdpdnJIv9GSN9nuT+BXYnKkJflSCbDK3ZR2rTpSd5dcUuSVpNfkvbGpWqqhWRt RXXOs9iLtVhbF7KWJXl8xmT4Wpe5iYTAtY+xFnn145MTB8UB4zKvgz92fovcgQOkZyvG Ja8howtcGuRiCxaOoz10CK+qcs7HGQ7ht9esVRlcASFAo5my+u4lswrZG+OZZHsk72c3 0GxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HsdkJyjK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si9901547wmk.85.2021.03.15.05.09.15; Mon, 15 Mar 2021 05:09:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HsdkJyjK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231176AbhCOMIp (ORCPT + 2 others); Mon, 15 Mar 2021 08:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbhCOMIX (ORCPT ); Mon, 15 Mar 2021 08:08:23 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B14E3C061574 for ; Mon, 15 Mar 2021 05:08:22 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id d15so8557734wrv.5 for ; Mon, 15 Mar 2021 05:08:22 -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=mV90VGp68UpB1XdgClwAqFevTATKxZfnnJBOM1WpO7w=; b=HsdkJyjKapsuHmADj0UbtPuLlN6DGjVY9sKHdYeHUqZLT6jVgdyZ0IZ9uIGuzxUiak z/6kAHWFvJ/TDWTfVIze1TCH9xDZabVLBbUakKvAZrDtA+aMFR+yLhlWf56jx1r408cc H4dAOnY6jpRLr49AKKAKzs2MmL09N/4rfO8M+ZNob9MsUqqDkA1VAp5TXIj8fFEPJuEy CEIYoZ+HrWmJjAsCg600CH7e793rAMSuS1OU0NBEOG3vrd1iM4fo9zvcOT8pyhiTXvjP TDE+BxxaeCvs/+Flb0+BhrYehXVKLVFmMnfi5fSStZiQjhr2iEoIa9MSS+AQ/YBZ3nbM HQWA== 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=mV90VGp68UpB1XdgClwAqFevTATKxZfnnJBOM1WpO7w=; b=PnYfXrHkYiU0fI5Si8rC5NcsgWK9BrUu6e02hs4fZjKor78U/GG3m6uER35UueMsAQ hpI+wO7W34uocfVhc91w7AFEtBSiOJ8yulvBEHBoSGmwy4+y5pdiQC7DdTY+VZu7bbyl 2hCCVeWt9jKUePr4wB2WgSks3TcF+PigRqprr0KyB8bse4ZGVbLEUBOjA3DaGO9537gX CaHljbf+IrwGRFBEpMdmNZx8wxylllc1OZb7PoWgXL2s6owmFd/1zXGvpfSRWGR7HAlc ug3LmbmaK/Y5B4+jtypBh+7dC/snaSSzoIHZ1/ldt+pAUY9esYvDU0RDdp7XFMqZTmNL hjWg== X-Gm-Message-State: AOAM530PJcfKT8XFyKIEVzcmfuWZZrBtPeQ09d1T8qEBBrBeF/H/Krrx LDysnNdZ/LWJ/4lN7oT/3dZ3vA== X-Received: by 2002:adf:f78f:: with SMTP id q15mr26502346wrp.383.1615810101502; Mon, 15 Mar 2021 05:08:21 -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 c18sm29239891wmk.0.2021.03.15.05.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 05:08:21 -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 v2 12/12] wcn36xx: Enable WOWLAN flags Date: Mon, 15 Mar 2021 12:09:37 +0000 Message-Id: <20210315120937.2512341-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> References: <20210315120937.2512341-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Enable flags for - Magic packet - GTK rekey Previous patches implemented the necessary code to switch these two on. Standalone magic packet absent GTK rekey is pretty useless, so it makes sense to flag both at once. Once done it is possible for wcn36xx firmware to 1. Respond to ipv4 and ipv6 ARP/NS lookup requests 2. Bring the system out of suspend when a magic packet is received. Magic in our case is a simple ipv4 or ipv6 unicast. 3. GTK rekey whilst in suspend Once we wake from suspend the GTK will be updated as necessary Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.30.1 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index ddfc60e02389..7838d2056e54 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -173,7 +173,9 @@ static struct ieee80211_supported_band wcn_band_5ghz = { #ifdef CONFIG_PM static const struct wiphy_wowlan_support wowlan_support = { - .flags = WIPHY_WOWLAN_ANY + .flags = WIPHY_WOWLAN_ANY | + WIPHY_WOWLAN_MAGIC_PKT | + WIPHY_WOWLAN_SUPPORTS_GTK_REKEY }; #endif