Merge remote-tracking branch 'remotes/origin/develop_SA_L3' into NR_SA_NGAP_RRC_wk42
This commit is contained in:
@@ -17,4 +17,5 @@ set ( UE_DEBUG_TRACE False )
|
||||
set ( UE_TIMING_TRACE False )
|
||||
set ( USRP_REC_PLAY False )
|
||||
set ( SKIP_SHARED_LIB_FLAG False )
|
||||
set ( PHYSIM True)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
|
||||
|
||||
@@ -43,6 +43,77 @@
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int
|
||||
nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
rnti_t rntiP){
|
||||
// todo
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t
|
||||
nr_rrc_data_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
if(sdu_sizeP == 255) {
|
||||
LOG_I(RRC,"sdu_sizeP == 255");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE,
|
||||
ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE,
|
||||
buffer_pP,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt_pP->rnti,
|
||||
muiP,
|
||||
sdu_sizeP);
|
||||
MessageDef *message_p;
|
||||
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
|
||||
uint8_t *message_buffer;
|
||||
message_buffer = itti_malloc (
|
||||
ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE,
|
||||
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
|
||||
sdu_sizeP);
|
||||
memcpy (message_buffer, buffer_pP, sdu_sizeP);
|
||||
message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_ENB : TASK_RRC_UE, RRC_DCCH_DATA_REQ);
|
||||
RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame;
|
||||
RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag;
|
||||
RRC_DCCH_DATA_REQ (message_p).rb_id = rb_idP;
|
||||
RRC_DCCH_DATA_REQ (message_p).muip = muiP;
|
||||
RRC_DCCH_DATA_REQ (message_p).confirmp = confirmP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_sizeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
|
||||
//memcpy (RRC_DCCH_DATA_REQ (message_p).sdu_p, buffer_pP, sdu_sizeP);
|
||||
RRC_DCCH_DATA_REQ (message_p).mode = modeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
|
||||
RRC_DCCH_DATA_REQ (message_p).rnti = ctxt_pP->rnti;
|
||||
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
|
||||
itti_send_msg_to_task (
|
||||
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
|
||||
ctxt_pP->instance,
|
||||
message_p);
|
||||
LOG_I(RRC,"sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB\n");
|
||||
|
||||
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
|
||||
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
|
||||
* messages automatically */
|
||||
if (ctxt_pP->enb_flag && NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type))
|
||||
pdcp_run(ctxt_pP);
|
||||
|
||||
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
|
||||
}
|
||||
|
||||
int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
@@ -114,4 +185,4 @@ int8_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,3 +116,19 @@ void *rrc_gnb_task(void *args_p);
|
||||
|
||||
/* Trigger RRC periodic processing. To be called once per ms. */
|
||||
void nr_rrc_trigger(protocol_ctxt_t *ctxt, int CC_id, int frame, int subframe);
|
||||
|
||||
uint8_t
|
||||
nr_rrc_data_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_size,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
int
|
||||
nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
rnti_t rntiP);
|
||||
|
||||
|
||||
+10
-17
@@ -526,7 +526,7 @@ rrc_gNB_generate_defaultRRCReconfiguration(
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
rrc_data_req(ctxt_pP,
|
||||
nr_rrc_data_req(ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
@@ -557,18 +557,11 @@ rrc_gNB_process_RRCReconfigurationComplete(
|
||||
NR_SRB_ToAddModList_t *SRB_configList = ue_context_pP->ue_context.SRB_configList2[xid];
|
||||
NR_DRB_ToReleaseList_t *DRB_Release_configList2 = ue_context_pP->ue_context.DRB_Release_configList2[xid];
|
||||
NR_DRB_Identity_t *drb_id_p = NULL;
|
||||
uint8_t nr_DRB2LCHAN[8];
|
||||
|
||||
ue_context_pP->ue_context.ue_reestablishment_timer = 0;
|
||||
rnti_t rnti = ue_context_pP->ue_id_rnti;
|
||||
module_id_t module_id = ctxt_pP->module_id;
|
||||
|
||||
int UE_id_mac = find_UE_id(module_id, rnti);
|
||||
|
||||
if (UE_id_mac == -1) {
|
||||
LOG_E(RRC, "Can't find UE_id(MAC) of UE rnti %x\n", rnti);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef PHYSIM
|
||||
/* Derive the keys from kgnb */
|
||||
if (DRB_configList != NULL) {
|
||||
derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm,
|
||||
@@ -582,7 +575,7 @@ rrc_gNB_process_RRCReconfigurationComplete(
|
||||
derive_key_rrc_int(ue_context_pP->ue_context.integrity_algorithm,
|
||||
ue_context_pP->ue_context.kgnb,
|
||||
&kRRCint);
|
||||
|
||||
#endif
|
||||
/* Refresh SRBs/DRBs */
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_PDCP_ENB, NULL, 0, MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
@@ -629,7 +622,7 @@ rrc_gNB_process_RRCReconfigurationComplete(
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
|
||||
if (DRB_configList->list.array[i]->pdcp_Config->moreThanOneRLC->primaryPath.logicalChannel) {
|
||||
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->pdcp_Config->moreThanOneRLC->primaryPath.logicalChannel;
|
||||
nr_DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->pdcp_Config->moreThanOneRLC->primaryPath.logicalChannel;
|
||||
}
|
||||
|
||||
// rrc_mac_config_req_eNB
|
||||
@@ -643,7 +636,7 @@ rrc_gNB_process_RRCReconfigurationComplete(
|
||||
SRB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
CONFIG_ACTION_REMOVE,
|
||||
DRB2LCHAN[i],
|
||||
nr_DRB2LCHAN[i],
|
||||
Rlc_info_um);
|
||||
}
|
||||
|
||||
@@ -778,7 +771,7 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
|
||||
if ((ue_context_p = rrc_gNB_ue_context_5g_s_tmsi_exist(RC.nrrrc[ctxt_pP->module_id], s_tmsi_part1))) {
|
||||
LOG_I(NR_RRC, " 5G-S-TMSI-Part1 exists, ue_context_p %p, old rnti %x => %x\n",ue_context_p, ue_context_p->ue_context.rnti, ctxt_pP->rnti);
|
||||
|
||||
rrc_mac_remove_ue(ctxt_pP->module_id, ue_context_p->ue_context.rnti);
|
||||
nr_rrc_mac_remove_ue(ctxt_pP->module_id, ue_context_p->ue_context.rnti);
|
||||
|
||||
/* replace rnti in the context */
|
||||
/* for that, remove the context from the RB tree */
|
||||
@@ -1419,7 +1412,7 @@ rrc_gNB_generate_SecurityModeCommand(
|
||||
size);
|
||||
|
||||
LOG_I(NR_RRC,"calling rrc_data_req :securityModeCommand\n");
|
||||
rrc_data_req(ctxt_pP,
|
||||
nr_rrc_data_req(ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
@@ -1463,7 +1456,7 @@ rrc_gNB_generate_UECapabilityEnquiry(
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
nr_rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
@@ -1523,7 +1516,7 @@ rrc_gNB_generate_RRCConnectionRelease(
|
||||
F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container_length = size;
|
||||
itti_send_msg_to_task(TASK_CU_F1, ctxt_pP->module_id, m);
|
||||
} else {
|
||||
rrc_data_req(ctxt_pP,
|
||||
nr_rrc_data_req(ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
|
||||
@@ -134,6 +134,7 @@ nr_rrc_pdcp_config_security(
|
||||
hashtable_rc_t h_rc;
|
||||
hash_key_t key;
|
||||
|
||||
#ifndef PHYSIM
|
||||
/* Derive the keys from kgnb */
|
||||
if (SRB_configList != NULL) {
|
||||
derive_key_up_enc(ue_context_pP->ue_context.ciphering_algorithm,
|
||||
@@ -147,6 +148,7 @@ nr_rrc_pdcp_config_security(
|
||||
derive_key_rrc_int(ue_context_pP->ue_context.integrity_algorithm,
|
||||
ue_context_pP->ue_context.kgnb,
|
||||
&kRRCint);
|
||||
#endif
|
||||
if (!IS_SOFTMODEM_IQPLAYER) {
|
||||
SET_LOG_DUMP(DEBUG_SECURITY) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user