summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorlaranjeiro2009-04-23 15:37:13 +0000
committerlaranjeiro2009-04-23 15:37:13 +0000
commit637c331f51c4b6cd244e50f94283252be63b7dd4 (patch)
tree2b13504325ac4b2f18039b69c5ffbff22771c251 /cesar
parent0a9f0390ec29a151c9f39a14457d9da1caa689d0 (diff)
cp/beacon: Added more trace to have the timer programed date.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4512 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/cp/beacon/inc/trace.h3
-rw-r--r--cesar/cp/beacon/src/beacon.c25
-rw-r--r--cesar/cp/beacon/src/trace.c11
3 files changed, 29 insertions, 10 deletions
diff --git a/cesar/cp/beacon/inc/trace.h b/cesar/cp/beacon/inc/trace.h
index bd272fce27..d2bd1a2ad6 100644
--- a/cesar/cp/beacon/inc/trace.h
+++ b/cesar/cp/beacon/inc/trace.h
@@ -28,7 +28,8 @@ enum
CP_BEACON_TRACE_BEACON_RECV,
CP_BEACON_TRACE_BEACON_SEND,
CP_BEACON_TRACE_SCHEDULES,
- CP_BEACON_TRACE_TIMER
+ CP_BEACON_TRACE_TIMER,
+ CP_BEACON_TRACE_TIMER_PRGM
};
BEGIN_DECLS
diff --git a/cesar/cp/beacon/src/beacon.c b/cesar/cp/beacon/src/beacon.c
index ce94e5fdb1..4930fbd987 100644
--- a/cesar/cp/beacon/src/beacon.c
+++ b/cesar/cp/beacon/src/beacon.c
@@ -39,7 +39,6 @@
#include "cp/beacon/inc/trace.h"
#include "cp/inc/context.h"
-
/**
* Compare the discover info bentry with the previous one.
* \param disc1 discover bentry one.
@@ -473,12 +472,12 @@ cp_beacon_compute_ca_schedules (cp_t *ctx,
ctx->beacon.ca_schedule_index = 0;
}
- ca_alloc_update_beacon_periods (ctx->ca, beacon_period,
- CP_SCHED_BEACON_PERIODS_MAX);
-
CP_BEACON_TRACE (SCHEDULES, mac_ntb(), beacon_period[0].start_date,
beacon_period[1].start_date,
beacon_period[2].start_date);
+
+ ca_alloc_update_beacon_periods (ctx->ca, beacon_period,
+ CP_SCHED_BEACON_PERIODS_MAX);
}
/**
@@ -892,6 +891,8 @@ cp_beacon_cco_send_beacon (cp_t *ctx, uint beacon_type)
hal_timer_instance_cancel (ctx->hal_timer, &ctx->beacon.leon_timer);
hal_timer_instance_program (ctx->hal_timer, &ctx->beacon.leon_timer,
cp_pwl_get_next_timer_date (ctx, true));
+ CP_BEACON_TRACE (TIMER_PRGM, mac_ntb(),
+ cp_pwl_get_next_timer_date (ctx, true));
}
common->nb_beacon_sent ++;
@@ -1014,6 +1015,10 @@ cp_beacon_create_default_schedules (cp_t *ctx)
beacon_period[0].schedule_index = CA_SCHEDULE_NB - 1;
}
+ CP_BEACON_TRACE (SCHEDULES, mac_ntb(), beacon_period[0].start_date,
+ beacon_period[1].start_date,
+ beacon_period[2].start_date);
+
// Provide the beacon period to the CA.
ca_alloc_update_beacon_periods (ctx->ca, beacon_period,
CP_SCHED_BEACON_PERIODS_MAX);
@@ -1022,6 +1027,8 @@ cp_beacon_create_default_schedules (cp_t *ctx)
hal_timer_instance_cancel (ctx->hal_timer, &ctx->beacon.leon_timer);
hal_timer_instance_program (ctx->hal_timer, &ctx->beacon.leon_timer,
cp_pwl_get_next_timer_date(ctx, true));
+ CP_BEACON_TRACE (TIMER_PRGM, mac_ntb(),
+ cp_pwl_get_next_timer_date(ctx, true));
if (ctx->beacon.ca_sched_first_shoot)
ctx->beacon.ca_sched_first_shoot = false;
@@ -1124,6 +1131,8 @@ cp_beacon_get_and_process_beacon (cp_t *ctx)
hal_timer_instance_cancel (ctx->hal_timer, &ctx->beacon.leon_timer);
hal_timer_instance_program (ctx->hal_timer, &ctx->beacon.leon_timer,
cp_pwl_get_next_timer_date (ctx, false));
+ CP_BEACON_TRACE (TIMER_PRGM, mac_ntb(),
+ cp_pwl_get_next_timer_date(ctx, false));
}
/* Our station is not associated. */
else if (!cp_sta_own_data_get_tei (ctx)
@@ -1140,6 +1149,8 @@ cp_beacon_get_and_process_beacon (cp_t *ctx)
hal_timer_instance_cancel (ctx->hal_timer, &ctx->beacon.leon_timer);
hal_timer_instance_program (ctx->hal_timer, &ctx->beacon.leon_timer,
cp_pwl_get_next_timer_date (ctx, false));
+ CP_BEACON_TRACE (TIMER_PRGM, mac_ntb(),
+ cp_pwl_get_next_timer_date(ctx, false));
}
// Raise the event in the FSM for station action.
@@ -1210,6 +1221,8 @@ cp_beacon_process_tracked_avln (cp_t *ctx, cp_beacon_desc_t *beacon,
hal_timer_instance_cancel (ctx->hal_timer, &ctx->beacon.leon_timer);
hal_timer_instance_program (ctx->hal_timer, &ctx->beacon.leon_timer,
cp_pwl_get_next_timer_date (ctx, false));
+ CP_BEACON_TRACE (TIMER_PRGM, mac_ntb(),
+ cp_pwl_get_next_timer_date(ctx, false));
// TODO : Call the ntb_clock_sync function.
}
@@ -1262,6 +1275,8 @@ cp_beacon_beacon_not_received (cp_t *ctx)
mac_ntb () +
cp_pwl_get_beacon_period_ntb (ctx));
+ CP_BEACON_TRACE (TIMER_PRGM, mac_ntb(),
+ mac_ntb() + cp_pwl_get_beacon_period_ntb (ctx));
CP_BEACON_TRACE (BEACON_NOT_RECV, mac_ntb());
}
@@ -1384,6 +1399,8 @@ cp_beacon_reconfigure_timer (cp_t *ctx)
hal_timer_instance_cancel (ctx->hal_timer, &ctx->beacon.leon_timer);
hal_timer_instance_program (ctx->hal_timer, &ctx->beacon.leon_timer,
cp_pwl_get_next_timer_date (ctx, cco));
+ CP_BEACON_TRACE (TIMER_PRGM, mac_ntb(),
+ cp_pwl_get_next_timer_date (ctx, cco));
}
/**
diff --git a/cesar/cp/beacon/src/trace.c b/cesar/cp/beacon/src/trace.c
index b2024d10b8..c60cc47653 100644
--- a/cesar/cp/beacon/src/trace.c
+++ b/cesar/cp/beacon/src/trace.c
@@ -28,12 +28,13 @@ cp_beacon_trace_init (cp_t *ctx)
static trace_namespace_t namespace;
static const trace_event_id_t event_ids[] =
{
- TRACE_EVENT (CP_BEACON_TRACE_BEACON_NOT_RECV, "[BEACON] Not received", TIMESTAMP),
- TRACE_EVENT (CP_BEACON_TRACE_BEACON_RECV, "[BEACON] Received", TIMESTAMP),
- TRACE_EVENT (CP_BEACON_TRACE_BEACON_SEND, "[BEACON] SEND Beacon type : %x",
+ TRACE_EVENT (CP_BEACON_TRACE_BEACON_NOT_RECV, "Not received", TIMESTAMP),
+ TRACE_EVENT (CP_BEACON_TRACE_BEACON_RECV, "Received", TIMESTAMP),
+ TRACE_EVENT (CP_BEACON_TRACE_BEACON_SEND, "SEND Beacon type : %x",
TIMESTAMP),
- TRACE_EVENT (CP_BEACON_TRACE_SCHEDULES, "[BEACON] Schedules : %d %d %d", TIMESTAMP),
- TRACE_EVENT (CP_BEACON_TRACE_TIMER, "[BEACON] Timer", TIMESTAMP)
+ TRACE_EVENT (CP_BEACON_TRACE_SCHEDULES, "Schedules : %u %u %u", TIMESTAMP),
+ TRACE_EVENT (CP_BEACON_TRACE_TIMER, "Timer", TIMESTAMP),
+ TRACE_EVENT (CP_BEACON_TRACE_TIMER_PRGM, "Timer prgm : %u", TIMESTAMP)
};
trace_namespace_init (&namespace, event_ids, COUNT (event_ids));