8d880a7e20fe1eb3b71f11b3d902701afdf2019c
[o-du/l2.git] / src / 5gnrmac / rg_uhm.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /************************************************************************
20  
21      Name:     LTE-MAC layer
22   
23      Type:     C source file
24   
25      Desc:     C source code for Entry point fucntions
26   
27      File:     rg_uhm.c
28   
29 **********************************************************************/
30
31 /** @file rg_uhm.c
32 @brief This module handles uplink harq related functionality in MAC.
33 */
34
35 /* header include files -- defines (.h) */
36 #include "envopt.h"        /* environment options */
37 #include "envdep.h"        /* environment dependent */
38 #include "envind.h"        /* environment independent */
39   
40 #include "gen.h"           /* general */
41 #include "ssi.h"           /* system services */
42
43 #include "cm_lte.h"        /* Common LTE */
44 #include "cm_tkns.h"       /* Common Token Defines */
45 #include "cm_llist.h"      /* Common Link List Defines */
46 #include "cm_hash.h"       /* Common Hash List Defines */
47 #include "cm_mblk.h"       /* memory management */
48
49 #include "rg_env.h"        /* MAC Environment Defines */
50 #include "tfu.h"           /* TFU Interface defines */
51 #include "crg.h"           /* CRG Interface defines */
52 #include "rgu.h"           /* RGU Interface defines */
53 #include "rg_sch_inf.h"           /* TFU Interface defines */
54 #include "lrg.h"           /* LRG Interface defines */
55
56 #include "rg.h"            /* MAC defines */
57 #include "rg_err.h"        /* MAC error defines */
58
59 /* header/extern include files (.x) */
60 #include "gen.x"           /* general */
61 #include "ssi.x"           /* system services */
62 #include "cm5.x"           /* system services */
63 #include "cm_lte.x"        /* Common LTE */
64 #include "cm_tkns.x"       /* Common Token Definitions */
65 #include "cm_llist.x"      /* Common Link List Definitions */
66 #include "cm_lib.x"        /* Common Library Definitions */
67 #include "cm_hash.x"       /* Common Hash List Definitions */
68 #include "cm_mblk.x"       /* memory management */
69
70 #include "tfu.x"           /* TFU Interface defines */
71 #include "crg.x"           /* CRG Interface includes */
72 #include "rgu.x"           /* RGU Interface includes */
73 #include "rg_sch_inf.x"    /* SCH Interface defines */
74 #include "rg_prg.x"        /* PRG Interface defines */
75 #include "lrg.x"           /* LRG Interface includes */
76
77 #include "du_app_mac_inf.h"
78 #include "rg.x"            /* MAC includes */
79
80 /* local defines */
81
82 /* local typedefs */
83  
84 /* local externs */
85  
86 /* forward references */
87
88 /**
89  * @brief Handler for initializing the HARQ entity.
90  *
91  * @details
92  *
93  *     Function: rgUHMCrgUeCfg
94  *     
95  *     Invoked by: CRG
96  *
97  *     Processing Steps: 
98  *      -  Initialize maxHqRetx
99  *           
100  *  @param[in]      *cellCb
101  *  @param[in,out]  *ueCb
102  *  @param[in]      *ueCfg
103  *  @param[out]     *err
104  *  @return  Void
105  **/
106 #ifdef ANSI
107 PUBLIC Void rgUHMCrgUeCfg
108 (
109 RgCellCb       *cellCb,
110 RgUeCb         *ueCb,
111 CrgUeCfg       *ueCfg
112 )
113 #else
114 PUBLIC Void rgUHMCrgUeCfg(cellCb, ueCb, ueCfg) 
115 RgCellCb       *cellCb;
116 RgUeCb         *ueCb;
117 CrgUeCfg       *ueCfg;
118 #endif
119 {
120    TRC2(rgUHMCrgUeCfg);
121
122    ueCb->ul.hqEnt.maxHqRetx = (ueCfg->ueUlHqCfg.maxUlHqTx - 1); 
123    RETVOID;
124 }  /* rgUHMCrgUeCfg */
125
126 /**
127  * @brief Handler for re-initializing the HARQ entity.
128  *
129  * @details
130  *
131  *     Function: rgUHMCrgUeRecfg
132  *     
133  *     Invoked by: CRG
134  *
135  *     Processing Steps: 
136  *      -  Re-initialize maxHqRetx
137  *           
138  *  @param[in]      *cellCb
139  *  @param[in,out]  *ueCb
140  *  @param[in]      *ueCfg
141  *  @param[out]     *err
142  *  @return  Void
143  **/
144 #ifdef ANSI
145 PUBLIC Void rgUHMCrgUeRecfg
146 (
147 RgCellCb       *cellCb,
148 RgUeCb         *ueCb,
149 CrgUeRecfg     *ueRecfg
150 )
151 #else
152 PUBLIC Void rgUHMCrgUeRecfg(cellCb, ueCb, ueRecfg) 
153 RgCellCb       *cellCb;
154 RgUeCb         *ueCb;
155 CrgUeRecfg     *ueRecfg;
156 #endif
157 {
158    TRC2(rgUHMCrgUeRecfg);
159
160    ueCb->ul.hqEnt.maxHqRetx = (ueRecfg->ueUlHqRecfg.maxUlHqTx - 1); 
161    RETVOID;
162 }  /* rgUHMCrgUeCfg */
163
164 /**********************************************************************
165  
166          End of file
167 **********************************************************************/