[Epic-ID: ODUHIGH-461][Task-ID: ODUHIGH-468]Unused files and functions removed/disabled
[o-du/l2.git] / src / 5gnrsch / sch_msg_router.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:     NR-SCH layer
22   
23      Type:     C source file
24   
25      Desc:     C source code SSI Interface Implementation
26   
27      File:     sch_msg_router.c
28   
29 **********************************************************************/
30
31 #if 0 /*MAC-SCH Interface working as Tightly Coupled thus Commenting*/
32
33 /** @file sch_msg_router.c
34 @brief This file contains the implementation of callback functions 
35 registered with SSI during the LTE MAC Task initialization.
36 */
37 /* header include files -- defines (.h) */
38 #include "common_def.h"
39 #include "tfu.h"           /* RGU defines */
40 #include "lrg.h"           /* layer management defines for LTE-MAC */
41 #include "rgr.h"           /* layer management defines for LTE-MAC */
42 #include "rgm.h"           /* layer management defines for LTE-MAC */
43 #include "rg_env.h"        /* customisable defines and macros for LTE-MAC */
44 #include "rg_sch_err.h"        /* defines and macros for Scheduler */
45 #include "rg_sch_inf.h"        /* defines and macros for Scheduler */
46 #include "rg_sch.h"        /* defines and macros for Scheduler */
47
48
49 /* header/extern include files (.x) */
50 #include "tfu.x"           /* RGU types */
51 #include "lrg.x"           /* layer management typedefs for MAC */
52 #include "rgr.x"           /* layer management typedefs for MAC */
53 #include "rgm.x"           /* layer management typedefs for MAC */
54 #include "rg_sch_inf.x"        /* typedefs for Scheduler */
55 #include "rg_sch.x"        /* typedefs for Scheduler */
56 #include "mac_sch_interface.h"
57
58 #ifdef CALL_FLOW_DEBUG_LOG
59 /*
60 * @brief
61 *
62 * Function:
63 *   name : callFlowSchActvTsk 
64 *
65 *  @b Description:
66 *  Function used to print values of src, dest, message
67 *  received at the layer
68 *
69 *  @param[in] pst   - Pst Structure
70 *
71 *  @return void
72 */
73
74 void callFlowSchActvTsk(Pst *pst)    
75 {
76    char sourceTask[50];
77    char destTask[50]="ENTSCH";
78    char message[100];
79
80    switch(pst->srcEnt)
81    {
82       case ENTMAC: /* When MAC sends a msg to Scheduler instance */
83          {
84             strcpy(sourceTask,"ENTMAC");
85             switch(pst->event)
86             {
87 #ifdef LCSCH
88                case EVTINFDEDBOUPDTREQ:
89                   strcpy(message,"EVTINFDEDBOUPDTREQ");
90                   break;
91                case EVTINFCMNBOUPDTREQ:
92                   strcpy(message,"EVTINFCMNBOUPDTREQ");
93                   break;   
94                case EVTINFSFRECPIND:
95                   strcpy(message,"EVTINFSFRECPIND");
96                   break;
97                   /*Fix: start: Inform UE delete to scheduler*/
98                case EVTINFUEDELIND:
99                   strcpy(message,"EVTINFUEDELIND");
100                   break;
101                   /*Fix: end: Inform UE delete to scheduler*/
102 #ifdef LTE_L2_MEAS
103                case EVTINFL2MEASCFM:
104                   strcpy(message,"EVTINFL2MEASCFM");
105                   break;
106                case EVTINFL2MEASSTOPCFM:
107                   strcpy(message,"EVTINFL2MEASSTOPCFM");
108                   break;
109 #endif
110 #endif            
111                case EVENT_SLOT_IND_TO_SCH:
112                   strcpy(message,"EVENT_SLOT_IND_TO_SCH");
113                   break;
114                default:
115                   strcpy(message,"Invalid Event");
116                   break;
117             }
118             break;
119          }
120       default:
121          strcpy(sourceTask,"Invalid Source Entity Id");
122          break;
123    }
124    DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message);
125 }
126 #endif
127
128 /**
129  * @brief Task Activation callback function. 
130  *
131  * @details
132  *
133  *     Function : schActvTsk
134  *     
135  *     Primitives invoked by MAC's users/providers through
136  *     a loosely coupled interface arrive here by means of 
137  *     SSI's message handling. This API is registered with
138  *     SSI during the Task Registration of MAC.
139  *     
140  *  @param[in]  Pst     *pst, post structure of the Primitive.     
141  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
142  *  @param[in]  Reason reason.
143  *  @return  S16
144  *      -# ROK
145  **/
146 S16 schActvTsk
147 (
148 Pst     *pst,                       /* post structure       */
149 Buffer  *mBuf                       /* message buffer       */
150 )
151 {
152
153 #ifdef CALL_FLOW_DEBUG_LOG
154    callFlowSchActvTsk(pst);
155 #endif
156
157    switch(pst->srcEnt)
158    {
159       /* The originator of this message is the stack manager,
160        * unpack and go to the respective primitive processing function */
161       case ENTSM:
162          switch(pst->event)
163          {
164 #ifdef LCRGMILRG
165             case EVTMACSCHGENCFGREQ:
166                /* Process a config. request */
167                cmUnpkLrgSchCfgReq(SchProcGenCfgReq, pst, mBuf);
168                break;
169             case EVTLRGSCHSTAIND:
170                /* Process a control request */
171                cmUnpkLrgSchStaInd(RgMiLrgSchStaInd, pst, mBuf);
172                break;
173 #ifdef LTE_L2_MEAS
174             case EVTLRGSCHL2MEASREQ:
175                /* Process L2 Measurement request */
176                cmUnpkLrgSchL2MeasReq(RgMiLrgSchL2MeasReq, pst, mBuf);
177                break;
178             case EVTLRGSCHL2MEASSTOPREQ:
179                /* Process L2 Measurement Stop request */
180                cmUnpkLrgSchL2MeasStopReq(RgMiLrgSchL2MeasStopReq, pst, mBuf);
181                break;
182             case EVTLRGSCHL2MEASSENDREQ:
183                /* Process L2 Measurement Send  request */
184                cmUnpkLrgSchL2MeasSendReq(RgMiLrgSchL2MeasSendReq, pst, mBuf);
185                break;
186 #endif
187 #endif /* LCRGMILRG */
188             default:
189                RGSCH_FREE_MSG(mBuf);
190                break;
191          }
192          break;
193       case ENTMAC: /* When MAC sends a msg to Scheduler instance */
194          switch(pst->event)
195          {
196 #ifdef LCSCH
197             case EVTINFDEDBOUPDTREQ:
198                cmUnpkMacSchDedBoUpdtReq(RgMacSchDedBoUpdtReq, pst, mBuf);
199                break;
200             case EVTINFCMNBOUPDTREQ:
201                cmUnpkMacSchCmnBoUpdtReq(RgMacSchCmnBoUpdtReq, pst, mBuf);
202                break;   
203             case EVTINFSFRECPIND:
204                cmUnpkMacSchSfRecpInd(RgMacSchSfRecpInd, pst, mBuf);
205                break;
206                /*Fix: start: Inform UE delete to scheduler*/
207             case EVTINFUEDELIND:
208                cmUnpkMacSchUeDelInd(RgMacSchUeDelInd, pst, mBuf);
209                break;
210             /*Fix: end: Inform UE delete to scheduler*/
211 #ifdef LTE_L2_MEAS
212             case EVTINFL2MEASCFM:
213                cmUnpkMacSchL2MeasCfm(RgMacSchL2MeasCfm, pst, mBuf);
214                break;
215             case EVTINFL2MEASSTOPCFM:
216                cmUnpkMacSchL2MeasCfm(RgMacSchL2MeasStopCfm, pst, mBuf);
217                break;
218 #endif
219 #endif            
220             case EVENT_SLOT_IND_TO_SCH:
221                unpackMacSchSlotInd(MacSchSlotInd, pst, mBuf);
222                break;
223             default:
224                RGSCH_FREE_MSG(mBuf);
225                break;
226          }
227          break;
228       default:
229           RGSCH_FREE_MSG(mBuf);
230           break;
231    }
232    ODU_EXIT_TASK();
233    return ROK;
234 }/* end of schActvTsk */
235
236 #endif
237 \f
238 /**********************************************************************
239  
240          End of file
241 **********************************************************************/