Main index | Section 9 | Options |
#include <net80211/ieee80211_var.h>
The virtual radio interface defined by the net80211 layer means that drivers must be structured to follow specific rules. Drivers that support only a single interface at any time must still follow these rules.
The virtual radio architecture splits state between a single per-device ieee80211com structure and one or more ieee80211vap structures. Vaps are created with the SIOCIFCREATE2 request. This results in a call into the driver's ic_vap_create method where the driver can decide if the request should be accepted.
The vap creation process is done in three steps. First the driver allocates the data structure with malloc(9). This data structure must have an ieee80211vap structure at the front but is usually extended with driver-private state. Next the vap is setup with a call to ieee80211_vap_setup(). This request initializes net80211 state but does not activate the interface. The driver can then override methods setup by net80211 and setup driver resources before finally calling ieee80211_vap_attach() to complete the process. Both these calls must be done without holding any driver locks as work may require the process block/sleep.
A vap is deleted when an SIOCIFDESTROY ioctl request is made or when the device detaches (causing all associated vaps to automatically be deleted). Delete requests cause the ic_vap_delete method to be called. Drivers must quiesce the device before calling ieee80211_vap_detach() to deactivate the vap and isolate it from activities such as requests from user applications. The driver can then reclaim resources held by the vap and re-enable device operation. The exact procedure for quiescing a device is unspecified but typically it involves blocking interrupts and stopping transmit and receive processing.
An important consequence of supporting multiple concurrent vaps is that a driver's iv_newstate method must be written to handle being called for each vap. Where necessary, drivers must track private state for all vaps and not just the one whose state is being changed (e.g. for handling beacon timers the driver may need to know if all vaps that beacon are stopped before stopping the hardware timers).
IEEE8021_VAP (9) | August 4, 2009 |
Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | How do you pronounce UNIX ? You Nix ! | ” |