Implement common nr_get_mu() in nr_mac_common
These functions look up the numerology, and code can be harmonized: - ssb_index_from_prach() - find_SSB_and_RO_available() - schedule_nr_prach() The next commits also need to look up the numerology from the UplinkConfigCommon. This provides the common implementation to be used in follow-up commits.
This commit is contained in:
committed by
ndomingues
parent
3083f4f3d1
commit
c609dd8fcf
@@ -5331,3 +5331,29 @@ int get_FeedbackDisabled(NR_DownlinkHARQ_FeedbackDisabled_r17_t *downlinkHARQ_Fe
|
||||
|
||||
return (downlinkHARQ_FeedbackDisabled_r17->buf[byte_index] >> (7 - bit_index)) & 1;
|
||||
}
|
||||
|
||||
int nr_get_mu(const NR_UplinkConfigCommon_t *uplinkConfigCommon)
|
||||
{
|
||||
int mu;
|
||||
NR_BWP_UplinkCommon_t *initialUplinkBWP = uplinkConfigCommon->initialUplinkBWP;
|
||||
|
||||
// if 2-Step configuration file exists
|
||||
if (initialUplinkBWP->ext1 && initialUplinkBWP->ext1->msgA_ConfigCommon_r16) {
|
||||
if (initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->rach_ConfigCommonTwoStepRA_r16.msgA_SubcarrierSpacing_r16) {
|
||||
// Choose Subcarrier Spacing of configuration file of 2-Step
|
||||
const NR_MsgA_ConfigCommon_r16_t *msgacc = initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup;
|
||||
mu = *msgacc->rach_ConfigCommonTwoStepRA_r16.msgA_SubcarrierSpacing_r16;
|
||||
} else {
|
||||
// Choose Subcarrier Spacing of configuration file of 4-Step
|
||||
mu = uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user