aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-05-22 16:13:05 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-12 06:10:46 -0400
commit8c358bcd097fa1f63e57fb82525ba52f4a537bfa (patch)
treeac11cd1fef6682c7eabecda0254f56e4ba8e4316 /net/mac80211/mlme.c
parent30f422925c39edf61cbcf6d35140d726402d4b04 (diff)
mac80211: add time synchronisation with BSS for assoc
Some drivers (iwlegacy, iwlwifi and rt2x00) today use the bss_conf.last_tsf value. By itself though that value is completely worthless since it may be ancient. What really is needed is synchronisation between some device time and the TSF. To clarify this, rename bss_conf.last_tsf to sync_tsf and add sync_device_ts which is obtained from rx_status which gets a new field device_timestamp for this purpose. This is intentionally not using the mactime field since that is used for other things and in IBSS is expected to sync with the IBSS's TSF which isn't necessarily true for the device timestamp. Also, since we have the information and it's useful even before the connection has been established, give all the timing details to the driver before authenticating. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 4b503ce893d8..4efcbf89a72d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1269,11 +1269,6 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1269 struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf; 1269 struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
1270 1270
1271 bss_info_changed |= BSS_CHANGED_ASSOC; 1271 bss_info_changed |= BSS_CHANGED_ASSOC;
1272 /* set timing information */
1273 bss_conf->beacon_int = cbss->beacon_interval;
1274 bss_conf->last_tsf = cbss->tsf;
1275
1276 bss_info_changed |= BSS_CHANGED_BEACON_INT;
1277 bss_info_changed |= ieee80211_handle_bss_capability(sdata, 1272 bss_info_changed |= ieee80211_handle_bss_capability(sdata,
1278 bss_conf->assoc_capability, bss->has_erp_value, bss->erp_value); 1273 bss_conf->assoc_capability, bss->has_erp_value, bss->erp_value);
1279 1274
@@ -3135,9 +3130,15 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
3135 3130
3136 memcpy(ifmgd->bssid, cbss->bssid, ETH_ALEN); 3131 memcpy(ifmgd->bssid, cbss->bssid, ETH_ALEN);
3137 3132
3138 /* tell driver about BSSID and basic rates */ 3133 /* set timing information */
3134 sdata->vif.bss_conf.beacon_int = cbss->beacon_interval;
3135 sdata->vif.bss_conf.sync_tsf = cbss->tsf;
3136 sdata->vif.bss_conf.sync_device_ts = bss->device_ts;
3137
3138 /* tell driver about BSSID, basic rates and timing */
3139 ieee80211_bss_info_change_notify(sdata, 3139 ieee80211_bss_info_change_notify(sdata,
3140 BSS_CHANGED_BSSID | BSS_CHANGED_BASIC_RATES); 3140 BSS_CHANGED_BSSID | BSS_CHANGED_BASIC_RATES |
3141 BSS_CHANGED_BEACON_INT);
3141 3142
3142 if (assoc) 3143 if (assoc)
3143 sta_info_pre_move_state(sta, IEEE80211_STA_AUTH); 3144 sta_info_pre_move_state(sta, IEEE80211_STA_AUTH);