Commit c30707b3 authored by Lionel Gauthier's avatar Lionel Gauthier

1/2 correction of bug when releasing UE

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6329 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent f5d3fda2
...@@ -182,4 +182,10 @@ typedef struct protocol_ctxt_s { ...@@ -182,4 +182,10 @@ typedef struct protocol_ctxt_s {
frame_t frame; /*!< \brief LTE Frame number.*/ frame_t frame; /*!< \brief LTE Frame number.*/
eNB_flag_t enb_flag; /*!< \brief Flag to indicate eNB (1) or UE (0) */ eNB_flag_t enb_flag; /*!< \brief Flag to indicate eNB (1) or UE (0) */
} protocol_ctxt_t; } protocol_ctxt_t;
#define PROTOCOL_CTXT_FMT "[FRAME %05u][%s][MOD %02u/%02u]"
#define PROTOCOL_CTXT_ARGS(CTXT_Pp) \
CTXT_Pp->frame, \
(CTXT_Pp->enb_flag == ENB_FLAG_YES) ? "eNB":" UE", \
CTXT_Pp->enb_module_id, \
CTXT_Pp->ue_module_id
#endif #endif
...@@ -70,7 +70,10 @@ rlc_am_get_buffer_occupancy_in_bytes ( ...@@ -70,7 +70,10 @@ rlc_am_get_buffer_occupancy_in_bytes (
if (rlc_pP->t_status_prohibit.running == 0) { if (rlc_pP->t_status_prohibit.running == 0) {
#ifdef TRACE_RLC_AM_BO #ifdef TRACE_RLC_AM_BO
if (((15 + rlc_pP->num_nack_sn*(10+1) + rlc_pP->num_nack_so*(15+15+1) + 7) >> 3) > 0) { if (((15 + rlc_pP->num_nack_sn*(10+1) + rlc_pP->num_nack_so*(15+15+1) + 7) >> 3) > 0) {
LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] BO : CONTROL PDU %d bytes \n", ctxt_pP->frame, rlc_pP->module_id, rlc_pP->rb_id, ((15 + rlc_pP->num_nack_sn*(10+1) + rlc_pP->num_nack_so*(15+15+1) + 7) >> 3)); LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" BO : CONTROL PDU %d bytes \n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
RB_AM_ARGS(rlc_pP),
((15 + rlc_pP->num_nack_sn*(10+1) + rlc_pP->num_nack_so*(15+15+1) + 7) >> 3));
} }
#endif #endif
return ((15 + rlc_pP->num_nack_sn*(10+1) + rlc_pP->num_nack_so*(15+15+1) + 7) >> 3); return ((15 + rlc_pP->num_nack_sn*(10+1) + rlc_pP->num_nack_so*(15+15+1) + 7) >> 3);
...@@ -92,9 +95,15 @@ rlc_am_get_buffer_occupancy_in_bytes ( ...@@ -92,9 +95,15 @@ rlc_am_get_buffer_occupancy_in_bytes (
#ifdef TRACE_RLC_AM_BO #ifdef TRACE_RLC_AM_BO
if ((rlc_pP->status_buffer_occupancy + rlc_pP->retransmission_buffer_occupancy + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead) > 0) { if ((rlc_pP->status_buffer_occupancy + rlc_pP->retransmission_buffer_occupancy + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead) > 0) {
LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] BO : STATUS BUFFER %d bytes \n", ctxt_pP->frame, rlc_pP->module_id, rlc_pP->rb_id, rlc_pP->status_buffer_occupancy); LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" BO : STATUS BUFFER %d bytes \n", PROTOCOL_CTXT_ARGS(ctxt_pP), RB_AM_ARGS(rlc_pP), rlc_pP->status_buffer_occupancy);
LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] BO : RETRANS BUFFER %d bytes \n", ctxt_pP->frame, rlc_pP->module_id,rlc_pP->rb_id, rlc_pP->retransmission_buffer_occupancy); LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" BO : RETRANS BUFFER %d bytes \n", PROTOCOL_CTXT_ARGS(ctxt_pP), RB_AM_ARGS(rlc_pP), rlc_pP->retransmission_buffer_occupancy);
LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] BO : SDU BUFFER %d bytes + li_overhead %d bytes header_overhead %d bytes (nb sdu not segmented %d)\n", ctxt_pP->frame, rlc_pP->module_id,rlc_pP->rb_id, rlc_pP->sdu_buffer_occupancy, max_li_overhead, header_overhead, rlc_pP->nb_sdu_no_segmented); LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" BO : SDU BUFFER %d bytes + li_overhead %d bytes header_overhead %d bytes (nb sdu not segmented %d)\n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
RB_AM_ARGS(rlc_pP),
rlc_pP->sdu_buffer_occupancy,
max_li_overhead,
header_overhead,
rlc_pP->nb_sdu_no_segmented);
} }
#endif #endif
return rlc_pP->status_buffer_occupancy + rlc_pP->retransmission_buffer_occupancy + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead; return rlc_pP->status_buffer_occupancy + rlc_pP->retransmission_buffer_occupancy + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead;
...@@ -128,20 +137,15 @@ config_req_rlc_am ( ...@@ -128,20 +137,15 @@ config_req_rlc_am (
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am; l_rlc_p = &rlc_union_p->rlc.am;
LOG_D(RLC, LOG_D(RLC,
"[FRAME %5u][%s][RRC][MOD %u/%u][][--- CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d) --->][RLC_AM][MOD %u/%u][RB %u]\n", PROTOCOL_CTXT_FMT RB_AM_FMT" CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d)\n",
ctxt_pP->frame, PROTOCOL_CTXT_ARGS(ctxt_pP),
( ctxt_pP->enb_flag > 0) ? "eNB":"UE", RB_AM_ARGS(l_rlc_p),
ctxt_pP->enb_module_id, config_am_pP->max_retx_threshold,
ctxt_pP->ue_module_id, config_am_pP->poll_pdu,
config_am_pP->max_retx_threshold, config_am_pP->poll_byte,
config_am_pP->poll_pdu, config_am_pP->t_poll_retransmit,
config_am_pP->poll_byte, config_am_pP->t_reordering,
config_am_pP->t_poll_retransmit, config_am_pP->t_status_prohibit);
config_am_pP->t_reordering,
config_am_pP->t_status_prohibit,
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP);
rlc_am_init(ctxt_pP, l_rlc_p); rlc_am_init(ctxt_pP, l_rlc_p);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP); rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP);
rlc_am_configure(ctxt_pP, l_rlc_p, rlc_am_configure(ctxt_pP, l_rlc_p,
...@@ -152,14 +156,9 @@ config_req_rlc_am ( ...@@ -152,14 +156,9 @@ config_req_rlc_am (
config_am_pP->t_reordering, config_am_pP->t_reordering,
config_am_pP->t_status_prohibit); config_am_pP->t_status_prohibit);
} else { } else {
LOG_E(RLC, "[FRAME %5u][%s][RRC][MOD %u/%u][][--- CONFIG_REQ --->][RLC_AM][MOD %u/%u][RB %u] RLC NOT FOUND\n", LOG_E(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" CONFIG_REQ RLC NOT FOUND\n",
ctxt_pP->frame, PROTOCOL_CTXT_ARGS(ctxt_pP),
(ctxt_pP->enb_flag) ? "eNB" : "UE", RB_AM_ARGS(l_rlc_p));
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP);
} }
} }
uint32_t pollPDU_tab[PollPDU_pInfinity+1]={4,8,16,32,64,128,256,1024}; // What is PollPDU_pInfinity??? 1024 for now uint32_t pollPDU_tab[PollPDU_pInfinity+1]={4,8,16,32,64,128,256,1024}; // What is PollPDU_pInfinity??? 1024 for now
...@@ -192,20 +191,15 @@ void config_req_rlc_am_asn1 ( ...@@ -192,20 +191,15 @@ void config_req_rlc_am_asn1 (
(config_am_pP->dl_AM_RLC.t_Reordering<T_Reordering_spare1) && (config_am_pP->dl_AM_RLC.t_Reordering<T_Reordering_spare1) &&
(config_am_pP->dl_AM_RLC.t_StatusProhibit<T_StatusProhibit_spare8) ){ (config_am_pP->dl_AM_RLC.t_StatusProhibit<T_StatusProhibit_spare8) ){
LOG_D(RLC, "[FRAME %5u][%s][RRC][MOD %u/%u][][--- CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d) --->][RLC_AM][MOD %u/%u][RB %u]\n", LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d)\n",
ctxt_pP->frame, PROTOCOL_CTXT_ARGS(ctxt_pP),
(ctxt_pP->enb_flag) ? "eNB" : "UE", RB_AM_ARGS(l_rlc_p),
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold], maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold],
pollPDU_tab[config_am_pP->ul_AM_RLC.pollPDU], pollPDU_tab[config_am_pP->ul_AM_RLC.pollPDU],
pollByte_tab[config_am_pP->ul_AM_RLC.pollByte], pollByte_tab[config_am_pP->ul_AM_RLC.pollByte],
PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit], PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit], t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP);
rlc_am_init(ctxt_pP, l_rlc_p); rlc_am_init(ctxt_pP, l_rlc_p);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP); rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP);
...@@ -218,30 +212,20 @@ void config_req_rlc_am_asn1 ( ...@@ -218,30 +212,20 @@ void config_req_rlc_am_asn1 (
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
} else { } else {
LOG_D(RLC, LOG_D(RLC,
"[FRAME %5u][%s][RRC][MOD %u/%u][][--- ILLEGAL CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d) --->][RLC_AM][MOD %u/%u][RB %u], RLC-AM NOT CONFIGURED\n", PROTOCOL_CTXT_FMT RB_AM_FMT "ILLEGAL CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d), RLC-AM NOT CONFIGURED\n",
ctxt_pP->frame, PROTOCOL_CTXT_ARGS(ctxt_pP),
(ctxt_pP->enb_flag) ? "eNB" : "UE", RB_AM_ARGS(l_rlc_p),
ctxt_pP->enb_module_id, config_am_pP->ul_AM_RLC.maxRetxThreshold,
ctxt_pP->ue_module_id, config_am_pP->ul_AM_RLC.pollPDU,
config_am_pP->ul_AM_RLC.maxRetxThreshold, config_am_pP->ul_AM_RLC.pollByte,
config_am_pP->ul_AM_RLC.pollPDU, config_am_pP->ul_AM_RLC.t_PollRetransmit,
config_am_pP->ul_AM_RLC.pollByte, config_am_pP->dl_AM_RLC.t_Reordering,
config_am_pP->ul_AM_RLC.t_PollRetransmit, config_am_pP->dl_AM_RLC.t_StatusProhibit);
config_am_pP->dl_AM_RLC.t_Reordering,
config_am_pP->dl_AM_RLC.t_StatusProhibit,
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP);
} }
} else { } else {
LOG_E(RLC, "[FRAME %5u][%s][RRC][MOD %u/%u][][--- CONFIG_REQ --->][RLC_AM][MOD %u/%u][RB %u] RLC NOT FOUND\n", LOG_E(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT "CONFIG_REQ RLC NOT FOUND\n",
ctxt_pP->frame, PROTOCOL_CTXT_ARGS(ctxt_pP),
(ctxt_pP->enb_flag) ? "eNB" : "UE", RB_AM_ARGS(l_rlc_p));
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP);
} }
} }
......
...@@ -86,6 +86,11 @@ ...@@ -86,6 +86,11 @@
#define RB_AM_FMT "[%s %02u]"
#define RB_AM_ARGS(RLC_Pp) \
(RLC_Pp->is_data_plane == TRUE) ? "DRB AM":"SRB AM", \
RLC_Pp->rb_id
/*! \fn void rlc_am_release (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP) /*! \fn void rlc_am_release (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP)
* \brief Empty function, TO DO. * \brief Empty function, TO DO.
* \param[in] ctxt_pP Running context. * \param[in] ctxt_pP Running context.
......
...@@ -43,9 +43,11 @@ rlc_am_init( ...@@ -43,9 +43,11 @@ rlc_am_init(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlc_pP->initialized == TRUE) { if (rlc_pP->initialized == TRUE) {
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] INITIALIZATION ALREADY DONE, DOING NOTHING\n", ctxt_pP->frame); LOG_D(RLC, PROTOCOL_CTXT_FMT"[AM INIT] INITIALIZATION ALREADY DONE, DOING NOTHING\n",
PROTOCOL_CTXT_ARGS(ctxt_pP));
} else { } else {
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] INITIALIZATION: STATE VARIABLES, BUFFERS, LISTS\n", ctxt_pP->frame); LOG_D(RLC, PROTOCOL_CTXT_FMT"[AM INIT] INITIALIZATION: STATE VARIABLES, BUFFERS, LISTS\n",
PROTOCOL_CTXT_ARGS(ctxt_pP));
memset(rlc_pP, 0, sizeof(rlc_am_entity_t)); memset(rlc_pP, 0, sizeof(rlc_am_entity_t));
list2_init(&rlc_pP->receiver_buffer, "RX BUFFER"); list2_init(&rlc_pP->receiver_buffer, "RX BUFFER");
...@@ -59,8 +61,14 @@ rlc_am_init( ...@@ -59,8 +61,14 @@ rlc_am_init(
#warning "cast the rlc retrans buffer to uint32" #warning "cast the rlc retrans buffer to uint32"
// rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t))); // rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
rlc_pP->pdu_retrans_buffer = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t))); rlc_pP->pdu_retrans_buffer = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] input_sdus[] = %p element size=%d\n", ctxt_pP->frame, rlc_pP->input_sdus,sizeof(rlc_am_tx_sdu_management_t)); LOG_D(RLC, PROTOCOL_CTXT_FMT"[AM INIT] input_sdus[] = %p element size=%d\n",
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] pdu_retrans_buffer[] = %p element size=%d\n", ctxt_pP->frame, rlc_pP->pdu_retrans_buffer,sizeof(rlc_am_tx_data_pdu_management_t)); PROTOCOL_CTXT_ARGS(ctxt_pP),
rlc_pP->input_sdus,
sizeof(rlc_am_tx_sdu_management_t));
LOG_D(RLC, PROTOCOL_CTXT_FMT"[AM INIT] pdu_retrans_buffer[] = %p element size=%d\n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
rlc_pP->pdu_retrans_buffer,
sizeof(rlc_am_tx_data_pdu_management_t));
// TX state variables // TX state variables
//rlc_pP->vt_a = 0; //rlc_pP->vt_a = 0;
...@@ -104,7 +112,8 @@ rlc_am_reestablish( ...@@ -104,7 +112,8 @@ rlc_am_reestablish(
* - stop and reset all timers; * - stop and reset all timers;
* - reset all state variables to their initial values. * - reset all state variables to their initial values.
*/ */
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][REESTABLISH] RE-INIT STATE VARIABLES, BUFFERS, LISTS\n", ctxt_pP->frame); LOG_D(RLC, PROTOCOL_CTXT_FMT"[AM REESTABLISH] RE-INIT STATE VARIABLES, BUFFERS, LISTS\n",
PROTOCOL_CTXT_ARGS(ctxt_pP));
#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR) #warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR)
list2_free(&rlc_pP->receiver_buffer); list2_free(&rlc_pP->receiver_buffer);
...@@ -141,15 +150,13 @@ rlc_am_reestablish( ...@@ -141,15 +150,13 @@ rlc_am_reestablish(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_am_cleanup( rlc_am_cleanup(
const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP
rlc_am_entity_t* const rlc_pP) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_I(RLC, "[FRAME ?????][%s][RLC_AM][MOD %u/%u][RB %u][CLEANUP]\n", LOG_I(RLC, RB_AM_FMT"[CLEANUP %p]\n",
(ctxt_pP->enb_flag) ? "eNB" : "UE", RB_AM_ARGS(rlc_pP),
ctxt_pP->enb_module_id, rlc_pP);
ctxt_pP->ue_module_id,
rlc_pP->rb_id);
list2_free(&rlc_pP->receiver_buffer); list2_free(&rlc_pP->receiver_buffer);
list_free(&rlc_pP->pdus_to_mac_layer); list_free(&rlc_pP->pdus_to_mac_layer);
...@@ -199,11 +206,8 @@ rlc_am_configure( ...@@ -199,11 +206,8 @@ rlc_am_configure(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlc_pP->configured == TRUE) { if (rlc_pP->configured == TRUE) {
LOG_I(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][RECONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n", LOG_I(RLC, PROTOCOL_CTXT_FMT"[RB AM %u][RECONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n",
ctxt_pP->frame, PROTOCOL_CTXT_ARGS(ctxt_pP),
(ctxt_pP->enb_flag) ? "eNB" : "UE",
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rlc_pP->rb_id, rlc_pP->rb_id,
max_retx_thresholdP, max_retx_thresholdP,
poll_pduP, poll_pduP,
...@@ -221,18 +225,15 @@ rlc_am_configure( ...@@ -221,18 +225,15 @@ rlc_am_configure(
rlc_pP->t_reordering.time_out = t_reorderingP; rlc_pP->t_reordering.time_out = t_reorderingP;
rlc_pP->t_status_prohibit.time_out = t_status_prohibitP; rlc_pP->t_status_prohibit.time_out = t_status_prohibitP;
} else { } else {
LOG_I(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][CONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n", LOG_I(RLC, PROTOCOL_CTXT_FMT"[RB AM %u][CONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n",
ctxt_pP->frame, PROTOCOL_CTXT_ARGS(ctxt_pP),
(ctxt_pP->enb_flag) ? "eNB" : "UE", rlc_pP->rb_id,
ctxt_pP->enb_module_id, max_retx_thresholdP,
ctxt_pP->ue_module_id, poll_pduP,
rlc_pP->rb_id, poll_byteP,
max_retx_thresholdP, t_poll_retransmitP,
poll_pduP, t_reorderingP,
poll_byteP, t_status_prohibitP);
t_poll_retransmitP,
t_reorderingP,
t_status_prohibitP);
rlc_pP->max_retx_threshold = max_retx_thresholdP; rlc_pP->max_retx_threshold = max_retx_thresholdP;
rlc_pP->poll_pdu = poll_pduP; rlc_pP->poll_pdu = poll_pduP;
...@@ -257,17 +258,6 @@ rlc_am_set_debug_infos( ...@@ -257,17 +258,6 @@ rlc_am_set_debug_infos(
const rb_id_t rb_idP) const rb_id_t rb_idP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][SET DEBUG INFOS] module_id %d rb_id %d is SRB %d\n",
ctxt_pP->frame,
(ctxt_pP->enb_flag) ? "eNB" : "UE",
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP,
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP,
(srb_flagP) ? "TRUE" : "FALSE");
rlc_pP->rb_id = rb_idP; rlc_pP->rb_id = rb_idP;
if (srb_flagP) { if (srb_flagP) {
...@@ -275,4 +265,8 @@ rlc_am_set_debug_infos( ...@@ -275,4 +265,8 @@ rlc_am_set_debug_infos(
} else { } else {
rlc_pP->is_data_plane = 1; rlc_pP->is_data_plane = 1;
} }
LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT "[SET DEBUG INFOS]\n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
RB_AM_ARGS(rlc_pP));
} }
...@@ -85,12 +85,11 @@ typedef volatile struct { ...@@ -85,12 +85,11 @@ typedef volatile struct {
*/ */
public_rlc_am_init( void rlc_am_init (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t* rlc_pP);) public_rlc_am_init( void rlc_am_init (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t* rlc_pP);)
/*! \fn void rlc_am_cleanup(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t *const rlc_pP) /*! \fn void rlc_am_cleanup(rlc_am_entity_t *const rlc_pP)
* \brief Free all memory resources allocated and kept by this RLC AM instance. * \brief Free all memory resources allocated and kept by this RLC AM instance.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
*/ */
public_rlc_am_init( void rlc_am_cleanup(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t* rlc_pP);) public_rlc_am_init( void rlc_am_cleanup(rlc_am_entity_t* rlc_pP);)
/*! \fn void rlc_am_configure(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, uint16_t max_retx_thresholdP, uint16_t poll_pduP, uint16_t poll_byteP, uint32_t t_poll_retransmitP, uint32_t t_reorderingP, uint32_t t_status_prohibitP) /*! \fn void rlc_am_configure(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, uint16_t max_retx_thresholdP, uint16_t poll_pduP, uint16_t poll_byteP, uint32_t t_poll_retransmitP, uint32_t t_reorderingP, uint32_t t_status_prohibitP)
* \brief Set RLC AM protocol parameters. * \brief Set RLC AM protocol parameters.
......
...@@ -122,7 +122,6 @@ rlc_tm_reset_state_variables ( ...@@ -122,7 +122,6 @@ rlc_tm_reset_state_variables (
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_tm_cleanup ( rlc_tm_cleanup (
const protocol_ctxt_t* const ctxt_pP,
rlc_tm_entity_t * const rlcP rlc_tm_entity_t * const rlcP
) )
{ {
......
...@@ -104,12 +104,11 @@ protected_rlc_tm_init(void rlc_tm_reset_state_variables ( ...@@ -104,12 +104,11 @@ protected_rlc_tm_init(void rlc_tm_reset_state_variables (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
rlc_tm_entity_t * const rlcP);) rlc_tm_entity_t * const rlcP);)
/*! \fn void rlc_tm_cleanup(const protocol_ctxt_t* const ctxt_pP,rlc_tm_entity_t * const rlcP) /*! \fn void rlc_tm_cleanup(rlc_tm_entity_t * const rlcP)
* \brief Free all allocated memory (lists and buffers) previously allocated by this RLC TM instance. * \brief Free all allocated memory (lists and buffers) previously allocated by this RLC TM instance.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
*/ */
public_rlc_tm_init( void rlc_tm_cleanup( public_rlc_tm_init( void rlc_tm_cleanup(
const protocol_ctxt_t* const ctxt_pP,
rlc_tm_entity_t * const rlcP);) rlc_tm_entity_t * const rlcP);)
/*! \fn void rlc_tm_configure(const protocol_ctxt_t* const ctxt_pP,rlc_tm_entity_t * const rlcP, const boolean_t is_uplink_downlinkP) /*! \fn void rlc_tm_configure(const protocol_ctxt_t* const ctxt_pP,rlc_tm_entity_t * const rlcP, const boolean_t is_uplink_downlinkP)
......
...@@ -286,7 +286,6 @@ rlc_um_reset_state_variables ( ...@@ -286,7 +286,6 @@ rlc_um_reset_state_variables (
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_um_cleanup ( rlc_um_cleanup (
const protocol_ctxt_t* const ctxt_pP,
rlc_um_entity_t * const rlc_pP) rlc_um_entity_t * const rlc_pP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -138,13 +138,11 @@ protected_rlc_um_control_primitives(void rlc_um_reset_state_variables ( ...@@ -138,13 +138,11 @@ protected_rlc_um_control_primitives(void rlc_um_reset_state_variables (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
rlc_um_entity_t * const rlc_pP);) rlc_um_entity_t * const rlc_pP);)
/*! \fn void rlc_um_cleanup(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP) /*! \fn void rlc_um_cleanup(rlc_um_entity_t * const rlc_pP)
* \brief Free all allocated memory (lists and buffers) previously allocated by this RLC UM instance. * \brief Free all allocated memory (lists and buffers) previously allocated by this RLC UM instance.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] rlc_pP RLC UM protocol instance pointer.
*/ */
public_rlc_um_control_primitives( void rlc_um_cleanup( public_rlc_um_control_primitives( void rlc_um_cleanup(
const protocol_ctxt_t* const ctxt_pP,
rlc_um_entity_t * const rlc_pP);) rlc_um_entity_t * const rlc_pP);)
/*! \fn void rlc_um_configure( /*! \fn void rlc_um_configure(
......
...@@ -524,11 +524,11 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxtP, ...@@ -524,11 +524,11 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxtP,
rlc_um_data_req(ctxtP, &rlc_union_p->rlc.um, new_sdu_p); rlc_um_data_req(ctxtP, &rlc_union_p->rlc.um, new_sdu_p);
//free_mem_block(new_sdu); //free_mem_block(new_sdu);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_OK; return RLC_OP_STATUS_OK;
} else { } else {
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_INTERNAL_ERROR; return RLC_OP_STATUS_INTERNAL_ERROR;
} }
break; break;
...@@ -559,18 +559,18 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxtP, ...@@ -559,18 +559,18 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxtP,
rb_idP); rb_idP);
LOG_D(RLC, "%s\n",RLC_FG_COLOR_DEFAULT); LOG_D(RLC, "%s\n",RLC_FG_COLOR_DEFAULT);
rlc_tm_data_req(ctxtP, &rlc_union_p->rlc.tm, new_sdu_p); rlc_tm_data_req(ctxtP, &rlc_union_p->rlc.tm, new_sdu_p);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_OK; return RLC_OP_STATUS_OK;
} else { } else {
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : out of memory\n", __FILE__, __LINE__); //handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : out of memory\n", __FILE__, __LINE__);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_INTERNAL_ERROR; return RLC_OP_STATUS_INTERNAL_ERROR;
} }
break; break;
default: default:
free_mem_block(sdu_pP); free_mem_block(sdu_pP);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_INTERNAL_ERROR; return RLC_OP_STATUS_INTERNAL_ERROR;
} }
...@@ -605,18 +605,18 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxtP, ...@@ -605,18 +605,18 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxtP,
rlc_um_data_req(ctxtP, &rlc_union_p->rlc.um, new_sdu_p); rlc_um_data_req(ctxtP, &rlc_union_p->rlc.um, new_sdu_p);
//free_mem_block(new_sdu); //free_mem_block(new_sdu);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_OK; return RLC_OP_STATUS_OK;
} else { } else {
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_BAD_PARAMETER; return RLC_OP_STATUS_BAD_PARAMETER;
} }
} else { } else {
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_BAD_PARAMETER; return RLC_OP_STATUS_BAD_PARAMETER;
} }
} else { } else {
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
return RLC_OP_STATUS_BAD_PARAMETER; return RLC_OP_STATUS_BAD_PARAMETER;
} }
} }
......
...@@ -335,11 +335,10 @@ public_rlc_rrc( rlc_op_status_t rrc_rlc_config_asn1_req ( ...@@ -335,11 +335,10 @@ public_rlc_rrc( rlc_op_status_t rrc_rlc_config_asn1_req (
/*! \fn void rb_free_rlc_union (void *rlcu_pP) /*! \fn void rb_free_rlc_union (void *rlcu_pP)
* \brief Free the rlc memory contained in the RLC embedded in the rlc_union_t * \brief Free the rlc memory contained in the RLC embedded in the rlc_union_t
* struct pointed by of the rlcu_pP parameter. Free the rlc_union_t struct also. * struct pointed by of the rlcu_pP parameter. Free the rlc_union_t struct also.
* \param[in] ctxtP Running context.
* \param[in] rlcu_pP Pointer on the rlc_union_t struct. * \param[in] rlcu_pP Pointer on the rlc_union_t struct.
*/ */
public_rlc_rrc(void public_rlc_rrc(void
rb_free_rlc_union (const protocol_ctxt_t* const ctxt_pP, void *rlcu_pP);) rb_free_rlc_union (void *rlcu_pP);)
/*! \fn rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const ctxtP) /*! \fn rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const ctxtP)
......
...@@ -407,22 +407,22 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP ...@@ -407,22 +407,22 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rb_free_rlc_union ( rb_free_rlc_union (
const protocol_ctxt_t* const ctxt_pP,
void *rlcu_pP) void *rlcu_pP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlc_union_t * rlcu_p; rlc_union_t * rlcu_p;
if (rlcu_pP) { if (rlcu_pP) {
rlcu_p = (rlc_union_t *)(rlcu_pP); rlcu_p = (rlc_union_t *)(rlcu_pP);
LOG_D(RLC,"%s %p \n",__FUNCTION__,rlcu_pP);
switch (rlcu_p->mode) { switch (rlcu_p->mode) {
case RLC_MODE_AM: case RLC_MODE_AM:
rlc_am_cleanup(ctxt_pP, &rlcu_p->rlc.am); rlc_am_cleanup(&rlcu_p->rlc.am);
break; break;
case RLC_MODE_UM: case RLC_MODE_UM:
rlc_um_cleanup(ctxt_pP, &rlcu_p->rlc.um); rlc_um_cleanup(&rlcu_p->rlc.um);
break; break;
case RLC_MODE_TM: case RLC_MODE_TM:
rlc_tm_cleanup(ctxt_pP, &rlcu_p->rlc.tm); rlc_tm_cleanup(&rlcu_p->rlc.tm);
break; break;
default: default:
LOG_W(RLC, LOG_W(RLC,
...@@ -431,11 +431,6 @@ rb_free_rlc_union ( ...@@ -431,11 +431,6 @@ rb_free_rlc_union (
rlcu_pP); rlcu_pP);
break; break;
} }
LOG_D(RLC,
"%s %p \n",
__FUNCTION__,
rlcu_pP);
free(rlcu_p);
} }
} }
...@@ -529,7 +524,7 @@ rlc_op_status_t rrc_rlc_remove_rlc ( ...@@ -529,7 +524,7 @@ rlc_op_status_t rrc_rlc_remove_rlc (
h_rc = hashtable_get(rlc_coll_p, key, &rlc_union_p); h_rc = hashtable_get(rlc_coll_p, key, &rlc_union_p);
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
switch (rlc_union_p->mode) { /*switch (rlc_union_p->mode) {
case RLC_MODE_AM: case RLC_MODE_AM:
rlc_am_cleanup(ctxt_pP, &rlc_union_p->rlc.am); rlc_am_cleanup(ctxt_pP, &rlc_union_p->rlc.am);
break; break;
...@@ -542,6 +537,8 @@ rlc_op_status_t rrc_rlc_remove_rlc ( ...@@ -542,6 +537,8 @@ rlc_op_status_t rrc_rlc_remove_rlc (
default: default:
break; break;
} }
cleanup is done in free() callback function configured in hashtable
*/
h_rc = hashtable_remove(rlc_coll_p, key); h_rc = hashtable_remove(rlc_coll_p, key);
LOG_D(RLC, "[Frame %05u][%s][RLC_RRC][INST %u/%u][%s %u] RELEASED %s\n", LOG_D(RLC, "[Frame %05u][%s][RLC_RRC][INST %u/%u][%s %u] RELEASED %s\n",
ctxt_pP->frame, ctxt_pP->frame,
......
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