summaryrefslogtreecommitdiff
path: root/cesar/hal/phy
diff options
context:
space:
mode:
authorschodet2010-04-19 13:18:51 +0000
committerschodet2010-04-19 13:18:51 +0000
commitb181dc1bc001f6163180c4786baed9a89ae31e61 (patch)
treeb39194b8755b6f98d04314512a9e9f8b9b156677 /cesar/hal/phy
parent505f4ad9eb1a4130b63ec6ab31496a2a295b2edb (diff)
cesar: remove context parameter from phy_date and phy_sysdate, refs #1415
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6931 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/hal/phy')
-rw-r--r--cesar/hal/phy/inc/trace.h2
-rw-r--r--cesar/hal/phy/maximus/src/maximus_phy_ctrl.c48
-rw-r--r--cesar/hal/phy/maximus/test/src/test_phy_ctrl.c2
-rw-r--r--cesar/hal/phy/phy.h6
-rw-r--r--cesar/hal/phy/spoc/test/src/spoc_coeff_check.c4
-rw-r--r--cesar/hal/phy/src/access.c4
-rw-r--r--cesar/hal/phy/src/pbdma.c2
-rw-r--r--cesar/hal/phy/src/phy.c24
-rw-r--r--cesar/hal/phy/src/pratic.c6
-rw-r--r--cesar/hal/phy/src/rx.c11
-rw-r--r--cesar/hal/phy/src/tx.c4
-rw-r--r--cesar/hal/phy/test/phy/src/access.c6
-rw-r--r--cesar/hal/phy/test/phy/src/basic.c10
-rw-r--r--cesar/hal/phy/test/phy/src/burst.c7
-rw-r--r--cesar/hal/phy/test/phy/src/clk_sync.c4
-rw-r--r--cesar/hal/phy/test/phy/src/data.c4
-rw-r--r--cesar/hal/phy/test/phy/src/test_phy.c6
17 files changed, 54 insertions, 96 deletions
diff --git a/cesar/hal/phy/inc/trace.h b/cesar/hal/phy/inc/trace.h
index 2dcc14c925..a00931bbc7 100644
--- a/cesar/hal/phy/inc/trace.h
+++ b/cesar/hal/phy/inc/trace.h
@@ -29,7 +29,7 @@
PASTE_EXPAND (PHY_TRACE_DATE_WARNING_, \
PREPROC_NARG (now)) ((date), ## now)
# define PHY_TRACE_DATE_WARNING_0(date) \
- PHY_TRACE_DATE_WARNING_1 ((date), phy_date (ctx))
+ PHY_TRACE_DATE_WARNING_1 ((date), phy_date ())
# define PHY_TRACE_DATE_WARNING_1(date, now) \
do { \
u32 now_ = (now); \
diff --git a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
index 4405d4586d..79466a080b 100644
--- a/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
+++ b/cesar/hal/phy/maximus/src/maximus_phy_ctrl.c
@@ -2200,28 +2200,10 @@ phy_deferred_schedule (phy_t *ctx)
}
-/**
- * set errno to:
- * - EINVAL if ctx is null
- */
u32
-phy_date (phy_t *ctx)
+phy_date (void)
{
- u32 date = 0;
-
- dbg_assert_ptr(ctx);
- if (NULL == ctx)
- {
- errno = EINVAL;
- station_log(&my_station, STATION_LOG_ERROR, STATION_LOGTYPE_PHY,
- "%s: errno = %d", __FUNCTION__, errno);
- }
- else
- {
- date = (u32)my_station.current_tick_tck;
- }
-
- return date;
+ return my_station.current_tick_tck;
}
@@ -2232,29 +2214,11 @@ phy_seed (void)
}
-/**
- * set errno to:
- * - EINVAL if ctx is null
- */
u32
-phy_sysdate (phy_t *ctx)
+phy_sysdate (void)
{
- u32 sysdate = 0;
-
- dbg_assert_ptr(ctx);
- if (NULL == ctx)
- {
- errno = EINVAL;
- station_log(&my_station, STATION_LOG_ERROR, STATION_LOGTYPE_PHY,
- "%s: errno = %d", __FUNCTION__, errno);
- }
- else
- {
- // TODO (for the moment, return the current date)
- sysdate = (u32)my_station.current_tick_tck;
- }
-
- return sysdate;
+ // TODO (for the moment, return the current date)
+ return my_station.current_tick_tck;
}
@@ -2902,7 +2866,7 @@ phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, u32 mod_fecrate_pb_size,
mod_fecrate_pb_size);
phy_pb_size_t pb_size = BF_GET (PHY_COMBO_PARAMS__PB_SIZE,
mod_fecrate_pb_size);
- u32 end_date = phy_date (ctx) + 1; // TODO: remove this.
+ u32 end_date = phy_date () + 1; // TODO: remove this.
/* PBP prepares HW for reception.
* This function is called when a FC is received, in the 'rx_fc_cb'. */
diff --git a/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c b/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c
index 7204dfa18a..13db24990c 100644
--- a/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c
+++ b/cesar/hal/phy/maximus/test/src/test_phy_ctrl.c
@@ -1391,7 +1391,7 @@ void phy_date_test_case(test_t t)
test_begin(t, "date")
{
my_station.current_tick_tck = 5;
- test_fail_unless (((u32)my_station.current_tick_tck == phy_date(ctx))
+ test_fail_unless (((u32)my_station.current_tick_tck == phy_date())
&& (EINVAL != errno));
} test_end;
diff --git a/cesar/hal/phy/phy.h b/cesar/hal/phy/phy.h
index 35ea3ba9ab..d4429df34c 100644
--- a/cesar/hal/phy/phy.h
+++ b/cesar/hal/phy/phy.h
@@ -125,19 +125,17 @@ phy_deferred_schedule (phy_t *ctx);
/**
* Get current date.
- * \param ctx phy context
* \return current date
*/
u32
-phy_date (phy_t *ctx);
+phy_date (void);
/**
* Retrieve uncorrected current date.
- * \param ctx phy context
* \return current uncorrected date
*/
u32
-phy_sysdate (phy_t *ctx);
+phy_sysdate (void);
/**
* Set the clock correction.
diff --git a/cesar/hal/phy/spoc/test/src/spoc_coeff_check.c b/cesar/hal/phy/spoc/test/src/spoc_coeff_check.c
index 204b39246b..21deb2019b 100644
--- a/cesar/hal/phy/spoc/test/src/spoc_coeff_check.c
+++ b/cesar/hal/phy/spoc/test/src/spoc_coeff_check.c
@@ -54,11 +54,11 @@ test_spoc_coeff (test_t test)
s32 alpha[PHY_SPOC_M_MATRIX_COEF_NB];
s32 beta[PHY_SPOC_M_MATRIX_COEF_NB];
#ifdef __sparc__
- u32 t1 = phy_date (INVALID_PTR);
+ u32 t1 = phy_date ();
#endif
phy_spoc_compute_m_matrix (coeff[c].rho_q30, alpha, beta);
#ifdef __sparc__
- u32 t2 = phy_date (INVALID_PTR);
+ u32 t2 = phy_date ();
printf ("SPOC M Matrix TX computation needs %d phy ticks\n", t2 - t1);
#endif
int e, emax = 0;
diff --git a/cesar/hal/phy/src/access.c b/cesar/hal/phy/src/access.c
index 7a510f636d..b0a4434595 100644
--- a/cesar/hal/phy/src/access.c
+++ b/cesar/hal/phy/src/access.c
@@ -30,7 +30,7 @@ phy_access_backoff_start (phy_t *ctx, u32 date, uint cap)
dbg_claim (cap < 4);
if (CONFIG_PHY_CAP_ZERO)
cap = 0;
- PHY_TRACE (ACCESS_BACKOFF_START, phy_date (ctx), date, cap);
+ PHY_TRACE (ACCESS_BACKOFF_START, phy_date (), date, cap);
/* Cancel previous programed action. */
PHY_PRATIC_TIMER_3_CTRL = 0;
PHY_PRATIC_TIMER_4_CTRL = 0;
@@ -42,7 +42,7 @@ phy_access_backoff_start (phy_t *ctx, u32 date, uint cap)
(TX_WHILE_RX, 1),
(TX_CANCEL_DUE_TO_FALSE_ALARM, 1));
/* Program PRP start. */
- u32 now = phy_date (ctx);
+ u32 now = phy_date ();
PHY_TRACE_DATE_WARNING (date - PHY_START_MAFADESE_DELAY_TCK, now);
if (lesseq_mod2p32 (now + PHY_ACCESS_SOFTWARE_MARGIN_TCK, date))
{
diff --git a/cesar/hal/phy/src/pbdma.c b/cesar/hal/phy/src/pbdma.c
index ed5a02261e..ed9847115f 100644
--- a/cesar/hal/phy/src/pbdma.c
+++ b/cesar/hal/phy/src/pbdma.c
@@ -65,7 +65,7 @@ phy_pbdma_start (phy_t *ctx, bool bypass_aes,
if (now)
PHY_PRATIC_IMMEDIATE_ACTION = PHY_PRATIC_ACTION__PBD_START;
/* Trace once finished. */
- PHY_TRACE (PBDMA_START, phy_date (ctx), bypass_aes, nb_total, nb_ready,
+ PHY_TRACE (PBDMA_START, phy_date (), bypass_aes, nb_total, nb_ready,
nb_pb_it, first_chandata ? true : false, now);
}
diff --git a/cesar/hal/phy/src/phy.c b/cesar/hal/phy/src/phy.c
index c1d3316fee..6129e34c19 100644
--- a/cesar/hal/phy/src/phy.c
+++ b/cesar/hal/phy/src/phy.c
@@ -137,7 +137,7 @@ phy_isr (cyg_vector_t vector, cyg_addrword_t data)
{
if (ctx->pbdma_start_on_resys_it)
{
- PHY_TRACE (PBDMA_START_ON_RESYS, phy_date (ctx));
+ PHY_TRACE (PBDMA_START_ON_RESYS, phy_date ());
/* Start PBDMA. */
PHY_PRATIC_IMMEDIATE_ACTION = PHY_PRATIC_ACTION__PBD_START;
/* Clear sound flag (see maria:#703). */
@@ -160,7 +160,7 @@ phy_isr (cyg_vector_t vector, cyg_addrword_t data)
PHY_DSPSS_RESYS_DETECT_OFFSET);
u32 rx_date = PHY_PRATIC_STA_LAST_RECEIVED_FRAME_DATE
- offset_smp / 3 - PHY_PREAMBLE_SYNCP_TCK;
- PHY_TRACE (RX_FC_CB, phy_date (ctx), rx_date);
+ PHY_TRACE (RX_FC_CB, phy_date (), rx_date);
if (status & BF_MASK (PHY_DSPSS_RX_FC_AV_STATUS__CRC_OK))
{
u32 fc_av[4];
@@ -177,53 +177,53 @@ phy_isr (cyg_vector_t vector, cyg_addrword_t data)
else if (it == LEON_ITC2_IT__PB_DMA_END)
{
u32 status_word = PHY_PBDMA_STATUS_ERROR;
- PHY_TRACE (PBDMA_CB, phy_date (ctx), status_word);
+ PHY_TRACE (PBDMA_CB, phy_date (), status_word);
call_dsr = ctx->pbdma_cb (ctx->user_data, status_word);
}
else if (it == LEON_ITC2_IT__PRATIC_ACCESS)
{
trace_do (u32 eff_date = PHY_PRATIC_TIMER_1_EFFECTIVE_DATE;)
- PHY_TRACE (ACCESS_CB, phy_date (ctx), eff_date);
+ PHY_TRACE (ACCESS_CB, phy_date (), eff_date);
PHY_TRACE_DATE_WARNING (eff_date + PHY_INTERRUPT_DELAY_MAX_TCK);
call_dsr = ctx->access_cb (ctx->user_data);
}
else if (it == LEON_ITC2_IT__PRATIC_ACCESS_CONF)
{
trace_do (u32 eff_date = PHY_PRATIC_TIMER_2_EFFECTIVE_DATE;)
- PHY_TRACE (ACCESS_CONF_CB, phy_date (ctx), eff_date);
+ PHY_TRACE (ACCESS_CONF_CB, phy_date (), eff_date);
PHY_TRACE_DATE_WARNING (eff_date + PHY_INTERRUPT_DELAY_MAX_TCK);
call_dsr = ctx->access_conf_cb (ctx->user_data);
}
else if (it == LEON_ITC2_IT__PRATIC_INTERRUPT)
{
trace_do (u32 eff_date = PHY_PRATIC_TIMER_5_EFFECTIVE_DATE;)
- PHY_TRACE (EXTRA_TIMER_CB, phy_date (ctx), eff_date);
+ PHY_TRACE (EXTRA_TIMER_CB, phy_date (), eff_date);
PHY_TRACE_DATE_WARNING (eff_date + PHY_INTERRUPT_DELAY_MAX_TCK);
call_dsr = ctx->extra_timer_cb (ctx->user_data);
}
else if (CONFIG_PHY_TRACE_MORE
&& it == LEON_ITC2_IT__MAPPOWSE_END_TX_FRAME)
{
- PHY_TRACE (TX_END, phy_date (ctx));
+ PHY_TRACE (TX_END, phy_date ());
call_dsr = false;
}
else if (CONFIG_PHY_TRACE_MORE
&& it == LEON_ITC2_IT__PB_DMA_ERROR)
{
- PHY_TRACE (PBDMA_ERROR, phy_date (ctx), PHY_PBDMA_STATUS_ERROR);
+ PHY_TRACE (PBDMA_ERROR, phy_date (), PHY_PBDMA_STATUS_ERROR);
call_dsr = false;
}
else if (CONFIG_PHY_TRACE_MORE
&& it == LEON_ITC2_IT__CONGESTION_TX_ERROR)
{
- PHY_TRACE (TX_CONGESTION, phy_date (ctx));
+ PHY_TRACE (TX_CONGESTION, phy_date ());
call_dsr = false;
}
else
{
dbg_assert_default ();
}
- PHY_TRACE (ISR_EXIT, phy_date (ctx));
+ PHY_TRACE (ISR_EXIT, phy_date ());
return (call_dsr ? CYG_ISR_CALL_DSR : 0) | CYG_ISR_HANDLED;
}
@@ -239,7 +239,7 @@ phy_dsr (cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data)
{
phy_t *ctx = (phy_t *) data;
dbg_claim (ctx);
- PHY_TRACE (DEFERRED_CB, phy_date (ctx));
+ PHY_TRACE (DEFERRED_CB, phy_date ());
ctx->deferred_cb (ctx->user_data);
}
@@ -728,7 +728,7 @@ phy_reset (phy_t *ctx)
u32
phy_seed (void)
{
- return phy_date (INVALID_PTR);
+ return phy_date ();
}
void
diff --git a/cesar/hal/phy/src/pratic.c b/cesar/hal/phy/src/pratic.c
index e1667183b7..178e319dc7 100644
--- a/cesar/hal/phy/src/pratic.c
+++ b/cesar/hal/phy/src/pratic.c
@@ -29,16 +29,14 @@
#include "hal/arch/arch.h"
u32 ARCH_ILRAM
-phy_date (phy_t *ctx)
+phy_date (void)
{
- dbg_claim (ctx);
return PHY_PRATIC_STA_LOCAL_TIMER;
}
u32
-phy_sysdate (phy_t *ctx)
+phy_sysdate (void)
{
- dbg_claim (ctx);
return PHY_PRATIC_SYS_LOCAL_TIMER;
}
diff --git a/cesar/hal/phy/src/rx.c b/cesar/hal/phy/src/rx.c
index 5bd93ff5e4..0ed92062bf 100644
--- a/cesar/hal/phy/src/rx.c
+++ b/cesar/hal/phy/src/rx.c
@@ -40,7 +40,7 @@ phy_rx_activate (phy_t *ctx, bool now, u32 date, bool flag)
/* Program new action. */
if (now)
{
- PHY_TRACE (RX_ACTIVATE_NOW, phy_date (ctx), flag);
+ PHY_TRACE (RX_ACTIVATE_NOW, phy_date (), flag);
if (flag)
PHY_PRATIC_IMMEDIATE_ACTION = PHY_PRATIC_ACTION__SEARCH_PRE;
else
@@ -159,8 +159,7 @@ phy_rx_prepare (phy_t *ctx, uint nb_pb, u32 mod_fecrate_pb_size,
phy_rx_prepare_common (ctx, false, false, nb_pb, mod_fecrate_pb_size, gil,
symbol_nb, tcc_halfit);
/* Trace when done. */
- PHY_TRACE (RX_PREPARE, phy_date (ctx), mod_fecrate_pb_size, gil,
- symbol_nb);
+ PHY_TRACE (RX_PREPARE, phy_date (), mod_fecrate_pb_size, gil, symbol_nb);
}
void ARCH_ILRAM
@@ -170,7 +169,7 @@ phy_rx_prepare_short (phy_t *ctx)
/* Prepare. */
phy_rx_prepare_common (ctx, true, false, 0, 0, PHY_GIL_417, 0, 0);
/* Trace when done. */
- PHY_TRACE (RX_PREPARE_SHORT, phy_date (ctx));
+ PHY_TRACE (RX_PREPARE_SHORT, phy_date ());
}
void ARCH_ILRAM
@@ -186,8 +185,8 @@ phy_rx_prepare_sound (phy_t *ctx, uint nb_pb, u32 mod_fecrate_pb_size,
/* Need to start PBDMA. */
ctx->pbdma_start_on_resys_it = true;
/* Trace when done. */
- PHY_TRACE (RX_PREPARE_SOUND, phy_date (ctx), nb_pb, mod_fecrate_pb_size,
- gil, symbol_nb);
+ PHY_TRACE (RX_PREPARE_SOUND, phy_date (), nb_pb, mod_fecrate_pb_size, gil,
+ symbol_nb);
}
u32 ARCH_ILRAM
diff --git a/cesar/hal/phy/src/tx.c b/cesar/hal/phy/src/tx.c
index 86f18ba92b..534682e380 100644
--- a/cesar/hal/phy/src/tx.c
+++ b/cesar/hal/phy/src/tx.c
@@ -165,7 +165,7 @@ phy_tx_frame (phy_t *ctx, u32 date, bool want_conf, bool stop_tx_on_prp_lost,
{
dbg_claim (ctx);
dbg_claim (fc_av);
- PHY_TRACE (TX_FRAME, phy_date (ctx), date, want_conf, stop_tx_on_prp_lost,
+ PHY_TRACE (TX_FRAME, phy_date (), date, want_conf, stop_tx_on_prp_lost,
fc_av[0]);
/* Set FC. */
PHY_DSPSS_TX_FC_AV_0 = fc_av[0];
@@ -198,7 +198,7 @@ void ARCH_ILRAM
phy_tx_prepare (phy_t *ctx)
{
dbg_claim (ctx);
- PHY_TRACE (TX_PREPARE, phy_date (ctx));
+ PHY_TRACE (TX_PREPARE, phy_date ());
PHY_PRATIC_IMMEDIATE_ACTION = PHY_PRATIC_ACTION__PBD_START;
}
diff --git a/cesar/hal/phy/test/phy/src/access.c b/cesar/hal/phy/test/phy/src/access.c
index f9d247d9b3..22846b9007 100644
--- a/cesar/hal/phy/test/phy/src/access.c
+++ b/cesar/hal/phy/test/phy/src/access.c
@@ -36,7 +36,7 @@ test_phy_access_timer_basic (test_t t, test_phy_t *ctx,
for (i = 0; i < msg->timer_basic_iter; i++)
{
/* Start timer. */
- u32 now = phy_date (ctx->phy);
+ u32 now = phy_date ();
u32 due_date = now + TEST_PHY_ANTICIP_TCK
+ lib_rnd_uniform (ctx->rnd, 20 * TEST_PHY_ANTICIP_TCK);
phy_access_timer_program (ctx->phy, due_date);
@@ -57,7 +57,7 @@ test_phy_access_timer_basic (test_t t, test_phy_t *ctx,
} test_end;
test_begin (t, "timer basic cancel")
{
- phy_access_timer_program (ctx->phy, phy_date (ctx->phy)
+ phy_access_timer_program (ctx->phy, phy_date ()
+ 2 * ctx->tck_per_rtc);
cyg_thread_delay (1);
phy_access_timer_cancel (ctx->phy);
@@ -256,7 +256,7 @@ test_phy_access_prs (test_t t, test_phy_t *ctx)
prp_date = ctx->clk_zero_tck;
}
else
- prp_date = phy_date (ctx->phy) + TEST_PHY_ANTICIP_TCK;
+ prp_date = phy_date () + TEST_PHY_ANTICIP_TCK;
prp_date += 2 * MAC_SLOT_TCK;
/* Prepare callbacks. */
ctx->access_conf_cb = test_phy_access_prs_access_conf_cb;
diff --git a/cesar/hal/phy/test/phy/src/basic.c b/cesar/hal/phy/test/phy/src/basic.c
index 8d1e276e99..8f35daa7e4 100644
--- a/cesar/hal/phy/test/phy/src/basic.c
+++ b/cesar/hal/phy/test/phy/src/basic.c
@@ -57,12 +57,12 @@ test_phy_basic (test_t t, test_phy_t *ctx, test_phy_msg_basic_t *msg)
{
u32 date0, date1;
uint delay_rtc = msg->date_delay_tck / ctx->tck_per_rtc;
- date1 = phy_sysdate (ctx->phy);
+ date1 = phy_sysdate ();
do
{
date0 = date1;
cyg_thread_delay (delay_rtc);
- date1 = phy_sysdate (ctx->phy);
+ date1 = phy_sysdate ();
/* Resolution will only be as good as tck_per_rtc. */
test_fail_unless (
date1 - date0 > (delay_rtc - 1) * ctx->tck_per_rtc
@@ -86,12 +86,12 @@ test_phy_basic (test_t t, test_phy_t *ctx, test_phy_msg_basic_t *msg)
}
uint delay_rtc = msg->date_delay_tck / tck_per_rtc;
/* Do test. */
- date1 = phy_date (ctx->phy);
+ date1 = phy_date ();
do
{
date0 = date1;
cyg_thread_delay (delay_rtc);
- date1 = phy_date (ctx->phy);
+ date1 = phy_date ();
/* Resolution will only be as good as tck_per_rtc. */
test_fail_unless (
date1 - date0 > (delay_rtc - 1) * tck_per_rtc
@@ -147,7 +147,7 @@ test_phy_basic (test_t t, test_phy_t *ctx, test_phy_msg_basic_t *msg)
ctx->access_conf_cb = test_phy_default_access_conf_cb;
ctx->deferred_cb = test_phy_default_deferred_cb;
phy_tx_param_short (ctx->phy, PHY_FC_MODE_AV_1);
- phy_tx_frame (ctx->phy, phy_date (ctx->phy), true, false, fc);
+ phy_tx_frame (ctx->phy, phy_date (), true, false, fc);
/* Report waiting. */
if (msg->preamble_async)
{
diff --git a/cesar/hal/phy/test/phy/src/burst.c b/cesar/hal/phy/test/phy/src/burst.c
index 4ff09ca802..f35b8dd666 100644
--- a/cesar/hal/phy/test/phy/src/burst.c
+++ b/cesar/hal/phy/test/phy/src/burst.c
@@ -287,7 +287,7 @@ test_phy_burst_tx (test_phy_t *ctx, test_phy_msg_burst_t *b)
phy_rx_param (ctx->phy, d->fc_mode);
/* Program ACCESS. */
b->tx_pbs = gen_data_blk_cached (&ctx->gen, d->pb_nb_ready, NULL);
- b->next_tx_date = phy_date (ctx->phy) + 2 * b->anticip_tck;
+ b->next_tx_date = phy_date () + 2 * b->anticip_tck;
phy_access_timer_program (ctx->phy, b->next_tx_date - b->anticip_tck);
/* Wait end. */
dbg_check (cyg_semaphore_wait (&ctx->event_sem));
@@ -753,8 +753,7 @@ test_phy_burst_rx (test_phy_t *ctx, test_phy_msg_burst_t *b)
ctx->extra_timer_cb = test_phy_burst_rx_extra_timer_cb;
/* Timeout. */
if (b->timeout_tck != -1)
- phy_extra_timer_program (ctx->phy, phy_date (ctx->phy)
- + b->timeout_tck);
+ phy_extra_timer_program (ctx->phy, phy_date () + b->timeout_tck);
/* Activate RX. */
phy_rx_param (ctx->phy, d->fc_mode);
phy_rx_activate (ctx->phy, true, 0, true);
@@ -1100,7 +1099,7 @@ test_phy_burst_csma (test_phy_t *ctx, test_phy_msg_burst_t *b)
{
b->csma_state = TEST_PHY_BURST_CSMA_SYNC_TX;
/* Transmit the synchronisation frame, will start on access_conf. */
- b->tx_date = phy_date (ctx->phy) + b->anticip_tck;
+ b->tx_date = phy_date () + b->anticip_tck;
/* Optionally prepare FC 1.0. */
if (PHY_FC_MODE_IS_HYBRID (d->fc_mode))
phy_tx_fc10 (ctx->phy, b->tx_date, 0xfc1000);
diff --git a/cesar/hal/phy/test/phy/src/clk_sync.c b/cesar/hal/phy/test/phy/src/clk_sync.c
index 208db1b0da..bbe6595d55 100644
--- a/cesar/hal/phy/test/phy/src/clk_sync.c
+++ b/cesar/hal/phy/test/phy/src/clk_sync.c
@@ -39,7 +39,7 @@ test_phy_clk_sync (test_t t, test_phy_t *ctx, test_phy_msg_clk_sync_t *msg)
{
/* Unblock the waiting STA. */
test_phy_clk_sync_go (t, ctx);
- test_fail_unless (phy_date (ctx->phy) < ctx->clk_zero_tck);
+ test_fail_unless (phy_date () < ctx->clk_zero_tck);
/* Activate reception after TX. */
ctx->rx_fc_cb = test_phy_default_rx_fc_cb;
ctx->deferred_cb = test_phy_default_deferred_cb;
@@ -165,7 +165,7 @@ void ARCH_ILRAM
test_phy_clk_sync_go (test_t t, test_phy_t *ctx)
{
dbg_assert (ctx);
- u32 pre_date = phy_date (ctx->phy) + TEST_PHY_ANTICIP_TCK;
+ u32 pre_date = phy_date () + TEST_PHY_ANTICIP_TCK;
/* Record zero date. */
ctx->clk_zero_tck = pre_date + MAC_PREAMBLE_TCK + MAC_FC_AV_TCK
+ MAC_RIFS_DEFAULT_TCK;
diff --git a/cesar/hal/phy/test/phy/src/data.c b/cesar/hal/phy/test/phy/src/data.c
index 6789d7c5f6..87f9e7d251 100644
--- a/cesar/hal/phy/test/phy/src/data.c
+++ b/cesar/hal/phy/test/phy/src/data.c
@@ -152,7 +152,7 @@ test_phy_data_data_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
test_phy_t *ctx = (void *) user;
dbg_assert (ctx);
/* Basic treatments. */
- ctx->rx_fc_date = phy_date (ctx->phy);
+ ctx->rx_fc_date = phy_date ();
ctx->rx_fc_count++;
ctx->received_pre_date = rx_date;
ctx->received_fc_crc_ok = !!fc_av;
@@ -185,7 +185,7 @@ test_phy_data_data_pbdma_cb (void *user, u32 status_word)
{
test_phy_t *ctx = (void *) user;
dbg_assert (ctx);
- ctx->pbdma_date = phy_date (ctx->phy);
+ ctx->pbdma_date = phy_date ();
ctx->pbdma_count++;
ctx->pbdma_status = PHY_PBDMA_STATUS (status_word);
dbg_assert (!ctx->pbdma_status.rx_header_load_error
diff --git a/cesar/hal/phy/test/phy/src/test_phy.c b/cesar/hal/phy/test/phy/src/test_phy.c
index 7b3f30bea3..986c7d2db0 100644
--- a/cesar/hal/phy/test/phy/src/test_phy.c
+++ b/cesar/hal/phy/test/phy/src/test_phy.c
@@ -184,7 +184,7 @@ test_phy_default_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av)
uint i;
test_phy_t *ctx = (void *) user;
dbg_assert (ctx);
- ctx->rx_fc_date = phy_date (ctx->phy);
+ ctx->rx_fc_date = phy_date ();
ctx->rx_fc_count++;
ctx->received_pre_date = rx_date;
ctx->received_fc_crc_ok = !!fc_av;
@@ -210,7 +210,7 @@ test_phy_default_access_cb (void *user)
{
test_phy_t *ctx = (void *) user;
dbg_assert (ctx);
- ctx->access_date = phy_date (ctx->phy);
+ ctx->access_date = phy_date ();
ctx->access_count++;
return true;
}
@@ -608,7 +608,7 @@ cyg_user_start (void)
mac_config.ntb_offset_tck = 0;
mac_config.sta_mac_address = SPC_OUI;
# if CONFIG_TRACE
- mac_ntb_init (INVALID_PTR, &mac_config);
+ mac_ntb_init (&mac_config);
# endif
hle_t *hle = hle_init (INVALID_PTR);
interface_t *interface = interface_init (hle, INVALID_PTR, INVALID_PTR,