summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
Diffstat (limited to 'cesar')
-rw-r--r--cesar/bsu/src/bsu.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/cesar/bsu/src/bsu.c b/cesar/bsu/src/bsu.c
index 78d8d3262a..dc7623433e 100644
--- a/cesar/bsu/src/bsu.c
+++ b/cesar/bsu/src/bsu.c
@@ -35,6 +35,22 @@
static bsu_t bsu_global;
/**
+ * Remove the MFS beacon.
+ * \param ctx the module context.
+ * \param index the MFS index.
+ */
+static inline void
+bsu_mfs_remove (bsu_t *ctx, uint index)
+{
+ ca_mfs_remove (ctx->ca, ctx->mfs_beacons[index]);
+ pbproc_mfs_remove_all (ctx->mfs_beacons[index]);
+ mac_store_mfs_remove (ctx->mac_store,
+ PARENT_OF (mfs_t, tx, ctx->mfs_beacons[index]));
+ blk_release (ctx->mfs_beacons[index]);
+ ctx->mfs_beacons[index] = NULL;
+}
+
+/**
* Reprogram bsu timer.
* \param ctx the module context.
* \param date the date to wake up.
@@ -446,11 +462,7 @@ bsu_uninit (bsu_t *ctx)
for (i = 0; i < COUNT (ctx->mfs_beacons); i++)
{
if (ctx->mfs_beacons[i])
- {
- mac_store_mfs_remove (ctx->mac_store,
- PARENT_OF (mfs_t, tx, ctx->mfs_beacons[i]));
- blk_release (ctx->mfs_beacons[i]);
- }
+ bsu_mfs_remove (ctx, i);
}
bsu_trace_uninit (ctx);
}
@@ -667,12 +679,7 @@ bsu_track_avln (u64 nid, u16 snid, u8 tei, mac_coexistence_mode_t hm)
for (i = 0; i < COUNT (ctx->mfs_beacons); i++)
{
if (ctx->mfs_beacons[i])
- {
- ca_mfs_remove (ctx->ca, ctx->mfs_beacons[i]);
- pbproc_mfs_remove_all (ctx->mfs_beacons[i]);
- blk_release (ctx->mfs_beacons[i]);
- ctx->mfs_beacons[i] = NULL;
- }
+ bsu_mfs_remove (ctx, i);
}
arch_dsr_unlock ();
}