Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
util.c File Reference
#include <linux/export.h>
#include <linux/bitops.h>
#include <linux/etherdevice.h>
#include <linux/slab.h>
#include <net/cfg80211.h>
#include <net/ip.h>
#include <net/dsfield.h>
#include "core.h"

Go to the source code of this file.

Functions

struct ieee80211_rateieee80211_get_response_rate (struct ieee80211_supported_band *sband, u32 basic_rates, int bitrate)
 
 EXPORT_SYMBOL (ieee80211_get_response_rate)
 
int ieee80211_channel_to_frequency (int chan, enum ieee80211_band band)
 
 EXPORT_SYMBOL (ieee80211_channel_to_frequency)
 
int ieee80211_frequency_to_channel (int freq)
 
 EXPORT_SYMBOL (ieee80211_frequency_to_channel)
 
struct ieee80211_channel__ieee80211_get_channel (struct wiphy *wiphy, int freq)
 
 EXPORT_SYMBOL (__ieee80211_get_channel)
 
void ieee80211_set_bitrate_flags (struct wiphy *wiphy)
 
bool cfg80211_supported_cipher_suite (struct wiphy *wiphy, u32 cipher)
 
int cfg80211_validate_key_settings (struct cfg80211_registered_device *rdev, struct key_params *params, int key_idx, bool pairwise, const u8 *mac_addr)
 
unsigned int __attribute_const__ ieee80211_hdrlen (__le16 fc)
 
 EXPORT_SYMBOL (ieee80211_hdrlen)
 
unsigned int ieee80211_get_hdrlen_from_skb (const struct sk_buff *skb)
 
 EXPORT_SYMBOL (ieee80211_get_hdrlen_from_skb)
 
unsigned int ieee80211_get_mesh_hdrlen (struct ieee80211s_hdr *meshhdr)
 
 EXPORT_SYMBOL (ieee80211_get_mesh_hdrlen)
 
int ieee80211_data_to_8023 (struct sk_buff *skb, const u8 *addr, enum nl80211_iftype iftype)
 
 EXPORT_SYMBOL (ieee80211_data_to_8023)
 
int ieee80211_data_from_8023 (struct sk_buff *skb, const u8 *addr, enum nl80211_iftype iftype, u8 *bssid, bool qos)
 
 EXPORT_SYMBOL (ieee80211_data_from_8023)
 
void ieee80211_amsdu_to_8023s (struct sk_buff *skb, struct sk_buff_head *list, const u8 *addr, enum nl80211_iftype iftype, const unsigned int extra_headroom, bool has_80211_header)
 
 EXPORT_SYMBOL (ieee80211_amsdu_to_8023s)
 
unsigned int cfg80211_classify8021d (struct sk_buff *skb)
 
 EXPORT_SYMBOL (cfg80211_classify8021d)
 
const u8ieee80211_bss_get_ie (struct cfg80211_bss *bss, u8 ie)
 
 EXPORT_SYMBOL (ieee80211_bss_get_ie)
 
void cfg80211_upload_connect_keys (struct wireless_dev *wdev)
 
void cfg80211_process_wdev_events (struct wireless_dev *wdev)
 
void cfg80211_process_rdev_events (struct cfg80211_registered_device *rdev)
 
int cfg80211_change_iface (struct cfg80211_registered_device *rdev, struct net_device *dev, enum nl80211_iftype ntype, u32 *flags, struct vif_params *params)
 
u32 cfg80211_calculate_bitrate (struct rate_info *rate)
 
 EXPORT_SYMBOL (cfg80211_calculate_bitrate)
 
int cfg80211_validate_beacon_int (struct cfg80211_registered_device *rdev, u32 beacon_int)
 
int cfg80211_can_use_iftype_chan (struct cfg80211_registered_device *rdev, struct wireless_dev *wdev, enum nl80211_iftype iftype, struct ieee80211_channel *chan, enum cfg80211_chan_mode chanmode)
 
int ieee80211_get_ratemask (struct ieee80211_supported_band *sband, const u8 *rates, unsigned int n_rates, u32 *mask)
 
const unsigned char
rfc1042_header[] 
__aligned (2)
 
 EXPORT_SYMBOL (rfc1042_header)
 
 EXPORT_SYMBOL (bridge_tunnel_header)
 

Function Documentation

const unsigned char rfc1042_header [] __aligned ( )
struct ieee80211_channel* __ieee80211_get_channel ( struct wiphy wiphy,
int  freq 
)
read

Definition at line 82 of file util.c.

u32 cfg80211_calculate_bitrate ( struct rate_info rate)

Definition at line 947 of file util.c.

int cfg80211_can_use_iftype_chan ( struct cfg80211_registered_device rdev,
struct wireless_dev wdev,
enum nl80211_iftype  iftype,
struct ieee80211_channel chan,
enum cfg80211_chan_mode  chanmode 
)

Definition at line 1008 of file util.c.

int cfg80211_change_iface ( struct cfg80211_registered_device rdev,
struct net_device dev,
enum nl80211_iftype  ntype,
u32 flags,
struct vif_params params 
)

Definition at line 792 of file util.c.

unsigned int cfg80211_classify8021d ( struct sk_buff skb)

cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame : the data frame

Definition at line 660 of file util.c.

void cfg80211_process_rdev_events ( struct cfg80211_registered_device rdev)

Definition at line 777 of file util.c.

void cfg80211_process_wdev_events ( struct wireless_dev wdev)

Definition at line 728 of file util.c.

bool cfg80211_supported_cipher_suite ( struct wiphy wiphy,
u32  cipher 
)

Definition at line 174 of file util.c.

void cfg80211_upload_connect_keys ( struct wireless_dev wdev)

Definition at line 696 of file util.c.

int cfg80211_validate_beacon_int ( struct cfg80211_registered_device rdev,
u32  beacon_int 
)

Definition at line 983 of file util.c.

int cfg80211_validate_key_settings ( struct cfg80211_registered_device rdev,
struct key_params params,
int  key_idx,
bool  pairwise,
const u8 mac_addr 
)

Definition at line 183 of file util.c.

EXPORT_SYMBOL ( ieee80211_get_response_rate  )
EXPORT_SYMBOL ( ieee80211_channel_to_frequency  )
EXPORT_SYMBOL ( ieee80211_frequency_to_channel  )
EXPORT_SYMBOL ( __ieee80211_get_channel  )
EXPORT_SYMBOL ( ieee80211_hdrlen  )
EXPORT_SYMBOL ( ieee80211_get_hdrlen_from_skb  )
EXPORT_SYMBOL ( ieee80211_get_mesh_hdrlen  )
EXPORT_SYMBOL ( ieee80211_data_to_8023  )
EXPORT_SYMBOL ( ieee80211_data_from_8023  )
EXPORT_SYMBOL ( ieee80211_amsdu_to_8023s  )
EXPORT_SYMBOL ( cfg80211_classify8021d  )
EXPORT_SYMBOL ( ieee80211_bss_get_ie  )
EXPORT_SYMBOL ( cfg80211_calculate_bitrate  )
EXPORT_SYMBOL ( rfc1042_header  )
EXPORT_SYMBOL ( bridge_tunnel_header  )
void ieee80211_amsdu_to_8023s ( struct sk_buff skb,
struct sk_buff_head list,
const u8 addr,
enum nl80211_iftype  iftype,
const unsigned int  extra_headroom,
bool  has_80211_header 
)

ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame

Decode an IEEE 802.11n A-MSDU frame and convert it to a list of 802.3 frames. The will be empty if the decode fails. The is consumed after the function returns.

: The input IEEE 802.11n A-MSDU frame. : The output list of 802.3 frames. It must be allocated and initialized by by the caller. : The device MAC address. : The device interface type. : The hardware extra headroom for SKBs in the . : Set it true if SKB is with IEEE 802.11 header.

Definition at line 561 of file util.c.

const u8* ieee80211_bss_get_ie ( struct cfg80211_bss bss,
u8  ie 
)

ieee80211_bss_get_ie - find IE with given ID : the bss to search : the IE ID Returns NULL if not found.

Definition at line 687 of file util.c.

int ieee80211_channel_to_frequency ( int  chan,
enum ieee80211_band  band 
)

DOC: Utility functions

cfg80211 offers a number of utility functions that can be useful. ieee80211_channel_to_frequency - convert channel number to frequency : channel number : band, necessary due to channel number overlap

Definition at line 34 of file util.c.

int ieee80211_data_from_8023 ( struct sk_buff skb,
const u8 addr,
enum nl80211_iftype  iftype,
u8 bssid,
bool  qos 
)

ieee80211_data_from_8023 - convert an 802.3 frame to 802.11 : the 802.3 frame : the device MAC address : the virtual interface type : the network bssid (used only for iftype STATION and ADHOC) : build 802.11 QoS data frame

Definition at line 445 of file util.c.

int ieee80211_data_to_8023 ( struct sk_buff skb,
const u8 addr,
enum nl80211_iftype  iftype 
)

DOC: Data path helpers

In addition to generic utilities, cfg80211 also offers functions that help implement the data path for devices that do not do the 802.11/802.3 conversion on the device. ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 : the 802.11 data frame : the device MAC address : the virtual interface type

Definition at line 328 of file util.c.

int ieee80211_frequency_to_channel ( int  freq)

ieee80211_frequency_to_channel - convert frequency to channel number : center frequency

Definition at line 64 of file util.c.

unsigned int ieee80211_get_hdrlen_from_skb ( const struct sk_buff skb)

ieee80211_get_hdrlen_from_skb - get header length from data

Given an skb with a raw 802.11 header at the data pointer this function returns the 802.11 header length in bytes (not including encryption headers). If the data in the sk_buff is too short to contain a valid 802.11 header the function returns 0.

: the frame

Definition at line 297 of file util.c.

unsigned int ieee80211_get_mesh_hdrlen ( struct ieee80211s_hdr meshhdr)

ieee80211_get_mesh_hdrlen - get mesh extension header length : the mesh extension header, only the flags field (first byte) will be accessed Returns the length of the extension header, which is always at least 6 bytes and at most 18 if address 5 and 6 are present.

Definition at line 312 of file util.c.

int ieee80211_get_ratemask ( struct ieee80211_supported_band sband,
const u8 rates,
unsigned int  n_rates,
u32 mask 
)

Definition at line 1158 of file util.c.

struct ieee80211_rate* ieee80211_get_response_rate ( struct ieee80211_supported_band sband,
u32  basic_rates,
int  bitrate 
)
read

ieee80211_get_response_rate - get basic rate for a given rate

: the band to look for rates in : bitmap of basic rates : the bitrate for which to find the basic rate

This function returns the basic rate corresponding to a given bitrate, that is the next lower bitrate contained in the basic rate map, which is, for this function, given as a bitmap of indices of rates in the band's bitrate table.

Definition at line 16 of file util.c.

unsigned int __attribute_const__ ieee80211_hdrlen ( __le16  fc)

ieee80211_hdrlen - get header length in bytes from frame control : frame control field in little-endian format

Definition at line 262 of file util.c.

void ieee80211_set_bitrate_flags ( struct wiphy wiphy)

Definition at line 165 of file util.c.