diff --git a/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c b/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c index 063f9589ef..295cca7a48 100644 --- a/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c +++ b/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c @@ -1227,6 +1227,29 @@ uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e numTLVs++; } #endif + + AssertFatal(pNfapiMsg->analog_beamforming_ve.num_beams_period_vendor_ext.tl.tag == 0, "BF Vendor extension shouldn't be set!"); + // The call to pack the TLV would be the same as any other TLV, it is only packed if the tag is set, + // so, it's safe to add the call to pack_nr_tlv even if it is not always set + retval &= pack_nr_tlv(NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG, + &(pNfapiMsg->analog_beamforming_ve.num_beams_period_vendor_ext), + ppWritePackedMsg, + end, + &pack_uint8_tlv_value); + // only increase if it was set + numTLVs += pNfapiMsg->analog_beamforming_ve.num_beams_period_vendor_ext.tl.tag == NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG; + + AssertFatal(pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext.tl.tag == 0, "BF Vendor extension shouldn't be set!"); + // The call to pack the TLV would be the same as any other TLV, it is only packed if the tag is set, + // so, it's safe to add the call to pack_nr_tlv even if it is not always set + retval &= pack_nr_tlv(NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG, + &(pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext), + ppWritePackedMsg, + end, + &pack_uint8_tlv_value); + // only increase if it was set + numTLVs += pNfapiMsg->analog_beamforming_ve.analog_bf_vendor_ext.tl.tag == NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG; + pNfapiMsg->num_tlv = numTLVs; retval &= push8(pNfapiMsg->num_tlv, &pNumTLVFields, end); return retval; diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h index a6ab614bde..4e9987b0cb 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h @@ -23,6 +23,8 @@ #define NFAPI_NR_NFAPI_TIMING_WINDOW_TAG 0x011E #define NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG 0x011F #define NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG 0x0120 +#define NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG 0xA000 +#define NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG 0xA001 typedef enum { NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED=1, diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index 0b8a4a1d12..c92851f4e5 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -484,6 +484,11 @@ typedef struct { nfapi_nr_pm_pdu_t *pmi_pdu; } nfapi_nr_pm_list_t; +typedef struct { + nfapi_uint8_tlv_t num_beams_period_vendor_ext; + nfapi_uint8_tlv_t analog_bf_vendor_ext; +} nfapi_nr_analog_beamforming_ve_t; + // ERROR enums typedef enum { // Table 2-22 NFAPI_NR_PARAM_MSG_OK = 0, @@ -597,6 +602,7 @@ typedef struct { nfapi_nr_nfapi_t nfapi_config; nfapi_nr_pm_list_t pmi_list; nfapi_nr_dbt_pdu_t dbt_config; + nfapi_nr_analog_beamforming_ve_t analog_beamforming_ve; } nfapi_nr_config_request_scf_t; typedef enum { diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index c2b73a095d..7b65533048 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -615,11 +615,20 @@ static void config_common(gNB_MAC_INST *nrmac, } } } + + if (nrmac->beam_info.beam_allocation) { + cfg->analog_beamforming_ve.num_beams_period_vendor_ext.tl.tag = NFAPI_NR_FAPI_NUM_BEAMS_PERIOD_VENDOR_EXTENSION_TAG; + cfg->analog_beamforming_ve.num_beams_period_vendor_ext.value = nrmac->beam_info.beams_per_period; + cfg->num_tlv++; + cfg->analog_beamforming_ve.analog_bf_vendor_ext.tl.tag = NFAPI_NR_FAPI_ANALOG_BF_VENDOR_EXTENSION_TAG; + cfg->analog_beamforming_ve.analog_bf_vendor_ext.value = 1; // analog BF enabled + cfg->num_tlv++; + } } static void initialize_beam_information(NR_beam_info_t *beam_info, int mu, int slots_per_frame) { - if(!beam_info->beam_allocation) + if (!beam_info->beam_allocation) return; int size = mu == 0 ? slots_per_frame << 1 : slots_per_frame;