Main index | Section 9 | Options |
#include <net80211/ieee80211_var.h>
void
ieee80211_start_all(struct ieee80211com *);
void
ieee80211_stop_all(struct ieee80211com *);
void
ieee80211_suspend_all(struct ieee80211com *);
void
ieee80211_resume_all(struct ieee80211com *);
enum ieee80211_state;
int
ieee80211_new_state(struct ieee80211vap *, enum ieee80211_state, int);
void
ieee80211_wait_for_parent(struct ieee80211com *);
The following states are defined for state machines:
IEEE80211_S_INIT | Default/initial state. A vap in this state should not hold any dynamic state (e.g. entries for associated stations in the node table). The driver must quiesce the hardware; e.g. there should be no interrupts firing. |
IEEE80211_S_SCAN | Scanning for a BSS or choosing a channel to operate on. Note that scanning can also take place in other states (e.g. when background scanning is active); this state is entered when initially bringing a vap to an operational state or after an event such as a beacon miss (in station mode). |
IEEE80211_S_AUTH | Authenticating to an access point (in station mode). This state is normally reached from IEEE80211_S_SCAN after selecting a BSS, but may also be reached from IEEE80211_S_ASSOC or IEEE80211_S_RUN if the authentication handshake fails. |
IEEE80211_S_ASSOC | |
Associating to an access point (in station mode). This state is reached from IEEE80211_S_AUTH after successfully authenticating or from IEEE80211_S_RUN if a DisAssoc frame is received. | |
IEEE80211_S_CAC | Doing Channel Availability Check (CAC). This state is entered only when DFS is enabled and the channel selected for operation requires CAC. |
IEEE80211_S_RUN | Operational. In this state a vap can transmit data frames, accept requests for stations associating, etc. Beware that data traffic is also gated by whether the associated "port" is authorized. When WPA/802.11i/802.1x is operational authorization may happen separately; e.g. in station mode wpa_supplicant(8) must complete the handshakes and plumb the necessary keys before a port is authorized. In this state a BSS is operational and associated state is valid and may be used; e.g. ic_bss and ic_bsschan are guaranteed to be usable. |
IEEE80211_S_CSA | Channel Switch Announcement (CSA) is pending. This state is reached only from IEEE80211_S_RUN when either a CSA is received from an access point (in station mode) or the local station is preparing to change channel. In this state traffic may be muted depending on the Mute setting in the CSA. |
IEEE80211_S_SLEEP | |
Asleep to save power (in station mode). This state is reached only from IEEE80211_S_RUN when power save operation is enabled and the local station is deemed sufficiently idle to enter low power mode. | |
Note that states are ordered (as shown above); e.g. a vap must be in the IEEE80211_S_RUN or "greater" before it can transmit frames. Certain net80211 data are valid only in certain states; e.g. the iv_bsschan that specifies the channel for the operating BSS should never be used except in IEEE80211_S_RUN or greater.
After multi-vap scheduling/coordination is done the per-vap iv_newstate method is called to carry out the state change work. Drivers use this entry to setup private state and then dispatch the call to the net80211 layer using the previously defined method pointer (in OOP-parlance they call the "super method" ).
net80211 handles two state changes specially. On transition to IEEE80211_S_RUN the IFF_DRV_OACTIVE bit on the vap's transmit queue is cleared so traffic can flow. On transition to IEEE80211_S_INIT any state in the scan cache associated with the vap is flushed and any frames pending on the transmit queue are flushed.
There is also an ieee80211_stop_all() call to force all vaps to an IEEE80211_S_INIT state but this should not be needed by a driver; control is usually handled by net80211 or, in the case of card eject or vap destroy, work will be initiated outside the driver.
IEEE80211_PROTO (9) | August 4, 2009 |
Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | It's a UNIX system, I know this! | ” |
— Lex Murphy, Jurassic Park |