Commit 143e765c authored by Daniel0326's avatar Daniel0326

msg5 decoding in RRC

parent 9c7a5b22
...@@ -276,14 +276,23 @@ hashtable_rc_t hashtable_get(const hash_table_t * const hashtblP, const hash_key ...@@ -276,14 +276,23 @@ hashtable_rc_t hashtable_get(const hash_table_t * const hashtblP, const hash_key
*dataP = NULL; *dataP = NULL;
return HASH_TABLE_BAD_PARAMETER_HASHTABLE; return HASH_TABLE_BAD_PARAMETER_HASHTABLE;
} }
//printf("Hash table size : %d\n", hashtblP->size);
//printf("hashfunc(keyP) : %d\n", hashtblP->hashfunc(keyP));
hash=hashtblP->hashfunc(keyP)%hashtblP->size; hash=hashtblP->hashfunc(keyP)%hashtblP->size;
/* fprintf(stderr, "hashtable_get() key=%s, hash=%d\n", key, hash);*/ //printf("keyP %d\n", keyP);
/*fprintf(stderr, "hashtable_get() key=%s, hash=%d\n", key, hash);*/
//printf("hash %d\n", hash);
node=hashtblP->nodes[hash]; node=hashtblP->nodes[hash];
//printf("nodes_value %d \n", hashtblP->nodes[hash]);
while(node) { while(node) {
//printf("node_key %d \n",node->key);
if(node->key == keyP) { if(node->key == keyP) {
//printf("node_key %d \n",node->key);
*dataP = node->data; *dataP = node->data;
//printf("data : %p \n",node->data);
return HASH_TABLE_OK; return HASH_TABLE_OK;
} }
node=node->next; node=node->next;
......
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#include "defs_NB_IoT.h" #include "defs_NB_IoT.h"
#include "proto_NB_IoT.h" #include "proto_NB_IoT.h"
#include "extern_NB_IoT.h" #include "extern_NB_IoT.h"
#include "RRC/LITE/proto.h"
#include "RRC/LITE/extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
unsigned char str20[] = "DCI_uss"; unsigned char str20[] = "DCI_uss";
unsigned char str21[] = "DATA_uss"; unsigned char str21[] = "DATA_uss";
...@@ -246,16 +249,40 @@ void rx_sdu_NB_IoT(module_id_t module_id, int CC_id, frame_t frame, sub_frame_t ...@@ -246,16 +249,40 @@ void rx_sdu_NB_IoT(module_id_t module_id, int CC_id, frame_t frame, sub_frame_t
printf("%02x ",payload_ptr[a]); printf("%02x ",payload_ptr[a]);
printf("\n");*/ printf("\n");*/
rx_lengths[i]-=1; rx_lengths[i]-=1;
mac_rrc_data_ind(
module_id,
CC_id,
frame,subframe,
rnti,
CCCH,
(uint8_t*)payload_ptr,
rx_lengths[i],
1,
module_id,
0);
LOG_D(MAC,"rx_lengths : %d\n", rx_lengths[i]); LOG_D(MAC,"rx_lengths : %d\n", rx_lengths[i]);
msg4_rrc_pdu = mac_rrc_msg3_ind_NB_IoT(payload_ptr,rnti,rx_lengths[i]); msg4_rrc_pdu = mac_rrc_msg3_ind_NB_IoT(payload_ptr,rnti,rx_lengths[i]);
receive_msg3_NB_IoT(mac_inst,rnti,PHR,ul_total_buffer,first_6,msg4_rrc_pdu); receive_msg3_NB_IoT(mac_inst,rnti,PHR,ul_total_buffer,first_6,msg4_rrc_pdu);
LOG_D(MAC,"Contention resolution ID = %02x %02x %02x %02x %02x %02x\n",first_6[0],first_6[1],first_6[2],first_6[3],first_6[4],first_6[5]); LOG_I(MAC,"Contention resolution ID = %02x %02x %02x %02x %02x %02x\n",first_6[0],first_6[1],first_6[2],first_6[3],first_6[4],first_6[5]);
//NB_IoT_mac_rrc_data_ind(payload_ptr,mac_inst,rnti); //NB_IoT_mac_rrc_data_ind(payload_ptr,mac_inst,rnti);
//NB_IoT_receive_msg3(mac_inst,rnti,PHR,ul_total_buffer); //NB_IoT_receive_msg3(mac_inst,rnti,PHR,ul_total_buffer);
break; break;
case DCCH0_NB_IoT: case DCCH0_NB_IoT:
case DCCH1_NB_IoT: case DCCH1_NB_IoT:
LOG_I(MAC,"DCCH PDU Here\n"); LOG_I(MAC,"DCCH PDU Here\n");
mac_rlc_data_ind(
module_id,
rnti,
module_id,
frame,
1,
0,
rx_lcids[i],
//1,/* change channel_id equals 1 (SRB) */
(char *)payload_ptr,
rx_lengths[i],
1,
NULL);//(unsigned int*)crc_status);
// UE specific here // UE specific here
//NB_IoT_mac_rlc_data_ind(payload_ptr,mac_inst,rnti); //NB_IoT_mac_rlc_data_ind(payload_ptr,mac_inst,rnti);
......
...@@ -514,6 +514,7 @@ pdcp_data_ind( ...@@ -514,6 +514,7 @@ pdcp_data_ind(
ctxt_pP->module_id, ctxt_pP->module_id,
ctxt_pP->rnti); ctxt_pP->rnti);
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_id, srb_flagP); key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_id, srb_flagP);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p); h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
if (h_rc != HASH_TABLE_OK) { if (h_rc != HASH_TABLE_OK) {
...@@ -652,6 +653,7 @@ pdcp_data_ind( ...@@ -652,6 +653,7 @@ pdcp_data_ind(
PROTOCOL_PDCP_CTXT_FMT" DATA-IND len %u", PROTOCOL_PDCP_CTXT_FMT" DATA-IND len %u",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p), PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len); sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len);
rrc_data_ind(ctxt_pP, rrc_data_ind(ctxt_pP,
rb_id, rb_id,
sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len, sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len,
......
...@@ -212,6 +212,11 @@ config_req_rlc_am ( ...@@ -212,6 +212,11 @@ config_req_rlc_am (
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
/***************************************/
printf("hashtable_get in comfig_req_rlc_am\n");
/***************************************/
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am; l_rlc_p = &rlc_union_p->rlc.am;
LOG_D(RLC, LOG_D(RLC,
...@@ -265,6 +270,10 @@ void config_req_rlc_am_asn1 ( ...@@ -265,6 +270,10 @@ void config_req_rlc_am_asn1 (
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
/***************************************/
printf("hashtable_get in config_req_rlc_am_asn1\n");
/***************************************/
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am; l_rlc_p = &rlc_union_p->rlc.am;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "assertions.h" #include "assertions.h"
extern boolean_t pdcp_data_ind( extern boolean_t pdcp_data_ind(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
...@@ -581,7 +582,17 @@ void rlc_data_ind ( ...@@ -581,7 +582,17 @@ void rlc_data_ind (
T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP)); T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
#endif #endif
/*************************For SRB1bis (RLC->RRC)*****************************/
rrc_data_ind(
ctxt_pP,
rb_idP,
51,
(uint8_t*)&sdu_pP->data[0]);
/***************************************************************************/
/*
pdcp_data_ind ( pdcp_data_ind (
ctxt_pP, ctxt_pP,
srb_flagP, srb_flagP,
...@@ -589,7 +600,9 @@ void rlc_data_ind ( ...@@ -589,7 +600,9 @@ void rlc_data_ind (
rb_idP, rb_idP,
sdu_sizeP, sdu_sizeP,
sdu_pP); sdu_pP);
*/
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_data_conf (const protocol_ctxt_t* const ctxt_pP, void rlc_data_conf (const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
......
...@@ -177,6 +177,7 @@ tbs_size_t mac_rlc_data_req( ...@@ -177,6 +177,7 @@ tbs_size_t mac_rlc_data_req(
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
rlc_mode = rlc_union_p->mode; rlc_mode = rlc_union_p->mode;
} else { } else {
...@@ -238,8 +239,9 @@ void mac_rlc_data_ind ( ...@@ -238,8 +239,9 @@ void mac_rlc_data_ind (
rlc_union_t *rlc_union_p = NULL; rlc_union_t *rlc_union_p = NULL;
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE; hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc; hashtable_rc_t h_rc;
srb_flag_t srb_flag = (channel_idP <= 2) ? SRB_FLAG_YES : SRB_FLAG_NO; srb_flag_t srb_flag = (channel_idP <= 3) ? SRB_FLAG_YES : SRB_FLAG_NO;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
LOG_I(RLC,"NB-IoT: RLC PDU receive\n");
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, enb_flagP, rntiP, frameP, 0, eNB_index); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, enb_flagP, rntiP, frameP, 0, eNB_index);
...@@ -282,7 +284,19 @@ void mac_rlc_data_ind ( ...@@ -282,7 +284,19 @@ void mac_rlc_data_ind (
return; return;
} }
} else { } else {
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag); key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
/*
printf("*******RLC_COLL_KEY_LCID_VALUE*********\n");
printf("module_id : %d\n",module_idP);
printf("rnti : %d\n",rntiP);
printf("enb_flag : %d\n",enb_flagP );
printf("channel_id : %d\n",channel_idP );
printf("srb_flag : %d\n",srb_flag);
printf("***************************************\n");
*/
} }
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
...@@ -298,18 +312,24 @@ void mac_rlc_data_ind ( ...@@ -298,18 +312,24 @@ void mac_rlc_data_ind (
switch (rlc_mode) { switch (rlc_mode) {
case RLC_MODE_NONE: case RLC_MODE_NONE:
LOG_I(RLC,"NB-IoT: No Radio bearer configure for\n");
//handle_event(WARNING,"FILE %s FONCTION mac_rlc_data_ind() LINE %s : no radio bearer configured :%d\n", __FILE__, __LINE__, channel_idP); //handle_event(WARNING,"FILE %s FONCTION mac_rlc_data_ind() LINE %s : no radio bearer configured :%d\n", __FILE__, __LINE__, channel_idP);
break; break;
case RLC_MODE_AM: case RLC_MODE_AM:
LOG_I(RLC,"NB-IoT: AM\n");
rlc_am_mac_data_indication(&ctxt, &rlc_union_p->rlc.am, data_ind); rlc_am_mac_data_indication(&ctxt, &rlc_union_p->rlc.am, data_ind);
break; break;
case RLC_MODE_UM: case RLC_MODE_UM:
LOG_I(RLC,"NB-IoT: UM\n");
rlc_um_mac_data_indication(&ctxt, &rlc_union_p->rlc.um, data_ind); rlc_um_mac_data_indication(&ctxt, &rlc_union_p->rlc.um, data_ind);
break; break;
case RLC_MODE_TM: case RLC_MODE_TM:
LOG_I(RLC,"NB-IoT: TM\n");
rlc_tm_mac_data_indication(&ctxt, &rlc_union_p->rlc.tm, data_ind); rlc_tm_mac_data_indication(&ctxt, &rlc_union_p->rlc.tm, data_ind);
break; break;
} }
...@@ -386,6 +406,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind( ...@@ -386,6 +406,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
rlc_mode = rlc_union_p->mode; rlc_mode = rlc_union_p->mode;
} else { } else {
...@@ -469,6 +490,7 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind( ...@@ -469,6 +490,7 @@ rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
rlc_mode = rlc_union_p->mode; rlc_mode = rlc_union_p->mode;
} else { } else {
......
...@@ -113,6 +113,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP ...@@ -113,6 +113,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
break; break;
case RLC_Config_PR_am: case RLC_Config_PR_am:
/****************************************config srb1********************************************/
if (rrc_rlc_add_rlc (ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, rb_id, lc_id, RLC_MODE_AM) != NULL) { if (rrc_rlc_add_rlc (ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, rb_id, lc_id, RLC_MODE_AM) != NULL) {
config_req_rlc_am_asn1 ( config_req_rlc_am_asn1 (
ctxt_pP, ctxt_pP,
...@@ -124,6 +125,21 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP ...@@ -124,6 +125,21 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
PROTOCOL_CTXT_ARGS(ctxt_pP), PROTOCOL_CTXT_ARGS(ctxt_pP),
rb_id); rb_id);
} }
/***********************************************************************************************/
/****************************************config srb1bis********************************************/
if (rrc_rlc_add_rlc (ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, 3, 3, RLC_MODE_AM) != NULL) {
config_req_rlc_am_asn1 (
ctxt_pP,
SRB_FLAG_YES,
&srb_toaddmod_p->rlc_Config->choice.explicitValue.choice.am,
3, 3);
} else {
LOG_E(RLC, PROTOCOL_CTXT_FMT" ERROR IN ALLOCATING SRB %d \n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
rb_id);
}
/***************************************************************************************************/
break; break;
...@@ -374,6 +390,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP ...@@ -374,6 +390,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_KEY_NOT_EXISTS) { if (h_rc == HASH_TABLE_KEY_NOT_EXISTS) {
rlc_union_p = rrc_rlc_add_rlc ( rlc_union_p = rrc_rlc_add_rlc (
ctxt_pP, ctxt_pP,
...@@ -489,7 +506,7 @@ rlc_op_status_t rrc_rlc_remove_rlc ( ...@@ -489,7 +506,7 @@ rlc_op_status_t rrc_rlc_remove_rlc (
rlc_union_t *rlc_union_p = NULL; rlc_union_t *rlc_union_p = NULL;
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
rlc_mbms_id_t *mbms_id_p = NULL; rlc_mbms_id_t *mbms_id_p = NULL;
#endif #endif rrc_rlc_remove_rlc
#ifdef OAI_EMU #ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP) CHECK_CTXT_ARGS(ctxt_pP)
...@@ -548,6 +565,7 @@ rlc_op_status_t rrc_rlc_remove_rlc ( ...@@ -548,6 +565,7 @@ rlc_op_status_t rrc_rlc_remove_rlc (
} }
key_lcid = RLC_COLL_KEY_LCID_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, lcid, srb_flagP); key_lcid = RLC_COLL_KEY_LCID_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, lcid, srb_flagP);
h_lcid_rc = hashtable_get(rlc_coll_p, key_lcid, (void**)&rlc_union_p); h_lcid_rc = hashtable_get(rlc_coll_p, key_lcid, (void**)&rlc_union_p);
} else { } else {
h_lcid_rc = HASH_TABLE_KEY_NOT_EXISTS; h_lcid_rc = HASH_TABLE_KEY_NOT_EXISTS;
} }
...@@ -632,8 +650,20 @@ rlc_union_t* rrc_rlc_add_rlc ( ...@@ -632,8 +650,20 @@ rlc_union_t* rrc_rlc_add_rlc (
{ {
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP); key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
key_lcid = RLC_COLL_KEY_LCID_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, chan_idP, srb_flagP); key_lcid = RLC_COLL_KEY_LCID_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, chan_idP, srb_flagP);
/*
printf("*******RLC_COLL_KEY_LCID_VALUE*********\n");
printf("module_id : %d\n",ctxt_pP->module_id);
printf("rnti : %d\n",ctxt_pP->rnti);
printf("enb_flag : %d\n",ctxt_pP->enb_flag );
printf("channel_id : %d\n",chan_idP );
printf("srb_flag : %d\n",srb_flagP);
printf("***************************************\n");
printf("key_lcid %d\n",key_lcid);
*/
} }
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
......
...@@ -604,6 +604,16 @@ rrc_data_ind( ...@@ -604,6 +604,16 @@ rrc_data_ind(
sdu_sizeP, sdu_sizeP,
ctxt_pP->rnti); ctxt_pP->rnti);
} }
/*
printf("....in rrc_data_ind....\n");
printf("module_id : %d\n",ctxt_pP->module_id);
printf("frame : %d\n",ctxt_pP->frame);
printf("DCCH_index : %d\n",DCCH_index);
printf("Srb_id : %d\n",Srb_id);
printf("sdu_sizeP : %d\n",sdu_sizeP);
printf("rnti : %d\n",ctxt_pP->rnti);
*/
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
{ {
......
...@@ -944,7 +944,6 @@ uint8_t do_RRCConnectionSetup_NB_IoT( ...@@ -944,7 +944,6 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT, //for both SRB1bis and SRB1 SRB_ToAddModList_NB_r13_t** SRB_configList_NB_IoT, //for both SRB1bis and SRB1
struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB_IoT) struct PhysicalConfigDedicated_NB_r13** physicalConfigDedicated_NB_IoT)
{ {
asn_enc_rval_t enc_rval; asn_enc_rval_t enc_rval;
uint8_t ecause=0; uint8_t ecause=0;
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "rlc.h" #include "rlc.h"
#include "extern_NB_IoT.h" #include "extern_NB_IoT.h"
#include "LAYER2/MAC/defs_NB_IoT.h" #include "LAYER2/MAC/defs_NB_IoT.h"
/*NOTE: no static function should be declared in this header file (e.g. init_SI_NB)*/
uint8_t* generate_msg4_NB_IoT(rrc_eNB_carrier_data_NB_IoT_t *carrier); uint8_t* generate_msg4_NB_IoT(rrc_eNB_carrier_data_NB_IoT_t *carrier);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment