Commit 53e7a572 authored by David Price's avatar David Price

Network search working again. Now calling generate_dci_top every subframe,...

Network search working again.  Now calling generate_dci_top every subframe, using dummy subframe if no data to transmit. MIB and SIB2/3 coming out.  UE sees cell
parent 142d96fd
This diff is collapsed.
...@@ -1161,9 +1161,12 @@ void vnf_start_thread(void* ptr) ...@@ -1161,9 +1161,12 @@ void vnf_start_thread(void* ptr)
} }
static vnf_info vnf; static vnf_info vnf;
extern uint8_t nfapi_pnf;
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port)
{ {
nfapi_pnf = 2;
memset(&vnf, 0, sizeof(vnf)); memset(&vnf, 0, sizeof(vnf));
memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs)); memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs));
......
...@@ -72,6 +72,10 @@ int l1_north_init_eNB() { ...@@ -72,6 +72,10 @@ int l1_north_init_eNB() {
} }
} }
} }
else
{
LOG_I(PHY,"%s() Not installing PHY callbacks - RC.nb_L1_inst:%d RC.nb_L1_CC:%p RC.eNB:%p\n", __FUNCTION__, RC.nb_L1_inst, RC.nb_L1_CC, RC.eNB);
}
return(0); return(0);
} }
...@@ -1728,13 +1732,13 @@ int phy_init_RU(RU_t *ru) { ...@@ -1728,13 +1732,13 @@ int phy_init_RU(RU_t *ru) {
#endif #endif
} }
LOG_D(PHY,"[INIT] %s() RC.nb_inst:%d \n", __FUNCTION__, RC.nb_inst); LOG_E(PHY,"[INIT] %s() RC.nb_inst:%d \n", __FUNCTION__, RC.nb_inst);
for (i=0; i<RC.nb_inst; i++) { for (i=0; i<RC.nb_inst; i++) {
for (p=0;p<15;p++) { for (p=0;p<15;p++) {
LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB); LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB);
if (p<ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p==5) { if (p<ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p==5) {
//LOG_E(PHY,"[INIT] %s() DO BEAM WEIGHTS nb_antenna_ports_eNB:%d nb_tx:%d\n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB, ru->nb_tx); LOG_D(PHY,"[INIT] %s() DO BEAM WEIGHTS nb_antenna_ports_eNB:%d nb_tx:%d\n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB, ru->nb_tx);
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
for (j=0; j<ru->nb_tx; j++) { for (j=0; j<ru->nb_tx; j++) {
ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
...@@ -1838,7 +1842,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1838,7 +1842,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
if (i<fp->nb_antenna_ports_eNB || i==5) { if (i<fp->nb_antenna_ports_eNB || i==5) {
common_vars->txdataF[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) ); common_vars->txdataF[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
LOG_E(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n", LOG_D(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
i,common_vars->txdataF[i], i,common_vars->txdataF[i],
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t)); fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
} }
......
...@@ -2074,6 +2074,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2074,6 +2074,11 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
int Msymb2; int Msymb2;
int split_flag=0; int split_flag=0;
if (num_dci>0)
{
LOG_D(PHY,"%s(num_pdcch_symbols:%d num_dci:%d dci_alloc:%p n_rnti:%04x amp:%d frame_parms:%p txdataF:%p subframe:%d)\n", __FUNCTION__, num_pdcch_symbols, num_dci, dci_alloc, n_rnti, amp, frame_parms, txdataF, subframe);
}
switch (frame_parms->N_RB_DL) { switch (frame_parms->N_RB_DL) {
case 100: case 100:
Msymb2 = Msymb; Msymb2 = Msymb;
...@@ -2148,7 +2153,9 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2148,7 +2153,9 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
} }
// Scrambling // Scrambling
// printf("pdcch scrambling\n"); #ifdef DEBUG_DCI_ENCODING
printf("pdcch scrambling\n");
#endif
pdcch_scrambling(frame_parms, pdcch_scrambling(frame_parms,
subframe, subframe,
e, e,
...@@ -2232,6 +2239,18 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols, ...@@ -2232,6 +2239,18 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
// This is the REG allocation algorithm from 36-211, second part of Section 6.8.5 // This is the REG allocation algorithm from 36-211, second part of Section 6.8.5
// printf("DCI (SF %d) : txdataF %p (0 %p)\n",subframe,&txdataF[0][512*14*subframe],&txdataF[0][0]); // printf("DCI (SF %d) : txdataF %p (0 %p)\n",subframe,&txdataF[0][512*14*subframe],&txdataF[0][0]);
#ifdef DEBUG_DCI_ENCODING
printf("kprime loop - N_RB_DL:%d lprime:num_pdcch_symbols:%d Ncp:%d pcfich:%02x,%02x,%02x,%02x ofdm_symbol_size:%d first_carrier_offset:%d nb_antenna_ports_eNB:%d\n",
frame_parms->N_RB_DL, num_pdcch_symbols,frame_parms->Ncp,
frame_parms->pcfich_reg[0],
frame_parms->pcfich_reg[1],
frame_parms->pcfich_reg[2],
frame_parms->pcfich_reg[3],
frame_parms->ofdm_symbol_size,
frame_parms->first_carrier_offset,
frame_parms->nb_antenna_ports_eNB
);
#endif
for (kprime=0; kprime<frame_parms->N_RB_DL*12; kprime++) { for (kprime=0; kprime<frame_parms->N_RB_DL*12; kprime++) {
for (lprime=0; lprime<num_pdcch_symbols; lprime++) { for (lprime=0; lprime<num_pdcch_symbols; lprime++) {
......
...@@ -801,6 +801,29 @@ void generate_RIV_tables() ...@@ -801,6 +801,29 @@ void generate_RIV_tables()
// n_tilde_PRB(0,1) = (0,2) // n_tilde_PRB(0,1) = (0,2)
void check_dlsch(char *file, int line)
{
PHY_VARS_eNB *eNB = RC.eNB[0][0];
static char oldbuf[13*NUMBER_OF_UE_MAX+100]="";
char buf[13*NUMBER_OF_UE_MAX+100];
char *pbuf=buf;
for (int i=0; i<NUMBER_OF_UE_MAX; i++) {
pbuf+=sprintf(pbuf, "[%02d]:%02x:%04x ", i, eNB->dlsch[i][0]->harq_mask, eNB->dlsch[i][0]->rnti);
}
int diff_size = memcmp(oldbuf, buf, strlen(buf));
if (diff_size!=0)
{
LOG_I(PHY,"check_dlsch:%s:%d:%s\n", file, line, buf);
LOG_I(PHY,"check_dlsch:%s:%d:%s\n", file, line, oldbuf);
}
memcpy(oldbuf, buf, sizeof(buf));
}
int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
{ {
uint8_t i; uint8_t i;
...@@ -1990,6 +2013,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_ ...@@ -1990,6 +2013,7 @@ int fill_dci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_
computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(fp->pdsch_config_common),fp->nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off); computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(fp->pdsch_config_common),fp->nb_antenna_ports_eNB,dlsch1,dlsch1_harq->dl_power_off);
} }
LOG_D(PHY, "%s() dci_length:%d\n", __FUNCTION__, dci_alloc->dci_length);
} }
...@@ -4485,7 +4509,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci) ...@@ -4485,7 +4509,7 @@ int dump_dci(LTE_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci)
break; break;
case 25: case 25:
LOG_D(PHY,"DCI format0 (FDD, 5MHz), rnti %x (%x): hopping %d, rb_alloc %x, mcs %d, ndi %d, TPC %d, cshift %d, cqi_req %d\n", LOG_I(PHY,"DCI format0 (FDD, 5MHz), rnti %x (%x): hopping %d, rb_alloc %x, mcs %d, ndi %d, TPC %d, cshift %d, cqi_req %d\n",
dci->rnti, dci->rnti,
((uint32_t*)&dci->dci_pdu[0])[0], ((uint32_t*)&dci->dci_pdu[0])[0],
((DCI0_5MHz_FDD_t *)&dci->dci_pdu[0])->hopping, ((DCI0_5MHz_FDD_t *)&dci->dci_pdu[0])->hopping,
......
...@@ -185,7 +185,7 @@ int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB, ...@@ -185,7 +185,7 @@ int generate_eNB_ulsch_params_from_rar(PHY_VARS_eNB *eNB,
LOG_D(PHY,"ulsch ra (eNB): harq_pid %d\n",harq_pid); LOG_D(PHY,"ulsch ra (eNB): harq_pid %d\n",harq_pid);
LOG_D(PHY,"ulsch ra (eNB): round %d\n",ulsch_harq->round); LOG_D(PHY,"ulsch ra (eNB): round %d\n",ulsch_harq->round);
LOG_D(PHY,"ulsch ra (eNB): TBS %d\n",ulsch_harq->TBS); LOG_D(PHY,"ulsch ra (eNB): TBS %d\n",ulsch_harq->TBS);
LOG_D(PHY,"ulsch ra (eNB): mcs %d\n",ulsch_harq->mcs); LOG_D(PHY,"ulsch ra (eNB): mcs %d\n",ulsch_harq->Msc_initial);
LOG_D(PHY,"ulsch ra (eNB): Or1 %d\n",ulsch_harq->Or1); LOG_D(PHY,"ulsch ra (eNB): Or1 %d\n",ulsch_harq->Or1);
LOG_D(PHY,"ulsch ra (eNB): ORI %d\n",ulsch_harq->O_RI); LOG_D(PHY,"ulsch ra (eNB): ORI %d\n",ulsch_harq->O_RI);
#endif #endif
......
...@@ -49,7 +49,7 @@ void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB, ...@@ -49,7 +49,7 @@ void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,
LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx]; LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx];
nfapi_dl_config_dci_dl_pdu *pdu = &dl_config_pdu->dci_dl_pdu; nfapi_dl_config_dci_dl_pdu *pdu = &dl_config_pdu->dci_dl_pdu;
LOG_D(PHY,"Frame %d, Subframe %d: DCI processing\n",proc->frame_tx,proc->subframe_tx); LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populating pdcch_vars->dci_alloc[%d] subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",proc->frame_tx,proc->subframe_tx, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci);
// copy dci configuration into eNB structure // copy dci configuration into eNB structure
fill_dci_and_dlsch(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu); fill_dci_and_dlsch(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],pdu);
...@@ -582,6 +582,10 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { ...@@ -582,6 +582,10 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
// DJP - AssertFatal(proc->subframe_tx == subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe); // DJP - AssertFatal(proc->subframe_tx == subframe, "Current subframe %d != NFAPI subframe %d\n",proc->subframe_tx,subframe);
// DJP - AssertFatal(proc->subframe_tx == subframe, "Current frame %d != NFAPI frame %d\n",proc->frame_tx,frame); // DJP - AssertFatal(proc->subframe_tx == subframe, "Current frame %d != NFAPI frame %d\n",proc->frame_tx,frame);
uint8_t number_dci = DL_req->dl_config_request_body.number_dci;
uint8_t number_pdcch_ofdm_symbols = DL_req->dl_config_request_body.number_pdcch_ofdm_symbols;
uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu; uint8_t number_dl_pdu = DL_req->dl_config_request_body.number_pdu;
uint8_t number_hi_dci0_pdu = HI_DCI0_req->hi_dci0_request_body.number_of_dci+HI_DCI0_req->hi_dci0_request_body.number_of_hi; uint8_t number_hi_dci0_pdu = HI_DCI0_req->hi_dci0_request_body.number_of_dci+HI_DCI0_req->hi_dci0_request_body.number_of_hi;
uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus; uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus;
...@@ -593,12 +597,14 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { ...@@ -593,12 +597,14 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
int i; int i;
eNB->pdcch_vars[subframe&1].num_pdcch_symbols = DL_req->dl_config_request_body.number_pdcch_ofdm_symbols; eNB->pdcch_vars[subframe&1].num_pdcch_symbols = number_pdcch_ofdm_symbols;
eNB->pdcch_vars[subframe&1].num_dci = DL_req->dl_config_request_body.number_dci; eNB->pdcch_vars[subframe&1].num_dci = number_dci;
eNB->phich_vars[subframe&1].num_hi = 0; eNB->phich_vars[subframe&1].num_hi = 0;
LOG_D(PHY,"NFAPI: Frame %d, Subframe %d: received %d dl_pdu, %d tx_req, %d hi_dci0_config_req, %d UL_config \n", LOG_D(PHY,"NFAPI: Frame %d, Subframe %d: received %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); 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; int do_oai =0;
...@@ -623,6 +629,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { ...@@ -623,6 +629,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);
do_oai=1; do_oai=1;
break; break;
case NFAPI_DL_CONFIG_BCH_PDU_TYPE: case NFAPI_DL_CONFIG_BCH_PDU_TYPE:
...@@ -643,7 +650,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) { ...@@ -643,7 +650,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_E(PHY,"%s() NFAPI_DL_CONFIG_DLSCH_PDU_TYPE TX:%d/%d RX:%d/%d\n", __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx); 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, AssertFatal(dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index<TX_req->tx_request_body.number_of_pdus,
"dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n", "dlsch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n",
......
...@@ -141,7 +141,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) { ...@@ -141,7 +141,7 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) {
int **txdataF = eNB->common_vars.txdataF; int **txdataF = eNB->common_vars.txdataF;
uint8_t *pbch_pdu=&eNB->pbch_pdu[0]; uint8_t *pbch_pdu=&eNB->pbch_pdu[0];
LOG_D(PHY,"common_signal_procedures: frame %d, subframe %d\n",frame,subframe); LOG_D(PHY,"common_signal_procedures: frame %d, subframe %d fdd:%s dir:%s\n",frame,subframe,fp->frame_type == FDD?"FDD":"TDD", subframe_select(fp,subframe) == SF_DL?"DL":"UL?");
// generate Cell-Specific Reference Signals for both slots // generate Cell-Specific Reference Signals for both slots
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,1);
...@@ -483,15 +483,20 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -483,15 +483,20 @@ 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",
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,
&eNB->pdcch_vars[subframe&1].dci_alloc[0], &eNB->pdcch_vars[subframe&1].dci_alloc[0],
0, 0,
AMP, AMP,
fp, fp,
eNB->common_vars.txdataF, eNB->common_vars.txdataF,
subframe); subframe);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
...@@ -1236,14 +1241,14 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1236,14 +1241,14 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
} }
if (SR_payload == 1) { if (SR_payload == 1) {
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",eNB->Mod_id, LOG_E(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",eNB->Mod_id,
uci->rnti,frame,subframe); uci->rnti,frame,subframe);
if (eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 if (eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
eNB->first_sr[i] = 0; eNB->first_sr[i] = 0;
eNB->dlsch[i][0]->harq_processes[0]->round=0; eNB->dlsch[i][0]->harq_processes[0]->round=0;
eNB->dlsch[i][0]->harq_processes[0]->status=SCH_IDLE; eNB->dlsch[i][0]->harq_processes[0]->status=SCH_IDLE;
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n", LOG_E(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n",
eNB->Mod_id, eNB->Mod_id,
eNB->ulsch[i]->rnti,frame,subframe); eNB->ulsch[i]->rnti,frame,subframe);
} }
...@@ -1582,7 +1587,10 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf ...@@ -1582,7 +1587,10 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf
if ((dlsch1_harq == NULL)|| if ((dlsch1_harq == NULL)||
((dlsch1_harq!=NULL)&& ((dlsch1_harq!=NULL)&&
(dlsch1_harq->status == SCH_IDLE))) (dlsch1_harq->status == SCH_IDLE)))
{
dlsch0->harq_mask &= ~(1<<harq_pid); dlsch0->harq_mask &= ~(1<<harq_pid);
LOG_I(PHY,"%s() UE_id:%d SFN/SF:%d/%d dlsch0->harq_mask:%02x\n", __FUNCTION__, UE_id, frame, subframe,dlsch0->harq_mask);
}
} }
else { // release all processes in the bundle that was acked, based on mask else { // release all processes in the bundle that was acked, based on mask
// This is at most 4 for multiplexing and 9 for bundling/special bundling // This is at most 4 for multiplexing and 9 for bundling/special bundling
...@@ -1936,7 +1944,3 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -1936,7 +1944,3 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
stop_meas(&eNB->phy_proc_rx); stop_meas(&eNB->phy_proc_rx);
} }
...@@ -316,10 +316,14 @@ void *eNB_app_task(void *args_p) ...@@ -316,10 +316,14 @@ void *eNB_app_task(void *args_p)
itti_mark_task_ready (TASK_ENB_APP); itti_mark_task_ready (TASK_ENB_APP);
LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
RCconfig_L1(); RCconfig_L1();
RCconfig_macrlc(); RCconfig_macrlc();
LOG_I(PHY, "%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst);
if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_eNB()==0,"could not initialize L1 north interface\n"); if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_eNB()==0,"could not initialize L1 north interface\n");
# if defined(ENABLE_ITTI) # if defined(ENABLE_ITTI)
...@@ -342,9 +346,11 @@ void *eNB_app_task(void *args_p) ...@@ -342,9 +346,11 @@ void *eNB_app_task(void *args_p)
LOG_I(ENB_APP,"Allocating eNB_RRC_INST for %d instances\n",RC.nb_inst); LOG_I(ENB_APP,"Allocating eNB_RRC_INST for %d instances\n",RC.nb_inst);
RC.rrc = (eNB_RRC_INST **)malloc(RC.nb_inst*sizeof(eNB_RRC_INST *)); RC.rrc = (eNB_RRC_INST **)malloc(RC.nb_inst*sizeof(eNB_RRC_INST *));
LOG_I(PHY, "%s() RC.nb_inst:%d RC.rrc:%p\n", __FUNCTION__, RC.nb_inst, RC.rrc);
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) { for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
RC.rrc[enb_id] = (eNB_RRC_INST*)malloc(sizeof(eNB_RRC_INST)); RC.rrc[enb_id] = (eNB_RRC_INST*)malloc(sizeof(eNB_RRC_INST));
LOG_I(PHY, "%s() Creating RRC instance RC.rrc[%d]:%p (%d of %d)\n", __FUNCTION__, enb_id, RC.rrc[enb_id], enb_id+1, enb_id_end);
memset((void *)RC.rrc[enb_id],0,sizeof(eNB_RRC_INST)); memset((void *)RC.rrc[enb_id],0,sizeof(eNB_RRC_INST));
configure_rrc(enb_id); configure_rrc(enb_id);
} }
......
...@@ -720,20 +720,12 @@ void RCconfig_L1(void) { ...@@ -720,20 +720,12 @@ void RCconfig_L1(void) {
if (RC.eNB == NULL) { if (RC.eNB == NULL) {
RC.eNB = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***)); RC.eNB = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***));
LOG_I(PHY,"DJP - have malloced RC.eNB - RC.eNB = %p\n",RC.eNB); LOG_I(PHY,"RC.eNB:%p\n",RC.eNB);
memset(RC.eNB,0,(1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***)); memset(RC.eNB,0,(1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***));
RC.nb_L1_CC = malloc((1+RC.nb_L1_inst)*sizeof(int)); RC.nb_L1_CC = malloc((1+RC.nb_L1_inst)*sizeof(int));
printf("%s() RC.eNB:%p - RC.nb_L1_CC:%p\n", __FUNCTION__, RC.eNB, RC.nb_L1_CC); LOG_I(PHY,"%s() RC.eNB:%p RC.nb_L1_CC:%p\n", __FUNCTION__, RC.eNB, RC.nb_L1_CC);
} }
#if 0
if (RC.nb_L1_inst==0)
{
RC.nb_L1_inst = 1;
printf("********\n\n\n*********** DJP - hard coding RC.nb_L1_inst = 1 \n\n\n\n");
}
#endif
setting = config_lookup(&cfg, CONFIG_STRING_L1_LIST); setting = config_lookup(&cfg, CONFIG_STRING_L1_LIST);
printf("%s() CONFIG_STRING_L1_LIST setting:%p\n", __FUNCTION__, setting); printf("%s() CONFIG_STRING_L1_LIST setting:%p\n", __FUNCTION__, setting);
...@@ -754,14 +746,6 @@ void RCconfig_L1(void) { ...@@ -754,14 +746,6 @@ void RCconfig_L1(void) {
"Failed to parse configuration file %s, L1 %d config !\n", "Failed to parse configuration file %s, L1 %d config !\n",
RC.config_file_name, j); RC.config_file_name, j);
} }
else
{
#if 0
RC.nb_L1_CC[j] = 1;
printf("****DJP - hard coding nb_L1_CC[%d] = 1 *************\n", j, RC.nb_L1_CC[j]);
#endif
}
for (i=0;i<RC.nb_L1_CC[j];i++) { for (i=0;i<RC.nb_L1_CC[j];i++) {
if (RC.eNB[j][i] == NULL) { if (RC.eNB[j][i] == NULL) {
...@@ -775,14 +759,14 @@ void RCconfig_L1(void) { ...@@ -775,14 +759,14 @@ void RCconfig_L1(void) {
printf("l1 %d/%d (nb CC %d)\n",j,RC.nb_inst,RC.nb_L1_CC[j]); printf("l1 %d/%d (nb CC %d)\n",j,RC.nb_inst,RC.nb_L1_CC[j]);
if (setting) if (setting_l1)
{ {
printf("RU %d: Transport %s\n",j,tr_n_preference);
if (!(config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, (const char **)&tr_n_preference))) { if (!(config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, (const char **)&tr_n_preference))) {
AssertFatal (0, AssertFatal (0,
"Failed to parse configuration file %s, L1 %d config !\n", "Failed to parse configuration file %s, L1 %d config !\n",
RC.config_file_name, j); RC.config_file_name, j);
} }
printf("RU %d: Transport %s\n",j,tr_n_preference);
if (strcmp(tr_n_preference, "local_mac") == 0) { if (strcmp(tr_n_preference, "local_mac") == 0) {
...@@ -810,14 +794,23 @@ void RCconfig_L1(void) { ...@@ -810,14 +794,23 @@ void RCconfig_L1(void) {
RC.eNB[j][0]->eth_params_n.remote_portc = remote_n_portc; RC.eNB[j][0]->eth_params_n.remote_portc = remote_n_portc;
RC.eNB[j][0]->eth_params_n.my_portd = local_n_portd; RC.eNB[j][0]->eth_params_n.my_portd = local_n_portd;
RC.eNB[j][0]->eth_params_n.remote_portd = remote_n_portd; RC.eNB[j][0]->eth_params_n.remote_portd = remote_n_portd;
RC.eNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE; RC.eNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE;
configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, RC.eNB[j][0]->eth_params_n.remote_portd); configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, RC.eNB[j][0]->eth_params_n.remote_portd);
{ RC.nb_macrlc_inst = 1; // This is used by mac_top_init_eNB()
extern uint8_t nfapi_pnf;
nfapi_pnf = 1; // This is used by init_eNB_afterRU()
} RC.nb_CC = (int *)malloc((1+RC.nb_inst)*sizeof(int));
RC.nb_CC[0]=1;
RC.nb_inst =1; // DJP - feptx_prec uses num_eNB but phy_init_RU uses nb_inst
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_inst=1 this is because phy_init_RU() uses that to index and not RC.num_eNB - why the 2 similar variables?\n", __FUNCTION__);
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_CC[0]=1 for init_eNB_afterRU()\n", __FUNCTION__, RC.nb_CC[0]);
LOG_I(PHY,"%s() NFAPI PNF mode - RC.nb_macrlc_inst:%d because used by mac_top_init_eNB()\n", __FUNCTION__, RC.nb_macrlc_inst);
mac_top_init_eNB();
} }
else { // other midhaul else { // other midhaul
} }
...@@ -854,14 +847,14 @@ void RCconfig_macrlc(void) { ...@@ -854,14 +847,14 @@ void RCconfig_macrlc(void) {
libconfig_int local_n_portd = 0; libconfig_int local_n_portd = 0;
libconfig_int remote_n_portd = 0; libconfig_int remote_n_portd = 0;
printf("%s() Enter\n" , __FUNCTION__);
load_config_file(&cfg); load_config_file(&cfg);
setting = config_lookup(&cfg, CONFIG_STRING_MACRLC_LIST); setting = config_lookup(&cfg, CONFIG_STRING_MACRLC_LIST);
if (setting != NULL) { if (setting != NULL) {
if ((RC.nb_macrlc_inst=config_setting_length(setting))>0) mac_top_init_eNB(); if ((RC.nb_macrlc_inst=config_setting_length(setting))>0) mac_top_init_eNB();
else AssertFatal(1==0,"improper macrlc setting\n"); else AssertFatal(1==0,"improper macrlc setting\n");
...@@ -950,17 +943,9 @@ void RCconfig_macrlc(void) { ...@@ -950,17 +943,9 @@ void RCconfig_macrlc(void) {
RC.mac[j]->eth_params_s.remote_portd = remote_s_portd; RC.mac[j]->eth_params_s.remote_portd = remote_s_portd;
RC.mac[j]->eth_params_s.transp_preference = ETH_UDP_MODE; RC.mac[j]->eth_params_s.transp_preference = ETH_UDP_MODE;
{ printf("**************** vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
extern uint8_t nfapi_pnf; configure_nfapi_vnf(RC.mac[j]->eth_params_s.my_addr, RC.mac[j]->eth_params_s.my_portc);
nfapi_pnf = 2; printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
}
{
printf("**************** vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
configure_nfapi_vnf(RC.mac[j]->eth_params_s.my_addr, RC.mac[j]->eth_params_s.my_portc);
printf("**************** RETURNED FROM configure_nfapi_vnf() vnf_port:%d\n", RC.mac[j]->eth_params_s.my_portc);
}
} }
else { // other midhaul else { // other midhaul
...@@ -968,7 +953,10 @@ void RCconfig_macrlc(void) { ...@@ -968,7 +953,10 @@ void RCconfig_macrlc(void) {
} }
}// j=0..num_inst }// j=0..num_inst
} }
return; else
{
printf("No MAC/RLC instances\n");
}
} }
int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
......
...@@ -538,7 +538,7 @@ void schedule_mib(module_id_t module_idP, ...@@ -538,7 +538,7 @@ void schedule_mib(module_id_t module_idP,
module_idP, module_idP,
0); // not used in this case 0); // not used in this case
LOG_E(MAC,"Frame %d, subframe %d: BCH PDU length %d\n", LOG_D(MAC,"Frame %d, subframe %d: BCH PDU length %d\n",
frameP,subframeP,mib_sdu_length); frameP,subframeP,mib_sdu_length);
if (mib_sdu_length > 0) { if (mib_sdu_length > 0) {
...@@ -575,7 +575,7 @@ void schedule_mib(module_id_t module_idP, ...@@ -575,7 +575,7 @@ void schedule_mib(module_id_t module_idP,
eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG; eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST; eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
if (frameP%100==0) LOG_E(MAC,"%s() TX_REQ: sfn_sf:%u pdus:%u pdu_length:%u pdu_index:%u segments:%u segment_length:%u\n", if (frameP%100==0) LOG_D(MAC,"%s() TX_REQ: sfn_sf:%u pdus:%u pdu_length:%u pdu_index:%u segments:%u segment_length:%u\n",
__FUNCTION__, eNB->TX_req[CC_id].sfn_sf, eNB->TX_req[CC_id].tx_request_body.number_of_pdus, __FUNCTION__, eNB->TX_req[CC_id].sfn_sf, eNB->TX_req[CC_id].tx_request_body.number_of_pdus,
TX_req->pdu_length, TX_req->pdu_index, TX_req->num_segments, TX_req->segments[0].segment_length); TX_req->pdu_length, TX_req->pdu_index, TX_req->num_segments, TX_req->segments[0].segment_length);
} }
...@@ -701,7 +701,7 @@ schedule_SI( ...@@ -701,7 +701,7 @@ schedule_SI(
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE; dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
dl_config_pdu->pdu_size = (uint8_t)(sizeof(nfapi_dl_config_dci_dl_pdu)); dl_config_pdu->pdu_size = (uint8_t)(sizeof(nfapi_dl_config_dci_dl_pdu));
dl_req->number_dci++; dl_req->number_dci++;
LOG_E(MAC, "%s() number_dci:%u\n", __FUNCTION__, dl_req->number_dci); LOG_D(MAC, "%s() number_dci:%u\n", __FUNCTION__, dl_req->number_dci);
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tl.tag = NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4; dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4;
...@@ -719,8 +719,9 @@ schedule_SI( ...@@ -719,8 +719,9 @@ schedule_SI(
dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST; dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
dl_config_request->sfn_sf = sfn_sf; dl_config_request->sfn_sf = sfn_sf;
LOG_D(MAC, "%s() mcs:%d bcch_sdu_length:%d N_RB_DL:%d first_rb:%d resource_block_coding:%d\n", __FUNCTION__, mcs, bcch_sdu_length, N_RB_DL, first_rb, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding);
if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) { if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) {
// DJP - dl_req->number_dci++;
dl_req->number_pdu++; dl_req->number_pdu++;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
......
...@@ -180,7 +180,7 @@ void UL_indication(UL_IND_t *UL_info) ...@@ -180,7 +180,7 @@ void UL_indication(UL_IND_t *UL_info)
handle_harq(UL_info); handle_harq(UL_info);
// clear HI prior to hanling ULSCH // clear HI prior to handling ULSCH
mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0; mac->HI_DCI0_req[CC_id].hi_dci0_request_body.number_of_hi = 0;