rlc_um_control_primitives.h 9.16 KB
Newer Older
1
/*******************************************************************************
gauthier's avatar
gauthier committed
2 3
    OpenAirInterface
    Copyright(c) 1999 - 2014 Eurecom
4

gauthier's avatar
gauthier committed
5 6 7 8
    OpenAirInterface is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
9 10


gauthier's avatar
gauthier committed
11 12 13 14
    OpenAirInterface is distributed in the hope that 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.
15

gauthier's avatar
gauthier committed
16 17 18 19
    You should have received a copy of the GNU General Public License
    along with OpenAirInterface.The full GNU General Public License is
   included in this distribution in the file called "COPYING". If not,
   see <http://www.gnu.org/licenses/>.
20

gauthier's avatar
gauthier committed
21 22 23 24 25
  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
  OpenAirInterface Dev  : openair4g-devel@eurecom.fr

ghaddab's avatar
ghaddab committed
26
  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
gauthier's avatar
gauthier committed
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 65 66 67 68 69
/*! \file rlc_um_control_primitives.h
* \brief This file defines the prototypes of the functions dealing with the control primitives and initialization.
* \author GAUTHIER Lionel
* \date 2010-2011
* \version
* \note
* \bug
* \warning
*/
/** @defgroup _rlc_um_init_impl_ RLC UM Init Reference Implementation
* @ingroup _rlc_um_impl_
* @{
*/
#    ifndef __RLC_UM_CONTROL_PRIMITIVES_H__
#        define __RLC_UM_CONTROL_PRIMITIVES_H__
//-----------------------------------------------------------------------------
#        include "rlc_um_entity.h"
#        include "mem_block.h"
#        include "rlc_um_structs.h"
#        include "rlc_um_constants.h"
#        include "platform_types.h"
#        include "DL-UM-RLC.h"
#        include "UL-UM-RLC.h"
//-----------------------------------------------------------------------------
#        ifdef RLC_UM_CONTROL_PRIMITIVES_C
#            define private_rlc_um_control_primitives(x)    x
#            define protected_rlc_um_control_primitives(x)  x
#            define public_rlc_um_control_primitives(x)     x
#        else
#            ifdef RLC_UM_MODULE
#                define private_rlc_um_control_primitives(x)
#                define protected_rlc_um_control_primitives(x)  extern x
#                define public_rlc_um_control_primitives(x)     extern x
#            else
#                define private_rlc_um_control_primitives(x)
#                define protected_rlc_um_control_primitives(x)
#                define public_rlc_um_control_primitives(x)     extern x
#            endif
#        endif

typedef volatile struct {
gauthier's avatar
gauthier committed
70 71 72 73
    uint32_t             is_uplink_downlink;
    uint32_t             timer_reordering;
    uint32_t             sn_field_length; // 5 or 10
    uint32_t             is_mXch; // boolean, true if configured for MTCH or MCCH
74 75 76
} rlc_um_info_t;


77
/*! \fn void config_req_rlc_um (
78
 * const protocol_ctxt_t* const ctxt_pP,
79 80 81
 * const srb_flag_t srb_flagP,
 * const rlc_um_info_t * const config_umP,
 * const rb_id_t rb_idP)
82
* \brief    Allocate memory for RLC UM instance, reset protocol variables, and set protocol parameters. After this configuration the RLC UM protocol instance will be in RLC_DATA_TRANSFER_READY_STATE state.
83
* \param[in]  ctxt_pP                   Running context.
84
* \param[in]  srb_flagP                 Flag to indicate signalling radio bearer (1) or data radio bearer (0).
85 86 87
* \param[in]  config_umP                Configuration parameters for RLC UM instance.
* \param[in]  rb_idP                    Radio bearer identifier.
*/
88
public_rlc_um_control_primitives(   void config_req_rlc_um (
89 90 91 92
                const protocol_ctxt_t* const ctxt_pP,
                const srb_flag_t srb_flagP,
                const rlc_um_info_t * const config_umP,
                const rb_id_t rb_idP);)
93

94
/*! \fn void config_req_rlc_um_asn1 (
95
 *     const protocol_ctxt_t* const ctxt_pP,
96 97 98 99
 *     const srb_flag_t srb_flagP,
 *     const MBMS_flag_t mbms_flagP,
 *     const mbms_session_id_t  mbms_session_idP,
 *     const mbms_service_id_t  mbms_service_idP,
100 101
 *     const UL_UM_RLC_t* const ul_rlc_pP,
 *     const DL_UM_RLC_t* const dl_rlc_pP,
102
 *     const rb_id_t rb_idP)
103
* \brief    Allocate memory for RLC UM instance, reset protocol variables, and set protocol parameters. After this configuration the RLC UM protocol instance will be in RLC_DATA_TRANSFER_READY_STATE state.
104
* \param[in]  ctxt_pP                   Running context.
105
* \param[in]  srb_flagP                 Flag to indicate signalling radio bearer (1) or data radio bearer (0).
106
* \param[in]  mbms_flagP                Flag to indicate if this RLC is configured for MBMS.
gauthier's avatar
gauthier committed
107 108
* \param[in]  mbms_session_idP          MBMS session id.
* \param[in]  mbms_service_idP          MBMS service id.
109 110
* \param[in]  ul_rlc_pP                 Configuration parameters for RLC UM UL instance.
* \param[in]  dl_rlc_pP                 Configuration parameters for RLC UM DL instance.
111 112
* \param[in]  rb_idP                    Radio bearer identifier.
*/
113
public_rlc_um_control_primitives(   void config_req_rlc_um_asn1 (
114 115 116 117 118 119 120 121 122 123
                const protocol_ctxt_t* const ctxt_pP,
                const srb_flag_t         srb_flagP,
                const MBMS_flag_t        mbms_flagP,
                const mbms_session_id_t  mbms_session_idP,
                const mbms_service_id_t  mbms_service_idP,
                const UL_UM_RLC_t       * const ul_rlc_pP,
                const DL_UM_RLC_t       * const dl_rlc_pP,
                const rb_id_t            rb_idP);)

/*! \fn void rlc_um_init (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)
124
* \brief    Initialize a RLC UM protocol instance, initialize all variables, lists, allocate buffers for making this instance ready to be configured with protocol configuration parameters. After this initialization the RLC UM protocol instance will be in RLC_NULL_STATE state.
125 126
* \param[in]  ctxtP                     Running context.
* \param[in]  rlc_pP                    RLC UM protocol instance pointer.
127
*/
128 129 130
protected_rlc_um_control_primitives(void rlc_um_init (
                const protocol_ctxt_t* const ctxt_pP,
                rlc_um_entity_t * const rlc_pP);)
131

132
/*! \fn void rlc_um_reset_state_variables (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)
133
* \brief    Reset protocol variables and state variables to initial values.
134 135
* \param[in]  ctxtP                     Running context.
* \param[in]  rlc_pP                    RLC UM protocol instance pointer.
136
*/
137 138 139
protected_rlc_um_control_primitives(void rlc_um_reset_state_variables (
                const protocol_ctxt_t* const ctxt_pP,
                rlc_um_entity_t * const rlc_pP);)
140

141
/*! \fn void rlc_um_cleanup(rlc_um_entity_t * const rlc_pP)
142
* \brief    Free all allocated memory (lists and buffers) previously allocated by this RLC UM instance.
143
* \param[in]  rlc_pP                    RLC UM protocol instance pointer.
144
*/
145 146
public_rlc_um_control_primitives(   void rlc_um_cleanup(
                rlc_um_entity_t * const rlc_pP);)
147

148
/*! \fn void rlc_um_configure(
149 150
 *     const protocol_ctxt_t* const ctxt_pP,
 *     rlc_um_entity_t * const rlc_pP,
151 152 153 154
 *     const uint32_t timer_reorderingP,
 *     const uint32_t rx_sn_field_lengthP,
 *     const uint32_t tx_sn_field_lengthP,
 *     const uint32_t is_mXchP)
155
* \brief    Configure RLC UM protocol parameters.
156 157
* \param[in]  ctxtP                     Running context.
* \param[in]  rlc_pP                    RLC UM protocol instance pointer.
158
* \param[in]  timer_reorderingP         t-Reordering timer initialization value, units in frameP.
159 160 161 162
* \param[in]  rx_sn_field_lengthP       Length of the sequence number, 5 or 10 bits in reception.
* \param[in]  tx_sn_field_lengthP       Length of the sequence number, 5 or 10 bits in transmission.
* \param[in]  is_mXchP                  Is the radio bearer for MCCH, MTCH.
*/
163
protected_rlc_um_control_primitives(void rlc_um_configure(
164 165 166 167 168 169
                const protocol_ctxt_t* const ctxt_pP,
                rlc_um_entity_t *const  rlc_pP,
                const uint32_t timer_reorderingP,
                const uint32_t rx_sn_field_lengthP,
                const uint32_t tx_sn_field_lengthP,
                const uint32_t is_mXchP);)
170

171
/*! \fn void rlc_um_set_debug_infos(
172 173 174 175
*     const protocol_ctxt_t* const ctxt_pP,
*     rlc_um_entity_t * const rlc_pP,
*     const srb_flag_t  srb_flagP,
*     const rb_id_t     rb_idP)
176
* \brief    Set debug informations for a RLC UM protocol instance, these informations are only for trace purpose.
177 178
* \param[in]  ctxtP                     Running context.
* \param[in]  rlc_pP                    RLC UM protocol instance pointer.
179
* \param[in]  rb_idP                    Radio bearer identifier.
180
* \param[in]  srb_flagP                 Flag to indicate signalling radio bearer (1) or data radio bearer (0).
181
*/
182
protected_rlc_um_control_primitives(void rlc_um_set_debug_infos(
183 184 185 186
                const protocol_ctxt_t* const ctxt_pP,
                rlc_um_entity_t * const rlc_pP,
                const srb_flag_t srb_flagP,
                const rb_id_t rb_idP);)
187 188
/** @} */
#    endif