public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Some cfg80211 deadcode removal
@ 2024-10-06 22:53 linux
  2024-10-06 22:53 ` [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort linux
  2024-10-06 22:53 ` [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions linux
  0 siblings, 2 replies; 7+ messages in thread
From: linux @ 2024-10-06 22:53 UTC (permalink / raw)
  To: johannes, davem, edumazet, kuba, pabeni, linux-wireless
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

Hi,
  These are a few unused functions a script of mine
found.  They've been unused for a few years.

Dave

Dr. David Alan Gilbert (2):
  cfg80211: Remove unused cfg80211_background_cac_abort
  cfg80211: Remove unused cfg80211_vendor_ functions

 include/net/cfg80211.h | 54 ------------------------------------------
 net/wireless/mlme.c    |  8 -------
 net/wireless/nl80211.c | 11 ---------
 3 files changed, 73 deletions(-)

-- 
2.46.2


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

* [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort
  2024-10-06 22:53 [PATCH 0/2] Some cfg80211 deadcode removal linux
@ 2024-10-06 22:53 ` linux
  2024-10-07  6:59   ` Vasanthakumar Thiagarajan
  2024-10-06 22:53 ` [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions linux
  1 sibling, 1 reply; 7+ messages in thread
From: linux @ 2024-10-06 22:53 UTC (permalink / raw)
  To: johannes, davem, edumazet, kuba, pabeni, linux-wireless
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

cfg80211_background_cac_abort() is unused.
It got renamed from cfg80211_offchan_cac_abort by commit
a95bfb876fa8 ("cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard")

and that was originally added in commit
1507b1531981 ("cfg80211: move offchan_cac_event to a dedicated work")
but never used.

To me it looks like the queue is still used (I see a queue_work
in __cfg80211_radar_event), so I think it's just the wrapper that's
unused.

Remove cfg80211_background_cac_abort.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 include/net/cfg80211.h | 9 ---------
 net/wireless/mlme.c    | 8 --------
 2 files changed, 17 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 69ec1eb41a09..fd843a519329 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -8752,15 +8752,6 @@ void cfg80211_cac_event(struct net_device *netdev,
 			enum nl80211_radar_event event, gfp_t gfp,
 			unsigned int link_id);
 
-/**
- * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
- * @wiphy: the wiphy
- *
- * This function is called by the driver when a Channel Availability Check
- * (CAC) is aborted by a offchannel dedicated chain.
- */
-void cfg80211_background_cac_abort(struct wiphy *wiphy);
-
 /**
  * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
  * @dev: network device
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 4dac81854721..8ec236bbbc7c 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -1226,14 +1226,6 @@ void cfg80211_background_cac_abort_wk(struct work_struct *work)
 				      NL80211_RADAR_CAC_ABORTED);
 }
 
-void cfg80211_background_cac_abort(struct wiphy *wiphy)
-{
-	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
-
-	queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
-}
-EXPORT_SYMBOL(cfg80211_background_cac_abort);
-
 int
 cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
 					  struct wireless_dev *wdev,
-- 
2.46.2


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

* [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions
  2024-10-06 22:53 [PATCH 0/2] Some cfg80211 deadcode removal linux
  2024-10-06 22:53 ` [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort linux
@ 2024-10-06 22:53 ` linux
  2024-10-07 11:04   ` Johannes Berg
  1 sibling, 1 reply; 7+ messages in thread
From: linux @ 2024-10-06 22:53 UTC (permalink / raw)
  To: johannes, davem, edumazet, kuba, pabeni, linux-wireless
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

cfg80211_vendor_cmd_get_sender() and cfg80211_vendor_event_alloc_ucast()
were added in 2019 by commit
55c1fdf0d6c5 ("cfg80211: allow sending vendor events unicast")

but never used.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 include/net/cfg80211.h | 45 ------------------------------------------
 net/wireless/nl80211.c | 11 -----------
 2 files changed, 56 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index fd843a519329..cd3ed718efe2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -7806,16 +7806,6 @@ cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
  */
 int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
 
-/**
- * cfg80211_vendor_cmd_get_sender - get the current sender netlink ID
- * @wiphy: the wiphy
- *
- * Return: the current netlink port ID in a vendor command handler.
- *
- * Context: May only be called from a vendor command handler
- */
-unsigned int cfg80211_vendor_cmd_get_sender(struct wiphy *wiphy);
-
 /**
  * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
  * @wiphy: the wiphy
@@ -7846,41 +7836,6 @@ cfg80211_vendor_event_alloc(struct wiphy *wiphy, struct wireless_dev *wdev,
 					  0, event_idx, approxlen, gfp);
 }
 
-/**
- * cfg80211_vendor_event_alloc_ucast - alloc unicast vendor-specific event skb
- * @wiphy: the wiphy
- * @wdev: the wireless device
- * @event_idx: index of the vendor event in the wiphy's vendor_events
- * @portid: port ID of the receiver
- * @approxlen: an upper bound of the length of the data that will
- *	be put into the skb
- * @gfp: allocation flags
- *
- * This function allocates and pre-fills an skb for an event to send to
- * a specific (userland) socket. This socket would previously have been
- * obtained by cfg80211_vendor_cmd_get_sender(), and the caller MUST take
- * care to register a netlink notifier to see when the socket closes.
- *
- * If wdev != NULL, both the ifindex and identifier of the specified
- * wireless device are added to the event message before the vendor data
- * attribute.
- *
- * When done filling the skb, call cfg80211_vendor_event() with the
- * skb to send the event.
- *
- * Return: An allocated and pre-filled skb. %NULL if any errors happen.
- */
-static inline struct sk_buff *
-cfg80211_vendor_event_alloc_ucast(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  unsigned int portid, int approxlen,
-				  int event_idx, gfp_t gfp)
-{
-	return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
-					  NL80211_ATTR_VENDOR_DATA,
-					  portid, event_idx, approxlen, gfp);
-}
-
 /**
  * cfg80211_vendor_event - send the event
  * @skb: The skb, must have been allocated with cfg80211_vendor_event_alloc()
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 9ab777e0bd4d..674ab5fa6da0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -15416,17 +15416,6 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb)
 }
 EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_reply);
 
-unsigned int cfg80211_vendor_cmd_get_sender(struct wiphy *wiphy)
-{
-	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
-
-	if (WARN_ON(!rdev->cur_cmd_info))
-		return 0;
-
-	return rdev->cur_cmd_info->snd_portid;
-}
-EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_get_sender);
-
 static int nl80211_set_qos_map(struct sk_buff *skb,
 			       struct genl_info *info)
 {
-- 
2.46.2


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

* Re: [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort
  2024-10-06 22:53 ` [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort linux
@ 2024-10-07  6:59   ` Vasanthakumar Thiagarajan
  2024-10-07 11:02     ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 7+ messages in thread
From: Vasanthakumar Thiagarajan @ 2024-10-07  6:59 UTC (permalink / raw)
  To: linux, johannes, davem, edumazet, kuba, pabeni, linux-wireless
  Cc: netdev, linux-kernel



On 10/7/2024 4:23 AM, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> cfg80211_background_cac_abort() is unused.
> It got renamed from cfg80211_offchan_cac_abort by commit
> a95bfb876fa8 ("cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard")
> 
> and that was originally added in commit
> 1507b1531981 ("cfg80211: move offchan_cac_event to a dedicated work")
> but never used.
> 
> To me it looks like the queue is still used (I see a queue_work
> in __cfg80211_radar_event), so I think it's just the wrapper that's
> unused.
> 
> Remove cfg80211_background_cac_abort.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>   include/net/cfg80211.h | 9 ---------
>   net/wireless/mlme.c    | 8 --------
>   2 files changed, 17 deletions(-)
> 
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 69ec1eb41a09..fd843a519329 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -8752,15 +8752,6 @@ void cfg80211_cac_event(struct net_device *netdev,
>   			enum nl80211_radar_event event, gfp_t gfp,
>   			unsigned int link_id);
>   
> -/**
> - * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
> - * @wiphy: the wiphy
> - *
> - * This function is called by the driver when a Channel Availability Check
> - * (CAC) is aborted by a offchannel dedicated chain.
> - */
> -void cfg80211_background_cac_abort(struct wiphy *wiphy);
> -
>   /**
>    * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
>    * @dev: network device
> diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> index 4dac81854721..8ec236bbbc7c 100644
> --- a/net/wireless/mlme.c
> +++ b/net/wireless/mlme.c
> @@ -1226,14 +1226,6 @@ void cfg80211_background_cac_abort_wk(struct work_struct *work)
>   				      NL80211_RADAR_CAC_ABORTED);
>   }
>   
> -void cfg80211_background_cac_abort(struct wiphy *wiphy)
> -{
> -	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
> -
> -	queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
> -}
> -EXPORT_SYMBOL(cfg80211_background_cac_abort);
> -

We have an internal WIP ath driver implementation for background radar feature
calling this function to notify the background CAC abort state. There is definitely
real use case for this function.

Vasanth

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

* Re: [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort
  2024-10-07  6:59   ` Vasanthakumar Thiagarajan
@ 2024-10-07 11:02     ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2024-10-07 11:02 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan
  Cc: johannes, davem, edumazet, kuba, pabeni, linux-wireless, netdev,
	linux-kernel

* Vasanthakumar Thiagarajan (quic_vthiagar@quicinc.com) wrote:
> 
> 
> On 10/7/2024 4:23 AM, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > 
> > cfg80211_background_cac_abort() is unused.
> > It got renamed from cfg80211_offchan_cac_abort by commit
> > a95bfb876fa8 ("cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard")
> > 
> > and that was originally added in commit
> > 1507b1531981 ("cfg80211: move offchan_cac_event to a dedicated work")
> > but never used.
> > 
> > To me it looks like the queue is still used (I see a queue_work
> > in __cfg80211_radar_event), so I think it's just the wrapper that's
> > unused.
> > 
> > Remove cfg80211_background_cac_abort.
> > 
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> > ---
> >   include/net/cfg80211.h | 9 ---------
> >   net/wireless/mlme.c    | 8 --------
> >   2 files changed, 17 deletions(-)
> > 
> > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> > index 69ec1eb41a09..fd843a519329 100644
> > --- a/include/net/cfg80211.h
> > +++ b/include/net/cfg80211.h
> > @@ -8752,15 +8752,6 @@ void cfg80211_cac_event(struct net_device *netdev,
> >   			enum nl80211_radar_event event, gfp_t gfp,
> >   			unsigned int link_id);
> > -/**
> > - * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
> > - * @wiphy: the wiphy
> > - *
> > - * This function is called by the driver when a Channel Availability Check
> > - * (CAC) is aborted by a offchannel dedicated chain.
> > - */
> > -void cfg80211_background_cac_abort(struct wiphy *wiphy);
> > -
> >   /**
> >    * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
> >    * @dev: network device
> > diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> > index 4dac81854721..8ec236bbbc7c 100644
> > --- a/net/wireless/mlme.c
> > +++ b/net/wireless/mlme.c
> > @@ -1226,14 +1226,6 @@ void cfg80211_background_cac_abort_wk(struct work_struct *work)
> >   				      NL80211_RADAR_CAC_ABORTED);
> >   }
> > -void cfg80211_background_cac_abort(struct wiphy *wiphy)
> > -{
> > -	struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
> > -
> > -	queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
> > -}
> > -EXPORT_SYMBOL(cfg80211_background_cac_abort);
> > -
> 
> We have an internal WIP ath driver implementation for background radar feature
> calling this function to notify the background CAC abort state. There is definitely
> real use case for this function.

OK, fair enough.

What about the other patch?

Dave

> Vasanth
-- 
 -----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] 7+ messages in thread

* Re: [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions
  2024-10-06 22:53 ` [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions linux
@ 2024-10-07 11:04   ` Johannes Berg
  2024-10-07 11:29     ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2024-10-07 11:04 UTC (permalink / raw)
  To: linux, davem, edumazet, kuba, pabeni, linux-wireless; +Cc: netdev, linux-kernel

On Sun, 2024-10-06 at 23:53 +0100, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> cfg80211_vendor_cmd_get_sender() and cfg80211_vendor_event_alloc_ucast()
> were added in 2019 by commit
> 55c1fdf0d6c5 ("cfg80211: allow sending vendor events unicast")
> 
> but never used.
> 

Yeah ... we have out-of-tree code using this for CSI matrix stuff
(sensing), but I guess we can keep this API out-of-tree just as well,
though it'll make it harder to integrate in ChromeOS.

johannes

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

* Re: [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions
  2024-10-07 11:04   ` Johannes Berg
@ 2024-10-07 11:29     ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2024-10-07 11:29 UTC (permalink / raw)
  To: Johannes Berg
  Cc: davem, edumazet, kuba, pabeni, linux-wireless, netdev,
	linux-kernel

* Johannes Berg (johannes@sipsolutions.net) wrote:
> On Sun, 2024-10-06 at 23:53 +0100, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > 
> > cfg80211_vendor_cmd_get_sender() and cfg80211_vendor_event_alloc_ucast()
> > were added in 2019 by commit
> > 55c1fdf0d6c5 ("cfg80211: allow sending vendor events unicast")
> > 
> > but never used.
> > 
> 
> Yeah ... we have out-of-tree code using this for CSI matrix stuff
> (sensing), but I guess we can keep this API out-of-tree just as well,
> though it'll make it harder to integrate in ChromeOS.

Obviously it's the maintainers call as which way to go.
I guess the best outcome would be for that out-of-tree code to land in
the tree!

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] 7+ messages in thread

end of thread, other threads:[~2024-10-07 11:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-06 22:53 [PATCH 0/2] Some cfg80211 deadcode removal linux
2024-10-06 22:53 ` [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort linux
2024-10-07  6:59   ` Vasanthakumar Thiagarajan
2024-10-07 11:02     ` Dr. David Alan Gilbert
2024-10-06 22:53 ` [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions linux
2024-10-07 11:04   ` Johannes Berg
2024-10-07 11:29     ` 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