Commit 1ed57bbf authored by matzakos's avatar matzakos

Extension to multiple UEs. Currently being tested with two UEs. Second UE...

Extension to multiple UEs. Currently being tested with two UEs. Second UE doesn't always reach the RRC Connection Reconfiguration stage.
parent 6cc3fb72
......@@ -1199,6 +1199,7 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) {
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) {
//LOG_I(MAC, "Panos-D: oai_nfapi_ul_config_req 1 \n");
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
ul_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
......
......@@ -2763,7 +2763,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
if(result == 0)
{
//printf( "Panos-D: P7 Pack failed to pack message\n");
printf( "Panos-D: P7 Pack failed to pack message\n");
NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack failed to pack message\n");
return -1;
}
......
......@@ -675,6 +675,8 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
//printf("subframe_buffer->sfn_sf:%d sfn_sf:%d\n", subframe_buffer->sfn_sf, sfn_sf);
if(tx_subframe_buffer->sfn_sf == sfn_sf_tx)
{
//printf("Panos-D: pnf_p7_subframe_ind tx_subframe_buffer->sfn_sf == sfn_sf_tx satisfied, pnf_p7: %d MINE: %d.%d, REAL: %d.%d \n",
// tx_subframe_buffer->sfn_sf, sfn_sf_tx>>4, sfn_sf_tx&0xf, tx_subframe_buffer->sfn_sf>>4, tx_subframe_buffer->sfn_sf&0xf);
if(tx_subframe_buffer->tx_req != 0)
{
if(pnf_p7->_public.tx_req)
......@@ -1366,6 +1368,7 @@ void pnf_handle_dl_node_sync(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, u
// unpack the message
if (nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &dl_node_sync, sizeof(dl_node_sync), &pnf_p7->_public.codec_config) < 0)
{
printf("Panos-D: %s: Unpack message failed, ignoring\n", __FUNCTION__);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
return;
}
......
......@@ -1247,9 +1247,14 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
//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)
{
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;
}
}
}
......
......@@ -816,7 +816,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
if (nfapi_mode) {
if (number_ul_pdu>0)
{
//LOG_D(PHY, "UL_CONFIG to send to PNF\n");
//LOG_I(PHY, "UL_CONFIG to send to PNF\n");
oai_nfapi_ul_config_req(UL_req);
UL_req->ul_config_request_body.number_of_pdus=0;
number_ul_pdu=0;
......
......@@ -1484,6 +1484,7 @@ typedef struct {
nfapi_dl_config_request_t* dl_config_req;
nfapi_ul_config_request_t* ul_config_req;
nfapi_hi_dci0_request_t* hi_dci0_req;
nfapi_tx_request_pdu_t* tx_request_pdu_list;
nfapi_tx_request_t* tx_req;
eth_params_t eth_params_n;
......
......@@ -186,10 +186,10 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
module_idP, frameP, subframeP, CC_id, ra->Msg3_frame,
ra->Msg3_subframe);
LOG_D(MAC,
"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d)\n",
LOG_I(MAC,
"Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n",
frameP, subframeP, ra->Msg3_frame, ra->Msg3_subframe,
ra->msg3_nb_rb, ra->msg3_first_rb, ra->msg3_round);
ra->msg3_nb_rb, ra->msg3_first_rb, ra->msg3_round, ra->rnti);
ul_config_pdu =
&ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
......@@ -693,7 +693,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
cc[CC_idP].RAR_pdu.payload, N_RB_DL, 7);
add_msg3(module_idP, CC_idP, ra, frameP, subframeP);
ra->state = WAITMSG3;
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP);
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d: state:WAITMSG3\n", module_idP, frameP, subframeP);
// DL request
mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
......
......@@ -87,6 +87,7 @@ rx_sdu(const module_id_t enb_mod_idP,
const uint16_t sdu_lenP,
const uint16_t timing_advance, const uint8_t ul_cqi)
{
//LOG_I(MAC, "Panos-D: rx_sdu 1 \n");
int current_rnti = rntiP;
unsigned char rx_ces[MAX_NUM_CE], num_ce, num_sdu, i, *payload_ptr;
unsigned char rx_lcids[NB_RB_MAX];
......@@ -155,7 +156,7 @@ rx_sdu(const module_id_t enb_mod_idP,
UE_id));
}
} else { // we've got an error
LOG_D(MAC,
LOG_I(MAC,
"[eNB %d][PUSCH %d] CC_id %d ULSCH in error in round %d, ul_cqi %d\n",
enb_mod_idP, harq_pid, CC_idP,
UE_list->UE_sched_ctrl[UE_id].round_UL[CC_idP][harq_pid],
......@@ -185,7 +186,7 @@ rx_sdu(const module_id_t enb_mod_idP,
radioResourceConfigCommon->rach_ConfigCommon.
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_mod_idP, harq_pid, CC_idP, ra[RA_id].msg3_round,
current_rnti, RA_id, ul_cqi);
......@@ -217,10 +218,11 @@ rx_sdu(const module_id_t enb_mod_idP,
add_msg3(enb_mod_idP, CC_idP, &ra[RA_id], frameP,
subframeP);
}
LOG_I(MAC, "Panos-D: rx_sdu() 2 before error returning \n");
return;
}
} else {
LOG_W(MAC,
LOG_I(MAC,
"Cannot find UE or RA corresponding to ULSCH rnti %x, dropping it\n",
current_rnti);
return;
......@@ -1043,6 +1045,7 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
for (i = 0; i < NB_RA_PROC_MAX; i++) {
if ((cc->ra[i].state == WAITMSG3) &&
(cc->ra[i].Msg3_subframe == sched_subframe)) {
//LOG_I(MAC, "Panos-D: schedule_ulsch WAITMSG3 \n");
first_rb[CC_id]++;
// cc->ray[i].Msg3_subframe = -1;
break;
......@@ -1062,6 +1065,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
unsigned char sched_subframeP, uint16_t * first_rb)
{
//LOG_I(MAC, "Panos-D: schedule_ulsch_rnti \n");
int UE_id;
uint8_t aggregation = 2;
rnti_t rnti = -1;
......@@ -1109,7 +1113,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
// don't schedule if Msg4 is not received yet
if (UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id].
configured == FALSE) {
LOG_D(MAC,
LOG_I(MAC,
"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n",
module_idP, frameP, subframeP, UE_id);
continue;
......@@ -1118,7 +1122,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
rnti = UE_RNTI(module_idP, UE_id);
if (rnti == NOT_A_RNTI) {
LOG_W(MAC, "[eNB %d] frame %d subfarme %d, UE %d: no RNTI \n",
LOG_I(MAC, "[eNB %d] frame %d subfarme %d, UE %d: no RNTI \n",
module_idP, frameP, subframeP, UE_id);
continue;
}
......@@ -1148,7 +1152,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
*/
if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0 &&
UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 0) {
LOG_W(MAC,
LOG_I(MAC,
"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: UE in weird state, let's put it 'out of sync'\n",
module_idP, frameP, subframeP, UE_id, rnti, CC_id);
// inform RRC of failure and clear timer
......@@ -1173,7 +1177,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
if (CCE_allocation_infeasible
(module_idP, CC_id, 1, subframeP, aggregation, rnti)) {
LOG_W(MAC,
LOG_I(MAC,
"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n",
module_idP, frameP, subframeP, UE_id, rnti, CC_id);
continue; // break;
......@@ -1181,7 +1185,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
/* be sure that there are some free RBs */
if (first_rb[CC_id] >= N_RB_UL - 1) {
LOG_W(MAC,
LOG_I(MAC,
"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n",
module_idP, frameP, subframeP, UE_id, rnti, CC_id);
continue;
......@@ -1463,6 +1467,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
T_INT(rb_table[rb_table_index]), T_INT(round));
// fill in NAK information
LOG_I(MAC, "schedule_ulsch_rnti() Retransmission case! \n");
hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi];
memset((void *) hi_dci0_pdu, 0,
......
......@@ -60,8 +60,10 @@ void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char e
if (first_sync == 1 && !(mme_enabled == 1)) {
//layer2_init_UE(module_idP);
LOG_I(MAC, "Panos-D: dl_phy_sync_success 1 \n");
openair_rrc_ue_init(module_idP, eNB_index);
} else {
LOG_I(MAC, "Panos-D: dl_phy_sync_success 2 \n");
rrc_in_sync_ind(module_idP, frameP, eNB_index);
}
}
......
......@@ -327,7 +327,7 @@ Msg3_transmitted(module_id_t module_idP, uint8_t CC_id,
"Transmission on secondary CCs is not supported yet\n");
// start contention resolution timer
LOG_D(MAC,
LOG_I(MAC,
"[UE %d][RAPROC] Frame %d : Msg3_tx: Setting contention resolution timer\n",
module_idP, frameP);
UE_mac_inst[module_idP].RA_contention_resolution_cnt = 0;
......
......@@ -63,7 +63,7 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
}
if (rarh->RAPID == preamble_index) {
LOG_D(PHY, "Found RAR with the intended RAPID %d\n",
LOG_I(PHY, "Found RAR with the intended RAPID %d\n",
rarh->RAPID);
rar = (uint8_t *) (dlsch_buffer + n_rarh + (n_rarpy - 1) * 6);
break;
......
......@@ -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: In ue_get_sdu() 1 \n");
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;
......@@ -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_get_sdu() 2 before copying to ulsch_buffer");
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);
}
......
......@@ -372,22 +372,22 @@ boolean_t pdcp_data_req(
break;
case RLC_OP_STATUS_BAD_PARAMETER:
LOG_W(PDCP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
LOG_D(PDCP, "Data sending request over RLC failed with 'Bad Parameter' reason!\n");
ret= FALSE;
break;
case RLC_OP_STATUS_INTERNAL_ERROR:
LOG_W(PDCP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
LOG_D(PDCP, "Data sending request over RLC failed with 'Internal Error' reason!\n");
ret= FALSE;
break;
case RLC_OP_STATUS_OUT_OF_RESSOURCES:
LOG_W(PDCP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
LOG_D(PDCP, "Data sending request over RLC failed with 'Out of Resources' reason!\n");
ret= FALSE;
break;
default:
LOG_W(PDCP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
LOG_D(PDCP, "RLC returned an unknown status code after PDCP placed the order to send some data (Status Code:%d)\n", rlc_status);
ret= FALSE;
break;
}
......
......@@ -217,6 +217,7 @@ void fill_rach_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL
//eNB->UL_INFO.rach_ind.preamble_list = &eNB->preamble_list[0];
UL_INFO->rach_ind.header.message_id = NFAPI_RACH_INDICATION;
UL_INFO->rach_ind.sfn_sf = frame<<4 | subframe;
UL_INFO->rach_ind.vendor_extension = NULL;
UL_INFO->rach_ind.rach_indication_body.tl.tag = NFAPI_RACH_INDICATION_BODY_TAG;
......@@ -592,6 +593,9 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
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);
// Panos: Modification
UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
// Panos: This should be done after the reception of the respective hi_dci0
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
......@@ -620,6 +624,9 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
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);
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
// Panos: Modification
UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
}
else {
LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3.1 \n");
......@@ -650,6 +657,9 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
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);
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
// Panos: Modification
UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
}
else {
ue_get_sdu( Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode);
......@@ -678,6 +688,9 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
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);
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
// Panos: Modification
UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
}
else {
ue_get_sdu( Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode);
......@@ -748,9 +761,9 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int timer_frame, int timer_subframe)
int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int timer_frame, int timer_subframe, module_id_t Mod_id)
{
if (req!=NULL && req->ul_config_request_body.ul_config_pdu_list !=NULL){
if (req!=NULL){ // && req->ul_config_request_body.ul_config_pdu_list !=NULL){
LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n",
__FUNCTION__,
NFAPI_SFNSF2DEC(req->sfn_sf),
......@@ -791,7 +804,8 @@ int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int timer_frame, int ti
//struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
//eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
//Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
nfapi_ul_config_request_pdu_t* ul_config_pdu_list = req->ul_config_request_body.ul_config_pdu_list;
//LOG_D(MAC, "Panos-D: ul_config_req_UE_MAC 1 \n");
......@@ -849,7 +863,7 @@ int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int timer_frame, int ti
//subtract_subframe(&sfn, &sf, 4);
LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC() TOTAL NUMBER OF UL_CONFIG PDUs: %d", req->ul_config_request_body.number_of_pdus);
LOG_I(MAC, "Panos-D: ul_config_req_UE_MAC() TOTAL NUMBER OF UL_CONFIG PDUs: %d, SFN/SF: %d/%d \n", req->ul_config_request_body.number_of_pdus, timer_frame, timer_subframe);
......@@ -858,14 +872,15 @@ int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int timer_frame, int ti
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, ul_config_pdu_list[i].pdu_size);
//LOG_D(MAC, "Panos-D: ul_config_req_UE_MAC 2.0 #PDUs: %d \n", i<req->ul_config_request_body.number_of_pdus);
if (
req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE ||
req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE ||
req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE ||
req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE ||
req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE ||
req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE
(req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_mac_inst[Mod_id].crnti) ||
(req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == UE_mac_inst[Mod_id].crnti) ||
(req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == UE_mac_inst[Mod_id].crnti) ||
(req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti == UE_mac_inst[Mod_id].crnti) ||
(req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].uci_cqi_harq_pdu.ue_information.ue_information_rel8.rnti == UE_mac_inst[Mod_id].crnti) ||
(req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].uci_sr_pdu.ue_information.ue_information_rel8.rnti == UE_mac_inst[Mod_id].crnti) ||
(req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].uci_cqi_sr_harq_pdu.ue_information.ue_information_rel8.rnti == UE_mac_inst[Mod_id].crnti)
)
{
/*switch (req->ul_config_request_body.ul_config_pdu_list[i].pdu_type){
......@@ -1049,13 +1064,13 @@ int tx_req_UE_MAC(nfapi_tx_request_t* req)
}
int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //, nfapi_tx_request_pdu_t* tx_request_pdu_list)
{
if (req!=NULL && tx_request_pdu_list!=NULL){
//LOG_I(MAC, "Panos-D: dl_config_req_UE_MAC 1 \n");
int sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
int sf = NFAPI_SFNSF2SF(req->sfn_sf);
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
//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];*/
......@@ -1084,15 +1099,29 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
if (dl_config_pdu_list[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type == 1) {
// C-RNTI (Normal DLSCH case)
dl_config_pdu_tmp = &dl_config_pdu_list[i+1];
if (dl_config_pdu_tmp->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE){
if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){
LOG_E(MAC, "dl_config_req_UE_MAC 2 Received data: sfn/sf:%d PDU[%d] size:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size);
if (dl_config_pdu_tmp->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE && UE_mac_inst[Mod_id].crnti == dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.rnti){
// PANTEL
/*nfapi_tx_request_pdu_t *ptr = tx_request_pdu_list;
ptr += dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index*(sizeof(nfapi_tx_request_pdu_t));
nfapi_tx_request_pdu_t temp;
memset(&temp, 0, sizeof(nfapi_tx_request_pdu_t));
//if (!memcmp(&temp, ptr, sizeof(temp)) ...
if( *(char*)ptr != 0){
//if(tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data!= NULL && tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_length >0){
*/
if(dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index <= tx_req_num_elems -1){
//if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){
LOG_E(MAC, "dl_config_req_UE_MAC 2 Received data: sfn/sf:%d PDU[%d] size:%d, TX_PDU index: %d, tx_req_num_elems: %d \n", NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index, tx_req_num_elems);
ue_send_sdu(Mod_id, 0, sfn, sf,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_length,
0);
i++;
}
else{
LOG_E(MAC,"dl_config_req_UE_MAC 2: Problem with receiving data: sfn/sf:%d PDU[%d] size:%d, TX_PDU index: %d\n", NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
}
}
else {
LOG_E(MAC,"[UE %d] Frame %d, subframe %d : Cannot extract DLSCH PDU from NFAPI\n",Mod_id, sfn,sf);
......@@ -1104,22 +1133,31 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
//pdu = Tx_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data;
LOG_E(MAC,"dl_config_req_UE_MAC 3 Received SI: [PDU:%d] NFAPI_DL_CONFIG_DLSCH_PDU_TYPE TX:%d/%d RX:%d/%d transport_blocks:%d pdu_index:%d sdu:%p\n",
i, sfn, sf, sfn, sf, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.transport_blocks, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index, tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){
if(dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index <= tx_req_num_elems -1){
//if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){
ue_decode_si(Mod_id, 0, sfn, 0,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_length);
i++;
}
else{
LOG_E(MAC,"dl_config_req_UE_MAC 3: Problem with receiving SI: sfn/sf:%d PDU[%d] size:%d, TX_PDU index: %d\n", NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
}
}
else if(dl_config_pdu_tmp->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE && dl_config_pdu_list[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti == 0xFFFE){
// P_RNTI case
//pdu = Tx_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data;
if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){
if (dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index <= tx_req_num_elems -1){
//if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){
ue_decode_p(Mod_id, 0, sfn, 0,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_length);
i++;
}
else{
LOG_E(MAC,"dl_config_req_UE_MAC: Problem with receiving Paging: sfn/sf:%d PDU[%d] size:%d, TX_PDU index: %d\n", NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index);
}
}
else if(dl_config_pdu_tmp->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE) {
// RA-RNTI case
......@@ -1129,9 +1167,10 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
//rnti_t c_rnti = UE_mac_inst[Mod_id].crnti;
rnti_t ra_rnti = UE_mac_inst[Mod_id].RA_prach_resources.ra_RNTI;
if ((UE_mac_inst[Mod_id].UE_mode[0] != PUSCH) &&
(UE_mac_inst[Mod_id].RA_prach_resources.Msg3!=NULL) &&
(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL)) {
LOG_E(MAC,"dl_config_req_UE_MAC 5 Received RAR \n");
(UE_mac_inst[Mod_id].RA_prach_resources.Msg3!=NULL) && (ra_rnti== dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.rnti) &&
//(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL)) {
(dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index <= tx_req_num_elems -1)) {
LOG_E(MAC,"dl_config_req_UE_MAC 5 Received RAR, PreambleIndex: %d \n", UE_mac_inst[Mod_id].RA_prach_resources.ra_PreambleIndex);
ue_process_rar(Mod_id, 0, sfn,
ra_rnti, //RA-RNTI
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
......@@ -1155,10 +1194,12 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
// for our case.
LOG_E(MAC,"dl_config_req_UE_MAC 4 Received MIB: sfn/sf: %d.%d \n", sfn, sf);
if(UE_mac_inst[Mod_id].UE_mode[0] == NOT_SYNCHED){
dl_phy_sync_success(Mod_id,sfn,0, 0);
dl_phy_sync_success(Mod_id,sfn,0, 1);
LOG_E(MAC,"dl_config_req_UE_MAC 5 Received MIB: UE_mode: %d\n", UE_mac_inst[Mod_id].UE_mode[0]);
UE_mac_inst[Mod_id].UE_mode[0]=PRACH;
}
else
dl_phy_sync_success(Mod_id,sfn,0, 0);
}
......@@ -1177,10 +1218,13 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
req->vendor_extension = NULL;
}*/
if(tx_request_pdu_list!=NULL){
// Panos: Modification here BRING THIS BACK!
/*if(tx_request_pdu_list!=NULL){
free(tx_request_pdu_list);
tx_request_pdu_list = NULL;
}
}*/
if(req->dl_config_request_body.dl_config_pdu_list!=NULL){
free(req->dl_config_request_body.dl_config_pdu_list);
req->dl_config_request_body.dl_config_pdu_list = NULL;
......@@ -1214,18 +1258,19 @@ int deallocate_mem_nfapi_dl(nfapi_dl_config_request_t* req, nfapi_tx_request_pdu
int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req)
int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req, module_id_t Mod_id)
{
if (req!=NULL && req->hi_dci0_request_body.hi_dci0_pdu_list!=NULL){
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.
//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);
......@@ -1255,14 +1300,7 @@ int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req)
}
}
/*if(req->hi_dci0_request_body.hi_dci0_pdu_list!=NULL){
free(req->hi_dci0_request_body.hi_dci0_pdu_list);
req->hi_dci0_request_body.hi_dci0_pdu_list = NULL;
}
free(req);
req = NULL;*/
}
/*else if(req!=NULL){
free(req);
req = NULL;
......@@ -1281,9 +1319,13 @@ int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request
{
//LOG_I(MAC, "Panos-D: memcpy_dl_config_req 1");
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
UE_mac_inst[Mod_id].dl_config_req = (nfapi_dl_config_request_t*)malloc(sizeof(nfapi_dl_config_request_t));
//LOG_I(MAC, "Panos-D: memcpy_dl_config_req 1 \n");
//LOG_I(MAC, "Panos-D: memcpy_dl_config_req 1, Mod_id:%d \n", Mod_id);
//UE_mac_inst[Mod_id].dl_config_req->header = req->header;
......@@ -1310,6 +1352,8 @@ int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request
UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.dl_config_pdu_list[i] = req->dl_config_request_body.dl_config_pdu_list[i];
}
}
//UE_mac_inst[Mod_id].dl_config_req = req;
return 0;
......@@ -1321,7 +1365,10 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
UE_mac_inst[Mod_id].ul_config_req = (nfapi_ul_config_request_t*)malloc(sizeof(nfapi_ul_config_request_t));
for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
UE_mac_inst[Mod_id].ul_config_req = (nfapi_ul_config_request_t*)malloc(sizeof(nfapi_ul_config_request_t));
//UE_mac_inst[Mod_id].ul_config_req->header = req->header;
UE_mac_inst[Mod_id].ul_config_req->sfn_sf = req->sfn_sf;
UE_mac_inst[Mod_id].ul_config_req->vendor_extension = req->vendor_extension;
......@@ -1346,6 +1393,7 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
//LOG_I(MAC, "Panos-D: memcpy_ul_config_req TAG MINE: %d \n", UE_mac_inst[Mod_id].ul_config_req->ul_config_request_body.ul_config_pdu_list[i].pdu_type);
//LOG_I(MAC, "Panos-D: memcpy_ul_config_req TAG REQ: %d \n", req->ul_config_request_body.ul_config_pdu_list[i].pdu_type);
}
}
......@@ -1353,7 +1401,10 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
return 0;
}
int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
/*int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
{
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
//LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.number_of_pdus: %d \n", req->tx_request_body.number_of_pdus);
......@@ -1370,10 +1421,58 @@ int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
int num_elem = req->tx_request_body.number_of_pdus;
tx_request_pdu_list = (nfapi_tx_request_pdu_t*) malloc(num_elem*sizeof(nfapi_tx_request_pdu_t));
UE_mac_inst[Mod_id].tx_request_pdu_list = (nfapi_tx_request_pdu_t*) malloc(num_elem*sizeof(nfapi_tx_request_pdu_t));
//UE_mac_inst[Mod_id].tx_req = (nfapi_tx_request_t*) malloc(sizeof(nfapi_tx_request_t));
//memcpy(UE_mac_inst[Mod_id].tx_req, req, sizeof(req));
for (int i=0; i<num_elem; i++) {
UE_mac_inst[Mod_id].tx_request_pdu_list[i].num_segments = req->tx_request_body.tx_pdu_list[i].num_segments;
UE_mac_inst[Mod_id].tx_request_pdu_list[i].pdu_index = req->tx_request_body.tx_pdu_list[i].pdu_index;
UE_mac_inst[Mod_id].tx_request_pdu_list[i].pdu_length = req->tx_request_body.tx_pdu_list[i].pdu_length;
for (int j=0; j<req->tx_request_body.tx_pdu_list[i].num_segments; j++){
//*tx_request_pdu_list[i].segments[j].segment_data = *req->tx_request_body.tx_pdu_list[i].segments[j].segment_data;
UE_mac_inst[Mod_id].tx_request_pdu_list[i].segments[j].segment_length = req->tx_request_body.tx_pdu_list[i].segments[j].segment_length;
if(UE_mac_inst[Mod_id].tx_request_pdu_list[i].segments[j].segment_length > 0){
UE_mac_inst[Mod_id].tx_request_pdu_list[i].segments[j].segment_data = (uint8_t*)malloc(UE_mac_inst[Mod_id].tx_request_pdu_list[i].segments[j].segment_length*sizeof (uint8_t));
memcpy(UE_mac_inst[Mod_id].tx_request_pdu_list[i].segments[j].segment_data, req->tx_request_body.tx_pdu_list[i].segments[j].segment_data, UE_mac_inst[Mod_id].tx_request_pdu_list[i].segments[j].segment_length);
}
//tx_request_pdu_list[i].segments[j].segment_length = req->tx_request_body.tx_pdu_list[i].segments[j].segment_length;
}
//tx_request_pdu_list[i].segments = req->tx_request_body.tx_pdu_list[i].segments;
}
// Panos: Old way. Not possible to use because by the time we call tx_req_UE_MAC tx_req memory has been deallocated within nfapi.
//UE_mac_inst[Mod_id].tx_req = req;
return 0;
}*/
int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
{
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
//LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.number_of_pdus: %d \n", req->tx_request_body.number_of_pdus);
//LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].pdu_length: %d \n", req->tx_request_body.tx_pdu_list[0].pdu_length);
//LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].pdu_index: %d \n", req->tx_request_body.tx_pdu_list[0].pdu_index);
//LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].num_segments: %d \n", req->tx_request_body.tx_pdu_list[0].num_segments);
//LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].segments[j].segment_data: %d \n", *req->tx_request_body.tx_pdu_list[0].segments[0].segment_data);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.number_of_pdus: %d \n", req->tx_request_body.number_of_pdus);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].pdu_length: %d \n", req->tx_request_body.tx_pdu_list[0].pdu_length);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].pdu_index: %d \n", req->tx_request_body.tx_pdu_list[0].pdu_index);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].num_segments: %d \n", req->tx_request_body.tx_pdu_list[0].num_segments);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].segments[j].segment_data: %d \n", *req->tx_request_body.tx_pdu_list[0].segments[0].segment_data);
//int num_elem = req->tx_request_body.number_of_pdus;
tx_req_num_elems = req->tx_request_body.number_of_pdus;
tx_request_pdu_list = (nfapi_tx_request_pdu_t*) calloc(tx_req_num_elems, sizeof(nfapi_tx_request_pdu_t));
//UE_mac_inst[Mod_id].tx_req = (nfapi_tx_request_t*) malloc(sizeof(nfapi_tx_request_t));
//memcpy(UE_mac_inst[Mod_id].tx_req, req, sizeof(req));
for (int i=0; i<tx_req_num_elems; i++) {
tx_request_pdu_list[i].num_segments = req->tx_request_body.tx_pdu_list[i].num_segments;
tx_request_pdu_list[i].pdu_index = req->tx_request_body.tx_pdu_list[i].pdu_index;
tx_request_pdu_list[i].pdu_length = req->tx_request_body.tx_pdu_list[i].pdu_length;
......@@ -1381,7 +1480,7 @@ int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
//*tx_request_pdu_list[i].segments[j].segment_data = *req->tx_request_body.tx_pdu_list[i].segments[j].segment_data;
tx_request_pdu_list[i].segments[j].segment_length = req->tx_request_body.tx_pdu_list[i].segments[j].segment_length;
if(tx_request_pdu_list[i].segments[j].segment_length > 0){
tx_request_pdu_list[i].segments[j].segment_data = (uint8_t*)malloc(tx_request_pdu_list[i].segments[j].segment_length*sizeof (uint8_t));
tx_request_pdu_list[i].segments[j].segment_data = (uint8_t*)malloc(tx_request_pdu_list[i].segments[j].segment_length*sizeof (uint8_t));
memcpy(tx_request_pdu_list[i].segments[j].segment_data, req->tx_request_body.tx_pdu_list[i].segments[j].segment_data, tx_request_pdu_list[i].segments[j].segment_length);
}
//tx_request_pdu_list[i].segments[j].segment_length = req->tx_request_body.tx_pdu_list[i].segments[j].segment_length;
......@@ -1401,6 +1500,8 @@ int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t*
//if(req!=0){
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
UE_mac_inst[Mod_id].hi_dci0_req = (nfapi_hi_dci0_request_t*)malloc(sizeof(nfapi_hi_dci0_request_t));
UE_mac_inst[Mod_id].hi_dci0_req->sfn_sf = req->sfn_sf;
......@@ -1425,6 +1526,8 @@ int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t*
UE_mac_inst[Mod_id].hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list[i] = req->hi_dci0_request_body.hi_dci0_pdu_list[i];
//LOG_I(MAC, "Original hi_dci0 req. type:%d, Copy type: %d \n",req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type, UE_mac_inst[Mod_id].hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type);
}
}
//}
//else
// LOG_I(MAC, "Panos-D: Dummy HI_DCI0");
......
......@@ -20,6 +20,7 @@
UL_IND_t *UL_INFO;
nfapi_tx_request_pdu_t* tx_request_pdu_list;
int tx_req_num_elems;
......@@ -71,18 +72,19 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id, int frame, int subframe, UL_IND