Cleanup before merge
The clean up includes removing white space changes, adding logs, adding comments to make various changes more obvious, etc.
This commit is contained in:
@@ -2220,20 +2220,20 @@ typedef struct {
|
||||
nfapi_ul_config_ulsch_cqi_ri_pdu ulsch_cqi_ri_pdu;
|
||||
nfapi_ul_config_ulsch_harq_pdu ulsch_harq_pdu;
|
||||
nfapi_ul_config_ulsch_cqi_harq_ri_pdu ulsch_cqi_harq_ri_pdu;
|
||||
nfapi_ul_config_uci_cqi_pdu uci_cqi_pdu; // should never see
|
||||
nfapi_ul_config_uci_cqi_pdu uci_cqi_pdu;
|
||||
nfapi_ul_config_uci_sr_pdu uci_sr_pdu;
|
||||
nfapi_ul_config_uci_harq_pdu uci_harq_pdu;
|
||||
nfapi_ul_config_uci_sr_harq_pdu uci_sr_harq_pdu;// should only see once in a while
|
||||
nfapi_ul_config_uci_cqi_harq_pdu uci_cqi_harq_pdu;// should never see
|
||||
nfapi_ul_config_uci_cqi_sr_pdu uci_cqi_sr_pdu;// should never see
|
||||
nfapi_ul_config_uci_cqi_sr_harq_pdu uci_cqi_sr_harq_pdu;// should never see
|
||||
nfapi_ul_config_srs_pdu srs_pdu;// should never see
|
||||
nfapi_ul_config_harq_buffer_pdu harq_buffer_pdu;// should never see
|
||||
nfapi_ul_config_ulsch_uci_csi_pdu ulsch_uci_csi_pdu;// should never see
|
||||
nfapi_ul_config_ulsch_uci_harq_pdu ulsch_uci_harq_pdu;// should never see
|
||||
nfapi_ul_config_ulsch_csi_uci_harq_pdu ulsch_csi_uci_harq_pdu;// should never see
|
||||
nfapi_ul_config_nulsch_pdu nulsch_pdu;// should never see
|
||||
nfapi_ul_config_nrach_pdu nrach_pdu;// should never see
|
||||
nfapi_ul_config_uci_sr_harq_pdu uci_sr_harq_pdu;
|
||||
nfapi_ul_config_uci_cqi_harq_pdu uci_cqi_harq_pdu;
|
||||
nfapi_ul_config_uci_cqi_sr_pdu uci_cqi_sr_pdu;
|
||||
nfapi_ul_config_uci_cqi_sr_harq_pdu uci_cqi_sr_harq_pdu;
|
||||
nfapi_ul_config_srs_pdu srs_pdu;
|
||||
nfapi_ul_config_harq_buffer_pdu harq_buffer_pdu;
|
||||
nfapi_ul_config_ulsch_uci_csi_pdu ulsch_uci_csi_pdu;
|
||||
nfapi_ul_config_ulsch_uci_harq_pdu ulsch_uci_harq_pdu;
|
||||
nfapi_ul_config_ulsch_csi_uci_harq_pdu ulsch_csi_uci_harq_pdu;
|
||||
nfapi_ul_config_nulsch_pdu nulsch_pdu;
|
||||
nfapi_ul_config_nrach_pdu nrach_pdu;
|
||||
};
|
||||
} nfapi_ul_config_request_pdu_t;
|
||||
|
||||
|
||||
@@ -526,7 +526,7 @@ uint32_t pullarray8(uint8_t **in, uint8_t out[], uint32_t max_len, uint32_t len,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((end - (*in)) >= sizeof(uint8_t) * len)
|
||||
if((end - (*in)) >= sizeof(uint8_t) * len)
|
||||
{
|
||||
memcpy(out, (*in), len);
|
||||
(*in)+=len;
|
||||
|
||||
@@ -37,31 +37,6 @@
|
||||
#include <nfapi.h>
|
||||
#include <debug.h>
|
||||
|
||||
__attribute__((unused))
|
||||
static const char *hexdump(const void *data, size_t data_len, char *out, size_t out_len)
|
||||
{
|
||||
char *p = out;
|
||||
char *endp = out + out_len;
|
||||
const uint8_t *q = data;
|
||||
snprintf(p, endp - p, "[%zu]", data_len);
|
||||
p += strlen(p);
|
||||
for (size_t i = 0; i < data_len; ++i)
|
||||
{
|
||||
if (p >= endp)
|
||||
{
|
||||
static const char ellipses[] = "...";
|
||||
char *s = endp - sizeof(ellipses);
|
||||
if (s >= p)
|
||||
{
|
||||
strcpy(s, ellipses);
|
||||
}
|
||||
break;
|
||||
}
|
||||
snprintf(p, endp - p, " %02X", *q++);
|
||||
p += strlen(p);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
extern int nfapi_unpack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t **ppReadPackedMsg, void* user_data);
|
||||
extern int nfapi_pack_p7_vendor_extension(nfapi_p7_message_header_t* header, uint8_t **ppWritePackedMsg, void* user_data);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#include <stdlib.h>
|
||||
@@ -505,7 +506,7 @@ int vnf_build_send_dl_node_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t
|
||||
dl_node_sync.t1 = calculate_t1(p7_info->sfn_sf, vnf_p7->sf_start_time_hr);
|
||||
dl_node_sync.delta_sfn_sf = 0;
|
||||
|
||||
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &dl_node_sync.header);
|
||||
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &dl_node_sync.header);
|
||||
}
|
||||
|
||||
int vnf_sync(vnf_p7_t* vnf_p7, nfapi_vnf_p7_connection_info_t* p7_info)
|
||||
@@ -1229,7 +1230,7 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
{
|
||||
/*NFAPI_TRACE(NFAPI_TRACE_NOTE, "***** Adjusting VNF phy_id:%d SFN/SF (%s) from %d to %d (%d) mode:%s zeroCount:%u sync:%s\n",
|
||||
ind.header.phy_id, (phy->in_sync ? "via sfn" : "now"),
|
||||
NFAPI_SFNSF2DEC(curr_sfn_sf), NFAPI_SFNSF2DEC(new_sfn_sf), phy->adjustment,
|
||||
NFAPI_SFNSF2DEC(curr_sfn_sf), NFAPI_SFNSF2DEC(new_sfn_sf), phy->adjustment,
|
||||
phy->filtered_adjust ? "FILTERED" : "ABSOLUTE",
|
||||
phy->zero_count,
|
||||
phy->in_sync ? "IN_SYNC" : "OUT_OF_SYNC");*/
|
||||
@@ -1269,7 +1270,6 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
if (vnf_p7 && vnf_p7->p7_connections)
|
||||
{
|
||||
int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
|
||||
printf("vnf_pnf_sfnsf_delta = %d adjusting now\n", vnf_pnf_sfnsf_delta); fflush(stdout);
|
||||
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta);
|
||||
|
||||
@@ -1277,8 +1277,7 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
//if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
|
||||
if (vnf_pnf_sfnsf_delta>0 || vnf_pnf_sfnsf_delta < 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n",
|
||||
__FUNCTION__, vnf_pnf_sfnsf_delta, NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), NFAPI_SFNSF2DEC(ind.last_sfn_sf));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnsf_delta, NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), NFAPI_SFNSF2DEC(ind.last_sfn_sf));
|
||||
// Panos: Careful here!!! Modification of the original nfapi-code
|
||||
vnf_p7->p7_connections[0].sfn_sf = ind.last_sfn_sf;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "vnf_p7.h"
|
||||
|
||||
@@ -181,7 +180,7 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
clock_gettime(CLOCK_MONOTONIC, &pselect_start);
|
||||
//long millisecond = pselect_start.tv_nsec / 1e6;
|
||||
|
||||
if((last_millisecond == -1) || (millisecond == last_millisecond) || (millisecond == (last_millisecond + 1) % 1000))
|
||||
if((last_millisecond == -1) || (millisecond == last_millisecond) || (millisecond == (last_millisecond + 1) % 1000) )
|
||||
{
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "pselect_start:%d.%d sf_start:%d.%d\n", pselect_start.tv_sec, pselect_start.tv_nsec, sf_start.tv_sec, sf_start.tv_nsec);
|
||||
|
||||
@@ -256,8 +255,8 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
if (selectRetval==-1 && errno == 22)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "INVAL: pselect_timeout:%d.%ld adj[dur:%d adj:%d], sf_dur:%d.%ld\n",
|
||||
pselect_timeout.tv_sec, pselect_timeout.tv_nsec,
|
||||
phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment,
|
||||
pselect_timeout.tv_sec, pselect_timeout.tv_nsec,
|
||||
phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment,
|
||||
sf_duration.tv_sec, sf_duration.tv_nsec);
|
||||
}
|
||||
if(selectRetval == 0)
|
||||
|
||||
Reference in New Issue
Block a user