Properly pass the frequency offset to Tx/Rx endpoints

This commit is contained in:
Teodora
2025-08-26 15:17:38 +02:00
parent 10d60f71ce
commit 0b0e804f73
3 changed files with 26 additions and 8 deletions
+4
View File
@@ -198,6 +198,10 @@ typedef struct split7_config {
} slot_dirs[160];
/*! this is the exponent in 2^X for the FFT size */
uint16_t fftSize;
// M-plane related parameters
uint16_t dl_k0[5];
uint16_t ul_k0[5];
} split7_config_t;
/*! \brief RF frontend parameters set by application */
+15 -8
View File
@@ -104,7 +104,9 @@ static bool create_proc_elem_v2(struct ly_ctx **ctx, const ru_session_t *ru_sess
return true;
}
static LY_ERR fill_uplane_ch_common_v2(const xran_mplane_t *xran_mplane, const size_t idx, struct lyd_node **root)
typedef enum { UP_CH_RX, UP_CH_TX } uplane_dir_t;
static LY_ERR fill_uplane_ch_common_v2(const uplane_dir_t dir, const xran_mplane_t *xran_mplane, const openair0_config_t *oai, const size_t idx, struct lyd_node **root)
{
LY_ERR ret = LY_SUCCESS;
@@ -114,8 +116,13 @@ static LY_ERR fill_uplane_ch_common_v2(const xran_mplane_t *xran_mplane, const s
ret = lyd_new_term(*root, NULL, "cp-length-other", "0", 0, NULL);
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"cp-length-other\" node.\n");
// to we actually store this from DU config file?
ret = lyd_new_term(*root, NULL, "offset-to-absolute-frequency-center", "0", 0, NULL);
char freq_offset[8];
if (dir == UP_CH_RX) {
snprintf(freq_offset, sizeof(freq_offset), "%d", oai->split7.ul_k0[oai->nr_scs_for_raster]);
} else {
snprintf(freq_offset, sizeof(freq_offset), "%d", oai->split7.dl_k0[oai->nr_scs_for_raster]);
}
ret = lyd_new_term(*root, NULL, "offset-to-absolute-frequency-center", freq_offset, 0, NULL);
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"offset-to-absolute-frequency-center\" node.\n");
struct lyd_node *compression_node = NULL;
@@ -171,7 +178,7 @@ static bool fill_uplane_ch_rx_v2(const xran_mplane_t *xran_mplane, const openair
{
LY_ERR ret = LY_SUCCESS;
ret = fill_uplane_ch_common_v2(xran_mplane, idx, root);
ret = fill_uplane_ch_common_v2(UP_CH_RX, xran_mplane, oai, idx, root);
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create common nodes.\n");
return true;
@@ -181,7 +188,7 @@ static bool fill_uplane_ch_tx_v2(const xran_mplane_t *xran_mplane, const openair
{
LY_ERR ret = LY_SUCCESS;
ret = fill_uplane_ch_common_v2(xran_mplane, idx, root);
ret = fill_uplane_ch_common_v2(UP_CH_TX, xran_mplane, oai, idx, root);
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create common nodes.\n");
return true;
@@ -274,7 +281,7 @@ static bool create_uplane_conf_v2(struct ly_ctx **ctx, const ru_session_t *ru_se
ret = lyd_new_list(*root, NULL, "low-level-rx-endpoints", 0, &pusch_node, ru_session->ru_mplane_config.rx_endpoints.name[i]);
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"low-level-rx-endpoints\" node.\n");
success = fill_uplane_ch_rx_v2(&ru_session->xran_mplane, i, &pusch_node);
success = fill_uplane_ch_rx_v2(&ru_session->xran_mplane, oai, i, &pusch_node);
VERIFY_SUCCESS(success, "[MPLANE] Failed to fill \"low-level-rx-endpoints\" node for %s.\n", ru_session->ru_mplane_config.rx_endpoints.name[i]);
const size_t prach_endpoint_name_offset = i + (ru_session->ru_mplane_config.rx_endpoints.num / 2);
@@ -282,7 +289,7 @@ static bool create_uplane_conf_v2(struct ly_ctx **ctx, const ru_session_t *ru_se
ret = lyd_new_list(*root, NULL, "low-level-rx-endpoints", 0, &prach_node, ru_session->ru_mplane_config.rx_endpoints.name[prach_endpoint_name_offset]);
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"low-level-rx-endpoints\" node.\n");
success = fill_uplane_ch_rx_v2(&ru_session->xran_mplane, i + ru_session->xran_mplane.prach_offset, &prach_node);
success = fill_uplane_ch_rx_v2(&ru_session->xran_mplane, oai, i + ru_session->xran_mplane.prach_offset, &prach_node);
VERIFY_SUCCESS(success, "[MPLANE] Failed to fill \"low-level-rx-endpoints\" node for %s.\n", ru_session->ru_mplane_config.rx_endpoints.name[prach_endpoint_name_offset]);
}
@@ -293,7 +300,7 @@ static bool create_uplane_conf_v2(struct ly_ctx **ctx, const ru_session_t *ru_se
ret = lyd_new_list(*root, NULL, "low-level-tx-endpoints", 0, &pdsch_node, ru_session->ru_mplane_config.tx_endpoints.name[i]);
VERIFY_SUCCESS(ret == LY_SUCCESS, "[MPLANE] Failed to create \"low-level-tx-endpoints\" node.\n");
success = fill_uplane_ch_tx_v2(&ru_session->xran_mplane, i, &pdsch_node);
success = fill_uplane_ch_tx_v2(&ru_session->xran_mplane, oai, i, &pdsch_node);
VERIFY_SUCCESS(success, "[MPLANE] Failed to fill \"low-level-tx-endpoints\" node for %s.\n", ru_session->ru_mplane_config.tx_endpoints.name[i]);
}