net80211 channel cleanup - IEEE80211_IS_CHAN_DEFINED() / IEEE80211_IS_CHAN_ANYC()

From: Adrian Chadd <adrian_at_freebsd.org>
Date: Sat, 21 Dec 2024 20:43:38 UTC
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
* IEEE80211_IS_CHAN_ANYC() returns true if the channel is the "any channel"
channel (ie IEEE80211_CHAN_ANYC).

There are a bunch of places in net80211 and sys/dev that manually check if
the channel is NULL / the channel is/isn't ANYC. My proposal is we go
through, find them all and convert them to these macros.

I'd appreciate feedback! If everyone's ok with this and it gets landed,
then this can be a nice mini-project for someone to go get dirty in the
net80211 stack / wireless drivers and participate a bit in the general
cleanup.

Thanks,


-adrian