summaryrefslogtreecommitdiff
path: root/cesar/cl/src
diff options
context:
space:
mode:
authorNélio Laranjeiro2012-07-12 11:47:34 +0200
committerNélio Laranjeiro2012-07-20 13:33:16 +0200
commit8d1a35c829b5e4dbf85582a29a8cc77d2358f8cb (patch)
tree22b5391f619808ae0b56bd092dc0c1f1671245e1 /cesar/cl/src
parenta510c559025c6bc920b21525e09b02733e546bfd (diff)
cesar/cl: merge cl_data_send_with_tei with cl_data_send_prepare, refs #3256
Diffstat (limited to 'cesar/cl/src')
-rw-r--r--cesar/cl/src/send_data.c41
1 files changed, 8 insertions, 33 deletions
diff --git a/cesar/cl/src/send_data.c b/cesar/cl/src/send_data.c
index d2759f8c95..e93efe4331 100644
--- a/cesar/cl/src/send_data.c
+++ b/cesar/cl/src/send_data.c
@@ -173,35 +173,6 @@ cl_av_data_send_multicast (cl_t *ctx, u8 *buffer, uint length, uint tag,
}
/**
- * Send a data once the TEI has been find.
- *
- * \param ctx the cl context.
- * \param buffer the buffer containing the data to send.
- * \param length the buffer data length.
- * \param tei the TEI found from the cl_mactotei list.
- * \param tag the tag provided by the upper layer.
- * \param arrival_time_ntb the arrival time in NTB.
- * \param dmac the final destination mac address.
- * \param smac the source mac address.
- */
-static void
-cl_data_send_with_tei (cl_t *ctx, u8 *buffer, uint length, uint tei,
- uint tag, u32 arrival_time_ntb)
-{
- dbg_assert (ctx);
- dbg_assert (buffer);
- dbg_assert ((length >= ETH_PACKET_MIN_SIZE_ALLOWED)
- && (length <= ETH_PACKET_MAX_SIZE));
- dbg_assert (tei);
- cl_data_send_sublayer (ctx, buffer, length, tag, arrival_time_ntb,
- tei, false /* unicast */);
- /* SAR ends using the buffer it can be given back.
- * BRGDMA is polled by the SAR thats why it the buffer can be given
- * back to the buffer manager. */
- bufmgr_give_back (ctx->bufmgr, buffer);
-}
-
-/**
* Prepare the CL to send a Frame.
* \param ctx the cl context.
* \param buffer the Ethernet frame to send.
@@ -254,11 +225,15 @@ cl_data_send_prepare (cl_t *ctx, u8 *buffer, uint length, uint tag,
else
tei = ctx->groups.member_tei[group][0];
}
-
/* If the TEI is not found the packet is send as broadcast. */
- cl_data_send_with_tei (ctx, buffer, length,
- tei == MAC_TEI_UNASSOCIATED ? MAC_TEI_BCAST: tei,
- tag, arrival_time_ntb);
+ if (tei == MAC_TEI_UNASSOCIATED)
+ tei = MAC_TEI_BCAST;
+ cl_data_send_sublayer (ctx, buffer, length, tag, arrival_time_ntb,
+ tei, false /* unicast */);
+ /* SAR ends using the buffer it can be given back.
+ * BRGDMA is polled by the SAR thats why it the buffer can be given
+ * back to the buffer manager. */
+ bufmgr_give_back (ctx->bufmgr, buffer);
}
void