rlc_um_dar.h 9.82 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*******************************************************************************

Eurecom OpenAirInterface 2
Copyright(c) 1999 - 2010 Eurecom

This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.

This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.

The full GNU General Public License is included in this distribution in
the file called "COPYING".

Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums       : http://forums.eurecom.fsr/openairinterface
Address      : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France

*******************************************************************************/
/*! \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"
//-----------------------------------------------------------------------------
#        ifdef RLC_UM_DAR_C
#            define private_rlc_um_dar(x)    x
#            define protected_rlc_um_dar(x)  x
#            define public_rlc_um_dar(x)     x
#        else
#            ifdef RLC_UM_MODULE
#                define private_rlc_um_dar(x)
#                define protected_rlc_um_dar(x)  extern x
#                define public_rlc_um_dar(x)     extern x
#            else
#                define private_rlc_um_dar(x)
#                define protected_rlc_um_dar(x)
#                define public_rlc_um_dar(x)     extern x
#            endif
#        endif
gauthier's avatar
gauthier committed
65
/*! \fn signed int rlc_um_get_pdu_infos(frame_t frameP,rlc_um_pdu_sn_10_t* header_pP, int16_t total_sizeP, rlc_um_pdu_info_t* pdu_info_pP, uint8_t sn_lengthP)
66
* \brief    Extract PDU informations (header fields, data size, etc) from the serialized PDU.
gauthier's avatar
gauthier committed
67
68
69
70
71
* \param[in]  frameP             Frame index.
* \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).
72
73
* \return     0 if no error was encountered during the parsing of the PDU, else -1;
*/
gauthier's avatar
gauthier committed
74
protected_rlc_um_dar(  signed int rlc_um_get_pdu_infos(frame_t frameP, rlc_um_pdu_sn_10_t* header_pP, int16_t total_sizeP, rlc_um_pdu_info_t* pdu_info_pP, uint8_t sn_lengthP));
75

gauthier's avatar
gauthier committed
76
/*! \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)
77
* \brief    Reset protocol variables and state variables to initial values.
gauthier's avatar
gauthier committed
78
79
80
81
82
* \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.
83
84
* \return     0 if no error was encountered during the parsing of the PDU, else -1;
*/
gauthier's avatar
gauthier committed
85
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));
86

gauthier's avatar
gauthier committed
87
/*! \fn void rlc_um_try_reassembly      (rlc_um_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, rlc_sn_t start_snP, rlc_sn_t end_snP)
88
* \brief    Try reassembly PDUs from DAR buffer, starting at sequence number snP.
gauthier's avatar
gauthier committed
89
90
91
* \param[in]  rlc_pP      RLC UM protocol instance pointer.
* \param[in]  frameP      Frame index.
* \param[in]  eNB_flagP   Flag to indicate eNB (1) or UE (0).
92
93
94
* \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.
*/
gauthier's avatar
gauthier committed
95
private_rlc_um_dar(  void rlc_um_try_reassembly      (rlc_um_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, rlc_sn_t start_snP, rlc_sn_t end_snP));
96

gauthier's avatar
gauthier committed
97
/*! \fn void rlc_um_check_timer_reordering(rlc_um_entity_t *rlc_pP,frame_t frameP)
98
* \brief      Check if timer reordering has timed-out, if so it is stopped and has the status "timed-out".
gauthier's avatar
gauthier committed
99
100
* \param[in]  rlc_pP            RLC UM protocol instance pointer.
* \param[in]  frameP            Frame index
101
*/
gauthier's avatar
gauthier committed
102
protected_rlc_um_dar(void rlc_um_check_timer_reordering(rlc_um_entity_t  *rlc_pP,frame_t frameP));
103

gauthier's avatar
gauthier committed
104
/*! \fn void rlc_um_stop_and_reset_timer_reordering(rlc_um_entity_t *rlc_pP,frame_t frameP)
105
* \brief      Stop and reset the timer reordering.
gauthier's avatar
gauthier committed
106
107
* \param[in]  rlc_pP            RLC UM protocol instance pointer.
* \param[in]  frameP            Frame index.
108
*/
gauthier's avatar
gauthier committed
109
protected_rlc_um_dar(void rlc_um_stop_and_reset_timer_reordering(rlc_um_entity_t *rlc_pP,frame_t frameP);)
110

gauthier's avatar
gauthier committed
111
/*! \fn void rlc_um_start_timer_reordering(rlc_um_entity_t *rlc_pP,frame_t frameP)
112
* \brief      Re-arm (based on RLC UM config parameter) and start timer reordering.
gauthier's avatar
gauthier committed
113
114
* \param[in]  rlc_pP            RLC UM protocol instance pointer.
* \param[in]  frameP            Frame index.
115
*/
gauthier's avatar
gauthier committed
116
protected_rlc_um_dar(void rlc_um_start_timer_reordering(rlc_um_entity_t *rlc_pP,frame_t frameP);)
117

gauthier's avatar
gauthier committed
118
/*! \fn void rlc_um_init_timer_reordering(rlc_um_entity_t *rlc_pP, uint32_t time_outP)
119
* \brief      Initialize the timer reordering with RLC UM time-out config parameter.
gauthier's avatar
gauthier committed
120
121
* \param[in]  rlc_pP            RLC UM protocol instance pointer.
* \param[in]  time_outP         Time-out in frameP units.
122
*/
gauthier's avatar
gauthier committed
123
protected_rlc_um_dar(void rlc_um_init_timer_reordering(rlc_um_entity_t *rlc_pP, uint32_t time_outP);)
124

gauthier's avatar
gauthier committed
125
/*! \fn void rlc_um_check_timer_dar_time_out(rlc_um_entity_t *rlc_pP,frame_t frameP,eNB_flag_t eNB_flagP)
126
* \brief    Check if t-Reordering expires and take the appropriate actions as described in 3GPP specifications.
gauthier's avatar
gauthier committed
127
128
129
* \param[in]  rlc_pP       RLC UM protocol instance pointer.
* \param[in]  frameP       Frame index.
* \param[in]  eNB_flagP    Flag to indicate eNB(1) or UE (1)
130
*/
gauthier's avatar
gauthier committed
131
protected_rlc_um_dar(  void rlc_um_check_timer_dar_time_out(rlc_um_entity_t *rlc_pP,frame_t frameP,eNB_flag_t eNB_flagP));
132

gauthier's avatar
gauthier committed
133
/*! \fn mem_block_t *rlc_um_remove_pdu_from_dar_buffer(rlc_um_entity_t *rlc_pP, uint16_t snP)
134
* \brief    Remove the PDU with sequence number snP from the DAR buffer and return it.
gauthier's avatar
gauthier committed
135
136
* \param[in]  rlc_pP        RLC UM protocol instance pointer.
* \param[in]  snP           Sequence number.
137
138
* \return     The PDU stored in the DAR buffer having sequence number snP, else return NULL.
*/
gauthier's avatar
gauthier committed
139
private_rlc_um_dar(  mem_block_t *rlc_um_remove_pdu_from_dar_buffer(rlc_um_entity_t *rlc_pP, uint16_t snP));
140

gauthier's avatar
gauthier committed
141
/*! \fn mem_block_t *rlc_um_remove_pdu_from_dar_buffer(rlc_um_entity_t *rlc_pP, uint16_t snP)
142
* \brief    Get the PDU with sequence number snP from the DAR buffer.
gauthier's avatar
gauthier committed
143
144
* \param[in]  rlc_pP        RLC UM protocol instance pointer.
* \param[in]  snP           Sequence number.
145
146
* \return     The PDU stored in the DAR buffer having sequence number snP, else return NULL.
*/
gauthier's avatar
gauthier committed
147
protected_rlc_um_dar(  inline mem_block_t* rlc_um_get_pdu_from_dar_buffer(rlc_um_entity_t *rlc_pP, uint16_t snP));
148

gauthier's avatar
gauthier committed
149
/*! \fn signed int rlc_um_in_window(rlc_um_entity_t *rlc_pP, frame_t frameP, rlc_sn_t lower_boundP, rlc_sn_t snP, rlc_sn_t higher_boundP)
150
* \brief    Compute if the sequence number of a PDU is in a window .
gauthier's avatar
gauthier committed
151
152
* \param[in]  rlc_pP         RLC UM protocol instance pointer.
* \param[in]  frameP         Frame index.
153
154
155
156
157
* \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.
*/
gauthier's avatar
gauthier committed
158
protected_rlc_um_dar(inline signed int rlc_um_in_window(rlc_um_entity_t *rlc_pP, frame_t frameP, rlc_sn_t lower_boundP, rlc_sn_t snP, rlc_sn_t higher_boundP));
159

gauthier's avatar
gauthier committed
160
/*! \fn signed int rlc_um_in_reordering_window(rlc_um_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP)
161
* \brief    Compute if the sequence number of a PDU is in a window .
gauthier's avatar
gauthier committed
162
163
* \param[in]  rlc_pP         RLC UM protocol instance pointer.
* \param[in]  frameP         Frame index.
164
165
166
* \param[in]  snP            Sequence number of a theorical PDU.
* \return     0 if snP is in reordering window, else -1.
*/
gauthier's avatar
gauthier committed
167
protected_rlc_um_dar(inline signed int rlc_um_in_reordering_window(rlc_um_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP));
168

gauthier's avatar
gauthier committed
169
/*! \fn void rlc_um_receive_process_dar (rlc_um_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, mem_block_t *pdu_mem_pP,rlc_um_pdu_sn_10_t *pdu_pP, sdu_size_t tb_sizeP)
170
* \brief    Apply the DAR process for a PDU: put it in DAR buffer and try to reassembly or discard it.
gauthier's avatar
gauthier committed
171
172
173
174
175
* \param[in]  rlc_pP     RLC UM protocol instance pointer.
* \param[in]  frameP     Frame index.
* \param[in]  eNB_flagP  Flag to indicated eNB (1) or UE (0).
* \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.
176
177
* \param[in]  tb_sizeP   Size of the UM PDU.
*/
gauthier's avatar
gauthier committed
178
protected_rlc_um_dar(void rlc_um_receive_process_dar (rlc_um_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, mem_block_t *pdu_mem_pP,rlc_um_pdu_sn_10_t *pdu_pP, sdu_size_t tb_sizeP));
179
180
/** @} */
#    endif