IEEE80211_BEACON(9)
π ieee80211_beacon β 802.11 beacon support π
okay bestie, welcome to the ieee80211_beacon page from the Kernel Developer's Manual π«Ά this is your girl's guide to making your wifi card scream "I'M HERE" at everyone in range. beacon frames, babes. they're the whole vibe. let's get into it β¨
πΈ SYNOPSIS πΈ
first things first, you gotta invite the right header to the party:
#include <net80211/ieee80211_var.h>
struct mbuf *
ieee80211_beacon_alloc(struct ieee80211_node *,
struct ieee80211_beacon_offsets *);
int
ieee80211_beacon_update(struct ieee80211_node *,
struct ieee80211_beacon_offsets *, struct mbuf *, int mcast);
void
ieee80211_beacon_notify(struct ieee80211vap *, int what);
look at those signatures. gorgeous. no notes π
β¨ DESCRIPTION β¨
so the net80211 software layer is literally the supportive bestie framework for drivers, and it's got this whole template-based mechanism for dynamically updating beacon frames that get transmitted in hostap, adhoc, and mesh operating modes. iconic behavior honestly.
drivers, listen up π you should call ieee80211_beacon_alloc() to create your initial beacon frame. that's step one, no skipping. and the ieee80211_beacon_offsets structure? it holds the info about what's inside the beacon, which is what makes updates done with ieee80211_beacon_update() so optimized and snappy. it's giving efficiency.
now here's the tea β update calls should only happen when something actually changes that affects the contents of the beacon frame. don't be out here updating for no reason, that's not the move. when a real change happens, the iv_update_beacon method gets invoked, and a driver-supplied routine has to do the right thing. yes, you have to do it. it's your moment.
for devices where the host transmits each beacon frame itself, this work may be as simple as setting a little bit in the ieee80211_beacon_offsets structure, like so:
static void
ath_beacon_update(struct ieee80211vap *vap, int item)
{
struct ieee80211_beacon_offsets *bo = &ATH_VAP(vap)->av_boff;
setbit(bo->bo_flags, item);
}
and then the ieee80211_beacon_update() call gets done before the next beacon is to be sent. simple. clean. slay.
but wait, there's another path π¦ devices that off-load beacon generation may instead choose to use this callback to push updates immediately to the device. exactly how that is accomplished is unspecified β the manpage said what it said, I'm just the messenger β and one possibility is to update the beacon frame contents and extract the appropriate information element, but other scenarios are possible. so like. do your thing. it's flexible.
π MULTI-VAP BEACON SCHEDULING π
okay this is the part for drivers supporting multiple vaps that can each beacon. you gotta think about how to schedule those beacon frames, bestie. there are two possibilities at the moment:
- burst all beacons at TBTT
- stagger beacons over the beacon interval
let's talk about bursting first because it's lowkey messy. bursting beacon frames may result in aperiodic delivery, which can affect the power save operation of associated stations. not great, not terrible, but not great. applying some jitter β e.g. by randomly ordering burst frames β may be sufficient to combat this, and typically it's not an issue unless stations are using aggressive power save techniques such as U-APSD (sometimes employed by VoIP phones, of all things π).
staggering frames, on the other hand, requires more interrupts and device support that may not be available. so like, it costs you. but the payoff? staggering beacon frames is usually superior to bursting frames, up to about eight vaps β at which point the overhead becomes significant and the channel becomes noticeably busy anyway. so basically: stagger till eight, then it's everybody's problem π
π SEE ALSO π
ngl the whole point is: alloc the beacon, only update when stuff changes, and please think about your multi-vap scheduling. your associated stations will thank you π
okay that's the page!! this was from the Kernel Developer's Manual, Debian edition, dated August 4, 2009 β yes she's an elder but she still ate, periodt π π bye bestie, go write some drivers β¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2009 Sam Leffler, Errno Consulting
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms