PERFORCE change 77361 for review
Sam Leffler
sam at FreeBSD.org
Mon May 23 21:23:22 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=77361
Change 77361 by sam at sam_ebb on 2005/05/23 21:22:28
track beacon tsf
Affected files ...
.. //depot/projects/vap/sys/net80211/ieee80211_input.c#16 edit
Differences ...
==== //depot/projects/vap/sys/net80211/ieee80211_input.c#16 (text+ko) ====
@@ -2275,6 +2275,9 @@
if (vap->iv_opmode == IEEE80211_M_STA &&
ni->ni_associd != 0 &&
IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_bssid)) {
+ /* record tsf of last beacon */
+ memcpy(ni->ni_tstamp.data, scan.tstamp,
+ sizeof(ni->ni_tstamp));
if (ni->ni_erp != scan.erp) {
IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni,
"erp change: was 0x%x, now 0x%x",
@@ -2372,17 +2375,19 @@
subtype, rssi, rstamp);
return;
}
- /*
- * Adhoc mode, do neighbor discovery.
- * NB: only record ibss stations
- */
- if ((scan.capinfo & IEEE80211_CAPINFO_IBSS) &&
- (ni == vap->iv_bss &&
- !IEEE80211_ADDR_EQ(ni->ni_macaddr, wh->i_addr2))) {
- /*
- * Create a new entry in the neighbor table.
- */
- ni = ieee80211_add_neighbor(vap, wh, &scan);
+ if (scan.capinfo & IEEE80211_CAPINFO_IBSS) {
+ if (!IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) {
+ /*
+ * Create a new entry in the neighbor table.
+ */
+ ni = ieee80211_add_neighbor(vap, wh, &scan);
+ } else {
+ /*
+ * Record tsf for potential resync.
+ */
+ memcpy(ni->ni_tstamp.data, scan.tstamp,
+ sizeof(ni->ni_tstamp));
+ }
if (ni != NULL) {
ni->ni_rssi = rssi;
ni->ni_rstamp = rstamp;
More information about the p4-projects
mailing list