From nobody Thu Jan 9 01:32:11 2025 X-Original-To: freebsd-wireless@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YT6j82dzPz5kQG7 for ; Thu, 09 Jan 2025 01:32:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YT6j72zKyz53Vw; Thu, 9 Jan 2025 01:32:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of adrian.chadd@gmail.com designates 209.85.167.49 as permitted sender) smtp.mailfrom=adrian.chadd@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-540218726d5so389671e87.2; Wed, 08 Jan 2025 17:32:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736386344; x=1736991144; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jxQvpGkOrp6pNQtccgyDpGxSV07VnV0R7GrSDxv1pRs=; b=l8f2e04H61I8X6989cB0Mne/DOk3KJJtSBiaPw2eV59BpsxmXFvyITTiBO3k+K5gjs AMHsc26rqf+Gc99DoK08V4q4mxvtaG0OCq8yErRkrThdLiksRsRIgQHdgSKR+MPjfjsL ZeYqbvzv2s3c8v8jm5VYxmcYG7mxZGiDeyqpHCRmKWMy/EdgyJnXuE3XT1M7IPywnVx4 46ctUep9Nrb04TEKHofPWpnNkh4aafTfs2IfsJDLWflem1izKsoj8p3KBjcLiVHW+Ul8 4U5nUQJQu6B/kbvz69E3Q879Kyz8nHJ36uFNNt7ENM/3xVKrXgcIxxUJhI1GtwGuexkE BTsg== X-Gm-Message-State: AOJu0YxxkzNxTGQ3oS8OgnIDZ/9HfxLO6drzE64SzgpchX2cnHqaGBPn WRsX6T7Y3tIx1Z2B7Z4Q9pSAgqRm388g/zKi9pVAffqV7AaGz10os9hLLf9OlbFSP437Y2GJfID RU9znqHPb8gMwgJbs80biS8uwc0qKzg== X-Gm-Gg: ASbGnctifzXfDcrQEdHHqRL54XrTpKaNyLXPynTeS8dzaBfCSyhnKauVY/alxYyi8pl EpKMVKqnWe78get6QPdd2Lsf1EYRgcSaF9MeoUIU= X-Google-Smtp-Source: AGHT+IE3Vk40h08IM+yAZD0jzhAgXAxKdb3EYzr7ZCiKIgqihilMY538pDT4zAX4nFSucIeEwFJ8t2PBEedwmqhP+1A= X-Received: by 2002:a05:6512:238c:b0:540:255d:42d7 with SMTP id 2adb3069b0e04-542845ba961mr1359861e87.23.1736386343766; Wed, 08 Jan 2025 17:32:23 -0800 (PST) List-Id: Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-wireless List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-wireless@freebsd.org Sender: owner-freebsd-wireless@FreeBSD.org MIME-Version: 1.0 References: <322ss8n1-1334-8s6q-85s9-80nsns73724q@SerrOFQ.bet> <2846qs8s-3503-s299-1158-sppp2r312293@serrofq.bet> In-Reply-To: <2846qs8s-3503-s299-1158-sppp2r312293@serrofq.bet> From: Adrian Chadd Date: Wed, 8 Jan 2025 17:32:11 -0800 X-Gm-Features: AbW1kvYtjlc12tCTdRcNv5TB7zuMR9LCb01Ln2OUBgXP0n2Gn8fX-UkVkMrVubE Message-ID: Subject: Re: net80211 channel cleanup - IEEE80211_IS_CHAN_DEFINED() / IEEE80211_IS_CHAN_ANYC() To: "Bjoern A. Zeeb" Cc: freebsd-wireless Content-Type: multipart/alternative; boundary="00000000000036928e062b3bf395" X-Rspamd-Queue-Id: 4YT6j72zKyz53Vw X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.86 / 15.00]; NEURAL_HAM_LONG(-0.99)[-0.992]; NEURAL_HAM_SHORT(-0.98)[-0.983]; NEURAL_HAM_MEDIUM(-0.98)[-0.982]; FORGED_SENDER(0.30)[adrian@freebsd.org,adrianchadd@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.49:from]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-wireless@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[adrian@freebsd.org,adrianchadd@gmail.com]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com] --00000000000036928e062b3bf395 Content-Type: text/plain; charset="UTF-8" On Tue, 7 Jan 2025 at 10:01, Bjoern A. Zeeb wrote: > > (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... > Yeah. :( Well, we can clean some of it up during the -16 timeline. I don't mind doing huge renames of stuff. > >> 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) { > Yeah. ew. :-) Those will definitely need cleaning up. Lemme go look at why those chan pointers may be 0 (which i believe is "NULL"). -adrian --00000000000036928e062b3bf395 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, 7 Jan 2= 025 at 10:01, Bjoern A. Zeeb <bz@freeb= sd.org> wrote:
> (I don't mind renaming it, I'm just curious why!)

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

Yeah. :( Well, we can clean = some of it up during the -16 timeline. I don't mind doing huge renames = of stuff.
=C2=A0
>> There are also plain "ANY" (no C) cases which should als= o 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:=C2=A0 =C2=A0if (chan =3D=3D IEEE80211_CHAN_ANY)
sys/dev/bwi/bwirf.c:=C2=A0 =C2=A0 rf->rf_curchan =3D IEEE80211_CHAN_ANY;=
sys/dev/bwi/bwirf.c:=C2=A0 =C2=A0 if (chan =3D=3D IEEE80211_CHAN_ANY)
sys/dev/bwi/bwirf.c:=C2=A0 =C2=A0 if (chan =3D=3D IEEE80211_CHAN_ANY) {
sys/dev/ral/rt2560.c:=C2=A0 =C2=A0KASSERT(chan !=3D 0 && chan !=3D = IEEE80211_CHAN_ANY, ("chan 0x%x", chan));
sys/dev/ral/rt2661.c:=C2=A0 =C2=A0KASSERT(chan !=3D 0 && chan !=3D = IEEE80211_CHAN_ANY, ("chan 0x%x", chan));
sys/dev/ral/rt2860.c:=C2=A0 =C2=A0if (chan =3D=3D 0 || chan =3D=3D IEEE8021= 1_CHAN_ANY)
sys/dev/usb/wlan/if_rum.c:=C2=A0 =C2=A0 =C2=A0 if (chan =3D=3D 0 || chan = =3D=3D IEEE80211_CHAN_ANY)
sys/dev/usb/wlan/if_run.c:=C2=A0 =C2=A0 =C2=A0 if (chan =3D=3D 0 || chan = =3D=3D IEEE80211_CHAN_ANY)
sys/dev/usb/wlan/if_upgt.c:=C2=A0 =C2=A0 =C2=A0if (channel =3D=3D 0 || chan= nel =3D=3D IEEE80211_CHAN_ANY) {
sys/dev/usb/wlan/if_ural.c:=C2=A0 =C2=A0 =C2=A0if (chan =3D=3D 0 || chan = =3D=3D IEEE80211_CHAN_ANY)
sys/dev/usb/wlan/if_zyd.c:=C2=A0 =C2=A0 =C2=A0 if (chan =3D=3D 0 || chan = =3D=3D IEEE80211_CHAN_ANY) {

Yeah. ew. = :-)

Those will definitely need cleaning up. Lemme = go look at why those chan pointers may be 0 (which i believe is "NULL&= quot;).



-adrian

--00000000000036928e062b3bf395--