Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
776a7440
Commit
776a7440
authored
Jun 02, 2020
by
MaheshK1995
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LTE to NR conversions
parent
01751798
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
185 additions
and
90 deletions
+185
-90
executables/nr-softmodem.c
executables/nr-softmodem.c
+2
-2
nfapi/oai_integration/nfapi_pnf.c
nfapi/oai_integration/nfapi_pnf.c
+24
-18
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+10
-9
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
+56
-0
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
+1
-34
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+39
-19
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
+3
-1
nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
+5
-2
nfapi/open-nFAPI/pnf/src/pnf.c
nfapi/open-nFAPI/pnf/src/pnf.c
+18
-3
nfapi/open-nFAPI/pnf/src/pnf_interface.c
nfapi/open-nFAPI/pnf/src/pnf_interface.c
+2
-0
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
+4
-2
nfapi/open-nFAPI/vnf/src/vnf.c
nfapi/open-nFAPI/vnf/src/vnf.c
+14
-0
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+7
-0
No files found.
executables/nr-softmodem.c
View file @
776a7440
...
...
@@ -795,7 +795,7 @@ int main( int argc, char **argv )
int
ru_id
,
CC_id
=
0
;
nfapi_mode
=
(
int
)
(
argv
[
argc
-
1
][
0
]
-
'0'
);
start_background_system
();
///static configuration for NR at the moment
...
...
@@ -864,7 +864,7 @@ if(!IS_SOFTMODEM_NOS1)
AssertFatal
(
create_gNB_tasks
(
1
)
==
0
,
"cannot create ITTI tasks
\n
"
);
}
else
{
printf
(
"No ITTI, Initializing L1
\n
"
);
RCconfig_L1
();
RCconfig_
NR_
L1
();
}
/* Start the agent. If it is turned off in the configuration, it won't start */
...
...
nfapi/oai_integration/nfapi_pnf.c
View file @
776a7440
...
...
@@ -30,6 +30,9 @@
#include "debug.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "nfapi_pnf_interface.h"
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "nfapi.h"
#include "nfapi_pnf.h"
#include "common/ran_context.h"
...
...
@@ -52,6 +55,7 @@ extern RAN_CONTEXT_t RC;
#include "PHY/INIT/phy_init.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#define NUM_P5_PHY 2
...
...
@@ -452,7 +456,7 @@ int pnf_stop_request(nfapi_pnf_config_t *config, nfapi_pnf_stop_request_t *req)
return
0
;
}
int
param_request
(
nfapi_pnf_config_t
*
config
,
nfapi_pnf_phy_config_t
*
phy
,
nfapi_
param_request
_t
*
req
)
{
int
param_request
(
nfapi_pnf_config_t
*
config
,
nfapi_pnf_phy_config_t
*
phy
,
nfapi_
nr_param_request_scf
_t
*
req
)
{
printf
(
"[PNF] Received NFAPI_PARAM_REQUEST phy_id:%d
\n
"
,
req
->
header
.
phy_id
);
//pnf_info* pnf = (pnf_info*)(config->user_data);
nfapi_param_response_t
nfapi_resp
;
...
...
@@ -463,12 +467,12 @@ int param_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
nfapi_resp
.
error_code
=
0
;
// DJP - what value???
struct
sockaddr_in
pnf_p7_sockaddr
;
pnf_p7_sockaddr
.
sin_addr
.
s_addr
=
inet_addr
(
pnf
->
phys
[
0
].
local_addr
);
nfapi_resp
.
nfapi_config
.
p7_pnf_address_ipv4
.
tl
.
tag
=
NFAPI_NFAPI_P7_PNF_ADDRESS_IPV4_TAG
;
nfapi_resp
.
nfapi_config
.
p7_pnf_address_ipv4
.
tl
.
tag
=
NFAPI_N
R_N
FAPI_P7_PNF_ADDRESS_IPV4_TAG
;
memcpy
(
nfapi_resp
.
nfapi_config
.
p7_pnf_address_ipv4
.
address
,
&
pnf_p7_sockaddr
.
sin_addr
.
s_addr
,
4
);
nfapi_resp
.
num_tlv
++
;
// P7 PNF Port
nfapi_resp
.
nfapi_config
.
p7_pnf_port
.
tl
.
tag
=
NFAPI_NFAPI_P7_PNF_PORT_TAG
;
nfapi_resp
.
nfapi_config
.
p7_pnf_port
.
value
=
32123
;
// DJP - hard code alert!!!! FIXME TODO
nfapi_resp
.
nfapi_config
.
p7_pnf_port
.
tl
.
tag
=
NFAPI_N
R_N
FAPI_P7_PNF_PORT_TAG
;
nfapi_resp
.
nfapi_config
.
p7_pnf_port
.
value
=
pnf
->
phys
[
0
].
local_port
;
//
32123; // DJP - hard code alert!!!! FIXME TODO
nfapi_resp
.
num_tlv
++
;
nfapi_pnf_param_resp
(
config
,
&
nfapi_resp
);
printf
(
"[PNF] Sent NFAPI_PARAM_RESPONSE phy_id:%d number_of_tlvs:%u
\n
"
,
req
->
header
.
phy_id
,
nfapi_resp
.
num_tlv
);
...
...
@@ -476,24 +480,26 @@ int param_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
return
0
;
}
int
config_request
(
nfapi_pnf_config_t
*
config
,
nfapi_pnf_phy_config_t
*
phy
,
nfapi_
config_request
_t
*
req
)
{
int
config_request
(
nfapi_pnf_config_t
*
config
,
nfapi_pnf_phy_config_t
*
phy
,
nfapi_
nr_config_request_scf
_t
*
req
)
{
printf
(
"[PNF] Received NFAPI_CONFIG_REQ phy_id:%d
\n
"
,
req
->
header
.
phy_id
);
pnf_info
*
pnf
=
(
pnf_info
*
)(
config
->
user_data
);
uint8_t
num_tlv
=
0
;
//struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
// In the case of nfapi_mode = 3 (UE = PNF) we should not have dependency on any eNB var. So we aim
// to keep only the necessary just to keep the nfapi FSM rolling by sending a dummy response.
LTE
_DL_FRAME_PARMS
*
fp
;
NR
_DL_FRAME_PARMS
*
fp
;
if
(
NFAPI_MODE
!=
NFAPI_UE_STUB_PNF
)
{
struct
PHY_VARS_
eNB_s
*
eNB
=
RC
.
eNB
[
0
]
[
0
];
fp
=
&
e
NB
->
frame_parms
;
struct
PHY_VARS_
gNB_s
*
gNB
=
RC
.
gNB
[
0
];
fp
=
&
g
NB
->
frame_parms
;
}
else
{
fp
=
(
LTE_DL_FRAME_PARMS
*
)
malloc
(
sizeof
(
LTE
_DL_FRAME_PARMS
));
fp
=
(
NR_DL_FRAME_PARMS
*
)
malloc
(
sizeof
(
NR
_DL_FRAME_PARMS
));
}
phy_info
*
phy_info
=
pnf
->
phys
;
// TODO: change all these tags to NR
#if 0
if(req->nfapi_config.timing_window.tl.tag == NFAPI_NFAPI_TIMING_WINDOW_TAG) {
phy_info->timing_window = req->nfapi_config.timing_window.value;
printf("Phy_info:Timing window:%u NFAPI_CONFIG:timing_window:%u\n", phy_info->timing_window, req->nfapi_config.timing_window.value);
...
...
@@ -650,14 +656,14 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
printf("[PNF] CONFIG_REQUEST[num_tlv:%d] TLVs processed:%d\n", req->num_tlv, num_tlv);
printf("[PNF] Simulating PHY CONFIG - DJP\n");
PHY_Config_t
phy_config
;
phy_config
.
Mod_id
=
0
;
phy_config
.
CC_id
=
0
;
phy_config
.
cfg
=
req
;
phy_config_request
(
&
phy_config
);
dump_frame_parms
(
fp
);
}
NR_PHY_Config_t nr_
phy_config;
nr_
phy_config.Mod_id = 0;
nr_
phy_config.CC_id=0;
nr_
phy_config.cfg = req;
nr_phy_config_request(&nr_
phy_config);
nr_
dump_frame_parms(fp);
}
#endif
phy_info
->
remote_port
=
req
->
nfapi_config
.
p7_vnf_port
.
value
;
struct
sockaddr_in
vnf_p7_sockaddr
;
memcpy
(
&
vnf_p7_sockaddr
.
sin_addr
.
s_addr
,
&
(
req
->
nfapi_config
.
p7_vnf_address_ipv4
.
address
[
0
]),
4
);
...
...
@@ -674,7 +680,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
if
(
NFAPI_MODE
==
NFAPI_UE_STUB_PNF
)
free
(
fp
);
return
0
;
}
...
...
nfapi/oai_integration/nfapi_vnf.c
View file @
776a7440
...
...
@@ -39,6 +39,7 @@
#include "nfapi_vnf.h"
#include "PHY/defs_eNB.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "common/ran_context.h"
extern
RAN_CONTEXT_t
RC
;
...
...
@@ -189,7 +190,7 @@ int vnf_pack_vendor_extension_tlv(void *ve, uint8_t **ppWritePackedMsg, uint8_t
int
vnf_unpack_vendor_extension_tlv
(
nfapi_tl_t
*
tl
,
uint8_t
**
ppReadPackedMessage
,
uint8_t
*
end
,
void
**
ve
,
nfapi_p4_p5_codec_config_t
*
codec
)
{
return
-
1
;
}
void
install_nr_schedule_handlers
(
NR_IF_Module_t
*
if_inst
);
void
install_schedule_handlers
(
IF_Module_t
*
if_inst
);
extern
int
single_thread_flag
;
extern
void
init_eNB_afterRU
(
void
);
...
...
@@ -1011,14 +1012,14 @@ int pnf_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_pnf_start_re
extern
uint32_t
to_earfcn
(
int
eutra_bandP
,
uint32_t
dl_CarrierFreq
,
uint32_t
bw
);
int
param_resp_cb
(
nfapi_vnf_config_t
*
config
,
int
p5_idx
,
nfapi_
param_response
_t
*
resp
)
{
int
param_resp_cb
(
nfapi_vnf_config_t
*
config
,
int
p5_idx
,
nfapi_
nr_param_response_scf
_t
*
resp
)
{
printf
(
"[VNF] Received NFAPI_PARAM_RESP idx:%d phy_id:%d
\n
"
,
p5_idx
,
resp
->
header
.
phy_id
);
vnf_info
*
vnf
=
(
vnf_info
*
)(
config
->
user_data
);
vnf_p7_info
*
p7_vnf
=
vnf
->
p7_vnfs
;
pnf_info
*
pnf
=
vnf
->
pnfs
;
phy_info
*
phy
=
pnf
->
phys
;
struct
sockaddr_in
pnf_p7_sockaddr
;
nfapi_
config_request_t
*
req
=
&
RC
.
mac
[
0
]
->
config
[
0
];
nfapi_
nr_config_request_t
*
req
=
&
RC
.
nr
mac
[
0
]
->
config
[
0
];
phy
->
remote_port
=
resp
->
nfapi_config
.
p7_pnf_port
.
value
;
memcpy
(
&
pnf_p7_sockaddr
.
sin_addr
.
s_addr
,
&
(
resp
->
nfapi_config
.
p7_pnf_address_ipv4
.
address
[
0
]),
4
);
phy
->
remote_addr
=
inet_ntoa
(
pnf_p7_sockaddr
.
sin_addr
);
...
...
@@ -1028,28 +1029,28 @@ int param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_param_response_t
req
->
header
.
message_id
=
NFAPI_CONFIG_REQUEST
;
req
->
header
.
phy_id
=
phy
->
id
;
printf
(
"[VNF] Send NFAPI_CONFIG_REQUEST
\n
"
);
req
->
nfapi_config
.
p7_vnf_port
.
tl
.
tag
=
NFAPI_NFAPI_P7_VNF_PORT_TAG
;
req
->
nfapi_config
.
p7_vnf_port
.
tl
.
tag
=
NFAPI_N
R_N
FAPI_P7_VNF_PORT_TAG
;
req
->
nfapi_config
.
p7_vnf_port
.
value
=
p7_vnf
->
local_port
;
req
->
num_tlv
++
;
printf
(
"[VNF] DJP local_port:%d
\n
"
,
p7_vnf
->
local_port
);
req
->
nfapi_config
.
p7_vnf_address_ipv4
.
tl
.
tag
=
NFAPI_NFAPI_P7_VNF_ADDRESS_IPV4_TAG
;
req
->
nfapi_config
.
p7_vnf_address_ipv4
.
tl
.
tag
=
NFAPI_N
R_N
FAPI_P7_VNF_ADDRESS_IPV4_TAG
;
struct
sockaddr_in
vnf_p7_sockaddr
;
vnf_p7_sockaddr
.
sin_addr
.
s_addr
=
inet_addr
(
p7_vnf
->
local_addr
);
memcpy
(
&
(
req
->
nfapi_config
.
p7_vnf_address_ipv4
.
address
[
0
]),
&
vnf_p7_sockaddr
.
sin_addr
.
s_addr
,
4
);
req
->
num_tlv
++
;
printf
(
"[VNF] DJP local_addr:%s
\n
"
,
p7_vnf
->
local_addr
);
req
->
nfapi_config
.
timing_window
.
tl
.
tag
=
NFAPI_NFAPI_TIMING_WINDOW_TAG
;
req
->
nfapi_config
.
timing_window
.
tl
.
tag
=
NFAPI_N
R_N
FAPI_TIMING_WINDOW_TAG
;
req
->
nfapi_config
.
timing_window
.
value
=
p7_vnf
->
timing_window
;
printf
(
"[VNF] Timing window:%u
\n
"
,
p7_vnf
->
timing_window
);
req
->
num_tlv
++
;
if
(
p7_vnf
->
periodic_timing_enabled
||
p7_vnf
->
aperiodic_timing_enabled
)
{
req
->
nfapi_config
.
timing_info_mode
.
tl
.
tag
=
NFAPI_NFAPI_TIMING_INFO_MODE_TAG
;
req
->
nfapi_config
.
timing_info_mode
.
tl
.
tag
=
NFAPI_N
R_N
FAPI_TIMING_INFO_MODE_TAG
;
req
->
nfapi_config
.
timing_info_mode
.
value
=
(
p7_vnf
->
aperiodic_timing_enabled
<<
1
)
|
(
p7_vnf
->
periodic_timing_enabled
);
req
->
num_tlv
++
;
if
(
p7_vnf
->
periodic_timing_enabled
)
{
req
->
nfapi_config
.
timing_info_period
.
tl
.
tag
=
NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG
;
req
->
nfapi_config
.
timing_info_period
.
tl
.
tag
=
NFAPI_N
R_N
FAPI_TIMING_INFO_PERIOD_TAG
;
req
->
nfapi_config
.
timing_info_period
.
value
=
p7_vnf
->
periodic_timing_period
;
req
->
num_tlv
++
;
}
...
...
@@ -1153,7 +1154,7 @@ void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
vnf
.
p7_vnfs
[
0
].
config
=
nfapi_vnf_p7_config_create
();
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"[VNF] %s() vnf.p7_vnfs[0].config:%p VNF ADDRESS:%s:%d
\n
"
,
__FUNCTION__
,
vnf
.
p7_vnfs
[
0
].
config
,
vnf_addr
,
vnf_p5_port
);
strcpy
(
vnf
.
p7_vnfs
[
0
].
local_addr
,
vnf_addr
);
vnf
.
p7_vnfs
[
0
].
local_port
=
50001
;
vnf
.
p7_vnfs
[
0
].
local_port
=
vnf
.
p7_vnfs
[
0
].
local_port
;
// 50001; // TODO: remove hardcode
vnf
.
p7_vnfs
[
0
].
mac
=
(
mac_t
*
)
malloc
(
sizeof
(
mac_t
));
nfapi_vnf_config_t
*
config
=
nfapi_vnf_config_create
();
config
->
malloc
=
malloc
;
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h
View file @
776a7440
...
...
@@ -587,6 +587,26 @@ typedef struct {
#define NFAPI_PNF_PHY_RF_TAG 0x1003
// Generic strucutre for single tlv value.
typedef
struct
{
nfapi_tl_t
tl
;
int32_t
value
;
}
nfapi_int32_tlv_t
;
typedef
struct
{
nfapi_tl_t
tl
;
uint32_t
value
;
}
nfapi_uint32_tlv_t
;
typedef
struct
{
nfapi_tl_t
tl
;
int64_t
value
;
}
nfapi_int64_tlv_t
;
typedef
struct
{
nfapi_tl_t
tl
;
uint64_t
value
;
}
nfapi_uint64_tlv_t
;
typedef
struct
{
nfapi_tl_t
tl
;
uint16_t
value
;
...
...
@@ -3653,6 +3673,42 @@ typedef struct {
nfapi_vendor_extension_tlv_t
vendor_extension
;
}
nfapi_nmm_stop_response_t
;
typedef
struct
{
// TODO: see if this needs to be uncommented
// These TLVs are used to setup the transport connection between VNF and PNF
nfapi_ipv4_address_t
p7_vnf_address_ipv4
;
nfapi_ipv6_address_t
p7_vnf_address_ipv6
;
nfapi_uint16_tlv_t
p7_vnf_port
;
nfapi_ipv4_address_t
p7_pnf_address_ipv4
;
nfapi_ipv6_address_t
p7_pnf_address_ipv6
;
nfapi_uint16_tlv_t
p7_pnf_port
;
// // These TLVs are used to setup the transport connection between VNF and PNF
nfapi_uint8_tlv_t
dl_ue_per_sf
;
nfapi_uint8_tlv_t
ul_ue_per_sf
;
// These TLVs are used by PNF to report its RF capabilities to the VNF software
nfapi_rf_bands_t
rf_bands
;
// These TLVs are used by the VNF to configure the synchronization with the PNF.
nfapi_uint8_tlv_t
timing_window
;
nfapi_uint8_tlv_t
timing_info_mode
;
nfapi_uint8_tlv_t
timing_info_period
;
// These TLVs are used by the VNF to configure the RF in the PNF
nfapi_uint16_tlv_t
max_transmit_power
;
nfapi_uint32_tlv_t
nrarfcn
;
// nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands;
// nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands;
// nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands;
// nfapi_uint8_tlv_t nmm_uplink_rssi_supported;
}
nfapi_nr_nfapi_t
;
//
// Configuration options for the encode decode functions
//
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h
View file @
776a7440
...
...
@@ -10,7 +10,7 @@
#define _NFAPI_NR_INTERFACE_H_
#include "nfapi_interface.h"
#include
<nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h>
#include
"/home/glab/NR_nfapi/openairinterface5g/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h"
#define NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS 5
#define NFAPI_NR_MAX_NB_TCI_STATES_PDCCH 64
...
...
@@ -22,41 +22,8 @@
// nFAPI enums
//These TLVs are used exclusively by nFAPI
typedef
struct
{
// These TLVs are used to setup the transport connection between VNF and PNF
// nfapi_ipv4_address_t p7_vnf_address_ipv4;
// nfapi_ipv6_address_t p7_vnf_address_ipv6;
// nfapi_uint16_tlv_t p7_vnf_port;
// nfapi_ipv4_address_t p7_pnf_address_ipv4;
// nfapi_ipv6_address_t p7_pnf_address_ipv6;
// nfapi_uint16_tlv_t p7_pnf_port;
// // These TLVs are used to setup the transport connection between VNF and PNF
// nfapi_uint8_tlv_t dl_ue_per_sf;
// nfapi_uint8_tlv_t ul_ue_per_sf;
// These TLVs are used by PNF to report its RF capabilities to the VNF software
nfapi_rf_bands_t
rf_bands
;
// These TLVs are used by the VNF to configure the synchronization with the PNF.
// nfapi_uint8_tlv_t timing_window;
// nfapi_uint8_tlv_t timing_info_mode;
// nfapi_uint8_tlv_t timing_info_period;
// These TLVs are used by the VNF to configure the RF in the PNF
// nfapi_uint16_tlv_t max_transmit_power;
nfapi_uint32_tlv_t
nrarfcn
;
// nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands;
// nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands;
// nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands;
// nfapi_uint8_tlv_t nmm_uplink_rssi_supported;
}
nfapi_nr_nfapi_t
;
#define NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG 0x5100
#define NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG 0x5101
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
View file @
776a7440
...
...
@@ -11,6 +11,7 @@
#include "stddef.h"
#include "nfapi_interface.h"
#include "nfapi_nr_interface.h"
#define NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS 5
#define NFAPI_NR_MAX_NB_TCI_STATES_PDCCH 64
...
...
@@ -24,25 +25,7 @@
#define NFAPI_MAX_NUM_CB 8
// Extension to the generic structures for single tlv values
typedef
struct
{
nfapi_tl_t
tl
;
int32_t
value
;
}
nfapi_int32_tlv_t
;
typedef
struct
{
nfapi_tl_t
tl
;
uint32_t
value
;
}
nfapi_uint32_tlv_t
;
typedef
struct
{
nfapi_tl_t
tl
;
int64_t
value
;
}
nfapi_int64_tlv_t
;
typedef
struct
{
nfapi_tl_t
tl
;
uint64_t
value
;
}
nfapi_uint64_tlv_t
;
typedef
enum
{
NFAPI_NR_DMRS_TYPE1
=
0
,
...
...
@@ -94,6 +77,8 @@ typedef enum {
//3.3.1 PARAM
//same with nfapi_param_request_t
typedef
struct
{
nfapi_p4_p5_message_header_t
header
;
...
...
@@ -463,9 +448,39 @@ typedef struct
}
nfapi_nr_measurement_config_t
;
/* PARAM.REQUEST */
typedef
struct
{
nfapi_p4_p5_message_header_t
header
;
nfapi_vendor_extension_tlv_t
vendor_extension
;
}
nfapi_nr_param_request_scf_t
;
/* PARAM.RESPONSE */
typedef
struct
{
nfapi_p4_p5_message_header_t
header
;
nfapi_nr_param_errors_e
error_code
;
uint8_t
number_of_tlvs
;
nfapi_vendor_extension_tlv_t
vendor_extension
;
nfapi_nr_cell_param_t
cell_param
;
nfapi_nr_carrier_param_t
carrier_param
;
nfapi_nr_pdcch_param_t
pdcch_param
;
nfapi_nr_pucch_param_t
pucch_param
;
nfapi_nr_pdsch_param_t
pdsch_param
;
nfapi_nr_pusch_param_t
pusch_param
;
nfapi_nr_prach_param_t
prach_param
;
nfapi_nr_measurement_param_t
measurement_param
;
nfapi_nr_nfapi_t
nfapi_config
;
}
nfapi_nr_param_response_scf_t
;
/* CONFIG.REQUEST */
typedef
struct
{
uint8_t
num_tlv
;
nfapi_p4_p5_message_header_t
header
;
nfapi_nr_param_errors_e
error_code
;
uint8_t
num_tlv
;
nfapi_vendor_extension_tlv_t
vendor_extension
;
nfapi_nr_carrier_config_t
carrier_config
;
nfapi_nr_cell_config_t
cell_config
;
nfapi_nr_ssb_config_t
ssb_config
;
...
...
@@ -473,8 +488,13 @@ typedef struct {
nfapi_nr_ssb_table_t
ssb_table
;
nfapi_nr_tdd_table_t
tdd_table
;
nfapi_nr_measurement_config_t
measurement_config
;
nfapi_nr_nfapi_t
nfapi_config
;
}
nfapi_nr_config_request_scf_t
;
/* CONFIG.RESPONSE */
typedef
struct
{
// TODO: add here
}
nfapi_nr_config_response_scf_t
;
//------------------------------//
//3.3.3 START
...
...
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
View file @
776a7440
...
...
@@ -33,11 +33,13 @@
#include <nfapi_interface.h>
#include <nfapi.h>
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
#include <debug.h>
// Pack routines
//TODO: Add pacl/unpack fns for uint32 and uint64
static
uint8_t
pack_pnf_param_request
(
void
*
msg
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_pnf_param_request_t
*
request
=
(
nfapi_pnf_param_request_t
*
)
msg
;
...
...
nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
View file @
776a7440
...
...
@@ -25,9 +25,12 @@ extern "C" {
#include "nfapi_interface.h"
#include "debug.h"
#include <openair2/PHY_INTERFACE/IF_Module.h>
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
#include <sys/types.h>
/*! This enum is used to describe the states of the pnf
*/
typedef
enum
...
...
@@ -166,7 +169,7 @@ typedef struct nfapi_pnf_config
* The client is expected to send the PARAM.response after receiving the
* PARAM.request. This can be done in the call back.
*/
int
(
*
param_req
)(
nfapi_pnf_config_t
*
config
,
nfapi_pnf_phy_config_t
*
phy
,
nfapi_
param_request
_t
*
req
);
int
(
*
param_req
)(
nfapi_pnf_config_t
*
config
,
nfapi_pnf_phy_config_t
*
phy
,
nfapi_
nr_param_request_scf
_t
*
req
);
/*! A callback for the CONFIG.request
* \param config A pointer to the pnf configuration
...
...
@@ -178,7 +181,7 @@ typedef struct nfapi_pnf_config
* The client is expected to send the CONFIG.response after receiving the
* CONFIG.request. This can be done in the call back.
*/
int
(
*
config_req
)(
nfapi_pnf_config_t
*
config
,
nfapi_pnf_phy_config_t
*
phy
,
nfapi_
config_request
_t
*
req
);
int
(
*
config_req
)(
nfapi_pnf_config_t
*
config
,
nfapi_pnf_phy_config_t
*
phy
,
nfapi_
nr_config_request_scf
_t
*
req
);
/*! A callback for the START.request
* \param config A pointer to the pnf configuration
...
...
nfapi/open-nFAPI/pnf/src/pnf.c
View file @
776a7440
...
...
@@ -26,7 +26,8 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "pnf.h"
#define MAX_SCTP_STREAMS 16
...
...
@@ -267,7 +268,7 @@ void pnf_handle_param_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
}
else
{
nfapi_
param_request
_t
req
;
nfapi_
nr_param_request_scf
_t
req
;
nfapi_pnf_config_t
*
config
=
&
(
pnf
->
_public
);
...
...
@@ -340,7 +341,7 @@ void pnf_handle_config_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
}
else
{
nfapi_
config_request
_t
req
;
nfapi_
nr_config_request_scf
_t
req
;
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"CONFIG.request received
\n
"
);
...
...
@@ -1393,8 +1394,15 @@ int pnf_connect(pnf_t* pnf)
int
pnf_send_message
(
pnf_t
*
pnf
,
uint8_t
*
msg
,
uint32_t
len
,
uint16_t
stream
)
{
if
(
pnf
->
sctp
)
{
printf
(
"
\n
PNF SENDS:
\n
"
);
for
(
int
i
=
0
;
i
<
len
;
i
++
){
printf
(
"%d"
,
msg
[
i
]);
}
printf
(
"
\n
"
);
if
(
sctp_sendmsg
(
pnf
->
p5_sock
,
msg
,
len
,
NULL
,
0
,
42
/*config->sctp_stream_number*/
,
0
,
stream
/*P5_STREAM_ID*/
,
0
,
0
)
<
0
)
{
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"sctp_sendmsg failed errno: %d
\n
"
,
errno
);
...
...
@@ -1486,6 +1494,13 @@ int pnf_read_dispatch_message(pnf_t* pnf)
}
else
{
// print the received message
printf
(
"
\n
MESSAGE RECEIVED:
\n
"
);
for
(
int
i
=
0
;
i
<
message_size
;
i
++
){
printf
(
"%d"
,
read_buffer
[
i
]);
}
printf
(
"
\n
"
);
if
(
flags
&
MSG_NOTIFICATION
)
{
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"Notification received from %s:%u
\n
"
,
inet_ntoa
(
addr
.
sin_addr
),
ntohs
(
addr
.
sin_port
));
...
...
nfapi/open-nFAPI/pnf/src/pnf_interface.c
View file @
776a7440
...
...
@@ -19,6 +19,8 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
nfapi_pnf_config_t
*
nfapi_pnf_config_create
()
{
...
...
nfapi/open-nFAPI/vnf/public_inc/nfapi_vnf_interface.h
View file @
776a7440
...
...
@@ -19,6 +19,7 @@
#include "nfapi_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "nfapi_nr_interface.h"
#include "debug.h"
...
...
@@ -248,7 +249,7 @@ typedef struct nfapi_vnf_config
* then the substructure pointers should be set to 0 and then the client should
* use the codec_config.deallocate function to release it at a future point
*/
int
(
*
param_resp
)(
nfapi_vnf_config_t
*
config
,
int
p5_idx
,
nfapi_
param_response
_t
*
resp
);
int
(
*
param_resp
)(
nfapi_vnf_config_t
*
config
,
int
p5_idx
,
nfapi_
nr_param_response_scf
_t
*
resp
);
/*! A callback for the CONFIG.response
* \param config A pointer to the vnf configuration
...
...
@@ -266,7 +267,8 @@ typedef struct nfapi_vnf_config
* then the substructure pointers should be set to 0 and then the client should
* use the codec_config.deallocate function to release it at a future point
*/
int
(
*
config_resp
)(
nfapi_vnf_config_t
*
config
,
int
p5_idx
,
nfapi_config_response_t
*
resp
);
//TODO: Add nfapi_nr_config_response_scf_t struct
int
(
*
config_resp
)(
nfapi_vnf_config_t
*
config
,
int
p5_idx
,
nfapi_nr_config_response_scf_t
*
resp
);
/*! A callback for the START.resp
* \param config A pointer to the vnf configuration
...
...
nfapi/open-nFAPI/vnf/src/vnf.c
View file @
776a7440
...
...
@@ -24,6 +24,8 @@
#include <errno.h>
#include "vnf.h"
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
void
*
vnf_malloc
(
nfapi_vnf_config_t
*
config
,
size_t
size
)
...
...
@@ -1024,6 +1026,12 @@ 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
(
"
\n
VNF 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
);
}
else
...
...
@@ -1051,6 +1059,12 @@ 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
"
);
//NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s len:%d stream:%d\n", __FUNCTION__, len, stream);
int
result
=
sctp_sendmsg
(
pnf
->
p5_sock
,
msg
,
len
,
(
struct
sockaddr
*
)
&
pnf
->
p5_pnf_sockaddr
,
sizeof
(
pnf
->
p5_pnf_sockaddr
),
1
,
0
,
stream
,
0
,
4
);
...
...
openair1/PHY/INIT/nr_init.c
View file @
776a7440
...
...
@@ -360,6 +360,13 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) gNB->UE_stats_ptr[UE_id] = NULL;
*/
}
//Adding nr_schedule_handler
void
install_nr_schedule_handlers
(
NR_IF_Module_t
*
if_inst
)
{
if_inst
->
NR_PHY_config_req
=
nr_phy_config_request
;
if_inst
->
NR_Schedule_response
=
nr_schedule_response
;
}
/*
void install_schedule_handlers(IF_Module_t *if_inst)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment