linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bruno randolf <bruno@thinktube.com>
To: ath5k-devel@lists.ath5k.org
Cc: "Luis R. Rodriguez" <mcgrof@gmail.com>,
	"Ivo van Doorn" <ivdoorn@gmail.com>,
	jirislaby@gmail.com, Michael Wu <flamingice@sourmilk.net>,
	linux-wireless@vger.kernel.org, linville@tuxdriver.com,
	Daniel Drake <dsd@gentoo.org>,
	Ulrich Kunitz <kune@deine-taler.de>,
	Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [ath5k-devel] [PATCH] mac80211: enable IBSS merging
Date: Wed, 23 Jan 2008 10:59:47 +0900	[thread overview]
Message-ID: <200801231059.48090.bruno@thinktube.com> (raw)
In-Reply-To: <43e72e890801221232hee414a3ie28d060e823bf28b@mail.gmail.com>

On Wednesday 23 January 2008 05:32:05 Luis R. Rodriguez wrote:
> On Jan 22, 2008 2:54 PM, Ivo van Doorn <ivdoorn@gmail.com> wrote:
> > Hi,
> >
> > > > > > Then there is a problem for rt2x00. Since the mactime isn't
> > > > > > known. rt2400pci is the _only_ device which has a RX_END_TIME
> > > > > > field in the RX descriptor.
> > > > >
> > > > > one workaround could be to simply use the current TSF at the time
> > > > > in the tasklet or interrupt handler (to be more close to the actual
> > > > > rx time). this should be sufficient to catch most cases where an
> > > > > IBSS merge is necessary - usually the beacon's TSF will be much
> > > > > higher than the local TSF.
> > > >
> > > > Should the driver to this, or should mac80211 handle that?
> > >
> > > The driver should if it has access to some the mactime of the received
> > > packet otherwise yes -- I think mac80211 can handle this using the
> > > supplied get_tsf().
> > >
> > > > Personally I think it is something for the mac80211 layer since the
> > > > driver will give what it can, and can be sure that it is what
> > > > mac80211 expects instead of drivers interpreting what mac80211 might
> > > > want as replacement. If mac80211 needs the TSF value when no mac time
> > > > is given, it could just use the get_tsf() callback function to the
> > > > driver to get the substitute. When the get_tsf() callback is not
> > > > provided, then mac80211 can complain about missing information.

well we can do that, but the closer you record the TSF of a packet after 
reception, the better. this is why i suggested the interrupt handler or the 
drivers rx tasklet. i don't know enough about when mac80211 rx handlers will 
run, but it seems they could be delayed quite a bit (work queue?).
especially for IBSS merges we need to basically compare the TSF of the beaon 
and the local TSF on a usec level. for most cases i guess getting the TSF in 
ieee80211_rx_bss_info() should be sufficient, but it will not merge 100% 
correctly if the time difference between IBSS nodes is small.

> I still think we should inform the user if the user switches to IBSS
> at some point, perhaps better during interface addition if their
> driver's IBSS mode is going to have some issues. How about we add to
> the enum ieee80211_hw_flags a "IEEE80211_HW_RX_MACTIME". Then we can
> warn accordingly during ieee80211_if_add() if the interface type is
> IBSS"
>
> * If driver supports IEEE80211_HW_RX_MACTIME we don't warn anything
> * If IEEE80211_HW_RX_MACTIME is not supported and get_tsf() is
> implemented inform user IBSS merge may not behave accurately
> * If IEEE80211_HW_RX_MACTIME is not supported and get_tsf() is not
> implemented warn IBSS merge will not work

jep, i think that would be best. can we add that in a separate patch?

> We could add:
>
> static inline u64 __approx_mactime(struct ieee80211_local *local) {
>    BUG_ON(!local || !local->ops);
>    return (local->ops->get_tsf) ?
> local->ops->get_tsf(local_to_hw(local)) : -1LLU;
> }
>
> Then in ieee80211_rx_bss_info() we can do something like:
>
> +               if (local->hw.flags & IEEE80211_HW_RX_MACTIME) {
> +                   if (rx_status->flag & RX_FLAG_TSFT)
> +                       mactime = rx_status->mactime;
> +                   else {
> +                     WARN_ON(1);
> +                     mactime = __approx_mactime(local);
> +                  }
> +              else {
> +                     mactime = __approx_mactime(local);
> +         }

i'd prefer to do it without the inline just all in the function. like this:

+               if (rx_status->flag & RX_FLAG_TSFT)
+                       /* in order for correct IBSS merging we need mactime*/
+                       mactime = rx_status->mactime;
+               else if (local && local->ops && local->ops->get_tsf)
+                       /* second best option: get current TSF */
+                       mactime = local->ops->get_tsf(local_to_hw(local));
+               else
+                       /* can't merge without knowing the TSF */
+                       mactime = -1LLU;

comments? should i resend my patch?

bruno

  parent reply	other threads:[~2008-01-23  2:00 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-18 12:52 [PATCH] mac80211: enable IBSS merging Bruno Randolf
2008-01-20 10:17 ` Luis R. Rodriguez
2008-01-20 10:43   ` Ivo van Doorn
2008-01-21  1:52     ` bruno randolf
2008-01-21 16:05       ` Ivo van Doorn
2008-01-22 19:47         ` Luis R. Rodriguez
2008-01-22 19:54           ` Ivo van Doorn
2008-01-22 20:32             ` Luis R. Rodriguez
2008-01-22 20:51               ` Ivo van Doorn
2008-01-23  1:59               ` bruno randolf [this message]
2008-01-22 23:16             ` Adam Baker
2008-01-22 23:25               ` Ivo van Doorn
2008-01-23 14:49     ` Johannes Berg
2008-01-24  5:51       ` bruno randolf
2008-01-21  1:57   ` bruno randolf
2008-01-23 14:48 ` Johannes Berg
2008-01-23 17:22   ` Dan Williams
2008-01-24  3:49     ` bruno randolf
2008-01-24  3:26   ` bruno randolf
2008-01-24 16:55     ` Johannes Berg
2008-01-25  8:01       ` bruno randolf
2008-02-02 23:22         ` Luis R. Rodriguez
2008-02-05  1:50           ` bruno randolf
2008-02-05  1:56             ` Luis R. Rodriguez
2008-02-06 10:01             ` Johannes Berg
2008-02-06  4:34           ` Jouni Malinen
2008-02-06 18:33             ` Luis R. Rodriguez
2008-02-06 20:10               ` John W. Linville
2008-02-07  3:58                 ` Jouni Malinen
2008-02-08  9:22                   ` Luis R. Rodriguez
2008-02-12  2:00                     ` bruno randolf
2008-02-15  1:06                       ` Luis R. Rodriguez
2008-02-15  1:40                         ` bruno randolf
2008-02-07  3:52               ` Jouni Malinen
2008-02-08  9:10                 ` Luis R. Rodriguez
2008-01-24  5:43   ` bruno randolf
2008-01-24  8:51     ` Kalle Valo
2008-01-24 14:27       ` Johannes Berg
2008-01-24 14:30     ` Johannes Berg
2008-01-25  6:16       ` bruno randolf

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=200801231059.48090.bruno@thinktube.com \
    --to=bruno@thinktube.com \
    --cc=ath5k-devel@lists.ath5k.org \
    --cc=dsd@gentoo.org \
    --cc=flamingice@sourmilk.net \
    --cc=ivdoorn@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=kune@deine-taler.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@gmail.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).