Commit 21188359 authored by gauthier's avatar gauthier

for GTPV1U

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5166 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 48c13361
......@@ -212,11 +212,11 @@ boolean_t pdcp_data_req(
memset(&pdu_header.mac_i[0],0,PDCP_CONTROL_PLANE_DATA_PDU_MAC_I_SIZE);
if (pdcp_serialize_control_plane_data_pdu_with_SRB_sn_buffer((unsigned char*)pdcp_pdu_p->data, &pdu_header) == FALSE) {
LOG_E(PDCP, "Cannot fill PDU buffer with relevant header fields!\n");
if (enb_flagP == ENB_FLAG_NO)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_req);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_req);
return FALSE;
if (enb_flagP == ENB_FLAG_NO)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_req);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_req);
return FALSE;
}
} else {
pdcp_user_plane_data_pdu_header_with_long_sn pdu_header;
......@@ -225,11 +225,11 @@ boolean_t pdcp_data_req(
current_sn = pdu_header.sn ;
if (pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer((unsigned char*)pdcp_pdu_p->data, &pdu_header) == FALSE) {
LOG_E(PDCP, "Cannot fill PDU buffer with relevant header fields!\n");
if (enb_flagP == ENB_FLAG_NO)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_req);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_req);
return FALSE;
if (enb_flagP == ENB_FLAG_NO)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_req);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_req);
return FALSE;
}
}
/*
......@@ -240,10 +240,10 @@ boolean_t pdcp_data_req(
LOG_E(PDCP, "There must be a problem with PDCP initialization, ignoring this PDU...\n");
free_mem_block(pdcp_pdu_p);
if (enb_flagP == ENB_FLAG_NO)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_req);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_req);
if (enb_flagP == ENB_FLAG_NO)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_req);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_req);
return FALSE;
}
......@@ -441,11 +441,11 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
if (sdu_buffer_sizeP < pdcp_header_len + pdcp_tailer_len ) {
LOG_W(PDCP, "Incoming (from RLC) SDU is short of size (size:%d)! Ignoring...\n", sdu_buffer_sizeP);
free_mem_block(sdu_buffer_pP);
if (enb_flagP)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_ind);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return FALSE;
if (enb_flagP)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_ind);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return FALSE;
}
/*
......@@ -499,10 +499,10 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
free_mem_block(sdu_buffer_pP);
// free_mem_block(new_sdu);
if (enb_flagP)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_ind);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return TRUE;
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_ind);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return TRUE;
}
payload_offset=PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
#if defined(ENABLE_SECURITY)
......@@ -533,10 +533,10 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
sdu_buffer_sizeP - payload_offset ) == 0 ) {
free_mem_block(sdu_buffer_pP);
if (enb_flagP)
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_ind);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return TRUE;
stop_meas(&eNB_pdcp_stats[enb_mod_idP].data_ind);
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].data_ind);
return TRUE;
}
}
#else
......@@ -707,8 +707,11 @@ void pdcp_run (frame_t frameP, eNB_flag_t enb_flagP, module_id_t ue_mod_idP, mo
pdcp_fifo_read_input_sdus_from_otg(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
pdcp_fifo_read_input_sdus(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
#if defined(LINK_PDCP_TO_GTPV1U)
if (enb_flagP == ENB_FLAG_NO) {
#endif
pdcp_fifo_read_input_sdus(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
}
// PDCP -> NAS/IP traffic: RX
pdcp_fifo_flush_sdus(frameP, enb_flagP, enb_mod_idP, ue_mod_idP);
......
......@@ -92,6 +92,10 @@ unsigned char pdcp_read_state_g = 0;
extern Packet_OTG_List_t *otg_pdcp_buffer;
#if defined(LINK_PDCP_TO_GTPV1U)
# include "gtpv1u_eNB_defs.h"
#endif
pdcp_data_req_header_t pdcp_read_header_g;
//-----------------------------------------------------------------------------
......@@ -102,7 +106,10 @@ int pdcp_fifo_flush_sdus(frame_t frameP, eNB_flag_t enb_flagP, module_id_t enb_m
mem_block_t *sdu_p = list_get_head (&pdcp_sdu_list);
int bytes_wrote = 0;
int pdcp_nb_sdu_sent = 0;
uint8_t cont = 1;
uint8_t cont = 1;
#if defined(LINK_PDCP_TO_GTPV1U)
MessageDef *message_p = NULL;
#endif
#if defined(NAS_NETLINK) && defined(LINUX)
int ret = 0;
......@@ -110,22 +117,40 @@ int pdcp_fifo_flush_sdus(frame_t frameP, eNB_flag_t enb_flagP, module_id_t enb_m
while (sdu_p && cont) {
#if defined(OAI_EMU)
//LGmcs_inst = ((pdcp_data_ind_header_t *)(sdu->data))->inst;
// asjust the instance id when passing sdu to IP
//((pdcp_data_ind_header_t *)(sdu->data))->inst = (((pdcp_data_ind_header_t *)(sdu->data))->inst >= NB_eNB_INST) ?
// ((pdcp_data_ind_header_t *)(sdu->data))->inst - NB_eNB_INST +oai_emulation.info.nb_enb_local - oai_emulation.info.first_ue_local :// UE
// ((pdcp_data_ind_header_t *)(sdu->data))->inst - oai_emulation.info.first_ue_local; // ENB
#else
#if ! defined(OAI_EMU)
((pdcp_data_ind_header_t *)(sdu_p->data))->inst = 0;
#endif
#if defined(LINK_PDCP_TO_GTPV1U)
if (enb_flagP) {
LOG_I(PDCP,"Sending to GTPV1U\n");
/*message_p = itti_alloc_new_message(TASK_PDCP_ENB, GTPV1U_TUNNEL_DATA_REQ);
GTPV1U_TUNNEL_DATA_REQ(message_p).buffer = &(((uint8_t *) sdu_p->data)[sizeof (pdcp_data_ind_header_t)]);
GTPV1U_TUNNEL_DATA_REQ(message_p).length = ((pdcp_data_ind_header_t *)(sdu_p->data))->data_size;
GTPV1U_TUNNEL_DATA_REQ(message_p).ue_module_id = ue_mod_idP;
GTPV1U_TUNNEL_DATA_REQ(message_p).rab_id; = ((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id;
*/
gtpv1u_new_data_req(
enb_mod_idP, //gtpv1u_data_t *gtpv1u_data_p,
ue_mod_idP,//rb_id/NB_RB_MAX, TO DO UE ID
((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id, //was 0 default RAB ID
&(((uint8_t *) sdu_p->data)[sizeof (pdcp_data_ind_header_t)]),
((pdcp_data_ind_header_t *)(sdu_p->data))->data_size);
list_remove_head (&pdcp_sdu_list);
free_mem_block (sdu_p);
cont = 1;
pdcp_nb_sdu_sent += 1;
sdu_p = list_get_head (&pdcp_sdu_list);
LOG_I(OTG,"After GTPV1U\n");
continue; // loop again
}
#endif /* defined(ENABLE_USE_MME) */
#ifdef PDCP_DEBUG
LOG_I(PDCP, "PDCP->IP TTI %d INST %d: Preparing %d Bytes of data from rab %d to Nas_mesh\n",
frameP, ((pdcp_data_ind_header_t *)(sdu_p->data))->inst,
((pdcp_data_ind_header_t *)(sdu_p->data))->data_size, ((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id);
#endif //PDCP_DEBUG
cont = 0;
if (!pdcp_output_sdu_bytes_to_write) {
......
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