summaryrefslogtreecommitdiff
path: root/cesar/cl/src/cl.c
diff options
context:
space:
mode:
authorAleksandar Cecaric2011-10-18 10:09:43 +0200
committerAleksandar Cecaric2011-10-18 10:09:43 +0200
commit652fe7afa35ee9dcdcf59090b0d6ee7472ff39e5 (patch)
tree8210a3e9216c858681f3b5910a60c42ab2b57d43 /cesar/cl/src/cl.c
parent572d57302cb0163ffa7a185a02588a72fbc56636 (diff)
parenta6bea4a24e98365390e1a5e6b1e8ebc98b1a20f4 (diff)
Merge commit 'av-1.1.11' into eoc
Conflicts: cesar/bsu/inc/context.h cesar/bsu/ntb/ntb.h cesar/bsu/ntb/src/ntb.c cesar/bsu/ntb/test/utest/src/ntb_compute.c cesar/bsu/src/bsu.c cesar/cp/sta/mgr/test/src/sta_mgr.c cesar/hal/phy/src/phy.c cesar/mac/pbproc/src/fsm_rx_sound.c cesar/mac/pbproc/src/fsm_tx_sound.c cesar/mac/pbproc/src/prep_mpdu.c cesar/mac/pbproc/test/int/sparc-Config cesar/station/src/station.c cleopatre/devkit/plcdrv/arm/inc/linux_drv.h cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c
Diffstat (limited to 'cesar/cl/src/cl.c')
-rw-r--r--cesar/cl/src/cl.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/cesar/cl/src/cl.c b/cesar/cl/src/cl.c
index fc6b7d22bb..11d721149f 100644
--- a/cesar/cl/src/cl.c
+++ b/cesar/cl/src/cl.c
@@ -15,6 +15,7 @@
#include "common/std.h"
#include "common/defs/ethernet.h"
#include "lib/bitstream.h"
+#include "lib/seq_check.h"
#include "config/cl.h"
#include "cl/cl.h"
@@ -42,6 +43,26 @@
static struct cl_t cl_global;
/**
+ * Callback when the lib sequencer detect a wrong sequencing.
+ * \param user user data
+ * \param vlan the VLAN id
+ * \param seq_expected the sequence number expected
+ * \param seq_actual the actual sequence number found in the packet
+ */
+void
+cl_lib_seq_check_cb (void *user, uint vlan, uint seq_expected,
+ uint seq_actual);
+
+void
+cl_lib_seq_check_cb (void *user, uint vlan, uint seq_expected,
+ uint seq_actual)
+{
+ dbg_assert (user);
+ trace_do (cl_t *ctx = (cl_t *) user);
+ CL_TRACE (SEQ_CHECK, vlan, seq_expected, seq_actual);
+}
+
+/**
* Search for the lid in the classifier
*
* \param ctx CL context
@@ -324,6 +345,9 @@ cl_init (mac_store_t *mac_store, sar_t *sar, mac_config_t *mac_config)
CL_TRACE (INIT, phy_date ());
+ /* Initialise packet sequence check. */
+ lib_seq_check_init (&ctx->seq_check_rx_ctx, cl_lib_seq_check_cb, ctx);
+
/* Debug leds. */
GPIO_SETUP (LED_CL_RX, GPIO_DIRECTION_OUT);
GPIO_SET (LED_CL_RX, 0);
@@ -985,6 +1009,9 @@ void cl_data_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs)
&& (length <= ETH_PACKET_MAX_SIZE));
dbg_assert (mfs);
+ /* Check sequence number of throughput. */
+ lib_seq_check_packet (&ctx->seq_check_rx_ctx, buffer, length);
+
dbg_assert (ctx->data_rx.cb);
mac_t smac, dmac;
bitstream_direct_read_macs (buffer, &dmac, &smac);