Commit 1fc396f5 authored by Raymond Knopp's avatar Raymond Knopp

Merge after bad rebase

Merge branch 'bugfix-48-L1L2signaling' of https://gitlab.eurecom.fr/oai/openairinterface5g into bugfix-48-L1L2signaling

Conflicts:
	openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
	openair1/SCHED/phy_procedures_lte_ue.c
	openair2/LAYER2/MAC/eNB_scheduler.c
	openair2/LAYER2/MAC/eNB_scheduler_RA.c
	openair2/LAYER2/MAC/eNB_scheduler_bch.c
	openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
	openair2/LAYER2/MAC/eNB_scheduler_primitives.c
	openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
	openair2/LAYER2/MAC/proto.h
	openair2/PHY_INTERFACE/defs.h
parents f48d10ba ccef9862
...@@ -2667,7 +2667,7 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -2667,7 +2667,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch1_harq->subframe = subframe; dlsch1_harq->subframe = subframe;
} }
#ifdef DEBUG_DCI //#ifdef DEBUG_DCI
if (dlsch0) { if (dlsch0) {
printf("dlsch0 eNB: dlsch0 %p\n",dlsch0); printf("dlsch0 eNB: dlsch0 %p\n",dlsch0);
...@@ -2683,7 +2683,7 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -2683,7 +2683,7 @@ int generate_eNB_dlsch_params_from_dci(int frame,
printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode); printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode);
} }
#endif //#endif
// compute DL power control parameters // compute DL power control parameters
computeRhoA_eNB(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off); computeRhoA_eNB(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off);
...@@ -5534,7 +5534,7 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -5534,7 +5534,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
} }
#ifdef DEBUG_DCI //#ifdef DEBUG_DCI
if (dlsch[0]) { if (dlsch[0]) {
printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti);
...@@ -5548,7 +5548,7 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -5548,7 +5548,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off);
} }
#endif //#endif
dlsch[0]->active=1; dlsch[0]->active=1;
// compute DL power control parameters // compute DL power control parameters
......
...@@ -671,6 +671,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -671,6 +671,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
// printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust); // printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
*llr32 = *rxF; *llr32 = *rxF;
// printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]); // printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
......
...@@ -241,19 +241,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -241,19 +241,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6) // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6)
// Schedule Normal DLSCH // Schedule Normal DLSCH
schedule_RA(module_idP,frameP,subframeP,2); schedule_RA(module_idP,frameP,subframeP,2);
if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD
schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag); schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag);
} else if ((mac_xface->lte_frame_parms->tdd_config == TDD) || //TDD } else if ((mac_xface->lte_frame_parms->tdd_config == TDD) || //TDD
(mac_xface->lte_frame_parms->tdd_config == 3) || (mac_xface->lte_frame_parms->tdd_config == 3) ||
(mac_xface->lte_frame_parms->tdd_config == 6)) { (mac_xface->lte_frame_parms->tdd_config == 6)) {
//schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag); //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag);
} }
schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
...@@ -283,7 +282,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -283,7 +282,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
schedule_ulsch(module_idP,frameP,cooperation_flag,1,5); schedule_ulsch(module_idP,frameP,cooperation_flag,1,5);
schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
} }
break; break;
...@@ -320,11 +318,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -320,11 +318,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
break; break;
} }
} else { //FDD } else { //FDD
schedule_ulsch(module_idP,frameP,cooperation_flag,3,7); schedule_ulsch(module_idP,frameP,cooperation_flag,3,7);
schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
} }
break; break;
...@@ -348,6 +345,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -348,6 +345,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// no break here! // no break here!
case 5: case 5:
schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
break; break;
...@@ -357,11 +355,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -357,11 +355,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
} }
} else { } else {
if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD
// schedule_RA(module_idP,frameP, subframeP, 0); // schedule_RA(module_idP,frameP, subframeP, 0);
schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8); schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8);
schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status);
fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_status); fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_status);
} }
} }
...@@ -380,7 +378,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -380,7 +378,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
schedule_ulsch(module_idP,frameP,cooperation_flag,5,9); schedule_ulsch(module_idP,frameP,cooperation_flag,5,9);
schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status);
fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
} else if ((mac_xface->lte_frame_parms->tdd_config == 0) || // TDD Config 0 } else if ((mac_xface->lte_frame_parms->tdd_config == 0) || // TDD Config 0
(mac_xface->lte_frame_parms->tdd_config == 6)) { // TDD Config 6 (mac_xface->lte_frame_parms->tdd_config == 6)) { // TDD Config 6
//schedule_ulsch(module_idP,cooperation_flag,subframeP); //schedule_ulsch(module_idP,cooperation_flag,subframeP);
......
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
#include "SIMULATION/TOOLS/defs.h" // for taus #include "SIMULATION/TOOLS/defs.h" // for taus
void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe) void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe)
{ {
......
...@@ -328,7 +328,6 @@ schedule_SI( ...@@ -328,7 +328,6 @@ schedule_SI(
eNB->eNB_stats[CC_id].bcch_mcs=mcs; eNB->eNB_stats[CC_id].bcch_mcs=mcs;
} else { } else {
//LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame); //LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame);
} }
} }
......
...@@ -471,7 +471,6 @@ schedule_ue_spec( ...@@ -471,7 +471,6 @@ schedule_ue_spec(
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
min_rb_unit[CC_id]=get_min_rb_unit(module_idP,CC_id); min_rb_unit[CC_id]=get_min_rb_unit(module_idP,CC_id);
frame_parms[CC_id] = mac_xface->get_lte_frame_parms(module_idP,CC_id); frame_parms[CC_id] = mac_xface->get_lte_frame_parms(module_idP,CC_id);
// get number of PRBs less those used by common channels // get number of PRBs less those used by common channels
total_nb_available_rb[CC_id] = frame_parms[CC_id]->N_RB_DL; total_nb_available_rb[CC_id] = frame_parms[CC_id]->N_RB_DL;
for (i=0;i<frame_parms[CC_id]->N_RB_DL;i++) for (i=0;i<frame_parms[CC_id]->N_RB_DL;i++)
......
...@@ -906,11 +906,14 @@ int get_nCCE_offset(int *CCE_table, ...@@ -906,11 +906,14 @@ int get_nCCE_offset(int *CCE_table,
// check CCE(0 ... L-1) // check CCE(0 ... L-1)
nb_candidates = (L==4) ? 4 : 2; nb_candidates = (L==4) ? 4 : 2;
nb_candidates = min(nb_candidates,nCCE/L); nb_candidates = min(nb_candidates,nCCE/L);
// printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L); // printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L);
for (m = nb_candidates-1 ; m >=0 ; m--) { for (m = nb_candidates-1 ; m >=0 ; m--) {
search_space_free = 1; search_space_free = 1;
for (l=0; l<L; l++) { for (l=0; l<L; l++) {
// printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]); // printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]);
if (CCE_table[(m*L) + l] == 1) { if (CCE_table[(m*L) + l] == 1) {
search_space_free = 0; search_space_free = 0;
...@@ -919,7 +922,9 @@ int get_nCCE_offset(int *CCE_table, ...@@ -919,7 +922,9 @@ int get_nCCE_offset(int *CCE_table,
} }
if (search_space_free == 1) { if (search_space_free == 1) {
// printf("returning %d\n",m*L); // printf("returning %d\n",m*L);
for (l=0; l<L; l++) for (l=0; l<L; l++)
CCE_table[(m*L)+l]=1; CCE_table[(m*L)+l]=1;
return(m*L); return(m*L);
...@@ -955,6 +960,7 @@ int get_nCCE_offset(int *CCE_table, ...@@ -955,6 +960,7 @@ int get_nCCE_offset(int *CCE_table,
break; break;
} }
LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates); LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates);
for (m = 0 ; m < nb_candidates ; m++) { for (m = 0 ; m < nb_candidates ; m++) {
...@@ -994,7 +1000,9 @@ int allocate_CCEs(int module_idP, ...@@ -994,7 +1000,9 @@ int allocate_CCEs(int module_idP,
int allocation_is_feasible = 1; int allocation_is_feasible = 1;
DCI_ALLOC_t *dci_alloc; DCI_ALLOC_t *dci_alloc;
LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
init_CCE_table(module_idP,CC_idP); init_CCE_table(module_idP,CC_idP);
DCI_pdu->nCCE=0; DCI_pdu->nCCE=0;
...@@ -1024,6 +1032,7 @@ int allocate_CCEs(int module_idP, ...@@ -1024,6 +1032,7 @@ int allocate_CCEs(int module_idP,
(i<DCI_pdu->Num_common_dci) ? 1 : 0, (i<DCI_pdu->Num_common_dci) ? 1 : 0,
dci_alloc->rnti, dci_alloc->rnti,
subframeP))>=0) {// the allocation is feasible, rnti rule passes subframeP))>=0) {// the allocation is feasible, rnti rule passes
LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); LOG_D(MAC,"Allocating at nCCE %d\n",fCCE);
if (test_onlyP == 0) { if (test_onlyP == 0) {
DCI_pdu->nCCE += (1<<dci_alloc->L); DCI_pdu->nCCE += (1<<dci_alloc->L);
......
...@@ -53,6 +53,7 @@ for the message. ...@@ -53,6 +53,7 @@ for the message.
@param Mod_id Instance ID of eNB @param Mod_id Instance ID of eNB
@param frame Frame index @param frame Frame index
@param subframe Subframe number on which to act @param subframe Subframe number on which to act
*/ */
void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe); void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe);
...@@ -122,6 +123,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,i ...@@ -122,6 +123,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,i
@param Mod_id Instance ID of eNB @param Mod_id Instance ID of eNB
@param frame Frame index @param frame Frame index
@param subframe Subframe on which to act @param subframe Subframe on which to act
@param mbsfn_flag Indicates that MCH/MCCH is in this subframe @param mbsfn_flag Indicates that MCH/MCCH is in this subframe
*/ */
void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag); void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag);
......
...@@ -238,7 +238,8 @@ typedef struct { ...@@ -238,7 +238,8 @@ typedef struct {
int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag); int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag);
/// Function to retrieve number of CCE /// Function to retrieve number of CCE
uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols ,int subframe); uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
int (*get_nCCE_offset)(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe); int (*get_nCCE_offset)(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe);
......
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