* [PATCH] mac80211: Improved IBSS merges
@ 2010-02-04 21:46 Benoit Papillault
2010-02-05 10:32 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Benoit Papillault @ 2010-02-04 21:46 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Benoit Papillault
According to $11.1.4 from IEEE 802.11-2007, TSF is reset (drv_reset_tsf)
on MLME-JOIN, ie only when a new IBSS is created or if an existing IBSS
is joined, but not on IBSS merges.
Next, we merge even if the BSSID from the received beacon is the same as
our since merge can update more things that BSSID itself. This is
specifically true for ath9k where the merge updates TBTT timers as a
side effect and this is indeed needed if the TSF has been updated (if
TSF is updated, we need to update TBTT timers as well).
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
---
net/mac80211/ibss.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index e905c45..5f0c246 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -77,9 +77,6 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
u32 bss_change;
u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
- /* Reset own TSF to allow time synchronization work. */
- drv_reset_tsf(local);
-
skb = ifibss->skb;
rcu_assign_pointer(ifibss->presp, NULL);
synchronize_rcu();
@@ -373,10 +370,6 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
sdata->u.ibss.ssid_len))
goto put_bss;
- /* same BSSID */
- if (memcmp(cbss->bssid, sdata->u.ibss.bssid, ETH_ALEN) == 0)
- goto put_bss;
-
if (rx_status->flag & RX_FLAG_TSFT) {
/*
* For correct IBSS merging we need mactime; since mactime is
@@ -575,6 +568,8 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
else
sdata->drop_unencrypted = 0;
+ drv_reset_tsf(local);
+
__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
ifibss->channel, 3, /* first two are basic */
capability, 0);
@@ -630,6 +625,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
" based on configured SSID\n",
sdata->name, cbss->bssid);
+ drv_reset_tsf(local);
ieee80211_sta_join_ibss(sdata, bss);
ieee80211_rx_bss_put(local, bss);
return;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Improved IBSS merges
2010-02-04 21:46 [PATCH] mac80211: Improved IBSS merges Benoit Papillault
@ 2010-02-05 10:32 ` Johannes Berg
2010-02-05 14:37 ` Benoit PAPILLAULT
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2010-02-05 10:32 UTC (permalink / raw)
To: Benoit Papillault; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 957 bytes --]
On Thu, 2010-02-04 at 22:46 +0100, Benoit Papillault wrote:
> Next, we merge even if the BSSID from the received beacon is the same as
> our since merge can update more things that BSSID itself. This is
> specifically true for ath9k where the merge updates TBTT timers as a
> side effect and this is indeed needed if the TSF has been updated (if
> TSF is updated, we need to update TBTT timers as well).
> @@ -373,10 +370,6 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
> sdata->u.ibss.ssid_len))
> goto put_bss;
>
> - /* same BSSID */
> - if (memcmp(cbss->bssid, sdata->u.ibss.bssid, ETH_ALEN) == 0)
> - goto put_bss;
> -
> if (rx_status->flag & RX_FLAG_TSFT) {
> /*
> * For correct IBSS merging we need mactime; since mactime is
NACK. This will create merges and merges and merges and merges whenever
you use hardware that doesn't have accurate timestamps all the time.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Improved IBSS merges
2010-02-05 10:32 ` Johannes Berg
@ 2010-02-05 14:37 ` Benoit PAPILLAULT
2010-02-05 15:02 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Benoit PAPILLAULT @ 2010-02-05 14:37 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
Johannes Berg a écrit :
> On Thu, 2010-02-04 at 22:46 +0100, Benoit Papillault wrote:
>
>
>> Next, we merge even if the BSSID from the received beacon is the same as
>> our since merge can update more things that BSSID itself. This is
>> specifically true for ath9k where the merge updates TBTT timers as a
>> side effect and this is indeed needed if the TSF has been updated (if
>> TSF is updated, we need to update TBTT timers as well).
>>
>
>
>> @@ -373,10 +370,6 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
>> sdata->u.ibss.ssid_len))
>> goto put_bss;
>>
>> - /* same BSSID */
>> - if (memcmp(cbss->bssid, sdata->u.ibss.bssid, ETH_ALEN) == 0)
>> - goto put_bss;
>> -
>> if (rx_status->flag & RX_FLAG_TSFT) {
>> /*
>> * For correct IBSS merging we need mactime; since mactime is
>>
>
> NACK. This will create merges and merges and merges and merges whenever
> you use hardware that doesn't have accurate timestamps all the time.
>
> johannes
>
Humm... could you give an example? For hardware that don't have RX
timestamp, we will use the drv_get_tsf() function, this function will
only return a timestamp that is later than the real time at which the
beacon is received, so we can only miss IBSS merges in fact. Did I miss
something?
I can resubmit a patch with the remaining and leave this one open for
discussion.
Regards,
Benoit
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Improved IBSS merges
2010-02-05 14:37 ` Benoit PAPILLAULT
@ 2010-02-05 15:02 ` Johannes Berg
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2010-02-05 15:02 UTC (permalink / raw)
To: Benoit PAPILLAULT; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1542 bytes --]
On Fri, 2010-02-05 at 15:37 +0100, Benoit PAPILLAULT wrote:
> Johannes Berg a écrit :
> > On Thu, 2010-02-04 at 22:46 +0100, Benoit Papillault wrote:
> >
> >
> >> Next, we merge even if the BSSID from the received beacon is the same as
> >> our since merge can update more things that BSSID itself. This is
> >> specifically true for ath9k where the merge updates TBTT timers as a
> >> side effect and this is indeed needed if the TSF has been updated (if
> >> TSF is updated, we need to update TBTT timers as well).
> >>
> >
> >
> >> @@ -373,10 +370,6 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
> >> sdata->u.ibss.ssid_len))
> >> goto put_bss;
> >>
> >> - /* same BSSID */
> >> - if (memcmp(cbss->bssid, sdata->u.ibss.bssid, ETH_ALEN) == 0)
> >> - goto put_bss;
> >> -
> >> if (rx_status->flag & RX_FLAG_TSFT) {
> >> /*
> >> * For correct IBSS merging we need mactime; since mactime is
> >>
> >
> > NACK. This will create merges and merges and merges and merges whenever
> > you use hardware that doesn't have accurate timestamps all the time.
> >
> > johannes
> >
> Humm... could you give an example? For hardware that don't have RX
> timestamp, we will use the drv_get_tsf() function, this function will
> only return a timestamp that is later than the real time at which the
> beacon is received, so we can only miss IBSS merges in fact. Did I miss
> something?
There's hardware that also doesn't have get_tsf()
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-05 15:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04 21:46 [PATCH] mac80211: Improved IBSS merges Benoit Papillault
2010-02-05 10:32 ` Johannes Berg
2010-02-05 14:37 ` Benoit PAPILLAULT
2010-02-05 15:02 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox