Merge branch 'eurecom-nfapi-nr-arch-mod' into episys/merge_nsa_w_develop
This commit is contained in:
@@ -154,10 +154,17 @@ int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t msg_len);
|
||||
|
||||
int pnf_p7_slot_ind(pnf_p7_t* config, uint16_t phy_id, uint16_t sfn, uint16_t slot);
|
||||
int pnf_p7_subframe_ind(pnf_p7_t* config, uint16_t phy_id, uint16_t sfn_sf);
|
||||
|
||||
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_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind);
|
||||
int nfapi_pnf_p7_nr_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_crc_indication_t* ind);
|
||||
int nfapi_pnf_p7_nr_srs_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_srs_indication_t* ind);
|
||||
int nfapi_pnf_p7_nr_uci_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_uci_indication_t* ind);
|
||||
int nfapi_pnf_p7_nr_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rach_indication_t* ind);
|
||||
pnf_p7_rx_message_t* pnf_p7_rx_reassembly_queue_add_segment(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, uint32_t rx_hr_time, uint16_t sequence_number, uint16_t segment_number, uint8_t m, uint8_t* data, uint16_t data_len);
|
||||
void pnf_p7_rx_reassembly_queue_remove_msg(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, pnf_p7_rx_message_t* msg);
|
||||
void pnf_p7_rx_reassembly_queue_remove_old_msgs(pnf_p7_t* pnf_p7, pnf_p7_rx_reassembly_queue_t* queue, uint32_t rx_hr_time, uint32_t delta);
|
||||
|
||||
int pnf_nr_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* header, uint32_t msg_len);
|
||||
|
||||
#endif /* _PNF_P7_H_ */
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ extern "C" {
|
||||
#include <openair2/PHY_INTERFACE/IF_Module.h>
|
||||
#include "nfapi_nr_interface.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "openair1/PHY/defs_gNB.h"
|
||||
|
||||
|
||||
+105
-159
@@ -156,17 +156,16 @@ nfapi_dl_config_request_t* allocate_nfapi_dl_config_request(pnf_p7_t* pnf_p7)
|
||||
void deallocate_nfapi_dl_tti_request(nfapi_nr_dl_tti_request_t* req, pnf_p7_t* pnf_p7)
|
||||
{
|
||||
//printf("%s() SFN/SF:%d %s req:%p pdu_list:%p\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), pnf_p7->_public.codec_config.deallocate ? "DEALLOCATE" : "FREE", req, req->dl_config_request_body.dl_config_pdu_list);
|
||||
/*
|
||||
if(pnf_p7->_public.codec_config.deallocate)
|
||||
{
|
||||
//nfapi_nr_dl_tti_request_pdu_t *temp = &req->dl_tti_pdu_list;
|
||||
(pnf_p7->_public.codec_config.deallocate)(req);
|
||||
}
|
||||
else
|
||||
{
|
||||
free(req);
|
||||
}
|
||||
*/
|
||||
|
||||
// if(pnf_p7->_public.codec_config.deallocate)
|
||||
// {
|
||||
// (pnf_p7->_public.codec_config.deallocate)(req);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// free(req);
|
||||
// }
|
||||
|
||||
pnf_p7_free(pnf_p7, req);
|
||||
}
|
||||
|
||||
@@ -915,14 +914,13 @@ void send_dummy_subframe(pnf_p7_t* pnf_p7, uint16_t sfn_sf)
|
||||
|
||||
|
||||
int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t slot)
|
||||
{
|
||||
{
|
||||
//This function is aligned with rx sfn/slot
|
||||
|
||||
// We could either send an event to the p7 thread have have it run the
|
||||
// subframe or we could handle it here and lock access to the subframe
|
||||
// buffers. If we do it on the p7 thread then we run the risk of blocking
|
||||
// on the udp send.
|
||||
//
|
||||
// todo : start a timer to give us more of the 1 ms tick before send back
|
||||
// the frame
|
||||
|
||||
// todo : consider a more efficent lock mechasium
|
||||
//uint16_t NUM_SLOTS = 20;//10* 2^mu
|
||||
@@ -935,21 +933,21 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
|
||||
// save the curren time, sfn and slot
|
||||
pnf_p7->slot_start_time_hr = pnf_get_current_time_hr();
|
||||
pnf_p7->sfn = sfn;
|
||||
|
||||
pnf_p7->slot = slot;
|
||||
|
||||
|
||||
|
||||
slot_ahead = 6;
|
||||
uint32_t sfn_slot_tx = sfnslot_add_slot(sfn, slot, slot_ahead);
|
||||
uint16_t sfn_tx = sfn_slot_tx>>6;
|
||||
uint16_t slot_tx = sfn_slot_tx & 0X3F;
|
||||
uint16_t sfn_tx = NFAPI_SFNSLOT2SFN(sfn_slot_tx);
|
||||
uint8_t slot_tx = NFAPI_SFNSLOT2SLOT(sfn_slot_tx);
|
||||
|
||||
// uint32_t tx_sfn_slot_dec = NFAPI_SFNSLOT2DEC(sfn,slot);
|
||||
uint32_t tx_slot_dec = NFAPI_SFNSLOT2DEC(sfn,slot);
|
||||
//We align the pnf_p7 sfn/slot with tx sfn/slot, and vnf is synced with pnf_p7 sfn/slot. This is so that the scheduler runs slot_ahead from rx thread.
|
||||
|
||||
pnf_p7->sfn = sfn_tx;
|
||||
pnf_p7->slot = slot_tx;
|
||||
|
||||
//uint32_t tx_sfn_slot_dec = NFAPI_SFNSLOT2DEC(sfn_slot_tx);
|
||||
uint32_t rx_slot_dec = NFAPI_SFNSLOT2DEC(sfn, slot);
|
||||
uint8_t buffer_index_rx = rx_slot_dec % 20;
|
||||
|
||||
uint32_t tx_slot_dec = NFAPI_SFNSLOT2DEC(sfn_tx,slot_tx);
|
||||
uint8_t buffer_index_tx = tx_slot_dec % 20;
|
||||
|
||||
// If the subframe_buffer has been configured
|
||||
if(pnf_p7->_public.slot_buffer_size!= 0) // for now value is same as sf_buffer_size
|
||||
@@ -976,28 +974,20 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
pnf_p7->slot_shift = 0;
|
||||
}
|
||||
|
||||
uint32_t slot_dec = NFAPI_SFNSLOT2DEC(sfn, slot);
|
||||
uint8_t buffer_index = slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
nfapi_pnf_p7_slot_buffer_t* rx_slot_buffer = &(pnf_p7->slot_buffer[buffer_index_rx]);
|
||||
|
||||
nfapi_pnf_p7_slot_buffer_t* slot_buffer = &(pnf_p7->slot_buffer[buffer_index]);
|
||||
// see where the PNF_P7 slot buffer its getting filled
|
||||
nfapi_pnf_p7_slot_buffer_t* tx_slot_buffer = &(pnf_p7->slot_buffer[buffer_index_tx]);
|
||||
|
||||
uint8_t tx_buffer_index = tx_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
nfapi_pnf_p7_slot_buffer_t* tx_slot_buffer = &(pnf_p7->slot_buffer[tx_buffer_index]);
|
||||
|
||||
if (0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() shift:%d slot_buffer->sfn_sf:%d tx_slot_buffer->sfn_slot:%d sfn_sf:%d subframe_buffer[buffer_index:%u dl_config_req:%p tx_req:%p] "
|
||||
"TX:sfn_sf:%d:tx_buffer_index:%d[dl_config_req:%p tx_req:%p]\n",
|
||||
__FUNCTION__,
|
||||
pnf_p7->slot_shift,
|
||||
NFAPI_SFNSLOT2DEC(slot_buffer->sfn, slot_buffer->slot),
|
||||
NFAPI_SFNSLOT2DEC(tx_slot_buffer->sfn, tx_slot_buffer->slot),
|
||||
slot_dec, buffer_index, slot_buffer->dl_tti_req, slot_buffer->tx_data_req,
|
||||
tx_slot_dec, tx_buffer_index, tx_slot_buffer->dl_tti_req, tx_slot_buffer->tx_data_req);
|
||||
// if (0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() shift:%d slot_buffer->sfn_sf:%d tx_slot_buffer->sfn_slot:%d sfn_sf:%d subframe_buffer[buffer_index:%u dl_config_req:%p tx_req:%p] "
|
||||
// "TX:sfn_sf:%d:tx_buffer_index:%d[dl_config_req:%p tx_req:%p]\n",
|
||||
// __FUNCTION__,
|
||||
// pnf_p7->slot_shift,
|
||||
// NFAPI_SFNSLOT2DEC(rx_slot_buffer->sfn, rx_slot_buffer->slot),
|
||||
// NFAPI_SFNSLOT2DEC(tx_slot_buffer->sfn, tx_slot_buffer->slot),
|
||||
// slot_dec, buffer_index_rx, rx_slot_buffer->dl_tti_req, rx_slot_buffer->tx_data_req,
|
||||
// tx_slot_dec, buffer_index_tx, tx_slot_buffer->dl_tti_req, tx_slot_buffer->tx_data_req);
|
||||
//TODO: Change later if required
|
||||
|
||||
|
||||
// if the subframe buffer sfn sf is set then we have atlease 1 message
|
||||
// from the vnf.
|
||||
// todo : how to handle the messages we don't have, send dummies for
|
||||
// now
|
||||
|
||||
@@ -1006,12 +996,16 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
//printf("tx_slot_buff_sfn - %d, tx_slot_buf_slot - %d, sfn_tx = %d, sllot_tx - %d \n",tx_slot_buffer->sfn,tx_slot_buffer->slot,sfn_tx,slot_tx);
|
||||
// if(tx_slot_buffer->slot == slot_tx && tx_slot_buffer->sfn == sfn_tx)
|
||||
// {
|
||||
|
||||
if(tx_slot_buffer->tx_data_req != 0)
|
||||
|
||||
//checking in the tx slot buffers to see if a p7 msg is present. todo: what if it's a mixed slot?
|
||||
|
||||
if(tx_slot_buffer->tx_data_req != 0 && tx_slot_buffer->tx_data_req->SFN == sfn_tx && tx_slot_buffer->tx_data_req->Slot == slot_tx)
|
||||
{
|
||||
|
||||
if(pnf_p7->_public.tx_data_req_fn)
|
||||
{
|
||||
{
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Calling tx_data_req_fn in SFN/slot %d.%d \n",sfn,slot);
|
||||
LOG_D(PHY, "Process tx_data SFN/slot %d.%d buffer index: %d \n",sfn_tx,slot_tx,buffer_index_tx);
|
||||
(pnf_p7->_public.tx_data_req_fn)(&(pnf_p7->_public), tx_slot_buffer->tx_data_req);
|
||||
}
|
||||
}
|
||||
@@ -1027,11 +1021,11 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(tx_slot_buffer->dl_tti_req != 0)
|
||||
if(tx_slot_buffer->dl_tti_req != 0 && tx_slot_buffer->dl_tti_req->SFN == sfn_tx && tx_slot_buffer->dl_tti_req->Slot == slot_tx)
|
||||
{
|
||||
if(pnf_p7->_public.dl_tti_req_fn)
|
||||
{
|
||||
LOG_D(PHY, "Process dl_tti SFN/slot %d.%d buffer index: %d \n",sfn_tx,slot_tx,buffer_index_tx);
|
||||
(pnf_p7->_public.dl_tti_req_fn)(NULL, &(pnf_p7->_public), tx_slot_buffer->dl_tti_req);
|
||||
}
|
||||
}
|
||||
@@ -1047,10 +1041,12 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
}
|
||||
|
||||
|
||||
if(tx_slot_buffer->ul_dci_req!= 0)
|
||||
if(tx_slot_buffer->ul_dci_req!= 0 && tx_slot_buffer->ul_dci_req->SFN == sfn_tx && tx_slot_buffer->ul_dci_req->Slot == slot_tx)
|
||||
{
|
||||
if(pnf_p7->_public.ul_dci_req_fn)
|
||||
{
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Calling UL_dci_req_fn in SFN/slot %d.%d \n",sfn,slot);
|
||||
LOG_D(PHY, "Process ul_dci SFN/slot %d.%d buffer index: %d \n",sfn_tx,slot_tx,buffer_index_tx);
|
||||
(pnf_p7->_public.ul_dci_req_fn)(NULL, &(pnf_p7->_public), tx_slot_buffer->ul_dci_req);
|
||||
}
|
||||
}
|
||||
@@ -1081,10 +1077,14 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_tti_req);
|
||||
}
|
||||
}
|
||||
|
||||
//deallocate slot buffers after passing down the PDUs to PHY processing
|
||||
|
||||
if(tx_slot_buffer->dl_tti_req != 0)
|
||||
{
|
||||
deallocate_nfapi_dl_tti_request(tx_slot_buffer->dl_tti_req, pnf_p7);
|
||||
tx_slot_buffer->dl_tti_req = 0;
|
||||
LOG_D(PHY,"SFN/slot %d.%d Buffer index : %d freed \n",sfn_tx,slot_tx,buffer_index_tx);
|
||||
}
|
||||
|
||||
if(tx_slot_buffer->tx_data_req != 0)
|
||||
@@ -1098,72 +1098,52 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
deallocate_nfapi_ul_dci_request(tx_slot_buffer->ul_dci_req, pnf_p7);
|
||||
tx_slot_buffer->ul_dci_req = 0;
|
||||
}
|
||||
|
||||
|
||||
//checking in the rx slot buffers to see if a p7 msg is present.
|
||||
|
||||
if(rx_slot_buffer->ul_tti_req != 0 && rx_slot_buffer->ul_tti_req->SFN == sfn && rx_slot_buffer->ul_tti_req->Slot == slot)
|
||||
{
|
||||
if(pnf_p7->_public.ul_tti_req_fn)
|
||||
{
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "Calling UL_tti_req_fn in SFN/slot %d.%d \n",sfn,slot);
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), rx_slot_buffer->ul_tti_req);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we ever need to "send" a dummy ul_config this won't work!!!
|
||||
// send_dummy_subframe(pnf_p7, sfn_sf_tx);
|
||||
// send dummy
|
||||
if(pnf_p7->_public.ul_tti_req_fn && pnf_p7->_public.dummy_slot.ul_tti_req)
|
||||
{
|
||||
pnf_p7->_public.dummy_slot.ul_tti_req->SFN = sfn;
|
||||
pnf_p7->_public.dummy_slot.ul_tti_req->Slot = slot;
|
||||
LOG_D(PHY, "Process ul_tti SFN/slot %d.%d buffer index: %d \n",sfn,slot,buffer_index_rx);
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_tti_req);
|
||||
}
|
||||
}
|
||||
if(rx_slot_buffer->ul_tti_req != 0)
|
||||
{
|
||||
deallocate_nfapi_ul_tti_request(rx_slot_buffer->ul_tti_req, pnf_p7);
|
||||
rx_slot_buffer->ul_tti_req = 0;
|
||||
|
||||
// send_dummy_slot(pnf_p7, sfn_tx, slot_tx);
|
||||
}
|
||||
|
||||
//reset slot buffer
|
||||
|
||||
|
||||
if(slot_buffer->sfn == sfn && slot_buffer->slot == slot )
|
||||
if ( rx_slot_buffer->dl_tti_req == 0 &&
|
||||
rx_slot_buffer->tx_data_req == 0 &&
|
||||
rx_slot_buffer->ul_tti_req == 0)
|
||||
{
|
||||
|
||||
if(slot_buffer->ul_tti_req != 0)
|
||||
{
|
||||
if(pnf_p7->_public.ul_tti_req_fn)
|
||||
{
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), slot_buffer->ul_tti_req);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// send dummy
|
||||
if(pnf_p7->_public.ul_tti_req_fn && pnf_p7->_public.dummy_slot.ul_tti_req)
|
||||
{
|
||||
pnf_p7->_public.dummy_slot.ul_tti_req->SFN = sfn;
|
||||
pnf_p7->_public.dummy_slot.ul_tti_req->Slot = slot;
|
||||
(pnf_p7->_public.ul_tti_req_fn)(NULL, &(pnf_p7->_public), pnf_p7->_public.dummy_slot.ul_tti_req);
|
||||
}
|
||||
}
|
||||
//if(subframe_buffer->dl_config_req != 0)
|
||||
//deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
|
||||
//if(subframe_buffer->tx_req != 0)
|
||||
//deallocate_nfapi_tx_request(subframe_buffer->tx_req, pnf_p7);
|
||||
if(slot_buffer->ul_tti_req != 0)
|
||||
{
|
||||
deallocate_nfapi_ul_tti_request(slot_buffer->ul_tti_req, pnf_p7);
|
||||
slot_buffer->ul_tti_req = 0;
|
||||
|
||||
}
|
||||
#if 0
|
||||
if(slot_buffer->lbt_dl_config_req != 0)
|
||||
{
|
||||
deallocate_nfapi_lbt_dl_config_request(slot_buffer->lbt_dl_config_req, pnf_p7);
|
||||
slot_buffer->lbt_dl_config_req = 0;
|
||||
}
|
||||
#endif
|
||||
} // sfn_slot match
|
||||
|
||||
|
||||
if ( slot_buffer->dl_tti_req == 0 &&
|
||||
slot_buffer->tx_data_req == 0 &&
|
||||
slot_buffer->ul_tti_req == 0)
|
||||
//slot_buffer->lbt_dl_config_req == 0 &&
|
||||
//slot_buffer->ue_release_req == 0)
|
||||
{
|
||||
memset(&(pnf_p7->slot_buffer[buffer_index]), 0, sizeof(nfapi_pnf_p7_slot_buffer_t));
|
||||
pnf_p7->slot_buffer[buffer_index].sfn = -1;
|
||||
pnf_p7->slot_buffer[buffer_index].slot = -1;
|
||||
memset(&(pnf_p7->slot_buffer[buffer_index_rx]), 0, sizeof(nfapi_pnf_p7_slot_buffer_t));
|
||||
pnf_p7->slot_buffer[buffer_index_rx].sfn = -1;
|
||||
pnf_p7->slot_buffer[buffer_index_rx].slot = -1;
|
||||
}
|
||||
|
||||
//printf("pnf_p7->_public.timing_info_mode_periodic:%d pnf_p7->timing_info_period_counter:%d pnf_p7->_public.timing_info_period:%d\n", pnf_p7->_public.timing_info_mode_periodic, pnf_p7->timing_info_period_counter, pnf_p7->_public.timing_info_period);
|
||||
//printf("pnf_p7->_public.timing_info_mode_aperiodic:%d pnf_p7->timing_info_aperiodic_send:%d\n", pnf_p7->_public.timing_info_mode_aperiodic, pnf_p7->timing_info_aperiodic_send);
|
||||
//printf("pnf_p7->timing_info_ms_counter:%d\n", pnf_p7->timing_info_ms_counter);
|
||||
|
||||
// send the periodic timing info if configured
|
||||
//send the periodic timing info if configured
|
||||
if(pnf_p7->_public.timing_info_mode_periodic && (pnf_p7->timing_info_period_counter++) == pnf_p7->_public.timing_info_period)
|
||||
{
|
||||
pnf_nr_pack_and_send_timing_info(pnf_p7);
|
||||
@@ -1182,26 +1162,6 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//send_dummy_subframe(pnf_p7, sfn_sf_tx);
|
||||
}
|
||||
|
||||
|
||||
//printf("pnf_p7->tick:%d\n", pnf_p7->tick);
|
||||
// if(pnf_p7->tick == 1000) // why?
|
||||
// {
|
||||
// // TODO: change stats to nr_stats
|
||||
// NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF P7:%d] (ONTIME/LATE) DL:(%d/%d) UL:(%d/%d) HI:(%d/%d) TX:(%d/%d)\n", pnf_p7->_public.phy_id,
|
||||
// pnf_p7->stats.dl_conf_ontime, pnf_p7->stats.dl_conf_late,
|
||||
// pnf_p7->stats.ul_conf_ontime, pnf_p7->stats.ul_conf_late,
|
||||
// pnf_p7->stats.hi_dci0_ontime, pnf_p7->stats.hi_dci0_late,
|
||||
// pnf_p7->stats.tx_ontime, pnf_p7->stats.tx_late);
|
||||
// pnf_p7->tick = 0;
|
||||
// memset(&pnf_p7->stats, 0, sizeof(pnf_p7->stats));
|
||||
// }
|
||||
// pnf_p7->tick++;
|
||||
|
||||
|
||||
if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
|
||||
{
|
||||
@@ -1561,11 +1521,11 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name,
|
||||
// }
|
||||
if(current_sfn_slot_dec <= recv_sfn_slot_dec + timing_window){
|
||||
in_window = 1;
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
}
|
||||
else if(current_sfn_slot_dec + NFAPI_MAX_SFNSLOTDEC <= recv_sfn_slot_dec + timing_window){ //checking for wrap
|
||||
in_window = 1;
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is in window %d\n", current_sfn_slot_dec, name, recv_sfn_slot_dec);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -1654,34 +1614,18 @@ void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
if (
|
||||
0 &&
|
||||
(NFAPI_SFNSF2DEC(req->sfn_sf) % 100 ==0 ||
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf) % 105 ==0
|
||||
)
|
||||
)
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "DL_CONFIG.req sfn_sf:%d pdcch:%u dci:%u pdu:%u pdsch_rnti:%u pcfich:%u\n",
|
||||
NFAPI_SFNSF2DEC(req->sfn_sf),
|
||||
req->dl_config_request_body.number_pdcch_ofdm_symbols,
|
||||
req->dl_config_request_body.number_dci,
|
||||
req->dl_config_request_body.number_pdu,
|
||||
req->dl_config_request_body.number_pdsch_rnti,
|
||||
req->dl_config_request_body.transmission_power_pcfich
|
||||
);
|
||||
#endif
|
||||
|
||||
if(is_nr_p7_request_in_window(req->SFN,req->Slot, "dl_tti_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
if(is_nr_p7_request_in_window(req->SFN,req->Slot, "dl_tti_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % 20;
|
||||
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_TTI_REQ sfn_slot:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, pnf_p7->sfn,pnf_p7->slot, req->SFN, req->Slot, buffer_index);
|
||||
|
||||
// if there is already an dl_config_req make sure we free it.
|
||||
// if there is already an dl_tti_req make sure we free it.
|
||||
if(pnf_p7->slot_buffer[buffer_index].dl_tti_req != 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_NOTE, "%s() is_nr_p7_request_in_window()=TRUE buffer_index occupied - free it first sfn_slot:%d buffer_index:%d\n", __FUNCTION__, NFAPI_SFNSLOT2DEC(req->SFN,req->Slot), buffer_index);
|
||||
@@ -1691,7 +1635,7 @@ void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
deallocate_nfapi_dl_tti_request(pnf_p7->slot_buffer[buffer_index].dl_tti_req, pnf_p7);
|
||||
}
|
||||
|
||||
// saving dl_config_request in subframe buffer
|
||||
// filling dl_tti_request in slot buffer
|
||||
pnf_p7->slot_buffer[buffer_index].sfn = req->SFN;
|
||||
pnf_p7->slot_buffer[buffer_index].slot = req->Slot;
|
||||
pnf_p7->slot_buffer[buffer_index].dl_tti_req = req;
|
||||
@@ -1840,12 +1784,12 @@ void pnf_handle_ul_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
if(is_nr_p7_request_in_window(req->SFN,req->Slot, "ul_tti_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
uint8_t buffer_index = (sfn_slot_dec % 20);
|
||||
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE UL_TTI_REQ sfn_slot:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE UL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, pnf_p7->sfn,pnf_p7->slot, req->SFN, req->Slot, buffer_index);
|
||||
|
||||
if(pnf_p7->slot_buffer[buffer_index].ul_tti_req != 0)
|
||||
{
|
||||
@@ -1855,6 +1799,8 @@ void pnf_handle_ul_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
|
||||
deallocate_nfapi_ul_tti_request(pnf_p7->slot_buffer[buffer_index].ul_tti_req, pnf_p7);
|
||||
}
|
||||
|
||||
//filling slot buffer
|
||||
|
||||
pnf_p7->slot_buffer[buffer_index].sfn = req->SFN;
|
||||
pnf_p7->slot_buffer[buffer_index].slot = req->Slot;
|
||||
@@ -1986,7 +1932,7 @@ void pnf_handle_ul_dci_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
|
||||
if(is_nr_p7_request_in_window(req->SFN,req->Slot,"ul_dci_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
uint8_t buffer_index = sfn_slot_dec % 20;
|
||||
|
||||
if(pnf_p7->slot_buffer[buffer_index].ul_dci_req!= 0)
|
||||
{
|
||||
@@ -2125,12 +2071,12 @@ void pnf_handle_tx_data_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
|
||||
if(is_nr_p7_request_in_window(req->SFN, req->Slot,"tx_request", pnf_p7))
|
||||
{
|
||||
uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot);
|
||||
uint8_t buffer_index = sfn_slot_dec % pnf_p7->_public.slot_buffer_size;
|
||||
uint8_t buffer_index = sfn_slot_dec % 20;
|
||||
|
||||
struct timespec t;
|
||||
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE TX_DATA_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE TX_DATA_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index);
|
||||
#if 0
|
||||
if (0 && NFAPI_SFNSF2DEC(req->sfn_sf)%100==0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX_REQ.req sfn_sf:%d pdus:%d - TX_REQ is within window\n",
|
||||
__FUNCTION__,
|
||||
@@ -2692,9 +2638,7 @@ void pnf_nr_dispatch_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
|
||||
case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC:
|
||||
pnf_nr_handle_dl_node_sync(pRecvMsg, recvMsgLen, pnf_p7, rx_hr_time);
|
||||
break;
|
||||
|
||||
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
|
||||
//printf("\nEntering pnf_handle_dl_tti_request sfn=%d,slot=%d \n",pnf_p7->sfn,pnf_p7->slot);
|
||||
pnf_handle_dl_tti_request(pRecvMsg, recvMsgLen, pnf_p7);
|
||||
break;
|
||||
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
|
||||
@@ -3324,7 +3268,7 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_nsec = 500000;
|
||||
|
||||
struct timespec slot_duration;
|
||||
struct timespec slot_duration;
|
||||
slot_duration.tv_sec = 0;
|
||||
slot_duration.tv_nsec = 0.5e6;
|
||||
|
||||
@@ -3339,7 +3283,9 @@ int pnf_nr_p7_message_pump(pnf_p7_t* pnf_p7)
|
||||
FD_ZERO(&rfds);
|
||||
FD_SET(pnf_p7->p7_sock, &rfds);
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &pselect_start);
|
||||
struct timespec timeout;
|
||||
timeout.tv_sec = 100;
|
||||
timeout.tv_nsec = 0;
|
||||
|
||||
//setting the timeout
|
||||
|
||||
|
||||
@@ -251,6 +251,18 @@ int nfapi_pnf_ue_release_resp(nfapi_pnf_p7_config_t* config, nfapi_ue_release_re
|
||||
|
||||
//NR UPLINK INDICATION
|
||||
|
||||
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)
|
||||
{
|
||||
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_rx_data_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rx_data_indication_t* ind)
|
||||
{
|
||||
if(config == NULL || ind == NULL)
|
||||
|
||||
Reference in New Issue
Block a user