Commit f7e98c7e authored by winckel's avatar winckel

Modified asserts in pdcp_data_req() to have more accurate information.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4785 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent cdcdac56
......@@ -38,6 +38,7 @@
#ifndef USER_MODE
#include <rtai_fifos.h>
#endif
#include "assertions.h"
#include "pdcp.h"
#include "pdcp_util.h"
#include "pdcp_sequence_manager.h"
......@@ -60,8 +61,6 @@
# include "intertask_interface.h"
#endif
#include "assertions.h"
#define PDCP_DATA_REQ_DEBUG 0
#define PDCP_DATA_IND_DEBUG 0
......@@ -98,9 +97,9 @@ BOOL pdcp_data_req(u8 eNB_id, u8 UE_id, u32_t frame, u8_t eNB_flag, rb_id_t rb_i
module_id_t module_id;
rb_id_t rb_id_rlc = 0;
DevCheck4(eNB_id < NUMBER_OF_eNB_MAX, eNB_id, NUMBER_OF_eNB_MAX, UE_id, rb_id);
DevCheck4(UE_id < NUMBER_OF_UE_MAX, UE_id, NUMBER_OF_UE_MAX, eNB_id, rb_id);
DevCheck4(rb_id < NB_RB_MAX, rb_id, NB_RB_MAX, UE_id, eNB_id);
AssertError (eNB_id < NUMBER_OF_eNB_MAX, return FALSE, "eNB id is too high (%u/%d) %u %u!\n", eNB_id, NUMBER_OF_eNB_MAX, UE_id, rb_id);
AssertError (UE_id < NUMBER_OF_UE_MAX, return FALSE, "UE id is too high (%u/%d) %u %u!\n", UE_id, NUMBER_OF_UE_MAX, eNB_id, rb_id);
AssertError (rb_id < NB_RB_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_id, NB_RB_MAX, UE_id, eNB_id);
#ifdef PDCP_UNIT_TEST
pdcp = test_pdcp_entity;
......@@ -546,10 +545,11 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) {
RRC_DCCH_DATA_REQ (msg_p).frame, RRC_DCCH_DATA_REQ (msg_p).enb_flag, RRC_DCCH_DATA_REQ (msg_p).rb_id,
RRC_DCCH_DATA_REQ (msg_p).muip, RRC_DCCH_DATA_REQ (msg_p).confirmp, RRC_DCCH_DATA_REQ (msg_p).mode);
pdcp_data_req (RRC_DCCH_DATA_REQ (msg_p).eNB_index, RRC_DCCH_DATA_REQ (msg_p).ue_index, RRC_DCCH_DATA_REQ (msg_p).frame, RRC_DCCH_DATA_REQ (msg_p).enb_flag,
RRC_DCCH_DATA_REQ (msg_p).rb_id, RRC_DCCH_DATA_REQ (msg_p).muip,
RRC_DCCH_DATA_REQ (msg_p).confirmp, RRC_DCCH_DATA_REQ (msg_p).sdu_size,
RRC_DCCH_DATA_REQ (msg_p).sdu_p, RRC_DCCH_DATA_REQ (msg_p).mode);
result = pdcp_data_req (RRC_DCCH_DATA_REQ (msg_p).eNB_index, RRC_DCCH_DATA_REQ (msg_p).ue_index, RRC_DCCH_DATA_REQ (msg_p).frame, RRC_DCCH_DATA_REQ (msg_p).enb_flag,
RRC_DCCH_DATA_REQ (msg_p).rb_id, RRC_DCCH_DATA_REQ (msg_p).muip,
RRC_DCCH_DATA_REQ (msg_p).confirmp, RRC_DCCH_DATA_REQ (msg_p).sdu_size,
RRC_DCCH_DATA_REQ (msg_p).sdu_p, RRC_DCCH_DATA_REQ (msg_p).mode);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
// Message buffer has been processed, free it now.
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_REQ (msg_p).sdu_p);
......@@ -565,6 +565,30 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) {
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
} while(msg_p != NULL);
# if 0
{
MessageDef *msg_resp_p;
msg_resp_p = itti_alloc_new_message(TASK_PDCP_ENB, MESSAGE_TEST);
itti_send_msg_to_task(TASK_RRC_ENB, 1, msg_resp_p);
}
{
MessageDef *msg_resp_p;
msg_resp_p = itti_alloc_new_message(TASK_PDCP_ENB, MESSAGE_TEST);
itti_send_msg_to_task(TASK_ENB_APP, 2, msg_resp_p);
}
{
MessageDef *msg_resp_p;
msg_resp_p = itti_alloc_new_message(TASK_PDCP_ENB, MESSAGE_TEST);
itti_send_msg_to_task(TASK_MAC_ENB, 3, msg_resp_p);
}
# endif
#endif
pdcp_fifo_read_input_sdus_from_otg(frame, eNB_flag, UE_index, eNB_index);
......
......@@ -276,6 +276,7 @@ int pdcp_fifo_read_input_sdus_remaining_bytes (u32_t frame, u8_t eNB_flag)
u8 UE_id = 0;
u8 eNB_id;
u8 rb_id;
int result;
// if remaining bytes to read
if (pdcp_input_sdu_remaining_size_to_read > 0) {
......@@ -326,14 +327,15 @@ int pdcp_fifo_read_input_sdus_remaining_bytes (u32_t frame, u8_t eNB_flag)
frame, pdcp_read_header.inst, pdcp_read_header.data_size, pdcp_read_header.inst, pdcp_read_header.rb_id);
if (pdcp->instanciated_instance) {
pdcp_data_req (eNB_id, UE_id,
frame, eNB_flag,
pdcp_input_header.rb_id,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_DATA_PDU);
result = pdcp_data_req (eNB_id, UE_id,
frame, eNB_flag,
pdcp_input_header.rb_id,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_DATA_PDU);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
} else if ((pdcp_input_header.traffic_type == OAI_NW_DRV_IPV6_ADDR_TYPE_MULTICAST) || (pdcp_input_header.traffic_type == OAI_NW_DRV_IPV4_ADDR_TYPE_MULTICAST)) {
......@@ -341,16 +343,17 @@ int pdcp_fifo_read_input_sdus_remaining_bytes (u32_t frame, u8_t eNB_flag)
frame, pdcp_read_header.inst, pdcp_read_header.data_size, pdcp_read_header.inst, pdcp_read_header.rb_id);
if (pdcp->instanciated_instance) {
pdcp_data_req (eNB_id,
UE_id,
frame,
eNB_flag,
pdcp_input_header.rb_id,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_TM);
result = pdcp_data_req (eNB_id,
UE_id,
frame,
eNB_flag,
pdcp_input_header.rb_id,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_TM);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
} else if (eNB_flag) {
......@@ -360,28 +363,30 @@ int pdcp_fifo_read_input_sdus_remaining_bytes (u32_t frame, u8_t eNB_flag)
for (rab_id = DEFAULT_RAB_ID; rab_id < MAX_RB; rab_id = rab_id + NB_RB_MAX) {
LOG_D(PDCP, "Checking if could sent on default rab id %d\n", rab_id);
if (pdcp->instanciated_instance == (pdcp_input_header.inst + 1)) {
pdcp_data_req (eNB_id,
UE_id,
frame, eNB_flag,
rab_id,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_DATA_PDU);
result = pdcp_data_req (eNB_id,
UE_id,
frame, eNB_flag,
rab_id,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_DATA_PDU);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
}
} else {
LOG_D(PDCP, "Forcing send on DEFAULT_RAB_ID\n");
pdcp_data_req (eNB_id,
UE_id,
frame, eNB_flag,
DEFAULT_RAB_ID,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_DATA_PDU);
result = pdcp_data_req (eNB_id,
UE_id,
frame, eNB_flag,
DEFAULT_RAB_ID,
RLC_MUI_UNDEFINED,
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_DATA_PDU);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
// not necessary
//memset(pdcp_input_sdu_buffer, 0, MAX_IP_PACKET_SIZE);
......@@ -583,6 +588,7 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
int pkt_size=0, pkt_cnt=0;
u8 pdcp_mode, is_ue=0;
Packet_otg_elt * otg_pkt_info;
int result;
src_id = eNB_index;
......@@ -608,21 +614,23 @@ void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index
otg_pkt = (u8*) (otg_pkt_info->otg_pkt).sdu_buffer;
pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size;
if (otg_pkt != NULL) {
if (is_ue == 0 ) {
//rb_id = (/*NB_eNB_INST +*/ dst_id -1 ) * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d for pdcp mode %d\n",
eNB_index, frame, pkt_cnt++, module_id, rb_id, module_id, dst_id, pkt_size, pdcp_mode);
pdcp_data_req(eNB_index, UE_index, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,pdcp_mode);
}
else {
//rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] sending packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n",
UE_index, src_id, rb_id, src_id, dst_id, pkt_size);
pdcp_data_req(eNB_index, UE_index, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt, PDCP_DATA_PDU);
}
free(otg_pkt);
if (is_ue == 0 ) {
//rb_id = (/*NB_eNB_INST +*/ dst_id -1 ) * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d for pdcp mode %d\n",
eNB_index, frame, pkt_cnt++, module_id, rb_id, module_id, dst_id, pkt_size, pdcp_mode);
result = pdcp_data_req(eNB_index, UE_index, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,pdcp_mode);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
else {
//rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] sending packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n",
UE_index, src_id, rb_id, src_id, dst_id, pkt_size);
result = pdcp_data_req(eNB_index, UE_index, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt, PDCP_DATA_PDU);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
free(otg_pkt);
}
// } //else LOG_D(OTG,"frame %d enb %d-> ue %d link not yet established state %d \n", frame, eNB_index,dst_id - NB_eNB_INST, mac_get_rrc_status(module_id, eNB_flag, dst_id - NB_eNB_INST));
// } //else LOG_D(OTG,"frame %d enb %d-> ue %d link not yet established state %d \n", frame, eNB_index,dst_id - NB_eNB_INST, mac_get_rrc_status(module_id, eNB_flag, dst_id - NB_eNB_INST));
}
}
......
......@@ -2128,6 +2128,7 @@ void rrc_ue_generate_MeasurementReport(u8 eNB_id, u8 UE_id, u32 frame) {
nElem = 100;
nElem1 = 33;
static u32 pframe=0;
int result;
target_eNB_offset = UE_rrc_inst[UE_id].Info[0].handoverTarget; // eNB_offset of target eNB: used to obtain the mod_id of target eNB
for (i=0;i<MAX_MEAS_ID;i++) {
......@@ -2159,7 +2160,8 @@ void rrc_ue_generate_MeasurementReport(u8 eNB_id, u8 UE_id, u32 frame) {
LOG_I(RRC, "[UE %d] Frame %d : Generating Measurement Report for eNB %d\n", UE_id, frame, eNB_id);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RRC_UE][UE %02d][][--- PDCP_DATA_REQ/%d Bytes (MeasurementReport to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
frame, UE_id, size, eNB_id, rrc_mui, eNB_id, DCCH);
pdcp_data_req(eNB_id, UE_id, frame, 0, DCCH, rrc_mui++, 0, size, buffer, 1);
result = pdcp_data_req(eNB_id, UE_id, frame, 0, DCCH, rrc_mui++, 0, size, buffer, 1);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
//LOG_D(RRC, "[UE %d] Frame %d Sending MeasReport (%d bytes) through DCCH%d to PDCP \n",Mod_id,frame, size, DCCH);
}
// measFlag = 0; //re-setting measFlag so that no more MeasReports are sent in this frame
......
......@@ -1226,6 +1226,8 @@ void rrc_eNB_process_handoverPreparationInformation(u8 Mod_id,u32 frame, u16 UE_
/*------------------------------------------------------------------------------*/
void check_handovers(u8 Mod_id, u32 frame) {
u8 i;
int result;
for (i=0;i<NUMBER_OF_UE_MAX;i++) {
if(eNB_rrc_inst[Mod_id].handover_info[i] != NULL) {
if(eNB_rrc_inst[Mod_id].handover_info[i]->ho_prepare == 0xFF) {
......@@ -1245,6 +1247,7 @@ void check_handovers(u8 Mod_id, u32 frame) {
rrc_eNB_mui++,0,
eNB_rrc_inst[Mod_id].handover_info[i]->size,
eNB_rrc_inst[Mod_id].handover_info[i]->buf,1);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
eNB_rrc_inst[Mod_id].handover_info[i]->ho_complete = 0xF2;
}
}
......
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