Commit 40e3c0ce authored by Xue Song's avatar Xue Song

modify rrcReestablishmentRequest

parent 7fa06a3a
...@@ -1262,7 +1262,7 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8 ...@@ -1262,7 +1262,7 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8
return encoded; return encoded;
} }
uint8_t do_RRCReestablishmentRequest(uint8_t Mod_id, uint8_t *buffer) { uint8_t do_RRCReestablishmentRequest(uint8_t Mod_id, uint8_t *buffer, uint16_t c_rnti) {
asn_enc_rval_t enc_rval; asn_enc_rval_t enc_rval;
NR_UL_CCCH_Message_t ul_ccch_msg; NR_UL_CCCH_Message_t ul_ccch_msg;
NR_RRCReestablishmentRequest_t *rrcReestablishmentRequest; NR_RRCReestablishmentRequest_t *rrcReestablishmentRequest;
...@@ -1277,7 +1277,7 @@ uint8_t do_RRCReestablishmentRequest(uint8_t Mod_id, uint8_t *buffer) { ...@@ -1277,7 +1277,7 @@ uint8_t do_RRCReestablishmentRequest(uint8_t Mod_id, uint8_t *buffer) {
rrcReestablishmentRequest = ul_ccch_msg.message.choice.c1->choice.rrcReestablishmentRequest; rrcReestablishmentRequest = ul_ccch_msg.message.choice.c1->choice.rrcReestablishmentRequest;
// test // test
rrcReestablishmentRequest->rrcReestablishmentRequest.reestablishmentCause = NR_ReestablishmentCause_reconfigurationFailure; rrcReestablishmentRequest->rrcReestablishmentRequest.reestablishmentCause = NR_ReestablishmentCause_reconfigurationFailure;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.c_RNTI = 0x1234; rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.c_RNTI = c_rnti;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.physCellId = 0; rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.physCellId = 0;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf = buf; rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf = buf;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf[0] = 0x08; rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf[0] = 0x08;
......
...@@ -147,7 +147,7 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, ...@@ -147,7 +147,7 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer,
uint32_t pdu_length, uint32_t pdu_length,
uint8_t *pdu_buffer); uint8_t *pdu_buffer);
uint8_t do_RRCReestablishmentRequest(uint8_t Mod_id, uint8_t *buffer); uint8_t do_RRCReestablishmentRequest(uint8_t Mod_id, uint8_t *buffer, uint16_t c_rnti);
uint8_t uint8_t
do_RRCReestablishment( do_RRCReestablishment(
......
This diff is collapsed.
...@@ -119,6 +119,8 @@ uint8_t do_NR_RRCReconfigurationComplete( ...@@ -119,6 +119,8 @@ uint8_t do_NR_RRCReconfigurationComplete(
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;
...@@ -1444,6 +1446,27 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB ...@@ -1444,6 +1446,27 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
ctxt_pP->module_id, ctxt_pP->module_id,
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;
...@@ -2261,6 +2284,7 @@ void nr_rrc_ue_generate_RRCReconfigurationComplete( const protocol_ctxt_t *const ...@@ -2261,6 +2284,7 @@ void nr_rrc_ue_generate_RRCReconfigurationComplete( const protocol_ctxt_t *const
UE_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer; UE_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer;
UE_RRC_DCCH_DATA_IND (message_p).size = size; UE_RRC_DCCH_DATA_IND (message_p).size = size;
itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p); itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p);
#else #else
rrc_data_req_ue ( rrc_data_req_ue (
ctxt_pP, ctxt_pP,
...@@ -2332,6 +2356,7 @@ nr_rrc_ue_decode_dcch( ...@@ -2332,6 +2356,7 @@ nr_rrc_ue_decode_dcch(
if (first_rrcreconfigurationcomplete == 0) { if (first_rrcreconfigurationcomplete == 0) {
first_rrcreconfigurationcomplete = 1; first_rrcreconfigurationcomplete = 1;
#ifdef ITTI_SIM #ifdef ITTI_SIM
if (AMF_MODE_ENABLED) {
as_nas_info_t initialNasMsg; as_nas_info_t initialNasMsg;
memset(&initialNasMsg, 0, sizeof(as_nas_info_t)); memset(&initialNasMsg, 0, sizeof(as_nas_info_t));
generateRegistrationComplete(&initialNasMsg, NULL); generateRegistrationComplete(&initialNasMsg, NULL);
...@@ -2356,6 +2381,15 @@ nr_rrc_ue_decode_dcch( ...@@ -2356,6 +2381,15 @@ nr_rrc_ue_decode_dcch(
itti_send_msg_to_task(TASK_RRC_NRUE, ctxt_pP->instance, message_p); itti_send_msg_to_task(TASK_RRC_NRUE, ctxt_pP->instance, message_p);
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, rnti);
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
} }
} }
...@@ -2527,8 +2561,8 @@ void *rrc_nrue_task( void *args_p ) { ...@@ -2527,8 +2561,8 @@ void *rrc_nrue_task( void *args_p ) {
memcpy (srb_info_p->Rx_buffer.Payload, NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu, memcpy (srb_info_p->Rx_buffer.Payload, NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu,
NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size); NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size);
srb_info_p->Rx_buffer.payload_size = NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size; srb_info_p->Rx_buffer.payload_size = NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size;
// PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, RRC_MAC_CCCH_DATA_IND (msg_p).rnti, RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0); PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_NO, NR_RRC_MAC_CCCH_DATA_IND (msg_p).rnti, NR_RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NR_RRC_MAC_CCCH_DATA_IND (msg_p).rnti, NR_RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0, NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index); // PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NR_RRC_MAC_CCCH_DATA_IND (msg_p).rnti, NR_RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0, NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index);
nr_rrc_ue_decode_ccch (&ctxt, nr_rrc_ue_decode_ccch (&ctxt,
srb_info_p, srb_info_p,
NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index); NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index);
...@@ -2744,11 +2778,10 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ...@@ -2744,11 +2778,10 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_ue_generate_RRCReestablishmentRequest( const protocol_ctxt_t *const ctxt_pP, const uint8_t gNB_index ) void rrc_ue_generate_RRCReestablishmentRequest( const protocol_ctxt_t *const ctxt_pP, const uint8_t gNB_index )
{ {
if(NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size ==0) {
NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size = NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size =
do_RRCReestablishmentRequest( do_RRCReestablishmentRequest(
ctxt_pP->module_id, ctxt_pP->module_id,
(uint8_t *)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload); (uint8_t *)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload, 1);
LOG_I(NR_RRC,"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCReestablishmentRequest (bytes %d, gNB %d)\n", LOG_I(NR_RRC,"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCReestablishmentRequest (bytes %d, gNB %d)\n",
ctxt_pP->module_id, ctxt_pP->frame, NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size, gNB_index); ctxt_pP->module_id, ctxt_pP->frame, NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size, gNB_index);
...@@ -2766,9 +2799,8 @@ void rrc_ue_generate_RRCReestablishmentRequest( const protocol_ctxt_t *const ctx ...@@ -2766,9 +2799,8 @@ void rrc_ue_generate_RRCReestablishmentRequest( const protocol_ctxt_t *const ctx
memcpy (message_buffer, (uint8_t*)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload, memcpy (message_buffer, (uint8_t*)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload,
NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size); NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size);
message_p = itti_alloc_new_message (TASK_RRC_NRUE, UE_RRC_CCCH_DATA_IND); message_p = itti_alloc_new_message (TASK_RRC_NRUE, UE_RRC_CCCH_DATA_IND);
GNB_RRC_CCCH_DATA_IND (message_p).sdu = message_buffer; UE_RRC_CCCH_DATA_IND (message_p).sdu = message_buffer;
GNB_RRC_CCCH_DATA_IND (message_p).size = NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size; UE_RRC_CCCH_DATA_IND (message_p).size = NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size;
itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p); itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p);
#endif #endif
}
} }
...@@ -71,6 +71,7 @@ uint32_t target_dl_mcs = 28; ...@@ -71,6 +71,7 @@ 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) {
...@@ -427,6 +428,7 @@ void *itti_sim_ue_rrc_task( void *args_p) { ...@@ -427,6 +428,7 @@ 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:
...@@ -435,6 +437,7 @@ void *itti_sim_ue_rrc_task( void *args_p) { ...@@ -435,6 +437,7 @@ 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:
...@@ -476,6 +479,7 @@ void *itti_sim_gnb_rrc_task( void *args_p) { ...@@ -476,6 +479,7 @@ 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:
...@@ -483,6 +487,7 @@ void *itti_sim_gnb_rrc_task( void *args_p) { ...@@ -483,6 +487,7 @@ 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;
...@@ -523,7 +528,7 @@ int main( int argc, char **argv ) ...@@ -523,7 +528,7 @@ int main( int argc, char **argv )
} }
AMF_MODE_ENABLED = !IS_SOFTMODEM_NOS1; AMF_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
// AMF_MODE_ENABLED = 0; // AMF_MODE_ENABLED = 0;
NGAP_CONF_MODE = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test; NGAP_CONF_MODE = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
#if T_TRACER #if T_TRACER
......
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