Commit f3745444 authored by Raymond Knopp's avatar Raymond Knopp

eMTC extensions in L1/L2 after interoperability testing with COTS Cat-M device.

parent fc283a32
......@@ -222,7 +222,11 @@ void phy_config_request(PHY_Config_t *phy_config) {
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value;
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value;
AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0],
"prach_starting_subframe_periodicity[0] < prach_numPetitionPerPreambleAttempt[0]\n");
"prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n",
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0],
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]);
AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0,
"prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n");
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value;
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value;
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value;
......
......@@ -1117,6 +1117,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
uint8_t restricted_set;
uint8_t n_ra_prb;
int frame;
int subframe;
int16_t *prachF=NULL;
int16_t **rxsigF=NULL;
......@@ -1153,9 +1154,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
int prach_ifft_cnt=0;
#endif
#ifdef PRACH_DEBUG
int en,en0=0;
int en0=0;
#endif
int en;
if (ru) {
fp = &ru->frame_parms;
nb_rx = ru->nb_rx;
......@@ -1204,17 +1205,31 @@ void rx_prach0(PHY_VARS_eNB *eNB,
#ifdef Rel14
if (br_flag == 1) {
prach_ifftp = eNB->prach_vars_br.prach_ifft[ce_level];
frame = eNB->proc.frame_prach_br;
subframe = eNB->proc.subframe_prach_br;
prachF = eNB->prach_vars_br.prachF;
rxsigF = eNB->prach_vars_br.rxsigF;
#ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
br_flag,ce_level,frame,subframe,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
prach_ConfigIndex,rootSequenceIndex,
eNB->prach_vars_br.repetition_number[ce_level],
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]);
#endif
}
else
#endif
{
prach_ifftp = eNB->prach_vars.prach_ifft[0];
frame = eNB->proc.frame_prach;
subframe = eNB->proc.subframe_prach;
prachF = eNB->prach_vars.prachF;
rxsigF = eNB->prach_vars.rxsigF;
#ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
#endif
}
}
else {
......@@ -1222,16 +1237,20 @@ void rx_prach0(PHY_VARS_eNB *eNB,
if (br_flag == 1) {
subframe = ru->proc.subframe_prach_br;
rxsigF = ru->prach_rxsigF_br[ce_level];
LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
#ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
br_flag,ce_level,frame,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
#endif
}
else
#endif
{
subframe = ru->proc.subframe_prach;
rxsigF = ru->prach_rxsigF;
LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
#ifdef PRACH_DEBUG
if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
#endif
}
}
......@@ -1242,7 +1261,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
if (ru->if_south == LOCAL_RF) { // set the time-domain signal if we have to use it in this node
prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset];
#ifdef PRACH_DEBUG
LOG_D(PHY,"RU %d, subframe %d, : prach %p (energy %d)\n",ru->idx,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti)));
if ((frame&1023) < 20) LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d, : prach %p (energy %d)\n",ru->idx,br_flag,ce_level,frame,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti)));
#endif
}
}
......@@ -1453,24 +1472,12 @@ void rx_prach0(PHY_VARS_eNB *eNB,
#endif
send_IF4p5(ru, ru->proc.frame_prach, ru->proc.subframe_prach, IF4p5_PRACH);
#if 0
if (dB_fixed(en0)>30) {
en = dB_fixed(signal_energy(&rxsigF[0][k],840));
// if (en>60)
printf("PRACH (if4p5), k %d, n_ra_prb %d: Frame %d, Subframe %d => %d dB\n",k,n_ra_prb,ru->proc.frame_rx,ru->proc.subframe_rx,en);
write_output("rxsigF.m","prach_rxF",rxsigF[0],12288,1,1);
exit(-1);
}
#endif
return;
} else if (eNB!=NULL) {
#if 0
en = dB_fixed(signal_energy(&rxsigF[0][0],840));
/*if (en>60)*/
printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en);
#ifdef PRACH_DEBUG
if ((en > 60)&&(br_flag==1)) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d, n_ra_prb %d, k %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,n_ra_prb,k,eNB->proc.frame_rx,eNB->proc.subframe_rx,en);
#endif
}
......@@ -1506,6 +1513,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
*max_preamble_energy=0;
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
#ifdef PRACH_DEBUG
if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame,subframe,preamble_index,br_flag);
#endif
if (restricted_set == 0) {
// This is the relative offset in the root sequence table (5.7.2-4 from 36.211) for the given preamble index
preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS)));
......@@ -1589,7 +1600,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
#ifdef PRACH_DEBUG
LOG_I(PHY,"preamble index %d: offset %d, preamble shift %d\n",preamble_index,preamble_offset,preamble_shift);
if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n",
frame,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en);
#endif
log2_ifft_size = 10;
fft_size = 6144;
......@@ -1651,25 +1663,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
#endif
// if (aa=1) write_output("prach_rxF_comp1.m","prach_rxF_comp1",prachF,1024,1,1);
}// antennas_rx
#ifdef PRACH_DEBUG
if (en>40) {
k = (12*n_ra_prb) - 6*fp->N_RB_UL;
if (k<0) k+=fp->ofdm_symbol_size;
k*=12;
k+=13;
k*=2;
printf("Dumping prach, k = %d (n_ra_prb %d)\n",k,n_ra_prb);
write_output("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
write_output("Xu.m","xu",Xu,N_ZC,1,1);
write_output("prach_ifft0.m","prach_t0",prach_ifft[0][0],1024,1,1);
exit(-1);
}
#endif
} // new dft
// check energy in nth time shift, for
......@@ -1679,22 +1672,58 @@ void rx_prach0(PHY_VARS_eNB *eNB,
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]))
#endif
{
#ifdef PRACH_DEBUG
if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame,subframe,br_flag,en);
#endif
preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<<log2_ifft_size)/N_ZC));
for (i=0; i<NCS2; i++) {
lev = (int32_t)prach_ifft[(preamble_shift2+i)<<1];
lev = (int32_t)prach_ifft[(preamble_shift2+i)];
levdB = dB_fixed_times10(lev);
if (levdB>*max_preamble_energy) {
*max_preamble_energy = levdB;
*max_preamble_delay = ((i*fft_size)>>log2_ifft_size)*update_TA/update_TA2;
*max_preamble = preamble_index;
//#ifdef PRACH_DEBUG
if ((en>60) && (br_flag==1)) LOG_I(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d,ce_level %d, levdB %d, lev %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,ce_level,levdB,lev);
//#endif
}
}
}
}// preamble_index
#ifdef PRACH_DEBUG
if (en>60) {
k = (12*n_ra_prb) - 6*fp->N_RB_UL;
if (k<0) k+=fp->ofdm_symbol_size;
k*=12;
k+=13;
k*=2;
if (br_flag == 0) {
/*
write_output("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
write_output("Xu.m","xu",Xu,N_ZC,1,1);
write_output("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);*/
}
else {
printf("Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
write_output("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1);
write_output("prach_rxF_comp0_br.m","prach_rxF_comp0_br",prachF,1024,1,1);
write_output("Xu_br.m","xu_br",Xu,N_ZC,1,1);
write_output("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
exit(-1);
}
}
#endif
if (eNB) stop_meas(&eNB->rx_prach);
}
......
......@@ -705,7 +705,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
LTE_eNB_DLSCH_t *dlsch,
LTE_eNB_DLSCH_t *dlsch1,
LTE_eNB_UE_stats *ue_stats,
int ra_flag){
int ra_flag) {
int frame=proc->frame_tx;
int subframe=proc->subframe_tx;
......@@ -715,7 +715,8 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
int i;
if (frame < 20) {
LOG_I(PHY,
LOG_D(PHY,
"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n",
eNB->Mod_id, dlsch->rnti,harq_pid,
frame, subframe, input_buffer_length, dlsch_harq->pdsch_start,
......@@ -953,16 +954,15 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
#ifdef Rel14
dlsch0->sib1_br_flag=0;
if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR
if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR
dlsch0->rnti = 0xFFFF;
dlsch0->Kmimo = 1;
dlsch0->Mdlharq = 4;
dlsch0->Mdlharq = 4;
dlsch0->Nsoft = 25344;
dlsch0->i0 = rel13->initial_transmission_sf_io;
dlsch0_harq->pdsch_start = rel10->pdsch_start;
if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1;
// configure PDSCH
......@@ -991,8 +991,8 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
}
dlsch0->active = 1;
dlsch0_harq->nb_rb = 6;
dlsch0_harq->nb_rb = 6;
dlsch0_harq->vrb_type = LOCALIZED;
dlsch0_harq->rvidx = rel8->redundancy_version;
dlsch0_harq->Nl = 1;
......@@ -1003,7 +1003,6 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
dlsch0_harq->TBS = rel8->length<<3;
dlsch0_harq->Qm = rel8->modulation;
dlsch0_harq->codeword = 0;
}
else {
......@@ -1019,7 +1018,15 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
nfapi_ul_config_request_pdu_t *ul_config_pdu) {
nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8;
uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT;
uint16_t RIV_max;
uint16_t use_srs=0;
int8_t UE_id;
LTE_eNB_ULSCH_t *ulsch;
LTE_UL_eNB_HARQ_t *ulsch_harq;
// check if we have received a dci for this ue and ulsch descriptor is configured
if (ul_config_pdu == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
......@@ -1027,6 +1034,80 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
"No existing UE ULSCH for rnti %x\n",rel8->rnti);
AssertFatal(eNB->ulsch[UE_id]->harq_mask > 0,
"ulsch for UE_id %d is not active\n",UE_id);
LOG_I(PHY,"Applying UL config for UE %d, rnti %x\n",
UE_id,rel8->rnti);
/*
#ifdef Rel14
nfapi_ul_config_ulsch_pdu_rel13_t *rel13 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13;
int harq_pid = rel8->harq_process_number;
if (rel13->ue_type > 0) { // This is a BL/CE UE, retrieve PUSCH programming
ulsch = eNB->ulsch[UE_id];
ulsch_harq = ulsch->harq_processes[harq_pid];
switch (eNB->frame_parms.N_RB_DL) {
case 6:
RIV2nb_rb_LUT = &RIV2nb_rb_LUT6[0];
RIV2first_rb_LUT = &RIV2first_rb_LUT6[0];
RIV_max = RIV_max6;
break;
case 25:
RIV2nb_rb_LUT = &RIV2nb_rb_LUT25[0];
RIV2first_rb_LUT = &RIV2first_rb_LUT25[0];
RIV_max = RIV_max25;
break;
case 50:
RIV2nb_rb_LUT = &RIV2nb_rb_LUT50[0];
RIV2first_rb_LUT = &RIV2first_rb_LUT50[0];
RIV_max = RIV_max50;
break;
case 100:
RIV2nb_rb_LUT = &RIV2nb_rb_LUT100[0];
RIV2first_rb_LUT = &RIV2first_rb_LUT100[0];
RIV_max = RIV_max100;
break;
default:
DevParam(frame_parms->N_RB_DL, harq_pid, 0);
break;
}
ulsch_harq->first_rb = rel8->resource_block_start;
ulsch_harq->nb_rb = rel8->number_of_resource_blocks;
ulsch_harq->O_RI = 0;//1;
ulsch_harq->Or2 = 0;
ulsch_harq->Or1 = 0;
ulsch_harq->O_ACK = 0;//2;
ulsch->beta_offset_cqi_times8 = 18;
ulsch->beta_offset_ri_times8 = 10;
ulsch->beta_offset_harqack_times8 = 16;
ulsch->rnti = rel8->rnti;
ulsch->harq_mask = 1<<harq_pid;
if (ulsch_harq->round == 0) {
ulsch_harq->status = ACTIVE;
ulsch_harq->rvidx = 0;
//ulsch_harq->TBS = dlsch_tbs25[ulsch_harq->mcs][ulsch_harq->nb_rb-1];
ulsch_harq->TBS = TBStable[get_I_TBS_UL(ulsch_harq->mcs)][ulsch_harq->nb_rb-1];
ulsch_harq->Msc_initial = 12*ulsch_harq->nb_rb;
ulsch_harq->Nsymb_initial = 9;
ulsch_harq->round = 0;
} else {
ulsch_harq->rvidx = 0;
ulsch_harq->round++;
}
use_srs = is_srs_occasion_common(frame_parms,ulsch_harq->frame,ulsch_harq->subframe);
ulsch_harq->Nsymb_pusch = 12-(frame_parms->Ncp<<1)-(use_srs==0?0:1);
ulsch_harq->srs_active = use_srs;
}
#endif
*/
}
else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) {
AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST))>=0,
......@@ -1034,19 +1115,19 @@ handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
handle_uci_harq_pdu(eNB,proc,ul_config_pdu);
}
else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) {
}
else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) {
}
else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE) {
}
else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) {
}
else if (ul_config_pdu == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) {
}
}
......@@ -1152,7 +1233,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1,
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
if (dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti == eNB->preamble_list[0].preamble_rel8.rnti) {// is RAR pdu
LOG_I(PHY,"Frame %d, Subframe %d: Received LTE RAR pdu, programming based on UL Grant\n");
generate_eNB_ulsch_params_from_rar(eNB,
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
frame,
......@@ -1198,7 +1279,7 @@ 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);
LOG_I(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_UCI_HARQ_PDU_TYPE,
"Optional UL_PDU type %d not supported\n",ul_config_pdu->pdu_type);
......@@ -1604,7 +1685,6 @@ void process_HARQ_feedback(uint8_t UE_id,
dl_subframe = ul_ACK_subframe2_dl_subframe(fp,
subframe,
m);
if (dlsch->subframe_tx[dl_subframe]==1) {
if (pusch_flag == 1)
mp++;
......@@ -1627,7 +1707,7 @@ void process_HARQ_feedback(uint8_t UE_id,
LOG_D(PHY,"[eNB %d][PDSCH %x/%d] subframe %d, status %d, round %d (rv %d, TBS %d)\n",eNB->Mod_id,
dlsch->rnti,dl_harq_pid[m],dl_subframe,
dlsch_harq_proc->status,dlsch_harq_proc->round,
dlsch->harq_processes[dl_harq_pid[m]]->rvidx,
dlsch->harq_processes[dl_harq_pid[m]]->rvidx,
dlsch->harq_processes[dl_harq_pid[m]]->TBS);
if (dlsch_harq_proc->status==DISABLED)
......@@ -1891,10 +1971,16 @@ void prach_procedures(PHY_VARS_eNB *eNB,
if (br_flag==1) {
subframe = eNB->proc.subframe_prach_br;
frame = eNB->proc.frame_prach_br;
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rach_ind_br.number_of_preambles=0;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
else
#endif
{
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.rach_ind.number_of_preambles=0;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
subframe = eNB->proc.subframe_prach;
frame = eNB->proc.frame_prach;
}
......@@ -1907,6 +1993,8 @@ void prach_procedures(PHY_VARS_eNB *eNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
for (i=0;i<eNB->num_RU;i++) {
ru=eNB->RU_list[i];
for (ru_aa=0,aa=0;ru_aa<ru->nb_rx;ru_aa++,aa++) {
......@@ -1932,13 +2020,13 @@ void prach_procedures(PHY_VARS_eNB *eNB,
#endif
);
//#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n",
#ifdef DEBUG_PHY_PROC
LOG_I(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d\n",
frame,subframe,
max_preamble[0],
max_preamble_energy[0],
max_preamble_energy[0]/10,
max_preamble_delay[0]);
//#endif
#endif
#ifdef Rel14
if (br_flag==1) {
......@@ -1949,30 +2037,46 @@ void prach_procedures(PHY_VARS_eNB *eNB,
prach_mask = is_prach_subframe(&eNB->frame_parms,eNB->proc.frame_prach_br,eNB->proc.subframe_prach_br);
eNB->UL_INFO.rach_ind_br.preamble_list = eNB->preamble_list_br;
int ind=0;
int ce_level=0;
/* Save for later, it doesn't work
for (int ind=0,ce_level=0;ce_level<4;ce_level++) {
if ((prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions
if ((eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[ce_level]==1)&&
(prach_mask&(1<<(1+ce_level)) > 0) && // prach is active and CE level has finished its repetitions
(eNB->prach_vars_br.repetition_number[ce_level]==
eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) {
if (max_preamble_energy[ind] > 580) {
eNB->UL_INFO.rach_ind_br.number_of_preambles++;
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];//
eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind];
// note: fid is implicitly 0 here, this is the rule for eMTC RA-RNTI from 36.321, Section 5.1.4
eNB->preamble_list_br[ind].preamble_rel8.rnti = 1+subframe+(eNB->prach_vars_br.first_frame[ce_level]%40);
eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is
eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1+ce_level; // CE Level
}
*/
if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0]==1){
if (max_preamble_energy[0] > 350) {
eNB->UL_INFO.rach_ind_br.number_of_preambles++;
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind];//
eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind];
// note: fid is implicitly 0 here, this is the rule for eMTC RA-RNTI from 36.321, Section 5.1.4
eNB->preamble_list_br[ind].preamble_rel8.rnti = 1+subframe+(eNB->prach_vars_br.first_frame[ce_level]%40);
eNB->preamble_list_br[ind].instance_length = 0; //don't know exactly what this is
eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type = 1+ce_level; // CE Level
LOG_I(PHY,"Filling NFAPI indication for RACH %d CELevel %d (mask %x) : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
ind,
ce_level,
prach_mask,
eNB->preamble_list_br[ind].preamble_rel8.timing_advance,
eNB->preamble_list_br[ind].preamble_rel8.preamble,
eNB->preamble_list_br[ind].preamble_rel8.rnti,
eNB->preamble_list_br[ind].preamble_rel13.rach_resource_type);
}
/*
ind++;
}
} // ce_level
} */// ce_level
}
}
else
#endif
{
if (max_preamble_energy[0] > 580) {
if (max_preamble_energy[0] > 10000) {
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
eNB->Mod_id,
......@@ -2002,10 +2106,15 @@ void prach_procedures(PHY_VARS_eNB *eNB,
eNB->preamble_list[0].preamble_rel8.rnti = 1+subframe; // note: fid is implicitly 0 here
eNB->preamble_list[0].preamble_rel13.rach_resource_type = 0;
eNB->preamble_list[0].instance_length = 0; //don't know exactly what this is
LOG_I(PHY,"Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, rach_resource_type %d\n",
eNB->preamble_list[0].preamble_rel8.timing_advance,
eNB->preamble_list[0].preamble_rel8.preamble,
eNB->preamble_list[0].preamble_rel8.rnti,
eNB->preamble_list[0].preamble_rel13.rach_resource_type);
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
} // max_preamble_energy > 580
} // max_preamble_energy > 350
} // else br_flag
/*
mac_xface->initiate_ra_proc(eNB->Mod_id,
......@@ -2494,7 +2603,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_uespec_RX(%d)\n",eNB->Mod_id,frame, subframe);
#endif
eNB->rb_mask_ul[0]=0;
eNB->rb_mask_ul[1]=0;
eNB->rb_mask_ul[2]=0;
......
......@@ -752,6 +752,15 @@ typedef struct {
#ifdef LOCALIZATION
eNB_UE_estimated_distances distance;
#endif
#ifdef Rel14
uint8_t rach_resource_type;
uint16_t mpdcch_repetition_cnt;
struct PhysicalConfigDedicated *physicalConfigDedicated;
frame_t Msg2_frame;
sub_frame_t Msg2_subframe;
#endif
} UE_TEMPLATE;
/*! \brief scheduling control information set through an API (not used)*/
......@@ -852,6 +861,12 @@ typedef struct {
int16_t timing_offset;
/// Timeout for RRC connection
int16_t RRC_timer;
/// Msg3 first RB
uint8_t msg3_first_rb;
/// Msg3 number of RB
uint8_t msg3_nb_rb;
/// Msg3 MCS
uint8_t msg3_mcs;
/// Round of Msg3 HARQ
uint8_t msg3_round;
/// TBS used for Msg4
......
......@@ -85,62 +85,113 @@ void check_and_add_msg3(module_id_t module_idP,frame_t frameP, sub_frame_t subfr
if (RA_template->RA_active == TRUE) {
// program reception 4 subframes prior to transmission
msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10;
if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023;
else msg3_prog_frame=RA_template->Msg3_frame;
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d CC_id %d RA %d is active, Msg3 in (%d,%d), programmed in (%d,%d)\n",
module_idP,frameP,subframeP,CC_id,i,RA_template->Msg3_frame,RA_template->Msg3_subframe,
msg3_prog_frame,msg3_prog_subframe);
if ((msg3_prog_frame==frameP) &&
(msg3_prog_subframe==subframeP)) {
LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n",
frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe);
eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe;
if (RA_template->msg3_round == 0) { // program ULSCH
ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
#ifdef Rel14
if (RA_template->rach_resource_type>0) {
// program reception 4 subframes prior to transmission
msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10;
if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023;
else msg3_prog_frame=RA_template->Msg3_frame;
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d CE level %d is active, Msg3 in (%d,%d), programmed in (%d,%d)\n",
module_idP,frameP,subframeP,CC_id,i,RA_template->rach_resource_type-1,
RA_template->Msg3_frame,RA_template->Msg3_subframe,
msg3_prog_frame,msg3_prog_subframe);
if ((msg3_prog_frame==frameP) &&
(msg3_prog_subframe==subframeP)) {
LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n",
frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe);
eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe;
if (RA_template->msg3_round == 0) { // program ULSCH
ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
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.handle = eNB->ul_handle++;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = narrowband_to_first_rb(cc,RA_template->msg34_narrowband)+RA_template->msg3_first_rb;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = RA_template->msg3_nb_rb;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = ((10*frameP)+subframeP)&7;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(RA_template->msg3_mcs,
RA_template->msg3_nb_rb);
// Re13 fields
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = RA_template->rach_resource_type>2 ? 2 : 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (RA_template->Msg3_frame*10)+RA_template->Msg3_subframe;
ul_req->number_of_pdus++;
}
}
}
else
#endif
{
// program reception 4 subframes prior to transmission
msg3_prog_subframe = (RA_template->Msg3_subframe + 6)%10;
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.handle = eNB->ul_handle++;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10,ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks);
ul_req->number_of_pdus++;
}
else { // program HI
hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi];
memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu);
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = 1; // note this is hard-coded like in fill_rar
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
hi_dci0_req->number_of_hi++;
if (RA_template->Msg3_subframe<4) msg3_prog_frame=(RA_template->Msg3_frame+1023)&1023;
else msg3_prog_frame=RA_template->Msg3_frame;
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active, Msg3 in (%d,%d), programmed in (%d,%d)\n",
module_idP,frameP,subframeP,CC_id,i,RA_template->Msg3_frame,RA_template->Msg3_subframe,
msg3_prog_frame,msg3_prog_subframe);
LOG_I(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n",
module_idP,RA_template[i].rnti,CC_id,frameP,subframeP,i,10,
1,1,
RA_template[i].msg3_round-1);
}
}
}
}
}
if ((msg3_prog_frame==frameP) &&
(msg3_prog_subframe==subframeP)) {
LOG_I(MAC,"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d)\n",
frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe);
eNB->UL_req[CC_id].sfn_sf = (RA_template->Msg3_frame<<4) + RA_template->Msg3_subframe;
if (RA_template->msg3_round == 0) { // program ULSCH
ul_config_pdu = &ul_req->ul_config_pdu_list[ul_req->number_of_pdus];
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.handle = eNB->ul_handle++;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti = RA_template->rnti;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.resource_block_start = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.modulation_type = 2;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.cyclic_shift_2_for_drms = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_enabled_flag = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10,ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.number_of_resource_blocks);
ul_req->number_of_pdus++;
}
}
else { // program HI
hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi];
memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2+sizeof(nfapi_hi_dci0_hi_pdu);
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = 1; // note this is hard-coded like in fill_rar
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = 0;
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
hi_dci0_req->number_of_hi++;
LOG_I(MAC,"[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA %d (mcs %d, first rb %d, nb_rb %d,round %d)\n",
module_idP,RA_template[i].rnti,CC_id,frameP,subframeP,i,10,
1,1,
RA_template[i].msg3_round-1);
} // PHICH
} // non-BL/CE UE case
} // RA_active = TRUE
} // for RA_processes
} // for CCids
}
void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template) {
......@@ -171,6 +222,11 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13;
PRACH_ParametersCE_r13_t *p[4]={NULL,NULL,NULL,NULL};
uint16_t absSF = (10*frameP)+subframeP;
uint16_t absSF_Msg2 = (10*RA_template->Msg2_frame)+RA_template->Msg2_subframe;
if (absSF>absSF_Msg2) return; // we're not ready yet, need to be to start ==
if (cc[CC_idP].radioResourceConfigCommon_BR) {
ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
......@@ -185,8 +241,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
p[1]=prach_ParametersListCE_r13->list.array[1];
case 1:
p[0]=prach_ParametersListCE_r13->list.array[0];
break;
default:
AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",prach_ParametersListCE_r13->list.count);
AssertFatal(1==0,"Illegal count for prach_ParametersListCE_r13 %d\n",(int)prach_ParametersListCE_r13->list.count);
break;
}
}
......@@ -201,9 +259,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// distributed transmission
// rmax from SIB2 information
rmax = p[RA_template->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13;
// choose r3 by default for RAR (Table 9.1.5-5)
rep = 2;
AssertFatal(rmax<9,"rmax>8!\n");
rmax = 1<<p[RA_template->rach_resource_type-1]->mpdcch_NumRepetition_RA_r13;
// choose r1 by default for RAR (Table 9.1.5-5)
rep = 0;
// get actual repetition count from Table 9.1.5-3
reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep));
// get narrowband according to higher-layer config
......@@ -212,9 +271,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg2_narrowband);
if ((RA_template->msg2_mpdcch_repetition_cnt == 0) &&
(mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){
(mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){
// MPDCCH configuration for RAR
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming MPDCCH %d repetitions\n",
module_idP,frameP,subframeP,reps);
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
......@@ -265,10 +325,13 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1;
RA_template->msg2_mpdcch_repetition_cnt++;
dl_req->number_pdu++;
RA_template->Msg2_subframe = (RA_template->Msg2_subframe+9)%10;
} //repetition_count==0 && SF condition met
else if (RA_template->msg2_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions
RA_template->msg2_mpdcch_repetition_cnt++;
if (RA_template->msg2_mpdcch_repetition_cnt>0) { // we're in a stream of repetitions
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, MPDCCH repetition %d\n",
module_idP,frameP,subframeP,RA_template->msg2_mpdcch_repetition_cnt);
if (RA_template->msg2_mpdcch_repetition_cnt==reps) { // this is the last mpdcch repetition
if (cc[CC_idP].tdd_Config==NULL) { // FDD case
// wait 2 subframes for PDSCH transmission
......@@ -279,9 +342,13 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
else {
AssertFatal(1==0,"TDD case not done yet\n");
}
} // mpdcch_repetition_count == reps
}// mpdcch_repetition_count == reps
RA_template->msg2_mpdcch_repetition_cnt++;
if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) {
// Program PDSCH
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH %d\n",
module_idP,frameP,subframeP);
RA_template->generate_rar = 0;
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
......@@ -310,7 +377,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
// Rel10 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
// Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2;;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10*frameP)+subframeP;
......@@ -338,8 +408,9 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
else
#endif
{
if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) {
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n",
LOG_I(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n",
module_idP, CC_idP, frameP, subframeP,
RA_template->RA_active,
......@@ -406,7 +477,8 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// Program UL processing for Msg3
get_Msg3alloc(&cc[CC_idP],subframeP,frameP,&RA_template->Msg3_frame,&RA_template->Msg3_subframe);
LOG_I(MAC,"Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n",
frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe);
fill_rar(module_idP,CC_idP,frameP,cc[CC_idP].RAR_pdu.payload,N_RB_DL,7);
// DL request
......@@ -558,7 +630,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg34_narrowband);
if ((RA_template->msg4_mpdcch_repetition_cnt == 0) &&
(mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){
(mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){
// MPDCCH configuration for RAR
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
......@@ -658,6 +730,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message
......@@ -1019,7 +1093,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP)
start_meas(&eNB->schedule_ra);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
// skip UL component carriers
if (is_UL_sf(&cc[CC_id],subframeP)==1) continue;
......@@ -1031,8 +1105,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP)
if (RA_template->RA_active == TRUE) {
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n",
module_idP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti);
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n",
module_idP,frameP,subframeP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti);
if (RA_template->generate_rar == 1) generate_Msg2(module_idP,CC_id,frameP,subframeP,RA_template);
else if (RA_template->generate_Msg4 == 1) generate_Msg4(module_idP,CC_id,frameP,subframeP,RA_template);
......@@ -1063,13 +1137,26 @@ void initiate_ra_proc(module_id_t module_idP,
{
uint8_t i;
RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&RC.mac[module_idP]->common_channels[CC_id].RA_template[0];
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index);
COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id];
RA_TEMPLATE *RA_template = &cc->RA_template[0];
struct PRACH_ConfigSIB_v1310 *ext4_prach=cc->radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13= &ext4_prach->prach_ParametersListCE_r13;
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,subframeP,preamble_index);
#ifdef Rel14
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d PRACH resource type %d\n",module_idP,CC_id,frameP,rach_resource_type);
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",module_idP,CC_id,frameP,subframeP,rach_resource_type);
#endif
if (prach_ParametersListCE_r13->list.count<rach_resource_type) {
LOG_E(MAC,"[eNB %d][RAPROC] CC_id %d Received impossible PRACH resource type %d, only %d CE levels configured\n",
module_idP,CC_id,
rach_resource_type,
(int)prach_ParametersListCE_r13->list.count);
return;
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,0);
......@@ -1088,6 +1175,8 @@ void initiate_ra_proc(module_id_t module_idP,
RA_template[i].msg2_mpdcch_repetition_cnt = 0;
RA_template[i].msg4_mpdcch_repetition_cnt = 0;
#endif
RA_template[i].Msg2_frame = frameP+((subframeP>5)?1:0);
RA_template[i].Msg2_subframe = (subframeP+4)%10;
/* TODO: find better procedure to allocate RNTI */
do {
RA_template[i].rnti = taus();
......@@ -1102,8 +1191,11 @@ void initiate_ra_proc(module_id_t module_idP,
if (loop == 100) { printf("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__); abort(); }
RA_template[i].RA_rnti = ra_rnti;
RA_template[i].preamble_index = preamble_index;
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation for process %d, rnti %x, RA_active %d\n",
module_idP,CC_id,frameP,i,RA_template[i].rnti,
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation in Frame %d, subframe %d for process %d, rnti %x, RA_active %d\n",
module_idP,CC_id,frameP,
RA_template[i].Msg2_frame,
RA_template[i].Msg2_subframe,
i,RA_template[i].rnti,
RA_template[i].RA_active);
return;
......
......@@ -121,16 +121,16 @@ schedule_SIB1_BR(
break;
case 1: // repetition 8
k = frameP&3;
AssertFatal(N_RB_DL<=15,"SIB1-BR repetition 8 not allowed for N_RB_DL= %d\n",N_RB_DL);
AssertFatal(N_RB_DL>15,"SIB1-BR repetition 8 not allowed for N_RB_DL= %d\n",N_RB_DL);
if ((foffset==0) && (subframeP!=(4+sfoffset))) continue;
else if ((foffset==1) && (subframeP!=((9+sfoffset)%10))) continue;
break;
case 2: // repetition 16
k = ((10*frameP) + subframeP)&3;
AssertFatal(N_RB_DL<=15,"SIB1-BR repetition 16 not allowed for N_RB_DL= %d\n",N_RB_DL);
AssertFatal(N_RB_DL>15,"SIB1-BR repetition 16 not allowed for N_RB_DL= %d\n",N_RB_DL);
if ((sfoffset == 1) && ((subframeP!=0)||(subframeP!=5))) continue;
else if ((sfoffset == 0) && (foffset==0) && ((subframeP!=4) || (subframeP!=9))) continue;
else if ((sfoffset == 0) && (foffset==1) && ((subframeP!=0) || (subframeP!=9))) continue;
else if ((sfoffset == 0) && (foffset==0) && (subframeP!=4) && (subframeP!=9)) continue;
else if ((sfoffset == 0) && (foffset==1) && (subframeP!=0) && (subframeP!=9)) continue;
break;
}
// if we get here we have to schedule SIB1_BR in this frame/subframe
......@@ -170,7 +170,7 @@ schedule_SIB1_BR(
Sj = Sj100;
break;
}
// Note: definition of k above and rvidx from 36.321 section 5.3.1
rvidx = (((3*k)>>1) + (k&1))&3;
i = cc->SIB1_BR_cnt & (m-1);
......@@ -196,7 +196,7 @@ schedule_SIB1_BR(
AssertFatal(bcch_sdu_length <= TBS, "length returned by RRC %d is not compatible with the TBS %d from MIB\n",bcch_sdu_length,TBS);
LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length);
if ((frameP&1023) < 200) LOG_D(MAC,"[eNB %d] Frame %d Subframe %d: SIB1_BR->DLSCH CC_id %d, Received %d bytes, scheduling on NB %d (i %d,m %d,N_S_NB %d) rvidx %d\n",module_idP,frameP,subframeP,CC_id,bcch_sdu_length,n_NB,i,m,N_S_NB,rvidx);
// allocate all 6 PRBs in narrowband for SIB1_BR
......@@ -235,6 +235,8 @@ schedule_SIB1_BR(
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// Rel10 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3;
// Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0; // SIB1-BR
......@@ -282,7 +284,6 @@ schedule_SIB1_BR(
}
return;
}
......@@ -312,7 +313,7 @@ schedule_SI_BR(
nfapi_dl_config_request_body_t *dl_req;
int i;
int rvidx;
int absSF = (frameP*10)+subframeP;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
......@@ -343,7 +344,10 @@ schedule_SI_BR(
"si_WindowLength_BR_r13 %d > %d\n",
(int)cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13,
SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_WindowLength_BR_r13_ms200);
// check that SI frequency-hopping is disabled
AssertFatal(cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_HoppingConfigCommon_r13==SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__si_HoppingConfigCommon_r13_off,
"Deactivate SI_HoppingConfigCommon_r13 in configuration file, not supported for now\n");
long si_WindowLength_BR_r13 = si_WindowLength_BR_r13tab[cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13];
long si_RepetitionPattern_r13 = cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->si_RepetitionPattern_r13;
......@@ -360,10 +364,11 @@ schedule_SI_BR(
// check if the SI is to be scheduled now
int period_in_sf = 80<<si_Periodicity; // 2^i * 80 subframes, note: si_Periodicity is 2^i * 80ms
int sf_mod_period = ((frameP*10)+subframeP)%period_in_sf;
rvidx = (((3*sf_mod_period)>>1) + (sf_mod_period&1))&3;
int sf_mod_period = absSF%period_in_sf;
int k = sf_mod_period&3;
// Note: definition of k and rvidx from 36.321 section 5.3.1
rvidx = (((3*k)>>1) + (k&1))&3;
if ((sf_mod_period < si_WindowLength_BR_r13) &&
((frameP&(((1<<si_RepetitionPattern_r13)-1)))==0)) { // this SIB is to be scheduled
......@@ -382,16 +387,26 @@ schedule_SI_BR(
AssertFatal(bcch_sdu_length <= (si_TBS_r13>>3),
"RRC provided bcch with length %d > %d (si_TBS_r13 %d)\n",
bcch_sdu_length,(int)(si_TBS_r13>>3),(int)schedulingInfoList_BR_r13->list.array[i]->si_TBS_r13);
LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length);
// allocate all 6 PRBs in narrowband for SIB1_BR
first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13);
// check that SIB1 didn't take this narrowband
if (vrb_map[first_rb] > 0) continue;
first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13-1);
vrb_map[first_rb] = 1;
vrb_map[first_rb+1] = 1;
vrb_map[first_rb+2] = 1;
vrb_map[first_rb+3] = 1;
vrb_map[first_rb+4] = 1;
vrb_map[first_rb+5] = 1;
if ((frameP&1023) < 200) LOG_D(MAC,"[eNB %d] Frame %d Subframe %d: SI_BR->DLSCH CC_id %d, Narrowband %d rvidx %d (sf_mod_period %d : si_WindowLength_BR_r13 %d : si_RepetitionPattern_r13 %d) bcch_sdu_length %d\n",
module_idP,frameP,subframeP,CC_id,si_Narrowband_r13-1,rvidx,
sf_mod_period,si_WindowLength_BR_r13,si_RepetitionPattern_r13,
bcch_sdu_length);
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));
......@@ -419,10 +434,12 @@ schedule_SI_BR(
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// Rel10 fields (for PDSCH starting symbol)
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
// Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 1; // SI-BR
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = absSF - sf_mod_period;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
dl_req->number_pdu++;
......@@ -507,6 +524,8 @@ void schedule_mib(module_id_t module_idP,
LOG_D(MAC,"Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n",
frameP,subframeP,dl_req->number_pdu,mib_sdu_length);
if ((frameP&1023) < 40) LOG_D(MAC,"[eNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes (cc->mib->message.schedulingInfoSIB1_BR_r13 %d)\n",module_idP,frameP,CC_id,mib_sdu_length,cc->mib->message.schedulingInfoSIB1_BR_r13);
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_BCH_PDU_TYPE,
......@@ -744,7 +763,7 @@ schedule_SI(
schedule_SIB1_BR(module_idP,frameP,subframeP);
schedule_SI_BR(module_idP,frameP,subframeP);
#endif
// this might be misleading when bcch is inactive
stop_meas(&eNB->schedule_si);
return;
}
......
......@@ -486,10 +486,13 @@ int get_numnarrowbandbits(long dl_Bandwidth) {
int startSF_fdd_RA_times2[8] = {2,3,4,5,8,10,16,20};
int startSF_tdd_RA[7] = {1,2,4,5,8,10,20};
int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type) {
int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type,int UE_id) {
struct PRACH_ConfigSIB_v1310 *ext4_prach = eNB->common_channels[CC_id].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
int T;
EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11;
switch (mpdcch_type) {
case TYPE0:
......@@ -504,6 +507,7 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t
case TYPE2: // RAR
AssertFatal(ext4_prach->mpdcch_startSF_CSS_RA_r13!=NULL,
"mpdcch_startSF_CSS_RA_r13 is null\n");
AssertFatal(rmax>0,"rmax is 0!\b");
if (eNB->common_channels[CC_id].tdd_Config==NULL) //FDD
T = rmax*startSF_fdd_RA_times2[ext4_prach->mpdcch_startSF_CSS_RA_r13->choice.fdd_r13]>>1;
else //TDD
......@@ -513,12 +517,23 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t
AssertFatal(1==0,"MPDCCH Type 2A not handled yet\n");
break;
case TYPEUESPEC:
AssertFatal(1==0,"MPDCCH Type UESPEC not handled yet\n");
epdcch_setconfig_r11= &eNB->UE_list.UE_template[CC_id][UE_id].physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0] ;
AssertFatal(epdcch_setconfig_r11 != NULL," epdcch_setconfig_r11 is null for UE specific \n");
AssertFatal(epdcch_setconfig_r11->ext2 != NULL," ext2 doesn't exist in epdcch config ' \n");
if (eNB->common_channels[CC_id].tdd_Config==NULL) //FDD
T = rmax*startSF_fdd_RA_times2[epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.fdd_r13]>>1;
else //TDD
T = rmax*startSF_tdd_RA[epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.tdd_r13];
break;
default:
return(0);
}
AssertFatal(T>0,"T is 0!\n");
if (((10*frameP) + subframeP)%T == 0) return(1);
else return(0);
......@@ -738,7 +753,11 @@ void dump_ue_list(UE_list_t *listP, int ul_flag)
}
}
int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP
#ifdef Rel14
,uint8_t rach_resource_type
#endif
)
{
int UE_id;
int i, j;
......@@ -760,6 +779,11 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
UE_list->ordered_ULCCids[0][UE_id] = cc_idP;
UE_list->num_UEs++;
UE_list->active[UE_id] = TRUE;
#ifdef Rel14
UE_list->UE_template[cc_idP][UE_id].rach_resource_type = rach_resource_type ;
#endif
memset((void*)&UE_list->UE_sched_ctrl[UE_id],0,sizeof(UE_sched_ctrl));
memset((void*)&UE_list->eNB_UE_stats[cc_idP][UE_id],0,sizeof(eNB_UE_STATS));
......
......@@ -370,7 +370,11 @@ void rx_sdu(const module_id_t enb_mod_idP,
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %ld\n",
enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP);
if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,RA_template->rnti,harq_pid)) == -1 ) {
if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pid
#ifdef Rel14
,eNB->common_channels[CC_idP].RA_template[ii].rach_resource_type
#endif
)) == -1 ) {
AssertFatal(1==0,"[MAC][eNB] Max user count reached\n");
// kill RA procedure
} else
......@@ -392,7 +396,8 @@ void rx_sdu(const module_id_t enb_mod_idP,
rx_lengths[i],
ENB_FLAG_YES,
enb_mod_idP,
0);
0
);
if (num_ce >0) { // handle msg3 which is not RRCConnectionRequest
......
......@@ -532,7 +532,11 @@ int to_prb(int);
int to_rbg(int);
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
int mac_init(void);
int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid);
int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid
#ifdef Rel14
,uint8_t rach_resource_type
#endif
);
int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP);
......@@ -901,7 +905,7 @@ uint8_t subframe2harqpid(COMMON_channels_t *cc,frame_t frame,sub_frame_t subfram
#ifdef Rel14
int get_numnarrowbandbits(long dl_Bandwidth);
int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type);
int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t subframeP,int rmax,MPDCCH_TYPES_t mpdcch_type,int UE_id);
int get_numnarrowbands(long dl_Bandwidth);
......
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