summaryrefslogtreecommitdiff
path: root/cesar/interface
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/interface')
-rw-r--r--cesar/interface/inc/context.h4
-rw-r--r--cesar/interface/interface.h39
-rw-r--r--cesar/interface/src/interface.c65
-rw-r--r--cesar/interface/stub/src/interface.c10
4 files changed, 10 insertions, 108 deletions
diff --git a/cesar/interface/inc/context.h b/cesar/interface/inc/context.h
index 6b3dd887a1..cf19dbbd07 100644
--- a/cesar/interface/inc/context.h
+++ b/cesar/interface/inc/context.h
@@ -57,10 +57,6 @@ struct interface_t
interface_mme_buffer_add_cb_t buffer_add_cb;
/** Interface MME user data. */
void *interface_mme_user_data;
- /** Callback on beacon add. */
- interface_beacon_add_cb_t beacon_add_cb;
- /** beacon user data. */
- void *beacon_user_data;
/** Buffer mailbox. */
mbox_t buffers_mbox;
diff --git a/cesar/interface/interface.h b/cesar/interface/interface.h
index 17edc16e19..787cee3396 100644
--- a/cesar/interface/interface.h
+++ b/cesar/interface/interface.h
@@ -46,14 +46,6 @@ typedef void
typedef void
(*interface_mme_buffer_add_cb_t) (void *user_data, u8 *buffer);
-/**
- * Function to call when the interface receives a beacon.
- * \param user_data the data registered by the actor in the init function.
- * \param beacon the beacon freshly received.
- */
-typedef void
-(*interface_beacon_add_cb_t) (void *user_data, pb_beacon_t *beacon);
-
BEGIN_DECLS
/**
@@ -87,17 +79,6 @@ void
interface_callback_init (interface_t *ctx, interface_mme_recv_cb_t mme_recv_cb,
interface_mme_buffer_add_cb_t buffer_add_cb, void *user_data);
-/**
- * Initialise the callbacks functions.
- * \param ctx the interface context.
- * \param beacon_add_cb the function to call on beacon reception
- * \param user_data the data to provide on each callback function.
- */
-void
-interface_callback_beacon_init (interface_t *ctx,
- interface_beacon_add_cb_t beacon_add_cb,
- void *user_data);
-
/** Receives an MME from the PWL or the HLE.
* \param ctx the interface context
* \param tei the station's source TEI.
@@ -134,25 +115,11 @@ interface_mme_send (interface_t *ctx, u8* buffer, uint length, uint tei);
* Sends a beacon, the interface will provide it to the SAR.
* \param ctx the interface context.
* \param beacon the beacon to send.
- * \param beacon_mfs the mfs to use to send the beacon.
- * \param bto_bpsto the four bto to use for the beacon and the bpsto address
- * to be stamp by the pbproc.
+ * \param params the bsu parameters.
*/
void
-interface_beacon_prepare (interface_t *ctx, pb_beacon_t *beacon,
- mfs_tx_t *beacon_mfs, void *bto_bpsto);
-
-/**
-* add a beacon to the interface.
-* It will provide it to the CP to process the beacon.
-*
-* \param ctx the interface context.
-* \param pb pb containing the beacon
-* \param params the rx params.
-* \param bparams the bsu computed params.
-*/
-void interface_beacon_add (interface_t *ctx, pb_beacon_t *pb,
- bsu_params_t *bparams);
+interface_beacon (interface_t *ctx, pb_beacon_t *beacon,
+ bsu_params_t *params);
/**
* Sends a message to the IPMbox
diff --git a/cesar/interface/src/interface.c b/cesar/interface/src/interface.c
index dcb6d9eb90..823401da43 100644
--- a/cesar/interface/src/interface.c
+++ b/cesar/interface/src/interface.c
@@ -118,9 +118,6 @@ interface_init (hle_t *hle, cl_t *cl, sar_t *sar, mac_config_t
cl_mme_recv_init (cl,(cl_mme_recv_cb_t) interface_mme_recv,
&interface_global);
- // Integrate the SAR.
- sar_init_beacon_cb (sar, &interface_global,
- (sar_beacon_cb_t) interface_beacon_add);
// Create the mailbox.
mbox_init (&interface_global.mailbox);
@@ -182,26 +179,6 @@ interface_callback_init (interface_t *ctx, interface_mme_recv_cb_t mme_recv_cb,
ctx->interface_mme_user_data = user_data;
}
-
-/**
- * Initialise the callbacks functions.
- * \param ctx the interface context.
- * \param beacon_add_cb the function to call on beacon reception
- * \param user_data the data to provide on each callback function.
- */
-void
-interface_callback_beacon_init (interface_t *ctx,
- interface_beacon_add_cb_t beacon_add_cb,
- void *user_data)
-{
- dbg_assert (ctx);
- dbg_assert (beacon_add_cb);
-
- ctx->beacon_add_cb = beacon_add_cb;
- ctx->beacon_user_data = user_data;
-}
-
-
/** Receives an MME from the PWL or the HLE.
* \param ctx the interface context
* \param tei the station's source TEI.
@@ -279,58 +256,30 @@ interface_mme_send (interface_t *ctx, u8* buffer, uint length, uint tei)
cl_mme_send (ctx->cl, buffer, length, tei);
}
-
void
-interface_beacon_prepare (interface_t *ctx, pb_beacon_t *beacon,
- mfs_tx_t *beacon_mfs, void *bto_bpsto)
+interface_beacon (interface_t *ctx, pb_beacon_t *beacon, bsu_params_t *params)
{
u8 *buffer;
-
dbg_assert (ctx);
dbg_assert (beacon);
- dbg_assert (ctx->sar);
+ dbg_assert (params);
- if (interface_sniffer_beacon_status_tx (ctx->sniffer))
+ if (params->direction == BSU_BEACON_DIRECTION_TO_PLC
+ && interface_sniffer_beacon_status_tx (ctx->sniffer))
{
buffer = interface_buffer_work_get (ctx);
-
if (buffer)
- {
interface_sniffer_copy_beacon_tx (ctx->sniffer, beacon, buffer);
- }
}
-
- sar_beacon_send (ctx->sar, beacon, beacon_mfs, bto_bpsto);
-}
-
-void interface_beacon_add (interface_t *ctx, pb_beacon_t *pb,
- bsu_params_t *bparams)
-{
- u8 *buffer;
-
- dbg_assert (ctx);
- dbg_assert (pb);
- dbg_assert (ctx->mac_config);
-
- /* Get the buffer to copy the data. */
- if (interface_sniffer_beacon_status_rx (ctx->sniffer))
+ else if (params->direction == BSU_BEACON_DIRECTION_FROM_PLC
+ && interface_sniffer_beacon_status_rx (ctx->sniffer))
{
buffer = interface_buffer_work_get (ctx);
-
if (buffer)
- {
- interface_sniffer_copy_beacon_rx (ctx->sniffer, pb, buffer);
- }
- }
-
- if (bparams->direction == BSU_BEACON_DIRECTION_FROM_PLC)
- {
- dbg_assert (ctx->beacon_add_cb);
- (*ctx->beacon_add_cb) (ctx->beacon_user_data, pb);
+ interface_sniffer_copy_beacon_rx (ctx->sniffer, beacon, buffer);
}
}
-
/**
* Sends a message to the IPMbox
* \param ctx the interface context
diff --git a/cesar/interface/stub/src/interface.c b/cesar/interface/stub/src/interface.c
index 17d0fd1410..68a4b87a9d 100644
--- a/cesar/interface/stub/src/interface.c
+++ b/cesar/interface/stub/src/interface.c
@@ -26,11 +26,6 @@ interface_callback_init (interface_t *ctx, interface_mme_recv_cb_t mme_recv_cb,
interface_mme_buffer_add_cb_t buffer_add_cb, void *user_data)__attribute__((weak));
void
-interface_callback_beacon_init (interface_t *ctx,
- interface_beacon_add_cb_t beacon_add_cb,
- void *user_data)__attribute__((weak));
-
-void
interface_mme_recv (interface_t *ctx, uint tei, u8 *buffer, uint length,
bool mme_data, bool encrypted)__attribute__((weak));
@@ -67,11 +62,6 @@ interface_callback_init (interface_t *ctx, interface_mme_recv_cb_t mme_recv_cb,
interface_mme_buffer_add_cb_t buffer_add_cb, void *user_data){}
void
-interface_callback_beacon_init (interface_t *ctx,
- interface_beacon_add_cb_t beacon_add_cb,
- void *user_data){}
-
-void
interface_mme_recv (interface_t *ctx, uint tei, u8 *buffer, uint length,
bool mme_data, bool encrypted){}