Commit 328681fd authored by Vaibhav Shrivastava's avatar Vaibhav Shrivastava Committed by jperaldi

Multi Cell fix after disabling fairRR and fix for CC mask

parent e7d5ed77
...@@ -276,7 +276,7 @@ MACRLCs = ( ...@@ -276,7 +276,7 @@ MACRLCs = (
remote_s_portd = 50010; remote_s_portd = 50010;
tr_s_preference = "nfapi"; tr_s_preference = "nfapi";
tr_n_preference = "local_RRC"; tr_n_preference = "local_RRC";
scheduler_mode = "fairRR"; #scheduler_mode = "fairRR";
} }
); );
......
...@@ -217,7 +217,7 @@ void oai_create_enb(void) { ...@@ -217,7 +217,7 @@ void oai_create_enb(void) {
RC.nb_CC[CC_id] = 2; RC.nb_CC[CC_id] = 2;
if (eNB->if_inst==0) { if (eNB->if_inst==0) {
eNB->if_inst = IF_Module_init(CC_id); eNB->if_inst = IF_Module_init(bodge_counter);
} }
// This will cause phy_config_request to be installed. That will result in RRC configuring the PHY // This will cause phy_config_request to be installed. That will result in RRC configuring the PHY
// that will result in eNB->configured being set to TRUE. // that will result in eNB->configured being set to TRUE.
...@@ -643,22 +643,24 @@ int phy_slot_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uin ...@@ -643,22 +643,24 @@ int phy_slot_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uin
int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uint16_t sfn_sf) { int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uint16_t sfn_sf) {
static uint8_t first_time = 1; static uint8_t first_time = 1;
if (first_time) { /* MultiCell: Function modify for Multiple CC */
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] subframe indication %d\n", NFAPI_SFNSF2DEC(sfn_sf)); for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
first_time = 0; if (first_time) {
} NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] subframe indication %d\n", NFAPI_SFNSF2DEC(sfn_sf));
first_time = 0;
}
if (RC.eNB && RC.eNB[0][0]->configured) { if (RC.eNB && RC.eNB[0][CC_id]->configured) {
uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf); uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf);
uint16_t sf = NFAPI_SFNSF2SF(sfn_sf); uint16_t sf = NFAPI_SFNSF2SF(sfn_sf);
//LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf); //LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf);
wake_eNB_rxtx(RC.eNB[0][0], sfn, sf); wake_eNB_rxtx(RC.eNB[0][CC_id], sfn, sf);
} else { } else {
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB); NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB);
if (RC.eNB) NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.eNB[0][0]->configured:%d\n", RC.eNB[0][0]->configured); if (RC.eNB) NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.eNB[0][CC_id]->configured:%d\n", RC.eNB[0][CC_id]->configured);
}
} }
return 0; return 0;
} }
......
...@@ -1248,110 +1248,112 @@ schedule_ulsch(module_id_t module_idP, ...@@ -1248,110 +1248,112 @@ schedule_ulsch(module_id_t module_idP,
start_meas(&(mac->schedule_ulsch)); start_meas(&(mac->schedule_ulsch));
sched_subframe = (subframeP + 4) % 10; sched_subframe = (subframeP + 4) % 10;
sched_frame = frameP; sched_frame = frameP;
cc = mac->common_channels;
/* For TDD: check subframes where we have to act and return if nothing should be done now */
if (cc->tdd_Config) { // Done only for CC_id = 0, assume tdd_Config for all CC_id
int tdd_sfa = cc->tdd_Config->subframeAssignment;
switch (subframeP) {
case 0:
if ((tdd_sfa == 0) || (tdd_sfa == 3))
sched_subframe = 4;
else if (tdd_sfa == 6)
sched_subframe = 7;
else
return;
break;
case 1: /* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */
if ((tdd_sfa == 0) || (tdd_sfa == 1)) for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++, cc++) {
sched_subframe = 7; /* MultiCell: Common channels modify for multiple CC */
else if (tdd_sfa == 6) cc = &RC.mac[module_idP]->common_channels[CC_id];
sched_subframe = 8;
else /* For TDD: check subframes where we have to act and return if nothing should be done now */
return; if (cc->tdd_Config) { // Done only for CC_id = 0, assume tdd_Config for all CC_id
int tdd_sfa = cc->tdd_Config->subframeAssignment;
switch (subframeP) {
case 0:
if ((tdd_sfa == 0) || (tdd_sfa == 3))
sched_subframe = 4;
else if (tdd_sfa == 6)
sched_subframe = 7;
else
return;
break; break;
case 2: // Don't schedule UL in subframe 2 for TDD case 1:
return; if ((tdd_sfa == 0) || (tdd_sfa == 1))
sched_subframe = 7;
else if (tdd_sfa == 6)
sched_subframe = 8;
else
return;
break;
case 3: case 2: // Don't schedule UL in subframe 2 for TDD
if (tdd_sfa == 2)
sched_subframe = 7;
else
return; return;
break; case 3:
if (tdd_sfa == 2)
sched_subframe = 7;
else
return;
case 4: break;
if (tdd_sfa == 1)
sched_subframe = 8;
else
return;
break; case 4:
if (tdd_sfa == 1)
sched_subframe = 8;
else
return;
case 5: break;
if (tdd_sfa == 0)
sched_subframe = 9;
else if (tdd_sfa == 6)
sched_subframe = 2;
else
return;
break; case 5:
if (tdd_sfa == 0)
sched_subframe = 9;
else if (tdd_sfa == 6)
sched_subframe = 2;
else
return;
case 6: break;
if (tdd_sfa == 0 || tdd_sfa == 1)
sched_subframe = 2;
else if (tdd_sfa == 6)
sched_subframe = 3;
else
return;
break; case 6:
if (tdd_sfa == 0 || tdd_sfa == 1)
sched_subframe = 2;
else if (tdd_sfa == 6)
sched_subframe = 3;
else
return;
case 7: break;
return;
case 8: case 7:
if ((tdd_sfa >= 2) && (tdd_sfa <= 5))
sched_subframe = 2;
else
return; return;
break; case 8:
if ((tdd_sfa >= 2) && (tdd_sfa <= 5))
sched_subframe = 2;
else
return;
case 9: break;
if ((tdd_sfa == 1) || (tdd_sfa == 3) || (tdd_sfa == 4))
sched_subframe = 3;
else if (tdd_sfa == 6)
sched_subframe = 4;
else
return;
break; case 9:
if ((tdd_sfa == 1) || (tdd_sfa == 3) || (tdd_sfa == 4))
sched_subframe = 3;
else if (tdd_sfa == 6)
sched_subframe = 4;
else
return;
default: break;
return;
default:
return;
}
} }
}
if (sched_subframe < subframeP) { if (sched_subframe < subframeP) {
sched_frame++; sched_frame++;
sched_frame %= 1024; sched_frame %= 1024;
} }
int emtc_active[5]; int emtc_active[5];
memset(emtc_active, 0, 5 * sizeof(int)); memset(emtc_active, 0, 5 * sizeof(int));
schedule_ulsch_rnti_emtc(module_idP, frameP, subframeP, sched_subframe, emtc_active); schedule_ulsch_rnti_emtc(module_idP, frameP, subframeP, sched_subframe, emtc_active);
/* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */
for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++, cc++) {
if (is_prach_subframe0(cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,cc->tdd_Config!=NULL ? 1 : 0, if (is_prach_subframe0(cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,cc->tdd_Config!=NULL ? 1 : 0,
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex, cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
sched_frame, sched_subframe)) { sched_frame, sched_subframe)) {
...@@ -1373,7 +1375,7 @@ schedule_ulsch(module_id_t module_idP, ...@@ -1373,7 +1375,7 @@ schedule_ulsch(module_id_t module_idP,
* - for 100: 3 RBs * - for 100: 3 RBs
* This is totally arbitrary and might even be wrong. * This is totally arbitrary and might even be wrong.
*/ */
switch (to_prb(cc[CC_id].ul_Bandwidth)) { switch (to_prb(cc->ul_Bandwidth)) {
case 25: case 25:
cc->vrb_map_UL[0] = 1; cc->vrb_map_UL[0] = 1;
cc->vrb_map_UL[24] = 1; cc->vrb_map_UL[24] = 1;
......
...@@ -720,14 +720,9 @@ void UL_indication(UL_IND_t *UL_info, void *proc) { ...@@ -720,14 +720,9 @@ void UL_indication(UL_IND_t *UL_info, void *proc) {
LOG_D(MAC,"current (%d,%d) frame count dl is %d\n",UL_info->frame,UL_info->subframe,frame_cnt); LOG_D(MAC,"current (%d,%d) frame count dl is %d\n",UL_info->frame,UL_info->subframe,frame_cnt);
} }
/* MultiCell: Condition Added for Multiple Cell */
if(ifi->CC_mask != 0) {
ifi->CC_mask = 0;
}
if (NFAPI_MODE != NFAPI_MODE_PNF) { if (NFAPI_MODE != NFAPI_MODE_PNF) {
/* MultiCell: Condition modified for Multiple CC */ /* MultiCell: Condition modified for Multiple CC */
if ((ifi->CC_mask==0)||(ifi->CC_mask==1)||(ifi->CC_mask==2)) { if ((ifi->CC_mask==0)||(ifi->CC_mask==1)||(ifi->CC_mask==2)||(ifi->CC_mask==3)) {
ifi->current_frame = UL_info->frame; ifi->current_frame = UL_info->frame;
ifi->current_subframe = UL_info->subframe; ifi->current_subframe = UL_info->subframe;
} else { } else {
...@@ -757,7 +752,7 @@ void UL_indication(UL_IND_t *UL_info, void *proc) { ...@@ -757,7 +752,7 @@ void UL_indication(UL_IND_t *UL_info, void *proc) {
if (NFAPI_MODE != NFAPI_MODE_PNF) { if (NFAPI_MODE != NFAPI_MODE_PNF) {
/* MultiCell: Condition modified for Multiple CC */ /* MultiCell: Condition modified for Multiple CC */
if ((ifi->CC_mask == ((1<<MAX_NUM_CCs)-3)) || (ifi->CC_mask == ((1<<MAX_NUM_CCs)-2))) { if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
eNB_dlsch_ulsch_scheduler(module_id, eNB_dlsch_ulsch_scheduler(module_id,
(UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024, (UL_info->frame+((UL_info->subframe>(9-sf_ahead))?1:0)) % 1024,
(UL_info->subframe+sf_ahead)%10); (UL_info->subframe+sf_ahead)%10);
......
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