aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlexander Bondar <alexander.bondar@intel.com>2015-03-01 02:10:00 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-03-03 09:56:06 -0500
commit2ecc3905e6c51f545a44cc621216b5dfd7f94c50 (patch)
tree6df50f49ffd720d3335e48d30d413deacf17c739 /net
parent5fc7432991a86678b38a2d700edbe8bcd29cc579 (diff)
mac80211: Update beacon's timing and DTIM count on every beacon
Beacon's timestamp, device system time associated with this beacon and DTIM count parameters are not updated in the associated vif context if the latest beacon's content is identical to the previously received. It make sense to update these changing parameters on every beacon so the driver can get most updated values. This may be necessary, for example, to avoid either beacons' drift effect or device time stamp overrun. IMPORTANT: Three sync_* parameters - sync_ts, sync_device_ts and sync_dtim_count would possibly be out of sync by the time the driver will use them. The synchronized view is currently guaranteed only in certain callbacks. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 10ac6324c1d0..cf3ae9348a9d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3419,6 +3419,26 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
3419 if (ifmgd->csa_waiting_bcn) 3419 if (ifmgd->csa_waiting_bcn)
3420 ieee80211_chswitch_post_beacon(sdata); 3420 ieee80211_chswitch_post_beacon(sdata);
3421 3421
3422 /*
3423 * Update beacon timing and dtim count on every beacon appearance. This
3424 * will allow the driver to use the most updated values. Do it before
3425 * comparing this one with last received beacon.
3426 * IMPORTANT: These parameters would possibly be out of sync by the time
3427 * the driver will use them. The synchronized view is currently
3428 * guaranteed only in certain callbacks.
3429 */
3430 if (local->hw.flags & IEEE80211_HW_TIMING_BEACON_ONLY) {
3431 sdata->vif.bss_conf.sync_tsf =
3432 le64_to_cpu(mgmt->u.beacon.timestamp);
3433 sdata->vif.bss_conf.sync_device_ts =
3434 rx_status->device_timestamp;
3435 if (elems.tim)
3436 sdata->vif.bss_conf.sync_dtim_count =
3437 elems.tim->dtim_count;
3438 else
3439 sdata->vif.bss_conf.sync_dtim_count = 0;
3440 }
3441
3422 if (ncrc == ifmgd->beacon_crc && ifmgd->beacon_crc_valid) 3442 if (ncrc == ifmgd->beacon_crc && ifmgd->beacon_crc_valid)
3423 return; 3443 return;
3424 ifmgd->beacon_crc = ncrc; 3444 ifmgd->beacon_crc = ncrc;
@@ -3446,18 +3466,6 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
3446 else 3466 else
3447 bss_conf->dtim_period = 1; 3467 bss_conf->dtim_period = 1;
3448 3468
3449 if (local->hw.flags & IEEE80211_HW_TIMING_BEACON_ONLY) {
3450 sdata->vif.bss_conf.sync_tsf =
3451 le64_to_cpu(mgmt->u.beacon.timestamp);
3452 sdata->vif.bss_conf.sync_device_ts =
3453 rx_status->device_timestamp;
3454 if (elems.tim)
3455 sdata->vif.bss_conf.sync_dtim_count =
3456 elems.tim->dtim_count;
3457 else
3458 sdata->vif.bss_conf.sync_dtim_count = 0;
3459 }
3460
3461 changed |= BSS_CHANGED_BEACON_INFO; 3469 changed |= BSS_CHANGED_BEACON_INFO;
3462 ifmgd->have_beacon = true; 3470 ifmgd->have_beacon = true;
3463 3471