summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorschodet2010-04-15 13:43:51 +0000
committerschodet2010-04-15 13:43:51 +0000
commit00119b3d1a01be964fbdc190799b3a6796e450ed (patch)
treef503858a55b7f0a3bea880d8718def74652532a1 /cesar
parentbe4633c15a0c7f9d1a497a49ffb88405c8097300 (diff)
cesar/mac/ca: allow date in the past for AIFS after an RX FC
When a FC is received just before an AIFS, the ACCESS timer is canceled. When it is reprogrammed, the date may be in the past because we need an AIFS as soon as possible. Add a test for this case so that Maximus do not byte us. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6925 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/mac/ca/src/access.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cesar/mac/ca/src/access.c b/cesar/mac/ca/src/access.c
index fe234c8736..07c22b6a4d 100644
--- a/cesar/mac/ca/src/access.c
+++ b/cesar/mac/ca/src/access.c
@@ -264,6 +264,16 @@ ca_access_compute (ca_t *ctx, u32 start_date, uint length_tck,
/* Hold a reference to choosen MFS. */
if (ctx->access_param.mfs)
blk_addref (ctx->access_param.mfs);
+#if MODULE_INCLUDED (hal_phy_maximus)
+ /* Maximus is more strict than hardware. When a FC is received right
+ * before AIFS, an ACCESS may be requested in the past. */
+ u32 now = phy_date (ctx->phy);
+ if (lesseq_mod2p32 (ctx->access_param.access_date - anticipation_tck, now)
+ && lesseq_mod2p32 (now - MAC_US_TO_TCK (200),
+ ctx->access_param.access_date - anticipation_tck)
+ && !ctx->access_param.mfs)
+ ctx->access_param.access_date = now + anticipation_tck;
+#endif
/* Setup ACCESS for this allocation. */
if (update)
phy_access_timer_update (ctx->phy, ctx->access_param.access_date