Commit 3d4e9240 authored by Nick Ho's avatar Nick Ho

fix the problem at fill DCI n1

parent d3409ac0
......@@ -31,7 +31,17 @@
#include "proto_NB_IoT.h"
#include "extern_NB_IoT.h"
uint8_t from_R_dl_to_idx(uint8_t R)
{
int it;
for(it=0; it<16;it++)
{
if(R==R_dl_table[it])
return it;
}
return -1;
}
/*DL scheduler*/
int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_TEMPLATE_NB_IoT *UE_info, uint32_t hyperSF_start, uint32_t frame_start, uint32_t subframe_start, UE_SCHED_CTRL_NB_IoT_t *UE_sched_ctrl_info)
{
......@@ -78,7 +88,8 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
uint32_t search_space_end_sf, h_temp, f_temp, sf_temp;
mac_rlc_status_resp_t rlc_status; //Declare rlc_status
I_mcs = get_I_mcs(UE_info->CE_level);
//I_mcs = get_I_mcs(UE_info->CE_level);
I_mcs = 6;
I_tbs = I_mcs;
//get max TBS
TBS = get_max_tbs(I_tbs);
......@@ -180,7 +191,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
/*Loop all NPDCCH candidate position*/
for(cdd_num=0;cdd_num<UE_info->R_max/UE_sched_ctrl_info->R_dci;++cdd_num)
{
LOG_I(MAC,"[%04d][DLSchedulerUSS] Candidate num %d DCI Rep %d DCI Rmax: %d\n",mac_inst->current_subframe, cdd_num, UE_sched_ctrl_info->R_dci,UE_info->R_max);
LOG_I(MAC,"[%04d][DLSchedulerUSS] Candidate num %d DCI Rep %d DCI Rmax: %d rep : %d\n",mac_inst->current_subframe, cdd_num, UE_sched_ctrl_info->R_dci,UE_info->R_max,UE_sched_ctrl_info->R_dl_data);
/*Check NPDCCH Resource*/
end_flagCCH = check_resource_NPDCCH_NB_IoT(mac_inst, hyperSF_start, frame_start, subframe_start, NPDCCH_info, cdd_num, UE_info->R_dci);
......@@ -271,6 +282,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
UE_sched_ctrl_info->dci_n1_index_delay=I_delay;
UE_sched_ctrl_info->dci_n1_index_ack_nack=HARQ_info->ACK_NACK_resource_field;
UE_sched_ctrl_info->total_data_size_dl=data_size;
UE_sched_ctrl_info->dci_n1_index_R_data = from_R_dl_to_idx(UE_sched_ctrl_info->R_dl_data);
}
LOG_I(MAC,"[%04d][DLSchedulerUSS][%d][Success] Complete scheduling with data size %d\n", mac_inst->current_subframe, UE_info->rnti, data_size);
//LOG_D(MAC,"[%04d][DLSchedulerUSS] RNTI %d\n", mac_inst->current_subframe, UE_info->rnti);
......@@ -500,7 +512,9 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->LCID = DCCH0_NB_IoT;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->F2=0;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->R=0;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->E=1;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->E=0;
//((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->E=1;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->F=0;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->L=(uint8_t)sdu_length[i];
num_subheader--;
......@@ -522,6 +536,7 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch
}
}
}
/*
if(flag_end_padding==1)
{
mac_header->LCID=PADDING;
......@@ -531,6 +546,7 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch
mac_header++;
offset++;
}
*/
return offset;
}
void fill_DCI_N1(DCIFormatN1_t *DCI_N1, UE_TEMPLATE_NB_IoT *UE_info, UE_SCHED_CTRL_NB_IoT_t *UE_sched_ctrl_info)
......@@ -540,7 +556,7 @@ void fill_DCI_N1(DCIFormatN1_t *DCI_N1, UE_TEMPLATE_NB_IoT *UE_info, UE_SCHED_CT
DCI_N1->Scheddly = UE_sched_ctrl_info->dci_n1_index_delay;
DCI_N1->ResAssign =UE_sched_ctrl_info->dci_n1_index_sf;
DCI_N1->mcs = UE_sched_ctrl_info->dci_n1_index_mcs;
DCI_N1->RepNum = UE_sched_ctrl_info->dci_n1_index_sf;
DCI_N1->RepNum = UE_sched_ctrl_info->dci_n1_index_R_data;
DCI_N1->HARQackRes = UE_sched_ctrl_info->dci_n1_index_ack_nack;
//DCI_N1->DCIRep = 3-UE_info->R_max/UE_info->R_dci/2;
DCI_N1->DCIRep=get_DCI_REP(UE_sched_ctrl_info->R_dci, UE_info->R_max);
......
......@@ -180,7 +180,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource = ((DCIFormatN1_t *)DCI_pdu)->HARQackRes;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication = ((DCIFormatN1_t *)DCI_pdu)->orderIndicator;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number = ((DCIFormatN1_t *)DCI_pdu)->DCIRep;
LOG_D(MAC,"[hypersfn:%2d][frame:%2d][subframe:%2d]NB-IoT fill DL DCI, res:%d\n",hypersfn,frame,subframe,dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.resource_assignment);
LOG_N(MAC,"[hypersfn:%2d][frame:%2d][subframe:%2d]NB-IoT fill DL DCI, res:%d, rep:%d\n",hypersfn,frame,subframe,dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.resource_assignment,((DCIFormatN1_t *)DCI_pdu)->RepNum);
}else if(schedule_result_list_DL->direction == UL) // DCI for uplink
{
......
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