Skip to contentSkip to conversation

mac80211: Give it some time to do the TSF sync

PATCH Superseded Alina Friedrichsen 2 participants 5 messages Feb 21, 2009 – Feb 25, 2009 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 mac80211: Give it some time to do the TSF sync

Give slow hardware some time to do the TSF sync, to not run into an IBS= S merging endless loop in some rarely situations.

Version 2 adds a comment.

Version 3: I had forgotten to change the bracket.

net/mac80211/ibss.c +0 -0
index 1bbfc70..ea737bf 100644
@@ -332,6 +332,10 @@ static void ieee80211_rx_bss_info(struct ieee80211=

_sub_if_data *sdata,
jiffies);
#endif
=20
+ /* give slow hardware some time to do the TSF sync */
+ if (rx_timestamp < 0x400000)
+ goto put_bss;
+
if (beacon_timestamp > rx_timestamp) {
#ifdef CONFIG_MAC80211_IBSS_DEBUG
printk(KERN_DEBUG "%s: beacon TSF higher than "

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger01
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#1 lore raw
Quoted 12 lines · Alina Friedrichsen

Give slow hardware some time to do the TSF sync, to not run into an IBSS merging endless loop in some rarely situations.

Version 2 adds a comment.

Version 3: I had forgotten to change the bracket.

net/mac80211/ibss.c +0 -0
index 1bbfc70..ea737bf 100644

net/mac80211/ibss.c static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, · line 337

Quoted 6 lines
net/mac80211/ibss.c +3 -0
@@ -332,6 +332,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
 	       jiffies);
 #endif
 
+	/* give slow hardware some time to do the TSF sync */
+	if (rx_timestamp < 0x400000)
+		goto put_bss;

Please elaborate on what this does. This uses the assumption that reset_tsf() makes it start at 0, and that then the hardware won't sync up until N seconds etc. I'd like that to be spelt out here, rather than having to think about this when reading the comment.

johannes

#2 lore raw

Hello Johannes!

Quoted 2 lines

Please elaborate on what this does. This uses the assumption that reset_tsf() makes it start at 0, and that then the hardware won't syn=

c

Quoted 1 line

up until N seconds etc.

The ath5k and ath9k drivers do so. If a driver/hardware don't, it cause= s other problems. For example ("iwconfig wlan0 essid new_ibss") if the = sync isn't done before the first beacon is send and the TSF of the old = IBSS-Network was higher the the TSF of the new one, so the all nodes of=
the new network now sync to the higher TSF of the old network.

Regards
Alina

--=20
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL f=FCr nur 17,95 =BF/mtl.!* http://dsl.gmx.de/?ac=3DOM.AD.PD003K11308T45=
69a
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

P.S.: You can test it with:

root@starbuck:~# echo reset > /sys/kernel/debug/ieee80211/phy0/tsf; cat=
 /sys/kernel/debug/ieee80211/phy0/tsf=20
0x0000000000000ca0
root@starbuck:~#=20

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger01
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#4 lore raw
In reply to Alina Friedrichsen
Quoted 6 lines · Alina Friedrichsen

Hello Johannes!

Quoted 3 lines

Please elaborate on what this does. This uses the assumption that reset_tsf() makes it start at 0, and that then the hardware won't sync up until N seconds etc.

Quoted 6 lines

The ath5k and ath9k drivers do so. If a driver/hardware don't, it causes other problems. For example ("iwconfig wlan0 essid new_ibss") if the sync isn't done before the first beacon is send and the TSF of the old IBSS-Network was higher the the TSF of the new one, so the all nodes of the new network now sync to the higher TSF of the old network.

Right. I just want to see an explanation in the code.

johannes