Commit f23b331a authored by Haruki NAOI's avatar Haruki NAOI

Change RA procedure DCI allocation.

parent 5f484004
......@@ -331,6 +331,11 @@ void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
FILE *fd;
if(-1 == (access("prach_config.txt",F_OK))){
creat("prach_config.txt", 0644);
}else{
chmod("prach_config.txt", 0644);
}
fd = fopen("prach_config.txt","w");
fprintf(fd,"prach_config: subframe = %d\n",subframe);
fprintf(fd,"prach_config: N_RB_UL = %d\n",frame_parms->N_RB_UL);
......
......@@ -52,8 +52,19 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_
(eNB->uci_vars[i].subframe==subframe)) return(i);
else if ((eNB->uci_vars[i].active == 0) && (first_free_index==-1)) first_free_index=i;
}
if (type == SEARCH_EXIST) return(-1);
else return(first_free_index);
if (type == SEARCH_EXIST){
LOG_E(PHY, "find_uci find_type is SEARCH_EXIST , return -1\n");
return(-1);
}
else{
if(first_free_index < 0){
LOG_E(PHY, "find_uci first_free_index = %d,rnti = %d,frame = %d,subframe = %d, last i = %d\n",first_free_index,rnti,frame,subframe, i);
for (i=0; i<NUMBER_OF_UCI_VARS_MAX; i++) {
LOG_T(PHY, "eNB->uci_vars[%d]\tactive = %d\trnti = %x\tframe = %d\tsubframe = %d\t type %d\n",i,eNB->uci_vars[i].active,eNB->uci_vars[i].rnti,eNB->uci_vars[i].frame,eNB->uci_vars[i].subframe,eNB->uci_vars[i].type);
}
}
return(first_free_index);
}
}
......
......@@ -189,7 +189,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(10, ra->msg3_nb_rb);
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(ra->msg3_mcs, ra->msg3_nb_rb);
ul_req_body->number_of_pdus++;
ul_req_body->tl.tag = NFAPI_UL_CONFIG_REQUEST_BODY_TAG;
ul_req->sfn_sf = ra->Msg3_frame<<4|ra->Msg3_subframe;
......@@ -571,6 +571,11 @@ void generate_Msg2(module_id_t module_idP,
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 = ;
// Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF = 0;
dl_req_body->number_pdu++;
mac->DL_req[CC_idP].sfn_sf = frameP<<4 | subframeP;
// Program UL processing for Msg3
......@@ -978,6 +983,7 @@ generate_Msg4(module_id_t module_idP,
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG;
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.handle = 0; // don't know how to use this
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti = ra->rnti;
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.ue_id = UE_id;
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.tl.tag = NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG;
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.ue_type = (ra->rach_resource_type < 3) ? 1 : 2;
ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel13.empty_symbols = 0;
......
......@@ -85,11 +85,11 @@ fill_rar(const module_id_t module_idP,
ra->msg3_first_rb = 2;
}
}
ra->msg3_nb_rb = 1;
ra->msg3_nb_rb = 3;
uint16_t rballoc = mac_computeRIV(N_RB_UL, ra->msg3_first_rb, ra->msg3_nb_rb); // first PRB only for UL Grant
rar[1] |= (rballoc >> 7) & 7; // Hopping = 0 (bit 3), 3 MSBs of rballoc
rar[2] = ((uint8_t) (rballoc & 0xff)) << 1; // 7 LSBs of rballoc
ra->msg3_mcs = 10;
ra->msg3_mcs = 1;
ra->msg3_TPC = 3;
ra->msg3_ULdelay = 0;
ra->msg3_cqireq = 0;
......
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