move rrc_config_dl_ptrs_params to common header since it is also used by dlsim

This commit is contained in:
francescomani
2025-04-24 18:40:49 +02:00
parent 4f7bbda19a
commit 76040b97aa
4 changed files with 38 additions and 47 deletions
+37 -2
View File
@@ -62,7 +62,6 @@
#include "PHY/impl_defs_nr.h"
#include "PHY/phy_vars_nr_ue.h"
#include "RRC/NR/nr_rrc_config.h"
#include "RRC/NR/nr_rrc_proto.h"
#include "SCHED_NR/fapi_nr_l1.h"
#include "SCHED_NR/sched_nr.h"
#include "SCHED_NR_UE/defs.h"
@@ -86,7 +85,6 @@
#include "oai_asn1.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/TOOLS/sim.h"
#include "openair2/RRC/LTE/rrc_vars.h"
#include "thread-pool.h"
#include "time_meas.h"
#include "utils.h"
@@ -121,6 +119,43 @@ void nr_derive_key_ng_ran_star(uint16_t pci, uint64_t nr_arfcn_dl, const uint8_t
{
}
/* Function to set or overwrite PTRS DL RRC parameters */
static void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, long *ptrsNrb, long *ptrsMcs, long *epre_Ratio, long *reOffset)
{
int i=0;
NR_DMRS_DownlinkConfig_t *tmp = bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
// struct NR_SetupRelease_PTRS_DownlinkConfig *tmp=bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS;
/* check for memory allocation */
if (tmp->phaseTrackingRS == NULL) {
asn1cCalloc(tmp->phaseTrackingRS, TrackingRS);
TrackingRS->present = NR_SetupRelease_PTRS_DownlinkConfig_PR_setup;
asn1cCalloc(TrackingRS->choice.setup, setup);
asn1cCalloc(setup->frequencyDensity, freqD);
/* Fill the given values */
for(i = 0; i < 2; i++) {
asn1cSequenceAdd(freqD->list, long, nbr);
*nbr = ptrsNrb[i];
}
asn1cCalloc(setup->timeDensity, timeD);
for(i = 0; i < 3; i++) {
asn1cSequenceAdd(timeD->list, long, mcs);
*mcs = ptrsMcs[i];
}
asn1cCallocOne(setup->epre_Ratio, epre_Ratio[0]);
asn1cCallocOne(setup->resourceElementOffset, reOffset[0]);
} else {
NR_PTRS_DownlinkConfig_t *TrackingRS = tmp->phaseTrackingRS->choice.setup;
for(i = 0; i < 2; i++) {
*TrackingRS->frequencyDensity->list.array[i] = ptrsNrb[i];
}
for(i = 0; i < 3; i++) {
*TrackingRS->timeDensity->list.array[i] = ptrsMcs[i];
}
*TrackingRS->epre_Ratio = epre_Ratio[0];
*TrackingRS->resourceElementOffset = reOffset[0];
}
}
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
void e1_bearer_context_setup(const e1ap_bearer_setup_req_t *req) { abort(); }
+1
View File
@@ -23,6 +23,7 @@
#define __NR_RRC_COMMON_H__
#include <stdint.h>
#include "NR_BWP-Downlink.h"
#define NR_NUM_SRB 4 /* Number of Signalling Radio Bearers according to clause 4.2.2 of 3GPP TS 38.331 */
#define NR_RRC_BUF_SIZE 4096
-8
View File
@@ -66,14 +66,6 @@ void rrc_gNB_generate_RRCRelease(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE);
\param args_p Pointer on arguments to start the task. */
void *rrc_gnb_task(void *args_p);
/**\ Function to set or overwrite PTRS DL RRC parameters.
\ *bwp Pointer to dedicated RC config structure
\ *ptrsNrb Pointer to K_ptrs N_RB related parameters
\ *ptrsMcs Pointer to L_ptrs MCS related parameters
\ *epre_Ratio Pointer to ep_ratio
\ *reOffset Pointer to RE Offset Value */
void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, long *ptrsNrb, long *ptrsMcs, long *epre_Ratio, long *reOffset);
int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const int dl_bwp_id, const int ul_bwp_id);
void rrc_gNB_generate_dedicatedRRCReconfiguration_release(gNB_RRC_INST *rrc,
-37
View File
@@ -63,41 +63,4 @@ NR_RRCReconfiguration_IEs_t *get_default_reconfig(const NR_CellGroupConfig_t *se
reconfig->nonCriticalExtension = NULL;
return reconfig;
}
/* Function to set or overwrite PTRS DL RRC parameters */
void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, long *ptrsNrb, long *ptrsMcs, long *epre_Ratio, long *reOffset)
{
int i=0;
NR_DMRS_DownlinkConfig_t *tmp = bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup;
// struct NR_SetupRelease_PTRS_DownlinkConfig *tmp=bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS;
/* check for memory allocation */
if (tmp->phaseTrackingRS == NULL) {
asn1cCalloc(tmp->phaseTrackingRS, TrackingRS);
TrackingRS->present = NR_SetupRelease_PTRS_DownlinkConfig_PR_setup;
asn1cCalloc(TrackingRS->choice.setup, setup);
asn1cCalloc(setup->frequencyDensity, freqD);
/* Fill the given values */
for(i = 0; i < 2; i++) {
asn1cSequenceAdd(freqD->list, long, nbr);
*nbr = ptrsNrb[i];
}
asn1cCalloc(setup->timeDensity, timeD);
for(i = 0; i < 3; i++) {
asn1cSequenceAdd(timeD->list, long, mcs);
*mcs = ptrsMcs[i];
}
asn1cCallocOne(setup->epre_Ratio, epre_Ratio[0]);
asn1cCallocOne(setup->resourceElementOffset, reOffset[0]);
} else {
NR_PTRS_DownlinkConfig_t *TrackingRS = tmp->phaseTrackingRS->choice.setup;
for(i = 0; i < 2; i++) {
*TrackingRS->frequencyDensity->list.array[i] = ptrsNrb[i];
}
for(i = 0; i < 3; i++) {
*TrackingRS->timeDensity->list.array[i] = ptrsMcs[i];
}
*TrackingRS->epre_Ratio = epre_Ratio[0];
*TrackingRS->resourceElementOffset = reOffset[0];
}
}
#endif