[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-440] Sending and Handling of PAGE REQ at MAC
[o-du/l2.git] / src / 5gnrmac / mac_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:     LTE-MAC layer
22   
23      Type:     C source file
24   
25      Desc:     C source code SSI Interface Implementation
26   
27      File:     mac_msg_router.c
28   
29 **********************************************************************/
30
31 /** @file mac_msg_router.c
32 @brief This file contains the implementation of callback functions 
33 registered with SSI during the LTE MAC Task initialization.
34 */
35 /* header include files -- defines (.h) */
36 #include "common_def.h"
37 #include "rgu.h"           /* RGU defines */
38 #include "tfu.h"           /* RGU defines */
39 #include "lrg.h"           /* layer management defines for LTE-MAC */
40 #include "rgr.h"           /* layer management defines for LTE-MAC */
41 #include "crg.h"           /* CRG interface includes */
42 #include "rg_sch_inf.h"    /* SCH interface includes */
43 #include "rg_prg.h"        /* PRG interface includes */
44 #include "rg_env.h"        /* customisable defines and macros for LTE-MAC */
45 #include "rg.h"            /* defines and macros for MAC */
46 #include "rgr.h"            /* defines and macros for SCH */
47
48
49 /* header/extern include files (.x) */
50 #include "rgu.x"           /* RGU types */
51 #include "tfu.x"           /* RGU types */
52 #include "lrg.x"           /* layer management typedefs for MAC */
53 #include "rgr.x"           /* layer management typedefs for MAC */
54 #include "crg.x"           /* CRG interface typedes */
55 #include "rg_sch_inf.x"    /* SCH interface typedefs */
56 #include "rg_prg.x"        /*PRG interface includes*/
57 #include "du_app_mac_inf.h"
58 #include "rg.x"            /* typedefs for MAC */
59 #include "rlc_mac_inf.h"
60 #include "lwr_mac_upr_inf.h"
61
62 /**
63  * @brief Task Activation callback function Entity SM. 
64  *
65  * @details
66  *
67  *     Function : rgHdlSMEvents
68  *     
69  *     Process Messages received from Entity SM
70  *     
71  *  @param[in]  Pst     *pst, Post structure of the primitive.     
72  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
73  *  @param[in]  Reason reason.
74  *  @return  void
75  **/
76 static inline void rgHdlSMEvents
77 (
78 Pst     *pst,                       /* post structure       */
79 Buffer  *mBuf                       /* message buffer       */
80 )
81 {
82    switch(pst->event)
83    {
84 #ifdef LCRGMILRG
85       case EVTLRGCFGREQ:
86          /* Process a config. request */
87          cmUnpkLrgCfgReq(RgMiLrgCfgReq, pst, mBuf);
88          break;
89       case EVTMACSCHGENCFGREQ:
90          /* Process a config. request */
91          cmUnpkLrgSchCfgReq(MacSchGenCfgReq, pst, mBuf);
92          break;
93       case EVTLRGCNTRLREQ:
94          /* Process a control request */
95          cmUnpkLrgCntrlReq(RgMiLrgCntrlReq, pst, mBuf);
96          break;
97       case EVTLRGSSTAREQ:
98          /* Process a status request  */
99          cmUnpkLrgStaReq(RgMiLrgStaReq, pst, mBuf);
100          break;
101       case EVTLRGSTSREQ:
102          /* Process a statistics request */
103          cmUnpkLrgStsReq(RgMiLrgStsReq, pst, mBuf);
104          break;
105 #endif /* LCRGMILRG */
106       case EVENT_MAC_CELL_CONFIG_REQ:
107          {
108             /* Process MAC cell config */
109             unpackDuMacCellCfg(MacProcCellCfgReq, pst, mBuf);
110             break;
111          }
112       case EVENT_MAC_CELL_START:
113          {
114             /* Process MAC cell start request */
115             unpackMacCellStart(MacProcCellStart, pst, mBuf);
116             break;
117          }
118       case EVENT_MAC_CELL_STOP:
119          {
120             /* Process MAC cell stop request */
121             unpackMacCellStop(MacProcCellStop, pst, mBuf);
122             break;
123          }
124       case EVENT_MAC_DL_CCCH_IND:
125          {
126             /* Process DL CCCH Ind */
127             unpackMacDlCcchInd(MacProcDlCcchInd, pst, mBuf);
128             break;
129          }
130       case EVENT_MAC_UE_CREATE_REQ:
131          {
132             /* Process Ue Create Request */
133             unpackMacUeCreateReq(MacProcUeCreateReq, pst, mBuf);
134             break;
135          }
136       case EVENT_MAC_UE_RECONFIG_REQ:
137          {
138             /* Process Ue Reconfig Request */
139             unpackMacUeReconfigReq(MacProcUeReconfigReq, pst, mBuf);
140             break;
141          }
142       case EVENT_MAC_UE_DELETE_REQ:
143          {
144             /* Process UE Delete Request */  
145             unpackMacUeDeleteReq(MacProcUeDeleteReq, pst, mBuf);
146             break;
147          }
148       case EVENT_MAC_CELL_DELETE_REQ:
149          {
150             /* Process Cell Delete Request */
151             unpackMacCellDeleteReq(MacProcCellDeleteReq, pst, mBuf);
152             break;
153          }
154       case EVENT_MAC_SLICE_CFG_REQ:
155          {
156             /* Process Slice Configuration Request */
157             unpackMacSliceCfgReq(MacProcSliceCfgReq, pst, mBuf);
158             break;
159          }
160       case EVENT_MAC_SLICE_RECFG_REQ:
161          {
162             /* Process Slice Reconfiguration Request */
163             unpackMacSliceCfgReq(MacProcSliceReCfgReq, pst, mBuf);
164             break;
165          }
166       case EVENT_MAC_RACH_RESOURCE_REQ:
167          {
168             /* Process Rach Resource Request */
169             unpackMacRachRsrcReq(MacProcRachRsrcReq, pst, mBuf);
170             break;
171          }
172       case EVENT_MAC_DL_PCCH_IND:
173          {
174             /* Process Pcch indication */
175             unpackMacDlPcchInd(MacProcDlPcchInd, pst, mBuf);
176             break;
177          }
178
179       default:
180          RG_FREE_MSG(mBuf);
181          break;
182    }
183 }
184
185
186 /**
187  * @brief Task Activation callback function Entity NH. 
188  *
189  * @details
190  *
191  *     Function : rgHdlNHEvents
192  *     
193  *     Process Messages received from Entity NH
194  *     
195  *  @param[in]  Pst     *pst, Post structure of the primitive.     
196  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
197  *  @param[in]  Reason reason.
198  *  @return  void
199  **/
200 static inline void rgHdlNHEvents
201 (
202 Pst     *pst,                       /* post structure       */
203 Buffer  *mBuf                       /* message buffer       */
204 )
205 {
206    switch(pst->event)
207    {
208 #ifdef LCRGUICRG
209       case EVTCRGBNDREQ:
210          cmUnpkCrgBndReq(RgUiCrgBndReq, pst, mBuf);
211          break;
212       case EVTCRGUBNDREQ:
213          cmUnpkCrgUbndReq(RgUiCrgUbndReq, pst, mBuf);
214          break;
215       case EVTCRGCFGREQ:
216          cmUnpkCrgCfgReq(RgUiCrgCfgReq, pst, mBuf);
217          break;
218 #endif            
219       default:
220          RG_FREE_MSG(mBuf);
221          break;
222    }
223 }
224
225 /**
226  * @brief Task Activation callback function Entity KW. 
227  *
228  * @details
229  *
230  *     Function : rgHdlKWEvents
231  *     
232  *     Process Messages received from Entity KW
233  *     
234  *  @param[in]  Pst     *pst, Post structure of the primitive.     
235  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
236  *  @param[in]  Reason reason.
237  *  @return  void
238  **/
239 static inline void rgHdlKWEvents
240 (
241 Pst     *pst,                       /* post structure       */
242 Buffer  *mBuf                       /* message buffer       */
243 )
244 {
245    switch(pst->event)
246    {
247 #ifdef LCRGUIRGU
248       case EVTRGUBNDREQ:
249          cmUnpkRguBndReq(RgUiRguBndReq, pst, mBuf);
250          break;
251       case EVTRGUUBNDREQ:
252          cmUnpkRguUbndReq(RgUiRguUbndReq, pst, mBuf);
253          break;
254       case EVENT_DL_DATA_TO_MAC:
255          unpackRlcDlData(MacProcRlcDlData, pst, mBuf);
256          break;
257       case EVENT_BO_STATUS_TO_MAC:
258          unpackRlcBoStatus(MacProcRlcBoStatus, pst, mBuf);
259          break;
260 #ifdef LTE_L2_MEAS
261
262       case EVTRGUL2MULTHRPMEASREQ:
263          cmUnpkRguL2MUlThrpMeasReq(RgUiRguL2MUlThrpMeasReq, pst,mBuf);
264          break;
265
266 #endif
267 #endif            
268       default:
269          RG_FREE_MSG(mBuf);
270          break;
271    }
272 }
273
274 /**
275  * @brief Task Activation callback function Entity TF. 
276  *
277  * @details
278  *
279  *     Function : rgHdlTFEvents
280  *     
281  *     Process Messages received from Entity TF
282  *     
283  *  @param[in]  Pst     *pst, Post structure of the primitive.     
284  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
285  *  @param[in]  Reason reason.
286  *  @return  void
287  **/
288 static inline void rgHdlTFEvents
289 (
290 Pst     *pst,                       /* post structure       */
291 Buffer  *mBuf                       /* message buffer       */
292 )
293 {
294    switch(pst->event)
295    {
296       case EVENT_SLOT_IND_TO_MAC:
297          unpackSlotInd(fapiMacSlotInd, pst, mBuf);
298          break;
299       case EVENT_STOP_IND_TO_MAC:
300          unpackStopInd(fapiMacStopInd, pst, mBuf);
301          break;
302       case EVENT_RACH_IND_TO_MAC:
303          unpackRachInd(fapiMacRachInd, pst, mBuf);
304          break;
305       case EVENT_CRC_IND_TO_MAC:
306          unpackCrcInd(fapiMacCrcInd, pst, mBuf);
307          break;
308       case EVENT_RX_DATA_IND_TO_MAC:
309          unpackRxDataInd(fapiMacRxDataInd, pst, mBuf);
310          break;
311       case EVENT_UCI_IND_TO_MAC:
312          unpackUciInd(FapiMacUciInd, pst, mBuf);
313          break;
314       default:
315          RG_FREE_MSG(mBuf);
316          break;
317    }
318 }
319
320
321 /**
322  * @brief Task Activation callback function Entity RG SCH. 
323  *
324  * @details
325  *
326  *     Function : rgHdlRGEvents
327  *     
328  *     Process Messages received from Entity RG SCH
329  *     
330  *  @param[in]  Pst     *pst, Post structure of the primitive.     
331  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
332  *  @param[in]  Reason reason.
333  *  @return  void
334  **/
335 static inline void rgHdlRGEvents
336 (
337 Pst     *pst,                       /* post structure       */
338 Buffer  *mBuf                       /* message buffer       */
339 )
340 {
341    switch(pst->event)
342    {
343 #ifdef LCRG
344       case EVTINFCELLREGREQ:
345          cmUnpkSchMacCellRegReq(RgSchMacCellRegReq, pst, mBuf);
346          break;
347       case EVTINFSFALLOCREQ:
348          cmUnpkSchMacSfAllocReq(RgSchMacSfAllocReq, pst, mBuf);
349          break;
350       case EVTINFRLSHQREQ:
351          cmUnpkSchMacRlsHqReq(RgSchMacRlsHqReq, pst, mBuf);
352          break;
353       case EVTINFHQENTRESET:
354          cmUnpkSchMacRstHqEntReq(RgSchMacRstHqEntReq, pst, mBuf);
355          break;
356       case EVTINFRLSRNTIREQ:
357          cmUnpkSchMacRlsRntiReq(RgSchMacRlsRntiReq, pst, mBuf);
358          break;
359 #ifdef LTEMAC_SPS
360       case EVTINFSPSLCREG:
361          cmUnpkSchMacSpsLcRegReq(RgSchMacSpsLcRegReq, pst, mBuf);
362          break;
363       case EVTINFSPSLCDEREG:
364          cmUnpkSchMacSpsLcDeregReq(RgSchMacSpsLcDeregReq, pst, mBuf);
365          break;
366       case EVTINFSPSRESET:
367          cmUnpkSchMacUlSpsResetReq(RgSchMacUlSpsResetReq, pst, mBuf);
368          break;
369 #endif /* LTEMAC_SPS */
370 #ifdef LTE_L2_MEAS
371       case EVTINFL2MEASREQ:
372          cmUnpkSchMacL2MeasReq(RgSchMacL2MeasReq, pst, mBuf);
373          break;
374       case EVTINFL2MEASSENDREQ :
375          cmUnpkSchMacL2MeasSendReq(RgSchMacL2MeasSendReq, pst , mBuf);
376          break;
377       case EVTINFL2MEASSTOPREQ:
378          cmUnpkSchMacL2MeasStopReq(RgSchMacL2MeasStopReq, pst , mBuf);
379          break;
380 #endif/* LTE_L2_MEAS */
381       case EVTINFLCGREG:
382          cmUnpkSchMacLcgRegReq(RgSchMacLcgRegReq, pst, mBuf);
383          break;
384 #endif            
385 #if defined(LTE_ADV) && defined(LCPRG)
386       case EVTPRGUESCELLCFGREQ:
387       {
388          cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgPMacSMacUeSCellCfgReq, pst, mBuf);
389       }
390       break;
391       case EVTPRGUESCELLCFGCFM:
392       case EVTPRGUESCELLLCHMODCFM:
393       case EVTPRGUESCELLLCHDELCFMDEL:
394       case EVTPRGUESCELLLCHADDCFM:
395       {
396          cmUnpkPrgSMacPMacCfgCfm(RgPrgSMacPMacCfgCfm, pst, mBuf);
397       }
398       break;
399       case EVTPRGUESCELLDELREQ:
400       {
401          cmUnpkPrgPMacSMacUeSCellDelReq(RgPrgPMacSMacUeSCellDelReq, pst, mBuf);
402       }
403       break;
404       case EVTPRGUESCELLLCHMODREQ:
405       {
406          cmUnpkPrgPMacSMacUeSCellLchModReq(RgPrgPMacSMacUeSCellLchModReq, pst,
407                                            mBuf);
408       }
409       break;
410       case EVTPRGUESCELLLCHDELREQ:
411       {
412          cmUnpkPrgPMacSMacUeSCellLchDelReq(RgPrgPMacSMacUeSCellLchDelReq, pst,
413                                            mBuf);
414       }
415       break;
416       case EVTPRGUESCELLLCHADDREQ:
417       {
418          cmUnpkPrgPMacSMacUeSCellLchAddReq(RgPrgPMacSMacUeSCellLchAddReq, pst,
419                                            mBuf);
420       }
421       break;
422
423 #endif
424       default:
425       {
426          RG_FREE_MSG(mBuf);
427          break;
428       }
429
430    }
431 }
432
433 /**
434 * @brief Function prints src, dest, msg infor about all the msgs that received.
435 *
436 * @details
437 *
438 *     Function : callFlowRgActvTsk 
439 *
440 *     Function prints src, dest, msg infor about all the msgs that received
441 *
442 *  @param[in]  Pst     *pst, Post structure of the primitive.
443 *
444 *  @return  void
445 **/
446
447 void callFlowRgActvTsk(Pst *pst)
448 {
449    char sourceTask[50];
450    char destTask[50]="ENTMAC";
451    char message[100];
452
453    switch(pst->srcEnt)
454    {
455       case ENTDUAPP:
456          {
457             strcpy(sourceTask,"ENTDUAPP");
458             switch(pst->event)
459             {
460 #ifdef LCRGMILRG
461                case EVTLRGCFGREQ:
462                   strcpy(message,"EVTLRGCFGREQ");
463                   break;
464                case EVTMACSCHGENCFGREQ:
465                   strcpy(message,"EVTMACSCHGENCFGREQ");
466                   break;
467                case EVTLRGCNTRLREQ:
468                   strcpy(message,"EVTLRGCNTRLREQ");
469                   break;
470                case EVTLRGSSTAREQ:
471                   strcpy(message,"EVTLRGSSTAREQ");
472                   break;
473                case EVTLRGSTSREQ:
474                   strcpy(message,"EVTLRGSTSREQ");
475                   break;
476 #endif /* LCRGMILRG */
477                case EVENT_MAC_CELL_CONFIG_REQ:
478                   strcpy(message,"EVENT_MAC_CELL_CONFIG_REQ");
479                   break;
480                case EVENT_MAC_CELL_START:
481                   strcpy(message,"EVENT_MAC_CELL_START");
482                   break;
483                case EVENT_MAC_CELL_STOP:
484                   strcpy(message,"EVENT_MAC_CELL_STOP");
485                   break;
486                case EVENT_MAC_DL_CCCH_IND:
487                   strcpy(message,"EVENT_MAC_DL_CCCH_IND");
488                   break;
489                case EVENT_MAC_UE_CREATE_REQ:
490                   strcpy(message,"EVENT_MAC_UE_CREATE_REQ");
491                   break;
492                case EVENT_MAC_UE_RECONFIG_REQ:
493                   strcpy(message,"EVENT_MAC_UE_RECONFIG_REQ");
494                   break;
495                case EVENT_MAC_UE_DELETE_REQ:
496                   strcpy(message,"EVENT_MAC_UE_DELETE_REQ");
497                   break;
498                case EVENT_MAC_CELL_DELETE_REQ:
499                   strcpy(message,"EVENT_MAC_CELL_DELETE_REQ");
500                   break;
501                case EVENT_MAC_SLICE_CFG_REQ:
502                   strcpy(message,"EVENT_MAC_SLICE_CFG_REQ");
503                   break;
504                case EVENT_MAC_SLICE_RECFG_REQ:
505                   strcpy(message,"EVENT_MAC_SLICE_RECFG_REQ");
506                   break;
507                default:
508                   strcpy(message,"Invalid Event");
509                   break;
510             }
511             break;
512          }
513       case ENTRLC:
514          { 
515             strcpy(sourceTask,"ENTRLC");
516             switch(pst->event)
517             {
518 #ifdef LCRGUIRGU
519                case EVTRGUBNDREQ:
520                   strcpy(message,"EVTRGUBNDREQ");
521                   break;
522                case EVTRGUUBNDREQ:
523                   strcpy(message,"EVTRGUUBNDREQ");
524                   break;
525                case EVENT_DL_DATA_TO_MAC:
526                   strcpy(message,"EVENT_DL_DATA_TO_MAC");
527                   break;
528                case EVENT_BO_STATUS_TO_MAC:
529                   strcpy(message,"EVENT_BO_STATUS_TO_MAC");
530                   break;
531 #endif
532                default:
533                   strcpy(message,"Invalid Event");
534                   break;
535             }
536
537             break;
538          }
539       case ENTLWRMAC:
540          {
541             strcpy(sourceTask,"ENTLWRMAC");
542             switch(pst->event)
543             {
544                case EVENT_SLOT_IND_TO_MAC:
545                   strcpy(message,"EVENT_SLOT_IND_TO_MAC");
546                   break;
547                case EVENT_STOP_IND_TO_MAC:
548                   strcpy(message,"EVENT_STOP_IND_TO_MAC");
549                   break;
550                case EVENT_RACH_IND_TO_MAC:
551                   strcpy(message,"EVENT_RACH_IND_TO_MAC");
552                   break;
553                case EVENT_CRC_IND_TO_MAC:
554                   strcpy(message,"EVENT_CRC_IND_TO_MAC");
555                   break;
556                case EVENT_RX_DATA_IND_TO_MAC:
557                   strcpy(message,"EVENT_RX_DATA_IND_TO_MAC");
558                   break;
559                case EVENT_UCI_IND_TO_MAC:
560                   strcpy(message,"EVENT_UCI_IND_TO_MAC");
561                   break;
562                default:
563                   strcpy(message,"Invalid Event");
564                   break;
565             }
566
567             break;
568          }
569       case ENTMAC: /* When scheduler instance sends msg to MAC */
570          {
571             strcpy(sourceTask,"ENTMAC");
572             switch(pst->event)
573             {
574 #ifdef LCRG
575                case EVTINFCELLREGREQ:
576                   strcpy(message,"EVTINFCELLREGREQ");
577                   break;
578                case EVTINFSFALLOCREQ:
579                   strcpy(message,"EVTINFSFALLOCREQ");
580                   break;
581                case EVTINFRLSHQREQ:
582                   strcpy(message,"EVTINFRLSHQREQ");
583                   break;
584                case EVTINFHQENTRESET:
585                   strcpy(message,"EVTINFHQENTRESET");
586                   break;
587                case EVTINFRLSRNTIREQ:
588                   strcpy(message,"EVTINFRLSRNTIREQ");
589                   break;
590 #ifdef LTEMAC_SPS
591                case EVTINFSPSLCREG:
592                   strcpy(message,"EVTINFSPSLCREG");
593                   break;
594                case EVTINFSPSLCDEREG:
595                   strcpy(message,"EVTINFSPSLCDEREG");
596                   break;
597                case EVTINFSPSRESET:
598                   strcpy(message,"EVTINFSPSRESET");
599                   break;
600 #endif /* LTEMAC_SPS */
601                case EVTINFLCGREG:
602                   strcpy(message,"EVTINFLCGREG");
603                   break;
604 #endif            
605 #if defined(LTE_ADV) && defined(LCPRG)
606                case EVTPRGUESCELLCFGREQ:
607                   strcpy(message,"EVTPRGUESCELLCFGREQ");
608                   break;
609                case EVTPRGUESCELLCFGCFM:
610                   strcpy(message,"EVTPRGUESCELLCFGCFM");
611                   break;
612                case EVTPRGUESCELLLCHMODCFM:
613                   strcpy(message,"EVTPRGUESCELLLCHMODCFM");
614                   break;
615                case EVTPRGUESCELLLCHDELCFMDEL:
616                   strcpy(message,"EVTPRGUESCELLLCHDELCFMDEL");
617                   break;
618                case EVTPRGUESCELLLCHADDCFM:
619                   strcpy(message,"EVTPRGUESCELLLCHADDCFM");
620                   break;
621                case EVTPRGUESCELLDELREQ:
622                   strcpy(message,"EVTPRGUESCELLDELREQ");
623                   break;
624                case EVTPRGUESCELLLCHMODREQ:
625                   strcpy(message,"EVTPRGUESCELLLCHMODREQ");
626                   break;
627                case EVTPRGUESCELLLCHDELREQ:
628                   strcpy(message,"EVTPRGUESCELLLCHDELREQ");
629                   break;
630                case EVTPRGUESCELLLCHADDREQ:
631                   strcpy(message,"EVTPRGUESCELLLCHADDREQ");
632                   break;
633
634 #endif
635                default:
636                   strcpy(message,"Invalid Event");
637                   break;
638             }
639             break;
640          }
641
642       default:
643          {
644             strcpy(sourceTask,"Invalid Source Entity Id");
645             break;
646          }
647    }
648    DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message);
649 }
650
651 \f
652 /**********************************************************************
653 \f
654 /**
655  * @brief Task Activation callback function. 
656  *
657  * @details
658  *
659  *     Function : rgActvTsk
660  *     
661  *     Primitives invoked by MAC's users/providers through
662  *     a loosely coupled interface arrive here by means of 
663  *     SSI's message handling. This API is registered with
664  *     SSI during the Task Registration of MAC.
665  *     
666  *  @param[in]  Pst     *pst, Post structure of the primitive.     
667  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
668  *  @param[in]  Reason reason.
669  *  @return  S16
670  *      -# ROK
671  **/
672 S16 rgActvTsk
673 (
674 Pst     *pst,                       /* post structure       */
675 Buffer  *mBuf                       /* message buffer       */
676 )
677 {
678
679 #ifdef CALL_FLOW_DEBUG_LOG
680    callFlowRgActvTsk(pst);
681 #endif
682
683    switch(pst->srcEnt)
684    {
685       /* The originator of this message is the stack manager,
686        * unpack and go to the respective primitive processing function */
687       case ENTDUAPP:
688           rgHdlSMEvents(pst, mBuf);
689            break;
690       case ENTNH:
691           rgHdlNHEvents(pst, mBuf);
692           break;
693       case ENTRLC:
694           rgHdlKWEvents(pst, mBuf);
695           break;
696       case ENTLWRMAC:
697           rgHdlTFEvents(pst, mBuf);
698           break;
699       case ENTMAC: /* When scheduler instance sends msg to MAC */
700           rgHdlRGEvents(pst, mBuf);
701           break;
702        default:
703           RG_FREE_MSG(mBuf);
704           break;
705    }
706    ODU_EXIT_TASK();
707    return ROK;
708 }/* end of rgActvTsk */
709
710 \f
711 /**********************************************************************
712  
713          End of file
714 **********************************************************************/