Commit db42be5d authored by Javier Morgade's avatar Javier Morgade

FeMBMS PBCH Initial Scan Procedures

parent 8a67e0e5
......@@ -35,6 +35,10 @@
uint8_t get_mi(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
{
// for FeMBMS
if(frame_parms->FeMBMS_active!=0){
return(0);
}
// for FDD
if (frame_parms->frame_type == FDD)
......
......@@ -126,6 +126,9 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
pbch_decoded = 0;
for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (ue->FeMBMS_active != 2){
#endif
pbch_tx_ant = rx_pbch(&ue->common_vars,
ue->pbch_vars[0],
frame_parms,
......@@ -133,12 +136,26 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
SISO,
ue->high_speed_flag,
frame_mod4);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
}else{
pbch_tx_ant = rx_pbch_fembms(&ue->common_vars,
ue->pbch_vars[0],
frame_parms,
0,
SISO,
ue->high_speed_flag,
frame_mod4);
}
#endif
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
pbch_decoded = 1;
break;
}
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (ue->FeMBMS_active != 2){
#endif
pbch_tx_ant = rx_pbch(&ue->common_vars,
ue->pbch_vars[0],
frame_parms,
......@@ -146,6 +163,17 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
ALAMOUTI,
ue->high_speed_flag,
frame_mod4);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
}else{
pbch_tx_ant = rx_pbch_fembms(&ue->common_vars,
ue->pbch_vars[0],
frame_parms,
0,
ALAMOUTI,
ue->high_speed_flag,
frame_mod4);
}
#endif
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
pbch_decoded = 1;
......@@ -202,7 +230,9 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
break;
}
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if(ue->FeMBMS_active != 2) {
#endif
// now check for PHICH parameters
frame_parms->phich_config_common.phich_duration = (PHICH_DURATION_t)((ue->pbch_vars[0]->decoded_output[2]>>4)&1);
dummy = (ue->pbch_vars[0]->decoded_output[2]>>2)&3;
......@@ -251,6 +281,28 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
frame_parms->phich_config_common.phich_duration,
phich_resource); //frame_parms->phich_config_common.phich_resource);
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
}else{
for(int i=0; i<RX_NB_TH;i++)
{
ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&31)<<1) + (ue->pbch_vars[0]->decoded_output[1]>>7))<<4;
ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx;
}
#ifdef DEBUG_INITIAL_SYNCH
LOG_I("[UE%d] Initial sync: FeMBMS pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, AdditionalNonMBSFN_SF %d, frame_mod4 %d\n",
ue->Mod_id,
frame_parms->nb_antenna_ports_eNB,
pbch_tx_ant,
ue->proc.proc_rxtx[0].frame_rx,
frame_parms->N_RB_DL,
0,
frame_mod4
);
#endif
}
#endif
return(0);
} else {
return(-1);
......@@ -330,6 +382,21 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret);
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (ret==-1){
ue->FeMBMS_active = 2;
ret = pbch_detection(ue,mode);
if (ret==-1){
ue->FeMBMS_active = 0;
frame_parms->FeMBMS_active = 0;
}
else frame_parms->FeMBMS_active = 1;
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FeMBMS Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret);
#endif
}
#endif
} else {
#ifdef DEBUG_INITIAL_SYNCH
......@@ -377,6 +444,25 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
LOG_I(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (ret==-1){
ue->FeMBMS_active = 2;
ret = pbch_detection(ue,mode);
if (ret==-1){
ue->FeMBMS_active = 0;
frame_parms->FeMBMS_active = 0;
}
else frame_parms->FeMBMS_active = 1;
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FeMBMS CAS Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
#endif
}
#endif
} else {
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
......
......@@ -647,7 +647,7 @@ void pbch_unscrambling_fembms(LTE_DL_FRAME_PARMS *frame_parms,
// x1 is set in first call to lte_gold_generic
x2 = frame_parms->Nid_cell+(1<<9); //this is c_init for FeMBMS in 36.211 Sec 6.6.1
printf("pbch_unscrambling: Nid_cell = %d, x2 = %d, frame_mod4 %d length %d\n",frame_parms->Nid_cell,x2,frame_mod4,length);
//msg("pbch_unscrambling: Nid_cell = %d, x2 = %d, frame_mod4 %d length %d\n",frame_parms->Nid_cell,x2,frame_mod4,length);
for (i=0; i<length; i++) {
if (i%32==0) {
s = lte_gold_generic(&x1, &x2, reset);
......
......@@ -621,6 +621,11 @@ typedef struct {
//uint8_t local_flag;
/// \brief Indicator of current run mode of UE (normal_txrx, rx_calib_ue, no_L2_connect, debug_prach)
runmode_t mode;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
/// \brief Indicator that UE is configured for FeMBMS functionality (This flag should be avoided) ... just kept for PBCH initical scan (TODO)
int FeMBMS_active;
#endif
/// \brief Indicator that UE should perform band scanning
int UE_scan;
/// \brief Indicator that UE should perform coarse scanning around carrier
......
......@@ -632,6 +632,9 @@ typedef struct {
uint8_t threequarter_fs;
/// Size of FFT
uint16_t ofdm_symbol_size;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
uint8_t FeMBMS_active;
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
/// Size of FFT
uint16_t ofdm_symbol_size_khz_1dot25;
......
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