linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] wifi: mac80211: Deadcode cleanup
@ 2024-12-24  1:32 linux
  2024-12-24  1:32 ` [PATCH 1/2] wifi: mac80211: Clean up debugfs_key deadcode linux
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: linux @ 2024-12-24  1:32 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

Hi,
  This pair of patches removes a bunch of functions that haven't
been called for more than a few years.

I suspect I could go further; in particular I wonder
if
  ieee80211_debugfs_key_remove_beacon_default()
and
  ieee80211_debugfs_key_remove_mgmt_default()

could go together with a data structure somewhere?

Also, ieee80211_nan_func_match() was the last use of
cfg80211_nan_match(); but that would be in a separate area.

Dave

Dr. David Alan Gilbert (2):
  wifi: mac80211: Clean up debugfs_key deadcode
  wifi: mac80211: Remove unused ieee80211_nan_func_match

 include/net/mac80211.h     | 15 ------------
 net/mac80211/cfg.c         | 25 --------------------
 net/mac80211/debugfs_key.c | 47 --------------------------------------
 net/mac80211/debugfs_key.h | 15 ------------
 4 files changed, 102 deletions(-)

-- 
2.47.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] wifi: mac80211: Clean up debugfs_key deadcode
  2024-12-24  1:32 [PATCH 0/2] wifi: mac80211: Deadcode cleanup linux
@ 2024-12-24  1:32 ` linux
  2024-12-24  1:32 ` [PATCH 2/2] wifi: mac80211: Remove unused ieee80211_nan_func_match linux
  2025-01-28 18:39 ` [PATCH 0/2] wifi: mac80211: Deadcode cleanup Dr. David Alan Gilbert
  2 siblings, 0 replies; 6+ messages in thread
From: linux @ 2024-12-24  1:32 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

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 <linux@treblig.org>
---
 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 */
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] wifi: mac80211: Remove unused ieee80211_nan_func_match
  2024-12-24  1:32 [PATCH 0/2] wifi: mac80211: Deadcode cleanup linux
  2024-12-24  1:32 ` [PATCH 1/2] wifi: mac80211: Clean up debugfs_key deadcode linux
@ 2024-12-24  1:32 ` linux
  2025-01-28 18:39 ` [PATCH 0/2] wifi: mac80211: Deadcode cleanup Dr. David Alan Gilbert
  2 siblings, 0 replies; 6+ messages in thread
From: linux @ 2024-12-24  1:32 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

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 <linux@treblig.org>
---
 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)
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] wifi: mac80211: Deadcode cleanup
  2024-12-24  1:32 [PATCH 0/2] wifi: mac80211: Deadcode cleanup linux
  2024-12-24  1:32 ` [PATCH 1/2] wifi: mac80211: Clean up debugfs_key deadcode linux
  2024-12-24  1:32 ` [PATCH 2/2] wifi: mac80211: Remove unused ieee80211_nan_func_match linux
@ 2025-01-28 18:39 ` Dr. David Alan Gilbert
  2025-01-28 19:33   ` Johannes Berg
  2 siblings, 1 reply; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2025-01-28 18:39 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: linux-kernel

* linux@treblig.org (linux@treblig.org) wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> Hi,
>   This pair of patches removes a bunch of functions that haven't
> been called for more than a few years.
> 
> I suspect I could go further; in particular I wonder
> if
>   ieee80211_debugfs_key_remove_beacon_default()
> and
>   ieee80211_debugfs_key_remove_mgmt_default()
> 
> could go together with a data structure somewhere?
> 
> Also, ieee80211_nan_func_match() was the last use of
> cfg80211_nan_match(); but that would be in a separate area.
> 
> Dave
> 
> Dr. David Alan Gilbert (2):
>   wifi: mac80211: Clean up debugfs_key deadcode
>   wifi: mac80211: Remove unused ieee80211_nan_func_match

Hi,
  I noticed one of these patches (debugfs_key) has landed in 6.14
but the other one I don't think has - any particular reason?

Dave

> 
>  include/net/mac80211.h     | 15 ------------
>  net/mac80211/cfg.c         | 25 --------------------
>  net/mac80211/debugfs_key.c | 47 --------------------------------------
>  net/mac80211/debugfs_key.h | 15 ------------
>  4 files changed, 102 deletions(-)
> 
> -- 
> 2.47.1
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] wifi: mac80211: Deadcode cleanup
  2025-01-28 18:39 ` [PATCH 0/2] wifi: mac80211: Deadcode cleanup Dr. David Alan Gilbert
@ 2025-01-28 19:33   ` Johannes Berg
  2025-01-28 19:53     ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2025-01-28 19:33 UTC (permalink / raw)
  To: Dr. David Alan Gilbert, linux-wireless; +Cc: linux-kernel

On Tue, 2025-01-28 at 18:39 +0000, Dr. David Alan Gilbert wrote:
> 
> >   wifi: mac80211: Remove unused ieee80211_nan_func_match
> 
> Hi,
>   I noticed one of these patches (debugfs_key) has landed in 6.14
> but the other one I don't think has - any particular reason?

We were still using NAN internally, and there's a chance that it might
make a comeback, so I was holding off on it for now.

johannes

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] wifi: mac80211: Deadcode cleanup
  2025-01-28 19:33   ` Johannes Berg
@ 2025-01-28 19:53     ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2025-01-28 19:53 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, linux-kernel

* Johannes Berg (johannes@sipsolutions.net) wrote:
> On Tue, 2025-01-28 at 18:39 +0000, Dr. David Alan Gilbert wrote:
> > 
> > >   wifi: mac80211: Remove unused ieee80211_nan_func_match
> > 
> > Hi,
> >   I noticed one of these patches (debugfs_key) has landed in 6.14
> > but the other one I don't think has - any particular reason?
> 
> We were still using NAN internally, and there's a chance that it might
> make a comeback, so I was holding off on it for now.

Ah OK.

Thanks!

Dave

> johannes
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-01-28 19:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-24  1:32 [PATCH 0/2] wifi: mac80211: Deadcode cleanup linux
2024-12-24  1:32 ` [PATCH 1/2] wifi: mac80211: Clean up debugfs_key deadcode linux
2024-12-24  1:32 ` [PATCH 2/2] wifi: mac80211: Remove unused ieee80211_nan_func_match linux
2025-01-28 18:39 ` [PATCH 0/2] wifi: mac80211: Deadcode cleanup Dr. David Alan Gilbert
2025-01-28 19:33   ` Johannes Berg
2025-01-28 19:53     ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).