Commit 8e59ef77 authored by Rúben Soares da Silva's avatar Rúben Soares da Silva Committed by Robert Schmidt

Fix Packing and Unpacking procedures for FAPI P7 messages

Creation and usage of packing/unpacking functions for DCI payload

Update Proxy commit id for CI

Apply formatting on changed functions and fix pull/push return value checking
parent 9127258a
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<eNB_instance>1</eNB_instance> <eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId> <eNB_serverId>1</eNB_serverId>
<forced_workspace_cleanup>True</forced_workspace_cleanup> <forced_workspace_cleanup>True</forced_workspace_cleanup>
<proxy_commit>f390610304baf6b66e4ec8cc00bf91398a651172</proxy_commit> <proxy_commit>b64d9bce986b38ca59e8582864ade3fcdd05c0dc</proxy_commit>
</testCase> </testCase>
</testCaseList> </testCaseList>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<eNB_instance>1</eNB_instance> <eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId> <eNB_serverId>1</eNB_serverId>
<forced_workspace_cleanup>True</forced_workspace_cleanup> <forced_workspace_cleanup>True</forced_workspace_cleanup>
<proxy_commit>f390610304baf6b66e4ec8cc00bf91398a651172</proxy_commit> <proxy_commit>b64d9bce986b38ca59e8582864ade3fcdd05c0dc</proxy_commit>
</testCase> </testCase>
</testCaseList> </testCaseList>
...@@ -1070,6 +1070,7 @@ int phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) { ...@@ -1070,6 +1070,7 @@ int phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) {
rx_ind->pdu_list[j].rnti = ind->pdu_list[j].rnti; rx_ind->pdu_list[j].rnti = ind->pdu_list[j].rnti;
rx_ind->pdu_list[j].timing_advance = ind->pdu_list[j].timing_advance; rx_ind->pdu_list[j].timing_advance = ind->pdu_list[j].timing_advance;
rx_ind->pdu_list[j].ul_cqi = ind->pdu_list[j].ul_cqi; rx_ind->pdu_list[j].ul_cqi = ind->pdu_list[j].ul_cqi;
rx_ind->pdu_list[j].rssi = ind->pdu_list[j].rssi;
} }
if (!put_queue(&gnb_rx_ind_queue, rx_ind)) if (!put_queue(&gnb_rx_ind_queue, rx_ind))
{ {
......
...@@ -77,6 +77,9 @@ uint8_t unpackarray(uint8_t **ppReadPackedMsg, ...@@ -77,6 +77,9 @@ uint8_t unpackarray(uint8_t **ppReadPackedMsg,
uint8_t *end, uint8_t *end,
unpack_array_elem_fn fn); unpack_array_elem_fn fn);
uint32_t pack_dci_payload(uint8_t payload[], uint16_t payloadSizeBits, uint8_t **out, uint8_t *end);
uint32_t unpack_dci_payload(uint8_t payload[], uint16_t payloadSizeBits, uint8_t **in, uint8_t *end);
uint8_t pack_tl(nfapi_tl_t *tl, uint8_t **ppWritePackedMsg, uint8_t *end); uint8_t pack_tl(nfapi_tl_t *tl, uint8_t **ppWritePackedMsg, uint8_t *end);
uint8_t unpack_tl(uint8_t **ppReadPackedMsg, nfapi_tl_t *tl, uint8_t *end); uint8_t unpack_tl(uint8_t **ppReadPackedMsg, nfapi_tl_t *tl, uint8_t *end);
......
...@@ -932,6 +932,8 @@ typedef struct ...@@ -932,6 +932,8 @@ typedef struct
typedef struct typedef struct
{ {
uint16_t bwp_size; // Needed for SCF222 10.02
uint16_t bwp_start; // Needed for SCF222 10.02
uint8_t subcarrier_spacing; // subcarrierSpacing [3GPP TS 38.211, sec 4.2], Value:0->4 uint8_t subcarrier_spacing; // subcarrierSpacing [3GPP TS 38.211, sec 4.2], Value:0->4
uint8_t cyclic_prefix; // Cyclic prefix type [3GPP TS 38.211, sec 4.2], 0: Normal; 1: Extended uint8_t cyclic_prefix; // Cyclic prefix type [3GPP TS 38.211, sec 4.2], 0: Normal; 1: Extended
uint16_t start_rb; // PRB where this CSI resource starts related to common resource block #0 (CRB#0). Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSIFrequencyOccupation], Value: 0 ->274 uint16_t start_rb; // PRB where this CSI resource starts related to common resource block #0 (CRB#0). Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSIFrequencyOccupation], Value: 0 ->274
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <execinfo.h> #include <execinfo.h>
#include <nfapi_interface.h> #include <nfapi_interface.h>
#include <nfapi_nr_interface_scf.h>
#include <nfapi.h> #include <nfapi.h>
#include <debug.h> #include <debug.h>
...@@ -544,6 +545,43 @@ uint8_t unpackarray(uint8_t **ppReadPackedMsg, void *array, uint16_t array_eleme ...@@ -544,6 +545,43 @@ uint8_t unpackarray(uint8_t **ppReadPackedMsg, void *array, uint16_t array_eleme
return 1; return 1;
} }
uint32_t pack_dci_payload(uint8_t payload[], uint16_t payloadSizeBits, uint8_t **out, uint8_t *end)
{
// Helper vars for DCI Payload
uint8_t dci_bytes_inverted[DCI_PAYLOAD_BYTE_LEN];
uint8_t dci_byte_len = (payloadSizeBits + 7) / 8;
// Align the dci payload bits to the left on the payload buffer
uint64_t *dci_pdu = (uint64_t *)payload;
if (payloadSizeBits % 8 != 0) {
uint8_t rotation_bits = 8 - (payloadSizeBits % 8);
*dci_pdu = (*dci_pdu << rotation_bits);
}
// Invert the byte order of the DCI Payload
for (int j = 0; j < dci_byte_len; j++) {
dci_bytes_inverted[j] = payload[(dci_byte_len - 1) - j];
}
return pusharray8(dci_bytes_inverted, DCI_PAYLOAD_BYTE_LEN, dci_byte_len, out, end);
}
uint32_t unpack_dci_payload(uint8_t payload[], uint16_t payloadSizeBits, uint8_t **in, uint8_t *end)
{
// Pull the inverted DCI and invert it back
// Helper vars for DCI Payload
uint8_t dci_bytes_inverted[DCI_PAYLOAD_BYTE_LEN];
uint8_t dci_byte_len = (payloadSizeBits + 7) / 8;
// Get DCI array inverted
uint32_t pullresult = pullarray8(in, dci_bytes_inverted, DCI_PAYLOAD_BYTE_LEN, dci_byte_len, end);
uint64_t *dci_pdu = (uint64_t *)payload;
// Reversing the byte order of the inverted DCI payload
for (uint16_t j = 0; j < dci_byte_len; j++) {
payload[j] = dci_bytes_inverted[(dci_byte_len - 1) - j];
}
if (payloadSizeBits % 8 != 0) {
uint8_t rotation_bits = 8 - (payloadSizeBits % 8);
*dci_pdu = (*dci_pdu >> rotation_bits);
}
return pullresult;
}
uint32_t pack_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { uint32_t pack_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) {
if(ve != 0 && config != 0) { if(ve != 0 && config != 0) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -253,14 +253,13 @@ int nfapi_pnf_ue_release_resp(nfapi_pnf_p7_config_t* config, nfapi_ue_release_re ...@@ -253,14 +253,13 @@ int nfapi_pnf_ue_release_resp(nfapi_pnf_p7_config_t* config, nfapi_ue_release_re
int nfapi_pnf_p7_nr_slot_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_slot_indication_scf_t* ind) int nfapi_pnf_p7_nr_slot_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_slot_indication_scf_t* ind)
{ {
if(config == NULL || ind == NULL) if (config == NULL || ind == NULL) {
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__); NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1; return -1;
} }
pnf_p7_t* _this = (pnf_p7_t*)(config); pnf_p7_t* _this = (pnf_p7_t*)(config);
return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nr_rx_data_indication_t)); return pnf_nr_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_nr_slot_indication_scf_t));
} }
int nfapi_pnf_p7_nr_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind) int nfapi_pnf_p7_nr_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind)
......
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