There's no reason to think that hwsim has any
actual signal strength, but for testing it is
very useful to have it report _some_ value to
the stack so I can see if the value ends up
being reported correctly
Signed-off-by: Johannes Berg <[email protected]>
---
Anyone have any objections? I'm not sure -- but it's still useful at
least for me testing the upper layers.
drivers/net/wireless/mac80211_hwsim.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- wireless-testing.orig/drivers/net/wireless/mac80211_hwsim.c 2009-07-10 16:26:35.000000000 +0200
+++ wireless-testing/drivers/net/wireless/mac80211_hwsim.c 2009-07-10 16:27:51.000000000 +0200
@@ -406,7 +406,8 @@ static bool mac80211_hwsim_tx_frame(stru
rx_status.freq = data->channel->center_freq;
rx_status.band = data->channel->band;
rx_status.rate_idx = info->control.rates[0].idx;
- /* TODO: simulate signal strength (and optional packet drop) */
+ /* TODO: simulate real signal strength (and optional packet loss) */
+ rx_status.signal = -50;
if (data->ps != PS_DISABLED)
hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
@@ -1026,7 +1027,8 @@ static int __init init_mac80211_hwsim(vo
BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_MESH_POINT);
- hw->flags = IEEE80211_HW_MFP_CAPABLE;
+ hw->flags = IEEE80211_HW_MFP_CAPABLE |
+ IEEE80211_HW_SIGNAL_DBM;
/* ask mac80211 to reserve space for magic */
hw->vif_data_size = sizeof(struct hwsim_vif_priv);
On Fri, Jul 10, 2009 at 04:56:59PM +0200, Johannes Berg wrote:
> There's no reason to think that hwsim has any
> actual signal strength, but for testing it is
> very useful to have it report _some_ value to
> the stack so I can see if the value ends up
> being reported correctly
> Anyone have any objections? I'm not sure -- but it's still useful at
> least for me testing the upper layers.
At some point, we might even get to simulating (e.g., by a user space
app) signal strength more properly, but for now, this looks fine to me.
--
Jouni Malinen PGP id EFC895FA