1 /* header include files (.h) */
2 #include "common_def.h"
5 /* header/extern include files (.x) */
7 #include "mac_sch_interface.h"
10 * @brief function to send Slot ind message from MAC
11 * to scheduler with loose coupling
15 * Function : packMacSchSlotInd
18 * @param[in] Pst *pst, the post structure
19 * @param[in] *slotInd, the value of SFN and slot
23 uint8_t packMacSchSlotInd(Pst *pst, SlotTimingInfo *slotInd)
26 if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
31 /* pack SFN and slot value */
32 CMCHKPK(oduUnpackUInt16,slotInd->sfn, mBuf);
33 CMCHKPK(oduUnpackUInt16,slotInd->slot, mBuf);
35 return ODU_POST_TASK(pst,mBuf);
39 * @brief function to unpack Slot ind message from MAC
40 * to scheduler with loose coupling
44 * Function : unpackMacSchSlotInd
47 * @param[in] Pst *pst, the post structure
48 * @param[in] Buffer *mBuf, the message buffer
52 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf)
59 /*******************************************************************
61 * @brief Pack and Send Rach Ind from MAC to SCH
65 * Function : packMacSchRachInd
68 * Pack and Send Rach Ind from MAC to SCH
71 * @return ROK - success
74 * ****************************************************************/
75 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd)
77 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
88 /*******************************************************************
90 * @brief Pack and Send Crc Ind from MAC to SCH
94 * Function : packMacSchCrcInd
97 * Pack and Send Crc Ind from MAC to SCH
100 * @return ROK - success
103 * ****************************************************************/
104 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
106 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
117 /*******************************************************************
119 * @brief Pack and Send DL RLC BO Info from MAC to SCH
123 * Function : packMacSchDlRlcBoInfo
126 * Pack and Send L RLC BO Info from MAC to SCH
129 * @return ROK - success
132 * ****************************************************************/
133 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo)
135 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
147 * @brief function to pack DL Broadcast allocation message
152 * Function : packSchMaccDlAlloc
155 * @param[in] Pst *pst, the post structure
156 * @param[in] DlSchedInfo *dlSchedInfo
160 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
166 * @brief function to pack UL Sch Info message
171 * Function : packSchMacUlSchInfo
174 * @param[in] Pst *pst, the post structure
175 * @param[in] UlSchedInfo *ulSchedInfo
179 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo)
185 * @brief function to pack cell cfg from MAC to SCH
189 * Function : packSchCellCfg
192 * @param[in] Pst *pst, the post structure
193 * @param[in] *schCellCfg, SchCellCfg structure
197 uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg)
203 * @brief function to pack cell cfg cfm from SCH to MAC
207 * Function : packSchCellCfgCfm
210 * @param[in] Pst *pst, the post structure
211 * @param[in] *schCellCfgCfm, SchCellCfgCfm structure
215 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm)
220 /*******************************************************************
222 * @brief Pack and Send UE Config Request from MAC to SCH
226 * Function : packMacSchAddUeConfigReq
229 * Pack and Send UE Create Request from MAC to SCH
232 * @return ROK - success
235 * ****************************************************************/
236 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfgReq *ueCfg)
238 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
250 /*******************************************************************
252 * @brief Packs and send UE create response
256 * Function : packSchUeCfgRsp
259 * Packs and send UE create response
261 * @params[in] Post structure
263 * @return ROK - success
266 * ****************************************************************/
267 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp)
272 /*******************************************************************
274 * @brief Packs and send UE reconfig response
278 * Function : packSchUeRecfgRsp
281 * Packs and send UE reconfig response
283 * @params[in] Post structure
284 * UE re-config response
285 * @return ROK - success
288 * ****************************************************************/
289 uint8_t packSchUeRecfgRsp(Pst *pst, SchUeRecfgRsp *recfgRsp)
294 /*******************************************************************
296 * @brief Pack and Send BSR from MAC to SCH
300 * Function : packMacSchBsr
303 * Pack and Send BSR from MAC to SCH
306 * @return ROK - success
309 * ****************************************************************/
310 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd)
312 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
323 /*******************************************************************
325 * @brief Pack and Send SR UCI Ind from MAC to SCH
329 * Function : packMacSrSchUciInd
332 * Pack and Send SR UCI Ind from MAC to SCH
335 * @return ROK - success
338 * ****************************************************************/
339 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd)
341 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
352 /*******************************************************************
354 * @brief Pack and Send DL HARQ Ind from MAC to SCH
358 * Function : packMacSchDlHarqInd
361 * Pack and Send DL HARQ Ind from MAC to SCH
364 * @return ROK - success
367 * ****************************************************************/
368 uint8_t packMacSchDlHarqInd(Pst *pst, DlHarqInd *dlHarqInd)
370 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
382 /*******************************************************************
384 * @brief Pack and Send Modify UE Config Request from MAC to SCH
388 * Function : packMacSchModUeConfigReq
391 * Pack and Send Modify UE Config Request from MAC to SCH
394 * @return ROK - success
397 * ****************************************************************/
398 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeRecfgReq *ueRecfg)
400 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
411 /*******************************************************************
413 * @brief Pack and Send RACH resource Request from MAC to SCH
417 * Function : packMacSchRachRsrcReq
420 * Pack and Send RACH resouece Request from MAC to SCH
422 * @params[in] Post structure
423 * RACH resource request
424 * @return ROK - success
427 * ****************************************************************/
428 uint8_t packMacSchRachRsrcReq(Pst *pst, SchRachRsrcReq *schRachRsrcReq)
430 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
441 /*******************************************************************
443 * @brief Pack and Send RACH resource Response from SCH to MAC
447 * Function : packSchRachRsrcRsp
450 * Pack and Send RACH resource Response from SCH to MAC
452 * @params[in] Post structure
453 * RACH resource response
454 * @return ROK - success
457 * ****************************************************************/
458 uint8_t packSchRachRsrcRsp(Pst *pst, SchRachRsrcRsp *schRachRsrcRsp)
460 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
471 /*******************************************************************
473 * @brief Pack and Send RACH resource Release from MAC to SCH
477 * Function : packMacSchRachRsrcRel
480 * Pack and Send RACH resouece Release from MAC to SCH
482 * @params[in] Post structure
483 * RACH resource release
484 * @return ROK - success
487 * ****************************************************************/
488 uint8_t packMacSchRachRsrcRel(Pst *pst, SchRachRsrcRel *schRachRsrcRel)
490 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
501 /*******************************************************************
503 * @brief Pack and Send UE Delete Request from MAC to SCH
507 * Function : packMacSchUeDeleteReq
510 * Pack and Send UE Delete Request from MAC to SCH
513 * @return ROK - success
516 * ****************************************************************/
517 uint8_t packMacSchUeDeleteReq(Pst *pst, SchUeDelete *schUeDel)
519 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
530 /*******************************************************************
532 * @brief Packs and send UE delete response
536 * Function : packSchUeDeleteRsp
539 * Packs and send UE delete response
541 * @params[in] Post structure
543 * @return ROK - success
546 * ****************************************************************/
548 uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp *delRsp)
553 /*******************************************************************
555 * @brief Pack and Send Cell Delete Request from MAC to SCH
559 * Function : packMacSchCellDeleteReq
562 * Pack and Send Cell Delete Request from MAC to SCH
564 * @params[in] Pst *pst, SchCellDelete *schCellDelete
565 * @return ROK - success
568 * ****************************************************************/
569 uint8_t packMacSchCellDeleteReq(Pst *pst, SchCellDeleteReq *schCellDelete)
571 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
582 /*******************************************************************
584 * @brief Packs and send CELL delete response
588 * Function : packSchCellDeleteRsp
591 * * @params[in] Post structure, SchCellDeleteRsp schCellDeleteRsp
593 * @return ROK - success
597 * ****************************************************************/
599 uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDeleteRsp)
604 /*******************************************************************
606 * @brief Pack and Send Slice Cfg request from MAC to SCH
610 * Function : packMacSchSliceCfgReq
613 * Pack and Send Slice Cfg request from MAC to SCH
615 * @params[in] Pst *pst, SchSliceCfgReq *cfgReq
616 * @return ROK - success
619 * ****************************************************************/
620 uint8_t packMacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *cfgReq)
622 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
634 * @brief function to pack slice cfg rsp from SCH to MAC
638 * Function : packSchSliceCfgRsp
641 * @param[in] Pst *pst, SchSliceCfgRsp *cfgRsp
644 uint8_t packSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp)
649 /*******************************************************************
651 * @brief Pack and Send Slice ReCfg request from MAC to SCH
655 * Function : packMacSchSliceRecfgReq
658 * Pack and Send Slice ReCfg request from MAC to SCH
660 * @params[in] Pst *pst, SchSliceRecfgReq *cfgReq
661 * @return ROK - success
664 * ****************************************************************/
665 uint8_t packMacSchSliceRecfgReq(Pst *pst, SchSliceRecfgReq *sliceRecfgReq)
667 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
679 * @brief function to pack slice cfg rsp from SCH to MAC
683 * Function : packSchSliceRecfgRsp
686 * @param[in] Pst *pst, SchSliceRecfgRsp *cfgRsp
689 uint8_t packSchSliceRecfgRsp(Pst *pst, SchSliceRecfgRsp *recfgRsp)
694 /*******************************************************************
696 * @brief Pack and Send paging indication from MAC to SCH
700 * Function : packMacSchPagingInd
703 * Pack and Send paging indication from MAC to SCH
705 * @params[in] Pst *pst, SchPageInd *pageInd
706 * @return ROK - success
709 * ****************************************************************/
710 uint8_t packMacSchPagingInd(Pst *pst, SchPageInd *pageInd)
712 if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
724 * @brief function to pack DL Paging allocation message
729 * Function : packSchMacDlPageAlloc
732 * @param[in] Pst *pst, the post structure
733 * @param[in] DlPageAlloc *dlPageAlloc
737 uint8_t packSchMacDlPageAlloc(Pst *pst, DlPageAlloc *dlPageAlloc)
743 * @brief function to pack Harq process release message
748 * Function : packSchMacDlReleaseHarq
751 * @param[in] Pst *pst, the post structure
752 * @param[in] SchRlsHqInfo *rlsHqInfo
756 uint8_t packSchMacDlReleaseHarq(Pst *pst, SchRlsHqInfo *rlsHqInfo)
761 /**********************************************************************
763 **********************************************************************/