Merge remote-tracking branch 'origin/SRS-meas' into integration_2025_w24 (!3460)
SRS configuration - Fix segmentation fault, a memory leak, and LOGs for SRS usage NFAPI_NR_SRS_BEAMMANAGEMENT - Refactor SRS configuration; - Add SRS ResourceSet to get the SNR measurements at MAC layer In this MR we have 2 SRS ResourceSet, for the same SRS Resource. This way, in addition to obtaining the UL-RI, we also obtain the SNR in the MAC and fill the PRB Black list. This branch has been tested with COTS UE and with RFSim. The measured values seem correct.
This commit is contained in:
@@ -1829,7 +1829,7 @@ typedef struct {
|
|||||||
uint8_t num_symbols; // Number of symbols for SRS. Value: 1 -> 4. If a PHY does not report for individual symbols then this parameter should be set to 1.
|
uint8_t num_symbols; // Number of symbols for SRS. Value: 1 -> 4. If a PHY does not report for individual symbols then this parameter should be set to 1.
|
||||||
uint8_t wide_band_snr; // SNR value in dB measured within configured SRS bandwidth on each symbol. Value: 0 -> 255 representing -64 dB to 63 dB with a step size 0.5 dB. 0xff will be set if this field is invalid.
|
uint8_t wide_band_snr; // SNR value in dB measured within configured SRS bandwidth on each symbol. Value: 0 -> 255 representing -64 dB to 63 dB with a step size 0.5 dB. 0xff will be set if this field is invalid.
|
||||||
uint8_t num_reported_symbols; // Number of symbols reported in this message. This allows PHY to report individual symbols or aggregated symbols where this field will be set to 1. Value: 1 -> 4.
|
uint8_t num_reported_symbols; // Number of symbols reported in this message. This allows PHY to report individual symbols or aggregated symbols where this field will be set to 1. Value: 1 -> 4.
|
||||||
nfapi_nr_srs_reported_symbol_t* reported_symbol_list;
|
nfapi_nr_srs_reported_symbol_t reported_symbol_list[4];
|
||||||
} nfapi_nr_srs_beamforming_report_t;
|
} nfapi_nr_srs_beamforming_report_t;
|
||||||
|
|
||||||
// SRS indication
|
// SRS indication
|
||||||
|
|||||||
@@ -4455,8 +4455,7 @@ int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen,
|
|||||||
&& pull8(&pReadPackedMessage, &nr_srs_beamforming_report->num_reported_symbols, end))) {
|
&& pull8(&pReadPackedMessage, &nr_srs_beamforming_report->num_reported_symbols, end))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
nr_srs_beamforming_report->reported_symbol_list =
|
|
||||||
calloc(nr_srs_beamforming_report->num_reported_symbols, sizeof(*nr_srs_beamforming_report->reported_symbol_list));
|
|
||||||
for (int reported_symbol = 0; reported_symbol < nr_srs_beamforming_report->num_reported_symbols; ++reported_symbol) {
|
for (int reported_symbol = 0; reported_symbol < nr_srs_beamforming_report->num_reported_symbols; ++reported_symbol) {
|
||||||
if (!unpack_nr_srs_reported_symbol(&nr_srs_beamforming_report->reported_symbol_list[reported_symbol],
|
if (!unpack_nr_srs_reported_symbol(&nr_srs_beamforming_report->reported_symbol_list[reported_symbol],
|
||||||
&pReadPackedMessage,
|
&pReadPackedMessage,
|
||||||
|
|||||||
@@ -1046,6 +1046,9 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
|||||||
nr_srs_bf_report.num_symbols = 1 << srs_pdu->num_symbols;
|
nr_srs_bf_report.num_symbols = 1 << srs_pdu->num_symbols;
|
||||||
nr_srs_bf_report.wide_band_snr = srs_est >= 0 ? (gNB->srs->snr + 64) << 1 : 0xFF; // 0xFF will be set if this field is invalid
|
nr_srs_bf_report.wide_band_snr = srs_est >= 0 ? (gNB->srs->snr + 64) << 1 : 0xFF; // 0xFF will be set if this field is invalid
|
||||||
nr_srs_bf_report.num_reported_symbols = 1 << srs_pdu->num_symbols;
|
nr_srs_bf_report.num_reported_symbols = 1 << srs_pdu->num_symbols;
|
||||||
|
AssertFatal(nr_srs_bf_report.num_reported_symbols == 1,
|
||||||
|
"nr_srs_bf_report.num_reported_symbols %i not handled yet!\n",
|
||||||
|
nr_srs_bf_report.num_reported_symbols);
|
||||||
fill_srs_reported_symbol(&nr_srs_bf_report.reported_symbol_list[0], srs_pdu, frame_parms->N_RB_UL, snr_per_rb, srs_est);
|
fill_srs_reported_symbol(&nr_srs_bf_report.reported_symbol_list[0], srs_pdu, frame_parms->N_RB_UL, snr_per_rb, srs_est);
|
||||||
|
|
||||||
#ifdef SRS_IND_DEBUG
|
#ifdef SRS_IND_DEBUG
|
||||||
@@ -1053,13 +1056,13 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
|||||||
LOG_I(NR_PHY, "nr_srs_bf_report.num_symbols = %i\n", nr_srs_bf_report.num_symbols);
|
LOG_I(NR_PHY, "nr_srs_bf_report.num_symbols = %i\n", nr_srs_bf_report.num_symbols);
|
||||||
LOG_I(NR_PHY, "nr_srs_bf_report.wide_band_snr = %i (%i dB)\n", nr_srs_bf_report.wide_band_snr, (nr_srs_bf_report.wide_band_snr >> 1) - 64);
|
LOG_I(NR_PHY, "nr_srs_bf_report.wide_band_snr = %i (%i dB)\n", nr_srs_bf_report.wide_band_snr, (nr_srs_bf_report.wide_band_snr >> 1) - 64);
|
||||||
LOG_I(NR_PHY, "nr_srs_bf_report.num_reported_symbols = %i\n", nr_srs_bf_report.num_reported_symbols);
|
LOG_I(NR_PHY, "nr_srs_bf_report.num_reported_symbols = %i\n", nr_srs_bf_report.num_reported_symbols);
|
||||||
LOG_I(NR_PHY, "nr_srs_bf_report.prgs[0].num_prgs = %i\n", nr_srs_bf_report.prgs[0].num_prgs);
|
LOG_I(NR_PHY, "nr_srs_bf_report.reported_symbol_list[0].num_prgs = %i\n", nr_srs_bf_report.reported_symbol_list[0].num_prgs);
|
||||||
for (int prg_idx = 0; prg_idx < nr_srs_bf_report.prgs[0].num_prgs; prg_idx++) {
|
for (int prg_idx = 0; prg_idx < nr_srs_bf_report.reported_symbol_list[0].num_prgs; prg_idx++) {
|
||||||
LOG_I(NR_PHY,
|
LOG_I(NR_PHY,
|
||||||
"nr_srs_beamforming_report.prgs[0].prg_list[%3i].rb_snr = %i (%i dB)\n",
|
"nr_srs_beamforming_report.reported_symbol_list[0].prg_list[%3i].rb_snr = %i (%i dB)\n",
|
||||||
prg_idx,
|
prg_idx,
|
||||||
nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr,
|
nr_srs_bf_report.reported_symbol_list[0].prg_list[prg_idx].rb_snr,
|
||||||
(nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr >> 1) - 64);
|
(nr_srs_bf_report.reported_symbol_list[0].prg_list[prg_idx].rb_snr >> 1) - 64);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1442,13 +1442,13 @@ void handle_nr_srs_measurements(const module_id_t module_id,
|
|||||||
LOG_I(NR_MAC, "nr_srs_bf_report.num_symbols = %i\n", nr_srs_bf_report.num_symbols);
|
LOG_I(NR_MAC, "nr_srs_bf_report.num_symbols = %i\n", nr_srs_bf_report.num_symbols);
|
||||||
LOG_I(NR_MAC, "nr_srs_bf_report.wide_band_snr = %i (%i dB)\n", nr_srs_bf_report.wide_band_snr, wide_band_snr_dB);
|
LOG_I(NR_MAC, "nr_srs_bf_report.wide_band_snr = %i (%i dB)\n", nr_srs_bf_report.wide_band_snr, wide_band_snr_dB);
|
||||||
LOG_I(NR_MAC, "nr_srs_bf_report.num_reported_symbols = %i\n", nr_srs_bf_report.num_reported_symbols);
|
LOG_I(NR_MAC, "nr_srs_bf_report.num_reported_symbols = %i\n", nr_srs_bf_report.num_reported_symbols);
|
||||||
LOG_I(NR_MAC, "nr_srs_bf_report.prgs[0].num_prgs = %i\n", nr_srs_bf_report.prgs[0].num_prgs);
|
LOG_I(NR_MAC, "nr_srs_bf_report.reported_symbol_list[0].num_prgs = %i\n", nr_srs_bf_report.reported_symbol_list[0].num_prgs);
|
||||||
for (int prg_idx = 0; prg_idx < nr_srs_bf_report.prgs[0].num_prgs; prg_idx++) {
|
for (int prg_idx = 0; prg_idx < nr_srs_bf_report.reported_symbol_list[0].num_prgs; prg_idx++) {
|
||||||
LOG_I(NR_MAC,
|
LOG_I(NR_MAC,
|
||||||
"nr_srs_bf_report.prgs[0].prg_list[%3i].rb_snr = %i (%i dB)\n",
|
"nr_srs_bf_report.reported_symbol_list[0].prg_list[%3i].rb_snr = %i (%i dB)\n",
|
||||||
prg_idx,
|
prg_idx,
|
||||||
nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr,
|
nr_srs_bf_report.reported_symbol_list[0].prg_list[prg_idx].rb_snr,
|
||||||
(nr_srs_bf_report.prgs[0].prg_list[prg_idx].rb_snr >> 1) - 64);
|
(nr_srs_bf_report.reported_symbol_list[0].prg_list[prg_idx].rb_snr >> 1) - 64);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -729,64 +729,58 @@ static struct NR_SRS_Resource__resourceType__periodic *configure_periodic_srs(co
|
|||||||
return periodic_srs;
|
return periodic_srs;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NR_SetupRelease_SRS_Config_t *get_config_srs(const NR_ServingCellConfigCommon_t *scc,
|
static NR_SRS_ResourceSet_t *get_srs_resourceset(const int resset_id,
|
||||||
const NR_UE_NR_Capability_t *uecap,
|
const int res_id,
|
||||||
const int curr_bwp,
|
const long usage,
|
||||||
const int uid,
|
const int minRXTXTIME,
|
||||||
const int res_id,
|
int do_srs)
|
||||||
const long maxMIMO_Layers,
|
|
||||||
const int minRXTXTIME,
|
|
||||||
int do_srs)
|
|
||||||
{
|
{
|
||||||
NR_SetupRelease_SRS_Config_t *setup_release_srs_Config = calloc(1,sizeof(*setup_release_srs_Config));
|
NR_SRS_ResourceSet_t *srs_resset = calloc_or_fail(1, sizeof(*srs_resset));
|
||||||
setup_release_srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
|
srs_resset->srs_ResourceSetId = resset_id;
|
||||||
setup_release_srs_Config->choice.setup = calloc(1,sizeof(*setup_release_srs_Config->choice.setup));
|
srs_resset->srs_ResourceIdList = calloc_or_fail(1, sizeof(*srs_resset->srs_ResourceIdList));
|
||||||
NR_SRS_Config_t *srs_Config = setup_release_srs_Config->choice.setup;
|
NR_SRS_ResourceId_t *srs_resset_id = calloc_or_fail(1, sizeof(*srs_resset_id));
|
||||||
|
*srs_resset_id = res_id;
|
||||||
srs_Config->srs_ResourceSetToReleaseList = NULL;
|
asn1cSeqAdd(&srs_resset->srs_ResourceIdList->list, srs_resset_id);
|
||||||
|
|
||||||
srs_Config->srs_ResourceSetToAddModList = calloc(1,sizeof(*srs_Config->srs_ResourceSetToAddModList));
|
|
||||||
NR_SRS_ResourceSet_t *srs_resset0 = calloc(1,sizeof(*srs_resset0));
|
|
||||||
srs_resset0->srs_ResourceSetId = res_id;
|
|
||||||
srs_resset0->srs_ResourceIdList = calloc(1,sizeof(*srs_resset0->srs_ResourceIdList));
|
|
||||||
NR_SRS_ResourceId_t *srs_resset0_id = calloc(1,sizeof(*srs_resset0_id));
|
|
||||||
*srs_resset0_id = res_id;
|
|
||||||
asn1cSeqAdd(&srs_resset0->srs_ResourceIdList->list, srs_resset0_id);
|
|
||||||
srs_Config->srs_ResourceToReleaseList=NULL;
|
|
||||||
if (do_srs) {
|
if (do_srs) {
|
||||||
srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic;
|
srs_resset->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic;
|
||||||
srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic));
|
srs_resset->resourceType.choice.periodic = calloc_or_fail(1, sizeof(*srs_resset->resourceType.choice.periodic));
|
||||||
srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL;
|
srs_resset->resourceType.choice.periodic->associatedCSI_RS = NULL;
|
||||||
} else {
|
} else {
|
||||||
srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic;
|
srs_resset->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic;
|
||||||
srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic));
|
srs_resset->resourceType.choice.aperiodic = calloc_or_fail(1, sizeof(*srs_resset->resourceType.choice.aperiodic));
|
||||||
srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger = 1;
|
srs_resset->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger = 1;
|
||||||
srs_resset0->resourceType.choice.aperiodic->csi_RS = NULL;
|
srs_resset->resourceType.choice.aperiodic->csi_RS = NULL;
|
||||||
srs_resset0->resourceType.choice.aperiodic->slotOffset = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset));
|
srs_resset->resourceType.choice.aperiodic->slotOffset =
|
||||||
*srs_resset0->resourceType.choice.aperiodic->slotOffset = minRXTXTIME;
|
calloc_or_fail(1, sizeof(*srs_resset->resourceType.choice.aperiodic->slotOffset));
|
||||||
srs_resset0->resourceType.choice.aperiodic->ext1 = NULL;
|
*srs_resset->resourceType.choice.aperiodic->slotOffset = minRXTXTIME;
|
||||||
|
srs_resset->resourceType.choice.aperiodic->ext1 = NULL;
|
||||||
}
|
}
|
||||||
srs_resset0->usage=NR_SRS_ResourceSet__usage_codebook;
|
srs_resset->usage = usage;
|
||||||
srs_resset0->alpha = calloc(1,sizeof(*srs_resset0->alpha));
|
srs_resset->alpha = calloc_or_fail(1, sizeof(*srs_resset->alpha));
|
||||||
*srs_resset0->alpha = NR_Alpha_alpha1;
|
*srs_resset->alpha = NR_Alpha_alpha1;
|
||||||
srs_resset0->p0 = calloc(1,sizeof(*srs_resset0->p0));
|
srs_resset->p0 = calloc_or_fail(1, sizeof(*srs_resset->p0));
|
||||||
*srs_resset0->p0 =-80;
|
*srs_resset->p0 = -80;
|
||||||
srs_resset0->pathlossReferenceRS = NULL;
|
srs_resset->pathlossReferenceRS = NULL;
|
||||||
srs_resset0->srs_PowerControlAdjustmentStates = NULL;
|
srs_resset->srs_PowerControlAdjustmentStates = NULL;
|
||||||
asn1cSeqAdd(&srs_Config->srs_ResourceSetToAddModList->list,srs_resset0);
|
return srs_resset;
|
||||||
|
}
|
||||||
|
|
||||||
srs_Config->srs_ResourceToReleaseList = NULL;
|
static NR_SRS_Resource_t *get_srs_resource(const NR_ServingCellConfigCommon_t *scc,
|
||||||
|
const NR_UE_NR_Capability_t *uecap,
|
||||||
srs_Config->srs_ResourceToAddModList = calloc(1,sizeof(*srs_Config->srs_ResourceToAddModList));
|
const int curr_bwp,
|
||||||
NR_SRS_Resource_t *srs_res0=calloc(1,sizeof(*srs_res0));
|
const int uid,
|
||||||
srs_res0->srs_ResourceId = res_id;
|
const int res_id,
|
||||||
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_port1;
|
const long maxMIMO_Layers,
|
||||||
|
const NR_SRS_Resource__transmissionComb_PR tx_comb,
|
||||||
|
int do_srs)
|
||||||
|
{
|
||||||
|
NR_SRS_Resource_t *srs_res = calloc_or_fail(1, sizeof(*srs_res));
|
||||||
|
srs_res->srs_ResourceId = res_id;
|
||||||
|
srs_res->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_port1;
|
||||||
if (do_srs) {
|
if (do_srs) {
|
||||||
long nrofSRS_Ports = 1;
|
long nrofSRS_Ports = 1;
|
||||||
if (uecap &&
|
if (uecap && uecap->featureSets && uecap->featureSets->featureSetsUplink
|
||||||
uecap->featureSets &&
|
&& uecap->featureSets->featureSetsUplink->list.count > 0) {
|
||||||
uecap->featureSets->featureSetsUplink &&
|
|
||||||
uecap->featureSets->featureSetsUplink->list.count > 0) {
|
|
||||||
NR_FeatureSetUplink_t *ul_feature_setup = uecap->featureSets->featureSetsUplink->list.array[0];
|
NR_FeatureSetUplink_t *ul_feature_setup = uecap->featureSets->featureSetsUplink->list.array[0];
|
||||||
switch (ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource) {
|
switch (ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource) {
|
||||||
case NR_SRS_Resources__maxNumberSRS_Ports_PerResource_n1:
|
case NR_SRS_Resources__maxNumberSRS_Ports_PerResource_n1:
|
||||||
@@ -799,55 +793,95 @@ static NR_SetupRelease_SRS_Config_t *get_config_srs(const NR_ServingCellConfigCo
|
|||||||
nrofSRS_Ports = 4;
|
nrofSRS_Ports = 4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_E(NR_RRC, "Max Number of SRS Ports Per Resource %ld is invalid!\n",
|
LOG_E(NR_RRC,
|
||||||
|
"Max Number of SRS Ports Per Resource %ld is invalid!\n",
|
||||||
ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource);
|
ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource);
|
||||||
}
|
}
|
||||||
nrofSRS_Ports = min(nrofSRS_Ports, maxMIMO_Layers);
|
nrofSRS_Ports = min(nrofSRS_Ports, maxMIMO_Layers);
|
||||||
switch (nrofSRS_Ports) {
|
switch (nrofSRS_Ports) {
|
||||||
case 1:
|
case 1:
|
||||||
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_port1;
|
srs_res->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_port1;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_ports2;
|
srs_res->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_ports2;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_ports4;
|
srs_res->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_ports4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG_E(NR_RRC, "Number of SRS Ports Per Resource %ld is invalid!\n",
|
LOG_E(NR_RRC,
|
||||||
|
"Number of SRS Ports Per Resource %ld is invalid!\n",
|
||||||
ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource);
|
ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG_I(NR_RRC, "SRS configured with %d ports\n", 1<<srs_res0->nrofSRS_Ports);
|
LOG_I(NR_RRC, "SRS configured with %d ports\n", 1 << srs_res->nrofSRS_Ports);
|
||||||
}
|
}
|
||||||
srs_res0->ptrs_PortIndex = NULL;
|
srs_res->ptrs_PortIndex = NULL;
|
||||||
srs_res0->transmissionComb.present = NR_SRS_Resource__transmissionComb_PR_n2;
|
srs_res->transmissionComb.present = tx_comb;
|
||||||
srs_res0->transmissionComb.choice.n2 = calloc(1,sizeof(*srs_res0->transmissionComb.choice.n2));
|
switch (tx_comb) {
|
||||||
srs_res0->transmissionComb.choice.n2->combOffset_n2 = 0;
|
case NR_SRS_Resource__transmissionComb_PR_n2:
|
||||||
srs_res0->transmissionComb.choice.n2->cyclicShift_n2 = 0;
|
srs_res->transmissionComb.choice.n2 = calloc_or_fail(1, sizeof(*srs_res->transmissionComb.choice.n2));
|
||||||
srs_res0->resourceMapping.startPosition = 1;
|
srs_res->transmissionComb.choice.n2->combOffset_n2 = 0;
|
||||||
srs_res0->resourceMapping.nrofSymbols = NR_SRS_Resource__resourceMapping__nrofSymbols_n1;
|
srs_res->transmissionComb.choice.n2->cyclicShift_n2 = 0;
|
||||||
srs_res0->resourceMapping.repetitionFactor = NR_SRS_Resource__resourceMapping__repetitionFactor_n1;
|
break;
|
||||||
srs_res0->freqDomainPosition = 0;
|
case NR_SRS_Resource__transmissionComb_PR_n4:
|
||||||
srs_res0->freqDomainShift = 0;
|
srs_res->transmissionComb.choice.n4 = calloc_or_fail(1, sizeof(*srs_res->transmissionComb.choice.n4));
|
||||||
srs_res0->freqHopping.b_SRS = 0;
|
srs_res->transmissionComb.choice.n4->combOffset_n4 = 0;
|
||||||
srs_res0->freqHopping.b_hop = 0;
|
srs_res->transmissionComb.choice.n4->cyclicShift_n4 = 0;
|
||||||
srs_res0->freqHopping.c_SRS = rrc_get_max_nr_csrs(curr_bwp, srs_res0->freqHopping.b_SRS);
|
break;
|
||||||
srs_res0->groupOrSequenceHopping = NR_SRS_Resource__groupOrSequenceHopping_neither;
|
default:
|
||||||
|
AssertFatal(1 == 0, "Invalid transmission comb %d\n", tx_comb);
|
||||||
|
}
|
||||||
|
srs_res->resourceMapping.startPosition = 1;
|
||||||
|
srs_res->resourceMapping.nrofSymbols = NR_SRS_Resource__resourceMapping__nrofSymbols_n1;
|
||||||
|
srs_res->resourceMapping.repetitionFactor = NR_SRS_Resource__resourceMapping__repetitionFactor_n1;
|
||||||
|
srs_res->freqDomainPosition = 0;
|
||||||
|
srs_res->freqDomainShift = 0;
|
||||||
|
srs_res->freqHopping.b_SRS = 0;
|
||||||
|
srs_res->freqHopping.b_hop = 0;
|
||||||
|
srs_res->freqHopping.c_SRS = rrc_get_max_nr_csrs(curr_bwp, srs_res->freqHopping.b_SRS);
|
||||||
|
srs_res->groupOrSequenceHopping = NR_SRS_Resource__groupOrSequenceHopping_neither;
|
||||||
if (do_srs) {
|
if (do_srs) {
|
||||||
srs_res0->resourceType.present = NR_SRS_Resource__resourceType_PR_periodic;
|
srs_res->resourceType.present = NR_SRS_Resource__resourceType_PR_periodic;
|
||||||
srs_res0->resourceType.choice.periodic = configure_periodic_srs(scc, uid);
|
srs_res->resourceType.choice.periodic = configure_periodic_srs(scc, uid);
|
||||||
} else {
|
} else {
|
||||||
srs_res0->resourceType.present = NR_SRS_Resource__resourceType_PR_aperiodic;
|
srs_res->resourceType.present = NR_SRS_Resource__resourceType_PR_aperiodic;
|
||||||
srs_res0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic));
|
srs_res->resourceType.choice.aperiodic = calloc_or_fail(1, sizeof(*srs_res->resourceType.choice.aperiodic));
|
||||||
}
|
}
|
||||||
srs_res0->sequenceId = 40;
|
srs_res->sequenceId = 40;
|
||||||
srs_res0->spatialRelationInfo = calloc(1,sizeof(*srs_res0->spatialRelationInfo));
|
srs_res->spatialRelationInfo = calloc_or_fail(1, sizeof(*srs_res->spatialRelationInfo));
|
||||||
srs_res0->spatialRelationInfo->servingCellId = NULL;
|
srs_res->spatialRelationInfo->servingCellId = NULL;
|
||||||
// TODO include CSI as reference signal when BWPs are handled properly
|
// TODO include CSI as reference signal when BWPs are handled properly
|
||||||
srs_res0->spatialRelationInfo->referenceSignal.present = NR_SRS_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
|
srs_res->spatialRelationInfo->referenceSignal.present = NR_SRS_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
|
||||||
srs_res0->spatialRelationInfo->referenceSignal.choice.ssb_Index = 0;
|
srs_res->spatialRelationInfo->referenceSignal.choice.ssb_Index = 0;
|
||||||
asn1cSeqAdd(&srs_Config->srs_ResourceToAddModList->list,srs_res0);
|
return srs_res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static NR_SetupRelease_SRS_Config_t *get_config_srs(const NR_ServingCellConfigCommon_t *scc,
|
||||||
|
const NR_UE_NR_Capability_t *uecap,
|
||||||
|
const int curr_bwp,
|
||||||
|
const int uid,
|
||||||
|
const int res_id,
|
||||||
|
const long maxMIMO_Layers,
|
||||||
|
const int minRXTXTIME,
|
||||||
|
int do_srs)
|
||||||
|
{
|
||||||
|
NR_SetupRelease_SRS_Config_t *setup_release_srs_Config = calloc_or_fail(1, sizeof(*setup_release_srs_Config));
|
||||||
|
setup_release_srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
|
||||||
|
setup_release_srs_Config->choice.setup = calloc_or_fail(1, sizeof(*setup_release_srs_Config->choice.setup));
|
||||||
|
NR_SRS_Config_t *srs_Config = setup_release_srs_Config->choice.setup;
|
||||||
|
|
||||||
|
srs_Config->srs_ResourceToAddModList = calloc_or_fail(1, sizeof(*srs_Config->srs_ResourceToAddModList));
|
||||||
|
NR_SRS_Resource_t *srs_res0 =
|
||||||
|
get_srs_resource(scc, uecap, curr_bwp, uid, res_id, maxMIMO_Layers, NR_SRS_Resource__transmissionComb_PR_n2, do_srs);
|
||||||
|
asn1cSeqAdd(&srs_Config->srs_ResourceToAddModList->list, srs_res0);
|
||||||
|
|
||||||
|
srs_Config->srs_ResourceSetToAddModList = calloc_or_fail(1, sizeof(*srs_Config->srs_ResourceSetToAddModList));
|
||||||
|
NR_SRS_ResourceSet_t *srs_resset0 = get_srs_resourceset(res_id, res_id, NR_SRS_ResourceSet__usage_codebook, minRXTXTIME, do_srs);
|
||||||
|
asn1cSeqAdd(&srs_Config->srs_ResourceSetToAddModList->list, srs_resset0);
|
||||||
|
|
||||||
|
srs_Config->srs_ResourceSetToReleaseList = NULL;
|
||||||
|
srs_Config->srs_ResourceToReleaseList = NULL;
|
||||||
|
|
||||||
return setup_release_srs_Config;
|
return setup_release_srs_Config;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user