diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 59a94deb91..ff4dcfa393 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -1551,7 +1551,17 @@ int nr_param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_resp // for now just 1 NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %d.%d pnf p7 %s:%d timing %u %u %u %u\n", p5_idx, phy->id, phy->remote_addr, phy->remote_port, p7_vnf->timing_window, p7_vnf->periodic_timing_period, p7_vnf->aperiodic_timing_enabled, p7_vnf->periodic_timing_period); - nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, phy->remote_port, phy->id); + // Hack? the VNF might need the subcarrier spacing for some calculations + // (that we actually don't use as of now...). We therefore need to save the + // mu, for the current PNF connection (together with where we have frame/slot + // info). nfapi_vnf_p7_add_pnf() prepends the current P7 connection to the + // beginning of the list. Pick it from there, and save the mu. + // check that SCS has actually been set + const nfapi_uint8_tlv_t *scs = &req->ssb_config.scs_common; + DevAssert(scs->tl.tag == NFAPI_NR_CONFIG_SCS_COMMON_TAG); + int mu = scs->value; + nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, phy->remote_port, phy->id, mu); + req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CONFIG_REQUEST; req->header.phy_id = phy->id; NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Send NFAPI_CONFIG_REQUEST\n"); @@ -1684,7 +1694,7 @@ int start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_start_response_t pnf_info *pnf = vnf->pnfs; phy_info *phy = pnf->phys; vnf_p7_info *p7_vnf = vnf->p7_vnfs; - nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, htons(phy->remote_port), phy->id); + nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, htons(phy->remote_port), phy->id, 0); return 0; } diff --git a/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h b/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h index 138a9a3570..77f0358e40 100644 --- a/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h +++ b/nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h @@ -932,13 +932,14 @@ int nfapi_vnf_p7_release_pdu(nfapi_vnf_p7_config_t* config, void*); * \param pnf_p7_addr The udp address the pnf p7 entity has chosen * \param pnf_p7_port The udp port the pnf p7 entity has chosen * \param phy_id The unique phy id for the pnf p7 entity + * \param mu The subcarrier spacing the PNF is operating with. * \return A status value. 0 equal success, -1 indicates failure * * This function should be used to each pnf p7 entity that is to be added to this * vnf p7 entity. Once added the vnf p7 entity will start establish sync with the * pnf p7 entity and that has been sucessfull will generate subframe indications for it */ -int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id); +int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id, int mu); /*! Delete a vnf p7 instance to the vnf p7 module * \param config A pointer to the vnf p7 configuration diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c index 2289a51120..d3160f4e30 100644 --- a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c +++ b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c @@ -534,7 +534,7 @@ int nfapi_vnf_p7_stop(nfapi_vnf_p7_config_t* config) return 0; } -int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id) +int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, int pnf_p7_port, int phy_id, int mu) { NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p phy_id:%d pnf_addr:%s pnf_p7_port:%d)\n", __FUNCTION__, config, phy_id, pnf_p7_addr, pnf_p7_port); @@ -558,7 +558,7 @@ int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr, node->sfn = 0; node->slot = 0; node->min_sync_cycle_count = 8; - node->mu = 1; /* TODO */ + node->mu = mu; // save the remote endpoint information node->remote_addr.sin_family = AF_INET; diff --git a/nfapi/open-nFAPI/vnf/tests/vnf_cunit_main.c b/nfapi/open-nFAPI/vnf/tests/vnf_cunit_main.c index 4df5da7c26..0b951047da 100644 --- a/nfapi/open-nFAPI/vnf/tests/vnf_cunit_main.c +++ b/nfapi/open-nFAPI/vnf/tests/vnf_cunit_main.c @@ -769,7 +769,7 @@ int start_response(nfapi_vnf_config_t* config, int p5_idx, nfapi_start_response_ vnf_test_config_vnf_t* vnf = &(vnf_test_config[0].vnfs[phy->vnf_idx]); - nfapi_vnf_p7_add_pnf(vnf->config, addr, port, response->header.phy_id); + nfapi_vnf_p7_add_pnf(vnf->config, addr, port, response->header.phy_id, 0); return 0; }