Commit a53d6795 authored by Xue Song's avatar Xue Song

fix some errors about rrcReestablishment

parent 96cf622e
...@@ -657,7 +657,7 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP, ...@@ -657,7 +657,7 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
int CC_id, int CC_id,
uint8_t *const buffer, uint8_t *const buffer,
const uint8_t transaction_id, const uint8_t transaction_id,
NR_SRB_ToAddModList_t *SRB_configList) NR_SRB_ToAddModList_t **SRB_configList)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
asn_enc_rval_t enc_rval;; asn_enc_rval_t enc_rval;;
...@@ -689,19 +689,19 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP, ...@@ -689,19 +689,19 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
/****************************** radioBearerConfig ******************************/ /****************************** radioBearerConfig ******************************/
/* Configure SRB1 */ /* Configure SRB1 */
if (SRB_configList) { if (*SRB_configList) {
free(SRB_configList); free(*SRB_configList);
} }
SRB_configList = calloc(1, sizeof(NR_SRB_ToAddModList_t)); *SRB_configList = calloc(1, sizeof(NR_SRB_ToAddModList_t));
// SRB1 // SRB1
/* TODO */ /* TODO */
SRB1_config = calloc(1, sizeof(NR_SRB_ToAddMod_t)); SRB1_config = calloc(1, sizeof(NR_SRB_ToAddMod_t));
SRB1_config->srb_Identity = 1; SRB1_config->srb_Identity = 1;
// pdcp_Config->t_Reordering // pdcp_Config->t_Reordering
SRB1_config->pdcp_Config = pdcp_Config; SRB1_config->pdcp_Config = pdcp_Config;
ie->radioBearerConfig.srb_ToAddModList = SRB_configList; ie->radioBearerConfig.srb_ToAddModList = *SRB_configList;
ASN_SEQUENCE_ADD(&SRB_configList->list, SRB1_config); ASN_SEQUENCE_ADD(&(*SRB_configList)->list, SRB1_config);
ie->radioBearerConfig.srb3_ToRelease = NULL; ie->radioBearerConfig.srb3_ToRelease = NULL;
ie->radioBearerConfig.drb_ToAddModList = NULL; ie->radioBearerConfig.drb_ToAddModList = NULL;
...@@ -1307,19 +1307,17 @@ rrc_gNB_ue_context_t *const ue_context_pP, ...@@ -1307,19 +1307,17 @@ rrc_gNB_ue_context_t *const ue_context_pP,
int CC_id, int CC_id,
uint8_t *const buffer, uint8_t *const buffer,
//const uint8_t transmission_mode, //const uint8_t transmission_mode,
const uint8_t Transaction_id const uint8_t Transaction_id,
//NR_SRB_ToAddModList_t **SRB_configList, NR_SRB_ToAddModList_t **SRB_configList
//struct LTE_PhysicalConfigDedicated **physicalConfigDedicated
) { ) {
asn_enc_rval_t enc_rval; asn_enc_rval_t enc_rval;
//long *logicalchannelgroup = NULL; //long *logicalchannelgroup = NULL;
//struct NR_SRB_ToAddMod *SRB1_config = NULL; struct NR_SRB_ToAddMod *SRB1_config = NULL;
//struct NR_SRB_ToAddMod *SRB2_config = NULL; struct NR_SRB_ToAddMod *SRB2_config = NULL;
//gNB_RRC_INST *nrrrc = RC.nrrrc[ctxt_pP->module_id]; //gNB_RRC_INST *nrrrc = RC.nrrrc[ctxt_pP->module_id];
//LTE_PhysicalConfigDedicated_t *physicalConfigDedicated2 = NULL;
NR_DL_DCCH_Message_t dl_dcch_msg; NR_DL_DCCH_Message_t dl_dcch_msg;
NR_RRCReestablishment_t *rrcReestablishment = NULL; NR_RRCReestablishment_t *rrcReestablishment = NULL;
//int i = 0; int i = 0;
ue_context_pP->ue_context.reestablishment_xid = Transaction_id; ue_context_pP->ue_context.reestablishment_xid = Transaction_id;
NR_SRB_ToAddModList_t **SRB_configList2 = NULL; NR_SRB_ToAddModList_t **SRB_configList2 = NULL;
SRB_configList2 = &ue_context_pP->ue_context.SRB_configList2[Transaction_id]; SRB_configList2 = &ue_context_pP->ue_context.SRB_configList2[Transaction_id];
...@@ -1335,9 +1333,6 @@ const uint8_t Transaction_id ...@@ -1335,9 +1333,6 @@ const uint8_t Transaction_id
dl_dcch_msg.message.choice.c1->present = NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment; dl_dcch_msg.message.choice.c1->present = NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment;
dl_dcch_msg.message.choice.c1->choice.rrcReestablishment = CALLOC(1,sizeof(NR_RRCReestablishment_t)); dl_dcch_msg.message.choice.c1->choice.rrcReestablishment = CALLOC(1,sizeof(NR_RRCReestablishment_t));
rrcReestablishment = dl_dcch_msg.message.choice.c1->choice.rrcReestablishment; rrcReestablishment = dl_dcch_msg.message.choice.c1->choice.rrcReestablishment;
/*
// RRCReestablishment
// Configure SRB1
// get old configuration of SRB2 // get old configuration of SRB2
if (*SRB_configList != NULL) { if (*SRB_configList != NULL) {
...@@ -1373,7 +1368,7 @@ const uint8_t Transaction_id ...@@ -1373,7 +1368,7 @@ const uint8_t Transaction_id
*SRB_configList = CALLOC(1, sizeof(LTE_SRB_ToAddModList_t)); *SRB_configList = CALLOC(1, sizeof(LTE_SRB_ToAddModList_t));
ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config); ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config);
*/
rrcReestablishment->rrc_TransactionIdentifier = Transaction_id; rrcReestablishment->rrc_TransactionIdentifier = Transaction_id;
rrcReestablishment->criticalExtensions.present = NR_RRCReestablishment__criticalExtensions_PR_rrcReestablishment; rrcReestablishment->criticalExtensions.present = NR_RRCReestablishment__criticalExtensions_PR_rrcReestablishment;
rrcReestablishment->criticalExtensions.choice.rrcReestablishment = CALLOC(1,sizeof(NR_RRCReestablishment_IEs_t)); rrcReestablishment->criticalExtensions.choice.rrcReestablishment = CALLOC(1,sizeof(NR_RRCReestablishment_IEs_t));
......
...@@ -91,7 +91,7 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP, ...@@ -91,7 +91,7 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
int CC_id, int CC_id,
uint8_t *const buffer, uint8_t *const buffer,
const uint8_t transaction_id, const uint8_t transaction_id,
NR_SRB_ToAddModList_t *SRB_configList); NR_SRB_ToAddModList_t **SRB_configList);
uint8_t do_NR_SecurityModeCommand( uint8_t do_NR_SecurityModeCommand(
const protocol_ctxt_t *const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
uint8_t *const buffer, uint8_t *const buffer,
...@@ -156,9 +156,8 @@ do_RRCReestablishment( ...@@ -156,9 +156,8 @@ do_RRCReestablishment(
int CC_id, int CC_id,
uint8_t *const buffer, uint8_t *const buffer,
//const uint8_t transmission_mode, //const uint8_t transmission_mode,
const uint8_t Transaction_id const uint8_t Transaction_id,
//NR_SRB_ToAddModList_t **SRB_configList, NR_SRB_ToAddModList_t **SRB_configList
//struct LTE_PhysicalConfigDedicated **physicalConfigDedicated
); );
uint8_t uint8_t
......
This diff is collapsed.
...@@ -128,8 +128,6 @@ nr_rrc_ue_generate_rrcReestablishmentComplete( ...@@ -128,8 +128,6 @@ nr_rrc_ue_generate_rrcReestablishmentComplete(
mui_t nr_rrc_mui=0; mui_t nr_rrc_mui=0;
uint8_t first_rrcreconfigurationcomplete = 0; uint8_t first_rrcreconfigurationcomplete = 0;
uint8_t rrcReestablishmentRequest_flag = 1;
extern uint16_t rnti;
static Rrc_State_NR_t nr_rrc_get_state (module_id_t ue_mod_idP) { static Rrc_State_NR_t nr_rrc_get_state (module_id_t ue_mod_idP) {
return NR_UE_rrc_inst[ue_mod_idP].nrRrcState; return NR_UE_rrc_inst[ue_mod_idP].nrRrcState;
...@@ -1456,26 +1454,6 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB ...@@ -1456,26 +1454,6 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
ctxt_pP->frame, ctxt_pP->frame,
ctxt_pP->rnti); ctxt_pP->rnti);
if (rrcReestablishmentRequest_flag == 1) {
free(NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config);
NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config = NULL;
free(NR_UE_rrc_inst[ctxt_pP->module_id].SRB1_config[gNB_index]);
NR_UE_rrc_inst[ctxt_pP->module_id].SRB1_config[gNB_index] = NULL;
free(NR_UE_rrc_inst[ctxt_pP->module_id].SRB2_config[gNB_index]);
NR_UE_rrc_inst[ctxt_pP->module_id].SRB2_config[gNB_index] = NULL;
free(NR_UE_rrc_inst[ctxt_pP->module_id].defaultDRB);
NR_UE_rrc_inst[ctxt_pP->module_id].defaultDRB = NULL;
for (int i = 0; i < 8; i++) {
if (NR_UE_rrc_inst[ctxt_pP->module_id].DRB_config[gNB_index][i] != NULL) {
free(NR_UE_rrc_inst[ctxt_pP->module_id].DRB_config[gNB_index][i]);
NR_UE_rrc_inst[ctxt_pP->module_id].DRB_config[gNB_index][i] = NULL;
}
}
}
// Get configuration // Get configuration
// Release T300 timer // Release T300 timer
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].T300_active = 0; NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].T300_active = 0;
...@@ -2362,6 +2340,7 @@ nr_rrc_ue_decode_dcch( ...@@ -2362,6 +2340,7 @@ nr_rrc_ue_decode_dcch(
nr_rrc_ue_generate_RRCReconfigurationComplete(ctxt_pP, nr_rrc_ue_generate_RRCReconfigurationComplete(ctxt_pP,
gNB_indexP, gNB_indexP,
dl_dcch_msg->message.choice.c1->choice.rrcReconfiguration->rrc_TransactionIdentifier); dl_dcch_msg->message.choice.c1->choice.rrcReconfiguration->rrc_TransactionIdentifier);
if (first_rrcreconfigurationcomplete == 0) { if (first_rrcreconfigurationcomplete == 0) {
first_rrcreconfigurationcomplete = 1; first_rrcreconfigurationcomplete = 1;
#ifdef ITTI_SIM #ifdef ITTI_SIM
...@@ -2391,14 +2370,6 @@ nr_rrc_ue_decode_dcch( ...@@ -2391,14 +2370,6 @@ nr_rrc_ue_decode_dcch(
LOG_I(NR_RRC, " Send NAS_UPLINK_DATA_REQ message(PduSessionEstablishRequest)\n"); LOG_I(NR_RRC, " Send NAS_UPLINK_DATA_REQ message(PduSessionEstablishRequest)\n");
} }
} }
if (rrcReestablishmentRequest_flag == 1) {
rrcReestablishmentRequest_flag = 0;
rnti = 2;
rrc_ue_generate_RRCReestablishmentRequest(ctxt_pP, gNB_indexP);
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_indexP].State = NR_RRC_SI_RECEIVED;
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_indexP].rnti = rnti;
}
#endif #endif
} }
} }
......
...@@ -71,7 +71,6 @@ uint32_t target_dl_mcs = 28; ...@@ -71,7 +71,6 @@ uint32_t target_dl_mcs = 28;
uint32_t target_ul_mcs = 20; uint32_t target_ul_mcs = 20;
uint32_t timing_advance = 0; uint32_t timing_advance = 0;
uint64_t num_missed_slots=0; uint64_t num_missed_slots=0;
uint16_t rnti = 1;
int split73=0; int split73=0;
void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) { void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) {
...@@ -428,7 +427,6 @@ void *itti_sim_ue_rrc_task( void *args_p) { ...@@ -428,7 +427,6 @@ void *itti_sim_ue_rrc_task( void *args_p) {
memset (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); memset (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
memcpy (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, GNB_RRC_CCCH_DATA_IND(msg_p).sdu, GNB_RRC_CCCH_DATA_IND(msg_p).size); memcpy (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, GNB_RRC_CCCH_DATA_IND(msg_p).sdu, GNB_RRC_CCCH_DATA_IND(msg_p).size);
NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = GNB_RRC_CCCH_DATA_IND(msg_p).size; NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = GNB_RRC_CCCH_DATA_IND(msg_p).size;
NR_RRC_MAC_CCCH_DATA_IND(message_p).rnti = rnti;
itti_send_msg_to_task (TASK_RRC_NRUE, instance, message_p); itti_send_msg_to_task (TASK_RRC_NRUE, instance, message_p);
break; break;
case GNB_RRC_DCCH_DATA_IND: case GNB_RRC_DCCH_DATA_IND:
...@@ -437,7 +435,6 @@ void *itti_sim_ue_rrc_task( void *args_p) { ...@@ -437,7 +435,6 @@ void *itti_sim_ue_rrc_task( void *args_p) {
NR_RRC_DCCH_DATA_IND (message_p).dcch_index = GNB_RRC_DCCH_DATA_IND(msg_p).rbid; NR_RRC_DCCH_DATA_IND (message_p).dcch_index = GNB_RRC_DCCH_DATA_IND(msg_p).rbid;
NR_RRC_DCCH_DATA_IND (message_p).sdu_size = GNB_RRC_DCCH_DATA_IND(msg_p).size; NR_RRC_DCCH_DATA_IND (message_p).sdu_size = GNB_RRC_DCCH_DATA_IND(msg_p).size;
NR_RRC_DCCH_DATA_IND (message_p).sdu_p = GNB_RRC_DCCH_DATA_IND(msg_p).sdu; NR_RRC_DCCH_DATA_IND (message_p).sdu_p = GNB_RRC_DCCH_DATA_IND(msg_p).sdu;
NR_RRC_DCCH_DATA_IND(message_p).rnti = rnti;
itti_send_msg_to_task (TASK_RRC_NRUE, instance, message_p); itti_send_msg_to_task (TASK_RRC_NRUE, instance, message_p);
break; break;
default: default:
...@@ -479,7 +476,6 @@ void *itti_sim_gnb_rrc_task( void *args_p) { ...@@ -479,7 +476,6 @@ void *itti_sim_gnb_rrc_task( void *args_p) {
NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = UE_RRC_CCCH_DATA_IND(msg_p).size; NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = UE_RRC_CCCH_DATA_IND(msg_p).size;
memset (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); memset (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
memcpy (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, UE_RRC_CCCH_DATA_IND(msg_p).sdu, UE_RRC_CCCH_DATA_IND(msg_p).size); memcpy (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, UE_RRC_CCCH_DATA_IND(msg_p).sdu, UE_RRC_CCCH_DATA_IND(msg_p).size);
NR_RRC_MAC_CCCH_DATA_IND(message_p).rnti = rnti;
itti_send_msg_to_task (TASK_RRC_GNB, instance, message_p); itti_send_msg_to_task (TASK_RRC_GNB, instance, message_p);
break; break;
case UE_RRC_DCCH_DATA_IND: case UE_RRC_DCCH_DATA_IND:
...@@ -487,7 +483,6 @@ void *itti_sim_gnb_rrc_task( void *args_p) { ...@@ -487,7 +483,6 @@ void *itti_sim_gnb_rrc_task( void *args_p) {
NR_RRC_DCCH_DATA_IND (message_p).sdu_size = UE_RRC_DCCH_DATA_IND(msg_p).size; NR_RRC_DCCH_DATA_IND (message_p).sdu_size = UE_RRC_DCCH_DATA_IND(msg_p).size;
NR_RRC_DCCH_DATA_IND (message_p).dcch_index = UE_RRC_DCCH_DATA_IND(msg_p).rbid; NR_RRC_DCCH_DATA_IND (message_p).dcch_index = UE_RRC_DCCH_DATA_IND(msg_p).rbid;
NR_RRC_DCCH_DATA_IND (message_p).sdu_p = UE_RRC_DCCH_DATA_IND(msg_p).sdu; NR_RRC_DCCH_DATA_IND (message_p).sdu_p = UE_RRC_DCCH_DATA_IND(msg_p).sdu;
NR_RRC_DCCH_DATA_IND(message_p).rnti = rnti;
itti_send_msg_to_task (TASK_RRC_GNB, instance, message_p); itti_send_msg_to_task (TASK_RRC_GNB, instance, message_p);
break; break;
......
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