Commit 0fac0ee7 authored by francescomani's avatar francescomani

filling config request, adjustment of prach functions and remove hardcoding from sib1

parent 7e5ef009
......@@ -866,7 +866,7 @@ int main(int argc, char **argv)
rrc.carrier.MIB = (uint8_t*) malloc(4);
rrc.carrier.sizeof_MIB = do_MIB_NR(&rrc,0);
nr_rrc_mac_config_req_ue(0,0,0,rrc.carrier.mib.message.choice.mib,secondaryCellGroup);
nr_rrc_mac_config_req_ue(0,0,0,rrc.carrier.mib.message.choice.mib,NULL,secondaryCellGroup);
nr_dcireq_t dcireq;
......
......@@ -726,7 +726,7 @@ int main(int argc, char **argv)
rrc.carrier.MIB = (uint8_t*) malloc(4);
rrc.carrier.sizeof_MIB = do_MIB_NR(&rrc,0);
nr_rrc_mac_config_req_ue(0,0,0,rrc.carrier.mib.message.choice.mib,secondaryCellGroup);
nr_rrc_mac_config_req_ue(0,0,0,rrc.carrier.mib.message.choice.mib,NULL,secondaryCellGroup);
nr_ue_phy_config_request(&UE_mac->phy_config);
......
......@@ -1179,12 +1179,12 @@ int get_format0(uint8_t index,
return format;
}
int64_t *get_prach_config_info(uint32_t pointa,
int64_t *get_prach_config_info(frequency_range_t freq_range,
uint8_t index,
uint8_t unpaired) {
int64_t *prach_config_info_p;
if (pointa > 2016666) { //FR2
if (freq_range == FR2) { //FR2
prach_config_info_p = table_6_3_3_2_4_prachConfig_Index[index];
}
else { // FR1
......
......@@ -113,7 +113,7 @@ int ul_ant_bits(NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig,long transformPreco
int get_format0(uint8_t index, uint8_t unpaired,frequency_range_t);
int64_t *get_prach_config_info(uint32_t pointa,
int64_t *get_prach_config_info(frequency_range_t freq_range,
uint8_t index,
uint8_t unpaired);
......
This diff is collapsed.
......@@ -314,6 +314,7 @@ typedef struct {
NR_CSI_ReportConfig_t *csirc;
long physCellId;
//// MAC config
int common_configuration_complete;
NR_DRX_Config_t *drx_Config;
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
NR_BSR_Config_t *bsr_Config;
......@@ -381,6 +382,7 @@ typedef struct {
NR_ControlResourceSet_t *coreset0;
frequency_range_t frequency_range;
uint16_t nr_band;
uint8_t ssb_subcarrier_offset;
} NR_UE_MAC_INST_t;
......
......@@ -83,7 +83,7 @@ int nr_rrc_mac_config_req_ue(
int cc_idP,
uint8_t gNB_index,
NR_MIB_t *mibP,
//NR_ServingCellConfigCommon_t *sccP,
NR_ServingCellConfigCommonSIB_t *sccP,
NR_CellGroupConfig_t *cell_group_config);
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
......@@ -313,7 +313,7 @@ void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
uint8_t *nb_dmrs_re_per_rb,
uint16_t *number_dmrs_symbols);
void build_ssb_to_ro_map(NR_ServingCellConfigCommon_t *scc, uint8_t unpaired);
void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac);
void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format);
......
......@@ -51,7 +51,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
//init mac here
nr_ue_mac_inst = (NR_UE_MAC_INST_t *)calloc(sizeof(NR_UE_MAC_INST_t),NB_NR_UE_MAC_INST);
if (rrc_inst) {
nr_rrc_mac_config_req_ue(0,0,0,NULL,rrc_inst->cell_group_config);
nr_rrc_mac_config_req_ue(0,0,0,NULL,NULL,rrc_inst->cell_group_config);
if (IS_SOFTMODEM_NOS1){
AssertFatal(rlc_module_init(0) == 0, "%s: Could not initialize RLC layer\n", __FUNCTION__);
pdcp_layer_init();
......
......@@ -143,6 +143,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
//storing ssb index in the mac structure
mac->mib_ssb = ssb_index;
mac->ssb_subcarrier_offset = ssb_subcarrier_offset;
uint8_t scs_ssb;
uint32_t band;
......
This diff is collapsed.
......@@ -418,7 +418,14 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
nrMultiBandInfo->freqBandIndicatorNR = configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[i];
ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list,nrMultiBandInfo);
}
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
int ref_scs;
if (configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000)
ref_scs = 0; // 15 khz
if (configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666)
ref_scs = 3; // 60 khz
uint32_t absolute_diff = (*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA =
(absolute_diff/12) - (10<<(configuration->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing - ref_scs));
for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.count; i++) {
ASN_SEQUENCE_ADD(&sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list,configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[i]);
}
......
......@@ -589,7 +589,7 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(
// (void *)&bcch_message->message.choice.mib,
// sizeof(NR_MIB_t) );
nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL);
nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL);
}
return 0;
......@@ -1198,12 +1198,16 @@ int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(
// FIXME: improve condition for the RA trigger
// Check for on-demand not broadcasted SI
check_requested_SI_List(module_id, NR_UE_rrc_inst[module_id].requested_SI_List, *sib1);
if( nr_rrc_get_state(module_id) == RRC_STATE_IDLE_NR ) {
if( nr_rrc_get_state(module_id) <= RRC_STATE_IDLE_NR ) {
NR_UE_rrc_inst[module_id].ra_trigger = INITIAL_ACCESS_FROM_RRC_IDLE;
// TODO: remove flag after full RA procedures implemented
get_softmodem_params()->do_ra = 1;
LOG_I(PHY,"Setting state to NR_RRC_SI_RECEIVED\n");
nr_rrc_set_state (module_id, NR_RRC_SI_RECEIVED);
}
nr_rrc_ue_generate_ra_msg(module_id,gNB_index);
// take ServingCellConfigCommon and configure L1/L2
NR_UE_rrc_inst[module_id].servingCellConfigCommonSIB = sib1->servingCellConfigCommon;
nr_rrc_mac_config_req_ue(module_id,0,0,NULL,sib1->servingCellConfigCommon,NULL);
nr_rrc_ue_generate_ra_msg(module_id,gNB_index);
} else {
LOG_E(NR_RRC, "SIB1 not decoded\n");
}
......
......@@ -105,6 +105,7 @@ typedef struct NR_UE_RRC_INST_s {
NR_MeasConfig_t *meas_config;
NR_CellGroupConfig_t *cell_group_config;
NR_ServingCellConfigCommonSIB_t *servingCellConfigCommonSIB;
NR_RadioBearerConfig_t *radio_bearer_config;
NR_MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ];
......
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