summaryrefslogtreecommitdiff
path: root/cesar/mac/pbproc/src
diff options
context:
space:
mode:
authorschodet2010-07-19 12:22:16 +0000
committerschodet2010-07-19 12:22:16 +0000
commite4e2e2fe87ca1f0f5f0859d09fbf17d6fd8bcce6 (patch)
tree00e807590b435e7c08149d32e91e863ae51b4a94 /cesar/mac/pbproc/src
parentb388e73eab9c6ed0114e7419c0db33347d2addb7 (diff)
cesar/mac/pbproc: handle beacon detection flag, refs #1763
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7298 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/mac/pbproc/src')
-rw-r--r--cesar/mac/pbproc/src/fsm_rx_data.c2
-rw-r--r--cesar/mac/pbproc/src/fsm_rx_sound.c2
-rw-r--r--cesar/mac/pbproc/src/fsm_top.c4
-rw-r--r--cesar/mac/pbproc/src/pbproc.c9
-rw-r--r--cesar/mac/pbproc/src/prep_mpdu.c6
5 files changed, 18 insertions, 5 deletions
diff --git a/cesar/mac/pbproc/src/fsm_rx_data.c b/cesar/mac/pbproc/src/fsm_rx_data.c
index b9bc368e19..0f5adfc9ff 100644
--- a/cesar/mac/pbproc/src/fsm_rx_data.c
+++ b/cesar/mac/pbproc/src/fsm_rx_data.c
@@ -539,7 +539,7 @@ pbproc_frda_send_sack (pbproc_t *ctx)
(SNID, ctx->alloc.snid),
(DTEI, ctx->recv_mpdu.sackd.tei),
(CFS, ctx->recv_mpdu.sackd.cfp),
- (BDF, false), /* TODO */
+ (BDF, ctx->detect.beacon_detected),
(SVN, 0),
(RRTF, 0),
(MFS_RSP_DATA, MFS_FSM_RSP_ACK),
diff --git a/cesar/mac/pbproc/src/fsm_rx_sound.c b/cesar/mac/pbproc/src/fsm_rx_sound.c
index 543dd1b60c..e1869e85ae 100644
--- a/cesar/mac/pbproc/src/fsm_rx_sound.c
+++ b/cesar/mac/pbproc/src/fsm_rx_sound.c
@@ -186,7 +186,7 @@ pbproc_frso__rx_sound__pbdma (pbproc_t *ctx)
PBPROC_FC_SOUND_W1,
(CFS, ctx->recv_mpdu.rx_params.cfp),
(PBSZ, false),
- (BDF, false), /* TODO */
+ (BDF, ctx->detect.beacon_detected),
(SAF, true),
(SCF, ctx->recv_mpdu.rx_params.sound_complete),
(REQ_TM, 0),
diff --git a/cesar/mac/pbproc/src/fsm_top.c b/cesar/mac/pbproc/src/fsm_top.c
index bbf08dbdac..f7077904ef 100644
--- a/cesar/mac/pbproc/src/fsm_top.c
+++ b/cesar/mac/pbproc/src/fsm_top.c
@@ -83,6 +83,10 @@ pbproc_ftop__idle__access (pbproc_t *ctx)
ctx->stats.aifs++;
/* Update detection. */
u32 now = phy_date ();
+ if (ctx->detect.beacon_detected
+ && lesseq_mod2p32 (ctx->detect.beacon_detect_expiration_date,
+ now))
+ ctx->detect.beacon_detected = false;
if (ctx->detect.hp10_detected
&& lesseq_mod2p32 (ctx->detect.hp10_detect_date
+ PBPROC_HP_DETECT_DELAY_TCK, now))
diff --git a/cesar/mac/pbproc/src/pbproc.c b/cesar/mac/pbproc/src/pbproc.c
index 609a7799fd..0fb4dc3ff5 100644
--- a/cesar/mac/pbproc/src/pbproc.c
+++ b/cesar/mac/pbproc/src/pbproc.c
@@ -211,6 +211,7 @@ pbproc_init (mac_config_t *config, mac_store_t *store)
ctx->access.mfs = NULL;
ctx->activated = false;
pbproc_prep_mpdu_init (ctx);
+ ctx->detect.beacon_detected = false;
/* Initialise precomputed times. */
pbproc_times_init (config, ctx->times_array);
ctx->symbol_tck[PHY_GIL_417] = MAC_DX417_TCK;
@@ -327,6 +328,14 @@ pbproc_activate (pbproc_t *ctx, bool flag)
}
void
+pbproc_beacon_detected (pbproc_t *ctx, u32 detect_expiration_date)
+{
+ dbg_assert_ptr (ctx);
+ ctx->detect.beacon_detected = true;
+ ctx->detect.beacon_detect_expiration_date = detect_expiration_date;
+}
+
+void
pbproc_rx_segment_refill (pbproc_t *ctx, pb_t *first, pb_t *last, uint nb)
{
dbg_assert_ptr (ctx);
diff --git a/cesar/mac/pbproc/src/prep_mpdu.c b/cesar/mac/pbproc/src/prep_mpdu.c
index a667cba3cf..86a84f8ba6 100644
--- a/cesar/mac/pbproc/src/prep_mpdu.c
+++ b/cesar/mac/pbproc/src/prep_mpdu.c
@@ -411,7 +411,7 @@ pbproc_prep_mpdu (pbproc_t *ctx)
prep->rts_fc_av.words[1] = BF_FILL (
PBPROC_FC_RTS_CTS_W1,
(CFS, access->cfp),
- (BDF, true), /* TODO */
+ (BDF, ctx->detect.beacon_detected),
(HP10DF, ctx->detect.hp10_detected),
(HP11DF, ctx->detect.hp11_detected),
(RTSF, true),
@@ -503,7 +503,7 @@ pbproc_prep_mpdu (pbproc_t *ctx)
prep->fc_av.words[1] = BF_FILL (
PBPROC_FC_SOF_W1,
(CFS, access->cfp),
- (BDF, true), /* TODO */
+ (BDF, ctx->detect.beacon_detected),
(HP10DF, ctx->detect.hp10_detected),
(HP11DF, ctx->detect.hp11_detected),
(EKS, eks),
@@ -1007,7 +1007,7 @@ pbproc_prep_mpdu_sound (pbproc_t *ctx, mfs_tx_t *mfs, uint fl_tck)
PBPROC_FC_SOUND_W1,
(CFS, ctx->access.cfp),
(PBSZ, false), /* TODO */
- (BDF, true), /* TODO */
+ (BDF, ctx->detect.beacon_detected),
(SAF, false),
(SCF, false),
(REQ_TM, TONEMAP_MAX),