Commit ce35b668 authored by francescomani's avatar francescomani

handle csi-measconfig in sc_info

parent 9b9eb6f4
......@@ -589,7 +589,6 @@ typedef struct NR_UE_UL_BWP {
NR_PUSCH_Config_t *pusch_Config;
NR_PUCCH_Config_t *pucch_Config;
NR_PUCCH_ConfigCommon_t *pucch_ConfigCommon;
NR_CSI_MeasConfig_t *csi_MeasConfig;
NR_SRS_Config_t *srs_Config;
long *msg3_DeltaPreamble;
long transform_precoding;
......@@ -612,6 +611,8 @@ typedef struct {
long *rateMatching_PUSCH;
long *xOverhead_PUSCH;
long *maxMIMO_Layers_PUSCH;
NR_CSI_MeasConfig_t *csi_MeasConfig;
NR_CSI_AperiodicTriggerStateList_t *aperiodicTriggerStateList;
} NR_UE_ServingCell_Info_t;
typedef enum {
......
......@@ -3418,9 +3418,9 @@ uint16_t nr_dci_size(const NR_UE_DL_BWP_t *DL_BWP,
dci_pdu->srs_request.nbits = 3;
size += dci_pdu->srs_request.nbits;
// CSI request
if (UL_BWP->csi_MeasConfig != NULL) {
if (UL_BWP->csi_MeasConfig->reportTriggerSize != NULL) {
dci_pdu->csi_request.nbits = *UL_BWP->csi_MeasConfig->reportTriggerSize;
if (sc_info->csi_MeasConfig != NULL) {
if (sc_info->csi_MeasConfig->reportTriggerSize != NULL) {
dci_pdu->csi_request.nbits = *sc_info->csi_MeasConfig->reportTriggerSize;
size += dci_pdu->csi_request.nbits;
}
}
......
......@@ -40,6 +40,7 @@
#include "common/utils/nr/nr_common.h"
#include "executables/softmodem-common.h"
#include "SCHED_NR/phy_frame_config_nr.h"
#include "oai_asn1.h"
const long logicalChannelGroup0_NR = 0;
typedef struct NR_LogicalChannelConfig__ul_SpecificParameters LcConfig_UlParamas_t;
......@@ -744,8 +745,6 @@ void configure_current_BWP(NR_UE_MAC_INST_t *mac,
}
if(spCellConfigDedicated) {
UL_BWP->csi_MeasConfig = spCellConfigDedicated->csi_MeasConfig ? spCellConfigDedicated->csi_MeasConfig->choice.setup : NULL;
if (spCellConfigDedicated->firstActiveDownlinkBWP_Id)
DL_BWP->bwp_id = *spCellConfigDedicated->firstActiveDownlinkBWP_Id;
if (spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id)
......@@ -1009,9 +1008,328 @@ void configure_maccellgroup(NR_UE_MAC_INST_t *mac, const NR_MAC_CellGroupConfig_
}
}
void configure_servingcell_info(NR_UE_ServingCell_Info_t *sc_info,
static void configure_csiconfig(NR_UE_ServingCell_Info_t *sc_info,
struct NR_SetupRelease_CSI_MeasConfig *csi_MeasConfig_sr)
{
switch (csi_MeasConfig_sr->present) {
case NR_SetupRelease_CSI_MeasConfig_PR_NOTHING :
break;
case NR_SetupRelease_CSI_MeasConfig_PR_release :
ASN_STRUCT_FREE(asn_DEF_NR_CSI_MeasConfig,
sc_info->csi_MeasConfig);
sc_info->csi_MeasConfig = NULL;
break;
case NR_SetupRelease_CSI_MeasConfig_PR_setup :
if (!sc_info->csi_MeasConfig) { // setup
updateMACie(sc_info->csi_MeasConfig,
csi_MeasConfig_sr->choice.setup,
NR_CSI_MeasConfig_t);
}
else { // modification
NR_CSI_MeasConfig_t *csi_MeasConfig = csi_MeasConfig_sr->choice.setup;
if (csi_MeasConfig->reportTriggerSize)
updateMACie(sc_info->csi_MeasConfig->reportTriggerSize,
csi_MeasConfig->reportTriggerSize,
long);
if (csi_MeasConfig->aperiodicTriggerStateList)
handleMACsetuprelease(sc_info->aperiodicTriggerStateList,
csi_MeasConfig->aperiodicTriggerStateList,
NR_CSI_AperiodicTriggerStateList_t,
asn_DEF_NR_CSI_AperiodicTriggerStateList);
if (csi_MeasConfig->semiPersistentOnPUSCH_TriggerStateList)
handleMACsetuprelease(sc_info->csi_MeasConfig->semiPersistentOnPUSCH_TriggerStateList->choice.setup,
csi_MeasConfig->semiPersistentOnPUSCH_TriggerStateList,
NR_CSI_SemiPersistentOnPUSCH_TriggerStateList_t,
asn_DEF_NR_CSI_SemiPersistentOnPUSCH_TriggerStateList);
// NZP-CSI-RS-Resources
if (csi_MeasConfig->nzp_CSI_RS_ResourceToReleaseList) {
for (int i = 0; i < csi_MeasConfig->nzp_CSI_RS_ResourceToReleaseList->list.count; i++) {
long id = *csi_MeasConfig->nzp_CSI_RS_ResourceToReleaseList->list.array[i];
int j;
for (j = 0; j < sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.array[j]->nzp_CSI_RS_ResourceId)
break;
}
if (j < sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.count)
asn_sequence_del(&sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list, j, 1);
else
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n");
}
}
if (csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList) {
for (int i = 0; i < csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.count; i++) {
NR_NZP_CSI_RS_Resource_t *res = csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.array[i];
long id = res->nzp_CSI_RS_ResourceId;
int j;
for (j = 0; j < sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.array[j]->nzp_CSI_RS_ResourceId)
break;
}
if (j < sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.count) { // modify
NR_NZP_CSI_RS_Resource_t *mac_res = sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list.array[j];
mac_res->resourceMapping = res->resourceMapping;
mac_res->powerControlOffset = res->powerControlOffset;
updateMACie(mac_res->powerControlOffsetSS,
res->powerControlOffsetSS,
long);
mac_res->scramblingID = res->scramblingID;
if (res->periodicityAndOffset)
updateMACie(mac_res->periodicityAndOffset,
res->periodicityAndOffset,
NR_CSI_ResourcePeriodicityAndOffset_t);
if (res->qcl_InfoPeriodicCSI_RS)
updateMACie(mac_res->qcl_InfoPeriodicCSI_RS,
res->qcl_InfoPeriodicCSI_RS,
NR_TCI_StateId_t);
}
else { // add
asn1cSequenceAdd(sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,
NR_NZP_CSI_RS_Resource_t,
nzp_csi_rs);
updateMACie(nzp_csi_rs, res, NR_NZP_CSI_RS_Resource_t);
}
}
}
// NZP-CSI-RS-ResourceSets
if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList) {
for (int i = 0; i < csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList->list.count; i++) {
long id = *csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList->list.array[i];
int j;
for (j = 0; j < sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[j]->nzp_CSI_ResourceSetId)
break;
}
if (j < sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.count)
asn_sequence_del(&sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list, j, 1);
else
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n");
}
}
if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList) {
for (int i = 0; i < csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.count; i++) {
NR_NZP_CSI_RS_ResourceSet_t *res = csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[i];
long id = res->nzp_CSI_ResourceSetId;
int j;
for (j = 0; j < sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[j]->nzp_CSI_ResourceSetId)
break;
}
if (j < sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.count) { // modify
NR_NZP_CSI_RS_ResourceSet_t *mac_res = sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[j];
updateMACie(mac_res, res, NR_NZP_CSI_RS_ResourceSet_t);
}
else { // add
asn1cSequenceAdd(sc_info->csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,
NR_NZP_CSI_RS_ResourceSet_t,
nzp_csi_rsset);
updateMACie(nzp_csi_rsset, res, NR_NZP_CSI_RS_ResourceSet_t);
}
}
}
// CSI-IM-Resource
if (csi_MeasConfig->csi_IM_ResourceToReleaseList) {
for (int i = 0; i < csi_MeasConfig->csi_IM_ResourceToReleaseList->list.count; i++) {
long id = *csi_MeasConfig->csi_IM_ResourceToReleaseList->list.array[i];
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list.array[j]->csi_IM_ResourceId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list.count)
asn_sequence_del(&sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list, j, 1);
else
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n");
}
}
if (csi_MeasConfig->csi_IM_ResourceToAddModList) {
for (int i = 0; i < csi_MeasConfig->csi_IM_ResourceToAddModList->list.count; i++) {
NR_CSI_IM_Resource_t *res = csi_MeasConfig->csi_IM_ResourceToAddModList->list.array[i];
long id = res->csi_IM_ResourceId;
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list.array[j]->csi_IM_ResourceId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list.count) { // modify
NR_CSI_IM_Resource_t *mac_res = sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list.array[j];
if (res->csi_IM_ResourceElementPattern)
updateMACie(mac_res->csi_IM_ResourceElementPattern,
res->csi_IM_ResourceElementPattern,
struct NR_CSI_IM_Resource__csi_IM_ResourceElementPattern);
if (res->freqBand)
updateMACie(mac_res->freqBand,
res->freqBand,
NR_CSI_FrequencyOccupation_t);
if (res->periodicityAndOffset)
updateMACie(mac_res->periodicityAndOffset,
res->periodicityAndOffset,
NR_CSI_ResourcePeriodicityAndOffset_t);
}
else { // add
asn1cSequenceAdd(sc_info->csi_MeasConfig->csi_IM_ResourceToAddModList->list,
NR_CSI_IM_Resource_t,
csi_im);
updateMACie(csi_im, res, NR_CSI_IM_Resource_t);
}
}
}
// CSI-IM-ResourceSets
if (csi_MeasConfig->csi_IM_ResourceSetToReleaseList) {
for (int i = 0; i < csi_MeasConfig->csi_IM_ResourceSetToReleaseList->list.count; i++) {
long id = *csi_MeasConfig->csi_IM_ResourceSetToReleaseList->list.array[i];
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.array[j]->csi_IM_ResourceSetId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.count)
asn_sequence_del(&sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list, j, 1);
else
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n");
}
}
if (csi_MeasConfig->csi_IM_ResourceSetToAddModList) {
for (int i = 0; i < csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.count; i++) {
NR_CSI_IM_ResourceSet_t *res = csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.array[i];
long id = res->csi_IM_ResourceSetId;
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.array[j]->csi_IM_ResourceSetId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.count) { // modify
NR_CSI_IM_ResourceSet_t *mac_res = sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list.array[j];
updateMACie(mac_res, res, NR_CSI_IM_ResourceSet_t);
}
else { // add
asn1cSequenceAdd(sc_info->csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,
NR_CSI_IM_ResourceSet_t,
csi_im_set);
updateMACie(csi_im_set, res, NR_CSI_IM_ResourceSet_t);
}
}
}
// CSI-SSB-ResourceSets
if (csi_MeasConfig->csi_SSB_ResourceSetToReleaseList) {
for (int i = 0; i < csi_MeasConfig->csi_SSB_ResourceSetToReleaseList->list.count; i++) {
long id = *csi_MeasConfig->csi_SSB_ResourceSetToReleaseList->list.array[i];
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[j]->csi_SSB_ResourceSetId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count)
asn_sequence_del(&sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list, j, 1);
else
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n");
}
}
if (csi_MeasConfig->csi_SSB_ResourceSetToAddModList) {
for (int i = 0; i < csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; i++) {
NR_CSI_SSB_ResourceSet_t *res = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[i];
long id = res->csi_SSB_ResourceSetId;
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[j]->csi_SSB_ResourceSetId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.count) { // modify
NR_CSI_SSB_ResourceSet_t *mac_res = sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[j];
updateMACie(mac_res, res, NR_CSI_SSB_ResourceSet_t);
}
else { // add
asn1cSequenceAdd(sc_info->csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,
NR_CSI_SSB_ResourceSet_t,
csi_ssb_set);
updateMACie(csi_ssb_set, res, NR_CSI_SSB_ResourceSet_t);
}
}
}
// CSI-ResourceConfigs
if (csi_MeasConfig->csi_ResourceConfigToReleaseList) {
for (int i = 0; i < csi_MeasConfig->csi_ResourceConfigToReleaseList->list.count; i++) {
long id = *csi_MeasConfig->csi_ResourceConfigToReleaseList->list.array[i];
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[j]->csi_ResourceConfigId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list.count)
asn_sequence_del(&sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list, j, 1);
else
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n");
}
}
if (csi_MeasConfig->csi_ResourceConfigToAddModList) {
for (int i = 0; i < csi_MeasConfig->csi_ResourceConfigToAddModList->list.count; i++) {
NR_CSI_ResourceConfig_t *res = csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[i];
long id = res->csi_ResourceConfigId;
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[j]->csi_ResourceConfigId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list.count) { // modify
NR_CSI_ResourceConfig_t *mac_res = sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[j];
updateMACie(mac_res, res, NR_CSI_ResourceConfig_t);
}
else { // add
asn1cSequenceAdd(sc_info->csi_MeasConfig->csi_ResourceConfigToAddModList->list,
NR_CSI_ResourceConfig_t,
csi_config);
updateMACie(csi_config, res, NR_CSI_ResourceConfig_t);
}
}
}
// CSI-ReportConfigs
if (csi_MeasConfig->csi_ReportConfigToReleaseList) {
for (int i = 0; i < csi_MeasConfig->csi_ReportConfigToReleaseList->list.count; i++) {
long id = *csi_MeasConfig->csi_ReportConfigToReleaseList->list.array[i];
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list.array[j]->reportConfigId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list.count)
asn_sequence_del(&sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list, j, 1);
else
LOG_E(NR_MAC, "Element not present in the list, impossible to release\n");
}
}
if (csi_MeasConfig->csi_ReportConfigToAddModList) {
for (int i = 0; i < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; i++) {
NR_CSI_ReportConfig_t *res = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[i];
long id = res->reportConfigId;
int j;
for (j = 0; j < sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list.count; j++) {
if(id == sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list.array[j]->reportConfigId)
break;
}
if (j < sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list.count) { // modify
NR_CSI_ReportConfig_t *mac_res = sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list.array[j];
updateMACie(mac_res, res, NR_CSI_ReportConfig_t);
}
else { // add
asn1cSequenceAdd(sc_info->csi_MeasConfig->csi_ReportConfigToAddModList->list,
NR_CSI_ReportConfig_t,
csi_rep);
updateMACie(csi_rep, res, NR_CSI_ReportConfig_t);
}
}
}
}
break;
default :
AssertFatal(false, "Invalid case\n");
}
}
static void configure_servingcell_info(NR_UE_ServingCell_Info_t *sc_info,
NR_ServingCellConfig_t *scd)
{
if (scd->csi_MeasConfig)
configure_csiconfig(sc_info, scd->csi_MeasConfig);
if (scd->supplementaryUplink)
updateMACie(sc_info->supplementaryUplink,
scd->supplementaryUplink,
......
......@@ -2507,8 +2507,8 @@ int nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCC
NR_PUCCH_Config_t *pucch_Config = current_UL_BWP->pucch_Config;
int num_csi = 0;
if (current_UL_BWP->csi_MeasConfig) {
NR_CSI_MeasConfig_t *csi_measconfig = current_UL_BWP->csi_MeasConfig;
if (mac->sc_info.csi_MeasConfig) {
NR_CSI_MeasConfig_t *csi_measconfig = mac->sc_info.csi_MeasConfig;
int csi_priority = INT_MAX;
for (int csi_report_id = 0; csi_report_id < csi_measconfig->csi_ReportConfigToAddModList->list.count; csi_report_id++){
......
......@@ -2157,14 +2157,12 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, vo
}
}
void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) {
NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP;
if (!current_UL_BWP->csi_MeasConfig)
void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot)
{
if (!mac->sc_info.csi_MeasConfig)
return;
NR_CSI_MeasConfig_t *csi_measconfig = current_UL_BWP->csi_MeasConfig;
NR_CSI_MeasConfig_t *csi_measconfig = mac->sc_info.csi_MeasConfig;
if (csi_measconfig->csi_IM_ResourceToAddModList == NULL)
return;
......@@ -2295,14 +2293,12 @@ uint8_t set_csirs_measurement_bitmap(NR_CSI_MeasConfig_t *csi_measconfig,
return meas_bitmap;
}
void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) {
NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP;
if (!current_UL_BWP->csi_MeasConfig)
void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot)
{
if (!mac->sc_info.csi_MeasConfig)
return;
NR_CSI_MeasConfig_t *csi_measconfig = current_UL_BWP->csi_MeasConfig;
NR_CSI_MeasConfig_t *csi_measconfig = mac->sc_info.csi_MeasConfig;
if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList == NULL)
return;
......
......@@ -2117,7 +2117,6 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
UL_BWP->pusch_Config = ubwpd->pusch_Config->choice.setup;
UL_BWP->pucch_Config = ubwpd->pucch_Config->choice.setup;
UL_BWP->srs_Config = ubwpd->srs_Config->choice.setup;
UL_BWP->csi_MeasConfig = servingCellConfig->csi_MeasConfig ? servingCellConfig->csi_MeasConfig->choice.setup : NULL;
}
else {
DL_BWP->bwp_id = 0;
......@@ -2126,7 +2125,6 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
DL_BWP->pdsch_Config = NULL;
UL_BWP->pusch_Config = NULL;
UL_BWP->pucch_Config = NULL;
UL_BWP->csi_MeasConfig = NULL;
UL_BWP->configuredGrantConfig = NULL;
}
......@@ -2183,6 +2181,10 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
if(UE) {
NR_UE_ServingCell_Info_t *sc_info = &UE->sc_info;
if (servingCellConfig) {
if(servingCellConfig->csi_MeasConfig) {
sc_info->csi_MeasConfig = servingCellConfig->csi_MeasConfig->choice.setup;
compute_csi_bitlen (sc_info->csi_MeasConfig, UE->csi_report_template);
}
if (servingCellConfig->pdsch_ServingCellConfig &&
servingCellConfig->pdsch_ServingCellConfig->choice.setup) {
NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig = servingCellConfig->pdsch_ServingCellConfig->choice.setup;
......@@ -2247,9 +2249,6 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0) :
NR_UL_DCI_FORMAT_0_0;
if (UL_BWP->csi_MeasConfig)
compute_csi_bitlen (UL_BWP->csi_MeasConfig, UE->csi_report_template);
set_max_fb_time(UL_BWP, DL_BWP);
set_sched_pucch_list(sched_ctrl, UL_BWP, scc);
}
......@@ -2574,7 +2573,6 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
UE_iterator(UE_info->list, UE) {
NR_UE_DL_BWP_t *dl_bwp = &UE->current_DL_BWP;
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
// CSI-RS is common to all UEs in a given BWP
// therefore we need to schedule only once per BWP
......@@ -2587,9 +2585,10 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
continue;
}
if (!ul_bwp->csi_MeasConfig) continue;
if (!UE->sc_info.csi_MeasConfig)
continue;
NR_CSI_MeasConfig_t *csi_measconfig = ul_bwp->csi_MeasConfig;
NR_CSI_MeasConfig_t *csi_measconfig = UE->sc_info.csi_MeasConfig;
// looking for the correct CSI-RS resource in current BWP
NR_NZP_CSI_RS_ResourceSetId_t *nzp = NULL;
......
......@@ -212,8 +212,9 @@ void nr_csi_meas_reporting(int Mod_idP,
if ((sched_ctrl->rrc_processing_timer > 0) || (sched_ctrl->ul_failure && !get_softmodem_params()->phy_test)) {
continue;
}
const NR_CSI_MeasConfig_t *csi_measconfig = ul_bwp->csi_MeasConfig;
if (!csi_measconfig) continue;
const NR_CSI_MeasConfig_t *csi_measconfig = UE->sc_info.csi_MeasConfig;
if (!csi_measconfig)
continue;
AssertFatal(csi_measconfig->csi_ReportConfigToAddModList->list.count > 0,
"NO CSI report configuration available");
NR_PUCCH_Config_t *pucch_Config = ul_bwp->pucch_Config;
......@@ -1051,8 +1052,8 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
return;
}
NR_CSI_MeasConfig_t *csi_MeasConfig = UE->current_UL_BWP.csi_MeasConfig;
if (csi_MeasConfig==NULL) {
NR_CSI_MeasConfig_t *csi_MeasConfig = UE->sc_info.csi_MeasConfig;
if (csi_MeasConfig == NULL) {
NR_SCHED_UNLOCK(&nrmac->sched_lock);
return;
}
......
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