Use existing VNF functions for P7 messages
Remove duplicated functions in fapi_vnf_p7.c, leaving only functions for messages that require usage of the secondaty data_buf for unpacking Move vnf_info struct declaration to nfapi_vnf.h to be available in fapi_nvIPC.c
This commit is contained in:
@@ -48,11 +48,13 @@
|
|||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#include <sys/epoll.h>
|
#include <sys/epoll.h>
|
||||||
#include "fapi_nvIPC.h"
|
#include "fapi_nvIPC.h"
|
||||||
|
#include <nfapi_vnf.h>
|
||||||
|
#include <nr_fapi_p7_utils.h>
|
||||||
#include "nfapi_interface.h"
|
#include "nfapi_interface.h"
|
||||||
#include "nfapi.h"
|
#include "nfapi.h"
|
||||||
#include "nfapi_nr_interface_scf.h"
|
#include "nfapi_nr_interface_scf.h"
|
||||||
#include "nfapi/open-nFAPI/vnf/inc/vnf_p7.h"
|
#include "nfapi/open-nFAPI/vnf/inc/vnf_p7.h"
|
||||||
|
#include "system.h"
|
||||||
#include "fapi_vnf_p7.h"
|
#include "fapi_vnf_p7.h"
|
||||||
|
|
||||||
#define MAX_EVENTS 10
|
#define MAX_EVENTS 10
|
||||||
@@ -92,40 +94,12 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vnf_p7_t *vnf_p7_config = (vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config;
|
||||||
switch (fapi_msg.message_id) {
|
switch (fapi_msg.message_id) {
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE ... NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION:
|
case NFAPI_NR_PHY_MSG_TYPE_PARAM_RESPONSE ... NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION:
|
||||||
vnf_nr_handle_p4_p5_message(msg->msg_buf, msg->msg_len, 1, vnf_config);
|
vnf_nr_handle_p4_p5_message(msg->msg_buf, msg->msg_len, 1, vnf_config);
|
||||||
break;
|
break;
|
||||||
// P7 Messages
|
// P7 Messages
|
||||||
// P7 Message Handlers -> ((vnf_info *)vnf_config->user_data)->p7_vnfs->config->
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: {
|
|
||||||
nfapi_nr_slot_indication_scf_t ind;
|
|
||||||
aerial_unpack_nr_slot_indication(&pReadPackedMessage,
|
|
||||||
end,
|
|
||||||
&ind,
|
|
||||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
|
||||||
// check if the sfn/slot unpacked come wrong at any time, should be old + 1 (slot 0 -- 19, sfn 0 -- 1023)
|
|
||||||
// add 1 to current sfn number
|
|
||||||
uint16_t old_slot_plus = ((old_slot + 1) % 20);
|
|
||||||
uint16_t old_sfn_plus = old_slot_plus == 0 ? ((old_sfn + 1) % 1024) : old_sfn;
|
|
||||||
if (old_slot_plus != ind.slot || old_sfn_plus != ind.sfn) {
|
|
||||||
LOG_E(NFAPI_VNF,
|
|
||||||
"\n============================================================================\n"
|
|
||||||
"sfn slot doesn't match unpacked one! L2->L1 %d.%d vs L1->L2 %d.%d \n"
|
|
||||||
"============================================================================\n",
|
|
||||||
old_sfn,
|
|
||||||
old_slot,
|
|
||||||
ind.sfn,
|
|
||||||
ind.slot);
|
|
||||||
}
|
|
||||||
old_sfn = ind.sfn;
|
|
||||||
old_slot = ind.slot;
|
|
||||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_slot_indication) {
|
|
||||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_slot_indication)(&ind);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: {
|
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: {
|
||||||
uint8_t *pReadData = msg->data_buf;
|
uint8_t *pReadData = msg->data_buf;
|
||||||
int dataBufLen = msg->data_len;
|
int dataBufLen = msg->data_len;
|
||||||
@@ -139,10 +113,10 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
|
|||||||
&pReadData,
|
&pReadData,
|
||||||
data_end,
|
data_end,
|
||||||
&ind,
|
&ind,
|
||||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
&vnf_p7_config->_public.codec_config);
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RX Indication\n", __FUNCTION__);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RX Indication\n", __FUNCTION__);
|
||||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_rx_data_indication) {
|
if (vnf_p7_config->_public.nr_rx_data_indication) {
|
||||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_rx_data_indication)(&ind);
|
(vnf_p7_config->_public.nr_rx_data_indication)(&ind);
|
||||||
for (int i = 0; i < ind.number_of_pdus; ++i) {
|
for (int i = 0; i < ind.number_of_pdus; ++i) {
|
||||||
free(ind.pdu_list[i].pdu);
|
free(ind.pdu_list[i].pdu);
|
||||||
}
|
}
|
||||||
@@ -151,53 +125,6 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: {
|
|
||||||
nfapi_nr_crc_indication_t crc_ind;
|
|
||||||
crc_ind.header.message_id = fapi_msg.message_id;
|
|
||||||
crc_ind.header.message_length = fapi_msg.message_length;
|
|
||||||
aerial_unpack_nr_crc_indication(&pReadPackedMessage,
|
|
||||||
end,
|
|
||||||
&crc_ind,
|
|
||||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
|
||||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_crc_indication) {
|
|
||||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_crc_indication)(&crc_ind);
|
|
||||||
free(crc_ind.crc_list);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: {
|
|
||||||
nfapi_nr_uci_indication_t ind;
|
|
||||||
aerial_unpack_nr_uci_indication(&pReadPackedMessage,
|
|
||||||
end,
|
|
||||||
&ind,
|
|
||||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
|
||||||
|
|
||||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_uci_indication) {
|
|
||||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_uci_indication)(&ind);
|
|
||||||
for (int i = 0; i < ind.num_ucis; i++) {
|
|
||||||
if (ind.uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) {
|
|
||||||
if (ind.uci_list[i].pucch_pdu_format_2_3_4.sr.sr_payload) {
|
|
||||||
free(ind.uci_list[i].pucch_pdu_format_2_3_4.sr.sr_payload);
|
|
||||||
}
|
|
||||||
if(ind.uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload){
|
|
||||||
free(ind.uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
|
|
||||||
}
|
|
||||||
if(ind.uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload){
|
|
||||||
free(ind.uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
|
|
||||||
}
|
|
||||||
if(ind.uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload){
|
|
||||||
free(ind.uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
free(ind.uci_list);
|
|
||||||
ind.uci_list = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: {
|
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: {
|
||||||
uint8_t *pReadData = msg->data_buf;
|
uint8_t *pReadData = msg->data_buf;
|
||||||
int dataBufLen = msg->data_len;
|
int dataBufLen = msg->data_len;
|
||||||
@@ -208,26 +135,47 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
|
|||||||
&pReadData,
|
&pReadData,
|
||||||
data_end,
|
data_end,
|
||||||
&ind,
|
&ind,
|
||||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
&vnf_p7_config->_public.codec_config);
|
||||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_srs_indication) {
|
if (vnf_p7_config->_public.nr_srs_indication) {
|
||||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_srs_indication)(&ind);
|
(vnf_p7_config->_public.nr_srs_indication)(&ind);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: {
|
||||||
|
nfapi_nr_slot_indication_scf_t ind;
|
||||||
|
if (!vnf_p7_config->_public.unpack_func(msg->msg_buf, msg->msg_len, &ind, sizeof(ind), &vnf_p7_config->_public.codec_config)) {
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
|
||||||
|
} else {
|
||||||
|
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling NR SLOT Indication\n", __FUNCTION__);
|
||||||
|
// check if the sfn/slot unpacked come wrong at any time, should be old + 1 (slot 0 -- 19, sfn 0 -- 1023)
|
||||||
|
// add 1 to current sfn number
|
||||||
|
uint16_t old_slot_plus = ((old_slot + 1) % 20);
|
||||||
|
uint16_t old_sfn_plus = old_slot_plus == 0 ? ((old_sfn + 1) % 1024) : old_sfn;
|
||||||
|
if (old_slot_plus != ind.slot || old_sfn_plus != ind.sfn) {
|
||||||
|
LOG_E(NFAPI_VNF,
|
||||||
|
"\n============================================================================\n"
|
||||||
|
"sfn slot doesn't match unpacked one! L2->L1 %d.%d vs L1->L2 %d.%d \n"
|
||||||
|
"============================================================================\n",
|
||||||
|
old_sfn,
|
||||||
|
old_slot,
|
||||||
|
ind.sfn,
|
||||||
|
ind.slot);
|
||||||
|
}
|
||||||
|
old_sfn = ind.sfn;
|
||||||
|
old_slot = ind.slot;
|
||||||
|
if (vnf_p7_config->_public.nr_slot_indication) {
|
||||||
|
(vnf_p7_config->_public.nr_slot_indication)(&ind);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
|
||||||
|
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
|
||||||
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: {
|
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: {
|
||||||
nfapi_nr_rach_indication_t ind;
|
vnf_nr_handle_p7_message(msg->msg_buf, msg->msg_len, vnf_p7_config);
|
||||||
aerial_unpack_nr_rach_indication(&pReadPackedMessage,
|
|
||||||
end,
|
|
||||||
&ind,
|
|
||||||
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
|
|
||||||
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_rach_indication) {
|
|
||||||
(((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_rach_indication)(&ind);
|
|
||||||
free(ind.pdu_list);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s P5 Unknown message ID %d\n", __FUNCTION__, fapi_msg.message_id);
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s P5 Unknown message ID %d\n", __FUNCTION__, fapi_msg.message_id);
|
||||||
|
|
||||||
@@ -322,10 +270,10 @@ bool aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_message_header_t *header)
|
bool aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_message_header_t *header)
|
||||||
{
|
{
|
||||||
if (ipc == NULL) {
|
if (ipc == NULL) {
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
nv_ipc_msg_t send_msg;
|
nv_ipc_msg_t send_msg;
|
||||||
uint8_t *pPacketBodyField = &((uint8_t *)packedBuf)[8];
|
uint8_t *pPacketBodyField = &((uint8_t *)packedBuf)[8];
|
||||||
@@ -386,7 +334,7 @@ int aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_me
|
|||||||
if (alloc_retval != 0) {
|
if (alloc_retval != 0) {
|
||||||
LOG_E(NFAPI_VNF, "%s error: allocate TX buffer failed Error: %d\n", __FUNCTION__, alloc_retval);
|
LOG_E(NFAPI_VNF, "%s error: allocate TX buffer failed Error: %d\n", __FUNCTION__, alloc_retval);
|
||||||
ipc->tx_release(ipc, &send_msg);
|
ipc->tx_release(ipc, &send_msg);
|
||||||
return alloc_retval;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(send_msg.msg_buf, packedBuf, send_msg.msg_len);
|
memcpy(send_msg.msg_buf, packedBuf, send_msg.msg_len);
|
||||||
@@ -402,21 +350,21 @@ int aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_me
|
|||||||
if (send_retval < 0) {
|
if (send_retval < 0) {
|
||||||
LOG_E(NFAPI_VNF, "%s error: send TX message failed Error: %d\n", __FUNCTION__, send_retval);
|
LOG_E(NFAPI_VNF, "%s error: send TX message failed Error: %d\n", __FUNCTION__, send_retval);
|
||||||
ipc->tx_release(ipc, &send_msg);
|
ipc->tx_release(ipc, &send_msg);
|
||||||
return send_retval;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ipc->notify(ipc, 1); // notify that there's 1 message in queue
|
ipc->notify(ipc, 1); // notify that there's 1 message in queue
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int aerial_send_P7_msg_with_data(void *packedBuf,
|
bool aerial_send_P7_msg_with_data(void *packedBuf,
|
||||||
uint32_t packedMsgLength,
|
uint32_t packedMsgLength,
|
||||||
void *dataBuf,
|
void *dataBuf,
|
||||||
uint32_t dataLength,
|
uint32_t dataLength,
|
||||||
nfapi_nr_p7_message_header_t *header)
|
nfapi_nr_p7_message_header_t *header)
|
||||||
{
|
{
|
||||||
if (ipc == NULL) {
|
if (ipc == NULL) {
|
||||||
return -1;
|
return false;
|
||||||
}
|
}
|
||||||
nv_ipc_msg_t send_msg;
|
nv_ipc_msg_t send_msg;
|
||||||
uint8_t *pPacketBodyField = &((uint8_t *)packedBuf)[8];
|
uint8_t *pPacketBodyField = &((uint8_t *)packedBuf)[8];
|
||||||
@@ -475,7 +423,7 @@ int aerial_send_P7_msg_with_data(void *packedBuf,
|
|||||||
if (alloc_retval != 0) {
|
if (alloc_retval != 0) {
|
||||||
LOG_E(NFAPI_VNF, "%s error: allocate TX buffer failed Error: %d\n", __FUNCTION__, alloc_retval);
|
LOG_E(NFAPI_VNF, "%s error: allocate TX buffer failed Error: %d\n", __FUNCTION__, alloc_retval);
|
||||||
ipc->tx_release(ipc, &send_msg);
|
ipc->tx_release(ipc, &send_msg);
|
||||||
return alloc_retval;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(send_msg.msg_buf, packedBuf, send_msg.msg_len);
|
memcpy(send_msg.msg_buf, packedBuf, send_msg.msg_len);
|
||||||
@@ -492,11 +440,11 @@ int aerial_send_P7_msg_with_data(void *packedBuf,
|
|||||||
if (send_retval != 0) {
|
if (send_retval != 0) {
|
||||||
LOG_E(NFAPI_VNF, "%s error: send TX message failed Error: %d\n", __FUNCTION__, send_retval);
|
LOG_E(NFAPI_VNF, "%s error: send TX message failed Error: %d\n", __FUNCTION__, send_retval);
|
||||||
ipc->tx_release(ipc, &send_msg);
|
ipc->tx_release(ipc, &send_msg);
|
||||||
return send_retval;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ipc->notify(ipc, 1); // notify that there's 1 message in queue
|
ipc->notify(ipc, 1); // notify that there's 1 message in queue
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always allocate message buffer, but allocate data buffer only when data_len > 0
|
// Always allocate message buffer, but allocate data buffer only when data_len > 0
|
||||||
@@ -634,7 +582,7 @@ int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req)
|
|||||||
ul_tti_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST;
|
ul_tti_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST;
|
||||||
|
|
||||||
// int retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
|
// int retval = nfapi_vnf_p7_ul_tti_req(p7_config, ul_tti_req);
|
||||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &ul_tti_req->header);
|
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &ul_tti_req->header);
|
||||||
|
|
||||||
if (retval != 0) {
|
if (retval != 0) {
|
||||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||||
@@ -654,7 +602,7 @@ int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req)
|
|||||||
ul_dci_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
ul_dci_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||||
ul_dci_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST;
|
ul_dci_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST;
|
||||||
// int retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
|
// int retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
|
||||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &ul_dci_req->header);
|
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &ul_dci_req->header);
|
||||||
if (retval != 0) {
|
if (retval != 0) {
|
||||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||||
} else {
|
} else {
|
||||||
@@ -670,7 +618,7 @@ int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
|
|||||||
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
|
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
|
||||||
// LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_data_req->SFN),
|
// LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_data_req->SFN),
|
||||||
// tx_data_req->Number_of_PDUs); int retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
// tx_data_req->Number_of_PDUs); int retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
|
||||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &tx_data_req->header);
|
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &tx_data_req->header);
|
||||||
if (retval != 0) {
|
if (retval != 0) {
|
||||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||||
} else {
|
} else {
|
||||||
@@ -685,7 +633,7 @@ int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
|
|||||||
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
||||||
dl_config_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
dl_config_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST;
|
||||||
dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &dl_config_req->header);
|
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &dl_config_req->header);
|
||||||
dl_config_req->dl_tti_request_body.nPDUs = 0;
|
dl_config_req->dl_tti_request_body.nPDUs = 0;
|
||||||
dl_config_req->dl_tti_request_body.nGroup = 0;
|
dl_config_req->dl_tti_request_body.nGroup = 0;
|
||||||
|
|
||||||
@@ -698,7 +646,7 @@ int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req)
|
|||||||
int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot){
|
int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot){
|
||||||
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
nfapi_vnf_p7_config_t *p7_config = (((vnf_info *)vnf_config->user_data)->p7_vnfs[0].config);
|
||||||
nfapi_nr_slot_indication_scf_t nr_slot_resp = {.header.message_id = 0x8F, .sfn = frame, .slot = slot};
|
nfapi_nr_slot_indication_scf_t nr_slot_resp = {.header.message_id = 0x8F, .sfn = frame, .slot = slot};
|
||||||
int retval = fapi_nr_pack_and_send_p7_message((vnf_p7_t *)p7_config, &nr_slot_resp.header);
|
int retval = p7_config->send_p7_msg((vnf_p7_t *)p7_config, &nr_slot_resp.header);
|
||||||
if (retval != 0) {
|
if (retval != 0) {
|
||||||
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "nv_ipc_utils.h"
|
#include "nv_ipc_utils.h"
|
||||||
#include "nvlog.h"
|
#include "nvlog.h"
|
||||||
#include "nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h"
|
#include "nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h"
|
||||||
|
#include "vnf.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||||
@@ -49,8 +50,8 @@ typedef struct {
|
|||||||
|
|
||||||
bool aerial_nr_send_p5_message(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len);
|
bool aerial_nr_send_p5_message(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len);
|
||||||
bool aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p5_message_header_t *header);
|
bool aerial_send_P5_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p4_p5_message_header_t *header);
|
||||||
int aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_message_header_t *header);
|
bool aerial_send_P7_msg(void *packedBuf, uint32_t packedMsgLength, nfapi_nr_p7_message_header_t *header);
|
||||||
int aerial_send_P7_msg_with_data(void *packedBuf,
|
bool aerial_send_P7_msg_with_data(void *packedBuf,
|
||||||
uint32_t packedMsgLength,
|
uint32_t packedMsgLength,
|
||||||
void *dataBuf,
|
void *dataBuf,
|
||||||
uint32_t dataLength,
|
uint32_t dataLength,
|
||||||
|
|||||||
@@ -35,200 +35,6 @@
|
|||||||
#include "nr_fapi_p7.h"
|
#include "nr_fapi_p7.h"
|
||||||
#include "nr_fapi_p7_utils.h"
|
#include "nr_fapi_p7_utils.h"
|
||||||
|
|
||||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h" // for handle_nr_srs_measurements()
|
|
||||||
|
|
||||||
extern pthread_cond_t nfapi_sync_cond;
|
|
||||||
extern pthread_mutex_t nfapi_sync_mutex;
|
|
||||||
extern int nfapi_sync_var;
|
|
||||||
|
|
||||||
int aerial_phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind)
|
|
||||||
{
|
|
||||||
nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind));
|
|
||||||
copy_crc_indication(ind, crc_ind);
|
|
||||||
if (!put_queue(&gnb_crc_ind_queue, crc_ind)) {
|
|
||||||
LOG_E(NR_MAC, "Put_queue failed for crc_ind\n");
|
|
||||||
free_crc_indication(crc_ind);
|
|
||||||
free(crc_ind);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind)
|
|
||||||
{
|
|
||||||
nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind));
|
|
||||||
copy_rx_data_indication(ind, rx_ind);
|
|
||||||
if (!put_queue(&gnb_rx_ind_queue, rx_ind)) {
|
|
||||||
LOG_E(NR_MAC, "Put_queue failed for rx_ind\n");
|
|
||||||
free_rx_data_indication(rx_ind);
|
|
||||||
free(rx_ind);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind)
|
|
||||||
{
|
|
||||||
nfapi_nr_rach_indication_t *rach_ind = CALLOC(1, sizeof(*rach_ind));
|
|
||||||
copy_rach_indication(ind, rach_ind);
|
|
||||||
if (!put_queue(&gnb_rach_ind_queue, rach_ind)) {
|
|
||||||
LOG_E(NR_MAC, "Put_queue failed for rach_ind\n");
|
|
||||||
free_rach_indication(rach_ind);
|
|
||||||
free(rach_ind);
|
|
||||||
} else {
|
|
||||||
LOG_I(NR_MAC, "RACH.indication put_queue successfull\n");
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind)
|
|
||||||
{
|
|
||||||
nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind));
|
|
||||||
AssertFatal(uci_ind, "Memory not allocated for uci_ind in phy_nr_uci_indication.");
|
|
||||||
copy_uci_indication(ind, uci_ind);
|
|
||||||
if (!put_queue(&gnb_uci_ind_queue, uci_ind)) {
|
|
||||||
LOG_E(NR_MAC, "Put_queue failed for uci_ind\n");
|
|
||||||
free_uci_indication(uci_ind);
|
|
||||||
free(uci_ind);
|
|
||||||
uci_ind = NULL;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, slot_t slot, NR_Sched_Rsp_t* sched_info);
|
|
||||||
int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req);
|
|
||||||
int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
|
|
||||||
int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t* tx_data_req);
|
|
||||||
int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t* ul_dci_req);
|
|
||||||
int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot);
|
|
||||||
extern int trigger_scheduler(nfapi_nr_slot_indication_scf_t *slot_ind);
|
|
||||||
|
|
||||||
int aerial_phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind)
|
|
||||||
{
|
|
||||||
LOG_D(MAC, "VNF SFN/Slot %d.%d \n", ind->sfn, ind->slot);
|
|
||||||
trigger_scheduler(ind);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind)
|
|
||||||
{
|
|
||||||
// or queue to decouple, but I think it should be fast (in all likelihood,
|
|
||||||
// the VNF has nothing to do)
|
|
||||||
for (int i = 0; i < ind->number_of_pdus; ++i)
|
|
||||||
handle_nr_srs_measurements(0, ind->sfn, ind->slot, &ind->pdu_list[i]);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *aerial_vnf_allocate(size_t size)
|
|
||||||
{
|
|
||||||
// return (void*)memory_pool::allocate(size);
|
|
||||||
return (void *)malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void aerial_vnf_deallocate(void *ptr)
|
|
||||||
{
|
|
||||||
// memory_pool::deallocate((uint8_t*)ptr);
|
|
||||||
free(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_vendor_ext(struct nfapi_vnf_p7_config *config, void *msg)
|
|
||||||
{
|
|
||||||
if (((nfapi_nr_p7_message_header_t *)msg)->message_id == P7_VENDOR_EXT_IND) {
|
|
||||||
// vendor_ext_p7_ind* ind = (vendor_ext_p7_ind*)msg;
|
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] vendor_ext (error_code:%d)\n", ind->error_code);
|
|
||||||
} else {
|
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] unknown %02x\n", ((nfapi_nr_p7_message_header_t *)msg)->message_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_unpack_p7_vendor_extension(void *header,
|
|
||||||
uint8_t **ppReadPackedMessage,
|
|
||||||
uint8_t *end,
|
|
||||||
nfapi_p7_codec_config_t *config)
|
|
||||||
{
|
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
|
|
||||||
if (((nfapi_nr_p7_message_header_t *)header)->message_id == P7_VENDOR_EXT_IND) {
|
|
||||||
vendor_ext_p7_ind *req = (vendor_ext_p7_ind *)(header);
|
|
||||||
|
|
||||||
if (!pull16(ppReadPackedMessage, &req->error_code, end))
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_pack_p7_vendor_extension(void *header, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config)
|
|
||||||
{
|
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
|
|
||||||
if (((nfapi_nr_p7_message_header_t *)header)->message_id == P7_VENDOR_EXT_REQ) {
|
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s\n", __FUNCTION__);
|
|
||||||
vendor_ext_p7_req *req = (vendor_ext_p7_req *)(header);
|
|
||||||
|
|
||||||
if (!(push16(req->dummy1, ppWritePackedMsg, end) && push16(req->dummy2, ppWritePackedMsg, end)))
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_unpack_vendor_extension_tlv(nfapi_tl_t *tl,
|
|
||||||
uint8_t **ppReadPackedMessage,
|
|
||||||
uint8_t *end,
|
|
||||||
void **ve,
|
|
||||||
nfapi_p7_codec_config_t *codec)
|
|
||||||
{
|
|
||||||
(void)tl;
|
|
||||||
(void)ppReadPackedMessage;
|
|
||||||
(void)ve;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int aerial_phy_pack_vendor_extension_tlv(void *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *codec)
|
|
||||||
{
|
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "phy_pack_vendor_extension_tlv\n");
|
|
||||||
nfapi_tl_t *tlv = (nfapi_tl_t *)ve;
|
|
||||||
|
|
||||||
switch (tlv->tag) {
|
|
||||||
case VENDOR_EXT_TLV_1_TAG: {
|
|
||||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "Packing VENDOR_EXT_TLV_1\n");
|
|
||||||
vendor_ext_tlv_1 *ve = (vendor_ext_tlv_1 *)tlv;
|
|
||||||
|
|
||||||
if (!push32(ve->dummy, ppWritePackedMsg, end))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
} break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void *aerial_phy_allocate_p7_vendor_ext(uint16_t message_id, uint16_t *msg_size)
|
|
||||||
{
|
|
||||||
if (message_id == P7_VENDOR_EXT_IND) {
|
|
||||||
*msg_size = sizeof(vendor_ext_p7_ind);
|
|
||||||
return (nfapi_nr_p7_message_header_t *)malloc(sizeof(vendor_ext_p7_ind));
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void aerial_phy_deallocate_p7_vendor_ext(void *header)
|
|
||||||
{
|
|
||||||
free(header);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t aerial_unpack_nr_slot_indication(uint8_t **ppReadPackedMsg,
|
|
||||||
uint8_t *end,
|
|
||||||
nfapi_nr_slot_indication_scf_t *msg,
|
|
||||||
nfapi_p7_codec_config_t *config)
|
|
||||||
{
|
|
||||||
return unpack_nr_slot_indication(ppReadPackedMsg, end, msg, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint8_t aerial_unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value,
|
static uint8_t aerial_unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value,
|
||||||
uint8_t **ppReadPackedMsg,
|
uint8_t **ppReadPackedMsg,
|
||||||
uint8_t *end,
|
uint8_t *end,
|
||||||
@@ -247,6 +53,7 @@ static uint8_t aerial_unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
||||||
uint8_t *end,
|
uint8_t *end,
|
||||||
uint8_t **pDataMsg,
|
uint8_t **pDataMsg,
|
||||||
@@ -273,11 +80,11 @@ uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
|||||||
}
|
}
|
||||||
// After unpacking the PDU headers, unpack the PDU data from the separate buffer
|
// After unpacking the PDU headers, unpack the PDU data from the separate buffer
|
||||||
for (int i = 0; i < pNfapiMsg->number_of_pdus; i++) {
|
for (int i = 0; i < pNfapiMsg->number_of_pdus; i++) {
|
||||||
if(!pullarray8(pDataMsg,
|
if (!pullarray8(pDataMsg,
|
||||||
pNfapiMsg->pdu_list[i].pdu,
|
pNfapiMsg->pdu_list[i].pdu,
|
||||||
pNfapiMsg->pdu_list[i].pdu_length,
|
pNfapiMsg->pdu_list[i].pdu_length,
|
||||||
pNfapiMsg->pdu_list[i].pdu_length,
|
pNfapiMsg->pdu_list[i].pdu_length,
|
||||||
data_end)){
|
data_end)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -285,19 +92,6 @@ uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t aerial_unpack_nr_crc_indication(uint8_t **ppReadPackedMsg,
|
|
||||||
uint8_t *end,
|
|
||||||
nfapi_nr_crc_indication_t *msg,
|
|
||||||
nfapi_p7_codec_config_t *config)
|
|
||||||
{
|
|
||||||
return unpack_nr_crc_indication(ppReadPackedMsg, end, msg, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t aerial_unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
|
|
||||||
{
|
|
||||||
return unpack_nr_uci_indication(ppReadPackedMsg, end, msg, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
|
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
|
||||||
uint8_t *end,
|
uint8_t *end,
|
||||||
uint8_t **pDataMsg,
|
uint8_t **pDataMsg,
|
||||||
@@ -316,20 +110,13 @@ uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t aerial_unpack_nr_rach_indication(uint8_t **ppReadPackedMsg,
|
|
||||||
uint8_t *end,
|
|
||||||
nfapi_nr_rach_indication_t *msg,
|
|
||||||
nfapi_p7_codec_config_t *config)
|
|
||||||
{
|
|
||||||
return unpack_nr_rach_indication(ppReadPackedMsg, end, msg, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int32_t aerial_pack_tx_data_request(void *pMessageBuf,
|
static int32_t aerial_pack_tx_data_request(void *pMessageBuf,
|
||||||
void *pPackedBuf,
|
void *pPackedBuf,
|
||||||
void *pDataBuf,
|
void *pDataBuf,
|
||||||
uint32_t packedBufLen,
|
uint32_t packedBufLen,
|
||||||
uint32_t dataBufLen,
|
uint32_t dataBufLen,
|
||||||
nfapi_p7_codec_config_t *config,
|
nfapi_p7_codec_config_t *config,
|
||||||
|
nfapi_vnf_p7_config_t *p7_config,
|
||||||
uint32_t *data_len)
|
uint32_t *data_len)
|
||||||
{
|
{
|
||||||
if (pMessageBuf == NULL || pPackedBuf == NULL) {
|
if (pMessageBuf == NULL || pPackedBuf == NULL) {
|
||||||
@@ -386,16 +173,15 @@ static int32_t aerial_pack_tx_data_request(void *pMessageBuf,
|
|||||||
uintptr_t dataEnd = (uintptr_t)pPackedDataField;
|
uintptr_t dataEnd = (uintptr_t)pPackedDataField;
|
||||||
data_len[0] = dataEnd - dataHead;
|
data_len[0] = dataEnd - dataHead;
|
||||||
|
|
||||||
|
if (!p7_config->pack_func(pMessageBuf, pPackedBuf, packedBufLen, config)) {
|
||||||
if (!fapi_nr_p7_message_pack(pMessageBuf, pPackedBuf, packedBufLen, config)) {
|
return -1;
|
||||||
return -1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return (int32_t)(pMessageHeader->message_length);
|
return (int32_t)(pMessageHeader->message_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int fapi_nr_pack_and_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header)
|
bool aerial_nr_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header)
|
||||||
{
|
{
|
||||||
uint8_t FAPI_buffer[1024 * 64];
|
uint8_t FAPI_buffer[1024 * 64];
|
||||||
// Check if TX_DATA request, if true, need to pack to data_buf
|
// Check if TX_DATA request, if true, need to pack to data_buf
|
||||||
@@ -414,17 +200,20 @@ int fapi_nr_pack_and_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_heade
|
|||||||
sizeof(FAPI_buffer),
|
sizeof(FAPI_buffer),
|
||||||
sizeof(FAPI_data_buffer),
|
sizeof(FAPI_data_buffer),
|
||||||
&vnf_p7->_public.codec_config,
|
&vnf_p7->_public.codec_config,
|
||||||
|
((nfapi_vnf_p7_config_t *)vnf_p7),
|
||||||
&data_len);
|
&data_len);
|
||||||
if (len_FAPI <= 0) {
|
if (len_FAPI <= 0) {
|
||||||
LOG_E(NFAPI_VNF, "Problem packing TX_DATA_request\n");
|
LOG_E(NFAPI_VNF, "Problem packing TX_DATA_request\n");
|
||||||
return len_FAPI;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
int retval = aerial_send_P7_msg_with_data(FAPI_buffer, len_FAPI, FAPI_data_buffer, data_len, header);
|
return aerial_send_P7_msg_with_data(FAPI_buffer, len_FAPI, FAPI_data_buffer, data_len, header) == 0;
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Create and send FAPI P7 message
|
// Create and send FAPI P7 message
|
||||||
int len_FAPI = fapi_nr_p7_message_pack(header, FAPI_buffer, sizeof(FAPI_buffer), &vnf_p7->_public.codec_config);
|
int len_FAPI = ((nfapi_vnf_p7_config_t *)vnf_p7)->pack_func(header,
|
||||||
return aerial_send_P7_msg(FAPI_buffer, len_FAPI, header);
|
FAPI_buffer,
|
||||||
|
sizeof(FAPI_buffer),
|
||||||
|
&vnf_p7->_public.codec_config);
|
||||||
|
return aerial_send_P7_msg(FAPI_buffer, len_FAPI, header) == 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,187 +47,21 @@
|
|||||||
#include "nfapi_interface.h"
|
#include "nfapi_interface.h"
|
||||||
#include "nfapi_nr_interface_scf.h"
|
#include "nfapi_nr_interface_scf.h"
|
||||||
#include "nfapi_vnf_interface.h"
|
#include "nfapi_vnf_interface.h"
|
||||||
#include "nfapi_vnf.h"
|
|
||||||
#include "nfapi.h"
|
|
||||||
#include "nfapi/oai_integration/vendor_ext.h"
|
|
||||||
#include "fapi_nvIPC.h"
|
#include "fapi_nvIPC.h"
|
||||||
|
|
||||||
#include "PHY/defs_eNB.h"
|
|
||||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
|
||||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
|
||||||
#include "lte-softmodem.h"
|
|
||||||
|
|
||||||
#include "common/ran_context.h"
|
|
||||||
#include "openair2/PHY_INTERFACE/queue_t.h"
|
#include "openair2/PHY_INTERFACE/queue_t.h"
|
||||||
#include "gnb_ind_vars.h"
|
|
||||||
#include "nfapi/open-nFAPI/vnf/inc/vnf.h"
|
|
||||||
#include "nfapi/open-nFAPI/vnf/inc/vnf_p7.h"
|
#include "nfapi/open-nFAPI/vnf/inc/vnf_p7.h"
|
||||||
typedef struct {
|
|
||||||
uint8_t enabled;
|
|
||||||
uint32_t rx_port;
|
|
||||||
uint32_t tx_port;
|
|
||||||
char tx_addr[80];
|
|
||||||
} udp_data;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint16_t index;
|
|
||||||
uint16_t id;
|
|
||||||
uint8_t rfs[2];
|
|
||||||
uint8_t excluded_rfs[2];
|
|
||||||
|
|
||||||
udp_data udp;
|
|
||||||
|
|
||||||
char local_addr[80];
|
|
||||||
int local_port;
|
|
||||||
|
|
||||||
char *remote_addr;
|
|
||||||
int remote_port;
|
|
||||||
|
|
||||||
uint8_t duplex_mode;
|
|
||||||
uint16_t dl_channel_bw_support;
|
|
||||||
uint16_t ul_channel_bw_support;
|
|
||||||
uint8_t num_dl_layers_supported;
|
|
||||||
uint8_t num_ul_layers_supported;
|
|
||||||
uint16_t release_supported;
|
|
||||||
uint8_t nmm_modes_supported;
|
|
||||||
|
|
||||||
uint8_t dl_ues_per_subframe;
|
|
||||||
uint8_t ul_ues_per_subframe;
|
|
||||||
|
|
||||||
uint8_t first_subframe_ind;
|
|
||||||
|
|
||||||
// timing information recevied from the vnf
|
|
||||||
uint8_t timing_window;
|
|
||||||
uint8_t timing_info_mode;
|
|
||||||
uint8_t timing_info_period;
|
|
||||||
|
|
||||||
} phy_info;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint16_t index;
|
|
||||||
uint16_t band;
|
|
||||||
int16_t max_transmit_power;
|
|
||||||
int16_t min_transmit_power;
|
|
||||||
uint8_t num_antennas_supported;
|
|
||||||
uint32_t min_downlink_frequency;
|
|
||||||
uint32_t max_downlink_frequency;
|
|
||||||
uint32_t max_uplink_frequency;
|
|
||||||
uint32_t min_uplink_frequency;
|
|
||||||
} rf_info;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int release;
|
|
||||||
phy_info phys[2];
|
|
||||||
rf_info rfs[2];
|
|
||||||
|
|
||||||
uint8_t sync_mode;
|
|
||||||
uint8_t location_mode;
|
|
||||||
uint8_t location_coordinates[6];
|
|
||||||
uint32_t dl_config_timing;
|
|
||||||
uint32_t ul_config_timing;
|
|
||||||
uint32_t tx_timing;
|
|
||||||
uint32_t hi_dci0_timing;
|
|
||||||
|
|
||||||
uint16_t max_phys;
|
|
||||||
uint16_t max_total_bw;
|
|
||||||
uint16_t max_total_dl_layers;
|
|
||||||
uint16_t max_total_ul_layers;
|
|
||||||
uint8_t shared_bands;
|
|
||||||
uint8_t shared_pa;
|
|
||||||
int16_t max_total_power;
|
|
||||||
uint8_t oui;
|
|
||||||
|
|
||||||
uint8_t wireshark_test_mode;
|
|
||||||
|
|
||||||
} pnf_info;
|
|
||||||
|
|
||||||
typedef struct mac mac_t;
|
|
||||||
typedef struct mac {
|
|
||||||
void *user_data;
|
|
||||||
|
|
||||||
void (*dl_config_req)(mac_t *mac, nfapi_dl_config_request_t *req);
|
|
||||||
void (*ul_config_req)(mac_t *mac, nfapi_ul_config_request_t *req);
|
|
||||||
void (*hi_dci0_req)(mac_t *mac, nfapi_hi_dci0_request_t *req);
|
|
||||||
void (*tx_req)(mac_t *mac, nfapi_tx_request_t *req);
|
|
||||||
} mac_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int local_port;
|
|
||||||
char local_addr[80];
|
|
||||||
|
|
||||||
unsigned timing_window;
|
|
||||||
unsigned periodic_timing_enabled;
|
|
||||||
unsigned aperiodic_timing_enabled;
|
|
||||||
unsigned periodic_timing_period;
|
|
||||||
|
|
||||||
// This is not really the right place if we have multiple PHY,
|
|
||||||
// should be part of the phy struct
|
|
||||||
udp_data udp;
|
|
||||||
|
|
||||||
uint8_t thread_started;
|
|
||||||
|
|
||||||
nfapi_vnf_p7_config_t *config;
|
|
||||||
|
|
||||||
mac_t *mac;
|
|
||||||
|
|
||||||
} vnf_p7_info;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint8_t wireshark_test_mode;
|
|
||||||
pnf_info pnfs[2];
|
|
||||||
vnf_p7_info p7_vnfs[2];
|
|
||||||
|
|
||||||
} vnf_info;
|
|
||||||
|
|
||||||
int aerial_phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind);
|
|
||||||
int aerial_phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind);
|
|
||||||
int aerial_phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind);
|
|
||||||
int aerial_phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind);
|
|
||||||
int aerial_phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind);
|
|
||||||
int aerial_phy_nr_srs_indication(nfapi_nr_srs_indication_t *ind);
|
|
||||||
void *aerial_vnf_allocate(size_t size);
|
|
||||||
void aerial_vnf_deallocate(void *ptr);
|
|
||||||
int aerial_phy_vendor_ext(struct nfapi_vnf_p7_config *config, void *msg);
|
|
||||||
int aerial_phy_unpack_p7_vendor_extension(void *header,
|
|
||||||
uint8_t **ppReadPackedMessage,
|
|
||||||
uint8_t *end,
|
|
||||||
nfapi_p7_codec_config_t *config);
|
|
||||||
int aerial_phy_pack_p7_vendor_extension(void *header, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config);
|
|
||||||
int aerial_phy_unpack_vendor_extension_tlv(nfapi_tl_t *tl,
|
|
||||||
uint8_t **ppReadPackedMessage,
|
|
||||||
uint8_t *end,
|
|
||||||
void **ve,
|
|
||||||
nfapi_p7_codec_config_t *codec);
|
|
||||||
int aerial_phy_pack_vendor_extension_tlv(void *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *codec);
|
|
||||||
void *aerial_phy_allocate_p7_vendor_ext(uint16_t message_id, uint16_t *msg_size);
|
|
||||||
void aerial_phy_deallocate_p7_vendor_ext(void *header);
|
|
||||||
|
|
||||||
uint8_t aerial_unpack_nr_slot_indication(uint8_t **ppReadPackedMsg,
|
|
||||||
uint8_t *end,
|
|
||||||
nfapi_nr_slot_indication_scf_t *msg,
|
|
||||||
nfapi_p7_codec_config_t *config);
|
|
||||||
uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg,
|
||||||
uint8_t *end,
|
uint8_t *end,
|
||||||
uint8_t **pDataMsg,
|
uint8_t **pDataMsg,
|
||||||
uint8_t *data_end,
|
uint8_t *data_end,
|
||||||
nfapi_nr_rx_data_indication_t *msg,
|
nfapi_nr_rx_data_indication_t *msg,
|
||||||
nfapi_p7_codec_config_t *config);
|
nfapi_p7_codec_config_t *config);
|
||||||
uint8_t aerial_unpack_nr_crc_indication(uint8_t **ppReadPackedMsg,
|
|
||||||
uint8_t *end,
|
|
||||||
nfapi_nr_crc_indication_t *msg,
|
|
||||||
nfapi_p7_codec_config_t *config);
|
|
||||||
uint8_t aerial_unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
|
|
||||||
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
|
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
|
||||||
uint8_t *end,
|
uint8_t *end,
|
||||||
uint8_t **pDataMsg,
|
uint8_t **pDataMsg,
|
||||||
uint8_t *data_end,
|
uint8_t *data_end,
|
||||||
void *msg,
|
void *msg,
|
||||||
nfapi_p7_codec_config_t *config);
|
nfapi_p7_codec_config_t *config);
|
||||||
uint8_t aerial_unpack_nr_rach_indication(uint8_t **ppReadPackedMsg,
|
bool aerial_nr_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header);
|
||||||
uint8_t *end,
|
|
||||||
nfapi_nr_rach_indication_t *msg,
|
|
||||||
nfapi_p7_codec_config_t *config);
|
|
||||||
|
|
||||||
// int fapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t* config);
|
|
||||||
int fapi_nr_pack_and_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header);
|
|
||||||
#endif // OPENAIRINTERFACE_FAPI_VNF_P7_H
|
#endif // OPENAIRINTERFACE_FAPI_VNF_P7_H
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include "nfapi_nr_interface_scf.h"
|
#include "nfapi_nr_interface_scf.h"
|
||||||
#include "nfapi_vnf_interface.h"
|
|
||||||
#include "nfapi_vnf.h"
|
#include "nfapi_vnf.h"
|
||||||
#include <vnf.h>
|
#include <vnf.h>
|
||||||
#include <vnf_p7.h>
|
#include <vnf_p7.h>
|
||||||
@@ -64,7 +63,9 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_AERIAL
|
#ifdef ENABLE_AERIAL
|
||||||
#include "aerial/fapi_nvIPC.h"
|
#include "aerial/fapi_nvIPC.h"
|
||||||
|
#include "aerial/fapi_vnf_p7.h"
|
||||||
#include "nr_fapi_p5.h"
|
#include "nr_fapi_p5.h"
|
||||||
|
#include "nr_fapi_p7.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TEST
|
#define TEST
|
||||||
@@ -72,128 +73,6 @@
|
|||||||
extern RAN_CONTEXT_t RC;
|
extern RAN_CONTEXT_t RC;
|
||||||
extern UL_RCC_IND_t UL_RCC_INFO;
|
extern UL_RCC_IND_t UL_RCC_INFO;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint8_t enabled;
|
|
||||||
uint32_t rx_port;
|
|
||||||
uint32_t tx_port;
|
|
||||||
char tx_addr[80];
|
|
||||||
} udp_data;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint16_t index;
|
|
||||||
uint16_t id;
|
|
||||||
uint8_t rfs[2];
|
|
||||||
uint8_t excluded_rfs[2];
|
|
||||||
|
|
||||||
udp_data udp;
|
|
||||||
|
|
||||||
char local_addr[80];
|
|
||||||
int local_port;
|
|
||||||
|
|
||||||
char *remote_addr;
|
|
||||||
int remote_port;
|
|
||||||
|
|
||||||
uint8_t duplex_mode;
|
|
||||||
uint16_t dl_channel_bw_support;
|
|
||||||
uint16_t ul_channel_bw_support;
|
|
||||||
uint8_t num_dl_layers_supported;
|
|
||||||
uint8_t num_ul_layers_supported;
|
|
||||||
uint16_t release_supported;
|
|
||||||
uint8_t nmm_modes_supported;
|
|
||||||
|
|
||||||
uint8_t dl_ues_per_subframe;
|
|
||||||
uint8_t ul_ues_per_subframe;
|
|
||||||
|
|
||||||
uint8_t first_subframe_ind;
|
|
||||||
|
|
||||||
// timing information recevied from the vnf
|
|
||||||
uint8_t timing_window;
|
|
||||||
uint8_t timing_info_mode;
|
|
||||||
uint8_t timing_info_period;
|
|
||||||
|
|
||||||
} phy_info;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint16_t index;
|
|
||||||
uint16_t band;
|
|
||||||
int16_t max_transmit_power;
|
|
||||||
int16_t min_transmit_power;
|
|
||||||
uint8_t num_antennas_supported;
|
|
||||||
uint32_t min_downlink_frequency;
|
|
||||||
uint32_t max_downlink_frequency;
|
|
||||||
uint32_t max_uplink_frequency;
|
|
||||||
uint32_t min_uplink_frequency;
|
|
||||||
} rf_info;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
|
|
||||||
int release;
|
|
||||||
phy_info phys[2];
|
|
||||||
rf_info rfs[2];
|
|
||||||
|
|
||||||
uint8_t sync_mode;
|
|
||||||
uint8_t location_mode;
|
|
||||||
uint8_t location_coordinates[6];
|
|
||||||
uint32_t dl_config_timing;
|
|
||||||
uint32_t ul_config_timing;
|
|
||||||
uint32_t tx_timing;
|
|
||||||
uint32_t hi_dci0_timing;
|
|
||||||
|
|
||||||
uint16_t max_phys;
|
|
||||||
uint16_t max_total_bw;
|
|
||||||
uint16_t max_total_dl_layers;
|
|
||||||
uint16_t max_total_ul_layers;
|
|
||||||
uint8_t shared_bands;
|
|
||||||
uint8_t shared_pa;
|
|
||||||
int16_t max_total_power;
|
|
||||||
uint8_t oui;
|
|
||||||
|
|
||||||
uint8_t wireshark_test_mode;
|
|
||||||
|
|
||||||
} pnf_info;
|
|
||||||
|
|
||||||
typedef struct mac mac_t;
|
|
||||||
|
|
||||||
typedef struct mac {
|
|
||||||
|
|
||||||
void *user_data;
|
|
||||||
|
|
||||||
void (*dl_config_req)(mac_t *mac, nfapi_dl_config_request_t *req);
|
|
||||||
void (*ul_config_req)(mac_t *mac, nfapi_ul_config_request_t *req);
|
|
||||||
void (*hi_dci0_req)(mac_t *mac, nfapi_hi_dci0_request_t *req);
|
|
||||||
void (*tx_req)(mac_t *mac, nfapi_tx_request_t *req);
|
|
||||||
} mac_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
|
|
||||||
int local_port;
|
|
||||||
char local_addr[80];
|
|
||||||
|
|
||||||
unsigned timing_window;
|
|
||||||
unsigned periodic_timing_enabled;
|
|
||||||
unsigned aperiodic_timing_enabled;
|
|
||||||
unsigned periodic_timing_period;
|
|
||||||
|
|
||||||
// This is not really the right place if we have multiple PHY,
|
|
||||||
// should be part of the phy struct
|
|
||||||
udp_data udp;
|
|
||||||
|
|
||||||
uint8_t thread_started;
|
|
||||||
|
|
||||||
nfapi_vnf_p7_config_t *config;
|
|
||||||
|
|
||||||
mac_t *mac;
|
|
||||||
|
|
||||||
} vnf_p7_info;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
|
|
||||||
uint8_t wireshark_test_mode;
|
|
||||||
pnf_info pnfs[2];
|
|
||||||
vnf_p7_info p7_vnfs[2];
|
|
||||||
|
|
||||||
} vnf_info;
|
|
||||||
|
|
||||||
int vnf_pack_vendor_extension_tlv(void *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *codec) {
|
int vnf_pack_vendor_extension_tlv(void *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *codec) {
|
||||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "vnf_pack_vendor_extension_tlv\n");
|
//NFAPI_TRACE(NFAPI_TRACE_INFO, "vnf_pack_vendor_extension_tlv\n");
|
||||||
nfapi_tl_t *tlv = (nfapi_tl_t *)ve;
|
nfapi_tl_t *tlv = (nfapi_tl_t *)ve;
|
||||||
@@ -1455,9 +1334,7 @@ void *configure_nr_p7_vnf(void *ptr)
|
|||||||
p7_vnf->config->codec_config.deallocate = &vnf_deallocate;
|
p7_vnf->config->codec_config.deallocate = &vnf_deallocate;
|
||||||
p7_vnf->config->allocate_p7_vendor_ext = &phy_nr_allocate_p7_vendor_ext;
|
p7_vnf->config->allocate_p7_vendor_ext = &phy_nr_allocate_p7_vendor_ext;
|
||||||
p7_vnf->config->deallocate_p7_vendor_ext = &phy_nr_deallocate_p7_vendor_ext;
|
p7_vnf->config->deallocate_p7_vendor_ext = &phy_nr_deallocate_p7_vendor_ext;
|
||||||
p7_vnf->config->unpack_func = &nfapi_nr_p7_message_unpack;
|
|
||||||
p7_vnf->config->hdr_unpack_func = &nfapi_nr_p7_message_header_unpack;
|
|
||||||
p7_vnf->config->pack_func = &nfapi_nr_p7_message_pack;
|
|
||||||
#ifdef ENABLE_WLS
|
#ifdef ENABLE_WLS
|
||||||
p7_vnf->config->unpack_func = &fapi_nr_p7_message_unpack;
|
p7_vnf->config->unpack_func = &fapi_nr_p7_message_unpack;
|
||||||
p7_vnf->config->hdr_unpack_func = &fapi_nr_p7_message_header_unpack;
|
p7_vnf->config->hdr_unpack_func = &fapi_nr_p7_message_header_unpack;
|
||||||
@@ -1476,7 +1353,10 @@ void *configure_nr_p7_vnf(void *ptr)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_AERIAL
|
#ifdef ENABLE_AERIAL
|
||||||
|
p7_vnf->config->unpack_func = &fapi_nr_p7_message_unpack;
|
||||||
|
p7_vnf->config->hdr_unpack_func = &fapi_nr_p7_message_header_unpack;
|
||||||
|
p7_vnf->config->pack_func = &fapi_nr_p7_message_pack;
|
||||||
|
p7_vnf->config->send_p7_msg = &aerial_nr_send_p7_message;
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,129 @@
|
|||||||
#define NFAPI_VNF_H_
|
#define NFAPI_VNF_H_
|
||||||
#include <common_lib.h>
|
#include <common_lib.h>
|
||||||
|
|
||||||
|
#include "nfapi_vnf_interface.h"
|
||||||
|
typedef struct {
|
||||||
|
uint8_t enabled;
|
||||||
|
uint32_t rx_port;
|
||||||
|
uint32_t tx_port;
|
||||||
|
char tx_addr[80];
|
||||||
|
} udp_data;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16_t index;
|
||||||
|
uint16_t id;
|
||||||
|
uint8_t rfs[2];
|
||||||
|
uint8_t excluded_rfs[2];
|
||||||
|
|
||||||
|
udp_data udp;
|
||||||
|
|
||||||
|
char local_addr[80];
|
||||||
|
int local_port;
|
||||||
|
|
||||||
|
char *remote_addr;
|
||||||
|
int remote_port;
|
||||||
|
|
||||||
|
uint8_t duplex_mode;
|
||||||
|
uint16_t dl_channel_bw_support;
|
||||||
|
uint16_t ul_channel_bw_support;
|
||||||
|
uint8_t num_dl_layers_supported;
|
||||||
|
uint8_t num_ul_layers_supported;
|
||||||
|
uint16_t release_supported;
|
||||||
|
uint8_t nmm_modes_supported;
|
||||||
|
|
||||||
|
uint8_t dl_ues_per_subframe;
|
||||||
|
uint8_t ul_ues_per_subframe;
|
||||||
|
|
||||||
|
uint8_t first_subframe_ind;
|
||||||
|
|
||||||
|
// timing information recevied from the vnf
|
||||||
|
uint8_t timing_window;
|
||||||
|
uint8_t timing_info_mode;
|
||||||
|
uint8_t timing_info_period;
|
||||||
|
|
||||||
|
} phy_info;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16_t index;
|
||||||
|
uint16_t band;
|
||||||
|
int16_t max_transmit_power;
|
||||||
|
int16_t min_transmit_power;
|
||||||
|
uint8_t num_antennas_supported;
|
||||||
|
uint32_t min_downlink_frequency;
|
||||||
|
uint32_t max_downlink_frequency;
|
||||||
|
uint32_t max_uplink_frequency;
|
||||||
|
uint32_t min_uplink_frequency;
|
||||||
|
} rf_info;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
|
||||||
|
int release;
|
||||||
|
phy_info phys[2];
|
||||||
|
rf_info rfs[2];
|
||||||
|
|
||||||
|
uint8_t sync_mode;
|
||||||
|
uint8_t location_mode;
|
||||||
|
uint8_t location_coordinates[6];
|
||||||
|
uint32_t dl_config_timing;
|
||||||
|
uint32_t ul_config_timing;
|
||||||
|
uint32_t tx_timing;
|
||||||
|
uint32_t hi_dci0_timing;
|
||||||
|
|
||||||
|
uint16_t max_phys;
|
||||||
|
uint16_t max_total_bw;
|
||||||
|
uint16_t max_total_dl_layers;
|
||||||
|
uint16_t max_total_ul_layers;
|
||||||
|
uint8_t shared_bands;
|
||||||
|
uint8_t shared_pa;
|
||||||
|
int16_t max_total_power;
|
||||||
|
uint8_t oui;
|
||||||
|
|
||||||
|
uint8_t wireshark_test_mode;
|
||||||
|
|
||||||
|
} pnf_info;
|
||||||
|
|
||||||
|
typedef struct mac mac_t;
|
||||||
|
|
||||||
|
typedef struct mac {
|
||||||
|
|
||||||
|
void *user_data;
|
||||||
|
|
||||||
|
void (*dl_config_req)(mac_t *mac, nfapi_dl_config_request_t *req);
|
||||||
|
void (*ul_config_req)(mac_t *mac, nfapi_ul_config_request_t *req);
|
||||||
|
void (*hi_dci0_req)(mac_t *mac, nfapi_hi_dci0_request_t *req);
|
||||||
|
void (*tx_req)(mac_t *mac, nfapi_tx_request_t *req);
|
||||||
|
} mac_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
|
||||||
|
int local_port;
|
||||||
|
char local_addr[80];
|
||||||
|
|
||||||
|
unsigned timing_window;
|
||||||
|
unsigned periodic_timing_enabled;
|
||||||
|
unsigned aperiodic_timing_enabled;
|
||||||
|
unsigned periodic_timing_period;
|
||||||
|
|
||||||
|
// This is not really the right place if we have multiple PHY,
|
||||||
|
// should be part of the phy struct
|
||||||
|
udp_data udp;
|
||||||
|
|
||||||
|
uint8_t thread_started;
|
||||||
|
|
||||||
|
nfapi_vnf_p7_config_t *config;
|
||||||
|
|
||||||
|
mac_t *mac;
|
||||||
|
|
||||||
|
} vnf_p7_info;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
|
||||||
|
uint8_t wireshark_test_mode;
|
||||||
|
pnf_info pnfs[2];
|
||||||
|
vnf_p7_info p7_vnfs[2];
|
||||||
|
|
||||||
|
} vnf_info;
|
||||||
|
|
||||||
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||||
void configure_nr_nfapi_vnf(eth_params_t params);
|
void configure_nr_nfapi_vnf(eth_params_t params);
|
||||||
|
|
||||||
|
|||||||
@@ -45,30 +45,16 @@ bool vnf_nr_send_p5_msg(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_head
|
|||||||
if (pnf) {
|
if (pnf) {
|
||||||
// pack the message for transmission
|
// pack the message for transmission
|
||||||
int packedMessageLength = 0;
|
int packedMessageLength = 0;
|
||||||
if (NFAPI_MODE == NFAPI_MODE_AERIAL) {
|
|
||||||
#ifdef ENABLE_AERIAL // TODO: Remove this into the aerial VNF transport module
|
packedMessageLength =
|
||||||
// In case it is a FAPI message, create 2 messages, one with nFAPI header for OAI PNF and one with no nFAPI header for Aerial
|
vnf->_public.pack_func(msg, msg_len, vnf->tx_message_buffer, sizeof(vnf->tx_message_buffer), &vnf->_public.codec_config);
|
||||||
// L1
|
|
||||||
// create FAPI tx_buffer
|
|
||||||
uint8_t tx_messagebufferFAPI[sizeof(vnf->tx_message_buffer)];
|
|
||||||
int packedMessageLengthFAPI = -1;
|
|
||||||
packedMessageLengthFAPI =
|
|
||||||
fapi_nr_p5_message_pack(msg, msg_len, tx_messagebufferFAPI, sizeof(tx_messagebufferFAPI), &vnf->_public.codec_config);
|
|
||||||
return aerial_send_P5_msg(tx_messagebufferFAPI, packedMessageLengthFAPI, msg);
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
packedMessageLength =
|
|
||||||
vnf->_public.pack_func(msg, msg_len, vnf->tx_message_buffer, sizeof(vnf->tx_message_buffer), &vnf->_public.codec_config);
|
|
||||||
|
|
||||||
if (packedMessageLength < 0) {
|
if (packedMessageLength < 0) {
|
||||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_nr_p5_message_pack failed with return %d\n", packedMessageLength);
|
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_nr_p5_message_pack failed with return %d\n", packedMessageLength);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return send_p5_msg(vnf, pnf, vnf->tx_message_buffer, packedMessageLength, 0);
|
return send_p5_msg(vnf, pnf, vnf->tx_message_buffer, packedMessageLength, 0);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
|
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user