summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorschodet2010-04-19 13:18:51 +0000
committerschodet2010-04-19 13:18:51 +0000
commitb181dc1bc001f6163180c4786baed9a89ae31e61 (patch)
treeb39194b8755b6f98d04314512a9e9f8b9b156677 /cesar
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')
-rw-r--r--cesar/cl/test/functional/src/cl.c14
-rw-r--r--cesar/cl/test/src/test.c4
-rw-r--r--cesar/cp/beacon/ntb/src/ntb.c2
-rw-r--r--cesar/cp/beacon/ntb/test/src/ntb.c21
-rw-r--r--cesar/cp/cco/action/test/src/action-test.c6
-rw-r--r--cesar/cp/cco/action/test/src/garbage.c9
-rw-r--r--cesar/cp/sta/action/test/utest/src/misc.c3
-rw-r--r--cesar/cp/sta/mgr/test/src/sta_mgr.c3
-rw-r--r--cesar/hal/leon/inc/timer_ctx.h4
-rw-r--r--cesar/hal/leon/maximus/src/maximus_timer.c3
-rw-r--r--cesar/hal/leon/maximus/test/src/test_maximus_timer.c8
-rw-r--r--cesar/hal/leon/src/timer.c7
-rw-r--r--cesar/hal/leon/test/timer/src/target.c7
-rw-r--r--cesar/hal/leon/timer.h5
-rw-r--r--cesar/hal/leon/unit-test/src/leon_timer.c10
-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
-rw-r--r--cesar/hal/timer/inc/context.h3
-rw-r--r--cesar/hal/timer/src/timer.c12
-rw-r--r--cesar/hal/timer/stub/src/hal_timer.c5
-rw-r--r--cesar/hal/timer/test/src/leon_timer_stub.c4
-rw-r--r--cesar/hal/timer/test/src/timer.c20
-rw-r--r--cesar/hal/timer/test/src/timer2.c11
-rw-r--r--cesar/hal/timer/test/src/timer_date_past.c11
-rw-r--r--cesar/hal/timer/timer.h4
-rw-r--r--cesar/hle/test/src/hle_recv_from_arm.c3
-rw-r--r--cesar/hle/test/src/hle_send_to_arm.c9
-rw-r--r--cesar/hle/test/src/interface-send.c8
-rw-r--r--cesar/lib/test/trace/src/trace_perf.c26
-rw-r--r--cesar/mac/ca/src/access.c20
-rw-r--r--cesar/mac/ca/src/alloc.c4
-rw-r--r--cesar/mac/ca/test/ca/src/phy_stub.c5
-rw-r--r--cesar/mac/ca/test/fcall/src/beacon_period.c3
-rw-r--r--cesar/mac/common/ntb.h6
-rw-r--r--cesar/mac/common/src/ntb.c17
-rw-r--r--cesar/mac/common/test/ntb/src/test_ntb.c13
-rw-r--r--cesar/mac/common/test/ntb/src/test_ntb_phy_unstub.c7
-rw-r--r--cesar/mac/pbproc/src/fsm.c10
-rw-r--r--cesar/mac/pbproc/src/fsm_top.c5
-rw-r--r--cesar/mac/pbproc/src/pbproc.c10
-rw-r--r--cesar/mac/pbproc/test/int/src/test_pbproc.c4
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/phy.c10
-rw-r--r--cesar/mac/sar/test/functional/src/sar_rx.c3
-rw-r--r--cesar/mac/sar/test/functional/src/sar_tx.c3
-rw-r--r--cesar/mac/sar/test/functional/src/test_functions.c2
-rw-r--r--cesar/mac/sar/test/unit_test/ecos/src/msdu_timeout.c4
-rw-r--r--cesar/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c4
-rw-r--r--cesar/mac/sar/test/unit_test/ecos/src/sar_manage_expiration.c29
-rw-r--r--cesar/mac/sar/test/unit_test/ecos/src/tests.c2
-rw-r--r--cesar/mac/sar/test/unit_test/host/src/phy_stub.c2
-rw-r--r--cesar/station/src/station.c5
-rw-r--r--cesar/test_general/dataplane/src/test_dataplane.c4
-rw-r--r--cesar/test_general/maximus/integration/cl-sar-pbproc/src/station.c2
-rw-r--r--cesar/test_general/maximus/integration/hle-cl-sar-pbproc/src/station.c2
-rw-r--r--cesar/test_general/maximus/integration/interface-dp/src/station.c2
-rw-r--r--cesar/test_general/maximus/integration/ipmbox-hle-cl-sar-pbproc/src/station.c2
-rw-r--r--cesar/test_general/maximus/integration/sar-pbproc/src/station.c2
-rw-r--r--cesar/tools/sniffer_phy/src/sniffer_phy.c2
73 files changed, 199 insertions, 357 deletions
diff --git a/cesar/cl/test/functional/src/cl.c b/cesar/cl/test/functional/src/cl.c
index 40980ab87d..4d554cb455 100644
--- a/cesar/cl/test/functional/src/cl.c
+++ b/cesar/cl/test/functional/src/cl.c
@@ -75,7 +75,6 @@ cl_data_tx_send (test_t test)
mac_store_t *mac_store;
mac_config_t mac_config;
uint sar;
- uint phy;
/* Initialise the test. */
memset (&mac_config, 0, sizeof (mac_config_t));
@@ -84,7 +83,7 @@ cl_data_tx_send (test_t test)
cl = cl_init (mac_store, (sar_t *) &sar, &mac_config);
cl_data_send_done_init (cl, cl_data_send_done_cb, NULL);
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
test_case_begin (test, "Data send");
@@ -230,7 +229,6 @@ cl_mme_tx_send (test_t test)
mac_store_t *mac_store;
mac_config_t mac_config;
uint sar;
- uint phy;
/* Initialise the test. */
memset (&mac_config, 0, sizeof (mac_config_t));
@@ -239,7 +237,7 @@ cl_mme_tx_send (test_t test)
cl = cl_init (mac_store, (sar_t *) &sar, &mac_config);
cl_mme_init_buffer_add_cb (cl, cl_mme_buffer_add_cb, NULL);
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
test_case_begin (test, "MMe send");
@@ -383,14 +381,6 @@ cyg_user_start (cyg_addrword_t addr)
/* Stubs. */
-#ifndef __sparc__
-u32
-phy_date (phy_t *phy)
-{
- return 0;
-}
-#endif
-
void
sar_msdu_add (sar_t *ctx, u8 *buffer, u16 length,
mfs_tx_t *mfs, void *user_data, u32 arrival_time_ntb)
diff --git a/cesar/cl/test/src/test.c b/cesar/cl/test/src/test.c
index c313dc05b2..51b090dce3 100644
--- a/cesar/cl/test/src/test.c
+++ b/cesar/cl/test/src/test.c
@@ -61,11 +61,10 @@ cl_trace_buffer_dbg_dump_callback (void *user, const char *text,
void
cl_test_init (cl_test_t *ctx, u32 seed)
{
- static int phy = 0;
dbg_assert (ctx);
ctx->mac_store = mac_store_init ();
mac_config_init (&ctx->mac_config);
- mac_ntb_init ((phy_t *) &phy, &ctx->mac_config);
+ mac_ntb_init (&ctx->mac_config);
ctx->mac_config.authenticated = true;
ctx->mac_config.tei = 0xfe;
ctx->mac_config.sta_mac_address = 0xfeffffd71300ull;
@@ -76,7 +75,6 @@ cl_test_init (cl_test_t *ctx, u32 seed)
cl_mme_recv_init (ctx->cl, cl_test_init_mme_recv_cp, &ctx->pwl_recv);
cl_data_recv_init (ctx->cl, cl_test_init_data_recv, &ctx->pwl_recv);
lib_rnd_init (&ctx->rnd, seed);
- mac_ntb_init ((phy_t*) &phy, &ctx->mac_config);
}
void
diff --git a/cesar/cp/beacon/ntb/src/ntb.c b/cesar/cp/beacon/ntb/src/ntb.c
index 5a44ab19cb..298c709d92 100644
--- a/cesar/cp/beacon/ntb/src/ntb.c
+++ b/cesar/cp/beacon/ntb/src/ntb.c
@@ -77,7 +77,7 @@ cp_beacon_ntb_offset (cp_t *ctx)
dbg_assert (ctx);
/* Get the delay in system ticks. */
- delay_systck = phy_sysdate (ctx->phy) - ctx->ntb.preamble_sysdate [0];
+ delay_systck = phy_sysdate () - ctx->ntb.preamble_sysdate [0];
CP_TRACE_VERBOSE (NTB_SYNC_PROC_DELAY, delay_systck);
if (ctx->ntb.preamble_sysdate[1])
diff --git a/cesar/cp/beacon/ntb/test/src/ntb.c b/cesar/cp/beacon/ntb/test/src/ntb.c
index 3cec3d0b3d..25ecf68530 100644
--- a/cesar/cp/beacon/ntb/test/src/ntb.c
+++ b/cesar/cp/beacon/ntb/test/src/ntb.c
@@ -35,6 +35,9 @@
static bool spoc_called;
typedef double phy_spoc_prec_t;
+/* Used by phy_sysdate stub. */
+cp_beacon_ntb_t *sysdate_ntb;
+
void
cp_beacon_ntb_clk_sync_call_spoc (cp_t *ctx);
@@ -73,7 +76,8 @@ test_case_ntb_ntb_sync (test_t test)
memset (&mac_config, 0, sizeof (mac_config_t));
cp_beacon_ntb_init (&cp);
cp.mac_config = &mac_config;
- cp.phy = (phy_t *) &cp.ntb;
+ cp.phy = INVALID_PTR;
+ sysdate_ntb = &cp.ntb;
/* Initialise the values. */
for (i = 0; i < COUNT (beacon_bts); i++)
@@ -114,10 +118,9 @@ test_case_ntb_spoc_call (test_t test)
test_begin (test, "counter")
{
cp_t cp;
- uint phy;
cp_beacon_ntb_init (&cp);
- cp.phy = (phy_t*) &phy;
+ cp.phy = INVALID_PTR;
cp.ntb.counter_spoc_interval = CP_BEACON_NTB_SPOC_INTERVAL_CALL + 1;
spoc_called = false;
@@ -131,10 +134,9 @@ test_case_ntb_spoc_call (test_t test)
test_begin (test, "PPM cause")
{
cp_t cp;
- uint phy;
cp_beacon_ntb_init (&cp);
- cp.phy = (phy_t*) &phy;
+ cp.phy = INVALID_PTR;
cp.ntb.counter_spoc_interval = 0;
cp.ntb.fe[0] = 4e-6;
@@ -177,7 +179,8 @@ test_case_ntb_fail_beacons (test_t test)
memset (&mac_config, 0, sizeof (mac_config_t));
cp_beacon_ntb_init (&cp);
cp.mac_config = &mac_config;
- cp.phy = (phy_t *) &cp.ntb;
+ cp.phy = INVALID_PTR;
+ sysdate_ntb = &cp.ntb;
/* Parse beacon_bts table with a step of 5. */
for (i = 0; i < COUNT (beacon_bts); i+=5)
@@ -214,11 +217,9 @@ main (void)
}
u32
-phy_sysdate (phy_t *ctx)
+phy_sysdate ()
{
- dbg_assert (ctx);
- cp_beacon_ntb_t *ntb = (cp_beacon_ntb_t *) ctx;
- return (ntb->preamble_sysdate[0] + DELAY_SYSTCK);
+ return (sysdate_ntb->preamble_sysdate[0] + DELAY_SYSTCK);
}
void
diff --git a/cesar/cp/cco/action/test/src/action-test.c b/cesar/cp/cco/action/test/src/action-test.c
index 12f91c324e..51c53c6b33 100644
--- a/cesar/cp/cco/action/test/src/action-test.c
+++ b/cesar/cp/cco/action/test/src/action-test.c
@@ -1251,12 +1251,6 @@ cp_beacon_change_snid (cp_t *ctx, u8 snid)
snid_compute = snid;
}
-u32
-phy_date (phy_t *phy)
-{
- return 42;
-}
-
/**
* Begin a CC_SET_TEI_MAP.IND construction.
* \param ctx control plane context
diff --git a/cesar/cp/cco/action/test/src/garbage.c b/cesar/cp/cco/action/test/src/garbage.c
index 7556de2484..434d211698 100644
--- a/cesar/cp/cco/action/test/src/garbage.c
+++ b/cesar/cp/cco/action/test/src/garbage.c
@@ -71,12 +71,11 @@ my_thread_entry (cyg_addrword_t data)
cp_t cp;
cp_net_t *net;
mac_config_t mac_config;
- uint phy;
uint date;
cl_t cl;
sar_t sar;
- mac_ntb_init ((phy_t*) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
cp_cco_action_init (&cp);
cp_sta_mgr_init (&cp);
@@ -129,12 +128,11 @@ my_thread_entry (cyg_addrword_t data)
cp_t cp;
cp_net_t *net;
mac_config_t mac_config;
- uint phy;
uint date;
cl_t cl;
sar_t sar;
- mac_ntb_init ((phy_t*) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
test_init (test, 0, NULL);
@@ -213,12 +211,11 @@ my_thread_entry (cyg_addrword_t data)
cp_t cp;
cp_net_t *net;
mac_config_t mac_config;
- uint phy;
uint date;
cl_t cl;
sar_t sar;
- mac_ntb_init ((phy_t*) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
cp_cco_action_init (&cp);
cp_sta_mgr_init (&cp);
diff --git a/cesar/cp/sta/action/test/utest/src/misc.c b/cesar/cp/sta/action/test/utest/src/misc.c
index 8cc2b75b19..491fa18b05 100644
--- a/cesar/cp/sta/action/test/utest/src/misc.c
+++ b/cesar/cp/sta/action/test/utest/src/misc.c
@@ -771,8 +771,7 @@ misc_nw_stats_test_case (test_t t)
/* Init mac ntb */
mac_config_t mac_config;
- uint phy;
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
test_case_begin (t, "nw_stats_req when no avln");
test_begin (t, "ok")
diff --git a/cesar/cp/sta/mgr/test/src/sta_mgr.c b/cesar/cp/sta/mgr/test/src/sta_mgr.c
index 60d5484e36..eb1de4d5b9 100644
--- a/cesar/cp/sta/mgr/test/src/sta_mgr.c
+++ b/cesar/cp/sta/mgr/test/src/sta_mgr.c
@@ -761,7 +761,6 @@ test_case__cp_sta_manager_garbage (test_t test)
test_begin (test, "Associated stations")
{
cp_t cp;
- uint phy;
cp_net_t *net;
cp_sta_t *sta;
mac_config_t mac_config;
@@ -775,7 +774,7 @@ test_case__cp_sta_manager_garbage (test_t test)
memset (&mac_config, 0, sizeof (mac_config_t));
cp_sta_mgr_init (&cp);
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
net = cp_sta_mgr_add_avln (&cp, 1, 1);
cp.sta_mgr.our_avln = net;
diff --git a/cesar/hal/leon/inc/timer_ctx.h b/cesar/hal/leon/inc/timer_ctx.h
index 8f3b245a0e..ecf22e7851 100644
--- a/cesar/hal/leon/inc/timer_ctx.h
+++ b/cesar/hal/leon/inc/timer_ctx.h
@@ -18,8 +18,6 @@
#include <cyg/hal/drv_api.h>
#include <cyg/infra/diag.h>
-#include "hal/phy/forward.h"
-
enum leon_timer_status_t
{
LEON_TIMER_STATUS_STOP,
@@ -33,8 +31,6 @@ struct leon_timer_t
leon_timer_status_t status;
/** Function call back to call. */
leon_timer_cb_t cb;
- /** phy context. */
- phy_t *phy;
/** Callback user data. */
void *user_data;
diff --git a/cesar/hal/leon/maximus/src/maximus_timer.c b/cesar/hal/leon/maximus/src/maximus_timer.c
index 7ad4a64317..84884ae0f5 100644
--- a/cesar/hal/leon/maximus/src/maximus_timer.c
+++ b/cesar/hal/leon/maximus/src/maximus_timer.c
@@ -52,13 +52,12 @@ static void _leon_timer_ecos_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_ad
* Initialise Leon timer.
* \param user_data user data passed to the callback
* \param cb timer callback, called in ISR context
- * \param phy phy context used to get the phy date (not used for Maximus)
* \return the newly created context
* set errno to:
* - EINVAL if user_data or cb are null
*/
leon_timer_t *
-leon_timer_init (void *user_data, leon_timer_cb_t cb, phy_t *phy)
+leon_timer_init (void *user_data, leon_timer_cb_t cb)
{
/* Set the user_data value of leon timer context.
* Set the cb value of leon timer context. */
diff --git a/cesar/hal/leon/maximus/test/src/test_maximus_timer.c b/cesar/hal/leon/maximus/test/src/test_maximus_timer.c
index cf10dfd078..36607c4275 100644
--- a/cesar/hal/leon/maximus/test/src/test_maximus_timer.c
+++ b/cesar/hal/leon/maximus/test/src/test_maximus_timer.c
@@ -25,14 +25,11 @@
#include <fcntl.h> // for 'read', 'open()' and 'close()'
#include <errno.h>
-#include "hal/phy/phy.h"
-
void leon_timer_test_suite (test_t t);
uint32_t maximus_pending_isrs;
station_ctx_t my_station;
leon_timer_t *ctx;
-phy_t *phy;
int user_data = 123456789;
void
@@ -69,12 +66,11 @@ void
leon_timer_init_test_case(test_t t)
{
printf("init\n");
- phy = blk_alloc ();
test_case_begin(t, "init");
test_begin(t, "init")
{
- ctx = leon_timer_init ((void *)&user_data, &leon_timer_cb, phy);
+ ctx = leon_timer_init ((void *)&user_data, &leon_timer_cb);
test_fail_unless ((EINVAL != errno)
&& (NULL != ctx)
&& (user_data == *((int *)ctx->user_data))
@@ -275,8 +271,6 @@ void leon_timer_uninit_test_case(test_t t)
test_fail_unless (EINVAL != errno);
} test_end;
- blk_release (phy);
-
return;
}
diff --git a/cesar/hal/leon/src/timer.c b/cesar/hal/leon/src/timer.c
index eef74e74c3..30479560e5 100644
--- a/cesar/hal/leon/src/timer.c
+++ b/cesar/hal/leon/src/timer.c
@@ -57,20 +57,17 @@ static leon_timer_t leon_timer_global;
* Initialise Leon timer.
* \param user_data user data passed to the callback
* \param cb timer callback, called in ISR context
- * \param phy phy context used to get the phy date.
* \return the newly created context
*/
leon_timer_t *
-leon_timer_init (void *user_data, leon_timer_cb_t cb, phy_t *phy)
+leon_timer_init (void *user_data, leon_timer_cb_t cb)
{
volatile u32 *leon_timer_value = (u32 *) LEON_TIMER_VALUE;
volatile u32 *leon_timer_config = (u32 *) LEON_TIMER_CONFIG;
cyg_priority_t priority;
dbg_assert (cb);
- dbg_assert (phy);
- leon_timer_global.phy = phy;
leon_timer_global.status = LEON_TIMER_STATUS_STOP;
leon_timer_global.cb = cb;
leon_timer_global.user_data = user_data;
@@ -144,7 +141,7 @@ leon_timer_program (leon_timer_t *ctx, u32 date)
dbg_assert (ctx);
dbg_assert (ctx->status == LEON_TIMER_STATUS_STOP);
- leon_date = PHY_DATE_TO_LEON_DATE (date - phy_date (ctx->phy));
+ leon_date = PHY_DATE_TO_LEON_DATE (date - phy_date ());
if (!(leon_date & ~LEON_TIMER_REGISTER_MASK))
{
/** Reconfigure the timer. */
diff --git a/cesar/hal/leon/test/timer/src/target.c b/cesar/hal/leon/test/timer/src/target.c
index c7bb7a0434..d39916f7bd 100644
--- a/cesar/hal/leon/test/timer/src/target.c
+++ b/cesar/hal/leon/test/timer/src/target.c
@@ -45,17 +45,16 @@ void my_thread(cyg_addrword_t index)
test_t test;
uint test_timer;
leon_timer_t *leon_timer;
- uint phy;
u32 date = 0;
test_init_basic (test, 3);
test_case_begin (test, "Programming the Leon timer");
- leon_timer = leon_timer_init (&test_timer, my_callback, (phy_t*) &phy);
+ leon_timer = leon_timer_init (&test_timer, my_callback);
test_begin (test, "Timer programmed for 223 ms")
{
- date = phy_date ((phy_t *) &phy) + MAC_MS_TO_TCK (223);
+ date = phy_date () + MAC_MS_TO_TCK (223);
test_timer = false;
leon_timer_cancel (leon_timer);
leon_timer_program (leon_timer, date);
@@ -69,7 +68,7 @@ void my_thread(cyg_addrword_t index)
test_begin (test, "Timer programmed for 2400 ticks")
{
- date = phy_date ((phy_t *) &phy) + 2400;
+ date = phy_date () + 2400;
test_timer = false;
leon_timer_cancel (leon_timer);
leon_timer_program (leon_timer, date);
diff --git a/cesar/hal/leon/timer.h b/cesar/hal/leon/timer.h
index 012979b807..8c4578402f 100644
--- a/cesar/hal/leon/timer.h
+++ b/cesar/hal/leon/timer.h
@@ -14,8 +14,6 @@
*
*/
-#include "hal/phy/forward.h"
-
typedef void (*leon_timer_cb_t) (void *user_data);
/** forward declaration. */
@@ -25,11 +23,10 @@ typedef struct leon_timer_t leon_timer_t;
* Initialise Leon timer.
* \param user_data user data passed to the callback
* \param cb timer callback, called in ISR context
- * \param phy phy context used to get the phy date.
* \return the newly created context
*/
leon_timer_t *
-leon_timer_init (void *user_data, leon_timer_cb_t cb, phy_t *phy);
+leon_timer_init (void *user_data, leon_timer_cb_t cb);
/**
* Uninitialise the Leon timer.
diff --git a/cesar/hal/leon/unit-test/src/leon_timer.c b/cesar/hal/leon/unit-test/src/leon_timer.c
index 8b5ffb27db..b59251e6df 100644
--- a/cesar/hal/leon/unit-test/src/leon_timer.c
+++ b/cesar/hal/leon/unit-test/src/leon_timer.c
@@ -27,7 +27,6 @@ struct leon_timer_t
{
leon_timer_cb_t cb;
void *user_data;
- phy_t *phy;
uint delay;
uint status;
};
@@ -68,16 +67,13 @@ my_leon (cyg_addrword_t data)
* Initialise Leon timer.
* \param user_data user data passed to the callback
* \param cb timer callback, called in ISR context
- * \param phy phy context used to get the phy date
* \return the newly created context
*/
leon_timer_t *
-leon_timer_init (void *user_data, leon_timer_cb_t cb, phy_t *phy)
+leon_timer_init (void *user_data, leon_timer_cb_t cb)
{
dbg_assert (cb);
- dbg_assert (phy);
- leon_timer_global.phy = phy;
leon_timer_global.cb = cb;
leon_timer_global.user_data = user_data;
@@ -112,9 +108,9 @@ void
leon_timer_program (leon_timer_t *ctx, u32 sysdate)
{
dbg_assert (ctx);
- dbg_assert (sysdate > phy_date(ctx->phy));
+ dbg_assert (sysdate > phy_date ());
- ctx->delay = sysdate - phy_date (ctx->phy);
+ ctx->delay = sysdate - phy_date ();
ctx->status = true;
cyg_thread_resume (my_leon_handle);
}
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,
diff --git a/cesar/hal/timer/inc/context.h b/cesar/hal/timer/inc/context.h
index 211c86c596..a05b7b5c68 100644
--- a/cesar/hal/timer/inc/context.h
+++ b/cesar/hal/timer/inc/context.h
@@ -18,7 +18,6 @@
#include "lib/heap.h"
#include "hal/leon/timer.h"
-#include "hal/phy/phy.h"
struct hal_timer_t
{
@@ -28,8 +27,6 @@ struct hal_timer_t
leon_timer_t *leon_timer;
/** Heap to store order instances. */
heap_t heap;
- /** phy context. */
- phy_t *phy;
/** Current instance beeing process. */
hal_timer_instance_t *current_instance;
};
diff --git a/cesar/hal/timer/src/timer.c b/cesar/hal/timer/src/timer.c
index 7ba5f78c21..e97f9eb88f 100644
--- a/cesar/hal/timer/src/timer.c
+++ b/cesar/hal/timer/src/timer.c
@@ -14,6 +14,7 @@
#include "common/std.h"
#include "hal/timer/timer.h"
#include "hal/leon/timer.h"
+#include "hal/phy/phy.h"
#include "hal/timer/inc/context.h"
#include "hal/timer/inc/timer.h"
@@ -21,18 +22,14 @@
static hal_timer_t hal_timer_global;
hal_timer_t *
-hal_timer_init (phy_t *phy)
+hal_timer_init (void)
{
- dbg_assert (phy);
-
hal_timer_global.leon_timer = leon_timer_init (&hal_timer_global,
- (leon_timer_cb_t) hal_timer_instance_process,
- phy);
+ (leon_timer_cb_t) hal_timer_instance_process);
// initialise the heap.
heap_init (&hal_timer_global.heap, hal_timer_instance_lesser);
- hal_timer_global.phy = phy;
hal_timer_global.current_instance = NULL;
return &hal_timer_global;
@@ -77,7 +74,6 @@ hal_timer_instance_program (hal_timer_t *ctx,
{
dbg_assert (ctx);
dbg_assert (instance);
- dbg_assert (ctx->phy);
/* Lock the scheduler to avoid an access at the same time as the DSR. */
cyg_scheduler_lock ();
@@ -177,7 +173,7 @@ hal_timer_instance_process (hal_timer_t *ctx)
instance = PARENT_OF (hal_timer_instance_t, node, heap_get_root
(&ctx->heap));
- if (lesseq_mod2p32(instance->date, phy_date (ctx->phy)))
+ if (lesseq_mod2p32(instance->date, phy_date ()))
{
ctx->current_instance = NULL;
heap_remove (&ctx->heap, &instance->node);
diff --git a/cesar/hal/timer/stub/src/hal_timer.c b/cesar/hal/timer/stub/src/hal_timer.c
index 65c6471062..fd2782585d 100644
--- a/cesar/hal/timer/stub/src/hal_timer.c
+++ b/cesar/hal/timer/stub/src/hal_timer.c
@@ -16,14 +16,13 @@
/**
* Initialise software timer.
- * \param phy the phy context.
* \return the newly created context
*/
hal_timer_t *
-hal_timer_init (phy_t *phy) __attribute__((weak));
+hal_timer_init (void) __attribute__((weak));
hal_timer_t *
-hal_timer_init (phy_t *phy)
+hal_timer_init (void)
{
return INVALID_PTR;
}
diff --git a/cesar/hal/timer/test/src/leon_timer_stub.c b/cesar/hal/timer/test/src/leon_timer_stub.c
index b6d055bd7d..6649bb9b3a 100644
--- a/cesar/hal/timer/test/src/leon_timer_stub.c
+++ b/cesar/hal/timer/test/src/leon_timer_stub.c
@@ -14,7 +14,6 @@
*/
#include "common/std.h"
#include "hal/leon/timer.h"
-#include "hal/phy/phy.h"
#include <cyg/kernel/kapi.h>
#define LEON_PRIO 0
@@ -52,11 +51,10 @@ leon_entry_function(cyg_addrword_t data)
* Initialise Leon timer.
* \param user_data user data passed to the callback
* \param cb timer callback, called in ISR context
- * \param phy phy context used to get the phy date
* \return the newly created context
*/
leon_timer_t *
-leon_timer_init (void *user_data, leon_timer_cb_t cb, phy_t *phy)
+leon_timer_init (void *user_data, leon_timer_cb_t cb)
{
cyg_thread_create(LEON_PRIO, &leon_entry_function,
0, "Leon", leon_stack,
diff --git a/cesar/hal/timer/test/src/timer.c b/cesar/hal/timer/test/src/timer.c
index 922c2de44e..9dd24d5759 100644
--- a/cesar/hal/timer/test/src/timer.c
+++ b/cesar/hal/timer/test/src/timer.c
@@ -19,6 +19,7 @@
#include "hal/timer/timer.h"
#include "hal/timer/inc/context.h"
+#include "hal/phy/phy.h"
#include <cyg/kernel/kapi.h>
#include <cyg/infra/diag.h>
@@ -37,7 +38,6 @@ static uint count;
static test_t test;
static hal_timer_t *hal_timer;
-static phy_t *phy;
/* Thread 1. */
u8 thread1_stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
@@ -67,8 +67,7 @@ increment_val (void *date)
{
count ++;
- diag_printf ("[CB] phy date : %x, count %d\n",
- phy_date (phy), count);
+ diag_printf ("[CB] phy date : %x, count %d\n", phy_date (), count);
}
void
@@ -83,7 +82,7 @@ thread1_entry_function(cyg_addrword_t data)
for (i = 0; i < 20; i++)
{
hal_timer_instance_program (hal_timer, &t1_instance,
- phy_date (phy) + 200000);
+ phy_date () + 200000);
cyg_thread_delay (25);
diag_printf ("[Thread1] date : %x, phy : %x, count : %d\n", date,
(u32) cyg_current_time(), count);
@@ -103,12 +102,12 @@ thread2_entry_function(cyg_addrword_t data)
hal_timer_instance_init (hal_timer, &t2_instance, &date, &increment_val);
hal_timer_instance_program (hal_timer, &t2_instance,
- phy_date (phy) + 210000);
+ phy_date () + 210000);
for (i = 0; i < 20; i++)
{
hal_timer_instance_program (hal_timer, &t2_instance,
- phy_date (phy) + 210000);
+ phy_date () + 210000);
cyg_thread_delay (26);
diag_printf ("[Thread2] date : %x, phy : %x, count : %d\n", date,
(u32) cyg_current_time (), count);
@@ -133,7 +132,7 @@ instance_th3_cb (void *data)
hal_timer_instance_program (t3_data.hal_timer,
t3_data.instance,
- phy_date (phy) + 40000);
+ phy_date () + 40000);
diag_printf ("[Thread3] cb\n");
}
@@ -148,7 +147,7 @@ thread3_entry_function(cyg_addrword_t data)
hal_timer_instance_init (t3_data.hal_timer, &t3_instance, &t3_data, &instance_th3_cb);
hal_timer_instance_program (hal_timer, &t3_instance,
- phy_date (phy) + 40000);
+ phy_date () + 40000);
diag_printf ("[Thread 3] Timer armed\n");
cyg_thread_suspend (handle_thread3);
@@ -159,8 +158,7 @@ cyg_user_start (void)
{
test_init (test, 0, NULL);
- phy = (phy_t *) 123;
- hal_timer = hal_timer_init (phy);
+ hal_timer = hal_timer_init ();
cyg_thread_create(THREAD1_PRIO, &thread1_entry_function,
0, "Thread 1", thread1_stack,
@@ -188,7 +186,7 @@ cyg_user_start (void)
#ifndef __sparc__
u32
-phy_date (phy_t *phy_useless)
+phy_date (void)
{
return cyg_current_time ();
}
diff --git a/cesar/hal/timer/test/src/timer2.c b/cesar/hal/timer/test/src/timer2.c
index 9903bbd2a7..2ec27c9255 100644
--- a/cesar/hal/timer/test/src/timer2.c
+++ b/cesar/hal/timer/test/src/timer2.c
@@ -19,6 +19,7 @@
#include "hal/timer/timer.h"
#include "hal/timer/inc/context.h"
+#include "hal/phy/phy.h"
#include <cyg/kernel/kapi.h>
#include <cyg/infra/diag.h>
@@ -28,7 +29,6 @@
static test_t test;
static hal_timer_t *hal_timer;
-static phy_t *phy;
/* Thread 1. */
u8 thread1_stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
@@ -42,7 +42,7 @@ timer_cb (void *nothing)
diag_printf ("Reprogram timer for 30350 ticks.\n");
hal_timer_instance_program (hal_timer, &t1_instance,
- phy_date (phy) + 30350);
+ phy_date () + 30350);
}
void
@@ -51,7 +51,7 @@ thread1_entry_function(cyg_addrword_t data)
hal_timer_instance_init (hal_timer, &t1_instance, NULL, &timer_cb);
hal_timer_instance_program (hal_timer, &t1_instance,
- phy_date (phy) + 30250);
+ phy_date () + 30250);
diag_printf ("Current instance prgmed : %p\n",
hal_timer->current_instance);
@@ -73,8 +73,7 @@ cyg_user_start (void)
{
test_init (test, 0, NULL);
- phy = (phy_t *) 123;
- hal_timer = hal_timer_init (phy);
+ hal_timer = hal_timer_init ();
cyg_thread_create(THREAD_PRIO, &thread1_entry_function,
0, "Thread 1", thread1_stack,
@@ -88,7 +87,7 @@ cyg_user_start (void)
#ifndef __sparc__
u32
-phy_date (phy_t *phy_useless)
+phy_date (void)
{
return cyg_current_time ();
}
diff --git a/cesar/hal/timer/test/src/timer_date_past.c b/cesar/hal/timer/test/src/timer_date_past.c
index 6c494316c4..68045e5d72 100644
--- a/cesar/hal/timer/test/src/timer_date_past.c
+++ b/cesar/hal/timer/test/src/timer_date_past.c
@@ -18,6 +18,7 @@
#include "hal/timer/timer.h"
#include "hal/timer/inc/context.h"
+#include "hal/phy/phy.h"
#include <cyg/kernel/kapi.h>
#include <cyg/infra/diag.h>
@@ -27,7 +28,6 @@
static test_t test;
static hal_timer_t *hal_timer;
-static phy_t *phy;
/* Thread 1. */
u8 thread1_stack[CYGNUM_HAL_STACK_SIZE_TYPICAL];
@@ -47,7 +47,7 @@ thread1_entry_function(cyg_addrword_t data)
hal_timer_instance_init (hal_timer, &t1_instance, NULL, &timer_cb);
hal_timer_instance_program (hal_timer, &t1_instance,
- phy_date (phy) - 10);
+ phy_date () - 10);
diag_printf ("Current instance prgmed : %p\n",
hal_timer->current_instance);
@@ -69,10 +69,9 @@ cyg_user_start (void)
{
test_init (test, 0, NULL);
- phy = (phy_t *) 123;
- hal_timer = hal_timer_init (phy);
+ hal_timer = hal_timer_init ();
- diag_printf ("Current phy date : %x\n", phy_date ((phy_t*) &phy));
+ diag_printf ("Current phy date : %x\n", phy_date ());
cyg_thread_create(THREAD_PRIO, &thread1_entry_function,
0, "Thread 1", thread1_stack,
@@ -86,7 +85,7 @@ cyg_user_start (void)
#ifndef __sparc__
u32
-phy_date (phy_t *phy_useless)
+phy_date (void)
{
return cyg_current_time ();
}
diff --git a/cesar/hal/timer/timer.h b/cesar/hal/timer/timer.h
index eabb8aa775..750a18fe8e 100644
--- a/cesar/hal/timer/timer.h
+++ b/cesar/hal/timer/timer.h
@@ -14,7 +14,6 @@
*
* To use it, in the module context add a hal_timer_t variable.
*/
-#include "hal/phy/phy.h"
#include "lib/heap.h"
/** Call back declaration. */
@@ -49,11 +48,10 @@ typedef struct hal_timer_instance_t hal_timer_instance_t;
/**
* Initialise software timer.
- * \param phy the phy context.
* \return the newly created context
*/
hal_timer_t *
-hal_timer_init (phy_t *phy);
+hal_timer_init (void);
/**
* Uninitialise the software timer.
diff --git a/cesar/hle/test/src/hle_recv_from_arm.c b/cesar/hle/test/src/hle_recv_from_arm.c
index cc6d5a49cc..fe93d95f21 100644
--- a/cesar/hle/test/src/hle_recv_from_arm.c
+++ b/cesar/hle/test/src/hle_recv_from_arm.c
@@ -309,13 +309,12 @@ test_case__hle_recv_interface_msg_type (test_t test)
int main (void)
{
- uint phy = 0;
uint mac_config = 0;
test_t test;
test_init (test, 0, NULL);
- mac_ntb_init ((phy_t *) &phy, (mac_config_t *) &mac_config);
+ mac_ntb_init ((mac_config_t *) &mac_config);
test_case__hle_recv_data_send_to_cl (test);
test_case__hle_recv_buffer (test);
diff --git a/cesar/hle/test/src/hle_send_to_arm.c b/cesar/hle/test/src/hle_send_to_arm.c
index 45eb87fc24..4daa0732c8 100644
--- a/cesar/hle/test/src/hle_send_to_arm.c
+++ b/cesar/hle/test/src/hle_send_to_arm.c
@@ -47,11 +47,10 @@ int main (void)
{
hle_t *hle;
uint cl;
- uint phy;
mac_config_t mac_config;
test_init(test, 0, NULL);
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
trace_init ();
test_case_begin (test, "Send to cleopatre");
@@ -82,12 +81,6 @@ int main (void)
return test_nb_failed (test) == 0 ? 0 : 1;
}
-u32
-phy_date (phy_t *phy)
-{
- return 0;
-}
-
ipmbox_t *ipmbox_init (void *user_data, ipmbox_rx_cb_t rx_cb)
{
return user_data;
diff --git a/cesar/hle/test/src/interface-send.c b/cesar/hle/test/src/interface-send.c
index f54c0987c2..581ae4a2b7 100644
--- a/cesar/hle/test/src/interface-send.c
+++ b/cesar/hle/test/src/interface-send.c
@@ -66,7 +66,6 @@ int main (void)
{
hle_t *hle;
cl_t *cl;
- uint phy;
mac_config_t mac_config;
uint word [3];
@@ -75,7 +74,7 @@ int main (void)
cl = blk_alloc ();
hle = hle_init (cl);
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
test_ipmbox_activate = false;
@@ -100,8 +99,3 @@ int main (void)
return test_nb_failed (test) == 0 ? 0 : 1;
}
-u32
-phy_date (phy_t *phy)
-{
- return 0;
-}
diff --git a/cesar/lib/test/trace/src/trace_perf.c b/cesar/lib/test/trace/src/trace_perf.c
index b995a33263..bef5815085 100644
--- a/cesar/lib/test/trace/src/trace_perf.c
+++ b/cesar/lib/test/trace/src/trace_perf.c
@@ -25,27 +25,27 @@ main (void)
trace_buffer_t trace_buf;
u32 start, stop;
int i;
- phy_t *phy = phy_init (NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ phy_init (NULL, NULL, NULL, NULL, NULL, NULL, NULL);
trace_init ();
/* Fast trace, print0. */
trace_buffer_add (&trace_buf, "fast", 2, 4, true, NULL);
- start = phy_sysdate (phy);
+ start = phy_sysdate ();
for (i = 0; i < NB_ITER; i++)
trace_fast_print0 (&trace_buf, 0);
- stop = phy_sysdate (phy);
+ stop = phy_sysdate ();
printf ("fast, print0: %d/%d\n", stop - start, NB_ITER);
trace_buffer_remove (&trace_buf);
/* Fast trace, print8. */
trace_buffer_add (&trace_buf, "fast", 2, 4, true, NULL);
- start = phy_sysdate (phy);
+ start = phy_sysdate ();
for (i = 0; i < NB_ITER; i++)
trace_fast_print8 (&trace_buf, 0, 1, 2, 3, 4, 5, 6, 7, 8);
- stop = phy_sysdate (phy);
+ stop = phy_sysdate ();
printf ("fast, print8: %d/%d\n", stop - start, NB_ITER);
trace_buffer_remove (&trace_buf);
/* Fast trace, printn. */
trace_buffer_add (&trace_buf, "fast", 2, 4, true, NULL);
- start = phy_sysdate (phy);
+ start = phy_sysdate ();
for (i = 0; i < NB_ITER; i++)
{
trace_fast_print0 (&trace_buf, 0);
@@ -58,28 +58,28 @@ main (void)
trace_fast_print7 (&trace_buf, 0, 1, 2, 3, 4, 5, 6, 7);
trace_fast_print8 (&trace_buf, 0, 1, 2, 3, 4, 5, 6, 7, 8);
}
- stop = phy_sysdate (phy);
+ stop = phy_sysdate ();
printf ("fast, printn: %d/%d\n", stop - start, NB_ITER);
trace_buffer_remove (&trace_buf);
/* Trace, print0. */
trace_buffer_add (&trace_buf, "slow", 2, 1, false, NULL);
- start = phy_sysdate (phy);
+ start = phy_sysdate ();
for (i = 0; i < NB_ITER; i++)
trace_print0 (&trace_buf, 0);
- stop = phy_sysdate (phy);
+ stop = phy_sysdate ();
printf ("print0: %d/%d\n", stop - start, NB_ITER);
trace_buffer_remove (&trace_buf);
/* Trace, print8. */
trace_buffer_add (&trace_buf, "slow", 2, 1, false, NULL);
- start = phy_sysdate (phy);
+ start = phy_sysdate ();
for (i = 0; i < NB_ITER; i++)
trace_print8 (&trace_buf, 0, 1, 2, 3, 4, 5, 6, 7, 8);
- stop = phy_sysdate (phy);
+ stop = phy_sysdate ();
printf ("print8: %d/%d\n", stop - start, NB_ITER);
trace_buffer_remove (&trace_buf);
/* Trace, printn. */
trace_buffer_add (&trace_buf, "slow", 2, 1, false, NULL);
- start = phy_sysdate (phy);
+ start = phy_sysdate ();
for (i = 0; i < NB_ITER; i++)
{
trace_print0 (&trace_buf, 0);
@@ -92,7 +92,7 @@ main (void)
trace_print7 (&trace_buf, 0, 1, 2, 3, 4, 5, 6, 7);
trace_print8 (&trace_buf, 0, 1, 2, 3, 4, 5, 6, 7, 8);
}
- stop = phy_sysdate (phy);
+ stop = phy_sysdate ();
printf ("printn: %d/%d\n", stop - start, NB_ITER);
trace_buffer_remove (&trace_buf);
/* Bye. */
diff --git a/cesar/mac/ca/src/access.c b/cesar/mac/ca/src/access.c
index 07c22b6a4d..a813543cc9 100644
--- a/cesar/mac/ca/src/access.c
+++ b/cesar/mac/ca/src/access.c
@@ -28,7 +28,7 @@ const ca_alloc_param_t *
ca_access_activate (ca_t *ctx, u32 date, uint anticipation_tck)
{
dbg_assert (ctx && ctx->state == CA_STATE_IDLE);
- CA_TRACE (ACCESS_ACTIVATE, phy_date (ctx->phy), date);
+ CA_TRACE (ACCESS_ACTIVATE, phy_date (), date);
/* Change to ACTIVATED state. */
ctx->state = CA_STATE_ACTIVATED;
/* Find current allocation. */
@@ -55,7 +55,7 @@ void
ca_access_deactivate (ca_t *ctx)
{
dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
- CA_TRACE (ACCESS_DEACTIVATE, phy_date (ctx->phy));
+ CA_TRACE (ACCESS_DEACTIVATE, phy_date ());
/* Cancel programmed timer. */
phy_access_timer_cancel (ctx->phy);
/* Release reference to old MFS. */
@@ -72,7 +72,7 @@ void ARCH_ILRAM
ca_access_hold (ca_t *ctx)
{
dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
- CA_TRACE (ACCESS_HOLD, phy_date (ctx->phy));
+ CA_TRACE (ACCESS_HOLD, phy_date ());
/* Change to HOLD state. */
ctx->state = CA_STATE_HOLD;
/* Cancel programmed timer. */
@@ -144,7 +144,7 @@ ca_access_compute (ca_t *ctx, u32 start_date, uint length_tck,
u32 allocation_end_date;
uint glid;
dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
- CA_TRACE (ACCESS_VCS_RESTART, phy_date (ctx->phy), start_date, length_tck,
+ CA_TRACE (ACCESS_VCS_RESTART, phy_date (), start_date, length_tck,
anticipation_tck, eifs, update);
/* Release reference to old MFS. */
if (ctx->access_param.mfs)
@@ -210,7 +210,7 @@ ca_access_compute (ca_t *ctx, u32 start_date, uint length_tck,
ca_access_goto_aifs (ctx);
}
/* Make sure date is in the future. */
- u32 update_date = phy_date (ctx->phy);
+ u32 update_date = phy_date ();
if (update
&& ctx->access_param.mfs
&& less_mod2p32 (ctx->access_param.access_date - anticipation_tck,
@@ -314,7 +314,7 @@ void ARCH_ILRAM
ca_access_program (ca_t *ctx, u32 date, uint anticipation_tck)
{
dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
- CA_TRACE (ACCESS_PROGRAM, phy_date (ctx->phy), date, anticipation_tck);
+ CA_TRACE (ACCESS_PROGRAM, phy_date (), date, anticipation_tck);
/* Release reference to old MFS. */
if (ctx->access_param.mfs)
{
@@ -332,7 +332,7 @@ void
ca_access_grant (ca_t *ctx, mfs_tx_t *mfs, u32 date, uint duration_tck)
{
dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
- CA_TRACE (ACCESS_GRANT, phy_date (ctx->phy), mfs, date, duration_tck);
+ CA_TRACE (ACCESS_GRANT, phy_date (), mfs, date, duration_tck);
/* Release reference to old MFS. */
if (ctx->access_param.mfs)
{
@@ -366,7 +366,7 @@ void
ca_access_defer (ca_t *ctx, u32 date, uint anticipation_tck)
{
dbg_assert (ctx && ctx->state != CA_STATE_IDLE);
- CA_TRACE (ACCESS_DEFER, phy_date (ctx->phy), date, anticipation_tck);
+ CA_TRACE (ACCESS_DEFER, phy_date (), date, anticipation_tck);
/* Release reference to old MFS. */
if (ctx->access_param.mfs)
{
@@ -390,7 +390,7 @@ ca_access_aifs (ca_t *ctx)
dbg_claim (ctx && ctx->state != CA_STATE_IDLE);
dbg_assert (ctx->current_beacon_period != ctx->beacon_periods_tail);
dbg_claim (ctx->access_param.mfs == NULL);
- CA_TRACE (ACCESS_AIFS, phy_date (ctx->phy));
+ CA_TRACE (ACCESS_AIFS, phy_date ());
/* Go on with the next allocation, first get current one. */
uint bp_i = ctx->current_beacon_period;
ca_beacon_period_t *bp = &ctx->beacon_periods[bp_i];
@@ -434,7 +434,7 @@ void
ca_access_update (ca_t *ctx)
{
dbg_assert (ctx);
- u32 date = phy_date (ctx->phy);
+ u32 date = phy_date ();
if (ctx->state >= CA_STATE_ACTIVATED
/* Is there time to reprogram? */
&& less_mod2p32 (date, ctx->access_param.access_date
diff --git a/cesar/mac/ca/src/alloc.c b/cesar/mac/ca/src/alloc.c
index cc6f9ff4d1..368db7c9ce 100644
--- a/cesar/mac/ca/src/alloc.c
+++ b/cesar/mac/ca/src/alloc.c
@@ -127,7 +127,7 @@ ca_alloc_update_beacon_periods (ca_t *ctx,
dbg_assert (beacon_periods);
dbg_assert (beacon_periods_nb > 0
&& beacon_periods_nb < CA_BEACON_PERIOD_NB - 1);
- CA_TRACE (ALLOC_UPDATE_BEACON_PERIODS, phy_date (ctx->phy));
+ CA_TRACE (ALLOC_UPDATE_BEACON_PERIODS, phy_date ());
/* Eliminate expired beacon period from context. */
for (i = ctx->beacon_periods_head;
i != ctx->beacon_periods_tail
@@ -139,7 +139,7 @@ ca_alloc_update_beacon_periods (ca_t *ctx,
current_at_tail = ctx->current_beacon_period == ctx->beacon_periods_tail;
/* First beacon period provided should be the current one (actually, it
* might be the second one...). */
- now = phy_date (ctx->phy);
+ now = phy_date ();
dbg_assert (lesseq_mod2p32 (beacon_periods[0].start_date, now)
&& (beacon_periods_nb < 2
|| less_mod2p32 (now, beacon_periods[1].start_date)));
diff --git a/cesar/mac/ca/test/ca/src/phy_stub.c b/cesar/mac/ca/test/ca/src/phy_stub.c
index 376c762c37..fe279800b0 100644
--- a/cesar/mac/ca/test/ca/src/phy_stub.c
+++ b/cesar/mac/ca/test/ca/src/phy_stub.c
@@ -65,10 +65,9 @@ phy_access_timer_cancel (phy_t *ctx)
}
u32
-phy_date (phy_t *ctx)
+phy_date (void)
{
- dbg_assert (ctx);
- return ctx->date;
+ return global_phy.date;
}
void
diff --git a/cesar/mac/ca/test/fcall/src/beacon_period.c b/cesar/mac/ca/test/fcall/src/beacon_period.c
index 226a3419a3..55a58a1460 100644
--- a/cesar/mac/ca/test/fcall/src/beacon_period.c
+++ b/cesar/mac/ca/test/fcall/src/beacon_period.c
@@ -12,6 +12,7 @@
*/
#include "common/std.h"
+#include "hal/phy/phy.h"
#include "host/fcall/fcall.h"
#include "mac/common/timings.h"
@@ -174,7 +175,7 @@ ca_test_fcall_set_beacon_period (ca_test_fcall_beacon_period_t *ctx,
if (ctx->beacon_periods_nb == 0)
{
/* Start now, or synchronise. */
- u32 start_date = phy_date (ctx->phy);
+ u32 start_date = phy_date ();
if (CONFIG_GPIO_CA_FCALL_BEACON_PERIOD_SYNC && sync)
{
u32 ref_date = phy_clock_get_zero_cross_captured_date (ctx->phy);
diff --git a/cesar/mac/common/ntb.h b/cesar/mac/common/ntb.h
index f713d54cfc..2a0c8ae599 100644
--- a/cesar/mac/common/ntb.h
+++ b/cesar/mac/common/ntb.h
@@ -14,7 +14,6 @@
*
*/
-#include "hal/phy/forward.h"
#include "mac/common/config.h"
/** Convert a NTB date to a Date. */
@@ -22,8 +21,6 @@
struct mac_ntb_t
{
- /** Phy context. */
- phy_t *phy;
/** mac config context. */
mac_config_t *mac_config;
};
@@ -34,11 +31,10 @@ extern mac_ntb_t ntb_global;
/**
* Initialize the ntb context.
*
- * \param phy the phy context.
* \param mac_config the mac config context.
*/
void
-mac_ntb_init (phy_t *phy, mac_config_t *mac_config);
+mac_ntb_init (mac_config_t *mac_config);
/**
* Uninitialize the ntb context.
diff --git a/cesar/mac/common/src/ntb.c b/cesar/mac/common/src/ntb.c
index 30d2429c3b..81c7a1b956 100644
--- a/cesar/mac/common/src/ntb.c
+++ b/cesar/mac/common/src/ntb.c
@@ -18,23 +18,20 @@
#include "mac/common/ntb.h"
u32
-phy_date (phy_t *ctx) __attribute__((weak));
+phy_date (void) __attribute__((weak));
mac_ntb_t ntb_global;
/**
* Initialize the ntb context.
*
- * \param phy the phy context.
* \param mac_config the mac config context.
*/
void
-mac_ntb_init (phy_t *phy, mac_config_t *mac_config)
+mac_ntb_init (mac_config_t *mac_config)
{
- dbg_assert(phy);
dbg_assert(mac_config);
- ntb_global.phy = phy;
ntb_global.mac_config = mac_config;
}
@@ -55,10 +52,9 @@ mac_ntb_uninit (void)
u32
mac_ntb (void)
{
- dbg_assert (ntb_global.phy);
dbg_assert (ntb_global.mac_config);
- return phy_date (ntb_global.phy) + ntb_global.mac_config->ntb_offset_tck;
+ return phy_date () + ntb_global.mac_config->ntb_offset_tck;
}
/**
@@ -69,23 +65,20 @@ mac_ntb (void)
u32
mac_date (void)
{
- dbg_assert (ntb_global.phy);
dbg_assert (ntb_global.mac_config);
- return phy_date (ntb_global.phy);
+ return phy_date ();
}
/**
* Create a phy_date weak function to do not have to include the phy on test
* when it is not necessary.
*
- * \param phy the phy context.
* \return the phy date.
*/
u32
-phy_date (phy_t *phy)
+phy_date (void)
{
return 42;
}
-
diff --git a/cesar/mac/common/test/ntb/src/test_ntb.c b/cesar/mac/common/test/ntb/src/test_ntb.c
index eb7e6570de..305b1ef145 100644
--- a/cesar/mac/common/test/ntb/src/test_ntb.c
+++ b/cesar/mac/common/test/ntb/src/test_ntb.c
@@ -14,24 +14,19 @@
#include "common/std.h"
#include "lib/test.h"
-#include "lib/blk.h"
#include "mac/common/ntb.h"
#include "mac/common/config.h"
-#include "hal/phy/phy.h"
int main (void)
{
test_t test;
-
+
mac_config_t mac_config;
- phy_t *phy;
test_init(test, 0, NULL);
- phy = blk_alloc();
-
- mac_ntb_init(phy, &mac_config);
+ mac_ntb_init(&mac_config);
mac_config.ntb_offset_tck = 10;
test_begin(test, "test ntb")
@@ -41,15 +36,13 @@ int main (void)
test_end;
mac_ntb_uninit();
- blk_release(phy);
test_result (test);
return test_nb_failed (test) == 0 ? 0 : 1;
}
u32
-phy_date (phy_t *phy)
+phy_date (void)
{
- dbg_assert(phy);
return 52;
}
diff --git a/cesar/mac/common/test/ntb/src/test_ntb_phy_unstub.c b/cesar/mac/common/test/ntb/src/test_ntb_phy_unstub.c
index 2fbc005081..de06d6f617 100644
--- a/cesar/mac/common/test/ntb/src/test_ntb_phy_unstub.c
+++ b/cesar/mac/common/test/ntb/src/test_ntb_phy_unstub.c
@@ -14,7 +14,6 @@
#include "common/std.h"
#include "lib/test.h"
-#include "lib/blk.h"
#include "mac/common/ntb.h"
#include "mac/common/config.h"
@@ -24,13 +23,10 @@ int main (void)
test_t test;
mac_config_t mac_config;
- phy_t *phy;
test_init(test, 0, NULL);
- phy = blk_alloc();
-
- mac_ntb_init (phy, &mac_config);
+ mac_ntb_init (&mac_config);
mac_config.ntb_offset_tck = 10;
test_begin(test, "test ntb")
@@ -40,7 +36,6 @@ int main (void)
test_end;
mac_ntb_uninit();
- blk_release (phy);
test_result (test);
return test_nb_failed (test) == 0 ? 0 : 1;
}
diff --git a/cesar/mac/pbproc/src/fsm.c b/cesar/mac/pbproc/src/fsm.c
index 86ab869309..cfec7fab2a 100644
--- a/cesar/mac/pbproc/src/fsm.c
+++ b/cesar/mac/pbproc/src/fsm.c
@@ -43,7 +43,7 @@ pbproc_fsm_handle_rx_fc_event (pbproc_t *ctx, u32 rx_date, const u32 *fc_av)
{
dbg_claim (ctx);
dbg_claim (ctx->fsm.current_state < PBPROC_FSM_STATE_NB);
- PBPROC_TRACE (FSM_RX_FC, phy_date (ctx->phy), rx_date,
+ PBPROC_TRACE (FSM_RX_FC, phy_date (), rx_date,
fc_av ? fc_av[0] : (u32) -1, fc_av ? fc_av[1] : (u32) -1,
fc_av ? fc_av[2] : (u32) -1, fc_av ? fc_av[3] : (u32) -1);
ctx->fsm.states[ctx->fsm.current_state].
@@ -62,7 +62,7 @@ pbproc_fsm_handle_access_event (pbproc_t *ctx)
{
dbg_claim (ctx);
dbg_claim (ctx->fsm.current_state < PBPROC_FSM_STATE_NB);
- PBPROC_TRACE (FSM_ACCESS, phy_date (ctx->phy));
+ PBPROC_TRACE (FSM_ACCESS, phy_date ());
ctx->fsm.states[ctx->fsm.current_state].access_cb (ctx);
if (ctx->fsm.schedule_deferred)
{
@@ -78,7 +78,7 @@ pbproc_fsm_handle_access_conf_event (pbproc_t *ctx)
{
dbg_claim (ctx);
dbg_claim (ctx->fsm.current_state < PBPROC_FSM_STATE_NB);
- PBPROC_TRACE (FSM_ACCESS_CONF, phy_date (ctx->phy));
+ PBPROC_TRACE (FSM_ACCESS_CONF, phy_date ());
ctx->fsm.states[ctx->fsm.current_state].access_conf_cb (ctx);
if (ctx->fsm.schedule_deferred)
{
@@ -94,7 +94,7 @@ pbproc_fsm_handle_pbdma_event (pbproc_t *ctx, u32 status_word)
{
dbg_claim (ctx);
dbg_claim (ctx->fsm.current_state < PBPROC_FSM_STATE_NB);
- PBPROC_TRACE (FSM_PBDMA, phy_date (ctx->phy), status_word);
+ PBPROC_TRACE (FSM_PBDMA, phy_date (), status_word);
ctx->pbdma_status = PHY_PBDMA_STATUS (status_word);
ctx->fsm.states[ctx->fsm.current_state].pbdma_cb (ctx);
if (ctx->fsm.schedule_deferred)
@@ -118,7 +118,7 @@ pbproc_fsm_handle_deferred (pbproc_t *ctx)
{
dbg_claim (ctx);
dbg_claim (ctx->fsm.deferred_cb);
- PBPROC_TRACE (FSM_DEFERRED, phy_date (ctx->phy));
+ PBPROC_TRACE (FSM_DEFERRED, phy_date ());
/* Call deferred callback. */
ctx->fsm.deferred_cb (ctx);
/* Signal idle task waiter. */
diff --git a/cesar/mac/pbproc/src/fsm_top.c b/cesar/mac/pbproc/src/fsm_top.c
index aa9281e68e..1a26d1be23 100644
--- a/cesar/mac/pbproc/src/fsm_top.c
+++ b/cesar/mac/pbproc/src/fsm_top.c
@@ -87,9 +87,8 @@ pbproc_ftop__idle__access (pbproc_t *ctx)
* delimiter is received, we should infer a collision. Do not
* use our backoff, the backoff procedure is not entered. */
ca_backoff_cancel (ctx->ca);
- ca_access_vcs_restart (ctx->ca, phy_date (ctx->phy),
- ctx->times.eifs_tck, PBPROC_ANTICIP_TCK,
- true);
+ ca_access_vcs_restart (ctx->ca, phy_date (), ctx->times.eifs_tck,
+ PBPROC_ANTICIP_TCK, true);
ctx->stats.prp_lost++;
dbg_claim (ctx->fsm.current_state == PBPROC_FSM_STATE_IDLE);
}
diff --git a/cesar/mac/pbproc/src/pbproc.c b/cesar/mac/pbproc/src/pbproc.c
index 41df3525c6..41666612c4 100644
--- a/cesar/mac/pbproc/src/pbproc.c
+++ b/cesar/mac/pbproc/src/pbproc.c
@@ -55,7 +55,7 @@ pbproc_deferred (pbproc_t *ctx)
/* Release PB. */
blk_release_desc_range (&head->blk, &tail->blk);
}
- current_date = phy_date (ctx->phy);
+ current_date = phy_date ();
budget_date = current_date + PBPROC_BUDGET_RX_BEACON_TCK;
while (!slist_empty (ctx->commit.rx_beacon_)
&& less_mod2p32 (current_date, budget_date))
@@ -71,7 +71,7 @@ pbproc_deferred (pbproc_t *ctx)
dbg_claim (ctx->rx_beacon_cb);
ctx->rx_beacon_cb (ctx->user_data, rx_beacon, params);
/* Watch watch. */
- current_date = phy_date (ctx->phy);
+ current_date = phy_date ();
}
budget_date = current_date + PBPROC_BUDGET_RX_TCK;
while (!slist_empty (ctx->commit.rx_)
@@ -86,7 +86,7 @@ pbproc_deferred (pbproc_t *ctx)
dbg_claim (ctx->rx_cb);
ctx->rx_cb (ctx->user_data, rx_desc);
/* Watch watch. */
- current_date = phy_date (ctx->phy);
+ current_date = phy_date ();
}
if (!slist_empty (ctx->commit.rx_beacon_)
|| !slist_empty (ctx->commit.rx_))
@@ -245,7 +245,7 @@ pbproc_deactivate_idle_task (pbproc_t *ctx)
void
pbproc_activate (pbproc_t *ctx, bool flag)
{
- PBPROC_TRACE (ACTIVATE, phy_date (ctx->phy), flag);
+ PBPROC_TRACE (ACTIVATE, phy_date (), flag);
ctx->activated = flag;
if (flag)
{
@@ -255,7 +255,7 @@ pbproc_activate (pbproc_t *ctx, bool flag)
ARCH_CPU_TO_DMA (ctx->config->tonemask_info.tonemask),
ctx->config->tonemask_info.carrier_nb);
/* Activate. */
- ctx->alloc = *ca_access_activate (ctx->ca, phy_date (ctx->phy),
+ ctx->alloc = *ca_access_activate (ctx->ca, phy_date (),
PBPROC_ANTICIP_TCK);
ctx->times = ctx->times_array[ctx->alloc.hybrid];
phy_rx_param (ctx->phy, PHY_FC_MODE (ctx->alloc.hybrid,
diff --git a/cesar/mac/pbproc/test/int/src/test_pbproc.c b/cesar/mac/pbproc/test/int/src/test_pbproc.c
index e605bc433e..fdd554869f 100644
--- a/cesar/mac/pbproc/test/int/src/test_pbproc.c
+++ b/cesar/mac/pbproc/test/int/src/test_pbproc.c
@@ -385,7 +385,7 @@ test_pbproc_init_pbproc (test_pbproc_t *ctx)
pbproc_init_cb (ctx->pbproc, ctx, test_pbproc_rx_cb,
test_pbproc_rx_beacon_cb);
ctx->ca = pbproc_get_ca (ctx->pbproc);
- ctx->timer = hal_timer_init (ctx->pbproc->phy);
+ ctx->timer = hal_timer_init ();
ctx->beacon_period.phy = ctx->pbproc->phy;
ctx->beacon_period.ca = ctx->ca;
ctx->beacon_period.timer = ctx->timer;
@@ -452,7 +452,7 @@ cyg_user_start (void)
test_pbproc_global.config.ntb_offset_tck = 0;
test_pbproc_global.config.sta_mac_address = SPC_OUI;
# if CONFIG_TRACE
- mac_ntb_init (INVALID_PTR, &test_pbproc_global.config);
+ mac_ntb_init (&test_pbproc_global.config);
# endif
hle_t *hle = hle_init (INVALID_PTR);
interface_t *interface = interface_init (hle, INVALID_PTR, INVALID_PTR,
diff --git a/cesar/mac/pbproc/test/pbproc/src/phy.c b/cesar/mac/pbproc/test/pbproc/src/phy.c
index 412da160e5..35be3b57c3 100644
--- a/cesar/mac/pbproc/test/pbproc/src/phy.c
+++ b/cesar/mac/pbproc/test/pbproc/src/phy.c
@@ -19,14 +19,15 @@
#include "lib/scenario/scenario.h"
+static phy_t phy_global;
+
phy_t *
phy_init (void *user_data, phy_rx_fc_cb_t rx_fc_cb, phy_access_cb_t access_cb,
phy_access_conf_cb_t access_conf_cb, phy_pbdma_cb_t pbdma_cb,
phy_tx_false_alarm_cb_t tx_false_alarm_cb,
phy_deferred_cb_t deferred_cb)
{
- static phy_t phy_ctx;
- phy_t *ctx = &phy_ctx;
+ phy_t *ctx = &phy_global;
ctx->current_date = 0;
ctx->user_data = user_data;
ctx->rx_fc_cb = rx_fc_cb;
@@ -61,10 +62,9 @@ phy_deferred_schedule (phy_t *ctx)
}
u32
-phy_date (phy_t *ctx)
+phy_date (void)
{
- dbg_assert (ctx);
- return ctx->current_date;
+ return phy_global.current_date;
}
void
diff --git a/cesar/mac/sar/test/functional/src/sar_rx.c b/cesar/mac/sar/test/functional/src/sar_rx.c
index 455c98bc41..be357930f5 100644
--- a/cesar/mac/sar/test/functional/src/sar_rx.c
+++ b/cesar/mac/sar/test/functional/src/sar_rx.c
@@ -221,7 +221,6 @@ test_thread_process (cyg_addrword_t data)
test_t test;
mac_config_t mac_config;
uint ca;
- uint phy;
uint pbproc;
mac_store_t *mac_store;
u8 *buffer;
@@ -232,7 +231,7 @@ test_thread_process (cyg_addrword_t data)
lib_stats_init ();
/* Initialise the test. */
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
mac_store = mac_store_init ();
sar_ctx = sar_init (mac_store, (pbproc_t *) &pbproc, (ca_t *) &ca, 0x1);
sar_activate (sar_ctx, true);
diff --git a/cesar/mac/sar/test/functional/src/sar_tx.c b/cesar/mac/sar/test/functional/src/sar_tx.c
index 220b9a013c..d2c92dd35d 100644
--- a/cesar/mac/sar/test/functional/src/sar_tx.c
+++ b/cesar/mac/sar/test/functional/src/sar_tx.c
@@ -191,7 +191,6 @@ test_thread_process (cyg_addrword_t data)
test_t test;
mac_config_t mac_config;
uint ca;
- uint phy;
uint pbproc;
test_init (test, 0, NULL);
@@ -199,7 +198,7 @@ test_thread_process (cyg_addrword_t data)
lib_stats_init ();
/* Initialise the test. */
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
mac_store = mac_store_init ();
sar_ctx = sar_init (mac_store, (pbproc_t *) &pbproc, (ca_t *) &ca, 0x1);
sar_activate (sar_ctx, true);
diff --git a/cesar/mac/sar/test/functional/src/test_functions.c b/cesar/mac/sar/test/functional/src/test_functions.c
index 86acf36f2b..3f9d024e95 100644
--- a/cesar/mac/sar/test/functional/src/test_functions.c
+++ b/cesar/mac/sar/test/functional/src/test_functions.c
@@ -98,7 +98,7 @@ sar_test_init (sar_test_ctx_t *test_ctx)
dbg_assert (test_ctx);
/* Initialise the mac NTB. */
- mac_ntb_init (INVALID_PTR, &test_ctx->mac_config);
+ mac_ntb_init (&test_ctx->mac_config);
/* Initialise the store. */
test_ctx->mac_store = mac_store_init ();
diff --git a/cesar/mac/sar/test/unit_test/ecos/src/msdu_timeout.c b/cesar/mac/sar/test/unit_test/ecos/src/msdu_timeout.c
index 709747177f..e5e004f113 100644
--- a/cesar/mac/sar/test/unit_test/ecos/src/msdu_timeout.c
+++ b/cesar/mac/sar/test/unit_test/ecos/src/msdu_timeout.c
@@ -28,12 +28,10 @@ test_case__sar_msdu_expiration (test_t test)
mac_config_t mac_config;
sar_msdu_t msdu;
mfs_tx_t mfs;
- uint phy;
test_case_begin (test, "MSDU expiration");
- phy = 0;
mac_config.ntb_offset_tck = 0;
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
test_begin (test, "MME Expiration")
{
diff --git a/cesar/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c b/cesar/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c
index 1ee427937b..822c1aedf7 100644
--- a/cesar/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c
+++ b/cesar/mac/sar/test/unit_test/ecos/src/reassembly_two_jobs.c
@@ -23,7 +23,6 @@
#include "mac/sar/sar.h"
-#include "hal/phy/phy.h"
#include "mac/common/config.h"
#include "mac/common/ntb.h"
#include "lib/test.h"
@@ -52,7 +51,6 @@ int main (void)
{
sar_t *sar_ctx = NULL;
mac_store_t *mac_store = NULL;
- uint phy = 0;
test_t test;
pbproc_rx_desc_t *rx_desc;
@@ -72,7 +70,7 @@ int main (void)
memset (&mac_config, 0, sizeof (mac_config_t));
ce_rx_init (INVALID_PTR, INVALID_PTR, INVALID_PTR, INVALID_PTR);
- mac_ntb_init ((phy_t *) &phy, &mac_config);
+ mac_ntb_init (&mac_config);
mac_store = mac_store_init();
lib_stats_init ();
sar_ctx = sar_init (mac_store, INVALID_PTR, INVALID_PTR, 0x1);
diff --git a/cesar/mac/sar/test/unit_test/ecos/src/sar_manage_expiration.c b/cesar/mac/sar/test/unit_test/ecos/src/sar_manage_expiration.c
index 7594db145e..d52f7ef70f 100644
--- a/cesar/mac/sar/test/unit_test/ecos/src/sar_manage_expiration.c
+++ b/cesar/mac/sar/test/unit_test/ecos/src/sar_manage_expiration.c
@@ -44,7 +44,7 @@ bool seg_done;
sar_t *sar_ctx;
mac_store_t *mac_store;
mac_config_t mac_config;
-uint phy;
+u32 phy_date_current;
void
sar_segmentation_done (void *user, u8* buffer)
@@ -186,16 +186,12 @@ void mfs_rx_expired_on_request (void);
/**
* Test the expiration of an msdu.
* The buffer shall be give back to the buffer list.
- *
- * \param phy use to update the date for the expiration.
*/
void
-msdu_expiration_test (phy_t *phy);
+msdu_expiration_test (void);
/**
* Test the expiration process with a PB which will expire before the mfs.
- *
- * \param phy
*/
void
pb_tx_expire (void);
@@ -209,9 +205,9 @@ test_expiration_test_init (void)
mac_config.ntb_offset_tck = 0;
// init the sar and the store
mac_store = mac_store_init ();
- phy = -1;
+ phy_date_current = -1;
- mac_ntb_init ((phy_t*) &phy, mac_config);
+ mac_ntb_init (mac_config);
lib_stats_init ();
sar_ctx = sar_init (mac_store, INVALID_PTR, INVALID_PTR, 0x1);
sar_init_mme_context (sar_ctx, &sar_ctx);
@@ -298,7 +294,7 @@ int cyg_user_start (void)
test_expiration_fourth_test ();
// test the msdu expiration.
- msdu_expiration_test (phy);
+ msdu_expiration_test ();
// test a PB expiration
pb_tx_expire ();
@@ -683,7 +679,7 @@ void mfs_rx_expired_on_request (void)
* The buffer shall be give back to the buffer list.
*/
void
-msdu_expiration_test (phy_t *phy)
+msdu_expiration_test (void)
{
sar_msdu_t sar_msdu;
u8 buffer [2048];
@@ -697,7 +693,7 @@ msdu_expiration_test (phy_t *phy)
sar_msdu.mfs = &mfs;
- *(u32*)phy = -1;
+ phy_date_current = -1;
seg_done = false;
sar_init_data_context (sar_ctx, sar_ctx);
@@ -786,16 +782,9 @@ pb_tx_expire (void)
}
-/**
- * Create a phy_date weak function to do not have to include the phy on test
- * when it is not necessary.
- *
- * \param phy the phy context.
- * \return the phy date.
- */
u32
-phy_date (phy_t *phy)
+phy_date (void)
{
- return *(u32*) phy;
+ return phy_date_current;
}
diff --git a/cesar/mac/sar/test/unit_test/ecos/src/tests.c b/cesar/mac/sar/test/unit_test/ecos/src/tests.c
index ea073296b2..af001f8296 100644
--- a/cesar/mac/sar/test/unit_test/ecos/src/tests.c
+++ b/cesar/mac/sar/test/unit_test/ecos/src/tests.c
@@ -72,7 +72,7 @@ sar_test_init (sar_test_t *t, void *phy, void *pbproc)
t->phy = phy;
else
t->phy = &tphy;
- mac_ntb_init ((phy_t*) t->phy, &t->mac_config);
+ mac_ntb_init (&t->mac_config);
lib_stats_init ();
t->sar = sar_init (t->mac_store, pbproc, INVALID_PTR, 123);
t->ce = ce_rx_init (t->mac_store, t->sar, pbproc, &t->mac_config);
diff --git a/cesar/mac/sar/test/unit_test/host/src/phy_stub.c b/cesar/mac/sar/test/unit_test/host/src/phy_stub.c
index 0141b73f5f..a4cd3d773e 100644
--- a/cesar/mac/sar/test/unit_test/host/src/phy_stub.c
+++ b/cesar/mac/sar/test/unit_test/host/src/phy_stub.c
@@ -17,7 +17,7 @@
#include "hal/phy/phy.h"
u32
-phy_date (phy_t *ctx)
+phy_date (void)
{
return 42;
}
diff --git a/cesar/station/src/station.c b/cesar/station/src/station.c
index 519e4c97a8..86ac478d35 100644
--- a/cesar/station/src/station.c
+++ b/cesar/station/src/station.c
@@ -57,8 +57,7 @@ cesar_init (void)
cesar.mac_store);
/* Initialise the mac ntb. */
- mac_ntb_init (pbproc_get_phy(cesar.pbproc),
- &cesar.mac_config);
+ mac_ntb_init (&cesar.mac_config);
/* Initialise the SAR. */
cesar.sar = sar_init (cesar.mac_store, cesar.pbproc,
@@ -78,7 +77,7 @@ cesar_init (void)
&cesar.mac_config);
/* Initialise the hal timer. */
- cesar.hal_timer = hal_timer_init (pbproc_get_phy(cesar.pbproc));
+ cesar.hal_timer = hal_timer_init ();
/* Initialize the CE in RX. */
cesar.ce_rx = ce_rx_init (cesar.mac_store, cesar.sar, cesar.pbproc,
diff --git a/cesar/test_general/dataplane/src/test_dataplane.c b/cesar/test_general/dataplane/src/test_dataplane.c
index 5219ddc8b6..fd881ba315 100644
--- a/cesar/test_general/dataplane/src/test_dataplane.c
+++ b/cesar/test_general/dataplane/src/test_dataplane.c
@@ -172,14 +172,14 @@ test_dataplane_init (test_dataplane_t *ctx)
ctx->snid = 1;
ctx->store = mac_store_init ();
ctx->pbproc = pbproc_init (&ctx->config, ctx->store);
- mac_ntb_init (pbproc_get_phy (ctx->pbproc), &ctx->config);
+ mac_ntb_init (&ctx->config);
ctx->sar = sar_init (ctx->store, ctx->pbproc, pbproc_get_ca
(ctx->pbproc), ctx->config.seed);
sar_init_measure_context (ctx->sar, ctx);
sar_init_measurement_cb (ctx->sar, ce_measurements);
ctx->cl = cl_init (ctx->store, ctx->sar, &ctx->config);
ctx->hle = hle_init (ctx->cl);
- ctx->hal_timer = hal_timer_init (pbproc_get_phy (ctx->pbproc));
+ ctx->hal_timer = hal_timer_init ();
/* Fcall. */
fcall_ctx_t *fcall;
#if CONFIG_FCALL_MME
diff --git a/cesar/test_general/maximus/integration/cl-sar-pbproc/src/station.c b/cesar/test_general/maximus/integration/cl-sar-pbproc/src/station.c
index 57648d5b5a..abefef5c6c 100644
--- a/cesar/test_general/maximus/integration/cl-sar-pbproc/src/station.c
+++ b/cesar/test_general/maximus/integration/cl-sar-pbproc/src/station.c
@@ -920,7 +920,7 @@ cesar_init (void)
station_test.mac_store);
// Initialise the mac ntb.
- mac_ntb_init (pbproc_get_phy(station_test.pbproc), &station_test.mac_config);
+ mac_ntb_init (&station_test.mac_config);
// Initialise the SAR.
station_test.sar = sar_init (station_test.mac_store, station_test.pbproc,
diff --git a/cesar/test_general/maximus/integration/hle-cl-sar-pbproc/src/station.c b/cesar/test_general/maximus/integration/hle-cl-sar-pbproc/src/station.c
index ad1f209937..42f95309af 100644
--- a/cesar/test_general/maximus/integration/hle-cl-sar-pbproc/src/station.c
+++ b/cesar/test_general/maximus/integration/hle-cl-sar-pbproc/src/station.c
@@ -1088,7 +1088,7 @@ cesar_init (void)
station_test.mac_store);
// Initialise the mac ntb.
- mac_ntb_init (pbproc_get_phy(station_test.pbproc), &station_test.mac_config);
+ mac_ntb_init (&station_test.mac_config);
// Initialise the SAR.
station_test.sar = sar_init (station_test.mac_store, station_test.pbproc,
diff --git a/cesar/test_general/maximus/integration/interface-dp/src/station.c b/cesar/test_general/maximus/integration/interface-dp/src/station.c
index 3d99fe0358..489566ceb8 100644
--- a/cesar/test_general/maximus/integration/interface-dp/src/station.c
+++ b/cesar/test_general/maximus/integration/interface-dp/src/station.c
@@ -489,7 +489,7 @@ cesar_init (void)
station_test.mac_store);
// Initialise the mac ntb.
- mac_ntb_init (pbproc_get_phy(station_test.pbproc), &station_test.mac_config);
+ mac_ntb_init (&station_test.mac_config);
// Initialise the SAR.
station_test.sar = sar_init (station_test.mac_store, station_test.pbproc,
diff --git a/cesar/test_general/maximus/integration/ipmbox-hle-cl-sar-pbproc/src/station.c b/cesar/test_general/maximus/integration/ipmbox-hle-cl-sar-pbproc/src/station.c
index 12150b5fc4..ff75ea559d 100644
--- a/cesar/test_general/maximus/integration/ipmbox-hle-cl-sar-pbproc/src/station.c
+++ b/cesar/test_general/maximus/integration/ipmbox-hle-cl-sar-pbproc/src/station.c
@@ -865,7 +865,7 @@ cesar_init (void)
station_test.mac_store);
// Initialise the mac ntb.
- mac_ntb_init (pbproc_get_phy(station_test.pbproc), &station_test.mac_config);
+ mac_ntb_init (&station_test.mac_config);
// Initialise the SAR.
station_test.sar = sar_init (station_test.mac_store, station_test.pbproc,
diff --git a/cesar/test_general/maximus/integration/sar-pbproc/src/station.c b/cesar/test_general/maximus/integration/sar-pbproc/src/station.c
index 9109d287e8..467b808a7b 100644
--- a/cesar/test_general/maximus/integration/sar-pbproc/src/station.c
+++ b/cesar/test_general/maximus/integration/sar-pbproc/src/station.c
@@ -917,7 +917,7 @@ cesar_init (void)
station_test.mac_store);
// Initialise the mac ntb.
- mac_ntb_init (pbproc_get_phy(station_test.pbproc), &station_test.mac_config);
+ mac_ntb_init (&station_test.mac_config);
// Initialise the SAR.
station_test.sar = sar_init (station_test.mac_store, station_test.pbproc,
diff --git a/cesar/tools/sniffer_phy/src/sniffer_phy.c b/cesar/tools/sniffer_phy/src/sniffer_phy.c
index e85a8f43ed..549f147e0f 100644
--- a/cesar/tools/sniffer_phy/src/sniffer_phy.c
+++ b/cesar/tools/sniffer_phy/src/sniffer_phy.c
@@ -42,7 +42,7 @@ cyg_user_start (void)
# if CONFIG_TRACE
static mac_config_t mac_config;
mac_config.ntb_offset_tck = 0;
- mac_ntb_init (INVALID_PTR, &mac_config);
+ mac_ntb_init (&mac_config);
# endif
trace_init ();
sniffer_phy_init (&sniffer_phy_global);