aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index dfff02f5c86d..9fd2beadb6f5 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(
830 return 0; 830 return 0;
831} 831}
832 832
833static int mac80211_hwsim_get_survey(
834 struct ieee80211_hw *hw, int idx,
835 struct survey_info *survey)
836{
837 struct ieee80211_conf *conf = &hw->conf;
838
839 printk(KERN_DEBUG "%s:%s (idx=%d)\n",
840 wiphy_name(hw->wiphy), __func__, idx);
841
842 if (idx != 0)
843 return -ENOENT;
844
845 /* Current channel */
846 survey->channel = conf->channel;
847
848 /*
849 * Magically conjured noise level --- this is only ok for simulated hardware.
850 *
851 * A real driver which cannot determine the real channel noise MUST NOT
852 * report any noise, especially not a magically conjured one :-)
853 */
854 survey->filled = SURVEY_INFO_NOISE_DBM;
855 survey->noise = -92;
856
857 return 0;
858}
859
833#ifdef CONFIG_NL80211_TESTMODE 860#ifdef CONFIG_NL80211_TESTMODE
834/* 861/*
835 * This section contains example code for using netlink 862 * This section contains example code for using netlink
@@ -947,6 +974,7 @@ static void hw_scan_done(struct work_struct *work)
947} 974}
948 975
949static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw, 976static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw,
977 struct ieee80211_vif *vif,
950 struct cfg80211_scan_request *req) 978 struct cfg80211_scan_request *req)
951{ 979{
952 struct hw_scan_done *hsd = kzalloc(sizeof(*hsd), GFP_KERNEL); 980 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)
993 mutex_lock(&hwsim->mutex); 1021 mutex_lock(&hwsim->mutex);
994 1022
995 printk(KERN_DEBUG "hwsim sw_scan_complete\n"); 1023 printk(KERN_DEBUG "hwsim sw_scan_complete\n");
996 hwsim->scanning = true; 1024 hwsim->scanning = false;
997 1025
998 mutex_unlock(&hwsim->mutex); 1026 mutex_unlock(&hwsim->mutex);
999} 1027}
@@ -1013,6 +1041,7 @@ static struct ieee80211_ops mac80211_hwsim_ops =
1013 .sta_notify = mac80211_hwsim_sta_notify, 1041 .sta_notify = mac80211_hwsim_sta_notify,
1014 .set_tim = mac80211_hwsim_set_tim, 1042 .set_tim = mac80211_hwsim_set_tim,
1015 .conf_tx = mac80211_hwsim_conf_tx, 1043 .conf_tx = mac80211_hwsim_conf_tx,
1044 .get_survey = mac80211_hwsim_get_survey,
1016 CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd) 1045 CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd)
1017 .ampdu_action = mac80211_hwsim_ampdu_action, 1046 .ampdu_action = mac80211_hwsim_ampdu_action,
1018 .sw_scan_start = mac80211_hwsim_sw_scan, 1047 .sw_scan_start = mac80211_hwsim_sw_scan,
@@ -1271,7 +1300,8 @@ static int __init init_mac80211_hwsim(void)
1271 hw->flags = IEEE80211_HW_MFP_CAPABLE | 1300 hw->flags = IEEE80211_HW_MFP_CAPABLE |
1272 IEEE80211_HW_SIGNAL_DBM | 1301 IEEE80211_HW_SIGNAL_DBM |
1273 IEEE80211_HW_SUPPORTS_STATIC_SMPS | 1302 IEEE80211_HW_SUPPORTS_STATIC_SMPS |
1274 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS; 1303 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
1304 IEEE80211_HW_AMPDU_AGGREGATION;
1275 1305
1276 /* ask mac80211 to reserve space for magic */ 1306 /* ask mac80211 to reserve space for magic */
1277 hw->vif_data_size = sizeof(struct hwsim_vif_priv); 1307 hw->vif_data_size = sizeof(struct hwsim_vif_priv);