Commit 8e91fab0 authored by Nick Ho's avatar Nick Ho

fix RAR issue, RAR can be recieved by UE now

parent 3e641f4f
......@@ -108,6 +108,7 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
int dci_candidate, i, num_candidate;
int msg2_i_delay;
int msg3_scheduling_delay;
static uint16_t tc_rnti = 0x0101;
int rep=1;
sched_temp_UL_NB_IoT_t npusch_info;
......@@ -153,14 +154,14 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
fail|=0x1;
}
// check msg2 resource
uint32_t TBS, I_tbs, I_mcs, I_sf, Nrep;
uint32_t TBS, I_tbs, I_mcs, I_sf, Nrep, RAR_TBS;
I_mcs = get_I_mcs(msg2_nodes->ce_level);
I_tbs = I_mcs;
TBS = get_tbs(7, I_tbs, &I_sf); // rar 7 bytes
Nrep = dl_rep[msg2_nodes->ce_level];
num_msg2_subframe = get_num_sf(I_sf) * Nrep;
RAR_TBS = TBS*8;
//num_msg2_subframe = 8;
msg2_i_delay = find_suit_i_delay(rmax, r, dci_candidate);
......@@ -250,7 +251,7 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
// for msg2
msg2_result->output_subframe = msg2_first_subframe;//msg2_subframe;
msg2_result->end_subframe = msg2_end_subframe;
msg2_result->sdu_length = 56; // rar size
msg2_result->sdu_length = RAR_TBS; // rar size
msg2_result->DLSCH_pdu = msg2_nodes->rar_buffer;
msg2_result->direction = DL;
msg2_result->DCI_release = 1;
......
......@@ -322,7 +322,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
SCHED_info->DL_req->dl_config_request_body.number_pdu = 1;
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = 2+sizeof(nfapi_dl_config_ndlsch_pdu_rel13_t);
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.length = (schedule_result_list_DL->sdu_length)*8;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.length = schedule_result_list_DL->sdu_length;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.pdu_index = 1;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti_type = 1;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti = schedule_result_list_DL->rnti; // C-RNTI
......@@ -338,7 +338,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
LOG_D(MAC,"[hypersfn:%2d][frame:%2d][subframe:%2d]NB-IoT fill SIBs\n",hypersfn,frame,subframe);
}else
LOG_D(MAC,"[hypersfn:%2d][frame:%2d][subframe:%2d]NB-IoT fill DL Data\n",hypersfn,frame,subframe);
LOG_D(MAC,"[hypersfn:%2d][frame:%2d][subframe:%2d]NB-IoT fill DL Data, length = %d\n",hypersfn,frame,subframe,dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.length);
//LOG_D(MAC,"A NB-IoT fill DL Data pdu : %d \n",schedule_result_list_DL->DLSCH_pdu);
......
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