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);
}
......
This diff is collapsed.
......@@ -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
......
This diff is collapsed.
......@@ -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