Commit 0aec0d91 authored by francescomani's avatar francescomani Committed by luis_pereira87

temporary workaround for RRC passing CG to MAC (forced encoding of message at MAC)

parent d7dae8fa
......@@ -544,8 +544,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
gNB->nr_gold_pdsch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
// ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1;
// ceil(((NB_RB*12(k)*2(QPSK)/32) // 3 RE *2(QPSK)
int pdsch_dmrs_init_length = ((fp->N_RB_DL*24)>>5)+1;
for (int slot=0; slot<fp->slots_per_frame; slot++) {
pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot);
......
......@@ -654,7 +654,23 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
}
int target_ss;
UE->CellGroup = CellGroup;
/* copy CellGroup by calling asn1c encode
this is a temporary hack to avoid the gNB having
a pointer to RRC CellGroup structure
(otherwise it would be applied to early)
TODO remove once we have a proper implementation */
UE->enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL,
(void *)CellGroup,
UE->cg_buf,
32768);
if(UE->enc_rval.encoded == -1) {
LOG_E(NR_MAC, "ASN1 message CellGroupConfig encoding failed (%s, %lu)!\n",
UE->enc_rval.failed_type->name, UE->enc_rval.encoded);
exit(1);
}
LOG_I(NR_MAC,"Modified rnti %04x with CellGroup\n",rnti);
process_CellGroup(CellGroup,&UE->UE_sched_ctrl);
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
......
......@@ -2910,7 +2910,15 @@ void nr_mac_update_timers(module_id_t module_id,
LOG_I(NR_MAC, "(%d.%d) De-activating RRC processing timer for UE %04x\n", frame, slot, UE->rnti);
const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL;
NR_CellGroupConfig_t *cg = UE->CellGroup;
NR_CellGroupConfig_t *cg = NULL;
uper_decode(NULL,
&asn_DEF_NR_CellGroupConfig, //might be added prefix later
(void **)&cg,
(uint8_t *)UE->cg_buf,
(UE->enc_rval.encoded+7)/8, 0, 0);
UE->CellGroup = cg;
NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon;
const NR_ServingCellConfig_t *spCellConfigDedicated = cg && cg->spCellConfig ? cg->spCellConfig->spCellConfigDedicated : NULL;
......
......@@ -710,6 +710,8 @@ typedef struct {
NR_UE_sched_ctrl_t UE_sched_ctrl;
NR_mac_stats_t mac_stats;
NR_CellGroupConfig_t *CellGroup;
char cg_buf[32768]; /* arbitrary size */
asn_enc_rval_t enc_rval;
/// CCE indexing
int m;
// UE selected beam index
......
......@@ -734,6 +734,19 @@ rrc_gNB_generate_defaultRRCReconfiguration(
NULL,
ue_p->masterCellGroup);
rrc_mac_config_req_gNB(rrc->module_id,
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
rrc->configuration.minRXTXTIME,
NULL,
NULL,
NULL,
0,
ue_p->rnti,
ue_p->masterCellGroup);
free(ue_context_pP->ue_context.nas_pdu.buffer);
LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Reconfiguration\n");
......@@ -1435,18 +1448,6 @@ rrc_gNB_process_RRCReconfigurationComplete(
/* Refresh SRBs/DRBs */
if (!NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
rrc_mac_config_req_gNB(rrc->module_id,
rrc->configuration.ssb_SubcarrierOffset,
rrc->configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
rrc->configuration.minRXTXTIME,
NULL,
NULL,
NULL,
0,
ue_context_pP->ue_context.rnti,
ue_context_pP->ue_context.masterCellGroup);
LOG_D(NR_RRC,"Configuring RLC DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti);
nr_rrc_rlc_config_asn1_req(ctxt_pP,
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