Resolved build warnings(25+) and 5G nFAPI downlink errors(future_ul_tti_request)

This commit is contained in:
Mahesh
2021-01-14 12:28:45 +05:30
parent 402c05eb6b
commit d7ccdbe6b0
28 changed files with 172 additions and 282 deletions
@@ -59,6 +59,8 @@ typedef enum {
NFAPI_NR_PHY_MSG_TYPE_STOP_REQUEST= 0X05,
NFAPI_NR_PHY_MSG_TYPE_STOP_INDICATION=0X06,
NFAPI_NR_PHY_MSG_TYPE_ERROR_INDICATION=0X07,
NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE=0X010D,
NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE=0X010F,
//RESERVED 0X08 ~ 0X7F
NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST= 0X80,
NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST= 0X81,
@@ -523,7 +525,7 @@ typedef struct {
/* PARAM.RESPONSE */
typedef struct {
nfapi_p4_p5_message_header_t header;
nfapi_nr_param_errors_e error_code;
uint8_t error_code;
uint8_t num_tlv;
nfapi_vendor_extension_tlv_t vendor_extension;
@@ -545,7 +547,6 @@ typedef struct {
/* CONFIG.REQUEST */
typedef struct {
nfapi_p4_p5_message_header_t header;
nfapi_nr_param_errors_e error_code; // TODO: check if needed
uint8_t num_tlv;
nfapi_vendor_extension_tlv_t vendor_extension;
@@ -564,7 +565,7 @@ typedef struct {
/* CONFIG.RESPONSE */
typedef struct {
nfapi_p4_p5_message_header_t header;
nfapi_nr_config_errors_e error_code;
uint8_t error_code;
//uint8_t num_invalid_tlvs;
// TODO: add list of invalid/unsupported TLVs (see Table 3.18)
nfapi_vendor_extension_tlv_t vendor_extension;
+19 -62
View File
@@ -259,13 +259,7 @@ static uint8_t pack_nr_pnf_param_response(void *msg, uint8_t **ppWritePackedMsg,
return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
pack_tlv(NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, ppWritePackedMsg, end, &pack_pnf_param_general_value) &&
pack_tlv(NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, ppWritePackedMsg, end, &pack_pnf_phy_value) &&
// pack_tlv(NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, ppWritePackedMsg, end, &pack_pnf_rf_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, ppWritePackedMsg, end, &pack_pnf_phy_rel10_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, ppWritePackedMsg, end, &pack_pnf_phy_rel11_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, ppWritePackedMsg, end, &pack_pnf_phy_rel12_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, ppWritePackedMsg, end, &pack_pnf_phy_rel13_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, ppWritePackedMsg, end, &pack_pnf_phy_rel13_nb_iot_value) &&
pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
}
@@ -276,13 +270,13 @@ static uint8_t pack_pnf_param_response(void *msg, uint8_t **ppWritePackedMsg, ui
return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
pack_tlv(NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, ppWritePackedMsg, end, &pack_pnf_param_general_value) &&
pack_tlv(NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, ppWritePackedMsg, end, &pack_pnf_phy_value) &&
// pack_tlv(NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, ppWritePackedMsg, end, &pack_pnf_rf_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, ppWritePackedMsg, end, &pack_pnf_phy_rel10_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, ppWritePackedMsg, end, &pack_pnf_phy_rel11_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, ppWritePackedMsg, end, &pack_pnf_phy_rel12_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, ppWritePackedMsg, end, &pack_pnf_phy_rel13_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, ppWritePackedMsg, end, &pack_pnf_phy_rel13_nb_iot_value) &&
pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
pack_tlv(NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, ppWritePackedMsg, end, &pack_pnf_rf_value) &&
pack_tlv(NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, ppWritePackedMsg, end, &pack_pnf_phy_rel10_value) &&
pack_tlv(NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, ppWritePackedMsg, end, &pack_pnf_phy_rel11_value) &&
pack_tlv(NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, ppWritePackedMsg, end, &pack_pnf_phy_rel12_value) &&
pack_tlv(NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, ppWritePackedMsg, end, &pack_pnf_phy_rel13_value) &&
pack_tlv(NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, ppWritePackedMsg, end, &pack_pnf_phy_rel13_nb_iot_value) &&
pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
}
@@ -426,18 +420,6 @@ static uint8_t unpack_uint32_tlv_value(void* tlv, uint8_t **ppReadPackedMsg, uin
return pull32(ppReadPackedMsg, &value->value, end);
}
static uint8_t pack_int32_tlv_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_int32_tlv_t* value = (nfapi_int32_tlv_t*)tlv;
return pushs32(value->value, ppWritePackedMsg, end);
}
static uint8_t unpack_int32_tlv_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_int32_tlv_t* value = (nfapi_int32_tlv_t*)tlv;
return pulls32(ppReadPackedMsg, &value->value, end);
}
static uint8_t pack_uint16_tlv_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
@@ -882,8 +864,7 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
nfapi_nr_config_request_scf_t *pNfapiMsg = (nfapi_nr_config_request_scf_t*)msg;
return (push8(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
push8(pNfapiMsg->num_tlv, ppWritePackedMsg, end) &&
return (push8(pNfapiMsg->num_tlv, ppWritePackedMsg, end) &&
pack_tlv(NFAPI_NR_CONFIG_DL_BANDWIDTH_TAG, &(pNfapiMsg->carrier_config.dl_bandwidth), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_DL_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.dl_frequency), ppWritePackedMsg, end, &pack_uint32_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_DL_GRID_SIZE_TAG, &(pNfapiMsg->carrier_config.dl_grid_size[1]), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
@@ -1088,7 +1069,7 @@ static uint8_t pack_nr_p5_message_body(nfapi_p4_p5_message_header_t *header, uin
result = pack_nr_start_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_START_RESPONSE:
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE:
result = pack_nr_start_response(header, ppWritePackedMsg, end, config);
break;
@@ -1096,18 +1077,9 @@ static uint8_t pack_nr_p5_message_body(nfapi_p4_p5_message_header_t *header, uin
result = pack_stop_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_STOP_RESPONSE:
case NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE:
result = pack_stop_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_MEASUREMENT_REQUEST:
result = pack_measurement_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_MEASUREMENT_RESPONSE:
result = pack_measurement_response(header, ppWritePackedMsg, end, config);
break;
default:
{
if(header->message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
@@ -1580,14 +1552,6 @@ static uint8_t unpack_nr_pnf_param_response(uint8_t **ppReadPackedMsg, uint8_t *
{
{ NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, &unpack_pnf_param_general_value},
{ NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, &unpack_pnf_phy_value},
/*
{ NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, &unpack_pnf_rf_value},
{ NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, &unpack_pnf_phy_rel10_value},
{ NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, &unpack_pnf_phy_rel11_value},
{ NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, &unpack_pnf_phy_rel12_value},
{ NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, &unpack_pnf_phy_rel13_value},
{ NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, &unpack_pnf_phy_rel13_nb_iot_value},
*/
};
return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
@@ -1604,14 +1568,13 @@ static uint8_t unpack_pnf_param_response(uint8_t **ppReadPackedMsg, uint8_t *end
{
{ NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, &unpack_pnf_param_general_value},
{ NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, &unpack_pnf_phy_value},
/*
{ NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, &unpack_pnf_rf_value},
{ NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, &unpack_pnf_phy_rel10_value},
{ NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, &unpack_pnf_phy_rel11_value},
{ NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, &unpack_pnf_phy_rel12_value},
{ NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, &unpack_pnf_phy_rel13_value},
{ NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, &unpack_pnf_phy_rel13_nb_iot_value},
*/
};
return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
@@ -2149,23 +2112,17 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end,
{ NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_SLOT_CONFIG_TAG, &(pNfapiMsg->tdd_table.max_tdd_periodicity_list[0].max_num_of_symbol_per_slot_list[0].slot_config), &unpack_uint8_tlv_value},
//{ NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.dl_ue_per_sf), &unpack_uint8_tlv_value},
//{ NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG, &(pNfapiMsg->nfapi_config.max_transmit_power), &unpack_uint16_tlv_value},
//{ NFAPI_NR_NFAPI_NRARFCN_TAG, &(pNfapiMsg->nfapi_config.nrarfcn), &unpack_uint32_tlv_value},
{ NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), &unpack_ipv4_address_value},
{ NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), &unpack_ipv6_address_value},
{ NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), &unpack_uint16_tlv_value},
{ NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4), &unpack_ipv4_address_value},
{ NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6), &unpack_ipv6_address_value},
{ NFAPI_NR_NFAPI_P7_VNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_port), &unpack_uint16_tlv_value},
//{ NFAPI_NR_NFAPI_RF_BANDS_TAG, &(pNfapiMsg->nfapi_config.rf_bands), &unpack_rf_bands_value},
{ NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), &unpack_uint8_tlv_value},
{ NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), &unpack_uint8_tlv_value},
{ NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), &unpack_uint8_tlv_value},
//{ NFAPI_NR_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.ul_ue_per_sf), &unpack_uint8_tlv_value},
};
return ( pull8(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end) &&
return ( pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end) &&
unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
}
@@ -2378,17 +2335,17 @@ static int check_nr_unpack_length(nfapi_nr_phy_msg_type_e msgId, uint32_t unpack
retLen = sizeof( nfapi_nr_start_request_scf_t);
break;
case NFAPI_START_RESPONSE:
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE:
if (unpackedBufLen >= sizeof(nfapi_nr_start_response_scf_t))
retLen = sizeof(nfapi_nr_start_response_scf_t);
break;
case NFAPI_STOP_REQUEST:
case NFAPI_NR_PHY_MSG_TYPE_STOP_REQUEST:
if (unpackedBufLen >= sizeof(nfapi_stop_request_t))
retLen = sizeof(nfapi_stop_request_t);
break;
case NFAPI_STOP_RESPONSE:
case NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE:
if (unpackedBufLen >= sizeof(nfapi_stop_response_t))
retLen = sizeof(nfapi_stop_response_t);
break;
@@ -2637,15 +2594,15 @@ int nfapi_nr_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *
result = unpack_nr_start_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_START_RESPONSE:
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE:
result = unpack_nr_start_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_STOP_REQUEST:
case NFAPI_NR_PHY_MSG_TYPE_STOP_REQUEST:
result = unpack_stop_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_STOP_RESPONSE:
case NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE:
result = unpack_stop_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
@@ -214,7 +214,8 @@ typedef struct nfapi_pnf_config
* STOP.request. This can be done in the call back.
*/
int (*stop_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_stop_request_t* req);
int (*nr_stop_req)(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi_nr_stop_request_t* req);
/*! A callback for the MEASUREMENT.request
* \param config A pointer to the pnf configuration
* \param phy A pointer to the pnf phy configuration
+8 -8
View File
@@ -829,7 +829,7 @@ void pnf_nr_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
nfapi_nr_start_response_scf_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_START_RESPONSE;
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_STATE;
nfapi_nr_pnf_start_resp(config, &resp);
@@ -839,7 +839,7 @@ void pnf_nr_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
nfapi_nr_start_response_scf_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_START_RESPONSE;
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_CONFIG;
nfapi_nr_pnf_start_resp(config, &resp);
@@ -849,7 +849,7 @@ void pnf_nr_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
nfapi_nr_start_response_scf_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_START_RESPONSE;
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_STATE;
nfapi_nr_pnf_start_resp(config, &resp);
@@ -962,16 +962,16 @@ void pnf_nr_handle_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
if(phy->state != NFAPI_PNF_PHY_RUNNING)
{
if(config->stop_req)
if(config->nr_stop_req)
{
(config->stop_req)(config, phy, &req);
(config->nr_stop_req)(config, phy, &req);
}
}
else
{
nfapi_stop_response_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_STOP_RESPONSE;
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_STATE;
nfapi_pnf_stop_resp(config, &resp);
@@ -981,7 +981,7 @@ void pnf_nr_handle_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
nfapi_stop_response_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_STOP_RESPONSE;
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_CONFIG;
nfapi_pnf_stop_resp(config, &resp);
@@ -991,7 +991,7 @@ void pnf_nr_handle_stop_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
{
nfapi_stop_response_t resp;
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_STOP_RESPONSE;
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_STATE;
nfapi_pnf_stop_resp(config, &resp);
+7 -41
View File
@@ -514,7 +514,7 @@ static uint32_t get_slot_time(uint32_t now_hr, uint32_t slot_start_hr)
// if the us have wrapped adjust for it
if(now_hr < slot_start_us)
{
now_us += 500000; // changed from 1e6 - gokul
now_us += 500000;
}
return now_us - slot_start_us;
@@ -985,8 +985,6 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
uint8_t tx_buffer_index = tx_slot_dec % pnf_p7->_public.slot_buffer_size;
nfapi_pnf_p7_slot_buffer_t* tx_slot_buffer = &(pnf_p7->slot_buffer[tx_buffer_index]);
//printf("sfn_sf_dec:%d tx_sfn_sf_dec:%d\n", sfn_sf_dec, tx_sfn_sf_dec);
if (0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() shift:%d slot_buffer->sfn_sf:%d tx_slot_buffer->sfn_slot:%d sfn_sf:%d subframe_buffer[buffer_index:%u dl_config_req:%p tx_req:%p] "
"TX:sfn_sf:%d:tx_buffer_index:%d[dl_config_req:%p tx_req:%p]\n",
__FUNCTION__,
@@ -1013,18 +1011,16 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
{
if(pnf_p7->_public.tx_data_req_fn)
{
{
(pnf_p7->_public.tx_data_req_fn)(&(pnf_p7->_public), tx_slot_buffer->tx_data_req);
}
//deallocate_nfapi_tx_request(slot_buffer->tx_req, pnf_p7);
}
else
{
// send dummy
if(pnf_p7->_public.tx_data_req_fn && pnf_p7->_public.dummy_slot.tx_data_req)
{
pnf_p7->_public.dummy_slot.tx_data_req->SFN = sfn_tx; // TODO: change tx_req to nfapi_nr_tx_data_request_t
pnf_p7->_public.dummy_slot.tx_data_req->SFN = sfn_tx;
pnf_p7->_public.dummy_slot.tx_data_req->Slot = slot_tx;
(pnf_p7->_public.tx_data_req_fn)(&(pnf_p7->_public), pnf_p7->_public.dummy_slot.tx_data_req);
@@ -1036,12 +1032,8 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
{
if(pnf_p7->_public.dl_tti_req_fn)
{
printf("\nIn pnf_phy_dl_tti_req VNF: sfn %d slot %d, PNF: sfn %d slot %d \n",tx_slot_buffer->dl_tti_req->SFN,tx_slot_buffer->dl_tti_req->Slot,pnf_p7->sfn,pnf_p7->slot);
(pnf_p7->_public.dl_tti_req_fn)(NULL, &(pnf_p7->_public), tx_slot_buffer->dl_tti_req);
}
//deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
}
@@ -1050,7 +1042,7 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
// send dummy
if(pnf_p7->_public.dl_tti_req_fn && pnf_p7->_public.dummy_slot.dl_tti_req)
{
pnf_p7->_public.dummy_slot.dl_tti_req->SFN = sfn_tx; // TODO: Change dl_config_req to nfapi_nr_dl_tti_request_t
pnf_p7->_public.dummy_slot.dl_tti_req->SFN = sfn_tx;
pnf_p7->_public.dummy_slot.dl_tti_req->Slot = slot_tx;
(pnf_p7->_public.dl_tti_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.dl_tti_req);
}
@@ -1059,10 +1051,9 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
if(tx_slot_buffer->ul_dci_req!= 0)
{
if(pnf_p7->_public.ul_dci_req_fn)
{ printf("\nIn pnf_phy_Ul_DCI_req VNF: sfn %d slot %d, PNF: sfn %d slot %d\n",tx_slot_buffer->ul_dci_req->SFN,tx_slot_buffer->ul_dci_req->Slot,pnf_p7->sfn,pnf_p7->slot);
{
(pnf_p7->_public.ul_dci_req_fn)(NULL, &(pnf_p7->_public), tx_slot_buffer->ul_dci_req);
}
//deallocate_nfapi_hi_dci0_request(subframe_buffer->hi_dci0_req, pnf_p7);
}
else
{
@@ -1074,24 +1065,6 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
(pnf_p7->_public.ul_dci_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_dci_req);
}
}
#if 0
if(tx_slot_buffer->ue_release_req != 0) // TODO: check later if needed
{
if(pnf_p7->_public.ue_release_req)
(pnf_p7->_public.ue_release_req)(&(pnf_p7->_public), tx_slot_buffer->ue_release_req);
}
else
{
//send dummy
if(pnf_p7->_public.ue_release_req && pnf_p7->_public.dummy_slot.ue_release_req)
{
pnf_p7->_public.dummy_slot.ue_release_req->sfn_sf = sfn_slot_tx;
(pnf_p7->_public.ue_release_req)(&(pnf_p7->_public), pnf_p7->_public.dummy_slot.ue_release_req);
}
}
#endif
//TODO: add deallocate fns for the new structs
if(tx_slot_buffer->dl_tti_req != 0)
{
deallocate_nfapi_dl_tti_request(tx_slot_buffer->dl_tti_req, pnf_p7);
@@ -1125,10 +1098,7 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
if(slot_buffer->ul_tti_req != 0)
{
if(pnf_p7->_public.ul_tti_req_fn)
{ struct timespec curr;
// clock_gettime(CLOCK_MONOTONIC,&curr);
// printf("\ntime at which ul_tti handle fn %ld.%ld \n",curr.tv_sec,curr.tv_nsec);
printf("\nIn pnf_phy_ul_tti_req VNF: sfn %d slot %d, PNF: sfn %d slot %d \n",slot_buffer->ul_tti_req->SFN,slot_buffer->ul_tti_req->Slot,pnf_p7->sfn,pnf_p7->slot);
{
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), slot_buffer->ul_tti_req);
}
//deallocate_nfapi_ul_config_request(subframe_buffer->ul_config_req, pnf_p7);
@@ -2597,8 +2567,6 @@ void pnf_nr_handle_dl_node_sync(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
ul_node_sync.t1 = dl_node_sync.t1;
ul_node_sync.t2 = calculate_nr_t2(rx_hr_time, pnf_p7->sfn,pnf_p7->slot, pnf_p7->slot_start_time_hr);
ul_node_sync.t3 = calculate_nr_t3(pnf_p7->sfn,pnf_p7->slot, pnf_p7->slot_start_time_hr);
// ul_node_sync.t2 = ul_node_sync.t1 + 10;
// ul_node_sync.t3 = ul_node_sync.t2 + 10; // hardcoded - gokul
if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
{
@@ -3020,7 +2988,7 @@ void pnf_nr_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_tim
int recvfrom_result = 0;
struct sockaddr_in remote_addr;
socklen_t remote_addr_size = sizeof(remote_addr);
remote_addr.sin_family = 2; // Gokul - hardcoded
remote_addr.sin_family = 2; //hardcoded
do
{
@@ -3130,7 +3098,6 @@ int pnf_p7_message_pump(pnf_p7_t* pnf_p7)
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
//addr.sin_port = htons(pnf_p7->_public.local_p7_port); Gokul
addr.sin_port = pnf_p7->_public.local_p7_port;
if(pnf_p7->_public.local_p7_addr == 0)
@@ -3271,7 +3238,6 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
//addr.sin_port = htons(pnf_p7->_public.local_p7_port); Gokul
addr.sin_port = pnf_p7->_public.local_p7_port;
if(pnf_p7->_public.local_p7_addr == 0)
+17 -65
View File
@@ -1100,62 +1100,14 @@ void vnf_nr_handle_p4_p5_message(void *pRecvMsg, int recvMsgLen, int p5_idx, nfa
vnf_nr_handle_config_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_START_RESPONSE:
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE:
vnf_nr_handle_start_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_STOP_RESPONSE:
case NFAPI_NR_PHY_MSG_TYPE_STOP_RESPONSE:
vnf_handle_stop_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_MEASUREMENT_RESPONSE:
vnf_handle_measurement_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_RSSI_RESPONSE:
vnf_handle_rssi_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_RSSI_INDICATION:
vnf_handle_rssi_indication(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_CELL_SEARCH_RESPONSE:
vnf_handle_cell_search_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_CELL_SEARCH_INDICATION:
vnf_handle_cell_search_indication(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_BROADCAST_DETECT_RESPONSE:
vnf_handle_broadcast_detect_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_BROADCAST_DETECT_INDICATION:
vnf_handle_broadcast_detect_indication(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_SYSTEM_INFORMATION_SCHEDULE_RESPONSE:
vnf_handle_system_information_schedule_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_SYSTEM_INFORMATION_SCHEDULE_INDICATION:
vnf_handle_system_information_schedule_indication(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_SYSTEM_INFORMATION_RESPONSE:
vnf_handle_system_information_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_SYSTEM_INFORMATION_INDICATION:
vnf_handle_system_information_indication(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_NMM_STOP_RESPONSE:
vnf_handle_nmm_stop_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
default:
{
if(messageHeader.message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
@@ -1387,11 +1339,11 @@ int vnf_nr_read_dispatch_message(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_
// handle now if complete message in one or more segments
if ((flags & 0x80) == 0x80)
{
printf("\nVNF RECEIVES:\n");
for(int i=0; i<message_size; i++){
printf("%d", read_buffer[i]);
}
printf("\n");
// printf("\nVNF RECEIVES:\n");
// for(int i=0; i<message_size; i++){
// printf("%d", read_buffer[i]);
// }
// printf("\n");
vnf_nr_handle_p4_p5_message(read_buffer, message_size, pnf->p5_idx, config);
}
@@ -1516,11 +1468,11 @@ int vnf_read_dispatch_message(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t*
// handle now if complete message in one or more segments
if ((flags & 0x80) == 0x80)
{
printf("\nVNF RECEIVES:\n");
for(int i=0; i<message_size; i++){
printf("%d", read_buffer[i]);
}
printf("\n");
// printf("\nVNF RECEIVES:\n");
// for(int i=0; i<message_size; i++){
// printf("%d", read_buffer[i]);
// }
// printf("\n");
vnf_handle_p4_p5_message(read_buffer, message_size, pnf->p5_idx, config);
}
@@ -1549,11 +1501,11 @@ int vnf_read_dispatch_message(nfapi_vnf_config_t* config, nfapi_vnf_pnf_info_t*
static int vnf_send_p5_msg(nfapi_vnf_pnf_info_t* pnf, const void *msg, int len, uint8_t stream)
{
printf("\n MESSAGE SENT: \n");
for(int i=0; i<len; i++){
printf("%d", *(uint8_t *)(msg + i));
}
printf("\n");
// printf("\n MESSAGE SENT: \n");
// for(int i=0; i<len; i++){
// printf("%d", *(uint8_t *)(msg + i));
// }
// printf("\n");
//NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s len:%d stream:%d\n", __FUNCTION__, len, stream);
+2 -5
View File
@@ -176,7 +176,7 @@ int nfapi_nr_vnf_p7_start(nfapi_vnf_p7_config_t* config)
slot_start = timespec_add(slot_start, slot_duration);
NFAPI_TRACE(NFAPI_TRACE_INFO, "next slot will start at %d.%d\n", slot_start.tv_sec, slot_start.tv_nsec);
//printf("next slot will start at %d.%d\n",slot_start.tv_sec, slot_start.tv_nsec);
while(vnf_p7->terminate == 0)
{
fd_set rfds;
@@ -380,7 +380,7 @@ NFAPI_TRACE(NFAPI_TRACE_ERROR, "INVAL: pselect_timeout:%d.%ld adj[dur:%d adj:%d]
else
{
// we have overrun the subframe advance to go and collect $200
// CHANGE - gokul
if((millisecond - last_millisecond) > 3)
NFAPI_TRACE(NFAPI_TRACE_WARN, "subframe overrun %ld %ld (%ld)\n", millisecond, last_millisecond, millisecond - last_millisecond + 1);
@@ -411,11 +411,8 @@ struct timespec current_time;
curr->slot++;
}
vnf_nr_sync(vnf_p7, curr);
//printf("\nsfn:%d, slot:%d\n current time:%d.%d",curr->sfn,curr->slot,current_time.tv_sec, current_time.tv_nsec); //remove later - gokul
//printf("next slot will start at %d.%d\n",current_time.tv_sec, current_time.tv_nsec);
curr = curr->next;
}
//send_mac_subframe_indications(vnf_p7);
send_mac_slot_indications(vnf_p7);
}
else if(selectRetval > 0)