summaryrefslogtreecommitdiff
path: root/cesar/cp
diff options
context:
space:
mode:
authorNélio Laranjeiro2012-10-19 08:07:47 +0200
committerNélio Laranjeiro2012-10-22 14:40:24 +0200
commit650637ae30911fae7cf04e0168f4333cb4134e00 (patch)
treedc2415ca2ff007ad07973f9ea71421a0b691d219 /cesar/cp
parentfb8255d2d814a1d9d7250c8af87e75f694733b53 (diff)
cesar: use CALLBACK macro to register callbacks, refs #3414
Diffstat (limited to 'cesar/cp')
-rw-r--r--cesar/cp/av/cco/action/src/cco_action.c2
-rw-r--r--cesar/cp/av/sta/mgr/src/sta_mgr.c4
-rw-r--r--cesar/cp/beacon/src/beacon.c8
-rw-r--r--cesar/cp/cco/bw/src/bw.c2
-rw-r--r--cesar/cp/cco/region/src/region.c2
-rw-r--r--cesar/cp/cl_interf/src/cl_interf.c2
-rw-r--r--cesar/cp/fsm/src/events.c6
-rw-r--r--cesar/cp/msg/src/msg.c19
-rw-r--r--cesar/cp/sta/mgr/src/net.c5
9 files changed, 27 insertions, 23 deletions
diff --git a/cesar/cp/av/cco/action/src/cco_action.c b/cesar/cp/av/cco/action/src/cco_action.c
index 6ed05a7047..081fd5825d 100644
--- a/cesar/cp/av/cco/action/src/cco_action.c
+++ b/cesar/cp/av/cco/action/src/cco_action.c
@@ -300,7 +300,7 @@ cp_av_cco_action_init (cp_t *ctx)
/* Initialise the SET. */
heap_init (&ctx->cco_action.selection_heap,
- cp_av_cco_action_cco_selection__less);
+ CALLBACK (cp_av_cco_action_cco_selection__less));
/* Create default region. */
cp_av_cco_region_default (ctx);
}
diff --git a/cesar/cp/av/sta/mgr/src/sta_mgr.c b/cesar/cp/av/sta/mgr/src/sta_mgr.c
index cba9b9de25..9b4f99c1e4 100644
--- a/cesar/cp/av/sta/mgr/src/sta_mgr.c
+++ b/cesar/cp/av/sta/mgr/src/sta_mgr.c
@@ -48,10 +48,10 @@ cp_av_sta_mgr_init (cp_t *ctx)
slab_cache_init (&ctx->sta_mgr.sta_slab_cache,
"Station cache",
sizeof (cp_sta_private_t),
- (slab_object_destructor_t) cp_sta_uninit);
+ (slab_object_destructor_t) CALLBACK (cp_sta_uninit));
// Initialise the set of station sorted by mac addresses.
- set_init (&ctx->sta_mgr.stas, cp_sta_mgr_sta_mac_address_less);
+ set_init (&ctx->sta_mgr.stas, CALLBACK (cp_sta_mgr_sta_mac_address_less));
}
static void
diff --git a/cesar/cp/beacon/src/beacon.c b/cesar/cp/beacon/src/beacon.c
index b51be0b8d1..7ae35ec1c0 100644
--- a/cesar/cp/beacon/src/beacon.c
+++ b/cesar/cp/beacon/src/beacon.c
@@ -296,7 +296,7 @@ cp_beacon_sta_compute_schedules (cp_t *ctx, bsu_beacon_t *beacon)
set_t set_schedules;
cp_cco_bw_alloc_t *sched;
- set_init (&set_schedules, cp_cco_bw_alloc_less);
+ set_init (&set_schedules, CALLBACK (cp_cco_bw_alloc_less));
for (i = 0; i < beacon->bmis.nps.ns; i++)
{
@@ -334,7 +334,7 @@ cp_beacon_sta_compute_schedules (cp_t *ctx, bsu_beacon_t *beacon)
cp_cco_region_alloc_t *region;
set_t set_regions;
- set_init (&set_regions, cp_cco_region_alloc_less);
+ set_init (&set_regions, CALLBACK (cp_cco_region_alloc_less));
for (i = 0; i < beacon->bmis.region.nb; i++)
{
@@ -497,11 +497,11 @@ cp_beacon_init (cp_t *ctx)
// Initialise the instance of the leon timer.
hal_timer_instance_init (
ctx->hal_timer, &ctx->beacon.leon_timer, ctx,
- (hal_timer_instance_cb_t) cp_beacon_timer_expires);
+ (hal_timer_instance_cb_t) CALLBACK (cp_beacon_timer_expires));
/* Setup beacon indicator. */
GPIO_SETUP (LED_BEACON_TX_RX, GPIO_DIRECTION_OUT);
GPIO_SET (LED_BEACON_TX_RX, 0);
- bsu_init_beacon_cb (cp_beacon_receive, ctx);
+ bsu_init_beacon_cb (CALLBACK (cp_beacon_receive), ctx);
/* Store the current date for SPOC update coefficients. */
ctx->beacon.spoc_update_date = phy_date ();
/* Initialise tunable parameters. */
diff --git a/cesar/cp/cco/bw/src/bw.c b/cesar/cp/cco/bw/src/bw.c
index 939c798a1e..6c83a2c512 100644
--- a/cesar/cp/cco/bw/src/bw.c
+++ b/cesar/cp/cco/bw/src/bw.c
@@ -86,7 +86,7 @@ cp_cco_bw_init (cp_t *ctx)
sizeof (cp_cco_bw_alloc_t), NULL);
/* Initialise the list. */
- set_init (&ctx->bw.alloc_list, cp_cco_bw_alloc_less);
+ set_init (&ctx->bw.alloc_list, CALLBACK (cp_cco_bw_alloc_less));
}
void
diff --git a/cesar/cp/cco/region/src/region.c b/cesar/cp/cco/region/src/region.c
index 09c2162a00..ee5f2663f2 100644
--- a/cesar/cp/cco/region/src/region.c
+++ b/cesar/cp/cco/region/src/region.c
@@ -42,7 +42,7 @@ cp_cco_region_init (cp_t *ctx)
memset (&ctx->region, 0, sizeof (cp_cco_region_t));
/* Initialise the set. */
- set_init (&ctx->region.region_list, cp_cco_region_alloc_less);
+ set_init (&ctx->region.region_list, CALLBACK (cp_cco_region_alloc_less));
/* Initialise the slab. */
slab_cache_init (&ctx->region.slab, "Region manager Slab cache",
sizeof (cp_cco_region_alloc_t), NULL);
diff --git a/cesar/cp/cl_interf/src/cl_interf.c b/cesar/cp/cl_interf/src/cl_interf.c
index 810466e4cd..78e1a53028 100644
--- a/cesar/cp/cl_interf/src/cl_interf.c
+++ b/cesar/cp/cl_interf/src/cl_interf.c
@@ -50,7 +50,7 @@ cp_cl_interf_init (cp_t *ctx)
// Initialise the call backs.
interface_callback_init (ctx->interface,
- cp_cl_interf_rx_mme,
+ CALLBACK (cp_cl_interf_rx_mme),
ctx);
// Initialise the cache.
diff --git a/cesar/cp/fsm/src/events.c b/cesar/cp/fsm/src/events.c
index f074e9f90a..820f341adc 100644
--- a/cesar/cp/fsm/src/events.c
+++ b/cesar/cp/fsm/src/events.c
@@ -223,12 +223,12 @@ cp_fsm_event_init (cp_t *ctx)
NULL);
slab_cache_init (&ctx->fsm.event_mme_cache, "event_mme",
sizeof (cp_fsm_event_mme_t),
- cp_fsm_event_mme_destructor);
+ CALLBACK (cp_fsm_event_mme_destructor));
slab_cache_init (&ctx->fsm.event_sta_cache, "event_sta",
sizeof (cp_fsm_event_sta_t),
- cp_fsm_event_sta_destructor);
+ CALLBACK (cp_fsm_event_sta_destructor));
slab_cache_init (&ctx->fsm.event_beacon_cache, "event_beacon",
sizeof (cp_fsm_event_beacon_t),
- cp_fsm_event_beacon_destructor);
+ CALLBACK (cp_fsm_event_beacon_destructor));
}
diff --git a/cesar/cp/msg/src/msg.c b/cesar/cp/msg/src/msg.c
index 051cfb3164..b8038181ec 100644
--- a/cesar/cp/msg/src/msg.c
+++ b/cesar/cp/msg/src/msg.c
@@ -394,13 +394,15 @@ cp_msg_init (cp_t *ctx)
{
dbg_assert (ctx);
- slab_cache_init (&ctx->msg.mme_tx_slab_cache, "MME TX",
- sizeof (cp_mme_tx_t),
- (slab_object_destructor_t) cp_msg_mme_tx_destructor);
-
- slab_cache_init (&ctx->msg.mme_rx_slab_cache, "MME RX",
- sizeof (cp_mme_rx_t),
- (slab_object_destructor_t) cp_msg_mme_rx_destructor);
+ slab_cache_init (
+ &ctx->msg.mme_tx_slab_cache, "MME TX",
+ sizeof (cp_mme_tx_t),
+ (slab_object_destructor_t) CALLBACK (cp_msg_mme_tx_destructor));
+
+ slab_cache_init (
+ &ctx->msg.mme_rx_slab_cache, "MME RX",
+ sizeof (cp_mme_rx_t),
+ (slab_object_destructor_t) CALLBACK (cp_msg_mme_rx_destructor));
ctx->msg.fmsn = 1;
}
@@ -621,7 +623,8 @@ cp_msg_mme_init (cp_t *ctx, cp_mme_peer_t *peer, mmtype_t mmtype,
dbg_assert (mme);
bitstream_init_buffer_cb (
&mme->bitstream,
- (bitstream_buffer_cb_t) cp_msg_mme_tx_change_buffer, mme);
+ (bitstream_buffer_cb_t) CALLBACK (cp_msg_mme_tx_change_buffer),
+ mme);
}
return mme;
diff --git a/cesar/cp/sta/mgr/src/net.c b/cesar/cp/sta/mgr/src/net.c
index ffc9d18337..84eb0a21e0 100644
--- a/cesar/cp/sta/mgr/src/net.c
+++ b/cesar/cp/sta/mgr/src/net.c
@@ -124,8 +124,9 @@ cp_net_init (cp_t *ctx, cp_net_t *net)
net->num_associated_stas = 0;
net->hm = MAC_COEXISTENCE_FULL_HYBRID_MODE;
net->beacon_recv_date = 0;
- set_init (&net->associated_stas, cp_net_station_assoc_less);
- set_init (&net->unassociated_stas, cp_net_station_unassoc_less);
+ set_init (&net->associated_stas, CALLBACK (cp_net_station_assoc_less));
+ set_init (&net->unassociated_stas,
+ CALLBACK (cp_net_station_unassoc_less));
}
void