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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 7eaaa3bab547..454f045ddff3 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -309,6 +309,8 @@ struct mac80211_hwsim_data {
309 */ 309 */
310 u64 group; 310 u64 group;
311 struct dentry *debugfs_group; 311 struct dentry *debugfs_group;
312
313 int power_level;
312}; 314};
313 315
314 316
@@ -497,7 +499,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
497 rx_status.band = data->channel->band; 499 rx_status.band = data->channel->band;
498 rx_status.rate_idx = info->control.rates[0].idx; 500 rx_status.rate_idx = info->control.rates[0].idx;
499 /* TODO: simulate real signal strength (and optional packet loss) */ 501 /* TODO: simulate real signal strength (and optional packet loss) */
500 rx_status.signal = -50; 502 rx_status.signal = data->power_level - 50;
501 503
502 if (data->ps != PS_DISABLED) 504 if (data->ps != PS_DISABLED)
503 hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM); 505 hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
@@ -698,6 +700,7 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
698 data->idle = !!(conf->flags & IEEE80211_CONF_IDLE); 700 data->idle = !!(conf->flags & IEEE80211_CONF_IDLE);
699 701
700 data->channel = conf->channel; 702 data->channel = conf->channel;
703 data->power_level = conf->power_level;
701 if (!data->started || !data->beacon_int) 704 if (!data->started || !data->beacon_int)
702 del_timer(&data->beacon_timer); 705 del_timer(&data->beacon_timer);
703 else 706 else