integration step 1, breaks in SIB2 generation in L1 (lte-segmentation.c)
This commit is contained in:
@@ -514,7 +514,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
|
||||
if (Ncb>(3*(RTC<<5)))
|
||||
AssertFatal(1==0,"Exiting, RM condition (Ncb %d, RTC %d, Nir/C %d, Nsoft %d, Kw %d)\n",Ncb,RTC,Nir/C,Nsoft,3*(RTC<<5));
|
||||
|
||||
|
||||
AssertFatal(Nl>0,"Nl is 0\n");
|
||||
AssertFatal(Qm>0,"Qm is 0\n");
|
||||
Gp = G/Nl/Qm;
|
||||
GpmodC = Gp%C;
|
||||
|
||||
@@ -720,6 +721,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
|
||||
Ncb = 3*(RTC<<5);
|
||||
}
|
||||
|
||||
AssertFatal(Nl>0,"Nl is 0\n");
|
||||
AssertFatal(Qm>0,"Qm is 0\n");
|
||||
Gp = G/Nl/Qm;
|
||||
GpmodC = Gp%C;
|
||||
|
||||
|
||||
@@ -123,6 +123,9 @@ int lte_segmentation(unsigned char *input_buffer,
|
||||
}
|
||||
|
||||
|
||||
AssertFatal(Bprime <= (*Cplus)*(*Kplus) + (*Cminus)*(*Kminus),
|
||||
"Bprime %d < (*Cplus %d)*(*Kplus %d) + (*Cminus %d)*(*Kminus %d)\n",
|
||||
Bprime,*Cplus,*Kplus,*Cminus,*Kminus);
|
||||
|
||||
*F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime));
|
||||
#ifdef DEBUG_SEGMENTATION
|
||||
|
||||
@@ -1018,7 +1018,7 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
|
||||
else dlsch1_harq->pdu = sdu;
|
||||
|
||||
#ifdef Rel14
|
||||
if ((rel13->pdsch_payload_type == 0) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR
|
||||
if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR
|
||||
// configure PDSCH
|
||||
switch (eNB->frame_parms.N_RB_DL) {
|
||||
case 6:
|
||||
@@ -1048,8 +1048,8 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
|
||||
|
||||
dlsch0_harq->nb_rb = 6;
|
||||
dlsch0_harq->vrb_type = LOCALIZED;
|
||||
dlsch0_harq->rvidx = 0;
|
||||
dlsch0_harq->Nl = 0;
|
||||
dlsch0_harq->rvidx = rel8->redundancy_version;
|
||||
dlsch0_harq->Nl = 1;
|
||||
dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI;
|
||||
dlsch0_harq->dl_power_off = 1;
|
||||
dlsch0_harq->round = 0;
|
||||
|
||||
@@ -566,7 +566,8 @@ void RCconfig_RU() {
|
||||
|
||||
|
||||
if ( !(
|
||||
config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower)
|
||||
config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) &&
|
||||
config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RXGAIN, &max_rxgain)
|
||||
)
|
||||
) {
|
||||
AssertFatal (0,
|
||||
@@ -575,8 +576,6 @@ void RCconfig_RU() {
|
||||
continue;
|
||||
}
|
||||
|
||||
>>>>>>> faa111ecc0815354979e075d5b83c5af107d404e
|
||||
|
||||
AssertFatal((setting_band = config_setting_get_member(setting_ru, CONFIG_STRING_RU_BAND_LIST))!=NULL,"No allowable LTE bands\n");
|
||||
|
||||
if (setting_band != NULL) num_bands = config_setting_length(setting_band);
|
||||
@@ -2568,12 +2567,13 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
|
||||
for (sched_info_idx = 0; sched_info_idx < num_scheduling_info; ++sched_info_idx)
|
||||
{
|
||||
scheduling_info_br = config_setting_get_elem(scheduling_info_br_list, sched_info_idx);
|
||||
if (! config_setting_lookup_int(scheduling_info_br, ENB_CONFIG_STRING_SI_NARROWBAND_R13, &si_Narrowband_r13)
|
||||
&& config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_SI_TBS_R13, &si_TBS_r13)
|
||||
)
|
||||
{
|
||||
AssertFatal (0, "Failed to parse eNB configuration file %s, scheduking info br %d!\n", RC.config_file_name, nb_cc++);
|
||||
}
|
||||
if (!(
|
||||
config_setting_lookup_int(scheduling_info_br, ENB_CONFIG_STRING_SI_NARROWBAND_R13, &si_Narrowband_r13)
|
||||
&& config_setting_lookup_int(scheduling_info_br, ENB_CONFIG_STRING_SI_TBS_R13, &si_TBS_r13)
|
||||
)
|
||||
){
|
||||
AssertFatal (0, "Failed to parse eNB configuration file %s, scheduking info br %d!\n", RC.config_file_name, nb_cc++);
|
||||
}
|
||||
RRC_CONFIGURATION_REQ (msg_p).si_Narrowband_r13[j][sched_info_idx] = si_Narrowband_r13;
|
||||
RRC_CONFIGURATION_REQ (msg_p).si_TBS_r13[j][sched_info_idx] = si_TBS_r13;
|
||||
}
|
||||
@@ -3767,6 +3767,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
|
||||
|
||||
if (config_setting_lookup_string(setting_br13, ENB_CONFIG_STRING_BRAccessRelatedInfo, &bandwidthReducedAccessRelatedInfo_r13) && !strcmp(bandwidthReducedAccessRelatedInfo_r13, "ENABLE"))
|
||||
{
|
||||
printf("Enabling BR access SI scheduling parameters\n");
|
||||
RRC_CONFIGURATION_REQ(msg_p).bandwidthReducedAccessRelatedInfo_r13[j] = TRUE;
|
||||
if (!config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_SI_WINDOWLENGTH_BR, &si_WindowLength_BR_r13) ||
|
||||
!config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_SI_REPETITIONPATTERN, &si_RepetitionPattern_r13) ||
|
||||
|
||||
@@ -527,6 +527,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
|
||||
}
|
||||
#ifdef Rel14
|
||||
if (sib1_v13ext != NULL) {
|
||||
LOG_I(MAC,"[CONFIG] Retrieved sib1_v13ext\n");
|
||||
RC.mac[Mod_idP]->common_channels[CC_idP].sib1_v13ext = sib1_v13ext;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -176,6 +176,7 @@ schedule_SIB1_BR(
|
||||
|
||||
n_NB = Sj[((cc->physCellId % N_S_NB) + (i*N_S_NB/m))%N_S_NB];
|
||||
|
||||
if ((frameP%1000) < 40) LOG_D(MAC,"[eNB %d] Frame %d, subframe %d : BCCH_BR->DLSCH (SIB1) CC_id %d\n",module_idP,frameP,subframeP,CC_id);
|
||||
|
||||
bcch_sdu_length = mac_rrc_data_req(module_idP,
|
||||
CC_id,
|
||||
@@ -189,98 +190,98 @@ schedule_SIB1_BR(
|
||||
AssertFatal(cc->mib->message.schedulingInfoSIB1_BR_r13<19,"schedulingInfoSIB1_BR_r13 %d > 18\n",
|
||||
(int)cc->mib->message.schedulingInfoSIB1_BR_r13);
|
||||
|
||||
AssertFatal(bcch_sdu_length>0,"RRC returned 0 bytes for SIB1-BR\n");
|
||||
|
||||
TBS = SIB1_BR_TBS_table[(cc->mib->message.schedulingInfoSIB1_BR_r13-1)/3]>>3;
|
||||
|
||||
AssertFatal(bcch_sdu_length <= TBS, "length returned by RRC is not compatible with the TBS %d from MIB\n",TBS);
|
||||
AssertFatal(bcch_sdu_length <= TBS, "length returned by RRC %d is not compatible with the TBS %d from MIB\n",bcch_sdu_length,TBS);
|
||||
|
||||
if (bcch_sdu_length > 0) {
|
||||
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
|
||||
first_rb = n_NB*6;
|
||||
vrb_map[first_rb] = 1;
|
||||
vrb_map[first_rb+1] = 1;
|
||||
vrb_map[first_rb+2] = 1;
|
||||
vrb_map[first_rb+3] = 1;
|
||||
vrb_map[first_rb+4] = 1;
|
||||
vrb_map[first_rb+5] = 1;
|
||||
if ((frameP%1000) < 40) LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH (SIB1) CC_id %d, Received %d bytes for NB %d\n",module_idP,frameP,CC_id,bcch_sdu_length,n_NB);
|
||||
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu));
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = TBS;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = rvidx;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
|
||||
// Rel13 fields
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0; // SIB1-BR
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF
|
||||
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
|
||||
dl_req->number_pdu++;
|
||||
|
||||
// Program TX Request
|
||||
TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
|
||||
TX_req->pdu_length = bcch_sdu_length;
|
||||
TX_req->pdu_index = eNB->pdu_index[CC_id]++;
|
||||
TX_req->num_segments = 1;
|
||||
TX_req->segments[0].segment_length = bcch_sdu_length;
|
||||
TX_req->segments[0].segment_data = cc->BCCH_BR_pdu[0].payload;
|
||||
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
|
||||
// allocate all 6 PRBs in narrowband for SIB1_BR
|
||||
first_rb = n_NB*6;
|
||||
vrb_map[first_rb] = 1;
|
||||
vrb_map[first_rb+1] = 1;
|
||||
vrb_map[first_rb+2] = 1;
|
||||
vrb_map[first_rb+3] = 1;
|
||||
vrb_map[first_rb+4] = 1;
|
||||
vrb_map[first_rb+5] = 1;
|
||||
|
||||
|
||||
if (opt_enabled == 1) {
|
||||
trace_pdu(1,
|
||||
&cc->BCCH_BR_pdu[0].payload[0],
|
||||
bcch_sdu_length,
|
||||
0xffff,
|
||||
4,
|
||||
0xffff,
|
||||
eNB->frame,
|
||||
eNB->subframe,
|
||||
0,
|
||||
0);
|
||||
LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n",
|
||||
module_idP, frameP, CC_id, 0xffff, bcch_sdu_length);
|
||||
}
|
||||
if (cc->tdd_Config!=NULL) { //TDD
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (TDD) for CC_id %d SIB1-BR %d bytes\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
bcch_sdu_length);
|
||||
} else {
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (FDD) for CC_id %d SIB1-BR %d bytes\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
bcch_sdu_length);
|
||||
}
|
||||
} else {
|
||||
|
||||
//LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame);
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu));
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.length = TBS;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,6);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = rvidx;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
|
||||
// Rel13 fields
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0; // SIB1-BR
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF
|
||||
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
|
||||
dl_req->number_pdu++;
|
||||
|
||||
// Program TX Request
|
||||
TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
|
||||
TX_req->pdu_length = bcch_sdu_length;
|
||||
TX_req->pdu_index = eNB->pdu_index[CC_id]++;
|
||||
TX_req->num_segments = 1;
|
||||
TX_req->segments[0].segment_length = bcch_sdu_length;
|
||||
TX_req->segments[0].segment_data = cc->BCCH_BR_pdu[0].payload;
|
||||
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
|
||||
|
||||
|
||||
if (opt_enabled == 1) {
|
||||
trace_pdu(1,
|
||||
&cc->BCCH_BR_pdu[0].payload[0],
|
||||
bcch_sdu_length,
|
||||
0xffff,
|
||||
4,
|
||||
0xffff,
|
||||
eNB->frame,
|
||||
eNB->subframe,
|
||||
0,
|
||||
0);
|
||||
LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n",
|
||||
module_idP, frameP, CC_id, 0xffff, bcch_sdu_length);
|
||||
}
|
||||
if (cc->tdd_Config!=NULL) { //TDD
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (TDD) for CC_id %d SIB1-BR %d bytes\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
bcch_sdu_length);
|
||||
} else {
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH-BR 0->DLSCH (FDD) for CC_id %d SIB1-BR %d bytes\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
bcch_sdu_length);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -360,7 +361,12 @@ schedule_SI_BR(
|
||||
int period_in_sf = 80<<si_Periodicity; // 2^i * 80 subframes, note: si_Periodicity is 2^i * 80ms
|
||||
int sf_mod_period = ((frameP*10)+subframeP)%period_in_sf;
|
||||
|
||||
|
||||
rvidx = (((3*sf_mod_period)>>1) + (sf_mod_period&1))&3;
|
||||
|
||||
if ((frameP%1000) < 200) LOG_I(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH (SI) CC_id %d, rvidx %d (sf_mod_period %d : si_WindowLength_BR_r13 %d : si_RepetitionPattern_r13 %d\n",
|
||||
module_idP,frameP,CC_id,si_Narrowband_r13,rvidx,
|
||||
sf_mod_period,si_WindowLength_BR_r13,si_RepetitionPattern_r13);
|
||||
|
||||
if ((sf_mod_period < si_WindowLength_BR_r13) &&
|
||||
((frameP&(((1<<si_RepetitionPattern_r13)-1)))==0)) { // this SIB is to be scheduled
|
||||
@@ -374,13 +380,16 @@ schedule_SI_BR(
|
||||
module_idP,
|
||||
0); // not used in this case
|
||||
|
||||
AssertFatal(bcch_sdu_length>0,"RRC returned 0 bytes for SI-BR %d\n",i);
|
||||
|
||||
if (bcch_sdu_length > 0) {
|
||||
AssertFatal(bcch_sdu_length <= (si_TBS_r13>>3),
|
||||
"RRC provided bcch with length %d > %d\n",
|
||||
bcch_sdu_length,(int)(si_TBS_r13>>3));
|
||||
"RRC provided bcch with length %d > %d (si_TBS_r13 %d)n",
|
||||
bcch_sdu_length,(int)(si_TBS_r13>>3),schedulingInfoList_BR_r13->list.array[i]->si_TBS_r13);
|
||||
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);
|
||||
|
||||
|
||||
if ((frameP%1000) < 200) LOG_I(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH (SI) CC_id %d, Received %d bytes for NB %d/rvidx %d\n",module_idP,frameP,CC_id,bcch_sdu_length,si_Narrowband_r13,rvidx);
|
||||
|
||||
// allocate all 6 PRBs in narrowband for SIB1_BR
|
||||
first_rb = si_Narrowband_r13*6;
|
||||
vrb_map[first_rb] = 1;
|
||||
@@ -504,6 +513,8 @@ void schedule_mib(module_id_t module_idP,
|
||||
LOG_D(MAC,"Frame %d, subframe %d: Adding BCH PDU in position %d (length %d)\n",
|
||||
frameP,subframeP,dl_req->number_pdu,mib_sdu_length);
|
||||
|
||||
if ((frameP&1023) < 40) LOG_I(MAC,"[eNB %d] Frame %d : MIB->BCH CC_id %d, Received %d bytes (cc->mib->message.schedulingInfoSIB1_BR_r13 %d)\n",module_idP,frameP,CC_id,mib_sdu_length,cc->mib->message.schedulingInfoSIB1_BR_r13);
|
||||
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_BCH_PDU_TYPE,
|
||||
@@ -553,190 +564,196 @@ schedule_SI(
|
||||
|
||||
start_meas(&eNB->schedule_si);
|
||||
|
||||
// Only schedule System Information in subframe 5
|
||||
if (subframeP != 5) return;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
cc = &eNB->common_channels[CC_id];
|
||||
vrb_map = (void*)&cc->vrb_map;
|
||||
N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth);
|
||||
dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
|
||||
|
||||
|
||||
bcch_sdu_length = mac_rrc_data_req(module_idP,
|
||||
CC_id,
|
||||
frameP,
|
||||
BCCH,1,
|
||||
&cc->BCCH_pdu.payload[0],
|
||||
1,
|
||||
module_idP,
|
||||
0); // not used in this case
|
||||
|
||||
if (bcch_sdu_length > 0) {
|
||||
LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length);
|
||||
|
||||
// Allocate 4 PRBs in a random location
|
||||
/*
|
||||
while (1) {
|
||||
first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL-4));
|
||||
if ((vrb_map[first_rb] != 1) &&
|
||||
(vrb_map[first_rb+1] != 1) &&
|
||||
(vrb_map[first_rb+2] != 1) &&
|
||||
(vrb_map[first_rb+3] != 1))
|
||||
break;
|
||||
}
|
||||
*/
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
first_rb = 0;
|
||||
break;
|
||||
case 15:
|
||||
first_rb = 6;
|
||||
break;
|
||||
case 25:
|
||||
first_rb = 11;
|
||||
break;
|
||||
case 50:
|
||||
first_rb = 23;
|
||||
break;
|
||||
case 100:
|
||||
first_rb = 48;
|
||||
break;
|
||||
}
|
||||
|
||||
vrb_map[first_rb] = 1;
|
||||
vrb_map[first_rb+1] = 1;
|
||||
vrb_map[first_rb+2] = 1;
|
||||
vrb_map[first_rb+3] = 1;
|
||||
|
||||
// Get MCS for length of SI, 3 PRBs
|
||||
if (bcch_sdu_length <= 7) {
|
||||
mcs=0;
|
||||
} else if (bcch_sdu_length <= 11) {
|
||||
mcs=1;
|
||||
} else if (bcch_sdu_length <= 18) {
|
||||
mcs=2;
|
||||
} else if (bcch_sdu_length <= 22) {
|
||||
mcs=3;
|
||||
} else if (bcch_sdu_length <= 26) {
|
||||
mcs=4;
|
||||
} else if (bcch_sdu_length <= 28) {
|
||||
mcs=5;
|
||||
} else if (bcch_sdu_length <= 32) {
|
||||
mcs=6;
|
||||
} else if (bcch_sdu_length <= 41) {
|
||||
mcs=7;
|
||||
} else if (bcch_sdu_length <= 49) {
|
||||
mcs=8;
|
||||
}
|
||||
|
||||
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu));
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = 0xFFFF;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // S-RNTI : see Table 4-10 from SCF082 - nFAPI specifications
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
|
||||
// Only schedule LTE System Information in subframe 5
|
||||
if (subframeP == 5) {
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0;
|
||||
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4);
|
||||
|
||||
if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) {
|
||||
LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for S_RNTI\n",
|
||||
frameP,subframeP);
|
||||
dl_req->number_dci++;
|
||||
dl_req->number_pdu++;
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
cc = &eNB->common_channels[CC_id];
|
||||
vrb_map = (void*)&cc->vrb_map;
|
||||
N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth);
|
||||
dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
|
||||
|
||||
|
||||
bcch_sdu_length = mac_rrc_data_req(module_idP,
|
||||
CC_id,
|
||||
frameP,
|
||||
BCCH,1,
|
||||
&cc->BCCH_pdu.payload[0],
|
||||
1,
|
||||
module_idP,
|
||||
0); // not used in this case
|
||||
|
||||
if (bcch_sdu_length > 0) {
|
||||
LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length);
|
||||
|
||||
// Allocate 4 PRBs in a random location
|
||||
/*
|
||||
while (1) {
|
||||
first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->frame_parms.N_RB_DL-4));
|
||||
if ((vrb_map[first_rb] != 1) &&
|
||||
(vrb_map[first_rb+1] != 1) &&
|
||||
(vrb_map[first_rb+2] != 1) &&
|
||||
(vrb_map[first_rb+3] != 1))
|
||||
break;
|
||||
}
|
||||
*/
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
first_rb = 0;
|
||||
break;
|
||||
case 15:
|
||||
first_rb = 6;
|
||||
break;
|
||||
case 25:
|
||||
first_rb = 11;
|
||||
break;
|
||||
case 50:
|
||||
first_rb = 23;
|
||||
break;
|
||||
case 100:
|
||||
first_rb = 48;
|
||||
break;
|
||||
}
|
||||
|
||||
vrb_map[first_rb] = 1;
|
||||
vrb_map[first_rb+1] = 1;
|
||||
vrb_map[first_rb+2] = 1;
|
||||
vrb_map[first_rb+3] = 1;
|
||||
|
||||
// Get MCS for length of SI, 3 PRBs
|
||||
if (bcch_sdu_length <= 7) {
|
||||
mcs=0;
|
||||
} else if (bcch_sdu_length <= 11) {
|
||||
mcs=1;
|
||||
} else if (bcch_sdu_length <= 18) {
|
||||
mcs=2;
|
||||
} else if (bcch_sdu_length <= 22) {
|
||||
mcs=3;
|
||||
} else if (bcch_sdu_length <= 26) {
|
||||
mcs=4;
|
||||
} else if (bcch_sdu_length <= 28) {
|
||||
mcs=5;
|
||||
} else if (bcch_sdu_length <= 32) {
|
||||
mcs=6;
|
||||
} else if (bcch_sdu_length <= 41) {
|
||||
mcs=7;
|
||||
} else if (bcch_sdu_length <= 49) {
|
||||
mcs=8;
|
||||
}
|
||||
|
||||
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu));
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
|
||||
dl_req->number_pdu++;
|
||||
|
||||
// Program TX Request
|
||||
TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
|
||||
TX_req->pdu_length = bcch_sdu_length;
|
||||
TX_req->pdu_index = eNB->pdu_index[CC_id]++;
|
||||
TX_req->num_segments = 1;
|
||||
TX_req->segments[0].segment_length = bcch_sdu_length;
|
||||
TX_req->segments[0].segment_data = cc->BCCH_pdu.payload;
|
||||
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
|
||||
}
|
||||
else {
|
||||
LOG_E(MAC,"[eNB %d] CCid %d Frame %d, subframe %d : Cannot add DCI 1A for SI\n",module_idP, CC_id,frameP,subframeP);
|
||||
}
|
||||
|
||||
if (opt_enabled == 1) {
|
||||
trace_pdu(1,
|
||||
&cc->BCCH_pdu.payload[0],
|
||||
bcch_sdu_length,
|
||||
0xffff,
|
||||
4,
|
||||
0xffff,
|
||||
eNB->frame,
|
||||
eNB->subframe,
|
||||
0,
|
||||
0);
|
||||
LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n",
|
||||
module_idP, frameP, CC_id, 0xffff, bcch_sdu_length);
|
||||
}
|
||||
if (cc->tdd_Config!=NULL) { //TDD
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
bcch_sdu_length,
|
||||
mcs);
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dci_dl_pdu));
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.dci_format = NFAPI_DL_DCI_FORMAT_1A;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level = 4;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti = 0xFFFF;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // S-RNTI : see Table 4-10 from SCF082 - nFAPI specifications
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
|
||||
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = mcs;
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0;
|
||||
|
||||
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4);
|
||||
|
||||
if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,SI_RNTI)) {
|
||||
LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for S_RNTI\n",
|
||||
frameP,subframeP);
|
||||
dl_req->number_dci++;
|
||||
dl_req->number_pdu++;
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_dl_config_dlsch_pdu));
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = eNB->pdu_index[CC_id];
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = 0xFFFF;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL,first_rb,4);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1;// first block
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc->p_eNB==1 ) ? 0 : 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_subbands = 1;
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.codebook_index = ;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ue_category_capacity = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc->mib->message.dl_Bandwidth); // ignored
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
|
||||
dl_req->number_pdu++;
|
||||
|
||||
// Program TX Request
|
||||
TX_req = &eNB->TX_req[CC_id].tx_request_body.tx_pdu_list[eNB->TX_req[CC_id].tx_request_body.number_of_pdus];
|
||||
TX_req->pdu_length = bcch_sdu_length;
|
||||
TX_req->pdu_index = eNB->pdu_index[CC_id]++;
|
||||
TX_req->num_segments = 1;
|
||||
TX_req->segments[0].segment_length = bcch_sdu_length;
|
||||
TX_req->segments[0].segment_data = cc->BCCH_pdu.payload;
|
||||
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
|
||||
}
|
||||
else {
|
||||
LOG_E(MAC,"[eNB %d] CCid %d Frame %d, subframe %d : Cannot add DCI 1A for SI\n",module_idP, CC_id,frameP,subframeP);
|
||||
}
|
||||
|
||||
if (opt_enabled == 1) {
|
||||
trace_pdu(1,
|
||||
&cc->BCCH_pdu.payload[0],
|
||||
bcch_sdu_length,
|
||||
0xffff,
|
||||
4,
|
||||
0xffff,
|
||||
eNB->frame,
|
||||
eNB->subframe,
|
||||
0,
|
||||
0);
|
||||
LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n",
|
||||
module_idP, frameP, CC_id, 0xffff, bcch_sdu_length);
|
||||
}
|
||||
if (cc->tdd_Config!=NULL) { //TDD
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
bcch_sdu_length,
|
||||
mcs);
|
||||
} else {
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (FDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
bcch_sdu_length,
|
||||
mcs);
|
||||
}
|
||||
|
||||
|
||||
eNB->eNB_stats[CC_id].total_num_bcch_pdu+=1;
|
||||
eNB->eNB_stats[CC_id].bcch_buffer=bcch_sdu_length;
|
||||
eNB->eNB_stats[CC_id].total_bcch_buffer+=bcch_sdu_length;
|
||||
eNB->eNB_stats[CC_id].bcch_mcs=mcs;
|
||||
} else {
|
||||
LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (FDD) for CC_id %d SI %d bytes (mcs %d, rb 3)\n",
|
||||
frameP,
|
||||
CC_id,
|
||||
bcch_sdu_length,
|
||||
mcs);
|
||||
|
||||
//LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame);
|
||||
}
|
||||
|
||||
|
||||
eNB->eNB_stats[CC_id].total_num_bcch_pdu+=1;
|
||||
eNB->eNB_stats[CC_id].bcch_buffer=bcch_sdu_length;
|
||||
eNB->eNB_stats[CC_id].total_bcch_buffer+=bcch_sdu_length;
|
||||
eNB->eNB_stats[CC_id].bcch_mcs=mcs;
|
||||
} else {
|
||||
|
||||
//LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame);
|
||||
}
|
||||
}
|
||||
|
||||
// this might be misleading when bcch is inactive
|
||||
#ifdef Rel14
|
||||
schedule_SIB1_BR(module_idP,frameP,subframeP);
|
||||
schedule_SI_BR(module_idP,frameP,subframeP);
|
||||
#endif
|
||||
|
||||
// this might be misleading when bcch is inactive
|
||||
stop_meas(&eNB->schedule_si);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -302,8 +302,24 @@ mac_rrc_data_req(
|
||||
//else
|
||||
//return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //Rel10 || Rel14
|
||||
#ifdef Rel14
|
||||
if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR){
|
||||
memcpy(&buffer_pP[0],
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR,
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
|
||||
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
|
||||
}
|
||||
|
||||
if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3
|
||||
memcpy(&buffer_pP[0],
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR,
|
||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
|
||||
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
|
||||
}
|
||||
|
||||
#endif
|
||||
} else { //This is an UE
|
||||
|
||||
|
||||
|
||||
@@ -192,7 +192,11 @@ uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId)
|
||||
return 0xFF; //error!
|
||||
}
|
||||
|
||||
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame, uint32_t schedulingInfoSIB1)
|
||||
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame
|
||||
#ifdef Rel14
|
||||
, uint32_t schedulingInfoSIB1
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
@@ -246,11 +250,13 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich
|
||||
#ifndef Rel14
|
||||
mib->message.spare.size = 2;
|
||||
mib->message.spare.bits_unused = 6; // This makes a spare of 10 bits
|
||||
mib->message.schedulingInfoSIB1_BR_r13 = schedulingInfoSIB1; // turn on eMTC
|
||||
#else
|
||||
mib->message.spare.size = 1;
|
||||
mib->message.spare.bits_unused = 3; // This makes a spare of 5 bits
|
||||
mib->message.schedulingInfoSIB1_BR_r13 = 0; // turn off eMTC
|
||||
mib->message.schedulingInfoSIB1_BR_r13 = schedulingInfoSIB1; // turn on/off eMTC
|
||||
LOG_I(RRC,"[MIB] schedulingInfoSIB1 %d\n",
|
||||
(uint32_t)mib->message.schedulingInfoSIB1_BR_r13);
|
||||
|
||||
#endif
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
|
||||
@@ -550,9 +556,13 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
|
||||
|
||||
if (configuration->bandwidthReducedAccessRelatedInfo_r13[CC_id])
|
||||
{
|
||||
|
||||
sib1_1310->bandwidthReducedAccessRelatedInfo_r13
|
||||
= calloc(1, sizeof(struct SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13));
|
||||
|
||||
LOG_I(RRC,"Allocating memory for BR access of SI (%p)\n",
|
||||
sib1_1310->bandwidthReducedAccessRelatedInfo_r13);
|
||||
|
||||
sib1_1310->bandwidthReducedAccessRelatedInfo_r13->si_WindowLength_BR_r13
|
||||
= configuration->si_WindowLength_BR_r13[CC_id]; // 0
|
||||
|
||||
@@ -570,18 +580,10 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
|
||||
for (index = 0; index < num_sched_info_br; ++index)
|
||||
{
|
||||
|
||||
if (configuration->si_Narrowband_r13[CC_id][index] && configuration->si_TBS_r13[CC_id][index])
|
||||
{
|
||||
schedulinginfo_br_13->si_Narrowband_r13 = configuration->si_Narrowband_r13[CC_id][index];
|
||||
schedulinginfo_br_13->si_TBS_r13 = configuration->si_TBS_r13[CC_id][index];
|
||||
}
|
||||
else
|
||||
{
|
||||
schedulinginfo_br_13->si_Narrowband_r13 = 1;
|
||||
schedulinginfo_br_13->si_TBS_r13 = SchedulingInfo_BR_r13__si_TBS_r13_b152;
|
||||
}
|
||||
|
||||
ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->schedulingInfoList_BR_r13->list, schedulinginfo_br_13);
|
||||
schedulinginfo_br_13->si_Narrowband_r13 = configuration->si_Narrowband_r13[CC_id][index];
|
||||
schedulinginfo_br_13->si_TBS_r13 = configuration->si_TBS_r13[CC_id][index];
|
||||
LOG_I(RRC,"Adding (%d,%d) to scheduling_info_br_13\n",schedulinginfo_br_13->si_Narrowband_r13,schedulinginfo_br_13->si_TBS_r13);
|
||||
ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->schedulingInfoList_BR_r13->list, schedulinginfo_br_13);
|
||||
}
|
||||
|
||||
sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_DownlinkOrTddSubframeBitmapBR_r13
|
||||
|
||||
@@ -67,7 +67,11 @@ uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId);
|
||||
@param phich_duration PHICH duration parameter
|
||||
@param frame radio frame number
|
||||
@return size of encoded bit stream in bytes*/
|
||||
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame, uint32_t schedulingInfoSIB1);
|
||||
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame
|
||||
#ifdef Rel14
|
||||
, uint32_t schedulingInfoSIB1
|
||||
#endif
|
||||
);
|
||||
|
||||
/**
|
||||
\brief Generate configuration for SIB1 (eNB).
|
||||
|
||||
@@ -150,16 +150,26 @@ init_SI(
|
||||
configuration->N_RB_DL[CC_id],
|
||||
(int)configuration->radioresourceconfig[CC_id].phich_resource,
|
||||
(int)configuration->radioresourceconfig[CC_id].phich_duration);
|
||||
#ifdef Rel14
|
||||
LOG_I(RRC, "configuration->schedulingInfoSIB1_BR_r13[CC_id] %d\n",(int)configuration->schedulingInfoSIB1_BR_r13[CC_id]);
|
||||
#endif
|
||||
do_MIB(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id],
|
||||
#ifdef ENABLE_ITTI
|
||||
configuration->N_RB_DL[CC_id],
|
||||
(int)configuration->radioresourceconfig[CC_id].phich_resource,
|
||||
(int)configuration->radioresourceconfig[CC_id].phich_duration,
|
||||
configuration->schedulingInfoSIB1_BR_r13[CC_id]
|
||||
0
|
||||
#else
|
||||
50, 0, 0, 1
|
||||
50, 0, 0, 0
|
||||
#endif
|
||||
,0);
|
||||
#ifdef Rel14
|
||||
#ifdef ENABLE_ITTI
|
||||
,configuration->schedulingInfoSIB1_BR_r13[CC_id]
|
||||
#else
|
||||
,0
|
||||
#endif
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1 = 0;
|
||||
@@ -311,14 +321,18 @@ init_SI(
|
||||
if ((RC.rrc[ctxt_pP->module_id]->carrier[CC_id].mib.message.schedulingInfoSIB1_BR_r13>0) &&
|
||||
(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR!=NULL)) {
|
||||
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension!=NULL,
|
||||
"sib2_br->nonCriticalExtension is null (v9.2)\n");
|
||||
"sib2_br->nonCriticalExtension is null (v8.9)\n");
|
||||
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension!=NULL,
|
||||
"sib2_br->nonCriticalExtension is null (v11.3)\n");
|
||||
"sib2_br->nonCriticalExtension is null (v9.2)\n");
|
||||
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension!=NULL,
|
||||
"sib2_br->nonCriticalExtension is null (v11.3)\n");
|
||||
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension!=NULL,
|
||||
"sib2_br->nonCriticalExtension is null (v12.5)\n");
|
||||
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension!=NULL,
|
||||
"sib2_br->nonCriticalExtension is null (v13.10)\n");
|
||||
sib1_v13ext = RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension;
|
||||
|
||||
sib1_v13ext = RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -342,10 +342,10 @@ int trx_usrp_set_gains(openair0_device* device,
|
||||
|
||||
usrp_state_t *s = (usrp_state_t*)device->priv;
|
||||
|
||||
s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[0]);
|
||||
s->usrp->set_tx_gain(89.0-openair0_cfg[0].tx_gain[0]);
|
||||
::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0);
|
||||
// limit to maximum gain
|
||||
if (openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) {
|
||||
if (125.0-openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) {
|
||||
LOG_E(PHY,"RX Gain 0 too high, reduce by %f dB\n",
|
||||
openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] - gain_range.stop());
|
||||
exit(-1);
|
||||
@@ -632,10 +632,10 @@ extern "C" {
|
||||
|
||||
::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i);
|
||||
// limit to maximum gain
|
||||
AssertFatal( openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] <= gain_range.stop(),
|
||||
AssertFatal( 125.0-openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] <= gain_range.stop(),
|
||||
"RX Gain too high, lower by %f dB\n",
|
||||
openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] - gain_range.stop());
|
||||
s->usrp->set_rx_gain(openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],i);
|
||||
125.0-openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] - gain_range.stop());
|
||||
s->usrp->set_rx_gain(125.0-openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],i);
|
||||
LOG_I(PHY,"RX Gain %d %f (%f) => %f (max %f)\n",i,
|
||||
openair0_cfg[0].rx_gain[i],openair0_cfg[0].rx_gain_offset[i],
|
||||
openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop());
|
||||
@@ -645,7 +645,7 @@ extern "C" {
|
||||
if (i<openair0_cfg[0].tx_num_channels) {
|
||||
s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i);
|
||||
s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i);
|
||||
s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i);
|
||||
s->usrp->set_tx_gain(89.0-openair0_cfg[0].tx_gain[i],i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user