rlc_am_init.h 6.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 * 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
 * the OAI Public License, Version 1.0  (the "License"); you may not use this file
 * 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
 */
Lionel Gauthier's avatar
Lionel Gauthier committed
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
/*! \file rlc_am_init.h
* \brief This file defines the prototypes of the functions initializing a RLC AM protocol instance.
* \author GAUTHIER Lionel
* \date 2010-2011
* \version
* \note
* \bug
* \warning
*/
/** @defgroup _rlc_am_init_impl_ RLC AM Init Reference Implementation
* @ingroup _rlc_am_impl_
* @{
*/
#ifndef __RLC_AM_INIT_H__
#    define __RLC_AM_INIT_H__

#    include "UTIL/MEM/mem_block.h"
//-----------------------------------------------------------------------------
#        ifdef RLC_AM_INIT_C
#            define private_rlc_am_init(x)    x
#            define protected_rlc_am_init(x)  x
#            define public_rlc_am_init(x)     x
#        else
#            ifdef RLC_AM_MODULE
#                define private_rlc_am_init(x)
#                define protected_rlc_am_init(x)  extern x
#                define public_rlc_am_init(x)     extern x
#            else
#                define private_rlc_am_init(x)
#                define protected_rlc_am_init(x)
#                define public_rlc_am_init(x)     extern x
#            endif
#        endif
//-----------------------------------------------------------------------------
#include "platform_types.h"
#include "platform_constants.h"
#include "PHY/defs.h"


/*! \struct  rlc_am_info_t
* \brief Structure containing RLC AM configuration parameters.
*/
typedef volatile struct {
65 66 67 68 69 70
  uint16_t max_retx_threshold;  /*!< \brief Maximum number of retransmissions for one RLC AM PDU. */
  uint16_t poll_pdu;            /*!< \brief Generate a status each poll_pdu pdu sent. */
  uint16_t poll_byte;           /*!< \brief Generate a status each time poll_byte bytes have been sent. */
  uint32_t t_poll_retransmit;   /*!< \brief t-PollRetransmit timer initial value. */
  uint32_t t_reordering;        /*!< \brief t-Reordering timer initial value. */
  uint32_t t_status_prohibit;   /*!< \brief t-StatusProhibit timer initial value. */
71 72 73
} rlc_am_info_t;

//-----------------------------------------------------------------------------
74
/*! \fn void rlc_am_init   (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP)
75
* \brief    Initialize the RLC AM protocol instance, reset variables, allocate buffers, lists, then, the next step in order have a running RLC AM instance is to configure and set debug informations for this RLC instance.
76 77
* \param[in]  ctxtP                     Running context.
* \param[in]  rlc_pP                    RLC AM protocol instance pointer.
78
*/
79
public_rlc_am_init( void rlc_am_init   (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t* rlc_pP);)
80

81
/*! \fn void rlc_am_cleanup(rlc_am_entity_t *const rlc_pP)
82
* \brief    Free all memory resources allocated and kept by this RLC AM instance.
83
* \param[in]  rlc_pP                    RLC AM protocol instance pointer.
84
*/
85
public_rlc_am_init( void rlc_am_cleanup(rlc_am_entity_t* rlc_pP);)
86

87
/*! \fn void rlc_am_configure(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP,  uint16_t max_retx_thresholdP, uint16_t poll_pduP, uint16_t poll_byteP, uint32_t t_poll_retransmitP, uint32_t t_reorderingP, uint32_t t_status_prohibitP)
88
* \brief    Set RLC AM protocol parameters.
89 90
* \param[in]  ctxtP                     Running context.
* \param[in]  rlc_pP                    RLC AM protocol instance pointer.
91 92 93 94 95 96 97 98
* \param[in]  max_retx_thresholdP       Limit the number of retransmissions of an
AMD PDU.
* \param[in]  poll_pduP                 Trigger a poll for every poll_pduP PDUs.
* \param[in]  poll_byteP                Trigger a poll for every pollByte bytes.
* \param[in]  t_poll_retransmitP        This timer is used by the transmitting side of an AM RLC entity in order to retransmit a poll, value in frames.
* \param[in]  t_reorderingP             This timer is used by the receiving side of an AM RLC entity in order to detect loss of RLC PDUs at lower layer, value in frames.
* \param[in]  t_status_prohibitP        This timer is used by the receiving side of an AM RLC entity in order to prohibit transmission of a STATUS PDU, value in frames.
*/
99
public_rlc_am_init( void rlc_am_configure(const protocol_ctxt_t* const ctxtP,
100 101 102 103 104 105 106
                    rlc_am_entity_t * const rlc_pP,
                    const uint16_t max_retx_thresholdP,
                    const uint16_t poll_pduP,
                    const uint16_t poll_byteP,
                    const uint32_t t_poll_retransmitP,
                    const uint32_t t_reorderingP,
                    const uint32_t t_status_prohibitP);)
107

108

109
/*! \fn void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP)
110
* \brief    Set informations that will be displayed in traces, helping the debug process.
111 112
* \param[in]  ctxtP                     Running context.
* \param[in]  rlc_pP                    RLC AM protocol instance pointer.
113
* \param[in]  srb_flagP                 Flag to indicate signalling radio bearer (1) or data radio bearer (0).
114
* \param[in]  rb_idP                    Radio bearer identifier.
115
* \param[in]  chan_idP                  Transport channel identifier.
116
*/
117
public_rlc_am_init( void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP, const logical_chan_id_t chan_idP);)
118 119
/** @} */
#endif