Commit 04e6828c authored by Rúben Soares Silva's avatar Rúben Soares Silva

Change functions using RX_DATA.indication PDU_Length to expect 32 bits

parent e1885f65
...@@ -3177,18 +3177,16 @@ uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t * ...@@ -3177,18 +3177,16 @@ uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *
static uint8_t pack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value, uint8_t **ppWritePackedMsg, uint8_t *end) 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)
if(!(push32(value->handle, ppWritePackedMsg, end) && && push16(value->rnti, ppWritePackedMsg, end)
push16(value->rnti, ppWritePackedMsg, end) && && push8(value->harq_id, ppWritePackedMsg, end)
push8(value->harq_id, ppWritePackedMsg, end) && && push32(value->pdu_length, ppWritePackedMsg, end)
push16(value->pdu_length, ppWritePackedMsg, end) && && push8(value->ul_cqi, ppWritePackedMsg, end)
push8(value->ul_cqi, ppWritePackedMsg, end) && && push16(value->timing_advance, ppWritePackedMsg, end)
push16(value->timing_advance, ppWritePackedMsg, end) && && push16(value->rssi, ppWritePackedMsg, end)))
push16(value->rssi, ppWritePackedMsg, end)
))
return 0; return 0;
if(pusharray8(value->pdu, value->pdu_length, value->pdu_length, ppWritePackedMsg, end) == 0) if (pusharray8(value->pdu, value->pdu_length, value->pdu_length, ppWritePackedMsg, end) == 0)
return 0; return 0;
return 1; return 1;
...@@ -6066,19 +6064,18 @@ static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value, ...@@ -6066,19 +6064,18 @@ static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value,
uint8_t *end, uint8_t *end,
nfapi_p7_codec_config_t *config) nfapi_p7_codec_config_t *config)
{ {
if (!(pull32(ppReadPackedMsg, &value->handle, end) && pull16(ppReadPackedMsg, &value->rnti, end) if (!(pull32(ppReadPackedMsg, &value->handle, end) && pull16(ppReadPackedMsg, &value->rnti, end)
&& pull8(ppReadPackedMsg, &value->harq_id, end) && pull16(ppReadPackedMsg, (uint16_t *)&value->pdu_length, end) && pull8(ppReadPackedMsg, &value->harq_id, end) && pull32(ppReadPackedMsg, &value->pdu_length, end)
&& pull8(ppReadPackedMsg, &value->ul_cqi, end) && pull16(ppReadPackedMsg, &value->timing_advance, end) && pull8(ppReadPackedMsg, &value->ul_cqi, end) && pull16(ppReadPackedMsg, &value->timing_advance, end)
&& pull16(ppReadPackedMsg, &value->rssi, end))) && pull16(ppReadPackedMsg, &value->rssi, end)))
return 0; return 0;
uint32_t length = value->pdu_length; value->pdu = nfapi_p7_allocate(sizeof(*value->pdu) * value->pdu_length, config);
value->pdu = nfapi_p7_allocate(sizeof(*value->pdu) * length, config); if (pullarray8(ppReadPackedMsg, value->pdu, value->pdu_length, value->pdu_length, end) == 0) {
if (pullarray8(ppReadPackedMsg, value->pdu, length, length, end) == 0) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pullarray8 failure\n", __FUNCTION__);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pullarray8 failure\n", __FUNCTION__); return 0;
return 0; }
} return 1;
return 1;
} }
static uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_rx_data_indication_t *msg, nfapi_p7_codec_config_t* config) static uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_rx_data_indication_t *msg, nfapi_p7_codec_config_t* config)
......
...@@ -644,7 +644,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -644,7 +644,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
const sub_frame_t slotP, const sub_frame_t slotP,
const rnti_t rntiP, const rnti_t rntiP,
uint8_t *sduP, uint8_t *sduP,
const uint16_t sdu_lenP, const uint32_t sdu_lenP,
const uint16_t timing_advance, const uint16_t timing_advance,
const uint8_t ul_cqi, const uint8_t ul_cqi,
const uint16_t rssi) const uint16_t rssi)
...@@ -939,7 +939,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -939,7 +939,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const sub_frame_t slotP, const sub_frame_t slotP,
const rnti_t rntiP, const rnti_t rntiP,
uint8_t *sduP, uint8_t *sduP,
const uint16_t sdu_lenP, const uint32_t sdu_lenP,
const uint16_t timing_advance, const uint16_t timing_advance,
const uint8_t ul_cqi, const uint8_t ul_cqi,
const uint16_t rssi) const uint16_t rssi)
......
...@@ -343,7 +343,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -343,7 +343,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const sub_frame_t subframeP, const sub_frame_t subframeP,
const rnti_t rntiP, const rnti_t rntiP,
uint8_t * sduP, uint8_t * sduP,
const uint16_t sdu_lenP, const uint32_t sdu_lenP,
const uint16_t timing_advance, const uint16_t timing_advance,
const uint8_t ul_cqi, const uint8_t ul_cqi,
const uint16_t rssi); const uint16_t rssi);
......
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