* [PATCH] mac80211_hwsim: Incorporate txpower into rssi
@ 2010-10-28 9:01 Blaise Gassend
2010-11-09 21:24 ` John W. Linville
0 siblings, 1 reply; 5+ messages in thread
From: Blaise Gassend @ 2010-10-28 9:01 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Jouni Malinen
Up to now mac80211_hwsim has been reporting an rssi of -50. This patch
improves the model slightly by returning txpower-50. This makes it
easy to stimulate tests that need to see a varying rssi.
Signed-off-by: Blaise Gassend <blaise@willowgarage.com>
---
diff --git a/drivers/net/wireless/mac80211_hwsim.c
b/drivers/net/wireless/mac80211
index 7eaaa3b..3c44246 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -309,6 +309,8 @@ struct mac80211_hwsim_data {
*/
u64 group;
struct dentry *debugfs_group;
+
+ int power_level;
};
@@ -497,7 +499,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
rx_status.band = data->channel->band;
rx_status.rate_idx = info->control.rates[0].idx;
/* TODO: simulate real signal strength (and optional packet loss) */
- rx_status.signal = -50;
+ rx_status.signal = data->power_level-50;
if (data->ps != PS_DISABLED)
hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
@@ -698,6 +700,7 @@ static int mac80211_hwsim_config(struct
ieee80211_hw *hw, u32
data->idle = !!(conf->flags & IEEE80211_CONF_IDLE);
data->channel = conf->channel;
+ data->power_level = conf->power_level;
if (!data->started || !data->beacon_int)
del_timer(&data->beacon_timer);
else
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211_hwsim: Incorporate txpower into rssi
2010-10-28 9:01 [PATCH] mac80211_hwsim: Incorporate txpower into rssi Blaise Gassend
@ 2010-11-09 21:24 ` John W. Linville
2010-11-09 22:20 ` Jouni Malinen
2010-11-11 6:58 ` Blaise Gassend
0 siblings, 2 replies; 5+ messages in thread
From: John W. Linville @ 2010-11-09 21:24 UTC (permalink / raw)
To: Blaise Gassend; +Cc: linville, linux-wireless, Jouni Malinen
On Thu, Oct 28, 2010 at 02:01:24AM -0700, Blaise Gassend wrote:
> Up to now mac80211_hwsim has been reporting an rssi of -50. This patch
> improves the model slightly by returning txpower-50. This makes it
> easy to stimulate tests that need to see a varying rssi.
>
> Signed-off-by: Blaise Gassend <blaise@willowgarage.com>
This patch seems to be whitespace-damaged. Also, you should have a
space around the "-" operator.
Any comments on this patch from the mac80211_hwsim users?
> ---
> diff --git a/drivers/net/wireless/mac80211_hwsim.c
> b/drivers/net/wireless/mac80211
> index 7eaaa3b..3c44246 100644
> --- a/drivers/net/wireless/mac80211_hwsim.c
> +++ b/drivers/net/wireless/mac80211_hwsim.c
> @@ -309,6 +309,8 @@ struct mac80211_hwsim_data {
> */
> u64 group;
> struct dentry *debugfs_group;
> +
> + int power_level;
> };
>
>
> @@ -497,7 +499,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
> rx_status.band = data->channel->band;
> rx_status.rate_idx = info->control.rates[0].idx;
> /* TODO: simulate real signal strength (and optional packet loss) */
> - rx_status.signal = -50;
> + rx_status.signal = data->power_level-50;
>
> if (data->ps != PS_DISABLED)
> hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
> @@ -698,6 +700,7 @@ static int mac80211_hwsim_config(struct
> ieee80211_hw *hw, u32
> data->idle = !!(conf->flags & IEEE80211_CONF_IDLE);
>
> data->channel = conf->channel;
> + data->power_level = conf->power_level;
> if (!data->started || !data->beacon_int)
> del_timer(&data->beacon_timer);
> else
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211_hwsim: Incorporate txpower into rssi
2010-11-09 21:24 ` John W. Linville
@ 2010-11-09 22:20 ` Jouni Malinen
2010-11-11 6:58 ` Blaise Gassend
1 sibling, 0 replies; 5+ messages in thread
From: Jouni Malinen @ 2010-11-09 22:20 UTC (permalink / raw)
To: John W. Linville; +Cc: Blaise Gassend, linville, linux-wireless
On Tue, Nov 09, 2010 at 04:24:22PM -0500, John W. Linville wrote:
> On Thu, Oct 28, 2010 at 02:01:24AM -0700, Blaise Gassend wrote:
> > Up to now mac80211_hwsim has been reporting an rssi of -50. This patch
> > improves the model slightly by returning txpower-50. This makes it
> > easy to stimulate tests that need to see a varying rssi.
> Any comments on this patch from the mac80211_hwsim users?
I'm not really using the RSSI value in my tests with hwsim at the moment
and would eventually prefer to see more complete options for simulating
changing RSSI. Anyway, the proposed change does not seem to any harm and
it can potentially help in getting somewhat different information for
simulations, so I'm fine with it.
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211_hwsim: Incorporate txpower into rssi
2010-11-09 21:24 ` John W. Linville
2010-11-09 22:20 ` Jouni Malinen
@ 2010-11-11 6:58 ` Blaise Gassend
2010-11-11 14:12 ` John W. Linville
1 sibling, 1 reply; 5+ messages in thread
From: Blaise Gassend @ 2010-11-11 6:58 UTC (permalink / raw)
To: John W. Linville; +Cc: linville, linux-wireless, Jouni Malinen
> This patch seems to be whitespace-damaged. Also, you should have a
> space around the "-" operator.
Do you need me to recreate the patch?
> Any comments on this patch from the mac80211_hwsim users?
To reply to Jouni's comments, I agree that a more complete model of
RSSI would be nice, but I think that whatever more complete model
emerges will have txpower as an additive term when determining rssi.
So this is a step in the right direction. I'm using this to test an
RSSI-based roaming code, so this little addition serves my purposes
great for now.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211_hwsim: Incorporate txpower into rssi
2010-11-11 6:58 ` Blaise Gassend
@ 2010-11-11 14:12 ` John W. Linville
0 siblings, 0 replies; 5+ messages in thread
From: John W. Linville @ 2010-11-11 14:12 UTC (permalink / raw)
To: Blaise Gassend; +Cc: linville, linux-wireless, Jouni Malinen
On Wed, Nov 10, 2010 at 10:58:37PM -0800, Blaise Gassend wrote:
> > This patch seems to be whitespace-damaged. Also, you should have a
> > space around the "-" operator.
>
> Do you need me to recreate the patch?
>
> > Any comments on this patch from the mac80211_hwsim users?
>
> To reply to Jouni's comments, I agree that a more complete model of
> RSSI would be nice, but I think that whatever more complete model
> emerges will have txpower as an additive term when determining rssi.
> So this is a step in the right direction. I'm using this to test an
> RSSI-based roaming code, so this little addition serves my purposes
> great for now.
I merged the patch yesterday.
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-11-11 14:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-28 9:01 [PATCH] mac80211_hwsim: Incorporate txpower into rssi Blaise Gassend
2010-11-09 21:24 ` John W. Linville
2010-11-09 22:20 ` Jouni Malinen
2010-11-11 6:58 ` Blaise Gassend
2010-11-11 14:12 ` John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).