summaryrefslogtreecommitdiff
path: root/cesar/mac/ca
diff options
context:
space:
mode:
authorschodet2009-09-25 11:24:20 +0000
committerschodet2009-09-25 11:24:20 +0000
commitda198db417a823876512048001468dfc10f51d7e (patch)
treeed0510519015ace5d467abef2b3230ee3f9faf6f /cesar/mac/ca
parentf8692ea07c491e44034283faf57d3b3eea953dfe (diff)
* mac/ca:
- move function from/to local ram. - replaced asserts by claims. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5759 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/mac/ca')
-rw-r--r--cesar/mac/ca/src/access.c34
-rw-r--r--cesar/mac/ca/src/backoff.c22
2 files changed, 28 insertions, 28 deletions
diff --git a/cesar/mac/ca/src/access.c b/cesar/mac/ca/src/access.c
index ac9f4d084f..8928c6bbc9 100644
--- a/cesar/mac/ca/src/access.c
+++ b/cesar/mac/ca/src/access.c
@@ -75,7 +75,7 @@ ca_access_deactivate (ca_t *ctx)
void ARCH_ILRAM
ca_access_hold (ca_t *ctx)
{
- dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
+ dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
CA_TRACE (ACCESS_HOLD, phy_date (ctx->phy));
/* Change to HOLD state. */
ctx->state = CA_STATE_HOLD;
@@ -119,8 +119,8 @@ ca_access_prepare_alloc (ca_t *ctx, u32 start_date, ca_schedule_t **sched_p,
ca_schedule_t *sched;
uint alloc_i;
uint aifs_tck = MAC_AIFS_TCK;
- dbg_assert (ctx);
- dbg_assert (sched_p && allocation_end_date_p && glid_p);
+ dbg_claim (ctx);
+ dbg_claim (sched_p && allocation_end_date_p && glid_p);
dbg_assert (ctx->current_beacon_period != ctx->beacon_periods_tail);
/* Use current schedule one. */
bp_i = ctx->current_beacon_period;
@@ -142,7 +142,7 @@ ca_access_prepare_alloc (ca_t *ctx, u32 start_date, ca_schedule_t **sched_p,
* beacon allocation at start of next beacon period. */
ca_schedule_t *next_sched =
&ctx->schedules[ctx->beacon_periods[next_bp_i].schedule_index];
- dbg_assert (next_sched->allocations_nb > 0);
+ dbg_claim (next_sched->allocations_nb > 0);
if (next_sched->allocations[0].glid == MAC_LID_SPC_CENTRAL)
aifs_tck = MAC_B2BIFS_TCK;
}
@@ -165,7 +165,7 @@ ca_access_goto_aifs (ca_t *ctx, u32 allocation_end_date)
uint bp_i;
ca_beacon_period_t *bp;
ca_schedule_t *sched;
- dbg_assert (ctx);
+ dbg_claim (ctx);
/* Get current schedule. */
bp_i = ctx->current_beacon_period;
dbg_assert (bp_i != ctx->beacon_periods_tail);
@@ -214,7 +214,7 @@ ca_access_compute (ca_t *ctx, u32 start_date, uint length_tck,
ca_schedule_t *sched;
u32 allocation_end_date;
uint glid;
- dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
+ dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
CA_TRACE (ACCESS_VCS_RESTART, phy_date (ctx->phy), start_date, length_tck,
anticipation_tck, eifs, update, update_date);
/* Release reference to old MFS. */
@@ -559,7 +559,7 @@ void ARCH_ILRAM
ca_access_vcs_restart (ca_t *ctx, u32 start_date, uint length_tck,
uint anticipation_tck, bool eifs)
{
- dbg_assert (ctx);
+ dbg_claim (ctx);
ca_access_compute (ctx, start_date, length_tck, anticipation_tck, eifs,
false, 0);
}
@@ -567,7 +567,7 @@ ca_access_vcs_restart (ca_t *ctx, u32 start_date, uint length_tck,
void ARCH_ILRAM
ca_access_program (ca_t *ctx, u32 date, uint anticipation_tck)
{
- dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
+ dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
CA_TRACE (ACCESS_PROGRAM, phy_date (ctx->phy), date, anticipation_tck);
/* Release reference to old MFS. */
if (ctx->access_param.mfs)
@@ -600,7 +600,7 @@ ca_access_reprogram (ca_t *ctx, u32 date, uint duration_tck,
ctx->access_param.mfs = NULL;
}
-void ARCH_ILRAM
+void
ca_access_grant (ca_t *ctx, mfs_tx_t *mfs, u32 date, uint duration_tck)
{
dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
@@ -666,9 +666,9 @@ ca_access_defer (ca_t *ctx, u32 date, uint anticipation_tck)
const ca_access_alloc_param_t * ARCH_ILRAM
ca_access_aifs (ca_t *ctx)
{
- dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
+ dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
dbg_assert (ctx->current_beacon_period != ctx->beacon_periods_tail);
- dbg_assert (ctx->access_param.mfs == NULL);
+ dbg_claim (ctx->access_param.mfs == NULL);
CA_TRACE (ACCESS_AIFS, phy_date (ctx->phy));
/* Go on with the next allocation, first get current one. */
uint bp_i = ctx->current_beacon_period;
@@ -709,7 +709,7 @@ ca_access_aifs (ca_t *ctx)
const ca_access_param_t * ARCH_ILRAM
ca_access_get_param (ca_t *ctx)
{
- dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
+ dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
return &ctx->access_param;
}
@@ -733,15 +733,15 @@ static mfs_tx_t * ARCH_ILRAM
ca_access_choose_mfs_tx (ca_t *ctx, uint glid)
{
mfs_tx_t *mfs;
- dbg_assert (ctx);
- dbg_assert (glid >= MAC_GLID_MIN);
+ dbg_claim (ctx);
+ dbg_claim (glid >= MAC_GLID_MIN);
/* If GLID, this is a CFP allocation, else choose the MFS with the greater
* priority. */
if (!CA_ALLOC_IS_CSMA (glid))
{
- dbg_assert (glid <= MAC_GLID_MAX
- || glid == MAC_LID_SPC_CENTRAL
- || glid == MAC_LID_DISCOVER);
+ dbg_claim (glid <= MAC_GLID_MAX
+ || glid == MAC_LID_SPC_CENTRAL
+ || glid == MAC_LID_DISCOVER);
mfs = mac_store_mfs_get_tx (ctx->store, false, false, glid, 0);
dbg_assert (!mfs || mfs->ca_state == CA_MFS_STATE_UNKNOWN
|| mfs->ca_state == CA_MFS_STATE_CFP_QUEUED
diff --git a/cesar/mac/ca/src/backoff.c b/cesar/mac/ca/src/backoff.c
index 7e3b729408..a3b3180f31 100644
--- a/cesar/mac/ca/src/backoff.c
+++ b/cesar/mac/ca/src/backoff.c
@@ -29,15 +29,15 @@ ca_backoff_init (ca_t *ctx, u32 seed)
CA_TRACE (BACKOFF_INIT);
}
-void
+void ARCH_ILRAM
ca_backoff_new (ca_t *ctx, uint cap)
{
- static const uint dc_by_pbc[4] = { 0, 1, 3, 15 };
- static const uint cw_by_capmsb_by_pbc[2][4] = {
+ static const uint dc_by_pbc[4] ARCH_DLRAM_DATA = { 0, 1, 3, 15 };
+ static const uint cw_by_capmsb_by_pbc[2][4] ARCH_DLRAM_DATA = {
{ 7, 15, 31, 63 }, { 7, 15, 15, 31 }
};
- dbg_assert (ctx);
- dbg_assert (cap < 4);
+ dbg_claim (ctx);
+ dbg_claim (cap < 4);
if (ctx->backoff.active)
ca_backoff_cancel (ctx);
if (ctx->backoff.bpc == 0 || ctx->backoff.bc == 0 || ctx->backoff.dc == 0)
@@ -71,10 +71,10 @@ ca_backoff_new (ca_t *ctx, uint cap)
ctx->backoff.dc);
}
-void
+void ARCH_ILRAM
ca_backoff_deferred (ca_t *ctx, int slot_counter)
{
- dbg_assert (ctx);
+ dbg_claim (ctx);
if (ctx->backoff.active)
{
if (slot_counter > (int) ctx->backoff.bc)
@@ -86,19 +86,19 @@ ca_backoff_deferred (ca_t *ctx, int slot_counter)
}
}
-void
+void ARCH_ILRAM
ca_backoff_success (ca_t *ctx)
{
- dbg_assert (ctx);
+ dbg_claim (ctx);
ctx->backoff.bpc = 0;
ctx->backoff.active = false;
CA_TRACE (BACKOFF_SUCCESS);
}
-void
+void ARCH_ILRAM
ca_backoff_cancel (ca_t *ctx)
{
- dbg_assert (ctx);
+ dbg_claim (ctx);
if (ctx->backoff.active)
{
ctx->backoff.bc++;