Commit 4158dd2e authored by Lionel Gauthier's avatar Lionel Gauthier

TX SDU RLC am was blocked if last SDU transmitted was lost in the air, due to BO computation

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7450 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 24cbca8b
......@@ -48,14 +48,10 @@
#include "UTIL/LOG/log.h"
#include "UL-AM-RLC.h"
#include "DL-AM-RLC.h"
//#define TRACE_RLC_AM_DATA_REQUEST
//#define TRACE_RLC_AM_TX_STATUS
//#define TRACE_RLC_AM_TX
//#define TRACE_RLC_AM_RX
//#define TRACE_RLC_AM_BO
extern rlc_am_control_pdu_info_t g_rlc_am_control_pdu_info;
//-----------------------------------------------------------------------------
uint32_t
rlc_am_get_buffer_occupancy_in_bytes (
......@@ -514,7 +510,6 @@ rlc_am_get_pdus (
if (rlc_pP->nb_bytes_requested_by_mac <= 2) {
LOG_D(RLC, "NUM BYTES REQUESTED BY MAC = %d", rlc_pP->nb_bytes_requested_by_mac);
}
LOG_D(RLC, "\n");
}
......@@ -608,8 +603,52 @@ rlc_am_mac_status_indication (
}
} else {
if (rlc_am_is_timer_poll_retransmit_timed_out(ctxt_pP, rlc)) {
if ((status_resp.buffer_occupancy_in_bytes == 0) && (rlc->input_sdus[rlc->current_sdu_index].mem_block == NULL) && (rlc->nb_sdu > 0)) {
// force BO to be > 0
rlc_sn_t sn = (rlc->vt_s - 1) & RLC_AM_SN_MASK;
rlc_sn_t sn_end = (rlc->vt_a - 1) & RLC_AM_SN_MASK;
int found_pdu = 0;
rlc_sn_t found_pdu_sn = 0; // avoid warning
while (sn != sn_end) {
if (rlc->pdu_retrans_buffer[sn].mem_block != NULL) {
if (!found_pdu) {
found_pdu = 1;
found_pdu_sn = sn;
}
status_resp.buffer_occupancy_in_bytes = rlc->pdu_retrans_buffer[sn].header_and_payload_size;
status_resp.buffer_occupancy_in_pdus = rlc->nb_sdu;
status_resp.head_sdu_remaining_size_to_send = status_resp.buffer_occupancy_in_bytes;
// TODO head_sdu_is_segmented
break;
}
}
}
}
}
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_RX_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE,
NULL,0,
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-IND %u",
MSC_AS_TIME_ARGS(ctxt_pP),
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc),
tb_sizeP);
MSC_LOG_TX_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE,
NULL,0,
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-RESP BO:%u/n%u(%u) %s sdu remain %u",
MSC_AS_TIME_ARGS(ctxt_pP),
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc),
status_resp.buffer_occupancy_in_bytes,
status_resp.buffer_occupancy_in_pdus,rlc->nb_sdu,
(status_resp.head_sdu_is_segmented)?"sdu seg":"sdu not seg",
status_resp.head_sdu_remaining_size_to_send);
#endif
#ifdef TRACE_RLC_AM_TX_STATUS
......@@ -794,7 +833,7 @@ rlc_am_mac_data_request (
# endif
}
} else {
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &g_rlc_am_control_pdu_info) >= 0) {
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) {
tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size; //tb_size_in_bytes modified by rlc_am_get_control_pdu_infos!
#ifdef MESSAGE_CHART_GENERATOR
message_string_size = 0;
......@@ -802,18 +841,18 @@ rlc_am_mac_data_request (
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS ACK_SN %u",
MSC_AS_TIME_ARGS(ctxt_pP),
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
g_rlc_am_control_pdu_info.ack_sn);
l_rlc_p->control_pdu_info.ack_sn);
for (num_nack = 0; num_nack < g_rlc_am_control_pdu_info.num_nack; num_nack++) {
if (g_rlc_am_control_pdu_info.nack_list[num_nack].e2) {
for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) {
if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) {
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u",
g_rlc_am_control_pdu_info.nack_list[num_nack].nack_sn,
g_rlc_am_control_pdu_info.nack_list[num_nack].so_start,
g_rlc_am_control_pdu_info.nack_list[num_nack].so_end);
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn,
l_rlc_p->control_pdu_info.nack_list[num_nack].so_start,
l_rlc_p->control_pdu_info.nack_list[num_nack].so_end);
} else {
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u",
g_rlc_am_control_pdu_info.nack_list[num_nack].nack_sn);
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn);
}
}
......@@ -831,19 +870,19 @@ rlc_am_mac_data_request (
message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC AM DATA REQ: STATUS PDU\n\n");
message_string_size += sprintf(&message_string[message_string_size], "Header :\n");
message_string_size += sprintf(&message_string[message_string_size], " D/C : %u\n", g_rlc_am_control_pdu_info.d_c);
message_string_size += sprintf(&message_string[message_string_size], " CPT : %u\n", g_rlc_am_control_pdu_info.cpt);
message_string_size += sprintf(&message_string[message_string_size], " ACK_SN : %u\n", g_rlc_am_control_pdu_info.ack_sn);
message_string_size += sprintf(&message_string[message_string_size], " E1 : %u\n", g_rlc_am_control_pdu_info.e1);
message_string_size += sprintf(&message_string[message_string_size], " D/C : %u\n", l_rlc_p->control_pdu_info.d_c);
message_string_size += sprintf(&message_string[message_string_size], " CPT : %u\n", l_rlc_p->control_pdu_info.cpt);
message_string_size += sprintf(&message_string[message_string_size], " ACK_SN : %u\n", l_rlc_p->control_pdu_info.ack_sn);
message_string_size += sprintf(&message_string[message_string_size], " E1 : %u\n", l_rlc_p->control_pdu_info.e1);
for (num_nack = 0; num_nack < g_rlc_am_control_pdu_info.num_nack; num_nack++) {
if (g_rlc_am_control_pdu_info.nack_list[num_nack].e2) {
for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) {
if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) {
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %04d SO START %05d SO END %05d",
g_rlc_am_control_pdu_info.nack_list[num_nack].nack_sn,
g_rlc_am_control_pdu_info.nack_list[num_nack].so_start,
g_rlc_am_control_pdu_info.nack_list[num_nack].so_end);
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn,
l_rlc_p->control_pdu_info.nack_list[num_nack].so_start,
l_rlc_p->control_pdu_info.nack_list[num_nack].so_end);
} else {
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %04d", g_rlc_am_control_pdu_info.nack_list[num_nack].nack_sn);
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %04d", l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn);
}
}
......@@ -1014,25 +1053,25 @@ rlc_am_mac_data_indication (
# endif
}
} else {
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &g_rlc_am_control_pdu_info) >= 0) {
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) {
#ifdef MESSAGE_CHART_GENERATOR
message_string_size = 0;
message_string_size += sprintf(&message_string[message_string_size],
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS size ACK_SN %u",
MSC_AS_TIME_ARGS(ctxt_pP),
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
g_rlc_am_control_pdu_info.ack_sn);
l_rlc_p->control_pdu_info.ack_sn);
for (num_nack = 0; num_nack < g_rlc_am_control_pdu_info.num_nack; num_nack++) {
if (g_rlc_am_control_pdu_info.nack_list[num_nack].e2) {
for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) {
if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) {
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u",
g_rlc_am_control_pdu_info.nack_list[num_nack].nack_sn,
g_rlc_am_control_pdu_info.nack_list[num_nack].so_start,
g_rlc_am_control_pdu_info.nack_list[num_nack].so_end);
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn,
l_rlc_p->control_pdu_info.nack_list[num_nack].so_start,
l_rlc_p->control_pdu_info.nack_list[num_nack].so_end);
} else {
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u",
g_rlc_am_control_pdu_info.nack_list[num_nack].nack_sn);
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn);
}
}
......@@ -1051,19 +1090,19 @@ rlc_am_mac_data_indication (
message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", ((struct mac_tb_ind *) (tb_p->data))->size);
message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC AM DATA IND: STATUS PDU\n\n");
message_string_size += sprintf(&message_string[message_string_size], "Header :\n");
message_string_size += sprintf(&message_string[message_string_size], " D/C : %u\n", g_rlc_am_control_pdu_info.d_c);
message_string_size += sprintf(&message_string[message_string_size], " CPT : %u\n", g_rlc_am_control_pdu_info.cpt);
message_string_size += sprintf(&message_string[message_string_size], " ACK_SN : %u\n", g_rlc_am_control_pdu_info.ack_sn);
message_string_size += sprintf(&message_string[message_string_size], " E1 : %u\n", g_rlc_am_control_pdu_info.e1);
message_string_size += sprintf(&message_string[message_string_size], " D/C : %u\n", l_rlc_p->control_pdu_info.d_c);
message_string_size += sprintf(&message_string[message_string_size], " CPT : %u\n", l_rlc_p->control_pdu_info.cpt);
message_string_size += sprintf(&message_string[message_string_size], " ACK_SN : %u\n", l_rlc_p->control_pdu_info.ack_sn);
message_string_size += sprintf(&message_string[message_string_size], " E1 : %u\n", l_rlc_p->control_pdu_info.e1);
for (num_nack = 0; num_nack < g_rlc_am_control_pdu_info.num_nack; num_nack++) {
if (g_rlc_am_control_pdu_info.nack_list[num_nack].e2) {
for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) {
if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) {
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %04d SO START %05d SO END %05d",
g_rlc_am_control_pdu_info.nack_list[num_nack].nack_sn,
g_rlc_am_control_pdu_info.nack_list[num_nack].so_start,
g_rlc_am_control_pdu_info.nack_list[num_nack].so_end);
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn,
l_rlc_p->control_pdu_info.nack_list[num_nack].so_start,
l_rlc_p->control_pdu_info.nack_list[num_nack].so_end);
} else {
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %04d", g_rlc_am_control_pdu_info.nack_list[num_nack].nack_sn);
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %04d", l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn);
}
}
......
......@@ -62,12 +62,13 @@ typedef struct rlc_am_entity_s {
rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */
logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */
boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
//boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */
rlc_buffer_occupancy_t sdu_buffer_occupancy; /*!< \brief Number of bytes of unsegmented SDUs. */
rlc_buffer_occupancy_t retransmission_buffer_occupancy; /*!< \brief Number of bytes of PDUs in retransmission buffer waiting for a ACK. */
rlc_buffer_occupancy_t status_buffer_occupancy; /*!< \brief Number of bytes of control PDUs waiting for transmission. */
rlc_am_control_pdu_info_t control_pdu_info;
//---------------------------------------------------------------------
// TX BUFFERS
//---------------------------------------------------------------------
......@@ -86,6 +87,7 @@ typedef struct rlc_am_entity_s {
signed int retrans_num_bytes_to_retransmit; /*!< \brief Number of bytes in the retransmission buffer to be retransmitted. */
unsigned int num_nack_so; /*!< \brief Number of segment offsets asked to be retransmitted by peer RLC entity. */
unsigned int num_nack_sn; /*!< \brief Number of segment asked to be retransmitted by peer RLC entity. */
boolean_t force_poll; /*!< \brief force poll due to t_poll_retransmit time-out. */
//---------------------------------------------------------------------
// RX BUFFERS
......
......@@ -35,10 +35,7 @@
#include "rlc.h"
#include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h"
//#define TRACE_RLC_AM_RESEGMENT
//#define TRACE_RLC_AM_FORCE_TRAFFIC
//#define TRACE_RLC_AM_NACK
//#define TRACE_RLC_AM_ACK
#include "msc.h"
//-----------------------------------------------------------------------------
void rlc_am_nack_pdu (
const protocol_ctxt_t* const ctxt_pP,
......@@ -122,7 +119,14 @@ void rlc_am_nack_pdu (
#endif
rlc_pP->stat_tx_pdcp_sdu_discarded += 1;
rlc_pP->stat_tx_pdcp_bytes_discarded += rlc_pP->input_sdus[sdu_index].sdu_size;
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" Dropped SDU mui %u cause max_retx %u reached",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP),
rlc_pP->input_sdus[sdu_index].mui,
rlc_pP->max_retx_threshold);
rlc_am_free_in_sdu(ctxt_pP, rlc_pP, sdu_index);
}
}
}
......@@ -843,6 +847,11 @@ void rlc_am_retransmit_any_pdu(
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[FORCE-TRAFFIC] RE-SEND DATA PDU SN %04d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
sn);
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" RTX any pdu found SN %u",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), sn);
#endif
rlc_am_nack_pdu (ctxt_pP, rlc_pP, sn, 0, 0x7FFF);
// no need for update rlc_pP->nb_bytes_requested_by_mac
pdu_p = rlc_am_retransmit_get_copy(ctxt_pP, rlc_pP, sn);
......@@ -873,6 +882,11 @@ void rlc_am_retransmit_any_pdu(
found_pdu_sn);
if (rlc_pP->nb_bytes_requested_by_mac > 4) {
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" RTX any pdu found SN %u (subseg)",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), found_pdu_sn);
#endif
rlc_am_nack_pdu (ctxt_pP, rlc_pP, found_pdu_sn, 0, 0x7FFF);
pdu_p = rlc_am_retransmit_get_subsegment(ctxt_pP, rlc_pP, found_pdu_sn, &rlc_pP->nb_bytes_requested_by_mac);
pdu_sn_10_p = (rlc_am_pdu_sn_10_t*) (&pdu_p->data[sizeof(struct mac_tb_req)]);
......
......@@ -84,26 +84,25 @@ void rlc_am_pdu_polling (
(rlc_pP->c_pdu_without_poll >= rlc_pP->poll_pdu) ||
(rlc_pP->c_byte_without_poll >= rlc_pP->poll_byte) ||
((rlc_pP->sdu_buffer_occupancy == 0) && (rlc_pP->retrans_num_bytes_to_retransmit == 0)) ||
(rlc_pP->vt_s == rlc_pP->vt_ms)
(rlc_pP->vt_s == rlc_pP->vt_ms) ||
(rlc_pP->force_poll == TRUE)
) {
rlc_pP->force_poll = FALSE;
if (rlc_pP->c_pdu_without_poll >= rlc_pP->poll_pdu) {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[POLL] SET POLL BECAUSE TX NUM PDU THRESHOLD %d HAS BEEN REACHED\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->poll_pdu);
}
} else
if (rlc_pP->c_byte_without_poll >= rlc_pP->poll_byte) {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[POLL] SET POLL BECAUSE TX NUM BYTES THRESHOLD %d HAS BEEN REACHED\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->poll_byte);
}
} else
if ((rlc_pP->sdu_buffer_occupancy == 0) && (rlc_pP->retrans_num_bytes_to_retransmit == 0)) {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[POLL] SET POLL BECAUSE TX BUFFERS ARE EMPTY\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
}
} else
if (rlc_pP->vt_s == rlc_pP->vt_ms) {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[POLL] SET POLL BECAUSE OF WINDOW STALLING\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
......
......@@ -44,9 +44,6 @@
//#define TRACE_RLC_AM_STATUS_CREATION 1
rlc_am_control_pdu_info_t g_rlc_am_control_pdu_info;
# if defined(ENABLE_ITTI)
//-----------------------------------------------------------------------------
void
......@@ -288,7 +285,7 @@ rlc_am_receive_process_control_pdu(
rlc_am_pdu_sn_10_t *rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)*first_byte_ppP;
sdu_size_t initial_pdu_size = *tb_size_in_bytes_pP;
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, tb_size_in_bytes_pP, &g_rlc_am_control_pdu_info) >= 0) {
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, tb_size_in_bytes_pP, &rlc_pP->control_pdu_info) >= 0) {
rlc_am_tx_buffer_display(ctxt_pP, rlc_pP, " TX BUFFER BEFORE PROCESS OF STATUS PDU");
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RX CONTROL PDU VT(A) %04d VT(S) %04d POLL_SN %04d ACK_SN %04d\n",
......@@ -296,10 +293,10 @@ rlc_am_receive_process_control_pdu(
rlc_pP->vt_a,
rlc_pP->vt_s,
rlc_pP->poll_sn,
g_rlc_am_control_pdu_info.ack_sn);
rlc_am_display_control_pdu_infos(&g_rlc_am_control_pdu_info);
rlc_pP->control_pdu_info.ack_sn);
rlc_am_display_control_pdu_infos(&rlc_pP->control_pdu_info);
rlc_sn_t ack_sn = g_rlc_am_control_pdu_info.ack_sn;
rlc_sn_t ack_sn = rlc_pP->control_pdu_info.ack_sn;
rlc_sn_t sn_cursor = rlc_pP->vt_a;
rlc_sn_t nack_sn;
unsigned int nack_index;
......@@ -325,13 +322,13 @@ rlc_am_receive_process_control_pdu(
// - if t-PollRetransmit is running:
// - stop and reset t-PollRetransmit.
assert(ack_sn < RLC_AM_SN_MODULO);
assert(g_rlc_am_control_pdu_info.num_nack < RLC_AM_MAX_NACK_IN_STATUS_PDU);
assert(rlc_pP->control_pdu_info.num_nack < RLC_AM_MAX_NACK_IN_STATUS_PDU);
if (rlc_am_in_tx_window(ctxt_pP, rlc_pP, ack_sn) > 0) {
rlc_pP->num_nack_so = 0;
rlc_pP->num_nack_sn = 0;
if (g_rlc_am_control_pdu_info.num_nack == 0) {
if (rlc_pP->control_pdu_info.num_nack == 0) {
while (sn_cursor != ack_sn) {
if (sn_cursor == rlc_pP->poll_sn) {
rlc_am_stop_and_reset_timer_poll_retransmit(ctxt_pP, rlc_pP);
......@@ -342,7 +339,7 @@ rlc_am_receive_process_control_pdu(
}
} else {
nack_index = 0;
nack_sn = g_rlc_am_control_pdu_info.nack_list[nack_index].nack_sn;
nack_sn = rlc_pP->control_pdu_info.nack_list[nack_index].nack_sn;
while (sn_cursor != ack_sn) {
if (sn_cursor == rlc_pP->poll_sn) {
......@@ -357,20 +354,20 @@ rlc_am_receive_process_control_pdu(
rlc_am_nack_pdu (ctxt_pP,
rlc_pP,
sn_cursor,
g_rlc_am_control_pdu_info.nack_list[nack_index].so_start,
g_rlc_am_control_pdu_info.nack_list[nack_index].so_end);
rlc_pP->control_pdu_info.nack_list[nack_index].so_start,
rlc_pP->control_pdu_info.nack_list[nack_index].so_end);
nack_index = nack_index + 1;
if (nack_index == g_rlc_am_control_pdu_info.num_nack) {
if (nack_index == rlc_pP->control_pdu_info.num_nack) {
nack_sn = 0xFFFF; // value never reached by sn
} else {
nack_sn = g_rlc_am_control_pdu_info.nack_list[nack_index].nack_sn;
nack_sn = rlc_pP->control_pdu_info.nack_list[nack_index].nack_sn;
}
}
if ((nack_index < g_rlc_am_control_pdu_info.num_nack) && (nack_index > 0)) {
if (g_rlc_am_control_pdu_info.nack_list[nack_index].nack_sn != g_rlc_am_control_pdu_info.nack_list[nack_index-1].nack_sn) {
if ((nack_index < rlc_pP->control_pdu_info.num_nack) && (nack_index > 0)) {
if (rlc_pP->control_pdu_info.nack_list[nack_index].nack_sn != rlc_pP->control_pdu_info.nack_list[nack_index-1].nack_sn) {
sn_cursor = (sn_cursor + 1) & RLC_AM_SN_MASK;
}
} else {
......
......@@ -36,6 +36,7 @@
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
//-----------------------------------------------------------------------------
void
rlc_am_check_timer_poll_retransmit(
......@@ -76,10 +77,16 @@ rlc_am_check_timer_poll_retransmit(
rlc_pP->t_poll_retransmit.running = 0;
rlc_pP->t_poll_retransmit.timed_out = 1;
rlc_pP->stat_timer_poll_retransmit_timed_out += 1;
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit timed-out",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
#endif
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] TIME-OUT\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
rlc_pP->force_poll= TRUE;
//#warning TO DO rlc_am_check_timer_poll_retransmit
rlc_pP->t_poll_retransmit.ms_time_out = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP) + rlc_pP->t_poll_retransmit.ms_duration;
}
......@@ -109,6 +116,11 @@ rlc_am_stop_and_reset_timer_poll_retransmit(
rlc_pP->t_poll_retransmit.ms_time_out = 0;
rlc_pP->t_poll_retransmit.ms_start = 0;
rlc_pP->t_poll_retransmit.timed_out = 0;
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit stopped & reseted",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
#endif
}
//-----------------------------------------------------------------------------
void
......@@ -120,16 +132,30 @@ rlc_am_start_timer_poll_retransmit(
{
rlc_pP->t_poll_retransmit.timed_out = 0;
if (rlc_pP->t_poll_retransmit.ms_duration > 0) {
rlc_pP->t_poll_retransmit.running = 1;
rlc_pP->t_poll_retransmit.ms_time_out = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP) + rlc_pP->t_poll_retransmit.ms_duration;
rlc_pP->t_poll_retransmit.ms_start = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] STARTED (TIME-OUT = FRAME %05d)\n",
if (rlc_pP->t_poll_retransmit.running == 0) {
if (rlc_pP->t_poll_retransmit.ms_duration > 0) {
rlc_pP->t_poll_retransmit.running = 1;
rlc_pP->t_poll_retransmit.ms_time_out = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP) + rlc_pP->t_poll_retransmit.ms_duration;
rlc_pP->t_poll_retransmit.ms_start = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] STARTED (TIME-OUT = FRAME %05d)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->t_poll_retransmit.ms_time_out);
} else {
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit started (TO %u ms)",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out);
#endif
} else {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
}
} else {
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit not restarted (TO %u ms)",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out);
#endif
}
}
//-----------------------------------------------------------------------------
......
......@@ -36,6 +36,7 @@
#include "rlc_am.h"
# include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
//-----------------------------------------------------------------------------
void
rlc_am_check_timer_reordering(
......@@ -72,6 +73,11 @@ rlc_am_check_timer_reordering(
// - start t-Reordering;
// - set VR(X) to VR(H).
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering timed out",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
#endif
rlc_pP->t_reordering.running = 0;
rlc_pP->t_reordering.timed_out = 1;
......@@ -128,6 +134,11 @@ rlc_am_stop_and_reset_timer_reordering(
rlc_pP->t_reordering.ms_time_out = 0;
rlc_pP->t_reordering.ms_start = 0;
rlc_pP->t_reordering.timed_out = 0;
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering stopped & reseted",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
#endif
}
//-----------------------------------------------------------------------------
void
......@@ -138,16 +149,23 @@ rlc_am_start_timer_reordering(
{
rlc_pP->t_reordering.timed_out = 0;
if (rlc_pP->t_reordering.ms_duration > 0) {
rlc_pP->t_reordering.running = 1;
rlc_pP->t_reordering.ms_time_out = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP) + rlc_pP->t_reordering.ms_duration;
rlc_pP->t_reordering.ms_start = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] STARTED (TIME-OUT = FRAME %5u)\n",
if (rlc_pP->t_reordering.running == 0){
if (rlc_pP->t_reordering.ms_duration > 0) {
rlc_pP->t_reordering.running = 1;
rlc_pP->t_reordering.ms_time_out = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP) + rlc_pP->t_reordering.ms_duration;
rlc_pP->t_reordering.ms_start = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] STARTED (TIME-OUT = %5u ms)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->t_reordering.ms_time_out);
} else {
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering started (TO %u ms)",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_reordering.ms_time_out);
#endif
} else {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
}
}
}
//-----------------------------------------------------------------------------
......
......@@ -36,6 +36,7 @@
#include "rlc_am.h"
#include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h"
#include "msc.h"
//-----------------------------------------------------------------------------
void
rlc_am_check_timer_status_prohibit(
......@@ -69,6 +70,11 @@ rlc_am_check_timer_status_prohibit(
rlc_pP->t_status_prohibit.timed_out = 1;
rlc_pP->stat_timer_status_prohibit_timed_out += 1;
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit timed out",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
#endif
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] TIME-OUT\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
//#warning TO DO rlc_am_check_timer_status_prohibit
......@@ -93,6 +99,11 @@ rlc_am_stop_and_reset_timer_status_prohibit(
rlc_pP->t_status_prohibit.ms_time_out = 0;
rlc_pP->t_status_prohibit.ms_start = 0;
rlc_pP->t_status_prohibit.timed_out = 0;
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit stopped & reseted",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
#endif
}
}
//-----------------------------------------------------------------------------
......@@ -105,17 +116,24 @@ rlc_am_start_timer_status_prohibit(
{
rlc_pP->t_status_prohibit.timed_out = 0;
if (rlc_pP->t_status_prohibit.ms_duration > 0) {
rlc_pP->t_status_prohibit.running = 1;
rlc_pP->t_status_prohibit.ms_time_out = rlc_pP->t_status_prohibit.ms_duration + PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
rlc_pP->t_status_prohibit.ms_start = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] STARTED (TIME-OUT = TIME %u)\n",
if (rlc_pP->t_status_prohibit.running == 0){
if (rlc_pP->t_status_prohibit.ms_duration > 0) {
rlc_pP->t_status_prohibit.running = 1;
rlc_pP->t_status_prohibit.ms_time_out = rlc_pP->t_status_prohibit.ms_duration + PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
rlc_pP->t_status_prohibit.ms_start = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] STARTED (TIME-OUT = %u ms)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->t_status_prohibit.ms_time_out);
LOG_D(RLC, "TIME-OUT = FRAME %u\n", rlc_pP->t_status_prohibit.ms_time_out);
} else {
LOG_D(RLC, "TIME-OUT = FRAME %u\n", rlc_pP->t_status_prohibit.ms_time_out);
#if defined(MESSAGE_CHART_GENERATOR_RLC_MAC)
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit started (TO %u ms)",\
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_status_prohibit.ms_time_out);
#endif
} else {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
}
}
}
//-----------------------------------------------------------------------------
......
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