summaryrefslogtreecommitdiff
path: root/cesar/cl/src
diff options
context:
space:
mode:
authormercadie2009-09-10 13:19:40 +0000
committermercadie2009-09-10 13:19:40 +0000
commit05f08d73e19062a1d4cac75adba766a9a918bce3 (patch)
tree39e93d405e1bc224148ed272a37e1a87293f95e8 /cesar/cl/src
parent1b295448664ec870c9bc28eb0bb7d2c9e77285d5 (diff)
* mme integration of data_rate in cm_nw_stats_req
- integration in fsm - unit tests git-svn-id: svn+ssh://pessac/svn/cesar/trunk@5496 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cl/src')
-rw-r--r--cesar/cl/src/cl.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/cesar/cl/src/cl.c b/cesar/cl/src/cl.c
index b35eb8a9fc..cd11325062 100644
--- a/cesar/cl/src/cl.c
+++ b/cesar/cl/src/cl.c
@@ -17,6 +17,7 @@
#include "lib/bitstream.h"
#include "cl/cl.h"
+#include "cl/data_rate.h"
#include "mac/sar/sar.h"
#include "mac/pbproc/pbproc.h"
@@ -31,6 +32,8 @@
#include <string.h>
#include "config/cl/eoc.h"
+#include "mac/common/store.h"
+
static struct cl_t cl_global;
/**
@@ -552,6 +555,10 @@ void
cl_data_send (cl_t *cl, u8 *buffer, uint length, uint tag,
u32 arrival_time_ntb)
{
+ uint tei;
+ sta_t* sta;
+ mac_t mac;
+
dbg_assert (cl);
dbg_assert (buffer);
dbg_assert ((length >= ETH_PACKET_MIN_SIZE_ALLOWED)
@@ -574,6 +581,15 @@ cl_data_send (cl_t *cl, u8 *buffer, uint length, uint tag,
bridge_table_add (cl, src_mac);
cl_send (cl, buffer, length, tag, false /* !MME */, arrival_time_ntb);
+
+ /* update data rate informations associated to the TX
+ * from the local sta to the associated sta */
+ tei = cl_mactotei_table_find_tei_from_mac (cl, mac & MAC_BROADCAST);
+ if (tei)
+ {
+ sta = mac_store_sta_get (cl->mac_store, tei);
+ data_rate_update_info (&(sta->tx_data_rate), length);
+ }
}
@@ -823,6 +839,10 @@ void cl_data_recv_init (cl_t *cl, cl_data_recv_cb_t cb, void *user)
*/
void cl_data_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs)
{
+ uint tei;
+ sta_t* sta;
+ mac_t mac;
+
dbg_assert (ctx);
dbg_assert (buffer);
dbg_assert ((length >= ETH_PACKET_MIN_SIZE_ALLOWED)
@@ -840,6 +860,16 @@ void cl_data_recv (cl_t *ctx, u8 *buffer, uint length, mfs_rx_t *mfs)
}
(*ctx->data_rx.cb) (ctx->data_rx.user, buffer, length);
+
+ /* update data rate informations associated to the RX
+ * from the associated sta to the local sta */
+ mac = bitstream_direct_read_large (buffer + 6, 0, 48);
+ tei = cl_mactotei_table_find_tei_from_mac (ctx, mac & MAC_BROADCAST);
+ if (tei)
+ {
+ sta = mac_store_sta_get (ctx->mac_store, tei);
+ data_rate_update_info(&(sta->rx_data_rate), length);
+ }
}
/**