Commit 1ec934f9 authored by David Price's avatar David Price

Works up to message 3 reception at VNF

parent 5be8cf7b
This diff is collapsed.
...@@ -294,24 +294,10 @@ extern void init_eNB_afterRU(void); ...@@ -294,24 +294,10 @@ extern void init_eNB_afterRU(void);
void oai_create_enb(void) void oai_create_enb(void)
{ {
static int bodge_counter = 0; int bodge_counter=0;
PHY_VARS_eNB *eNB; PHY_VARS_eNB *eNB = RC.eNB[0][0];
if (RC.eNB && RC.eNB[0] && RC.eNB[0][0]) printf("[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d td:%p te:%p if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag, eNB->single_thread_flag, eNB->td, eNB->te, eNB->if_inst);
{
eNB = RC.eNB[0][0];
printf("[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d\n", eNB->Mod_id, eNB->CC_id);
}
else
{
printf("[VNF] DJP ***** RC.eNB[] and RC.eNB[%d][%d] RC.nb_CC[%d]=1 MALLOCING structure and zeroing *******\n", bodge_counter, bodge_counter, bodge_counter);
RC.eNB[bodge_counter] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**));
RC.eNB[bodge_counter][bodge_counter] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB));
memset((void*)RC.eNB[bodge_counter][bodge_counter],0,sizeof(PHY_VARS_eNB));
eNB = RC.eNB[bodge_counter][bodge_counter];
}
eNB->Mod_id = bodge_counter; eNB->Mod_id = bodge_counter;
eNB->CC_id = bodge_counter; eNB->CC_id = bodge_counter;
...@@ -326,8 +312,6 @@ void oai_create_enb(void) ...@@ -326,8 +312,6 @@ void oai_create_enb(void)
eNB->if_inst = IF_Module_init(bodge_counter); eNB->if_inst = IF_Module_init(bodge_counter);
} }
//init_eNB_proc(bodge_counter);
// This will cause phy_config_request to be installed. That will result in RRC configuring the PHY // This will cause phy_config_request to be installed. That will result in RRC configuring the PHY
// that will result in eNB->configured being set to TRUE. // that will result in eNB->configured being set to TRUE.
// See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values // See we need to wait for that to happen otherwise the NFAPI message exchanges won't contain the right parameter values
...@@ -343,7 +327,6 @@ void oai_create_enb(void) ...@@ -343,7 +327,6 @@ void oai_create_enb(void)
} while(eNB->configured != 1); } while(eNB->configured != 1);
} }
void oai_enb_init(void) void oai_enb_init(void)
{ {
init_eNB_afterRU(); init_eNB_afterRU();
...@@ -598,9 +581,6 @@ int phy_sync_indication(struct nfapi_vnf_p7_config* config, uint8_t sync) ...@@ -598,9 +581,6 @@ int phy_sync_indication(struct nfapi_vnf_p7_config* config, uint8_t sync)
} }
} }
//if (RC.eNB && RC.eNB[0][0]->configured)
//wake_eNB_rxtx(RC.eNB[0][0], 0, 0);
return(0); return(0);
} }
...@@ -679,22 +659,101 @@ int phy_rach_indication(struct nfapi_vnf_p7_config* config, nfapi_rach_indicatio ...@@ -679,22 +659,101 @@ 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) int phy_harq_indication(struct nfapi_vnf_p7_config* config, nfapi_harq_indication_t* ind)
{ {
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data); LOG_E(MAC, "%s() NFAPI SFN/SF:%d number_of_preambles:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->harq_indication_body.number_of_harqs);
//mac_harq_ind(p7_vnf->mac, ind);
return 1; for (int i=0; i<ind->harq_indication_body.number_of_harqs; i++)
{
harq_indication(
0, // DJP - fixme
0, // DJP - fixme
NFAPI_SFNSF2SFN(ind->sfn_sf),
NFAPI_SFNSF2SF(ind->sfn_sf),
&ind->harq_indication_body.harq_pdu_list[i]
);
}
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_harq_ind(p7_vnf->mac, ind);
return 1;
} }
int phy_crc_indication(struct nfapi_vnf_p7_config* config, nfapi_crc_indication_t* ind) int phy_crc_indication(struct nfapi_vnf_p7_config* config, nfapi_crc_indication_t* ind)
{ {
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.crc_ind = *ind;
nfapi_crc_indication_t *dest_ind = &eNB->UL_INFO.crc_ind;
nfapi_crc_indication_pdu_t *dest_pdu_list = eNB->crc_pdu_list;
*dest_ind = *ind;
dest_ind->crc_indication_body.crc_pdu_list = dest_pdu_list;
LOG_E(MAC, "%s() NFAPI SFN/SF:%d IND:number_of_crcs:%u UL_INFO:crcs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->crc_indication_body.number_of_crcs, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs);
for (int i=0; i<ind->crc_indication_body.number_of_crcs; i++)
{
LOG_D(MAC, "%s() PDU[%d] rnti:%04x UL_INFO:rnti:%04x\n",
__FUNCTION__,
i,
ind->crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti,
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[i].rx_ue_information.rnti);
memcpy(&dest_ind->crc_indication_body.crc_pdu_list[i], &ind->crc_indication_body.crc_pdu_list[i], sizeof(ind->crc_indication_body.crc_pdu_list[0]));
}
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_crc_ind(p7_vnf->mac, ind); //mac_crc_ind(p7_vnf->mac, ind);
return 1; return 1;
} }
int phy_rx_indication(struct nfapi_vnf_p7_config* config, nfapi_rx_indication_t* ind) int phy_rx_indication(struct nfapi_vnf_p7_config* config, nfapi_rx_indication_t* ind)
{ {
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
//mac_rx_ind(p7_vnf->mac, ind);
return 1; LOG_E(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);
nfapi_rx_indication_t *dest_ind = &eNB->UL_INFO.rx_ind;
nfapi_rx_indication_pdu_t *dest_pdu_list = eNB->rx_pdu_list;
*dest_ind = *ind;
dest_ind->rx_indication_body.rx_pdu_list = dest_pdu_list;
for(int i=0; i<ind->rx_indication_body.number_of_pdus; i++)
{
nfapi_rx_indication_pdu_t *dest_pdu = &dest_ind->rx_indication_body.rx_pdu_list[i];
nfapi_rx_indication_pdu_t *src_pdu = &ind->rx_indication_body.rx_pdu_list[i];
memcpy(dest_pdu, src_pdu, sizeof(*src_pdu));
// DJP - TODO FIXME - intentional memory leak
dest_pdu->data = malloc(dest_pdu->rx_indication_rel8.length);
memcpy(dest_pdu->data, src_pdu->data, dest_pdu->rx_indication_rel8.length);
LOG_E(PHY, "%s() handle:%d rnti:%04x length:%d offset:%d ul_cqi:%d ta:%d data:%p\n",
__FUNCTION__,
dest_pdu->rx_ue_information.handle,
dest_pdu->rx_ue_information.rnti,
dest_pdu->rx_indication_rel8.length,
dest_pdu->rx_indication_rel8.offset,
dest_pdu->rx_indication_rel8.ul_cqi,
dest_pdu->rx_indication_rel8.timing_advance,
dest_pdu->data
);
}
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_rx_ind(p7_vnf->mac, ind);
return 1;
} }
int phy_srs_indication(struct nfapi_vnf_p7_config* config, nfapi_srs_indication_t* ind) int phy_srs_indication(struct nfapi_vnf_p7_config* config, nfapi_srs_indication_t* ind)
{ {
...@@ -710,10 +769,21 @@ int phy_sr_indication(struct nfapi_vnf_p7_config* config, nfapi_sr_indication_t* ...@@ -710,10 +769,21 @@ int phy_sr_indication(struct nfapi_vnf_p7_config* config, nfapi_sr_indication_t*
} }
int phy_cqi_indication(struct nfapi_vnf_p7_config* config, nfapi_cqi_indication_t* ind) int phy_cqi_indication(struct nfapi_vnf_p7_config* config, nfapi_cqi_indication_t* ind)
{ {
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data); // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_cqi_ind(p7_vnf->mac, ind); //mac_cqi_ind(p7_vnf->mac, ind);
return 1; struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
LOG_E(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);
eNB->UL_INFO.cqi_ind = ind->cqi_indication_body;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
return 1;
} }
int phy_lbt_dl_indication(struct nfapi_vnf_p7_config* config, nfapi_lbt_dl_indication_t* ind) int phy_lbt_dl_indication(struct nfapi_vnf_p7_config* config, nfapi_lbt_dl_indication_t* ind)
{ {
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data); // vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
...@@ -1024,6 +1094,7 @@ printf("[VNF] DJP local_addr:%s\n", p7_vnf->local_addr); ...@@ -1024,6 +1094,7 @@ printf("[VNF] DJP local_addr:%s\n", p7_vnf->local_addr);
req->nfapi_config.timing_window.tl.tag = NFAPI_NFAPI_TIMING_WINDOW_TAG; req->nfapi_config.timing_window.tl.tag = NFAPI_NFAPI_TIMING_WINDOW_TAG;
req->nfapi_config.timing_window.value = p7_vnf->timing_window; req->nfapi_config.timing_window.value = p7_vnf->timing_window;
printf("[VNF] Timing window:%d\n", p7_vnf->timing_window);
req->num_tlv++; req->num_tlv++;
if(p7_vnf->periodic_timing_enabled || p7_vnf->aperiodic_timing_enabled) if(p7_vnf->periodic_timing_enabled || p7_vnf->aperiodic_timing_enabled)
...@@ -1300,3 +1371,49 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) ...@@ -1300,3 +1371,49 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req)
} }
return retval; return retval;
} }
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req)
{
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
hi_dci0_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() HI_DCI0_REQ p7_config:%p phy_id:%d message_id:%d sfn_sf:%d number_of_dci:%d number_of_hi:%d\n", __FUNCTION__, p7_config, hi_dci0_req->header.phy_id, hi_dci0_req->header.message_id, NFAPI_SFNSF2DEC(hi_dci0_req->sfn_sf), hi_dci0_req->hi_dci0_request_body.number_of_dci, hi_dci0_req->hi_dci0_request_body.number_of_hi);
int retval = nfapi_vnf_p7_hi_dci0_req(p7_config, hi_dci0_req);
if (retval!=0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
}
return retval;
}
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req)
{
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
ul_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
//NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() header message_id:%d\n", __FUNCTION__, ul_config_req->header.message_id);
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() UL_CONFIG p7_config:%p phy_id:%d message_id:%d sfn_sf:%d PDUs:%d rach_prach_frequency_resources:%d srs_present:%d\n",
__FUNCTION__, p7_config, ul_config_req->header.phy_id, ul_config_req->header.message_id, NFAPI_SFNSF2DEC(ul_config_req->sfn_sf),
ul_config_req->ul_config_request_body.number_of_pdus,
ul_config_req->ul_config_request_body.rach_prach_frequency_resources,
ul_config_req->ul_config_request_body.srs_present);
int retval = nfapi_vnf_p7_ul_config_req(p7_config, ul_config_req);
if (retval!=0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
}
else
{
// Reset number of PDUs so that it is not resent
ul_config_req->ul_config_request_body.number_of_pdus=0;
}
return retval;
}
This diff is collapsed.
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req); int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req);
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req); int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req);
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req);
extern uint8_t nfapi_pnf;
void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,
...@@ -640,7 +644,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -640,7 +644,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
handle_nfapi_dci_dl_pdu(eNB,proc,dl_config_pdu); handle_nfapi_dci_dl_pdu(eNB,proc,dl_config_pdu);
eNB->pdcch_vars[subframe&1].num_dci++; eNB->pdcch_vars[subframe&1].num_dci++;
LOG_D(PHY,"Incremented num_dci:%d but already set??? dl_config:num_dci:%d\n", eNB->pdcch_vars[subframe&1].num_dci, number_dci); LOG_E(PHY,"Incremented num_dci:%d but already set??? dl_config:num_dci:%d\n", eNB->pdcch_vars[subframe&1].num_dci, number_dci);
do_oai=1; do_oai=1;
break; break;
case NFAPI_DL_CONFIG_BCH_PDU_TYPE: case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
...@@ -661,7 +665,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -661,7 +665,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
// handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu); // handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu);
break; break;
case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE:
LOG_D(PHY,"%s() NFAPI_DL_CONFIG_DLSCH_PDU_TYPE TX:%d/%d RX:%d/%d transport_blocks:%d pdu_index:%d data:%p\n", __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data); LOG_E(PHY,"%s() NFAPI_DL_CONFIG_DLSCH_PDU_TYPE TX:%d/%d RX:%d/%d transport_blocks:%d pdu_index:%d data:%p\n", __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
/* /*
AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus, AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus,
...@@ -712,14 +716,17 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -712,14 +716,17 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
} }
} }
#if 1 if (nfapi_pnf && do_oai)
if (do_oai)
{ {
oai_nfapi_tx_req(Sched_INFO->TX_req); oai_nfapi_tx_req(Sched_INFO->TX_req);
oai_nfapi_dl_config_req(Sched_INFO->DL_req); // DJP - .dl_config_request_body.dl_config_pdu_list[0]); // DJP - FIXME TODO - yuk - only copes with 1 pdu oai_nfapi_dl_config_req(Sched_INFO->DL_req); // DJP - .dl_config_request_body.dl_config_pdu_list[0]); // DJP - FIXME TODO - yuk - only copes with 1 pdu
} }
#endif
if (nfapi_pnf && number_hi_dci0_pdu!=0)
{
oai_nfapi_hi_dci0_req(HI_DCI0_req);
}
for (i=0;i<number_hi_dci0_pdu;i++) { for (i=0;i<number_hi_dci0_pdu;i++) {
...@@ -731,7 +738,9 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -731,7 +738,9 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
case NFAPI_HI_DCI0_DCI_PDU_TYPE: case NFAPI_HI_DCI0_DCI_PDU_TYPE:
handle_nfapi_hi_dci0_dci_pdu(eNB,proc,hi_dci0_req_pdu); handle_nfapi_hi_dci0_dci_pdu(eNB,proc,hi_dci0_req_pdu);
eNB->pdcch_vars[subframe&1].num_dci++; eNB->pdcch_vars[subframe&1].num_dci++;
break; break;
...@@ -742,6 +751,20 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -742,6 +751,20 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
} }
} }
if (nfapi_pnf)
{
for (int future_subframe=0;future_subframe<10;future_subframe++)
{
// DJP - indexing directly into the mac - not good - ??????
if (RC.mac[0]->UL_req_tmp[CC_id][future_subframe].ul_config_request_body.number_of_pdus > 0)
{
LOG_D(PHY,"UL_CONFIG for the future future_subframe:%d PDUs:%d\n", future_subframe, RC.mac[0]->UL_req_tmp[CC_id][future_subframe].ul_config_request_body.number_of_pdus);
oai_nfapi_ul_config_req(&RC.mac[0]->UL_req_tmp[CC_id][future_subframe]);
}
}
}
for (i=0;i<number_ul_pdu;i++) { for (i=0;i<number_ul_pdu;i++) {
ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
......
...@@ -477,8 +477,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -477,8 +477,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
num_dci = eNB->pdcch_vars[subframe&1].num_dci; num_dci = eNB->pdcch_vars[subframe&1].num_dci;
// LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols, // LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,
// DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); // DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(number dci %"PRIu8"\n",num_pdcch_symbols, //LOG_D(PHY,"num_pdcch_symbols %"PRIu8",number dci %"PRIu8"\n",num_pdcch_symbols, num_dci);
num_dci);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,num_pdcch_symbols); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,num_pdcch_symbols);
...@@ -487,10 +486,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -487,10 +486,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if (num_dci > 0) if (num_dci > 0)
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8") num_pdcch_symbols:%d\n",eNB->Mod_id,frame, subframe, num_dci, num_pdcch_symbols); LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8") num_pdcch_symbols:%d\n",eNB->Mod_id,frame, subframe, num_dci, num_pdcch_symbols);
LOG_D(PHY,"Before generate_dci_top num_pdcch_symbols:%d num_dci:%d dci_alloc:dci_length:%d\n", //LOG_D(PHY,"Before generate_dci_top num_pdcch_symbols:%d num_dci:%d dci_alloc:dci_length:%d\n", num_pdcch_symbols, num_dci, eNB->pdcch_vars[subframe&1].dci_alloc[0].dci_length);
num_pdcch_symbols,
num_dci,
eNB->pdcch_vars[subframe&1].dci_alloc[0].dci_length);
generate_dci_top(num_pdcch_symbols, generate_dci_top(num_pdcch_symbols,
num_dci, num_dci,
...@@ -786,6 +782,7 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u ...@@ -786,6 +782,7 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u
pdu->instance_length = 0; // don't know what to do with this pdu->instance_length = 0; // don't know what to do with this
// pdu->rx_ue_information.handle = handle; // pdu->rx_ue_information.handle = handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = rnti; pdu->rx_ue_information.rnti = rnti;
int SNRtimes10 = dB_fixed_times10(stat) - 200;//(10*eNB->measurements.n0_power_dB[0]); int SNRtimes10 = dB_fixed_times10(stat) - 200;//(10*eNB->measurements.n0_power_dB[0]);
...@@ -1386,7 +1383,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -1386,7 +1383,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
stop_meas(&eNB->ulsch_decoding_stats); stop_meas(&eNB->ulsch_decoding_stats);
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d ulsch_harq->cqi_crc_status:%d ackBits:%d\n",
eNB->Mod_id,harq_pid, eNB->Mod_id,harq_pid,
frame,subframe, frame,subframe,
ulsch->rnti, ulsch->rnti,
...@@ -1396,7 +1393,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -1396,7 +1393,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
20,//eNB->measurements.n0_power_dB[1], 20,//eNB->measurements.n0_power_dB[1],
ulsch_harq->o_ACK[0], ulsch_harq->o_ACK[0],
ulsch_harq->o_ACK[1], ulsch_harq->o_ACK[1],
ret); ret,
ulsch_harq->cqi_crc_status,
ulsch_harq->O_ACK);
//compute the expected ULSCH RX power (for the stats) //compute the expected ULSCH RX power (for the stats)
...@@ -1445,6 +1444,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) { ...@@ -1445,6 +1444,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
); );
#endif #endif
} // ulsch in error
else {
fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC fill_crc_indication(eNB,i,frame,subframe,0); // indicate ACK to MAC
fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC
...@@ -1561,12 +1563,18 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { ...@@ -1561,12 +1563,18 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) {
frame,subframe); frame,subframe);
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
pdu = &eNB->UL_INFO.rx_ind.rx_pdu_list[eNB->UL_INFO.rx_ind.number_of_pdus];
eNB->UL_INFO.rx_ind.sfn_sf = frame<<4| subframe;
eNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
pdu = &eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
// pdu->rx_ue_information.handle = eNB->ulsch[UE_id]->handle; // pdu->rx_ue_information.handle = eNB->ulsch[UE_id]->handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti; pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti;
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3; pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3;
pdu->rx_indication_rel8.offset = 0; // filled in at the end of the UL_INFO formation pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->b; pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->b;
// estimate timing advance for MAC // estimate timing advance for MAC
sync_pos = lte_est_timing_advance_pusch(eNB,UE_id); sync_pos = lte_est_timing_advance_pusch(eNB,UE_id);
...@@ -1613,7 +1621,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { ...@@ -1613,7 +1621,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) {
harq_pid,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance, harq_pid,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance,
timing_advance_update); timing_advance_update);
eNB->UL_INFO.rx_ind.number_of_pdus++; eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
...@@ -1709,11 +1717,13 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe ...@@ -1709,11 +1717,13 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe
nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis]; nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis]; nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = rnti; pdu->rx_ue_information.rnti = rnti;
if (ulsch_harq->cqi_crc_status != 1) pdu->cqi_indication_rel9.data_offset = 0; if (ulsch_harq->cqi_crc_status != 1) pdu->cqi_indication_rel9.data_offset = 0;
else pdu->cqi_indication_rel9.data_offset = 1; // fill in after all cqi_indications have been generated when non-zero else pdu->cqi_indication_rel9.data_offset = 1; // fill in after all cqi_indications have been generated when non-zero
// by default set O to rank 1 value // by default set O to rank 1 value
pdu->cqi_indication_rel9.tl.tag = NFAPI_CQI_INDICATION_REL9_TAG;
pdu->cqi_indication_rel9.length = (ulsch_harq->Or1>>3) + ((ulsch_harq->Or1&7) > 0 ? 1 : 0); pdu->cqi_indication_rel9.length = (ulsch_harq->Or1>>3) + ((ulsch_harq->Or1&7) > 0 ? 1 : 0);
pdu->cqi_indication_rel9.ri[0] = 0; pdu->cqi_indication_rel9.ri[0] = 0;
...@@ -1728,6 +1738,8 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe ...@@ -1728,6 +1738,8 @@ void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe
pdu->ul_cqi_information.channel = 1; // PUSCH pdu->ul_cqi_information.channel = 1; // PUSCH
memcpy((void*)raw_pdu->pdu,ulsch_harq->o,pdu->cqi_indication_rel9.length); memcpy((void*)raw_pdu->pdu,ulsch_harq->o,pdu->cqi_indication_rel9.length);
eNB->UL_INFO.cqi_ind.number_of_cqis++; eNB->UL_INFO.cqi_ind.number_of_cqis++;
LOG_E(PHY,"eNB->UL_INFO.cqi_ind.number_of_cqis:%d\n", eNB->UL_INFO.cqi_ind.number_of_cqis);
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
...@@ -1747,6 +1759,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, ...@@ -1747,6 +1759,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
pdu->rx_ue_information.rnti = rnti; pdu->rx_ue_information.rnti = rnti;
if (eNB->frame_parms.frame_type == FDD) { if (eNB->frame_parms.frame_type == FDD) {
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.mode = 0;
pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK; pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
...@@ -1772,6 +1785,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, ...@@ -1772,6 +1785,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
M=ul_ACK_subframe2_M(&eNB->frame_parms, M=ul_ACK_subframe2_M(&eNB->frame_parms,
subframe); subframe);
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
pdu->harq_indication_fdd_rel13.mode = 1-bundling; pdu->harq_indication_fdd_rel13.mode = 1-bundling;
pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK; pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
...@@ -1791,7 +1805,9 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, ...@@ -1791,7 +1805,9 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
} }
} }
LOG_E(PHY,"eNB->UL_INFO.harq_ind.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.number_of_harqs);
eNB->UL_INFO.harq_ind.number_of_harqs++; eNB->UL_INFO.harq_ind.number_of_harqs++;
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
...@@ -1951,6 +1967,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, ...@@ -1951,6 +1967,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
eNB->UL_INFO.harq_ind.number_of_harqs++; eNB->UL_INFO.harq_ind.number_of_harqs++;
LOG_E(PHY,"Incremented eNB->UL_INFO.harq_ind.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.number_of_harqs);
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
...@@ -1959,14 +1976,22 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, ...@@ -1959,14 +1976,22 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag) { void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag) {
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_pdu_list[eNB->UL_INFO.crc_ind.number_of_crcs]; nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
eNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
eNB->UL_INFO.crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
pdu->instance_length = 0; // don't know what to do with this pdu->instance_length = 0; // don't know what to do with this
// pdu->rx_ue_information.handle = handle; // pdu->rx_ue_information.handle = handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti; pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti;
pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
pdu->crc_indication_rel8.crc_flag = crc_flag; pdu->crc_indication_rel8.crc_flag = crc_flag;
eNB->UL_INFO.crc_ind.number_of_crcs++; eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++;
LOG_D(PHY, "%s() rnti:%04x pdus:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs);
pthread_mutex_unlock(&eNB->UL_INFO_mutex); pthread_mutex_unlock(&eNB->UL_INFO_mutex);
} }
...@@ -1996,10 +2021,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -1996,10 +2021,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
eNB->rb_mask_ul[2]=0; eNB->rb_mask_ul[2]=0;
eNB->rb_mask_ul[3]=0; eNB->rb_mask_ul[3]=0;
// Fix me here, these should be locked
eNB->UL_INFO.rx_ind.number_of_pdus = 0;
eNB->UL_INFO.crc_ind.number_of_crcs = 0;
// Call SRS first since all others depend on presence of SRS or lack thereof // Call SRS first since all others depend on presence of SRS or lack thereof
srs_procedures(eNB,proc); srs_procedures(eNB,proc);
......
...@@ -245,6 +245,8 @@ void schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -245,6 +245,8 @@ void schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; ul_req = &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
LOG_E(MAC, "UE active UE_id:%d ul_req->number_of_pdus:%d\n", UE_id, ul_req->number_of_pdus);
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id); AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id);
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet // drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
...@@ -417,23 +419,29 @@ void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) ...@@ -417,23 +419,29 @@ void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP)
{ {
int CC_id; int CC_id;
eNB_MAC_INST *eNB; eNB_MAC_INST *eNB;
nfapi_ul_config_request_body_t *ul_req_tmp; nfapi_ul_config_request_body_t *ul_req_body_tmp;
nfapi_ul_config_request_body_t *ul_req; nfapi_ul_config_request_body_t *ul_req_body;
eNB = RC.mac[module_idP]; eNB = RC.mac[module_idP];
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
ul_req_tmp = &eNB->UL_req_tmp[CC_id][subframeP].ul_config_request_body; ul_req_body_tmp = &eNB->UL_req_tmp[CC_id][subframeP].ul_config_request_body;
ul_req = &