Commit 230421bc authored by matzakos's avatar matzakos

More stable performance of nfapi-L2-emulator with 2 UEs, after dealing with...

More stable performance of nfapi-L2-emulator with 2 UEs, after dealing with some PNF-VNF synchronization issues.
parent d74c43bd
......@@ -1110,6 +1110,7 @@ int start_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi
}
if(phy_info->timing_info_mode & 0x2) {
//printf("Panos-D: start_request () Enabling timing_info_mode_aperiodic \n");
p7_config->timing_info_mode_aperiodic = 1;
}
......@@ -1177,7 +1178,7 @@ int start_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] DJP - HACK - Set p7_config global ready for subframe ind%s\n", __FUNCTION__);
p7_config_g = p7_config;
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Panos-D: start_request, BUFFER SIZE: %d", p7_config_g->subframe_buffer_size);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Panos-D: start_request, BUFFER SIZE: %d", p7_config_g->subframe_buffer_size);
//printf("Panos-D: start_request, bUFFER SIZE: %d", p7_config_g->subframe_buffer_size);
// Need to wait for main thread to create RU structures
......
......@@ -826,6 +826,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
}
else if(pnf_p7->_public.timing_info_mode_aperiodic && pnf_p7->timing_info_aperiodic_send)
{
printf("Panos-D: Sending aperiodic timing info message \n");
pnf_pack_and_send_timing_info(pnf_p7);
pnf_p7->timing_info_aperiodic_send = 0;
......
......@@ -34,6 +34,7 @@ nfapi_pnf_p7_config_t* nfapi_pnf_p7_config_create()
_this->_public.subframe_buffer_size = 8;
_this->_public.timing_info_mode_periodic = 1;
_this->_public.timing_info_period = 32;
//printf("Panos-D: nfapi_pnf_p7_config_create() Enabling timing_info_mode_aperiodic \n");
_this->_public.timing_info_mode_aperiodic = 1;
_this->_public.checksum_enabled = 1;
......
......@@ -1249,12 +1249,12 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta);
// Panos: Careful here!!!
if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
//if (vnf_pnf_sfnsf_delta>0 || vnf_pnf_sfnsf_delta < 0)
//if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
if (vnf_pnf_sfnsf_delta>0 || vnf_pnf_sfnsf_delta < 0)
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnsf_delta, NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), NFAPI_SFNSF2DEC(ind.last_sfn_sf));
// Panos: Careful here!!!
//vnf_p7->p7_connections[0].sfn_sf = ind.last_sfn_sf;
vnf_p7->p7_connections[0].sfn_sf = ind.last_sfn_sf;
}
}
}
......
......@@ -1479,6 +1479,8 @@ typedef struct {
/// Panos: Phy_stub mode: Boolean variable to distinguish whether a Msg3 or a regular ULSCH data pdu should be generated
/// after the reception of NFAPI_UL_CONFIG_ULSCH_PDU_TYPE.
uint8_t first_ULSCH_Tx;
int ra_frame; // This variable keeps the frame in which the RA started for the specific UE. It is used in order
// to make sure that different UEs RA starts within a number of frames difference.
/// Panos: Pointers to config_request types. Used from nfapi callback functions.
nfapi_dl_config_request_t* dl_config_req;
......
......@@ -1214,7 +1214,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
#endif
{
// This is normal LTE case
LOG_I(MAC, "Panos-D: generate_Msg4 1 ra->Msg4_frame SFN/SF: %d.%d, SFN/SF: %d.%d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP);
LOG_I(MAC, "Panos-D: generate_Msg4 1 ra->Msg4_frame SFN/SF: %d.%d, frameP SFN/SF: %d.%d FOR UE_Mod: %d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP, module_idP);
if ((ra->Msg4_frame == frameP) && (ra->Msg4_subframe == subframeP)) {
// Get RRCConnectionSetup for Piggyback
......@@ -1224,7 +1224,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
rrc_sdu_length = mac_rrc_data_req(module_idP, CC_idP, frameP, CCCH, 1, // 1 transport block
&cc[CC_idP].CCCH_pdu.payload[0], 0); // not used in this case
LOG_D(MAC,
LOG_I(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n",
module_idP, CC_idP, frameP, subframeP, UE_id, rrc_sdu_length);
......@@ -1503,8 +1503,8 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth);
LOG_I(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 for harq_pid %d was acknowledged (round %d)\n",
module_idP, CC_idP, frameP, subframeP, ra->harq_pid, round);
"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 for harq_pid %d was acknowledged (round %d), UE_id: %d \n",
module_idP, CC_idP, frameP, subframeP, ra->harq_pid, round, UE_id);
if (round != 8) {
......
......@@ -1625,7 +1625,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
uint8_t * ulsch_buffer, uint16_t buflen, uint8_t * access_mode)
{
LOG_I(MAC, "Panos-D: UE[%d] In ue_get_sdu() 1 \n", module_idP);
//LOG_I(MAC, "Panos-D: UE[%d] In ue_get_sdu() 1 \n", module_idP);
uint8_t total_rlc_pdu_header_len = 0, rlc_pdu_header_len_last = 0;
uint16_t buflen_remain = 0;
uint8_t bsr_len = 0, bsr_ce_len = 0, bsr_header_len = 0;
......@@ -1655,7 +1655,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
rlc_buffer_occupancy_t lcid_buffer_occupancy_old =
0, lcid_buffer_occupancy_new = 0;
LOG_I(MAC,
LOG_D(MAC,
"[UE %d] MAC PROCESS UL TRANSPORT BLOCK at frame%d subframe %d TBS=%d\n",
module_idP, frameP, subframe, buflen);
......@@ -2206,7 +2206,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
bsr_s, // short bsr
bsr_l, post_padding); // long_bsr
LOG_I(MAC,
LOG_D(MAC,
"[UE %d] Generate header :bufflen %d sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d, total_rlc_pdu_header_len %d, padding %d,post_padding %d, bsr len %d, phr len %d, reminder %d \n",
module_idP, buflen, sdu_length_total, num_sdus, sdu_lengths[0],
sdu_lcids[0], payload_offset, total_rlc_pdu_header_len,
......@@ -2214,7 +2214,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
buflen - sdu_length_total - payload_offset);
// cycle through SDUs and place in ulsch_buffer
if (sdu_length_total) {
LOG_I(MAC, "Panos-D: [UE %d] ue_get_sdu() 2 before copying to ulsch_buffer, SFN/SF: %d/%d \n \n \n", module_idP, frameP, subframe);
//LOG_I(MAC, "Panos-D: [UE %d] ue_get_sdu() 2 before copying to ulsch_buffer, SFN/SF: %d/%d \n \n \n", module_idP, frameP, subframe);
memcpy(&ulsch_buffer[payload_offset], ulsch_buff,
sdu_length_total);
}
......
......@@ -312,7 +312,7 @@ void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subfram
void fill_ulsch_harq_indication_UE_MAC(int Mod_id, int frame,int subframe, UL_IND_t *UL_INFO, nfapi_ul_config_ulsch_harq_information *harq_information, uint16_t rnti)
{
printf(MAC, "Panos-D: fill_ulsch_harq_indication_UE_MAC 1 \n");
//LOG_I(MAC, "Panos-D: fill_ulsch_harq_indication_UE_MAC 1 \n");
//int UE_id = find_dlsch(rnti,eNB,SEARCH_EXIST);
//AssertFatal(UE_id>=0,"UE_id doesn't exist\n");
......@@ -577,7 +577,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
// check if we have received a dci for this ue and ulsch descriptor is configured
if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
LOG_D(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 2 \n");
//LOG_D(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 2 \n");
//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);
LOG_D(PHY,"Applying UL config for UE, rnti %x for frame %d, subframe %d\n",
......@@ -589,7 +589,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
uint8_t access_mode=SCHEDULED_ACCESS;
if(buflen>0){
if(UE_mac_inst[Mod_id].first_ULSCH_Tx == 1){ // Msg3 case
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 2.2 \n");
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 2.2, Mod_id:%d, SFN/SF: %d/%d \n", Mod_id, frame, subframe);
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti);
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti, index);
Msg3_transmitted(Mod_id, 0, frame, 0);
......@@ -601,7 +601,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
}
else {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 2.3 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 2.3 \n");
ue_get_sdu( Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode);
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti);
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_buffer,buflen, rnti, index);
......@@ -610,8 +610,9 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
}
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3 \n");
//AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3 \n");
//AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti);
uint8_t ulsch_buffer[5477] __attribute__ ((aligned(32)));
uint16_t buflen = ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.size;
......@@ -629,20 +630,20 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
}
else {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3.1 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3.1 \n");
ue_get_sdu( Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode);
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti);
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_buffer,buflen, rnti, index);
}
}
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3.2 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3.2 \n");
if(ulsch_harq_information!=NULL)
fill_ulsch_harq_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti);
}
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 4 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 4 \n");
//AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,
// eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti);
......@@ -671,7 +672,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
}
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE) {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 5 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 5 \n");
//AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,
// eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti);
......@@ -705,7 +706,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
}
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 6 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 6 \n");
// AssertFatal((UE_id = find_uci(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti,
// proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No available UE UCI for rnti %x\n",ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti);
......@@ -713,7 +714,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
uint16_t rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti;
nfapi_ul_config_harq_information *ulsch_harq_information = &ul_config_pdu->uci_harq_pdu.harq_information;
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 7 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 7 \n");
fill_uci_harq_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO,ulsch_harq_information, rnti);
}
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) {
......@@ -726,7 +727,8 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
AssertFatal(1==0,"NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE not handled yet\n");
}
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE) {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 8 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 8 \n");
//AssertFatal((UE_id = find_uci(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti,
// proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti);
......@@ -737,7 +739,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
}
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 9 \n");
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 9 \n");
//AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti);
......@@ -934,32 +936,6 @@ int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int timer_frame, int ti
handle_nfapi_ul_pdu_UE_MAC(Mod_id,&req->ul_config_request_body.ul_config_pdu_list[i],sfn,sf,req->ul_config_request_body.srs_present, i);
/*if (UL_INFO->crc_ind.crc_indication_body.number_of_crcs>0)
{
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
oai_nfapi_crc_indication(&UL_INFO->crc_ind);
LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.2 \n");
UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0;
}
if (UL_INFO->rx_ind.rx_indication_body.number_of_pdus>0)
{
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.3 \n");
oai_nfapi_rx_ind(&UL_INFO->rx_ind);
LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.4 \n");
UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0;
}*/
/*if (UL_INFO->rx_ind.rx_indication_body.number_of_pdus>0)
{
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
oai_nfapi_rx_ind(&UL_INFO->rx_ind);
oai_nfapi_crc_indication(&UL_INFO->crc_ind);
//UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0;
}*/
//LOG_D(MAC, "Panos-D: ul_config_req_UE_MAC 3 \n");
}
else
......
......@@ -94,6 +94,7 @@ mac_rrc_data_req(
if((Srb_id & RAB_OFFSET) == BCCH) {
if(RC.rrc[Mod_idP]->carrier[CC_id].SI.Active==0) {
//LOG_D(RRC, "Panos-D: mac_rrc_data_req() 1, BCCH case, RC.rrc[Mod_idP]->carrier[CC_id].SI.Active==0 \n");
return 0;
}
......@@ -183,6 +184,7 @@ mac_rrc_data_req(
#endif
return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
} else {
//LOG_D(RRC, "Panos-D: mac_rrc_data_req() 2 \n");
return(0);
}
}
......@@ -243,6 +245,7 @@ mac_rrc_data_req(
Srb_info->Tx_buffer.payload_size=0;
}
LOG_D(RRC, "mac_rrc_data_req(), Sdu_size: %d \n", Sdu_size);
return (Sdu_size);
}
......
......@@ -3044,7 +3044,7 @@ int decode_BCCH_DLSCH_Message(
sizeof(SystemInformationBlockType1_t) );
LOG_D( RRC, "[UE %"PRIu8"] Decoding First SIB1\n", ctxt_pP->module_id );
LOG_I( RRC, "Panos-D: decode_BCCH_DLSCH_Message1 BEFORE decode_SIB1");
//LOG_I( RRC, "Panos-D: decode_BCCH_DLSCH_Message1 BEFORE decode_SIB1");
//printf("Panos-D: decode_BCCH_DLSCH_Message1 BEFORE decode_SIB1");
decode_SIB1( ctxt_pP, eNB_index, rsrq, rsrp );
}
......@@ -3064,7 +3064,7 @@ int decode_BCCH_DLSCH_Message(
LOG_D( RRC, "[UE %"PRIu8"] Decoding SI for frameP %"PRIu32"\n",
ctxt_pP->module_id,
ctxt_pP->frame );
LOG_I( RRC, "Panos-D: decode_BCCH_DLSCH_Message1 BEFORE OTHER decode_SI");
//LOG_I( RRC, "Panos-D: decode_BCCH_DLSCH_Message1 BEFORE OTHER decode_SI");
//printf("Panos-D: decode_BCCH_DLSCH_Message1 BEFORE OTHER decode_SI");
decode_SI( ctxt_pP, eNB_index );
}
......@@ -3919,7 +3919,7 @@ uint64_t arfcn_to_freq(long arfcn) {
// Dump contents
if ((*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_systemInformation_r8 ||
(*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_criticalExtensionsFuture) {
LOG_I( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n",
LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n",
(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count );
} else {
//LOG_D( RRC, "Panos-D: decode_SI 2.3 \n");
......@@ -3929,7 +3929,7 @@ uint64_t arfcn_to_freq(long arfcn) {
LOG_D( RRC, "Panos-D: decode_SI 3 \n");
for (int i=0; i<(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count; i++) {
LOG_I( RRC, "SI count %d\n", i );
//LOG_I( RRC, "Panos-D: SI count %d\n", i );
struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member *typeandinfo;
typeandinfo = (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.array[i];
......
......@@ -1164,6 +1164,7 @@ rrc_eNB_generate_RRCConnectionReject(
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.payload_size =
do_RRCConnectionReject(ctxt_pP->module_id,
(uint8_t*) RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.Payload);
//LOG_D(RRC,"%s rrc_eNB_generate_RRCConnectionReject() Payload size return value: %d \n", __FUNCTION__, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.payload_size);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"[MSG] RRCConnectionReject\n");
......@@ -1219,6 +1220,10 @@ rrc_eNB_generate_RRCConnectionReestablishment(
SRB_configList,
&ue_context_pP->ue_context.physicalConfigDedicated);
//LOG_D(RRC,"%s rrc_eNB_generate_RRCConnectionReestablishment() Payload size return value: %d \n", __FUNCTION__, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.payload_size);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"[MSG] RRCConnectionReestablishment\n");
......@@ -1953,6 +1958,10 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
do_RRCConnectionReestablishmentReject(ctxt_pP->module_id,
(uint8_t*) RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.Payload);
//LOG_D(RRC,"%s rrc_eNB_generate_RRCConnectionReestablishmentReject() Payload size return value: %d \n", __FUNCTION__, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.payload_size);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"[MSG] RRCConnectionReestablishmentReject\n");
......@@ -5062,6 +5071,10 @@ rrc_eNB_generate_RRCConnectionSetup(
SRB_configList,
&ue_context_pP->ue_context.physicalConfigDedicated);
LOG_D(RRC,"%s rrc_eNB_generate_RRCConnectionSetup() Payload size return value: %d, SFN/SF:%d/%d \n", __FUNCTION__, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Tx_buffer.payload_size, ctxt_pP->frame, ctxt_pP->subframe);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"[MSG] RRC Connection Setup\n");
......
......@@ -1446,6 +1446,10 @@ int main( int argc, char **argv )
printf("Sending sync to all threads\n");
/*if(nfapi_mode==3){
usleep(1000);
}*/
pthread_mutex_lock(&sync_mutex);
sync_var=0;
pthread_cond_broadcast(&sync_cond);
......
......@@ -878,8 +878,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
thread_top_init("UE_phy_stub_thread_rxn_txnp4",1,870000L,1000000L,1000000L);
module_id_t Mod_id = 0;
int init_ra_UE = -1; // This counter is used to initiate the RA of each UE in different SFrames
int global_cnt = 0;
//int init_ra_UE = -1; // This counter is used to initiate the RA of each UE in different SFrames
static __thread int UE_thread_rxtx_retval;
struct rx_tx_thread_data *rtd = arg;
UE_rxtx_proc_t *proc = rtd->proc;
......@@ -905,6 +904,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
UE_mac_inst[Mod_id].dl_config_req = NULL;
UE_mac_inst[Mod_id].ul_config_req = NULL;
UE_mac_inst[Mod_id].hi_dci0_req = NULL;
UE_mac_inst[Mod_id].ra_frame = 0;
tx_request_pdu_list = NULL;
tx_req_num_elems = 0;
UE_mac_inst[Mod_id].tx_req = NULL;
......@@ -949,25 +949,8 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
updateTimes(proc->gotIQs, &t2, 10000, "Delay to wake up UE_Thread_Rx (case 2)");*/
// Process Rx data for one sub-frame
/*if(global_cnt == 0){
init_ra_UE++;
global_cnt++;
}*/
/*if(global_cnt>= 0 && global_cnt<15000)
global_cnt++;
if(global_cnt == 10000 || global_cnt == 15000){
LOG_I(MAC, "Panos-D: global_cnt: %d", global_cnt);
global_cnt++;
init_ra_UE++;
}*/
//if(timer_frame%5 == 0 && timer_subframe%10 == 0)
init_ra_UE++;
//init_ra_UE++;
//Panos: Not sure whether we should put the memory allocation here.
//*** Note we should find the right place to call free(UL_INFO).
......@@ -1045,14 +1028,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
//oai_subframe_ind(timer_frame, timer_subframe);
//LOG_I( MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind \n");
//printf("Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind \n");
/*if(UE_mac_inst[Mod_id].tx_req!= NULL){
printf("Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind 2\n");
tx_req_UE_MAC(UE_mac_inst[Mod_id].tx_req);
}*/
if(UE_mac_inst[Mod_id].dl_config_req!= NULL) {
//LOG_I( MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind 3, NB_UE_INST:%d \n", NB_UE_INST);
dl_config_req_UE_MAC(UE_mac_inst[Mod_id].dl_config_req, Mod_id);
......@@ -1082,9 +1057,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
//#endif
}
//} //for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++)
//>>>>>>> Stashed changes
#if UE_TIMING_TRACE
start_meas(&UE->generic_stat);
......@@ -1130,16 +1102,21 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
(UE->frame_parms.frame_type == FDD) )
if (UE->mode != loop_through_memory){
if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH) ) {
if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id == 0) || (UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id>0 && proc->frame_rx >= UE_mac_inst[Mod_id-1].ra_frame + 20) ) {
//LOG_D(MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 before RACH \n");
// check if we have PRACH opportunity
if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx && Mod_id == (module_id_t) init_ra_UE) ) { //&& Mod_id == init_ra_UE
if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx) ) {
// The one working strangely...
//if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx && Mod_id == (module_id_t) init_ra_UE) ) {
//LOG_I(MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 before RACH 2 \n");
PRACH_RESOURCES_t *prach_resources = ue_get_rach(Mod_id, 0, proc->frame_tx, 0, proc->subframe_tx);
if(prach_resources!=NULL ) {
//LOG_I(MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 before RACH 3 \n");
UE_mac_inst[Mod_id].ra_frame = proc->frame_rx;
LOG_I(MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 before RACH 3, Mod_id: %d \n", Mod_id );
fill_rach_indication_UE_MAC(Mod_id, proc->frame_tx ,proc->subframe_tx, UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI);
Msg1_transmitted(Mod_id, 0, proc->frame_tx, 0);
UE_mac_inst[Mod_id].UE_mode[0] = RA_RESPONSE;
......@@ -1202,7 +1179,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
if (UL_INFO->crc_ind.crc_indication_body.number_of_crcs>0)
{
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.2, SFN/SF of PNF counter:%d.%d, number_of_crcs: %d \n", timer_frame, timer_subframe, UL_INFO->crc_ind.crc_indication_body.number_of_crcs);
//LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.2, SFN/SF of PNF counter:%d.%d, number_of_crcs: %d \n", timer_frame, timer_subframe, UL_INFO->crc_ind.crc_indication_body.number_of_crcs);
oai_nfapi_crc_indication(&UL_INFO->crc_ind);
//LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.21 \n");
UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0;
......@@ -1210,7 +1187,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
if (UL_INFO->rx_ind.rx_indication_body.number_of_pdus>0)
{
//LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf));
LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.3, SFN/SF of PNF counter:%d.%d, number_of_pdus: %d \n", timer_frame, timer_subframe, UL_INFO->rx_ind.rx_indication_body.number_of_pdus);
//LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.3, SFN/SF of PNF counter:%d.%d, number_of_pdus: %d \n", timer_frame, timer_subframe, UL_INFO->rx_ind.rx_indication_body.number_of_pdus);
//LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.3 \n");
oai_nfapi_rx_ind(&UL_INFO->rx_ind);
//LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.31 \n");
......@@ -1218,7 +1195,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
}
if(UL_INFO->harq_ind.harq_indication_body.number_of_harqs>0)
{
LOG_D(MAC, "Panos-D: ul_config_req_UE_MAC 2.4, SFN/SF of PNF counter:%d.%d, number_of_harqs: %d \n", timer_frame, timer_subframe, UL_INFO->harq_ind.harq_indication_body.number_of_harqs);
//LOG_D(MAC, "Panos-D: ul_config_req_UE_MAC 2.4, SFN/SF of PNF counter:%d.%d, number_of_harqs: %d \n", timer_frame, timer_subframe, UL_INFO->harq_ind.harq_indication_body.number_of_harqs);
oai_nfapi_harq_indication(&UL_INFO->harq_ind);
//LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.41 \n");
UL_INFO->harq_ind.harq_indication_body.number_of_harqs =0;
......@@ -1226,7 +1203,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
}
if(UL_INFO->sr_ind.sr_indication_body.number_of_srs>0)
{
LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.5, SFN/SF of PNF counter:%d.%d, number_of_srs: %d \n", timer_frame, timer_subframe, UL_INFO->sr_ind.sr_indication_body.number_of_srs);
//LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.5, SFN/SF of PNF counter:%d.%d, number_of_srs: %d \n", timer_frame, timer_subframe, UL_INFO->sr_ind.sr_indication_body.number_of_srs);
oai_nfapi_sr_indication(&UL_INFO->sr_ind);
//LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC 2.51 \n");
UL_INFO->sr_ind.sr_indication_body.number_of_srs = 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