lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aPZl0LFtls2LA6uf@gallifrey>
Date: Mon, 20 Oct 2025 16:39:44 +0000
From: "Dr. David Alan Gilbert" <linux@...blig.org>
To: Johannes Berg <johannes@...solutions.net>
Cc: linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] wifi: mac80211: Remove unused wdev_to_ieee80211_vif

* Johannes Berg (johannes@...solutions.net) wrote:
> On Sun, 2025-10-12 at 16:40 +0000, Dr. David Alan Gilbert wrote:
> > * linux@...blig.org (linux@...blig.org) wrote:
> > > From: "Dr. David Alan Gilbert" <linux@...blig.org>
> > > 
> > > wdev_to_ieee80211_vif() was added in 2013 by
> > > commit ad7e718c9b4f ("nl80211: vendor command support")
> > > but has remained unused.
> > > 
> > > Remove it.
> > > 
> > > Signed-off-by: Dr. David Alan Gilbert <linux@...blig.org>
> > 
> > Hi,
> >   Gentle ping on this one please.

Hi Johannes,
  Thanks for the reply,

> This was/is used elsewhere out-of-tree, so I had dropped this change, at
> least for now.

OK, I've made a note.

> I guess that's really not a good excuse though.

So what is it about these out of tree things that needs these calls;
why don't the in tree ones need it?

Dave

> 
> I guess drivers could instead ieee80211_iterate_active_interfaces_mtx()
> and find the right wdev from that list, like
> 
> 
> struct wdev_find_vif_iter {
> 	struct wireless_dev *wdev;
> 	struct ieee80211_vif *vif;
> };
> 
> static void wdev_find_vif_iter_fn(void *data, u8 *mac, struct ieee80211_vif *vif)
> {
> 	struct wdev_find_vif_iter *iter = data;
> 
> 	if (ieee80211_vif_to_wdev(vif) == iter->wdev)
> 		iter->vif = vif;
> }
> 
> struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev)
> {
> 	struct wdev_find_vif_iter iter = {
> 		.wdev = wdev,
> 	};
> 
> 	ieee80211_iterate_active_interfaces_mtx(wiphy_to_ieee80211_hw(wdev->wiphy),
> 						IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER,
> 						wdev_find_vif_iter_fn, &iter);
> 
> 	return iter.vif;
> }
> 
> 
> but I guess I'm not sure it's really better for drivers to have that vs.
> upstream carrying the unused function.
> 
> 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   |_______/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ