diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index 0dfaf242a69f5ab5a21a3cf36be0e76032b52e2c..ba26dda38d1740a243a36b8d79c6734406dfccf7 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -396,7 +396,10 @@ ue_send_sdu( for (i=0; i<6; i++) if (tx_sdu[i] != payload_ptr[i]) { LOG_E(MAC,"[UE %d][RAPROC] Contention detected, RA failed\n",module_idP); - ra_failed(module_idP,CC_id,eNB_index); + // Panos: Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to + // PRACH state. + UE_mac_inst[module_idP].UE_mode[eNB_index] = PRACH; + //ra_failed(module_idP,CC_id,eNB_index); UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT); return; @@ -417,7 +420,8 @@ ue_send_sdu( #ifdef DEBUG_HEADER_PARSING LOG_D(MAC,"[UE] CE %d : UE Timing Advance : %d\n",i,payload_ptr[0]); #endif - process_timing_advance(module_idP,CC_id,payload_ptr[0]); + // Panos: Eliminate call to process_timing_advance for the phy_stub UE operation mode. Is this correct? + //process_timing_advance(module_idP,CC_id,payload_ptr[0]); payload_ptr++; break; @@ -1592,7 +1596,7 @@ for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid // build PHR and update the timers if (phr_ce_len == sizeof(POWER_HEADROOM_CMD)) { - //Panos: Substitute with a static value for the MAC layer abstraction + //Panos: Substitute with a static value for the MAC layer abstraction (phy_stub mode) //phr_p->PH = get_phr_mapping(module_idP,CC_id,eNB_index); phr_p->PH = 40; phr_p->R = 0; diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index a11355cee5ebe2ac32d9b33a010c361d66fd302e..c1c4b94befbf8cc2532754ab460346e09717053e 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -17,6 +17,9 @@ //extern uint8_t nfapi_pnf; //UL_IND_t *UL_INFO; +void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); +void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); + void fill_rx_indication_UE_MAC(module_id_t Mod_id,int frame,int subframe, UL_IND_t* UL_INFO, uint8_t *ulsch_buffer, uint16_t buflen, uint16_t rnti) @@ -865,6 +868,50 @@ int dl_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_ +int hi_dci0_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req) +{ + LOG_D(PHY,"[UE-PHY_STUB] hi dci0 request sfn_sf:%d number_of_dci:%d number_of_hi:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), req->hi_dci0_request_body.number_of_dci, req->hi_dci0_request_body.number_of_hi); + + //phy_info* phy = (phy_info*)(pnf_p7->user_data); + + module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change. + + /*struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; + eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];*/ + + for (int i=0; i<req->hi_dci0_request_body.number_of_dci + req->hi_dci0_request_body.number_of_hi; i++) + { + LOG_D(PHY,"[UE-PHY_STUB] HI_DCI0_REQ sfn_sf:%d PDU[%d]\n", NFAPI_SFNSF2DEC(req->sfn_sf), i); + + if (req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) + { + LOG_D(PHY,"[UE-PHY_STUB] HI_DCI0_REQ sfn_sf:%d PDU[%d] - NFAPI_HI_DCI0_DCI_PDU_TYPE not used \n", NFAPI_SFNSF2DEC(req->sfn_sf), i); + + } + else if (req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type == NFAPI_HI_DCI0_HI_PDU_TYPE) + { + LOG_D(PHY,"[UE-PHY_STUB] HI_DCI0_REQ sfn_sf:%d PDU[%d] - NFAPI_HI_DCI0_HI_PDU_TYPE\n", NFAPI_SFNSF2DEC(req->sfn_sf), i); + + nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu = &req->hi_dci0_request_body.hi_dci0_pdu_list[i]; + + // This is meaningful only after ACKnowledging the first ULSCH Txon (i.e. Msg3) + if(hi_dci0_req_pdu->hi_pdu.hi_pdu_rel8.hi_value == 1 && UE_mac_inst[Mod_id].first_ULSCH_Tx == 1){ + UE_mac_inst[Mod_id].UE_mode[0] = PUSCH; + UE_mac_inst[Mod_id].first_ULSCH_Tx = 0; + } + + } + else + { + LOG_E(PHY,"[UE-PHY_STUB] HI_DCI0_REQ sfn_sf:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), i, req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type); + } + } + + return 0; +} + + + /*void handle_nfapi_UE_Rx(uint8_t Mod_id, Sched_Rsp_t *Sched_INFO, int eNB_id){ // copy data from eNB L2 interface to UE L2 interface diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.h b/openair2/PHY_INTERFACE/phy_stub_UE.h index a893a7f4cda0aca027a06d845c83bdec8e1d6cbd..979358716196b6a344d9a95c2dac8c616b8de084 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.h +++ b/openair2/PHY_INTERFACE/phy_stub_UE.h @@ -80,5 +80,8 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, int tx_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req); +int hi_dci0_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req); + + #endif /* PHY_STUB_UE_H_ */