From 11a313fe6bc52a7997baf4c0b17094c1819907df Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Tue, 19 Apr 2011 18:27:13 +0200 Subject: cesar/bsu: avoid computing twice the BTS in phy clock, closes #2450 --- cesar/bsu/aclf/aclf.h | 8 +++----- cesar/bsu/aclf/src/aclf.c | 8 ++++---- cesar/bsu/src/bsu.c | 13 +++++++------ 3 files changed, 14 insertions(+), 15 deletions(-) (limited to 'cesar/bsu') diff --git a/cesar/bsu/aclf/aclf.h b/cesar/bsu/aclf/aclf.h index 92dc58095e..b08b71194a 100644 --- a/cesar/bsu/aclf/aclf.h +++ b/cesar/bsu/aclf/aclf.h @@ -148,16 +148,14 @@ bsu_aclf_acl_frequency_detection (bsu_aclf_t *ctx); * Compute the beacon period start date from the data contained in the * beacon. * \param ctx the module context. - * \param bts_ntb the beacon time stamp in CCo's 25Mhz clock. + * \param bts_date the beacon time stamp in phy_date. * \param bto the four BTO present in the beacon. * \param bpsto the beacon period start time offset. - * \param ntb_offset_tck the NTB tick offset. */ void -bsu_aclf_compute_beacon_period_start_date (bsu_aclf_t *ctx, const u32 bts_ntb, +bsu_aclf_compute_beacon_period_start_date (bsu_aclf_t *ctx, const u32 bts_date, const s16 bto[HPAV_BEACON_BTO_NB], - const u32 bpsto, - u32 ntb_offset_tck); + const u32 bpsto); /** * Get the beacon period start time. diff --git a/cesar/bsu/aclf/src/aclf.c b/cesar/bsu/aclf/src/aclf.c index 0af61dae6a..4f0ac7463e 100644 --- a/cesar/bsu/aclf/src/aclf.c +++ b/cesar/bsu/aclf/src/aclf.c @@ -272,15 +272,15 @@ bsu_aclf_uninit (bsu_aclf_t *ctx) } void -bsu_aclf_compute_beacon_period_start_date (bsu_aclf_t *ctx, const u32 bts_ntb, +bsu_aclf_compute_beacon_period_start_date (bsu_aclf_t *ctx, const u32 bts_date, const s16 bto[HPAV_BEACON_BTO_NB], - const u32 bpsto, u32 ntb_offset_tck) + const u32 bpsto) { uint i; dbg_assert (ctx); - u32 bts_date = bts_ntb - ntb_offset_tck - bpsto; + u32 bpstart_date = bts_date - bpsto; u32 reference; - for (i = 0, reference = bts_date + ctx->beacon_period_theo_tck; + for (i = 0, reference = bpstart_date + ctx->beacon_period_theo_tck; i < BSU_ACLF_BPSD_NB - 1; i++, reference = ctx->bpsd[i] + ctx->beacon_period_theo_tck) { diff --git a/cesar/bsu/src/bsu.c b/cesar/bsu/src/bsu.c index 567fc5f126..65b07131a7 100644 --- a/cesar/bsu/src/bsu.c +++ b/cesar/bsu/src/bsu.c @@ -743,10 +743,12 @@ bsu_timer_event_process (void *ud) &ctx->sta_avln->sync, ctx->mac_config, ctx->phy); /* Compute the new BPSD with the data of the new AVLN. */ bsu_aclf_compute_beacon_period_start_date ( - ctx->aclf, ctx->sta_avln->sync.bts, ctx->sta_avln->bto, + ctx->aclf, + ctx->sta_avln->sync.bts + - ctx->sta_avln->sync.ntb_offset_tck, + ctx->sta_avln->bto, ctx->sta_avln->beacon.bmis.bpsto.present ? - ctx->sta_avln->beacon.bmis.bpsto.bpsto : 0, - ctx->sta_avln->sync.ntb_offset_tck); + ctx->sta_avln->beacon.bmis.bpsto.bpsto : 0); bsu_aclf_beacon_period_start_date ( ctx->aclf, bpsd, COUNT (bpsd)); /* Decrease countdown, the first schedule will not be @@ -943,10 +945,9 @@ bsu_beacon_process__avln_tracked (bsu_t *ctx, bsu_beacon_t *beacon, if (ctx->track_new == false && less_mod2p32 (bpsd0, bts_date)) { bsu_aclf_compute_beacon_period_start_date ( - ctx->aclf, params->bts, (s16*) params->bto, + ctx->aclf, bts_date, (s16*) params->bto, ctx->sta_avln->beacon.bmis.bpsto.present ? - ctx->sta_avln->beacon.bmis.bpsto.bpsto : 0, - ctx->sta_avln->sync.ntb_offset_tck); + ctx->sta_avln->beacon.bmis.bpsto.bpsto : 0); /* Create the CA schedules. */ bsu_ca_schedules__beacon_reception (ctx, ctx->sta_avln); } -- cgit v1.2.3