Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2025 18:01:50 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@freebsd.org>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        freebsd-wireless <freebsd-wireless@freebsd.org>
Subject:   Re: net80211 channel cleanup - IEEE80211_IS_CHAN_DEFINED() / IEEE80211_IS_CHAN_ANYC()
Message-ID:  <2846qs8s-3503-s299-1158-sppp2r312293@serrofq.bet>
In-Reply-To: <CAJ-Vmo=j3tyquMmZxw62zmj9%2BPVdtk%2BROGYE=MCKCEB-E=ux1Q@mail.gmail.com>
References:  <CAJ-Vmom1vKu-S%2BpNeVme=WyE5GmGDs_=aduCTimXPYPMKfTDwQ@mail.gmail.com> <322ss8n1-1334-8s6q-85s9-80nsns73724q@SerrOFQ.bet> <CAJ-Vmo=j3tyquMmZxw62zmj9%2BPVdtk%2BROGYE=MCKCEB-E=ux1Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 27 Dec 2024, Adrian Chadd wrote:

> On Thu, 26 Dec 2024 at 22:58, Bjoern A. Zeeb <bz@freebsd.org> wrote:
>
>> On Sat, 21 Dec 2024, Adrian Chadd wrote:
>>
>>> hi!
>>>
>>> i've started on the bare minimum to start cleaning up the way we handle
>>> channels in net80211. The first part - no matter what direction we
>>> eventually DO go - is to try and remove all of the direct pointer
>>> comparisons and dereferences that are going on.
>>>
>>> So along this topic, i've created a diff to demonstrate a couple of those
>>> cases:
>>>
>>> https://reviews.freebsd.org/D48172
>>>
>>> Specifically:
>>>
>>> * IEEE80211_IS_CHAN_DEFINED() returns true if the channel isn't null; and
>>
>> I am sceptical about this one; see further below.
>>
>>
>>> * IEEE80211_IS_CHAN_ANYC() returns true if the channel is the "any
>> channel"
>>> channel (ie IEEE80211_CHAN_ANYC).
>>
>> I would suggest to keep the IEEE80211_CHAN_ prefix and insert the IS
>> after that: IEEE80211_CHAN_IS_ANYC()
>>
>
> ok, why's that? All of the other mcaros are IEEE80211_IS_CHAN_xxx().
> (I don't mind renaming it, I'm just curious why!)

Grml. Yes.  So be it.  The flags are all IEEE80211_CHAN_* and it
would've been nice to have the common prefix for all channel stuff but
history...

>> There are also plain "ANY" (no C) cases which should also be covered but
>> they fit even less into this scheme.
>>
>
> Which ones? I want to make sure those get covered too.

I just grepped and didn't go through them anymore in drivers ...
There seem to be two halfs in this output unintenionally nicely ordered
;-)

sys/dev/bwi/bwiphy.c:   if (chan == IEEE80211_CHAN_ANY)
sys/dev/bwi/bwirf.c:    rf->rf_curchan = IEEE80211_CHAN_ANY;
sys/dev/bwi/bwirf.c:    if (chan == IEEE80211_CHAN_ANY)
sys/dev/bwi/bwirf.c:    if (chan == IEEE80211_CHAN_ANY) {
sys/dev/ral/rt2560.c:   KASSERT(chan != 0 && chan != IEEE80211_CHAN_ANY, ("chan 0x%x", chan));
sys/dev/ral/rt2661.c:   KASSERT(chan != 0 && chan != IEEE80211_CHAN_ANY, ("chan 0x%x", chan));
sys/dev/ral/rt2860.c:   if (chan == 0 || chan == IEEE80211_CHAN_ANY)
sys/dev/usb/wlan/if_rum.c:      if (chan == 0 || chan == IEEE80211_CHAN_ANY)
sys/dev/usb/wlan/if_run.c:      if (chan == 0 || chan == IEEE80211_CHAN_ANY)
sys/dev/usb/wlan/if_upgt.c:     if (channel == 0 || channel == IEEE80211_CHAN_ANY) {
sys/dev/usb/wlan/if_ural.c:     if (chan == 0 || chan == IEEE80211_CHAN_ANY)
sys/dev/usb/wlan/if_zyd.c:      if (chan == 0 || chan == IEEE80211_CHAN_ANY) {


-- 
Bjoern A. Zeeb                                                     r15:7



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2846qs8s-3503-s299-1158-sppp2r312293>