efa914ff6bd8ac18828ce29dd12c3136911f740a
[o-du/l2.git] / src / 5gnrmac / rg_prg_pt.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 MAC to MAC (PRG) interface 
26   
27      File:     rg_prg_pt.c 
28   
29 **********************************************************************/
30
31 /* header include files -- defines (.h) */
32 #include "envopt.h"        /* environment options */
33 #include "envdep.h"        /* environment dependent */
34 #include "envind.h"        /* environment independent */
35 #include "gen.h"           /* general layer */
36 #include "ssi.h"           /* system service interface */
37 #include "cm_hash.h"       /* common hash list */
38 #include "cm_mblk.h"       /* common memory link list library */
39 #include "cm_llist.h"      /* common linked list library */
40 #include "cm_err.h"        /* common error */
41 #include "cm_lte.h"        /* common LTE */
42 #include "lrg.h"           /* layer manager for MAC */
43 #include "crg.h"           /* CRG interface includes*/
44 #include "rgu.h"           /* RGU interface includes*/
45 #include "tfu.h"           /* TFU interface includes*/
46 #include "rg_sch_inf.h"    /* SCH interface includes*/
47 #include "rg_prg.h"        /* PRG interface includes*/
48 #include "rg_env.h"        /* MAC Enviroments includes */
49 #include "rg.h"            /* MAC includes*/
50 #include "rg_err.h"        /* MAC error includes*/
51
52 /* header/extern include files (.x) */
53 #include "gen.x"           /* general layer typedefs */
54 #include "ssi.x"           /* system services typedefs */
55 #include "cm5.x"           /* common timers */
56 #include "cm_hash.x"       /* common hash list */
57 #include "cm_lib.x"        /* common library */
58 #include "cm_llist.x"      /* common linked list */
59 #include "cm_mblk.x"       /* memory management */
60 #include "cm_tkns.x"       /* common tokens */
61 #include "cm_lte.x"        /* common tokens */
62 #include "rgu.x"           /* RGU types */
63 #include "tfu.x"           /* RGU types */
64 #include "lrg.x"           /* layer management typedefs for MAC */
65 #include "crg.x"           /* layer management typedefs for MAC */
66 #include "rg_sch_inf.x"    /* layer management typedefs for MAC */
67 #include "rg_prg.x"        /* PRG interface typedefs*/
68 #include "du_app_mac_inf.h"
69 #include "rg.x"            /* typedefs for MAC */
70
71 #ifdef LTE_ADV
72 #include "rg_pom_scell.x"
73
74 /* Matrix for Ue SCell Config Req*/
75 PRIVATE CONSTANT RgPrgUeSCellCfgReq RgPrgPMacSMacUeSCellCfgReqMt[RG_PRG_MAX] =
76 {
77 #ifdef LCPRG
78   cmPkPrgPMacSMacUeSCellCfgReq,
79 #else
80    RgPrgPMacSMacUeSCellCfgReq
81 #endif
82 };
83
84 /**
85 * @brief Ue SCell config Req from PMac to SMac 
86 *
87 * @details
88 *
89 *     Function : RgPrgPMacSMacUeSCellCfg
90 *
91 *  @param[in]   Pst         *pst
92 *  @param[in]   RgPrgUeSCellCfgInfo *ueSCellCfgInfo;
93 *  @return   S16
94 *      -# ROK
95 **/
96 #ifdef ANSI
97 PUBLIC S16 RgPrgPMacSMacUeSCellCfg
98 (
99  Pst         *pst,
100  RgPrgUeSCellCfgInfo *ueSCellCfgInfo
101 )
102 #else
103 PUBLIC S16 RgPrgPMacSMacUeSCellCfg(pst, ueSCellCfgInfo)
104  Pst         *pst;
105  RgPrgUeSCellCfgInfo *ueSCellCfgInfo;
106 #endif
107 {
108
109    TRC3(RgPrgPMacSMacUeSCellCfg);
110
111    RETVALUE((*RgPrgPMacSMacUeSCellCfgReqMt[0])(pst, ueSCellCfgInfo));
112 }
113
114 /* Matrix for config confirm from SMac to Pmac*/
115 PRIVATE CONSTANT RgSMacPMacCfgCfm RgPrgSMacPMacCfgCfmMt[RG_PRG_MAX] =
116 {
117 #ifdef LCPRG
118    cmPkPrgSMacPMacCfgCfm,
119 #else
120    RgPrgSMacPMacCfgCfm
121 #endif
122 };
123
124 /**
125 * @brief Config confirm from SMac to PMac for Ue Cell Config Req 
126 *
127 * @details
128 *
129 *     Function :RgPrgSMacPMacCfg
130 *
131 *  @param[in]   Pst              *pst
132 *  @param[in]   RgPrgCfgCfmInfo  *cfmCfm
133 *  @return   S16
134 *      -# ROK
135 **/
136 #ifdef ANSI
137 PUBLIC S16 RgPrgSMacPMacCfg
138 (
139  Pst             *pst,
140  RgPrgCfgCfmInfo *cfgCfm
141 )
142 #else
143 PUBLIC S16 RgPrgSMacPMacCfg(pst, cfgCfm)
144  Pst             *pst;
145  RgPrgCfgCfmInfo *cfgCfm;
146 #endif
147 {
148
149    TRC3(RgPrgSMacPMacCfg);
150
151    RETVALUE((*RgPrgSMacPMacCfgCfmMt[0])(pst, cfgCfm));
152 }
153
154 /* Matrix for Ue SCell delete req/Ue Id change req from PMac to SMac */
155 PRIVATE CONSTANT RgUeSCellDelReq RgPrgPMacSMacUeSCellDelReqMt[RG_PRG_MAX] =
156 {
157 #ifdef LCPRG
158    cmPkPrgPMacSMacUeSCellDelReq,
159 #else
160    RgPrgPMacSMacUeSCellDelReq
161 #endif
162 };
163
164 /**
165 * @brief Ue SCell delete Req/Ue Id change Req from PMac to SMac
166 *
167 * @details
168 *
169 *     Function : RgPrgPMacSMacUeSCellDel 
170 *
171 *  @param[in]   Pst                 *pst
172 *  @param[in]   RgPrgUeSCellDelInfo *ueSCellDelInfo;
173 *  @return   S16
174 *      -# ROK
175 **/
176 #ifdef ANSI
177 PUBLIC S16 RgPrgPMacSMacUeSCellDel
178 (
179  Pst                 *pst,
180  RgPrgUeSCellDelInfo *ueSCellDelInfo
181 )
182 #else
183 PUBLIC S16 RgPrgPMacSMacUeSCellDel(pst, ueSCellDelInfo)
184  Pst                 *pst;
185  RgPrgUeSCellDelInfo *ueSCellDelInfo;
186 #endif
187 {
188
189    TRC3(RgPrgPMacSMacUeSCellDel);
190
191    RETVALUE((*RgPrgPMacSMacUeSCellDelReqMt[0])(pst, ueSCellDelInfo));
192 }
193
194
195
196 /* Matrix for Lch ReConfig Req*/
197 PRIVATE CONSTANT RgPrgUeScellModLchReq RgPrgPMacSMacUeScellModLchReqMt[RG_PRG_MAX] =
198 {
199 #ifdef LCPRG
200   cmPkPrgPMacSMacUeSCellLchModReq,
201 #else
202    RgPrgPMacSMacUeSCellLchModReq
203 #endif
204 };
205
206
207 /**
208 * @brief Ue Lch Reconfig Req from PMac to SMac 
209 *
210 * @details
211 *
212 *     Function : RgPrgPMacSMacUeScellLchMod
213 *
214 *  @param[in]   Pst                      *pst
215 *  @param[in]   RgPrgUeSCellLchModInfo   *lchCfgInfo
216 *  @return   S16
217 *      -# ROK
218 **/
219 #ifdef ANSI
220 PUBLIC S16 RgPrgPMacSMacUeScellLchMod
221 (
222  Pst                      *pst,
223  RgPrgUeSCellLchModInfo   *lchCfgInfo
224 )
225 #else
226 PUBLIC S16 RgPrgPMacSMacUeScellLchMod(pst, lchCfgInfo)
227  Pst                      *pst;
228  RgPrgUeSCellLchModInfo   *lchCfgInfo;
229 #endif
230 {
231
232    TRC3(RgPrgPMacSMacUeScellLchMod);
233
234    RETVALUE((*RgPrgPMacSMacUeScellModLchReqMt[0])(pst, lchCfgInfo));
235 }
236
237
238 /* Matrix for delete Lch Req*/
239 PRIVATE CONSTANT RgPrgUeScellDelLchReq RgPrgPMacSMacUeScellDelLchReqMt[RG_PRG_MAX] =
240 {
241 #ifdef LCPRG
242   cmPkPrgPMacSMacUeSCellLchDelReq,
243 #else
244    RgPrgPMacSMacUeSCellLchDelReq
245 #endif
246 };
247
248
249 /**
250 * @brief Delete Lch Req from PMac to SMac 
251 *
252 * @details
253 *
254 *     Function : RgPrgPMacSMacUeScellLchDel
255 *
256 *  @param[in]   Pst                      *pst
257 *  @param[in]   RgPrgUeSCellLchDelInfo   *delLcCb
258 *  @return   S16
259 *      -# ROK
260 **/
261 #ifdef ANSI
262 PUBLIC S16 RgPrgPMacSMacUeScellLchDel
263 (
264  Pst                       *pst,
265  RgPrgUeSCellLchDelInfo    *delLcCb
266 )
267 #else
268 PUBLIC S16 RgPrgPMacSMacUeScellLchDel(pst, delLcCb)
269  Pst                       *pst;
270  RgPrgUeSCellLchDelInfo    *delLcCb;
271 #endif
272 {
273
274    TRC3(RgPrgPMacSMacUeScellLchDel);
275
276    RETVALUE((*RgPrgPMacSMacUeScellDelLchReqMt[0])(pst, delLcCb));
277 }
278
279
280 /* Matrix for Lch Config Req*/
281 PRIVATE CONSTANT RgPrgUeScellAddLchReq RgPrgPMacSMacUeScellAddLchReqMt[RG_PRG_MAX] =
282 {
283 #ifdef LCPRG
284   cmPkPrgPMacSMacUeSCellLchAddReq,
285 #else
286    RgPrgPMacSMacUeSCellLchAddReq
287 #endif
288 };
289
290
291 /**
292 * @brief Ue Lch config Req from PMac to SMac 
293 *
294 * @details
295 *
296 *     Function : RgPrgPMacSMacUeScellLchAdd
297 *
298 *  @param[in]   Pst                      *pst
299 *  @param[in]   RgPrgUeSCellLchAddInfo   *lchCfgInfo
300 *  @return   S16
301 *      -# ROK
302 **/
303 #ifdef ANSI
304 PUBLIC S16 RgPrgPMacSMacUeScellLchAdd
305 (
306  Pst                      *pst,
307  RgPrgUeSCellLchAddInfo   *lchCfgInfo
308 )
309 #else
310 PUBLIC S16 RgPrgPMacSMacUeScellLchAdd(pst, lchCfgInfo)
311  Pst                      *pst;
312  RgPrgUeSCellLchAddInfo   *lchCfgInfo;
313 #endif
314 {
315
316    TRC3(RgPrgPMacSMacUeScellLchAdd);
317
318    RETVALUE((*RgPrgPMacSMacUeScellAddLchReqMt[0])(pst, lchCfgInfo));
319 }
320
321 #endif /* LTE_ADV */
322
323 /**********************************************************************
324  
325          End of file
326 **********************************************************************/