Commit 39daad93 authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'l1-sidelink' of https://gitlab.eurecom.fr/matzakos/LTE-D2D into l1-sidelink

Conflicts:
	openair1/SCHED/phy_procedures_lte_ue.c
parents ba433236 dc2b99ea
......@@ -168,7 +168,7 @@ int rx_psbch(PHY_VARS_UE *ue,int frame_rx,int subframe_rx) {
}
LOG_I(PHY,"Running PBCH detection with Nid_SL %d (is_synchronizedSL %d) rxdata %p\n",ue->frame_parms.Nid_SL,ue->is_synchronizedSL,ue->common_vars.rxdata[0]);
LOG_D(PHY,"Running PBCH detection with Nid_SL %d (is_synchronizedSL %d) rxdata %p\n",ue->frame_parms.Nid_SL,ue->is_synchronizedSL,ue->common_vars.rxdata[0]);
for (int l=0; l<11; l++) {
slot_fep_ul(&ru_tmp,l%7,(l>6)?1:0,0);
......@@ -336,7 +336,7 @@ int rx_psbch(PHY_VARS_UE *ue,int frame_rx,int subframe_rx) {
for (int i=0; i<(PSBCH_A>>3); i++)
decoded_output[(PSBCH_A>>3)-i-1] = slbch_a[i];
LOG_I(PHY,"SFN.SF %d.%d SLBCH : %x.%x.%x.%x.%x\n",frame_rx,subframe_rx,decoded_output[0],decoded_output[1],decoded_output[2],decoded_output[3],decoded_output[4]);
if (ue->is_synchronizedSL==0) LOG_I(PHY,"SFN.SF %d.%d SLBCH : %x.%x.%x.%x.%x\n",frame_rx,subframe_rx,decoded_output[0],decoded_output[1],decoded_output[2],decoded_output[3],decoded_output[4]);
#ifdef DEBUG_PSBCH
LOG_I(PHY,"PSBCH CRC %x : %x\n",
......@@ -347,9 +347,11 @@ int rx_psbch(PHY_VARS_UE *ue,int frame_rx,int subframe_rx) {
uint16_t crc = (crc16(slbch_a,PSBCH_A)>>16) ^
(((uint16_t)slbch_a[PSBCH_A>>3]<<8)+slbch_a[(PSBCH_A>>3)+1]);
ue->slbch_rxops++;
if (crc>0) {
LOG_I(PHY,"SLBCH not received in %d.%d\n", frame_rx,subframe_rx);
ue->slbch_errors++;
return(-1);
}
else {
......
......@@ -1338,6 +1338,7 @@ typedef struct {
pthread_mutex_t sldch_mutex;
pthread_mutex_t slsch_mutex;
int slbch_errors;
int slbch_rxops;
//Paging parameters
uint32_t IMSImod1024;
uint32_t PF;
......
......@@ -4795,10 +4795,10 @@ void phy_procedures_UE_SL_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
proc->sl_fep_done = 0;
if (ue->is_SynchRef == 0 && (frame_rx&3) == 0 && subframe_rx == 0) rx_psbch(ue,frame_rx,subframe_rx);
rx_sldch(ue,proc,frame_rx,subframe_rx);
if (ue->is_SynchRef == 0 && frame_rx==0 && subframe_rx==0) LOG_I(PHY,"Connected with SyncRef UE (slbch errors %d/%d)\n",
ue->slbch_errors,ue->slbch_rxops);
}
......
......@@ -152,7 +152,7 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
LOG_I(MAC, "[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",
LOG_D(MAC, "[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",
Mod_idP, eNB_index);
if (tdd_Config != NULL) {
......
......@@ -609,7 +609,7 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
0);
}
else {
LOG_I(MAC, "[UE %d] Frame %d Sending MIBSL to RRC (LCID Id %d,len %d) : %x.%x.%x.%x.%x\n",
LOG_D(MAC, "[UE %d] Frame %d Sending MIBSL to RRC (LCID Id %d,len %d) : %x.%x.%x.%x.%x\n",
module_idP, frameP, MIBSLCH, 5, slss->slmib[0],slss->slmib[1],slss->slmib[2],slss->slmib[3],slss->slmib[4]);
mac_rrc_data_ind_ue(module_idP, CC_id, frameP, 0, // unknown subframe
......@@ -619,7 +619,7 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
// copy frame/subframe
*frame = UE_mac_inst[module_idP].directFrameNumber_r12;
*subframe = UE_mac_inst[module_idP].directSubframeNumber_r12;
LOG_I(MAC,"SL: Resetting SF.SFN to %d.%d\n",*frame,*subframe);
LOG_D(MAC,"SL: Resetting SF.SFN to %d.%d\n",*frame,*subframe);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_OUT);
......
......@@ -118,7 +118,7 @@ mac_rrc_data_req_ue(
else if (Srb_idP == MIBCH) {
int Ret_size = do_MIB_SL(&ctxt,eNB_indexP,frameP,0);
memcpy((void*)buffer_pP,(void*)UE_rrc_inst[Mod_idP].SL_MIB,Ret_size);
LOG_I(RRC,"MIB-SL for %d.%d: %x.%x.%x.%x.%x\n",frameP/10,frameP%10,buffer_pP[0],buffer_pP[1],buffer_pP[2],buffer_pP[3],buffer_pP[4]);
LOG_D(RRC,"MIB-SL for %d.%d: %x.%x.%x.%x.%x\n",frameP/10,frameP%10,buffer_pP[0],buffer_pP[1],buffer_pP[2],buffer_pP[3],buffer_pP[4]);
return(Ret_size);
}
......@@ -282,8 +282,8 @@ mac_rrc_data_ind_ue(
#ifdef Rel14
if (srb_idP == MIBSLCH) {
LOG_I(RRC,"[UE %d] Received SDU for MIBSL\n");
if (decode_MIB_SL(&ctxt,sduP,5)>=0) LOG_I(RRC,"Received MIB_SL: %x.%x.%x.%x.%x\n",sduP[0],sduP[1],sduP[2],sduP[3],sduP[4]);
LOG_D(RRC,"[UE %d] Received SDU for MIBSL\n");
if (decode_MIB_SL(&ctxt,sduP,5)>=0) LOG_D(RRC,"Received MIB_SL: %x.%x.%x.%x.%x\n",sduP[0],sduP[1],sduP[2],sduP[3],sduP[4]);
else LOG_E(RRC,"Received bogus MIB_SL\n");
}
......
......@@ -6274,7 +6274,7 @@ int decode_MIB_SL( const protocol_ctxt_t* const ctxt_pP,
return -1;
}
LOG_I(RRC,"Decoded MIBSL SFN.SF %d.%d, sl_Bandwidth_r12 %d, InCoverage %d\n",
LOG_D(RRC,"Decoded MIBSL SFN.SF %d.%d, sl_Bandwidth_r12 %d, InCoverage %d\n",
BIT_STRING_to_uint32(&UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.directFrameNumber_r12), // indicates that there is no update in the frame number
UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.directSubframeNumber_r12, // /indicates that there isno update in the subframe number
UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.sl_Bandwidth_r12,
......
......@@ -1774,6 +1774,8 @@ void *UE_threadSL(void *arg) {
else {
if (start_rx_stream==0 && UE->is_SynchRef == 0) {
start_rx_stream=1;
UE->slbch_errors=0;
UE->slbch_rxops=0;
if (UE->no_timing_correction==0) {
LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d), subframe_delay %d\n",UE->rx_offsetSL,UE->mode,subframe_delay);
AssertFatal(UE->rx_offsetSL ==
......
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