From db9f855b3b5509020504ba2e7e63789e30ee7699 Mon Sep 17 00:00:00 2001 From: khalidhamdy Date: Tue, 15 Aug 2017 11:48:29 +0200 Subject: [PATCH] add UEspec mpdcch search space subframe rule --- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 4 +- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 37 +++---------------- .../LAYER2/MAC/eNB_scheduler_primitives.c | 15 +++++++- openair2/LAYER2/MAC/proto.h | 2 +- 4 files changed, 21 insertions(+), 37 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 88ee3d14ae..0dd607b7da 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -212,7 +212,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg2_narrowband); if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && - (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){ + (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){ // MPDCCH configuration for RAR @@ -558,7 +558,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg34_narrowband); if ((RA_template->msg4_mpdcch_repetition_cnt == 0) && - (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2)>0)){ + (mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){ // MPDCCH configuration for RAR memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t)); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index a03ec0b3f9..7122ae3baf 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -416,14 +416,14 @@ set_ul_DAI( void getRepetition(UE_TEMPLATE * pue_template,unsigned int *maxRep , unsigned int *narrowBandindex, unsigned int *first_rb){ EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11; - AssertFatal(pue_template->physicalConfigDedicated, "no RRC physical configuration for this UE ") ; - AssertFatal(pue_template->physicalConfigDedicated->ext4, "no RRC physical configuration for this UE ") ; + AssertFatal(pue_template->physicalConfigDedicated !=NULL, "no RRC physical configuration for this UE ") ; + AssertFatal(pue_template->physicalConfigDedicated->ext4 !=NULL, "no RRC physical configuration for this UE ") ; AssertFatal(pue_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.count > 0 ,"epdcch config list is empty") ; epdcch_setconfig_r11 = pue_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0] ; - AssertFatal(epdcch_setconfig_r11->ext2 && epdcch_setconfig_r11->ext2->mpdcch_config_r13 ," mpdcch config not found") ; + AssertFatal(epdcch_setconfig_r11->ext2 !=NULL && epdcch_setconfig_r11->ext2->mpdcch_config_r13 !=NULL," mpdcch config not found") ; *maxRep = epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_NumRepetition_r13 ; @@ -431,33 +431,6 @@ void getRepetition(UE_TEMPLATE * pue_template,unsigned int *maxRep , unsigned i -/* - epdcch_setconfig_r11->setConfigId_r11 = 0; - epdcch_setconfig_r11->transmissionType_r11 = EPDCCH_SetConfig_r11__transmissionType_r11_localised; - epdcch_setconfig_r11->resourceBlockAssignment_r11.numberPRB_Pairs_r11 = EPDCCH_SetConfig_r11__resourceBlockAssignment_r11__numberPRB_Pairs_r11_n2; - //epdcch_setconfig_r11->resourceBlockAssignment_r11.resourceBlockAssignment_r11 = calloc(0, sizeof(BIT_STRING_t)); - epdcch_setconfig_r11->resourceBlockAssignment_r11.resourceBlockAssignment_r11.buf = calloc(0, 2 * sizeof(uint8_t)); - epdcch_setconfig_r11->resourceBlockAssignment_r11.resourceBlockAssignment_r11.size = 2; - epdcch_setconfig_r11->resourceBlockAssignment_r11.resourceBlockAssignment_r11.bits_unused = 6; - epdcch_setconfig_r11->resourceBlockAssignment_r11.resourceBlockAssignment_r11.buf[0] = 0x0E; - - epdcch_setconfig_r11->dmrs_ScramblingSequenceInt_r11 = 0; - epdcch_setconfig_r11->pucch_ResourceStartOffset_r11 = 0; - epdcch_setconfig_r11->re_MappingQCL_ConfigId_r11 = NULL; - - epdcch_setconfig_r11->ext2 = calloc(1, sizeof(struct EPDCCH_SetConfig_r11__ext2)); - epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310 = NULL; - epdcch_setconfig_r11->ext2->mpdcch_config_r13 = calloc(1, sizeof(struct EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13)); - epdcch_setconfig_r11->ext2->mpdcch_config_r13->present = EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13_PR_setup; - epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.csi_NumRepetitionCE_r13 = EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__csi_NumRepetitionCE_r13_sf1; - epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13 = EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_pdsch_HoppingConfig_r13_off; - epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.present = EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_StartSF_UESS_r13_PR_fdd_r13; - epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_StartSF_UESS_r13.choice.fdd_r13 = EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_StartSF_UESS_r13__fdd_r13_v1; - epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_NumRepetition_r13 = EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_NumRepetition_r13_r1; - epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13 = 3; - ASN_SEQUENCE_ADD(physicalConfigDedicated2->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11, epdcch_setconfig_r11); - - */ } @@ -778,7 +751,7 @@ schedule_ue_spec_br( vrb_map[first_rb + 5] = 1; if ((UE_list->UE_template[CC_id][UE_id].mpdcch_repetition_cnt == 0) && - (mpdcch_sf_condition(eNB, CC_id, frameP, subframeP, rmax, TYPEUESPEC) > 0)) + (mpdcch_sf_condition(eNB, CC_id, frameP, subframeP, rmax, TYPEUESPEC,UE_id) > 0)) { // MPDCCH configuration for RAR dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; @@ -1393,7 +1366,7 @@ schedule_ue_spec_br( vrb_map[first_rb + 5] = 1; if ((UE_list->UE_template[CC_id][UE_id].mpdcch_repetition_cnt == 0) && - (mpdcch_sf_condition(eNB, CC_id, frameP, subframeP, rmax, TYPEUESPEC) > 0)) + (mpdcch_sf_condition(eNB, CC_id, frameP, subframeP, rmax, TYPEUESPEC,UE_id) > 0)) { // MPDCCH configuration for RAR dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 9fa7c16868..a8418d2316 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -486,9 +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; + + EPDCCH_SetConfig_r11_t *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] ; + + int T; switch (mpdcch_type) { @@ -513,7 +517,14 @@ 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"); + 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); diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 1a7421c7e7..85eaca5b21 100755 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -905,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);