Commit c4a81c22 authored by Raymond Knopp's avatar Raymond Knopp

changes for TDD signaling.

parent f8f6f003
...@@ -2660,7 +2660,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ...@@ -2660,7 +2660,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7) else if(ulsch->harq_processes[harq_pid]->n_DMRS == 7)
ulsch->harq_processes[harq_pid]->n_DMRS2 = 9; ulsch->harq_processes[harq_pid]->n_DMRS2 = 9;
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d ulsch_pdu:rvidx:%d\n", LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d, Subframe %d Programming PUSCH with n_DMRS2 %d (cshift %d) ulsch:ndi:%d ulsch_pdu:ndi:%d new_ulsch:%d status:%d ulsch_pdu:rvidx:%d\n",
eNB->Mod_id,harq_pid,frame,subframe, eNB->Mod_id,harq_pid,frame,subframe,
ulsch->harq_processes[harq_pid]->n_DMRS2, ulsch->harq_processes[harq_pid]->n_DMRS2,
ulsch->harq_processes[harq_pid]->n_DMRS, ulsch->harq_processes[harq_pid]->n_DMRS,
...@@ -2692,7 +2692,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame ...@@ -2692,7 +2692,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame
else ulsch->harq_processes[harq_pid]->round++; else ulsch->harq_processes[harq_pid]->round++;
ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti; ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti;
LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, status %d, handled %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n", LOG_I(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, status %d, handled %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
ulsch->rnti, ulsch->rnti,
UE_id, UE_id,
new_ulsch, new_ulsch,
...@@ -6465,9 +6465,9 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t ...@@ -6465,9 +6465,9 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t
{ {
uint8_t ret = 255; uint8_t ret = 255;
if (frame_parms->frame_type == FDD) { // if (frame_parms->frame_type == FDD) {
ret = (((frame*10)+subframe)&7); ret = (((frame*10)+subframe)&7);
} else { /* } else {
switch (frame_parms->tdd_config) { switch (frame_parms->tdd_config) {
...@@ -6535,6 +6535,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t ...@@ -6535,6 +6535,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t
AssertFatal(ret!=255, AssertFatal(ret!=255,
"invalid harq_pid(%d) at SFN/SF = %d/%d\n", (int8_t)ret, frame, subframe); "invalid harq_pid(%d) at SFN/SF = %d/%d\n", (int8_t)ret, frame, subframe);
*/
return ret; return ret;
} }
......
...@@ -537,7 +537,7 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, ...@@ -537,7 +537,7 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) { if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
"No existing UE ULSCH for rnti %x\n",rel8->rnti); "No existing UE ULSCH for rnti %x\n",rel8->rnti);
LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d, modulation %d, rvidx %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version); LOG_I(PHY,"Applying UL config for UE %d, rnti %x in frame %d, subframe %d, modulation %d, rvidx %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version);
fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe); fill_ulsch(eNB,&ul_config_pdu->ulsch_pdu,frame,subframe);
...@@ -655,7 +655,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -655,7 +655,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
eNB->pdcch_vars[subframe&1].num_dci = 0; eNB->pdcch_vars[subframe&1].num_dci = 0;
eNB->phich_vars[subframe&1].num_hi = 0; eNB->phich_vars[subframe&1].num_hi = 0;
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d hi_dci0:SFN/SF:%04d%d:pdus:%d ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n", LOG_I(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d hi_dci0:SFN/SF:%04d%d:pdus:%d ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n",
frame,subframe, frame,subframe,
NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu, NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu,
NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus, NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus,
...@@ -831,7 +831,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) ...@@ -831,7 +831,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
else { else {
for (i=0;i<number_ul_pdu;i++) { for (i=0;i<number_ul_pdu;i++) {
ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i]; ul_config_pdu = &UL_req->ul_config_request_body.ul_config_pdu_list[i];
LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type); LOG_I(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE || AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE || ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ||
ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE || ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE ||
......
...@@ -841,7 +841,7 @@ lte_subframe_t get_subframe_direction(uint8_t Mod_id,uint8_t CC_id,uint8_t subfr ...@@ -841,7 +841,7 @@ lte_subframe_t get_subframe_direction(uint8_t Mod_id,uint8_t CC_id,uint8_t subfr
uint8_t phich_subframe_to_harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe) uint8_t phich_subframe_to_harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe)
{ {
//LOG_D(PHY,"phich_subframe_to_harq_pid.c: frame %d, subframe %d\n",frame,subframe); LOG_I(PHY,"phich_subframe_to_harq_pid.c: frame %d, subframe %d\n",frame,subframe);
return(subframe2harq_pid(frame_parms, return(subframe2harq_pid(frame_parms,
phich_frame2_pusch_frame(frame_parms,frame,subframe), phich_frame2_pusch_frame(frame_parms,frame,subframe),
phich_subframe2_pusch_subframe(frame_parms,subframe))); phich_subframe2_pusch_subframe(frame_parms,subframe)));
......
...@@ -1157,13 +1157,13 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1157,13 +1157,13 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
const int subframe = proc->subframe_rx; const int subframe = proc->subframe_rx;
const int frame = proc->frame_rx; const int frame = proc->frame_rx;
if (fp->frame_type == FDD) harq_pid = ((10*frame) + subframe)&7; harq_pid = ((10*frame) + subframe)&7;
else harq_pid = subframe%10;
LOG_I(PHY,"Running eNB pusch procedures in %d.%d, harq_pid %d\n",frame,subframe,harq_pid);
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
ulsch = eNB->ulsch[i]; ulsch = eNB->ulsch[i];
ulsch_harq = ulsch->harq_processes[harq_pid]; ulsch_harq = ulsch->harq_processes[harq_pid];
if (ulsch->rnti>0) LOG_D(PHY,"eNB->ulsch[%d]->harq_processes[harq_pid:%d] SFN/SF:%04d%d: PUSCH procedures, UE %d/%x ulsch_harq[status:%d SFN/SF:%04d%d handled:%d]\n", if (ulsch->rnti>0) LOG_I(PHY,"eNB->ulsch[%d]->harq_processes[harq_pid:%d] SFN/SF:%04d%d: PUSCH procedures, UE %d/%x ulsch_harq[status:%d SFN/SF:%04d%d handled:%d]\n",
i, harq_pid, frame,subframe,i,ulsch->rnti, i, harq_pid, frame,subframe,i,ulsch->rnti,
ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled); ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled);
...@@ -1182,7 +1182,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1182,7 +1182,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31)); eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
} }
LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", eNB->Mod_id, frame, subframe, i); LOG_I(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d \n", eNB->Mod_id, frame, subframe, i);
nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]; nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1];
...@@ -1190,7 +1190,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1190,7 +1190,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
nPRS)%12; nPRS)%12;
LOG_D(PHY, LOG_I(PHY,
"[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, ), O_ACK %d, beta_cqi %d \n", "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, Qm %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, ), O_ACK %d, beta_cqi %d \n",
eNB->Mod_id,harq_pid,frame,subframe, eNB->Mod_id,harq_pid,frame,subframe,
ulsch_harq->dci_alloc, ulsch_harq->dci_alloc,
...@@ -1223,7 +1223,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1223,7 +1223,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
stop_meas(&eNB->ulsch_decoding_stats); stop_meas(&eNB->ulsch_decoding_stats);
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d ulsch_harq->cqi_crc_status:%d ackBits:%d ulsch_decoding_stats[t:%lld max:%lld]\n", LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d ulsch_harq->cqi_crc_status:%d ackBits:%d ulsch_decoding_stats[t:%lld max:%lld]\n",
eNB->Mod_id,harq_pid, eNB->Mod_id,harq_pid,
frame,subframe, frame,subframe,
ulsch->rnti, ulsch->rnti,
...@@ -1259,7 +1259,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1259,7 +1259,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC fill_crc_indication(eNB,i,frame,subframe,1); // indicate NAK to MAC
fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC fill_rx_indication(eNB,i,frame,subframe); // indicate SDU to MAC
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n", LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
eNB->Mod_id,harq_pid, eNB->Mod_id,harq_pid,
frame,subframe, i, frame,subframe, i,
ulsch_harq->round, ulsch_harq->round,
......
...@@ -476,7 +476,7 @@ copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -476,7 +476,7 @@ copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
nfapi_ul_config_request_pdu_t *ul_req_pdu = ul_req->ul_config_request_body.ul_config_pdu_list; nfapi_ul_config_request_pdu_t *ul_req_pdu = ul_req->ul_config_request_body.ul_config_pdu_list;
*ul_req = *ul_req_tmp; *ul_req = *ul_req_tmp;
LOG_D(MAC,"SFN.SF %d.%d: Copying %d UL pdus to UL_req (sfn_sf %d.%d)\n",frameP,subframeP,ul_req->ul_config_request_body.number_of_pdus,ul_req->sfn_sf>>4,ul_req->sfn_sf&0xf);
// Restore the pointer // Restore the pointer
ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu; ul_req->ul_config_request_body.ul_config_pdu_list = ul_req_pdu;
ul_req->sfn_sf = (frameP<<4) + subframeP; ul_req->sfn_sf = (frameP<<4) + subframeP;
...@@ -484,9 +484,10 @@ copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -484,9 +484,10 @@ copy_ulreq(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
if (ul_req->ul_config_request_body.number_of_pdus>0) if (ul_req->ul_config_request_body.number_of_pdus>0)
{ {
LOG_D(PHY, "%s() active NOW (frameP:%d subframeP:%d) pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req->ul_config_request_body.number_of_pdus); LOG_D(MAC, "%s() active NOW (frameP:%d subframeP:%d) pdus:%d\n", __FUNCTION__, frameP, subframeP, ul_req->ul_config_request_body.number_of_pdus);
} }
memcpy((void*)ul_req->ul_config_request_body.ul_config_pdu_list, memcpy((void*)ul_req->ul_config_request_body.ul_config_pdu_list,
(void*)ul_req_tmp->ul_config_request_body.ul_config_pdu_list, (void*)ul_req_tmp->ul_config_request_body.ul_config_pdu_list,
ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t)); ul_req->ul_config_request_body.number_of_pdus*sizeof(nfapi_ul_config_request_pdu_t));
......
...@@ -126,9 +126,9 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, ...@@ -126,9 +126,9 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
ra->rach_resource_type - 1, ra->Msg3_frame, ra->rach_resource_type - 1, ra->Msg3_frame,
ra->Msg3_subframe); ra->Msg3_subframe);
LOG_D(MAC, LOG_D(MAC,
"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d)\n", "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d), harq_pid %d\n",
frameP, subframeP, ra->Msg3_frame, ra->Msg3_subframe, frameP, subframeP, ra->Msg3_frame, ra->Msg3_subframe,
ra->msg3_nb_rb, ra->msg3_round); ra->msg3_nb_rb, ra->msg3_round,((10 * ra->Msg3_frame) + ra->Msg3_subframe) & 7);
ul_config_pdu = ul_config_pdu =
&ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
...@@ -195,7 +195,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, ...@@ -195,7 +195,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.frequency_hopping_bits = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.frequency_hopping_bits = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.new_data_indication = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = rvseq[ra->msg3_round]; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.redundancy_version = rvseq[ra->msg3_round];
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = subframe2harqpid(cc, ra->Msg3_frame, ra->Msg3_subframe); ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.harq_process_number = ((ra->Msg3_frame*10)+ra->Msg3_subframe)&7;//subframe2harqpid(cc, ra->Msg3_frame, ra->Msg3_subframe);
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; 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.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
...@@ -470,7 +470,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -470,7 +470,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
// Program UL processing for Msg3, same as regular LTE // Program UL processing for Msg3, same as regular LTE
get_Msg3alloc(&cc[CC_idP], subframeP, frameP, get_Msg3alloc(&cc[CC_idP], subframeP, frameP,
&ra->Msg3_frame, &ra->Msg3_subframe); &ra->Msg3_frame, &ra->Msg3_subframe);
add_msg3(module_idP, CC_idP, ra, frameP, subframeP); //add_msg3(module_idP, CC_idP, ra, frameP, subframeP);
fill_rar_br(mac, CC_idP, ra, frameP, subframeP, fill_rar_br(mac, CC_idP, ra, frameP, subframeP,
cc[CC_idP].RAR_pdu.payload, cc[CC_idP].RAR_pdu.payload,
ra->rach_resource_type - 1); ra->rach_resource_type - 1);
...@@ -572,7 +572,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -572,7 +572,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
ra->Msg3_subframe); ra->Msg3_subframe);
fill_rar(module_idP, CC_idP, ra, frameP, cc[CC_idP].RAR_pdu.payload, N_RB_DL, 7); fill_rar(module_idP, CC_idP, ra, frameP, cc[CC_idP].RAR_pdu.payload, N_RB_DL, 7);
add_msg3(module_idP, CC_idP, ra, frameP, subframeP); //add_msg3(module_idP, CC_idP, ra, frameP, subframeP);
ra->state = WAITMSG3; ra->state = WAITMSG3;
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP); LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP);
...@@ -1359,6 +1359,8 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -1359,6 +1359,8 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
LOG_D(MAC,"Schedule_RA %d.%d is_UL_sf %d\n",frameP,subframeP,is_UL_sf(&cc[CC_id],subframeP));
// skip UL component carriers if TDD // skip UL component carriers if TDD
if (is_UL_sf(&cc[CC_id], subframeP) == 1) if (is_UL_sf(&cc[CC_id], subframeP) == 1)
continue; continue;
...@@ -1368,7 +1370,7 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -1368,7 +1370,7 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
ra = (RA_t *) & cc[CC_id].ra[i]; ra = (RA_t *) & cc[CC_id].ra[i];
//LOG_D(MAC,"RA[state:%d]\n",ra->state); LOG_I(MAC,"RA[state:%d]\n",ra->state);
if (ra->state == MSG2) if (ra->state == MSG2)
generate_Msg2(module_idP, CC_id, frameP, subframeP, ra); generate_Msg2(module_idP, CC_id, frameP, subframeP, ra);
...@@ -1378,6 +1380,13 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -1378,6 +1380,13 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
check_Msg4_retransmission(module_idP, CC_id, frameP, check_Msg4_retransmission(module_idP, CC_id, frameP,
subframeP, ra); subframeP, ra);
int absSF = (frameP*10)+subframeP;
int msg3_absSF = (ra->Msg3_frame*10) + ra->Msg3_subframe;
// This is done here to account for delay in TDD programming of Msg3
if (ra->state == WAITMSG3 && ((absSF+4)%10240) == msg3_absSF) add_msg3(module_idP, CC_id, ra, frameP, subframeP);
} // for i=0 .. N_RA_PROC-1 } // for i=0 .. N_RA_PROC-1
} // CC_id } // CC_id
...@@ -1417,7 +1426,7 @@ initiate_ra_proc(module_id_t module_idP, ...@@ -1417,7 +1426,7 @@ initiate_ra_proc(module_id_t module_idP,
#endif /* Rel14 */ #endif /* Rel14 */
LOG_D(MAC, LOG_I(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n", "[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",
module_idP, CC_id, frameP, subframeP, preamble_index); module_idP, CC_id, frameP, subframeP, preamble_index);
#ifdef Rel14 #ifdef Rel14
......
...@@ -308,6 +308,34 @@ get_Msg3allocret(COMMON_channels_t * cc, ...@@ -308,6 +308,34 @@ get_Msg3allocret(COMMON_channels_t * cc,
} }
} }
uint8_t pusch_sf_to_phich_sfoffset(COMMON_channels_t * cc, sub_frame_t subframe) {
if (cc->tdd_Config == NULL) return(4);
else
switch (cc->tdd_Config->subframeAssignment) {
case 0:
if (subframe==2 || subframe==7) return(4);
else if (subframe==3 || subframe==8) return(7);
else if (subframe==4 || subframe==9) return(6);
break;
case 1:
if (subframe==2 || subframe==7) return(4);
else return(6);
break;
case 2:
case 3:
case 4:
case 5:
return (6);
break;
case 6:
if (subframe==2 || subframe==7) return(4);
else if (subframe==3 || subframe==4) return(6);
else if (subframe==8) return(7);
break;
}
}
uint8_t uint8_t
subframe2harqpid(COMMON_channels_t * cc, frame_t frame, subframe2harqpid(COMMON_channels_t * cc, frame_t frame,
sub_frame_t subframe) sub_frame_t subframe)
...@@ -316,9 +344,9 @@ subframe2harqpid(COMMON_channels_t * cc, frame_t frame, ...@@ -316,9 +344,9 @@ subframe2harqpid(COMMON_channels_t * cc, frame_t frame,
AssertFatal(cc != NULL, "cc is null\n"); AssertFatal(cc != NULL, "cc is null\n");
if (cc->tdd_Config == NULL) { // FDD // if (cc->tdd_Config == NULL) { // FDD
ret = (((frame << 1) + subframe) & 7); ret = (((frame << 1) + subframe) & 7);
} else { /* } else {
switch (cc->tdd_Config->subframeAssignment) { switch (cc->tdd_Config->subframeAssignment) {
case 1: case 1:
if ((subframe == 2) || if ((subframe == 2) ||
...@@ -381,6 +409,7 @@ subframe2harqpid(COMMON_channels_t * cc, frame_t frame, ...@@ -381,6 +409,7 @@ subframe2harqpid(COMMON_channels_t * cc, frame_t frame,
(int) cc->tdd_Config->subframeAssignment); (int) cc->tdd_Config->subframeAssignment);
} }
} }
*/
return ret; return ret;
} }
......
...@@ -224,7 +224,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -224,7 +224,7 @@ rx_sdu(const module_id_t enb_mod_idP,
radioResourceConfigCommon->rach_ConfigCommon. radioResourceConfigCommon->rach_ConfigCommon.
maxHARQ_Msg3Tx); maxHARQ_Msg3Tx);
LOG_D(MAC, LOG_I(MAC,
"[eNB %d][PUSCH %d] CC_id %d [RAPROC Msg3] Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n", "[eNB %d][PUSCH %d] CC_id %d [RAPROC Msg3] Received ULSCH sdu round %d from PHY (rnti %x, RA_id %d) ul_cqi %d\n",
enb_mod_idP, harq_pid, CC_idP, ra[RA_id].msg3_round, enb_mod_idP, harq_pid, CC_idP, ra[RA_id].msg3_round,
current_rnti, RA_id, ul_cqi); current_rnti, RA_id, ul_cqi);
...@@ -232,7 +232,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -232,7 +232,7 @@ rx_sdu(const module_id_t enb_mod_idP,
first_rb = ra->msg3_first_rb; first_rb = ra->msg3_first_rb;
if (sduP == NULL) { // we've got an error on Msg3 if (sduP == NULL) { // we've got an error on Msg3
LOG_D(MAC, LOG_I(MAC,
"[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n", "[eNB %d] CC_id %d, RA %d ULSCH in error in round %d/%d\n",
enb_mod_idP, CC_idP, RA_id, enb_mod_idP, CC_idP, RA_id,
ra[RA_id].msg3_round, ra[RA_id].msg3_round,
...@@ -704,7 +704,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -704,7 +704,7 @@ rx_sdu(const module_id_t enb_mod_idP,
hi_dci0_req_body->number_of_hi++; hi_dci0_req_body->number_of_hi++;
hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP,subframeP, 0); hi_dci0_req_body->sfnsf = sfnsf_add_subframe(frameP,subframeP, 0);
hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG; hi_dci0_req_body->tl.tag = NFAPI_HI_DCI0_REQUEST_BODY_TAG;
hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP,subframeP, 4); hi_dci0_req->sfn_sf = sfnsf_add_subframe(frameP,subframeP, pusch_sf_to_phich_sfoffset(& RC.mac[enb_mod_idP]->common_channels[CC_idP],subframeP));
hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST;
/* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */ /* NN--> FK: we could either check the payload, or use a phy helper to detect a false msg3 */
......
...@@ -1034,6 +1034,8 @@ uint8_t getQm(uint8_t mcs); ...@@ -1034,6 +1034,8 @@ uint8_t getQm(uint8_t mcs);
uint8_t subframe2harqpid(COMMON_channels_t * cc, frame_t frame, uint8_t subframe2harqpid(COMMON_channels_t * cc, frame_t frame,
sub_frame_t subframe); sub_frame_t subframe);
uint8_t pusch_sf_to_phich_sfoffset(COMMON_channels_t * cc, sub_frame_t subframe);
void get_srs_pos(COMMON_channels_t * cc, uint16_t isrs, void get_srs_pos(COMMON_channels_t * cc, uint16_t isrs,
uint16_t * psrsPeriodicity, uint16_t * psrsOffset); uint16_t * psrsPeriodicity, uint16_t * psrsOffset);
......
...@@ -595,7 +595,7 @@ void UL_indication(UL_IND_t *UL_info) ...@@ -595,7 +595,7 @@ void UL_indication(UL_IND_t *UL_info)
sched_info->DL_req = &mac->DL_req[CC_id]; sched_info->DL_req = &mac->DL_req[CC_id];
sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id]; sched_info->HI_DCI0_req = &mac->HI_DCI0_req[CC_id];
if ((mac->common_channels[CC_id].tdd_Config==NULL) || if ((mac->common_channels[CC_id].tdd_Config==NULL) ||
(is_UL_sf(&mac->common_channels[CC_id],(sched_info->subframe+sf_ahead)%10)>0)) (is_UL_sf(&mac->common_channels[CC_id],sched_info->subframe)>0))
sched_info->UL_req = &mac->UL_req[CC_id]; sched_info->UL_req = &mac->UL_req[CC_id];
else else
sched_info->UL_req = NULL; sched_info->UL_req = NULL;
......
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