Resolved merge conflicts and allocated gNB struct in VNF
This commit is contained in:
@@ -73,7 +73,6 @@ extern pthread_mutex_t nfapi_sync_mutex;
|
||||
extern int nfapi_sync_var;
|
||||
|
||||
extern int sync_var;
|
||||
char uecap_xer_in;
|
||||
|
||||
extern void init_eNB_afterRU(void);
|
||||
extern void init_UE_stub(int nb_inst,int,int);
|
||||
@@ -2202,7 +2201,7 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add
|
||||
pnf.phys[0].udp.tx_port = vnf_p7_port;
|
||||
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
|
||||
strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
|
||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n",
|
||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%u rx:%u]\n",
|
||||
__FUNCTION__,config->vnf_ip_addr, config->vnf_p5_port,
|
||||
pnf.phys[0].local_addr,
|
||||
pnf.phys[0].udp.tx_addr, pnf.phys[0].udp.tx_port,
|
||||
@@ -2253,7 +2252,7 @@ void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr,
|
||||
pnf.phys[0].udp.tx_port = vnf_p7_port;
|
||||
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
|
||||
strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
|
||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n",
|
||||
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%u rx:%u]\n",
|
||||
__FUNCTION__,
|
||||
config->vnf_ip_addr, config->vnf_p5_port,
|
||||
pnf.phys[0].local_addr,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#if !defined(NFAPI_PNF_H__)
|
||||
#define NFAPI_PNF_H__
|
||||
extern nfapi_ue_release_request_body_t release_rntis;
|
||||
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
|
||||
|
||||
@@ -239,6 +239,18 @@ void oai_enb_init(void) {
|
||||
|
||||
void oai_create_gnb(void) {
|
||||
int bodge_counter=0;
|
||||
|
||||
if (RC.gNB == NULL) {
|
||||
RC.gNB = (PHY_VARS_gNB **) calloc(1, sizeof(PHY_VARS_gNB *));
|
||||
LOG_I(PHY,"gNB L1 structure RC.gNB allocated @ %p\n",RC.gNB);
|
||||
}
|
||||
|
||||
|
||||
if (RC.gNB[0] == NULL) {
|
||||
RC.gNB[0] = (PHY_VARS_gNB *) calloc(1, sizeof(PHY_VARS_gNB));
|
||||
LOG_I(PHY,"[nr-gnb.c] gNB structure RC.gNB[%d] allocated @ %p\n",0,RC.gNB[0]);
|
||||
}
|
||||
|
||||
PHY_VARS_gNB *gNB = RC.gNB[0];
|
||||
RC.nb_nr_CC = (int *)malloc(sizeof(int)); // TODO: find a better function to place this in
|
||||
|
||||
|
||||
@@ -1,76 +1,76 @@
|
||||
/*
|
||||
* Copyright 2017 Cisco Systems, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#define MAX_MSG_LENGTH 2096
|
||||
#define TRACE_HEADER_LENGTH 44
|
||||
|
||||
void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...);
|
||||
|
||||
// initialize the trace function to 0
|
||||
void (*nfapi_trace_g)(nfapi_trace_level_t level, const char* format, ...) = &nfapi_trace_dbg;
|
||||
|
||||
nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_INFO;
|
||||
//nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_WARN;
|
||||
|
||||
void nfapi_set_trace_level(nfapi_trace_level_t new_level)
|
||||
{
|
||||
nfapi_trace_level_g = new_level;
|
||||
}
|
||||
|
||||
void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...)
|
||||
{
|
||||
char trace_buff[MAX_MSG_LENGTH + TRACE_HEADER_LENGTH];
|
||||
uint32_t num_chars;
|
||||
va_list p_args;
|
||||
struct timeval tv;
|
||||
pthread_t tid = pthread_self();
|
||||
|
||||
(void)gettimeofday(&tv, NULL);
|
||||
|
||||
num_chars = (uint32_t)snprintf(trace_buff, TRACE_HEADER_LENGTH, "%04u.%06u: 0x%02x: %10u: ", ((uint32_t)tv.tv_sec) & 0x1FFF, (uint32_t)tv.tv_usec, (uint32_t)level, (uint32_t)tid);
|
||||
|
||||
if (num_chars > TRACE_HEADER_LENGTH)
|
||||
{
|
||||
printf("trace_dbg: Error, num_chars is too large: %d", num_chars);
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(p_args, format);
|
||||
if ((num_chars = (uint32_t)vsnprintf(&trace_buff[num_chars], MAX_MSG_LENGTH, format, p_args)))
|
||||
{
|
||||
if (level <= NFAPI_TRACE_WARN)
|
||||
{
|
||||
printf("%s", trace_buff);
|
||||
}
|
||||
printf("%s", trace_buff);
|
||||
}
|
||||
va_end(p_args);
|
||||
}
|
||||
/*
|
||||
* Copyright 2017 Cisco Systems, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#define MAX_MSG_LENGTH 2096
|
||||
#define TRACE_HEADER_LENGTH 44
|
||||
|
||||
void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...);
|
||||
|
||||
// initialize the trace function to 0
|
||||
void (*nfapi_trace_g)(nfapi_trace_level_t level, const char* format, ...) = &nfapi_trace_dbg;
|
||||
|
||||
nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_INFO;
|
||||
//nfapi_trace_level_t nfapi_trace_level_g = NFAPI_TRACE_WARN;
|
||||
|
||||
void nfapi_set_trace_level(nfapi_trace_level_t new_level)
|
||||
{
|
||||
nfapi_trace_level_g = new_level;
|
||||
}
|
||||
|
||||
void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...)
|
||||
{
|
||||
char trace_buff[MAX_MSG_LENGTH + TRACE_HEADER_LENGTH];
|
||||
uint32_t num_chars;
|
||||
va_list p_args;
|
||||
struct timeval tv;
|
||||
pthread_t tid = pthread_self();
|
||||
|
||||
(void)gettimeofday(&tv, NULL);
|
||||
|
||||
num_chars = (uint32_t)snprintf(trace_buff, TRACE_HEADER_LENGTH, "%04u.%06u: 0x%02x: %10u: ", ((uint32_t)tv.tv_sec) & 0x1FFF, (uint32_t)tv.tv_usec, (uint32_t)level, (uint32_t)tid);
|
||||
|
||||
if (num_chars > TRACE_HEADER_LENGTH)
|
||||
{
|
||||
printf("trace_dbg: Error, num_chars is too large: %u", num_chars);
|
||||
return;
|
||||
}
|
||||
|
||||
va_start(p_args, format);
|
||||
if ((num_chars = (uint32_t)vsnprintf(&trace_buff[num_chars], MAX_MSG_LENGTH, format, p_args)))
|
||||
{
|
||||
if (level <= NFAPI_TRACE_WARN)
|
||||
{
|
||||
printf("%s", trace_buff);
|
||||
}
|
||||
printf("%s", trace_buff);
|
||||
}
|
||||
va_end(p_args);
|
||||
}
|
||||
|
||||
@@ -972,7 +972,7 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t ss_pbch_power;//SSB Block Power Value: TBD (-60..50 dBm)
|
||||
int ss_pbch_power;//SSB Block Power Value: TBD (-60..50 dBm)
|
||||
uint8_t bch_payload;//Defines option selected for generation of BCH payload, see Table 3-13 (v0.0.011 Value: 0: MAC generates the full PBCH payload 1: PHY generates the timing PBCH bits 2: PHY generates the full PBCH payload
|
||||
uint8_t scs_common;//subcarrierSpacing for common, used for initial access and broadcast message. [38.211 sec 4.2] Value:0->3
|
||||
|
||||
@@ -1058,12 +1058,6 @@ typedef struct {
|
||||
fapi_nr_tdd_table_t tdd_table;
|
||||
fapi_nr_prach_config_t prach_config;
|
||||
|
||||
fapi_nr_dl_bwp_common_config_t dl_bwp_common;
|
||||
fapi_nr_dl_bwp_dedicated_config_t dl_bwp_dedicated;
|
||||
|
||||
fapi_nr_ul_bwp_common_config_t ul_bwp_common;
|
||||
fapi_nr_ul_bwp_dedicated_config_t ul_bwp_dedicated;
|
||||
|
||||
} fapi_nr_config_request_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -357,7 +357,7 @@ typedef struct
|
||||
//table 3-23
|
||||
typedef struct
|
||||
{
|
||||
nfapi_uint32_tlv_t ss_pbch_power;//SSB Block Power Value: TBD (-60..50 dBm)
|
||||
nfapi_int32_tlv_t ss_pbch_power;//SSB Block Power Value: TBD (-60..50 dBm)
|
||||
nfapi_uint8_tlv_t bch_payload;//Defines option selected for generation of BCH payload, see Table 3-13 (v0.0.011 Value: 0: MAC generates the full PBCH payload 1: PHY generates the timing PBCH bits 2: PHY generates the full PBCH payload
|
||||
nfapi_uint8_tlv_t scs_common;//subcarrierSpacing for common, used for initial access and broadcast message. [38.211 sec 4.2] Value:0->3
|
||||
|
||||
@@ -398,13 +398,13 @@ typedef struct
|
||||
{
|
||||
nfapi_uint32_tlv_t ssb_mask;//Bitmap for actually transmitted SSB. MSB->LSB of first 32 bit number corresponds to SSB 0 to SSB 31 MSB->LSB of second 32 bit number corresponds to SSB 32 to SSB 63 Value for each bit: 0: not transmitted 1: transmitted
|
||||
|
||||
} nfapi_nr_ssb_mask_size_2_t;
|
||||
} nfapi_nr_ssb_mask_list_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
nfapi_uint8_tlv_t beam_id[64];//BeamID for each SSB in SsbMask. For example, if SSB mask bit 26 is set to 1, then BeamId[26] will be used to indicate beam ID of SSB 26. Value: from 0 to 63
|
||||
nfapi_uint8_tlv_t beam_id;//BeamID for each SSB in SsbMask. For example, if SSB mask bit 26 is set to 1, then BeamId[26] will be used to indicate beam ID of SSB 26. Value: from 0 to 63
|
||||
|
||||
} nfapi_nr_ssb_mask_size_64_t;
|
||||
} nfapi_nr_ssb_beam_id_list_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -413,8 +413,8 @@ typedef struct
|
||||
nfapi_uint8_tlv_t ssb_period;//SSB periodicity in msec Value: 0: ms5 1: ms10 2: ms20 3: ms40 4: ms80 5: ms160
|
||||
nfapi_uint8_tlv_t ssb_subcarrier_offset;//ssbSubcarrierOffset or 𝑘𝑆𝑆𝐵 (38.211, section 7.4.3.1) Value: 0->31
|
||||
nfapi_uint32_tlv_t MIB;//MIB payload, where the 24 MSB are used and represent the MIB in [38.331 MIB IE] and represent 0 1 2 3 1 , , , ,..., A− a a a a a [38.212, sec 7.1.1]
|
||||
nfapi_nr_ssb_mask_size_2_t ssb_mask_list[2];
|
||||
nfapi_nr_ssb_mask_size_64_t* ssb_beam_id_list;//64
|
||||
nfapi_nr_ssb_mask_list_t ssb_mask_list[2];
|
||||
nfapi_nr_ssb_beam_id_list_t ssb_beam_id_list[64];
|
||||
nfapi_uint8_tlv_t ss_pbch_multiple_carriers_in_a_band;//0 = disabled 1 = enabled
|
||||
nfapi_uint8_tlv_t multiple_cells_ss_pbch_in_a_carrier;//Indicates that multiple cells will be supported in a single carrier 0 = disabled 1 = enabled
|
||||
|
||||
@@ -678,7 +678,7 @@ typedef struct {
|
||||
|
||||
} nfapi_nr_slot_indication_scf_t;
|
||||
|
||||
// 3.4.2
|
||||
// 3.4.2
|
||||
|
||||
//for pdcch_pdu:
|
||||
|
||||
@@ -691,11 +691,10 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
uint16_t pm_idx;//Index to precoding matrix (PM) pre-stored at cell configuration. Note: If precoding is not used this parameter should be set to 0. Value: 0->65535.
|
||||
nfapi_nr_dig_bf_interface_t* dig_bf_interface_list;
|
||||
nfapi_nr_dig_bf_interface_t dig_bf_interface_list[1];//max dig_bf_interfaces
|
||||
|
||||
}nfapi_nr_tx_precoding_and_beamforming_number_of_prgs_t;
|
||||
|
||||
/*
|
||||
//table 3-43
|
||||
typedef struct
|
||||
{
|
||||
@@ -703,23 +702,10 @@ typedef struct
|
||||
uint16_t prg_size;//Size in RBs of a precoding resource block group (PRG) – to which same precoding and digital beamforming gets applied. Value: 1->275
|
||||
//watchout: dig_bf_interfaces here, in table 3-53 it's dig_bf_interface
|
||||
uint8_t dig_bf_interfaces;//Number of STD ant ports (parallel streams) feeding into the digBF Value: 0->255
|
||||
nfapi_nr_tx_precoding_and_beamforming_number_of_prgs_t* prgs_list;//
|
||||
nfapi_nr_tx_precoding_and_beamforming_number_of_prgs_t prgs_list[1];//max prg_size
|
||||
|
||||
}nfapi_nr_tx_precoding_and_beamforming_t;
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/// Number of PRGs spanning this allocation. Value : 1->275
|
||||
uint16_t numPRGs;
|
||||
/// Size in RBs of a precoding resource block group (PRG) – to which same precoding and digital beamforming gets applied. Value: 1->275
|
||||
uint16_t prgSize;
|
||||
/// Number of STD ant ports (parallel streams) feeding into the digBF Value: 0->255
|
||||
uint8_t digBFInterfaces;
|
||||
// Depends on numPRGs
|
||||
uint16_t PMIdx[275];
|
||||
// Depends on digBFInterfaces
|
||||
uint16_t beamIdx[256];
|
||||
} nfapi_nr_tx_precoding_and_beamforming_t;
|
||||
|
||||
//table 3-37
|
||||
|
||||
@@ -755,16 +741,6 @@ typedef struct {
|
||||
|
||||
} nfapi_nr_dl_dci_pdu_t;
|
||||
|
||||
typedef struct {
|
||||
/// Number of PRGs spanning this allocation. Value : 1->275
|
||||
uint16_t numPRGs;
|
||||
/// Size in RBs of a precoding resource block group (PRG) – to which same precoding and digital beamforming gets applied. Value: 1->275
|
||||
uint16_t prgSize;
|
||||
/// Number of STD ant ports (parallel streams) feeding into the digBF Value: 0->255
|
||||
uint8_t digBFInterfaces;
|
||||
uint16_t PMIdx[275];
|
||||
uint16_t *beamIdx[275];
|
||||
} nr_beamforming_t;
|
||||
|
||||
typedef struct {
|
||||
///Bandwidth part size [TS38.213 sec12]. Number of contiguous PRBs allocated to the BWP,Value: 1->275
|
||||
@@ -1028,7 +1004,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
uint16_t PDUType;
|
||||
uint16_t PDUSize;
|
||||
uint32_t PDUSize;
|
||||
|
||||
union {
|
||||
nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu;
|
||||
|
||||
+8271
-8271
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,6 @@ extern "C" {
|
||||
#include <openair2/PHY_INTERFACE/IF_Module.h>
|
||||
#include "nfapi_nr_interface.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "openair1/PHY/defs_gNB.h"
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ void *fapi_thread_start(void *ptr) {
|
||||
|
||||
if(instance->tick == 1000) {
|
||||
if(instance->tx_byte_count > 0) {
|
||||
printf("[FAPI] Tx rate %d bytes/sec\n", instance->tx_byte_count);
|
||||
printf("[FAPI] Tx rate %u bytes/sec\n", instance->tx_byte_count);
|
||||
instance->tx_byte_count = 0;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ void *fapi_thread_start(void *ptr) {
|
||||
millisec = now_ts.tv_nsec / 1e6;
|
||||
|
||||
if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec) {
|
||||
printf("*** missing millisec %d %d\n", last_millisec, millisec);
|
||||
printf("*** missing millisec %u %u\n", last_millisec, millisec);
|
||||
catchup = millisec - last_millisec - 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user