Commit 34ea6c7a authored by Rúben Soares Silva's avatar Rúben Soares Silva

Fix packing/unpacking procedures for PARAM.response

Added missing support for packing/unpacking tag 0x001C (supportedMaxModulationOrderDl)

Now properly handles tag 0x0005 (NumConfigTLVsToReport) and subsequent TLVs that come after this value ( Table 3-9 SCF 222.10.02 )
parent 61a3125d
......@@ -856,6 +856,19 @@ int unpack_nr_tlv_list(unpack_tlv_t unpack_fns[],
for (idx = 0; idx < size; ++idx) {
if (unpack_fns[idx].tag == generic_tl.tag) { // match the extracted tag value with all the tags in unpack_fn list
tagMatch = 1;
if (generic_tl.tag == NFAPI_NR_PARAM_TLV_NUM_CONFIG_TLVS_TO_REPORT_TAG) {
// padding and sub tlvs handled already
nfapi_nr_cell_param_t *cellParamTable = (nfapi_nr_cell_param_t *)unpack_fns[idx].tlv;
cellParamTable->num_config_tlvs_to_report.tl.tag = generic_tl.tag;
cellParamTable->num_config_tlvs_to_report.tl.length = generic_tl.length;
int result = (*unpack_fns[idx].unpack_func)(unpack_fns[idx].tlv, ppReadPackedMsg, end);
if (result == 0) {
return 0;
}
continue;
}
nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv);
tl->tag = generic_tl.tag;
tl->length = generic_tl.length;
......
......@@ -665,320 +665,348 @@ uint8_t pack_nr_param_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
{
printf("\nRUNNING pack_param_response\n");
nfapi_nr_param_response_scf_t *pNfapiMsg = (nfapi_nr_param_response_scf_t *)msg;
return (push8(pNfapiMsg->error_code, ppWritePackedMsg, end) && push8(pNfapiMsg->num_tlv, ppWritePackedMsg, end)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_RELEASE_CAPABILITY_TAG,
&(pNfapiMsg->cell_param.release_capability),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PHY_STATE_TAG,
&(pNfapiMsg->cell_param.phy_state),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SKIP_BLANK_DL_CONFIG_TAG,
&(pNfapiMsg->cell_param.skip_blank_dl_config),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SKIP_BLANK_UL_CONFIG_TAG,
&(pNfapiMsg->cell_param.skip_blank_ul_config),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_NUM_CONFIG_TLVS_TO_REPORT_TAG,
&(pNfapiMsg->cell_param.num_config_tlvs_to_report),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_CYCLIC_PREFIX_TAG,
&(pNfapiMsg->carrier_param.cyclic_prefix),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_SUBCARRIER_SPACINGS_DL_TAG,
&(pNfapiMsg->carrier_param.supported_subcarrier_spacings_dl),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_BANDWIDTH_DL_TAG,
&(pNfapiMsg->carrier_param.supported_bandwidth_dl),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_SUBCARRIER_SPACINGS_UL_TAG,
&(pNfapiMsg->carrier_param.supported_subcarrier_spacings_ul),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_BANDWIDTH_UL_TAG,
&(pNfapiMsg->carrier_param.supported_bandwidth_ul),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_CCE_MAPPING_TYPE_TAG,
&(pNfapiMsg->pdcch_param.cce_mapping_type),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_CORESET_OUTSIDE_FIRST_3_OFDM_SYMS_OF_SLOT_TAG,
&(pNfapiMsg->pdcch_param.coreset_outside_first_3_of_ofdm_syms_of_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PRECODER_GRANULARITY_CORESET_TAG,
&(pNfapiMsg->pdcch_param.coreset_precoder_granularity_coreset),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDCCH_MU_MIMO_TAG,
&(pNfapiMsg->pdcch_param.pdcch_mu_mimo),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDCCH_PRECODER_CYCLING_TAG,
&(pNfapiMsg->pdcch_param.pdcch_precoder_cycling),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PDCCHS_PER_SLOT_TAG,
&(pNfapiMsg->pdcch_param.max_pdcch_per_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUCCH_FORMATS_TAG,
&(pNfapiMsg->pucch_param.pucch_formats),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PUCCHS_PER_SLOT_TAG,
&(pNfapiMsg->pucch_param.max_pucchs_per_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_MAPPING_TYPE_TAG,
&(pNfapiMsg->pdsch_param.pdsch_mapping_type),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_ALLOCATION_TYPES_TAG,
&(pNfapiMsg->pdsch_param.pdsch_allocation_types),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_VRB_TO_PRB_MAPPING_TAG,
&(pNfapiMsg->pdsch_param.pdsch_vrb_to_prb_mapping),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_CBG_TAG,
&(pNfapiMsg->pdsch_param.pdsch_cbg),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_DMRS_CONFIG_TYPES_TAG,
&(pNfapiMsg->pdsch_param.pdsch_dmrs_config_types),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_DMRS_MAX_LENGTH_TAG,
&(pNfapiMsg->pdsch_param.pdsch_dmrs_max_length),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_DMRS_ADDITIONAL_POS_TAG,
&(pNfapiMsg->pdsch_param.pdsch_dmrs_additional_pos),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PDSCH_S_TBS_PER_SLOT_TAG,
&(pNfapiMsg->pdsch_param.max_pdsch_tbs_per_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_NUMBER_MIMO_LAYERS_PDSCH_TAG,
&(pNfapiMsg->pdsch_param.max_number_mimo_layers_pdsch),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_MU_MIMO_USERS_DL_TAG,
&(pNfapiMsg->pdsch_param.max_mu_mimo_users_dl),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_DATA_IN_DMRS_SYMBOLS_TAG,
&(pNfapiMsg->pdsch_param.pdsch_data_in_dmrs_symbols),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PREMPTION_SUPPORT_TAG,
&(pNfapiMsg->pdsch_param.premption_support),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_NON_SLOT_SUPPORT_TAG,
&(pNfapiMsg->pdsch_param.pdsch_non_slot_support),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_UCI_MUX_ULSCH_IN_PUSCH_TAG,
&(pNfapiMsg->pusch_param.uci_mux_ulsch_in_pusch),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_UCI_ONLY_PUSCH_TAG,
&(pNfapiMsg->pusch_param.uci_only_pusch),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_FREQUENCY_HOPPING_TAG,
&(pNfapiMsg->pusch_param.pusch_frequency_hopping),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_DMRS_CONFIG_TYPES_TAG,
&(pNfapiMsg->pusch_param.pusch_dmrs_config_types),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_DMRS_MAX_LEN_TAG,
&(pNfapiMsg->pusch_param.pusch_dmrs_max_len),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_DMRS_ADDITIONAL_POS_TAG,
&(pNfapiMsg->pusch_param.pusch_dmrs_additional_pos),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_CBG_TAG,
&(pNfapiMsg->pusch_param.pusch_cbg),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_MAPPING_TYPE_TAG,
&(pNfapiMsg->pusch_param.pusch_mapping_type),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_ALLOCATION_TYPES_TAG,
&(pNfapiMsg->pusch_param.pusch_allocation_types),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_VRB_TO_PRB_MAPPING_TAG,
&(pNfapiMsg->pusch_param.pusch_vrb_to_prb_mapping),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_MAX_PTRS_PORTS_TAG,
&(pNfapiMsg->pusch_param.pusch_max_ptrs_ports),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PDUSCHS_TBS_PER_SLOT_TAG,
&(pNfapiMsg->pusch_param.max_pduschs_tbs_per_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_NUMBER_MIMO_LAYERS_NON_CB_PUSCH_TAG,
&(pNfapiMsg->pusch_param.max_number_mimo_layers_non_cb_pusch),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_MODULATION_ORDER_UL_TAG,
&(pNfapiMsg->pusch_param.supported_modulation_order_ul),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_MU_MIMO_USERS_UL_TAG,
&(pNfapiMsg->pusch_param.max_mu_mimo_users_ul),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_DFTS_OFDM_SUPPORT_TAG,
&(pNfapiMsg->pusch_param.dfts_ofdm_support),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_AGGREGATION_FACTOR_TAG,
&(pNfapiMsg->pusch_param.pusch_aggregation_factor),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PRACH_LONG_FORMATS_TAG,
&(pNfapiMsg->prach_param.prach_long_formats),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PRACH_SHORT_FORMATS_TAG,
&(pNfapiMsg->prach_param.prach_short_formats),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PRACH_RESTRICTED_SETS_TAG,
&(pNfapiMsg->prach_param.prach_restricted_sets),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG,
&(pNfapiMsg->prach_param.max_prach_fd_occasions_in_a_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_RSSI_MEASUREMENT_SUPPORT_TAG,
&(pNfapiMsg->measurement_param.rssi_measurement_support),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&&
// config:
pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG,
&(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4),
ppWritePackedMsg,
end,
&pack_ipv4_address_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG,
&(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6),
ppWritePackedMsg,
end,
&pack_ipv6_address_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_PORT_TAG,
&(pNfapiMsg->nfapi_config.p7_vnf_port),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG,
&(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4),
ppWritePackedMsg,
end,
&pack_ipv4_address_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG,
&(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6),
ppWritePackedMsg,
end,
&pack_ipv6_address_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_PNF_PORT_TAG,
&(pNfapiMsg->nfapi_config.p7_pnf_port),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_WINDOW_TAG,
&(pNfapiMsg->nfapi_config.timing_window),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG,
&(pNfapiMsg->nfapi_config.timing_info_mode),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG,
&(pNfapiMsg->nfapi_config.timing_info_period),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
uint8_t retval = push8(pNfapiMsg->error_code, ppWritePackedMsg, end) && push8(pNfapiMsg->num_tlv, ppWritePackedMsg, end)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_RELEASE_CAPABILITY_TAG,
&(pNfapiMsg->cell_param.release_capability),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PHY_STATE_TAG,
&(pNfapiMsg->cell_param.phy_state),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SKIP_BLANK_DL_CONFIG_TAG,
&(pNfapiMsg->cell_param.skip_blank_dl_config),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SKIP_BLANK_UL_CONFIG_TAG,
&(pNfapiMsg->cell_param.skip_blank_ul_config),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_NUM_CONFIG_TLVS_TO_REPORT_TAG,
&(pNfapiMsg->cell_param.num_config_tlvs_to_report),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value);
for (int i = 0; i < pNfapiMsg->cell_param.num_config_tlvs_to_report.value; ++i) {
/*retval &= pack_nr_tlv(pNfapiMsg->cell_param.config_tlvs_to_report_list[i].tl.tag,
&(pNfapiMsg->cell_param.config_tlvs_to_report_list[i]),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value);*/
retval &= push16(pNfapiMsg->cell_param.config_tlvs_to_report_list[i].tl.tag, ppWritePackedMsg, end);
retval &= push8(pNfapiMsg->cell_param.config_tlvs_to_report_list[i].tl.length, ppWritePackedMsg, end);
retval &= push8(pNfapiMsg->cell_param.config_tlvs_to_report_list[i].value, ppWritePackedMsg, end);
// Add padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
int padding = get_tlv_padding(pNfapiMsg->cell_param.config_tlvs_to_report_list[i].tl.length);
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
"TLV 0x%x with padding of %d bytes\n",
pNfapiMsg->cell_param.config_tlvs_to_report_list[i].tl.tag,
padding);
if (padding != 0) {
memset(*ppWritePackedMsg, 0, padding);
(*ppWritePackedMsg) += padding;
}
}
retval &= pack_nr_tlv(NFAPI_NR_PARAM_TLV_CYCLIC_PREFIX_TAG,
&(pNfapiMsg->carrier_param.cyclic_prefix),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_SUBCARRIER_SPACINGS_DL_TAG,
&(pNfapiMsg->carrier_param.supported_subcarrier_spacings_dl),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_BANDWIDTH_DL_TAG,
&(pNfapiMsg->carrier_param.supported_bandwidth_dl),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_SUBCARRIER_SPACINGS_UL_TAG,
&(pNfapiMsg->carrier_param.supported_subcarrier_spacings_ul),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_BANDWIDTH_UL_TAG,
&(pNfapiMsg->carrier_param.supported_bandwidth_ul),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_CCE_MAPPING_TYPE_TAG,
&(pNfapiMsg->pdcch_param.cce_mapping_type),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_CORESET_OUTSIDE_FIRST_3_OFDM_SYMS_OF_SLOT_TAG,
&(pNfapiMsg->pdcch_param.coreset_outside_first_3_of_ofdm_syms_of_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PRECODER_GRANULARITY_CORESET_TAG,
&(pNfapiMsg->pdcch_param.coreset_precoder_granularity_coreset),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDCCH_MU_MIMO_TAG,
&(pNfapiMsg->pdcch_param.pdcch_mu_mimo),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDCCH_PRECODER_CYCLING_TAG,
&(pNfapiMsg->pdcch_param.pdcch_precoder_cycling),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PDCCHS_PER_SLOT_TAG,
&(pNfapiMsg->pdcch_param.max_pdcch_per_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUCCH_FORMATS_TAG,
&(pNfapiMsg->pucch_param.pucch_formats),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PUCCHS_PER_SLOT_TAG,
&(pNfapiMsg->pucch_param.max_pucchs_per_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_MAPPING_TYPE_TAG,
&(pNfapiMsg->pdsch_param.pdsch_mapping_type),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_ALLOCATION_TYPES_TAG,
&(pNfapiMsg->pdsch_param.pdsch_allocation_types),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_VRB_TO_PRB_MAPPING_TAG,
&(pNfapiMsg->pdsch_param.pdsch_vrb_to_prb_mapping),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_CBG_TAG,
&(pNfapiMsg->pdsch_param.pdsch_cbg),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_DMRS_CONFIG_TYPES_TAG,
&(pNfapiMsg->pdsch_param.pdsch_dmrs_config_types),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_DMRS_MAX_LENGTH_TAG,
&(pNfapiMsg->pdsch_param.pdsch_dmrs_max_length),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_DMRS_ADDITIONAL_POS_TAG,
&(pNfapiMsg->pdsch_param.pdsch_dmrs_additional_pos),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PDSCH_S_TBS_PER_SLOT_TAG,
&(pNfapiMsg->pdsch_param.max_pdsch_tbs_per_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_NUMBER_MIMO_LAYERS_PDSCH_TAG,
&(pNfapiMsg->pdsch_param.max_number_mimo_layers_pdsch),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_MAX_MODULATION_ORDER_DL_TAG,
&(pNfapiMsg->pdsch_param.supported_max_modulation_order_dl),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_MU_MIMO_USERS_DL_TAG,
&(pNfapiMsg->pdsch_param.max_mu_mimo_users_dl),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_DATA_IN_DMRS_SYMBOLS_TAG,
&(pNfapiMsg->pdsch_param.pdsch_data_in_dmrs_symbols),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PREMPTION_SUPPORT_TAG,
&(pNfapiMsg->pdsch_param.premption_support),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PDSCH_NON_SLOT_SUPPORT_TAG,
&(pNfapiMsg->pdsch_param.pdsch_non_slot_support),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_UCI_MUX_ULSCH_IN_PUSCH_TAG,
&(pNfapiMsg->pusch_param.uci_mux_ulsch_in_pusch),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_UCI_ONLY_PUSCH_TAG,
&(pNfapiMsg->pusch_param.uci_only_pusch),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_FREQUENCY_HOPPING_TAG,
&(pNfapiMsg->pusch_param.pusch_frequency_hopping),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_DMRS_CONFIG_TYPES_TAG,
&(pNfapiMsg->pusch_param.pusch_dmrs_config_types),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_DMRS_MAX_LEN_TAG,
&(pNfapiMsg->pusch_param.pusch_dmrs_max_len),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_DMRS_ADDITIONAL_POS_TAG,
&(pNfapiMsg->pusch_param.pusch_dmrs_additional_pos),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_CBG_TAG,
&(pNfapiMsg->pusch_param.pusch_cbg),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_MAPPING_TYPE_TAG,
&(pNfapiMsg->pusch_param.pusch_mapping_type),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_ALLOCATION_TYPES_TAG,
&(pNfapiMsg->pusch_param.pusch_allocation_types),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_VRB_TO_PRB_MAPPING_TAG,
&(pNfapiMsg->pusch_param.pusch_vrb_to_prb_mapping),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_MAX_PTRS_PORTS_TAG,
&(pNfapiMsg->pusch_param.pusch_max_ptrs_ports),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PDUSCHS_TBS_PER_SLOT_TAG,
&(pNfapiMsg->pusch_param.max_pduschs_tbs_per_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_NUMBER_MIMO_LAYERS_NON_CB_PUSCH_TAG,
&(pNfapiMsg->pusch_param.max_number_mimo_layers_non_cb_pusch),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_SUPPORTED_MODULATION_ORDER_UL_TAG,
&(pNfapiMsg->pusch_param.supported_modulation_order_ul),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_MU_MIMO_USERS_UL_TAG,
&(pNfapiMsg->pusch_param.max_mu_mimo_users_ul),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_DFTS_OFDM_SUPPORT_TAG,
&(pNfapiMsg->pusch_param.dfts_ofdm_support),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PUSCH_AGGREGATION_FACTOR_TAG,
&(pNfapiMsg->pusch_param.pusch_aggregation_factor),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PRACH_LONG_FORMATS_TAG,
&(pNfapiMsg->prach_param.prach_long_formats),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PRACH_SHORT_FORMATS_TAG,
&(pNfapiMsg->prach_param.prach_short_formats),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_PRACH_RESTRICTED_SETS_TAG,
&(pNfapiMsg->prach_param.prach_restricted_sets),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG,
&(pNfapiMsg->prach_param.max_prach_fd_occasions_in_a_slot),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_PARAM_TLV_RSSI_MEASUREMENT_SUPPORT_TAG,
&(pNfapiMsg->measurement_param.rssi_measurement_support),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&&
// config:
pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG,
&(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4),
ppWritePackedMsg,
end,
&pack_ipv4_address_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG,
&(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6),
ppWritePackedMsg,
end,
&pack_ipv6_address_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_VNF_PORT_TAG,
&(pNfapiMsg->nfapi_config.p7_vnf_port),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG,
&(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4),
ppWritePackedMsg,
end,
&pack_ipv4_address_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG,
&(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6),
ppWritePackedMsg,
end,
&pack_ipv6_address_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_P7_PNF_PORT_TAG,
&(pNfapiMsg->nfapi_config.p7_pnf_port),
ppWritePackedMsg,
end,
&pack_uint16_tlv_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_WINDOW_TAG,
&(pNfapiMsg->nfapi_config.timing_window),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG,
&(pNfapiMsg->nfapi_config.timing_info_mode),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_nr_tlv(NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG,
&(pNfapiMsg->nfapi_config.timing_info_period),
ppWritePackedMsg,
end,
&pack_uint8_tlv_value)
&& pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
return retval;
}
static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config)
......@@ -2586,6 +2614,41 @@ static uint8_t unpack_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, vo
config,
&pNfapiMsg->vendor_extension));
}
static uint8_t unpack_config_tlvs_to_report(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
uint8_t *pStartOfValue = *ppReadPackedMsg;
nfapi_nr_cell_param_t *cellParamTable = (nfapi_nr_cell_param_t *)tlv;
uint8_t retval = pull16(ppReadPackedMsg, &cellParamTable->num_config_tlvs_to_report.value, end);
// check if the length was right;
if (cellParamTable->num_config_tlvs_to_report.tl.length != (*ppReadPackedMsg - pStartOfValue)) {
NFAPI_TRACE(NFAPI_TRACE_ERROR,
"Warning tlv tag 0x%x length %d not equal to unpack %ld\n",
cellParamTable->num_config_tlvs_to_report.tl.tag,
cellParamTable->num_config_tlvs_to_report.tl.length,
(*ppReadPackedMsg - pStartOfValue));
}
// Remove padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
int padding = get_tlv_padding(cellParamTable->num_config_tlvs_to_report.tl.length);
if (padding != 0) {
(*ppReadPackedMsg) += padding;
}
// after this value, get the tlv list
cellParamTable->config_tlvs_to_report_list = calloc(cellParamTable->num_config_tlvs_to_report.value, sizeof(nfapi_uint8_tlv_t *));
for (int i = 0; i < cellParamTable->num_config_tlvs_to_report.value; ++i) {
pull16(ppReadPackedMsg, &cellParamTable->config_tlvs_to_report_list[i].tl.tag, end);
pull8(ppReadPackedMsg, (uint8_t *)&cellParamTable->config_tlvs_to_report_list[i].tl.length, end);
pull8(ppReadPackedMsg, &cellParamTable->config_tlvs_to_report_list[i].value, end);
// Remove padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
padding = get_tlv_padding(cellParamTable->config_tlvs_to_report_list[i].tl.length);
if (padding != 0) {
(*ppReadPackedMsg) += padding;
}
}
return retval;
}
uint8_t unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t *config)
{
......@@ -2595,9 +2658,7 @@ uint8_t unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *
{NFAPI_NR_PARAM_TLV_PHY_STATE_TAG, &(pNfapiMsg->cell_param.phy_state), &unpack_uint16_tlv_value},
{NFAPI_NR_PARAM_TLV_SKIP_BLANK_DL_CONFIG_TAG, &(pNfapiMsg->cell_param.skip_blank_dl_config), &unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_SKIP_BLANK_UL_CONFIG_TAG, &(pNfapiMsg->cell_param.skip_blank_ul_config), &unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_NUM_CONFIG_TLVS_TO_REPORT_TAG,
&(pNfapiMsg->cell_param.num_config_tlvs_to_report),
&unpack_uint16_tlv_value},
{NFAPI_NR_PARAM_TLV_NUM_CONFIG_TLVS_TO_REPORT_TAG, &(pNfapiMsg->cell_param), &unpack_config_tlvs_to_report},
{NFAPI_NR_PARAM_TLV_CYCLIC_PREFIX_TAG, &(pNfapiMsg->carrier_param.cyclic_prefix), &unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_SUPPORTED_SUBCARRIER_SPACINGS_DL_TAG,
......@@ -2638,6 +2699,9 @@ uint8_t unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *
{NFAPI_NR_PARAM_TLV_MAX_NUMBER_MIMO_LAYERS_PDSCH_TAG,
&(pNfapiMsg->pdsch_param.max_number_mimo_layers_pdsch),
&unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_SUPPORTED_MAX_MODULATION_ORDER_DL_TAG,
&(pNfapiMsg->pdsch_param.supported_max_modulation_order_dl),
&unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_MAX_MU_MIMO_USERS_DL_TAG, &(pNfapiMsg->pdsch_param.max_mu_mimo_users_dl), &unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_PDSCH_DATA_IN_DMRS_SYMBOLS_TAG,
&(pNfapiMsg->pdsch_param.pdsch_data_in_dmrs_symbols),
......@@ -2676,7 +2740,7 @@ uint8_t unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *
&unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_PRACH_LONG_FORMATS_TAG, &(pNfapiMsg->prach_param.prach_long_formats), &unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_PRACH_SHORT_FORMATS_TAG, &(pNfapiMsg->prach_param.prach_short_formats), &unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_PRACH_SHORT_FORMATS_TAG, &(pNfapiMsg->prach_param.prach_short_formats), &unpack_uint16_tlv_value},
{NFAPI_NR_PARAM_TLV_PRACH_RESTRICTED_SETS_TAG, &(pNfapiMsg->prach_param.prach_restricted_sets), &unpack_uint8_tlv_value},
{NFAPI_NR_PARAM_TLV_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG,
&(pNfapiMsg->prach_param.max_prach_fd_occasions_in_a_slot),
......@@ -2698,10 +2762,10 @@ uint8_t unpack_nr_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *
};
// print ppReadPackedMsg
uint8_t *ptr = *ppReadPackedMsg;
printf("\n Read message unpack_param_response: ");
printf("\n Read message unpack_param_response: ");
while (ptr < end) {
printf(" %02x ", *ptr);
printf(" 0x%02x", *ptr);
ptr++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment