Commit b3ff033e authored by Robert Schmidt's avatar Robert Schmidt

Do not decode RRC Container in DL RRC message

The RRC container is transparent for the DU. Hence, we should not decode
it.
parent 27566f49
......@@ -139,19 +139,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
.rnti = f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id),
.srb_id = srb_id
};
int rc = dl_rrc_message(instance, &dl_rrc);
if (rc == 0)
return 0; /* has been handled, otherwise continue below */
// decode RRC Container and act on the message type
AssertFatal(srb_id<3,"illegal srb_id\n");
MessageDef *msg = itti_alloc_new_message(TASK_DU_F1, 0, NR_DU_RRC_DL_INDICATION);
NRDuDlReq_t *req=&NRDuDlReq(msg);
req->rnti=f1ap_get_rnti_by_du_id(DUtype, instance, du_ue_f1ap_id);
req->srb_id=srb_id;
req->buf= get_free_mem_block( ie->value.choice.RRCContainer.size, __func__);
memcpy(req->buf->data, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
itti_send_msg_to_task(TASK_RRC_GNB, instance, msg);
dl_rrc_message(instance, &dl_rrc);
return 0;
}
......
......@@ -29,95 +29,10 @@
#include "NR_DL-CCCH-Message.h"
#include "NR_CellGroupConfig.h"
int dl_rrc_message_rrcSetup(module_id_t module_id, const f1ap_dl_rrc_message_t *dl_rrc, NR_RRCSetup_t *rrcSetup);
int dl_rrc_message(module_id_t module_id, const f1ap_dl_rrc_message_t *dl_rrc)
{
/* dispatch message to dl_rrc_message_rrcSetup() and others, similar to as is
* done in the DU (should be the same here) */
LOG_D(NR_MAC, "DL RRC Message Transfer with %d bytes for RNTI %04x SRB %d\n", dl_rrc->rrc_container_length, dl_rrc->rnti, dl_rrc->srb_id);
if (dl_rrc->srb_id == CCCH) { // SRB 0
NR_DL_CCCH_Message_t *dl_ccch_msg = NULL;
asn_dec_rval_t dec_rval = uper_decode(NULL,
&asn_DEF_NR_DL_CCCH_Message,
(void **) &dl_ccch_msg,
dl_rrc->rrc_container,
dl_rrc->rrc_container_length,
0,
0);
AssertFatal(dec_rval.code == RC_OK, "could not decode F1AP message\n");
switch (dl_ccch_msg->message.choice.c1->present) {
case NR_DL_CCCH_MessageType__c1_PR_NOTHING:
LOG_W(NR_MAC, "Received NOTHING on DL-CCCH-Message\n");
break;
case NR_DL_CCCH_MessageType__c1_PR_rrcReject:
LOG_D(NR_MAC, "DL-CCCH/SRB0, received rrcReject for RNTI %04x\n", dl_rrc->rnti);
AssertFatal(0, "rrcReject not implemented yet\n");
break;
case NR_DL_CCCH_MessageType__c1_PR_rrcSetup:
LOG_D(NR_MAC, "DL-CCCH/SRB0, received rrcSetup for RNTI %04x\n", dl_rrc->rnti);
return dl_rrc_message_rrcSetup(module_id, dl_rrc, dl_ccch_msg->message.choice.c1->choice.rrcSetup);
break;
case NR_DL_CCCH_MessageType__c1_PR_spare2:
LOG_W(NR_MAC, "DL-CCCH/SRB0, received spare2\n");
break;
case NR_DL_CCCH_MessageType__c1_PR_spare1:
LOG_W(NR_MAC, "DL-CCCH/SRB0, received spare1\n");
break;
default:
AssertFatal(0 == 1, "Unknown DL-CCCH/SRB0 message %d\n", dl_ccch_msg->message.choice.c1->present);
break;
}
return 0;
} else if (dl_rrc->srb_id == DCCH) { // SRB 1
nr_rlc_srb_recv_sdu(dl_rrc->rnti, DCCH, dl_rrc->rrc_container, dl_rrc->rrc_container_length);
return 0;
} else if (dl_rrc->srb_id == DCCH1) { // SRB 2
nr_rlc_srb_recv_sdu(dl_rrc->rnti, DCCH1, dl_rrc->rrc_container, dl_rrc->rrc_container_length);
return 0;
}
return -1; /* not handled yet */
}
int dl_rrc_message_rrcSetup(module_id_t module_id, const f1ap_dl_rrc_message_t *dl_rrc, NR_RRCSetup_t *rrcSetup)
{
DevAssert(rrcSetup != NULL);
NR_RRCSetup_IEs_t *rrcSetup_ies = rrcSetup->criticalExtensions.choice.rrcSetup;
AssertFatal(rrcSetup_ies->masterCellGroup.buf != NULL,"masterCellGroup is NULL\n");
NR_CellGroupConfig_t *cellGroup = NULL;
asn_dec_rval_t dec_rval = uper_decode(NULL,
&asn_DEF_NR_CellGroupConfig,
(void **)&cellGroup,
rrcSetup_ies->masterCellGroup.buf,
rrcSetup_ies->masterCellGroup.size,
0,
0);
AssertFatal(dec_rval.code == RC_OK, "could not decode masterCellGroup\n");
/* there might be a memory leak for the cell group if we call this multiple
* times. */
nr_mac_update_cellgroup(RC.nrmac[module_id], dl_rrc->rnti, cellGroup);
/* TODO: drop the RRC context */
gNB_RRC_INST *rrc = RC.nrrrc[module_id];
rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context_by_rnti(rrc, dl_rrc->rnti);
gNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
ue_p->SRB_configList = rrcSetup_ies->radioBearerConfig.srb_ToAddModList;
ue_p->masterCellGroup = cellGroup;
nr_rlc_srb_recv_sdu(dl_rrc->rnti, CCCH, dl_rrc->rrc_container, dl_rrc->rrc_container_length);
/* the cellGroup sent to CU specifies there is SRB1, so create it */
DevAssert(cellGroup->rlc_BearerToAddModList->list.count == 1);
const NR_RLC_BearerConfig_t *bearer = cellGroup->rlc_BearerToAddModList->list.array[0];
DevAssert(bearer->servedRadioBearer->choice.srb_Identity == 1);
nr_rlc_add_srb(dl_rrc->rnti, DCCH, bearer);
LOG_I(NR_MAC, "DL RRC Message Transfer with %d bytes for RNTI %04x SRB %d\n", dl_rrc->rrc_container_length, dl_rrc->rnti, dl_rrc->srb_id);
nr_rlc_srb_recv_sdu(dl_rrc->rnti, dl_rrc->srb_id, dl_rrc->rrc_container, dl_rrc->rrc_container_length);
return 0;
}
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