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:
@@ -1225,7 +1225,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
|
||||
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu_list = req->dl_tti_request_body.dl_tti_pdu_list;
|
||||
|
||||
if (req->dl_tti_request_body.nPDUs)
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d; sfn:%d, slot:%d, nGroup:%u, nPDUs: %u, nUE: %u, PduIdx: %u,\n",
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d; sfn:%d, slot:%d, nGroup:%u, nPDUs: %u, nUE: %p, PduIdx: %p,\n",
|
||||
__FUNCTION__, proc->frame_tx, proc->slot_tx, proc->frame_rx, proc->slot_rx, // TODO: change subframes to slot
|
||||
req->SFN,
|
||||
req->Slot,
|
||||
@@ -1790,7 +1790,6 @@ int start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi
|
||||
|
||||
int nr_start_request(nfapi_pnf_config_t *config, nfapi_pnf_phy_config_t *phy, nfapi_nr_start_request_scf_t *req) {
|
||||
printf("[PNF] Received NFAPI_START_REQ phy_id:%d\n", req->header.phy_id);
|
||||
nfapi_set_trace_level(NFAPI_TRACE_INFO);
|
||||
pnf_info *pnf = (pnf_info *)(config->user_data);
|
||||
phy_info *phy_info = pnf->phys;
|
||||
nfapi_pnf_p7_config_t *p7_config = nfapi_pnf_p7_config_create();
|
||||
@@ -2295,15 +2294,13 @@ void oai_subframe_ind(uint16_t sfn, uint16_t sf) {
|
||||
uint16_t sfn_sf_tx = sfn<<4 | sf;
|
||||
|
||||
if ((sfn % 100 == 0) && sf==0) {
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s %d.%d (sfn:%u sf:%u) SFN/SF(TX):%u\n", __FUNCTION__, ts.tv_sec, ts.tv_nsec, sfn, sf, NFAPI_SFNSF2DEC(sfn_sf_tx));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] (sfn:%u sf:%u) SFN/SF(TX):%u\n", sfn, sf, NFAPI_SFNSF2DEC(sfn_sf_tx));
|
||||
}
|
||||
|
||||
int subframe_ret = nfapi_pnf_p7_subframe_ind(p7_config_g, p7_config_g->phy_id, sfn_sf_tx);
|
||||
|
||||
if (subframe_ret) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] %s(frame:%u subframe:%u) SFN/SF(TX):%u - PROBLEM with pnf_p7_subframe_ind()\n", __FUNCTION__, sfn, sf, sfn_sf_tx, NFAPI_SFNSF2DEC(sfn_sf_tx));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] (frame:%u subframe:%u) SFN/SF(TX):%u - PROBLEM with pnf_p7_subframe_ind()\n", sfn, sf, sfn_sf_tx);
|
||||
} else {
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "***NFAPI subframe handler finished *** \n");
|
||||
}
|
||||
@@ -2347,8 +2344,8 @@ void oai_slot_ind(uint16_t sfn, uint16_t slot) {
|
||||
int slot_ret = nfapi_pnf_p7_slot_ind(p7_config_g, p7_config_g->phy_id, sfn, slot);
|
||||
|
||||
// if (subframe_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));
|
||||
if (slot_ret) {
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF](frame:%u slot:%u) SFN/SLOT(TX):%u - PROBLEM with pnf_p7_slot_ind()\n", sfn, slot, sfn_slot_tx);
|
||||
// printing anything causes error: probably because there isn't enough time to accomodate a print statement
|
||||
} else {
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "***NFAPI subframe handler finished *** \n");
|
||||
|
||||
@@ -646,8 +646,8 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id,
|
||||
int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indication_t *ind) {
|
||||
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_preambles:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
|
||||
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
|
||||
printf("[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
LOG_D(MAC, "[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
|
||||
AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
|
||||
|
||||
@@ -659,7 +659,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
|
||||
for (int i=0; i<ind->rach_indication_body.number_of_preambles; i++) {
|
||||
if (ind->rach_indication_body.preamble_list[i].preamble_rel8.tl.tag == NFAPI_PREAMBLE_REL8_TAG) {
|
||||
|
||||
printf("preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n",
|
||||
LOG_D(MAC, "preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n",
|
||||
i,
|
||||
ind->rach_indication_body.preamble_list[i].preamble_rel8.rnti,
|
||||
ind->rach_indication_body.preamble_list[i].preamble_rel8.preamble,
|
||||
@@ -667,7 +667,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
|
||||
);
|
||||
}
|
||||
if(ind->rach_indication_body.preamble_list[i].preamble_rel13.tl.tag == NFAPI_PREAMBLE_REL13_TAG) {
|
||||
printf("RACH PREAMBLE REL13 present\n");
|
||||
LOG_D(MAC, "RACH PREAMBLE REL13 present\n");
|
||||
}
|
||||
|
||||
UL_RCC_INFO.rach_ind[index].rach_indication_body.preamble_list[i] = ind->rach_indication_body.preamble_list[i];
|
||||
@@ -678,7 +678,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
|
||||
|
||||
for (int i=0; i<ind->rach_indication_body.number_of_preambles; i++) {
|
||||
if (ind->rach_indication_body.preamble_list[i].preamble_rel8.tl.tag == NFAPI_PREAMBLE_REL8_TAG) {
|
||||
printf("preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n",
|
||||
LOG_D(MAC, "preamble[%d]: rnti:%02x preamble:%d timing_advance:%d\n",
|
||||
i,
|
||||
ind->rach_indication_body.preamble_list[i].preamble_rel8.rnti,
|
||||
ind->rach_indication_body.preamble_list[i].preamble_rel8.preamble,
|
||||
@@ -687,13 +687,13 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
|
||||
}
|
||||
|
||||
if(ind->rach_indication_body.preamble_list[i].preamble_rel13.tl.tag == NFAPI_PREAMBLE_REL13_TAG) {
|
||||
printf("RACH PREAMBLE REL13 present\n");
|
||||
LOG_D(MAC, "RACH PREAMBLE REL13 present\n");
|
||||
}
|
||||
|
||||
eNB->preamble_list[i] = ind->rach_indication_body.preamble_list[i];
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
|
||||
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
|
||||
//mac_rach_ind(p7_vnf->mac, ind);
|
||||
return 1;
|
||||
@@ -702,7 +702,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
|
||||
int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indication_t *ind) {
|
||||
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
|
||||
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->harq_indication_body.number_of_harqs);
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
|
||||
|
||||
@@ -726,7 +726,7 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio
|
||||
sizeof(eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[i]));
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
|
||||
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
|
||||
//mac_harq_ind(p7_vnf->mac, ind);
|
||||
return 1;
|
||||
@@ -734,7 +734,7 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio
|
||||
|
||||
int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_t *ind) {
|
||||
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
|
||||
|
||||
@@ -778,7 +778,7 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
|
||||
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
|
||||
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
|
||||
//mac_crc_ind(p7_vnf->mac, ind);
|
||||
return 1;
|
||||
@@ -791,7 +791,7 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
|
||||
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_pdus:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
|
||||
|
||||
@@ -857,7 +857,7 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
|
||||
);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
|
||||
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
|
||||
//mac_rx_ind(p7_vnf->mac, ind);
|
||||
return 1;
|
||||
@@ -871,7 +871,7 @@ int phy_srs_indication(struct nfapi_vnf_p7_config *config, nfapi_srs_indication_
|
||||
int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t *ind) {
|
||||
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
|
||||
LOG_D(MAC, "%s() NFAPI SFN/SF:%d srs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->sr_indication_body.number_of_srs);
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
|
||||
|
||||
@@ -906,7 +906,7 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t
|
||||
memcpy(dest_pdu, src_pdu, sizeof(*src_pdu));
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
|
||||
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
|
||||
//mac_sr_ind(p7_vnf->mac, ind);
|
||||
return 1;
|
||||
@@ -947,7 +947,7 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
|
||||
//mac_cqi_ind(p7_vnf->mac, ind);
|
||||
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
|
||||
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_cqis:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis);
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_lock(&eNB->UL_INFO_mutex)==0, "Mutex lock failed");
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
|
||||
|
||||
@@ -989,7 +989,7 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
|
||||
&ind->cqi_indication_body.cqi_raw_pdu_list[i], sizeof(nfapi_cqi_indication_raw_pdu_t));
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
AssertFatal(pthread_mutex_unlock(&eNB->UL_INFO_mutex)==0, "Mutex unlock failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1160,7 +1160,6 @@ void *vnf_nr_p7_thread_start(void *ptr) {
|
||||
p7_vnf->config->nrach_indication = &phy_nrach_indication;
|
||||
p7_vnf->config->malloc = &vnf_allocate;
|
||||
p7_vnf->config->free = &vnf_deallocate;
|
||||
p7_vnf->config->trace = &vnf_trace;
|
||||
p7_vnf->config->vendor_ext = &phy_vendor_ext;
|
||||
p7_vnf->config->user_data = p7_vnf;
|
||||
p7_vnf->mac->user_data = p7_vnf;
|
||||
@@ -1197,7 +1196,6 @@ void *vnf_p7_thread_start(void *ptr) {
|
||||
p7_vnf->config->nrach_indication = &phy_nrach_indication;
|
||||
p7_vnf->config->malloc = &vnf_allocate;
|
||||
p7_vnf->config->free = &vnf_deallocate;
|
||||
p7_vnf->config->trace = &vnf_trace;
|
||||
p7_vnf->config->vendor_ext = &phy_vendor_ext;
|
||||
p7_vnf->config->user_data = p7_vnf;
|
||||
p7_vnf->mac->user_data = p7_vnf;
|
||||
@@ -1507,7 +1505,6 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
|
||||
nfapi_vnf_config_t *config = nfapi_vnf_config_create();
|
||||
config->malloc = malloc;
|
||||
config->free = free;
|
||||
config->trace = &vnf_trace;
|
||||
config->vnf_p5_port = vnf_p5_port;
|
||||
config->vnf_ipv4 = 1;
|
||||
config->vnf_ipv6 = 0;
|
||||
@@ -1558,7 +1555,6 @@ void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
|
||||
nfapi_vnf_config_t *config = nfapi_vnf_config_create();
|
||||
config->malloc = malloc;
|
||||
config->free = free;
|
||||
config->trace = &vnf_trace;
|
||||
config->vnf_p5_port = vnf_p5_port;
|
||||
config->vnf_ipv4 = 1;
|
||||
config->vnf_ipv6 = 0;
|
||||
|
||||
Reference in New Issue
Block a user