Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
sta_info.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/etherdevice.h>
#include <linux/netdevice.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/timer.h>
#include <linux/rtnetlink.h>
#include <net/mac80211.h>
#include "ieee80211_i.h"
#include "driver-ops.h"
#include "rate.h"
#include "sta_info.h"
#include "debugfs_sta.h"
#include "mesh.h"
#include "wme.h"

Go to the source code of this file.

Functions

struct sta_infosta_info_get (struct ieee80211_sub_if_data *sdata, const u8 *addr)
 
struct sta_infosta_info_get_bss (struct ieee80211_sub_if_data *sdata, const u8 *addr)
 
struct sta_infosta_info_get_by_idx (struct ieee80211_sub_if_data *sdata, int idx)
 
void sta_info_free (struct ieee80211_local *local, struct sta_info *sta)
 
struct sta_infosta_info_alloc (struct ieee80211_sub_if_data *sdata, const u8 *addr, gfp_t gfp)
 
int sta_info_insert_rcu (struct sta_info *sta) __acquires(RCU)
 
int sta_info_insert (struct sta_info *sta)
 
void sta_info_recalc_tim (struct sta_info *sta)
 
int __must_check __sta_info_destroy (struct sta_info *sta)
 
int sta_info_destroy_addr (struct ieee80211_sub_if_data *sdata, const u8 *addr)
 
int sta_info_destroy_addr_bss (struct ieee80211_sub_if_data *sdata, const u8 *addr)
 
void sta_info_init (struct ieee80211_local *local)
 
void sta_info_stop (struct ieee80211_local *local)
 
int sta_info_flush (struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata)
 
void ieee80211_sta_expire (struct ieee80211_sub_if_data *sdata, unsigned long exp_time)
 
struct ieee80211_staieee80211_find_sta_by_ifaddr (struct ieee80211_hw *hw, const u8 *addr, const u8 *localaddr)
 
 EXPORT_SYMBOL_GPL (ieee80211_find_sta_by_ifaddr)
 
struct ieee80211_staieee80211_find_sta (struct ieee80211_vif *vif, const u8 *addr)
 
 EXPORT_SYMBOL (ieee80211_find_sta)
 
void ieee80211_sta_ps_deliver_wakeup (struct sta_info *sta)
 
void ieee80211_sta_ps_deliver_poll_response (struct sta_info *sta)
 
void ieee80211_sta_ps_deliver_uapsd (struct sta_info *sta)
 
void ieee80211_sta_block_awake (struct ieee80211_hw *hw, struct ieee80211_sta *pubsta, bool block)
 
 EXPORT_SYMBOL (ieee80211_sta_block_awake)
 
void ieee80211_sta_eosp_irqsafe (struct ieee80211_sta *pubsta)
 
 EXPORT_SYMBOL (ieee80211_sta_eosp_irqsafe)
 
void ieee80211_sta_set_buffered (struct ieee80211_sta *pubsta, u8 tid, bool buffered)
 
 EXPORT_SYMBOL (ieee80211_sta_set_buffered)
 
int sta_info_move_state (struct sta_info *sta, enum ieee80211_sta_state new_state)
 

Function Documentation

int __must_check __sta_info_destroy ( struct sta_info sta)

Definition at line 718 of file sta_info.c.

EXPORT_SYMBOL ( ieee80211_find_sta  )
EXPORT_SYMBOL ( ieee80211_sta_block_awake  )
EXPORT_SYMBOL ( ieee80211_sta_eosp_irqsafe  )
EXPORT_SYMBOL ( ieee80211_sta_set_buffered  )
EXPORT_SYMBOL_GPL ( ieee80211_find_sta_by_ifaddr  )
struct ieee80211_sta* ieee80211_find_sta ( struct ieee80211_vif vif,
const u8 addr 
)
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.

struct ieee80211_sta* ieee80211_find_sta_by_ifaddr ( struct ieee80211_hw hw,
const u8 addr,
const u8 localaddr 
)
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_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.

void ieee80211_sta_expire ( struct ieee80211_sub_if_data sdata,
unsigned long  exp_time 
)

Definition at line 883 of file sta_info.c.

void ieee80211_sta_ps_deliver_poll_response ( struct sta_info sta)

Definition at line 1252 of file sta_info.c.

void ieee80211_sta_ps_deliver_uapsd ( struct sta_info sta)

Definition at line 1268 of file sta_info.c.

void ieee80211_sta_ps_deliver_wakeup ( struct sta_info sta)

Definition at line 958 of file sta_info.c.

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.

struct sta_info* sta_info_alloc ( struct ieee80211_sub_if_data sdata,
const u8 addr,
gfp_t  gfp 
)
read

Definition at line 294 of file sta_info.c.

int sta_info_destroy_addr ( struct ieee80211_sub_if_data sdata,
const u8 addr 
)

Definition at line 790 of file sta_info.c.

int sta_info_destroy_addr_bss ( struct ieee80211_sub_if_data sdata,
const u8 addr 
)

Definition at line 803 of file sta_info.c.

int sta_info_flush ( struct ieee80211_local local,
struct ieee80211_sub_if_data sdata 
)

sta_info_flush - flush matching STA entries from the STA table

Returns the number of removed STA entries.

: local interface data : matching rule for the net device (sta->dev) or NULL to match all STAs

Definition at line 863 of file sta_info.c.

void sta_info_free ( struct ieee80211_local local,
struct sta_info sta 
)

sta_info_free - free STA

: pointer to the global information : STA info to free

This function must undo everything done by sta_info_alloc() that may happen before sta_info_insert(). It may only be called when sta_info_insert() has not been attempted (and if that fails, the station is freed anyway.)

Definition at line 231 of file sta_info.c.

struct sta_info* sta_info_get ( struct ieee80211_sub_if_data sdata,
const u8 addr 
)
read

Definition at line 159 of file sta_info.c.

struct sta_info* sta_info_get_bss ( struct ieee80211_sub_if_data sdata,
const u8 addr 
)
read

Definition at line 181 of file sta_info.c.

struct sta_info* sta_info_get_by_idx ( struct ieee80211_sub_if_data sdata,
int  idx 
)
read

Definition at line 200 of file sta_info.c.

void sta_info_init ( struct ieee80211_local local)

Definition at line 839 of file sta_info.c.

int sta_info_insert ( struct sta_info sta)

Definition at line 496 of file sta_info.c.

int sta_info_insert_rcu ( struct sta_info sta)

Definition at line 470 of file sta_info.c.

int sta_info_move_state ( struct sta_info sta,
enum ieee80211_sta_state  new_state 
)

Definition at line 1358 of file sta_info.c.

void sta_info_recalc_tim ( struct sta_info sta)

Definition at line 541 of file sta_info.c.

void sta_info_stop ( struct ieee80211_local local)

Definition at line 849 of file sta_info.c.