Commit 3866ad41 authored by Nick Ho's avatar Nick Ho

Optimize function for SIB size indication from RRC to MAC

parent 9e84ca4c
...@@ -524,7 +524,7 @@ void rrc_mac_config_req_NB_IoT( ...@@ -524,7 +524,7 @@ void rrc_mac_config_req_NB_IoT(
mac_inst->npdcch_config_common[0].R_max = rmax[nprach_parameter->npdcch_NumRepetitions_RA_r13]; mac_inst->npdcch_config_common[0].R_max = rmax[nprach_parameter->npdcch_NumRepetitions_RA_r13];
mac_inst->npdcch_config_common[0].G = gvalue[nprach_parameter->npdcch_StartSF_CSS_RA_r13]; mac_inst->npdcch_config_common[0].G = gvalue[nprach_parameter->npdcch_StartSF_CSS_RA_r13];
mac_inst->npdcch_config_common[0].a_offset = pdcchoffset[nprach_parameter->npdcch_Offset_RA_r13]; mac_inst->npdcch_config_common[0].a_offset = pdcchoffset[nprach_parameter->npdcch_Offset_RA_r13];
LOG_I(MAC,"NPRACH 0 setting: Rmax: %ld G: %lf a: %lf\n",mac_inst->npdcch_config_common[0].R_max,mac_inst->npdcch_config_common[0].G,mac_inst->npdcch_config_common[0].a_offset); LOG_I(MAC,"NPRACH 0 setting: Rmax: %lu G: %lf a: %lf\n",mac_inst->npdcch_config_common[0].R_max,mac_inst->npdcch_config_common[0].G,mac_inst->npdcch_config_common[0].a_offset);
} }
///CE level 1 ///CE level 1
...@@ -538,7 +538,7 @@ void rrc_mac_config_req_NB_IoT( ...@@ -538,7 +538,7 @@ void rrc_mac_config_req_NB_IoT(
mac_inst->npdcch_config_common[1].R_max = rmax[nprach_parameter->npdcch_NumRepetitions_RA_r13]; mac_inst->npdcch_config_common[1].R_max = rmax[nprach_parameter->npdcch_NumRepetitions_RA_r13];
mac_inst->npdcch_config_common[1].G = gvalue[nprach_parameter->npdcch_StartSF_CSS_RA_r13]; mac_inst->npdcch_config_common[1].G = gvalue[nprach_parameter->npdcch_StartSF_CSS_RA_r13];
mac_inst->npdcch_config_common[1].a_offset = pdcchoffset[nprach_parameter->npdcch_Offset_RA_r13]; mac_inst->npdcch_config_common[1].a_offset = pdcchoffset[nprach_parameter->npdcch_Offset_RA_r13];
LOG_I(MAC,"NPRACH 1 setting: Rmax: %ld G: %lf a: %lf\n",mac_inst->npdcch_config_common[1].R_max,mac_inst->npdcch_config_common[1].G,mac_inst->npdcch_config_common[1].a_offset); LOG_I(MAC,"NPRACH 1 setting: Rmax: %lu G: %lf a: %lf\n",mac_inst->npdcch_config_common[1].R_max,mac_inst->npdcch_config_common[1].G,mac_inst->npdcch_config_common[1].a_offset);
} }
///CE level 2 ///CE level 2
if ( radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[2] != NULL) { if ( radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[2] != NULL) {
...@@ -551,7 +551,7 @@ void rrc_mac_config_req_NB_IoT( ...@@ -551,7 +551,7 @@ void rrc_mac_config_req_NB_IoT(
mac_inst->npdcch_config_common[2].R_max = rmax[nprach_parameter->npdcch_NumRepetitions_RA_r13]; mac_inst->npdcch_config_common[2].R_max = rmax[nprach_parameter->npdcch_NumRepetitions_RA_r13];
mac_inst->npdcch_config_common[2].G = gvalue[nprach_parameter->npdcch_StartSF_CSS_RA_r13]; mac_inst->npdcch_config_common[2].G = gvalue[nprach_parameter->npdcch_StartSF_CSS_RA_r13];
mac_inst->npdcch_config_common[2].a_offset = pdcchoffset[nprach_parameter->npdcch_Offset_RA_r13]; mac_inst->npdcch_config_common[2].a_offset = pdcchoffset[nprach_parameter->npdcch_Offset_RA_r13];
LOG_I(MAC,"NPRACH 2 setting: Rmax: %ld G: %lf a: %lf\n",mac_inst->npdcch_config_common[2].R_max,mac_inst->npdcch_config_common[2].G,mac_inst->npdcch_config_common[2].a_offset); LOG_I(MAC,"NPRACH 2 setting: Rmax: %lu G: %lf a: %lf\n",mac_inst->npdcch_config_common[2].R_max,mac_inst->npdcch_config_common[2].G,mac_inst->npdcch_config_common[2].a_offset);
} }
......
...@@ -51,14 +51,14 @@ typedef enum sib_MappingInfo{ ...@@ -51,14 +51,14 @@ typedef enum sib_MappingInfo{
}sib_MappingInfo_NB_IoT; }sib_MappingInfo_NB_IoT;
typedef enum si_TB{ typedef enum si_TB{
si_TB_56=2, si_TB_56=0,
si_TB_120=2, si_TB_120,
si_TB_208=8, si_TB_208,
si_TB_256=8, si_TB_256,
si_TB_328=8, si_TB_328,
si_TB_440=8, si_TB_440,
si_TB_552=8, si_TB_552,
si_TB_680=8 si_TB_680
}si_TB_NB_IoT; }si_TB_NB_IoT;
///RACH_ConfigCommon configuration ///RACH_ConfigCommon configuration
...@@ -215,14 +215,14 @@ typedef enum si_repetition_pattern_e{ ...@@ -215,14 +215,14 @@ typedef enum si_repetition_pattern_e{
}si_repetition_pattern_t; }si_repetition_pattern_t;
typedef enum si_tb_e{ typedef enum si_tb_e{
b56=2, b56=0,
b120=2, b120,
b208=8, b208,
b256=8, b256,
b328=8, b328,
b440=8, b440,
b552=8, b552,
b680=8 b680
}si_tb_t; }si_tb_t;
...@@ -230,8 +230,7 @@ typedef struct sibs_NB_IoT_sched_s{ ...@@ -230,8 +230,7 @@ typedef struct sibs_NB_IoT_sched_s{
si_periodicity_t si_periodicity; si_periodicity_t si_periodicity;
si_repetition_pattern_t si_repetition_pattern; si_repetition_pattern_t si_repetition_pattern;
sib_MappingInfo_NB_IoT sib_mapping_info; //bit vector sib_MappingInfo_NB_IoT sib_mapping_info; //bit vector
si_tb_t si_tb; si_TB_NB_IoT si_tb;
}sibs_NB_IoT_sched_t; }sibs_NB_IoT_sched_t;
......
...@@ -19,10 +19,11 @@ char str[6][7] = { "SIBs_1", "SIBs_2", "SIBs_3", "SIBs_4", "SIBs_5", "SIBs_6" }; ...@@ -19,10 +19,11 @@ char str[6][7] = { "SIBs_1", "SIBs_2", "SIBs_3", "SIBs_4", "SIBs_5", "SIBs_6" };
extern int extend_space[num_flags]; extern int extend_space[num_flags];
extern int extend_alpha_offset[num_flags]; extern int extend_alpha_offset[num_flags];
uint8_t get_SIB23_size(void) uint32_t get_SIB23_size(void)
{ {
rrc_config_NB_IoT_t *mac_config = &mac_inst->rrc_config; rrc_config_NB_IoT_t *mac_config = &mac_inst->rrc_config;
uint8_t size_SIB23_in_MAC = 0; uint32_t size_SIB23_in_MAC = 0;
switch(mac_config->sibs_NB_IoT_sched[0].si_tb) switch(mac_config->sibs_NB_IoT_sched[0].si_tb)
{ {
case si_TB_56: case si_TB_56:
...@@ -43,17 +44,18 @@ uint8_t get_SIB23_size(void) ...@@ -43,17 +44,18 @@ uint8_t get_SIB23_size(void)
case si_TB_440: case si_TB_440:
size_SIB23_in_MAC = 440; size_SIB23_in_MAC = 440;
break; break;
case si_TB_556: case si_TB_552:
size_SIB23_in_MAC = 556; size_SIB23_in_MAC = 552;
break; break;
case SI_TB_680: case si_TB_680:
size_SIB23_in_MAC = 680; size_SIB23_in_MAC = 680;
break; break;
default: default:
LOG_E(MAC,"No index for SIB23 size from SIB1!\n"); LOG_E(MAC,"No index for SIB23 size from SIB1!\n");
break; break;
return size_SIB23_in_MAC;
} }
return size_SIB23_in_MAC;
} }
void schedule_sibs(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t sibs_order, int start_subframe1){ void schedule_sibs(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t sibs_order, int start_subframe1){
...@@ -64,10 +66,18 @@ void schedule_sibs(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t sibs_order, int start ...@@ -64,10 +66,18 @@ void schedule_sibs(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t sibs_order, int start
schedule_result_t *new_node; schedule_result_t *new_node;
DCIFormatN1_t *sibs_dci; DCIFormatN1_t *sibs_dci;
uint32_t j, i, k; uint32_t j, i, k;
uint8_t SIB23_size = 0; uint32_t SIB23_size = 0;
uint8_t *SIB23_pdu = get_NB_IoT_SIB23(); uint8_t *SIB23_pdu = get_NB_IoT_SIB23();
int residual_subframe, num_subframe, last_subframe; int residual_subframe, num_subframe, last_subframe;
num_subframe = (mac_inst->rrc_config.sibs_NB_IoT_sched[sibs_order].si_tb)*8; uint8_t num_subframe_per_SIB = 0;
SIB23_size = get_SIB23_size();
if(SIB23_size > 0 && SIB23_size <= 120)
num_subframe_per_SIB = 2;
else if(SIB23_size > 120 && SIB23_size <= 680)
num_subframe_per_SIB = 8;
else
LOG_E(MAC,"Invalid SIB size\n");
num_subframe = num_subframe_per_SIB *8;
int rmax = mac_inst->rrc_config.mac_NPRACH_ConfigSIB[0].mac_npdcch_NumRepetitions_RA_NB_IoT; int rmax = mac_inst->rrc_config.mac_NPRACH_ConfigSIB[0].mac_npdcch_NumRepetitions_RA_NB_IoT;
rmax = (rmax * 10) >> 3; // x1.25 rmax = (rmax * 10) >> 3; // x1.25
...@@ -116,7 +126,6 @@ void schedule_sibs(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t sibs_order, int start ...@@ -116,7 +126,6 @@ void schedule_sibs(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t sibs_order, int start
if((available_resource_DL_t *)0 != pt[k]){ if((available_resource_DL_t *)0 != pt[k]){
new_node = (schedule_result_t *)malloc(sizeof(schedule_result_t)); new_node = (schedule_result_t *)malloc(sizeof(schedule_result_t));
// fill new node // fill new node
SIB23_size = get_SIB23_size();
new_node->output_subframe = first_subframe[k]; new_node->output_subframe = first_subframe[k];
new_node->end_subframe = (j==i)?last_subframe:j+9; new_node->end_subframe = (j==i)?last_subframe:j+9;
new_node->sdu_length = SIB23_size; new_node->sdu_length = SIB23_size;
......
...@@ -77,7 +77,7 @@ void rrc_mac_config_req_NB_IoT( ...@@ -77,7 +77,7 @@ void rrc_mac_config_req_NB_IoT(
uint8_t ded_flag, uint8_t ded_flag,
uint8_t ue_list_ded_num); uint8_t ue_list_ded_num);
uint8_t get_SIB23_size(void); uint32_t get_SIB23_size(void);
///system ///system
......
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