Page MenuHomeFreeBSD

net80211: migrate if_flags, if_drvflags out of most source files
ClosedPublic

Authored by adrian on May 18 2025, 4:34 AM.
Referenced Files
F125046796: D50405.id155642.diff
Sat, Aug 2, 8:27 PM
Unknown Object (File)
Tue, Jul 29, 7:33 AM
Unknown Object (File)
Fri, Jul 25, 6:17 PM
Unknown Object (File)
Mon, Jul 21, 6:51 PM
Unknown Object (File)
Mon, Jul 21, 6:49 PM
Unknown Object (File)
Mon, Jul 21, 6:41 PM
Unknown Object (File)
Mon, Jul 21, 6:41 PM
Unknown Object (File)
Mon, Jul 21, 6:08 PM

Details

Summary

Migrate both if_flags and if_drvflags out of most source files.
Ideally it'd only be referenced in ieee80211_freebsd.c, but for now
it also ignores references in ieee80211_ioctl.c.

  • migrate if_flags set to if_setflags
  • migrate if_flags get to if_getflags
  • migrate if_drvflags get to if_getdrvflags
  • add ieee80211_vap_check_is_monitor() and ieee8021_vap_check_is_simplex() to abstract out the IFF_MONITOR and IFF_SIMPLEX flag checks.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64280
Build 61164: arc lint + arc unit

Event Timeline

bz requested changes to this revision.May 18 2025, 8:24 PM
bz added a subscriber: bz.
bz added inline comments.
sys/net80211/ieee80211_freebsd.c
1273

You can save yourself the local variable here and all the way down.

1275

No. Stop for a bool. Also would belong inside ().

style.9 says return ((if_getflags(ifp) & IFF_MONITOR) != 0);

Here and all the way down please.

1316

This almost wants a set and a clear function. I'd at least call the argument set and not state to make it clearer.

sys/net80211/ieee80211_freebsd.h
265–267

While here you could make it style clean and check != 0

sys/net80211/ieee80211_proto.c
1987

no space

This revision now requires changes to proceed.May 18 2025, 8:24 PM
sys/net80211/ieee80211_freebsd.c
1316

Yeah, I'm not happy with my naming scheme right now - these aren't really supposed to be public net80211 functions and their current names make them sound like drivers/tools can use them to query stuff. What they REALLY are is glue to the underlying OS interface.

Do you have any suggestions on what to name them to make that particular fact clearer? Or should I just be clearer in the documentation?

fixed, i hope!

This revision is now accepted and ready to land.May 24 2025, 11:23 PM