Commit fb465455 authored by frtabu's avatar frtabu

Fix corrupted LOGs in L1L2simulator, introducing two new components NFAPI_VNF...

Fix corrupted LOGs in L1L2simulator, introducing two new components NFAPI_VNF and NFAPI_pnf. Integrate Fujitsu fix for up to 50 UEs. Apply astyle to all modified files in the branch
parent f3dc8d44
...@@ -303,8 +303,8 @@ void log_getconfig(log_t *g_log) { ...@@ -303,8 +303,8 @@ void log_getconfig(log_t *g_log) {
logparams_dump[i].numelt = 0; logparams_dump[i].numelt = 0;
} }
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX); config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX); config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX); config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
/* set the debug mask according to the debug parameters values */ /* set the debug mask according to the debug parameters values */
...@@ -385,7 +385,6 @@ int logInit (void) { ...@@ -385,7 +385,6 @@ int logInit (void) {
register_log_component("OCG","",OCG); register_log_component("OCG","",OCG);
register_log_component("PERF","",PERF); register_log_component("PERF","",PERF);
register_log_component("OIP","",OIP); register_log_component("OIP","",OIP);
register_log_component("CLI","",CLI);
register_log_component("MSC","log",MSC); register_log_component("MSC","log",MSC);
register_log_component("OCM","log",OCM); register_log_component("OCM","log",OCM);
register_log_component("HW","",HW); register_log_component("HW","",HW);
...@@ -408,6 +407,8 @@ int logInit (void) { ...@@ -408,6 +407,8 @@ int logInit (void) {
register_log_component("X2AP","",X2AP); register_log_component("X2AP","",X2AP);
register_log_component("LOADER","log",LOADER); register_log_component("LOADER","log",LOADER);
register_log_component("ASN","log",ASN); register_log_component("ASN","log",ASN);
register_log_component("NFAPI_PNF","log",NFAPI_PNF);
register_log_component("NFAPI_VNF","log",NFAPI_VNF);
for (int i=0 ; log_level_names[i].name != NULL ; i++) for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
...@@ -438,7 +439,7 @@ char *log_getthreadname(char *threadname, int bufsize) { ...@@ -438,7 +439,7 @@ char *log_getthreadname(char *threadname, int bufsize) {
static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) { static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
char threadname[PR_SET_NAME]; char threadname[PR_SET_NAME];
return snprintf(log_buffer, buffsize , "%s%s[%s]%c %s %s%s", return snprintf(log_buffer, buffsize, "%s%s[%s]%c %s %s%s",
log_level_highlight_end[level], log_level_highlight_end[level],
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]), ( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
g_log->log_component[comp].name, g_log->log_component[comp].name,
...@@ -452,11 +453,17 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le ...@@ -452,11 +453,17 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le
char log_buffer[MAX_LOG_TOTAL]; char log_buffer[MAX_LOG_TOTAL];
va_list args; va_list args;
va_start(args, format); va_start(args, format);
log_header(log_buffer,MAX_LOG_TOTAL ,comp, level,format); log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args); g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
va_end(args); va_end(args);
} }
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args ) {
char log_buffer[MAX_LOG_TOTAL];
log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
}
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ) { void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ) {
va_list args; va_list args;
char *wbuf; char *wbuf;
...@@ -474,7 +481,7 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char ...@@ -474,7 +481,7 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
if (wbuf != NULL) { if (wbuf != NULL) {
va_start(args, format); va_start(args, format);
int pos=log_header(wbuf,MAX_LOG_TOTAL ,component, OAILOG_INFO,""); int pos=log_header(wbuf,MAX_LOG_TOTAL,component, OAILOG_INFO,"");
int pos2=vsprintf(wbuf+pos,format, args); int pos2=vsprintf(wbuf+pos,format, args);
pos=pos+pos2; pos=pos+pos2;
va_end(args); va_end(args);
......
...@@ -198,7 +198,6 @@ typedef enum { ...@@ -198,7 +198,6 @@ typedef enum {
NAS, NAS,
PERF, PERF,
OIP, OIP,
CLI,
MSC, MSC,
OCM, OCM,
UDP_, UDP_,
...@@ -218,6 +217,8 @@ typedef enum { ...@@ -218,6 +217,8 @@ typedef enum {
X2AP, X2AP,
LOADER, LOADER,
ASN, ASN,
NFAPI_VNF,
NFAPI_PNF,
MAX_LOG_PREDEF_COMPONENTS, MAX_LOG_PREDEF_COMPONENTS,
} }
comp_name_t; comp_name_t;
...@@ -286,6 +287,7 @@ extern "C" { ...@@ -286,6 +287,7 @@ extern "C" {
int logInit (void); int logInit (void);
int isLogInitDone (void); int isLogInitDone (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ); void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
int set_log(int component, int level); int set_log(int component, int level);
void set_glog(int level); void set_glog(int level);
...@@ -365,9 +367,9 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -365,9 +367,9 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) # define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0) # define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0) # define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
# define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0)
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */ /* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */ # define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
# define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */
/* bitmask dependant macros, to isolate debugging code */ /* bitmask dependant macros, to isolate debugging code */
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D) # define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
......
...@@ -800,6 +800,47 @@ ID = LEGACY_SIM_TRACE ...@@ -800,6 +800,47 @@ ID = LEGACY_SIM_TRACE
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_NFAPI_VNF_INFO
DESC = NFAPI_VNF legacy logs - info level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_ERROR
DESC = NFAPI_VNF legacy logs - error level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_WARNING
DESC = NFAPI_VNF legacy logs - warning level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_DEBUG
DESC = NFAPI_VNF legacy logs - debug level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_TRACE
DESC = NFAPI_VNF legacy logs - trace level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_INFO
DESC = NFAPI_PNF legacy logs - info level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_ERROR
DESC = NFAPI_PNF legacy logs - error level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_WARNING
DESC = NFAPI_PNF legacy logs - warning level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_DEBUG
DESC = NFAPI_PNF legacy logs - debug level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_TRACE
DESC = NFAPI_PNF legacy logs - trace level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
# this is a bad hack but I won't fix (function util_print_hex_octets # this is a bad hack but I won't fix (function util_print_hex_octets
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c # in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
# does funky things with the LOG_x macros but we work on the C pre-processor # does funky things with the LOG_x macros but we work on the C pre-processor
...@@ -845,27 +886,7 @@ ID = LEGACY_componentP_TRACE ...@@ -845,27 +886,7 @@ ID = LEGACY_componentP_TRACE
GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
#needed?
ID = LEGACY_CLI_INFO
DESC = CLI legacy logs - info level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_ERROR
DESC = CLI legacy logs - error level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_WARNING
DESC = CLI legacy logs - warning level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_DEBUG
DESC = CLI legacy logs - debug level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_TRACE
DESC = CLI legacy logs - trace level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
################# #################
#### UE LOGS #### #### UE LOGS ####
......
...@@ -57,7 +57,7 @@ extern RAN_CONTEXT_t RC; ...@@ -57,7 +57,7 @@ extern RAN_CONTEXT_t RC;
#define _GNU_SOURCE #define _GNU_SOURCE
extern void phy_init_RU(RU_t*); extern void phy_init_RU(RU_t *);
extern int config_sync_var; extern int config_sync_var;
extern pthread_cond_t nfapi_sync_cond; extern pthread_cond_t nfapi_sync_cond;
...@@ -78,7 +78,7 @@ extern void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_d ...@@ -78,7 +78,7 @@ extern void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, nfapi_d
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
nfapi_tx_request_pdu_t* tx_request_pdu[1023][10][10]; // [frame][subframe][max_num_pdus] nfapi_tx_request_pdu_t *tx_request_pdu[1023][10][10]; // [frame][subframe][max_num_pdus]
uint8_t tx_pdus[32][8][4096]; uint8_t tx_pdus[32][8][4096];
...@@ -90,11 +90,11 @@ nfapi_pnf_param_response_t g_pnf_param_resp; ...@@ -90,11 +90,11 @@ nfapi_pnf_param_response_t g_pnf_param_resp;
nfapi_pnf_p7_config_t *p7_config_g = NULL; nfapi_pnf_p7_config_t *p7_config_g = NULL;
void* pnf_allocate(size_t size) { void *pnf_allocate(size_t size) {
return malloc(size); return malloc(size);
} }
void pnf_deallocate(void* ptr) { void pnf_deallocate(void *ptr) {
free(ptr); free(ptr);
} }
...@@ -109,36 +109,36 @@ typedef struct { ...@@ -109,36 +109,36 @@ typedef struct {
} udp_data; } udp_data;
typedef struct { typedef struct {
uint16_t index; uint16_t index;
uint16_t id; uint16_t id;
uint8_t rfs[2]; uint8_t rfs[2];
uint8_t excluded_rfs[2]; uint8_t excluded_rfs[2];
udp_data udp; udp_data udp;
char local_addr[80]; char local_addr[80];
int local_port; int local_port;
char* remote_addr; char *remote_addr;
int remote_port; int remote_port;
uint8_t duplex_mode; uint8_t duplex_mode;
uint16_t dl_channel_bw_support; uint16_t dl_channel_bw_support;
uint16_t ul_channel_bw_support; uint16_t ul_channel_bw_support;
uint8_t num_dl_layers_supported; uint8_t num_dl_layers_supported;
uint8_t num_ul_layers_supported; uint8_t num_ul_layers_supported;
uint16_t release_supported; uint16_t release_supported;
uint8_t nmm_modes_supported; uint8_t nmm_modes_supported;
uint8_t dl_ues_per_subframe; uint8_t dl_ues_per_subframe;
uint8_t ul_ues_per_subframe; uint8_t ul_ues_per_subframe;
uint8_t first_subframe_ind; uint8_t first_subframe_ind;
// timing information recevied from the vnf // timing information recevied from the vnf
uint8_t timing_window; uint8_t timing_window;
uint8_t timing_info_mode; uint8_t timing_info_mode;
uint8_t timing_info_period; uint8_t timing_info_period;
} phy_info; } phy_info;
...@@ -158,36 +158,36 @@ typedef struct { ...@@ -158,36 +158,36 @@ typedef struct {
typedef struct { typedef struct {
int release; int release;
phy_info phys[2]; phy_info phys[2];
rf_info rfs[2]; rf_info rfs[2];
uint8_t sync_mode; uint8_t sync_mode;
uint8_t location_mode; uint8_t location_mode;
uint8_t location_coordinates[6]; uint8_t location_coordinates[6];
uint32_t dl_config_timing; uint32_t dl_config_timing;
uint32_t ul_config_timing; uint32_t ul_config_timing;
uint32_t tx_timing; uint32_t tx_timing;
uint32_t hi_dci0_timing; uint32_t hi_dci0_timing;
uint16_t max_phys; uint16_t max_phys;
uint16_t max_total_bw; uint16_t max_total_bw;
uint16_t max_total_dl_layers; uint16_t max_total_dl_layers;
uint16_t max_total_ul_layers; uint16_t max_total_ul_layers;
uint8_t shared_bands; uint8_t shared_bands;
uint8_t shared_pa; uint8_t shared_pa;
int16_t max_total_power; int16_t max_total_power;
uint8_t oui; uint8_t oui;
uint8_t wireshark_test_mode; uint8_t wireshark_test_mode;
} pnf_info; } pnf_info;
typedef struct { typedef struct {
uint16_t phy_id; uint16_t phy_id;
nfapi_pnf_config_t* config; nfapi_pnf_config_t *config;
phy_info* phy; phy_info *phy;
nfapi_pnf_p7_config_t* p7_config; nfapi_pnf_p7_config_t *p7_config;
} pnf_phy_user_data_t; } pnf_phy_user_data_t;
static pnf_info pnf; static pnf_info pnf;
...@@ -195,32 +195,34 @@ static pthread_t pnf_start_pthread; ...@@ -195,32 +195,34 @@ static pthread_t pnf_start_pthread;
int nfapitooai_level(int nfapi_level) { int nfapitooai_level(int nfapi_level) {
switch(nfapi_level) { switch(nfapi_level) {
case NFAPI_TRACE_ERROR: case NFAPI_TRACE_ERROR:
return LOG_ERR; return LOG_ERR;
case NFAPI_TRACE_WARN:
return LOG_WARNING; case NFAPI_TRACE_WARN:
return LOG_WARNING;
case NFAPI_TRACE_NOTE: case NFAPI_TRACE_NOTE:
return LOG_INFO; return LOG_INFO;
case NFAPI_TRACE_INFO:
return LOG_DEBUG; case NFAPI_TRACE_INFO:
} return LOG_DEBUG;
}
return LOG_ERR; return LOG_ERR;
} }
void pnf_nfapi_trace(nfapi_trace_level_t nfapi_level, const char* message, ...) { void pnf_nfapi_trace(nfapi_trace_level_t nfapi_level, const char *message, ...) {
va_list args; va_list args;
va_start(args, message); va_start(args, message);
nfapi_log("FILE>", "FUNC", 999, PHY, nfapitooai_level(nfapi_level), message, args); VLOG( NFAPI_PNF, nfapitooai_level(nfapi_level), message, args);
va_end(args); va_end(args);
} }
void pnf_set_thread_priority(int priority) { void pnf_set_thread_priority(int priority) {
pthread_attr_t ptAttr; pthread_attr_t ptAttr;
struct sched_param schedParam; struct sched_param schedParam;
schedParam.__sched_priority = priority; schedParam.__sched_priority = priority;
if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0) { if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0) {
printf("failed to set SCHED_RR\n"); printf("failed to set SCHED_RR\n");
} }
...@@ -230,36 +232,29 @@ void pnf_set_thread_priority(int priority) { ...@@ -230,36 +232,29 @@ void pnf_set_thread_priority(int priority) {
} }
pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED); pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED);
struct sched_param thread_params; struct sched_param thread_params;
thread_params.sched_priority = 20; thread_params.sched_priority = 20;
if(pthread_attr_setschedparam(&ptAttr, &thread_params) != 0) { if(pthread_attr_setschedparam(&ptAttr, &thread_params) != 0) {
printf("failed to set sched param\n"); printf("failed to set sched param\n");
} }
} }
void* pnf_p7_thread_start(void* ptr) { void *pnf_p7_thread_start(void *ptr) {
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] P7 THREAD %s\n", __FUNCTION__); NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] P7 THREAD %s\n", __FUNCTION__);
pnf_set_thread_priority(79); pnf_set_thread_priority(79);
nfapi_pnf_p7_config_t *config = (nfapi_pnf_p7_config_t *)ptr;
nfapi_pnf_p7_config_t* config = (nfapi_pnf_p7_config_t*)ptr;
nfapi_pnf_p7_start(config); nfapi_pnf_p7_start(config);
return 0; return 0;
} }
int pnf_param_request(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req) { int pnf_param_request(nfapi_pnf_config_t *config, nfapi_pnf_param_request_t *req) {
printf("[PNF] pnf param request\n"); printf("[PNF] pnf param request\n");
nfapi_pnf_param_response_t resp; nfapi_pnf_param_response_t resp;
memset(&resp, 0, sizeof(resp)); memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_PNF_PARAM_RESPONSE; resp.header.message_id = NFAPI_PNF_PARAM_RESPONSE;
resp.error_code = NFAPI_MSG_OK; resp.error_code = NFAPI_MSG_OK;
pnf_info *pnf = (pnf_info *)(config->user_data);
pnf_info* pnf = (pnf_info*)(config->user_data);
resp.pnf_param_general.tl.tag = NFAPI_PNF_PARAM_GENERAL_TAG; resp.pnf_param_general.tl.tag = NFAPI_PNF_PARAM_GENERAL_TAG;
resp.pnf_param_general.nfapi_sync_mode = pnf->sync_mode; resp.pnf_param_general.nfapi_sync_mode = pnf->sync_mode;
resp.pnf_param_general.location_mode = pnf->location_mode; resp.pnf_param_general.location_mode = pnf->location_mode;
...@@ -274,25 +269,25 @@ int pnf_param_request(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req ...@@ -274,25 +269,25 @@ int pnf_param_request(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req
resp.pnf_param_general.shared_bands = pnf->shared_bands; resp.pnf_param_general.shared_bands = pnf->shared_bands;
resp.pnf_param_general.shared_pa = pnf->shared_pa; resp.pnf_param_general.shared_pa = pnf->shared_pa;
resp.pnf_param_general.maximum_total_power = pnf->max_total_power; resp.pnf_param_general.maximum_total_power = pnf->max_total_power;
resp.pnf_phy.tl.tag = NFAPI_PNF_PHY_TAG; resp.pnf_phy.tl.tag = NFAPI_PNF_PHY_TAG;
resp.pnf_phy.number_of_phys = 1; resp.pnf_phy.number_of_phys = 1;
for(int i = 0; i < 1; ++i) { for(int i = 0; i < 1; ++i) {
resp.pnf_phy.phy[i].phy_config_index = pnf->phys[i].index; resp.pnf_phy.phy[i].phy_config_index = pnf->phys[i].index;
resp.pnf_phy.phy[i].downlink_channel_bandwidth_supported = pnf->phys[i].dl_channel_bw_support; resp.pnf_phy.phy[i].downlink_channel_bandwidth_supported = pnf->phys[i].dl_channel_bw_support;
resp.pnf_phy.phy[i].uplink_channel_bandwidth_supported = pnf->phys[i].ul_channel_bw_support; resp.pnf_phy.phy[i].uplink_channel_bandwidth_supported = pnf->phys[i].ul_channel_bw_support;
resp.pnf_phy.phy[i].number_of_dl_layers_supported = pnf->phys[i].num_dl_layers_supported; resp.pnf_phy.phy[i].number_of_dl_layers_supported = pnf->phys[i].num_dl_layers_supported;
resp.pnf_phy.phy[i].number_of_ul_layers_supported = pnf->phys[i].num_ul_layers_supported; resp.pnf_phy.phy[i].number_of_ul_layers_supported = pnf->phys[i].num_ul_layers_supported;
resp.pnf_phy.phy[i].maximum_3gpp_release_supported = pnf->phys[i].release_supported; resp.pnf_phy.phy[i].maximum_3gpp_release_supported = pnf->phys[i].release_supported;
resp.pnf_phy.phy[i].nmm_modes_supported = pnf->phys[i].nmm_modes_supported; resp.pnf_phy.phy[i].nmm_modes_supported = pnf->phys[i].nmm_modes_supported;
resp.pnf_phy.phy[i].number_of_rfs = 2; resp.pnf_phy.phy[i].number_of_rfs = 2;
for(int j = 0; j < 1; ++j) { for(int j = 0; j < 1; ++j) {
resp.pnf_phy.phy[i].rf_config[j].rf_config_index = pnf->phys[i].rfs[j]; resp.pnf_phy.phy[i].rf_config[j].rf_config_index = pnf->phys[i].rfs[j];
} }
resp.pnf_phy.phy[i].number_of_rf_exclusions = 0; resp.pnf_phy.phy[i].number_of_rf_exclusions = 0;
for(int j = 0; j < 0; ++j) { for(int j = 0; j < 0; ++j) {
resp.pnf_phy.phy[i].excluded_rf_config[j].rf_config_index = pnf->phys[i].excluded_rfs[j]; resp.pnf_phy.phy[i].excluded_rf_config[j].rf_config_index = pnf->phys[i].excluded_rfs[j];
} }
...@@ -302,9 +297,9 @@ int pnf_param_request(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req ...@@ -302,9 +297,9 @@ int pnf_param_request(nfapi_pnf_config_t* config, nfapi_pnf_param_request_t* req
resp.pnf_rf.number_of_rfs = 2; resp.pnf_rf.number_of_rfs = 2;
for(int i = 0; i < 2; ++i) { for(int i = 0; i < 2; ++i) {
resp.pnf_rf.rf[i].rf_config_index = pnf->rfs[i].index; resp.pnf_rf.rf[i].rf_config_index = pnf->rfs[i].index;
resp.pnf_rf.rf[i].band = pnf->rfs[i].band; resp.pnf_rf.rf[i].band = pnf->rfs[i].band;
resp.pnf_rf.rf[i].maximum_transmit_power = pnf->rfs[i].max_transmit_power; resp.pnf_rf.rf[i].maximum_transmit_power = pnf->rfs[i].max_transmit_power;
resp.pnf_rf.rf[i].minimum_transmit_power = pnf->rfs[i].min_transmit_power; resp.pnf_rf.rf[i].minimum_transmit_power = pnf->rfs[i].min_transmit_power;
resp.pnf_rf.rf[i].number_of_antennas_suppported = pnf->rfs[i].num_antennas_supported; resp.pnf_rf.rf[i].number_of_antennas_suppported = pnf->rfs[i].num_antennas_supported;