rlc_um_dar.h 10.4 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 38 39 40 41 42 43 44 45
/*! \file rlc_um_dar.h
* \brief This file defines the prototypes of the functions dealing with the reassembly buffer.
* \author GAUTHIER Lionel
* \date 2010-2011
* \version
* \note
* \bug
* \warning
*/
/** @defgroup _rlc_um_receiver_impl_ RLC UM Receiver Implementation
* @ingroup _rlc_um_impl_
* @{
*/
#    ifndef __RLC_UM_DAR_H__
#        define __RLC_UM_DAR_H__
//-----------------------------------------------------------------------------
#        include "rlc_um_entity.h"
#        include "rlc_um_structs.h"
#        include "rlc_um_constants.h"
#        include "list.h"
//-----------------------------------------------------------------------------
#            define private_rlc_um_dar(x)    x
#            define protected_rlc_um_dar(x)  x
#            define public_rlc_um_dar(x)     x
46
/*! \fn signed int rlc_um_get_pdu_infos(const protocol_ctxt_t* const ctxt_pP,const rlc_um_entity_t * const rlc_pP,rlc_um_pdu_sn_10_t* header_pP, int16_t total_sizeP, rlc_um_pdu_info_t* pdu_info_pP, uint8_t sn_lengthP)
47
* \brief    Extract PDU informations (header fields, data size, etc) from the serialized PDU.
48
* \param[in]  ctxt_pP              Running context.
49
* \param[in]  rlc_pP             RLC UM protocol instance pointer..
50 51 52 53
* \param[in]  header_pP          RLC UM header PDU pointer.
* \param[in]  total_sizeP        Size of RLC UM PDU.
* \param[in]  pdu_info_pP        Structure containing extracted informations from PDU.
* \param[in]  sn_lengthP         Sequence number length in bits in PDU header (5 or 10).
54 55
* \return     0 if no error was encountered during the parsing of the PDU, else -1;
*/
56
protected_rlc_um_dar(  signed int rlc_um_get_pdu_infos(
57
                         const protocol_ctxt_t* const ctxt_pP,
58
                         const rlc_um_entity_t * const rlc_pP,
59 60 61 62
                         rlc_um_pdu_sn_10_t  * const header_pP,
                         const sdu_size_t            total_sizeP,
                         rlc_um_pdu_info_t   * const pdu_info_pP,
                         const uint8_t               sn_lengthP));
63

64
/*! \fn int rlc_um_read_length_indicators(unsigned char**data_ppP, rlc_um_e_li_t* e_li_pP, unsigned int* li_array_pP, unsigned int *num_li_pP, sdu_size_t *data_size_pP)
65
* \brief    Reset protocol variables and state variables to initial values.
66 67 68 69 70
* \param[in,out]  data_ppP       Pointer on data payload.
* \param[in]      e_li_pP        Pointer on first LI + e bit in PDU.
* \param[in,out]  li_array_pP    Array containing read LI.
* \param[in,out]  num_li_pP      Pointer on number of LI read.
* \param[in,out]  data_size_pP   Pointer on data size.
71 72
* \return     0 if no error was encountered during the parsing of the PDU, else -1;
*/
73
private_rlc_um_dar(  int rlc_um_read_length_indicators(unsigned char**data_ppP, rlc_um_e_li_t* e_li_pP, unsigned int* li_array_pP, unsigned int *num_li_pP, sdu_size_t *data_size_pP));
74

75
/*! \fn void rlc_um_try_reassembly      (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, rlc_sn_t start_snP, rlc_sn_t end_snP)
76
* \brief    Try reassembly PDUs from DAR buffer, starting at sequence number snP.
77
* \param[in]  ctxt_pP       Running context.
78 79
* \param[in]  rlc_pP      RLC UM protocol instance pointer.
* \param[in]  frameP      Frame index.
80 81 82
* \param[in]  start_snP   First PDU to be reassemblied if possible.
* \param[in]  end_snP     Last excluded highest sequence number of PDU to be reassemblied.
*/
83
private_rlc_um_dar(  void rlc_um_try_reassembly      (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t start_snP, const rlc_sn_t end_snP));
84

85
/*! \fn void rlc_um_check_timer_reordering(rlc_um_entity_t * const rlc_pP,frame_t frameP)
86
* \brief      Check if timer reordering has timed-out, if so it is stopped and has the status "timed-out".
87
* \param[in]  ctxt_pP             Running context.
88 89
* \param[in]  rlc_pP            RLC UM protocol instance pointer.
* \param[in]  frameP            Frame index
90
*/
91
protected_rlc_um_dar(void rlc_um_check_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t  *const rlc_pP));
92

93
/*! \fn void rlc_um_stop_and_reset_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)
94
* \brief      Stop and reset the timer reordering.
95
* \param[in]  ctxt_pP             Running context.
96 97
* \param[in]  rlc_pP            RLC UM protocol instance pointer.
* \param[in]  frameP            Frame index.
98
*/
99
protected_rlc_um_dar(void rlc_um_stop_and_reset_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *const rlc_pP);)
100

101
/*! \fn void rlc_um_start_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)
102
* \brief      Re-arm (based on RLC UM config parameter) and start timer reordering.
103
* \param[in]  ctxt_pP             Running context.
104 105
* \param[in]  rlc_pP            RLC UM protocol instance pointer.
* \param[in]  frameP            Frame index.
106
*/
107
protected_rlc_um_dar(void rlc_um_start_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP);)
108

109
/*! \fn void rlc_um_init_timer_reordering(rlc_um_entity_t * const rlc_pP, const uint32_t ms_durationP)
110
* \brief      Initialize the timer reordering with RLC UM time-out config parameter.
111
* \param[in]  ctxt_pP             Running context.
112
* \param[in]  rlc_pP            RLC UM protocol instance pointer.
113
* \param[in]  ms_durationP      Duration in milliseconds units.
114
*/
115
protected_rlc_um_dar(void rlc_um_init_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint32_t ms_durationP);)
116

117
/*! \fn void rlc_um_check_timer_dar_time_out(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,)
118
* \brief    Check if t-Reordering expires and take the appropriate actions as described in 3GPP specifications.
119
* \param[in]  ctxt_pP        Running context.
120
* \param[in]  rlc_pP       RLC UM protocol instance pointer.
121
*/
122
protected_rlc_um_dar(  void rlc_um_check_timer_dar_time_out(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP));
123

124
/*! \fn mem_block_t *rlc_um_remove_pdu_from_dar_buffer(rlc_um_entity_t * const rlc_pP, uint16_t snP)
125
* \brief    Remove the PDU with sequence number snP from the DAR buffer and return it.
126
* \param[in]  ctxt_pP         Running context.
127 128
* \param[in]  rlc_pP        RLC UM protocol instance pointer.
* \param[in]  snP           Sequence number.
129 130
* \return     The PDU stored in the DAR buffer having sequence number snP, else return NULL.
*/
131
private_rlc_um_dar(  mem_block_t *rlc_um_remove_pdu_from_dar_buffer(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint16_t snP));
132

133
/*! \fn mem_block_t *rlc_um_remove_pdu_from_dar_buffer(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint16_t snP)
134
* \brief    Get the PDU with sequence number snP from the DAR buffer.
135
* \param[in]  ctxt_pP         Running context.
136 137
* \param[in]  rlc_pP        RLC UM protocol instance pointer.
* \param[in]  snP           Sequence number.
138 139
* \return     The PDU stored in the DAR buffer having sequence number snP, else return NULL.
*/
140
protected_rlc_um_dar(mem_block_t* rlc_um_get_pdu_from_dar_buffer(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint16_t snP));
141

142
/*! \fn signed int rlc_um_in_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,rlc_sn_t lower_boundP, rlc_sn_t snP, rlc_sn_t higher_boundP)
143
* \brief    Compute if the sequence number of a PDU is in a window .
144
* \param[in]  ctxt_pP          Running context.
145
* \param[in]  rlc_pP         RLC UM protocol instance pointer.
146 147 148 149 150
* \param[in]  lower_boundP   Lower bound of a window.
* \param[in]  snP            Sequence number of a theorical PDU.
* \param[in]  higher_boundP  Higher bound of a window.
* \return     -2 if lower_boundP  > sn, -1 if higher_boundP < sn, 0 if lower_boundP  < sn < higher_boundP, 1 if lower_boundP  == sn, 2 if higher_boundP == sn, 3 if higher_boundP == sn == lower_boundP.
*/
151
protected_rlc_um_dar(signed int rlc_um_in_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t lower_boundP, const rlc_sn_t snP, const rlc_sn_t higher_boundP));
152

153
/*! \fn signed int rlc_um_in_reordering_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t snP)
154
* \brief    Compute if the sequence number of a PDU is in a window .
155
* \param[in]  ctxt_pP          Running context.
156
* \param[in]  rlc_pP         RLC UM protocol instance pointer.
157 158 159
* \param[in]  snP            Sequence number of a theorical PDU.
* \return     0 if snP is in reordering window, else -1.
*/
160
protected_rlc_um_dar(signed int rlc_um_in_reordering_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,  const rlc_sn_t snP));
161

162
/*! \fn void rlc_um_receive_process_dar (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, mem_block_t *pdu_mem_pP,rlc_um_pdu_sn_10_t * const pdu_pP, const sdu_size_t tb_sizeP)
163
* \brief    Apply the DAR process for a PDU: put it in DAR buffer and try to reassembly or discard it.
164
* \param[in]  ctxt_pP        Running context.
165 166 167
* \param[in]  rlc_pP     RLC UM protocol instance pointer.
* \param[in]  pdu_mem_pP mem_block_t wrapper for a UM PDU .
* \param[in]  pdu_pP     Pointer on the header of the UM PDU.
168 169
* \param[in]  tb_sizeP   Size of the UM PDU.
*/
170 171
protected_rlc_um_dar(void rlc_um_receive_process_dar (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, mem_block_t * pdu_mem_pP,rlc_um_pdu_sn_10_t * const pdu_pP,
                     const sdu_size_t tb_sizeP));
172 173
/** @} */
#    endif