From patchwork Sun Nov 29 13:14:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 334629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2700C71156 for ; Sun, 29 Nov 2020 13:15:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE03F20705 for ; Sun, 29 Nov 2020 13:15:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727936AbgK2NPi (ORCPT ); Sun, 29 Nov 2020 08:15:38 -0500 Received: from paleale.coelho.fi ([176.9.41.70]:33424 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727892AbgK2NPf (ORCPT ); Sun, 29 Nov 2020 08:15:35 -0500 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kjMXQ-0035gF-10; Sun, 29 Nov 2020 15:14:48 +0200 From: Luca Coelho To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org Date: Sun, 29 Nov 2020 15:14:35 +0200 Message-Id: X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201129131442.1857561-1-luca@coelho.fi> References: <20201129131442.1857561-1-luca@coelho.fi> MIME-Version: 1.0 Subject: [PATCH 05/12] cfg80211: flush scan entries upon suspend Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Emmanuel Grumbach When we suspend, we can't really remember our BSS table. Purge all the data. Export this function to allow driver to purge the BSS table in case they feel the need to. iwlwifi will need to do that. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho --- include/net/cfg80211.h | 6 ++++++ net/wireless/sysfs.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 661edfc8722e..67335a6a1816 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -8026,4 +8026,10 @@ void cfg80211_update_owe_info_event(struct net_device *netdev, */ void cfg80211_bss_flush(struct wiphy *wiphy); +/** + * cfg80211_bss_flush - resets all the scan entries + * @wiphy: the wiphy + */ +void cfg80211_bss_flush(struct wiphy *wiphy); + #endif /* __NET_CFG80211_H */ diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c index 3ac1f48195d2..b670f0d78621 100644 --- a/net/wireless/sysfs.c +++ b/net/wireless/sysfs.c @@ -5,6 +5,7 @@ * * Copyright 2005-2006 Jiri Benc * Copyright 2006 Johannes Berg + * Copyright (C) 2020 Intel Corporation */ #include @@ -107,6 +108,7 @@ static int wiphy_suspend(struct device *dev) if (rdev->wiphy.registered) { if (!rdev->wiphy.wowlan_config) { cfg80211_leave_all(rdev); + cfg80211_bss_flush(&rdev->wiphy); cfg80211_process_rdev_events(rdev); } if (rdev->ops->suspend)