summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorlaranjeiro2010-06-04 14:20:31 +0000
committerlaranjeiro2010-06-04 14:20:31 +0000
commitf20d3a6be657c27ec63ff5ffec41a0043aaa0fe3 (patch)
tree23ead55fbab76fb2b7348582a290bec9ba1f6d54 /cesar
parent125ac02525dda44218356563e3094055911cad72 (diff)
cesar/cl: send MME to linux when TEI is MAC_TEI_FOREIGN, refs #1618
Change cl behavior when sending a MME to a FOREIGN TEI, when this TEI is used Cesar must send it to linux without trying to send it over the PLC as data. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7176 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/cl/inc/trace.h1
-rw-r--r--cesar/cl/src/cl.c31
-rw-r--r--cesar/cl/src/trace.c1
-rw-r--r--cesar/cl/test/functional/src/cl.c34
4 files changed, 3 insertions, 64 deletions
diff --git a/cesar/cl/inc/trace.h b/cesar/cl/inc/trace.h
index ab74a3910a..484049d3c4 100644
--- a/cesar/cl/inc/trace.h
+++ b/cesar/cl/inc/trace.h
@@ -30,7 +30,6 @@ enum
CL_TRACE_MME_SEND_UNASSOC_UNICAST,
CL_TRACE_MME_SEND_TO_UNASSOC,
CL_TRACE_MME_SEND_UNICAST,
- CL_TRACE_MME_SEND_AS_DATA,
CL_TRACE_MME_SEND_TO_DRIVER,
CL_TRACE_MME_SEND_DONE,
CL_TRACE_MME_SEND_DROP,
diff --git a/cesar/cl/src/cl.c b/cesar/cl/src/cl.c
index 009f4126b9..6653c17dff 100644
--- a/cesar/cl/src/cl.c
+++ b/cesar/cl/src/cl.c
@@ -695,34 +695,9 @@ cl_mme_send (cl_t *ctx, u8 *buffer, uint length, uint tei)
}
else
{
- uint table_tei;
- mac_t mac;
- cl_send_t *cl_data;
-
- mac = bitstream_direct_read_large (buffer, 0, 48);
- /* Get the TEI from the mac to TEI table. */
- table_tei = cl_mactotei_table_find_tei_from_mac (ctx, mac & MAC_BROADCAST);
-
- if ((table_tei == MAC_TEI_UNASSOCIATED)
- && (tei == MAC_TEI_FOREIGN))
- {
- CL_TRACE (MME_SEND_TO_DRIVER, phy_date (), length, buffer);
- dbg_assert (ctx->mme_ul_send.cb);
- (*ctx->mme_ul_send.cb) (ctx->mme_ul_send.user, buffer, length);
- }
- else if (ctx->mac_config->authenticated)
- {
- mac_t dmac = bitstream_direct_read_large (buffer, 0, 48);
- dbg_assert (tei != ctx->mac_config->tei);
- // if the TEI is not found the packet is send as broadcast.
-
- cl_data = cl_send_init (ctx, buffer, true /* MME. */);
- cl_data_send_with_tei (ctx, buffer, length,
- table_tei,
- 1 /* Priority 0 in HPAV.*/, cl_data,
- mac_ntb(), dmac);
- CL_TRACE (MME_SEND_AS_DATA, phy_date (), length, buffer, tei);
- }
+ CL_TRACE (MME_SEND_TO_DRIVER, phy_date (), length, buffer);
+ dbg_assert (ctx->mme_ul_send.cb);
+ (*ctx->mme_ul_send.cb) (ctx->mme_ul_send.user, buffer, length);
}
}
diff --git a/cesar/cl/src/trace.c b/cesar/cl/src/trace.c
index c99b071e55..d9ff1dee61 100644
--- a/cesar/cl/src/trace.c
+++ b/cesar/cl/src/trace.c
@@ -35,7 +35,6 @@ cl_trace_init (cl_t *ctx)
TRACE_EVENT (CL_TRACE_MME_SEND_UNASSOC_UNICAST, "MME send as unassociated unicast, length: %d, buffer: %x, dtei: %d", TIMESTAMP),
TRACE_EVENT (CL_TRACE_MME_SEND_TO_UNASSOC, "MME send to unassociated STA, length: %d, buffer: %x, dtei: %d", TIMESTAMP),
TRACE_EVENT (CL_TRACE_MME_SEND_UNICAST, "MME send unicast, length: %d, buffer: %x, dtei: %d", TIMESTAMP),
- TRACE_EVENT (CL_TRACE_MME_SEND_AS_DATA, "CL_MME_SEND_AS_DATA length : %d, buffer @ : %x", TIMESTAMP),
TRACE_EVENT (CL_TRACE_MME_SEND_TO_DRIVER, "CL_MME_SEND_TO_DRIVER length : %d, buffer @ : %x", TIMESTAMP),
TRACE_EVENT (CL_TRACE_MME_SEND_DONE, "CL_MME_SEND_DONE buffer : %d", TIMESTAMP),
TRACE_EVENT (CL_TRACE_MME_SEND_DROP, "CL_MME_SEND_DROP authenticated : %d, buffer @ : %x, length : %d", TIMESTAMP),
diff --git a/cesar/cl/test/functional/src/cl.c b/cesar/cl/test/functional/src/cl.c
index 4d554cb455..6035e25480 100644
--- a/cesar/cl/test/functional/src/cl.c
+++ b/cesar/cl/test/functional/src/cl.c
@@ -289,40 +289,6 @@ cl_mme_tx_send (test_t test)
dbg_check (mac_store_sta_remove (mac_store, tei));
}
test_end;
-
-
- test_begin (test, "MME to PWL, TEI Foreign")
- {
- cl_mactotei_blk_t *table;
- mfs_tx_t *mfs;
-
- bitstream_direct_write_large (buffer, 0, 0x123456789ABCull, 48);
- bitstream_direct_write_large (buffer, 48, 0x123456789ABCull, 48);
-
- mac_config.tei = 1;
- mac_config.authenticated = true;
-
- /* Add the address to the mac_to_tei table. */
- table = cl_mactotei_new ();
- cl_mactotei_addr_add (table, 0x123456789ABCull, 2, 1);
- cl_mactotei_use_table (cl, table);
-
- tei = 0;
- lid = 0;
- cl_mme_send (cl, buffer, 106, MAC_TEI_FOREIGN);
-
- test_fail_unless (tei == 2);
- test_fail_unless (lid == 0);
-
- /* Remove the mfs. */
- mfs = mac_store_mfs_get_tx (mac_store, false, false, lid, tei);
- mac_store_mfs_remove (mac_store, (mfs_t *) mfs);
- blk_release (mfs);
- dbg_check (mac_store_sta_remove (mac_store, tei));
-
- }
- test_end;
-
test_begin (test, "MME to HLE, TEI FOREIGN")
{
cl_mactotei_release_table (cl);