Commit 6d54870f authored by Rúben Soares Silva's avatar Rúben Soares Silva Committed by Robert Schmidt

Fix SRS.indication unpacking for Aerial.

When using Aerial, the Report TLV on SRS.indication is transported in a different buffer, as such, it needs to be unpacked separately.
parent 91a75fe4
......@@ -250,9 +250,14 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg)
}
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: {
uint8_t *pReadData = msg->data_buf;
int dataBufLen = msg->data_len;
uint8_t *data_end = msg->data_buf + dataBufLen;
nfapi_nr_srs_indication_t ind;
aerial_unpack_nr_srs_indication(&pReadPackedMessage,
end,
&pReadData,
data_end,
&ind,
&((vnf_p7_t *)((vnf_info *)vnf_config->user_data)->p7_vnfs->config)->_public.codec_config);
if (((vnf_info *)vnf_config->user_data)->p7_vnfs->config->nr_srs_indication) {
......
......@@ -502,9 +502,25 @@ uint8_t aerial_unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end,
return unpack_nr_uci_indication(ppReadPackedMsg, end, msg, config);
}
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config)
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
uint8_t *end,
uint8_t **pDataMsg,
uint8_t *data_end,
void *msg,
nfapi_p7_codec_config_t *config)
{
return unpack_nr_srs_indication(ppReadPackedMsg, end, msg, config);
uint8_t retval = unpack_nr_srs_indication(ppReadPackedMsg, end, msg, config);
nfapi_nr_srs_indication_t *srs_ind = (nfapi_nr_srs_indication_t *)msg;
for (uint8_t pdu_idx = 0; pdu_idx < srs_ind->number_of_pdus; pdu_idx++) {
nfapi_nr_srs_indication_pdu_t *pdu = &srs_ind->pdu_list[pdu_idx];
nfapi_srs_report_tlv_t *report_tlv = &pdu->report_tlv;
for (int i = 0; i < (report_tlv->length + 3) / 4; i++) {
if (!pull32(pDataMsg, &report_tlv->value[i], data_end)) {
return 0;
}
}
}
return retval;
}
uint8_t aerial_unpack_nr_rach_indication(uint8_t **ppReadPackedMsg,
......
......@@ -217,7 +217,12 @@ uint8_t aerial_unpack_nr_crc_indication(uint8_t **ppReadPackedMsg,
nfapi_nr_crc_indication_t *msg,
nfapi_p7_codec_config_t *config);
uint8_t aerial_unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config);
uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg,
uint8_t *end,
uint8_t **pDataMsg,
uint8_t *data_end,
void *msg,
nfapi_p7_codec_config_t *config);
uint8_t aerial_unpack_nr_rach_indication(uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_nr_rach_indication_t *msg,
......
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