Commit 9f781408 authored by David Price's avatar David Price

Fails at the point core sends Identity Request to UE

parent 3a7456df
......@@ -964,7 +964,7 @@ int pnf_phy_hi_dci0_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t*
int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req)
{
LOG_D(PHY,"[PNF] dl config request sfn_sf:%d pdcch:%u dci:%u pdu:%d pdsch_rnti:%d pcfich:%u RC.ru:%p RC.eNB:%p sync_var:%d\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, RC.ru, RC.eNB, sync_var);
LOG_D(PHY,"[PNF] %s() sfn_sf:%d pdcch:%u dl_cfg[dci:%u pdus:%d pdsch_rnti:%d] pcfich:%u\n", __FUNCTION__,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);
if (RC.ru == 0)
{
......@@ -1038,10 +1038,11 @@ int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request
{
nfapi_dl_config_dlsch_pdu *dlsch_pdu = &dl_config_pdu_list[i].dlsch_pdu;
nfapi_dl_config_dlsch_pdu_rel8_t *rel8_pdu = &dlsch_pdu->dlsch_pdu_rel8;
nfapi_tx_request_pdu_t *tx_pdu = tx_request_pdu[sfn][sf][rel8_pdu->pdu_index];
if (tx_request_pdu[sfn][sf][rel8_pdu->pdu_index] != NULL)
if (tx_pdu != NULL)
{
uint8_t *dlsch_sdu = malloc(tx_request_pdu[sfn][sf][rel8_pdu->pdu_index]->segments[0].segment_length);
uint8_t *dlsch_sdu = malloc(tx_pdu->segments[0].segment_length);
// **********************************************************************
// THIS IS CREATING AN INTENTIONAL LEAK - I think...
......@@ -1053,7 +1054,7 @@ int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request
// I THINK I NEED TO FIX THIS - unless it IS getting freed by the stack
//
// **********************************************************************
memcpy(dlsch_sdu, tx_request_pdu[sfn][sf][rel8_pdu->pdu_index]->segments[0].segment_data, tx_request_pdu[sfn][sf][rel8_pdu->pdu_index]->segments[0].segment_length);
memcpy(dlsch_sdu, tx_pdu->segments[0].segment_data, tx_pdu->segments[0].segment_length);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DLSCH:pdu_index:%d handle_nfapi_dlsch_pdu(eNB, proc_rxtx, dlsch_pdu, transport_blocks:%d sdu:%p) eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols:%d\n", __FUNCTION__, rel8_pdu->pdu_index, rel8_pdu->transport_blocks, dlsch_sdu, eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols);
......@@ -1086,13 +1087,13 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf);
LOG_D(PHY,"%s() SFN/SF:%d/%d PDUs:%d\n", __FUNCTION__, sfn, sf, req->tx_request_body.number_of_pdus);
LOG_D(PHY,"%s() SFN/SF:%d%d PDUs:%d\n", __FUNCTION__, sfn, sf, req->tx_request_body.number_of_pdus);
if (req->tx_request_body.tl.tag==NFAPI_TX_REQUEST_BODY_TAG)
{
for (int i=0; i<req->tx_request_body.number_of_pdus; i++)
{
LOG_D(PHY,"%s() SFN/SF:%d/%d number_of_pdus:%d [PDU:%d] pdu_length:%d pdu_index:%d num_segments:%d\n",
LOG_D(PHY,"%s() SFN/SF:%d%d number_of_pdus:%d [PDU:%d] pdu_length:%d pdu_index:%d num_segments:%d\n",
__FUNCTION__,
sfn, sf,
req->tx_request_body.number_of_pdus,
......@@ -1149,7 +1150,7 @@ int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
for (int i=0;i<req->ul_config_request_body.number_of_pdus;i++)
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, ul_config_pdu_list[i].pdu_size);
LOG_D(PHY, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, ul_config_pdu_list[i].pdu_size);
if (
ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
......@@ -1161,7 +1162,7 @@ int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE
)
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() handle_nfapi_ul_pdu() for PDU:%d\n", __FUNCTION__, i);
LOG_D(PHY, "%s() handle_nfapi_ul_pdu() for PDU:%d\n", __FUNCTION__, i);
handle_nfapi_ul_pdu(eNB,proc,&ul_config_pdu_list[i],curr_sfn,curr_sf,req->ul_config_request_body.srs_present);
}
......@@ -1871,3 +1872,16 @@ int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind)
return retval;
}
int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind)
{
ind->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
int retval = nfapi_pnf_p7_sr_ind(p7_config_g, ind);
LOG_E(PHY,"%s() retval:%d\n", __FUNCTION__, retval);
//free(ind.rx_indication_body.rx_pdu_list);
return retval;
}
......@@ -532,7 +532,7 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf)
old_sf = sf;
old_sfn = sfn;
if (old_sf == 0 && old_sfn % 100==0) LOG_W( PHY,"[eNB] sfn/sf:%d:%d old_sfn/sf:%d:%d proc[frame_rx:%d subframe_rx:%d]\n", sfn, sf, old_sfn, old_sf, proc->frame_rx, proc->subframe_rx);
if (old_sf == 0 && old_sfn % 100==0) LOG_W( PHY,"[eNB] sfn/sf:%d%d old_sfn/sf:%d%d proc[rx:%d%d]\n", sfn, sf, old_sfn, old_sf, proc->frame_rx, proc->subframe_rx);
}
++proc_rxtx->instance_cnt_rxtx;
......@@ -551,7 +551,7 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf)
proc_rxtx->frame_tx = (proc_rxtx->subframe_rx > (9-sf_ahead)) ? (proc_rxtx->frame_rx+1)&1023 : proc_rxtx->frame_rx;
proc_rxtx->subframe_tx = (proc_rxtx->subframe_rx + sf_ahead)%10;
LOG_E(PHY, "sfn/sf:%d:%d proc[frame_rx:%d subframe_rx:%d timestamp_rx:%ld timestamp_tx:%ld] proc_rxtx[instance_cnt_rxtx:%d frame_rx:%d subframe_rx:%d]\n", sfn, sf, proc->frame_rx, proc->subframe_rx, proc->timestamp_rx, proc->timestamp_tx, proc_rxtx->instance_cnt_rxtx, proc_rxtx->frame_rx, proc_rxtx->subframe_rx);
LOG_D(PHY, "sfn/sf:%d%d proc[rx:%d%d] proc_rxtx[instance_cnt_rxtx:%d rx:%d%d]\n\n", sfn, sf, proc->frame_rx, proc->subframe_rx, proc_rxtx->instance_cnt_rxtx, proc_rxtx->frame_rx, proc_rxtx->subframe_rx);
// the thread can now be woken up
if (pthread_cond_signal(&proc_rxtx->cond_rxtx) != 0) {
......@@ -560,7 +560,9 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf)
return(-1);
}
//LOG_D(PHY,"%s() About to attempt pthread_mutex_unlock\n", __FUNCTION__);
pthread_mutex_unlock( &proc_rxtx->mutex_rxtx );
//LOG_D(PHY,"%s() UNLOCKED pthread_mutex_unlock\n", __FUNCTION__);
return(0);
}
......@@ -775,10 +777,34 @@ 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)
{
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_sr_ind(p7_vnf->mac, ind);
return 1;
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
LOG_D(MAC, "%s() NFAPI SFN/SF:%d srs:%d\n", NFAPI_SFNSF2DEC(ind->sfn_sf), ind->sr_indication_body.number_of_srs);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_sr_indication_t *dest_ind = &eNB->UL_INFO.sr_ind;
nfapi_rx_indication_pdu_t *dest_pdu_list = eNB->sr_pdu_list;
*dest_ind = *ind;
dest_ind->sr_indication_body.sr_pdu_list = dest_pdu_list;
for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
{
nfapi_sr_indication_pdu_t *dest_pdu = &dest_ind->sr_indication_body.sr_pdu_list[i];
nfapi_sr_indication_pdu_t *src_pdu = &ind->sr_indication_body.sr_pdu_list[i];
memcpy(dest_pdu, src_pdu, sizeof(*src_pdu));
}
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
// vnf_p7_info* p7_vnf = (vnf_p7_info*)(config->user_data);
//mac_sr_ind(p7_vnf->mac, ind);
return 1;
}
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);
......@@ -1354,15 +1380,20 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req)
dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
//dl_config_req->header.message_id = NFAPI_DL_CONFIG_BCH_PDU_TYPE;
//NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() header message_id:%02x\n", __FUNCTION__, dl_config_req->header.message_id);
//LOG_D(PHY, "[VNF] %s() header message_id:%02x\n", __FUNCTION__, dl_config_req->header.message_id);
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() DL_CONFIG p7_config:%p phy_id:%d message_id:%02x sfn_sf:%d pdcch:%d dci:%d pdu:%d pdsch_rnti:%d pcfich:%d\n", __FUNCTION__, p7_config, dl_config_req->header.phy_id, dl_config_req->header.message_id, NFAPI_SFNSF2DEC(dl_config_req->sfn_sf), dl_config_req->dl_config_request_body.number_pdcch_ofdm_symbols, dl_config_req->dl_config_request_body.number_dci, dl_config_req->dl_config_request_body.number_pdu, dl_config_req->dl_config_request_body.number_pdsch_rnti, dl_config_req->dl_config_request_body.transmission_power_pcfich);
LOG_D(PHY, "[VNF] %s() DL_CONFIG p7_config:%p phy_id:%d message_id:%02x sfn_sf:%d pdcch:%d dci:%d pdu:%d pdsch_rnti:%d pcfich:%d\n", __FUNCTION__, p7_config, dl_config_req->header.phy_id, dl_config_req->header.message_id, NFAPI_SFNSF2DEC(dl_config_req->sfn_sf), dl_config_req->dl_config_request_body.number_pdcch_ofdm_symbols, dl_config_req->dl_config_request_body.number_dci, dl_config_req->dl_config_request_body.number_pdu, dl_config_req->dl_config_request_body.number_pdsch_rnti, dl_config_req->dl_config_request_body.transmission_power_pcfich);
int retval = nfapi_vnf_p7_dl_config_req(p7_config, dl_config_req);
dl_config_req->dl_config_request_body.number_pdcch_ofdm_symbols = 1;
dl_config_req->dl_config_request_body.number_dci = 0;
dl_config_req->dl_config_request_body.number_pdu = 0;
dl_config_req->dl_config_request_body.number_pdsch_rnti = 0;
if (retval!=0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
}
return retval;
}
......@@ -1373,13 +1404,18 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req)
tx_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() TX_REQ p7_config:%p phy_id:%d message_id:%02x sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, p7_config, tx_req->header.phy_id, tx_req->header.message_id, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
LOG_D(PHY, "[VNF] %s() TX_REQ p7_config:%p phy_id:%d message_id:%02x sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, p7_config, tx_req->header.phy_id, tx_req->header.message_id, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
int retval = nfapi_vnf_p7_tx_req(p7_config, tx_req);
if (retval!=0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
}
else
{
tx_req->tx_request_body.number_of_pdus = 0;
}
return retval;
}
......@@ -1390,13 +1426,19 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req)
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:%02x 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);
LOG_D(PHY, "[VNF] %s() HI_DCI0_REQ p7_config:%p phy_id:%d message_id:%02x 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);
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
}
else
{
hi_dci0_req->hi_dci0_request_body.number_of_hi = 0;
hi_dci0_req->hi_dci0_request_body.number_of_dci = 0;
}
return retval;
}
......@@ -1407,9 +1449,9 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req)
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:%02x\n", __FUNCTION__, ul_config_req->header.message_id);
//LOG_D(PHY, "[VNF] %s() header message_id:%02x\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:%02x sfn_sf:%d PDUs:%d rach_prach_frequency_resources:%d srs_present:%d\n",
LOG_D(PHY, "[VNF] %s() UL_CONFIG p7_config:%p phy_id:%d message_id:%02x 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,
......@@ -1419,13 +1461,14 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req)
if (retval!=0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
LOG_E(PHY, "%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;
ul_config_req->ul_config_request_body.number_of_pdus = 0;
ul_config_req->ul_config_request_body.rach_prach_frequency_resources = 0;
ul_config_req->ul_config_request_body.srs_present = 0;
}
return retval;
}
......@@ -832,7 +832,7 @@ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
AssertFatal(eNB->dlsch[i]!=NULL,"eNB->dlsch[%d] is null\n",i);
AssertFatal(eNB->dlsch[i]!=NULL,"eNB->dlsch[%d][0] is null\n",i);
//LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index);
LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index);
if ((eNB->dlsch[i][0]->harq_mask >0) &&
(eNB->dlsch[i][0]->rnti==rnti)) return i;
else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
......
......@@ -96,6 +96,7 @@ void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start,
hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms);
// DJP - TODO FIXME - transmission power ignored
phich->config[phich->num_hi].hi = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value;
phich->config[phich->num_hi].first_rb = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start;
phich->config[phich->num_hi].n_DMRS = hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms;
......@@ -111,7 +112,7 @@ void handle_nfapi_bch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
AssertFatal(rel8->length == 3, "BCH PDU has length %d != 3\n",rel8->length);
LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]);
//LOG_D(PHY,"bch_pdu: %x,%x,%x\n",sdu[0],sdu[1],sdu[2]);
eNB->pbch_pdu[0] = sdu[2];
eNB->pbch_pdu[1] = sdu[1];
eNB->pbch_pdu[2] = sdu[0];
......@@ -618,10 +619,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
eNB->pdcch_vars[subframe&1].num_dci = number_dci;
eNB->phich_vars[subframe&1].num_hi = 0;
LOG_D(PHY,"NFAPI: Sched_INFO[Frame %d, Subframe %d]: %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config num_pdcch_symbols:%d\n",
frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu,
eNB->pdcch_vars[subframe&1].num_pdcch_symbols
);
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%d%d dl_pdu:%d tx_req:%d hi_dci0:%d ul_cfg:%d num_pdcch_symbols:%d\n",
frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu, eNB->pdcch_vars[subframe&1].num_pdcch_symbols);
int do_oai =0;
......@@ -641,12 +640,12 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
}
for (i=0;i<number_dl_pdu;i++) {
dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i];
LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
switch (dl_config_pdu->pdu_type) {
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
handle_nfapi_dci_dl_pdu(eNB,proc,dl_config_pdu);
eNB->pdcch_vars[subframe&1].num_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);
//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;
break;
case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
......@@ -667,7 +666,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
// handle_nfapi_mch_dl_pdu(eNB,dl_config_pdu);
break;
case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE:
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);
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);
/*
AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus,
......@@ -718,15 +717,13 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
}
}
if (nfapi_mode && do_oai)
{
if (nfapi_mode && do_oai) {
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
}
if (nfapi_mode && number_hi_dci0_pdu!=0)
{
if (nfapi_mode && number_hi_dci0_pdu!=0) {
oai_nfapi_hi_dci0_req(HI_DCI0_req);
}
......@@ -738,25 +735,22 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
switch (hi_dci0_req_pdu->pdu_type) {
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++;
break;
eNB->pdcch_vars[subframe&1].num_dci++;
break;
case NFAPI_HI_DCI0_HI_PDU_TYPE:
handle_nfapi_hi_dci0_hi_pdu(eNB,proc,hi_dci0_req_pdu);
case NFAPI_HI_DCI0_HI_PDU_TYPE:
handle_nfapi_hi_dci0_hi_pdu(eNB,proc,hi_dci0_req_pdu);
break;
break;
}
}
if (nfapi_mode)
{
for (int future_subframe=0;future_subframe<10;future_subframe++)
{
if (nfapi_mode) {
for (int future_subframe=0;future_subframe<10;future_subframe++) {
nfapi_ul_config_request_t *ul_req_tmp = &RC.mac[0]->UL_req_tmp[CC_id][future_subframe];
// DJP - indexing directly into the mac - not good - ??????
......@@ -772,18 +766,29 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
}
}
for (i=0;i<number_ul_pdu;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);
AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE
,
"Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type);
handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present);
if (nfapi_mode) {
if (number_ul_pdu>0)
{
LOG_D(PHY, "UL_CONFIG to send to PNF\n");
oai_nfapi_ul_config_req(UL_req);
UL_req->ul_config_request_body.number_of_pdus=0;
number_ul_pdu=0;
}
}
else {
for (i=0;i<number_ul_pdu;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);
AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE
,
"Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type);
handle_nfapi_ul_pdu(eNB,proc,ul_config_pdu,UL_req->sfn_sf>>4,UL_req->sfn_sf&0xf,UL_req->ul_config_request_body.srs_present);
}
}
}
......@@ -784,7 +784,14 @@ void srs_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat) {
pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_sr_indication_pdu_t *pdu = &eNB->UL_INFO.sr_ind.sr_pdu_list[eNB->UL_INFO.sr_ind.number_of_srs];
nfapi_sr_indication_t *sr_ind = &eNB->UL_INFO.sr_ind;
nfapi_sr_indication_body_t *sr_ind_body = &sr_ind->sr_indication_body;
nfapi_sr_indication_pdu_t *pdu = &sr_ind_body->sr_pdu_list[sr_ind_body->number_of_srs];
sr_ind.sfn_sf = frame<<4|subframe;
sr_ind.header.message_id = NFAPI_RX_SR_INDICATION;
sr_ind_body->tl.tag = NFAPI_SR_INDICATION_BODY_TAG;
pdu->instance_length = 0; // don't know what to do with this
// pdu->rx_ue_information.handle = handle;
......@@ -794,12 +801,14 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u
int SNRtimes10 = dB_fixed_times10(stat) - 200;//(10*eNB->measurements.n0_power_dB[0]);
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
if (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0;
else if (SNRtimes10 > 635) pdu->ul_cqi_information.ul_cqi=255;
else pdu->ul_cqi_information.ul_cqi=(640+SNRtimes10)/5;
pdu->ul_cqi_information.channel = 0;
eNB->UL_INFO.sr_ind.number_of_srs++;
sr_ind_body->number_of_srs++;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
......
......@@ -234,7 +234,8 @@ void schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
{
eNB_MAC_INST *eNB = RC.mac[module_idP];
UE_list_t *UE_list = &eNB->UE_list;
nfapi_ul_config_request_body_t *ul_req;
nfapi_ul_config_request_t *ul_req;
nfapi_ul_config_request_body_t *ul_req_body;
int CC_id;
int UE_id;
SchedulingRequestConfig_t *SRconfig;
......@@ -249,9 +250,10 @@ void schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
for (UE_id = 0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
if (RC.mac[module_idP]->UE_list.active[UE_id]!=TRUE) continue;
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_req_body = &ul_req->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);
//LOG_D(MAC, "UE active UE_id:%d ul_req_body->number_of_pdus:%d\n", UE_id, ul_req_body->number_of_pdus);
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated != NULL, "physicalConfigDedicated is null for UE %d\n",UE_id);
......@@ -284,18 +286,18 @@ void schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
skip_ue=0;
is_harq = 0;
// check that there is no existing UL grant for ULSCH which overrides the SR
for (i = 0; i < ul_req->number_of_pdus; i++) {
if (((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)||
(ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)||
(ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)||
(ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE))&&
(ul_req->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
for (i = 0; i < ul_req_body->number_of_pdus; i++) {
if (((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE)||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE)||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE)||
(ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE))&&
(ul_req_body->ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
skip_ue=1;
break;
}
/* if there is already an HARQ pdu, convert to SR_HARQ */
else if ((ul_req->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)&&
(ul_req->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
else if ((ul_req_body->ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE)&&
(ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.ue_information.ue_information_rel8.rnti == UE_list->UE_template[CC_id][UE_id].rnti)) {
is_harq = 1;
break;
}
......@@ -304,33 +306,45 @@ void schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
// drop the allocation because ULSCH with handle it with BSR
if (skip_ue==1) continue;
LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti);
LOG_D(MAC,"Frame %d, Subframe %d : Scheduling SR for UE %d/%x is_harq:%d\n",frameP,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].rnti, is_harq);
// check Rel10 or Rel8 SR
#if defined(Rel10) || defined(Rel14)
if ((UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2) &&
(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)&&
(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020)) {
sr.sr_information_rel8.tl.tag = 0;
sr.sr_information_rel10.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG;
sr.sr_information_rel10.number_of_pucch_resources = 1;
sr.sr_information_rel10.pucch_index_p1 = *UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->ext2->schedulingRequestConfig_v1020->sr_PUCCH_ResourceIndexP1_r10;
LOG_D(MAC,"REL10 PUCCH INDEX P1:%d\n", sr.sr_information_rel10.pucch_index_p1);
} else
#endif
{
sr.sr_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG;
sr.sr_information_rel8.pucch_index = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
sr.sr_information_rel10.tl.tag = 0;
LOG_D(MAC,"REL8 PUCCH INDEX:%d\n", sr.sr_information_rel8.pucch_index);
}
/* if there is already an HARQ pdu, convert to SR_HARQ */
if (is_harq) {
nfapi_ul_config_harq_information h = ul_req->ul_config_pdu_list[i].uci_harq_pdu.harq_information;
ul_req->ul_config_pdu_list[i].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
ul_req->ul_config_pdu_list[i].uci_sr_harq_pdu.sr_information = sr;
ul_req->ul_config_pdu_list[i].uci_sr_harq_pdu.harq_information = h;
nfapi_ul_config_harq_information h = ul_req_body->ul_config_pdu_list[i].uci_harq_pdu.harq_information;
ul_req_body->ul_config_pdu_list[i].pdu_type = NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE;
ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.sr_information = sr;
ul_req_body->ul_config_pdu_list[i].uci_sr_harq_pdu.harq_information = h;
} else {
ul_req->ul_config_pdu_list[ul_req->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ul_req->ul_config_pdu_list[ul_req->number_of_pdus].uci_sr_pdu.sr_information = sr;
ul_req->number_of_pdus++;
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].pdu_type = NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE;
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel8.rnti = UE_list->UE_template[CC_id][UE_id].rnti;
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel11.tl.tag = 0;
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.ue_information.ue_information_rel13.tl.tag = 0;
ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus].uci_sr_pdu.sr_information = sr;
ul_req_body->number_of_pdus++;
} /* if (is_harq) */
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
} // for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id])
} // for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
}
......@@ -392,6 +406,8 @@ void check_ul_failure(module_id_t module_idP,int CC_id,int UE_id,
}
extern uint8_t nfapi_mode;
void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_frame_t subframeP)
{
nfapi_dl_config_request_t *DL_req = &eNB->DL_req[0];
......@@ -399,26 +415,41 @@ void clear_nfapi_information(eNB_MAC_INST *eNB,int CC_idP,frame_t frameP,sub_fra
nfapi_hi_dci0_request_t *HI_DCI0_req = &eNB->HI_DCI0_req[0];
nfapi_tx_request_t *TX_req = &eNB->TX_req[0];
eNB->pdu_index[CC_idP] = 0;
DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1;
DL_req[CC_idP].dl_config_request_body.number_dci = 0;
DL_req[CC_idP].dl_config_request_body.number_pdu = 0;
DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0;
DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000;
HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<4);
HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0;
UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0;
UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now
UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now
TX_req[CC_idP].tx_request_body.number_of_pdus = 0;
if (nfapi_mode==0 || nfapi_mode == 1) // monolithic or PNF
{
DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1;
DL_req[CC_idP].dl_config_request_body.number_dci = 0;
DL_req[CC_idP].dl_config_request_body.number_pdu = 0;
DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0;
DL_req[CC_idP].dl_config_request_body.transmission_power_pcfich = 6000;
HI_DCI0_req[CC_idP].hi_dci0_request_body.sfnsf = subframeP + (frameP<<4);
HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci = 0;
UL_req[CC_idP].ul_config_request_body.number_of_pdus = 0;
UL_req[CC_idP].ul_config_request_body.rach_prach_frequency_resources = 0; // ignored, handled by PHY for now
UL_req[CC_idP].ul_config_request_body.srs_present = 0; // ignored, handled by PHY for now
TX_req[CC_idP].tx_request_body.number_of_pdus = 0;
LOG_D(MAC,"%s() SFN_SF:%d%d ZERO PDUs of TX_req:(SFN_SF:%d):%d UL_req:(SFN_SF:%d):%d HI_DCI0_req:(SFN_SF:%d):dci:%d hi:%d DL:(SFN_SF:%d):dci:%d DL:pdu:%d\n",
__FUNCTION__,
frameP, subframeP,
NFAPI_SFNSF2DEC(TX_req[CC_idP].sfn_sf),
TX_req[CC_idP].tx_request_body.number_of_pdus,
NFAPI_SFNSF2DEC(UL_req[CC_idP].sfn_sf),
UL_req[CC_idP].ul_config_request_body.number_of_pdus,
NFAPI_SFNSF2DEC(HI_DCI0_req[CC_idP].sfn_sf),
HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_dci,
HI_DCI0_req[CC_idP].hi_dci0_request_body.number_of_hi,
NFAPI_SFNSF2DEC(DL_req[CC_idP].sfn_sf),
DL_req[CC_idP].dl_config_request_body.number_dci,
DL_req[CC_idP].dl_config_request_body.number_pdu);
}
}
void copy_ulreq(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP)
......@@ -485,8 +516,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, sub_frame
#endif
RC.mac[module_idP]->frame = frameP;
RC.mac[module_idP]->subframe = subframeP;
clear_nfapi_information(RC.mac[module_idP],CC_id,frameP,subframeP);
}
// refresh UE list based on UEs dropped by PHY in previous subframe
......
......@@ -886,6 +886,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// see Section 10.2 from 36.213
int ackNAK_absSF = absSF + reps + 4;
AssertFatal(reps>2,"Have to handle programming of ACK when PDSCH repetitions is > 2\n");
ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF%10];
ul_req_body = &ul_req->ul_config_request_body;
ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
......@@ -906,6 +907,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
ul_req->sfn_sf = sfnsf_add_subframe(RA_template->Msg3_frame, RA_template->Msg3_subframe, 4);
ul_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
LOG_D(MAC,"UL_req_tmp[CC_idP:%d][ackNAK_absSF mod 10:%d] RA_template->Msg3_frame:%d RA_template->Msg3_subframe:%d + 4 sfn_sf:%d\n", CC_idP, ackNAK_absSF%10, RA_template->Msg3_frame, RA_template->Msg3_subframe, NFAPI_SFNSF2DEC(ul_req->sfn_sf));
// Note need to keep sending this across reptitions!!!! Not really for PUCCH, to ask small-cell forum, we'll see for the other messages, maybe parameters change across repetitions and FAPI has to provide for that
if (cc[CC_idP].tdd_Config==NULL) { // FDD case
ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG;
......
......@@ -560,7 +560,7 @@ void schedule_mib(module_id_t module_idP,
dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
dl_config_request->sfn_sf = sfn_sf;
LOG_E(MAC,"eNB->DL_req[0].number_pdu %d (%p) sfn_sf:%d\n", dl_req->number_pdu,&dl_req->number_pdu, NFAPI_SFNSF2DEC(dl_config_request->sfn_sf));
//LOG_D(MAC,"eNB->DL_req[0].number_pdu %d (%p) sfn_sf:%d\n", dl_req->number_pdu,&dl_req->number_pdu, NFAPI_SFNSF2DEC(dl_config_request->sfn_sf));
// DL request
TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
......@@ -694,6 +694,7 @@ schedule_SI(
//LOG_D(MAC,"%s() Before ADDING SI dl_req->number_pdu:%d dl_req->number_dci:%d eNB->TX_req[CC_id].tx_request_body.number_of_pdus:%d\n", __FUNCTION__, dl_req->number_pdu, dl_req->number_dci, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
......
......@@ -75,6 +75,7 @@ add_ue_dlsch_info(
)
//------------------------------------------------------------------------------
{
//LOG_D(MAC, "%s(module_idP:%d, CC_id:%d, UE_id:%d, subframeP:%d, status:%d) serving_num:%d rnti:%x\n", __FUNCTION__, module_idP, CC_id, UE_id, subframeP, status, eNB_dlsch_info[module_idP][CC_id][UE_id].serving_num, UE_RNTI(module_idP,UE_id));
eNB_dlsch_info[module_idP][CC_id][UE_id].rnti = UE_RNTI(module_idP,UE_id);
// eNB_dlsch_info[module_idP][CC_id][ue_mod_idP].weight = weight;
......@@ -542,6 +543,8 @@ schedule_ue_spec(
dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
//LOG_D(MAC,"%s() BEFORE mbsfn_flag[CC_id]:%d dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, mbsfn_flag[CC_id], dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
if (mbsfn_flag[CC_id]>0)
continue;
......@@ -551,6 +554,7 @@ schedule_ue_spec(
eNB_UE_stats = &UE_list->eNB_UE_stats[CC_id][UE_id];
ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
//LOG_D(MAC,"%s() rnti:%x, eNB_UE_stats:%p, ue_sched_ctl:%p tmode:%d\n", __FUNCTION__, rnti, eNB_UE_stats, ue_sched_ctl, get_tmode(module_idP,CC_id,UE_id));
if (rnti==NOT_A_RNTI) {
LOG_D(MAC,"Cannot find rnti for UE_id %d (num_UEs %d)\n",UE_id,UE_list->num_UEs);
......@@ -582,6 +586,7 @@ schedule_ue_spec(
}
} /* if (continue_flag != 1 */
//LOG_D(MAC,"%s() BEFORE mbsfn_flag[CC_id]:%d dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, mbsfn_flag[CC_id], dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated
CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,aggregation,rnti)
) {
......@@ -599,14 +604,18 @@ schedule_ue_spec(
set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP);
}
//LOG_D(MAC,"%s() BEFORE mbsfn_flag[CC_id]:%d continue_flag:%d dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, mbsfn_flag[CC_id], continue_flag, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
if (continue_flag == 1 ) {
//LOG_D(MAC,"[eNB %d] Frame %d : UE %d on CC_id %d: continue flag - add_ue_dlsch_info\n", module_idP, frameP, UE_id, CC_id);
add_ue_dlsch_info(module_idP,
CC_id,
UE_id,
subframeP,
S_DL_NONE);
//LOG_D(MAC,"%s() BEFORE mbsfn_flag[CC_id]:%d continue_flag:%d dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, mbsfn_flag[CC_id], continue_flag, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
continue;
}
//LOG_D(MAC,"%s() BEFORE mbsfn_flag[CC_id]:%d continue_flag:%d dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, mbsfn_flag[CC_id], continue_flag, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
#warning RK->CR This old API call has to be revisited for FAPI, or logic must be changed
#if 0
......@@ -715,6 +724,7 @@ schedule_ue_spec(
}
*/
LOG_D(MAC,"%s() BEFORE dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
switch (get_tmode(module_idP,CC_id,UE_id)) {
case 1:
case 2:
......@@ -787,7 +797,9 @@ schedule_ue_spec(
LOG_D(MAC,"Filled NFAPI configuration for DCI/DLSCH %d, retransmission round %d\n",eNB->pdu_index[CC_id],round);
LOG_D(MAC,"%s() BEFORE dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
program_dlsch_acknak(module_idP,CC_id,UE_id,frameP,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
LOG_D(MAC,"%s() BEFORE dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
// No TX request for retransmission (check if null request for FAPI)
}
else {
......@@ -949,7 +961,7 @@ schedule_ue_spec(
header_len_dtch+=3;
header_len_dtch_last=3;
LOG_D(MAC,"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
if (0)LOG_D(MAC,"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
module_idP,frameP,lcid,TBS,
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
......@@ -1223,6 +1235,8 @@ schedule_ue_spec(
tpc = 1; //0
}
LOG_D(MAC,"%s() BEFORE 2 dl_config dci:%d pdu:%d\n", __FUNCTION__, dl_req->number_dci, dl_req->number_pdu);
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
......@@ -1300,12 +1314,14 @@ schedule_ue_spec(
0, //number of PRBs treated as one subband, not used here
0 // number of beamforming vectors, not used here
);
LOG_D(MAC,"%s() BEFORE dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
eNB->TX_req[CC_id].sfn_sf = fill_nfapi_tx_req(&eNB->TX_req[CC_id].tx_request_body,
(frameP*10)+subframeP,
TBS,
eNB->pdu_index[CC_id],
eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0]);
LOG_D(MAC,"%s() BEFORE dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[CC_id].tx_request_body.number_of_pdus);
LOG_D(MAC,"SFN/SF:%d Filled NFAPI configuration for DCI/DLSCH/TXREQ %d, new SDU\n",NFAPI_SFNSF2DEC(eNB->TX_req[CC_id].sfn_sf), eNB->pdu_index[CC_id]);
eNB->pdu_index[CC_id]++;
......@@ -1325,10 +1341,11 @@ schedule_ue_spec(
set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP);
}
} // UE_id loop
} // CC_id loop
} // round != 8
} // UE_id loop
//LOG_D(MAC,"%s() AFTER dl_config dci:%d pdu:%d TX_REQ[pdus:%d]\n", __FUNCTION__, dl_req->number_dci, dl_req->number_pdu, eNB->TX_req[0].tx_request_body.number_of_pdus);
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_flag);
......
......@@ -1315,6 +1315,8 @@ void fill_nfapi_dlsch_config(eNB_MAC_INST *eNB,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = num_bf_vector;
dl_req->number_pdu++;
dl_req->tl.tag=NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
LOG_D(MAC,"Filled DL_CONFIG_PDU - DLSCH - dl_req->number_pdu:%d\n", dl_req->number_pdu);
}
uint16_t fill_nfapi_tx_req(nfapi_tx_request_body_t *tx_req_body,uint16_t absSF,uint16_t pdu_length, uint16_t pdu_index, uint8_t *pdu)
......@@ -1358,31 +1360,31 @@ void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_con
{
memset((void*)ul_config_pdu,0,sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu));
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = handle;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = resource_block_start;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = number_of_resource_blocks;
if (mcs<11) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
else if (mcs<21) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4;
else ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cyclic_shift_2_for_drms;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = frequency_hopping_enabled_flag;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = frequency_hopping_bits;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = new_data_indication;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = redundancy_version;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = harq_process_number;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = ul_tx_mode;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = current_tx_nb;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = size;
if (cqi_req == 1) {
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu));
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.handle = handle;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti = rnti;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.resource_block_start = resource_block_start;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = number_of_resource_blocks;
if (mcs<11) ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
else if (mcs<21) ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4;
else ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cyclic_shift_2_for_drms;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = frequency_hopping_enabled_flag;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = frequency_hopping_bits;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.new_data_indication = new_data_indication;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.redundancy_version = redundancy_version;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.harq_process_number = harq_process_number;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = ul_tx_mode;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = current_tx_nb;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs;
ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.size = size;
// Add CQI portion
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE;
ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_cqi_ri_pdu));
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.tl.tag = NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG;
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.report_type = 1;
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.number_of_cc = 1;
......@@ -1410,18 +1412,43 @@ void fill_nfapi_ulsch_config_request_rel8(nfapi_ul_config_request_pdu_t *ul_con
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_cqi = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.delta_offset_ri = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
LOG_D(MAC,"%s() ri_size:%d\n",__FUNCTION__, ul_config_pdu->ulsch_cqi_ri_pdu.cqi_ri_information.cqi_ri_information_rel9.aperiodic_cqi_pmi_ri_report.cc[0].ri_size);
}
else
{
ul_config_pdu->pdu_type = NFAPI_UL_CONFIG_ULSCH_PDU_TYPE;
ul_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_ul_config_ulsch_pdu));
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.handle = handle;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = rnti;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = resource_block_start;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = number_of_resource_blocks;
if (mcs<11) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
else if (mcs<21) ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 4;
else ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 6;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = cyclic_shift_2_for_drms;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = frequency_hopping_enabled_flag;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = frequency_hopping_bits;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = new_data_indication;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = redundancy_version;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = harq_process_number;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = ul_tx_mode;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = current_tx_nb;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = n_srs;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = size;
}
}
#ifdef Rel14
void fill_nfapi_ulsch_config_request_emtc(nfapi_ul_config_request_pdu_t *ul_config_pdu,
uint8_t ue_type,
uint16_t total_number_of_repetitions,
uint16_t repetition_number,
uint16_t initial_transmission_sf_io)
uint8_t ue_type,
uint16_t total_number_of_repetitions,
uint16_t repetition_number,
uint16_t initial_transmission_sf_io)
{
// Re13 fields
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ue_type;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = total_number_of_repetitions;
......@@ -1571,8 +1598,8 @@ int find_UE_id(module_id_t mod_idP, rnti_t rntiP)
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
LOG_D(PHY,"%s(mod_idP:%d, rntiP:%04x) UE_id:%d active:%d UE_PCCID(mod_idP,UE_id):%d UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti:%04x\n",
__FUNCTION__, mod_idP, rntiP, UE_id, UE_list->active[UE_id], UE_PCCID(mod_idP,UE_id), UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti);
//LOG_D(PHY,"%s(mod_idP:%d, rntiP:%04x) UE_id:%d active:%d UE_PCCID(mod_idP,UE_id):%d UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti:%04x\n",
//__FUNCTION__, mod_idP, rntiP, UE_id, UE_list->active[UE_id], UE_PCCID(mod_idP,UE_id), UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti);
if (UE_list->active[UE_id] != TRUE) continue;
if (UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti==rntiP) {
......@@ -1593,10 +1620,7 @@ int find_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP)
RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&RC.mac[mod_idP]->common_channels[CC_idP].RA_template[0];
for (RA_id = 0; RA_id < NB_RA_PROC_MAX; RA_id++) {
LOG_D(MAC,"Checking RA_id %d for %x : RA_active %d, wait_ack_Msg4 %d\n",
RA_id,rntiP,
RA_template[RA_id].RA_active,
RA_template[RA_id].wait_ack_Msg4);
//LOG_D(MAC,"Checking RA_id %d for %x : RA_active %d, wait_ack_Msg4 %d\n", RA_id,rntiP, RA_template[RA_id].RA_active, RA_template[RA_id].wait_ack_Msg4);
if (RA_template[RA_id].RA_active==TRUE &&
RA_template[RA_id].wait_ack_Msg4 == 0 &&
......
......@@ -577,7 +577,8 @@ abort();
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = first_rb;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1; // DJP - wireshark shows this as a NAK who is right?
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 1;
//hi_dci0_pdu->hi_pdu.hi_pdu_rel8.transmission_power = 6000; // DJP - TODO FIXME - not used??
hi_dci0_req_body->number_of_hi++;
hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP,subframeP, 0);
hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
......@@ -999,6 +1000,9 @@ abort();
else
cqi_req = 0;
LOG_D(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x cqi_req %d RRC Status %d\n",
module_idP,harq_pid,frameP,subframeP,UE_id,rnti,cqi_req,status);
//power control
//compute the expected ULSCH RX power (for the stats)
......@@ -1121,9 +1125,6 @@ abort();
hi_dci0_req->sfn_sf = frameP<<4|subframeP; // sfnsf_add_subframe(sched_frame, sched_subframeP, 0); // sunday!
hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n",
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP);
// Add UL_config PDUs
fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus],
cqi_req,
......@@ -1166,6 +1167,9 @@ abort();
ul_req_tmp->sfn_sf = sched_frame<<4|sched_subframeP;
ul_req_tmp->header.message_id = NFAPI_UL_CONFIG_REQUEST;
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n",
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP);
// Scheduler dips into this structure to work out if UE has a grant, so in nfapi mode we still need to populate it
// but we can send it right here, right now
......@@ -1214,8 +1218,6 @@ abort();
UE_template->first_rb_ul[harq_pid], UE_template->nb_rb_ul[harq_pid],
UE_template->TBS_UL[harq_pid],harq_pid,round);
// Add UL_config PDUs
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n",
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP);
fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp_body->ul_config_pdu_list[ul_req_tmp_body->number_of_pdus],
cqi_req,
cc,
......@@ -1254,6 +1256,8 @@ abort();
ul_req_tmp->sfn_sf = sched_frame<<4|sched_subframeP;
ul_req_tmp->header.message_id = NFAPI_UL_CONFIG_REQUEST;
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d cqi_req %d\n",
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP,cqi_req);
}/*
else if (round > 0) { //we schedule a retransmission
......
......@@ -668,7 +668,7 @@ if (nb_rbs_required_remaining[CC_id][i]<0) abort();
}
if (nb_rbs_required[CC_id][i]> 0 )
LOG_D(MAC,"round %d : nb_rbs_required_remaining[%d][%d]= %d (remaining_1 %d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)\n",
if (0)LOG_D(MAC,"round %d : nb_rbs_required_remaining[%d][%d]= %d (remaining_1 %d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)\n",
r1, CC_id, i,
nb_rbs_required_remaining[CC_id][i],
nb_rbs_required_remaining_1[CC_id][i],
......@@ -848,17 +848,17 @@ if (nb_rbs_required_remaining[CC_id][i]<0) abort();
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].dl_pow_off = dl_pow_off[UE_id];
if (ue_sched_ctl->pre_nb_available_rbs[CC_id] > 0 ) {
LOG_D(MAC,"******************DL Scheduling Information for UE%d ************************\n",UE_id);
LOG_D(MAC,"dl power offset UE%d = %d \n",UE_id,ue_sched_ctl->dl_pow_off[CC_id]);
LOG_D(MAC,"***********RB Alloc for every subband for UE%d ***********\n",UE_id);
//LOG_D(MAC,"******************DL Scheduling Information for UE%d ************************\n",UE_id);
//LOG_D(MAC,"dl power offset UE%d = %d \n",UE_id,ue_sched_ctl->dl_pow_off[CC_id]);
//LOG_D(MAC,"***********RB Alloc for every subband for UE%d ***********\n",UE_id);
for(j=0; j<N_RBG[CC_id]; j++) {
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].rballoc_sub[i] = rballoc_sub_UE[CC_id][UE_id][i];
LOG_D(MAC,"RB Alloc for UE%d and Subband%d = %d\n",UE_id,j,ue_sched_ctl->rballoc_sub_UE[CC_id][j]);
//LOG_D(MAC,"RB Alloc for UE%d and Subband%d = %d\n",UE_id,j,ue_sched_ctl->rballoc_sub_UE[CC_id][j]);
}
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = pre_nb_available_rbs[CC_id][UE_id];
LOG_D(MAC,"Total RBs allocated for UE%d = %d\n",UE_id,ue_sched_ctl->pre_nb_available_rbs[CC_id]);
//LOG_D(MAC,"Total RBs allocated for UE%d = %d\n",UE_id,ue_sched_ctl->pre_nb_available_rbs[CC_id]);
}
}
}
......@@ -881,7 +881,6 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
int i,j;
UE_list_t *UE_list=&RC.mac[module_idP]->UE_list;
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
rnti_t rnti = UE_RNTI(module_idP,UE_id);
uint8_t *vrb_map = RC.mac[module_idP]->common_channels[CC_id].vrb_map;
int N_RB_DL = to_prb(RC.mac[module_idP]->common_channels[CC_id].mib->message.dl_Bandwidth);
......@@ -891,6 +890,7 @@ void dlsch_scheduler_pre_processor_reset (int module_idP,
#endif
//rnti_t rnti = UE_RNTI(module_idP,UE_id);
//LOG_D(MAC,"Running preprocessor for UE %d (%x)\n",UE_id,rnti);
// initialize harq_pid and round
......@@ -1275,14 +1275,14 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
int Ncp;
int N_RB_UL;
LOG_D(MAC, "%s() Enter\n", __FUNCTION__);
//LOG_D(MAC, "%s() Enter\n", __FUNCTION__);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if (UE_list->active[i] != TRUE) continue;
rnti = UE_RNTI(module_idP,i);
LOG_D(MAC, "%s() UE active rnti:%04x UE_list->UE_sched_ctrl[i].ul_out_of_sync:%d UE_list->UE_sched_ctrl[i].phr_received:%d numactiveULCCs[UE_id]:%d UE_list->UE_template[CC_id][UE_id].ul_total_buffer:%d\n", __FUNCTION__, rnti, UE_list->UE_sched_ctrl[i].ul_out_of_sync, UE_list->UE_sched_ctrl[i].phr_received, UE_list->numactiveULCCs[i], UE_list->UE_template[CC_id][i].ul_total_buffer);
//LOG_D(MAC, "%s() UE active rnti:%04x UE_list->UE_sched_ctrl[i].ul_out_of_sync:%d UE_list->UE_sched_ctrl[i].phr_received:%d numactiveULCCs[UE_id]:%d UE_list->UE_template[CC_id][UE_id].ul_total_buffer:%d\n", __FUNCTION__, rnti, UE_list->UE_sched_ctrl[i].ul_out_of_sync, UE_list->UE_sched_ctrl[i].phr_received, UE_list->numactiveULCCs[i], UE_list->UE_template[CC_id][i].ul_total_buffer);
if (rnti==NOT_A_RNTI)
continue;
......@@ -1369,7 +1369,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
UE_template->pre_allocated_nb_rb_ul,
UE_template->phr_info,tx_power);
} else {
LOG_E(MAC,"no ul buffer");
//LOG_E(MAC,"no ul buffer");
/* if UE has pending scheduling request then pre-allocate 3 RBs */
//if (UE_template->ul_active == 1 && UE_template->ul_SR == 1) {
......
......@@ -13,6 +13,7 @@ Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs];
extern int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind);
extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind);
extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern uint8_t nfapi_mode;
extern uint16_t sf_ahead;
......@@ -65,15 +66,22 @@ void handle_sr(UL_IND_t *UL_info) {
int i;
for (i=0;i<UL_info->sr_ind.number_of_srs;i++)
SR_indication(UL_info->module_id,
UL_info->CC_id,
UL_info->frame,
UL_info->subframe,
UL_info->sr_ind.sr_pdu_list[i].rx_ue_information.rnti,
UL_info->sr_ind.sr_pdu_list[i].ul_cqi_information.ul_cqi);
if (nfapi_mode == 1)
{
oai_nfapi_sr_indication(&UL_info->sr_ind);
}
else
{
for (i=0;i<UL_info->sr_ind.sr_indication_body.number_of_srs;i++)
SR_indication(UL_info->module_id,
UL_info->CC_id,
UL_info->frame,
UL_info->subframe,
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].rx_ue_information.rnti,
UL_info->sr_ind.sr_indication_body.sr_pdu_list[i].ul_cqi_information.ul_cqi);
}
UL_info->sr_ind.number_of_srs=0;
UL_info->sr_ind.sr_indication_body.number_of_srs=0;
}
void handle_cqi(UL_IND_t *UL_info) {
......@@ -517,7 +525,7 @@ void UL_indication(UL_IND_t *UL_info)
IF_Module_t *ifi = if_inst[module_id];
eNB_MAC_INST *mac = RC.mac[module_id];
LOG_D(PHY,"frame %d, subframe %d, module_id %d, CC_id %d UL_info[rx_ind:%d number_of_harqs:%d number_of_crcs:%d number_of_cqis:%d number_of_preambles:%d]\n",
LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rx_ind:%d harqs:%d crcs:%d cqis:%d preambles:%d]\n",
UL_info->frame,UL_info->subframe,
module_id,CC_id,
UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->harq_ind.harq_indication_body.number_of_harqs, UL_info->crc_ind.crc_indication_body.number_of_crcs, UL_info->cqi_ind.number_of_cqis, UL_info->rach_ind.rach_indication_body.number_of_preambles);
......@@ -536,9 +544,12 @@ void UL_indication(UL_IND_t *UL_info)
}
//LOG_D(PHY,"%s() SFN_SF:%d%d About to call clear_nfapi_information()\n", __FUNCTION__, UL_info->frame, UL_info->subframe);
// clear DL/UL info for new scheduling round
clear_nfapi_information(RC.mac[module_id],CC_id,
UL_info->frame,UL_info->subframe);
//LOG_D(PHY,"%s() SFN_SF:%d%d Returned from call clear_nfapi_information()\n", __FUNCTION__, UL_info->frame, UL_info->subframe);
handle_rach(UL_info);
......@@ -590,8 +601,7 @@ void UL_indication(UL_IND_t *UL_info)
ifi->schedule_response(sched_info);
}
LOG_D(PHY,"Schedule_response: frame %d, subframe %d (dl_pdus %d / %p)\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu,
&sched_info->DL_req->dl_config_request_body.number_pdu);
LOG_D(PHY,"Schedule_response: SFN_SF:%d%d dl_pdus:%d\n",sched_info->frame,sched_info->subframe,sched_info->DL_req->dl_config_request_body.number_pdu);
}
}
}
......
......@@ -67,7 +67,7 @@ typedef struct{
nfapi_crc_indication_t crc_ind;
/// SR indication list
nfapi_sr_indication_body_t sr_ind;
nfapi_sr_indication_t sr_ind;
/// CQI indication list
nfapi_cqi_indication_body_t cqi_ind;
......
......@@ -512,7 +512,7 @@ void nfapi_log(char *file, char *func, int line, int comp, int level, const char
}
//log record: add to a list
void logRecord(const char *file, const char *func, int line, int comp,
void logRecord(const char *file, const char *func, int line, pthread_t thread_id, int comp,
int level, const char *format, ...)
{
va_list args;
......@@ -527,6 +527,7 @@ void logRecord(const char *file, const char *func, int line, int comp,
log_params.file = strdup(file);
log_params.func = strdup(func);
log_params.line = line;
log_params.thread_id = thread_id;
log_params.comp = comp;
log_params.level = level;
log_params.format = format;
......@@ -565,7 +566,7 @@ void logRecord(const char *file, const char *func, int line, int comp,
}
void logRecord_thread_safe(const char *file, const char *func,
int line, int comp, int level,
int line, pthread_t thread_id, int comp, int level,
int len, const char *params_string)
{
log_component_t *c;
......@@ -617,6 +618,8 @@ void logRecord_thread_safe(const char *file, const char *func,
func);
}
total_len += snprintf(&log_buffer[total_len], MAX_LOG_TOTAL - total_len, "[%08lx] ", thread_id);
if ((g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) {
total_len += snprintf(&log_buffer[total_len], MAX_LOG_TOTAL - total_len, "[%s:%d]",
file, line);
......@@ -716,6 +719,7 @@ void *log_thread_function(void *list)
logRecord_thread_safe(log_params.file,
log_params.func,
log_params.line,
log_params.thread_id,
log_params.comp,
log_params.level,
log_params.len,
......@@ -1004,8 +1008,8 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
#endif /* #if 0 */
//log record, format, and print: executed in the main thread (mt)
void logRecord_mt(const char *file, const char *func, int line, int comp,
int level, const char *format, ...)
void logRecord_mt(const char *file, const char *func, int line,
pthread_t thread_id, int comp, int level, const char *format, ...)
{
int len = 0;
va_list args;
......@@ -1100,13 +1104,16 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%08lx]", thread_id);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
len += vsnprintf(&log_buffer[len], MAX_LOG_TOTAL - len, format, args);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
log_end = log_buffer + len;
if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) {
len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s",
log_level_highlight_end[level]);
log_level_highlight_end[level]);
if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
}
}
......@@ -1125,7 +1132,7 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
}
#else
fwrite(log_buffer, len, 1, stdout);
fwrite(log_buffer, len, 1, stdout);
#endif
#ifndef RTAI
......
......@@ -240,6 +240,7 @@ typedef struct LOG_params {
const char *file;
const char *func;
int line;
pthread_t thread_id;
int comp;
int level;
const char *format;
......@@ -262,8 +263,8 @@ void log_set_instance_type (log_instance_type_t instance);
# include "log_if.h"
/*----------------------------------------------------------------------------*/
int logInit (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void logRecord_mt(const char *file, const char *func, int line,pthread_t thread_id, int comp, int level, const char *format, ...) __attribute__ ((format (printf, 7, 8)));
void logRecord(const char *file, const char *func, int line, pthread_t thread_id, int comp, int level, const char *format, ...) __attribute__ ((format (printf, 7, 8)));
int set_comp_log(int component, int level, int verbosity, int interval);
int set_log(int component, int level, int interval);
void set_glog(int level, int verbosity);
......@@ -285,15 +286,15 @@ void *log_thread_function(void * list);
#ifdef USER_MODE
//#define logIt(component, level, format, args...) do {logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args);} while(0);
#ifdef LOG_NO_THREAD
#define logIt(component, level, format, args...) logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args)
#define logIt(component, level, format, args...) logRecord_mt(__FILE__, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
#else //default
#define logIt(component, level, format, args...) logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args)
#define logIt(component, level, format, args...) logRecord(__FILE__, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
#endif
#else
#ifdef LOG_NO_THREAD
#define logIt(component, level, format, args...) logRecord_mt(NULL, __FUNCTION__, __LINE__, component, level, format, ##args)
#define logIt(component, level, format, args...) logRecord_mt(NULL, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
#else // default
#define logIt(component, level, format, args...) logRecord(NULL, __FUNCTION__, __LINE__, component, level, format, ##args)
#define logIt(component, level, format, args...) logRecord(NULL, __FUNCTION__, __LINE__, pthread_self(), component, level, format, ##args)
#endif
#endif
/* @}*/
......
......@@ -175,7 +175,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
//LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe);
oai_subframe_ind(frame, subframe);
LOG_D(PHY, "UL_info[rx_ind:%d number_of_harqs:%d number_of_crcs:%d number_of_cqis:%d number_of_preambles:%d]\n", eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus, eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, eNB->UL_INFO.cqi_ind.number_of_cqis, eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles);
LOG_D(PHY, "UL_info[rx_ind:%d:%d number_of_harqs:%d:%d number_of_crcs:%d:%d number_of_preambles:%d:%d number_of_cqis:%d] RX:%d%d TX:%d%d num_pdcch_symbols:%d\n",
NFAPI_SFNSF2DEC(eNB->UL_INFO.rx_ind.sfn_sf), eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus,
NFAPI_SFNSF2DEC(eNB->UL_INFO.harq_ind.sfn_sf), eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs,
NFAPI_SFNSF2DEC(eNB->UL_INFO.crc_ind.sfn_sf), eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs,
NFAPI_SFNSF2DEC(eNB->UL_INFO.rach_ind.sfn_sf), eNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles,
eNB->UL_INFO.cqi_ind.number_of_cqis,
proc->frame_rx, proc->subframe_rx,
proc->frame_tx, proc->subframe_tx, eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols);
}
if (nfapi_mode == 1 && eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols == 0)
......@@ -200,27 +207,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
#endif
}
LOG_D(PHY, "RX_IND:SFN/SF:%d proc:SFN/SF:%d/%d [rx_ind:num_pdus:%d] TX:%d/%d eNB->pdcch_vars[subframe&1].num_pdcch_symbols:%d\n", NFAPI_SFNSF2DEC(eNB->UL_INFO.rx_ind.sfn_sf), proc->frame_rx, proc->subframe_rx, eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus, proc->frame_tx, proc->subframe_tx, eNB->pdcch_vars[proc->subframe_tx&1].num_pdcch_symbols);
if (eNB->UL_INFO.rx_ind.sfn_sf == (proc->frame_rx<<4|proc->subframe_rx) && eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus>0)
{
// Fix me here, these should be locked
for (int i=0; i<eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus; i++)
{
LOG_E(PHY, "SFN/SF(RX):%d/%d eNB->UL_INFO.rx_ind.number_of_pdus:%d NOT ZEROING!\n\n\n\n\n", proc->frame_rx, proc->subframe_rx, eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus);
//eNB->UL_INFO.rx_ind[proc->subframe_rx&1].number_of_pdus = 0;
}
}
if (eNB->UL_INFO.crc_ind.sfn_sf == (proc->frame_rx<<4|proc->subframe_rx))
{
for (int i=0; i<eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs; i++)
{
LOG_E(PHY, "SFN/SF(RX):%d/%d eNB->UL_INFO.crc_ind.number_of_crcs:%d NOT ZEROING!\n\n\n\n\n", proc->frame_rx, proc->subframe_rx, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs);
//eNB->UL_INFO.crc_ind.number_of_crcs = 0;
}
}
// UE-specific RX processing for subframe n
if (nfapi_mode == 0 || nfapi_mode == 1) {
phy_procedures_eNB_uespec_RX(eNB, proc, no_relay );
......@@ -250,6 +236,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
stop_meas( &softmodem_stats_rxtx_sf );
LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);
return(0);
}
......@@ -295,8 +283,11 @@ static void* eNB_thread_rxtx( void* param ) {
//LOG_D(PHY,"%s:%s() TX:%u/%u About to rxtx()\n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx);
if (eNB->CC_id==0)
{
if (rxtx(eNB,proc,thread_name) < 0) break;
}
//LOG_D(PHY,"%s:%s() TX:%u/%u DONE rxtx()\n", thread_name, __FUNCTION__, proc->frame_tx, proc->subframe_tx);
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
......@@ -481,7 +472,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
// check if we have to detect PRACH first
if (is_prach_subframe(fp,frame,subframe)>0) {
LOG_D(PHY,"Triggering prach processing, frame %d, subframe %d\n",frame,subframe);
//LOG_D(PHY,"Triggering prach processing, frame %d, subframe %d\n",frame,subframe);
if (proc->instance_cnt_prach == 0) {
LOG_W(PHY,"[eNB] Frame %d Subframe %d, dropping PRACH\n", frame,subframe);
return;
......@@ -597,7 +588,7 @@ static void* eNB_thread_prach( void* param ) {
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"eNB_prach_thread") < 0) break;
LOG_D(PHY,"Running eNB prach procedures\n");
//LOG_D(PHY,"Running eNB prach procedures\n");
prach_procedures(eNB
#ifdef Rel14
,0
......@@ -638,7 +629,7 @@ static void* eNB_thread_prach_br( void* param ) {
if (wait_on_condition(&proc->mutex_prach_br,&proc->cond_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break;
LOG_D(PHY,"Running eNB prach procedures for BL/CE UEs\n");
//LOG_D(PHY,"Running eNB prach procedures for BL/CE UEs\n");
prach_procedures(eNB,1);
if (release_thread(&proc->mutex_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break;
......
......@@ -1494,14 +1494,12 @@ static void* ru_thread( void* param ) {
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&subframe);
else AssertFatal(1==0, "No fronthaul interface at south port");
LOG_D(PHY,"AFTER fh_south_in - SFN/SF:%d/%d RU->proc[RX:%d/%d TX:%d/%d] RC.eNB[0][0]:[RX:%d/%d TX(SFN):%d] eNB:%p RU:eNB:%p proc:%p ru->proc:%p\n",
LOG_D(PHY,"AFTER fh_south_in - SFN/SF:%d%d RU->proc[RX:%d%d TX:%d%d] RC.eNB[0][0]:[RX:%d%d TX(SFN):%d]\n",
frame,subframe,
proc->frame_rx,proc->subframe_rx,
proc->frame_tx,proc->subframe_tx,
RC.eNB[0][0]->proc.frame_rx,RC.eNB[0][0]->proc.subframe_rx,
RC.eNB[0][0]->proc.frame_tx,
RC.eNB[0][0], ru->eNB_list[0],
proc,&ru->proc);
RC.eNB[0][0]->proc.frame_tx);
if (nfapi_mode == 1) // PNF
{
......
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