Commit 04b5954f authored by fnabet's avatar fnabet

Merge Fix Issue 250 RLC AM Tpoll Retx

parents aae302f1 40e42c4c
......@@ -206,23 +206,28 @@ boolean_t rlc_am_nack_pdu (
void rlc_am_ack_pdu (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
const rlc_sn_t snP)
const rlc_sn_t snP,
boolean_t free_pdu)
{
mem_block_t* mb_p = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block;
rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE];
tx_data_pdu_buffer->flags.retransmit = 0;
if ((tx_data_pdu_buffer->flags.ack == 0) && (mb_p != NULL)) {
//if (mb_pP != NULL) {
if (mb_p != NULL) {
if (free_pdu) {
free_mem_block(mb_p, __func__);
tx_data_pdu_buffer->mem_block = NULL;
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[ACK-PDU] ACK PDU SN %05d previous retx_count %d \n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
snP,
tx_data_pdu_buffer->retx_count);
}
if (tx_data_pdu_buffer->retx_payload_size) {
AssertFatal (tx_data_pdu_buffer->flags.ack == 0,
"RLC AM Rx Status Report sn=%d acked twice but is pending for Retx vtA=%d vtS=%d LcId=%d\n",
snP, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
rlc_pP->retrans_num_bytes_to_retransmit -= tx_data_pdu_buffer->retx_payload_size;
tx_data_pdu_buffer->retx_payload_size = 0;
tx_data_pdu_buffer->num_holes = 0;
......
......@@ -74,12 +74,14 @@ protected_rlc_am_retransmit(boolean_t rlc_am_nack_pdu (
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] snP Sequence number of the PDU that is acknowledged.
* \param[in] free_pdu Boolean indicating that the PDU can be freed because smaller than new vtA.
* \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU.
*/
protected_rlc_am_retransmit(void rlc_am_ack_pdu (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP,
const rlc_sn_t snP);)
const rlc_sn_t snP,
boolean_t free_pdu);)
/*! \fn mem_block_t* rlc_am_retransmit_get_copy (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, rlc_sn_t snP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
......
......@@ -318,7 +318,7 @@ rlc_am_receive_process_control_pdu(
{
if (rlc_pP->control_pdu_info.num_nack == 0) {
while (sn_cursor != ack_sn) {
rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor);
rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor,TRUE);
sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
}
......@@ -330,7 +330,7 @@ rlc_am_receive_process_control_pdu(
prev_nack_sn = 0x3FFF;
while (sn_cursor != nack_sn) {
rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor);
rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor,TRUE);
sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
}
......@@ -354,7 +354,8 @@ rlc_am_receive_process_control_pdu(
if (sn_cursor != nack_sn) {
rlc_am_ack_pdu(ctxt_pP,
rlc_pP,
sn_cursor);
sn_cursor,
FALSE);
} else {
status = rlc_am_nack_pdu (ctxt_pP,
rlc_pP,
......
......@@ -88,8 +88,8 @@ rlc_am_check_timer_poll_retransmit(
/* Look for the first retransmittable PDU starting from vtS - 1 */
while (sn != sn_end) {
tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE];
AssertFatal (tx_data_pdu_buffer_p->mem_block != NULL, "RLC AM Tpoll Retx expiry sn=%d is empty vtA=%d vtS=%d LcId=%d\n",
sn, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
AssertFatal (tx_data_pdu_buffer_p->mem_block != NULL, "RLC AM Tpoll Retx expiry sn=%d ack=%d is empty vtA=%d vtS=%d LcId=%d\n",
sn, tx_data_pdu_buffer_p->flags.ack,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
if ((tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) {
tx_data_pdu_buffer_p->flags.retransmit = 1;
tx_data_pdu_buffer_p->retx_payload_size = tx_data_pdu_buffer_p->payload_size;
......
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