1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for Layer Manager Interface Module
29 **********************************************************************/
32 @brief This file contains the Layer Management interface module implementation.
33 The functions for the configuration, control, status and statistics
34 request primitives are defined here.
36 static const char* RLOG_MODULE_NAME="MAC";
37 static int RLOG_FILE_ID=220;
38 static int RLOG_MODULE_ID=4096;
40 /* header include files (.h) */
41 #include "envopt.h" /* environment options */
42 #include "envdep.h" /* environment dependent */
43 #include "envind.h" /* environment independent */
44 #include "gen.h" /* general */
45 #include "ssi.h" /* system services */
46 #include "cm_tkns.h" /* Common Token Defines */
47 #include "cm_llist.h" /* Common Link List Defines */
48 #include "cm_hash.h" /* Common Hash List Defines */
49 #include "cm_mblk.h" /* common memory link list library */
50 #include "cm_lte.h" /* Common LTE Defines */
51 #include "rg_env.h" /* MAC Environment Defines */
52 #include "crg.h" /* CRG Interface defines */
53 #include "rgu.h" /* RGU Interface defines */
54 #include "tfu.h" /* RGU Interface defines */
55 #include "rg_sch_inf.h" /* RGR Interface defines */
56 #include "lrg.h" /* LRG Interface defines */
57 #include "rgr.h" /* LRG Interface defines */
58 #include "rg.h" /* MAC defines */
59 #include "rg_err.h" /* MAC error defines */
62 /* header/extern include files (.x) */
63 #include "gen.x" /* general */
64 #include "ssi.x" /* system services */
65 #include "cm5.x" /* system services */
66 #include "cm_tkns.x" /* Common Token Definitions */
67 #include "cm_llist.x" /* Common Link List Definitions */
68 #include "cm_lib.x" /* Common Library Definitions */
69 #include "cm_hash.x" /* Common Hash List Definitions */
70 #include "cm_mblk.x" /* common memory link list library */
71 #include "cm_lte.x" /* Common LTE Defines */
72 #include "crg.x" /* CRG Interface includes */
73 #include "rgu.x" /* RGU Interface includes */
74 #include "tfu.x" /* RGU Interface includes */
75 #include "rg_sch_inf.x" /* SCH Interface includes */
76 #include "rg_prg.x" /* PRG Interface includes */
77 #include "lrg.x" /* LRG Interface includes */
78 #include "rgr.x" /* LRG Interface includes */
79 #include "du_app_mac_inf.h"
80 #include "rg.x" /* MAC includes */
82 #include "ss_diag.h" /* Common log file */
88 #include "lwr_mac_phy.h"
89 #include "lwr_mac_fsm.h"
93 #endif /* __cplusplus */
94 EXTERN Void rgGetSId ARGS((SystemId *s));
97 #endif /* __cplusplus */
99 /* Public variable declaration */
103 /* forward references */
104 PRIVATE U16 rgLMMGenCfg ARGS((
109 PRIVATE U16 rgLMMSapCfg ARGS((
115 PRIVATE Void rgLMMShutdown ARGS((
119 PRIVATE Void rgLMMFillCfmPst ARGS((
125 PRIVATE Void rgLMMGenCntrl ARGS((
131 PRIVATE Void rgLMMSapCntrl ARGS((
137 extern U16 packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
139 packMacCellCfgConfirm packMacCellCfmOpts[] =
141 packMacCellCfgCfm, /* packing for loosely coupled */
142 duHandleMacCellCfgCfm, /* packing for tightly coupled */
143 packMacCellCfgCfm, /* packing for light weight loosly coupled */
146 SchCellCfgFunc SchCellCfgOpts[] =
148 packSchCellCfg, /* packing for loosely coupled */
149 SchHdlCellCfgReq, /* packing for tightly coupled */
150 packSchCellCfg /* packing for light weight loosly coupled */
155 * @brief Task Initiation callback function.
159 * Function : rgActvInit
161 * This function is supplied as one of parameters during MAC's
162 * task registration. SSI will invoke this function once, after
163 * it creates and attaches this TAPA Task to a system task.
165 * @param[in] Ent entity, the entity ID of this task.
166 * @param[in] Inst inst, the instance ID of this task.
167 * @param[in] Region region, the region ID registered for memory
168 * usage of this task.
169 * @param[in] Reason reason.
174 PUBLIC S16 rgActvInit
176 Ent entity, /* entity */
177 Inst inst, /* instance */
178 Region region, /* region */
179 Reason reason /* reason */
182 PUBLIC S16 rgActvInit(entity, inst, region, reason)
183 Ent entity; /* entity */
184 Inst inst; /* instance */
185 Region region; /* region */
186 Reason reason; /* reason */
192 RG_IS_INST_VALID(inst);
194 macInst = inst - RG_INST_START;
195 /* Initialize the MAC TskInit structure to zero */
196 cmMemset ((U8 *)&rgCb[macInst], 0, sizeof(RgCb));
198 /* Initialize the MAC TskInit with received values */
199 rgCb[macInst].rgInit.ent = entity;
200 rgCb[macInst].rgInit.inst = inst;
201 rgCb[macInst].rgInit.region = region;
202 rgCb[macInst].rgInit.pool = 0;
203 rgCb[macInst].rgInit.reason = reason;
204 rgCb[macInst].rgInit.cfgDone = FALSE;
205 rgCb[macInst].rgInit.acnt = FALSE;
206 rgCb[macInst].rgInit.usta = FALSE;
207 rgCb[macInst].rgInit.trc = FALSE;
208 rgCb[macInst].trcLen = 0;
211 /* disabling debugs by default */
212 rgCb[macInst].rgInit.dbgMask = 0xffffffff;
216 rgCb[macInst].rgInit.logMask = 0x0;
218 rgCb[macInst].rgInit.procId = SFndProcId();
219 rgCb[macInst].tfuSap.numBndRetries = 0;
221 /* Initialize Sap state */
222 rgCb[macInst].tfuSap.sapSta.sapState = LRG_NOT_CFG;
223 rgCb[macInst].crgSap.sapSta.sapState = LRG_NOT_CFG;
224 rgCb[macInst].rguSap = NULLP;
225 rgCb[macInst].crgSap.sapSta.sapState = LRG_NOT_CFG;
227 rgCb[macInst].inactiveCell = NULLP;
228 rgCb[macInst].cell = NULLP;
230 SAttachSRngBuf(SS_RNG_BUF_ULMAC_TO_ULRLC, SS_RBUF_ENT_ULMAC,SS_RNG_TX);
231 SAttachSRngBuf(SS_RNG_BUF_ULMAC_TO_ULRLC, SS_RBUF_ENT_ULRLC,SS_RNG_RX);
234 /* Initializing CL control block */
235 clGlobalCp.region = region;
237 clGlobalCp.clCfgDone = FALSE;
238 clGlobalCp.numOfCells = 0;
239 clGlobalCp.phyState = PHY_STATE_IDLE;
241 if( cmHashListInit(&clGlobalCp.cellCbLst, MAX_NUM_CELL_SUPP, 0x0, FALSE,
242 CM_HASH_KEYTYPE_DEF, clGlobalCp.region, clGlobalCp.pool ) != ROK )
244 printf("\n Cellcb hash list initialization failed for MAC CL");
248 /* Initialize Scheduler as well */
249 schActvInit(ENTRG, (DEFAULT_CELLS + SCH_INST_START), DFLT_REGION, PWR_UP);
251 /* Initialize lower mac */
259 * @brief Layer Manager Configuration request handler.
263 * Function : RgMiLrgCfgReq
265 * This function handles the configuration
266 * request received from the Layer Manager.
267 * -# Based on the cfg->hdr.elmId.elmnt value it invokes one of the
268 * functions rgHdlGenCfg() or rgHdlSapCfg().
269 * -# Invokes RgMiLrgCfgCfm() to send back the confirmation to the LM.
271 * @param[in] Pst *pst, the post structure
272 * @param[in] RgMngmt *cfg, the configuration parameter's structure
277 PUBLIC S16 RgMiLrgCfgReq
279 Pst *pst, /* post structure */
280 RgMngmt *cfg /* config structure */
283 PUBLIC S16 RgMiLrgCfgReq(pst, cfg)
284 Pst *pst; /* post structure */
285 RgMngmt *cfg; /* config structure */
288 U16 ret = LCM_PRIM_OK;
289 U16 reason = LCM_REASON_NOT_APPL;
297 RG_DIAG_LVL0(inst,0x0a0b0001, RG_DIAG_NA, SS_DIAG_INV_ARG,
298 "Received CfgReq for MAC layer, Entity = %d, Instance = %d\n",
299 pst->srcEnt, pst->srcInst,0,0);
301 RG_IS_INST_VALID(pst->dstInst);
302 inst = pst->dstInst - RG_INST_START;
304 /* Fill the post structure for sending the confirmation */
305 rgLMMFillCfmPst(pst, &cfmPst, cfg);
307 cmMemset((U8 *)&cfm, 0, sizeof(RgMngmt));
310 cfm.hdr.transId = cfg->hdr.transId;
314 cfm.hdr.elmId.elmnt = cfg->hdr.elmId.elmnt;
315 switch(cfg->hdr.elmId.elmnt)
318 reason = rgLMMGenCfg(inst,&cfg->t.cfg);
323 reason = rgLMMSapCfg(inst,&cfg->t.cfg, cfg->hdr.elmId.elmnt);
327 reason = LCM_REASON_INVALID_ELMNT;
328 RLOG1(L_ERROR, "Invalid Elmnt=%d",
329 cfg->hdr.elmId.elmnt);
333 if (reason != LCM_REASON_NOT_APPL)
338 cfm.cfm.status = ret;
339 cfm.cfm.reason = reason;
341 RgMiLrgCfgCfm(&cfmPst, &cfm);
344 }/*-- RgMiLrgCfgReq --*/
348 * @brief Layer Manager Statistics request handler.
352 * Function : RgMiLrgStsReq
354 * This function handles the statistics
355 * request received from the Layer Manager.
356 * -# Based on sts->hdr.elmId.elmnt, it retrieves either general or SAP
357 * statistics from the rgCb global control block.
358 * -# If action=ARST, it will reset the statistics parameters in rgCb to 0.
359 * -# Invokes the RgMiLrgStsCfm to send back the confirmation to LM.
361 * @param[in] Pst *pst, the post structure
362 * @param[in] RgMngmt *sts, the statistics parameter's structure
367 PUBLIC S16 RgMiLrgStsReq
369 Pst *pst, /* post structure */
370 RgMngmt *sts /* statistics structure */
373 PUBLIC S16 RgMiLrgStsReq(pst, sts)
374 Pst *pst; /* post structure */
375 RgMngmt *sts; /* statistics structure */
385 RG_IS_INST_VALID(pst->dstInst);
386 inst = pst->dstInst - RG_INST_START;
387 /* Fill the post structure for sending the confirmation */
388 rgLMMFillCfmPst(pst, &cfmPst, sts);
390 cmMemset((U8 *)&cfm, 0, sizeof(RgMngmt));
393 cfm.hdr.transId = sts->hdr.transId;
395 SGetDateTime(&cfm.t.sts.dt);
396 cfm.cfm.status = LCM_PRIM_OK;
397 cfm.cfm.reason = LCM_REASON_NOT_APPL;
398 cfm.hdr.elmId.elmnt = sts->hdr.elmId.elmnt;
399 cfm.t.sts.action = sts->t.sts.action;
401 /* Check if General Config Done */
402 if(rgCb[inst].rgInit.cfgDone != TRUE)
404 cfm.cfm.status = LCM_PRIM_NOK;
405 cfm.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
406 RgMiLrgStsCfm(&cfmPst,&cfm);
407 RLOG0(L_ERROR, "Gen Cfg not done");
411 switch(sts->hdr.elmId.elmnt)
415 cmMemcpy((U8 *)&(cfm.t.sts.s.genSts), (U8 *)&rgCb[inst].genSts,
417 /* check if action is read and reset */
418 if(sts->t.sts.action == ARST)
420 rgCb[inst].genSts.numHarqFail = 0;
425 RgGenSts *genSts = &(cfm.t.sts.s.genSts);
427 for(cqi=0; cqi <= 14; cqi++)
429 /* Filling DL ACK/NACK stats */
430 genSts->nackAckStats.dlCqiStat[cqi].mcs = \
431 hqFailStats.dlCqiStat[cqi].mcs;
432 genSts->nackAckStats.dlCqiStat[cqi].numOfNacks = \
433 hqFailStats.dlCqiStat[cqi].numOfNacks;
434 genSts->nackAckStats.dlCqiStat[cqi].numOfAcks =
435 hqFailStats.dlCqiStat[cqi].numOfAcks;
437 /* Filling UL ACK/NACK stats */
438 genSts->nackAckStats.ulCqiStat[cqi].mcs = \
439 hqFailStats.ulCqiStat[cqi].mcs;
440 genSts->nackAckStats.ulCqiStat[cqi].numOfNacks = \
441 hqFailStats.ulCqiStat[cqi].numOfNacks;
442 genSts->nackAckStats.ulCqiStat[cqi].numOfAcks = \
443 hqFailStats.ulCqiStat[cqi].numOfAcks;
445 /* Filling DL HQ Retx stats */
446 genSts->hqRetxStats.dlCqiStat[cqi].mcs = \
447 hqRetxStats.dlCqiStat[cqi].mcs;
448 genSts->hqRetxStats.dlCqiStat[cqi].numOfHQ_1 = \
449 hqRetxStats.dlCqiStat[cqi].numOfHQ_1;
450 genSts->hqRetxStats.dlCqiStat[cqi].numOfHQ_2 = \
451 hqRetxStats.dlCqiStat[cqi].numOfHQ_2;
452 genSts->hqRetxStats.dlCqiStat[cqi].numOfHQ_3 = \
453 hqRetxStats.dlCqiStat[cqi].numOfHQ_3;
454 genSts->hqRetxStats.dlCqiStat[cqi].numOfHQ_4 = \
455 hqRetxStats.dlCqiStat[cqi].numOfHQ_4;
456 genSts->hqRetxStats.dlCqiStat[cqi].totalTx = \
457 hqRetxStats.dlCqiStat[cqi].totalTx;
459 /* Filling UL HQ Retx stats */
460 genSts->hqRetxStats.ulCqiStat[cqi].mcs = \
461 hqRetxStats.ulCqiStat[cqi].mcs;
462 genSts->hqRetxStats.ulCqiStat[cqi].numOfHQ_1 = \
463 hqRetxStats.ulCqiStat[cqi].numOfHQ_1;
464 genSts->hqRetxStats.ulCqiStat[cqi].numOfHQ_2 = \
465 hqRetxStats.ulCqiStat[cqi].numOfHQ_2;
466 genSts->hqRetxStats.ulCqiStat[cqi].numOfHQ_3 = \
467 hqRetxStats.ulCqiStat[cqi].numOfHQ_3;
468 genSts->hqRetxStats.ulCqiStat[cqi].numOfHQ_4 = \
469 hqRetxStats.ulCqiStat[cqi].numOfHQ_4;
470 genSts->hqRetxStats.ulCqiStat[cqi].totalTx = \
471 hqRetxStats.ulCqiStat[cqi].totalTx;
473 /* Reset statistics */
474 if(sts->t.sts.action == ZEROSTS)
476 cmMemset((U8 *)&hqRetxStats, 0, \
477 sizeof(RgSchHqRetxStats));
478 cmMemset((U8 *)&hqFailStats, 0, \
479 sizeof(RgSchNackAckStats));
482 #endif /* MAC_SCH_STATS*/
486 cmMemcpy((U8 *)&(cfm.t.sts.s.rguSts), (U8 *)&rgCb[inst].rguSap[sts->t.sts.sapInst].sapSts,
489 /* check if action is read and reset */
490 if(sts->t.sts.action == ARST)
491 cmMemset((U8 *)&rgCb[inst].rguSap[sts->t.sts.sapInst].sapSts, 0, sizeof(RgSapSts));
495 cmMemcpy((U8 *)&(cfm.t.sts.s.crgSts), (U8 *)&rgCb[inst].crgSap.sapSts,
498 /* check if action is read and reset */
499 if(sts->t.sts.action == ARST)
500 cmMemset((U8 *)&rgCb[inst].crgSap.sapSts, 0, sizeof(RgSapSts));
504 cmMemcpy((U8 *)&(cfm.t.sts.s.tfuSts), (U8 *)&rgCb[inst].tfuSap.sapSts,
507 /* check if action is read and reset */
508 if(sts->t.sts.action == ARST)
509 cmMemset((U8 *)&rgCb[inst].tfuSap.sapSts, 0, sizeof(RgSapSts));
513 cfm.cfm.status = LCM_PRIM_NOK;
514 cfm.cfm.reason = LCM_REASON_INVALID_ELMNT;
515 RLOG1(L_ERROR, "Invalid Elmnt = %d",sts->hdr.elmId.elmnt);
518 RgMiLrgStsCfm(&cfmPst,&cfm);
520 }/*-- RgMiLrgStsReq --*/
524 * @brief Layer Manager Status request handler.
528 * Function : RgMiLrgStaReq
530 * This function handles the solicited status
531 * request received from the Layer Manager.
532 * -# Based on sta->hdr.elmId.elmnt, it retrieves the status of a
533 * particular SAP from the rgCb global control block.
534 * -# Invokes the RgMiLrgStaCfm to send back the confirmation to LM.
536 * @param[in] Pst *pst, the post structure
537 * @param[in] RgMngmt *sta, the status parameter's structure
542 PUBLIC S16 RgMiLrgStaReq
544 Pst *pst, /* post structure */
545 RgMngmt *sta /* status structure */
548 PUBLIC S16 RgMiLrgStaReq(pst, sta)
549 Pst *pst; /* post structure */
550 RgMngmt *sta; /* status structure */
560 RG_IS_INST_VALID(pst->dstInst);
561 inst = pst->dstInst - RG_INST_START;
564 /* Fill the post structure for sending the confirmation */
565 rgLMMFillCfmPst(pst, &cfmPst, sta);
567 if (sta->t.ssta.s.sysId.ptNmb != NULLP)
569 SPutSBuf(pst->region, pst->pool, (Data *)sta->t.ssta.s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
572 cmMemset((U8 *)&cfm, 0, sizeof(RgMngmt));
573 cfm.hdr.elmId.elmnt = sta->hdr.elmId.elmnt;
576 cfm.hdr.transId = sta->hdr.transId;
578 /* Check if General Config Done */
579 if(rgCb[inst].rgInit.cfgDone != TRUE)
581 SGetDateTime(&cfm.t.ssta.dt);
582 if (SGetSBuf(cfmPst.region, cfmPst.pool,
583 (Data **)&(cfm.t.ssta.s.sysId.ptNmb), LRG_MAX_PT_NUM_SIZE)
586 RLOG0(L_ERROR, "Memory Unavailable for Confirmation");
589 cmMemset((U8 *)(cfm.t.ssta.s.sysId.ptNmb), 0, LRG_MAX_PT_NUM_SIZE);
590 rgGetSId(&cfm.t.ssta.s.sysId);
591 cfm.cfm.status = LCM_PRIM_NOK;
592 cfm.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
593 cfm.hdr.elmId.elmnt = sta->hdr.elmId.elmnt;
594 RgMiLrgStaCfm(&cfmPst, &cfm);
595 RLOG0(L_ERROR, "Gen Cfg not done");
599 switch(sta->hdr.elmId.elmnt)
602 SGetDateTime(&cfm.t.ssta.dt);
603 if (SGetSBuf(cfmPst.region, cfmPst.pool,
604 (Data **)&(cfm.t.ssta.s.sysId.ptNmb), LRG_MAX_PT_NUM_SIZE)
607 RLOG0(L_ERROR, "Memory Unavailable for Confirmation");
610 cmMemset((U8 *)(cfm.t.ssta.s.sysId.ptNmb), 0, LRG_MAX_PT_NUM_SIZE);
611 rgGetSId(&cfm.t.ssta.s.sysId);
612 cfm.cfm.status = LCM_PRIM_OK;
613 cfm.cfm.reason = LCM_REASON_NOT_APPL;
614 RgMiLrgStaCfm(&cfmPst, &cfm);
617 cfm.cfm.status = LCM_PRIM_OK;
618 cfm.cfm.reason = LCM_REASON_NOT_APPL;
619 SGetDateTime(&cfm.t.ssta.dt);
620 cmMemcpy((U8 *)&(cfm.t.ssta.s.rguSapSta),
621 (U8 *)&rgCb[inst].rguSap[sta->t.ssta.sapInst].sapSta,
623 RgMiLrgStaCfm(&cfmPst, &cfm);
626 cfm.cfm.status = LCM_PRIM_OK;
627 cfm.cfm.reason = LCM_REASON_NOT_APPL;
628 SGetDateTime(&cfm.t.ssta.dt);
629 cmMemcpy((U8 *)&(cfm.t.ssta.s.crgSapSta), (U8 *)&rgCb[inst].crgSap.sapSta,
631 RgMiLrgStaCfm(&cfmPst, &cfm);
634 cfm.cfm.status = LCM_PRIM_OK;
635 cfm.cfm.reason = LCM_REASON_NOT_APPL;
636 SGetDateTime(&cfm.t.ssta.dt);
637 cmMemcpy((U8 *)&(cfm.t.ssta.s.tfuSapSta), (U8 *)&rgCb[inst].tfuSap.sapSta,
639 RgMiLrgStaCfm(&cfmPst, &cfm);
642 cfm.cfm.status = LCM_PRIM_NOK;
643 cfm.cfm.reason = LCM_REASON_INVALID_ELMNT;
644 RgMiLrgStaCfm(&cfmPst, &cfm);
645 RLOG1(L_ERROR, "Invalid elmnt=%d",sta->hdr.elmId.elmnt);
649 }/*-- RgMiLrgStaReq --*/
653 * @brief Layer Manager Control request handler.
657 * Function : RgMiLrgCntrlReq
659 * This function handles the control
660 * request received from the Layer Manager.
661 * -# Based on cntrl->hdr.elmId.elmnt, cntrl->t.cntrl.action
662 * and cntrl->t.cntrl.subAction, it performs the appropriate control action
663 * of SAP (enable/disable), Debug (enable/disable), Trace (enable/disable)
664 * and layer shutdown.
665 * -# Invokes the RgMiLrgCntrlCfm to send back the confirmation to LM.
667 * @param[in] Pst *pst, the post structure
668 * @param[in] RgMngmt *cntrl, the control parameter's structure
673 PUBLIC S16 RgMiLrgCntrlReq
675 Pst *pst, /* post structure */
676 RgMngmt *cntrl /* control structure */
679 PUBLIC S16 RgMiLrgCntrlReq(pst, cntrl)
680 Pst *pst; /* post structure */
681 RgMngmt *cntrl; /* control structure */
684 S16 ret = ROK; /* return value */
689 TRC2(RgMiLrgCntrlReq)
691 /* Fill the post structure for sending the confirmation */
693 RG_IS_INST_VALID(pst->dstInst);
694 inst = pst->dstInst - RG_INST_START;
696 rgLMMFillCfmPst(pst, &cfmPst, cntrl);
698 cmMemset((U8 *)&cfm, 0, sizeof(RgMngmt));
700 cfm.hdr.transId = cntrl->hdr.transId;
702 cfm.hdr.elmId.elmnt = cntrl->hdr.elmId.elmnt;
703 cfm.t.cntrl.action = cntrl->t.cntrl.action;
704 cfm.t.cntrl.subAction = cntrl->t.cntrl.subAction;
706 /* Check if General Config Done*/
707 if(rgCb[inst].rgInit.cfgDone != TRUE)
709 cfm.cfm.status = LCM_PRIM_NOK;
710 cfm.cfm.reason = LCM_REASON_GENCFG_NOT_DONE;
711 cfm.hdr.elmId.elmnt = cntrl->hdr.elmId.elmnt;
712 RgMiLrgCntrlCfm(&cfmPst, &cfm);
713 RLOG0(L_ERROR, "Gen Cfg not done");
717 /* General Config done, process the Control request */
718 switch(cntrl->hdr.elmId.elmnt)
721 rgLMMGenCntrl(cntrl, &cfm, &cfmPst);
726 rgLMMSapCntrl(cntrl, &cfm, &cfmPst);
729 cfm.cfm.status = LCM_PRIM_NOK;
730 cfm.cfm.reason = LCM_REASON_INVALID_PAR_VAL;
731 RgMiLrgCntrlCfm(&cfmPst, &cfm);
732 RLOG1(L_ERROR, "invalid elmnt=%d",cntrl->hdr.elmId.elmnt);
736 }/*-- RgMiLrgCntrlReq --*/
740 * @brief SAP Configuration Handler.
744 * Function : rgLMMSapCfg
746 * This function in called by RgMiLrgCfgReq(). It handles the
747 * interface SAP configuration of the LTE MAC layer. It
748 * initializes the sapState to LRG_UNBND. Returns
749 * reason for success/failure of this function.
751 * @param[in] Inst inst
752 * @param[in] RgCfg *cfg, the Configuaration information
754 * -# LCM_REASON_GENCFG_NOT_DONE
755 * -# LCM_REASON_INVALID_SAP
756 * -# LCM_REASON_NOT_APPL
759 PRIVATE U16 rgLMMSapCfg
762 RgCfg *cfg, /* Configuaration information */
763 Elmnt sapType /* Sap Type */
766 PRIVATE U16 rgLMMSapCfg(inst,cfg,sapType)
768 RgCfg *cfg; /* Configuaration information */
769 Elmnt sapType; /* Sap Type */
772 U16 ret = LCM_REASON_NOT_APPL;
773 RgLowSapCfgInfo *lowSapCfg = NULLP;
774 RgUpSapCfgInfo *upSapCfg = NULLP;
775 RgUpSapCb *upSapCb = NULLP;
779 /* Check if Gen Config has been done */
780 if(rgCb[inst].rgInit.cfgDone != TRUE)
781 RETVALUE(LCM_REASON_GENCFG_NOT_DONE);
786 if ((cfg->s.rguSap.spId > LRG_MAX_RGU_SAPS) &&
787 (cfg->s.rguSap.selector != RGU_SEL_TC) &&
788 (cfg->s.rguSap.selector != RGU_SEL_LC))
790 ret = LCM_REASON_INVALID_PAR_VAL;
791 RLOG0(L_ERROR, "unsupported Selector value for RGU");
794 upSapCb = &(rgCb[inst].rguSap[cfg->s.rguSap.spId]);
795 if(upSapCb->sapSta.sapState == LRG_NOT_CFG)
797 upSapCb->sapSta.sapState = LRG_UNBND;
799 upSapCfg = &(upSapCb->sapCfg);
800 upSapCfg->sapPst.dstEnt = cfg->s.rguSap.ent;
801 upSapCfg->sapPst.dstInst = cfg->s.rguSap.inst;
802 upSapCfg->sapPst.dstProcId = cfg->s.rguSap.procId;
803 upSapCfg->sapPst.srcEnt = rgCb[inst].rgInit.ent;
804 upSapCfg->sapPst.srcInst = rgCb[inst].rgInit.inst;
805 upSapCfg->sapPst.srcProcId = rgCb[inst].rgInit.procId;
806 upSapCfg->sapPst.region = cfg->s.rguSap.mem.region;
807 upSapCfg->sapPst.pool = cfg->s.rguSap.mem.pool;
808 upSapCfg->sapPst.selector = cfg->s.rguSap.selector;
809 upSapCfg->sapPst.route = cfg->s.rguSap.route;
810 upSapCfg->sapPst.intfVer = 0;
811 upSapCfg->sapPst.prior = cfg->s.rguSap.prior;
812 upSapCfg->suId = cfg->s.rguSap.suId;
813 upSapCfg->spId = cfg->s.rguSap.spId;
814 /*T2K uses 2 saps, T3K uses 1 sap. change the rgRguDlSap to 1 only if
815 * there is cfg request with sap is 1*/
818 if ((cfg->s.crgSap.selector != CRG_SEL_TC) &&
819 (cfg->s.crgSap.selector != CRG_SEL_LC))
821 ret = LCM_REASON_INVALID_PAR_VAL;
822 RLOG0(L_ERROR, "unsupported Selector value for CRG");
825 if(rgCb[inst].crgSap.sapSta.sapState == LRG_NOT_CFG)
827 rgCb[inst].crgSap.sapSta.sapState = LRG_UNBND;
829 upSapCfg = &rgCb[inst].crgSap.sapCfg;
831 upSapCfg->sapPst.dstEnt = cfg->s.crgSap.ent;
832 upSapCfg->sapPst.dstInst = cfg->s.crgSap.inst;
833 upSapCfg->sapPst.dstProcId = cfg->s.crgSap.procId;
834 upSapCfg->sapPst.srcEnt = rgCb[inst].rgInit.ent;
835 upSapCfg->sapPst.srcInst = rgCb[inst].rgInit.inst;
836 upSapCfg->sapPst.srcProcId = rgCb[inst].rgInit.procId;
837 upSapCfg->sapPst.region = cfg->s.crgSap.mem.region;
838 upSapCfg->sapPst.pool = cfg->s.crgSap.mem.pool;
839 upSapCfg->sapPst.selector = cfg->s.crgSap.selector;
840 upSapCfg->sapPst.route = cfg->s.crgSap.route;
841 upSapCfg->sapPst.intfVer = 0;
842 upSapCfg->sapPst.prior = cfg->s.crgSap.prior;
843 upSapCfg->suId = cfg->s.crgSap.suId;
844 upSapCfg->spId = cfg->s.crgSap.spId;
848 if ((cfg->s.tfuSap.selector != TFU_SEL_TC) &&
849 (cfg->s.tfuSap.selector != TFU_SEL_LC))
851 ret = LCM_REASON_INVALID_PAR_VAL;
852 RLOG0(L_ERROR, "unsupported Selector value for TFU");
856 if (rgCb[inst].tfuSap.sapSta.sapState == LRG_NOT_CFG)
858 rgCb[inst].tfuSap.sapSta.sapState = LRG_UNBND;
860 lowSapCfg = &rgCb[inst].tfuSap.sapCfg;
862 lowSapCfg->sapPst.dstEnt = cfg->s.tfuSap.ent;
863 lowSapCfg->sapPst.dstInst = cfg->s.tfuSap.inst;
864 lowSapCfg->sapPst.dstProcId = rgCb[inst].rgInit.procId;
865 lowSapCfg->sapPst.srcEnt = rgCb[inst].rgInit.ent;
866 lowSapCfg->sapPst.srcInst = rgCb[inst].rgInit.inst;
867 lowSapCfg->sapPst.srcProcId = rgCb[inst].rgInit.procId;
868 lowSapCfg->sapPst.region = cfg->s.tfuSap.mem.region;
869 lowSapCfg->sapPst.pool = cfg->s.tfuSap.mem.pool;
870 lowSapCfg->sapPst.selector = cfg->s.tfuSap.selector;
871 lowSapCfg->sapPst.route = cfg->s.tfuSap.route;
872 lowSapCfg->sapPst.intfVer = 0;
873 lowSapCfg->sapPst.prior = cfg->s.tfuSap.prior;
874 lowSapCfg->suId = cfg->s.tfuSap.suId;
875 lowSapCfg->spId = cfg->s.tfuSap.spId;
876 cmMemcpy((U8 *)&lowSapCfg->bndTmr, (U8 *)&cfg->s.tfuSap.bndTmr,
880 /* would never reach here */
888 * @brief General Configuration Handler.
892 * Function : rgLMMGenCfg
894 * This function in called by RgMiLrgCfgReq(). It handles the
895 * general configuration of the LTE MAC layer. It initializes
896 * the hash lists of RgCb. Returns
897 * reason for success/failure of this function.
899 * @param[in] Inst inst
900 * @param[in] RgCfg *cfg, the Configuaration information
902 * -# LCM_REASON_NOT_APPL
903 * -# LCM_REASON_INVALID_MSGTYPE
904 * -# LCM_REASON_MEM_NOAVAIL
907 PRIVATE U16 rgLMMGenCfg
910 RgCfg *cfg /* Configuaration information */
913 PRIVATE U16 rgLMMGenCfg(inst,cfg)
915 RgCfg *cfg; /* Configuaration information */
918 U16 ret = LCM_REASON_NOT_APPL;
922 /* Check if General Configuration is done already */
923 if (rgCb[inst].rgInit.cfgDone == TRUE)
925 RETVALUE(LCM_REASON_INVALID_MSGTYPE);
927 if ((cfg->s.genCfg.lmPst.selector != LRG_SEL_TC) &&
928 (cfg->s.genCfg.lmPst.selector != LRG_SEL_LC))
930 RLOG0(L_ERROR, "unsupported Selector value for RGU");
931 RETVALUE(LCM_REASON_INVALID_PAR_VAL);
933 /* Update the Pst structure for LM interface */
934 cmMemcpy((U8 *)&rgCb[inst].rgInit.lmPst, (U8 *)&cfg->s.genCfg.lmPst,
937 rgCb[inst].rgInit.lmPst.srcProcId = rgCb[inst].rgInit.procId;
938 rgCb[inst].rgInit.lmPst.srcEnt = rgCb[inst].rgInit.ent;
939 rgCb[inst].rgInit.lmPst.srcInst = rgCb[inst].rgInit.inst;
940 rgCb[inst].rgInit.lmPst.event = EVTNONE;
942 rgCb[inst].rgInit.region = cfg->s.genCfg.mem.region;
943 rgCb[inst].rgInit.pool = cfg->s.genCfg.mem.pool;
944 rgCb[inst].genCfg.tmrRes = cfg->s.genCfg.tmrRes;
946 macCb.macInst = rgCb[inst].rgInit.inst;
948 /* Initialize SAP States */
949 rgCb[inst].crgSap.sapSta.sapState = LRG_NOT_CFG;
951 if(cfg->s.genCfg.numRguSaps == 0)
953 RGDBGERRNEW(inst,(rgPBuf(inst), "\nrgGenCfg(): Invalid numRguSap.\n"));
957 /* allocate RGR saps */
958 if (SGetSBuf(rgCb[inst].rgInit.region,
959 rgCb[inst].rgInit.pool,
960 (Data **)&rgCb[inst].rguSap,
961 (sizeof(RgUpSapCb) * cfg->s.genCfg.numRguSaps)) != ROK)
963 RGDBGERRNEW(inst,(rgPBuf(inst), "\nrgGenCfg(): Failed to allocate mem for RGU SAP's.\n"));
966 rgCb[inst].numRguSaps = cfg->s.genCfg.numRguSaps;
968 for (int idx = 0; idx < rgCb[inst].numRguSaps; idx++)
970 rgCb[inst].rguSap[idx].sapSta.sapState = LRG_NOT_CFG;
971 cmMemset((U8 *)&rgCb[inst].rguSap[idx], 0, sizeof(RgUpSapCb));
973 rgCb[inst].tfuSap.sapSta.sapState = LRG_NOT_CFG;
974 /* Initialize the timer blocks */
975 cmInitTimers(rgCb[inst].tmrBlk, RG_MAX_TIMER);
976 /* Initialzie the timer queue */
977 cmMemset((U8 *)&rgCb[inst].tmrTq, 0, sizeof(CmTqType)*RG_TQ_SIZE);
978 /* Initialize the timer control point */
979 cmMemset((U8 *)&rgCb[inst].tmrTqCp, 0, sizeof(CmTqCp));
980 rgCb[inst].tmrTqCp.tmrLen = RG_TQ_SIZE;
982 /* Timer Registration request to SSI */
983 if (SRegTmrMt(rgCb[inst].rgInit.ent, rgCb[inst].rgInit.inst,
984 (S16)rgCb[inst].genCfg.tmrRes, rgActvTmr) != ROK)
987 RLOG0(L_ERROR, "Failed to register timer");
989 SPutSBuf(rgCb[inst].rgInit.region,
990 rgCb[inst].rgInit.pool,
991 (Data *)rgCb[inst].rguSap,
992 (sizeof(RgUpSapCb) * cfg->s.genCfg.numRguSaps));
994 RETVALUE(LCM_REASON_MEM_NOAVAIL);
997 /* Set Config done in TskInit */
998 rgCb[inst].rgInit.cfgDone = TRUE;
1004 /***********************************************************
1006 * Func : rgLMMShutdown
1009 * Desc : Handles the MAC layer shutdown request. Calls
1010 * rgCFGFreeCellCb(RgCellCb*) to handle each cellCb deallocation.
1019 **********************************************************/
1021 PRIVATE Void rgLMMShutdown
1026 PRIVATE Void rgLMMShutdown(inst)
1030 RgCellCb *cell = rgCb[inst].cell;
1035 /* Unbind the TFU Sap */
1036 if(rgCb[inst].tfuSap.sapSta.sapState == LRG_WAIT_BNDCFM)
1038 rgLIMTfuUbndReq(inst,rgCb[inst].tfuSap.sapCfg.spId, LRG_UNBND);
1039 if (rgCb[inst].tfuSap.sapCfg.bndTmr.enb == TRUE)
1041 rgLMMStopTmr(inst,RG_BNDREQ_TMR, (PTR)&rgCb[inst].tfuSap);
1043 rgCb[inst].tfuSap.sapSta.sapState = LRG_UNBND;
1045 if(rgCb[inst].tfuSap.sapSta.sapState == LRG_BND)
1047 rgLIMTfuUbndReq(inst,rgCb[inst].tfuSap.sapCfg.spId, LRG_UNBND);
1048 rgCb[inst].tfuSap.sapSta.sapState = LRG_UNBND;
1054 for(idx=0;idx < RG_NUM_SUB_FRAMES; idx++)
1056 rgTOMRlsSf(inst,&cell->subFrms[idx]);
1059 rgCFGFreeCellCb(cell);
1062 /* Deleting the RGU SAPs */
1063 SPutSBuf(rgCb[inst].rgInit.region,
1064 rgCb[inst].rgInit.pool,
1065 (Data *)rgCb[inst].rguSap,
1066 (sizeof(RgUpSapCb) * rgCb[inst].numRguSaps));
1067 rgCb[inst].rguSap = NULLP;
1069 rgCb[inst].inactiveCell = NULLP;
1070 rgCb[inst].cell = NULLP;
1072 /* De-register the Timer Service */
1073 (Void) SDeregTmrMt(rgCb[inst].rgInit.ent, rgCb[inst].rgInit.inst,
1074 (S16)rgCb[inst].genCfg.tmrRes, rgActvTmr);
1076 /* call back the task initialization function to intialize
1077 * the global RgCb Struct */
1078 rgActvInit(rgCb[inst].rgInit.ent, rgCb[inst].rgInit.inst, rgCb[inst].rgInit.region,
1079 rgCb[inst].rgInit.reason);
1085 /***********************************************************
1087 * Func : rgLMMGenCntrl
1090 * Desc : Processes the LM control request for STGEN elmnt.
1099 **********************************************************/
1101 PRIVATE Void rgLMMGenCntrl
1108 PRIVATE Void rgLMMGenCntrl(cntrl, cfm, cfmPst)
1114 Inst inst = (cfmPst->srcInst - RG_INST_START);
1117 cfm->cfm.status = LCM_PRIM_OK;
1118 cfm->cfm.reason = LCM_REASON_NOT_APPL;
1121 switch(cntrl->t.cntrl.action)
1124 /* Action is Enable */
1125 switch(cntrl->t.cntrl.subAction)
1129 rgCb[inst].rgInit.trc = TRUE;
1130 rgCb[inst].trcLen = cntrl->t.cntrl.s.trcLen;
1131 /*Store the response and TransId for sending the Traces */
1132 cmMemcpy((U8 *)&rgCb[inst].genCfg.trcResp.response,
1133 (U8 *)&cntrl->hdr.response, sizeof(Resp));
1134 rgCb[inst].genCfg.trcResp.transId = cntrl->hdr.transId;
1138 /* Enable Unsolicited Status (alarms) */
1139 rgCb[inst].rgInit.usta = TRUE;
1140 /*Store the response and TransId for sending the Alarms */
1141 cmMemcpy((U8 *)&rgCb[inst].genCfg.ustaResp.response,
1142 (U8 *)&cntrl->hdr.response, sizeof(Resp));
1143 rgCb[inst].genCfg.ustaResp.transId = cntrl->hdr.transId;
1146 /* Enable Debug Printing */
1148 rgCb[inst].rgInit.dbgMask |= cntrl->t.cntrl.s.rgDbgCntrl.dbgMask;
1153 rgCb[inst].rgInit.logMask = cntrl->t.cntrl.s.logMask;
1158 cfm->cfm.status = LCM_PRIM_NOK;
1159 cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
1160 RLOG1(L_ERROR, "invalid subaction=%d",cntrl->t.cntrl.subAction);
1165 /* Action is Diable immidiately */
1166 switch(cntrl->t.cntrl.subAction)
1169 /* Disable Traces */
1170 rgCb[inst].rgInit.trc = FALSE;
1173 /* Disable Unsolicited Status (alarms) */
1174 rgCb[inst].rgInit.usta = FALSE;
1177 /* Disable Debug Printing */
1179 rgCb[inst].rgInit.dbgMask &=~cntrl->t.cntrl.s.rgDbgCntrl.dbgMask;
1184 rgCb[inst].rgInit.logMask = cntrl->t.cntrl.s.logMask;
1189 cfm->cfm.status = LCM_PRIM_NOK;
1190 cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
1191 RLOG1(L_ERROR, "invalid subaction=%d",cntrl->t.cntrl.subAction);
1196 /* Free all the memory dynamically allocated by MAC */
1197 rgLMMShutdown(inst);
1200 cfm->cfm.status = LCM_PRIM_NOK;
1201 cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
1202 RLOG1(L_ERROR, "invalid action=%d",cntrl->t.cntrl.action);
1205 RgMiLrgCntrlCfm(cfmPst, cfm);
1210 /***********************************************************
1212 * Func : rgLMMSapCntrl
1215 * Desc : Processes the LM control request for STxxxSAP elmnt.
1224 **********************************************************/
1226 PRIVATE Void rgLMMSapCntrl
1233 PRIVATE Void rgLMMSapCntrl(cntrl, cfm, cfmPst)
1239 Inst inst = cfmPst->srcInst - RG_INST_START;
1242 /* Only TFU Sap can be controlled by LM */
1243 switch(cntrl->hdr.elmId.elmnt)
1246 switch(cntrl->t.cntrl.action)
1249 /* Bind Enable Request */
1250 if ((rgCb[inst].tfuSap.sapSta.sapState == LRG_NOT_CFG) ||
1251 (rgCb[inst].tfuSap.sapSta.sapState == LRG_BND))
1253 cfm->cfm.status = LCM_PRIM_NOK;
1254 cfm->cfm.reason = LCM_REASON_INVALID_SAP;
1258 if (rgCb[inst].tfuSap.sapCfg.bndTmr.enb == TRUE)
1260 rgLMMStartTmr(inst,RG_BNDREQ_TMR, rgCb[inst].tfuSap.sapCfg.bndTmr.val,
1261 (PTR)&rgCb[inst].tfuSap);
1263 /* Change SAP state */
1264 rgCb[inst].tfuSap.sapSta.sapState = LRG_WAIT_BNDCFM;
1265 rgCb[inst].tfuSap.numBndRetries++;
1266 /* Store the response and TransId for sending
1267 * the Control confirm */
1268 cmMemcpy((U8 *)&rgCb[inst].genCfg.bndCfmResp.response,
1269 (U8 *)&cntrl->hdr.response, sizeof(Resp));
1270 rgCb[inst].genCfg.bndCfmResp.transId = cntrl->hdr.transId;
1272 /* Sending Status Indication to Layer Manager */
1273 cfm->cfm.status = LCM_PRIM_OK_NDONE;
1274 cfm->cfm.reason = LCM_REASON_NOT_APPL;
1275 RgMiLrgCntrlCfm(cfmPst, cfm);
1277 rgLIMTfuBndReq(inst,rgCb[inst].tfuSap.sapCfg.suId,
1278 rgCb[inst].tfuSap.sapCfg.spId);
1283 /* Unbind request */
1285 /* Check if the SAP is configured */
1286 if( (rgCb[inst].tfuSap.sapSta.sapState == LRG_NOT_CFG) ||
1287 (rgCb[inst].tfuSap.sapSta.sapState == LRG_UNBND))
1289 cfm->cfm.status = LCM_PRIM_NOK;
1290 cfm->cfm.reason = LCM_REASON_INVALID_MSGTYPE;
1294 rgLIMTfuUbndReq(inst,rgCb[inst].tfuSap.sapCfg.spId, TFU_UBNDREQ_MNGMT);
1295 if (rgCb[inst].tfuSap.sapCfg.bndTmr.enb == TRUE)
1297 rgLMMStopTmr(inst,RG_BNDREQ_TMR, (PTR)&rgCb[inst].tfuSap);
1299 /* Change SAP state */
1300 rgCb[inst].tfuSap.sapSta.sapState = LRG_UNBND;
1301 cfm->cfm.status = LCM_PRIM_OK;
1302 cfm->cfm.reason = LCM_REASON_NOT_APPL;
1306 /* Delete SAP, does initialization of SAP */
1307 if ((rgCb[inst].tfuSap.sapSta.sapState == LRG_WAIT_BNDCFM) ||
1308 (rgCb[inst].tfuSap.sapSta.sapState == LRG_BND))
1310 rgLIMTfuUbndReq(inst,rgCb[inst].tfuSap.sapCfg.spId, TFU_UBNDREQ_MNGMT);
1311 if (rgCb[inst].tfuSap.sapCfg.bndTmr.enb == TRUE)
1313 rgLMMStopTmr(inst,RG_BNDREQ_TMR, (PTR)&rgCb[inst].tfuSap);
1316 cmMemset((U8 *)&rgCb[inst].tfuSap, 0, sizeof(RgLowSapCb));
1317 rgCb[inst].tfuSap.sapSta.sapState = LRG_NOT_CFG;
1318 cfm->cfm.status = LCM_PRIM_OK;
1319 cfm->cfm.reason = LCM_REASON_NOT_APPL;
1322 cfm->cfm.status = LCM_PRIM_NOK;
1323 cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
1324 RGDBGERRNEW(inst,(rgPBuf(inst), "\nrgLMMSapCntrl(): invalid action=%d",
1325 cntrl->t.cntrl.action));
1330 switch(cntrl->t.cntrl.action)
1333 cmMemset((U8 *)&rgCb[inst].rguSap[cntrl->t.cntrl.instId], 0, sizeof(RgUpSapCb));
1334 rgCb[inst].rguSap[cntrl->t.cntrl.instId].sapSta.sapState = LRG_NOT_CFG;
1335 cfm->cfm.status = LCM_PRIM_OK;
1336 cfm->cfm.reason = LCM_REASON_NOT_APPL;
1339 cfm->cfm.status = LCM_PRIM_NOK;
1340 cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
1341 RGDBGERRNEW(inst,(rgPBuf(inst), "\nrgLMMSapCntrl(): invalid action=%d",
1342 cntrl->t.cntrl.action));
1347 switch(cntrl->t.cntrl.action)
1350 cmMemset((U8 *)&rgCb[inst].crgSap, 0, sizeof(RgUpSapCb));
1351 rgCb[inst].crgSap.sapSta.sapState = LRG_NOT_CFG;
1352 cfm->cfm.status = LCM_PRIM_OK;
1353 cfm->cfm.reason = LCM_REASON_NOT_APPL;
1356 cfm->cfm.status = LCM_PRIM_NOK;
1357 cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
1358 RLOG1(L_ERROR, "invalid action=%d",cntrl->t.cntrl.action);
1364 /* Would never here. */
1367 RgMiLrgCntrlCfm(cfmPst, cfm);
1372 /***********************************************************
1374 * Func : rgLMMFillCfmPst
1377 * Desc : Fills the Confirmation Post Structure cfmPst using the reqPst
1378 * and the cfm->hdr.response.
1387 **********************************************************/
1389 PRIVATE Void rgLMMFillCfmPst
1396 PRIVATE Void rgLMMFillCfmPst(reqPst, cfmPst, cfm)
1403 TRC2(rgLMMFillCfmPst)
1404 inst = (reqPst->dstInst - RG_INST_START);
1406 cfmPst->srcEnt = rgCb[inst].rgInit.ent;
1407 cfmPst->srcInst = rgCb[inst].rgInit.inst;
1408 cfmPst->srcProcId = rgCb[inst].rgInit.procId;
1409 cfmPst->dstEnt = reqPst->srcEnt;
1410 cfmPst->dstInst = reqPst->srcInst;
1411 cfmPst->dstProcId = reqPst->srcProcId;
1413 cfmPst->selector = cfm->hdr.response.selector;
1414 cfmPst->prior = cfm->hdr.response.prior;
1415 cfmPst->route = cfm->hdr.response.route;
1416 cfmPst->region = cfm->hdr.response.mem.region;
1417 cfmPst->pool = cfm->hdr.response.mem.pool;
1424 * @brief Timer start handler.
1428 * Function : rgLMMStartTmr
1430 * This function based on the input parameters starts the timer for
1431 * "tmrVal" duration. As of now MAC uses the timer functionality for
1432 * BndReq only. Hence there is no conditional code based on "tmrEvnt".
1434 * @param[in] Inst inst
1435 * @param[in] S16 tmrEvnt, the Timer Event
1436 * @param[in] U32 tmrVal, the Wait Time
1437 * @param[in] PTR cb, Entry for which Timer expired
1442 PUBLIC S16 rgLMMStartTmr
1445 S16 tmrEvnt, /* Timer Event */
1446 U32 tmrVal, /* Wait Time */
1447 PTR cb /* Entry for which Timer Expired */
1450 PUBLIC S16 rgLMMStartTmr(tmrEvnt, tmrVal, cb)
1452 S16 tmrEvnt; /* Timer Event */
1453 U32 tmrVal; /* Wait Time */
1454 PTR cb; /* Entry for which Timer Expired */
1463 /* Initialize the arg structure */
1464 cmMemset((U8 *)&arg, 0, sizeof(CmTmrArg));
1466 arg.tqCp = &rgCb[inst].tmrTqCp;
1467 arg.tq = rgCb[inst].tmrTq;
1468 arg.timers = rgCb[inst].tmrBlk;
1471 arg.max = RG_MAX_TIMER;
1472 arg.evnt = RG_BNDREQ_TMR;
1481 * @brief Timer stop handler.
1485 * Function : rgLMMStopTmr
1487 * This function based on the input parameters stops the timer for
1488 * "tmrEvnt". As of now MAC uses the timer functionality for
1489 * BndReq only. Hence there is no conditional code based on "tmrEvnt".
1490 * Once the bind happens and this timer is stopped, the timer functionality
1491 * is deregistered with SSI. As there is no further use of timer processing.
1493 * @param[in] Inst inst
1494 * @param[in] S16 tmrEvnt, the Timer Event
1495 * @param[in] PTR cb, Entry for which Timer expired
1501 PUBLIC S16 rgLMMStopTmr
1503 Inst inst, /* Scheduler instance */
1504 S16 tmrEvnt, /* Timer Event */
1505 PTR cb /* Entry for which Timer Expired */
1508 PUBLIC S16 rgLMMStopTmr(inst,tmrEvnt, cb)
1509 Inst inst; /* Scheduler instance */
1510 S16 tmrEvnt; /* Timer Event */
1511 PTR cb; /* Entry for which Timer Expired */
1522 for(i=0;i<RG_MAX_TIMER;i++)
1524 /* Search for the Timer Blocks */
1525 if(rgCb[inst].tmrBlk[i].tmrEvnt == tmrEvnt)
1527 /* Initialize the arg structure */
1528 cmMemset((U8 *)&arg, 0, sizeof(CmTmrArg));
1530 arg.tqCp = &rgCb[inst].tmrTqCp;
1531 arg.tq = rgCb[inst].tmrTq;
1532 arg.timers = rgCb[inst].tmrBlk;
1534 arg.max = RG_MAX_TIMER;
1552 * @brief Timer Expiry handler.
1556 * Function : rgLMMTmrExpiry
1558 * This is a callback function used as an input parameter to cmPrcTmr()
1559 * to check expiry of any timer. In this function, the only concern is
1560 * about tmrEvnt=Bind timer.
1562 * @param[in] PTR cb, Entry for which Timer expired
1563 * @param[in] S16 tmrEvnt, the Timer Event
1568 PUBLIC S16 rgLMMTmrExpiry
1570 PTR cb, /* Pointer to timer control block */
1571 S16 tmrEvnt /* Timer Event */
1574 PUBLIC S16 rgLMMTmrExpiry(cb,tmrEvnt)
1575 PTR cb; /* Pointer to timer control block */
1576 S16 tmrEvnt; /* Timer Event */
1580 RgLowSapCb *tfuSap = (RgLowSapCb *)cb;
1581 Inst inst = tfuSap->sapCfg.sapPst.srcInst - RG_INST_START;
1583 TRC2(rgLMMTmrExpiry)
1589 tfuSap->numBndRetries++;
1590 if(tfuSap->numBndRetries > RG_MAX_BNDRETRY)
1592 rgLMMStaInd(inst,LCM_CATEGORY_INTERFACE, LCM_EVENT_BND_FAIL,
1593 LCM_CAUSE_TMR_EXPIRED, NULLP);
1597 /* Restart the bind timer */
1598 if (tfuSap->sapCfg.bndTmr.enb == TRUE)
1600 ret = rgLMMStartTmr(inst,RG_BNDREQ_TMR, tfuSap->sapCfg.bndTmr.val,
1604 /* Send bind request */
1605 rgLIMTfuBndReq(inst,rgCb[inst].tfuSap.sapCfg.suId,
1606 rgCb[inst].tfuSap.sapCfg.spId);
1610 RLOG1(L_ERROR, "Invalid tmrEvnt=%d",tmrEvnt);
1620 * @brief Layer Manager Unsolicited Status Indication generation.
1624 * Function : rgLMMStaInd
1626 * This API is used by the other modules of MAC to send a unsolicited
1627 * status indication to the Layer Manager.
1629 * @param[in] Inst inst
1630 * @param[in] U16 category, the Alarm category
1631 * @param[in] U16 event, the Alarm event
1632 * @param[in] U16 cause, the cause of the Alarm
1633 * @param[in] RgUstaDgn *dgn, Alarm Diagonostics
1638 PUBLIC S16 rgLMMStaInd
1647 PUBLIC S16 rgLMMStaInd(inst,category, event, cause, dgn)
1659 if(rgCb[inst].rgInit.usta == FALSE)
1664 cmMemset((U8 *)&usta, 0, sizeof(RgMngmt));
1666 SGetDateTime(&usta.t.usta.cmAlarm.dt);
1667 usta.t.usta.cmAlarm.category = category;
1668 usta.t.usta.cmAlarm.event = event;
1669 usta.t.usta.cmAlarm.cause = cause;
1672 cmMemcpy((U8 *)&usta.t.usta.dgn, (U8 *)dgn, sizeof(RgUstaDgn));
1675 rgCb[inst].rgInit.lmPst.selector = rgCb[inst].genCfg.ustaResp.response.selector;
1676 rgCb[inst].rgInit.lmPst.prior = rgCb[inst].genCfg.ustaResp.response.prior;
1677 rgCb[inst].rgInit.lmPst.route = rgCb[inst].genCfg.ustaResp.response.route;
1678 rgCb[inst].rgInit.lmPst.region = rgCb[inst].genCfg.ustaResp.response.mem.region;
1679 rgCb[inst].rgInit.lmPst.pool = rgCb[inst].genCfg.ustaResp.response.mem.pool;
1680 usta.hdr.transId = rgCb[inst].genCfg.ustaResp.transId;
1682 RETVALUE(RgMiLrgStaInd(&rgCb[inst].rgInit.lmPst, &usta));
1687 * @brief Layer Manager Trace Indication generation.
1691 * Function : rgLMMTrcInd
1693 * This API is used by the other modules of MAC to send a
1694 * Trace indication to the Layer Manager.
1696 * @param[in] Inst inst
1697 * @param[in] Buffer *srcMbuf, the Message Buffer .
1698 * @param[in] U8 event, the trace event.
1702 PUBLIC Void rgLMMTrcInd
1705 Buffer *srcMbuf, /* Message Buffer */
1706 U8 event /* event */
1709 PUBLIC Void rgLMMTrcInd(inst,srcMbuf,event)
1711 Buffer *srcMbuf; /* Message Buffer */
1712 U8 event; /* event */
1715 Buffer *dstMbuf = NULLP;
1725 if ((rgCb[inst].trcLen == LRG_NO_TRACE) || (srcMbuf == NULLP))
1727 RLOG0(L_ERROR, "Trace Disabled.");
1731 cmMemset((U8 *)&trc, 0, sizeof(RgMngmt));
1733 pst = rgCb[inst].rgInit.lmPst;
1734 pst.selector = rgCb[inst].genCfg.trcResp.response.selector;
1735 pst.prior = rgCb[inst].genCfg.trcResp.response.prior;
1736 pst.route = rgCb[inst].genCfg.trcResp.response.route;
1737 pst.region = rgCb[inst].genCfg.trcResp.response.mem.region;
1738 pst.pool = rgCb[inst].genCfg.trcResp.response.mem.pool;
1740 trc.hdr.transId = rgCb[inst].genCfg.trcResp.transId;
1742 SGetDateTime(&trc.t.trc.dt);
1744 /* Check if the whole buffer is to be sent in Trace indication */
1745 if(rgCb[inst].trcLen == LRG_FULL_TRACE)
1747 if (SCpyMsgMsg(srcMbuf, pst.region, pst.pool, &dstMbuf)
1750 RLOG0(L_ERROR, "SCpyMsgMsg Failed.");
1753 trc.cfm.status = LCM_PRIM_OK;
1754 trc.cfm.reason = LCM_REASON_NOT_APPL;
1755 trc.t.trc.evnt = event;
1757 /* Send Trace Indication to Layer manager */
1758 RgMiLrgTrcInd(&pst, &trc, dstMbuf);
1760 /* check if only a specified number of bytes are to be sent */
1761 else if(rgCb[inst].trcLen > 0)
1763 /* Get the length of the recvd message buffer */
1764 if (SFndLenMsg(srcMbuf, &bufLen) != ROK)
1766 RLOG0(L_ERROR, "SFndLenMsg Failed.");
1769 /* Check if the recvd buffer size is less than request trace len */
1770 if(bufLen < rgCb[inst].trcLen)
1772 /* Copy the whole of the recvd buffer in trace indication */
1774 if (SCpyMsgMsg(srcMbuf, pst.region, pst.pool, &dstMbuf)
1777 RLOG0(L_ERROR, "SCpyMsgMsg Failed.");
1781 trc.cfm.status = LCM_PRIM_OK;
1782 trc.cfm.reason = LCM_REASON_NOT_APPL;
1783 trc.t.trc.evnt = event;
1785 /* Send Trace Indication to Layer manager */
1786 RgMiLrgTrcInd(&pst, &trc, dstMbuf);
1788 /* if the recvd buffer size is greater than request trace len */
1789 if(bufLen >= rgCb[inst].trcLen)
1791 /* Get a temporary buffer to store the msg */
1792 if (rgAllocSBuf(inst,&tempBuf, rgCb[inst].trcLen) != ROK)
1794 RLOG0(L_ERROR, "rgAllocSBuf Failed.");
1798 /* Copy trcLen nos of bytes from the recvd message */
1799 if (SCpyMsgFix(srcMbuf,0,rgCb[inst].trcLen,tempBuf,&tempCnt) != ROK)
1801 RLOG0(L_ERROR, "SCpyMsgFix Failed.");
1805 if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
1807 RLOG0(L_ERROR, "dstMbuf Allocation Failed");
1810 /* Copy the tempBuf data to dst mBuf */
1811 if (SCpyFixMsg(tempBuf,dstMbuf,0,rgCb[inst].trcLen,&tempCnt) != ROK)
1813 RLOG0(L_ERROR, "SCpyFixMsg Failed.");
1817 /*ccpu00117052 - MOD - Passing double pointer for proper NULLP
1819 /* Free the memory allocated for tempBuf */
1820 rgFreeSBuf(inst,&tempBuf, rgCb[inst].trcLen);
1822 trc.cfm.status = LCM_PRIM_OK;
1823 trc.cfm.reason = LCM_REASON_NOT_APPL;
1824 trc.t.trc.evnt = event;
1826 /* Send Trace Indication to Layer manager */
1827 RgMiLrgTrcInd(&pst, &trc, dstMbuf);
1835 * @brief Layer Manager Control Confirm generation handler
1836 * for Bind Confirm reception at TFU interface.
1837 * RgLiTfuBndCfm() forwards the confirmation to this
1838 * function. All SAP state related handling is restricted
1839 * to LMM modules, hence the cfm forwarding.
1843 * Function : rgLMMBndCfm
1845 * This API is used by the LIM module of MAC to forward
1846 * the Bind Confirm it receives over the TFU interface.
1848 * @param[in] Pst *pst, Post Structure
1849 * @param[in] SuId suId, Service user ID
1850 * @param[in] U8 status, Status
1855 PUBLIC S16 rgLMMBndCfm
1857 Pst *pst, /* Post Structure */
1858 SuId suId, /* Service user ID */
1859 U8 status /* Status */
1862 PUBLIC S16 rgLMMBndCfm(pst,suId,status)
1863 Pst *pst; /* Post Structure */
1864 SuId suId; /* Service user ID */
1865 U8 status; /* Status */
1868 Inst inst = pst->dstInst - RG_INST_START;
1877 /* Check if the suId is valid */
1878 if(rgCb[inst].tfuSap.sapCfg.suId != suId)
1880 RLOG0(L_ERROR, "Invalid SuId");
1884 /* check the Sap State */
1885 switch(rgCb[inst].tfuSap.sapSta.sapState)
1887 case LRG_WAIT_BNDCFM:
1890 /* SAP is already bound */
1896 cfmPst = rgCb[inst].rgInit.lmPst;
1897 cfmPst.selector = rgCb[inst].genCfg.bndCfmResp.response.selector;
1898 cfmPst.prior = rgCb[inst].genCfg.bndCfmResp.response.prior;
1899 cfmPst.route = rgCb[inst].genCfg.bndCfmResp.response.route;
1900 cfmPst.region = rgCb[inst].genCfg.bndCfmResp.response.mem.region;
1901 cfmPst.pool = rgCb[inst].genCfg.bndCfmResp.response.mem.pool;
1903 cmMemset((U8 *)&cntrlCfm, 0, sizeof(RgMngmt));
1907 case CM_BND_OK: /* status is OK */
1908 /* Change SAP state to Bound */
1909 rgCb[inst].tfuSap.sapSta.sapState = LRG_BND;
1910 if (rgCb[inst].tfuSap.sapCfg.bndTmr.enb == TRUE)
1912 ret = rgLMMStopTmr(inst,RG_BNDREQ_TMR, (PTR)&rgCb[inst].tfuSap);
1914 /* Send Control Confirm with status as OK to Layer Manager */
1915 cntrlCfm.cfm.status = LCM_PRIM_OK;
1916 cntrlCfm.cfm.reason = LCM_REASON_NOT_APPL;
1920 /* Change SAP state to UnBound */
1921 rgCb[inst].tfuSap.sapSta.sapState = LRG_UNBND;
1922 if (rgCb[inst].tfuSap.sapCfg.bndTmr.enb == TRUE)
1924 ret = rgLMMStopTmr(inst,RG_BNDREQ_TMR, (PTR)&rgCb[inst].tfuSap);
1926 /* Send Control Confirm with status as NOK to Layer Manager */
1927 cntrlCfm.cfm.status = LCM_PRIM_NOK;
1928 cntrlCfm.cfm.reason = LCM_REASON_NEG_CFM;
1931 rgCb[inst].tfuSap.numBndRetries = 0;
1932 cntrlCfm.hdr.elmId.elmnt = STTFUSAP;
1933 cntrlCfm.hdr.transId = rgCb[inst].genCfg.bndCfmResp.transId;
1935 ret = RgMiLrgCntrlCfm(&cfmPst, &cntrlCfm);
1942 * @brief LTE MAC timer call back function registered with SSI.
1946 * Function : rgActvTmr
1948 * This function is invoked by SSI for every timer activation
1955 PUBLIC S16 rgActvTmr
1961 PUBLIC S16 rgActvTmr(ent, inst)
1966 Inst macInst = (inst - RG_INST_START);
1969 /* Check if any MAC timer has expired */
1970 cmPrcTmr(&rgCb[macInst].tmrTqCp, rgCb[macInst].tmrTq, (PFV) rgLMMTmrExpiry);
1974 } /* end of rgActvTmr */
1977 * @brief Layer Manager Configuration request handler for Scheduler
1981 * Function : MacSchGenCfgReq
1983 * This function receives general configurations for Scheduler
1984 * from DU APP and forwards to Scheduler.
1986 * @param[in] Pst *pst, the post structure
1987 * @param[in] RgMngmt *cfg, the configuration parameter's structure
1992 PUBLIC S16 MacSchGenCfgReq
1994 Pst *pst, /* post structure */
1995 RgMngmt *cfg /* config structure */
1998 PUBLIC S16 MacSchGenCfgReq(pst, cfg)
1999 Pst *pst; /* post structure */
2000 RgMngmt *cfg; /* config structure */
2003 printf("\nReceived Scheduler gen config at MAC");
2004 pst->dstInst = DEFAULT_CELLS + 1;
2005 HandleSchGenCfgReq(pst, cfg);
2011 * @brief Layer Manager Configuration response from Scheduler
2015 * Function : SchSendCfgCfm
2017 * This function sends general configurations response from
2018 * Scheduler to DU APP.
2020 * @param[in] Pst *pst, the post structure
2021 * @param[in] RgMngmt *cfm, the configuration confirm structure
2026 PUBLIC S16 SchSendCfgCfm
2028 Pst *pst, /* post structure */
2029 RgMngmt *cfm /* config confirm structure */
2032 PUBLIC S16 SchSendCfgCfm(pst, cfm)
2033 Pst *pst; /* post structure */
2034 RgMngmt *cfm; /* config confirm structure */
2037 printf("\nSending Scheduler config confirm to DU APP");
2038 pst->dstEnt = ENTDUAPP;
2041 pst->selector = MAC_SCH_LC_SELECTOR;
2042 RgMiLrgSchCfgCfm(pst, cfm);
2048 /***********************************************************
2050 * Func : macCellCfgFillCfmPst
2053 * Desc : Fills the Confirmation Post Structure cfmPst
2061 **********************************************************/
2062 Void macCellCfgFillCfmPst
2069 inst = reqPst->dstInst;
2071 cfmPst->srcEnt = rgCb[inst].rgInit.ent;
2072 cfmPst->srcInst = rgCb[inst].rgInit.inst;
2073 cfmPst->srcProcId = rgCb[inst].rgInit.procId;
2075 cfmPst->dstEnt = ENTDUAPP;
2076 cfmPst->dstInst = 0;
2077 cfmPst->dstProcId = cfmPst->srcProcId;
2079 cfmPst->selector = LRG_SEL_LC;
2080 cfmPst->prior = reqPst->prior;
2081 cfmPst->route = reqPst->route;
2082 cfmPst->region = reqPst->region;
2083 cfmPst->pool = reqPst->pool;
2084 cfmPst->event = EVENT_MAC_CELL_CONFIG_CFM;
2090 * @brief Layer Manager Configuration request handler.
2094 * Function : MacHdlCellCfgReq
2096 * This function handles the gNB and cell configuration
2097 * request received from DU APP.
2098 * This API unapcks and forwards the config towards SCH
2100 * @param[in] Pst *pst
2101 * @param[in] MacCellCfg *macCellCfg
2105 int MacHdlCellCfgReq
2108 MacCellCfg *macCellCfg
2114 MacCellCb *macCellCb;
2115 Inst inst = pst->dstInst;
2117 cmMemset((U8 *)&cfmPst, 0, sizeof(Pst));
2118 MAC_ALLOC(cellCb,sizeof(RgCellCb));
2122 DU_LOG("\nMAC : cellCb is NULL at handling of macCellCfg\n");
2126 memcpy(&cellCb->macCellCfg,macCellCfg,sizeof(MacCellCfg));
2127 rgCb[inst].cell = cellCb;
2129 MAC_ALLOC(macCellCb,sizeof(MacCellCb));
2130 if(macCellCb == NULLP)
2132 DU_LOG("\nMAC : macCellCb is NULL at handling of macCellCfg\n");
2135 macCb.macCell = macCellCb;
2136 macCb.macCell->cellId = macCellCfg->cellId;
2137 /* Send cell cfg to scheduler */
2138 ret = MacSchCellCfgReq(pst, macCellCfg);
2141 MacCellCfgCfm macCellCfgCfm;
2142 macCellCfgCfm.rsp = RSP_NOK;
2143 macCellCfgCfm.transId = macCellCfg->transId;
2144 macCellCfgFillCfmPst(pst,&cfmPst);
2145 ret = (*packMacCellCfmOpts[cfmPst.selector])(&cfmPst,&macCellCfgCfm);
2148 LwrMacEnqueueWlsBlock();
2151 } /* end of MacHdlCellCfgReq */
2154 * @brief Layer Manager Configuration request handler.
2158 * Function : MacSchCellCfgReq
2160 * This function sends cell configuration to SCH
2162 * @param[in] Pst *pst
2163 * @param[in] MacCellCfg *macCellCfg
2167 int MacSchCellCfgReq
2170 MacCellCfg *macCellCfg
2173 SchCellCfg schCellCfg;
2177 cmMemset((U8 *)&cfgPst, 0, sizeof(Pst));
2178 schCellCfg.cellId = macCellCfg->cellId;
2179 schCellCfg.phyCellId = macCellCfg->phyCellId;
2180 schCellCfg.bandwidth = macCellCfg->dlCarrCfg.bw;
2181 schCellCfg.dupMode = macCellCfg->dupType;
2183 /* fill ssb scheduler parameters */
2184 schCellCfg.ssbSchCfg.ssbPbchPwr = macCellCfg->ssbCfg.ssbPbchPwr;
2185 schCellCfg.ssbSchCfg.scsCommon = macCellCfg->ssbCfg.scsCmn;
2186 schCellCfg.ssbSchCfg.ssbOffsetPointA = macCellCfg->ssbCfg.ssbOffsetPointA;
2187 schCellCfg.ssbSchCfg.ssbPeriod = macCellCfg->ssbCfg.ssbPeriod;
2188 schCellCfg.ssbSchCfg.ssbSubcOffset = macCellCfg->ssbCfg.ssbScOffset;
2189 for(uint8_t idx=0; idx<SSB_MASK_SIZE; idx++)
2191 schCellCfg.ssbSchCfg.nSSBMask[idx] = macCellCfg->ssbCfg.ssbMask[idx];
2194 /* fill SIB1 scheduler parameters */
2195 schCellCfg.sib1SchCfg.sib1PduLen = macCellCfg->sib1Cfg.sib1PduLen;
2196 schCellCfg.sib1SchCfg.sib1NewTxPeriod = macCellCfg->sib1Cfg.sib1NewTxPeriod;
2197 schCellCfg.sib1SchCfg.sib1RepetitionPeriod = macCellCfg->sib1Cfg.sib1RepetitionPeriod;
2198 schCellCfg.sib1SchCfg.coresetZeroIndex = macCellCfg->sib1Cfg.coresetZeroIndex;
2199 schCellCfg.sib1SchCfg.searchSpaceZeroIndex = macCellCfg->sib1Cfg.searchSpaceZeroIndex;
2200 schCellCfg.sib1SchCfg.sib1Mcs = macCellCfg->sib1Cfg.sib1Mcs;
2202 cfgPst.srcProcId = pst->dstProcId;
2203 cfgPst.dstProcId = pst->srcProcId;
2204 cfgPst.srcEnt = ENTRG;
2206 cfgPst.dstEnt = ENTRG;
2208 cfgPst.selector = MAC_SCH_TC_SELECTOR;
2209 cfgPst.event = EVENT_SCH_CELL_CFG;
2211 ret = (*SchCellCfgOpts[cfgPst.selector])(&cfgPst, &schCellCfg);
2213 } /* end of MacSchCellCfgReq */
2216 /*******************************************************************
2218 * @brief Sends Cell config confirm to DU APP
2222 * Function : MacSendCellCfgCfm
2225 * Sends Cell config confirm to DU APP
2227 * @params[in] Response status
2230 * ****************************************************************/
2231 void MacSendCellCfgCfm(uint8_t response)
2235 MacCellCfgCfm macCellCfgCfm;
2237 cmMemset((U8 *)&pst, 0, sizeof(Pst));
2238 cellCb = rgCb[macCb.macInst].cell;
2240 macCellCfgCfm.transId = cellCb->macCellCfg.transId;
2241 macCellCfgCfm.rsp = response;
2243 memcpy((void *)&pst, (void *)&rgCb[macCb.macInst].rgInit.lmPst, sizeof(Pst));
2244 pst.event = EVENT_MAC_CELL_CONFIG_CFM;
2245 (*packMacCellCfmOpts[pst.selector])(&pst,&macCellCfgCfm);
2250 * @brief Layer Manager Configuration response handler.
2254 * Function : MacProcSchCellCfgCfm
2256 * This function processes cell configuration to SCH
2258 * @param[in] Pst *pst
2259 * @param[in] SchCellCfgCfm *schCellCfgCfm
2263 int MacProcSchCellCfgCfm
2266 SchCellCfgCfm *schCellCfgCfm
2269 if(schCellCfgCfm->rsp == RSP_OK)
2271 sendToLowerMac(PARAM_REQUEST, 0, (void *)NULL);
2275 MacSendCellCfgCfm(RSP_NOK);
2280 /**********************************************************************
2283 **********************************************************************/