From patchwork Tue Jun 1 15:09:50 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: 451383 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870477jao; Tue, 1 Jun 2021 08:08:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmkCo52spZ1uLd0hI10fNEktunNwSZH9lMcyqz8k4F3pGw7p6mbImh40Ry2UIn+LfOpP2k X-Received: by 2002:a5d:914a:: with SMTP id y10mr21477295ioq.156.1622560104244; Tue, 01 Jun 2021 08:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560104; cv=none; d=google.com; s=arc-20160816; b=EGMH7eBwatRxpnTBTp1v7cDxWx8zjJL9MN4ghR0nqplU4xKWrESF5tV4flE7BNv09G RmzXpFzTK+mBqBRSDBpFxAlsc3yOi56TzKKbZn6Y6Stzh2ebryapmkuaO5GgpPUDW8Z3 xj/quFSEJcZ88q3r68E/WmI47Ou+m/9A8VU7k+oLl4AjRC0TxsTtC4zXn7PlJi4MlX1T cJVQ/WDqkstwco2RyDB74WN+nbjMBxgLGkuinzes19W9LoUZIbVXPO/7DZXObsB6kvZy yF0IaxKoUgaObuKU7BzRj21jDFkxNc7tmmSfrJ+FIragMkKqh+JeepKd94Q/ieFO7USd mrSg== 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=/kuNaO+3BN/9XKW0uTC+mnQ6gznoI5jFyk7Mscc9K1Y=; b=fch5WcbGX2DOH9Enm7kjXjLTJSlhafja/EgoOCUMVc+vpgKaGJFgkWo9sn30MiC3bn iN7UZok11LJoPZnbIacU/EaorjEDHqpMtSBGXxgqGNiyrR7IQmpwFcA88YB+HW+2d+iZ N9DolkzXt9ISbFwWdBFgaaKVI/DtcrUwRqVoyOwz3IBG7GAQOj+2/cc7zgcDLzHx6k1j 7d4dXlwuS8hF5LFpoYnWwCrVJjSRIHMpyf757qgQ9Y898DKRGoERUxC9pi2+L5DZPyp2 0WzdWgno120OdUWjg3i3o0UJlD60Zn2P7nnHJc1pWiF7T7Knqz3jRZHx2W9UcMESNIbg yunQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sNhF3dBW; 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 f4si19067448ilq.138.2021.06.01.08.08.24; Tue, 01 Jun 2021 08:08:24 -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=sNhF3dBW; 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 S234362AbhFAPKE (ORCPT + 2 others); Tue, 1 Jun 2021 11:10:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234074AbhFAPKD (ORCPT ); Tue, 1 Jun 2021 11:10:03 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4D0FC061574 for ; Tue, 1 Jun 2021 08:08:21 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso1813269wmh.4 for ; Tue, 01 Jun 2021 08: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=/kuNaO+3BN/9XKW0uTC+mnQ6gznoI5jFyk7Mscc9K1Y=; b=sNhF3dBWejpCgwbM1zny2PMGooFhdnzRTnX5ieerwXuJQzA973sykaegD+gt2TfpcX ke/hIsNt5Q2Nn/hYyMmqKuGbWoHNGbpkliuxUhcMhTMug4kBSd7QO7z1DTSthx0kSVjH eOtQUTcv5FavXfIcq7etU1H/N7CVh8cSL9aS2EBYEqVlh7fZbLeR91edOPC+PQzZqtCh WlV+xG0gF0JJ3/P2KPEmIbcu7wDZ+4JraYIrgKEDs+gEuuF6OwTtODGlnBFEv4vyfneN E1Dkk4IQbFou5UcJ14KjHs8qVl5Ctgcwmd6+L0rw+DJDLcxi9G+DDfyiO9w/23jHykOy 84Gg== 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=/kuNaO+3BN/9XKW0uTC+mnQ6gznoI5jFyk7Mscc9K1Y=; b=hvTk67sE1ZvnU1FklIWtV9kDBxL9Aex2Bdsyc+yzND00/VyB7rjysolbdEcsr3uPsE 6f8AoXKzkpRgIeVdGfrucDdlujRZbKLvVu6tZr84FkGcvwwLTFchjiAdwqEcA79MC/MW yRtDlpFnGPBGJo69UucyvIT+lA0CE6A1xnxlB+UJxPnRLFADr8OX7ocJOAZ15Kup+g2T 0IYS5e3UFkQfoX1JkcCv/gYxVuK4xwQijsFsllEXHCril0D++XgE5qCbKyGN6wxJpjpM eTlb/jOem7gr/mVPJ6+QSrD3I087Zt82BpqWRc7YeoT61TExhKg2q7g+HDkCw362O0to ElrA== X-Gm-Message-State: AOAM532a7rfufkfEUq8S/LFkHnruQJniF4+4TIKyXkCu7fQEH+beIj8+ i+syLbATWo2UXdffYI15gPKGuQ== X-Received: by 2002:a05:600c:1994:: with SMTP id t20mr370722wmq.51.1622560100323; Tue, 01 Jun 2021 08: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 o129sm2822237wmo.22.2021.06.01.08.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:18 -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 v5 01/12] wcn36xx: Return result of set_power_params in suspend Date: Tue, 1 Jun 2021 16:09:50 +0100 Message-Id: <20210601151001.1450540-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-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 Tested-by: Benjamin Li --- 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 Tue Jun 1 15:09:51 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: 451384 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870485jao; Tue, 1 Jun 2021 08:08:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKZYrEsF1VW5wKmgwPb++YcEvDN9S2CYPmLWauj/gPima1/4cLiifGOThJ1mu/1Tw3eCVY X-Received: by 2002:a6b:f314:: with SMTP id m20mr12623531ioh.7.1622560104738; Tue, 01 Jun 2021 08:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560104; cv=none; d=google.com; s=arc-20160816; b=VRBj/p0qyfMY8dYkW31FYphIolTtrEc0x/EFnfbthutVotdLyOSvahZRazSCOoWBl1 ClOdyRZvyfNtSGBOGpyfw/UZza8YCa/YE3abFas8aAUjIuGBgK4+JTzBd+mm6PCOzANk xgXT1Y5AfIWczrYO/zlGyyFQZoq3bsPcoBhRlnzitnzdEHM85HosyQHlTyHyK/dZXflN JMoXY5KVVt28KZQcnvKxq/RnIsYQsD07KDnSFx2BeZ7i22/lMWEbMjjgJh8+OMHoFC/4 kW4w1Rvr6n0KRusdldFFX48Dx9pfDUHZkFRydtlprC8cszk0uiZFUvGk6i0pRTkIDY4m drcw== 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=BDB2CUDPDaolV/e1QpwHthEeMSH5hthfQ21cne8mw4A=; b=FXXC+kxesDt7NHPrOBX/op1In6m5493FQgN3RR+XQX9ND4gHZjYhm80+z5eYBusJc1 aJpQ66rjJd4z1KtmBT0SFq1L6qAR5+VhEUtNoETaaLepxmtU9qak5HtQFZNUXmCFokvH Y+mbbhVOEWIcnF2Su91LpLxyc38u9+IgDzJKTFXAFWpd00ZiQJFzOjlWiOzHco2eb+Qs QHaY2iVagETWLFZimY41T2NYNqKhkxT3yp+UT0bTVCzzwpqNKATePKw1R8fRI045vkRh DRnnNsvu19QXcl5rh4RkJx73u8ICf1Ghy/sLde+kMjgiwmHXwFu+D6IdbNJ274Fo6aBN GI1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UyL9p2CY; 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 f4si19067448ilq.138.2021.06.01.08.08.24; Tue, 01 Jun 2021 08:08:24 -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=UyL9p2CY; 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 S234370AbhFAPKF (ORCPT + 2 others); Tue, 1 Jun 2021 11:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234363AbhFAPKE (ORCPT ); Tue, 1 Jun 2021 11:10:04 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2C05C06174A for ; Tue, 1 Jun 2021 08:08:22 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id z137-20020a1c7e8f0000b02901774f2a7dc4so1462725wmc.0 for ; Tue, 01 Jun 2021 08: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=BDB2CUDPDaolV/e1QpwHthEeMSH5hthfQ21cne8mw4A=; b=UyL9p2CYH5J04r0W6uZRR0+QlJBrjCWzwvFPDfrgNDv3ObhX+Sz7rNAMXaQ3UW04nF wCFNG0bWHvkAwndw+FThWuciBSkxOIclA9goIBF5PyGRDDPi4MviKyvicUMQaFUkWQY8 ZRbKg7h72bzwOud3DEj4qqIlNy/ZfjYrZ+11ebKOJnhsRnI4W1Io4FcSXsqrnGNH90wD Gd5MpdWxhMm6LVOgXDaRAqhRyAy2EKDBdTl4k5lw/iaFqoJa7FILMjng07Te6pPbfkha v0VZinMV+9d3C4tTEohF7Neyfn9UqIbgPleO3E3sSWAKyz5Ga+SUEQVua6irZ3nJeevf LTag== 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=BDB2CUDPDaolV/e1QpwHthEeMSH5hthfQ21cne8mw4A=; b=nl+W17Y1GzMypM3AgCHPbwJEothhlt76ne2d200CdLBUoLyoLg4KCeehKVZZ6YZvMz T070Z9ypSmaZY0fsk8ub9ESn985l938OwmhYRQIwT/yfwfyKs/eTep5PQ7TAM1UMQOIf QXWT8BKQu2LEnDyzPOVbfbID/E4IHCZ3u+hcnU9rhaN7Vv2wuGMYwN6FLpKnSCcHK51L KS/GKc/k6t00TD7kA17UQEa5EyiL3tNAsyEN8IF0u4Jjn1mb3Xvn49bb9GEoXCsEyKCd k6FSg7suR1llIr1d29at8mA0RnAEo5tLboV7KBC2vS4Qh27yMh6scdOsT7OJ304rSG3J OTaA== X-Gm-Message-State: AOAM533RpbY+LfSu0NbLf1kcAUYqAbiCeBmLZ71ADJgcxPlCr79BDJUn 3pIwG34GWXeXg6ESr54/GxCkAA== X-Received: by 2002:a05:600c:4b87:: with SMTP id e7mr11047183wmp.101.1622560101406; Tue, 01 Jun 2021 08: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 o129sm2822237wmo.22.2021.06.01.08.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08: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 v5 02/12] wcn36xx: Run suspend for the first ieee80211_vif Date: Tue, 1 Jun 2021 16:09:51 +0100 Message-Id: <20210601151001.1450540-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/main.c | 31 ++++++++++++++++++++++--- 1 file changed, 28 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..9a97a288a96f 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1088,15 +1088,34 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw, #ifdef CONFIG_PM +static struct ieee80211_vif *wcn36xx_get_first_assoc_vif(struct wcn36xx *wcn) +{ + struct wcn36xx_vif *vif_priv = NULL; + struct ieee80211_vif *vif = NULL; + + list_for_each_entry(vif_priv, &wcn->vif_list, list) { + if (vif_priv->sta_assoc) { + vif = wcn36xx_priv_to_vif(vif_priv); + 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; + 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_assoc_vif(wcn); + if (vif) + ret = wcn36xx_smd_set_power_params(wcn, true); + mutex_unlock(&wcn->conf_mutex); return ret; } @@ -1104,11 +1123,17 @@ 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; 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_assoc_vif(wcn); + if (vif) + wcn36xx_smd_set_power_params(wcn, false); + mutex_unlock(&wcn->conf_mutex); + return 0; } From patchwork Tue Jun 1 15:09:52 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: 451385 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870504jao; Tue, 1 Jun 2021 08:08:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoh37ZkJs1CIsh9BZneRh6bjYxQ7hJ/29uwCJbzJOl9ximP9C4+RWQANHbFMzQ3kDBrEEt X-Received: by 2002:a02:54c1:: with SMTP id t184mr25651066jaa.79.1622560105815; Tue, 01 Jun 2021 08:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560105; cv=none; d=google.com; s=arc-20160816; b=Wm20dUZQRDyo/vx1pi2tUPz158QwNRwilmbRCX9A4ub2PkgRKKCXot/pG+TeB1VdjQ jrE63cuinW85zlDvdv6hxqbIeKvq9cM+hwsrNhnyohEVaoGaE7UinvW/ngousXwMTVgW vy3SRAsRfEI1Z3yLHL92fUyJCBx7+imnKzxZ+69SNj7V4JRlXLpbJKW8SzC1n3Rlk82u 1nqkGAeKWNYujlUZjERsOK0Cu7RVEgcobOu27cyt6xzvciZhOX878KUHp1HIIuTohMNo vGfsqM//TK2hIDm3nZ4ZlkaCBXaSM2xc/JTU0U/ZxBLGVpGado9RiAkwJCOeUABUAI3T Mtpg== 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=8AUXLUY8VCW5F1ufkPQ70OsRXxkMZiVh0Lvonqi0Vbc=; b=k5jUVl4qoivalYgJ884L8NMxNMdvPr2fB3TOPyWY1D/oE2hbYlYcZI6Ma34HE9ps5V PWhsSRK1F8/cd0S21HV/RBV+elegb10YBOr7OMMmHhcFVdL3GvzCpYAWxayaPcowP+Hm O/VJBMVFN/6VPlEnQCmiqJ4ITm7INjPLgb53jx5pPu1bZAFj1tE/4YgZ67QmNwGzKiAf wP9spqhauwsFcxOh0mEaWWAoTsMjG3MGUSTpcrJJoVU9S23ELQ5RPn02Qp7ApnHaLimC X5/IJlFzO33HSBdVtdj7NjwxVz4nUI6mvDJ+ENKvOhPoLNhzx4yfs8ucptlFPiuX1fPn hr3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BwcUQSFd; 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 f4si19067448ilq.138.2021.06.01.08.08.25; Tue, 01 Jun 2021 08:08:25 -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=BwcUQSFd; 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 S234378AbhFAPKG (ORCPT + 2 others); Tue, 1 Jun 2021 11:10:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234363AbhFAPKF (ORCPT ); Tue, 1 Jun 2021 11:10:05 -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 E2D4FC061574 for ; Tue, 1 Jun 2021 08:08:23 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id q5so14716504wrs.4 for ; Tue, 01 Jun 2021 08:08:23 -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=8AUXLUY8VCW5F1ufkPQ70OsRXxkMZiVh0Lvonqi0Vbc=; b=BwcUQSFdDVZwiClzBVYknuT6WPbQvCQo+KrbJxctKjjsOM9aVaoQHibAUBkCg2lKgB oDkrhdHnd2bpUjkwQuGGJCZv66wY7rPElSrfwHNuO/oNNaUkCmtzU16VgHjhJttn2r5I fTUxSE1FUuJJeZNXTmb3vHZgnS3H/mzGYCLsOu0l2Bbc3mtYSF2+ZgBpH+V/uqW88WMX 6ac0MUP+jJsABvo6ZikfczOUGVYLHngl+Yi4l4jUXKJvak2liTGZ95hVN0j37g2NXlCa T19ROiC5H6czk1ggamHE4kv77UrjM0jWaHTUT5840E+iX8AwxaNDiClCZl8EJeEtsLms pI5A== 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=8AUXLUY8VCW5F1ufkPQ70OsRXxkMZiVh0Lvonqi0Vbc=; b=L03xq8pJmwifncKnVVeh26TyGG91EYVkd3J8DK4qpgzTY0VhhVvaqyla7Oz6h/mnH5 Uyy5fIrw8CDHomm716po1aeyxW4wFjcbF2bqXzacPg/WE1+mBIKZEOsZ6VvS2iX2c7Px 5qgXIFeW9W7xkwKYvDKewfnrGr2iM+ws/wzpK47tZDCNUrByUkRudX2TuY0HqCvX9CaF Axwr68QDW1TD5S+zxh9Po7GL4YFDMnRIGMdBDCpvaMxHh0N1KSDweaTI3ZNTekKSdOgX dquN9bYXpi4gbADupm/FTTM1CFMvqtRXyP80bmNGr/X35507iZpwacdCaM3Y/mp+8eqS MpPw== X-Gm-Message-State: AOAM530tdw2AES6R10647cx+iIpJxQaABGYihoPm9OMiyJZNjRUTgmVr 1R5dcIsPpQsGJM3OrihiPkp7j55cLs33amSo X-Received: by 2002:a5d:6da9:: with SMTP id u9mr28373260wrs.264.1622560102576; Tue, 01 Jun 2021 08:08:22 -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 o129sm2822237wmo.22.2021.06.01.08.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:22 -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 v5 03/12] wcn36xx: Add ipv4 ARP offload support in suspend Date: Tue, 1 Jun 2021 16:09:52 +0100 Message-Id: <20210601151001.1450540-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/hal.h | 10 +++---- drivers/net/wireless/ath/wcn36xx/main.c | 13 +++++++-- drivers/net/wireless/ath/wcn36xx/smd.c | 38 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 4 +++ 4 files changed, 57 insertions(+), 8 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 9a97a288a96f..0da123660fa1 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1112,11 +1112,16 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) flush_workqueue(wcn->hal_ind_wq); mutex_lock(&wcn->conf_mutex); + vif = wcn36xx_get_first_assoc_vif(wcn); - if (vif) + if (vif) { + 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; } @@ -1130,8 +1135,10 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) flush_workqueue(wcn->hal_ind_wq); mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_assoc_vif(wcn); - if (vif) + if (vif) { wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_arp_offload(wcn, vif, false); + } mutex_unlock(&wcn->conf_mutex); return 0; 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 Tue Jun 1 15:09:53 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: 451386 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870546jao; Tue, 1 Jun 2021 08:08:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybW0izB3nUhgj2Nd731ezEkNDbV+gcpKvSya+/5Z7GJQfLElZsRmTfTtizRGHr2+8fTEPz X-Received: by 2002:a5d:8516:: with SMTP id q22mr21935652ion.173.1622560108085; Tue, 01 Jun 2021 08:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560108; cv=none; d=google.com; s=arc-20160816; b=Hyq+R/1sCphQH0F0A3r39E1uN2cSXjzhVAyfOVEeF+4wtKvd9JFvz58Hswp18AYbU3 R/F/iF0eQrf5ywuROoTeq+sCtQafdHqqFz6wqZ0rX/rAPU3WWN2sIVekk/Kwa5EbMP0d p8T6UVHHGcJ+C7KR0eoxuAIQcfEWBOMIVHf0frfYsHgnjJl4cAigC7lRPTOH4PbvJjpW Cgcmq36VCRu2SYnqKDOBAWo5dWHSvw+WGqIWglFO1ysBZJ/GCSvCuOtZVQMGgBZW+sJF E1xGFlqnn1i/dIO77Z3fGD2uYg0yk6jKsGR6B7sH7zb4EeUEDrznVxbKZ6SytwUVcAo+ TGTQ== 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=SquAaKfKT+XFRM7MHN5IY0d9iler2O6E6du+Hc36euc=; b=1Bbt1b/QQY2Kay0T0iqYkxEBHz7aiNUmknOxrjCz4BI8liDJAyvglEEdabmw5Rcx7p +kkYJasLt7xiyUZjWs9dFyrE4ewHVPQ2r3knt9zjH1/Qh3poCEJiUc4APbH2MCLqB8yg 6jOeYU+rrItrkoXU/Ue/Kt+IcQmUwEIG2FMjnML69NaDE9G2JKLrbJBf1AGUahJGs7i3 f/WbyiWfmDduzSu6FNgln3uzLpLw99t148fVZ1+heGx3mP8zFPIT1FflOZHXDlbU0C7g Xt5ctaHckF61y/s7PnO0iHj+Kc2mC59xD1sV02YpIDKkSMpQQV4m34Q+1r15lOIezj6u sC9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bhSI5t2L; 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 f4si19067448ilq.138.2021.06.01.08.08.28; Tue, 01 Jun 2021 08:08:28 -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=bhSI5t2L; 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 S234393AbhFAPKI (ORCPT + 2 others); Tue, 1 Jun 2021 11:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234363AbhFAPKG (ORCPT ); Tue, 1 Jun 2021 11:10:06 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61688C06174A for ; Tue, 1 Jun 2021 08:08:25 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id o127so8408949wmo.4 for ; Tue, 01 Jun 2021 08:08:25 -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=SquAaKfKT+XFRM7MHN5IY0d9iler2O6E6du+Hc36euc=; b=bhSI5t2LXcO0cI7OzuFyOUtXr8NHcb9UAqoLbi7dW/hD4qG+aYzOG31ENCjvp6UIt8 Np0Apn2vTHHE7H31zx8xSOyZi665SxJm15SsRLfnjcYkcJEM/bmlD4iNZ21EEqE8dOg6 BKZPVAZHGbxc0gbeSaP7PtTwk+xWz414s5qrKEwuDCznGoPsZp4lnWy9OrcXstD3rg8X ARpfqUBnVbrMRhoyThCFlDOOPmEH3K7ONxRh/+dzgrLd5BKcOJoSnpTz2qgwdUWSpsIQ QHGf2UOTWZBxqlsRZ5qFZNRQjYp67qahODJrAPYqW6DDRM7jqiIo2Z7FcT8633hNVR9B JvlQ== 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=SquAaKfKT+XFRM7MHN5IY0d9iler2O6E6du+Hc36euc=; b=BSrqZebYlWLenBrtdapHr8V9qny16QdPqrZuz3DWSq5EqOYu4dA1x1rovpkKQZPhJE ijr3xq93tt00hM11Pzk4PDAbFZnKXHyTsrjadve/I5xoVEYNba8Wps5CFunCb6fRd2MF Uq4zb4nkUdTMP4hXT8J9qaPLIGHLFZPzbAHc6Oihc5d6OSIOjkEE5Js8i9HRCRq9VKCA KHIoHZ4jXYVFZXoE1YE1iCVf0fMQdTMLD0QmwkR9rfvHZ32VUGmIhBT+G/760HmeGqHT gDyQqNiunEwryPQ3QfUzXvBF2xYuAHqP4q4g4PCdYCtQhQcITCvUXLYwouDZ3B+2hHow DcIA== X-Gm-Message-State: AOAM5326txT9ABwe+SI6a8Pk4PscXOhwV1L2PszK7IoSsQfJkdYC8Pvh knX/N4RJwlM7x1PIoV55iA0PGg== X-Received: by 2002:a1c:bdd6:: with SMTP id n205mr19395846wmf.74.1622560103997; Tue, 01 Jun 2021 08:08:23 -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 o129sm2822237wmo.22.2021.06.01.08.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:23 -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 v5 04/12] wcn36xx: Do not flush indication queue on suspend/resume Date: Tue, 1 Jun 2021 16:09:53 +0100 Message-Id: <20210601151001.1450540-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-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 Tested-by: Benjamin Li --- 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 0da123660fa1..9731fcbe2e7f 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_assoc_vif(wcn); @@ -1132,7 +1131,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_assoc_vif(wcn); if (vif) { From patchwork Tue Jun 1 15:09:54 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: 451387 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870593jao; Tue, 1 Jun 2021 08:08:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6MAbScRwl7kM5OJJx6CK2D6AErht6+Ch/xYiKf7dHt1WSS/j/wLX1t4bDxl+oGkHRDP2g X-Received: by 2002:a05:6e02:12c9:: with SMTP id i9mr9362560ilm.17.1622560110111; Tue, 01 Jun 2021 08:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560110; cv=none; d=google.com; s=arc-20160816; b=g1pFzfJCYMlQph6GtOxgN36vEN1m6yiCF0VLoNR9qB2JqE+lnUI7AT7mmhM5FcJ3ZY 8JBvrDz2aOXDrB9iTsDNifPUBfeAfnAGYNce4SyJUOIAGlh5TKMV/TFLmlhvc9srF1rF 0agcsHvs408kCXcW5ag6taGKa14Pw7ixjM7fJH1N4GzCb3Mvfm0n35eCvVnTsD7C0SPc bMpEwJu0rql6nUpQPcFata7mPHbFeNALNVHa+/gghOLQyEYZiqsgZGYI3jIuvjVS00l8 RI23aS7XzP3tkHGFIUS0jZrEl5lXx/u7mx6maj95Xx4vyfK7R1ycrLsYHNS7OUWdtSEc hjVw== 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=W+UYnqbXmGpOtA5im0JIGu1QFL9pMS49kWTkIpsAbWs=; b=IVAuGtr6GDS40HmFi7sfoSjQuRcjw2FJaEyrJ+AkClIaNiP9Mgy74HyysUmR/gVMc4 HqnjQRFg3tjwm8PeDWgnVht3mv5Bqpxs/eM528VWR4u7CfU1WeBAnq7e3Pkf9x+i0Zls 5LS/Wojje1mR/Y6yVWrlT3LHYXiLLPcqZRO7pDRsyCTmlwWyb+pegcMeO/ESIh7UOGW3 oo8vnlCYAtkM5jmBdsMSsMI7wzTinP6z24kGVJwbL3w/7QkwAmK8P7GefKHbUXr6EQAk VLujH8MW2C5Ty1se7xK+kWUgglmBzsz86Ot8Tkn6xzpGFHQUOgRb/TQEkKWU3sfv17MP QOUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BMjxWAwu; 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 f4si19067448ilq.138.2021.06.01.08.08.30; Tue, 01 Jun 2021 08:08:30 -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=BMjxWAwu; 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 S234403AbhFAPKK (ORCPT + 2 others); Tue, 1 Jun 2021 11:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234386AbhFAPKJ (ORCPT ); Tue, 1 Jun 2021 11:10:09 -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 6036BC061574 for ; Tue, 1 Jun 2021 08:08:27 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id l2so7248295wrw.6 for ; Tue, 01 Jun 2021 08:08:27 -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=W+UYnqbXmGpOtA5im0JIGu1QFL9pMS49kWTkIpsAbWs=; b=BMjxWAwuV2FvRB2/Aqc0rzWATZKNR+ROSIqpqLzf52Uh+tQ1wV/HLTqSSmIWzIMYQf /FpTAb7bChMf1jyWDjrufSLqXfwcH/d+R2J+qhiA5U7j5XB8me+0R3e8UZrHQnEc9h3Q WuCCjZbzUOlfkoMogwzg9umhhR297zPevOX8ptllx7/ARjgawLTIAurFcbkTWMkjSDUY xmkGifU99B0KZAGSWUhptALTbqXkKQAjkcFiK+A6xOi48nbZaPUbmYGMZ948AefIqkc7 +uQ/LVObDRZoG9Ioo/sagjjsb7wpw+BaazT49CsLadxpjdQt13nLnQfDbvoo5hJpRQss +HWA== 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=W+UYnqbXmGpOtA5im0JIGu1QFL9pMS49kWTkIpsAbWs=; b=oN6u+uSftZfch1+5v4QzKUnjgPpi35y0Rf9PgawaO91G1erRMkn8XScImHrAbS3Pvc SfKFpAIulP95qkDijvPNOq0J4EcH9sV9RfyGZrabe9Y2znjRJ0IYZmjQ7IzGyPza3YeN Ph1DA5MWvWQh5ER7FWuwx8cjTKe/oIA8Cr1h8MJXI1JP/dCIRkViYAhe9lYtMrfDw+3n 0vCTZy2RupqETqxD64b2LFu9UzXZNO3MazJflpCQpiULdHZOWLVgwlLeI5ciHf6sXX+U VCvv+nllmQWqZjxGWp/RGNpnBaIGiEw1NiTYnmLuWkbm30ycVEvJdrIk500OZW9eHXy7 hFNA== X-Gm-Message-State: AOAM532pSssjYqDgYP9kJO++0/LaCWbB5U6R3rflLJ9zbeuLEiwSdZWE VojWTboH3zXCvMusZIkM2Xm6uW2U6z6cigJZ X-Received: by 2002:adf:f309:: with SMTP id i9mr29114688wro.307.1622560105161; Tue, 01 Jun 2021 08:08:25 -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 o129sm2822237wmo.22.2021.06.01.08.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:24 -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 v5 05/12] wcn36xx: Add ipv6 address tracking Date: Tue, 1 Jun 2021 16:09:54 +0100 Message-Id: <20210601151001.1450540-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-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 Tested-by: Benjamin Li --- 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 9731fcbe2e7f..240ecdd52f81 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" @@ -1208,6 +1209,34 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw, return ret; } +#if IS_ENABLED(CONFIG_IPV6) +static 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, @@ -1231,6 +1260,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 Tue Jun 1 15:09:55 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: 451388 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870604jao; Tue, 1 Jun 2021 08:08:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnPUSKt5jCQ+QgNnClkIIEEnRNSQI9fjW80YBYl8AUp8B1xgPtTsbvqSnbEHP5mLDG/WSA X-Received: by 2002:a05:6602:2596:: with SMTP id p22mr21366092ioo.184.1622560110360; Tue, 01 Jun 2021 08:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560110; cv=none; d=google.com; s=arc-20160816; b=azj2O54BLFGDyxZb/LXOHOtP1lgWEON/MvcDeL4/fmT0d4jSjvhewltUbnkqnHsn+K gKD8lrnQ8rehe6MvWDzBlAcgYvyabqxQUz3HvbAyCA/ytoE/8n+sEogTzdvlndwk7H/C 3hbkxO4MiKf6WP+ux7kxQywlkpcHRvTZ7h+L0ITjR4fp8rh3r5Fq4PG0NMeHBGYzZ0JO iuj9q2aV+QaWvu80dm0EUGDG63fur3d8cQBg/pkFaeivTq92d7JIlPPVqbRp7iCYiUna Wwa6uerSNeRp2cDm/GJLUYDbCRc2GEC+LZnEH8GU0C/pVVHX4ajtA0LDgdT43UDztBWz pcGw== 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=RACFcUJtiWm8MN8W1vtslkiqbwIBEQgKrtcO2mZsrAw=; b=l4RaeQ98/tVjzzkSYV7Bpv/yGSgeB1uHwn26xcdFJrxZg43DgTtG5cma5PcqSn5TXr wYku9/uGVFdFxy6PJzoAgPyU2iBhF34Pdvx/9NFo6FFujAF0uYLFaMf12r4iL9ocTHZP eQqBKJpSO0XCzzrFe64jOfsJt9QFS4M/rhc0h7xlJ51GRsXIw6MBB6GuF2+uzdWnWY71 YDz5XnLgv0paMA8aUkZegVtw+s2lYyEq27DgnOKJRBbX7CRhF2ZUT1cxNfbp+K/ekcbc 9wtlP8BuiLubRBqUlBG5iYogGJ7avOAkmeduPUzIMcl/9LNEba75f69QnsT+Kh50VQFm 350Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AGgG0dQM; 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 f4si19067448ilq.138.2021.06.01.08.08.30; Tue, 01 Jun 2021 08:08:30 -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=AGgG0dQM; 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 S234363AbhFAPKK (ORCPT + 2 others); Tue, 1 Jun 2021 11:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234387AbhFAPKJ (ORCPT ); Tue, 1 Jun 2021 11:10:09 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DC69C06174A for ; Tue, 1 Jun 2021 08:08:28 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id l11-20020a05600c4f0bb029017a7cd488f5so2150885wmq.0 for ; Tue, 01 Jun 2021 08:08:28 -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=RACFcUJtiWm8MN8W1vtslkiqbwIBEQgKrtcO2mZsrAw=; b=AGgG0dQM96lT7J0dEkowXD307tZoS+094SJYDKI/TzLc5/Q069FbiA6HRnOFspT0ez Bc5wjShkKdYuGHGIrIknaeaevCA5ASWmeD5AZX8H4Auh/hQQDDh3o7EKt1q14iIIDFf/ q4LfdQjcMTIrrmHZpMhmYbA/trluet0ZrDdU2wmu3le3dmqtWSV8KATmmLqTLUgBDBYE vVNGDZipgwtfXUmGMX5oXQ+i09z/sMcgNpU8EB/NddDNtKdVrPHdMIqvPB3/uj9+up4j JbGmb8ntS1IV8VG0daFYiSUbqX4wBUgYxGu3xrTVV3hMP0ptGahlfPo/ZLZ3tA9SDCYb hg4w== 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=RACFcUJtiWm8MN8W1vtslkiqbwIBEQgKrtcO2mZsrAw=; b=pn1n9neicdBlqRUcRKNGAheg0Mc750JIGVDA5FQbRgt9jJ1MJhakNrxX93Z0fet0PX nhqUhNdbPNkgtQEwEL50Nx+RvHOiE/WWOInayGkYawAwu9Zm+YQY80AmEQ2zbxPJ96L/ fXTw9HL0Gphy+16cYayVKE1k4BOApEzorCs0D4BwV6LAZ8gvfv/8kDcykOgf/ByVT/6G PFWFqh6+0PbkmKXviyg0yCQBDxHQGFvH3aBtVSBsgbUd1O8yZJcvrabR99By5ZDnX9np 007517UGVCcINhlBWr49i2Ng5mSHUfTzs72UemXiC1zIREd0w5heD7MV6UtaEHm5uUQB 4vWA== X-Gm-Message-State: AOAM53387FofvkgXHqrnGxCUiRpkSfZb4eQqBOqmGFw8cx12hrGdQXez yGUMviE8Wr34gPw21N5SrLSG6g== X-Received: by 2002:a7b:c1d3:: with SMTP id a19mr26810852wmj.104.1622560107075; Tue, 01 Jun 2021 08:08:27 -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 o129sm2822237wmo.22.2021.06.01.08.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:26 -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, kernel test robot Subject: [PATCH v5 06/12] wcn36xx: Add ipv6 namespace offload in suspend Date: Tue, 1 Jun 2021 16:09:55 +0100 Message-Id: <20210601151001.1450540-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-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 Reported-by: kernel test robot Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/hal.h | 3 ++ drivers/net/wireless/ath/wcn36xx/main.c | 4 ++ drivers/net/wireless/ath/wcn36xx/smd.c | 63 +++++++++++++++++++++++++ drivers/net/wireless/ath/wcn36xx/smd.h | 3 ++ 4 files changed, 73 insertions(+) -- 2.30.1 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 240ecdd52f81..09e22f829682 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1116,6 +1116,9 @@ static int wcn36xx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wow) vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { 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); @@ -1136,6 +1139,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { wcn36xx_smd_set_power_params(wcn, false); + wcn36xx_smd_ipv6_ns_offload(wcn, vif, false); wcn36xx_smd_arp_offload(wcn, vif, false); } mutex_unlock(&wcn->conf_mutex); diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 478e363610e1..4a50e5f8456a 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2793,6 +2793,69 @@ int wcn36xx_smd_arp_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +#if IS_ENABLED(CONFIG_IPV6) +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; +} +#else +int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, + bool enable) +{ + return 0; +} +#endif + 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 Tue Jun 1 15:09:56 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: 451389 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870652jao; Tue, 1 Jun 2021 08:08:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnNQTqufnoCKrYO0zr3Hrd4IuCL8H6TuBkQLClSeVR5DCOLGwxBYrZDk1PMuXaLi2yQUlB X-Received: by 2002:a92:d289:: with SMTP id p9mr11467860ilp.86.1622560112084; Tue, 01 Jun 2021 08:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560112; cv=none; d=google.com; s=arc-20160816; b=oyn7yiTAQIuNwAa8jiNCKpryGvH/wjnG7Wq1M875pueii9cMB49/g1jhvHTTWWujb9 /zQcMC7/mgNOFIaHP2lO1ONesJdJa9s+gOZj7vaq6r/IX4Alh6j2QJIp1b2FULYmQ40p 3vgZ+1rnGzVTtpqdl9W4G7hnaJx+Us/z3oJcrkDX0ZI7VzL61EG30TgYwGjNBFx9STKs SlORlzVBMuv3UafCHDMQbQNCxwd+jO/C/TPF7mnnWEXAvqdlZCzHak2RW/Djw+tWft4T /ny54ItfWoq/X5Veozskm5CfsYF0fQQ13PwymsQQK+Zw63mBkRKbY3Ay+UkNuR6mMHIb f0XA== 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=EqMw+TK1CU976V2wAL6yPr0zVt+M7GcrRHHt2Qzbk6I=; b=bjjxFPaGE3m+HZ0Ht51uBk1Nn4bFccHaS2F5WaMf+ofIWZKt4uFl2RfEfwpakWFgvF itWBLK1DY/sxmOngK9fTz1ayu1cx+zMq5MPC7P/8EoMc+MdeGChrcCFz34Pz5uIOa1JW 1YyKCtr1sNRMft2PYlHdQ1lbuCiAq/XHI28Rxv+EwtVhPuOkp9eatN56JklFYiAeDWUJ GOhmNEi+RUbHw8shMHAzqTlmlv0ex2rDvXGqoWW+58ri2gF3tgAyMOxu0LsRm4F4Z2NN +uB5oW4T83KEvwqCZiA08b+FB0xeecWo8k4WyaqOS3xj68pdGi0iWEKqyCO7nYTb+1pc KYjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RxeqFnqU; 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 f4si19067448ilq.138.2021.06.01.08.08.32; Tue, 01 Jun 2021 08:08:32 -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=RxeqFnqU; 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 S234411AbhFAPKM (ORCPT + 2 others); Tue, 1 Jun 2021 11:10:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234052AbhFAPKL (ORCPT ); Tue, 1 Jun 2021 11:10:11 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61C09C061574 for ; Tue, 1 Jun 2021 08:08:30 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id b145-20020a1c80970000b029019c8c824054so1804840wmd.5 for ; Tue, 01 Jun 2021 08:08:30 -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=EqMw+TK1CU976V2wAL6yPr0zVt+M7GcrRHHt2Qzbk6I=; b=RxeqFnqU96Xv6bnRyg4MU79EeOjioPa9frXhIBOMgPZvK5jXfoPrXuiA4KlSSue9CA U9GepZK4PQKDR66VOIasUc+vGDdCgFW97/4WPXRwP/ZmvknAP+Qmn2qlMy1UWGgnCKyA +MnBY4vqz19qjXZxZmVVBmmdspOnOpq0p5o6Oh8ryVG5axWFTqBZsQNxmfMwvFWLpypq KrIvDvX4HTbWUiz+kdGHnKyVNRbn7vSW6DnB9OHVDLpFl4BcBghT15IcVhmcAyEfja/N u2FLaogqvYitSzteWdR74gmnbn/Mx+GS3bbX6PeS7r08/T7rQJZnYuZhiYU6k0ExhXUo 1l+A== 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=EqMw+TK1CU976V2wAL6yPr0zVt+M7GcrRHHt2Qzbk6I=; b=IA6TWO5kopnBFN9XHtJvMILdUeTWWxxiKM3JqYz5ulP5B0B+DXqsqPDcyz1LHKz/dL VqZ2ROpYCPXUBJWvNkKWDcjMST3qdiPQx3VJlO6BkcbmH2rIsKbpZ6jxt/YyeT+CLQGz Ug1rFDnMEggdbaEJ5501QRXd9vvUuCI2ljrOtnTGNjKOJRxZp+9cbbUXJaIjOvyA7A2o AbhiHd8x67lEpagXnxVGZvFL5F0EofUK7meyVDgTwX+qoDO58W3WBNbolSTSJ2sUwKmi k3HQbM7ZxhEvSjreTe+E3621HAFjauAyceF58JULSNuQfSfTXPAxU74DgOIcxxnu+kcI zn2Q== X-Gm-Message-State: AOAM533Z/foBKpGmeyFOnQfAoehjrbR84B+FOCjiRc6O8+bYgMtoZDvK 2AWVmwnAcY0pe/NgrMyo1gKQVw== X-Received: by 2002:a1c:65c2:: with SMTP id z185mr414096wmb.2.1622560108162; Tue, 01 Jun 2021 08:08:28 -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 o129sm2822237wmo.22.2021.06.01.08.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:27 -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 v5 07/12] wcn36xx: Add set_rekey_data callback Date: Tue, 1 Jun 2021 16:09:56 +0100 Message-Id: <20210601151001.1450540-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-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 Tested-by: Benjamin Li --- 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 09e22f829682..ec32b8b0067d 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1147,6 +1147,24 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) return 0; } +static 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, @@ -1249,6 +1267,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 Tue Jun 1 15:09:57 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: 451390 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870778jao; Tue, 1 Jun 2021 08:08:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVoI0DGk50aTrFZZ5ekezECL2QkjOUQ8uZdj/4kwG6kcRT/CjbJPgPEd26efsIRC3KZDTe X-Received: by 2002:a17:902:a60a:b029:f0:ad94:70bf with SMTP id u10-20020a170902a60ab02900f0ad9470bfmr26436341plq.31.1622560118324; Tue, 01 Jun 2021 08:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560118; cv=none; d=google.com; s=arc-20160816; b=le2Y/Y0hPSyy0MXS2UHTbgJ87ewtEYfdBMnWShq7UdhpCavAG7m1fp7of1QUcZciwB k8OALKRtAu46F99zDdZ3R7Od/H8rxp5YE5rHsNyqMh7KqqdQ/1AHn579TwMKcRyHk+qb BS6Zr90V4l+UdJKb0rFAPO5/zthFgV6PYYPzSbi+R3bCDb5hVvJnQuu6w1J3JoVnezML IPeQpghSrrWcQoQ44nElC585YkIyeJf4jCFBCz7JvOSxE0huxuo6IgLOUvNYU5cpm5cB 6zbXMz7I0tIhtnIlFQNqBhTVdnz81Q/BZ2Pjm+U08vKUzJ31rbJKYT3jcv79U21VMKAD f9bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=x5Z0Ag5uahh76nLsx6IX+HBftdn2PEx45jwrtMV9R1s=; b=gWxFxT1d9hXVnQWNuJdq57gGFkd1EEXgNg2XiIizdiDsJ8a5HhvGp1Q2V/yePqqN0M oE3VGxVpwSuRfC2fiS9GFmhN19g8W508blumeo5M98XdKiKK0ECK83xeB1lEGAkjJFJJ yficvC8CD8eiz9Qoj4gICNILMSxegeQbo6tgn0dXERCYispFZcZV2Zp8mBilGa8EG68B tRTgyeo0IPOG7gZ73oEYIAeuuBS02bJfbdQE1+0CYC5LVTqq/H0j+fVnJvBoTSCujvGp g3tpxcoTgse72lwDQXLHMFlIiIF9IHR9SO6g+eK0hjQkPS2TTgsIQT+dZ2YFIZXSF+6E QJZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=V21isrDE; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Q6MfWM1Z; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id s33si12951042pgm.88.2021.06.01.08.08.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=V21isrDE; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Q6MfWM1Z; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x5Z0Ag5uahh76nLsx6IX+HBftdn2PEx45jwrtMV9R1s=; b=V21isrDE2XelX3 ruyf3mdgTa8NLJ6OM/cm++NfXlyTbxbdRgTEutYoZiRqbtt9RBqZ86iEdh/CM0vkI29orpj7C9p0G nIlOroFnicosMP0sy5iHTxengEHFdQnnEYwdauW7Bh/HXozbhs3AfiRv31GD8SqyjiscAe4clZAqJ zZ4Mrt1sGFw92PYLhx5JfAbpIpuPHA3dB0S6CCmMW5qE2jSzeULdyCC4hoK80iS23OP/fVJQB+1iX +UQOibOhusjGvRoyvd3yVzaXLRjiGOLsE4DvJNbLzB7gI615sZgZXzPs0QNcZ3yH+Gwrih07Vj0a3 N2BDENH0DW+FdpKCm+kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60T-00H7dK-EF; Tue, 01 Jun 2021 15:08:37 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60N-00H7Wi-Qw for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 15:08:33 +0000 Received: by mail-wr1-x435.google.com with SMTP id q5so14716998wrs.4 for ; Tue, 01 Jun 2021 08:08:31 -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=CJNEkd9odSJS4sHsW2fkqbqVW7PMvd2b9q+phGy9YsI=; b=Q6MfWM1ZK0fp5R9HisziCn2yGoVuRxfdorL07UBWpGI+U4uAt6GibtMrOm/Mmvzs9s T76+6mv0zQJrJWgAe5DBEHwR06TrGBajw3Q7rtmBy2Ttz4ylstS3YeyUxtf+/3LJEOLT saN/QxQd+yN6zVQzw+55KUxjRMbwHreBAkDET1+siLkYn4bYVgAlNAkcyaWDyPq5cZRR RlPGkHnEm0Q6o6C//1i1GjPp9uKL+6agofFO6etrUHCHioEnDWyVYq9rmS/XKIeOPJBs hL3fRzbyRNdSg/f1Ga1RGtPTfjM1IAosPuxXaboEqTZxxBZ/hynpWNkmvfQOx0ggdns7 8OPQ== 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=CJNEkd9odSJS4sHsW2fkqbqVW7PMvd2b9q+phGy9YsI=; b=sGfI4Rp8eD6j6rJoQlKS5KifFUNah4uMbpz8s/SsS6NaenE7LKsSeSiqQhNFpryKXF hfcMN2XmY+admPeoDP2j1Cel9CeNN5PztCKvukRt4D+cM8mT9agTPiu48QZHDfrdLSU9 R+oW3ddqNsGxpv6eu23Hh/HGqjnMqRSZHzFdP9HNUSkjLk1Jh5izj6y2GfWg0tc142yK y3EdXrlyz7d6Iv2Zu95uW8/y5FYnS/GzX30juQg2nJ/31xcBEGhtttfrIQqGmkxGBdN0 t6UU4a3SGdmRYdZC2U/UC/4E85Otmyhwa8nSbbYtiVUIIQaGzXbz1f85wzXkR5pbbUkq Kx/g== X-Gm-Message-State: AOAM531rZ3i6glhr4GafJ5o/yXAdobF0xM0eYYZXU/VerOusSSLKtiio iVpzmIXR6HXsrtWebZVfe8SuWQ== X-Received: by 2002:a05:6000:2cb:: with SMTP id o11mr28623338wry.326.1622560109995; Tue, 01 Jun 2021 08:08:29 -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 o129sm2822237wmo.22.2021.06.01.08.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:29 -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 v5 08/12] wcn36xx: Add GTK offload to WoWLAN path Date: Tue, 1 Jun 2021 16:09:57 +0100 Message-Id: <20210601151001.1450540-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_080831_945553_3A3DAD12 X-CRM114-Status: GOOD ( 16.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:435 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org 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 Tested-by: Benjamin Li --- 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 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 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 ec32b8b0067d..db1528a14757 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1119,6 +1119,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); @@ -1139,6 +1142,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { 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 4a50e5f8456a..f74cb16327d0 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2856,6 +2856,43 @@ int wcn36xx_smd_ipv6_ns_offload(struct wcn36xx *wcn, struct ieee80211_vif *vif, } #endif +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) { @@ -2905,6 +2942,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 Tue Jun 1 15:09:58 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: 451391 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870775jao; Tue, 1 Jun 2021 08:08:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmykVlZz8iSj5ai1amamj4G12eEQV1/W8SSU6GSuLRXZvvCA0A0sXzWbabs3VtJMomlh1w X-Received: by 2002:a65:4201:: with SMTP id c1mr5982546pgq.125.1622560118280; Tue, 01 Jun 2021 08:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560118; cv=none; d=google.com; s=arc-20160816; b=tmKD3KFEhI96FzAEQ3UBy1Q+JoriQGV8uLyS70yN1BP3tclHMGVTqm0zYY5L3Z7OP7 dR+EwTdAdZlrfXp+M+KQLJ5jcpULj2BxoNCi7+poiIacz5lFwqAlI2MVdTZWBqii8p7U n6a/XAZWlDUC8WDytSLFEtxuBptT/x5S2V027YyxB43RGvduy9b+Loi5G8QnJsFIi67B A0+vHIYpu4MeCQkwVqwtMuylW5zsvMqMBpTBw17E1F18KkK4ffgRGHIima07vK4Vqble Y9SFNUMUGmEAOhqvNusx7nvNtell/0o4zJckUM2sjxDNyaOv4KDYeX3+mKT74gvoLx5W vjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=yEEkMwU9hNCcYzL0exiGjkrhSgYuhOmU3hLzlTfVEdg=; b=cJaKEbzfssDBlHuwT1Z95jibLuFJnsS5nkMjS3a2j+yXxfy1Gr9tO5lFAHcildHSjj hBng3Jhw4fXsq9JelisyfVoRf+T6bOjSl2v3zw0Wbue9/wR/+UYXY01LzeROrRFBrPX1 ToNLbx6lQ91zQK6QGHorsOekc+23INhmOWfGIlz/GK5GoEYgocKw0fAEMCl5jZcRCTiy VVVp4ZCLP6J2Htp41XeYAzNZadfPuihkvxFtx6uvAIvc7cJAoloOix5ciaJtQJQuL8Ex 6yGM6zkPahKuA8aE+P6w4mk9c+3crSerFhQJTcK+YgGOrVz8Rw1RvFmAbNQy00b3ggXk IxTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=gz3HookW; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=zdYZW7F5; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id j125si20232056pgc.368.2021.06.01.08.08.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=gz3HookW; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=zdYZW7F5; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yEEkMwU9hNCcYzL0exiGjkrhSgYuhOmU3hLzlTfVEdg=; b=gz3HookWHSisLS 7Wu93CLd2tcQZQesx93p9lXDIfA0+PxH6WboPJbk9GnzDv8YT1+tOVW/7nm4MltN3gwjSsFPznPBN +Rajzytl5/xkfe/14wUy2IOjOJ6f0GAmrG1xksRtwiQlcGhcLC4UeX/TweTuN7KPzJqpEuUHt1YvK WfR1VYPljgNLJTxjo/GToG3pM9K5c1kwKFyGshkF7zmqEiJ1qvPdIMyp48Z4CtFluAZobBp1N1YU4 l+iO5WSiWKIL1BYA8UvrdTewcppwHl2K1150s6gs80kngarKPiYwEkKiLt1lb9KCD3urkKPG38Y7j xkkThE5nvTYa5klO0pxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60S-00H7cE-LH; Tue, 01 Jun 2021 15:08:36 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60O-00H7Xb-Ab for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 15:08:34 +0000 Received: by mail-wr1-x430.google.com with SMTP id c3so14696272wrp.8 for ; Tue, 01 Jun 2021 08:08:32 -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=SzCu0Os7QusVy/mnoUQrDSZnGR8B3iHYzezmZSLH1gs=; b=zdYZW7F5mnR1liKjC8pQu3XQtgT36f12qJLgd5SsxZA5Ad6p9L8LUhsaK2sONOWhry PfDPzauil2JSU3xHSVGL6AfASos7iEfHYUkUhhpgiwfcYXiMjBNtnNPdyAk2p0KFaFTl 4452IrQ1n5HU6dki7gzDDbjGi9DiVZr+S2j3iItWD9WJAESuXBoVNQnT5f7BiwCG5Qsm YPRkPlNpzM8fGjiXIfxoPN9FbsWat17HQ9QerZenpZ7P7VkuHW0mBPtfeqGq9TscGHOx 4mBRy/Q0kZv6rzaky1ItekTjmGxiwFgmIRlRvVGtxw0fgy3arGTZaKdNnMpbxS9xqG5x c5LA== 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=SzCu0Os7QusVy/mnoUQrDSZnGR8B3iHYzezmZSLH1gs=; b=KzkecXjVynxyxmB8RjwucrdPYWgqr6zIgg5qXLWi69eb+qw6/xcULhL6Jo8valfWdM gJWjrrKVbQ2ItagDsj2ItlkYMRQxSLBhIWIBdWjRsWAXm7pa6hnFPcMLDxcUbeS00Uxi W0nQLvAv3JqlCkOTCAGxrJc6B4x2iq0W0gjgtETt8Jw55Zp2e5U7b7A+a4OWIL2eMwFy jECY/srp+v+cewYkNVI3NElxYPkn1p+G8cJcaFr4kVxCQFCA3KRa/Ldhi0bMGQF0nkyw q9jVEUa5mVX+BYp3eyLpNP+Y6u4foksHauNSeEbPUBo9mxOnsu/0DenCnZqy08B/9aB8 h6yw== X-Gm-Message-State: AOAM531Vk5TWWPOePiH9IV85cfv51XbM2JvqWq/GWHkH3AKCgeQZD6rH wA11VZkONwpemBHWaSod5LZJmA== X-Received: by 2002:a5d:4302:: with SMTP id h2mr29048790wrq.266.1622560111037; Tue, 01 Jun 2021 08:08:31 -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 o129sm2822237wmo.22.2021.06.01.08.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:30 -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 v5 09/12] wcn36xx: Add GTK offload info to WoWLAN resume Date: Tue, 1 Jun 2021 16:09:58 +0100 Message-Id: <20210601151001.1450540-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_080832_445169_2D26750D X-CRM114-Status: GOOD ( 16.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:430 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org 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 Tested-by: Benjamin Li --- 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 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 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 db1528a14757..8e5d8326d551 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1142,6 +1142,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { 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 f74cb16327d0..e249971c4ef7 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2893,6 +2893,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) { @@ -2943,6 +3014,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 Tue Jun 1 15:09:59 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: 451392 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870808jao; Tue, 1 Jun 2021 08:08:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI8NwMMoojn6mrlcuvEQQJhBpwpKYNKTgorTFoIFDM/F+6vT2WNzBRXgfYqTUY3QYZBtwo X-Received: by 2002:a17:902:bd01:b029:fd:924f:b10d with SMTP id p1-20020a170902bd01b02900fd924fb10dmr26080930pls.74.1622560119416; Tue, 01 Jun 2021 08:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560119; cv=none; d=google.com; s=arc-20160816; b=aBK0gfGg59JiNxPEsAB68/EdK7KQG+wFhmMaft7kCR3hdjUJR17FDpUxTm6uDpj3Uf T3zUC8VkOSyMQPN/OKeX678rSMUOAHRQfvZ2ug0woYLW0wl2q4eeEsApx3YgUe/3+RpU bUqRr9xCJeHFKtyAZQ/i3xhZZucjnSLTmJtUSMJzCaB970BDVQlhd/Bxp96GsOZIH7+B sKSxJxDfxZyuMMBG8lGpqWtOZA4TuShQa8yrASHL8kkt2ly2+kZCPnXUlT2kKhXcm9Eo knMyW30J0e9ew72pBlOAyBlCTcFcEztWTuMjGvdzLklfNNGCADU8KJ1q9nsF/YDs23YZ APDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=PKJVVvSezOZV8d7YhR4ADDlNM8zZ4cOc2F5ggHfo8ig=; b=U/wvEA+UFG4sBVG+C/+XIbeNzpsCNYo8ZUfRBgmYQi/34Q9YBC6mDgWJwAsd04EeC1 amyF17a+LkGeh9t70lsFixccsDvUexC/W7JXCt4AlQFEzdQgW3oWDqtdoXKQjDVZJBwi NnTTkr8HCgq1JxKFclb+IQHLLQkPdJo7yR2jPXqjKTjGMQXx9LFx8c0lB8xv4X3Piy1F AIDyWZSsyhdS4gAiyGLLrw/DMas6UApsBvNrSeJj3HfBt7omxaRAwXC/d7Aumre4UQc7 /OLvGokW40bUuVjxSSiFIn0JkuJ2xfoJHZZtxOXjIVG7Hbr6TWS+f6TACG7l5xwaKxBH 1fFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=kcxZ2DvH; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MpsmmDjy; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id c5si21694641pfr.226.2021.06.01.08.08.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=kcxZ2DvH; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MpsmmDjy; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PKJVVvSezOZV8d7YhR4ADDlNM8zZ4cOc2F5ggHfo8ig=; b=kcxZ2DvHL/d5E/ loZNGDt56V7ySLwXBr0zfKswQxaoTNfqncdfiGYYogRUKv3ozl2N1ffDFzzMaCu8GcLiP3lS89A4D 2luq97GBYd2a9cTT2+5ZG7RfansXxYNhhVqLCBUZyOrqjIhsTg8J/UE15cEPkoccP6lxtrIBebKWs ujlYb+/0XyQboFaaZKGVbhlPmqSjYL48xN2I31xmHWK65FGMHvsias3lEc5eUiLgpU1HUH6f6nSVC NAa0oOXVa/1cHZDg7ie6k+vqB+V8fVP7ljU4I4dK1vlfukbDsfmmDtEzc7pvWHD6+iHZoMdRbjTqJ rSJREoasNoTuFsEsUXng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60T-00H7dv-UH; Tue, 01 Jun 2021 15:08:37 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60P-00H7Yt-LG for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 15:08:35 +0000 Received: by mail-wr1-x42a.google.com with SMTP id g17so14658867wrs.13 for ; Tue, 01 Jun 2021 08:08:33 -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=m7tgQqGtDFs1RDJ68kf8vBszyeLOJelji2axp1aENbQ=; b=MpsmmDjyujoAEL7TQVSjXsylzBeOrzk0pG8I0ioGr/FwgfXmYzFGl+j/tHWyp7s7eW eBgw8D3+rbXlBLEh1NfZUOc+k4RxiWgKcvQx1Xcdoyw8ezo1cwR1TvCIntomq1LEVLeL AnZjMc4xuC1qUxiZD2wRZEtD75AsSqrZijWnqJif3fbj1aXOeSRnhHoABGxq3p4N9Asz 8rgN6l+dHw1beIwqBl14gD/KMUGMrpe+MsJAaA75j/UwXjAmEB7ZGvdsQlGlrGMlWt9G SFFRpMqkAnzM6zdZg9FkEMP+OQZDalcgqqq+8FjKOeJ050kwPjaZ7ro/JlOl2Mo/0ol0 8bWQ== 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=m7tgQqGtDFs1RDJ68kf8vBszyeLOJelji2axp1aENbQ=; b=uVOGOPtDdly8WeigpafqgixhQYs6u3PKcKYAjNpLWUUe2BA/F9f5VuV58GCx27iw00 FGNL+ne38KCR0Vg4r7TpCmLUOH07cpgK7lGpqWBokzH1XYYSGK3eJZO4mA81Q37pPVCT QulWMZ8FTSsItdwVAKLVH1UkVeyGReCcsTJgAaE06gw4/3ICyw2O6f0WwPIK1JzZLwYU vx92UMU2qmwRIuJ8c+mbx+vuw12Op1brZuWY7kBccftcKpm5Hhsm8s0GS6M9GrpZUkjY 5uG3Om57ls2tLslFyAM/XwynwYuHTKYTcofrbwr/CPbO+IBvwfMaiPcC16bgze5P/YHN uE2w== X-Gm-Message-State: AOAM531anfgGFr6mto1rhxAWB2z1V+eH+udGlZgUMLbR/qRHx78fhUqw KoaNRGhwm3lsYdHEqjGZ6DvBlA== X-Received: by 2002:adf:ee50:: with SMTP id w16mr1761317wro.187.1622560112316; Tue, 01 Jun 2021 08:08:32 -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 o129sm2822237wmo.22.2021.06.01.08.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:31 -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 v5 10/12] wcn36xx: Add Host suspend indication support Date: Tue, 1 Jun 2021 16:09:59 +0100 Message-Id: <20210601151001.1450540-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_080833_742771_7EA62125 X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org 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 Tested-by: Benjamin Li --- 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 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 8e5d8326d551..e4d5e4d597f9 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1125,6 +1125,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 e249971c4ef7..302877d23ecf 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2964,6 +2964,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 Tue Jun 1 15:10:00 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: 451395 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870862jao; Tue, 1 Jun 2021 08:08:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDQaYdAledcz3yTioAIQAtlBi4JLjLviSbIMLsbbUpYRPDGCfI94BSaWPvDLTTSuNCD8ZC X-Received: by 2002:a17:90b:188f:: with SMTP id mn15mr25149366pjb.219.1622560121871; Tue, 01 Jun 2021 08:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560121; cv=none; d=google.com; s=arc-20160816; b=C1yNGkLfLsHZWw3CW+2rYeNKQN0QTDqm63Xkx6kaXyi9ULt30RmasTwWTrf5sT3RSv +HCNfNZlvkE0x7Q8TwSPysW6Hwvap0ZeS7WoBRWt6MikVVp1FdkzsOHxEEO5p54yoU1l m3SjDtmd++ehQvbh8Bv5cQRBTmk01j/Mjp7qFJUIegxCq9w5wG0NOXpwAO0jWnbRdK4c xsmj+ei0ZsxgfBNSviqn0fraL5+hm30iBjM7OS0X5vzOSyrK7ZaDJU+s9sjd+jYdPMyR ZXrv3QwJly2QYkVmcSRLSSH6WkLRIvLVml/Va4DCHK2QHkIQxfQotXOg+vQE4WADL7ks rWWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=Wv8Ar6+Vz5jpHC/sWKGAgUcZ09GVf4UIN32oPoSuMGo=; b=wxTWd8v5kLHAtf4YKl+h9elnnT7cw4JxQXgL2wN1HyuFiCGyLH0682VafL+oy+wbGW A6wbuGclRjhBqBynQrMzCfV5wEVYhA6/8li1a4jQpm7mJRmSQQRiRq4D2vs+xMQ2fl/g 0Ro4nUbUm1aey3HbCogsDjg+xNql274ty/D6XfdcDdlpVaW7Ukp6w4UUTfmvPM92cSXP s3Fe1VRqeg3x5mOCoZQHi79jB2yDnnef1ruZ7ufTl673oNMLAzeiQytHY8h1mM519AQP 3aHq/oZdfbvPh/3nn64MzgO/jmaboYUTk3Cx1ThRLbuuRz8TPrt6zoQP5KmAmhZG0NEm A0JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=HKI7OVxv; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=mnLdL50I; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id s1si4182178pjf.72.2021.06.01.08.08.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=HKI7OVxv; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=mnLdL50I; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Wv8Ar6+Vz5jpHC/sWKGAgUcZ09GVf4UIN32oPoSuMGo=; b=HKI7OVxv2j7Tcc QBUEskzAcr88zaSONhi/jVup1XgqUhelF4tZOT4YEAk2PDAVUl8X/rsznLPOCF6G3NFK8/8uRXaFE g9xLagF/k+Q1IrBeqcNboER5DYshcQQWqDXWDCgTDo0e5Ie6DL/pCEE7SYK2rSRv93cDh+bv4rsoJ M7rwmFyCPOVlr4zxwRVm/bAgOUyl4uUH16aU/sc4dcP5EgY0DJ57/FJximNrsPdyEP4531bX/CoGY eeAZuhZnYB7AODOHFP795ujidvJmyHvAS8YGMAEZYKPwQimi94+Q/gmrFQCrBROIVv2uHkpx7qfMZ 4+mpOChUj7XbVDeAGdvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60W-00H7fu-MV; Tue, 01 Jun 2021 15:08:40 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60R-00H7aI-9a for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 15:08:36 +0000 Received: by mail-wr1-x42f.google.com with SMTP id n2so14779147wrm.0 for ; Tue, 01 Jun 2021 08:08:34 -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=A4tsdVSzTEyTW8xfDSUd84WZI63N7G22QirTh+/x9MM=; b=mnLdL50IkTgsJjnm4vQ9aWLdaMvL47oT5L5dllPfEYcigA/J3Zf8iLVPI+8eR8pIfR Fplo/+NinlspP8L6xzFJH2pA2Ez/DAFrxzhdesyMYcjRCLpOuUIXxOSvU1qLeluBA7sf +kG5MX72k+XqSpSEtsmcqIdW3c+qt+I+FBM0IpNRInrzeryqoGG5HD/DhOdwB6mMzszj MFEHb+kngSSP5u4NYPIDMZ9L6vcNWAjg76dKY5lu5tHolbpimawduIEmdMfE/x4iddXA jcQHocUwqkv77wOxOH+Sqh8kXxo96LL6r8QA2GI11XZ0TN1RvmvuuEX9N7svnBc1txci AnVA== 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=A4tsdVSzTEyTW8xfDSUd84WZI63N7G22QirTh+/x9MM=; b=aEHRAJLhpP3bzn0Xk+31Jk9w3umnwknrNGT33T9/7bttPWBt9m0tGY9XvOO2rrdSZ3 vRf23+zrNonjK4gdPv7nwM/XE4FUSSSmRxTcSVuIz0dK9Y5SfX6CJngMIBgtxALxdjjJ V2/M6YLUelh5MWE89EpsNATaqEH9U6nTxjJ+JDYGDdumzezWTw+KvDoPHIAEXsemhF1M 0tEcrGd9B9GAq5XOwNZxu9WRR9KQrVhip4/Aq3NSDLlb2tN6L02U8nkTtD8VJYcUD6fF QfvI2cJdegHZkYafElbeGvH7Okl9dEbCkIJ5n/Kqxa/PS7DMWB+LGKp4uXqw1V5ZVPkK NTKw== X-Gm-Message-State: AOAM532VY79Xea+vPBMkaZVfB3g1f263CuXELw1RbJXnMBzLxfAXYBcP XtHsWoomjnoiOK7umJGCGcKlSw== X-Received: by 2002:a5d:6da9:: with SMTP id u9mr28374308wrs.264.1622560113485; Tue, 01 Jun 2021 08:08:33 -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 o129sm2822237wmo.22.2021.06.01.08.08.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:33 -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 v5 11/12] wcn36xx: Add host resume request support Date: Tue, 1 Jun 2021 16:10:00 +0100 Message-Id: <20210601151001.1450540-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_080835_387444_E9DE8BB2 X-CRM114-Status: GOOD ( 14.11 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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/respon [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42f listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org 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 Tested-by: Benjamin Li --- 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 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index e4d5e4d597f9..c697b9f3633a 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1144,6 +1144,7 @@ static int wcn36xx_resume(struct ieee80211_hw *hw) mutex_lock(&wcn->conf_mutex); vif = wcn36xx_get_first_assoc_vif(wcn); if (vif) { + 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 302877d23ecf..de0f630a82be 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2983,6 +2983,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) { @@ -3034,6 +3068,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 Tue Jun 1 15:10:01 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: 451394 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp1870893jao; Tue, 1 Jun 2021 08:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd65Dc1SICUK2VMQKfN4zrmpOGLrvzAhv9z/Nwzzz09Y/1sxI9p6k3EMERbTql99dyxTRn X-Received: by 2002:a65:6256:: with SMTP id q22mr28631322pgv.391.1622560123207; Tue, 01 Jun 2021 08:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622560123; cv=none; d=google.com; s=arc-20160816; b=qDC0Vnm8qDZ1wRGvmNcltKjGGuIUOE2hyvT4HDkKc9DWTK/nmDGuwNdOvcZ2188ycZ 7fU5k5eVh+eGifQePXcA1/ApWfM46Eh71ZY4Nvb9SnFht2uQmf20jIMYQReMie/jyCRi Ngw3tr/LZ62o4VqvTsNfHFiMsGVtKxp8Vo3l/kkIVPISAuCPj1OtcuK7wQkwCRx3L5DJ IGV+1gml6MZxcqTSNLaK4JoLt5AA9B1yI6hxbHWvdAmVpn/xDsHVLcb+dayRHPI4MMAG ee7soH2ae2LsAE1hr3oAiYMTE8x8tKfA/CkbCTT3V/FkRJdxICSIdNdq75hCKq910CYj k8tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature; bh=l6d2mR3ZhAdnAoAbH0n0WXUkWehM4bOPP92/ylPwMjw=; b=V3rtDW7DUdVCd/rRNclqovP3TueeeohNYgAmSh06vLrR5mfR7gpeyciIytuoIxB6pq ys3u4rr6YvoAKxmMXCMCUr6+Dv9BBqeCHyETUorjExcalzQ4fN5SgVFT9jyclX6O+aCj PGoeHGktL75NJfnbkCP6PWD2UOdGlp21I7l9GBKHjxhWedZIhztIOvkLMPHHpOLdB8yl 3VLQIeR7ylCyqUhDry9Z9a6EcI0YMD5OYjfM5L/QVTkF6RSNTJhm2fgZkKAyYCwLai1O efepeSlOjkP7MEzHNvJU0tENKHpIwrUORtDUvJ5ZAR01UgkuoDRTKmR4TL38lXpm285A xOYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=qFGvDduP; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=td7Ky7vI; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id m9si19725579pgv.271.2021.06.01.08.08.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20210309 header.b=qFGvDduP; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=td7Ky7vI; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l6d2mR3ZhAdnAoAbH0n0WXUkWehM4bOPP92/ylPwMjw=; b=qFGvDduPBmgEAt MSunq+35ehbs+Tk3PMnnLhgVu41Ji3wo+f2aVgmpKxrI2NndaQ7J6Kht7pWyofkXlPcbxW8O65BKX QRRs3VpOCxgBQtQ8dhnjxTbe9pDpi87/wp2weWWmb8gVMVdOg7PgJAtl5+sfuhr3nqGP0QXvsq+qt OWBrtlTXuC9zscIGYJFpYyZcMqtqVHfMBYXoPgHkUvrCe15IDshZSC6eCtRqKeLg8lv1B/Lx/Vi/M odATKzk0FFFd+kxqYGfrwqFgEE4079cG9OjQkIFn8hYQtJ42TA+fdlQ45eyqkCjI/dNizIaUe5wg5 592Ch7ymzCaR+cuOaurg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60X-00H7gV-B9; Tue, 01 Jun 2021 15:08:41 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo60S-00H7b3-9c for wcn36xx@lists.infradead.org; Tue, 01 Jun 2021 15:08:37 +0000 Received: by mail-wm1-x329.google.com with SMTP id b145-20020a1c80970000b029019c8c824054so1804970wmd.5 for ; Tue, 01 Jun 2021 08:08:35 -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=oAnhL/rLVHOlPObR2Xdk1DvWetZIgbSOpJEsqp74oTI=; b=td7Ky7vIlMGR0lzB9NGPGL4DZjzHaMJwurupmI6h/cvMBTHZd5bT55tplls//PeW3r NQQFaw9Iqpf41xUP6IlbAkhxbl2y5YUyoP3LbQHZHBNhj6nNDFn/sBbPZoo9xBI6GCpV bMd5+BJyY0YHfBtzilzIwN+9BQQ2idaM+THk8nixSlUBtiDrx+dZ2DfKOkIevtAEJXLf xxFRiKkB8SXfO+JW0pOguRDmiQ/WTqNu6c97ZscjQnWjL4FV1rW6NlY3JpLZko9t8DbQ K/+ezRt5IF8/cmDI6E9hcHkNtQHPKP7/73V44zlBZ/DfBcbUwYC9K6eKNgH+V9x3lnoV w87g== 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=oAnhL/rLVHOlPObR2Xdk1DvWetZIgbSOpJEsqp74oTI=; b=Z0oD9uAXr+WlzUwbCJrQIGlmkW5malBfoibE0V6d5i82toju8UceVeo4hc33QtTRcL WrKhL8xFBySmjK2BaP4bFxS4s1kqPCPyP0EEdil7sLpxDUoKBKgl+Btvr5NiRKlPh1DZ 2zWoWwZsw9Db3Z8Q7KLjGBc+Z7bgvIobS85VCSTjwoFajqd2ptonCdl30tbv+64GUj8t gucRtFqqUvHHFANzmv20vhik2+eYWy/7GHhmsUohaLMWEJRxuezbxS7Wf5rKSSTKRAsI 99rsgnj8DmF0atXZjBkopZg4DBgv4BYV+gI8cnUj66Mu0vtlenC9tVs+T9shSasxlXr9 GGQA== X-Gm-Message-State: AOAM531tuJkeNFrrqVy84qTVFat/iir4oLyd2A3OqRTswVI0EG8HWdip 53MbMDxLdHu8R+dxYI0ysvWsyg== X-Received: by 2002:a1c:4b0d:: with SMTP id y13mr7381400wma.179.1622560114474; Tue, 01 Jun 2021 08:08:34 -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 o129sm2822237wmo.22.2021.06.01.08.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 08:08:34 -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 v5 12/12] wcn36xx: Enable WOWLAN flags Date: Tue, 1 Jun 2021 16:10:01 +0100 Message-Id: <20210601151001.1450540-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> References: <20210601151001.1450540-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_080836_376374_727576B6 X-CRM114-Status: GOOD ( 13.60 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:329 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org 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 Tested-by: Benjamin Li --- drivers/net/wireless/ath/wcn36xx/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.30.1 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index c697b9f3633a..3a4e383b3a6c 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