ieee80211_beacon_alloc (9)
Leading comments
Copyright (c) 2009 Sam Leffler, Errno Consulting All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documenta...
NAME
ieee80211_beacon - 802.11 beacon supportSYNOPSIS
In net80211/ieee80211_var.hFt struct mbuf * Fo ieee80211_beacon_alloc Fa struct ieee80211_node * Fa struct ieee80211_beacon_offsets * Fc Ft int Fo ieee80211_beacon_update Fa struct ieee80211_node * Fa struct ieee80211_beacon_offsets * Fa struct mbuf * Fa int mcast Fc Ft void Fn ieee80211_beacon_notify struct ieee80211vap * int what
DESCRIPTION
The net80211 software layer provides a support framework for drivers that includes a template-based mechanism for dynamic update of beacon frames transmit in hostap, adhoc, and mesh operating modes. Drivers should use Fn ieee80211_beacon_alloc to create an initial beacon frame. The Vt ieee80211_beacon_offsets structure holds information about the beacon contents that is used to optimize updates done with Fn ieee80211_beacon_update .Update calls should only be done when something changes that affects the contents of the beacon frame. When this happens the iv_update_beacon method is invoked and a driver-supplied routine must do the right thing. For devices that involve the host to transmit each beacon frame this work may be as simple as marking a bit in the Vt ieee80211_beacon_offsets structure:
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); }
with the Fn ieee80211_beacon_update call done before the next beacon is to be sent.
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. One possibility is to update the beacon frame contents and extract the appropriate information element, but other scenarios are possible.