[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-448]RACH resource release at target DU and...
[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_RACH_RESOURCE_REL:
173          {
174             /* Process Rach Resource Release */
175             unpackMacRachRsrcRel(MacProcRachRsrcRel, pst, mBuf);
176             break;
177          }
178       case EVENT_MAC_DL_PCCH_IND:
179          {
180             /* Process Pcch indication */
181             unpackMacDlPcchInd(MacProcDlPcchInd, pst, mBuf);
182             break;
183          }
184
185       default:
186          RG_FREE_MSG(mBuf);
187          break;
188    }
189 }
190
191
192 /**
193  * @brief Task Activation callback function Entity NH. 
194  *
195  * @details
196  *
197  *     Function : rgHdlNHEvents
198  *     
199  *     Process Messages received from Entity NH
200  *     
201  *  @param[in]  Pst     *pst, Post structure of the primitive.     
202  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
203  *  @param[in]  Reason reason.
204  *  @return  void
205  **/
206 static inline void rgHdlNHEvents
207 (
208 Pst     *pst,                       /* post structure       */
209 Buffer  *mBuf                       /* message buffer       */
210 )
211 {
212    switch(pst->event)
213    {
214 #ifdef LCRGUICRG
215       case EVTCRGBNDREQ:
216          cmUnpkCrgBndReq(RgUiCrgBndReq, pst, mBuf);
217          break;
218       case EVTCRGUBNDREQ:
219          cmUnpkCrgUbndReq(RgUiCrgUbndReq, pst, mBuf);
220          break;
221       case EVTCRGCFGREQ:
222          cmUnpkCrgCfgReq(RgUiCrgCfgReq, pst, mBuf);
223          break;
224 #endif            
225       default:
226          RG_FREE_MSG(mBuf);
227          break;
228    }
229 }
230
231 /**
232  * @brief Task Activation callback function Entity KW. 
233  *
234  * @details
235  *
236  *     Function : rgHdlKWEvents
237  *     
238  *     Process Messages received from Entity KW
239  *     
240  *  @param[in]  Pst     *pst, Post structure of the primitive.     
241  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
242  *  @param[in]  Reason reason.
243  *  @return  void
244  **/
245 static inline void rgHdlKWEvents
246 (
247 Pst     *pst,                       /* post structure       */
248 Buffer  *mBuf                       /* message buffer       */
249 )
250 {
251    switch(pst->event)
252    {
253 #ifdef LCRGUIRGU
254       case EVTRGUBNDREQ:
255          cmUnpkRguBndReq(RgUiRguBndReq, pst, mBuf);
256          break;
257       case EVTRGUUBNDREQ:
258          cmUnpkRguUbndReq(RgUiRguUbndReq, pst, mBuf);
259          break;
260       case EVENT_DL_DATA_TO_MAC:
261          unpackRlcDlData(MacProcRlcDlData, pst, mBuf);
262          break;
263       case EVENT_BO_STATUS_TO_MAC:
264          unpackRlcBoStatus(MacProcRlcBoStatus, pst, mBuf);
265          break;
266 #ifdef LTE_L2_MEAS
267
268       case EVTRGUL2MULTHRPMEASREQ:
269          cmUnpkRguL2MUlThrpMeasReq(RgUiRguL2MUlThrpMeasReq, pst,mBuf);
270          break;
271
272 #endif
273 #endif            
274       default:
275          RG_FREE_MSG(mBuf);
276          break;
277    }
278 }
279
280 /**
281  * @brief Task Activation callback function Entity TF. 
282  *
283  * @details
284  *
285  *     Function : rgHdlTFEvents
286  *     
287  *     Process Messages received from Entity TF
288  *     
289  *  @param[in]  Pst     *pst, Post structure of the primitive.     
290  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
291  *  @param[in]  Reason reason.
292  *  @return  void
293  **/
294 static inline void rgHdlTFEvents
295 (
296 Pst     *pst,                       /* post structure       */
297 Buffer  *mBuf                       /* message buffer       */
298 )
299 {
300    switch(pst->event)
301    {
302       case EVENT_SLOT_IND_TO_MAC:
303          unpackSlotInd(fapiMacSlotInd, pst, mBuf);
304          break;
305       case EVENT_STOP_IND_TO_MAC:
306          unpackStopInd(fapiMacStopInd, pst, mBuf);
307          break;
308       case EVENT_RACH_IND_TO_MAC:
309          unpackRachInd(fapiMacRachInd, pst, mBuf);
310          break;
311       case EVENT_CRC_IND_TO_MAC:
312          unpackCrcInd(fapiMacCrcInd, pst, mBuf);
313          break;
314       case EVENT_RX_DATA_IND_TO_MAC:
315          unpackRxDataInd(fapiMacRxDataInd, pst, mBuf);
316          break;
317       case EVENT_UCI_IND_TO_MAC:
318          unpackUciInd(FapiMacUciInd, pst, mBuf);
319          break;
320       default:
321          RG_FREE_MSG(mBuf);
322          break;
323    }
324 }
325
326
327 /**
328  * @brief Task Activation callback function Entity RG SCH. 
329  *
330  * @details
331  *
332  *     Function : rgHdlRGEvents
333  *     
334  *     Process Messages received from Entity RG SCH
335  *     
336  *  @param[in]  Pst     *pst, Post structure of the primitive.     
337  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
338  *  @param[in]  Reason reason.
339  *  @return  void
340  **/
341 static inline void rgHdlRGEvents
342 (
343 Pst     *pst,                       /* post structure       */
344 Buffer  *mBuf                       /* message buffer       */
345 )
346 {
347    switch(pst->event)
348    {
349 #ifdef LCRG
350       case EVTINFCELLREGREQ:
351          cmUnpkSchMacCellRegReq(RgSchMacCellRegReq, pst, mBuf);
352          break;
353       case EVTINFSFALLOCREQ:
354          cmUnpkSchMacSfAllocReq(RgSchMacSfAllocReq, pst, mBuf);
355          break;
356       case EVTINFRLSHQREQ:
357          cmUnpkSchMacRlsHqReq(RgSchMacRlsHqReq, pst, mBuf);
358          break;
359       case EVTINFHQENTRESET:
360          cmUnpkSchMacRstHqEntReq(RgSchMacRstHqEntReq, pst, mBuf);
361          break;
362       case EVTINFRLSRNTIREQ:
363          cmUnpkSchMacRlsRntiReq(RgSchMacRlsRntiReq, pst, mBuf);
364          break;
365 #ifdef LTEMAC_SPS
366       case EVTINFSPSLCREG:
367          cmUnpkSchMacSpsLcRegReq(RgSchMacSpsLcRegReq, pst, mBuf);
368          break;
369       case EVTINFSPSLCDEREG:
370          cmUnpkSchMacSpsLcDeregReq(RgSchMacSpsLcDeregReq, pst, mBuf);
371          break;
372       case EVTINFSPSRESET:
373          cmUnpkSchMacUlSpsResetReq(RgSchMacUlSpsResetReq, pst, mBuf);
374          break;
375 #endif /* LTEMAC_SPS */
376 #ifdef LTE_L2_MEAS
377       case EVTINFL2MEASREQ:
378          cmUnpkSchMacL2MeasReq(RgSchMacL2MeasReq, pst, mBuf);
379          break;
380       case EVTINFL2MEASSENDREQ :
381          cmUnpkSchMacL2MeasSendReq(RgSchMacL2MeasSendReq, pst , mBuf);
382          break;
383       case EVTINFL2MEASSTOPREQ:
384          cmUnpkSchMacL2MeasStopReq(RgSchMacL2MeasStopReq, pst , mBuf);
385          break;
386 #endif/* LTE_L2_MEAS */
387       case EVTINFLCGREG:
388          cmUnpkSchMacLcgRegReq(RgSchMacLcgRegReq, pst, mBuf);
389          break;
390 #endif            
391 #if defined(LTE_ADV) && defined(LCPRG)
392       case EVTPRGUESCELLCFGREQ:
393       {
394          cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgPMacSMacUeSCellCfgReq, pst, mBuf);
395       }
396       break;
397       case EVTPRGUESCELLCFGCFM:
398       case EVTPRGUESCELLLCHMODCFM:
399       case EVTPRGUESCELLLCHDELCFMDEL:
400       case EVTPRGUESCELLLCHADDCFM:
401       {
402          cmUnpkPrgSMacPMacCfgCfm(RgPrgSMacPMacCfgCfm, pst, mBuf);
403       }
404       break;
405       case EVTPRGUESCELLDELREQ:
406       {
407          cmUnpkPrgPMacSMacUeSCellDelReq(RgPrgPMacSMacUeSCellDelReq, pst, mBuf);
408       }
409       break;
410       case EVTPRGUESCELLLCHMODREQ:
411       {
412          cmUnpkPrgPMacSMacUeSCellLchModReq(RgPrgPMacSMacUeSCellLchModReq, pst,
413                                            mBuf);
414       }
415       break;
416       case EVTPRGUESCELLLCHDELREQ:
417       {
418          cmUnpkPrgPMacSMacUeSCellLchDelReq(RgPrgPMacSMacUeSCellLchDelReq, pst,
419                                            mBuf);
420       }
421       break;
422       case EVTPRGUESCELLLCHADDREQ:
423       {
424          cmUnpkPrgPMacSMacUeSCellLchAddReq(RgPrgPMacSMacUeSCellLchAddReq, pst,
425                                            mBuf);
426       }
427       break;
428
429 #endif
430       default:
431       {
432          RG_FREE_MSG(mBuf);
433          break;
434       }
435
436    }
437 }
438
439 /**
440 * @brief Function prints src, dest, msg infor about all the msgs that received.
441 *
442 * @details
443 *
444 *     Function : callFlowRgActvTsk 
445 *
446 *     Function prints src, dest, msg infor about all the msgs that received
447 *
448 *  @param[in]  Pst     *pst, Post structure of the primitive.
449 *
450 *  @return  void
451 **/
452
453 void callFlowRgActvTsk(Pst *pst)
454 {
455    char sourceTask[50];
456    char destTask[50]="ENTMAC";
457    char message[100];
458
459    switch(pst->srcEnt)
460    {
461       case ENTDUAPP:
462          {
463             strcpy(sourceTask,"ENTDUAPP");
464             switch(pst->event)
465             {
466 #ifdef LCRGMILRG
467                case EVTLRGCFGREQ:
468                   strcpy(message,"EVTLRGCFGREQ");
469                   break;
470                case EVTMACSCHGENCFGREQ:
471                   strcpy(message,"EVTMACSCHGENCFGREQ");
472                   break;
473                case EVTLRGCNTRLREQ:
474                   strcpy(message,"EVTLRGCNTRLREQ");
475                   break;
476                case EVTLRGSSTAREQ:
477                   strcpy(message,"EVTLRGSSTAREQ");
478                   break;
479                case EVTLRGSTSREQ:
480                   strcpy(message,"EVTLRGSTSREQ");
481                   break;
482 #endif /* LCRGMILRG */
483                case EVENT_MAC_CELL_CONFIG_REQ:
484                   strcpy(message,"EVENT_MAC_CELL_CONFIG_REQ");
485                   break;
486                case EVENT_MAC_CELL_START:
487                   strcpy(message,"EVENT_MAC_CELL_START");
488                   break;
489                case EVENT_MAC_CELL_STOP:
490                   strcpy(message,"EVENT_MAC_CELL_STOP");
491                   break;
492                case EVENT_MAC_DL_CCCH_IND:
493                   strcpy(message,"EVENT_MAC_DL_CCCH_IND");
494                   break;
495                case EVENT_MAC_UE_CREATE_REQ:
496                   strcpy(message,"EVENT_MAC_UE_CREATE_REQ");
497                   break;
498                case EVENT_MAC_UE_RECONFIG_REQ:
499                   strcpy(message,"EVENT_MAC_UE_RECONFIG_REQ");
500                   break;
501                case EVENT_MAC_UE_DELETE_REQ:
502                   strcpy(message,"EVENT_MAC_UE_DELETE_REQ");
503                   break;
504                case EVENT_MAC_CELL_DELETE_REQ:
505                   strcpy(message,"EVENT_MAC_CELL_DELETE_REQ");
506                   break;
507                case EVENT_MAC_SLICE_CFG_REQ:
508                   strcpy(message,"EVENT_MAC_SLICE_CFG_REQ");
509                   break;
510                case EVENT_MAC_SLICE_RECFG_REQ:
511                   strcpy(message,"EVENT_MAC_SLICE_RECFG_REQ");
512                   break;
513                default:
514                   strcpy(message,"Invalid Event");
515                   break;
516             }
517             break;
518          }
519       case ENTRLC:
520          { 
521             strcpy(sourceTask,"ENTRLC");
522             switch(pst->event)
523             {
524 #ifdef LCRGUIRGU
525                case EVTRGUBNDREQ:
526                   strcpy(message,"EVTRGUBNDREQ");
527                   break;
528                case EVTRGUUBNDREQ:
529                   strcpy(message,"EVTRGUUBNDREQ");
530                   break;
531                case EVENT_DL_DATA_TO_MAC:
532                   strcpy(message,"EVENT_DL_DATA_TO_MAC");
533                   break;
534                case EVENT_BO_STATUS_TO_MAC:
535                   strcpy(message,"EVENT_BO_STATUS_TO_MAC");
536                   break;
537 #endif
538                default:
539                   strcpy(message,"Invalid Event");
540                   break;
541             }
542
543             break;
544          }
545       case ENTLWRMAC:
546          {
547             strcpy(sourceTask,"ENTLWRMAC");
548             switch(pst->event)
549             {
550                case EVENT_SLOT_IND_TO_MAC:
551                   strcpy(message,"EVENT_SLOT_IND_TO_MAC");
552                   break;
553                case EVENT_STOP_IND_TO_MAC:
554                   strcpy(message,"EVENT_STOP_IND_TO_MAC");
555                   break;
556                case EVENT_RACH_IND_TO_MAC:
557                   strcpy(message,"EVENT_RACH_IND_TO_MAC");
558                   break;
559                case EVENT_CRC_IND_TO_MAC:
560                   strcpy(message,"EVENT_CRC_IND_TO_MAC");
561                   break;
562                case EVENT_RX_DATA_IND_TO_MAC:
563                   strcpy(message,"EVENT_RX_DATA_IND_TO_MAC");
564                   break;
565                case EVENT_UCI_IND_TO_MAC:
566                   strcpy(message,"EVENT_UCI_IND_TO_MAC");
567                   break;
568                default:
569                   strcpy(message,"Invalid Event");
570                   break;
571             }
572
573             break;
574          }
575       case ENTMAC: /* When scheduler instance sends msg to MAC */
576          {
577             strcpy(sourceTask,"ENTMAC");
578             switch(pst->event)
579             {
580 #ifdef LCRG
581                case EVTINFCELLREGREQ:
582                   strcpy(message,"EVTINFCELLREGREQ");
583                   break;
584                case EVTINFSFALLOCREQ:
585                   strcpy(message,"EVTINFSFALLOCREQ");
586                   break;
587                case EVTINFRLSHQREQ:
588                   strcpy(message,"EVTINFRLSHQREQ");
589                   break;
590                case EVTINFHQENTRESET:
591                   strcpy(message,"EVTINFHQENTRESET");
592                   break;
593                case EVTINFRLSRNTIREQ:
594                   strcpy(message,"EVTINFRLSRNTIREQ");
595                   break;
596 #ifdef LTEMAC_SPS
597                case EVTINFSPSLCREG:
598                   strcpy(message,"EVTINFSPSLCREG");
599                   break;
600                case EVTINFSPSLCDEREG:
601                   strcpy(message,"EVTINFSPSLCDEREG");
602                   break;
603                case EVTINFSPSRESET:
604                   strcpy(message,"EVTINFSPSRESET");
605                   break;
606 #endif /* LTEMAC_SPS */
607                case EVTINFLCGREG:
608                   strcpy(message,"EVTINFLCGREG");
609                   break;
610 #endif            
611 #if defined(LTE_ADV) && defined(LCPRG)
612                case EVTPRGUESCELLCFGREQ:
613                   strcpy(message,"EVTPRGUESCELLCFGREQ");
614                   break;
615                case EVTPRGUESCELLCFGCFM:
616                   strcpy(message,"EVTPRGUESCELLCFGCFM");
617                   break;
618                case EVTPRGUESCELLLCHMODCFM:
619                   strcpy(message,"EVTPRGUESCELLLCHMODCFM");
620                   break;
621                case EVTPRGUESCELLLCHDELCFMDEL:
622                   strcpy(message,"EVTPRGUESCELLLCHDELCFMDEL");
623                   break;
624                case EVTPRGUESCELLLCHADDCFM:
625                   strcpy(message,"EVTPRGUESCELLLCHADDCFM");
626                   break;
627                case EVTPRGUESCELLDELREQ:
628                   strcpy(message,"EVTPRGUESCELLDELREQ");
629                   break;
630                case EVTPRGUESCELLLCHMODREQ:
631                   strcpy(message,"EVTPRGUESCELLLCHMODREQ");
632                   break;
633                case EVTPRGUESCELLLCHDELREQ:
634                   strcpy(message,"EVTPRGUESCELLLCHDELREQ");
635                   break;
636                case EVTPRGUESCELLLCHADDREQ:
637                   strcpy(message,"EVTPRGUESCELLLCHADDREQ");
638                   break;
639
640 #endif
641                default:
642                   strcpy(message,"Invalid Event");
643                   break;
644             }
645             break;
646          }
647
648       default:
649          {
650             strcpy(sourceTask,"Invalid Source Entity Id");
651             break;
652          }
653    }
654    DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message);
655 }
656
657 \f
658 /**********************************************************************
659 \f
660 /**
661  * @brief Task Activation callback function. 
662  *
663  * @details
664  *
665  *     Function : rgActvTsk
666  *     
667  *     Primitives invoked by MAC's users/providers through
668  *     a loosely coupled interface arrive here by means of 
669  *     SSI's message handling. This API is registered with
670  *     SSI during the Task Registration of MAC.
671  *     
672  *  @param[in]  Pst     *pst, Post structure of the primitive.     
673  *  @param[in]  Buffer *mBuf, Packed primitive parameters in the buffer.
674  *  @param[in]  Reason reason.
675  *  @return  S16
676  *      -# ROK
677  **/
678 S16 rgActvTsk
679 (
680 Pst     *pst,                       /* post structure       */
681 Buffer  *mBuf                       /* message buffer       */
682 )
683 {
684
685 #ifdef CALL_FLOW_DEBUG_LOG
686    callFlowRgActvTsk(pst);
687 #endif
688
689    switch(pst->srcEnt)
690    {
691       /* The originator of this message is the stack manager,
692        * unpack and go to the respective primitive processing function */
693       case ENTDUAPP:
694           rgHdlSMEvents(pst, mBuf);
695            break;
696       case ENTNH:
697           rgHdlNHEvents(pst, mBuf);
698           break;
699       case ENTRLC:
700           rgHdlKWEvents(pst, mBuf);
701           break;
702       case ENTLWRMAC:
703           rgHdlTFEvents(pst, mBuf);
704           break;
705       case ENTMAC: /* When scheduler instance sends msg to MAC */
706           rgHdlRGEvents(pst, mBuf);
707           break;
708        default:
709           RG_FREE_MSG(mBuf);
710           break;
711    }
712    ODU_EXIT_TASK();
713    return ROK;
714 }/* end of rgActvTsk */
715
716 \f
717 /**********************************************************************
718  
719          End of file
720 **********************************************************************/