Commit 7b9f610b authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/F1_SRB1' into integration_2022_wk50

parents cc55c431 7c3b0030
...@@ -36,7 +36,9 @@ int dl_rrc_message(module_id_t module_id, const f1ap_dl_rrc_message_t *dl_rrc) ...@@ -36,7 +36,9 @@ 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 /* dispatch message to dl_rrc_message_rrcSetup() and others, similar to as is
* done in the DU (should be the same here) */ * done in the DU (should be the same here) */
if (dl_rrc->srb_id == 0) { 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);
if (dl_rrc->srb_id == CCCH) { // SRB 0
NR_DL_CCCH_Message_t *dl_ccch_msg = NULL; NR_DL_CCCH_Message_t *dl_ccch_msg = NULL;
asn_dec_rval_t dec_rval = uper_decode(NULL, asn_dec_rval_t dec_rval = uper_decode(NULL,
...@@ -71,6 +73,12 @@ int dl_rrc_message(module_id_t module_id, const f1ap_dl_rrc_message_t *dl_rrc) ...@@ -71,6 +73,12 @@ int dl_rrc_message(module_id_t module_id, const f1ap_dl_rrc_message_t *dl_rrc)
break; break;
} }
return 0; 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 */ return -1; /* not handled yet */
...@@ -115,7 +123,7 @@ int dl_rrc_message_rrcSetup(module_id_t module_id, const f1ap_dl_rrc_message_t * ...@@ -115,7 +123,7 @@ int dl_rrc_message_rrcSetup(module_id_t module_id, const f1ap_dl_rrc_message_t *
ue_p->SRB_configList = rrcSetup_ies->radioBearerConfig.srb_ToAddModList; ue_p->SRB_configList = rrcSetup_ies->radioBearerConfig.srb_ToAddModList;
ue_p->masterCellGroup = cellGroup; ue_p->masterCellGroup = cellGroup;
nr_rlc_srb0_recv_sdu(dl_rrc->rnti, dl_rrc->rrc_container, dl_rrc->rrc_container_length); nr_rlc_srb_recv_sdu(dl_rrc->rnti, CCCH, dl_rrc->rrc_container, dl_rrc->rrc_container_length);
protocol_ctxt_t ctxt = {.module_id = module_id, .rntiMaybeUEid = dl_rrc->rnti}; protocol_ctxt_t ctxt = {.module_id = module_id, .rntiMaybeUEid = dl_rrc->rnti};
nr_rrc_rlc_config_asn1_req(&ctxt, nr_rrc_rlc_config_asn1_req(&ctxt,
......
...@@ -745,9 +745,7 @@ static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity, ...@@ -745,9 +745,7 @@ static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity,
{ {
nr_pdcp_ue_t *ue = _ue; nr_pdcp_ue_t *ue = _ue;
int srb_id; int srb_id;
protocol_ctxt_t ctxt;
int i; int i;
mem_block_t *memblock;
for (i = 0; i < sizeofArray(ue->srb) ; i++) { for (i = 0; i < sizeofArray(ue->srb) ; i++) {
if (entity == ue->srb[i]) { if (entity == ue->srb[i]) {
...@@ -766,21 +764,18 @@ srb_found: ...@@ -766,21 +764,18 @@ srb_found:
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]); //for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]);
//printf("\n"); //printf("\n");
if ((RC.nrrrc == NULL) || (!NODE_IS_CU(RC.nrrrc[0]->node_type))) { if ((RC.nrrrc == NULL) || (!NODE_IS_CU(RC.nrrrc[0]->node_type))) {
ctxt.module_id = 0; if (entity->is_gnb) {
ctxt.enb_flag = 1; f1ap_dl_rrc_message_t dl_rrc = {.old_gNB_DU_ue_id = 0xFFFFFF, .rrc_container = (uint8_t *)buf, .rrc_container_length = size, .rnti = ue->rntiMaybeUEid, .srb_id = DCCH};
ctxt.instance = 0; gNB_RRC_INST *rrc = RC.nrrrc[0];
ctxt.frame = 0; rrc->mac_rrc.dl_rrc_message_transfer(0, &dl_rrc);
ctxt.subframe = 0; } else { // UE
ctxt.eNB_index = 0; mem_block_t *memblock;
ctxt.brOption = 0; protocol_ctxt_t ctxt = {.module_id = 0, .enb_flag = 1, .instance = 0, .frame = 0, .subframe = 0, .eNB_index = 0, .brOption = 0, .rntiMaybeUEid = ue->rntiMaybeUEid};
memblock = get_free_mem_block(size, __FUNCTION__);
ctxt.rntiMaybeUEid = ue->rntiMaybeUEid; memcpy(memblock->data, buf, size);
enqueue_rlc_data_req(&ctxt, 1, MBMS_FLAG_NO, srb_id, sdu_id, 0, size, memblock);
memblock = get_free_mem_block(size, __FUNCTION__); }
memcpy(memblock->data, buf, size); } else {
enqueue_rlc_data_req(&ctxt, 1, MBMS_FLAG_NO, srb_id, sdu_id, 0, size, memblock);
}
else {
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_DL_RRC_MESSAGE); MessageDef *message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_DL_RRC_MESSAGE);
uint8_t *message_buffer = itti_malloc (TASK_RRC_GNB, TASK_CU_F1, size); uint8_t *message_buffer = itti_malloc (TASK_RRC_GNB, TASK_CU_F1, size);
memcpy (message_buffer, buf, size); memcpy (message_buffer, buf, size);
......
...@@ -748,7 +748,7 @@ static void add_rlc_srb(int rnti, struct NR_SRB_ToAddMod *s, NR_RLC_BearerConfig ...@@ -748,7 +748,7 @@ static void add_rlc_srb(int rnti, struct NR_SRB_ToAddMod *s, NR_RLC_BearerConfig
nr_rlc_manager_lock(nr_rlc_ue_manager); nr_rlc_manager_lock(nr_rlc_ue_manager);
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rnti); ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rnti);
if (ue->srb[srb_id-1] != NULL) { if (ue->srb[srb_id-1] != NULL) {
LOG_W(RLC, "%s:%d:%s: SRB %d already exists for UE with RNTI 0x%x, do nothing\n", __FILE__, __LINE__, __FUNCTION__, srb_id, rnti); LOG_W(RLC, "%s:%d:%s: SRB %d already exists for UE with RNTI %04x, do nothing\n", __FILE__, __LINE__, __FUNCTION__, srb_id, rnti);
} else { } else {
/* hack: hardcode values for NR */ /* hack: hardcode values for NR */
t_poll_retransmit = 45; t_poll_retransmit = 45;
...@@ -838,7 +838,7 @@ static void add_drb_am(int rnti, struct NR_DRB_ToAddMod *s, NR_RLC_BearerConfig_ ...@@ -838,7 +838,7 @@ static void add_drb_am(int rnti, struct NR_DRB_ToAddMod *s, NR_RLC_BearerConfig_
nr_rlc_manager_lock(nr_rlc_ue_manager); nr_rlc_manager_lock(nr_rlc_ue_manager);
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rnti); ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rnti);
if (ue->drb[drb_id-1] != NULL) { if (ue->drb[drb_id-1] != NULL) {
LOG_W(RLC, "%s:%d:%s: DRB %d already exists for UE with RNTI %d, do nothing\n", __FILE__, __LINE__, __FUNCTION__, drb_id, rnti); LOG_W(RLC, "%s:%d:%s: DRB %d already exists for UE with RNTI %04x, do nothing\n", __FILE__, __LINE__, __FUNCTION__, drb_id, rnti);
} else { } else {
nr_rlc_am = new_nr_rlc_entity_am(10000000, nr_rlc_am = new_nr_rlc_entity_am(10000000,
10000000, 10000000,
...@@ -1240,7 +1240,7 @@ const bool nr_rlc_get_statistics( ...@@ -1240,7 +1240,7 @@ const bool nr_rlc_get_statistics(
return ret; return ret;
} }
void nr_rlc_srb0_recv_sdu(int rnti, unsigned char *buf, int size) void nr_rlc_srb_recv_sdu(const int rnti, const logical_chan_id_t channel_id, unsigned char *buf, int size)
{ {
nr_rlc_ue_t *ue; nr_rlc_ue_t *ue;
nr_rlc_entity_t *rb; nr_rlc_entity_t *rb;
...@@ -1250,8 +1250,13 @@ void nr_rlc_srb0_recv_sdu(int rnti, unsigned char *buf, int size) ...@@ -1250,8 +1250,13 @@ void nr_rlc_srb0_recv_sdu(int rnti, unsigned char *buf, int size)
nr_rlc_manager_lock(nr_rlc_ue_manager); nr_rlc_manager_lock(nr_rlc_ue_manager);
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rnti); ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rnti);
rb = ue->srb0; if (channel_id == 0) {
AssertFatal(rb != NULL, "SDU sent to unknown RB rnti %d srb0\n", rnti); rb = ue->srb0;
} else {
rb = ue->srb[channel_id - 1];
}
AssertFatal(rb != NULL, "SDU sent to unknown RB RNTI %04x SRB %d\n", rnti, channel_id);
rb->set_time(rb, nr_rlc_current_time); rb->set_time(rb, nr_rlc_current_time);
rb->recv_sdu(rb, (char *)buf, size, -1); rb->recv_sdu(rb, (char *)buf, size, -1);
......
...@@ -59,7 +59,7 @@ void nr_rlc_activate_avg_time_to_tx( ...@@ -59,7 +59,7 @@ void nr_rlc_activate_avg_time_to_tx(
const logical_chan_id_t channel_id, const logical_chan_id_t channel_id,
const bool is_on); const bool is_on);
void nr_rlc_srb0_recv_sdu(int rnti, unsigned char *buf, int size); void nr_rlc_srb_recv_sdu(const int rnti, const logical_chan_id_t channel_id, unsigned char *buf, int size);
void nr_rlc_activate_srb0(int rnti, int module_id, int cc_id, int uid, void nr_rlc_activate_srb0(int rnti, int module_id, int cc_id, int uid,
void (*send_initial_ul_rrc_message)( void (*send_initial_ul_rrc_message)(
......
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