summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
Diffstat (limited to 'cesar')
-rw-r--r--cesar/bsu/aclf/aclf.h8
-rw-r--r--cesar/bsu/aclf/src/aclf.c7
-rw-r--r--cesar/bsu/src/interface.c2
-rw-r--r--cesar/mac/common/pb.h2
4 files changed, 19 insertions, 0 deletions
diff --git a/cesar/bsu/aclf/aclf.h b/cesar/bsu/aclf/aclf.h
index beb6e1146a..e6ea17693c 100644
--- a/cesar/bsu/aclf/aclf.h
+++ b/cesar/bsu/aclf/aclf.h
@@ -257,6 +257,14 @@ bsu_aclf_track_powerline (bsu_aclf_t *ctx);
void
bsu_aclf_clear_sync (bsu_aclf_t *ctx);
+/**
+ * Get the date at the one the beacon should be considered as invalid.
+ * \param ctx the module context.
+ * \return the expiration date.
+ */
+u32
+bsu_aclf_beacon_expiration_date (bsu_aclf_t *ctx);
+
END_DECLS
#endif /* bsu_aclf_aclf_h */
diff --git a/cesar/bsu/aclf/src/aclf.c b/cesar/bsu/aclf/src/aclf.c
index 6f531167cc..a43e6618c8 100644
--- a/cesar/bsu/aclf/src/aclf.c
+++ b/cesar/bsu/aclf/src/aclf.c
@@ -381,3 +381,10 @@ bsu_aclf_clear_sync (bsu_aclf_t *ctx)
for (i = 2; i < BSU_ACLF_BPSD_NB; i++)
ctx->bpsd[i] = ctx->bpsd[i - 1] + ctx->beacon_period_theo_tck;
}
+
+u32
+bsu_aclf_beacon_expiration_date (bsu_aclf_t *ctx)
+{
+ dbg_claim (ctx);
+ return ctx->bpsd[2];
+}
diff --git a/cesar/bsu/src/interface.c b/cesar/bsu/src/interface.c
index d4f0c82c5b..74ffc03b85 100644
--- a/cesar/bsu/src/interface.c
+++ b/cesar/bsu/src/interface.c
@@ -90,6 +90,8 @@ bsu_beacon_send (bsu_t *ctx, bsu_beacon_type_t beacon_type,
if (beacon_type == BSU_BEACON_TYPE_CENTRAL)
ca_mfs_hold (ctx->ca, mfs);
mfs->cfp = ctx->sta_avln->beacon.vf.hm == MAC_COEXISTENCE_AV_ONLY_MODE;
+ beacon->expiration_ntb = bsu_aclf_beacon_expiration_date (ctx->aclf)
+ + ctx->mac_config->ntb_offset_tck;
/* Provide the beacon to the SAR. */
sar_beacon_send (ctx->sar, beacon, mfs, bto_bpsto);
BSU_TRACE (BEACON_SEND, phy_date (), beacon_type);
diff --git a/cesar/mac/common/pb.h b/cesar/mac/common/pb.h
index af337ed8dc..34372db3fd 100644
--- a/cesar/mac/common/pb.h
+++ b/cesar/mac/common/pb.h
@@ -80,6 +80,8 @@ union pb_beacon_t
u8 *data;
/** First four bytes of the beacon payload. */
u32 first_data_word;
+ /** Expiration NTB date.*/
+ u32 expiration_ntb;
};
};
typedef union pb_beacon_t pb_beacon_t;