NVIDIA Aerial Integration
- Aerial config file - Changes for ARC1.1. Change config file to max MCS 25. Fixed pdu size errors. - Remove taskset from Dockerfile.gNB.aerial.ubuntu20 after changing isolated CPUs - removed the USRP from Docker file Co-authored-by: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Co-authored-by: Fredrik Molander <fmolander@nvidia.com> Co-authored-by: Reem Bahsoun <reem.bahsoun@openairinterface.org>
This commit is contained in:
committed by
Robert Schmidt
co-authored by
Florian Kaltenberger
Fredrik Molander
Reem Bahsoun
parent
ed65b52c3c
commit
8150a47ba5
@@ -328,6 +328,7 @@ typedef struct
|
||||
#define NFAPI_NR_CONFIG_SLOT_CONFIG_TAG 0x1027
|
||||
|
||||
#define NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG 0x1028
|
||||
#define NFAPI_NR_CONFIG_TDD_TABLE 0x1035
|
||||
|
||||
//table 3-21
|
||||
typedef struct
|
||||
@@ -1467,11 +1468,9 @@ typedef enum {
|
||||
|
||||
//table 3-58
|
||||
#define NFAPI_NR_MAX_TX_REQUEST_TLV 2
|
||||
typedef struct {
|
||||
uint16_t PDU_length; // SCF 222.10.02 The total length (in bytes) of the PDU description and PDU data, without the padding bytes.
|
||||
// (2 bytes PDU_Length + 2 bytes PDU_Index + 4 bytes num_TLV + TLV size ( 2 bytes tag + 2 bytes length +
|
||||
// value size without padding))
|
||||
// TBS + 12
|
||||
typedef struct
|
||||
{
|
||||
uint32_t PDU_length;
|
||||
uint16_t PDU_index;
|
||||
uint32_t num_TLV;
|
||||
nfapi_nr_tx_data_request_tlv_t TLVs[NFAPI_NR_MAX_TX_REQUEST_TLV];
|
||||
@@ -1505,7 +1504,7 @@ typedef struct
|
||||
uint32_t handle;
|
||||
uint16_t rnti;
|
||||
uint8_t harq_id;
|
||||
uint16_t pdu_length;
|
||||
uint32_t pdu_length;// For Aerial, RX_DATA.indication PDULength is changed to 32 bit field
|
||||
uint8_t ul_cqi;
|
||||
uint16_t timing_advance;//Timing advance 𝑇𝐴 measured for the UE [TS 38.213, Section 4.2] NTA_new = NTA_old + (TA − 31) ⋅ 16 ⋅ 64⁄2μ Value: 0 → 63 0xffff should be set if this field is invalid
|
||||
uint16_t rssi;
|
||||
|
||||
@@ -102,8 +102,13 @@ uint8_t push16(uint16_t in, uint8_t **out, uint8_t *end) {
|
||||
uint8_t *pOut = *out;
|
||||
|
||||
if((end - pOut) >= 2) {
|
||||
#ifdef FAPI_BYTE_ORDERING_BIG_ENDIAN
|
||||
pOut[1] = (in & 0xFF00) >> 8;
|
||||
pOut[0] = (in & 0xFF);
|
||||
#else
|
||||
pOut[0] = (in & 0xFF00) >> 8;
|
||||
pOut[1] = (in & 0xFF);
|
||||
#endif
|
||||
(*out)+=2;
|
||||
return 2;
|
||||
} else {
|
||||
@@ -117,8 +122,13 @@ uint8_t pushs16(int16_t in, uint8_t **out, uint8_t *end) {
|
||||
uint8_t *pOut = *out;
|
||||
|
||||
if((end - pOut) >= 2) {
|
||||
#ifdef FAPI_BYTE_ORDERING_BIG_ENDIAN
|
||||
pOut[1] = (in & 0xFF00) >> 8;
|
||||
pOut[0] = (in & 0xFF);
|
||||
#else
|
||||
pOut[0] = (in & 0xFF00) >> 8;
|
||||
pOut[1] = (in & 0xFF);
|
||||
#endif
|
||||
(*out)+=2;
|
||||
return 2;
|
||||
} else {
|
||||
@@ -132,10 +142,17 @@ uint8_t push32(uint32_t in, uint8_t **out, uint8_t *end) {
|
||||
uint8_t *pOut = *out;
|
||||
|
||||
if((end - pOut) >= 4) {
|
||||
#ifdef FAPI_BYTE_ORDERING_BIG_ENDIAN
|
||||
pOut[3] = (in & 0xFF000000) >> 24;
|
||||
pOut[2] = (in & 0xFF0000) >> 16;
|
||||
pOut[1] = (in & 0xFF00) >> 8;
|
||||
pOut[0] = (in & 0xFF);
|
||||
#else
|
||||
pOut[0] = (in & 0xFF000000) >> 24;
|
||||
pOut[1] = (in & 0xFF0000) >> 16;
|
||||
pOut[2] = (in & 0xFF00) >> 8;
|
||||
pOut[3] = (in & 0xFF);
|
||||
#endif
|
||||
(*out)+=4;
|
||||
return 4;
|
||||
} else {
|
||||
@@ -149,10 +166,17 @@ uint8_t pushs32(int32_t in, uint8_t **out, uint8_t *end) {
|
||||
uint8_t *pOut = *out;
|
||||
|
||||
if((end - pOut) >= 4) {
|
||||
#ifdef FAPI_BYTE_ORDERING_BIG_ENDIAN
|
||||
pOut[3] = (in & 0xFF000000) >> 24;
|
||||
pOut[2] = (in & 0xFF0000) >> 16;
|
||||
pOut[1] = (in & 0xFF00) >> 8;
|
||||
pOut[0] = (in & 0xFF);
|
||||
#else
|
||||
pOut[0] = (in & 0xFF000000) >> 24;
|
||||
pOut[1] = (in & 0xFF0000) >> 16;
|
||||
pOut[2] = (in & 0xFF00) >> 8;
|
||||
pOut[3] = (in & 0xFF);
|
||||
#endif
|
||||
(*out)+=4;
|
||||
return 4;
|
||||
} else {
|
||||
@@ -194,7 +218,11 @@ uint8_t pull16(uint8_t **in, uint16_t *out, uint8_t *end) {
|
||||
uint8_t *pIn = *in;
|
||||
|
||||
if((end - pIn) >=2 ) {
|
||||
#ifdef FAPI_BYTE_ORDERING_BIG_ENDIAN
|
||||
*out = ((pIn[1]) << 8) | pIn[0];
|
||||
#else
|
||||
*out = ((pIn[0]) << 8) | pIn[1];
|
||||
#endif
|
||||
(*in)+=2;
|
||||
return 2;
|
||||
} else {
|
||||
@@ -208,7 +236,11 @@ uint8_t pulls16(uint8_t **in, int16_t *out, uint8_t *end) {
|
||||
uint8_t *pIn = *in;
|
||||
|
||||
if((end - pIn) >=2 ) {
|
||||
#ifdef FAPI_BYTE_ORDERING_BIG_ENDIAN
|
||||
*out = ((pIn[1]) << 8) | pIn[0];
|
||||
#else
|
||||
*out = ((pIn[0]) << 8) | pIn[1];
|
||||
#endif
|
||||
(*in)+=2;
|
||||
return 2;
|
||||
} else {
|
||||
@@ -222,7 +254,11 @@ uint8_t pull32(uint8_t **in, uint32_t *out, uint8_t *end) {
|
||||
uint8_t *pIn = *in;
|
||||
|
||||
if((end - pIn) >= 4) {
|
||||
#ifdef FAPI_BYTE_ORDERING_BIG_ENDIAN
|
||||
*out = ((uint32_t)pIn[3] << 24) | (pIn[2] << 16) | (pIn[1] << 8) | pIn[0];
|
||||
#else
|
||||
*out = ((uint32_t)pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
|
||||
#endif
|
||||
(*in) += 4;
|
||||
return 4;
|
||||
} else {
|
||||
@@ -236,7 +272,11 @@ uint8_t pulls32(uint8_t **in, int32_t *out, uint8_t *end) {
|
||||
uint8_t *pIn = *in;
|
||||
|
||||
if((end - pIn) >=4 ) {
|
||||
#ifdef FAPI_BYTE_ORDERING_BIG_ENDIAN
|
||||
*out = (pIn[3] << 24) | (pIn[2] << 16) | (pIn[1] << 8) | pIn[0];
|
||||
#else
|
||||
*out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];
|
||||
#endif
|
||||
(*in)+=4;
|
||||
return 4;
|
||||
} else {
|
||||
@@ -839,7 +879,6 @@ int unpack_nr_tlv_list(unpack_tlv_t unpack_fns[],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <nfapi.h>
|
||||
#include "nfapi_nr_interface.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include <debug.h>
|
||||
|
||||
|
||||
@@ -1670,6 +1671,16 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
|
||||
end,
|
||||
&pack_uint16_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
if (NFAPI_MODE != NFAPI_MODE_AERIAL) {
|
||||
// TLV not supported by Aerial L1
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG,
|
||||
&(pNfapiMsg->carrier_config.frequency_shift_7p5khz),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
}
|
||||
// END Carrier Configuration
|
||||
|
||||
// START Cell Configuration
|
||||
@@ -1695,13 +1706,15 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
|
||||
end,
|
||||
&pack_uint32_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG,
|
||||
&(pNfapiMsg->ssb_config.bch_payload),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
if (NFAPI_MODE != NFAPI_MODE_AERIAL) {
|
||||
// TLV not supported by Aerial L1
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG,
|
||||
&(pNfapiMsg->ssb_config.bch_payload),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
}
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_SCS_COMMON_TAG,
|
||||
&(pNfapiMsg->ssb_config.scs_common),
|
||||
@@ -1780,6 +1793,16 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
|
||||
end,
|
||||
&pack_uint16_tlv_value);
|
||||
numTLVs++;
|
||||
for (int k = 0; k < prach_fd_occasion.num_unused_root_sequences.value; k++) {
|
||||
prach_fd_occasion.unused_root_sequences_list[k].tl.tag = NFAPI_NR_CONFIG_UNUSED_ROOT_SEQUENCES_TAG;
|
||||
prach_fd_occasion.unused_root_sequences_list[k].value = 0;
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_UNUSED_ROOT_SEQUENCES_TAG,
|
||||
&(prach_fd_occasion.unused_root_sequences_list[k]),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint16_tlv_value);
|
||||
numTLVs++;
|
||||
}
|
||||
}
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_SSB_PER_RACH_TAG,
|
||||
@@ -1788,15 +1811,25 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band.tl.tag = NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG;
|
||||
pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band.value = 0;
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG,
|
||||
&(pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
// END PRACH Configuration
|
||||
// START SSB Table
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG,
|
||||
&(pNfapiMsg->ssb_table.ssb_offset_point_a),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint16_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
if (NFAPI_MODE != NFAPI_MODE_AERIAL) {
|
||||
// TLV not supported by Aerial L1
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG,
|
||||
&(pNfapiMsg->ssb_table.ssb_offset_point_a),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint16_tlv_value);
|
||||
numTLVs++;
|
||||
}
|
||||
retval &=
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_SSB_PERIOD_TAG, &(pNfapiMsg->ssb_table.ssb_period), ppWritePackedMsg, end, &pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
@@ -1807,7 +1840,10 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
/* was unused */
|
||||
pNfapiMsg->ssb_table.MIB.tl.tag = NFAPI_NR_CONFIG_MIB_TAG;
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_MIB_TAG, &(pNfapiMsg->ssb_table.MIB), ppWritePackedMsg, end, &pack_uint32_tlv_value);
|
||||
numTLVs++;
|
||||
// SCF222.10.02 Table 3-25 : If included there must be two instances of this TLV
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG,
|
||||
&(pNfapiMsg->ssb_table.ssb_mask_list[0].ssb_mask),
|
||||
@@ -1822,26 +1858,48 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
|
||||
end,
|
||||
&pack_uint32_tlv_value);
|
||||
numTLVs++;
|
||||
if (NFAPI_MODE != NFAPI_MODE_AERIAL) {
|
||||
// TLV not supported by Aerial L1
|
||||
for (int i = 0; i < 64; i++) {
|
||||
// SCF222.10.02 Table 3-25 : If included there must be 64 instances of this TLV
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_BEAM_ID_TAG,
|
||||
&(pNfapiMsg->ssb_table.ssb_beam_id_list[i].beam_id),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 64; i++) {
|
||||
// SCF222.10.02 Table 3-25 : If included there must be 64 instances of this TLV
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_BEAM_ID_TAG,
|
||||
&(pNfapiMsg->ssb_table.ssb_beam_id_list[i].beam_id),
|
||||
// END SSB Table
|
||||
// START TDD Table
|
||||
retval &= pack_nr_tlv(NFAPI_NR_CONFIG_TDD_PERIOD_TAG,
|
||||
&(pNfapiMsg->tdd_table.tdd_period),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
// END TDD Table
|
||||
for (int i = 0; i < 40; i++) {
|
||||
for (int k = 0; k < 14; k++) {
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_SLOT_CONFIG_TAG,
|
||||
&(pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[k].slot_config),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// END SSB Table
|
||||
// START TDD Table
|
||||
retval &=
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), ppWritePackedMsg, end, &pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
// END TDD Table
|
||||
|
||||
// START Measurement Config
|
||||
// SCF222.10.02 Table 3-27 : Contains only one TLV and is currently unused
|
||||
pNfapiMsg->measurement_config.rssi_measurement.tl.tag = NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG;
|
||||
pNfapiMsg->measurement_config.rssi_measurement.value = 1;
|
||||
pack_nr_tlv(NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG,
|
||||
&(pNfapiMsg->measurement_config.rssi_measurement),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
// END Measurement Config
|
||||
|
||||
// START Digital Beam Table (DBT) PDU
|
||||
@@ -1851,57 +1909,57 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin
|
||||
// START Precoding Matrix (PM) PDU
|
||||
// Struct in nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h nfapi_nr_pm_pdu_t, currently unused, tag to use for AERIAL
|
||||
// is 0xA011 END Precoding Matrix (PM) PDU
|
||||
|
||||
// START nFAPI TLVs included in CONFIG.request for IDLE and CONFIGURED states
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG,
|
||||
&(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_ipv4_address_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG,
|
||||
&(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_ipv6_address_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_PORT_TAG,
|
||||
&(pNfapiMsg->nfapi_config.p7_vnf_port),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint16_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_WINDOW_TAG,
|
||||
&(pNfapiMsg->nfapi_config.timing_window),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG,
|
||||
&(pNfapiMsg->nfapi_config.timing_info_mode),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG,
|
||||
&(pNfapiMsg->nfapi_config.timing_info_period),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
// END nFAPI TLVs included in CONFIG.request for IDLE and CONFIGURED states
|
||||
|
||||
if (pNfapiMsg->vendor_extension != 0 && config != 0) {
|
||||
retval &= pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "Packing CONFIG.request vendor_extension_tlv %d\n", pNfapiMsg->vendor_extension->tag);
|
||||
if(NFAPI_MODE != NFAPI_MODE_AERIAL){
|
||||
// START nFAPI TLVs included in CONFIG.request for IDLE and CONFIGURED states
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG,
|
||||
&(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_ipv4_address_value);
|
||||
numTLVs++;
|
||||
}
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG,
|
||||
&(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_ipv6_address_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_PORT_TAG,
|
||||
&(pNfapiMsg->nfapi_config.p7_vnf_port),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint16_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_WINDOW_TAG,
|
||||
&(pNfapiMsg->nfapi_config.timing_window),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG,
|
||||
&(pNfapiMsg->nfapi_config.timing_info_mode),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
|
||||
retval &= pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG,
|
||||
&(pNfapiMsg->nfapi_config.timing_info_period),
|
||||
ppWritePackedMsg,
|
||||
end,
|
||||
&pack_uint8_tlv_value);
|
||||
numTLVs++;
|
||||
// END nFAPI TLVs included in CONFIG.request for IDLE and CONFIGURED states
|
||||
|
||||
if (pNfapiMsg->vendor_extension != 0 && config != 0) {
|
||||
retval &= pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "Packing CONFIG.request vendor_extension_tlv %d\n", pNfapiMsg->vendor_extension->tag);
|
||||
numTLVs++;
|
||||
}
|
||||
}
|
||||
pNfapiMsg->num_tlv = numTLVs;
|
||||
retval &= push8(pNfapiMsg->num_tlv, &pNumTLVFields, end);
|
||||
return retval;
|
||||
@@ -2170,7 +2228,7 @@ static uint8_t pack_p5_message_body(nfapi_p4_p5_message_header_t *header, uint8_
|
||||
|
||||
static uint32_t get_packed_msg_len(uintptr_t msgHead, uintptr_t msgEnd) {
|
||||
if (msgEnd < msgHead) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "get_packed_msg_len: Error in pointers supplied %lu, %lu\n", msgHead, msgEnd);
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "get_packed_msg_len: Error in pointers supplied %p, %p\n", &msgHead, &msgEnd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2178,6 +2236,7 @@ static uint32_t get_packed_msg_len(uintptr_t msgHead, uintptr_t msgEnd) {
|
||||
}
|
||||
|
||||
// Main pack function - public
|
||||
|
||||
int nfapi_nr_p5_message_pack(void *pMessageBuf,
|
||||
uint32_t messageBufLen,
|
||||
void *pPackedBuf,
|
||||
|
||||
@@ -328,8 +328,8 @@ static uint8_t pack_dl_tti_pdsch_pdu_rel15_value(void *tlv, uint8_t **ppWritePac
|
||||
}
|
||||
// TODO Add TX power info
|
||||
// Hardcoded values that represent 0db
|
||||
if (!(push8(8, ppWritePackedMsg, end) && // powerControlOffset
|
||||
push8(1, ppWritePackedMsg, end))) { // powerControlOffsetSS
|
||||
if (!(push8(0, ppWritePackedMsg, end) && // powerControlOffset
|
||||
push8(0, ppWritePackedMsg, end))) { // powerControlOffsetSS
|
||||
return 0;
|
||||
}
|
||||
// TODO Add CBG Fields
|
||||
@@ -346,9 +346,8 @@ static uint8_t pack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppWritePacke
|
||||
&& push16(value->ssbOffsetPointA, ppWritePackedMsg, end) && push8(value->bchPayloadFlag, ppWritePackedMsg, end)
|
||||
&& push8((value->bchPayload >> 16) & 0xff, ppWritePackedMsg, end)
|
||||
&& push8((value->bchPayload >> 8) & 0xff, ppWritePackedMsg, end) && push8(value->bchPayload & 0xff, ppWritePackedMsg, end)
|
||||
&& push8(0, ppWritePackedMsg, end) &&
|
||||
&& push8(0, ppWritePackedMsg, end)
|
||||
// TODO add Tx Power Info
|
||||
push8(0, ppWritePackedMsg, end) && push8(0, ppWritePackedMsg, end)
|
||||
&& push16(value->precoding_and_beamforming.num_prgs, ppWritePackedMsg, end)
|
||||
&& push16(value->precoding_and_beamforming.prg_size, ppWritePackedMsg, end)
|
||||
&& push8(value->precoding_and_beamforming.dig_bf_interfaces, ppWritePackedMsg, end))) {
|
||||
@@ -1092,7 +1091,7 @@ static uint8_t pack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ui
|
||||
}
|
||||
|
||||
static uint8_t pack_ul_tti_request_srs_pdu(nfapi_nr_srs_pdu_t *srs_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) {
|
||||
return(
|
||||
if(!(
|
||||
push16(srs_pdu->rnti, ppWritePackedMsg, end) &&
|
||||
push32(srs_pdu->handle, ppWritePackedMsg, end) &&
|
||||
push16(srs_pdu->bwp_size, ppWritePackedMsg, end) &&
|
||||
@@ -1117,7 +1116,23 @@ static uint8_t pack_ul_tti_request_srs_pdu(nfapi_nr_srs_pdu_t *srs_pdu, uint8_t
|
||||
push16(srs_pdu->t_srs, ppWritePackedMsg, end) &&
|
||||
push16(srs_pdu->t_offset, ppWritePackedMsg, end)
|
||||
// TODO: ignoring beamforming tlv for now
|
||||
);
|
||||
)){
|
||||
return 0;
|
||||
}
|
||||
// Rx Beamforming PDU
|
||||
if(!(push16(srs_pdu->beamforming.num_prgs,ppWritePackedMsg,end) &&
|
||||
push16(srs_pdu->beamforming.prg_size,ppWritePackedMsg,end) &&
|
||||
push8(srs_pdu->beamforming.dig_bf_interface,ppWritePackedMsg,end))){
|
||||
return 0;
|
||||
}
|
||||
for(int prg = 0; prg < srs_pdu->beamforming.num_prgs; prg ++){
|
||||
for(int digInt = 0; digInt < srs_pdu->beamforming.dig_bf_interface; digInt++){
|
||||
if(!push16(srs_pdu->beamforming.prgs_list[0].dig_bf_interface_list[0].beam_idx,ppWritePackedMsg,end)){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static uint8_t pack_ul_config_request_ulsch_pdu(nfapi_ul_config_ulsch_pdu *ulsch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) {
|
||||
@@ -2002,6 +2017,7 @@ static uint8_t pack_hi_dci0_request(void *msg, uint8_t **ppWritePackedMsg, uint8
|
||||
static uint8_t pack_tx_data_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
|
||||
{
|
||||
nfapi_nr_pdu_t *value = (nfapi_nr_pdu_t *)tlv;
|
||||
AssertFatal(value->PDU_length <= 0xFFFF,"TX_DATA.request PDU_Length should be within 16 bit, according to SCF222.10.02");
|
||||
if (!(push16(value->PDU_length, ppWritePackedMsg, end) && push16(value->PDU_index, ppWritePackedMsg, end)
|
||||
&& push32(value->num_TLV, ppWritePackedMsg, end)))
|
||||
return 0;
|
||||
@@ -3153,6 +3169,7 @@ return 1;
|
||||
|
||||
static uint8_t pack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value, uint8_t **ppWritePackedMsg, uint8_t *end)
|
||||
{
|
||||
AssertFatal(value->pdu_length <= 0xFFFF,"RX_DATA.indication PDU_Length should be within 16 bit, according to SCF222.10.02");
|
||||
if(!(push32(value->handle, ppWritePackedMsg, end) &&
|
||||
push16(value->rnti, ppWritePackedMsg, end) &&
|
||||
push8(value->harq_id, ppWritePackedMsg, end) &&
|
||||
@@ -5886,7 +5903,7 @@ static uint8_t unpack_hi_dci0_request(uint8_t **ppReadPackedMsg, uint8_t *end, v
|
||||
static uint8_t unpack_tx_data_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) {
|
||||
nfapi_nr_pdu_t *pNfapiMsg = (nfapi_nr_pdu_t *)msg;
|
||||
|
||||
if(!(pull16(ppReadPackedMsg, &pNfapiMsg->PDU_length, end) &&
|
||||
if(!(pull16(ppReadPackedMsg, (uint16_t *)&pNfapiMsg->PDU_length, end) &&
|
||||
pull16(ppReadPackedMsg, &pNfapiMsg->PDU_index, end) &&
|
||||
pull32(ppReadPackedMsg, &pNfapiMsg->num_TLV, end)
|
||||
))
|
||||
@@ -5939,13 +5956,6 @@ static uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, v
|
||||
|
||||
for (int i = 0; i < pNfapiMsg->Number_of_PDUs; i++) {
|
||||
if (!unpack_tx_data_pdu_list_value(ppReadPackedMsg, end, &pNfapiMsg->pdu_list[i])) {
|
||||
printf("%s():%d. Error packing TX_DATA.request PDU #%d, PDU length = %d PDU IDX = %d\n",
|
||||
__FUNCTION__,
|
||||
__LINE__,
|
||||
i,
|
||||
pNfapiMsg->pdu_list[i].PDU_length,
|
||||
pNfapiMsg->pdu_list[i].PDU_index);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -6065,7 +6075,7 @@ static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value,
|
||||
nfapi_p7_codec_config_t *config)
|
||||
{
|
||||
if (!(pull32(ppReadPackedMsg, &value->handle, end) && pull16(ppReadPackedMsg, &value->rnti, end)
|
||||
&& pull8(ppReadPackedMsg, &value->harq_id, end) && pull16(ppReadPackedMsg, &value->pdu_length, end)
|
||||
&& pull8(ppReadPackedMsg, &value->harq_id, end) && pull16(ppReadPackedMsg, (uint16_t *)&value->pdu_length, end)
|
||||
&& pull8(ppReadPackedMsg, &value->ul_cqi, end) && pull16(ppReadPackedMsg, &value->timing_advance, end)
|
||||
&& pull16(ppReadPackedMsg, &value->rssi, end)))
|
||||
return 0;
|
||||
|
||||
@@ -2040,8 +2040,10 @@ int pnf_read_dispatch_message(pnf_t* pnf)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF Failed to unpack p5 message header\n");
|
||||
return 0;
|
||||
}
|
||||
message_size = header.message_length;
|
||||
}else{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "PNF Unpack p5 message header success\n");
|
||||
}
|
||||
message_size = header.message_length+header_buffer_size;
|
||||
|
||||
// now have the size of the mesage
|
||||
}
|
||||
@@ -2206,7 +2208,7 @@ int pnf_nr_read_dispatch_message(pnf_t* pnf)
|
||||
// print the received message
|
||||
printf("\n MESSAGE RECEIVED: \n");
|
||||
for(int i=0; i<message_size; i++){
|
||||
printf("%d", read_buffer[i]);
|
||||
printf("read_buffer[%d] = 0x%02x\n",i, read_buffer[i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
@@ -27,7 +27,11 @@
|
||||
#include "vnf.h"
|
||||
#include "nfapi_nr_interface.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
|
||||
#ifdef ENABLE_AERIAL
|
||||
#include "nfapi/oai_integration/aerial/fapi_nvIPC.h"
|
||||
#include "nfapi/oai_integration/aerial/fapi_vnf_p5.h"
|
||||
#endif
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
void* vnf_malloc(nfapi_vnf_config_t* config, size_t size)
|
||||
{
|
||||
@@ -1520,20 +1524,45 @@ int vnf_nr_pack_and_send_p5_message(vnf_t* vnf, uint16_t p5_idx, nfapi_p4_p5_mes
|
||||
if(pnf)
|
||||
{
|
||||
// pack the message for transmission
|
||||
int packedMessageLength = nfapi_nr_p5_message_pack(msg, msg_len, vnf->tx_message_buffer, sizeof(vnf->tx_message_buffer), &vnf->_public.codec_config);
|
||||
int packedMessageLength = 0;
|
||||
if (NFAPI_MODE == NFAPI_MODE_AERIAL) {
|
||||
#ifdef ENABLE_AERIAL
|
||||
// In case it is a FAPI message, create 2 messages, one with nFAPI header for OAI PNF and one with no nFAPI header for Aerial
|
||||
// L1
|
||||
nfapi_p4_p5_message_header_t *msgFAPI = calloc(1, msg_len);
|
||||
memcpy(msgFAPI, msg, msg_len);
|
||||
// create FAPI tx_buffer
|
||||
uint8_t tx_messagebufferFAPI[sizeof(vnf->tx_message_buffer)];
|
||||
int packedMessageLengthFAPI = -1;
|
||||
packedMessageLengthFAPI =
|
||||
fapi_nr_p5_message_pack(msgFAPI, msg_len, tx_messagebufferFAPI, sizeof(tx_messagebufferFAPI), &vnf->_public.codec_config);
|
||||
return aerial_send_P5_msg(tx_messagebufferFAPI, packedMessageLengthFAPI, msg);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
} else {
|
||||
packedMessageLength = nfapi_nr_p5_message_pack(msg,
|
||||
msg_len,
|
||||
vnf->tx_message_buffer,
|
||||
sizeof(vnf->tx_message_buffer),
|
||||
&vnf->_public.codec_config);
|
||||
|
||||
if (packedMessageLength < 0) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p5_message_pack failed with return %d\n", packedMessageLength);
|
||||
return -1;
|
||||
}
|
||||
// printf("msg id = 0x%02x, entire message length: %d\n", msg->message_id, packedMessageLength);
|
||||
// for (int i = 0; i < packedMessageLength; i++) {
|
||||
// printf(" msg->msg_buf[%d] = 0x%02x\n", i, ((uint8_t *) vnf->tx_message_buffer)[i]);
|
||||
// }
|
||||
|
||||
return vnf_send_p5_msg(pnf, vnf->tx_message_buffer, packedMessageLength, 0);
|
||||
}
|
||||
} else {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (packedMessageLength < 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p5_message_pack failed with return %d\n", packedMessageLength);
|
||||
return -1;
|
||||
}
|
||||
return vnf_send_p5_msg(pnf, vnf->tx_message_buffer, packedMessageLength, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() cannot find pnf info for p5_idx:%d\n", __FUNCTION__, p5_idx);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef ENABLE_AERIAL
|
||||
#include "nfapi/oai_integration/aerial/fapi_nvIPC.h"
|
||||
#endif
|
||||
#include "vnf_p7.h"
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
||||
Reference in New Issue
Block a user