From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wifi: mac80211: Remove unused wdev_to_ieee80211_vif
Date: Mon, 20 Oct 2025 16:39:44 +0000 [thread overview]
Message-ID: <aPZl0LFtls2LA6uf@gallifrey> (raw)
In-Reply-To: <30b9e7eebfc99330857f7a81c72b9eb23ea6406d.camel@sipsolutions.net>
* Johannes Berg (johannes@sipsolutions.net) wrote:
> On Sun, 2025-10-12 at 16:40 +0000, Dr. David Alan Gilbert wrote:
> > * linux@treblig.org (linux@treblig.org) wrote:
> > > From: "Dr. David Alan Gilbert" <linux@treblig.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@treblig.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 |_______/
next prev parent reply other threads:[~2025-10-20 17:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-19 0:52 [PATCH] wifi: mac80211: Remove unused wdev_to_ieee80211_vif linux
2025-10-12 16:40 ` Dr. David Alan Gilbert
2025-10-20 14:06 ` Johannes Berg
2025-10-20 16:39 ` Dr. David Alan Gilbert [this message]
2025-10-21 14:30 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aPZl0LFtls2LA6uf@gallifrey \
--to=linux@treblig.org \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox