Add pack/unpack for CONFIG.request Precoding Matrix table
Adds the packing and unpacking functions needed for the PM Table in CONFIG.request This table tag is specified in SCF222.10.06(0x104B), previous versions didn't have a tag for this table, and this version of the spec introduces the parameter `num_pm_idx`, previously not present. A struct nfapi_nr_pm_tlv_ve_t is added to represent this TLV in order to be able to use the pack_nr_tlv function. The necessary additions to the utility functions are done to account for this table. The unitary test is changed to fill this table with randomized data to test transport and copy.
This commit is contained in:
@@ -225,6 +225,28 @@ static void fill_config_request_tlv_tdd_rand(nfapi_nr_config_request_scf_t *nfap
|
||||
nfapi_resp->num_tlv++;
|
||||
}
|
||||
|
||||
nfapi_nr_pm_list_t *pm_list = &nfapi_resp->pmi_list;
|
||||
const uint16_t num_layers = rand16_range(1, 4);
|
||||
const uint16_t num_ant_ports = rand16_range(1, 4);
|
||||
pm_list->num_pm_idx = rand16_range(1, 4);
|
||||
if (nfapi_resp->pmi_list.num_pm_idx > 0) {
|
||||
pm_list->pmi_pdu = calloc(pm_list->num_pm_idx, sizeof(*pm_list->pmi_pdu));
|
||||
for (int i = 0; i < pm_list->num_pm_idx; i++) {
|
||||
nfapi_nr_pm_pdu_t *pmi_pdu = &pm_list->pmi_pdu[i];
|
||||
pmi_pdu->pm_idx = i+1;
|
||||
pmi_pdu->numLayers = num_layers;
|
||||
pmi_pdu->num_ant_ports = num_ant_ports;
|
||||
for (int j = 0; j < num_layers; j++) {
|
||||
for (int k = 0; k < num_ant_ports; k++) {
|
||||
nfapi_nr_pm_weights_t* pm_weight = &pmi_pdu->weights[j][k];
|
||||
pm_weight->precoder_weight_Re = (int16_t)rand16_range(1, 0xffff);
|
||||
pm_weight->precoder_weight_Im = (int16_t)rand16_range(1, 0xffff);
|
||||
}
|
||||
}
|
||||
}
|
||||
nfapi_resp->num_tlv++;
|
||||
}
|
||||
|
||||
nfapi_resp->nfapi_config.p7_vnf_address_ipv4.tl.tag = NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG;
|
||||
for (int i = 0; i < NFAPI_IPV4_ADDRESS_LENGTH; ++i) {
|
||||
nfapi_resp->nfapi_config.p7_vnf_address_ipv4.address[i] = rand8();
|
||||
|
||||
Reference in New Issue
Block a user