Merge remote-tracking branch 'origin/Mult_TDD_Pattern' into integration_2025_w05 (!2799)
Changes to support multiple TDD patterns - Updated the configuration changes for 2 Patterns - Update the TDD table configuration for NFAPI - Added the tdd bitmap for the period - Adapted the bitmap for UL/DL for the multi TDD pattern - Updated the RACH procedure for multi TDD pattern - Updated DL and UL scheduler for multi TDD pattern
This commit is contained in:
+163
-75
@@ -49,7 +49,9 @@
|
||||
#include "constr_TYPE.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "oai_asn1.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair3/UTILS/conversions.h"
|
||||
#include "uper_decoder.h"
|
||||
#include "uper_encoder.h"
|
||||
@@ -312,9 +314,13 @@ static uint64_t get_ssb_bitmap(const NR_ServingCellConfigCommon_t *scc)
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
static int set_ideal_period(const int n_slots_period, const int n_ul_slots_period)
|
||||
static int set_ideal_period(bool is_csi)
|
||||
{
|
||||
return MAX_MOBILES_PER_GNB * 2 * n_slots_period / n_ul_slots_period; // 2 reports per UE (RSRP and RI-PMI-CQI)
|
||||
const frame_structure_t *fs = &RC.nrmac[0]->frame_structure;
|
||||
const int nb_slots_per_period = fs->numb_slots_period;
|
||||
const int n_ul_slots_per_period = get_ul_slots_per_period(fs); // full UL + mixed with UL symbols
|
||||
// 2 reports per UE (RSRP and RI-PMI-CQI)
|
||||
return is_csi ? MAX_MOBILES_PER_GNB * 2 * nb_slots_per_period / n_ul_slots_per_period : nb_slots_per_period * MAX_MOBILES_PER_GNB;
|
||||
}
|
||||
|
||||
static void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0,
|
||||
@@ -389,16 +395,6 @@ static void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigco
|
||||
nzpcsirs0->aperiodicTriggeringOffset = NULL;
|
||||
nzpcsirs0->trs_Info = NULL;
|
||||
asn1cSeqAdd(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0);
|
||||
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon ?
|
||||
&servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
|
||||
const int n_slots_frame = slotsperframe[*servingcellconfigcommon->ssbSubcarrierSpacing];
|
||||
const int nb_slots_per_period = tdd ? n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity): n_slots_frame;
|
||||
const int nb_dl_slots_period = tdd ? tdd->nrofDownlinkSlots : n_slots_frame;
|
||||
const int n_ul_slots_period = tdd ? (tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0)) : n_slots_frame;
|
||||
const int ideal_period = set_ideal_period(nb_slots_per_period, n_ul_slots_period); // same periodicity as CSI measurement report
|
||||
|
||||
if(!csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
|
||||
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
|
||||
@@ -447,7 +443,12 @@ static void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigco
|
||||
nzpcsi0->powerControlOffsetSS = calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
|
||||
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
|
||||
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
|
||||
set_csirs_periodicity(nzpcsi0, id, ideal_period, nb_slots_per_period, nb_dl_slots_period);
|
||||
|
||||
const int ideal_period = set_ideal_period(true); // same periodicity as CSI measurement report
|
||||
const frame_structure_t *fs = &(RC.nrmac[0]->frame_structure);
|
||||
const int nb_dl_slots_period = get_full_dl_slots_per_period(fs); // full DL slots
|
||||
set_csirs_periodicity(nzpcsi0, id, ideal_period, fs->numb_slots_period, nb_dl_slots_period);
|
||||
|
||||
nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS));
|
||||
*nzpcsi0->qcl_InfoPeriodicCSI_RS = 0;
|
||||
asn1cSeqAdd(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
|
||||
@@ -628,15 +629,12 @@ long rrc_get_max_nr_csrs(const int max_rbs, const long b_SRS) {
|
||||
static struct NR_SRS_Resource__resourceType__periodic *configure_periodic_srs(const NR_ServingCellConfigCommon_t *scc,
|
||||
const int uid)
|
||||
{
|
||||
frame_structure_t *fs = &RC.nrmac[0]->frame_structure;
|
||||
int offset = get_ul_slot_offset(fs, uid, false); // only full UL slots for SRS
|
||||
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
const int n_slots_frame = slotsperframe[*scc->ssbSubcarrierSpacing];
|
||||
const int ul_slots_period = tdd ? tdd->nrofUplinkSlots : n_slots_frame;
|
||||
const int n_slots_period = tdd ? n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame;
|
||||
const int first_full_ul_slot = n_slots_period - ul_slots_period;
|
||||
const int ideal_period = n_slots_period * MAX_MOBILES_PER_GNB;
|
||||
const int offset = first_full_ul_slot + (uid % ul_slots_period) + (n_slots_period * (uid / ul_slots_period));
|
||||
AssertFatal(offset < 2560, "Cannot allocate SRS configuration for uid %d, not enough resources\n", uid);
|
||||
const int ideal_period = set_ideal_period(false);
|
||||
|
||||
struct NR_SRS_Resource__resourceType__periodic *periodic_srs = calloc(1,sizeof(*periodic_srs));
|
||||
if (ideal_period < 5) {
|
||||
periodic_srs->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl4;
|
||||
@@ -907,7 +905,17 @@ void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsc
|
||||
if(frame_type==TDD) {
|
||||
// TDD
|
||||
if(tdd_UL_DL_ConfigurationCommon) {
|
||||
int dl_symb = tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols;
|
||||
int dl_symb = 0;
|
||||
if (tdd_UL_DL_ConfigurationCommon->pattern2 && tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols)
|
||||
AssertFatal(tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols == tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols,
|
||||
"nrofDownlinkSymbols in pattern1 %ld and pattern2 %ld must be the same in current implementation\n",
|
||||
tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols,
|
||||
tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols);
|
||||
if (tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols != 0) {
|
||||
dl_symb = tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols;
|
||||
} else if (tdd_UL_DL_ConfigurationCommon->pattern2) {
|
||||
dl_symb = tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols;
|
||||
}
|
||||
if(dl_symb > 1) {
|
||||
// mixed slot TDA with TDA index 2
|
||||
struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation2 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
|
||||
@@ -919,6 +927,94 @@ void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsc
|
||||
}
|
||||
}
|
||||
|
||||
const float tdd_ms_period_pattern[] = {0.5, 0.625, 1.0, 1.25, 2.0, 2.5, 5.0, 10.0};
|
||||
const float tdd_ms_period_ext[] = {3.0, 4.0};
|
||||
|
||||
/**
|
||||
* @brief Retrieves the periodicity in milliseconds for the given TDD pattern
|
||||
* depending on the presence of the extension
|
||||
* @param pattern Pointer to the NR_TDD_UL_DL_Pattern_t pattern structure
|
||||
* @return Periodicity value in milliseconds.
|
||||
*/
|
||||
static float get_tdd_periodicity(NR_TDD_UL_DL_Pattern_t *pattern) {
|
||||
if (!pattern->ext1) {
|
||||
LOG_D(NR_MAC, "Setting TDD configuration period to dl_UL_TransmissionPeriodicity %ld\n", pattern->dl_UL_TransmissionPeriodicity);
|
||||
return tdd_ms_period_pattern[pattern->dl_UL_TransmissionPeriodicity];
|
||||
} else {
|
||||
DevAssert(pattern->ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL);
|
||||
LOG_D(NR_MAC,
|
||||
"Setting TDD configuration period to dl_UL_TransmissionPeriodicity_v1530 %ld\n",
|
||||
*pattern->ext1->dl_UL_TransmissionPeriodicity_v1530);
|
||||
return tdd_ms_period_ext[*pattern->ext1->dl_UL_TransmissionPeriodicity_v1530];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Determines the TDD period index based on pattern periodicities
|
||||
* @note Not applicabile to pattern extension
|
||||
* @param tdd Pointer to the NR_TDD_UL_DL_ConfigCommon_t containing patterns
|
||||
* @return Index of the TDD period in tdd_ms_period_pattern
|
||||
*/
|
||||
int get_tdd_period_idx(NR_TDD_UL_DL_ConfigCommon_t *tdd)
|
||||
{
|
||||
int tdd_period_idx = 0;
|
||||
float pattern1_ms = get_tdd_periodicity(&tdd->pattern1);
|
||||
float pattern2_ms = tdd->pattern2 ? get_tdd_periodicity(tdd->pattern2) : 0.0;
|
||||
bool found_match = false;
|
||||
// Find matching TDD period in the predefined list of periodicities
|
||||
for (int i = 0; i < NFAPI_MAX_NUM_PERIODS; i++) {
|
||||
if ((pattern1_ms + pattern2_ms) == tdd_ms_period_pattern[i]) {
|
||||
tdd_period_idx = i;
|
||||
LOG_I(NR_MAC,
|
||||
"TDD period index = %d, based on the sum of dl_UL_TransmissionPeriodicity "
|
||||
"from Pattern1 (%f ms) and Pattern2 (%f ms): Total = %f ms\n",
|
||||
tdd_period_idx,
|
||||
pattern1_ms,
|
||||
pattern2_ms,
|
||||
pattern1_ms + pattern2_ms);
|
||||
found_match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Assert if no match was found
|
||||
AssertFatal(found_match, "The sum of pattern1_ms and pattern2_ms does not match any value in tdd_ms_period_pattern");
|
||||
return tdd_period_idx;
|
||||
}
|
||||
|
||||
static struct NR_PUSCH_TimeDomainResourceAllocation *set_TimeDomainResourceAllocation(const int k2, uint8_t index, int ul_symb)
|
||||
{
|
||||
struct NR_PUSCH_TimeDomainResourceAllocation *puschTdrAlloc = calloc_or_fail(1, sizeof(*puschTdrAlloc));
|
||||
puschTdrAlloc->k2 = calloc_or_fail(1, sizeof(*puschTdrAlloc->k2));
|
||||
*puschTdrAlloc->k2 = k2;
|
||||
puschTdrAlloc->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
|
||||
switch (index) {
|
||||
case 0:
|
||||
puschTdrAlloc->startSymbolAndLength = get_SLIV(0, 13);
|
||||
break;
|
||||
case 1:
|
||||
puschTdrAlloc->startSymbolAndLength = get_SLIV(0, 12);
|
||||
break;
|
||||
case 2:
|
||||
// UL TDA index 2 for mixed slot (TDD)
|
||||
puschTdrAlloc->startSymbolAndLength =
|
||||
get_SLIV(NR_NUMBER_OF_SYMBOLS_PER_SLOT - ul_symb, ul_symb - 1); // starting in fist ul symbol til the last but one
|
||||
break;
|
||||
case 3: {
|
||||
// UL TDA index 3 for msg3 in the mixed slot (TDD)
|
||||
int no_mix_slot = ul_symb < 3 ? 1 : 0; // we need at least 2 symbols for scheduling Msg3
|
||||
*puschTdrAlloc->k2 += no_mix_slot;
|
||||
if (no_mix_slot)
|
||||
puschTdrAlloc->startSymbolAndLength = get_SLIV(0, 13); // full allocation if there is no mixed slot
|
||||
else
|
||||
puschTdrAlloc->startSymbolAndLength =
|
||||
get_SLIV(NR_NUMBER_OF_SYMBOLS_PER_SLOT - ul_symb, ul_symb - 1); // starting in fist ul symbol til the last but one
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return puschTdrAlloc;
|
||||
}
|
||||
|
||||
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay)
|
||||
{
|
||||
@@ -928,58 +1024,48 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay)
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
AssertFatal(tda->list.count == 0, "already have pusch_TimeDomainAllocationList members\n");
|
||||
|
||||
frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
|
||||
const int k2 = min_fb_delay;
|
||||
|
||||
uint8_t DELTA[4]= {2,3,4,6}; // Delta parameter for Msg3
|
||||
int mu = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing;
|
||||
struct NR_SetupRelease_PUSCH_ConfigCommon *pusch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon;
|
||||
|
||||
// UL TDA index 0 is basic slot configuration starting in symbol 0 til the last but one symbol
|
||||
struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation));
|
||||
pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long));
|
||||
*pusch_timedomainresourceallocation->k2 = k2;
|
||||
pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
|
||||
pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0, 13);
|
||||
asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation);
|
||||
asn1cSeqAdd(&pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list, set_TimeDomainResourceAllocation(k2, 0, 0));
|
||||
|
||||
// UL TDA index 1 in case of SRS
|
||||
struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation1 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation));
|
||||
pusch_timedomainresourceallocation1->k2 = CALLOC(1,sizeof(long));
|
||||
*pusch_timedomainresourceallocation1->k2 = k2;
|
||||
pusch_timedomainresourceallocation1->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
|
||||
pusch_timedomainresourceallocation1->startSymbolAndLength = get_SLIV(0, 12);
|
||||
asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1);
|
||||
asn1cSeqAdd(&pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list, set_TimeDomainResourceAllocation(k2, 1, 0));
|
||||
|
||||
if(frame_type==TDD) {
|
||||
if(scc->tdd_UL_DL_ConfigurationCommon) {
|
||||
int ul_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols;
|
||||
if (ul_symb>1) {
|
||||
// UL TDA index 2 for mixed slot (TDD)
|
||||
pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation));
|
||||
pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long));
|
||||
*pusch_timedomainresourceallocation->k2 = k2;
|
||||
pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
|
||||
pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(14 - ul_symb, ul_symb - 1); // starting in fist ul symbol til the last but one
|
||||
asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation);
|
||||
}
|
||||
// UL TDA index 3 for msg3 in the mixed slot (TDD)
|
||||
int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
|
||||
int nb_slots_per_period = ((1 << mu) * 10) / nb_periods_per_frame;
|
||||
struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation_msg3 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation));
|
||||
pusch_timedomainresourceallocation_msg3->k2 = CALLOC(1,sizeof(long));
|
||||
int no_mix_slot = ul_symb < 3 ? 1 : 0; // we need at least 2 symbols for scheduling Msg3
|
||||
*pusch_timedomainresourceallocation_msg3->k2 = nb_slots_per_period - DELTA[mu] + no_mix_slot;
|
||||
if(*pusch_timedomainresourceallocation_msg3->k2 < min_fb_delay)
|
||||
*pusch_timedomainresourceallocation_msg3->k2 += nb_slots_per_period;
|
||||
AssertFatal(*pusch_timedomainresourceallocation_msg3->k2 < 33,"Computed k2 for msg3 %ld is larger than the range allowed by RRC (0..32)\n",
|
||||
*pusch_timedomainresourceallocation_msg3->k2);
|
||||
pusch_timedomainresourceallocation_msg3->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB;
|
||||
if(no_mix_slot)
|
||||
pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(0, 13); // full allocation if there is no mixed slot
|
||||
else
|
||||
pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(14 - ul_symb, ul_symb - 1); // starting in fist ul symbol til the last but one
|
||||
asn1cSeqAdd(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3);
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon) {
|
||||
int ul_symb = 0;
|
||||
NR_TDD_UL_DL_Pattern_t *p1 = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
NR_TDD_UL_DL_Pattern_t *p2 = scc->tdd_UL_DL_ConfigurationCommon->pattern2;
|
||||
if (p2 && p2->nrofUplinkSymbols)
|
||||
AssertFatal(p2->nrofUplinkSymbols == p1->nrofUplinkSymbols,
|
||||
"nrofDownlinkSymbols in pattern1 %ld and pattern2 %ld must be the same in current implementation\n",
|
||||
p1->nrofUplinkSymbols,
|
||||
p2->nrofUplinkSymbols);
|
||||
if (p1->nrofUplinkSymbols) {
|
||||
ul_symb = p1->nrofUplinkSymbols;
|
||||
} else if (p2) {
|
||||
ul_symb = p1->nrofUplinkSymbols;
|
||||
}
|
||||
if (ul_symb>1) {
|
||||
// UL TDA index 2 for mixed slot (TDD)
|
||||
asn1cSeqAdd(&pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,
|
||||
set_TimeDomainResourceAllocation(k2, 2, ul_symb));
|
||||
}
|
||||
// UL TDA index 3 for msg3 in the mixed slot (TDD)
|
||||
int tdd_period_idx = get_tdd_period_idx(scc->tdd_UL_DL_ConfigurationCommon);
|
||||
int nb_periods_per_frame = get_nb_periods_per_frame(tdd_period_idx);
|
||||
int nb_slots_per_period = ((1 << mu) * 10) / nb_periods_per_frame;
|
||||
int k2_msg3 = nb_slots_per_period - DELTA[mu];
|
||||
struct NR_PUSCH_TimeDomainResourceAllocation *puschTdrAllocMsg3 = set_TimeDomainResourceAllocation(k2_msg3, 3, ul_symb);
|
||||
if (*puschTdrAllocMsg3->k2 < min_fb_delay)
|
||||
*puschTdrAllocMsg3->k2 += nb_slots_per_period;
|
||||
AssertFatal(*puschTdrAllocMsg3->k2 < 33,
|
||||
"Computed k2 for msg3 %ld is larger than the range allowed by RRC (0..32)\n",
|
||||
*puschTdrAllocMsg3->k2);
|
||||
asn1cSeqAdd(&pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list, puschTdrAllocMsg3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1118,10 +1204,10 @@ void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) {
|
||||
|
||||
static void set_SR_periodandoffset(NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig, const NR_ServingCellConfigCommon_t *scc, int scs)
|
||||
{
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
const frame_structure_t *fs = &RC.nrmac[0]->frame_structure;
|
||||
int sr_slot = 1; // in FDD SR in slot 1
|
||||
if(tdd)
|
||||
sr_slot = get_first_ul_slot(tdd->nrofDownlinkSlots, tdd->nrofDownlinkSymbols, tdd->nrofUplinkSymbols);
|
||||
if (fs->is_tdd)
|
||||
sr_slot = get_first_ul_slot(fs, true);
|
||||
|
||||
schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
|
||||
|
||||
@@ -1581,15 +1667,14 @@ static void set_csi_meas_periodicity(const NR_ServingCellConfigCommon_t *scc,
|
||||
int curr_bwp,
|
||||
bool is_rsrp)
|
||||
{
|
||||
const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
|
||||
const int n_slots_frame = slotsperframe[*scc->ssbSubcarrierSpacing];
|
||||
const int n_ul_slots_period = tdd ? (tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0)) : n_slots_frame;
|
||||
const int n_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame;
|
||||
const int ideal_period = set_ideal_period(n_slots_period, n_ul_slots_period);
|
||||
const int first_ul_slot_period = tdd ? get_first_ul_slot(tdd->nrofDownlinkSlots, tdd->nrofDownlinkSymbols, tdd->nrofUplinkSymbols) : 0;
|
||||
const int ideal_period = set_ideal_period(true);
|
||||
const int num_pucch2 = get_nb_pucch2_per_slot(scc, curr_bwp);
|
||||
const int idx = (uid * 2 / num_pucch2) + is_rsrp;
|
||||
const int offset = first_ul_slot_period + idx % n_ul_slots_period + (idx / n_ul_slots_period) * n_slots_period;
|
||||
|
||||
frame_structure_t *fs = &RC.nrmac[0]->frame_structure;
|
||||
int offset = get_ul_slot_offset(fs, idx, true);
|
||||
|
||||
LOG_D(NR_MAC, "set_csi_meas_periodicity: uid = %d, offset = %d, ideal_period = %d", uid, offset, ideal_period);
|
||||
AssertFatal(offset < 320, "Not enough UL slots to accomodate all possible UEs. Need to rework the implementation\n");
|
||||
|
||||
if (ideal_period < 5) {
|
||||
@@ -2499,7 +2584,10 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc,
|
||||
AssertFatal(ServCellCom->tdd_UL_DL_ConfigurationCommon != NULL, "out of memory\n");
|
||||
ServCellCom->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing = scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing;
|
||||
ServCellCom->tdd_UL_DL_ConfigurationCommon->pattern1 = scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
ServCellCom->tdd_UL_DL_ConfigurationCommon->pattern2 = scc->tdd_UL_DL_ConfigurationCommon->pattern2;
|
||||
if (scc->tdd_UL_DL_ConfigurationCommon->pattern2) {
|
||||
ServCellCom->tdd_UL_DL_ConfigurationCommon->pattern2 = calloc_or_fail(1, sizeof(struct NR_TDD_UL_DL_Pattern));
|
||||
*ServCellCom->tdd_UL_DL_ConfigurationCommon->pattern2 = *scc->tdd_UL_DL_ConfigurationCommon->pattern2;
|
||||
}
|
||||
}
|
||||
ServCellCom->ss_PBCH_BlockPower = scc->ss_PBCH_BlockPower;
|
||||
|
||||
|
||||
@@ -112,5 +112,6 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
int uid);
|
||||
|
||||
NR_ReconfigurationWithSync_t *get_reconfiguration_with_sync(rnti_t rnti, uid_t uid, const NR_ServingCellConfigCommon_t *scc);
|
||||
int get_tdd_period_idx(NR_TDD_UL_DL_ConfigCommon_t *tdd);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user