Commit 6b792001 authored by Florian Kaltenberger's avatar Florian Kaltenberger

preparing l2_init_ue and l3_init_ue to make sure parameters are passed down....

preparing l2_init_ue and l3_init_ue to make sure parameters are passed down. To be merged with Francesco's changes and tested.
parent 886d7423
...@@ -134,27 +134,24 @@ int nr_rrc_mac_config_req_ue( ...@@ -134,27 +134,24 @@ int nr_rrc_mac_config_req_ue(
int cc_idP, int cc_idP,
uint8_t gNB_index, uint8_t gNB_index,
NR_MIB_t *mibP, NR_MIB_t *mibP,
NR_ServingCellConfigCommon_t *sccP, // NR_ServingCellConfigCommon_t *sccP,
// NR_MAC_CellGroupConfig_t *mac_cell_group_configP, // NR_MAC_CellGroupConfig_t *mac_cell_group_configP,
// NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, // NR_PhysicalCellGroupConfig_t *phy_cell_group_configP,
NR_SpCellConfig_t *spCell_ConfigP ){ NR_SpCellConfig_t *spCell_ConfigP ){
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
// NR_ServingCellConfig_t *serving_cell_config = spcell_configP->spCellConfigDedicated; // NR_ServingCellConfig_t *serving_cell_config = spcell_configP->spCellConfigDedicated;
// TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc.
NR_ServingCellConfigCommon_t *scc;
if(mibP != NULL){ if(mibP != NULL){
mac->mib = mibP; // update by every reception mac->mib = mibP; // update by every reception
} }
if(spCell_ConfigP != NULL ){ if(spCell_ConfigP != NULL ){
mac->servCellIndex = spCell_ConfigP->servCellIndex; mac->servCellIndex = *spCell_ConfigP->servCellIndex;
if (spCell_ConfigP->reconfigurationWithSync) { if (spCell_ConfigP->reconfigurationWithSync) {
mac->scc = spCell_ConfigP->reconfigurationWithSync->spCellConfigCommon; mac->scc = spCell_ConfigP->reconfigurationWithSync->spCellConfigCommon;
config_common_ue(mac); config_common_ue(mac);
......
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
#include "mac_defs.h" #include "mac_defs.h"
#include "mac.h" #include "mac.h"
#include <openair1/PHY/defs_nr_UE.h> #include "PHY/defs_nr_UE.h"
#include "RRC/NR_UE/rrc_defs.h"
/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message /**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message
\param module_id module id \param module_id module id
...@@ -70,11 +72,11 @@ int nr_rrc_mac_config_req_ue( ...@@ -70,11 +72,11 @@ int nr_rrc_mac_config_req_ue(
int cc_idP, int cc_idP,
uint8_t gNB_index, uint8_t gNB_index,
NR_MIB_t *mibP, NR_MIB_t *mibP,
NR_ServingCellConfigCommon_t *sccP, //NR_ServingCellConfigCommon_t *sccP,
NR_SpCellConfig_t *spCell_ConfigP); NR_SpCellConfig_t *spCell_ConfigP);
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/ /**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
int nr_l2_init_ue(void); NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst);
/**\brief fetch MAC instance by module_id, within 0 - (NB_NR_UE_MAC_INST-1) /**\brief fetch MAC instance by module_id, within 0 - (NB_NR_UE_MAC_INST-1)
\param module_id index of MAC instance(s)*/ \param module_id index of MAC instance(s)*/
......
...@@ -36,8 +36,7 @@ ...@@ -36,8 +36,7 @@
static NR_UE_MAC_INST_t *nr_ue_mac_inst; static NR_UE_MAC_INST_t *nr_ue_mac_inst;
int NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst)
nr_l2_init_ue(void)
{ {
//LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n"); //LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
...@@ -45,6 +44,8 @@ nr_l2_init_ue(void) ...@@ -45,6 +44,8 @@ nr_l2_init_ue(void)
//init mac here //init mac here
nr_ue_mac_inst = (NR_UE_MAC_INST_t *)malloc(sizeof(NR_UE_MAC_INST_t)*NB_NR_UE_MAC_INST); nr_ue_mac_inst = (NR_UE_MAC_INST_t *)malloc(sizeof(NR_UE_MAC_INST_t)*NB_NR_UE_MAC_INST);
nr_rrc_mac_config_req_ue(0,0,0,NULL,rrc_inst->cell_group_config->spCellConfig);
if (IS_SOFTMODEM_NOS1){ if (IS_SOFTMODEM_NOS1){
if (rlc_module_init(0) != 0) { if (rlc_module_init(0) != 0) {
...@@ -55,7 +56,7 @@ nr_l2_init_ue(void) ...@@ -55,7 +56,7 @@ nr_l2_init_ue(void)
} }
return (1); return (nr_ue_mac_inst);
} }
NR_UE_MAC_INST_t *get_mac_inst(module_id_t module_id){ NR_UE_MAC_INST_t *get_mac_inst(module_id_t module_id){
......
...@@ -1838,7 +1838,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac, ...@@ -1838,7 +1838,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
if(dlsch_config_pdu != NULL){ if(dlsch_config_pdu != NULL){
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL; NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = NULL;
if (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList) if (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList)
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList; pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList->choice.setup;
else if (mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList) else if (mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList)
pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; pdsch_TimeDomainAllocationList = mac->DLbwp[0]->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
if (pdsch_TimeDomainAllocationList) { if (pdsch_TimeDomainAllocationList) {
...@@ -1878,7 +1878,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac, ...@@ -1878,7 +1878,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
if(ulsch_config_pdu != NULL){ if(ulsch_config_pdu != NULL){
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL; NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
if (mac->ULbwp[0]->bwp_Dedicated->pusch_Config) if (mac->ULbwp[0]->bwp_Dedicated->pusch_Config)
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList; pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList->choice.setup;
if (pusch_TimeDomainAllocationList) { if (pusch_TimeDomainAllocationList) {
AssertFatal(pusch_TimeDomainAllocationList->list.count > time_domain_ind, AssertFatal(pusch_TimeDomainAllocationList->list.count > time_domain_ind,
......
...@@ -33,11 +33,9 @@ ...@@ -33,11 +33,9 @@
#include "defs.h" #include "defs.h"
#include "rrc_proto.h" #include "rrc_proto.h"
int nr_l3_init_ue(char* rrc_config_path){ NR_UE_RRC_INST_t* nr_l3_init_ue(char* rrc_config_path){
//LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); //LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n");
openair_rrc_top_init_ue_nr(rrc_config_path); return openair_rrc_top_init_ue_nr(rrc_config_path);
return 0;
} }
...@@ -80,7 +80,7 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config( ...@@ -80,7 +80,7 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cell_group_config, 0); SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cell_group_config, 0);
} }
//nr_rrc_mac_config_req_ue( module_id_t module_id, int CC_id, uint8_t gNB_index, NR_MIB_t *mibP, NR_MAC_CellGroupConfig_t *mac_cell_group_configP, NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, NR_SpCellConfig_t *spcell_configP ); //nr_rrc_mac_config_req_ue( 0,0,0,NULL, cell_group_config->mac_CellGroupConfig, cell_group_config->physicalCellGroupConfig, cell_group_config->spCellConfig );
return 0; return 0;
} }
...@@ -124,8 +124,9 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig ...@@ -124,8 +124,9 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
nr_rrc_ue_process_scg_config(cellGroupConfig); nr_rrc_ue_process_scg_config(cellGroupConfig);
}else{ }else{
// after first time, update it and free the memory after. // after first time, update it and free the memory after.
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)NR_UE_rrc_inst->cell_group_config, 0);
NR_UE_rrc_inst->cell_group_config = cellGroupConfig;
nr_rrc_ue_process_scg_config(cellGroupConfig); nr_rrc_ue_process_scg_config(cellGroupConfig);
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cellGroupConfig, 0);
} }
} }
...@@ -168,8 +169,7 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){ ...@@ -168,8 +169,7 @@ int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config){
int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){ int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){
int i; int i;
if(NR_UE_rrc_inst->cell_group_config==NULL){ if(NR_UE_rrc_inst->cell_group_config==NULL){
// initial list // initial list
if(cell_group_config->spCellConfig != NULL){ if(cell_group_config->spCellConfig != NULL){
if(cell_group_config->spCellConfig->spCellConfigDedicated != NULL){ if(cell_group_config->spCellConfig->spCellConfigDedicated != NULL){
if(cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList != NULL){ if(cell_group_config->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList != NULL){
...@@ -179,8 +179,6 @@ int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){ ...@@ -179,8 +179,6 @@ int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config){
} }
} }
} }
}else{ }else{
// maintain list // maintain list
if(cell_group_config->spCellConfig != NULL){ if(cell_group_config->spCellConfig != NULL){
...@@ -259,7 +257,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, ...@@ -259,7 +257,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
} }
int8_t openair_rrc_top_init_ue_nr(char* rrc_config_path){ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){
if(NB_NR_UE_INST > 0){ if(NB_NR_UE_INST > 0){
NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t));
...@@ -347,7 +345,7 @@ int8_t openair_rrc_top_init_ue_nr(char* rrc_config_path){ ...@@ -347,7 +345,7 @@ int8_t openair_rrc_top_init_ue_nr(char* rrc_config_path){
NR_UE_rrc_inst = NULL; NR_UE_rrc_inst = NULL;
} }
return 0; return NR_UE_rrc_inst;
} }
...@@ -418,7 +416,7 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message( ...@@ -418,7 +416,7 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(
// (void *)&bcch_message->message.choice.mib, // (void *)&bcch_message->message.choice.mib,
// sizeof(NR_MIB_t) ); // sizeof(NR_MIB_t) );
nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL); nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL);
} }
return 0; return 0;
......
...@@ -67,7 +67,7 @@ typedef struct NR_UE_RRC_INST_s { ...@@ -67,7 +67,7 @@ typedef struct NR_UE_RRC_INST_s {
NR_MeasConfig_t *meas_config; NR_MeasConfig_t *meas_config;
NR_CellGroupConfig_t *cell_group_config; NR_CellGroupConfig_t *cell_group_config;
NR_RadioBearerConfig_t *radio_bearer_config; NR_RadioBearerConfig_t *radio_bearer_config;
NR_MIB_t *mib; NR_MIB_t *mib;
// lists // lists
......
...@@ -43,14 +43,14 @@ ...@@ -43,14 +43,14 @@
// main_rrc.c // main_rrc.c
// //
/**\brief Layer 3 initialization*/ /**\brief Layer 3 initialization*/
int nr_l3_init_ue(char*); NR_UE_RRC_INST_t* nr_l3_init_ue(char*);
// //
// UE_rrc.c // UE_rrc.c
// //
/**\brief Initial the top level RRC structure instance*/ /**\brief Initial the top level RRC structure instance*/
int8_t openair_rrc_top_init_ue_nr(char*); NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*);
......
...@@ -33,7 +33,7 @@ gNBs = ...@@ -33,7 +33,7 @@ gNBs =
# downlinkConfigCommon # downlinkConfigCommon
#frequencyInfoDL #frequencyInfoDL
# this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP) # this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 642016; absoluteFrequencySSB = 642364;
dl_frequencyBand = 78; dl_frequencyBand = 78;
# this is 3600 MHz # this is 3600 MHz
dl_absoluteFrequencyPointA = 640000; dl_absoluteFrequencyPointA = 640000;
...@@ -152,7 +152,7 @@ gNBs = ...@@ -152,7 +152,7 @@ gNBs =
# ssb_periodicityServingCell # ssb_periodicityServingCell
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 # 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
ssb_periodicityServingCell = 2; ssb_periodicityServingCell = 1;
# dmrs_TypeA_position # dmrs_TypeA_position
# 0 = pos2, 1 = pos3 # 0 = pos2, 1 = pos3
......
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