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
lizhongxiao
OpenXG-RAN
Commits
3343d93d
Commit
3343d93d
authored
Jun 13, 2020
by
MaheshK1995
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
investigating pack/unpack
parent
fd51a5bd
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
231 additions
and
58 deletions
+231
-58
nfapi/oai_integration/nfapi_pnf.c
nfapi/oai_integration/nfapi_pnf.c
+48
-46
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+3
-2
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
+9
-0
nfapi/open-nFAPI/nfapi/src/nfapi.c
nfapi/open-nFAPI/nfapi/src/nfapi.c
+1
-1
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
+165
-6
nfapi/open-nFAPI/vnf/src/vnf_interface.c
nfapi/open-nFAPI/vnf/src/vnf_interface.c
+1
-1
openair1/PHY/INIT/nr_init.c
openair1/PHY/INIT/nr_init.c
+2
-1
openair1/PHY/NR_REFSIG/scrambling_luts.c
openair1/PHY/NR_REFSIG/scrambling_luts.c
+2
-0
openair1/PHY/defs_common.h
openair1/PHY/defs_common.h
+0
-1
No files found.
nfapi/oai_integration/nfapi_pnf.c
View file @
3343d93d
...
...
@@ -498,15 +498,14 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
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) {
if
(
req
->
nfapi_config
.
timing_window
.
tl
.
tag
==
NFAPI_NR_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
);
num_tlv
++
;
}
if(req->nfapi_config.timing_info_mode.tl.tag == NFAPI_NFAPI_TIMING_INFO_MODE_TAG) {
if
(
req
->
nfapi_config
.
timing_info_mode
.
tl
.
tag
==
NFAPI_N
R_N
FAPI_TIMING_INFO_MODE_TAG
)
{
printf
(
"timing info mode:%d
\n
"
,
req
->
nfapi_config
.
timing_info_mode
.
value
);
phy_info
->
timing_info_mode
=
req
->
nfapi_config
.
timing_info_mode
.
value
;
num_tlv
++
;
...
...
@@ -515,7 +514,7 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
printf
(
"NO timing info mode provided
\n
"
);
}
if(req->nfapi_config.timing_info_period.tl.tag == NFAPI_NFAPI_TIMING_INFO_PERIOD_TAG) {
if
(
req
->
nfapi_config
.
timing_info_period
.
tl
.
tag
==
NFAPI_N
R_N
FAPI_TIMING_INFO_PERIOD_TAG
)
{
printf
(
"timing info period provided value:%d
\n
"
,
req
->
nfapi_config
.
timing_info_period
.
value
);
phy_info
->
timing_info_period
=
req
->
nfapi_config
.
timing_info_period
.
value
;
num_tlv
++
;
...
...
@@ -523,135 +522,138 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
phy_info
->
timing_info_period
=
0
;
}
if(req->
rf_config.dl_channel_bandwidth.tl.tag == NFAPI_RF_CONFIG_DL_CHANNE
L_BANDWIDTH_TAG) {
phy_info->dl_channel_bw_support = req->rf_config.dl_channel_bandwidth.value;
fp->N_RB_DL = req->rf_config.dl_channel_bandwidth.value;
if
(
req
->
carrier_config
.
dl_bandwidth
.
tl
.
tag
==
NFAPI_NR_CONFIG_D
L_BANDWIDTH_TAG
)
{
phy_info
->
dl_channel_bw_support
=
req
->
carrier_config
.
dl_bandwidth
.
value
;
//
rf_config.dl_channel_bandwidth.value;
fp
->
N_RB_DL
=
req
->
carrier_config
.
dl_bandwidth
.
value
;
//
rf_config.dl_channel_bandwidth.value;
num_tlv
++
;
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_
RF_CONFIG_DL_CHANNE
L_BANDWIDTH_TAG N_RB_DL:%u\n", __FUNCTION__, fp->N_RB_DL);
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s() NFAPI_
NR_CONFIG_D
L_BANDWIDTH_TAG N_RB_DL:%u
\n
"
,
__FUNCTION__
,
fp
->
N_RB_DL
);
}
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() Missing NFAPI_
RF_CONFIG_DL_CHANNE
L_BANDWIDTH_TAG\n", __FUNCTION__);
NFAPI_TRACE
(
NFAPI_TRACE_ERROR
,
"%s() Missing NFAPI_
NR_CONFIG_D
L_BANDWIDTH_TAG
\n
"
,
__FUNCTION__
);
}
if(req->
rf_config.ul_channel_bandwidth.tl.tag == NFAPI_RF_CONFIG_UL_CHANNEL
_BANDWIDTH_TAG) {
phy_info->ul_channel_bw_support = req->rf_config.ul_channel_bandwidth.value;
fp->N_RB_UL = req->rf_config.ul_channel_bandwidth.value;
if
(
req
->
carrier_config
.
uplink_bandwidth
.
tl
.
tag
==
NFAPI_NR_CONFIG_UPLINK
_BANDWIDTH_TAG
)
{
phy_info
->
ul_channel_bw_support
=
req
->
carrier_config
.
uplink_bandwidth
.
value
;
//req->
rf_config.ul_channel_bandwidth.value;
fp
->
N_RB_UL
=
req
->
carrier_config
.
uplink_bandwidth
.
value
;
//req->
rf_config.ul_channel_bandwidth.value;
num_tlv
++
;
}
if(req->nfapi_config.rf_bands.tl.tag == NFAPI_NFAPI_RF_BANDS_TAG) {
if
(
req
->
nfapi_config
.
rf_bands
.
tl
.
tag
==
NFAPI_NR_NFAPI_RF_BANDS_TAG
)
{
pnf
->
rfs
[
0
].
band
=
req
->
nfapi_config
.
rf_bands
.
rf_band
[
0
];
fp->
eutra
_band = req->nfapi_config.rf_bands.rf_band[0];
fp
->
nr
_band
=
req
->
nfapi_config
.
rf_bands
.
rf_band
[
0
];
num_tlv
++
;
}
if(req->nfapi_config.
earfcn.tl.tag == NFAPI_NFAPI_E
ARFCN_TAG) {
fp->dl_CarrierFreq = from_
earfcn(fp->eutra_band, req->nfapi_config.earfcn.value);
fp->ul_CarrierFreq = fp->dl_CarrierFreq - (get_
uldl_offset(fp->eutra_band) * 1e5);
if
(
req
->
nfapi_config
.
nrarfcn
.
tl
.
tag
==
NFAPI_NR_NFAPI_NR
ARFCN_TAG
)
{
fp
->
dl_CarrierFreq
=
from_
nrarfcn
(
fp
->
nr_band
,
0
,
req
->
nfapi_config
.
nrarfcn
.
value
);
// TODO: give SCS index
fp
->
ul_CarrierFreq
=
fp
->
dl_CarrierFreq
-
(
get_
nr_uldl_offset
(
fp
->
nr_band
)
*
1e5
);
// TODO: why 1e5 ?
num_tlv
++
;
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s()
e
arfcn:%u dl_carrierFreq:%u ul_CarrierFreq:%u band:%u N_RB_DL:%u\n",
__FUNCTION__, req->nfapi_config.
e
arfcn.value, fp->dl_CarrierFreq, fp->ul_CarrierFreq, pnf->rfs[0].band, fp->N_RB_DL);
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"%s()
nr
arfcn:%u dl_carrierFreq:%u ul_CarrierFreq:%u band:%u N_RB_DL:%u
\n
"
,
__FUNCTION__
,
req
->
nfapi_config
.
nr
arfcn
.
value
,
fp
->
dl_CarrierFreq
,
fp
->
ul_CarrierFreq
,
pnf
->
rfs
[
0
].
band
,
fp
->
N_RB_DL
);
}
if (req->subframe_config.duplex_mode.tl.tag == NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG) {
#if SUBFRAME // TODO: add subframe struct to nr config request struct
if
(
req
->
subframe_config
.
duplex_mode
.
tl
.
tag
==
NFAPI_
NR_
SUBFRAME_CONFIG_DUPLEX_MODE_TAG
)
{
fp
->
frame_type
=
req
->
subframe_config
.
duplex_mode
.
value
==
0
?
TDD
:
FDD
;
num_tlv
++
;
NFAPI_TRACE
(
NFAPI_TRACE_INFO
,
"%s() frame_type:%d
\n
"
,
__FUNCTION__
,
fp
->
frame_type
);
}
if (req->subframe_config.dl_cyclic_prefix_type.tl.tag == NFAPI_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG) {
req
->
tdd_table
.
if
(
req
->
subframe_config
.
dl_cyclic_prefix_type
.
tl
.
tag
==
NFAPI_NR_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG
)
{
fp
->
Ncp
=
req
->
subframe_config
.
dl_cyclic_prefix_type
.
value
;
num_tlv
++
;
}
if (req->subframe_config.ul_cyclic_prefix_type.tl.tag == NFAPI_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG) {
if
(
req
->
subframe_config
.
ul_cyclic_prefix_type
.
tl
.
tag
==
NFAPI_
NR_
SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG
)
{
fp
->
Ncp_UL
=
req
->
subframe_config
.
ul_cyclic_prefix_type
.
value
;
num_tlv
++
;
}
fp
->
num_MBSFN_config
=
0
;
// DJP - hard code alert
#endif
if (req->
sch_config.physical_cell_id.tl.tag == NFAPI_SCH_CONFIG_PHYSICAL
_CELL_ID_TAG) {
fp->Nid_cell = req->sch_config.physical_cell_id.value;
if
(
req
->
cell_config
.
phy_cell_id
.
tl
.
tag
==
NFAPI_NR_CONFIG_PHY
_CELL_ID_TAG
)
{
fp
->
Nid_cell
=
req
->
cell_config
.
phy_cell_id
.
value
;
//
sch_config.physical_cell_id.value;
fp
->
nushift
=
fp
->
Nid_cell
%
6
;
num_tlv
++
;
}
if (req->rf_config.tx_antenna_ports.tl.tag == NFAPI_RF_CONFIG_TX_ANTENNA_PORTS_TAG) {
#if LTE
if
(
req
->
rf_config
.
tx_antenna_ports
.
tl
.
tag
==
NFAPI_
NR_
RF_CONFIG_TX_ANTENNA_PORTS_TAG
)
{
fp
->
nb_antennas_tx
=
req
->
rf_config
.
tx_antenna_ports
.
value
;
fp
->
nb_antenna_ports_eNB
=
1
;
num_tlv
++
;
}
if (req->rf_config.rx_antenna_ports.tl.tag == NFAPI_RF_CONFIG_RX_ANTENNA_PORTS_TAG) {
if
(
req
->
rf_config
.
rx_antenna_ports
.
tl
.
tag
==
NFAPI_
NR_
RF_CONFIG_RX_ANTENNA_PORTS_TAG
)
{
fp
->
nb_antennas_rx
=
req
->
rf_config
.
rx_antenna_ports
.
value
;
num_tlv
++
;
}
if (req->phich_config.phich_resource.tl.tag == NFAPI_PHICH_CONFIG_PHICH_RESOURCE_TAG) {
if
(
req
->
phich_config
.
phich_resource
.
tl
.
tag
==
NFAPI_
NR_
PHICH_CONFIG_PHICH_RESOURCE_TAG
)
{
fp
->
phich_config_common
.
phich_resource
=
req
->
phich_config
.
phich_resource
.
value
;
num_tlv
++
;
}
if (req->phich_config.phich_duration.tl.tag == NFAPI_PHICH_CONFIG_PHICH_DURATION_TAG) {
if
(
req
->
phich_config
.
phich_duration
.
tl
.
tag
==
NFAPI_
NR_
PHICH_CONFIG_PHICH_DURATION_TAG
)
{
fp
->
phich_config_common
.
phich_duration
=
req
->
phich_config
.
phich_duration
.
value
;
num_tlv
++
;
}
if (req->phich_config.phich_power_offset.tl.tag == NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG) {
if
(
req
->
phich_config
.
phich_power_offset
.
tl
.
tag
==
NFAPI_
NR_
PHICH_CONFIG_PHICH_POWER_OFFSET_TAG
)
{
LOG_E
(
PHY
,
"%s() NFAPI_PHICH_CONFIG_PHICH_POWER_OFFSET_TAG tag:%d not supported
\n
"
,
__FUNCTION__
,
req
->
phich_config
.
phich_power_offset
.
tl
.
tag
);
//fp->phich_config_common.phich_power_offset = req->phich_config.
num_tlv
++
;
}
// UL RS Config
if (req->uplink_reference_signal_config.cyclic_shift_1_for_drms.tl.tag == NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG) {
if
(
req
->
uplink_reference_signal_config
.
cyclic_shift_1_for_drms
.
tl
.
tag
==
NFAPI_
NR_
UPLINK_REFERENCE_SIGNAL_CONFIG_CYCLIC_SHIFT_1_FOR_DRMS_TAG
)
{
fp
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
cyclicShift
=
req
->
uplink_reference_signal_config
.
cyclic_shift_1_for_drms
.
value
;
num_tlv
++
;
}
if (req->uplink_reference_signal_config.uplink_rs_hopping.tl.tag == NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG) {
if
(
req
->
uplink_reference_signal_config
.
uplink_rs_hopping
.
tl
.
tag
==
NFAPI_
NR_
UPLINK_REFERENCE_SIGNAL_CONFIG_UPLINK_RS_HOPPING_TAG
)
{
fp
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
groupHoppingEnabled
=
req
->
uplink_reference_signal_config
.
uplink_rs_hopping
.
value
;
num_tlv
++
;
}
if (req->uplink_reference_signal_config.group_assignment.tl.tag == NFAPI_UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG) {
if
(
req
->
uplink_reference_signal_config
.
group_assignment
.
tl
.
tag
==
NFAPI_
NR_
UPLINK_REFERENCE_SIGNAL_CONFIG_GROUP_ASSIGNMENT_TAG
)
{
fp
->
pusch_config_common
.
ul_ReferenceSignalsPUSCH
.
groupAssignmentPUSCH
=
req
->
uplink_reference_signal_config
.
group_assignment
.
value
;
num_tlv
++
;
}
if (req->pusch_config.hopping_mode.tl.tag == NFAPI_PUSCH_CONFIG_HOPPING_MODE_TAG) {
if
(
req
->
pusch_config
.
hopping_mode
.
tl
.
tag
==
NFAPI_
NR_
PUSCH_CONFIG_HOPPING_MODE_TAG
)
{
}
// DJP - not being handled?
if (req->pusch_config.hopping_offset.tl.tag == NFAPI_PUSCH_CONFIG_HOPPING_OFFSET_TAG) {
if
(
req
->
pusch_config
.
hopping_offset
.
tl
.
tag
==
NFAPI_
NR_
PUSCH_CONFIG_HOPPING_OFFSET_TAG
)
{
}
// DJP - not being handled?
if (req->pusch_config.number_of_subbands.tl.tag == NFAPI_PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG) {
if
(
req
->
pusch_config
.
number_of_subbands
.
tl
.
tag
==
NFAPI_
NR_
PUSCH_CONFIG_NUMBER_OF_SUBBANDS_TAG
)
{
}
// DJP - not being handled?
if (req->prach_config.configuration_index.tl.tag == NFAPI_PRACH_CONFIG_CONFIGURATION_INDEX_TAG) {
if
(
req
->
prach_config
.
configuration_index
.
tl
.
tag
==
NFAPI_
NR_
PRACH_CONFIG_CONFIGURATION_INDEX_TAG
)
{
fp
->
prach_config_common
.
prach_ConfigInfo
.
prach_ConfigIndex
=
req
->
prach_config
.
configuration_index
.
value
;
num_tlv
++
;
}
if (req->prach_config.root_sequence_index.tl.tag == NFAPI_PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG) {
if
(
req
->
prach_config
.
root_sequence_index
.
tl
.
tag
==
NFAPI_
NR_
PRACH_CONFIG_ROOT_SEQUENCE_INDEX_TAG
)
{
fp
->
prach_config_common
.
rootSequenceIndex
=
req
->
prach_config
.
root_sequence_index
.
value
;
num_tlv
++
;
}
if (req->prach_config.zero_correlation_zone_configuration.tl.tag == NFAPI_PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG) {
if
(
req
->
prach_config
.
zero_correlation_zone_configuration
.
tl
.
tag
==
NFAPI_
NR_
PRACH_CONFIG_ZERO_CORRELATION_ZONE_CONFIGURATION_TAG
)
{
fp
->
prach_config_common
.
prach_ConfigInfo
.
zeroCorrelationZoneConfig
=
req
->
prach_config
.
zero_correlation_zone_configuration
.
value
;
num_tlv
++
;
}
if (req->prach_config.high_speed_flag.tl.tag == NFAPI_PRACH_CONFIG_HIGH_SPEED_FLAG_TAG) {
if
(
req
->
prach_config
.
high_speed_flag
.
tl
.
tag
==
NFAPI_
NR_
PRACH_CONFIG_HIGH_SPEED_FLAG_TAG
)
{
fp
->
prach_config_common
.
prach_ConfigInfo
.
highSpeedFlag
=
req
->
prach_config
.
high_speed_flag
.
value
;
num_tlv
++
;
}
if (req->prach_config.frequency_offset.tl.tag == NFAPI_PRACH_CONFIG_FREQUENCY_OFFSET_TAG) {
if
(
req
->
prach_config
.
frequency_offset
.
tl
.
tag
==
NFAPI_
NR_
PRACH_CONFIG_FREQUENCY_OFFSET_TAG
)
{
fp
->
prach_config_common
.
prach_ConfigInfo
.
prach_FreqOffset
=
req
->
prach_config
.
frequency_offset
.
value
;
num_tlv
++
;
}
#endif
if
(
NFAPI_MODE
!=
NFAPI_UE_STUB_PNF
)
{
printf
(
"[PNF] CONFIG_REQUEST[num_tlv:%d] TLVs processed:%d
\n
"
,
req
->
num_tlv
,
num_tlv
);
...
...
@@ -663,7 +665,6 @@ int config_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfap
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
);
...
...
@@ -995,6 +996,7 @@ int pnf_sim_pack_vendor_extention_tlv(void *ve, uint8_t **ppWritePackedMsg, uint
//printf("%s\n", __FUNCTION__);
(
void
)
ve
;
(
void
)
ppWritePackedMsg
;
return
-
1
;
}
...
...
nfapi/oai_integration/nfapi_vnf.c
View file @
3343d93d
...
...
@@ -1019,7 +1019,8 @@ int param_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_param_respons
pnf_info
*
pnf
=
vnf
->
pnfs
;
phy_info
*
phy
=
pnf
->
phys
;
struct
sockaddr_in
pnf_p7_sockaddr
;
nfapi_nr_config_request_scf_t
*
req
=
&
RC
.
nrmac
[
0
]
->
config
[
0
];
nfapi_nr_config_request_scf_t
*
req
=
&
RC
.
nrmac
[
0
]
->
config
[
0
];
// check
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
);
...
...
nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h
View file @
3343d93d
...
...
@@ -473,6 +473,9 @@ typedef struct {
nfapi_nr_nfapi_t
nfapi_config
;
}
nfapi_nr_param_response_scf_t
;
//------------------------------//
//3.3.2 CONFIG
/* CONFIG.REQUEST */
typedef
struct
{
nfapi_p4_p5_message_header_t
header
;
...
...
@@ -491,9 +494,15 @@ typedef struct {
nfapi_nr_nfapi_t
nfapi_config
;
}
nfapi_nr_config_request_scf_t
;
/* CONFIG.RESPONSE */
typedef
struct
{
// TODO: add here
nfapi_p4_p5_message_header_t
header
;
nfapi_nr_param_errors_e
error_code
;
uint8_t
num_invalid_tlvs
;
nfapi_vendor_extension_tlv_t
vendor_extension
;
}
nfapi_nr_config_response_scf_t
;
//------------------------------//
...
...
nfapi/open-nFAPI/nfapi/src/nfapi.c
View file @
3343d93d
...
...
@@ -712,7 +712,7 @@ int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPa
for
(
idx
=
0
;
idx
<
size
;
++
idx
)
{
if
(
unpack_fns
[
idx
].
tag
==
generic_tl
.
tag
)
if
(
unpack_fns
[
idx
].
tag
==
generic_tl
.
tag
)
// match the extracted tag value with all the tags in unpack_fn list
{
tagMatch
=
1
;
nfapi_tl_t
*
tl
=
(
nfapi_tl_t
*
)(
unpack_fns
[
idx
].
tlv
);
...
...
nfapi/open-nFAPI/nfapi/src/nfapi_p5.c
View file @
3343d93d
...
...
@@ -322,6 +322,31 @@ static uint8_t pack_param_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t
return
(
pack_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
));
}
static
uint8_t
pack_uint32_tlv_value
(
void
*
tlv
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
)
{
nfapi_uint32_tlv_t
*
value
=
(
nfapi_uint32_tlv_t
*
)
tlv
;
return
push32
(
value
->
value
,
ppWritePackedMsg
,
end
);
}
static
uint8_t
unpack_uint32_tlv_value
(
void
*
tlv
,
uint8_t
**
ppReadPackedMsg
,
uint8_t
*
end
)
{
nfapi_uint32_tlv_t
*
value
=
(
nfapi_uint32_tlv_t
*
)
tlv
;
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
)
{
nfapi_uint16_tlv_t
*
value
=
(
nfapi_uint16_tlv_t
*
)
tlv
;
...
...
@@ -333,6 +358,7 @@ static uint8_t unpack_uint16_tlv_value(void* tlv, uint8_t **ppReadPackedMsg, uin
nfapi_uint16_tlv_t
*
value
=
(
nfapi_uint16_tlv_t
*
)
tlv
;
return
pull16
(
ppReadPackedMsg
,
&
value
->
value
,
end
);
}
static
uint8_t
pack_int16_tlv_value
(
void
*
tlv
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
)
{
nfapi_int16_tlv_t
*
value
=
(
nfapi_int16_tlv_t
*
)
tlv
;
...
...
@@ -521,7 +547,8 @@ static uint8_t pack_param_response(void *msg, uint8_t **ppWritePackedMsg, uint8_
pack_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
));
#if 0
#if LTE
{
return
(
push8
(
pNfapiMsg
->
error_code
,
ppWritePackedMsg
,
end
)
&&
push8
(
pNfapiMsg
->
num_tlv
,
ppWritePackedMsg
,
end
)
&&
pack_tlv
(
NFAPI_L1_STATUS_PHY_STATE_TAG
,
&
pNfapiMsg
->
l1_status
.
phy_state
,
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
...
...
@@ -627,14 +654,77 @@ static uint8_t pack_param_response(void *msg, uint8_t **ppWritePackedMsg, uint8_
pack_tlv
(
NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
nmm_lte_frequency_bands
),
ppWritePackedMsg
,
end
,
&
pack_nmm_frequency_bands_value
)
&&
pack_tlv
(
NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
nmm_uplink_rssi_supported
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
)
);
}
#endif
}
static
uint8_t
pack_config_request
(
void
*
msg
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_config_request_t
*
pNfapiMsg
=
(
nfapi_config_request_t
*
)
msg
;
printf
(
"
\n\n
Entering pack_config_request
\n
"
);
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
)
&&
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
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_DL_K0_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
dl_k0
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
frequency_shift_7p5khz
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_NUM_RX_ANT_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
num_rx_ant
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_NUM_TX_ANT_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
num_tx_ant
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_UL_GRID_SIZE_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
ul_grid_size
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_UL_K0_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
ul_k0
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
uplink_bandwidth
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
uplink_frequency
),
ppWritePackedMsg
,
end
,
&
pack_uint32_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG
,
&
(
pNfapiMsg
->
cell_config
.
frame_duplex_type
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_PHY_CELL_ID_TAG
,
&
(
pNfapiMsg
->
cell_config
.
phy_cell_id
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG
,
&
(
pNfapiMsg
->
measurement_config
.
rssi_measurement
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG
,
&
(
pNfapiMsg
->
prach_config
.
num_prach_fd_occasions
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG
,
&
(
pNfapiMsg
->
prach_config
.
prach_multiple_carriers_in_a_band
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG
,
&
(
pNfapiMsg
->
prach_config
.
prach_sequence_length
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG
,
&
(
pNfapiMsg
->
prach_config
.
restricted_set_config
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_SSB_PER_RACH_TAG
,
&
(
pNfapiMsg
->
prach_config
.
ssb_per_rach
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG
,
&
(
pNfapiMsg
->
prach_config
.
prach_sub_c_spacing
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG
,
&
(
pNfapiMsg
->
ssb_config
.
bch_payload
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_SCS_COMMON_TAG
,
&
(
pNfapiMsg
->
ssb_config
.
scs_common
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG
,
&
(
pNfapiMsg
->
ssb_config
.
ss_pbch_power
),
ppWritePackedMsg
,
end
,
&
pack_uint32_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_BETA_PSS_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
beta_pss
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_MIB_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
MIB
),
ppWritePackedMsg
,
end
,
&
pack_uint32_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
multiple_cells_ss_pbch_in_a_carrier
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
ss_pbch_multiple_carriers_in_a_band
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
//pack_tlv(NFAPI_NR_CONFIG_BEAM_ID_TAG, &(pNfapiMsg->ssb_table.ssb_beam_id_list->beam_id), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
//pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list->ssb_mask), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv
(
NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
ssb_offset_point_a
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_SSB_PERIOD_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
ssb_period
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
ssb_subcarrier_offset
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_CONFIG_TDD_PERIOD_TAG
,
&
(
pNfapiMsg
->
tdd_table
.
tdd_period
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
dl_ue_per_sf
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
max_transmit_power
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_NRARFCN_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
nrarfcn
),
ppWritePackedMsg
,
end
,
&
pack_uint32_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
p7_pnf_address_ipv4
),
ppWritePackedMsg
,
end
,
&
pack_ipv4_address_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
p7_pnf_address_ipv6
),
ppWritePackedMsg
,
end
,
&
pack_ipv6_address_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_P7_PNF_PORT_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
p7_pnf_port
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
p7_vnf_address_ipv4
),
ppWritePackedMsg
,
end
,
&
pack_ipv4_address_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
p7_vnf_address_ipv6
),
ppWritePackedMsg
,
end
,
&
pack_ipv6_address_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_P7_VNF_PORT_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
p7_vnf_port
),
ppWritePackedMsg
,
end
,
&
pack_uint16_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_RF_BANDS_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
rf_bands
),
ppWritePackedMsg
,
end
,
&
pack_rf_bands_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
timing_info_mode
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
timing_info_period
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_TIMING_WINDOW_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
timing_window
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_tlv
(
NFAPI_NR_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
ul_ue_per_sf
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
)
);
return
(
push8
(
pNfapiMsg
->
num_tlv
,
ppWritePackedMsg
,
end
)
&&
#if LTE
{
push8
(
pNfapiMsg
->
num_tlv
,
ppWritePackedMsg
,
end
)
&&
// Do we check the phy state and then just fill those sepecified, however
// we do not know the duplex mode, so just attempt to pack all and assumme
...
...
@@ -759,8 +849,11 @@ static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_
pack_tlv
(
NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
nmm_lte_frequency_bands
),
ppWritePackedMsg
,
end
,
&
pack_nmm_frequency_bands_value
)
&&
pack_tlv
(
NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG
,
&
(
pNfapiMsg
->
nfapi_config
.
nmm_uplink_rssi_supported
),
ppWritePackedMsg
,
end
,
&
pack_uint8_tlv_value
)
&&
pack_vendor_extension_tlv
(
pNfapiMsg
->
vendor_extension
,
ppWritePackedMsg
,
end
,
config
)
);
}
#endif
}
static
uint8_t
pack_config_response
(
void
*
msg
,
uint8_t
**
ppWritePackedMsg
,
uint8_t
*
end
,
nfapi_p4_p5_codec_config_t
*
config
)
{
...
...
@@ -1408,7 +1501,7 @@ static uint8_t unpack_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, vo
{
NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG
,
&
pNfapiMsg
->
nfapi_config
.
timing_info_period
,
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG
,
&
pNfapiMsg
->
nfapi_config
.
max_transmit_power
,
&
unpack_uint16_tlv_value
}
};
#if LTE
#if LTE
{
NFAPI_L1_STATUS_PHY_STATE_TAG
,
&
pNfapiMsg
->
l1_status
.
phy_state
,
&
unpack_uint16_tlv_value
},
{
NFAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG
,
&
pNfapiMsg
->
phy_capabilities
.
dl_bandwidth_support
,
&
unpack_uint16_tlv_value
},
...
...
@@ -1495,6 +1588,17 @@ static uint8_t unpack_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, vo
};
#endif
// print ppReadPackedMsg
uint8_t
*
ptr
=
*
ppReadPackedMsg
;
printf
(
"
\n
Read message: "
);
while
(
ptr
<
end
){
printf
(
" %d "
,
*
ptr
);
ptr
++
;
}
printf
(
"
\n
"
);
return
(
pull8
(
ppReadPackedMsg
,
&
pNfapiMsg
->
error_code
,
end
)
&&
pull8
(
ppReadPackedMsg
,
&
pNfapiMsg
->
num_tlv
,
end
)
&&
unpack_tlv_list
(
unpack_fns
,
sizeof
(
unpack_fns
)
/
sizeof
(
unpack_tlv_t
),
ppReadPackedMsg
,
end
,
config
,
&
pNfapiMsg
->
vendor_extension
));
...
...
@@ -1503,9 +1607,56 @@ static uint8_t unpack_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, vo
static
uint8_t
unpack_config_request
(
uint8_t
**
ppReadPackedMsg
,
uint8_t
*
end
,
void
*
msg
,
nfapi_p4_p5_codec_config_t
*
config
)
{
nfapi_
config_request_t
*
pNfapiMsg
=
(
nfapi_config_request
_t
*
)
msg
;
nfapi_
nr_config_request_scf_t
*
pNfapiMsg
=
(
nfapi_nr_config_request_scf
_t
*
)
msg
;
unpack_tlv_t
unpack_fns
[]
=
{
{
NFAPI_NR_CONFIG_DL_FREQUENCY_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
dl_frequency
),
&
unpack_uint32_tlv_value
},
{
NFAPI_NR_CONFIG_DL_GRID_SIZE_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
dl_grid_size
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_DL_K0_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
dl_k0
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
frequency_shift_7p5khz
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_NUM_RX_ANT_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
num_rx_ant
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_NUM_TX_ANT_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
num_tx_ant
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_UL_GRID_SIZE_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
ul_grid_size
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_UL_K0_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
ul_k0
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
uplink_bandwidth
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG
,
&
(
pNfapiMsg
->
carrier_config
.
uplink_frequency
),
&
unpack_uint32_tlv_value
},
{
NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG
,
&
(
pNfapiMsg
->
cell_config
.
frame_duplex_type
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_PHY_CELL_ID_TAG
,
&
(
pNfapiMsg
->
cell_config
.
phy_cell_id
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG
,
&
(
pNfapiMsg
->
measurement_config
.
rssi_measurement
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG
,
&
(
pNfapiMsg
->
prach_config
.
num_prach_fd_occasions
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG
,
&
(
pNfapiMsg
->
prach_config
.
prach_multiple_carriers_in_a_band
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG
,
&
(
pNfapiMsg
->
prach_config
.
prach_sequence_length
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG
,
&
(
pNfapiMsg
->
prach_config
.
restricted_set_config
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_SSB_PER_RACH_TAG
,
&
(
pNfapiMsg
->
prach_config
.
ssb_per_rach
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG
,
&
(
pNfapiMsg
->
prach_config
.
prach_sub_c_spacing
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG
,
&
(
pNfapiMsg
->
ssb_config
.
bch_payload
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_SCS_COMMON_TAG
,
&
(
pNfapiMsg
->
ssb_config
.
scs_common
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG
,
&
(
pNfapiMsg
->
ssb_config
.
ss_pbch_power
),
&
unpack_uint32_tlv_value
},
{
NFAPI_NR_CONFIG_BETA_PSS_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
beta_pss
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_MIB_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
MIB
),
&
unpack_uint32_tlv_value
},
{
NFAPI_NR_CONFIG_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
multiple_cells_ss_pbch_in_a_carrier
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
ss_pbch_multiple_carriers_in_a_band
),
&
unpack_uint8_tlv_value
},
{
NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
ssb_offset_point_a
),
&
unpack_uint16_tlv_value
},
{
NFAPI_NR_CONFIG_SSB_PERIOD_TAG
,
&
(
pNfapiMsg
->
ssb_table
.
ssb_period
),
&
unpack_uint8_tlv_value
},
{
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_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
},
};
#if LTE
{
{
NFAPI_SUBFRAME_CONFIG_DUPLEX_MODE_TAG
,
&
pNfapiMsg
->
subframe_config
.
duplex_mode
,
&
unpack_uint16_tlv_value
},
{
NFAPI_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG
,
&
pNfapiMsg
->
subframe_config
.
pcfich_power_offset
,
&
unpack_uint16_tlv_value
},
...
...
@@ -1622,7 +1773,7 @@ static uint8_t unpack_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
{
NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG
,
&
pNfapiMsg
->
nfapi_config
.
nmm_uplink_rssi_supported
,
&
unpack_uint8_tlv_value
},
};
#endif
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
));
...
...
@@ -1880,6 +2031,14 @@ int nfapi_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
return
-
1
;
}
uint8_t
*
ptr
=
pReadPackedMessage
;
printf
(
"
\n
Read message: "
);
while
(
ptr
<
end
){
printf
(
" %d "
,
*
ptr
);
ptr
++
;
}
printf
(
"
\n
"
);
// clean the supplied buffer for - tag value blanking
(
void
)
memset
(
pUnpackedBuf
,
0
,
unpackedBufLen
);
...
...
nfapi/open-nFAPI/vnf/src/vnf_interface.c
View file @
3343d93d
...
...
@@ -546,7 +546,7 @@ int nfapi_vnf_config_req(nfapi_vnf_config_t* config, int p5_idx, nfapi_nr_config
if
(
phy
==
NULL
)
{
NFAPI_TRACE
(
NFAPI_TRACE_WARN
,
"%s failed to find phy inforation phy_id:%d
\n
"
,
__FUNCTION__
,
req
->
header
.
phy_id
);
NFAPI_TRACE
(
NFAPI_TRACE_WARN
,
"%s failed to find phy infor
m
ation phy_id:%d
\n
"
,
__FUNCTION__
,
req
->
header
.
phy_id
);
return
-
1
;
}
...
...
openair1/PHY/INIT/nr_init.c
View file @
3343d93d
...
...
@@ -463,13 +463,14 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
fp
->
dl_CarrierFreq
=
((
dl_bw_khz
>>
1
)
+
gNB_config
->
carrier_config
.
dl_frequency
.
value
)
*
1000
;
int32_t
dlul_offset
=
0
;
lte_frame_type_t
frame_type
=
0
;
lte_frame_type_t
frame_type
=
0
;
// FDD
get_band
(
fp
->
dl_CarrierFreq
,
&
fp
->
nr_band
,
&
dlul_offset
,
&
frame_type
);
uint64_t
ul_bw_khz
=
(
12
*
gNB_config
->
carrier_config
.
ul_grid_size
[
gNB_config
->
ssb_config
.
scs_common
.
value
].
value
)
*
(
15
<<
gNB_config
->
ssb_config
.
scs_common
.
value
);
fp
->
ul_CarrierFreq
=
((
ul_bw_khz
>>
1
)
+
gNB_config
->
carrier_config
.
uplink_frequency
.
value
)
*
1000
;
printf
(
"
\n
%d
\t
%d
\t
%d
\n
"
,
fp
->
ul_CarrierFreq
,
fp
->
dl_CarrierFreq
,
dlul_offset
);
AssertFatal
(
fp
->
ul_CarrierFreq
==
(
fp
->
dl_CarrierFreq
+
dlul_offset
),
"Disagreement in uplink frequency for band %d
\n
"
,
fp
->
nr_band
);
fp
->
threequarter_fs
=
openair0_cfg
[
0
].
threequarter_fs
;
...
...
openair1/PHY/NR_REFSIG/scrambling_luts.c
View file @
3343d93d
...
...
@@ -42,6 +42,7 @@ void init_byte2m64(void) {
byte2m64_im
[
s
]
=
_mm_insert_pi16
(
byte2m64_im
[
s
],(
1
-
2
*
((
s
>>
5
)
&
1
)),
2
);
byte2m64_re
[
s
]
=
_mm_insert_pi16
(
byte2m64_re
[
s
],(
1
-
2
*
((
s
>>
6
)
&
1
)),
3
);
byte2m64_im
[
s
]
=
_mm_insert_pi16
(
byte2m64_im
[
s
],(
1
-
2
*
((
s
>>
7
)
&
1
)),
3
);
/*
printf("init_scrambling_luts: s %x (%d) ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
((uint16_t*)&s)[0],
(1-2*(s&1)),
...
...
@@ -49,6 +50,7 @@ void init_byte2m64(void) {
((int16_t*)&byte2m64_re[s])[1],((int16_t*)&byte2m64_im[s])[1],
((int16_t*)&byte2m64_re[s])[2],((int16_t*)&byte2m64_im[s])[2],
((int16_t*)&byte2m64_re[s])[3],((int16_t*)&byte2m64_im[s])[3]);
*/
}
}
...
...
openair1/PHY/defs_common.h
View file @
3343d93d
...
...
@@ -99,7 +99,6 @@
#define NB_RX_ANTENNAS_MAX 64
typedef
enum
{
TDD
=
1
,
FDD
=
0
}
lte_frame_type_t
;
typedef
enum
{
EXTENDED
=
1
,
NORMAL
=
0
}
lte_prefix_type_t
;
...
...
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