Linux Kernel
3.7.1
|
#include <linux/bug.h>
#include <linux/kernel.h>
#include <linux/if_ether.h>
#include <linux/skbuff.h>
#include <linux/ieee80211.h>
#include <net/cfg80211.h>
#include <asm/unaligned.h>
Go to the source code of this file.
Data Structures | |
struct | ieee80211_tx_queue_params |
struct | ieee80211_low_level_stats |
struct | ieee80211_bss_conf |
struct | ieee80211_tx_rate |
struct | ieee80211_tx_info |
struct | ieee80211_sched_scan_ies |
struct | ieee80211_rx_status |
struct | ieee80211_conf |
struct | ieee80211_channel_switch |
struct | ieee80211_vif |
struct | ieee80211_key_conf |
struct | ieee80211_sta |
struct | ieee80211_tx_control |
struct | ieee80211_hw |
struct | ieee80211_ops |
struct | ieee80211_tpt_blink |
struct | ieee80211_key_seq |
struct | ieee80211_tx_rate_control |
struct | rate_control_ops |
Macros | |
#define | IEEE80211_INVAL_HW_QUEUE 0xff |
#define | IEEE80211_NUM_ACS 4 |
#define | IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 |
#define | IEEE80211_TX_CTL_STBC_SHIFT 23 |
#define | IEEE80211_TX_TEMPORARY_FLAGS |
#define | IEEE80211_TX_INFO_DRIVER_DATA_SIZE 40 |
#define | IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24 |
#define | IEEE80211_TX_MAX_RATES 4 |
#define | IEEE80211_TX_STATUS_HEADROOM 14 |
Variables | |
struct ieee80211_tx_rate | __packed |
#define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 |
Definition at line 204 of file mac80211.h.
#define IEEE80211_INVAL_HW_QUEUE 0xff |
Definition at line 101 of file mac80211.h.
#define IEEE80211_NUM_ACS 4 |
Definition at line 116 of file mac80211.h.
#define IEEE80211_TX_CTL_STBC_SHIFT 23 |
Definition at line 430 of file mac80211.h.
#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE 40 |
Definition at line 480 of file mac80211.h.
#define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24 |
Definition at line 483 of file mac80211.h.
#define IEEE80211_TX_MAX_RATES 4 |
Definition at line 486 of file mac80211.h.
#define IEEE80211_TX_STATUS_HEADROOM 14 |
Definition at line 2778 of file mac80211.h.
#define IEEE80211_TX_TEMPORARY_FLAGS |
Definition at line 436 of file mac80211.h.
enum ieee80211_ac_numbers |
enum ieee80211_ac_numbers - AC numbers as used in mac80211 : voice : video : best effort : background
Definition at line 110 of file mac80211.h.
enum ieee80211_ampdu_mlme_action - A-MPDU actions
These flags are used with the ampdu_action() callback in &struct ieee80211_ops to indicate which action is needed.
Note that drivers MUST be able to deal with a TX aggregation session being stopped even before they OK'ed starting it by calling ieee80211_start_tx_ba_cb_irqsafe, because the peer might receive the addBA frame and send a delBA right away!
: start Rx aggregation : stop Rx aggregation : start Tx aggregation : stop Tx aggregation : TX aggregation has become operational
IEEE80211_AMPDU_RX_START | |
IEEE80211_AMPDU_RX_STOP | |
IEEE80211_AMPDU_TX_START | |
IEEE80211_AMPDU_TX_STOP | |
IEEE80211_AMPDU_TX_OPERATIONAL |
Definition at line 1913 of file mac80211.h.
enum ieee80211_bss_change |
enum ieee80211_bss_change - BSS change notification flags
These flags are used with the bss_info_changed() callback to indicate which BSS parameter changed.
: association status changed (associated/disassociated), also implies a change in the AID. : CTS protection changed : preamble changed : slot timing changed : 802.11n parameters changed : Basic rateset changed : Beacon interval changed : BSSID changed, for whatever reason (IBSS and managed mode) : Beacon data changed, retrieve new beacon (beaconing modes) : Beaconing should be enabled/disabled (beaconing modes) : Connection quality monitor config changed : IBSS join status changed : Hardware ARP filter address list or state changed. : QoS for this association was enabled/disabled. Note that it is only ever disabled for station mode. : Idle changed for this BSS/interface. : SSID changed for this BSS (AP mode) : Probe Response changed for this BSS (AP mode) : PS changed for this BSS (STA mode)
Definition at line 176 of file mac80211.h.
enum ieee80211_conf_changed - denotes which configuration changed
: the listen interval changed : the monitor flag changed : the PS flag or dynamic PS timeout changed : the TX power changed : the channel/channel_type changed : retry limits changed : Idle flag changed : Spatial multiplexing powersave mode changed
Definition at line 798 of file mac80211.h.
enum ieee80211_conf_flags |
enum ieee80211_conf_flags - configuration flags
Flags to define PHY configuration options
: there's a monitor interface present – use this to determine for example whether to calculate timestamps for packets or not, do not use instead of filter flags! : Enable 802.11 power save mode (managed mode only). This is the power save mode defined by IEEE 802.11-2007 section 11.2, meaning that the hardware still wakes up for beacons, is able to transmit frames and receive the possible acknowledgment frames. Not to be confused with hardware specific wakeup/sleep states, driver is responsible for that. See the section "Powersave support" for more. : The device is running, but idle; if the flag is set the driver should be prepared to handle configuration requests but may turn the device off as much as possible. Typically, this flag will be set when an interface is set UP but not associated or scanning, but it can also be unset in that case when monitor interfaces are active. : The device is currently not on its main operating channel.
Definition at line 778 of file mac80211.h.
DOC: Hardware crypto acceleration
mac80211 is capable of taking advantage of many hardware acceleration designs for encryption and decryption operations.
The set_key() callback in the &struct ieee80211_ops for a given device is called to enable hardware acceleration of encryption and decryption. The callback takes a parameter that will be NULL for default keys or keys used for transmission only, or point to the station information for the peer for individual keys. Multiple transmission keys with the same key index may be used when VLANs are configured for an access point.
When transmitting, the TX control data will use the selected by the driver by modifying the &struct ieee80211_key_conf pointed to by the parameter to the set_key() function.
The set_key() call for the SET_KEY command should return 0 if the key is now in use, -EOPNOTSUPP or -ENOSPC if it couldn't be added; if you return 0 then hw_key_idx must be assigned to the hardware key index, you are free to use the full u8 range.
When the cmd is DISABLE_KEY then it must succeed.
Note that it is permissible to not decrypt a frame even if a key for it has been uploaded to hardware, the stack will not make any decision based on whether a key has been uploaded or not but rather based on the receive flags.
The &struct ieee80211_key_conf structure pointed to by the parameter is guaranteed to be valid until another call to set_key() removes it, but it can only be used as a cookie to differentiate keys.
In TKIP some HW need to be provided a phase 1 key, for RX decryption acceleration (i.e. iwlwifi). Those drivers should provide update_tkip_key handler. The update_tkip_key() call updates the driver with the new phase 1 key. This happens every time the iv16 wraps around (every 65536 packets). The set_key() call will happen only once for each key (unless the AP did rekeying), it will not include a valid phase 1 key. The valid phase 1 key is provided by update_tkip_key only. The trigger that makes mac80211 call this handler is software decryption with wrap around of iv16. DOC: Powersave support
mac80211 has support for various powersave implementations.
First, it can support hardware that handles all powersaving by itself, such hardware should simply set the IEEE80211_HW_SUPPORTS_PS hardware flag. In that case, it will be told about the desired powersave mode with the IEEE80211_CONF_PS flag depending on the association status. The hardware must take care of sending nullfunc frames when necessary, i.e. when entering and leaving powersave mode. The hardware is required to look at the AID in beacons and signal to the AP that it woke up when it finds traffic directed to it.
IEEE80211_CONF_PS flag enabled means that the powersave mode defined in IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused with hardware wakeup and sleep states. Driver is responsible for waking up the hardware before issuing commands to the hardware and putting it back to sleep at appropriate times.
When PS is enabled, hardware needs to wakeup for beacons and receive the buffered multicast/broadcast frames after the beacon. Also it must be possible to send frames and receive the acknowledment frame.
Other hardware designs cannot send nullfunc frames by themselves and also need software support for parsing the TIM bitmap. This is also supported by mac80211 by combining the IEEE80211_HW_SUPPORTS_PS and IEEE80211_HW_PS_NULLFUNC_STACK flags. The hardware is of course still required to pass up beacons. The hardware is still required to handle waking up for multicast traffic; if it cannot the driver must handle that as best as it can, mac80211 is too slow to do that.
Dynamic powersave is an extension to normal powersave in which the hardware stays awake for a user-specified period of time after sending a frame so that reply frames need not be buffered and therefore delayed to the next wakeup. It's compromise of getting good enough latency when there's data traffic and still saving significantly power in idle periods.
Dynamic powersave is simply supported by mac80211 enabling and disabling PS based on traffic. Driver needs to only set IEEE80211_HW_SUPPORTS_PS flag and mac80211 will handle everything automatically. Additionally, hardware having support for the dynamic PS feature may set the IEEE80211_HW_SUPPORTS_DYNAMIC_PS flag to indicate that it can support dynamic PS mode itself. The driver needs to look at the hardware configuration value and use it that value whenever IEEE80211_CONF_PS is set. In this case mac80211 will disable dynamic PS feature in stack and will just keep IEEE80211_CONF_PS enabled whenever user has enabled powersave.
Some hardware need to toggle a single shared antenna between WLAN and Bluetooth to facilitate co-existence. These types of hardware set limitations on the use of host controlled dynamic powersave whenever there is simultaneous WLAN and Bluetooth traffic. For these types of hardware, the driver may request temporarily going into full power save, in order to enable toggling the antenna between BT and WLAN. If the driver requests disabling dynamic powersave, the value will be temporarily set to zero until the driver re-enables dynamic powersave.
Driver informs U-APSD client support by enabling IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the uapsd paramater in conf_tx() operation. Hardware needs to send the QoS Nullfunc frames and stay awake until the service period has ended. To utilize U-APSD, dynamic powersave is disabled for voip AC and all frames from that AC are transmitted with powersave enabled.
Note: U-APSD client mode is not yet supported with IEEE80211_HW_PS_NULLFUNC_STACK. DOC: Beacon filter support
Some hardware have beacon filter support to reduce host cpu wakeups which will reduce system power consumption. It usually works so that the firmware creates a checksum of the beacon but omits all constantly changing elements (TSF, TIM etc). Whenever the checksum changes the beacon is forwarded to the host, otherwise it will be just dropped. That way the host will only receive beacons where some relevant information (for example ERP protection or WMM settings) have changed.
Beacon filter support is advertised with the IEEE80211_VIF_BEACON_FILTER interface capability. The driver needs to enable beacon filter support whenever power save is enabled, that is IEEE80211_CONF_PS is set. When power save is enabled, the stack will not check for beacon loss and the driver needs to notify about loss of beacons with ieee80211_beacon_loss().
The time (or number of beacons missed) until the firmware notifies the driver of a beacon loss event (which in turn causes the driver to call ieee80211_beacon_loss()) should be configurable and will be controlled by mac80211 and the roaming algorithm in the future.
Since there may be constantly changing information elements that nothing in the software stack cares about, we will, in the future, have mac80211 tell the driver which information elements are interesting in the sense that we want to see changes in them. This will include
Ideally, the hardware would filter out any beacons without changes in the requested elements, but if it cannot support that it may, at the expense of some efficiency, filter out only a subset. For example, if the device doesn't support checking for OUIs it should pass up all changes in all vendor information elements.
Note that change, for the sake of simplification, also includes information elements appearing or disappearing from the beacon.
Some hardware supports an "ignore list" instead, just make sure nothing that was requested is on the ignore list, and include commonly changing information element IDs in the ignore list, for example 11 (BSS load) and the various vendor-assigned IEs with unknown contents (128, 129, 133-136, 149, 150, 155, 156, 173, 176, 178, 179, 219); for forward compatibility it could also include some currently unused IDs.
In addition to these capabilities, hardware should support notifying the host of changes in the beacon RSSI. This is relevant to implement roaming when no traffic is flowing (when traffic is flowing we see the RSSI of the received data packets). This can consist in notifying the host when the RSSI changes significantly or when it drops below or rises above configurable thresholds. In the future these thresholds will also be configured by mac80211 (which gets them from userspace) to implement them as the roaming algorithm requires.
If the hardware cannot implement this, the driver should ask it to periodically pass beacon frames to the host so that software can do the signal strength threshold checking. DOC: Spatial multiplexing power save
SMPS (Spatial multiplexing power save) is a mechanism to conserve power in an 802.11n implementation. For details on the mechanism and rationale, please refer to 802.11 (as amended by 802.11n-2009) "11.2.3 SM power save".
The mac80211 implementation is capable of sending action frames to update the AP about the station's SMPS mode, and will instruct the driver to enter the specific mode. It will also announce the requested SMPS mode during the association handshake. Hardware support for this feature is required, and can be indicated by hardware flags.
The default mode will be "automatic", which nl80211/cfg80211 defines to be dynamic SMPS in (regular) powersave, and SMPS turned off otherwise.
To support this feature, the driver must set the appropriate hardware support flags, and handle the SMPS flag to the config() operation. It will then with this mechanism be instructed to enter the requested SMPS mode while associated to an HT AP. DOC: Frame filtering
mac80211 requires to see many management frames for proper operation, and users may want to see many more frames when in monitor mode. However, for best CPU usage and power consumption, having as few frames as possible percolate through the stack is desirable. Hence, the hardware should filter as much as possible.
To achieve this, mac80211 uses filter flags (see below) to tell the driver's configure_filter() function which frames should be passed to mac80211 and which should be filtered out.
Before configure_filter() is invoked, the prepare_multicast() callback is invoked with the parameters and for the combined multicast address list of all virtual interfaces. It's use is optional, and it returns a u64 that is passed to configure_filter(). Additionally, configure_filter() has the arguments telling which flags were changed and with the new flag states.
If your device has no multicast address filters your driver will need to check both the FIF_ALLMULTI flag and the parameter to see whether multicast frames should be accepted or dropped.
All unsupported flags in must be cleared. Hardware does not support a flag if it is incapable of passing the frame to the stack. Otherwise the driver must ignore the flag, but not clear it. You must only clear the flag (announce no support for the flag to mac80211) if you are not able to pass the packet type to the stack (so the hardware always filters it). So for example, you should clear , if your hardware always filters control frames. If your hardware always passes control frames to the kernel and is incapable of filtering them, you do not clear the flag. This rule applies to all other FIF flags as well. DOC: AP support for powersaving clients
In order to implement AP and P2P GO modes, mac80211 has support for client powersaving, both "legacy" PS (PS-Poll/null data) and uAPSD. There currently is no support for sAPSD.
There is one assumption that mac80211 makes, namely that a client will not poll with PS-Poll and trigger with uAPSD at the same time. Both are supported, and both can be used by the same client, but they can't be used concurrently by the same client. This simplifies the driver code.
The first thing to keep in mind is that there is a flag for complete driver implementation: IEEE80211_HW_AP_LINK_PS. If this flag is set, mac80211 expects the driver to handle most of the state machine for powersaving clients and will ignore the PM bit in incoming frames. Drivers then use ieee80211_sta_ps_transition() to inform mac80211 of stations' powersave transitions. In this mode, mac80211 also doesn't handle PS-Poll/uAPSD.
In the mode without IEEE80211_HW_AP_LINK_PS, mac80211 will check the PM bit in incoming frames for client powersave transitions. When a station goes to sleep, we will stop transmitting to it. There is, however, a race condition: a station might go to sleep while there is data buffered on hardware queues. If the device has support for this it will reject frames, and the driver should give the frames back to mac80211 with the IEEE80211_TX_STAT_TX_FILTERED flag set which will cause mac80211 to retry the frame when the station wakes up. The driver is also notified of powersave transitions by calling its callback.
When the station is asleep, it has three choices: it can wake up, it can PS-Poll, or it can possibly start a uAPSD service period. Waking up is implemented by simply transmitting all buffered (and filtered) frames to the station. This is the easiest case. When the station sends a PS-Poll or a uAPSD trigger frame, mac80211 will inform the driver of this with the callback; this callback is optional. mac80211 will then transmit the frames as usual and set the IEEE80211_TX_CTL_NO_PS_BUFFER on each frame. The last frame in the service period (or the only response to a PS-Poll) also has IEEE80211_TX_STATUS_EOSP set to indicate that it ends the service period; as this frame must have TX status report it also sets IEEE80211_TX_CTL_REQ_TX_STATUS. When TX status is reported for this frame, the service period is marked has having ended and a new one can be started by the peer.
Additionally, non-bufferable MMPDUs can also be transmitted by mac80211 with the IEEE80211_TX_CTL_NO_PS_BUFFER set in them.
Another race condition can happen on some devices like iwlwifi when there are frames queued for the station and it wakes up or polls; the frames that are already queued could end up being transmitted first instead, causing reordering and/or wrong processing of the EOSP. The cause is that allowing frames to be transmitted to a certain station is out-of-band communication to the device. To allow this problem to be solved, the driver can call ieee80211_sta_block_awake() if frames are buffered when it is notified that the station went to sleep. When all these frames have been filtered (see above), it must call the function again to indicate that the station is no longer blocked.
If the driver buffers frames in the driver for aggregation in any way, it must use the ieee80211_sta_set_buffered() call when it is notified of the station going to sleep to inform mac80211 of any TIDs that have frames buffered. Note that when a station wakes up this information is reset (hence the requirement to call it when informed of the station going to sleep). Then, when a service period starts for any reason, is called with the number of frames to be released and which TIDs they are to come from. In this case, the driver is responsible for setting the EOSP (for uAPSD) and MORE_DATA bits in the released frames, to help the paramter is passed to tell the driver if there is more data on other TIDs – the TIDs to release frames from are ignored since mac80211 doesn't know how many frames the buffers for those TIDs contain.
If the driver also implement GO mode, where absence periods may shorten service periods (or abort PS-Poll responses), it must filter those response frames except in the case of frames that are buffered in the driver – those must remain buffered to avoid reordering. Because it is possible that no frames are released in this case, the driver must call ieee80211_sta_eosp_irqsafe() to indicate to mac80211 that the service period ended anyway.
Finally, if frames from multiple TIDs are released from mac80211 but the driver might reorder them, it must clear & set the flags appropriately (only the last frame may have IEEE80211_TX_STATUS_EOSP) and also take care of the EOSP and MORE_DATA bits in the frame. The driver may also use ieee80211_sta_eosp_irqsafe() in this case. DOC: HW queue control
Before HW queue control was introduced, mac80211 only had a single static assignment of per-interface AC software queues to hardware queues. This was problematic for a few reasons: 1) off-channel transmissions might get stuck behind other frames 2) multiple virtual interfaces couldn't be handled correctly 3) after-DTIM frames could get stuck behind other frames
To solve this, hardware typically uses multiple different queues for all the different usages, and this needs to be propagated into mac80211 so it won't have the same problem with the software queues.
Therefore, mac80211 now offers the IEEE80211_HW_QUEUE_CONTROL capability flag that tells it that the driver implements its own queue control. To do so, the driver will set up the various queues in each &struct ieee80211_vif and the offchannel queue in &struct ieee80211_hw. In response, mac80211 will use those queue IDs in the hw_queue field of &struct ieee80211_tx_info and if necessary will queue the frame on the right software queue that mirrors the hardware queue. Additionally, the driver has to then use these HW queue IDs for the queue management functions (ieee80211_stop_queue() et al.)
The driver is free to set up the queue mappings as needed, multiple virtual interfaces may map to the same hardware queues if needed. The setup has to happen during add_interface or change_interface callbacks. For example, a driver supporting station+station and station+AP modes might decide to have 10 hardware queues to handle different scenarios:
4 AC HW queues for 1st vif: 0, 1, 2, 3 4 AC HW queues for 2nd vif: 4, 5, 6, 7 after-DTIM queue for AP: 8 off-channel queue: 9
It would then set up the hardware like this: hw.offchannel_tx_hw_queue = 9
and the first virtual interface that is added as follows: vif.hw_queue[IEEE80211_AC_VO] = 0 vif.hw_queue[IEEE80211_AC_VI] = 1 vif.hw_queue[IEEE80211_AC_BE] = 2 vif.hw_queue[IEEE80211_AC_BK] = 3 vif.cab_queue = 8 // if AP mode, otherwise IEEE80211_INVAL_HW_QUEUE and the second virtual interface with 4-7.
If queue 6 gets full, for example, mac80211 would only stop the second virtual interface's BE queue since virtual interface queues are per AC.
Note that the vif.cab_queue value should be set to IEEE80211_INVAL_HW_QUEUE whenever the queue is not used (i.e. the interface is not in AP mode) if the queue could potentially be shared since mac80211 will look at cab_queue when a queue is stopped/woken even if the interface is not in AP mode. enum ieee80211_filter_flags - hardware filter flags
These flags determine what the filter in hardware should be programmed to let through and what should not be passed to the stack. It is always safe to pass more frames than requested, but this has negative impact on power consumption.
: promiscuous mode within your BSS, think of the BSS as your network segment and then this corresponds to the regular ethernet device promiscuous mode.
: pass all multicast frames, this is used if requested by the user or if the hardware is not capable of filtering by multicast address.
: pass frames with failed FCS (but you need to set the RX_FLAG_FAILED_FCS_CRC for them)
: pass frames with failed PLCP CRC (but you need to set the RX_FLAG_FAILED_PLCP_CRC for them
: This flag is set during scanning to indicate to the hardware that it should not filter beacons or probe responses by BSSID. Filtering them can greatly reduce the amount of processing mac80211 needs to do and the amount of CPU wakeups, so you should honour this flag if possible.
: pass control frames (except for PS Poll), if PROMISC_IN_BSS is not set then only those addressed to this station.
: pass frames destined to other BSSes
: pass PS Poll frames, if PROMISC_IN_BSS is not set then only those addressed to this station.
: pass probe request frames
FIF_PROMISC_IN_BSS | |
FIF_ALLMULTI | |
FIF_FCSFAIL | |
FIF_PLCPFAIL | |
FIF_BCN_PRBRESP_PROMISC | |
FIF_CONTROL | |
FIF_OTHER_BSS | |
FIF_PSPOLL | |
FIF_PROBE_REQ |
Definition at line 1884 of file mac80211.h.
enum ieee80211_frame_release_type - frame release reason : frame released for PS-Poll : frame(s) released due to frame received on trigger-enabled AC
Definition at line 1927 of file mac80211.h.
enum ieee80211_hw_flags |
enum ieee80211_hw_flags - hardware flags
These flags are used to indicate hardware capabilities to the stack. Generally, flags here should have their meaning done in a way that the simplest hardware doesn't need setting any particular flags. There are some exceptions to this rule, however, so you are advised to review these flags carefully.
: The hardware or firmware includes rate control, and cannot be controlled by the stack. As such, no rate control algorithm should be instantiated, and the TX rate reported to userspace will be taken from the TX status instead of the rate control algorithm. Note that this requires that the driver implement a number of callbacks so it has the correct information, it needs to have the callback and must look at the BSS config for G/N protection, for slot timing in 2.4 GHz and for preambles for CCK frames.
: Indicates that received frames passed to the stack include the FCS at the end.
: Some wireless LAN chipsets buffer broadcast/multicast frames for power saving stations in the hardware/firmware and others rely on the host system for such buffering. This option is used to configure the IEEE 802.11 upper layer to buffer broadcast and multicast frames when there are power saving stations so that the driver can fetch them with ieee80211_get_buffered_bc().
: Hardware is not capable of short slot operation on the 2.4 GHz band.
: Hardware is not capable of receiving frames with short preamble on the 2.4 GHz band.
: Hardware can provide signal values but we don't know its units. We expect values between 0 and . If possible please provide dB or dBm instead.
: Hardware gives signal values in dBm, decibel difference from one milliwatt. This is the preferred method since it is standardized between different devices. does not need to be set.
: Hardware supports spectrum management defined in 802.11h Measurement, Channel Switch, Quieting, TPC
: Hardware supports 11n A-MPDU aggregation.
: Hardware has power save support (i.e. can go to sleep).
: Hardware requires nullfunc frame handling in stack, implies stack support for dynamic PS.
: Hardware has support for dynamic PS.
: Hardware supports management frame protection (MFP, IEEE 802.11w).
: Hardware supports static spatial multiplexing powersave, ie. can turn off all but one chain even on HT connections that should be using more chains.
: Hardware supports dynamic spatial multiplexing powersave, ie. can turn off all but one chain and then wake the rest up as required after, for example, rts/cts handshake.
: Hardware supports Unscheduled Automatic Power Save Delivery (U-APSD) in managed mode. The mode is configured with conf_tx() operation.
: Hardware can provide ack status reports of Tx frames to the stack.
: The hardware performs its own connection monitoring, including periodic keep-alives to the AP and probing the AP on beacon loss. When this flag is set, signaling beacon-loss will cause an immediate change to disassociated state.
: This device needs to know the DTIM period for the BSS before associating.
: The device's crypto engine supports per-station GTKs as used by IBSS RSN or during fast transition. If the device doesn't support per-station GTKs, but can be asked not to decrypt group addressed frames, then IBSS RSN support is still possible but software crypto will be used. Advertise the wiphy flag only in that case.
: When operating in AP mode the device autonomously manages the PS status of connected stations. When this flag is set mac80211 will not trigger PS mode for connected stations based on the PM bit of incoming frames. Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure the PS mode of connected stations.
: The device handles TX A-MPDU session setup strictly in HW. mac80211 should not attempt to do this in software.
: The device can do hw scan while being idle (i.e. mac80211 doesn't have to go idle-off during the the scan).
: The driver would like to be informed of a virtual monitor interface when monitor interfaces are the only active interfaces.
: The driver wants to control per-interface queue mapping in order to use different queues (not just one per AC) for different virtual interfaces. See the doc section on HW queue control for more details.
: Use the P2P Device address for any P2P Interface. This will be honoured even if more than one interface is supported.
Definition at line 1257 of file mac80211.h.
enum ieee80211_key_flags |
enum ieee80211_key_flags - key flags
These flags are used for communication about keys between the driver and mac80211, with the parameter of &struct ieee80211_key_conf.
: Set by mac80211, this flag indicates that the STA this key will be used with could be using QoS. : This flag should be set by the driver to indicate that it requires IV generation for this particular key. : This flag should be set by the driver for a TKIP key if it requires Michael MIC generation in software. : Set by mac80211, this flag indicates that the key is pairwise rather then a shared key. : This flag should be set by the driver for a CCMP key if it requires CCMP encryption of management frames (MFP) to be done in software. : This flag should be set by the driver if space should be prepared for the IV, but the IV itself should not be generated. Do not set together with on the same key. : This key will be used to decrypt received management frames. The flag can help drivers that have a hardware crypto implementation that doesn't deal with management frames properly by allowing them to not upload the keys to hardware and fall back to software crypto. Note that this flag deals only with RX, if your crypto engine can't deal with TX you can also set the IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW.
Definition at line 991 of file mac80211.h.
enum ieee80211_max_queues |
enum ieee80211_max_queues - maximum number of queues
: Maximum number of regular device queues.
Definition at line 97 of file mac80211.h.
enum ieee80211_rate_control_changed - flags to indicate what changed
: The bandwidth that can be used to transmit to this station changed. : The SMPS state of the station changed. : The supported rate set of this peer changed (in IBSS mode) due to discovering more information about the peer.
Definition at line 1942 of file mac80211.h.
enum ieee80211_rssi_event |
enum ieee80211_smps_mode |
enum ieee80211_smps_mode - spatial multiplexing power save mode
: automatic : off : static : dynamic : internal, don't use
IEEE80211_SMPS_AUTOMATIC | |
IEEE80211_SMPS_OFF | |
IEEE80211_SMPS_STATIC | |
IEEE80211_SMPS_DYNAMIC | |
IEEE80211_SMPS_NUM_MODES |
Definition at line 818 of file mac80211.h.
enum ieee80211_sta_state |
enum ieee80211_sta_state - station state
: station doesn't exist at all, this is a special state for add/remove transitions : station exists without special state : station is authenticated : station is associated : station is authorized (802.1X)
IEEE80211_STA_NOTEXIST | |
IEEE80211_STA_NONE | |
IEEE80211_STA_AUTH | |
IEEE80211_STA_ASSOC | |
IEEE80211_STA_AUTHORIZED |
Definition at line 1056 of file mac80211.h.
enum ieee80211_tpt_led_trigger_flags - throughput trigger flags : enable blinking with radio : enable blinking when working : enable blinking when at least one interface is connected in some way, including being an AP
IEEE80211_TPT_LEDTRIG_FL_RADIO | |
IEEE80211_TPT_LEDTRIG_FL_WORK | |
IEEE80211_TPT_LEDTRIG_FL_CONNECTED |
Definition at line 2510 of file mac80211.h.
enum ieee80211_vif_flags |
enum ieee80211_vif_flags - virtual interface flags
: the device performs beacon filtering on this virtual interface to avoid unnecessary CPU wakeups : the device can do connection quality monitoring on this virtual interface – i.e. it can monitor connection quality related parameters, such as the RSSI level and provide notifications if configured trigger levels are reached.
Definition at line 911 of file mac80211.h.
enum mac80211_rate_control_flags - per-rate flags set by the Rate Control algorithm.
These flags are set by the Rate control algorithm for each rate during tx, in the member of struct ieee80211_tx_rate.
: Use RTS/CTS exchange for this rate. : CTS-to-self protection is required. This is set if the current BSS requires ERP protection. : Use short preamble. : HT rate. : Indicates whether this rate should be used in Greenfield mode. : Indicates if the Channel Width should be 40 MHz. : The frame should be transmitted on both of the adjacent 20 MHz channels, if the current channel type is NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. : Short Guard interval should be used for this rate.
Definition at line 465 of file mac80211.h.
enum mac80211_rx_flags |
enum mac80211_rx_flags - receive flags
These flags are used with the member of &struct ieee80211_rx_status. : Michael MIC error was reported on this frame. Use together with RX_FLAG_MMIC_STRIPPED. : This frame was decrypted in hardware. : the Michael MIC is stripped off this frame, verification has been done by the hardware. : The IV/ICV are stripped from this frame. If this flag is set, the stack cannot do any replay detection hence the driver or hardware will have to do that. : Set this flag if the FCS check failed on the frame. : Set this flag if the PCLP check failed on the frame. : The timestamp passed in the RX status ( field) is valid and contains the time the first symbol of the MPDU was received. This is useful in monitor mode and for proper IBSS merging. : Short preamble was used for this frame : HT MCS was used and rate_idx is MCS index : HT40 (40 MHz) was used : Short guard interval was used : The signal strength value is not present. Valid only for data frames (mainly A-MPDU) : This frame was received in a HT-greenfield transmission, if the driver fills this value it should add IEEE80211_RADIOTAP_MCS_HAVE_FMT to hw.radiotap_mcs_details to advertise that fact : A-MPDU details are known, in particular the reference number () must be populated and be a distinct number for each A-MPDU : driver reports 0-length subframes : This is a zero-length subframe, for monitoring purposes only : last subframe is known, should be set on all subframes of a single A-MPDU : this subframe is the last subframe of the A-MPDU : A delimiter CRC error has been detected on this subframe : The delimiter CRC field is known (the CRC is stored in the field)
Definition at line 693 of file mac80211.h.
enum mac80211_tx_control_flags - flags to describe transmission information/status
These flags are used with the member of &ieee80211_tx_info.
: require TX status callback for this frame. : The driver has to assign a sequence number to this frame, taking care of not overwriting the fragment number and increasing the sequence number only when the IEEE80211_TX_CTL_FIRST_FRAGMENT flag is set. mac80211 will properly assign sequence numbers to QoS-data frames but cannot do so correctly for non-QoS-data and management frames because beacons need them from that counter as well and mac80211 cannot guarantee proper sequencing. If this flag is set, the driver should instruct the hardware to assign a sequence number to the frame or assign one itself. Cf. IEEE 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for beacons and always be clear for frames without a sequence number field. : tell the low level not to wait for an ack : clear powersave filter for destination station : this is a first fragment of the frame : send this frame after DTIM beacon : this frame should be sent as part of an A-MPDU : Frame was injected, internal to mac80211. : The frame was not transmitted because the destination STA was in powersave mode. Note that to avoid race conditions, the filter must be set by the hardware or firmware upon receiving a frame that indicates that the station went to sleep (must be done on device to filter frames already on the queue) and may only be unset after mac80211 gives the OK for that by setting the IEEE80211_TX_CTL_CLEAR_PS_FILT (see above), since only then is it guaranteed that no more frames are in the hardware queue. : Frame was acknowledged : The frame was aggregated, so status is for the whole aggregation. : no block ack was returned, so consider using block ack request (BAR). : internal to mac80211, can be set by rate control algorithms to indicate probe rate, will be cleared for fragmented frames (except on the last fragment) : completely internal to mac80211, used to indicate that a pending frame requires TX processing before it can be sent out. : completely internal to mac80211, used to indicate that a frame was already retried due to PS : completely internal to mac80211, used to indicate frame should not be encrypted : This frame is a response to a poll frame (PS-Poll or uAPSD) or a non-bufferable MMPDU and must be sent although the station is in powersave mode. : More frames will be passed to the transmit function after the current frame, this can be used by drivers to kick the DMA queue only if unset or when the queue gets full. : This frame is being retransmitted after TX status because the destination was asleep, it must not be modified again (no seqno assignment, crypto, etc.) : Frame was requested through nl80211 MLME command (internal to mac80211 to figure out whether to send TX status to user space) : tells the driver to use LDPC for this frame : Enables Space-Time Block Coding (STBC) for this frame and selects the maximum number of streams that it can use. : Marks this packet to be transmitted on the off-channel channel when a remain-on-channel offload is done in hardware – normal packets still flow and are expected to be handled properly by the device. : Marks this packet to be used for TKIP testing. It will be sent out with incorrect Michael MIC key to allow TKIP countermeasures to be tested. : This frame will be sent at non CCK rate. This flag is actually used for management frame especially for P2P frames not being sent at CCK rate in 2GHz band. : This packet marks the end of service period, when its status is reported the service period ends. For frames in an SP that mac80211 transmits, it is already set; for driver frames the driver may set this flag. It is also used to do the same for PS-Poll responses. : This frame will be sent at lowest rate. This flag is used to send nullfunc frame at minimum rate when the nullfunc is used for connection monitoring purpose. : Don't fragment this packet even if it would be fragmented by size (this is optional, only used for monitor injection).
Note: If you have to add new flags to the enumeration, then don't forget to update IEEE80211_TX_TEMPORARY_FLAGS when necessary.
Definition at line 398 of file mac80211.h.
enum set_key_cmd |
enum set_key_cmd - key command
Used with the set_key() callback in &struct ieee80211_ops, this indicates whether a key is being removed or added.
: a key is set : a key must be disabled
Definition at line 1042 of file mac80211.h.
enum sta_notify_cmd |
enum sta_notify_cmd - sta notify command
Used with the sta_notify() callback in &struct ieee80211_ops, this indicates if an associated station made a power state transition.
: a station is now sleeping : a sleeping station woke up
Definition at line 1108 of file mac80211.h.
|
read |
ieee80211_alloc_hw - Allocate a new hardware device
This must be called once for each hardware device. The returned pointer must be used to refer to this device when calling other functions. mac80211 allocates a private data area for the driver pointed to by in &struct ieee80211_hw, the size of this area is given as .
: length of private data : callbacks for this device
|
read |
ieee80211_ap_probereq_get - retrieve a Probe Request template : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback.
Creates a Probe Request template which can, for example, be uploaded to hardware. The template is filled with bssid, ssid and supported rate information. This function must only be called from within the .bss_info_changed callback function and only in managed mode. The function is only useful when the interface is associated, otherwise it will return NULL.
int ieee80211_ave_rssi | ( | struct ieee80211_vif * | vif | ) |
|
read |
ieee80211_beacon_get_tim - beacon generation function : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback. : pointer to variable that will receive the TIM IE offset. Set to 0 if invalid (in non-AP modes). : pointer to variable that will receive the TIM IE length, (including the ID and length bytes!). Set to 0 if invalid (in non-AP modes).
If the driver implements beaconing modes, it must use this function to obtain the beacon frame/template.
If the beacon frames are generated by the host system (i.e., not in hardware/firmware), the driver uses this function to get each beacon frame from mac80211 – it is responsible for calling this function before the beacon is needed (e.g. based on hardware interrupt).
If the beacon frames are generated by the device, then the driver must use the returned beacon as the template and change the TIM IE according to the current DTIM parameters/TIM bitmap.
void ieee80211_beacon_loss | ( | struct ieee80211_vif * | vif | ) |
ieee80211_beacon_loss - inform hardware does not receive beacons
: &struct ieee80211_vif pointer from the add_interface callback.
When beacon filtering is enabled with IEEE80211_VIF_BEACON_FILTER and IEEE80211_CONF_PS is set, the driver needs to inform whenever the hardware is not receiving beacons with this function.
void ieee80211_chswitch_done | ( | struct ieee80211_vif * | vif, |
bool | success | ||
) |
void ieee80211_connection_loss | ( | struct ieee80211_vif * | vif | ) |
ieee80211_connection_loss - inform hardware has lost connection to the AP
: &struct ieee80211_vif pointer from the add_interface callback.
When beacon filtering is enabled with IEEE80211_VIF_BEACON_FILTER, and IEEE80211_CONF_PS and IEEE80211_HW_CONNECTION_MONITOR are set, the driver needs to inform if the connection to the AP has been lost.
This function will cause immediate change to disassociated state, without connection recovery attempts.
void ieee80211_cqm_rssi_notify | ( | struct ieee80211_vif * | vif, |
enum nl80211_cqm_rssi_threshold_event | rssi_event, | ||
gfp_t | gfp | ||
) |
ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring rssi threshold triggered
: &struct ieee80211_vif pointer from the add_interface callback. : the RSSI trigger event type : context flags
When the IEEE80211_VIF_SUPPORTS_CQM_RSSI is set, and a connection quality monitoring is configured with an rssi threshold, the driver will inform whenever the rssi level reaches the threshold.
__le16 ieee80211_ctstoself_duration | ( | struct ieee80211_hw * | hw, |
struct ieee80211_vif * | vif, | ||
size_t | frame_len, | ||
const struct ieee80211_tx_info * | frame_txctl | ||
) |
ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback. : the length of the frame that is going to be protected by the CTS-to-self. : &struct ieee80211_tx_info of the frame.
If the CTS-to-self is generated in firmware, but the host system must provide the duration field, the low-level driver uses this function to receive the duration field value in little-endian byteorder.
void ieee80211_ctstoself_get | ( | struct ieee80211_hw * | hw, |
struct ieee80211_vif * | vif, | ||
const void * | frame, | ||
size_t | frame_len, | ||
const struct ieee80211_tx_info * | frame_txctl, | ||
struct ieee80211_cts * | cts | ||
) |
ieee80211_ctstoself_get - CTS-to-self frame generation function : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback. : pointer to the frame that is going to be protected by the CTS-to-self. : the frame length (in octets). : &struct ieee80211_tx_info of the frame. : The buffer where to store the CTS-to-self frame.
If the CTS-to-self frames are generated by the host system (i.e., not in hardware/firmware), the low-level driver uses this function to receive the next CTS-to-self frame from the 802.11 code. The low-level is responsible for calling this function before and CTS-to-self frame is needed.
void ieee80211_disable_dyn_ps | ( | struct ieee80211_vif * | vif | ) |
ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm
: &struct ieee80211_vif pointer from the add_interface callback.
Some hardware require full power save to manage simultaneous BT traffic on the WLAN frequency. Full PSM is required periodically, whenever there are burst of BT traffic. The hardware gets information of BT traffic via hardware co-existence lines, and consequentially requests mac80211 to (temporarily) enter full psm. This function will only temporarily disable dynamic PS, not enable PSM if it was not already enabled. The driver must make sure to re-enable dynamic PS using ieee80211_enable_dyn_ps() if the driver has disabled it.
void ieee80211_disable_rssi_reports | ( | struct ieee80211_vif * | vif | ) |
void ieee80211_enable_dyn_ps | ( | struct ieee80211_vif * | vif | ) |
ieee80211_enable_dyn_ps - restore dynamic psm after being disabled
: &struct ieee80211_vif pointer from the add_interface callback.
This function restores dynamic PS after being temporarily disabled via ieee80211_disable_dyn_ps(). Each ieee80211_disable_dyn_ps() call must be coupled with an eventual call to this function.
void ieee80211_enable_rssi_reports | ( | struct ieee80211_vif * | vif, |
int | rssi_min_thold, | ||
int | rssi_max_thold | ||
) |
|
read |
ieee80211_find_sta - find a station
: virtual interface to look for station on : station's address
This function must be called under RCU lock and the resulting pointer is only valid under RCU lock as well.
Definition at line 928 of file sta_info.c.
|
read |
ieee80211_find_sta_by_ifaddr - find a station on hardware
: pointer as obtained from ieee80211_alloc_hw() : remote station's address : local address (vif->sdata->vif.addr). Use NULL for 'any'.
This function must be called under RCU lock and the resulting pointer is only valid under RCU lock as well.
NOTE: You may pass NULL for localaddr, but then you will just get the first STA that matches the remote address 'addr'. We can have multiple STA associated with multiple logical stations (e.g. consider a station connecting to another BSSID on the same AP hardware without disconnecting first). In this case, the result of this method with localaddr NULL is not reliable.
DO NOT USE THIS FUNCTION with localaddr NULL if at all possible.
Definition at line 905 of file sta_info.c.
void ieee80211_free_hw | ( | struct ieee80211_hw * | hw | ) |
void ieee80211_free_txskb | ( | struct ieee80211_hw * | hw, |
struct sk_buff * | skb | ||
) |
__le16 ieee80211_generic_frame_duration | ( | struct ieee80211_hw * | hw, |
struct ieee80211_vif * | vif, | ||
enum ieee80211_band | band, | ||
size_t | frame_len, | ||
struct ieee80211_rate * | rate | ||
) |
ieee80211_generic_frame_duration - Calculate the duration field for a frame : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback. : the band to calculate the frame duration on : the length of the frame. : the rate at which the frame is going to be transmitted.
Calculate the duration field of some generic frame, given its length and transmission rate (in 100kbps).
|
read |
ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames : pointer as obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback.
Function for accessing buffered broadcast and multicast frames. If hardware/firmware does not implement buffering of broadcast/multicast frames when power saving is used, 802.11 code buffers them in the host memory. The low-level driver uses this function to fetch next buffered frame. In most cases, this is used when generating beacon frame. This function returns a pointer to the next buffered skb or NULL if no more buffered frames are available.
Note: buffered frames are returned only after DTIM beacon frame was generated with ieee80211_beacon_get() and the low-level driver must thus call ieee80211_beacon_get() first. ieee80211_get_buffered_bc() returns NULL if the previous generated beacon was not DTIM, so the low-level driver does not need to check for DTIM beacons separately and should be able to use common code for all beacons.
void ieee80211_get_key_rx_seq | ( | struct ieee80211_key_conf * | keyconf, |
int | tid, | ||
struct ieee80211_key_seq * | seq | ||
) |
ieee80211_get_key_rx_seq - get key RX sequence counter
: the parameter passed with the set key : The TID, or -1 for the management frame value (CCMP only); the value on TID 0 is also used for non-QoS frames. For CMAC, only TID 0 is valid. : buffer to receive the sequence data
This function allows a driver to retrieve the current RX IV/PNs for the given key. It must not be called if IV checking is done by the device and not by mac80211.
Note that this function may only be called when no RX processing can be done concurrently.
void ieee80211_get_key_tx_seq | ( | struct ieee80211_key_conf * | keyconf, |
struct ieee80211_key_seq * | seq | ||
) |
ieee80211_get_key_tx_seq - get key TX sequence counter
: the parameter passed with the set key : buffer to receive the sequence data
This function allows a driver to retrieve the current TX IV/PN for the given key. It must not be called if IV generation is offloaded to the device.
Note that this function may only be called when no TX processing can be done concurrently, for example when queues are stopped and the stop has been synchronized.
void ieee80211_get_tkip_p1k_iv | ( | struct ieee80211_key_conf * | keyconf, |
u32 | iv32, | ||
u16 * | p1k | ||
) |
void ieee80211_get_tkip_rx_p1k | ( | struct ieee80211_key_conf * | keyconf, |
const u8 * | ta, | ||
u32 | iv32, | ||
u16 * | p1k | ||
) |
ieee80211_get_tkip_rx_p1k - get a TKIP phase 1 key for RX
This function returns the TKIP phase 1 key for the given IV32 and transmitter address.
: the parameter passed with the set key : TA that will be used with the key : IV32 to get the P1K for : a buffer to which the key will be written, as 5 u16 values
void ieee80211_iter_keys | ( | struct ieee80211_hw * | hw, |
struct ieee80211_vif * | vif, | ||
void(*)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct ieee80211_key_conf *key, void *data) | iter, | ||
void * | iter_data | ||
) |
ieee80211_iter_keys - iterate keys programmed into the device : pointer obtained from ieee80211_alloc_hw() : virtual interface to iterate, may be NULL for all : iterator function that will be called for each key : custom data to pass to the iterator function
This function can be used to iterate all the keys known to mac80211, even those that weren't previously programmed into the device. This is intended for use in WoWLAN if the device needs reprogramming of the keys during suspend. Note that due to locking reasons, it is also only safe to call this at few spots since it must hold the RTNL and be able to sleep.
The order in which the keys are iterated matches the order in which they were originally installed and handed to the set_key callback.
void ieee80211_iterate_active_interfaces | ( | struct ieee80211_hw * | hw, |
void(*)(void *data, u8 *mac, struct ieee80211_vif *vif) | iterator, | ||
void * | data | ||
) |
ieee80211_iterate_active_interfaces - iterate active interfaces
This function iterates over the interfaces associated with a given hardware that are currently active and calls the callback for them. This function allows the iterator function to sleep, when the iterator function is atomic can be used. Does not iterate over a new interface during add_interface()
: the hardware struct of which the interfaces should be iterated over : the iterator function to call : first argument of the iterator function
void ieee80211_iterate_active_interfaces_atomic | ( | struct ieee80211_hw * | hw, |
void(*)(void *data, u8 *mac, struct ieee80211_vif *vif) | iterator, | ||
void * | data | ||
) |
ieee80211_iterate_active_interfaces_atomic - iterate active interfaces
This function iterates over the interfaces associated with a given hardware that are currently active and calls the callback for them. This function requires the iterator callback function to be atomic, if that is not desired, use instead. Does not iterate over a new interface during add_interface()
: the hardware struct of which the interfaces should be iterated over : the iterator function to call, cannot sleep : first argument of the iterator function
void ieee80211_napi_complete | ( | struct ieee80211_hw * | hw | ) |
void ieee80211_napi_schedule | ( | struct ieee80211_hw * | hw | ) |
|
read |
ieee80211_nullfunc_get - retrieve a nullfunc template : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback.
Creates a Nullfunc template which can, for example, uploaded to hardware. The template must be updated after association so that correct BSSID and address is used.
Note: Caller (or hardware) is responsible for setting the &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields.
|
read |
ieee80211_probereq_get - retrieve a Probe Request template : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback. : SSID buffer : length of SSID : buffer containing all IEs except SSID for the template : length of the IE buffer
Creates a Probe Request template which can, for example, be uploaded to hardware.
|
read |
ieee80211_proberesp_get - retrieve a Probe Response template : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback.
Creates a Probe Response template which can, for example, be uploaded to hardware. The destination address should be set by the caller.
Can only be called in AP mode.
|
read |
ieee80211_pspoll_get - retrieve a PS Poll template : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback.
Creates a PS Poll a template which can, for example, uploaded to hardware. The template must be updated after association so that correct AID, BSSID and MAC address is used.
Note: Caller (or hardware) is responsible for setting the &IEEE80211_FCTL_PM bit.
void ieee80211_queue_delayed_work | ( | struct ieee80211_hw * | hw, |
struct delayed_work * | dwork, | ||
unsigned long | delay | ||
) |
ieee80211_queue_delayed_work - add work onto the mac80211 workqueue
Drivers and mac80211 use this to queue delayed work onto the mac80211 workqueue.
: the hardware struct for the interface we are adding work for : delayable work to queue onto the mac80211 workqueue : number of jiffies to wait before queueing
int ieee80211_queue_stopped | ( | struct ieee80211_hw * | hw, |
int | queue | ||
) |
ieee80211_queue_stopped - test status of the queue : pointer as obtained from ieee80211_alloc_hw(). : queue number (counted from zero).
Drivers should use this function instead of netif_stop_queue.
void ieee80211_queue_work | ( | struct ieee80211_hw * | hw, |
struct work_struct * | work | ||
) |
ieee80211_queue_work - add work onto the mac80211 workqueue
Drivers and mac80211 use this to add work onto the mac80211 workqueue. This helper ensures drivers are not queueing work when they should not be.
: the hardware struct for the interface we are adding work for : the work we want to add onto the mac80211 workqueue
int ieee80211_rate_control_register | ( | struct rate_control_ops * | ops | ) |
void ieee80211_rate_control_unregister | ( | struct rate_control_ops * | ops | ) |
void ieee80211_ready_on_channel | ( | struct ieee80211_hw * | hw | ) |
ieee80211_ready_on_channel - notification of remain-on-channel start : pointer as obtained from ieee80211_alloc_hw()
Definition at line 243 of file offchannel.c.
int ieee80211_register_hw | ( | struct ieee80211_hw * | hw | ) |
ieee80211_register_hw - Register hardware device
You must call this function before any other functions in mac80211. Note that before a hardware can be registered, you need to fill the contained wiphy's information.
: the device to register as returned by ieee80211_alloc_hw()
void ieee80211_remain_on_channel_expired | ( | struct ieee80211_hw * | hw | ) |
ieee80211_remain_on_channel_expired - remain_on_channel duration expired : pointer as obtained from ieee80211_alloc_hw()
Definition at line 425 of file offchannel.c.
void ieee80211_report_low_ack | ( | struct ieee80211_sta * | sta, |
u32 | num_packets | ||
) |
void ieee80211_request_smps | ( | struct ieee80211_vif * | vif, |
enum ieee80211_smps_mode | smps_mode | ||
) |
ieee80211_request_smps - request SM PS transition : &struct ieee80211_vif pointer from the add_interface callback. : new SM PS mode
This allows the driver to request an SM PS transition in managed mode. This is useful when the driver has more information than the stack about possible interference, for example by bluetooth.
void ieee80211_restart_hw | ( | struct ieee80211_hw * | hw | ) |
ieee80211_restart_hw - restart hardware completely
Call this function when the hardware was restarted for some reason (hardware error, ...) and the driver is unable to restore its state by itself. mac80211 assumes that at this point the driver/hardware is completely uninitialised and stopped, it starts the process by calling the ->start() operation. The driver will need to reset all internal state that it has prior to calling this function.
: the hardware to restart
void ieee80211_resume_disconnect | ( | struct ieee80211_vif * | vif | ) |
ieee80211_resume_disconnect - disconnect from AP after resume
: &struct ieee80211_vif pointer from the add_interface callback.
Instructs mac80211 to disconnect from the AP after resume. Drivers can use this after WoWLAN if they know that the connection cannot be kept up, for example because keys were used while the device was asleep but the replay counters or similar cannot be retrieved from the device during resume.
Note that due to implementation issues, if the driver uses the reconfiguration functionality during resume the interface will still be added as associated first during resume and then disconnect normally later.
This function can only be called from the resume callback and the driver must not be holding any of its own locks while it calls this function, or at least not any locks it needs in the key configuration paths (if it supports HW crypto).
__le16 ieee80211_rts_duration | ( | struct ieee80211_hw * | hw, |
struct ieee80211_vif * | vif, | ||
size_t | frame_len, | ||
const struct ieee80211_tx_info * | frame_txctl | ||
) |
ieee80211_rts_duration - Get the duration field for an RTS frame : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback. : the length of the frame that is going to be protected by the RTS. : &struct ieee80211_tx_info of the frame.
If the RTS is generated in firmware, but the host system must provide the duration field, the low-level driver uses this function to receive the duration field value in little-endian byteorder.
void ieee80211_rts_get | ( | struct ieee80211_hw * | hw, |
struct ieee80211_vif * | vif, | ||
const void * | frame, | ||
size_t | frame_len, | ||
const struct ieee80211_tx_info * | frame_txctl, | ||
struct ieee80211_rts * | rts | ||
) |
ieee80211_rts_get - RTS frame generation function : pointer obtained from ieee80211_alloc_hw(). : &struct ieee80211_vif pointer from the add_interface callback. : pointer to the frame that is going to be protected by the RTS. : the frame length (in octets). : &struct ieee80211_tx_info of the frame. : The buffer where to store the RTS frame.
If the RTS frames are generated by the host system (i.e., not in hardware/firmware), the low-level driver uses this function to receive the next RTS frame from the 802.11 code. The low-level is responsible for calling this function before and RTS frame is needed.
void ieee80211_rx | ( | struct ieee80211_hw * | hw, |
struct sk_buff * | skb | ||
) |
ieee80211_rx - receive frame
Use this function to hand received frames to mac80211. The receive buffer in must start with an IEEE 802.11 header. In case of a paged is used, the driver is recommended to put the ieee80211 header of the frame on the linear part of the to avoid memory allocation and/or memcpy by the stack.
This function may not be called in IRQ context. Calls to this function for a single hardware must be synchronized against each other. Calls to this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be mixed for a single hardware.
In process context use instead ieee80211_rx_ni().
: the hardware this frame came in on : the buffer to receive, owned by mac80211 after this call
void ieee80211_rx_irqsafe | ( | struct ieee80211_hw * | hw, |
struct sk_buff * | skb | ||
) |
ieee80211_rx_irqsafe - receive frame
Like ieee80211_rx() but can be called in IRQ context (internally defers to a tasklet.)
Calls to this function, ieee80211_rx() or ieee80211_rx_ni() may not be mixed for a single hardware.
: the hardware this frame came in on : the buffer to receive, owned by mac80211 after this call
void ieee80211_scan_completed | ( | struct ieee80211_hw * | hw, |
bool | aborted | ||
) |
ieee80211_scan_completed - completed hardware scan
When hardware scan offload is used (i.e. the hw_scan() callback is assigned) this function needs to be called by the driver to notify mac80211 that the scan finished. This function can be called from any context, including hardirq context.
: the hardware that finished the scan : set to true if scan was aborted
void ieee80211_sched_scan_results | ( | struct ieee80211_hw * | hw | ) |
void ieee80211_sched_scan_stopped | ( | struct ieee80211_hw * | hw | ) |
ieee80211_sched_scan_stopped - inform that the scheduled scan has stopped
When a scheduled scan is running, this function can be called by the driver if it needs to stop the scan to perform another task. Usual scenarios are drivers that cannot continue the scheduled scan while associating, for instance.
: the hardware that is performing scheduled scans
ieee80211_send_bar - send a BlockAckReq frame
can be used to flush pending frames from the peer's aggregation reorder buffer.
: &struct ieee80211_vif pointer from the add_interface callback. : the peer's destination address : the TID of the aggregation session : the new starting sequence number for the receiver
void ieee80211_sta_block_awake | ( | struct ieee80211_hw * | hw, |
struct ieee80211_sta * | pubsta, | ||
bool | block | ||
) |
ieee80211_sta_block_awake - block station from waking up : the hardware : the station : whether to block or unblock
Some devices require that all frames that are on the queues for a specific station that went to sleep are flushed before a poll response or frames after the station woke up can be delivered to that it. Note that such frames must be rejected by the driver as filtered, with the appropriate status flag.
This function allows implementing this mode in a race-free manner.
To do this, a driver must keep track of the number of frames still enqueued for a specific station. If this number is not zero when the station goes to sleep, the driver must call this function to force mac80211 to consider the station to be asleep regardless of the station's actual state. Once the number of outstanding frames reaches zero, the driver must call this function again to unblock the station. That will cause mac80211 to be able to send ps-poll responses, and if the station queried in the meantime then frames will also be sent out as a result of this. Additionally, the driver will be notified that the station woke up some time after it is unblocked, regardless of whether the station actually woke up while blocked or not.
Definition at line 1302 of file sta_info.c.
void ieee80211_sta_eosp_irqsafe | ( | struct ieee80211_sta * | pubsta | ) |
ieee80211_sta_eosp - notify mac80211 about end of SP : the station
When a device transmits frames in a way that it can't tell mac80211 in the TX status about the EOSP, it must clear the IEEE80211_TX_STATUS_EOSP bit and call this function instead. This applies for PS-Poll as well as uAPSD.
Note that there is no non-_irqsafe version right now as it wasn't needed, but just like _tx_status() and _rx() must not be mixed in irqsafe/non-irqsafe versions, this function must not be mixed with those either. Use the all irqsafe, or all non-irqsafe, don't mix! If you need the non-irqsafe version of this, you need to add it.
Definition at line 1316 of file sta_info.c.
int ieee80211_sta_ps_transition | ( | struct ieee80211_sta * | sta, |
bool | start | ||
) |
ieee80211_sta_ps_transition - PS transition for connected sta
When operating in AP mode with the IEEE80211_HW_AP_LINK_PS flag set, use this function to inform mac80211 about a connected station entering/leaving PS mode.
This function may not be called in IRQ context or with softirqs enabled.
Calls to this function for a single hardware must be synchronized against each other.
The function returns -EINVAL when the requested PS mode is already set.
: currently connected sta : start or stop PS
void ieee80211_sta_set_buffered | ( | struct ieee80211_sta * | sta, |
u8 | tid, | ||
bool | buffered | ||
) |
ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames : &struct ieee80211_sta pointer for the sleeping station : the TID that has buffered frames : indicates whether or not frames are buffered for this TID
If a driver buffers frames for a powersave station instead of passing them back to mac80211 for retransmission, the station may still need to be told that there are buffered frames via the TIM bit.
This function informs mac80211 whether or not there are frames that are buffered in the driver for a given TID; mac80211 can then use this data to set the TIM bit (NOTE: This may call back into the driver's set_tim call! Beware of the locking!)
If all frames are released to the station (due to PS-poll or uAPSD) then the driver needs to inform mac80211 that there no longer are frames buffered. However, when the station wakes up mac80211 assumes that all buffered frames will be transmitted and clears this data, drivers need to make sure they inform mac80211 about all buffered frames on the sleep transition (sta_notify() with STA_NOTIFY_SLEEP).
Note that technically mac80211 only needs to know this per AC, not per TID, but since driver buffering will inevitably happen per TID (since it is related to aggregation) it is easier to make mac80211 map the TID to the AC as required instead of keeping track in all drivers that use this API.
Definition at line 1341 of file sta_info.c.
ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. : &struct ieee80211_vif pointer from the add_interface callback : receiver address of the BA session recipient. : the TID to BA on.
This function must be called by low level driver once it has finished with preparations for the BA session. It can be called from any context.
int ieee80211_start_tx_ba_session | ( | struct ieee80211_sta * | sta, |
u16 | tid, | ||
u16 | timeout | ||
) |
ieee80211_start_tx_ba_session - Start a tx Block Ack session. : the station for which to start a BA session : the TID to BA on. : session timeout value (in TUs)
Return: success if addBA request was sent, failure otherwise
Although mac80211/low level driver/user space application can estimate the need to start aggregation on a certain RA/TID, the session level will be managed by the mac80211.
void ieee80211_stop_queue | ( | struct ieee80211_hw * | hw, |
int | queue | ||
) |
ieee80211_stop_queue - stop specific queue : pointer as obtained from ieee80211_alloc_hw(). : queue number (counted from zero).
Drivers should use this function instead of netif_stop_queue.
void ieee80211_stop_queues | ( | struct ieee80211_hw * | hw | ) |
ieee80211_stop_queues - stop all queues : pointer as obtained from ieee80211_alloc_hw().
Drivers should use this function instead of netif_stop_queue.
ieee80211_stop_rx_ba_session - callback to stop existing BA sessions
in order not to harm the system performance and user experience, the device may request not to allow any rx ba session and tear down existing rx ba sessions based on system constraints such as periodic BT activity that needs to limit wlan activity (eg.sco or a2dp)." in such cases, the intention is to limit the duration of the rx ppdu and therefore prevent the peer device to use a-mpdu aggregation.
: &struct ieee80211_vif pointer from the add_interface callback. : Bit map of open rx ba per tid : & to bssid mac address
ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. : &struct ieee80211_vif pointer from the add_interface callback : receiver address of the BA session recipient. : the desired TID to BA on.
This function must be called by low level driver once it has finished with preparations for the BA session tear down. It can be called from any context.
int ieee80211_stop_tx_ba_session | ( | struct ieee80211_sta * | sta, |
u16 | tid | ||
) |
ieee80211_stop_tx_ba_session - Stop a Block Ack session. : the station whose BA session to stop : the TID to stop BA.
Return: negative error if the TID is invalid, or no aggregation active
Although mac80211/low level driver/user space application can estimate the need to stop aggregation on a certain RA/TID, the session level will be managed by the mac80211.
void ieee80211_tx_status | ( | struct ieee80211_hw * | hw, |
struct sk_buff * | skb | ||
) |
ieee80211_tx_status - transmit status callback
Call this function for all transmitted frames after they have been transmitted. It is permissible to not call this function for multicast frames but this can affect statistics.
This function may not be called in IRQ context. Calls to this function for a single hardware must be synchronized against each other. Calls to this function, ieee80211_tx_status_ni() and ieee80211_tx_status_irqsafe() may not be mixed for a single hardware.
: the hardware the frame was transmitted by : the frame that was transmitted, owned by mac80211 after this call
void ieee80211_tx_status_irqsafe | ( | struct ieee80211_hw * | hw, |
struct sk_buff * | skb | ||
) |
ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback
Like ieee80211_tx_status() but can be called in IRQ context (internally defers to a tasklet.)
Calls to this function, ieee80211_tx_status() and ieee80211_tx_status_ni() may not be mixed for a single hardware.
: the hardware the frame was transmitted by : the frame that was transmitted, owned by mac80211 after this call
void ieee80211_unregister_hw | ( | struct ieee80211_hw * | hw | ) |
void ieee80211_wake_queue | ( | struct ieee80211_hw * | hw, |
int | queue | ||
) |
ieee80211_wake_queue - wake specific queue : pointer as obtained from ieee80211_alloc_hw(). : queue number (counted from zero).
Drivers should use this function instead of netif_wake_queue.
void ieee80211_wake_queues | ( | struct ieee80211_hw * | hw | ) |
ieee80211_wake_queues - wake all queues : pointer as obtained from ieee80211_alloc_hw().
Drivers should use this function instead of netif_wake_queue.
bool rate_control_send_low | ( | struct ieee80211_sta * | sta, |
void * | priv_sta, | ||
struct ieee80211_tx_rate_control * | txrc | ||
) |
rate_control_send_low - helper for drivers for management/no-ack frames
Rate control algorithms that agree to use the lowest rate to send management frames and NO_ACK data with the respective hw retries should use this in the beginning of their mac80211 get_rate callback. If true is returned the rate control can simply return. If false is returned we guarantee that sta and sta and priv_sta is not null.
Rate control algorithms wishing to do more intelligent selection of rate for multicast/broadcast frames may choose to not use this.
: &struct ieee80211_sta pointer to the target destination. Note that this may be null. : private rate control structure. This may be null. : rate control information we sholud populate for mac80211.
|
read |
wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy
: the &struct wiphy which we want to query
mac80211 drivers can use this to get to their respective &struct ieee80211_hw. Drivers wishing to get to their own private structure can then access it via hw->priv. Note that mac802111 drivers should not use wiphy_priv() to try to get their private driver structure as this is already used internally by mac80211.