Page MenuHomeFreeBSD

kern: net80211: export sta assoc/disassoc via devctl
Needs RevisionPublic

Authored by kevans on Mar 9 2022, 12:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 10 2024, 3:30 AM
Unknown Object (File)
Jan 1 2024, 8:03 PM
Unknown Object (File)
Dec 20 2023, 6:04 AM
Unknown Object (File)
Oct 27 2023, 2:49 PM
Unknown Object (File)
Oct 19 2023, 4:59 PM
Unknown Object (File)
Jun 24 2023, 9:22 AM
Unknown Object (File)
Jun 21 2023, 2:27 PM
Unknown Object (File)
May 3 2023, 2:55 AM
Subscribers

Details

Summary

This sets up some new devd notify goodies. We don't seem to have any
net80211-related goodies, so I've structured it such that we have
net80211 as the overarching system, with the intention that subsystem
may be sta/ap/ibss/etc.

The only notifications currently added are:

net80211:sta:assoc, providing $vap, $ssid, $bssid
net80211:sta:disassoc, providing $vap, $ssid, $bssid

A potential use for this is triggering a backup script once a laptop
returns its home wifi network, for instance.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44710
Build 41598: arc lint + arc unit

Event Timeline

I'll +1 it to commit once they're moved to ieee80211_freebsd.c

sys/net80211/ieee80211_node.c
834

this should live in ieee80211_freebsd.c :-)

874

same as these; so the other OSes that consume our stack can just stub it out in their OS code.

Move platform-specific bits to ieee80211_freebsd.c

kevans added inline comments.
sys/net80211/ieee80211_proto.h
443

I might s/devctl/userland/ or something to that effect.

This revision is now accepted and ready to land.Mar 9 2022, 3:05 AM
imp requested changes to this revision.Mar 9 2022, 5:05 AM

this needs to at the very least be documented in devd.conf.5.
But the code otherwise looks decent... One real comment and one 'oh, yea, I should provide a better interface here' musing for future archaeologists

sys/net80211/ieee80211_freebsd.c
798

why the mixture of ' ' and 0x7e? shouldn't that be < 0x20 too?

807

I've often wanted a key value pair interface for this... But for another time.

This revision now requires changes to proceed.Mar 9 2022, 5:05 AM
sys/net80211/ieee80211_freebsd.c
798

I lifted it from elsewhere that ssids are printed, no objection to making it consistent.

807

Yeah, that'd be nice. I have another couple changes that add a devctl_notifyf that simplify a number of callers that just needed simple concatenation that can be expressed as a format string:

sys/arm/ti/am335x/am335x_pmic.c |  4 +---
sys/dev/acpica/acpi.c           |  5 ++---
sys/dev/asmc/asmc.c             |  4 +---
sys/dev/usb/usb_device.c        | 13 ++-----------
sys/geom/geom_dev.c             | 29 +++++++++++------------------
sys/geom/geom_disk.c            |  4 +---
sys/kern/kern_conf.c            | 13 +------------
sys/net/if.c                    |  6 +++---
sys/powerpc/powermac/pmu.c      |  6 ++----
9 files changed, 24 insertions(+), 60 deletions(-)

I -think- it's probably worth it? It's a modest win, at least.