aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-05 10:54:31 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-11 12:44:59 -0500
commit8cef2c9df88fdd13f518e6607de9d664b31f26cc (patch)
treef8a4d29db6012ad3468a5d9435562fc1f383209a /net/mac80211/ibss.c
parent83c7aa1a1475ae1c42640ab6e4559016142efc67 (diff)
cfg80211: move TSF into IEs
While technically the TSF isn't an IE, it can be necessary to distinguish between the TSF from a beacon and a probe response, in particular in order to know the next DTIM TBTT, as not all APs are spec compliant wrt. TSF==0 being a DTIM TBTT and thus the DTIM count needs to be taken into account as well. To allow this, move the TSF into the IE struct so it can be known whence it came. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r--net/mac80211/ibss.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 71c55cc0f7b6..055fa9436e95 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -242,6 +242,8 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
242 u32 basic_rates; 242 u32 basic_rates;
243 int i, j; 243 int i, j;
244 u16 beacon_int = cbss->beacon_interval; 244 u16 beacon_int = cbss->beacon_interval;
245 const struct cfg80211_bss_ies *ies;
246 u64 tsf;
245 247
246 lockdep_assert_held(&sdata->u.ibss.mtx); 248 lockdep_assert_held(&sdata->u.ibss.mtx);
247 249
@@ -265,13 +267,17 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
265 } 267 }
266 } 268 }
267 269
270 rcu_read_lock();
271 ies = rcu_dereference(cbss->ies);
272 tsf = ies->tsf;
273 rcu_read_unlock();
274
268 __ieee80211_sta_join_ibss(sdata, cbss->bssid, 275 __ieee80211_sta_join_ibss(sdata, cbss->bssid,
269 beacon_int, 276 beacon_int,
270 cbss->channel, 277 cbss->channel,
271 basic_rates, 278 basic_rates,
272 cbss->capability, 279 cbss->capability,
273 cbss->tsf, 280 tsf, false);
274 false);
275} 281}
276 282
277static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta, 283static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta,
@@ -535,8 +541,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
535 541
536 cbss = container_of((void *)bss, struct cfg80211_bss, priv); 542 cbss = container_of((void *)bss, struct cfg80211_bss, priv);
537 543
538 /* was just updated in ieee80211_bss_info_update */ 544 /* same for beacon and probe response */
539 beacon_timestamp = cbss->tsf; 545 beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp);
540 546
541 /* check if we need to merge IBSS */ 547 /* check if we need to merge IBSS */
542 548