Commit 399b9334 authored by Aniq's avatar Aniq

pnf_p7_slot_ind function COMPLETED

parent 55384420
...@@ -1679,7 +1679,7 @@ void oai_slot_ind(uint16_t sfn, uint16_t slot) { ...@@ -1679,7 +1679,7 @@ void oai_slot_ind(uint16_t sfn, uint16_t slot) {
if ((sfn % 100 == 0) && slot==0) { // DOUBT: Why 100? if ((sfn % 100 == 0) && slot==0) { // DOUBT: Why 100?
struct timespec ts; struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts); clock_gettime(CLOCK_MONOTONIC, &ts);
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s %d.%d (sfn:%u slot:%u) SFN/SLOT(TX):%u\n", __FUNCTION__, ts.tv_sec, ts.tv_nsec, sfn, slot, NFAPI_SFNSLOT2DEC(sfn_slot_tx)); NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s %d.%d (sfn:%u slot:%u) SFN/SLOT(TX):%u\n", __FUNCTION__, ts.tv_sec, ts.tv_nsec, sfn, slot, NFAPI_SFNSLOT2DEC(sfn, slot));
} }
//TODO: send p7_config instead of p7_config_g //TODO: send p7_config instead of p7_config_g
...@@ -1687,7 +1687,7 @@ void oai_slot_ind(uint16_t sfn, uint16_t slot) { ...@@ -1687,7 +1687,7 @@ void oai_slot_ind(uint16_t sfn, uint16_t slot) {
// if (subframe_ret) { // if (subframe_ret) {
if (slot_ret) { if (slot_ret) {
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s(frame:%u slot:%u) SFN/SLOT(TX):%u - PROBLEM with pnf_p7_slot_ind()\n", __FUNCTION__, sfn, slot, sfn_slot_tx, NFAPI_SFNSLOT2DEC(sfn_slot_tx)); NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s(frame:%u slot:%u) SFN/SLOT(TX):%u - PROBLEM with pnf_p7_slot_ind()\n", __FUNCTION__, sfn, slot, sfn_slot_tx, NFAPI_SFNSLOT2DEC(sfn, slot));
// printing anything causes error: probably because there isn't enough time to accomodate a print statement // printing anything causes error: probably because there isn't enough time to accomodate a print statement
} else { } else {
//NFAPI_TRACE(NFAPI_TRACE_INFO, "***NFAPI subframe handler finished *** \n"); //NFAPI_TRACE(NFAPI_TRACE_INFO, "***NFAPI subframe handler finished *** \n");
......
...@@ -121,7 +121,7 @@ typedef struct { ...@@ -121,7 +121,7 @@ typedef struct {
#define NFAPI_TAG_LENGTH_PACKED_LEN 4 #define NFAPI_TAG_LENGTH_PACKED_LEN 4
// Convenience methods to convert between SFN/SLOT formats // Convenience methods to convert between SFN/SLOT formats
#define NFAPI_SFNSLOT2DEC(_sfn,_slot) ((((_sfn) >> 6) * 20) + ((_slot) & 0x3F)) // total count of slots #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) << 4) | (((_sfnslot_dec) - (((_sfnslot_dec) / 20) * 10)) & 0x3F))
#define NFAPI_SFNSLOT2SFN(_sfnslot) ((_sfnslot) >> 6) #define NFAPI_SFNSLOT2SFN(_sfnslot) ((_sfnslot) >> 6)
......
...@@ -38,6 +38,20 @@ typedef struct { ...@@ -38,6 +38,20 @@ typedef struct {
uint16_t tx_late; uint16_t tx_late;
} pnf_p7_stats_t; } pnf_p7_stats_t;
typedef struct { // TODO: replace with the stats
uint16_t dl_tti_ontime;
uint16_t dl_tti_late;
uint16_t ul_tti_ontime;
uint16_t ul_tti_late;
uint16_t ul_dci_ontime;
uint16_t ul_dci_late;
uint16_t tx_data_ontime;
uint16_t tx_data_late;
} pnf_p7_nr_stats_t;
typedef struct { typedef struct {
uint8_t* buffer; uint8_t* buffer;
uint16_t length; uint16_t length;
...@@ -99,7 +113,7 @@ typedef struct { ...@@ -99,7 +113,7 @@ typedef struct {
uint16_t slot; uint16_t slot;
uint16_t sfn_slot; uint16_t sfn_slot;
uint32_t slot_start_time_hr; uint32_t slot_start_time_hr;
int32_t sfn_slot_shift; int32_t slot_shift;
uint8_t timing_info_period_counter; uint8_t timing_info_period_counter;
uint8_t timing_info_aperiodic_send; // 0:false 1:true uint8_t timing_info_aperiodic_send; // 0:false 1:true
...@@ -113,6 +127,7 @@ typedef struct { ...@@ -113,6 +127,7 @@ typedef struct {
uint32_t tick; uint32_t tick;
pnf_p7_stats_t stats; pnf_p7_stats_t stats;
pnf_p7_nr_stats_t nr_stats;
} pnf_p7_t; } pnf_p7_t;
......
...@@ -555,12 +555,14 @@ typedef struct ...@@ -555,12 +555,14 @@ typedef struct
typedef struct typedef struct
{ {
uint16_t sfn_slot; //uint16_t sfn_slot
int16_t sfn;
int16_t slot;
//TODO: Change P7 structs to NR //TODO: Change P7 structs to NR
nfapi_nr_dl_tti_request_t dl_config_req;//nfapi_dl_config_request_t* dl_config_req; nfapi_nr_dl_tti_request_t* dl_tti_req;//nfapi_dl_config_request_t* dl_config_req;
nfapi_nr_ul_tti_request_t ul_config_req;//nfapi_ul_config_request_t* ul_config_req; nfapi_nr_ul_tti_request_t* ul_tti_req;//nfapi_ul_config_request_t* ul_config_req;
nfapi_nr_ul_dci_request_t hi_dci0_req;//nfapi_hi_dci0_request_t* hi_dci0_req; nfapi_nr_ul_dci_request_t* ul_dci_req;//nfapi_hi_dci0_request_t* hi_dci0_req;
nfapi_nr_tx_data_request_t* tx_req;//nfapi_tx_request_t* tx_req; nfapi_nr_tx_data_request_t* tx_data_req;//nfapi_tx_request_t* tx_req;
//TODO: check these two later //TODO: check these two later
nfapi_lbt_dl_config_request_t* lbt_dl_config_req; nfapi_lbt_dl_config_request_t* lbt_dl_config_req;
...@@ -640,6 +642,7 @@ typedef struct nfapi_pnf_p7_config ...@@ -640,6 +642,7 @@ typedef struct nfapi_pnf_p7_config
* \param req A pointer to the dl config request message structure * \param req A pointer to the dl config request message structure
* \return not currently used * \return not currently used
*/ */
int (*dl_tti_req_fn)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req);
int (*dl_config_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_dl_config_request_t* req); int (*dl_config_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_dl_config_request_t* req);
/*! A callback for the UL_CONFIG.request /*! A callback for the UL_CONFIG.request
...@@ -647,6 +650,7 @@ typedef struct nfapi_pnf_p7_config ...@@ -647,6 +650,7 @@ typedef struct nfapi_pnf_p7_config
* \param req A pointer to the ul config request message structure * \param req A pointer to the ul config request message structure
* \return not currently used * \return not currently used
*/ */
int (*ul_tti_req_fn)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_ul_tti_request_t* req);
int (*ul_config_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_ul_config_request_t* req); int (*ul_config_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_ul_config_request_t* req);
/*! A callback for the HI_DCI0.request /*! A callback for the HI_DCI0.request
...@@ -654,6 +658,7 @@ typedef struct nfapi_pnf_p7_config ...@@ -654,6 +658,7 @@ typedef struct nfapi_pnf_p7_config
* \param req A pointer to the hi dci0 request message structure * \param req A pointer to the hi dci0 request message structure
* \return not currently used * \return not currently used
*/ */
int (*ul_dci_req_fn)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_nr_ul_dci_request_t* req);
int (*hi_dci0_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_hi_dci0_request_t* req); int (*hi_dci0_req)(L1_rxtx_proc_t *proc,nfapi_pnf_p7_config_t* config, nfapi_hi_dci0_request_t* req);
/*! A callback for the TX_REQ.request /*! A callback for the TX_REQ.request
...@@ -665,6 +670,7 @@ typedef struct nfapi_pnf_p7_config ...@@ -665,6 +670,7 @@ typedef struct nfapi_pnf_p7_config
* will 'keep' the pointers until they are transmitted the callee should set the pointers in the req to 0 * will 'keep' the pointers until they are transmitted the callee should set the pointers in the req to 0
* and then use the p7 codec config free function to release the pdu's when appropriate. * and then use the p7 codec config free function to release the pdu's when appropriate.
*/ */
int (*tx_data_req_fn)(nfapi_pnf_p7_config_t* config, nfapi_nr_tx_data_request_t* req);
int (*tx_req)(nfapi_pnf_p7_config_t* config, nfapi_tx_request_t* req); int (*tx_req)(nfapi_pnf_p7_config_t* config, nfapi_tx_request_t* req);
/*! A callback for the LBT_DL_CONFIG.request /*! A callback for the LBT_DL_CONFIG.request
......
This diff is collapsed.
...@@ -65,6 +65,7 @@ RAN_CONTEXT_t RC; ...@@ -65,6 +65,7 @@ RAN_CONTEXT_t RC;
int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
int sf_ahead=4 ; int sf_ahead=4 ;
int slot_ahead=6 ;
int sl_ahead=0; int sl_ahead=0;
double cpuf; double cpuf;
uint8_t nfapi_mode = 0; uint8_t nfapi_mode = 0;
......
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