[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / 5gnrsch / rg_sch_sc1.h
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:    LTE MAC SC1 scheduler 
21
22      Type:    C header file
23
24      Desc:    Defines required by SC1 scheduler
25
26      File:    rg_sch_sc1.h
27
28 *********************************************************************21*/
29
30 \f
31 #ifndef __RGSCHSC1H__
32 #define __RGSCHSC1H__ 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 /***********************************************************************
39                          Macro Definitions 
40  ***********************************************************************/
41
42 /* Scheduler1 tunable params */
43
44 #define RG_GET_SC1_CELL_UL(cell) \
45              ((RgSchSc1UlCell *)((RgSchCmnCell*)((cell)->sc.sch))->ul.schSpfc)
46 #define RG_GET_SC1_CELL_DL(cell) \
47              ((RgSchSc1DlCell *)((RgSchCmnCell*)((cell)->sc.sch))->dl.schSpfc)
48
49 #define RG_GET_SC1_UE_DL(ue, cell) \
50              ((RgSchSc1DlUe *)((RgSchCmnUe *)((ue->cellInfo[ue->cellIdToCellIdxMap\
51                             [RG_SCH_CELLINDEX(cell)]])->sch))->dl.schSpfc)
52 #define RG_GET_SC1_UE_UL(ue, cell) \
53              ((RgSchSc1UlUe *)((RgSchCmnUe *)((ue->cellInfo[ue->cellIdToCellIdxMap\
54                  [RG_SCH_CELLINDEX(cell)]])->sch))->ul.schSpfc)
55
56 #define RG_GET_SC1_SVC_DL(_ue,_svc,_cell) RG_SCH_CMN_GET_LC_SCH_SPFC(_ue,_svc,_cell)
57
58 #define RG_GET_SC1_HQP_DL(hqP) \
59              ((RgSchSc1DlHqProc *)((RgSchCmnDlHqProc *)((hqP)->sch))->schSpfc)
60
61 #define RG_SC1_SVC_HAS_DATA(_svc,_cell) \
62    (((RgSchSc1DlSvc *)(((RgSchCmnDlSvc *)(_svc->sch))->schSpfc[\
63                        svc->ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(_cell)]]))->effMbr != 0)
64
65
66 #define RG_SC1_ISGBRPRIO(qciPrio) ((qciPrio) >=2 && (qciPrio) <= 5)
67
68 /* SC1 configuration error types */ 
69 #define RGSCHERR_SCH_SC1_DL_CFG (RGSCHERR_SCH_CFG + 10)
70 #define RGSCHERR_SCH_SC1_UL_CFG (RGSCHERR_SCH_CFG + 11)
71
72 /* Scheduler1 fixed params */
73 #define RG_SC1_UL_INVALID_QID      255
74 #define RG_SC1_QCIPRIOVAL_MAX      9
75 #define RG_SC1_QCIPRIOVAL_MIN      1
76 #define RG_SC1_UL_CONT_RES_QID     0
77 #define RG_SC1_MAX_DL_AMBR         0xffffffff
78 #define RG_SC1_UL_NUM_Q            (RG_SCH_CMN_NUM_QCI + 1)
79 #define RG_SC1_DL_NUM_Q            (RG_SCH_CMN_MAX_PRIO + 1) 
80 #ifdef RG_UNUSED
81 #define RG_SC1_UL_INVALID_BETA8    0xffff
82 #endif
83 #define RG_SCH_SC1_DL_GBR_PRIO_START     1
84 #define RG_SCH_SC1_DL_GBR_PRIO_END       4
85 #define RG_SCH_SC1_DL_PRIOS              RG_SCH_CMN_MAX_PRIO + 1
86
87 #ifdef __cplusplus
88 }
89 #endif
90 #endif /* __RGSCHSC1H__ */
91
92 /********************************************************************30**
93
94          End of file
95 **********************************************************************/