Add NSA mode to working dl_tti messages from gNB

This commit is not currently building, but I wanted
to be able to save the changes that I have added.
This commit is contained in:
Melissa Elkadi
2021-04-30 13:36:18 -07:00
parent f434a8ded9
commit e1a77b2d82
55 changed files with 974 additions and 380 deletions
+26 -20
View File
@@ -72,6 +72,7 @@ extern nfapi_tx_request_pdu_t* tx_request_pdu[1023][NUM_NFAPI_SUBFRAME][10]; //T
//extern int timer_subframe;
//extern int timer_frame;
extern UE_RRC_INST *UE_rrc_inst;
extern uint16_t sf_ahead;
void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
@@ -1301,26 +1302,6 @@ void *ue_standalone_pnf_task(void *context)
abort();
}
}
else if (len == sizeof(channel_info))
{
channel_info * ch_info = malloc(sizeof(channel_info));
memcpy(ch_info, buffer, sizeof(channel_info));
current_sfn_sf = ch_info->sfn_sf;
if (sem_post(&sfn_semaphore) != 0)
{
LOG_E(MAC, "sem_post() error\n");
abort();
}
uint16_t sf = ch_info->sfn_sf & 15;
if(sf > 10 && sf < 0)
{
LOG_E(MAC, "sf out of bounds, sfn: %d\n", sf);
abort();
}
sf_rnti_mcs[sf].sinr = ch_info->sinr;
LOG_D(MAC, "Received_SINR = %f\n",ch_info->sinr);
}
else if (len == sizeof(phy_channel_params_t))
{
phy_channel_params_t ch_info;
@@ -1333,6 +1314,9 @@ void *ue_standalone_pnf_task(void *context)
}
uint16_t sf = ch_info.sfn_sf & 15;
assert(sf < 10);
sf_rnti_mcs[sf].sinr = ch_info.sinr;
LOG_D(MAC, "Received_SINR = %f\n",ch_info.sinr);
}
else
{
@@ -2075,8 +2059,30 @@ static float get_bler_val(uint8_t mcs, int sinr)
}
static inline bool is_channel_modeling(void)
{
/* TODO: For now we enable channel modeling based on the node_number.
Replace with a command line option to enable/disable channel modeling. */
return node_number == 0;
}
static bool should_drop_transport_block(int sf, uint16_t rnti)
{
if (!is_channel_modeling())
{
return false;
}
/* We want to avoid dropping setup messages because this would be pathological.
This assumes were in standalone_pnf mode where
UE_rrc_inst[0] is module_id = 0 and Info[0] is eNB_index = 0. */
UE_STATE_t state = UE_rrc_inst[0].Info[0].State;
if (state < RRC_CONNECTED)
{
LOG_I(MAC, "Not dropping because state: %d", state);
return false;
}
/* Get block error rate (bler_val) from table based on every saved
MCS and SINR to be used as the cutoff rate for dropping packets.
Generate random uniform vairable to compare against bler_val. */
-8
View File
@@ -19,7 +19,6 @@
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
//#include "openair1/PHY/defs.h"
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
#include "nfapi/open-nFAPI/pnf/inc/pnf_p7.h"
#include "queue.h"
#define NUM_MCS 28
@@ -41,13 +40,6 @@ eth_params_t stub_eth_params;
typedef struct
{
uint16_t sfn_sf;
float sinr;
// Incomplete, need all channel parameters
} channel_info;
typedef struct
{
uint8_t sf;
uint16_t rnti[256];
uint8_t mcs[256];