rlc_am_retransmit.h 7.11 KB
Newer Older
1 2 3 4 5
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
/*! \file rlc_am_retransmit.h
* \brief This file defines the prototypes of the functions dealing with the retransmission.
* \author GAUTHIER Lionel
* \date 2010-2011
* \version
* \note
* \bug
* \warning
*/
/** @defgroup _rlc_am_internal_retransmit_impl_ RLC AM Retransmitter Internal Reference Implementation
* @ingroup _rlc_am_internal_impl_
* @{
*/
#    ifndef __RLC_AM_RETRANSMIT_H__
#        define __RLC_AM_RETRANSMIT_H__
//-----------------------------------------------------------------------------
38
/*! \fn boolean_t  rlc_am_nack_pdu (const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t *rlcP, int16_t snP, int16_t prev_nack_snP,sdu_size_t so_startP, sdu_size_t so_endP)
39
* \brief      The RLC AM PDU which have the sequence number snP is marked NACKed with segment offset fields.
40
* \param[in]  ctxtP        Running context.
41 42
* \param[in]  rlcP         RLC AM protocol instance pointer.
* \param[in]  snP          Sequence number of the PDU that is negative acknowledged.
43
* \param[in]  prev_nack_snP  Sequence number of previous PDU that is negative acknowledged.
44 45
* \param[in]  so_startP    Start of the segment offset of the PDU that .
* \param[in]  so_endP      Transport blocks received from MAC layer.
46
* \return                  OK/KO
47 48
* \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU.
*/
49
boolean_t         rlc_am_nack_pdu (
50 51 52
                              const protocol_ctxt_t* const  ctxt_pP,
                              rlc_am_entity_t *const rlcP,
                              const rlc_sn_t snP,
53 54
							  const rlc_sn_t prev_nack_snP,
                              sdu_size_t so_startP,
55
                              sdu_size_t so_endP);
56

57
/*! \fn void rlc_am_ack_pdu (const protocol_ctxt_t* const  ctxt_pP,rlc_am_entity_t *rlcP, rlc_sn_t snP)
58
* \brief      The RLC AM PDU which have the sequence number snP is marked ACKed.
59
* \param[in]  ctxtP        Running context.
60 61
* \param[in]  rlcP         RLC AM protocol instance pointer.
* \param[in]  snP          Sequence number of the PDU that is acknowledged.
fnabet's avatar
fnabet committed
62
* \param[in]  free_pdu     Boolean indicating that the PDU can be freed because smaller than new vtA.
63 64
* \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.
*/
65
void         rlc_am_ack_pdu (
66 67
                              const protocol_ctxt_t* const  ctxt_pP,
                              rlc_am_entity_t *const rlcP,
fnabet's avatar
fnabet committed
68
                              const rlc_sn_t snP,
69
							  boolean_t free_pdu);
70

71
/*! \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)
72
* \brief      The RLC AM PDU which have the sequence number snP is marked ACKed.
73
* \param[in]  ctxtP        Running context.
74 75 76 77
* \param[in]  rlcP         RLC AM protocol instance pointer.
* \param[in]  snP          Sequence number of the PDU to be copied.
* \return                  A copy of the PDU having sequence number equal to parameter snP.
*/
78
mem_block_t* rlc_am_retransmit_get_copy (
79 80
                              const protocol_ctxt_t* const  ctxt_pP,
                              rlc_am_entity_t *const rlcP,
81
                              const rlc_sn_t snP);
82

83
#if 0
84
/*! \fn mem_block_t* rlc_am_retransmit_get_subsegment (const protocol_ctxt_t* const  ctxt_pP,rlc_am_entity_t *rlcP,rlc_sn_t snP, sdu_size_t *sizeP)
85
* \brief      The RLC AM PDU which have the sequence number snP is marked ACKed.
86
* \param[in]  ctxtP        Running context.
87 88 89 90 91
* \param[in]  rlcP         RLC AM protocol instance pointer.
* \param[in]  snP          Sequence number of the PDU to be copied.
* \param[in,out]  sizeP    Maximum size allowed for the subsegment, it is updated with the amount of bytes not used (sizeP[out] = sizeP[in] - size of segment).
* \return                  A copy of a segment of the PDU having sequence number equal to parameter snP.
*/
92
mem_block_t* rlc_am_retransmit_get_subsegment (
93 94 95
                              const protocol_ctxt_t* const  ctxt_pP,
                              rlc_am_entity_t *const rlcP,
                              const rlc_sn_t snP,
96
                              sdu_size_t *const sizeP);
97
#endif
98

99 100 101 102 103 104
/*! \fn mem_block_t* rlc_am_get_pdu_to_retransmit(const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t* rlcP)
* \brief      Find a PDU or PDU segment to retransmit.
* \param[in]  ctxtP        Running context.
* \param[in]  rlcP         RLC AM protocol instance pointer.
* \return                  A copy of the retransmitted PDU or PDU segment or NULL if TBS was not big enough
*/
105
mem_block_t* rlc_am_get_pdu_to_retransmit(
106
                              const protocol_ctxt_t* const  ctxt_pP,
107
                              rlc_am_entity_t* const rlcP);
108
#if 0
109
/*! \fn void rlc_am_retransmit_any_pdu(const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t* rlcP)
110
* \brief      Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU.
111
* \param[in]  ctxtP        Running context.
112 113
* \param[in]  rlcP         RLC AM protocol instance pointer.
*/
114
void rlc_am_retransmit_any_pdu(
115
                              const protocol_ctxt_t* const  ctxt_pP,
116
                              rlc_am_entity_t* const rlcP);
117
#endif
118

119
/*! \fn void rlc_am_tx_buffer_display (const protocol_ctxt_t* const  ctxt_pP,rlc_am_entity_t* rlcP,  char* message_pP)
120
* \brief      Display the dump of the retransmission buffer.
121
* \param[in]  ctxtP        Running context.
122
* \param[in]  rlcP         RLC AM protocol instance pointer.
123
* \param[in]  message_pP     Message to be displayed along with the display of the dump of the retransmission buffer.
124
*/
125
void rlc_am_tx_buffer_display (
126 127
                              const protocol_ctxt_t* const  ctxt_pP,
                              rlc_am_entity_t* const rlcP,
128
                              char* const message_pP);
129 130
/** @} */
#    endif