Commit 30dfc645 authored by Melissa's avatar Melissa

Merge branch 'episys/david/nfapi_update_in_x2_trigger_nsa' into 'episys/x2_trigger_nsa'

nFAPI library update from IISc

See merge request aburger/openairinterface5g!40
parents dc2865f3 ef56a5dd
......@@ -395,7 +395,7 @@ set (FIRMWARE_VERSION "No svn information")
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
add_definitions("-DEMIT_ASN_DEBUG=1")
add_definitions("-DASN_EMIT_DEBUG=1")
# Debug related options
......
......@@ -2402,3 +2402,36 @@ int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind) {
//free(ind.rx_indication_body.rx_pdu_list);
return retval;
}
//NR UPLINK INDICATION
int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) {
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION;
return nfapi_pnf_p7_nr_rx_data_ind(p7_config_g, ind);
}
int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) {
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION;
return nfapi_pnf_p7_nr_crc_ind(p7_config_g, ind);
}
int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) {
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION;
return nfapi_pnf_p7_nr_srs_ind(p7_config_g, ind);
}
int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) {
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION;
return nfapi_pnf_p7_nr_uci_ind(p7_config_g, ind);
}
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) {
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION;
return nfapi_pnf_p7_nr_rach_ind(p7_config_g, ind);
}
......@@ -124,7 +124,7 @@ typedef struct {
// Convenience methods to convert between SFN/SLOT formats
#define NFAPI_SFNSLOT2DEC(_sfn,_slot) ( _sfn*20 + _slot ) // total count of slots
#define NFAPI_SFNSLOTDEC2SFNSLOT(_sfnslot_dec) ((((_sfnslot_dec) / 20) << 4) | (((_sfnslot_dec) - (((_sfnslot_dec) / 20) * 10)) & 0x3F))
#define NFAPI_SFNSLOTDEC2SFNSLOT(_sfnslot_dec) ((((_sfnslot_dec) / 20) << 6) | (((_sfnslot_dec) - (((_sfnslot_dec) / 20) * 20)) & 0x3F))
#define NFAPI_SFNSLOT2SFN(_sfnslot) ((_sfnslot) >> 6)
#define NFAPI_SFNSLOT2SLOT(_sfnslot) ((_sfnslot) & 0x3F)
......
......@@ -1518,10 +1518,11 @@ typedef struct
typedef struct
{
nfapi_p7_message_header_t header;
uint16_t sfn;
uint16_t slot;
uint16_t number_of_pdus;
nfapi_nr_rx_data_pdu_t* pdu_list;
nfapi_nr_rx_data_pdu_t *pdu_list; //changed from pointer to struct - gokul
} nfapi_nr_rx_data_indication_t;
......@@ -1544,6 +1545,7 @@ typedef struct
typedef struct
{
nfapi_p7_message_header_t header;
uint16_t sfn;
uint16_t slot;
uint16_t number_crcs;
......@@ -1681,6 +1683,7 @@ typedef struct
typedef struct
{
nfapi_p7_message_header_t header;
uint16_t sfn;
uint16_t slot;
uint16_t num_ucis;
......@@ -1717,6 +1720,7 @@ typedef struct
typedef struct
{
nfapi_p7_message_header_t header;
uint16_t sfn;
uint16_t slot;
uint8_t number_of_pdus;
......@@ -1749,6 +1753,7 @@ typedef struct{
typedef struct
{
nfapi_p7_message_header_t header;
uint16_t sfn;
uint16_t slot;
uint8_t number_of_pdus;
......
......@@ -3366,6 +3366,308 @@ static uint8_t pack_nr_timing_info(void *msg, uint8_t **ppWritePackedMsg, uint8_
}
//NR UPLINK indication function packing
//RX DATA INDICATION
static uint8_t pack_nr_rx_data_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv;
if(!(push32(value->handle, ppWritePackedMsg, end) &&
push16(value->rnti, ppWritePackedMsg, end) &&
push8(value->harq_id, ppWritePackedMsg, end) &&
push16(value->pdu_length, ppWritePackedMsg, end) &&
push8(value->ul_cqi, ppWritePackedMsg, end) &&
push16(value->timing_advance, ppWritePackedMsg, end) &&
push16(value->rssi, ppWritePackedMsg, end)
))
return 0;
return 1;
}
static uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{
nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t*)msg;
if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) &&
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end)
))
return 0;
for(int i=0; i<pNfapiMsg->number_of_pdus;i++)
{
if(!pack_nr_rx_data_indication_body(pNfapiMsg->pdu_list,ppWritePackedMsg,end))
return 0;
}
return 1;
}
//NR CRC INDICATION
static uint8_t pack_nr_crc_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_crc_t* value = (nfapi_nr_crc_t*)tlv;
if(!(push32(value->handle, ppWritePackedMsg, end) &&
push16(value->rnti, ppWritePackedMsg, end) &&
push8(value->harq_id, ppWritePackedMsg, end) &&
push8(value->tb_crc_status, ppWritePackedMsg, end) &&
push16(value->num_cb, ppWritePackedMsg, end) &&
//pusharray8(value->cb_crc_status, (int)(value->num_cb / 8) + 1, (int)(value->num_cb / 8) + 1, ppWritePackedMsg, end) && //length is ceil(NumCb/8)
push8(value->ul_cqi, ppWritePackedMsg, end) &&
push16(value->timing_advance, ppWritePackedMsg, end) &&
push16(value->rssi, ppWritePackedMsg, end)
))
return 0;
return 1;
}
static uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{
nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t*)msg;
if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) &&
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
push16(pNfapiMsg->number_crcs, ppWritePackedMsg, end)
))
return 0;
for(int i=0; i<pNfapiMsg->number_crcs;i++)
{
if(!pack_nr_crc_indication_body(pNfapiMsg->crc_list,ppWritePackedMsg,end))
return 0;
}
return 1;
}
//SRS INDICATION
static uint8_t pack_nr_srs_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_srs_indication_pdu_t* value = (nfapi_nr_srs_indication_pdu_t*)tlv;
if(!(push32(value->handle, ppWritePackedMsg, end) &&
push16(value->rnti, ppWritePackedMsg, end) &&
push16(value->timing_advance, ppWritePackedMsg, end) &&
push8(value->num_symbols, ppWritePackedMsg, end) &&
push8(value->wide_band_snr, ppWritePackedMsg, end) &&
push8(value->num_reported_symbols, ppWritePackedMsg, end) &&
push8(value->reported_symbol_list->num_rbs, ppWritePackedMsg, end)
))
return 0;
for(int i = 0; i < value->reported_symbol_list->num_rbs; i++)
{
if(!(push8(value->reported_symbol_list->rb_list->rb_snr, ppWritePackedMsg, end)
))
return 0;
}
return 1;
}
static uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{
nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t*)msg;
if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) &&
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end)
))
return 0;
for(int i=0; i<pNfapiMsg->number_of_pdus;i++)
{
if(!pack_nr_srs_indication_body(&(pNfapiMsg->pdu_list[i]),ppWritePackedMsg,end))
return 0;
}
return 1;
}
//RACH INDICATION
static uint8_t pack_nr_rach_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_prach_indication_pdu_t* value = (nfapi_nr_prach_indication_pdu_t*)tlv;
if(!(push16(value->phy_cell_id, ppWritePackedMsg, end) &&
push8(value->symbol_index, ppWritePackedMsg, end) &&
push8(value->slot_index, ppWritePackedMsg, end) &&
push8(value->freq_index, ppWritePackedMsg, end) &&
push8(value->avg_rssi, ppWritePackedMsg, end) &&
push8(value->avg_snr, ppWritePackedMsg, end) &&
push8(value->num_preamble, ppWritePackedMsg, end)
))
return 0;
for(int i = 0; i < value->num_preamble; i++)
{
if(!(push8(value->preamble_list->preamble_index, ppWritePackedMsg, end) &&
push16(value->preamble_list->timing_advance, ppWritePackedMsg, end) &&
push32(value->preamble_list->preamble_pwr, ppWritePackedMsg, end)
))
return 0;
}
return 1;
}
static uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{
nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t*)msg;
if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) &&
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end)
))
return 0;
for(int i=0; i<pNfapiMsg->number_of_pdus;i++)
{
if(!pack_nr_rach_indication_body(&(pNfapiMsg->pdu_list[i]),ppWritePackedMsg,end))
return 0;
}
return 1;
}
//UCI INDICATION
static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) {
nfapi_nr_uci_pucch_pdu_format_0_1_t* value = (nfapi_nr_uci_pucch_pdu_format_0_1_t*)tlv;
if(!(push8(value->pduBitmap, ppWritePackedMsg, end) &&
push32(value->handle, ppWritePackedMsg, end) &&
push16(value->rnti, ppWritePackedMsg, end) &&
push8(value->pucch_format, ppWritePackedMsg, end) &&
push8(value->ul_cqi, ppWritePackedMsg, end) &&
push16(value->timing_advance, ppWritePackedMsg, end) &&
push16(value->rssi, ppWritePackedMsg, end)
))
return 0;
if (value->pduBitmap & 0x01) { //SR
if(!(push8(value->sr->sr_indication, ppWritePackedMsg, end) &&
push8(value->sr->sr_confidence_level, ppWritePackedMsg, end)
))
return 0;
}
if (((value->pduBitmap >> 1) & 0x01)) { //HARQ
if(!(push8(value->harq->num_harq, ppWritePackedMsg, end) &&
push8(value->harq->harq_confidence_level, ppWritePackedMsg, end)
))
return 0;
for(int i=0; i<value->harq->num_harq;i++)
{
if(!(push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end)
))
return 0;
}
}
return 1;
}
static uint8_t pack_nr_uci_pucch_2_3_4(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) {
nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv;
if(!(push8(value->pduBitmap, ppWritePackedMsg, end) &&
push32(value->handle, ppWritePackedMsg, end) &&
push16(value->rnti, ppWritePackedMsg, end) &&
push8(value->pucch_format, ppWritePackedMsg, end) &&
push8(value->ul_cqi, ppWritePackedMsg, end) &&
push16(value->timing_advance, ppWritePackedMsg, end) &&
push16(value->rssi, ppWritePackedMsg, end)
))
return 0;
if (value->pduBitmap & 0x01) { //SR
if(!(push8(value->sr.sr_bit_len, ppWritePackedMsg, end) &&
pusharray8(value->sr.sr_payload, (int)(value->sr.sr_bit_len / 8) + 1, (int)(value->sr.sr_bit_len / 8) + 1, ppWritePackedMsg, end)
))
return 0;
}
if (((value->pduBitmap >> 1) & 0x01)) { //HARQ
if(!(push8(value->harq.harq_crc, ppWritePackedMsg, end) &&
push8(value->harq.harq_bit_len, ppWritePackedMsg, end) &&
pusharray8(value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8) + 1, (int)(value->harq.harq_bit_len / 8) + 1, ppWritePackedMsg, end)
))
return 0;
}
if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1
if(!(push8(value->csi_part1.csi_part1_crc, ppWritePackedMsg, end) &&
push8(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end) &&
pusharray8(value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, ppWritePackedMsg, end)
))
return 0;
}
if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2
if(!(push8(value->csi_part2.csi_part2_crc, ppWritePackedMsg, end) &&
push8(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end) &&
pusharray8(value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, ppWritePackedMsg, end)
))
return 0;
}
return 1;
}
static uint8_t pack_nr_uci_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_uci_t* value = (nfapi_nr_uci_t*)tlv;
if(!(push16(value->pdu_type, ppWritePackedMsg, end) &&
push16(value->pdu_size, ppWritePackedMsg, end)
))
return 0;
switch (value->pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
printf("Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
break;
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &value->pucch_pdu_format_0_1;
pack_nr_uci_pucch_0_1(uci_pdu, ppWritePackedMsg, end);
break;
}
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
pack_nr_uci_pucch_2_3_4(uci_pdu, ppWritePackedMsg, end);
break;
}
}
return 1;
}
static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{
nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg;
if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) &&
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
push16(pNfapiMsg->num_ucis, ppWritePackedMsg, end)
))
return 0;
for(int i=0; i<pNfapiMsg->num_ucis;i++)
{
if(!pack_nr_uci_indication_body(&(pNfapiMsg->uci_list[i]),ppWritePackedMsg,end))
return 0;
}
return 1;
}
// Main pack function - public
......@@ -3431,49 +3733,24 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe
result =pack_ue_release_response(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_HARQ_INDICATION:
result = pack_harq_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_CRC_INDICATION:
result = pack_crc_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_RX_ULSCH_INDICATION:
//printf("RX ULSCH\n");
result = pack_rx_ulsch_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_RACH_INDICATION:
result = pack_rach_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_SRS_INDICATION:
result = pack_srs_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_RX_SR_INDICATION:
result = pack_sr_indication(pMessageHeader, &pWritePackedMessage, end, config);
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
result = pack_nr_rx_data_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_RX_CQI_INDICATION:
result = pack_cqi_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_LBT_DL_CONFIG_REQUEST:
result = pack_lbt_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config);
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
result = pack_nr_crc_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_LBT_DL_INDICATION:
result = pack_lbt_dl_indication(pMessageHeader, &pWritePackedMessage, end, config);
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
result = pack_nr_uci_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_NB_HARQ_INDICATION:
result = pack_nb_harq_indication(pMessageHeader, &pWritePackedMessage, end, config);
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_NRACH_INDICATION:
result = pack_nrach_indication(pMessageHeader, &pWritePackedMessage, end, config);
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
......@@ -3589,7 +3866,6 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
switch (pMessageHeader->message_id)
{
case NFAPI_DL_CONFIG_REQUEST:
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST\n", __FUNCTION__);
result = pack_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config);
break;
......@@ -3597,7 +3873,6 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
result = pack_ul_config_request(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_TX_REQUEST:
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__);
result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config);
break;
case NFAPI_HI_DCI0_REQUEST:
......@@ -3621,7 +3896,6 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
break;
case NFAPI_RX_ULSCH_INDICATION:
//printf("RX ULSCH\n");
result = pack_rx_ulsch_indication(pMessageHeader, &pWritePackedMessage, end, config);
break;
......@@ -6087,6 +6361,334 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
return 1;
}
//UNPACK NR UPLINK INDICATION FUNCTIONS
//RX DATA INDICATION
static uint8_t unpack_nr_rx_data_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv;
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull8(ppReadPackedMsg, &value->harq_id, end) &&
pull16(ppReadPackedMsg, &value->pdu_length, end) &&
pull8(ppReadPackedMsg, &value->ul_cqi, end) &&
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
pull16(ppReadPackedMsg, &value->rssi, end)
))
return 0;
return 1;
}
static uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{
// uint8_t *ptr = *ppReadPackedMsg;
// printf("\n Read P7 message rx data indication unpack: ");
// while(ptr < end){
// printf(" %d ", *ptr);
// ptr++;
// }
// printf("\n");
nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t*)msg;
printf("\n");
if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end)
))
return 0;
for(int i=0; i<pNfapiMsg->number_of_pdus;i++)
{
if(!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list, ppReadPackedMsg, end))
return 0;
}
return 1;
}
//NR CRC INDICATION
static uint8_t unpack_nr_crc_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_nr_crc_t* value = (nfapi_nr_crc_t*)tlv;
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull8(ppReadPackedMsg, &value->harq_id, end) &&
pull8(ppReadPackedMsg, &value->tb_crc_status, end) &&
pull16(ppReadPackedMsg, &value->num_cb, end) &&
//pullarray8(ppReadPackedMsg, value->cb_crc_status, (int)(value->num_cb / 8) + 1, (int)(value->num_cb / 8) + 1, end) && //length is ceil(NumCb/8)
pull8(ppReadPackedMsg, &value->ul_cqi, end) &&
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
pull16(ppReadPackedMsg, &value->rssi, end)
))
return 0;
return 1;
}
static uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{
uint8_t *ptr = *ppReadPackedMsg;
// printf("\n Read P7 message indication unpack: ");
// while(ptr < end){
// printf(" %d ", *ptr);
// ptr++;
// }
// printf("\n");
nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t*)msg;
if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->number_crcs, end)
))
return 0;
for(int i=0; i<pNfapiMsg->number_crcs;i++)
{
if(!unpack_nr_crc_indication_body(&pNfapiMsg->crc_list,ppReadPackedMsg,end))
return 0;
}
return 1;
}
//SRS INDICATION
static uint8_t unpack_nr_srs_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_nr_srs_indication_pdu_t* value = (nfapi_nr_srs_indication_pdu_t*)tlv;
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
pull8(ppReadPackedMsg, &value->num_symbols, end) &&
pull8(ppReadPackedMsg, &value->wide_band_snr, end) &&
pull8(ppReadPackedMsg, &value->num_reported_symbols, end) &&
pull16(ppReadPackedMsg, &value->reported_symbol_list->num_rbs, end)
))
return 0;
for(int i = 0; i < value->reported_symbol_list->num_rbs; i++)
{
if(!(pull8(ppReadPackedMsg, &value->reported_symbol_list->rb_list->rb_snr, end)
))
return 0;
}
return 1;
}
static uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{
nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t*)msg;
if (!(pull16(ppReadPackedMsg,&pNfapiMsg->sfn , end) &&
pull16(ppReadPackedMsg,&pNfapiMsg->slot , end) &&
pull8(ppReadPackedMsg,&pNfapiMsg->number_of_pdus, end)
))
return 0;
for(int i=0; i<pNfapiMsg->number_of_pdus;i++)
{
if(!unpack_nr_srs_indication_body(&pNfapiMsg->pdu_list,ppReadPackedMsg,end))
return 0;
}
return 1;
}
//NR RACH
static uint8_t unpack_nr_rach_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_nr_prach_indication_pdu_t* value = (nfapi_nr_prach_indication_pdu_t*)tlv;
if(!(pull16(ppReadPackedMsg, &value->phy_cell_id, end) &&
pull8(ppReadPackedMsg, &value->symbol_index, end) &&
pull8(ppReadPackedMsg, &value->slot_index, end) &&
pull8(ppReadPackedMsg, &value->freq_index, end) &&
pull8(ppReadPackedMsg, &value->avg_rssi, end) &&
pull8(ppReadPackedMsg, &value->avg_snr, end) &&
pull8(ppReadPackedMsg, &value->num_preamble, end)
))
return 0;
for(int i = 0; i < value->num_preamble; i++)
{
if(!(pull8(ppReadPackedMsg, &value->preamble_list->preamble_index, end) &&
pull16(ppReadPackedMsg, &value->preamble_list->timing_advance, end) &&
pull32(ppReadPackedMsg, &value->preamble_list->preamble_pwr, end)
))
return 0;
}
return 1;
}
static uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) {
nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t*)msg;
if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) &&
pull8(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end)
))
return 0;
for(int i=0; i< pNfapiMsg->number_of_pdus;i++)
{
if(!unpack_nr_rach_indication_body(&pNfapiMsg->pdu_list,ppReadPackedMsg,end))
return 0;
}
return 1;
}
//NR UCI
static uint8_t unpack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) {
nfapi_nr_uci_pucch_pdu_format_0_1_t* value = (nfapi_nr_uci_pucch_pdu_format_0_1_t*)tlv;
uint8_t *ptr = *ppReadPackedMsg;
printf("\n Read P7 message uci_0_1 indication unpack: ");
while(ptr < end){
printf(" %d ", *ptr);
ptr++;
}
printf("\n");
if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) &&
pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull8(ppReadPackedMsg, &value->pucch_format, end) &&
pull8(ppReadPackedMsg, &value->ul_cqi, end) &&
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
pull16(ppReadPackedMsg, &value->rssi, end)
))
return 0;
if (value->pduBitmap & 0x01) { //SR
if(!(pull8(ppReadPackedMsg, &value->sr->sr_indication, end) &&
pull8(ppReadPackedMsg, &value->sr->sr_confidence_level, end)
))
return 0;
}
// if (((value->pduBitmap >> 1) & 0x01)) { //HARQ
// uint8_t* temp; //&value->harq->num_harq &value->harq->harq_confidence_level &value->harq->harq_list[0].harq_value
// temp = (uint8_t*) malloc(sizeof(uint8_t));
// //printf("value->harq->num_harq = %d \n", value->harq->num_harq);
// // if(!(pull8(ppReadPackedMsg, temp, end) &&
// // pull8(ppReadPackedMsg, temp, end)
// // ))
// // return 0;
// // for(int i=0; i<1;i++)
// // {
// // if(!(pull8(ppReadPackedMsg, temp, end) //review - gokul
// // ))
// // return 0;
// // }
// }
return 1;
}
static uint8_t unpack_nr_uci_pucch_2_3_4(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) {
nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv;
if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) &&
pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull8(ppReadPackedMsg, &value->pucch_format, end) &&
pull8(ppReadPackedMsg, &value->ul_cqi, end) &&
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
pull16(ppReadPackedMsg, &value->rssi, end)
))
return 0;
if (value->pduBitmap & 0x01) { //SR
if(!(pull16(ppReadPackedMsg, &value->sr.sr_bit_len, end) &&
pullarray8(ppReadPackedMsg, value->sr.sr_payload, (int)(value->sr.sr_bit_len / 8) + 1, (int)(value->sr.sr_bit_len / 8) + 1, end)
))
return 0;
}
if (((value->pduBitmap >> 1) & 0x01)) { //HARQ
if(!(pull8(ppReadPackedMsg, &value->harq.harq_crc, end) &&
pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end) &&
pullarray8(ppReadPackedMsg, value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8) + 1, (int)(value->harq.harq_bit_len / 8) + 1, end)
))
return 0;
}
if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1
if(!(pull8(ppReadPackedMsg, &value->csi_part1.csi_part1_crc, end) &&
pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end) &&
pullarray8(ppReadPackedMsg, value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, end)
))
return 0;
}
if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2
if(!(pull8(ppReadPackedMsg, &value->csi_part2.csi_part2_crc, end) &&
pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end) &&
pullarray8(ppReadPackedMsg, value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, end)
))
return 0;
}
return 1;
}
static uint8_t unpack_nr_uci_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_nr_uci_t* value = (nfapi_nr_uci_t*)tlv;
if(!(pull16(ppReadPackedMsg, &value->pdu_type, end) &&
pull16(ppReadPackedMsg, &value->pdu_size, end)
))
return 0;
switch (value->pdu_type) {
case NFAPI_NR_UCI_PUSCH_PDU_TYPE:
printf("Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n");
break;
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu = &value->pucch_pdu_format_0_1;
unpack_nr_uci_pucch_0_1(&uci_pdu, ppReadPackedMsg, end);
break;
}
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: {
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4;
unpack_nr_uci_pucch_2_3_4(&uci_pdu, ppReadPackedMsg, end);
break;
}
}
return 1;
}
static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{
nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg;
if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->num_ucis, end)
))
return 0;
for(int i=0; i<pNfapiMsg->num_ucis;i++)
{
if(!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list,ppReadPackedMsg,end))
return 0;
}
return 1;
}
static uint8_t unpack_ue_release_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{
uint8_t proceed = 1;
......@@ -7734,62 +8336,32 @@ static int check_nr_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBuf
if (unpackedBufLen >= sizeof(nfapi_nr_tx_data_request_t))
retLen = sizeof(nfapi_nr_tx_data_request_t);
break;
case NFAPI_HARQ_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_harq_indication_t))
retLen = sizeof(nfapi_harq_indication_t);
break;
case NFAPI_CRC_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_crc_indication_t))
retLen = sizeof(nfapi_crc_indication_t);
break;
case NFAPI_RX_ULSCH_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_rx_indication_t))
retLen = sizeof(nfapi_rx_indication_t);
break;
case NFAPI_RACH_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_rach_indication_t))
retLen = sizeof(nfapi_rach_indication_t);
break;
case NFAPI_SRS_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_srs_indication_t))
retLen = sizeof(nfapi_srs_indication_t);
break;
case NFAPI_RX_SR_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_sr_indication_t))
retLen = sizeof(nfapi_sr_indication_t);
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_rx_data_indication_t))
retLen = sizeof(nfapi_nr_rx_data_indication_t);
break;
case NFAPI_RX_CQI_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_cqi_indication_t))
retLen = sizeof(nfapi_cqi_indication_t);
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_crc_indication_t))
retLen = sizeof(nfapi_nr_crc_indication_t);
break;
case NFAPI_LBT_DL_CONFIG_REQUEST:
if (unpackedBufLen >= sizeof(nfapi_lbt_dl_config_request_t))
retLen = sizeof(nfapi_lbt_dl_config_request_t);
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_rach_indication_t))
retLen = sizeof(nfapi_nr_rach_indication_t);
break;
case NFAPI_LBT_DL_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_lbt_dl_indication_t))
retLen = sizeof(nfapi_lbt_dl_indication_t);
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_uci_indication_t))
retLen = sizeof(nfapi_nr_uci_indication_t);
break;
case NFAPI_NB_HARQ_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nb_harq_indication_t))
retLen = sizeof(nfapi_nb_harq_indication_t);
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nr_srs_indication_t))
retLen = sizeof(nfapi_nr_srs_indication_t);
break;
case NFAPI_NRACH_INDICATION:
if (unpackedBufLen >= sizeof(nfapi_nrach_indication_t))
retLen = sizeof(nfapi_nrach_indication_t);
break;
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
if (unpackedBufLen >= sizeof(nfapi_nr_dl_node_sync_t))
retLen = sizeof(nfapi_nr_dl_node_sync_t);
......@@ -7965,9 +8537,7 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
case NFAPI_RX_ULSCH_INDICATION:
if (check_unpack_length(NFAPI_RX_ULSCH_INDICATION, unpackedBufLen))
{
result = unpack_rx_indication(&pReadPackedMessage, end, pMessageHeader, config);
}
else
return -1;
break;
......@@ -8101,15 +8671,15 @@ int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *
NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen);
return -1;
}
/*
uint8_t *ptr = pMessageBuf;
printf("\n Read P7 message unpack: ");
while(ptr < end){
printf(" %d ", *ptr);
ptr++;
}
printf("\n");
*/
// uint8_t *ptr = pMessageBuf;
// printf("\n Read P7 message unpack: ");
// while(ptr < end){
// printf(" %d ", *ptr);
// ptr++;
// }
// printf("\n");
// clean the supplied buffer for - tag value blanking
(void)memset(pUnpackedBuf, 0, unpackedBufLen);
......@@ -8175,83 +8745,41 @@ int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *
return -1;
break;
case NFAPI_HARQ_INDICATION:
if (check_nr_unpack_length(NFAPI_HARQ_INDICATION, unpackedBufLen))
result = unpack_harq_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_CRC_INDICATION:
if (check_nr_unpack_length(NFAPI_CRC_INDICATION, unpackedBufLen))
result = unpack_crc_indication(&pReadPackedMessage,end , pMessageHeader, config);
else
return -1;
break;
case NFAPI_RX_ULSCH_INDICATION:
if (check_nr_unpack_length(NFAPI_RX_ULSCH_INDICATION, unpackedBufLen))
result = unpack_rx_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_RACH_INDICATION:
if (check_nr_unpack_length(NFAPI_RACH_INDICATION, unpackedBufLen))
result = unpack_rach_indication(&pReadPackedMessage, end, pMessageHeader, config);
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION, unpackedBufLen))
result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_SRS_INDICATION:
if (check_nr_unpack_length(NFAPI_SRS_INDICATION, unpackedBufLen))
result = unpack_srs_indication(&pReadPackedMessage, end, pMessageHeader, config);
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION, unpackedBufLen))
result = unpack_nr_crc_indication(&pReadPackedMessage,end , pMessageHeader, config);
else
return -1;
break;
case NFAPI_RX_SR_INDICATION:
if (check_nr_unpack_length(NFAPI_RX_SR_INDICATION, unpackedBufLen))
result = unpack_sr_indication(&pReadPackedMessage, end, pMessageHeader, config);
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION, unpackedBufLen))
result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_RX_CQI_INDICATION:
if (check_nr_unpack_length(NFAPI_RX_CQI_INDICATION, unpackedBufLen))
result = unpack_cqi_indication(&pReadPackedMessage, end, pMessageHeader, config);
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION, unpackedBufLen))
result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_LBT_DL_CONFIG_REQUEST:
if (check_nr_unpack_length(NFAPI_LBT_DL_CONFIG_REQUEST, unpackedBufLen))
result = unpack_lbt_dl_config_request(&pReadPackedMessage, end, pMessageHeader, config);
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION, unpackedBufLen))
result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_LBT_DL_INDICATION:
if (check_nr_unpack_length(NFAPI_LBT_DL_INDICATION, unpackedBufLen))
result = unpack_lbt_dl_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_NB_HARQ_INDICATION:
if (check_nr_unpack_length(NFAPI_NB_HARQ_INDICATION, unpackedBufLen))
result = unpack_nb_harq_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_NRACH_INDICATION:
if (check_nr_unpack_length(NFAPI_NRACH_INDICATION, unpackedBufLen))
result = unpack_nrach_indication(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC, unpackedBufLen))
result = unpack_nr_dl_node_sync(&pReadPackedMessage, end, pMessageHeader, config);
......
......@@ -20,6 +20,8 @@
#include "nfapi_pnf_interface.h"
#define NFAPI_MAX_PACKED_MESSAGE_SIZE 8192
typedef struct {
nfapi_pnf_config_t _public;
......
......@@ -25,6 +25,8 @@
#include "nfapi_pnf_interface.h"
#define NFAPI_MAX_PACKED_MESSAGE_SIZE 8192
typedef struct {
uint16_t dl_conf_ontime;
uint16_t dl_tti_ontime;
......
......@@ -168,17 +168,7 @@ int nfapi_pnf_p7_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_rach_indication_t
pnf_p7_t* _this = (pnf_p7_t*)(config);
return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_rach_indication_t));
}
int nfapi_pnf_p7_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_srs_indication_t* ind)
{
if(config == NULL || ind == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
pnf_p7_t* _this = (pnf_p7_t*)(config);
return pnf_p7_pack_and_send_p7_message(_this, (nfapi_p7_message_header_t*)ind, sizeof(nfapi_srs_indication_t));
}
int nfapi_pnf_p7_sr_ind(nfapi_pnf_p7_config_t* config, nfapi_sr_indication_t* ind)
{
if(config == NULL || ind == NULL)
......@@ -258,3 +248,65 @@ int nfapi_pnf_ue_release_resp(nfapi_pnf_p7_config_t* config, nfapi_ue_release_re
return pnf_p7_pack_and_send_p7_message(_this, &(resp->header), sizeof(nfapi_ue_release_response_t));
}
//NR UPLINK INDICATION
int nfapi_pnf_p7_nr_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind)
{
if(config == NULL || ind == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
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));
}
int nfapi_pnf_p7_nr_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_crc_indication_t* ind)
{
if(config == NULL || ind == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
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_crc_indication_t));
}
int nfapi_pnf_p7_nr_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_srs_indication_t* ind)
{
if(config == NULL || ind == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
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_srs_indication_t));
}
int nfapi_pnf_p7_nr_uci_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_uci_indication_t* ind)
{
if(config == NULL || ind == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
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_uci_indication_t));
}
int nfapi_pnf_p7_nr_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rach_indication_t* ind)
{
if(config == NULL || ind == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
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_rach_indication_t));
}
......@@ -28,6 +28,7 @@
extern "C" {
#endif
#define NFAPI_MAX_PACKED_MESSAGE_SIZE 8192
/*! The nfapi VNF phy configuration information
*/
......
......@@ -1461,6 +1461,102 @@ void vnf_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
}
}
//NR HANDLES FOR UPLINK MESSAGES
void vnf_handle_nr_rx_data_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
// ensure it's valid
if (pRecvMsg == NULL || vnf_p7 == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
}
else
{
nfapi_nr_rx_data_indication_t ind;
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
}
}
}
void vnf_handle_nr_crc_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
// ensure it's valid
if (pRecvMsg == NULL || vnf_p7 == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
}
else
{
nfapi_nr_crc_indication_t ind;
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
}
}
}
void vnf_handle_nr_srs_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
// ensure it's valid
if (pRecvMsg == NULL || vnf_p7 == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
}
else
{
nfapi_nr_srs_indication_t ind;
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
}
}
}
void vnf_handle_nr_uci_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
// ensure it's valid
if (pRecvMsg == NULL || vnf_p7 == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
}
else
{
nfapi_nr_uci_indication_t ind;
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
}
}
}
void vnf_handle_nr_rach_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
// ensure it's valid
if (pRecvMsg == NULL || vnf_p7 == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: NULL parameters\n", __FUNCTION__);
}
else
{
nfapi_nr_rach_indication_t ind;
if(nfapi_nr_p7_message_unpack(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config) < 0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
}
}
}
void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
{
//printf("received UL Node sync");
......@@ -2041,46 +2137,26 @@ void vnf_nr_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
vnf_nr_handle_timing_info(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_HARQ_INDICATION:
vnf_handle_harq_indication(pRecvMsg, recvMsgLen, vnf_p7);
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
vnf_handle_nr_rx_data_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_CRC_INDICATION:
vnf_handle_crc_indication(pRecvMsg, recvMsgLen, vnf_p7);
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
vnf_handle_nr_crc_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_RX_ULSCH_INDICATION:
vnf_handle_rx_ulsch_indication(pRecvMsg, recvMsgLen, vnf_p7);
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
vnf_handle_nr_uci_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_RACH_INDICATION:
vnf_handle_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
vnf_handle_nr_rach_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_SRS_INDICATION:
vnf_handle_srs_indication(pRecvMsg, recvMsgLen, vnf_p7);
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
vnf_handle_nr_srs_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_RX_SR_INDICATION:
vnf_handle_rx_sr_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_RX_CQI_INDICATION:
vnf_handle_rx_cqi_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_LBT_DL_INDICATION:
vnf_handle_lbt_dl_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_NB_HARQ_INDICATION:
vnf_handle_nb_harq_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_NRACH_INDICATION:
vnf_handle_nrach_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
case NFAPI_UE_RELEASE_RESPONSE:
vnf_handle_ue_release_resp(pRecvMsg, recvMsgLen, vnf_p7);
break;
......
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