Commit 0d86181a authored by francescomani's avatar francescomani

using uid also in SA

parent 2ded9658
...@@ -325,7 +325,14 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, ...@@ -325,7 +325,14 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
NR_ServingCellConfigCommon_t *scc=RC.nrrrc[module_idP]->carrier.servingcellconfigcommon; NR_ServingCellConfigCommon_t *scc=RC.nrrrc[module_idP]->carrier.servingcellconfigcommon;
memset(&cellGroupConfig,0,sizeof(cellGroupConfig)); memset(&cellGroupConfig,0,sizeof(cellGroupConfig));
fill_initial_cellGroupConfig(rntiP,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier); struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[module_idP]);
ue_context_p->ue_id_rnti = rntiP;
ue_context_p->ue_context.rnti = rntiP;
ue_context_p->ue_context.random_ue_identity = rntiP;
ue_context_p->ue_context.Srb0.Active = 1;
RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[module_idP]->rrc_ue_head, ue_context_p);
fill_initial_cellGroupConfig(ue_context_p->local_uid,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier);
MessageDef* tmp=itti_alloc_new_message_sized(TASK_RRC_GNB, 0, F1AP_INITIAL_UL_RRC_MESSAGE, sizeof(f1ap_initial_ul_rrc_message_t) + sdu_lenP); MessageDef* tmp=itti_alloc_new_message_sized(TASK_RRC_GNB, 0, F1AP_INITIAL_UL_RRC_MESSAGE, sizeof(f1ap_initial_ul_rrc_message_t) + sdu_lenP);
f1ap_initial_ul_rrc_message_t *msg = &F1AP_INITIAL_UL_RRC_MESSAGE(tmp); f1ap_initial_ul_rrc_message_t *msg = &F1AP_INITIAL_UL_RRC_MESSAGE(tmp);
...@@ -347,13 +354,6 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, ...@@ -347,13 +354,6 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
msg->rrc_container_length=sdu_lenP; msg->rrc_container_length=sdu_lenP;
itti_send_msg_to_task(TASK_DU_F1, 0, tmp); itti_send_msg_to_task(TASK_DU_F1, 0, tmp);
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[module_idP]);
ue_context_p->ue_id_rnti = rntiP;
ue_context_p->ue_context.rnti = rntiP;
ue_context_p->ue_context.random_ue_identity = rntiP;
ue_context_p->ue_context.Srb0.Active = 1;
RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[module_idP]->rrc_ue_head, ue_context_p);
return(0); return(0);
} }
......
...@@ -976,7 +976,7 @@ uint8_t do_RRCReject(uint8_t Mod_id, ...@@ -976,7 +976,7 @@ uint8_t do_RRCReject(uint8_t Mod_id,
return((enc_rval.encoded+7)/8); return((enc_rval.encoded+7)/8);
} }
void fill_initial_SpCellConfig(rnti_t rnti, void fill_initial_SpCellConfig(int uid,
NR_SpCellConfig_t *SpCellConfig, NR_SpCellConfig_t *SpCellConfig,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
rrc_gNB_carrier_data_t *carrier) { rrc_gNB_carrier_data_t *carrier) {
...@@ -1009,9 +1009,8 @@ void fill_initial_SpCellConfig(rnti_t rnti, ...@@ -1009,9 +1009,8 @@ void fill_initial_SpCellConfig(rnti_t rnti,
// one symbol (13) // one symbol (13)
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
pucchres0->pucch_ResourceId=0; pucchres0->pucch_ResourceId=0;
//pucchres0->startingPRB=0; pucchres0->startingPRB=(8+uid) % curr_bwp;
pucchres0->startingPRB=(8+rnti) % curr_bwp; LOG_D(NR_RRC, "pucchres0->startPRB %ld uid %d curr_bwp %d\n", pucchres0->startingPRB, uid, curr_bwp);
LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp);
pucchres0->intraSlotFrequencyHopping=NULL; pucchres0->intraSlotFrequencyHopping=NULL;
pucchres0->secondHopPRB=NULL; pucchres0->secondHopPRB=NULL;
pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0; pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
...@@ -1396,7 +1395,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ...@@ -1396,7 +1395,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb); ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb);
} }
void fill_initial_cellGroupConfig(rnti_t rnti, void fill_initial_cellGroupConfig(int uid,
NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
rrc_gNB_carrier_data_t *carrier) { rrc_gNB_carrier_data_t *carrier) {
...@@ -1490,7 +1489,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti, ...@@ -1490,7 +1489,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti,
cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig)); cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig));
fill_initial_SpCellConfig(rnti,cellGroupConfig->spCellConfig,scc,carrier); fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,carrier);
cellGroupConfig->sCellToAddModList = NULL; cellGroupConfig->sCellToAddModList = NULL;
cellGroupConfig->sCellToReleaseList = NULL; cellGroupConfig->sCellToReleaseList = NULL;
...@@ -1569,7 +1568,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, ...@@ -1569,7 +1568,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
} }
else { else {
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,cellGroupConfig,scc,carrier); fill_initial_cellGroupConfig(ue_context_pP->local_uid,cellGroupConfig,scc,carrier);
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL, NULL,
......
...@@ -100,12 +100,12 @@ void do_SpCellConfig(gNB_RRC_INST *rrc, ...@@ -100,12 +100,12 @@ void do_SpCellConfig(gNB_RRC_INST *rrc,
uint8_t do_RRCReject(uint8_t Mod_id, uint8_t do_RRCReject(uint8_t Mod_id,
uint8_t *const buffer); uint8_t *const buffer);
void fill_initial_SpCellConfig(rnti_t rnti, void fill_initial_SpCellConfig(int uid,
NR_SpCellConfig_t *SpCellConfig, NR_SpCellConfig_t *SpCellConfig,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
rrc_gNB_carrier_data_t *carrier); rrc_gNB_carrier_data_t *carrier);
void fill_initial_cellGroupConfig(rnti_t rnti, void fill_initial_cellGroupConfig(int uid,
NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
rrc_gNB_carrier_data_t *carrier); rrc_gNB_carrier_data_t *carrier);
......
...@@ -889,9 +889,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -889,9 +889,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList)); pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
pucch_Config->resourceToReleaseList = NULL; pucch_Config->resourceToReleaseList = NULL;
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
NR_PUCCH_Resource_t *pucchres1=calloc(1,sizeof(*pucchres1));
NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2)); NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
NR_PUCCH_Resource_t *pucchres3=calloc(1,sizeof(*pucchres3));
pucchres0->pucch_ResourceId=1; pucchres0->pucch_ResourceId=1;
pucchres0->startingPRB= (8 + uid) % curr_bwp; pucchres0->startingPRB= (8 + uid) % curr_bwp;
......
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