Commit 64ee6a47 authored by ndomingues's avatar ndomingues Committed by francescomani

Use common function to get mu at UE for PRACH

parent 88a95153
...@@ -5333,28 +5333,19 @@ int get_FeedbackDisabled(NR_DownlinkHARQ_FeedbackDisabled_r17_t *downlinkHARQ_Fe ...@@ -5333,28 +5333,19 @@ int get_FeedbackDisabled(NR_DownlinkHARQ_FeedbackDisabled_r17_t *downlinkHARQ_Fe
return (downlinkHARQ_FeedbackDisabled_r17->buf[byte_index] >> (7 - bit_index)) & 1; return (downlinkHARQ_FeedbackDisabled_r17->buf[byte_index] >> (7 - bit_index)) & 1;
} }
int nr_get_mu(const NR_UplinkConfigCommon_t *uplinkConfigCommon) int nr_get_prach_mu(const NR_MsgA_ConfigCommon_r16_t *msgacc, const NR_RACH_ConfigCommon_t *rach_ConfigCommon)
{ {
int mu; int mu;
NR_BWP_UplinkCommon_t *initialUplinkBWP = uplinkConfigCommon->initialUplinkBWP;
// if 2-Step configuration file exists // if 2-Step configuration file exists
if (initialUplinkBWP->ext1 && initialUplinkBWP->ext1->msgA_ConfigCommon_r16) { if (msgacc && msgacc->rach_ConfigCommonTwoStepRA_r16.msgA_SubcarrierSpacing_r16) {
if (initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->rach_ConfigCommonTwoStepRA_r16.msgA_SubcarrierSpacing_r16) { // Choose Subcarrier Spacing of configuration file of 2-Step
// Choose Subcarrier Spacing of configuration file of 2-Step mu = *msgacc->rach_ConfigCommonTwoStepRA_r16.msgA_SubcarrierSpacing_r16;
const NR_MsgA_ConfigCommon_r16_t *msgacc = initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup; } else if (rach_ConfigCommon->msg1_SubcarrierSpacing) {
mu = *msgacc->rach_ConfigCommonTwoStepRA_r16.msgA_SubcarrierSpacing_r16; // Choose Subcarrier Spacing of configuration file of 4-Step
} else { mu = *rach_ConfigCommon->msg1_SubcarrierSpacing;
// Choose Subcarrier Spacing of configuration file of 4-Step } else
mu = uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; AssertFatal(false, "PRACH subcarrier spacing mandatory present for L139, not supported otherwise\n");
}
} else {
if (initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing) {
mu = *initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing;
} else {
mu = uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
}
}
return mu; return mu;
} }
...@@ -327,6 +327,6 @@ int get_nrofHARQ_ProcessesForPDSCH(const NR_UE_ServingCell_Info_t *sc_info); ...@@ -327,6 +327,6 @@ int get_nrofHARQ_ProcessesForPDSCH(const NR_UE_ServingCell_Info_t *sc_info);
int get_nrofHARQ_ProcessesForPUSCH(const NR_UE_ServingCell_Info_t *sc_info); int get_nrofHARQ_ProcessesForPUSCH(const NR_UE_ServingCell_Info_t *sc_info);
int nr_get_mu(const NR_UplinkConfigCommon_t *uplinkConfigCommon); int nr_get_prach_mu(const NR_MsgA_ConfigCommon_r16_t *msgacc, const NR_RACH_ConfigCommon_t *rach_ConfigCommon);
#endif #endif
...@@ -1804,13 +1804,6 @@ static void build_ro_list(NR_UE_MAC_INST_t *mac) ...@@ -1804,13 +1804,6 @@ static void build_ro_list(NR_UE_MAC_INST_t *mac)
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric; NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
config_index = rach_ConfigGeneric->prach_ConfigurationIndex; config_index = rach_ConfigGeneric->prach_ConfigurationIndex;
int mu;
if (setup->msg1_SubcarrierSpacing)
mu = *setup->msg1_SubcarrierSpacing;
else
mu = mac->current_UL_BWP->scs;
msg1_FDM = rach_ConfigGeneric->msg1_FDM; msg1_FDM = rach_ConfigGeneric->msg1_FDM;
switch (msg1_FDM){ switch (msg1_FDM){
...@@ -1830,6 +1823,7 @@ static void build_ro_list(NR_UE_MAC_INST_t *mac) ...@@ -1830,6 +1823,7 @@ static void build_ro_list(NR_UE_MAC_INST_t *mac)
int unpaired = mac->phy_config.config_req.cell_config.frame_duplex_type; int unpaired = mac->phy_config.config_req.cell_config.frame_duplex_type;
const int64_t *prach_config_info_p = get_prach_config_info(mac->frequency_range, config_index, unpaired); const int64_t *prach_config_info_p = get_prach_config_info(mac->frequency_range, config_index, unpaired);
int mu = nr_get_prach_mu(mac->current_UL_BWP->msgA_ConfigCommon_r16, setup);
// Identify the proper PRACH Configuration Index table according to the operating frequency // Identify the proper PRACH Configuration Index table according to the operating frequency
LOG_D(NR_MAC,"mu = %u, PRACH config index = %u, unpaired = %u\n", mu, config_index, unpaired); LOG_D(NR_MAC,"mu = %u, PRACH config index = %u, unpaired = %u\n", mu, config_index, unpaired);
...@@ -2935,12 +2929,9 @@ static void nr_ue_prach_scheduler(NR_UE_MAC_INST_t *mac, frame_t frameP, sub_fra ...@@ -2935,12 +2929,9 @@ static void nr_ue_prach_scheduler(NR_UE_MAC_INST_t *mac, frame_t frameP, sub_fra
if (ra->ra_type == RA_4_STEP) { if (ra->ra_type == RA_4_STEP) {
nr_Msg1_transmitted(mac); nr_Msg1_transmitted(mac);
} else if (ra->ra_type == RA_2_STEP) { } else if (ra->ra_type == RA_2_STEP) {
const NR_MsgA_ConfigCommon_r16_t *msgacc = mac->current_UL_BWP->msgA_ConfigCommon_r16;
int mu = (int)*msgacc->rach_ConfigCommonTwoStepRA_r16.msgA_SubcarrierSpacing_r16;
NR_MsgA_PUSCH_Resource_r16_t *msgA_PUSCH_Resource = NR_MsgA_PUSCH_Resource_r16_t *msgA_PUSCH_Resource =
mac->current_UL_BWP->msgA_ConfigCommon_r16->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16; mac->current_UL_BWP->msgA_ConfigCommon_r16->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16;
int mu = nr_get_prach_mu(mac->current_UL_BWP->msgA_ConfigCommon_r16, setup);
const int n_slots_frame = nr_slots_per_frame[mu]; const int n_slots_frame = nr_slots_per_frame[mu];
slot_t msgA_pusch_slot = (slotP + msgA_PUSCH_Resource->msgA_PUSCH_TimeDomainOffset_r16) % n_slots_frame; slot_t msgA_pusch_slot = (slotP + msgA_PUSCH_Resource->msgA_PUSCH_TimeDomainOffset_r16) % n_slots_frame;
frame_t msgA_pusch_frame = frame_t msgA_pusch_frame =
......
...@@ -96,8 +96,10 @@ static int16_t ssb_index_from_prach(module_id_t module_idP, ...@@ -96,8 +96,10 @@ static int16_t ssb_index_from_prach(module_id_t module_idP,
uint8_t config_period = 1; uint8_t config_period = 1;
uint16_t prach_occasion_id = -1; uint16_t prach_occasion_id = -1;
uint8_t num_active_ssb = cc->num_active_ssb; uint8_t num_active_ssb = cc->num_active_ssb;
NR_MsgA_ConfigCommon_r16_t *msgacc = NULL;
int mu = nr_get_mu(scc->uplinkConfigCommon); if (scc->uplinkConfigCommon->initialUplinkBWP->ext1 && scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16)
msgacc = scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup;
int mu = nr_get_prach_mu(msgacc, rach_ConfigCommon);
get_nr_prach_info_from_index(config_index, get_nr_prach_info_from_index(config_index,
(int)frameP, (int)frameP,
...@@ -201,7 +203,10 @@ void find_SSB_and_RO_available(gNB_MAC_INST *nrmac) ...@@ -201,7 +203,10 @@ void find_SSB_and_RO_available(gNB_MAC_INST *nrmac)
break; break;
} }
int mu = nr_get_mu(scc->uplinkConfigCommon); NR_MsgA_ConfigCommon_r16_t *msgacc = NULL;
if (scc->uplinkConfigCommon->initialUplinkBWP->ext1 && scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16)
msgacc = scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup;
int mu = nr_get_prach_mu(msgacc, rach_ConfigCommon);
// prach is scheduled according to configuration index and tables 6.3.3.2.2 to 6.3.3.2.4 // prach is scheduled according to configuration index and tables 6.3.3.2.2 to 6.3.3.2.4
get_nr_prach_occasion_info_from_index(config_index, get_nr_prach_occasion_info_from_index(config_index,
...@@ -266,7 +271,8 @@ static void schedule_nr_MsgA_pusch(NR_UplinkConfigCommon_t *uplinkConfigCommon, ...@@ -266,7 +271,8 @@ static void schedule_nr_MsgA_pusch(NR_UplinkConfigCommon_t *uplinkConfigCommon,
NR_MsgA_PUSCH_Resource_r16_t *msgA_PUSCH_Resource = uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice NR_MsgA_PUSCH_Resource_r16_t *msgA_PUSCH_Resource = uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice
.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16; .setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16;
int mu = nr_get_mu(uplinkConfigCommon); int mu = nr_get_prach_mu(uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup,
uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup);
const int n_slots_frame = nr_slots_per_frame[mu]; const int n_slots_frame = nr_slots_per_frame[mu];
slot_t msgA_pusch_slot = (slotP + msgA_PUSCH_Resource->msgA_PUSCH_TimeDomainOffset_r16) % n_slots_frame; slot_t msgA_pusch_slot = (slotP + msgA_PUSCH_Resource->msgA_PUSCH_TimeDomainOffset_r16) % n_slots_frame;
...@@ -367,7 +373,10 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP ...@@ -367,7 +373,10 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
NR_COMMON_channels_t *cc = gNB->common_channels; NR_COMMON_channels_t *cc = gNB->common_channels;
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
NR_RACH_ConfigCommon_t *rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup; NR_RACH_ConfigCommon_t *rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
int mu = nr_get_mu(scc->uplinkConfigCommon); NR_MsgA_ConfigCommon_r16_t *msgacc = NULL;
if (scc->uplinkConfigCommon->initialUplinkBWP->ext1 && scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16)
msgacc = scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup;
int mu = nr_get_prach_mu(msgacc, rach_ConfigCommon);
int index = ul_buffer_index(frameP, slotP, mu, gNB->UL_tti_req_ahead_size); int index = ul_buffer_index(frameP, slotP, mu, gNB->UL_tti_req_ahead_size);
nfapi_nr_ul_tti_request_t *UL_tti_req = &RC.nrmac[module_idP]->UL_tti_req_ahead[0][index]; nfapi_nr_ul_tti_request_t *UL_tti_req = &RC.nrmac[module_idP]->UL_tti_req_ahead[0][index];
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[module_idP]->config[0]; nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[module_idP]->config[0];
......
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