Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
core.c File Reference
#include <linux/if.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/nl80211.h>
#include <linux/debugfs.h>
#include <linux/notifier.h>
#include <linux/device.h>
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>
#include <linux/sched.h>
#include <net/genetlink.h>
#include <net/cfg80211.h>
#include "nl80211.h"
#include "core.h"
#include "sysfs.h"
#include "debugfs.h"
#include "wext-compat.h"
#include "ethtool.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define PHY_NAME   "phy"
 

Functions

 MODULE_AUTHOR ("Johannes Berg")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("wireless configuration support")
 
 LIST_HEAD (cfg80211_rdev_list)
 
 DEFINE_MUTEX (cfg80211_mutex)
 
 module_param (cfg80211_disable_40mhz_24ghz, bool, 0644)
 
 MODULE_PARM_DESC (cfg80211_disable_40mhz_24ghz,"Disable 40MHz support in the 2.4GHz band")
 
struct cfg80211_registered_devicecfg80211_rdev_by_wiphy_idx (int wiphy_idx)
 
int get_wiphy_idx (struct wiphy *wiphy)
 
struct wiphywiphy_idx_to_wiphy (int wiphy_idx)
 
struct cfg80211_registered_devicecfg80211_get_dev_from_ifindex (struct net *net, int ifindex)
 
int cfg80211_dev_rename (struct cfg80211_registered_device *rdev, char *newname)
 
int cfg80211_switch_netns (struct cfg80211_registered_device *rdev, struct net *net)
 
struct wiphywiphy_new (const struct cfg80211_ops *ops, int sizeof_priv)
 
 EXPORT_SYMBOL (wiphy_new)
 
int wiphy_register (struct wiphy *wiphy)
 
 EXPORT_SYMBOL (wiphy_register)
 
void wiphy_rfkill_start_polling (struct wiphy *wiphy)
 
 EXPORT_SYMBOL (wiphy_rfkill_start_polling)
 
void wiphy_rfkill_stop_polling (struct wiphy *wiphy)
 
 EXPORT_SYMBOL (wiphy_rfkill_stop_polling)
 
void wiphy_unregister (struct wiphy *wiphy)
 
 EXPORT_SYMBOL (wiphy_unregister)
 
void cfg80211_dev_free (struct cfg80211_registered_device *rdev)
 
void wiphy_free (struct wiphy *wiphy)
 
 EXPORT_SYMBOL (wiphy_free)
 
void wiphy_rfkill_set_hw_state (struct wiphy *wiphy, bool blocked)
 
 EXPORT_SYMBOL (wiphy_rfkill_set_hw_state)
 
void cfg80211_unregister_wdev (struct wireless_dev *wdev)
 
 EXPORT_SYMBOL (cfg80211_unregister_wdev)
 
void cfg80211_update_iface_num (struct cfg80211_registered_device *rdev, enum nl80211_iftype iftype, int num)
 
 subsys_initcall (cfg80211_init)
 
 module_exit (cfg80211_exit)
 

Variables

int cfg80211_rdev_list_generation
 
struct workqueue_structcfg80211_wq
 

Macro Definition Documentation

#define PHY_NAME   "phy"

Definition at line 31 of file core.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 7 of file core.c.

Function Documentation

void cfg80211_dev_free ( struct cfg80211_registered_device rdev)

Definition at line 695 of file core.c.

int cfg80211_dev_rename ( struct cfg80211_registered_device rdev,
char newname 
)

Definition at line 121 of file core.c.

struct cfg80211_registered_device* cfg80211_get_dev_from_ifindex ( struct net net,
int  ifindex 
)
read

Definition at line 100 of file core.c.

struct cfg80211_registered_device* cfg80211_rdev_by_wiphy_idx ( int  wiphy_idx)
read

Definition at line 55 of file core.c.

int cfg80211_switch_netns ( struct cfg80211_registered_device rdev,
struct net net 
)

Definition at line 170 of file core.c.

void cfg80211_unregister_wdev ( struct wireless_dev wdev)

cfg80211_unregister_wdev - remove the given wdev : struct wireless_dev to remove

Call this function only for wdevs that have no netdev assigned, e.g. P2P Devices. It removes the device from the list so that it can no longer be used. It is necessary to call this function even when cfg80211 requests the removal of the interface by calling the del_virtual_intf() callback. The function must also be called when the driver wishes to unregister the wdev, e.g. when the device is unbound from the driver.

Requires the RTNL to be held.

Definition at line 756 of file core.c.

void cfg80211_update_iface_num ( struct cfg80211_registered_device rdev,
enum nl80211_iftype  iftype,
int  num 
)

Definition at line 789 of file core.c.

DEFINE_MUTEX ( cfg80211_mutex  )
EXPORT_SYMBOL ( wiphy_new  )
EXPORT_SYMBOL ( wiphy_register  )
EXPORT_SYMBOL ( wiphy_rfkill_start_polling  )
EXPORT_SYMBOL ( wiphy_rfkill_stop_polling  )
EXPORT_SYMBOL ( wiphy_unregister  )
EXPORT_SYMBOL ( wiphy_free  )
EXPORT_SYMBOL ( wiphy_rfkill_set_hw_state  )
EXPORT_SYMBOL ( cfg80211_unregister_wdev  )
int get_wiphy_idx ( struct wiphy wiphy)

Definition at line 74 of file core.c.

LIST_HEAD ( cfg80211_rdev_list  )
MODULE_AUTHOR ( "Johannes Berg"  )
MODULE_DESCRIPTION ( "wireless configuration support )
module_exit ( cfg80211_exit  )
MODULE_LICENSE ( "GPL"  )
module_param ( cfg80211_disable_40mhz_24ghz  ,
bool  ,
0644   
)
MODULE_PARM_DESC ( cfg80211_disable_40mhz_24ghz  ,
"Disable 40MHz support in the 2.4GHz band"   
)
subsys_initcall ( cfg80211_init  )
void wiphy_free ( struct wiphy wiphy)

wiphy_free - free wiphy

: The wiphy to free

Definition at line 707 of file core.c.

struct wiphy* wiphy_idx_to_wiphy ( int  wiphy_idx)
read

Definition at line 84 of file core.c.

struct wiphy* wiphy_new ( const struct cfg80211_ops ops,
int  sizeof_priv 
)
read

wiphy_new - create a new wiphy for use with cfg80211

: The configuration operations for this device : The size of the private area to allocate

Create a new wiphy and associate the given operations with it. bytes are allocated for private use.

The returned pointer must be assigned to each netdev's ieee80211_ptr for proper operation.

Definition at line 283 of file core.c.

int wiphy_register ( struct wiphy wiphy)

wiphy_register - register a wiphy with cfg80211

: The wiphy to register.

Returns a non-negative wiphy index or a negative error code.

Definition at line 447 of file core.c.

void wiphy_rfkill_set_hw_state ( struct wiphy wiphy,
bool  blocked 
)

DOC: RFkill integration

RFkill integration in cfg80211 is almost invisible to drivers, as cfg80211 automatically registers an rfkill instance for each wireless device it knows about. Soft kill is also translated into disconnecting and turning all interfaces off, drivers are expected to turn off the device when all interfaces are down.

However, devices may have a hard RFkill line, in which case they also need to interact with the rfkill subsystem, via cfg80211. They can do this with a few helper functions documented here. wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state : the wiphy : block status

Definition at line 713 of file core.c.

void wiphy_rfkill_start_polling ( struct wiphy wiphy)

wiphy_rfkill_start_polling - start polling rfkill : the wiphy

Definition at line 609 of file core.c.

void wiphy_rfkill_stop_polling ( struct wiphy wiphy)

wiphy_rfkill_stop_polling - stop polling rfkill : the wiphy

Definition at line 620 of file core.c.

void wiphy_unregister ( struct wiphy wiphy)

wiphy_unregister - deregister a wiphy from cfg80211

: The wiphy to unregister.

After this call, no more requests can be made with this priv pointer, but the call may sleep to wait for an outstanding request that is being handled.

Definition at line 628 of file core.c.

Variable Documentation

int cfg80211_rdev_list_generation

Definition at line 39 of file core.c.

struct workqueue_struct* cfg80211_wq

Definition at line 47 of file core.c.