rlc_tm.h 6.29 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
/*! \file rlc_tm.h
* \brief This file, and only this file must be included by code that interact with RLC TM layer.
* \author GAUTHIER Lionel
* \date 2010-2011
* \version
* \note
* \bug
* \warning
*/
/** @defgroup _rlc_tm_impl_ RLC TM Layer Reference Implementation
* @ingroup _rlc_impl_
* @{
*/
#    ifndef __RLC_TM_H__
#        define __RLC_TM_H__
#        include "platform_types.h"
#        include "rlc_def.h"
#        include "rlc_def_lte.h"
#        include "rlc_tm_structs.h"
#        include "rlc_tm_entity.h"
#        include "mem_block.h"
#        include "rlc_tm_init.h"

45 46 47 48
#define PROTOCOL_RLC_TM_CTXT_FMT PROTOCOL_CTXT_FMT"[%s %02u]"
#define PROTOCOL_RLC_TM_CTXT_ARGS(CTXT_Pp, rLC_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp),\
          (rLC_Pp->is_data_plane) ? "DRB TM" : "SRB TM",\
          rLC_Pp->rb_id
49 50


51
/*! \fn void rlc_tm_send_sdu (
52
*        const protocol_ctxt_t* const  ctxt_pP,
53 54 55 56
*        rlc_tm_entity_t * const rlc_pP,
*        const boolean_t         error_indicationP,
*        uint8_t * const         srcP,
*        const sdu_size_t        length_in_bitsP)
57 58 59 60 61 62
* \brief    Send SDU if any reassemblied to upper layer.
* \param[in]  rlcP                RLC TM protocol instance pointer.
* \param[in]  error_indicationP   Error indicated by lower layers for this SDU.
* \param[in]  srcP                SDU data pointer.
* \param[in]  length_in_bitsP     Length of SDU in bits.
*/
63
void rlc_tm_send_sdu (
64 65 66 67
                 const protocol_ctxt_t* const  ctxt_pP,
                 rlc_tm_entity_t * const rlc_pP,
                 const boolean_t         error_indicationP,
                 uint8_t * const         srcP,
68
                 const sdu_size_t        length_in_bitsP);
69 70

/*! \fn void rlc_tm_no_segment (const protocol_ctxt_t* const  ctxt_pP, rlc_tm_entity_t * const rlcP)
71
* \brief    Schedule a SDU to be transmited by lower layers.
72
* \param[in]  ctxtP                     Running context.
73 74
* \param[in]  rlcP                RLC TM protocol instance pointer.
*/
75
void rlc_tm_no_segment (
76
                 const protocol_ctxt_t* const  ctxt_pP,
77
                 rlc_tm_entity_t *const rlcP);
78

79
/*! \fn void rlc_tm_rx (const protocol_ctxt_t* const  ctxt_pP,void *const rlcP, struct mac_data_ind data_indP)
80
* \brief    Process the received PDUs from lower layer.
81
* \param[in]  ctxtP                     Running context.
82 83 84
* \param[in]  rlcP                      RLC TM protocol instance pointer.
* \param[in]  data_indP                 PDUs from MAC.
*/
85
void     rlc_tm_rx (
86 87
                  const protocol_ctxt_t* const  ctxt_pP,
                  void *const rlcP,
88
                  struct mac_data_ind data_indP);
89 90


91
/*! \fn struct mac_status_resp rlc_tm_mac_status_indication (const protocol_ctxt_t* const  ctxt_pP, void * const rlcP, const uint16_t tbs_sizeP, struct mac_status_ind tx_statusP)
92
* \brief    Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
93
* \param[in]  ctxtP                     Running context.
94 95 96 97 98
* \param[in]  rlcP                      RLC TM protocol instance pointer.
* \param[in]  tbs_sizeP                 Number of bytes requested by MAC for next transmission.
* \param[in]  tx_statusP                Transmission status given by MAC on previous MAC transmission of the PDU.
* \return     The maximum number of bytes that can be served by RLC instance to MAC.
*/
laurent's avatar
laurent committed
99 100 101 102 103 104
struct mac_status_resp
rlc_tm_mac_status_indication (
  const protocol_ctxt_t* const  ctxt_pP,
  void * const                  rlc_pP,
  const tb_size_t               tb_sizeP,
  struct mac_status_ind         tx_statusP);
105 106


107
/*! \fn struct mac_data_req rlc_tm_mac_data_request (const protocol_ctxt_t* const  ctxt_pP, void * const rlcP)
108
* \brief    Gives PDUs to lower layer MAC.
109
* \param[in]  ctxtP                     Running context.
110 111 112
* \param[in]  rlcP                      RLC TM protocol instance pointer.
* \return     A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission.
*/
113
struct mac_data_req  rlc_tm_mac_data_request (
114
                 const protocol_ctxt_t* const  ctxt_pP,
115
                 void * const rlcP);
116 117


118
/*! \fn void     rlc_tm_mac_data_indication (const protocol_ctxt_t* const  ctxt_pP,void * const rlcP, struct mac_data_ind data_indP)
119
* \brief    Receive PDUs from lower layer MAC.
120 121 122
* \param[in]  ctxtP                     Running context.
* \param[in]  rlcP                      RLC TM protocol instance pointer.
* \param[in]  data_indP                 PDUs from MAC.
123
*/
124
void rlc_tm_mac_data_indication (
125 126
                 const protocol_ctxt_t* const  ctxt_pP,
                 void * const rlcP,
127
                 struct mac_data_ind data_indP);
128 129


130
/*! \fn void     rlc_tm_data_req (const protocol_ctxt_t* const  ctxt_pP,void * const rlcP, mem_block_t * const sduP)
131
* \brief    Interface with higher layers, buffer higher layer SDUS for transmission.
132 133 134
* \param[in]  ctxtP                     Running context.
* \param[in]  rlcP                      RLC TM protocol instance pointer.
* \param[in]  sduP                      SDU. (A struct rlc_tm_data_req is mapped on sduP->data.)
135
*/
136
void     rlc_tm_data_req (
137 138
                    const protocol_ctxt_t* const  ctxt_pP,
                    void * const rlcP,
139
                    mem_block_t * const sduP);
140 141 142

/** @} */
#    endif