c967e515c5893b776fcf3a17ccee2de9dd0caaaa
[o-du/l2.git] / src / cm / rgm.x
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      Name:    Upper Layer Interface
21
22      Type:    C header file
23
24      Desc:    Structures, variables and typedefs required by 
25               RGU interface
26
27      File:    rgu.x
28
29 *********************************************************************21*/
30
31 \f
32 #ifndef __RGMX__
33 #define __RGMX__
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /** 
39   @file rgu.x 
40   @brief Structure declarations and definitions for RGU interface.
41  */
42
43 /***********************************************************************
44                           typedefs and data structures
45  ***********************************************************************/
46
47 #define RGM_PRB_REPORT_STOP     0 
48 #define RGM_PRB_REPORT_START    1 
49
50 #define RGM_MAX_QCI_REPORTS     4
51
52 typedef struct rgmPrbRprtCfg
53 {
54    uint16_t   usPrbAvgPeriodicty; /* It is in milli sec */
55    uint8_t    bConfigType;
56    uint8_t    bCellId;
57 }RgmPrbRprtCfg;
58
59 /* RRM_SP1_START */
60 typedef struct rgmPrbRptPerQci
61 {
62    uint8_t       bQci;
63    uint8_t       bAvgPrbUlUsage;
64    uint8_t       bAvgPrbDlUsage;
65 }RgmPrbRptPerQci;
66
67 typedef struct rgmPrbRprtInd
68 {
69    RgmPrbRptPerQci   stQciPrbRpts[RGM_MAX_QCI_REPORTS];
70 /* RRM_SP1_END */
71    uint8_t                bCellId;
72    /* TDD: DL PRB Usage pres = 2 and 
73     *      UL PRB Usage pres = 1 
74     * FDD: DL and UL Usage Pres = 3     
75     */
76    uint8_t                bPrbUsageMask; 
77 }RgmPrbRprtInd;
78
79 typedef enum
80 {
81    RGM_TXN_MODE1,
82    RGM_TXN_MODE2,
83    RGM_TXN_MODE3,
84    RGM_TXN_MODE4,
85    RGM_TXN_MODE5,
86    RGM_TXN_MODE6,
87    RGM_TXN_MODE7,
88    RGM_TXN_MODE8
89 } RgmTxnMode;
90
91 typedef struct rgmTransModeInd
92 {
93    RgmTxnMode       eMode;         /* Indicate TM Mode */ 
94    uint16_t              usCrnti;       /* UE Crnti value     */
95    uint8_t               bCellId;       /* Cell Id */
96 }RgmTransModeInd;
97 /***********************************************************************
98           type definitions for upper layer interface - RLC primitives
99  ***********************************************************************/
100 /** @brief Bind Request from RLC to MAC to bind the interface SAPs */
101 typedef S16 (*RgmBndReq) ARGS((
102    Pst*                 pst,
103    SuId                 suId,
104    SpId                 spId));
105 /** @brief Unbind Request from RLC to MAC to unbind the interface SAPs */
106 typedef S16 (*RgmUbndReq) ARGS((
107    Pst*                 pst,
108    SpId                 spId,
109    Reason               reason));
110 /** @brief Bind Confirmation from MAC to RLC for the bind/unbind 
111  * request for the interface SAPs */
112 typedef S16 (*RgmBndCfm) ARGS((
113    Pst*                 pst,
114    SuId                 suId,
115    uint8_t                   status));
116 /** @brief Data Request from RLC to MAC for forwarding SDUs on common
117  * channel for transmission */
118 typedef S16 (*RgmCfgPrbRprtFptr) ARGS((
119    Pst*                 pst,
120    SpId                 spId,
121    RgmPrbRprtCfg   *    prbRprtCfg));
122 /** @brief Data Indication from MAC to RLC to 
123  * forward the data received for common channels */
124 typedef S16 (*RgmPrbRprtIndFptr) ARGS((
125    Pst*                 pst,
126    SuId                 suId,
127    RgmPrbRprtInd  *    prbRprtInd));
128
129 typedef S16 (*RgmTransModeIndFptr) ARGS((
130    Pst*                 pst,
131    SuId                 suId,
132    RgmTransModeInd  *   transModeInd));
133 #ifdef RG
134 /** @brief Bind Request from RLC to MAC to bind the interface SAPs
135  * @param pst Pointer to the post structure.
136  * @param suId SAP ID of the service user.
137  * @param spId SAP ID of the service provider.
138  * @return ROK/RFAILED
139 */
140 S16 RgUiRgmBndReq ARGS((Pst* pst,SuId suId,SpId spId));
141 /** @brief Unbind Request from RLC to MAC to unbind the interface SAPs 
142  * @param pst Pointer to the post structure.
143  * @param spId SAP ID of the service provider.
144  * @param reason Reason for unbind request.
145  * @return ROK/RFAILED
146 */
147 S16 RgUiRgmUbndReq ARGS((Pst* pst,SpId spId,Reason reason));
148 /** @brief Bind Confirmation from MAC to RLC for the bind and unbind 
149  * request for the interface SAPs 
150  * @param pst Pointer to the post structure.
151  * @param suId SAP ID of the service user.
152  * @param status Status of the bind request. 
153  * @return ROK/RFAILED
154 */
155 S16 RgUiRgmBndCfm ARGS((Pst* pst,SuId suId,uint8_t status));
156 /** @brief Data Request from RLC to MAC for forwarding SDUs on common
157  * channel for transmission 
158  * @param pst Pointer to the post structure.
159  * @param spId SAP ID of the service provider.
160  * @param prbRprtCfg Data request for common channels (BCCH, PCCH and CCCH).
161  * @return ROK/RFAILED
162 */
163 S16 RgUiRgmCfgPrbRprt ARGS((Pst* pst,SuId suId,RgmPrbRprtCfg *prbRprtCfg));
164 /** @brief Data Indication from MAC to RLC to 
165  * forward the data received for common channels
166  * @param pst Pointer to the post structure.
167  * @param suId SAP ID of the service user.
168  * @param prbRprtInd Data indication on CCCH.
169  * @return ROK/RFAILED
170 */
171 S16 RgUiRgmPrbRprtInd ARGS((Pst* pst,SuId suId,RgmPrbRprtInd  *prbRprtInd));
172
173 #endif
174
175 #ifdef RM_INTF
176 /** @brief Request from RLC to MAC to bind the interface saps */
177 S16 RmLiRgmBndReq ARGS((
178    Pst*                 pst,
179    SuId                 suId,
180    SpId                 spId
181 ));
182 /** @brief Request from RLC to MAC to Unbind the interface saps */
183 S16 RmLiRgmUbndReq ARGS((
184    Pst*                 pst,
185    SpId                 spId,
186    Reason               reason
187 ));
188 /** @brief Confirmation from MAC to RLC for the bind/Unbind 
189  * request for the interface saps */
190 S16 RmLiRgmBndCfm ARGS((
191    Pst*                 pst,
192    SuId                 suId,
193    uint8_t                   status
194 ));
195 /** @brief Request from RLC to MAC for forwarding SDUs on common
196  * channel for transmission */
197 S16 RmLiRgmCfgPrbRprt ARGS((
198    Pst*                 pst,
199    SpId                 spId,
200    RgmPrbRprtCfg*       prbRprtCfg
201 ));
202 /** @brief Data Indication from MAC to RLC to 
203  * forward the data received for common channels*/
204 S16 RmLiRgmPrbRprtInd ARGS((
205    Pst*                 pst,
206    SuId                 suId,
207    RgmPrbRprtInd*       prbRprtInd
208 ));
209 /** @brief Data Indication from MAC to RRM to 
210  * change the transmission mode*/
211 S16 RmLiRgmTransModeInd ARGS((
212    Pst*                 pst,
213    SuId                 suId,
214    RgmTransModeInd*     transModeInd
215 ));
216 #endif
217
218 #ifdef RGM_LWLC
219 /** @brief Request from RLC to MAC to bind the interface saps */
220 S16 cmPkLwLcRgmBndReq ARGS((
221    Pst*                 pst,
222    SuId                 suId,
223    SpId                 spId
224 ));
225 /** @brief Request from RLC to MAC to bind the interface saps */
226 S16 cmUnpkLwLcRgmBndReq ARGS((
227    RgmBndReq            func,
228    Pst*                 pst,
229    Buffer               *mBuf
230 ));
231 /** @brief Request from RLC to MAC to Unbind the interface saps */
232 S16 cmPkLwLcRgmUbndReq ARGS((
233    Pst*                 pst,
234    SpId                 spId,
235    Reason               reason
236 ));
237 /** @brief Request from RLC to MAC to Unbind the interface saps */
238 S16 cmUnpkLwLcRgmUbndReq ARGS((
239    RgmUbndReq           func,
240    Pst*                 pst,
241    Buffer               *mBuf
242 ));
243 /** @brief Confirmation from MAC to RLC for the bind/Unbind 
244  * request for the interface saps */
245 S16 cmPkLwLcRgmBndCfm ARGS((
246    Pst*                 pst,
247    SuId                 suId,
248    uint8_t                   status
249 ));
250 /** @brief Confirmation from MAC to RLC for the bind/Unbind 
251  * request for the interface saps */
252 S16 cmUnpkLwLcRgmBndCfm ARGS((
253    RgmBndCfm            func,
254    Pst*                 pst,
255    Buffer               *mBuf
256 ));
257 /** @brief Request from RLC to MAC for forwarding SDUs on common
258  * channel for transmission */
259 S16 cmPkLwLcRgmCfgPrbRprt ARGS((
260    Pst*                 pst,
261    SpId                 spId,
262    RgmPrbRprtCfg  *    prbRprtCfg
263 ));
264 /** @brief Request from RLC to MAC for forwarding SDUs on common
265  * channel for transmission */
266 S16 cmUnpkLwLcRgmCfgPrbRprt ARGS((
267    RgmCfgPrbRprtFptr           func,
268    Pst*                 pst,
269    Buffer               *mBuf
270 ));
271 /** @brief Data Indication from MAC to RLC to 
272  * forward the data received for common channels*/
273 S16 cmPkLwLcRgmPrbRprtInd ARGS((
274    Pst*                 pst,
275    SuId                 suId,
276    RgmPrbRprtInd  *    prbRprtInd
277 ));
278 /** @brief Data Indication from MAC to RLC to 
279  * forward the data received for common channels*/
280 S16 cmUnpkLwLcRgmPrbRprtInd ARGS((
281    RgmPrbRprtIndFptr           func,
282    Pst*                 pst,
283    Buffer               *mBuf
284 ));
285 #endif
286
287
288 /** @brief Request from RLC to MAC to bind the interface saps */
289 S16 cmPkRgmBndReq ARGS((
290    Pst*                 pst,
291    SuId                 suId,
292    SpId                 spId
293 ));
294 /** @brief Request from RLC to MAC to bind the interface saps */
295 S16 cmUnpkRgmBndReq ARGS((
296    RgmBndReq            func,
297    Pst*                 pst,
298    Buffer               *mBuf
299 ));
300 /** @brief Request from RLC to MAC to Unbind the interface saps */
301 S16 cmPkRgmUbndReq ARGS((
302    Pst*                 pst,
303    SpId                 spId,
304    Reason               reason
305 ));
306 /** @brief Request from RLC to MAC to Unbind the interface saps */
307 S16 cmUnpkRgmUbndReq ARGS((
308    RgmUbndReq           func,
309    Pst*                 pst,
310    Buffer               *mBuf
311 ));
312 /** @brief Confirmation from MAC to RLC for the bind/Unbind 
313  * request for the interface saps */
314 S16 cmPkRgmBndCfm ARGS((
315    Pst*                 pst,
316    SuId                 suId,
317    uint8_t                   status
318 ));
319 /** @brief Confirmation from MAC to RLC for the bind/Unbind 
320  * request for the interface saps */
321 S16 cmUnpkRgmBndCfm ARGS((
322    RgmBndCfm            func,
323    Pst*                 pst,
324    Buffer               *mBuf
325 ));
326 /** @brief Request from RLC to MAC for forwarding SDUs on common
327  * channel for transmission */
328 S16 cmPkRgmCfgPrbRprt ARGS((
329    Pst*                 pst,
330    SpId                 spId,
331    RgmPrbRprtCfg   *    prbRprtCfg
332 ));
333
334
335 S16 cmPkCfgPrbRprt ARGS((
336 RgmPrbRprtCfg  * prbRprtCfg,
337 Buffer *mBuf
338 ));
339
340 S16 cmPkPrbRprtInd ARGS((
341 RgmPrbRprtInd  * prbRprtInd,
342 Buffer *mBuf
343 ));
344
345 /** @brief Request from RLC to MAC for forwarding SDUs on common
346  * channel for transmission */
347 S16 cmUnpkRgmCfgPrbRprt ARGS((
348    RgmCfgPrbRprtFptr    func,
349    Pst*                 pst,
350    Buffer               *mBuf
351 ));
352
353 S16 cmUnPkCfgPrbRprt ARGS((
354 RgmPrbRprtCfg  * prbRprtCfg,
355 Buffer *mBuf
356 ));
357
358 /** @brief Data Indication from MAC to RLC to 
359  * forward the data received for common channels*/
360 S16 cmPkRgmPrbRprtInd ARGS((
361    Pst*                 pst,
362    SuId                 suId,
363    RgmPrbRprtInd  *    prbRprtInd
364 ));
365
366
367 S16 cmUnpkPrbRprtInd ARGS((
368 RgmPrbRprtInd  * prbRprtInd,
369 Buffer *mBuf
370 ));
371
372 S16 cmPkTransModeInd ARGS((
373 RgmTransModeInd *transModeInd,
374 Buffer *mBuf
375 ));
376
377 S16 cmUnpkTransModeInd ARGS((
378 RgmTransModeInd *transModeInd,
379 Buffer *mBuf
380 ));
381 S16 cmPkRgmTransModeInd ARGS((
382    Pst*                 pst,
383    SuId                 suId,
384    RgmTransModeInd *transModeInd
385 ));
386
387
388 S16 cmUnpkRgmTransModeInd ARGS((
389          RgmTransModeIndFptr    func,
390          Pst*                 pst,
391          Buffer               *mBuf
392          ));
393
394 /** @brief Data Indication from MAC to RLC to 
395  * forward the data received for common channels*/
396 S16 cmUnpkRgmPrbRprtInd ARGS((
397    RgmPrbRprtIndFptr    func,
398    Pst*                 pst,
399    Buffer               *mBuf
400 ));
401
402 S16 cmPkRgmPrbQciRpt ARGS((
403 RgmPrbRptPerQci *qciPrbRprt,
404 Buffer *mBuf
405 ));
406
407 S16 cmUnpkRgmPrbQciRpt ARGS((
408 RgmPrbRptPerQci *qciPrbRprt,
409 Buffer *mBuf
410 ));
411
412 #ifdef __cplusplus
413 }
414 #endif
415 #endif /* __RGUX__ */
416
417 /********************************************************************30**
418
419          End of file
420 **********************************************************************/