From patchwork Tue Dec 24 01:32:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13919579 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C763139D; Tue, 24 Dec 2024 01:33:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735003984; cv=none; b=JiLKTHnT/DXKTNmKq6vwZ5NQ4zt3c1ukuNU+7wybu9YYFxeSEBcxxEndkON/nX9i2RtuB7WSCFe/cjzAEzBjZMUeepjZRQ/D0YTv60Qc7FkiwmqJ/1qwFJp63PxklitV2Iepy2X2D3tKLZybrjz6T9ZwQ8DwjPMU+2+UInrDQRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735003984; c=relaxed/simple; bh=/3RA0jnSH3S8QwTSON0xgsl/KDiYU1P4Ws16sfE4qnY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UtAJef8IBvJehFH+J05qixHmVaMda+J6uSUjFRW8GvtjrUiHlrCVL0ReGzQpHX07KBqCuEeCgVAcGPu3uyrEAFBhqPMd4tI6kS4/yqn1u3vpo4u9row/Bj/2Cdjz2/+oQ1Bxx6h8tChTW0+HHg+TcvBdGtQ2mn3gQq930uAm2Ok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=mGDgUTHn; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="mGDgUTHn" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=wDgeQdZmmkR227GhLvh6GOgLONdDJz0d2NeCCr0pQqk=; b=mGDgUTHnSkqRNech OKyrqhxJiItkNVl+rU70bXfcPNZoxHxFOfC3X5OmMv58YD3GM46AZoOP5mtqyXBYJwIUANl9rmDP8 +wieQ0NCDtx0hMIPY1fDUx57FeZ+KPkD4s8ekm9isYLtSLDJGvawyztCgCfzsqFGuOg3c0DcMRqr1 swpoTNf83ENXtdr+98/kwQRsBjX2tusdwVD5mwbIy2uABAZpw1NjnhPFWiRI8FQ0syj4dUT28cey2 qVTPQAkKIUUPPMzNLVJLpY4wwdXBqqiJjkBMZPYzbJio+ycIE5gEDHwP8gjUMVhZXUNXVtZzvTf+m Tu9IjslrPP/PY5YUZg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1tPtn9-006wDg-1p; Tue, 24 Dec 2024 01:32:59 +0000 From: linux@treblig.org To: johannes@sipsolutions.net, linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 1/2] wifi: mac80211: Clean up debugfs_key deadcode Date: Tue, 24 Dec 2024 01:32:56 +0000 Message-ID: <20241224013257.185742-2-linux@treblig.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241224013257.185742-1-linux@treblig.org> References: <20241224013257.185742-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" The last use of ieee80211_debugfs_key_sta_del() was removed in 2007 by commit 11a843b7e160 ("[MAC80211]: rework key handling") The last use of ieee80211_debugfs_key_add_mgmt_default() was removed in 2010 by commit f7e0104c1a4e ("mac80211: support separate default keys") The last use of ieee80211_debugfs_key_add_beacon_default() was removed in 2020 by commit e5473e80d467 ("mac80211: Support BIGTK configuration for Beacon protection") Remove them. Signed-off-by: Dr. David Alan Gilbert --- net/mac80211/debugfs_key.c | 47 -------------------------------------- net/mac80211/debugfs_key.h | 15 ------------ 2 files changed, 62 deletions(-) diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c index b3a64edea0f2..117f58af5ff9 100644 --- a/net/mac80211/debugfs_key.c +++ b/net/mac80211/debugfs_key.c @@ -402,25 +402,6 @@ void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata) } } -void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata) -{ - char buf[50]; - struct ieee80211_key *key; - - if (!sdata->vif.debugfs_dir) - return; - - key = wiphy_dereference(sdata->local->hw.wiphy, - sdata->deflink.default_mgmt_key); - if (key) { - sprintf(buf, "../keys/%d", key->debugfs.cnt); - sdata->debugfs.default_mgmt_key = - debugfs_create_symlink("default_mgmt_key", - sdata->vif.debugfs_dir, buf); - } else - ieee80211_debugfs_key_remove_mgmt_default(sdata); -} - void ieee80211_debugfs_key_remove_mgmt_default(struct ieee80211_sub_if_data *sdata) { if (!sdata) @@ -430,27 +411,6 @@ void ieee80211_debugfs_key_remove_mgmt_default(struct ieee80211_sub_if_data *sda sdata->debugfs.default_mgmt_key = NULL; } -void -ieee80211_debugfs_key_add_beacon_default(struct ieee80211_sub_if_data *sdata) -{ - char buf[50]; - struct ieee80211_key *key; - - if (!sdata->vif.debugfs_dir) - return; - - key = wiphy_dereference(sdata->local->hw.wiphy, - sdata->deflink.default_beacon_key); - if (key) { - sprintf(buf, "../keys/%d", key->debugfs.cnt); - sdata->debugfs.default_beacon_key = - debugfs_create_symlink("default_beacon_key", - sdata->vif.debugfs_dir, buf); - } else { - ieee80211_debugfs_key_remove_beacon_default(sdata); - } -} - void ieee80211_debugfs_key_remove_beacon_default(struct ieee80211_sub_if_data *sdata) { @@ -460,10 +420,3 @@ ieee80211_debugfs_key_remove_beacon_default(struct ieee80211_sub_if_data *sdata) debugfs_remove(sdata->debugfs.default_beacon_key); sdata->debugfs.default_beacon_key = NULL; } - -void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, - struct sta_info *sta) -{ - debugfs_remove(key->debugfs.stalink); - key->debugfs.stalink = NULL; -} diff --git a/net/mac80211/debugfs_key.h b/net/mac80211/debugfs_key.h index af7cf495f8d1..e17a48d5c6cc 100644 --- a/net/mac80211/debugfs_key.h +++ b/net/mac80211/debugfs_key.h @@ -6,16 +6,10 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key); void ieee80211_debugfs_key_remove(struct ieee80211_key *key); void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata); -void ieee80211_debugfs_key_add_mgmt_default( - struct ieee80211_sub_if_data *sdata); void ieee80211_debugfs_key_remove_mgmt_default( struct ieee80211_sub_if_data *sdata); -void ieee80211_debugfs_key_add_beacon_default( - struct ieee80211_sub_if_data *sdata); void ieee80211_debugfs_key_remove_beacon_default( struct ieee80211_sub_if_data *sdata); -void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, - struct sta_info *sta); #else static inline void ieee80211_debugfs_key_add(struct ieee80211_key *key) {} @@ -24,21 +18,12 @@ static inline void ieee80211_debugfs_key_remove(struct ieee80211_key *key) static inline void ieee80211_debugfs_key_update_default( struct ieee80211_sub_if_data *sdata) {} -static inline void ieee80211_debugfs_key_add_mgmt_default( - struct ieee80211_sub_if_data *sdata) -{} static inline void ieee80211_debugfs_key_remove_mgmt_default( struct ieee80211_sub_if_data *sdata) {} -static inline void ieee80211_debugfs_key_add_beacon_default( - struct ieee80211_sub_if_data *sdata) -{} static inline void ieee80211_debugfs_key_remove_beacon_default( struct ieee80211_sub_if_data *sdata) {} -static inline void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, - struct sta_info *sta) -{} #endif #endif /* __MAC80211_DEBUGFS_KEY_H */ From patchwork Tue Dec 24 01:32:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13919580 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4D0E3FE4; Tue, 24 Dec 2024 01:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735003984; cv=none; b=TCSusf25haXjwKethPtKWR/HXmYojY66PFYq8G+cRIpJ/8DJBJlxe+gOL5hTMlG0i2UMymYOwZ/W7arDJtSm6ZeIAcLTBMw9c6eE7UcoXcEqXwrxWvqomRF0Y4aCEH3jrawDtf0D6xN9hhPbKVYsQLyX1ym9nrDJz613OUA6ELk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735003984; c=relaxed/simple; bh=bkOlsJMCEhswxSQkLahHchzZI3J0JbslmKmDz4pDc78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gTehk3hvi6dWdspGfvXpWsWrxYyuhnKPd+qW0dhuoKl6AjqJznoex4j0mDQrifEF1zEouNxRINjDb7243LD3Wg6pVZ1JZ2q6a9JRxSs38WNSBbfwepT+G+OraOpzNBVduj+Ji8bOAuRQ2COFSNSofXUjKzJN9KXUrzMpVTNPS6E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=os25GmIg; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="os25GmIg" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=hBSa9Rn0CkNbYuUWFc1n920EK0yIZQ8wal1JvWTl5/s=; b=os25GmIgt9Z0JJcu 9HR7MgT8G4KXCSaiduuCGlCxp882OPNfgvkIZfyG8JSy+KWktbBf9cMndMTdH29Q7iPcS83VewUpZ q5s3/4aEGY4WBBCNAk8mLFGRWfhxgUAsHsYv6C8BWlCM95k3xQl5hNFfUp8zsd8MUHlrXBAI8x23Z pFQAf01F+twvJK23urwfwEy69oUAvl72Ehkb5zFwtkRO5YQcKXORbriPLQKS1fj/9hqHw3IxMFHLM +wkPKtrpGjs2GOSkiKdJWd2Hh0W7LE82w0uPFWaWF6Z/77s7j6VQsEjUOnK+AhsYnKUyZBChXMTAi wXcZrjrdlmwyIUi4JQ==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1tPtnA-006wDg-2S; Tue, 24 Dec 2024 01:33:00 +0000 From: linux@treblig.org To: johannes@sipsolutions.net, linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 2/2] wifi: mac80211: Remove unused ieee80211_nan_func_match Date: Tue, 24 Dec 2024 01:32:57 +0000 Message-ID: <20241224013257.185742-3-linux@treblig.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241224013257.185742-1-linux@treblig.org> References: <20241224013257.185742-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" ieee80211_nan_func_match() was explicitly added in 2016 by commit 92bc43bce284 ("mac80211: Add API to report NAN function match") but has remained unused. Remove it. Signed-off-by: Dr. David Alan Gilbert --- include/net/mac80211.h | 15 --------------- net/mac80211/cfg.c | 25 ------------------------- 2 files changed, 40 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index ab8dce1f2c27..47d67b1f7d02 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -7550,21 +7550,6 @@ void ieee80211_nan_func_terminated(struct ieee80211_vif *vif, enum nl80211_nan_func_term_reason reason, gfp_t gfp); -/** - * ieee80211_nan_func_match - notify about NAN function match event. - * - * This function is used to notify mac80211 about NAN function match. The - * cookie inside the match struct will be assigned by mac80211. - * Note that this function can't be called from hard irq. - * - * @vif: &struct ieee80211_vif pointer from the add_interface callback. - * @match: match event information - * @gfp: allocation flags - */ -void ieee80211_nan_func_match(struct ieee80211_vif *vif, - struct cfg80211_nan_match_params *match, - gfp_t gfp); - /** * ieee80211_calc_rx_airtime - calculate estimated transmission airtime for RX. * diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index d3fc158ccaf6..50b4ec777349 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4525,31 +4525,6 @@ void ieee80211_nan_func_terminated(struct ieee80211_vif *vif, } EXPORT_SYMBOL(ieee80211_nan_func_terminated); -void ieee80211_nan_func_match(struct ieee80211_vif *vif, - struct cfg80211_nan_match_params *match, - gfp_t gfp) -{ - struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); - struct cfg80211_nan_func *func; - - if (WARN_ON(vif->type != NL80211_IFTYPE_NAN)) - return; - - spin_lock_bh(&sdata->u.nan.func_lock); - - func = idr_find(&sdata->u.nan.function_inst_ids, match->inst_id); - if (WARN_ON(!func)) { - spin_unlock_bh(&sdata->u.nan.func_lock); - return; - } - match->cookie = func->cookie; - - spin_unlock_bh(&sdata->u.nan.func_lock); - - cfg80211_nan_match(ieee80211_vif_to_wdev(vif), match, gfp); -} -EXPORT_SYMBOL(ieee80211_nan_func_match); - static int ieee80211_set_multicast_to_unicast(struct wiphy *wiphy, struct net_device *dev, const bool enabled)