linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Thomas Pedersen <thomas@cozybit.com>
Cc: linville@tuxdriver.org, linux-wireless@vger.kernel.org,
	jlopex@gmail.com, j@wl.fi
Subject: Re: [PATCH v2 1/3] mac80211_hwsim: use hrtimer for beacon timers
Date: Fri, 21 Dec 2012 15:33:16 +0100	[thread overview]
Message-ID: <1356100396.9580.10.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1356029871-17794-1-git-send-email-thomas@cozybit.com> (sfid-20121220_195824_731125_DAECB6B9)

On Thu, 2012-12-20 at 10:57 -0800, Thomas Pedersen wrote:

> @@ -896,7 +897,8 @@ static void mac80211_hwsim_stop(struct ieee80211_hw *hw)
>  {
>  	struct mac80211_hwsim_data *data = hw->priv;
>  	data->started = false;
> -	del_timer(&data->beacon_timer);
> +	hrtimer_cancel(&data->beacon_timer);
> +	tasklet_kill(&data->bcn_tasklet);
>  	wiphy_debug(hw->wiphy, "%s\n", __func__);

Hm this seems odd, why is it stopped here rather than when beaconing is
stopped? Or does it do both?

> @@ -1084,12 +1096,12 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
>  
>  	if (changed & BSS_CHANGED_BEACON_INT) {
>  		wiphy_debug(hw->wiphy, "  BCNINT: %d\n", info->beacon_int);
> -		data->beacon_int = 1024 * info->beacon_int / 1000 * HZ / 1000;
> -		if (WARN_ON(!data->beacon_int))
> -			data->beacon_int = 1;
> -		if (data->started)
> -			mod_timer(&data->beacon_timer,
> -				  jiffies + data->beacon_int);
> +		data->beacon_int = ns_to_ktime(info->beacon_int * 1024 * 1000);
> +		if (WARN_ON(!ktime_to_ns(data->beacon_int)))
> +			data->beacon_int = ns_to_ktime(1000 * 1000);

Can that warning really happen? It seems it should be checking
info->beacon_int rather than data->beacon_int? Why convert back and
forth?

Also the default here seems very very small, that's like less than 1ms
beacon interval (not even in TU)?

johannes


  parent reply	other threads:[~2012-12-21 14:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20 18:57 [PATCH v2 1/3] mac80211_hwsim: use hrtimer for beacon timers Thomas Pedersen
2012-12-20 18:57 ` [PATCH v2 2/3] mac80211_hwsim: beacon at beacon interval Thomas Pedersen
2012-12-21 14:36   ` Johannes Berg
2012-12-21 18:30     ` Thomas Pedersen
2012-12-20 18:57 ` [PATCH v2 3/3] mac80211_hwsim: emulate proper beaconing Thomas Pedersen
2012-12-21 14:37   ` Johannes Berg
2012-12-21 18:31     ` Thomas Pedersen
2012-12-21 14:33 ` Johannes Berg [this message]
2012-12-21 18:24   ` [PATCH v2 1/3] mac80211_hwsim: use hrtimer for beacon timers Thomas Pedersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1356100396.9580.10.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=j@wl.fi \
    --cc=jlopex@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.org \
    --cc=thomas@cozybit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).