Some cfg80211 deadcode removal
Subsystems (3)
cover Some cfg80211 deadcode removal
From: "Dr. David Alan Gilbert" <[email protected]>
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(-)
Signature · 1 line
2.46.2
PATCH 1/2 cfg80211: Remove unused cfg80211_background_cac_abort
From: "Dr. David Alan Gilbert" <[email protected]>
cfg80211_background_cac_abort() is unused.
It got renamed from cfg80211_offchan_cac_abort by commita95bfb876fa8 ("cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard")
and that was originally added in commit1507b1531981 ("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.
--- include/net/cfg80211.h | 9 --------- net/wireless/mlme.c | 8 -------- 2 files changed, 17 deletions(-)
include/net/cfg80211.h +0 -9
@@ -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
net/wireless/mlme.c +0 -8
@@ -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,
Signature · 1 line
2.46.2
Re: [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort
Quoted 48 lines · On 10/7/2024 4:23 AM, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cfg80211_background_cac_abort()is unused.
It got renamed fromcfg80211_offchan_cac_abortby commita95bfb876fa8("cfg80211: renameoffchannel_chainstructs tobackground_chainto avoid confusion with ETSI standard")and that was originally added in commit
1507b1531981("cfg80211: moveoffchan_cac_eventto a dedicated work") but never used.To me it looks like the queue is still used (I see a
queue_workin__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 <[email protected]>--- include/net/cfg80211.h | 9 --------- net/wireless/mlme.c | 8 -------- 2 files changed, 17 deletions(-)include/net/cfg80211.h +0
-9@@ -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 net/wireless/mlme.c +0
-0@@ -1226,14 +1226,6 @@ void cfg80211_background_cac_abort_wk(struct work_struct *work) NL80211_RADAR_CAC_ABORTED);
net/wireless/mlme.c void cfg80211_background_cac_abort_wk(struct work_struct *work) · line 1236
Quoted 10 lines
net/wireless/mlme.c +0
-8} -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
Re: [PATCH 1/2] cfg80211: Remove unused cfg80211_background_cac_abort
Quoted 55 lines · * Vasanthakumar Thiagarajan ([email protected]) wrote:
Quoted 52 lines · On 10/7/2024 4:23 AM, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cfg80211_background_cac_abort()is unused.
It got renamed fromcfg80211_offchan_cac_abortby commita95bfb876fa8("cfg80211: renameoffchannel_chainstructs tobackground_chainto avoid confusion with ETSI standard")and that was originally added in commit
1507b1531981("cfg80211: moveoffchan_cac_eventto a dedicated work") but never used.To me it looks like the queue is still used (I see a
queue_workin__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 <[email protected]>--- include/net/cfg80211.h | 9 --------- net/wireless/mlme.c | 8 -------- 2 files changed, 17 deletions(-)include/net/cfg80211.h +0
-9@@ -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 net/wireless/mlme.c +0
-4@@ -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); -
Quoted 8 lines
net/wireless/mlme.c void cfg80211_background_cac_abort_wk(struct work_struct *work) · line 1236
Quoted 4 lines
net/wireless/mlme.c +0
-4-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
Quoted 1 line
Vasanth
Signature · 4 lines
-----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 |_______/
PATCH 2/2 cfg80211: Remove unused cfg80211_vendor_ functions
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
cfg80211_vendor_cmd_get_sender() and cfg80211_vendor_event_alloc_ucast() were added in 2019 by commit55c1fdf0d6c5 ("cfg80211: allow sending vendor events unicast")
but never used.
Remove them.
--- include/net/cfg80211.h | 45 ------------------------------------------ net/wireless/nl80211.c | 11 ----------- 2 files changed, 56 deletions(-)
include/net/cfg80211.h +0 -45
@@ -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()
net/wireless/nl80211.c +0 -11
@@ -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) {
Signature · 1 line
2.46.2
Johannes Berg
maintainerRe: [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions
Quoted 8 lines · On Sun, 2024-10-06 at 23:53 +0100, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cfg80211_vendor_cmd_get_sender()andcfg80211_vendor_event_alloc_ucast()were added in 2019 by commit55c1fdf0d6c5("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
Re: [PATCH 2/2] cfg80211: Remove unused cfg80211_vendor_ functions
Quoted 7 lines · * Johannes Berg ([email protected]) wrote:
Quoted 6 lines · On Sun, 2024-10-06 at 23:53 +0100, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cfg80211_vendor_cmd_get_sender()andcfg80211_vendor_event_alloc_ucast()were added in 2019 by commit55c1fdf0d6c5("cfg80211: allow sending vendor events unicast")
Quoted 6 lines
Quoted 2 lines
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
Quoted 2 lines
johannes
Signature · 4 lines
-----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 |_______/