Commit ba433236 authored by Raymond Knopp's avatar Raymond Knopp

SLDCH RX

parent 2646250f
......@@ -324,6 +324,15 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *phy_vars_eNB);
*/
int phy_init_secsys_eNB(PHY_VARS_eNB *phy_vars_eNb);
/*!
\fn void phy_config_SL(int Mod_id,SLDCH_t *sldch_rx,SLSCH_t *slsch_rx)
\brief Configure PHY Sidelink parameters .
@param Mod_id
@param sldch_rx Sidelink discovery channel configuration
@param slsch_rx Sidelink Control/Shared channel configuration
*/
int phy_config_SL(int Mod_id,SLDCH_t *sldch_rx,SLSCH_t *slsch_rx);
void free_lte_top(void);
void init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms);
......
......@@ -627,6 +627,16 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
}
}
int phy_config_SL(int Mod_id,SLDCH_t *sldch_rx,SLSCH_t *slsch_rx) {
PHY_VARS_UE *ue=PHY_vars_UE_g[Mod_id][0];
memcpy((void*)&ue->sldch_rx,(void*)sldch_rx,sizeof(SLDCH_t));
memcpy((void*)&ue->slsch_rx,(void*)slsch_rx,sizeof(SLSCH_t));
return(0);
}
int init_lte_ue_signal(PHY_VARS_UE *ue,
int nb_connected_eNB,
uint8_t abstraction_flag)
......
This diff is collapsed.
......@@ -784,7 +784,7 @@ void generate_slsch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,SLSCH_t *slsch,int fram
}
void pscch_decoding(PHY_VARS_UE *ue,int frame_rx,int subframe_rx,int a,int slot) {
void pscch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subframe_rx,int a,int slot) {
int Nsymb = 7 - slot;
SLSCH_t *slsch = &ue->slsch_rx;
......@@ -809,7 +809,7 @@ void pscch_decoding(PHY_VARS_UE *ue,int frame_rx,int subframe_rx,int a,int slot)
else nprb = slsch->prb_End_SC-(slsch->N_SL_RB_SC>>1)+amod;
// slot FEP
if (ue->sl_fep_done == 0) {
if (proc->sl_fep_done == 0) {
RU_t ru_tmp;
memset((void*)&ru_tmp,0,sizeof(RU_t));
......@@ -1068,7 +1068,7 @@ void pscch_decoding(PHY_VARS_UE *ue,int frame_rx,int subframe_rx,int a,int slot)
}
void rx_slcch(PHY_VARS_UE *ue,int frame_rx,int subframe_rx) {
void rx_slcch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subframe_rx) {
AssertFatal(frame_rx<1024 && frame_rx>=0,"frame %d is illegal\n",frame_rx);
AssertFatal(subframe_rx<10 && subframe_rx>=0,"subframe %d is illegal\n",subframe_rx);
......@@ -1118,8 +1118,8 @@ void rx_slcch(PHY_VARS_UE *ue,int frame_rx,int subframe_rx) {
uint32_t b1=slsch->n_pscch%LPSCCH;
uint32_t b2=(slsch->n_pscch + 1 + (a1%(LPSCCH-1)))%LPSCCH;
if (absSF_modP == b1) pscch_decoding(ue,frame_rx,subframe_rx,a1,0);
else if (absSF_modP == b2) pscch_decoding(ue,frame_rx,subframe_rx,a2,1);
if (absSF_modP == b1) pscch_decoding(ue,proc,frame_rx,subframe_rx,a1,0);
else if (absSF_modP == b2) pscch_decoding(ue,proc,frame_rx,subframe_rx,a2,1);
else return;
......@@ -1143,8 +1143,8 @@ void slsch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra
LOG_I(PHY,"slsch_decoding %d.%d => lmod10 %d\n",frame_rx,subframe_rx,ljmod10);
// slot FEP
if (ue->sl_fep_done == 0) {
ue->sl_fep_done = 1;
if (proc->sl_fep_done == 0) {
proc->sl_fep_done = 1;
RU_t ru_tmp;
memset((void*)&ru_tmp,0,sizeof(RU_t));
......
......@@ -625,6 +625,8 @@ typedef struct {
int sub_frame_start;
int sub_frame_step;
unsigned long long gotIQs;
/// indicator that slot_fep has been done for subframe (for sidelink)
int sl_fep_done;
} UE_rxtx_proc_t;
/// Context data structure for eNB subframe processing
......@@ -1299,7 +1301,6 @@ typedef struct {
// This is for SIC in the UE, to store the reencoded data
LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX];
// Sidelink-specific variables
int sl_fep_done;
SL_chan_t sl_chan;
LTE_eNB_DLSCH_t *dlsch_slsch;
LTE_UE_ULSCH_t *ulsch_slsch;
......@@ -1331,6 +1332,7 @@ typedef struct {
uint32_t slsch_errors;
uint32_t slsch_rxcnt[4];
SLDCH_t *sldch;
SLDCH_t sldch_rx;
int sldch_sdu_active;
pthread_mutex_t slss_mutex;
pthread_mutex_t sldch_mutex;
......
......@@ -4793,7 +4793,11 @@ void phy_procedures_UE_SL_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
LOG_D(PHY,"SFN.SF %d.%d Running Steady-state SL UE procedures\n",frame_rx,subframe_rx);
if ((frame_rx&3) == 0 && subframe_rx == 0) rx_psbch(ue,frame_rx,subframe_rx);
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);
}
......
......@@ -740,6 +740,7 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
/// Number of retransmissions (numRetx-r12)
UE_mac_inst[Mod_idP].sldch.numRetx = discrxpool->numRetx_r13;
phy_config_SL(Mod_idP,&UE_mac_inst[Mod_idP].sldch,&UE_mac_inst[Mod_idP].slsch);
}
if (directFrameNumber_r12<1025) UE_mac_inst[Mod_idP].directFrameNumber_r12 = directFrameNumber_r12;
......
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