Commit 73560827 authored by Raymond Knopp's avatar Raymond Knopp

added narrowband to first rb maping for L2

parent 828077c2
...@@ -209,7 +209,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t ...@@ -209,7 +209,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// get narrowband according to higher-layer config // get narrowband according to higher-layer config
num_nb = p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.count; num_nb = p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.count;
RA_template->msg2_narrowband = *p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.array[RA_template->preamble_index%num_nb]; RA_template->msg2_narrowband = *p[RA_template->rach_resource_type-1]->mpdcch_NarrowbandsToMonitor_r13.list.array[RA_template->preamble_index%num_nb];
first_rb = RA_template->msg2_narrowband*6; first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg2_narrowband);
if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && 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)>0)){
...@@ -555,7 +555,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t ...@@ -555,7 +555,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// get actual repetition count from Table 9.1.5-3 // get actual repetition count from Table 9.1.5-3
reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep)); reps = (rmax<=8)?(1<<rep):(rmax>>(3-rep));
// get first narrowband // get first narrowband
first_rb = RA_template->msg34_narrowband*6; first_rb = narrowband_to_first_rb(&cc[CC_idP],RA_template->msg34_narrowband);
if ((RA_template->msg4_mpdcch_repetition_cnt == 0) && 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)>0)){
......
...@@ -199,7 +199,9 @@ schedule_SIB1_BR( ...@@ -199,7 +199,9 @@ schedule_SIB1_BR(
LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length);
// allocate all 6 PRBs in narrowband for SIB1_BR // allocate all 6 PRBs in narrowband for SIB1_BR
first_rb = n_NB*6;
first_rb = narrowband_to_first_rb(cc,n_NB);
vrb_map[first_rb] = 1; vrb_map[first_rb] = 1;
vrb_map[first_rb+1] = 1; vrb_map[first_rb+1] = 1;
vrb_map[first_rb+2] = 1; vrb_map[first_rb+2] = 1;
...@@ -383,7 +385,7 @@ schedule_SI_BR( ...@@ -383,7 +385,7 @@ schedule_SI_BR(
LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length); LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length);
// allocate all 6 PRBs in narrowband for SIB1_BR // allocate all 6 PRBs in narrowband for SIB1_BR
first_rb = si_Narrowband_r13*6; first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13);
vrb_map[first_rb] = 1; vrb_map[first_rb] = 1;
vrb_map[first_rb+1] = 1; vrb_map[first_rb+1] = 1;
vrb_map[first_rb+2] = 1; vrb_map[first_rb+2] = 1;
......
...@@ -524,7 +524,35 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t ...@@ -524,7 +524,35 @@ int mpdcch_sf_condition(eNB_MAC_INST *eNB,int CC_id, frame_t frameP,sub_frame_t
} }
int narrowband_to_first_rb(COMMON_channels_t *cc, int nb_index) {
switch (cc->mib->message.dl_Bandwidth) {
case 0: // 6 PRBs, N_NB=1, i_0=0
return(0);
break;
case 3: // 50 PRBs, N_NB=8, i_0=1
return((int)(1+(6*nb_index)));
break;
case 5: // 100 PRBs, N_NB=16, i_0=2
return((int)(2+(6*nb_index)));
break;
case 1: // 15 PRBs N_NB=2, i_0=1
if (nb_index>0) return(1);
else return(0);
break;
case 2: // 25 PRBs, N_NB=4, i_0=0
if (nb_index>1) return(1+(6*nb_index));
else return((6*nb_index));
break;
case 4: // 75 PRBs, N_NB=12, i_0=1
if (nb_index>5) return(2+(6*nb_index));
else return(1+(6*nb_index));
break;
default:
AssertFatal(1==0,"Impossible dl_Bandwidth %d\n",cc->mib->message.dl_Bandwidth);
break;
}
}
#endif #endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
...@@ -904,6 +904,9 @@ int get_numnarrowbandbits(long dl_Bandwidth); ...@@ -904,6 +904,9 @@ 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 get_numnarrowbands(long dl_Bandwidth); int get_numnarrowbands(long dl_Bandwidth);
int narrowband_to_first_rb(COMMON_channels_t *cc, int nb_index);
#endif #endif
......
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