Commit f8464b9e authored by francescomani's avatar francescomani

MAC configuration of logical channel identities

parent 0982bf26
...@@ -511,16 +511,26 @@ void configure_ss_coreset(NR_UE_MAC_INST_t *mac, ...@@ -511,16 +511,26 @@ void configure_ss_coreset(NR_UE_MAC_INST_t *mac,
mac->BWP_coresets[i] = NULL; mac->BWP_coresets[i] = NULL;
} }
// todo handle mac_LogicalChannelConfig void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
int nr_rrc_mac_config_req_ue_logicalChannelBearer( struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_toadd_list,
module_id_t module_id, struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_torelease_list)
int cc_idP, {
uint8_t gNB_index,
long logicalChannelIdentity,
bool status){
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
mac->logicalChannelBearer_exist[logicalChannelIdentity] = status; if(rlc_toadd_list) {
return 0; for (int i = 0; i < rlc_toadd_list->list.count; i++) {
NR_RLC_BearerConfig_t *rlc_bearer = rlc_toadd_list->list.array[i];
int id = rlc_bearer->logicalChannelIdentity - 1;
mac->active_RLC_bearer[id] = true;
}
}
if (rlc_torelease_list) {
for (int i = 0; i < rlc_torelease_list->list.count; i++) {
if(rlc_torelease_list->list.array[i]) {
int id = *rlc_torelease_list->list.array[i] - 1;
mac->active_RLC_bearer[id] = false;
}
}
}
} }
......
...@@ -503,7 +503,7 @@ typedef struct { ...@@ -503,7 +503,7 @@ typedef struct {
uint8_t BSR_reporting_active; uint8_t BSR_reporting_active;
/// LogicalChannelConfig has bearer. /// LogicalChannelConfig has bearer.
bool logicalChannelBearer_exist[NR_MAX_NUM_LCID]; bool active_RLC_bearer[NR_MAX_NUM_LCID];
NR_UE_SCHEDULING_INFO scheduling_info; NR_UE_SCHEDULING_INFO scheduling_info;
/// PHR /// PHR
......
...@@ -63,17 +63,9 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id, ...@@ -63,17 +63,9 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
uint8_t *pduP, uint8_t *pduP,
uint32_t pdu_len); uint32_t pdu_len);
/**\brief primitive from RRC layer to MAC layer to set if bearer exists for a logical channel. todo handle mac_LogicalChannelConfig void nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
\param module_id module id struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_toadd_list,
\param cc_id component carrier id struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_torelease_list);
\param gNB_index gNB index
\param long logicalChannelIdentity
\param bool status*/
int nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id_t module_id,
int cc_idP,
uint8_t gNB_index,
long logicalChannelIdentity,
bool status);
void nr_rrc_mac_config_req_scg(module_id_t module_id, void nr_rrc_mac_config_req_scg(module_id_t module_id,
int cc_idP, int cc_idP,
......
...@@ -78,7 +78,10 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) { ...@@ -78,7 +78,10 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
nr_pdcp_layer_init(); nr_pdcp_layer_init();
nr_pdcp_add_drbs(ENB_FLAG_NO, nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList, 0, NULL, NULL); nr_pdcp_add_drbs(ENB_FLAG_NO, nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList, 0, NULL, NULL);
nr_rlc_add_drb(nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList->list.array[0]->drb_Identity, rlc_rbconfig); nr_rlc_add_drb(nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList->list.array[0]->drb_Identity, rlc_rbconfig);
nr_ue_mac_inst->logicalChannelBearer_exist[4] = true; struct NR_CellGroupConfig__rlc_BearerToAddModList rlc_toadd_list;
rlc_toadd_list.list.count = 1;
rlc_toadd_list.list.array[0] = rlc_rbconfig;
nr_rrc_mac_config_req_ue_logicalChannelBearer(0, &rlc_toadd_list, NULL);
// free memory // free memory
free_nr_noS1_bearer_config(&rbconfig, &rlc_rbconfig); free_nr_noS1_bearer_config(&rbconfig, &rlc_rbconfig);
......
This diff is collapsed.
...@@ -163,7 +163,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR ...@@ -163,7 +163,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
return -1; return -1;
} }
nr_rrc_manage_rlc_bearers(cellGroupConfig, &NR_UE_rrc_inst[module_id], 0, NR_UE_rrc_inst[module_id].rnti); if(get_softmodem_params()->sa || get_softmodem_params()->nsa)
nr_rrc_manage_rlc_bearers(cellGroupConfig, &NR_UE_rrc_inst[module_id], 0, module_id, NR_UE_rrc_inst[module_id].rnti);
if(get_softmodem_params()->sa || get_softmodem_params()->nsa) { if(get_softmodem_params()->sa || get_softmodem_params()->nsa) {
if (LOG_DEBUGFLAG(DEBUG_ASN1)) { if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
...@@ -222,7 +223,8 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){ ...@@ -222,7 +223,8 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){
} }
void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message,int msg_len) { void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, void *message,int msg_len)
{
module_id_t module_id=0; // TODO module_id_t module_id=0; // TODO
switch (nsa_message_type) { switch (nsa_message_type) {
case nr_SecondaryCellGroupConfig_r15: case nr_SecondaryCellGroupConfig_r15:
...@@ -338,8 +340,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_fi ...@@ -338,8 +340,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* reconfig_fi
fclose(fd); fclose(fd);
process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, buffer,msg_len); process_nsa_message(NR_UE_rrc_inst, nr_RadioBearerConfigX_r15, buffer,msg_len);
} }
else if (get_softmodem_params()->nsa) else if (get_softmodem_params()->nsa) {
{
LOG_D(NR_RRC, "In NSA mode \n"); LOG_D(NR_RRC, "In NSA mode \n");
} }
...@@ -755,6 +756,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id_t module_id, ...@@ -755,6 +756,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id_t module_id,
void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig, void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
NR_UE_RRC_INST_t *rrc, NR_UE_RRC_INST_t *rrc,
int gNB_index, int gNB_index,
module_id_t module_id,
int rnti) int rnti)
{ {
if(cellGroupConfig->rlc_BearerToReleaseList != NULL) { if(cellGroupConfig->rlc_BearerToReleaseList != NULL) {
...@@ -790,6 +792,9 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig, ...@@ -790,6 +792,9 @@ void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
} }
} }
} }
nr_rrc_mac_config_req_ue_logicalChannelBearer(module_id,
cellGroupConfig->rlc_BearerToAddModList,
cellGroupConfig->rlc_BearerToReleaseList);
} }
void nr_rrc_ue_process_masterCellGroup(const protocol_ctxt_t *const ctxt_pP, void nr_rrc_ue_process_masterCellGroup(const protocol_ctxt_t *const ctxt_pP,
...@@ -814,7 +819,7 @@ void nr_rrc_ue_process_masterCellGroup(const protocol_ctxt_t *const ctxt_pP, ...@@ -814,7 +819,7 @@ void nr_rrc_ue_process_masterCellGroup(const protocol_ctxt_t *const ctxt_pP,
rrc->cell_group_config = calloc(1,sizeof(NR_CellGroupConfig_t)); rrc->cell_group_config = calloc(1,sizeof(NR_CellGroupConfig_t));
} }
nr_rrc_manage_rlc_bearers(cellGroupConfig, rrc, gNB_index, ctxt_pP->rntiMaybeUEid); nr_rrc_manage_rlc_bearers(cellGroupConfig, rrc, gNB_index, ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
if(cellGroupConfig->mac_CellGroupConfig != NULL){ if(cellGroupConfig->mac_CellGroupConfig != NULL){
//TODO (configure the MAC entity of this cell group as specified in 5.3.5.5.5) //TODO (configure the MAC entity of this cell group as specified in 5.3.5.5.5)
......
...@@ -166,6 +166,7 @@ void nr_rrc_handle_SetupRelease_RLF_TimersAndConstants(NR_UE_RRC_INST_t *rrc, ...@@ -166,6 +166,7 @@ void nr_rrc_handle_SetupRelease_RLF_TimersAndConstants(NR_UE_RRC_INST_t *rrc,
void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig, void nr_rrc_manage_rlc_bearers(const NR_CellGroupConfig_t *cellGroupConfig,
NR_UE_RRC_INST_t *rrc, NR_UE_RRC_INST_t *rrc,
int gNB_index, int gNB_index,
module_id_t module_id,
int rnti); int rnti);
int configure_NR_SL_Preconfig(int sync_source); int configure_NR_SL_Preconfig(int sync_source);
......
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