diff options
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
| -rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 34 | 
1 files changed, 32 insertions, 2 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index dfff02f5c86..9fd2beadb6f 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -830,6 +830,33 @@ static int mac80211_hwsim_conf_tx(  	return 0;  } +static int mac80211_hwsim_get_survey( +	struct ieee80211_hw *hw, int idx, +	struct survey_info *survey) +{ +	struct ieee80211_conf *conf = &hw->conf; + +	printk(KERN_DEBUG "%s:%s (idx=%d)\n", +	       wiphy_name(hw->wiphy), __func__, idx); + +	if (idx != 0) +		return -ENOENT; + +	/* Current channel */ +	survey->channel = conf->channel; + +	/* +	 * Magically conjured noise level --- this is only ok for simulated hardware. +	 * +	 * A real driver which cannot determine the real channel noise MUST NOT +	 * report any noise, especially not a magically conjured one :-) +	 */ +	survey->filled = SURVEY_INFO_NOISE_DBM; +	survey->noise = -92; + +	return 0; +} +  #ifdef CONFIG_NL80211_TESTMODE  /*   * This section contains example code for using netlink @@ -947,6 +974,7 @@ static void hw_scan_done(struct work_struct *work)  }  static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw, +				  struct ieee80211_vif *vif,  				  struct cfg80211_scan_request *req)  {  	struct hw_scan_done *hsd = kzalloc(sizeof(*hsd), GFP_KERNEL); @@ -993,7 +1021,7 @@ static void mac80211_hwsim_sw_scan_complete(struct ieee80211_hw *hw)  	mutex_lock(&hwsim->mutex);  	printk(KERN_DEBUG "hwsim sw_scan_complete\n"); -	hwsim->scanning = true; +	hwsim->scanning = false;  	mutex_unlock(&hwsim->mutex);  } @@ -1013,6 +1041,7 @@ static struct ieee80211_ops mac80211_hwsim_ops =  	.sta_notify = mac80211_hwsim_sta_notify,  	.set_tim = mac80211_hwsim_set_tim,  	.conf_tx = mac80211_hwsim_conf_tx, +	.get_survey = mac80211_hwsim_get_survey,  	CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd)  	.ampdu_action = mac80211_hwsim_ampdu_action,  	.sw_scan_start = mac80211_hwsim_sw_scan, @@ -1271,7 +1300,8 @@ static int __init init_mac80211_hwsim(void)  		hw->flags = IEEE80211_HW_MFP_CAPABLE |  			    IEEE80211_HW_SIGNAL_DBM |  			    IEEE80211_HW_SUPPORTS_STATIC_SMPS | -			    IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS; +			    IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | +			    IEEE80211_HW_AMPDU_AGGREGATION;  		/* ask mac80211 to reserve space for magic */  		hw->vif_data_size = sizeof(struct hwsim_vif_priv);  |