Date: Fri, 27 Dec 2024 06:58:45 +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: <322ss8n1-1334-8s6q-85s9-80nsns73724q@SerrOFQ.bet> In-Reply-To: <CAJ-Vmom1vKu-S%2BpNeVme=WyE5GmGDs_=aduCTimXPYPMKfTDwQ@mail.gmail.com> References: <CAJ-Vmom1vKu-S%2BpNeVme=WyE5GmGDs_=aduCTimXPYPMKfTDwQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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() > 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. >From looking through the code I would hypothesize that if NULL checks are not for local state most of them are either a result of copy&paste in multi-OS-ported drivers or there as a result of crashes due to race conditions/insufficient locking in net80211 and most should simply never occur. Plasting them behind a IEEE80211_CHAN_IS_DEFINED (or IS_VALID whatever you'd name it) is likely not helpful to fix the underlying issues upfront. I would wonder if most could go away or should me made sure to have a valid state (often coming along with the ANYC check anyway?). There are also plain "ANY" (no C) cases which should also be covered but they fit even less into this scheme. > 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 > -- Bjoern A. Zeeb r15:7
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?322ss8n1-1334-8s6q-85s9-80nsns73724q>