Commit ad2b1c4a authored by Cedric Roux's avatar Cedric Roux

rlc v2: fix for CU/DU split

Limitation: this fix only works if there is only one eNB,
because we force module_id = 0 in the function deliver_sdu where
(as the code is today) we have no way to know which module_id is
concerned. More generally, the rlc v2 does not work with more than
1 eNB.
parent 4649c05c
......@@ -337,6 +337,9 @@ void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char *dataP, con
{
}
#include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
static void deliver_sdu(void *_ue, rlc_entity_t *entity, char *buf, int size)
{
rlc_ue_t *ue = _ue;
......@@ -399,9 +402,23 @@ rb_found:
T(T_ENB_RLC_UL,
T_INT(0 /*ctxt_pP->module_id*/),
T_INT(ue->rnti), T_INT(rb_id), T_INT(size));
const ngran_node_t type = RC.rrc[0 /*ctxt_pP->module_id*/]->node_type;
AssertFatal(type != ngran_eNB_CU && type != ngran_ng_eNB_CU && type != ngran_gNB_CU,
"Can't be CU, bad node type %d\n", type);
if (NODE_IS_DU(type) && is_srb == 1) {
MessageDef *msg = itti_alloc_new_message(TASK_RLC_ENB, F1AP_UL_RRC_MESSAGE);
F1AP_UL_RRC_MESSAGE(msg).rnti = ue->rnti;
F1AP_UL_RRC_MESSAGE(msg).srb_id = rb_id;
F1AP_UL_RRC_MESSAGE(msg).rrc_container = (unsigned char *)buf;
F1AP_UL_RRC_MESSAGE(msg).rrc_container_length = size;
itti_send_msg_to_task(TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(0 /*ctxt_pP->module_id*/), msg);
return;
}
}
if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock)) {
if (!get_pdcp_data_ind_func()(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
/* what to do in case of failure? for the moment: nothing */
}
......
......@@ -3533,16 +3533,18 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
, NULL);
/* Refresh SRBs/DRBs */
rrc_rlc_config_asn1_req(ctxt_pP,
*SRB_configList2, // NULL,
*DRB_configList,
NULL
if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
rrc_rlc_config_asn1_req(ctxt_pP,
*SRB_configList2, // NULL,
*DRB_configList,
NULL
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
, (LTE_PMCH_InfoList_r9_t *) NULL,
0,
0
, (LTE_PMCH_InfoList_r9_t *) NULL,
0,
0
#endif
);
);
}
free(Sparams);
Sparams = NULL;
......@@ -6077,16 +6079,18 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct
, NULL);
/* Refresh SRBs/DRBs */
rrc_rlc_config_asn1_req(ctxt_pP,
*SRB_configList2, // NULL,
*DRB_configList,
NULL
if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
rrc_rlc_config_asn1_req(ctxt_pP,
*SRB_configList2, // NULL,
*DRB_configList,
NULL
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
, (LTE_PMCH_InfoList_r9_t *) NULL,
0,
0
, (LTE_PMCH_InfoList_r9_t *) NULL,
0,
0
#endif
);
);
}
free(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ);
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ = NULL;
......@@ -6131,12 +6135,14 @@ rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s *ue_context_p, protoc
NULL,
NULL,
(LTE_PMCH_InfoList_r9_t *) NULL, NULL);
rrc_rlc_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList,
(LTE_DRB_ToAddModList_t *) NULL,
(LTE_DRB_ToReleaseList_t *) NULL,
(LTE_PMCH_InfoList_r9_t *) NULL, 0, 0
);
if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
rrc_rlc_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList,
(LTE_DRB_ToAddModList_t *) NULL,
(LTE_DRB_ToReleaseList_t *) NULL,
(LTE_PMCH_InfoList_r9_t *) NULL, 0, 0
);
}
if (EPC_MODE_ENABLED) {
rrc_eNB_process_security (
......@@ -6271,14 +6277,16 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
(LTE_PMCH_InfoList_r9_t *) NULL,
NULL);
/* Refresh SRBs/DRBs */
rrc_rlc_config_asn1_req(ctxt_pP,
SRB_configList, // NULL,
DRB_configList,
DRB_Release_configList2,
(LTE_PMCH_InfoList_r9_t *) NULL,
0,
0
);
if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type)) {
rrc_rlc_config_asn1_req(ctxt_pP,
SRB_configList, // NULL,
DRB_configList,
DRB_Release_configList2,
(LTE_PMCH_InfoList_r9_t *) NULL,
0,
0
);
}
/* Set the SRB active in UE context */
if (SRB_configList != NULL) {
......
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