Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
mac80211_hwsim.c File Reference
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <net/dst.h>
#include <net/xfrm.h>
#include <net/mac80211.h>
#include <net/ieee80211_radiotap.h>
#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/ktime.h>
#include <net/genetlink.h>
#include "mac80211_hwsim.h"

Go to the source code of this file.

Data Structures

struct  hwsim_vif_priv
 
struct  hwsim_sta_priv
 
struct  mac80211_hwsim_data
 
struct  hwsim_radiotap_hdr
 
struct  mac80211_hwsim_addr_match_data
 
struct  hw_scan_done
 

Macros

#define WARN_QUEUE   100
 
#define MAX_QUEUE   200
 
#define HWSIM_VIF_MAGIC   0x69537748
 
#define HWSIM_STA_MAGIC   0x6d537748
 
#define CHAN2G(_freq)
 
#define CHAN5G(_freq)
 

Enumerations

enum  hwsim_regtest {
  HWSIM_REGTEST_DISABLED = 0, HWSIM_REGTEST_DRIVER_REG_FOLLOW = 1, HWSIM_REGTEST_DRIVER_REG_ALL = 2, HWSIM_REGTEST_DIFF_COUNTRY = 3,
  HWSIM_REGTEST_WORLD_ROAM = 4, HWSIM_REGTEST_CUSTOM_WORLD = 5, HWSIM_REGTEST_CUSTOM_WORLD_2 = 6, HWSIM_REGTEST_STRICT_FOLLOW = 7,
  HWSIM_REGTEST_STRICT_ALL = 8, HWSIM_REGTEST_STRICT_AND_DRIVER_REG = 9, HWSIM_REGTEST_ALL = 10
}
 

Functions

 MODULE_AUTHOR ("Jouni Malinen")
 
 MODULE_DESCRIPTION ("Software simulator of 802.11 radio(s) for mac80211")
 
 MODULE_LICENSE ("GPL")
 
 module_param (radios, int, 0444)
 
 MODULE_PARM_DESC (radios,"Number of simulated radios")
 
 module_param (fake_hw_scan, bool, 0444)
 
 MODULE_PARM_DESC (fake_hw_scan,"Install fake (no-op) hw-scan handler")
 
 module_param (regtest, int, 0444)
 
 MODULE_PARM_DESC (regtest,"The type of regulatory test we want to run")
 
 DEFINE_SIMPLE_ATTRIBUTE (hwsim_fops_ps, hwsim_fops_ps_read, hwsim_fops_ps_write,"%llu\n")
 
 DEFINE_SIMPLE_ATTRIBUTE (hwsim_fops_group, hwsim_fops_group_read, hwsim_fops_group_write,"%llx\n")
 
 module_init (init_mac80211_hwsim)
 
 module_exit (exit_mac80211_hwsim)
 

Variables

struct hwsim_radiotap_hdr __packed
 

Macro Definition Documentation

#define CHAN2G (   _freq)
Value:
{ \
.center_freq = (_freq), \
.hw_value = (_freq), \
.max_power = 20, \
}

Definition at line 212 of file mac80211_hwsim.c.

#define CHAN5G (   _freq)
Value:
{ \
.center_freq = (_freq), \
.hw_value = (_freq), \
.max_power = 20, \
}

Definition at line 219 of file mac80211_hwsim.c.

#define HWSIM_STA_MAGIC   0x6d537748

Definition at line 188 of file mac80211_hwsim.c.

#define HWSIM_VIF_MAGIC   0x69537748

Definition at line 164 of file mac80211_hwsim.c.

#define MAX_QUEUE   200

Definition at line 35 of file mac80211_hwsim.c.

#define WARN_QUEUE   100

Definition at line 34 of file mac80211_hwsim.c.

Enumeration Type Documentation

enum hwsim_regtest - the type of regulatory tests we offer

These are the different values you can use for the regtest module parameter. This is useful to help test world roaming and the driver regulatory_hint() call and combinations of these. If you want to do specific alpha2 regulatory domain tests simply use the userspace regulatory request as that will be respected as well without the need of this module parameter. This is designed only for testing the driver regulatory request, world roaming and all possible combinations.

: No regulatory tests are performed, this is the default value. : Used for testing the driver regulatory hint, only one driver regulatory hint will be sent as such the secondary radios are expected to follow. : Used for testing the driver regulatory request with all radios reporting the same regulatory domain. : Used for testing the drivers calling different regulatory domains requests. Expected behaviour is for an intersection to occur but each device will still use their respective regulatory requested domains. Subsequent radios will use the resulting intersection. : Used for testing the world roaming. We accomplish this by using a custom beacon-capable regulatory domain for the first radio. All other device world roam. : Used for testing the custom world regulatory domain requests. All radios will adhere to this custom world regulatory domain. : Used for testing 2 custom world regulatory domain requests. The first radio will adhere to the first custom world regulatory domain, the second one to the second custom world regulatory domain. All other devices will world roam. : Used for testing strict regulatory domain settings, only the first radio will send a regulatory domain request and use strict settings. The rest of the radios are expected to follow. : Used for testing strict regulatory domain settings. All radios will adhere to this. : Used for testing strict regulatory domain settings, combined with secondary driver regulatory domain settings. The first radio will get a strict regulatory domain setting using the first driver regulatory request and the second radio will use non-strict settings using the second driver regulatory request. All other devices should follow the intersection created between the first two. : Used for testing every possible mix. You will need at least 6 radios for a complete test. We will test in this order: 1 - driver custom world regulatory domain 2 - second custom world regulatory domain 3 - first driver regulatory domain request 4 - second driver regulatory domain request 5 - strict regulatory domain settings using the third driver regulatory domain request 6 and on - should follow the intersection of the 3rd, 4rth and 5th radio regulatory requests.

Enumerator:
HWSIM_REGTEST_DISABLED 
HWSIM_REGTEST_DRIVER_REG_FOLLOW 
HWSIM_REGTEST_DRIVER_REG_ALL 
HWSIM_REGTEST_DIFF_COUNTRY 
HWSIM_REGTEST_WORLD_ROAM 
HWSIM_REGTEST_CUSTOM_WORLD 
HWSIM_REGTEST_CUSTOM_WORLD_2 
HWSIM_REGTEST_STRICT_FOLLOW 
HWSIM_REGTEST_STRICT_ALL 
HWSIM_REGTEST_STRICT_AND_DRIVER_REG 
HWSIM_REGTEST_ALL 

Definition at line 108 of file mac80211_hwsim.c.

Function Documentation

DEFINE_SIMPLE_ATTRIBUTE ( hwsim_fops_ps  ,
hwsim_fops_ps_read  ,
hwsim_fops_ps_write  ,
"%llu\n"   
)
DEFINE_SIMPLE_ATTRIBUTE ( hwsim_fops_group  ,
hwsim_fops_group_read  ,
hwsim_fops_group_write  ,
"%llx\n"   
)
MODULE_AUTHOR ( "Jouni Malinen"  )
MODULE_DESCRIPTION ( "Software simulator of 802.11 radio(s) for mac80211"  )
module_exit ( exit_mac80211_hwsim  )
module_init ( init_mac80211_hwsim  )
MODULE_LICENSE ( "GPL"  )
module_param ( radios  ,
int  ,
0444   
)
module_param ( fake_hw_scan  ,
bool  ,
0444   
)
module_param ( regtest  ,
int  ,
0444   
)
MODULE_PARM_DESC ( radios  ,
"Number of simulated radios"   
)
MODULE_PARM_DESC ( fake_hw_scan  ,
"Install fake (no-op) hw-scan handler  
)
MODULE_PARM_DESC ( regtest  ,
"The type of regulatory test we want to run  
)

Variable Documentation