Commit 7a1d8e30 authored by AlanLi's avatar AlanLi

Fixed bugs for SIB23

parent 0daeb68d
...@@ -223,8 +223,10 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -223,8 +223,10 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch; NB_IoT_eNB_NPBCH_t *broadcast_str = &eNB->npbch;
//NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB; //NB_IoT_eNB_NDLSCH_t *sib1 = &eNB->ndlsch_SIB;
NB_IoT_DL_eNB_SIB_t *sib1 = &eNB->ndlsch_SIB.content_sib1; NB_IoT_eNB_NDLSCH_t *ndlsch = &eNB->ndlsch_SIB;
NB_IoT_DL_eNB_SIB_t *sib23 = &eNB->ndlsch_SIB.content_sib23; NB_IoT_DL_eNB_SIB_t *sib1 = &ndlsch->content_sib1;
NB_IoT_DL_eNB_SIB_t *sib23 = &ndlsch->content_sib23;
int **txdataF = eNB->common_vars.txdataF[0]; int **txdataF = eNB->common_vars.txdataF[0];
int subframe = proc->subframe_tx; int subframe = proc->subframe_tx;
uint32_t frame = proc->frame_tx; uint32_t frame = proc->frame_tx;
...@@ -299,6 +301,10 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -299,6 +301,10 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
if(subframe == 0) if(subframe == 0)
{ {
LOG_I(PHY,"MIB NB-IoT content:\n");
for(int i = 0; i<6;i++)
printf("%02X",broadcast_str->pdu[i]);
printf("\n");
generate_npbch(broadcast_str, generate_npbch(broadcast_str,
txdataF, txdataF,
...@@ -313,6 +319,12 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -313,6 +319,12 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
///////////////////////////////////////////////////////// SIB1 //////////////////////////////////// ///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////
if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) ) if((subframe == 4) && (frame%2==0) && (frame%32<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{ {
LOG_I(PHY,"SIB1 NB-IoT content:\n");
for(int i = 0; i<6;i++)
printf("%02X",sib1->pdu[i]);
printf("\n");
if( frame%32 == 0 ) if( frame%32 == 0 )
{ {
dlsch_encoding_NB_IoT(sib1_pdu, dlsch_encoding_NB_IoT(sib1_pdu,
...@@ -345,6 +357,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -345,6 +357,11 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
//////////////////////////////////////////////////// SIB23 //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////// SIB23 ////////////////////////////////////////////////////////////////////////
if( (subframe >0) && (subframe !=5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) ) if( (subframe >0) && (subframe !=5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
{ {
LOG_I(PHY,"SIB2 NB-IoT content:\n");
for(int i = 0; i<6;i++)
printf("%02X",sib23->pdu[i]);
printf("\n");
if( subframe == 1 ) if( subframe == 1 )
{ {
dlsch_encoding_NB_IoT(sib23_pdu, dlsch_encoding_NB_IoT(sib23_pdu,
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file eNB_scheduler_NB_IoT.c /*! \file eNB_scheduler_NB_IoT.c
* \brief top level of the scheduler, it scheduled in pdcch period based. * \brief top level of the scheduler, it scheduled in pdcch period based.
* \author NTUST BMW Lab./Nick HO, Xavier LIU, Calvin HSU * \author NTUST BMW Lab./
* \date 2017 - 2018 * \date 2017
* \email: nick133371@gmail.com, sephiroth7277@gmail.com , kai-hsiang.hsu@eurecom.fr * \email:
* \version 1.0 * \version 1.0
* *
*/ */
...@@ -37,17 +18,6 @@ ...@@ -37,17 +18,6 @@
#define flag_css_type2 0x2 #define flag_css_type2 0x2
#define flag_uss_v 0x4 #define flag_uss_v 0x4
#if 0 // disable now
#define flag_css_type1_ce0 0x1
#define flag_css_type1_ce1 0x2
#define flag_css_type1_ce2 0x4
#define flag_css_type2_ce0 0x8
#define flag_css_type2_ce1 0x10
#define flag_css_type2_ce2 0x20
#define flag_uss_v 0x40
#endif
// common // common
#define flag_mib 0x1 #define flag_mib 0x1
...@@ -56,10 +26,6 @@ ...@@ -56,10 +26,6 @@
#define flag_nsss 0x8 #define flag_nsss 0x8
#define num_flags 2
// type2 css, type1 css
//extern BCCH_DL_SCH_Message_NB_IoT_t SIB; //extern BCCH_DL_SCH_Message_NB_IoT_t SIB;
void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t abs_subframe, uint32_t *scheduler_flags, uint32_t *common_flags, uint32_t *max_subframe){ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t abs_subframe, uint32_t *scheduler_flags, uint32_t *common_flags, uint32_t *max_subframe){
...@@ -70,6 +36,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ...@@ -70,6 +36,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t
//NPRACH_Parameters_NB_IoT_r13_t **type2_css_info = SIB.message.choice.c1.choice.systemInformation_r13.criticalExtensions.choice.systemInformation_r13.sib_TypeAndInfo_r13.choice.sib2_r13.radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list.array; //NPRACH_Parameters_NB_IoT_r13_t **type2_css_info = SIB.message.choice.c1.choice.systemInformation_r13.criticalExtensions.choice.systemInformation_r13.sib_TypeAndInfo_r13.choice.sib2_r13.radioResourceConfigCommon_r13.nprach_Config_r13.nprach_ParametersList_r13.list.array;
// fixed scheduling part (e.g. MIB, NPSS, NSSS, SIB1)
if(subframe == 0){ if(subframe == 0){
*common_flags |= flag_mib; *common_flags |= flag_mib;
}else if(subframe == 5){ }else if(subframe == 5){
...@@ -81,7 +48,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ...@@ -81,7 +48,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t
} }
/* uint32_t type2_css_pp[3] = { type2_css_info[0]->npdcch_NumRepetitions_RA_r13*type2_css_info[0]->npdcch_StartSF_CSS_RA_r13, type2_css_info[1]->npdcch_NumRepetitions_RA_r13*type2_css_info[1]->npdcch_StartSF_CSS_RA_r13, type2_css_info[2]->npdcch_NumRepetitions_RA_r13*type2_css_info[2]->npdcch_StartSF_CSS_RA_r13 };*/ /* uint32_t type2_css_pp[3] = { type2_css_info[0]->npdcch_NumRepetitions_RA_r13*type2_css_info[0]->npdcch_StartSF_CSS_RA_r13, type2_css_info[1]->npdcch_NumRepetitions_RA_r13*type2_css_info[1]->npdcch_StartSF_CSS_RA_r13, type2_css_info[2]->npdcch_NumRepetitions_RA_r13*type2_css_info[2]->npdcch_StartSF_CSS_RA_r13 };*/
uint32_t type2_css_pp[3] = {256, 256, 256}; uint32_t type2_css_pp[3] = {256, 256, 256}; // TODO RRC config should get from structure
uint32_t start_subframe; uint32_t start_subframe;
for(i=0; i<1; ++i){ // only CE0 for(i=0; i<1; ++i){ // only CE0
start_subframe = 0; start_subframe = 0;
...@@ -119,7 +86,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ...@@ -119,7 +86,7 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t
} }
} }
*max_subframe = max; *max_subframe = max; // the maximum subframe to be extend
} }
/*function description: /*function description:
...@@ -129,16 +96,13 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ...@@ -129,16 +96,13 @@ void eNB_scheduler_computing_flag_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t
void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t abs_subframe){ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t abs_subframe){
int i; int i;
uint8_t MIB_flag,SIB1_flag ; uint8_t tx_mib=0, tx_sib1=0;
uint32_t scheduler_flags, max_subframe, common_flags; uint32_t scheduler_flags, max_subframe, common_flags;
/*Check this subframe should schedule something, set the flag*/ /*Check this subframe should schedule something, set the flag*/
scheduler_flags = 0; scheduler_flags = 0;
common_flags = 0; common_flags = 0;
MIB_flag = 0;
SIB1_flag = 0;
uint32_t h,f,sf; uint32_t h,f,sf;
int a;
eNB_scheduler_computing_flag_NB_IoT(mac_inst, abs_subframe, &scheduler_flags, &common_flags, &max_subframe); eNB_scheduler_computing_flag_NB_IoT(mac_inst, abs_subframe, &scheduler_flags, &common_flags, &max_subframe);
if(scheduler_flags > 0){ if(scheduler_flags > 0){
...@@ -147,7 +111,7 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab ...@@ -147,7 +111,7 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab
maintain_available_resource(mac_inst); maintain_available_resource(mac_inst);
if((abs_subframe % rachperiod[4]) == rachstart[0]){ if((abs_subframe % rachperiod[4]) == rachstart[0]){ //TODO, configuration should be pass by configuration module
add_UL_Resource(); add_UL_Resource();
} }
...@@ -159,6 +123,7 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab ...@@ -159,6 +123,7 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab
//Check if type1 searching space scheduling //Check if type1 searching space scheduling
if((scheduler_flags&flag_css_type1)>0){ if((scheduler_flags&flag_css_type1)>0){
// paging, direct indication
scheduler_flags &= ~(flag_css_type1); scheduler_flags &= ~(flag_css_type1);
} }
//The scheduling time is current subframe + 1 //The scheduling time is current subframe + 1
...@@ -175,22 +140,22 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab ...@@ -175,22 +140,22 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab
} }
} }
if(common_flags == flag_mib) if(common_flags&flag_mib){
MIB_flag = 1; tx_mib = 1;
if(common_flags == flag_sib1) }
SIB1_flag = 1; if(common_flags&flag_sib1){
convert_system_number(abs_subframe, &h, &f, &sf); tx_sib1 = 1;
}
a = output_handler(mac_inst, (module_id_t)0, 0, h, f, sf, MIB_flag, SIB1_flag, abs_subframe); convert_system_number(abs_subframe, &h, &f, &sf);
if(a != 0){ if(0 != output_handler(mac_inst, (module_id_t)0, 0, h, f, sf, tx_mib, tx_sib1, abs_subframe)){
LOG_D(MAC,"output handler error\n"); LOG_D(MAC,"output handler error\n");
} }
} }
void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, uint32_t subframe, uint32_t frame, uint32_t hypersfn, int index_ss) void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, uint32_t subframe, uint32_t frame, uint32_t hypersfn, int index_ss)
{ {
// printf_FUNCTION_IN("[USS]");
//SCHEDULE_NB_IoT_t *scheduler = &eNB->scheduler; //SCHEDULE_NB_IoT_t *scheduler = &eNB->scheduler;
mac_inst->scheduling_flag.flag_uss[0]=1; mac_inst->scheduling_flag.flag_uss[0]=1;
...@@ -245,6 +210,5 @@ void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, u ...@@ -245,6 +210,5 @@ void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, u
UE_ID = UE_template_temp->next; UE_ID = UE_template_temp->next;
} }
// printf_FUNCTION_OUT("[USS]");
} }
...@@ -464,8 +464,8 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui ...@@ -464,8 +464,8 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
mac_xface->eNB_dlsch_ulsch_scheduler = eNB_dlsch_ulsch_scheduler; mac_xface->eNB_dlsch_ulsch_scheduler = eNB_dlsch_ulsch_scheduler;
mac_xface->get_dci_sdu = get_dci_sdu; mac_xface->get_dci_sdu = get_dci_sdu;
mac_xface->fill_rar = fill_rar; mac_xface->fill_rar = fill_rar;
//mac_xface->initiate_ra_proc = initiate_ra_proc; mac_xface->initiate_ra_proc = initiate_ra_proc;
mac_xface->initiate_ra_proc = initiate_ra_proc_NB_IoT; //mac_xface->initiate_ra_proc = initiate_ra_proc_NB_IoT;
mac_xface->cancel_ra_proc = cancel_ra_proc; mac_xface->cancel_ra_proc = cancel_ra_proc;
mac_xface->set_msg3_subframe = set_msg3_subframe; mac_xface->set_msg3_subframe = set_msg3_subframe;
mac_xface->SR_indication = SR_indication; mac_xface->SR_indication = SR_indication;
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file main_NB_IoT.c /*! \file main_NB_IoT.c
* \brief top init of Layer 2 * \brief top init of Layer 2
* \author NTUST BMW Lab./Nick HO, Xavier LIU, Calvin HSU * \author NTUST BMW LAB./
* \date 2017 - 2018 * \date 2017
* \email: nick133371@gmail.com, sephiroth7277@gmail.com , kai-hsiang.hsu@eurecom.fr
* \version 1.0 * \version 1.0
* * \email:
*/ */
...@@ -71,6 +51,7 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst) ...@@ -71,6 +51,7 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
LOG_I(MAC,"[NB-IoT] MAC start initialization\n"); LOG_I(MAC,"[NB-IoT] MAC start initialization\n");
mac_inst->current_subframe = 0;
for(i=0;i<64;++i) for(i=0;i<64;++i)
{ {
mac_inst->sib1_flag[i] = 0; mac_inst->sib1_flag[i] = 0;
...@@ -119,6 +100,7 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst) ...@@ -119,6 +100,7 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
mac_inst->rrc_config.si_window_length = ms160; mac_inst->rrc_config.si_window_length = ms160;
mac_inst->rrc_config.sibs_NB_IoT_sched[0].si_periodicity = rf64; mac_inst->rrc_config.sibs_NB_IoT_sched[0].si_periodicity = rf64;
mac_inst->rrc_config.si_radio_frame_offset = 1;
for(i=0;i<256;++i){ for(i=0;i<256;++i){
mac_inst->sibs_table[i] = -1; mac_inst->sibs_table[i] = -1;
...@@ -184,44 +166,13 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst) ...@@ -184,44 +166,13 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
LOG_I(MAC,"[NB-IoT] List_number %d R_max %d G %.1f a_offset %.1f T %d SS_start %d\n", i, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.R_max, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.G, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.a_offset, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.T, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.ss_start_uss); LOG_I(MAC,"[NB-IoT] List_number %d R_max %d G %.1f a_offset %.1f T %d SS_start %d\n", i, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.R_max, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.G, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.a_offset, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.T, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.ss_start_uss);
} }
/*
//Initial one UE template
//UE_TEMPLATE_NB_IoT *UE_info=(UE_TEMPLATE_NB_IoT*)malloc(USER_NUM_USS*sizeof(UE_TEMPLATE_NB_IoT));
mac_inst->UE_list_spec->head=0;
mac_inst->UE_list_spec->tail=0;
for(i=0;i<USER_NUM_USS;++i)
{
UE_info_setting(mac_inst->UE_list_spec->UE_template_NB_IoT+i);
if(i==0)
{
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->prev=-1;
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->next=1;
//mac_inst->UE_list_spec->next[i]=-1;
}
else if(i>=USER_NUM_USS-1)
{
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->prev=i-1;
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->next=-1;
}
else
{
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->prev=i-1;
(mac_inst->UE_list_spec->UE_template_NB_IoT+i)->next=i+1;
}
//mac_inst->UE_list_spec->UE_template_NB_IoT[i]=UE_info[i];
mac_inst->UE_list_spec->tail=i;
}
*/
//UL initial //UL initial
//Setting nprach configuration //Setting nprach configuration
setting_nprach(); setting_nprach();
//Initialize uplink resource from nprach configuration //Initialize uplink resource from nprach configuration
Initialize_Resource(); Initialize_Resource();
//add_UL_Resource(mac_inst); //add_UL_Resource(mac_inst);
extend_available_resource_DL(mac_inst, mac_inst->current_subframe + 1 + 160); extend_available_resource_DL(mac_inst, mac_inst->current_subframe + 1 + mac_inst->rrc_config.si_window_length);
} }
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file schedule_tool_NB_IoT.c /*! \file schedule_tool_NB_IoT.c
* \brief scheduler helper function * \brief scheduler helper function
* \author NTUST BMW Lab./Nick HO, Xavier LIU, Calvin HSU * \author NTUST BMW Lab./
* \date 2017 - 2018 * \date 2017
* \email: nick133371@gmail.com, sephiroth7277@gmail.com , kai-hsiang.hsu@eurecom.fr * \email:
* \version 1.0 * \version 1.0
* *
*/ */
...@@ -941,23 +922,22 @@ void init_dl_list(eNB_MAC_INST_NB_IoT *mac_inst){ ...@@ -941,23 +922,22 @@ void init_dl_list(eNB_MAC_INST_NB_IoT *mac_inst){
available_resource_DL_last = node; available_resource_DL_last = node;
node->start_subframe = 0; node->start_subframe = 0;
node->end_subframe = mac_inst->rrc_config.si_window_length; node->end_subframe = 0;
mac_inst->schedule_subframe_DL = mac_inst->rrc_config.si_window_length; mac_inst->schedule_subframe_DL = 0;
//node->end_subframe = mac_inst->rrc_config.si_window_length;
//mac_inst->schedule_subframe_DL = mac_inst->rrc_config.si_window_length;
// init sibs for first si-window // init sibs for first si-window
schedule_sibs(mac_inst, 0, 0); //schedule_sibs(mac_inst, 0, 0); // TODO, check init
} }
// extend subframe align to si-period // extend subframe align to si-period
void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subframe){ // assume max_subframe is found. void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subframe){
//printf_FUNCTION_IN("[EXTEND DL]");
available_resource_DL_t *new_node; available_resource_DL_t *new_node;
//int temp;
uint32_t i, i_div_si_window; uint32_t i, i_div_si_window;
//uint32_t si_period_div_window;
//pt = available_resource_DL;
LOG_D(MAC,"[extend DL] max_subframe: %d, current schedule subframe: %d\n", max_subframe, mac_inst->schedule_subframe_DL); LOG_D(MAC,"[extend DL] max_subframe: %d, current schedule subframe: %d\n", max_subframe, mac_inst->schedule_subframe_DL);
print_available_resource_DL(mac_inst); print_available_resource_DL(mac_inst);
...@@ -984,23 +964,20 @@ void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subfram ...@@ -984,23 +964,20 @@ void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subfram
} }
// do schedule sibs after extend. // do schedule sibs after extend.
for(i=mac_inst->schedule_subframe_DL;i<max_subframe;i+=mac_inst->rrc_config.si_window_length){ for(i=mac_inst->schedule_subframe_DL; i<max_subframe; i+=mac_inst->rrc_config.si_window_length){
i_div_si_window = (i / mac_inst->rrc_config.si_window_length)%256; i_div_si_window = (i / mac_inst->rrc_config.si_window_length)%256;
if(-1 != mac_inst->sibs_table[i_div_si_window]){ if(-1 != mac_inst->sibs_table[i_div_si_window]){
LOG_D(MAC,"[sibs%d] %d\n", mac_inst->sibs_table[i_div_si_window], i); LOG_D(MAC,"[sibs%d] %d\n", mac_inst->sibs_table[i_div_si_window], i + (mac_inst->rrc_config.si_radio_frame_offset*10));
schedule_sibs(mac_inst, mac_inst->sibs_table[i_div_si_window], i); schedule_sibs(mac_inst, mac_inst->sibs_table[i_div_si_window], i + (mac_inst->rrc_config.si_radio_frame_offset*10)); // add si-radio-frame-offset carried in SIB1
} }
} }
mac_inst->schedule_subframe_DL = max_subframe; mac_inst->schedule_subframe_DL = max_subframe;
} }
//printf_FUNCTION_OUT("[EXTEND DL]");
return ;
} }
void maintain_available_resource(eNB_MAC_INST_NB_IoT *mac_inst){ void maintain_available_resource(eNB_MAC_INST_NB_IoT *mac_inst){
//printf_FUNCTION_IN("[MAINTAIN]");
available_resource_DL_t *pfree, *iterator; available_resource_DL_t *pfree, *iterator;
available_resource_UL_t *pfree2, *iterator2; available_resource_UL_t *pfree2, *iterator2;
schedule_result_t *iterator1; schedule_result_t *iterator1;
......
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