[Epic-ID: ODUHIGH-402][Task-ID: ODUHIGH-418] Harq feature changes
[o-du/l2.git] / src / cm / mac_sch_interface.c
1 /* header include files (.h) */
2 #include "common_def.h"
3 #include "lrg.h"
4
5 /* header/extern include files (.x) */
6 #include "lrg.x"
7 #include "mac_sch_interface.h"
8
9 /**
10  * @brief function to send Slot ind message from MAC
11  *        to scheduler with loose coupling 
12  *
13  * @details
14  *
15  *     Function : packMacSchSlotInd
16  *     
17  *     
18  *  @param[in]  Pst *pst, the post structure     
19  *  @param[in]  *slotInd, the value of SFN and slot
20  *  @return  S16
21  *      -# ROK
22  **/
23 uint8_t packMacSchSlotInd(Pst *pst, SlotTimingInfo *slotInd)
24 {
25    Buffer *mBuf = NULLP;
26    if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK)
27    {
28       return RFAILED;
29    }
30
31    /* pack SFN and slot value */
32    CMCHKPK(oduUnpackUInt16,slotInd->sfn, mBuf);
33    CMCHKPK(oduUnpackUInt16,slotInd->slot, mBuf);
34
35    return ODU_POST_TASK(pst,mBuf);
36 }
37
38 /**
39  * @brief function to unpack Slot ind message from MAC
40  *        to scheduler with loose coupling
41  *
42  * @details
43  *
44  *     Function : unpackMacSchSlotInd
45  *
46  *
47  *  @param[in]  Pst *pst, the post structure
48  *  @param[in]  Buffer *mBuf, the message buffer
49  *  @return  S16
50  *      -# ROK
51  **/
52 uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer  *mBuf)
53 {
54    /* TODO */
55    return ROK;
56 }
57
58
59 /*******************************************************************
60  *
61  * @brief Pack and Send Rach Ind from MAC to SCH
62  *
63  * @details
64  *
65  *    Function : packMacSchRachInd
66  *
67  *    Functionality:
68  *      Pack and Send Rach Ind from MAC to SCH
69  *
70  * @params[in] 
71  * @return ROK     - success
72  *         RFAILED - failure
73  *
74  * ****************************************************************/
75 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd)
76 {
77    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
78    {
79       /* TODO */
80    }
81    else
82    {
83       return RFAILED;
84    }
85    return ROK;
86 }
87
88 /*******************************************************************
89  *
90  * @brief Pack and Send Crc Ind from MAC to SCH
91  *
92  * @details
93  *
94  *    Function : packMacSchCrcInd
95  *
96  *    Functionality:
97  *       Pack and Send Crc Ind from MAC to SCH
98  *
99  * @params[in] 
100  * @return ROK     - success
101  *         RFAILED - failure
102  *
103  * ****************************************************************/
104 uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
105 {
106    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
107    {
108       /* TODO */
109    }
110    else
111    {
112       return RFAILED;
113    }
114    return ROK;
115 }
116
117 /*******************************************************************
118  *
119  * @brief Pack and Send DL RLC BO Info from MAC to SCH
120  *
121  * @details
122  *
123  *    Function : packMacSchDlRlcBoInfo
124  *
125  *    Functionality:
126  *       Pack and Send L RLC BO Info from MAC to SCH
127  *
128  * @params[in] 
129  * @return ROK     - success
130  *         RFAILED - failure
131  *
132  * ****************************************************************/
133 uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo)
134 {
135    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
136    {
137       /* TODO */
138    }
139    else
140    {
141       return RFAILED;
142    }
143    return ROK;
144 }
145
146 /**
147  * @brief function to pack DL Broadcast allocation message 
148  *        from MAC to SCH
149  *
150  * @details
151  *
152  *     Function : packSchMaccDlAlloc 
153  *     
154  *     
155  *  @param[in]  Pst *pst, the post structure     
156  *  @param[in]  DlSchedInfo  *dlSchedInfo
157  *  @return  S16
158  *      -# ROK
159  **/
160 uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo  *dlSchedInfo)
161 {
162    return ROK;
163 }
164
165 /**
166  * @brief function to pack UL Sch Info  message 
167  *        from SCH to MAC
168  *
169  * @details
170  *
171  *     Function : packSchMacUlSchInfo 
172  *     
173  *     
174  *  @param[in]  Pst *pst, the post structure     
175  *  @param[in]  UlSchedInfo *ulSchedInfo
176  *  @return  S16
177  *      -# ROK
178  **/
179 uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo)
180 {
181    return ROK;
182 }
183
184 /**
185  * @brief function to pack cell cfg from MAC to SCH
186  *
187  * @details
188  *
189  *     Function : packSchCellCfg 
190  *     
191  *     
192  *  @param[in]  Pst *pst, the post structure     
193  *  @param[in]  *schCellCfg, SchCellCfg structure
194  *  @return  S16
195  *      -# ROK
196  **/
197 uint8_t packSchCellCfg(Pst *pst, SchCellCfg  *schCellCfg)
198 {
199    return ROK;
200 }
201
202 /**
203  * @brief function to pack cell cfg cfm from SCH to MAC
204  *
205  * @details
206  *
207  *     Function : packSchCellCfgCfm
208  *     
209  *     
210  *  @param[in]  Pst *pst, the post structure     
211  *  @param[in]  *schCellCfgCfm, SchCellCfgCfm structure
212  *  @return  S16
213  *      -# ROK
214  **/
215 uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm)
216 {
217    return ROK;
218 }
219
220 /*******************************************************************
221  *
222  * @brief Pack and Send UE Config Request from MAC to SCH
223  *
224  * @details
225  *
226  *    Function : packMacSchAddUeConfigReq
227  *
228  *    Functionality:
229  *       Pack and Send UE Create Request from MAC to SCH
230  *
231  * @params[in]
232  * @return ROK     - success
233  *         RFAILED - failure
234  *
235  * ****************************************************************/
236 uint8_t packMacSchAddUeConfigReq(Pst *pst, SchUeCfg  *ueCfg)
237 {
238    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
239    {
240       /* TODO */
241    }
242    else
243    {
244       return RFAILED; 
245    }
246    return ROK;
247 }
248
249
250 /*******************************************************************
251  *
252  * @brief Packs and send UE create response
253  *
254  * @details 
255  *
256  *    Function : packSchUeCfgRsp
257  *
258  *    Functionality:
259  *      Packs and send UE create response
260  *
261  * @params[in] Post structure
262  *             UE config response
263  * @return ROK     - success
264  *         RFAILED - failure
265  *
266  * ****************************************************************/
267 uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp)
268 {
269    return ROK;
270 }
271 /*******************************************************************
272  *
273  * @brief Pack and Send BSR from MAC to SCH
274  *
275  * @details
276  *
277  *    Function : packMacSchBsr
278  *
279  *    Functionality:
280  *       Pack and Send BSR from MAC to SCH
281  *
282  * @params[in]
283  * @return ROK     - success
284  *         RFAILED - failure
285  *
286  * ****************************************************************/
287 uint8_t packMacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd)
288 {
289    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
290    {
291       /* TODO */
292    }
293    else
294    {
295       return RFAILED;
296    }
297    return ROK;
298 }
299
300 /*******************************************************************
301  *
302  * @brief Pack and Send SR UCI Ind from MAC to SCH
303  *
304  * @details
305  *
306  *    Function : packMacSrSchUciInd
307  *
308  *    Functionality:
309  *       Pack and Send SR UCI Ind from MAC to SCH
310  *
311  * @params[in] 
312  * @return ROK     - success
313  *         RFAILED - failure
314  *
315  * ****************************************************************/
316 uint8_t packMacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd)
317 {
318    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
319    {
320       /* TODO */
321    }
322    else
323    {
324       return RFAILED;
325    }
326    return ROK;
327 }
328
329 /*******************************************************************
330  *
331  * @brief Pack and Send HARQ UCI Ind from MAC to SCH
332  *
333  * @details
334  *
335  *    Function : packMacHarqSchUciInd
336  *
337  *    Functionality:
338  *       Pack and Send HARQ UCI Ind from MAC to SCH
339  *
340  * @params[in]
341  * @return ROK     - success
342  *         RFAILED - failure
343  *
344  * ****************************************************************/
345 uint8_t packMacSchHarqUciInd(Pst *pst, HarqUciIndInfo *uciInd)
346 {
347    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
348    {
349       /* TODO */
350    }
351    else
352    {
353       return RFAILED;
354    }
355    return ROK;
356 }
357
358
359 /*******************************************************************
360  *
361  * @brief Pack and Send Modify UE Config Request from MAC to SCH
362  *
363  * @details
364  *
365  *    Function : packMacSchModUeConfigReq
366  *
367  *    Functionality:
368  *       Pack and Send Modify UE Config Request from MAC to SCH
369  *
370  * @params[in]
371  * @return ROK     - success
372  *         RFAILED - failure
373  *
374  * ****************************************************************/
375 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg  *ueCfg)
376 {
377    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
378    {
379       /* TODO */
380    }
381    else
382    {
383       return RFAILED; 
384    }
385    return ROK;
386 }
387
388 /*******************************************************************
389  *
390  * @brief Pack and Send RACH resource Request from MAC to SCH
391  *
392  * @details
393  *
394  *    Function : packMacSchRachRsrcReq
395  *
396  *    Functionality:
397  *       Pack and Send RACH resouece Request from MAC to SCH
398  *
399  * @params[in] Post structure
400  *             RACH resource request
401  * @return ROK     - success
402  *         RFAILED - failure
403  *
404  * ****************************************************************/
405 uint8_t packMacSchRachRsrcReq(Pst *pst, SchRachRsrcReq *schRachRsrcReq)
406 {
407    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
408    {
409       /* TODO */
410    }
411    else
412    {
413       return RFAILED; 
414    }
415    return ROK;
416 }
417
418 /*******************************************************************
419  *
420  * @brief Pack and Send RACH resource Response from SCH to MAC
421  *
422  * @details
423  *
424  *    Function : packSchRachRsrcRsp
425  *
426  *    Functionality:
427  *       Pack and Send RACH resource Response from SCH to MAC
428  *
429  * @params[in] Post structure
430  *             RACH resource response
431  * @return ROK     - success
432  *         RFAILED - failure
433  *
434  * ****************************************************************/
435 uint8_t packSchRachRsrcRsp(Pst *pst, SchRachRsrcRsp *schRachRsrcRsp)
436 {
437    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
438    {  
439       /* TODO */
440    }
441    else
442    {  
443       return RFAILED;
444    }
445    return ROK;
446 }
447
448 /*******************************************************************
449  *
450  * @brief Pack and Send RACH resource Release from MAC to SCH
451  *
452  * @details
453  *
454  *    Function : packMacSchRachRsrcRel
455  *
456  *    Functionality:
457  *       Pack and Send RACH resouece Release from MAC to SCH
458  *
459  * @params[in] Post structure
460  *             RACH resource release
461  * @return ROK     - success
462  *         RFAILED - failure
463  *
464  * ****************************************************************/
465 uint8_t packMacSchRachRsrcRel(Pst *pst, SchRachRsrcRel *schRachRsrcRel)
466 {
467    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
468    {   
469       /* TODO */
470    }   
471    else
472    {   
473       return RFAILED; 
474    }   
475    return ROK;
476 }
477
478 /*******************************************************************
479 *
480 * @brief Pack and Send UE Delete Request from MAC to SCH
481 *
482 * @details
483 *
484 *    Function : packMacSchUeDeleteReq 
485 *
486 *    Functionality:
487 *       Pack and Send  UE Delete Request from MAC to SCH
488 *
489 * @params[in]
490 * @return ROK     - success
491 *         RFAILED - failure
492 *
493 * ****************************************************************/
494 uint8_t packMacSchUeDeleteReq(Pst *pst,  SchUeDelete *schUeDel)
495 {
496     if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
497     {
498        /* TODO */
499     }
500     else
501     {
502        return RFAILED;
503     }
504     return ROK;
505 }
506
507 /*******************************************************************
508 *
509 * @brief Packs and send UE delete response
510 *
511 * @details
512 *
513 *    Function : packSchUeDeleteRsp
514 *
515 *    Functionality:
516 *      Packs and send UE delete response
517 *
518 * @params[in] Post structure
519 *             UE delete response
520 * @return ROK     - success
521 *         RFAILED - failure
522 *
523 * ****************************************************************/
524
525 uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp  *delRsp)
526 {
527    return ROK;
528 }
529
530 /*******************************************************************
531  *
532  * @brief Pack and Send Cell Delete Request from MAC to SCH
533  *
534  * @details
535  *
536  *    Function : packMacSchCellDeleteReq
537  *
538  *    Functionality:
539  *       Pack and Send  Cell Delete Request from MAC to SCH
540  *
541  * @params[in] Pst *pst,  SchCellDelete *schCellDelete
542  * @return ROK     - success
543  *         RFAILED - failure
544  *
545  * ****************************************************************/
546 uint8_t packMacSchCellDeleteReq(Pst *pst,  SchCellDelete *schCellDelete)
547 {
548    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
549    {
550       /* TODO */
551    }
552    else
553    {
554       return RFAILED;
555    }
556    return ROK;
557 }
558
559 /*******************************************************************
560  *
561  * @brief Packs and send CELL delete response
562  *
563  * @details
564  *
565  *    Function : packSchCellDeleteRsp
566  *
567  *    Functionality:
568  * * @params[in] Post structure, SchCellDeleteRsp schCellDeleteRsp
569  *
570  * @return ROK     - success
571  *         RFAILED - failure
572  *
573  *
574  * ****************************************************************/
575
576 uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp  *schCellDeleteRsp)
577 {
578    return ROK;
579 }
580
581 /*******************************************************************
582  *
583  * @brief Pack and Send Slice Cfg request from MAC to SCH
584  *
585  * @details
586  *
587  *    Function : packMacSchSliceCfgReq 
588  *
589  *    Functionality:
590  *       Pack and Send Slice Cfg request from MAC to SCH
591  *
592  * @params[in] Pst *pst, SchSliceCfgReq *cfgReq 
593  * @return ROK     - success
594  *         RFAILED - failure
595  *
596  * ****************************************************************/
597 uint8_t packMacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *cfgReq)
598 {
599    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
600    {
601       /* TODO */
602    }
603    else
604    {
605       return RFAILED;
606    }
607    return ROK;
608 }
609
610 /**
611  * @brief function to pack slice cfg rsp from SCH to MAC
612  *
613  * @details
614  *
615  *     Function : packSchSliceCfgRsp 
616  *     
617  *     
618  *  @param[in]  Pst *pst, SchSliceCfgRsp *cfgRsp
619  *  @return  S16 - ROK
620  **/
621 uint8_t packSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp)
622 {
623    return ROK;
624 }
625
626 /*******************************************************************
627  *
628  * @brief Pack and Send Slice ReCfg request from MAC to SCH
629  *
630  * @details
631  *
632  *    Function : packMacSchSliceReCfgReq 
633  *
634  *    Functionality:
635  *       Pack and Send Slice ReCfg request from MAC to SCH
636  *
637  * @params[in] Pst *pst, SchSliceCfgReq *cfgReq 
638  * @return ROK     - success
639  *         RFAILED - failure
640  *
641  * ****************************************************************/
642 uint8_t packMacSchSliceReCfgReq(Pst *pst, SchSliceCfgReq *cfgReq)
643 {
644    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
645    {
646       /* TODO */
647    }
648    else
649    {
650       return RFAILED;
651    }
652    return ROK;
653 }
654
655 /**
656  * @brief function to pack slice cfg rsp from SCH to MAC
657  *
658  * @details
659  *
660  *     Function : packSchSliceReCfgRsp 
661  *     
662  *     
663  *  @param[in]  Pst *pst, SchSliceCfgRsp *cfgRsp
664  *  @return  S16 - ROK
665  **/
666 uint8_t packSchSliceReCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp)
667 {
668    return ROK;
669 }
670
671 /*******************************************************************
672  *
673  * @brief Pack and Send paging indication from MAC to SCH
674  *
675  * @details
676  *
677  *    Function : packMacSchPagingInd
678  *
679  *    Functionality:
680  *       Pack and Send paging indication from MAC to SCH
681  *
682  * @params[in] Pst *pst,  SchPageInd *pageInd
683  * @return ROK     - success
684  *         RFAILED - failure
685  *
686  * ****************************************************************/
687 uint8_t packMacSchPagingInd(Pst *pst,  SchPageInd *pageInd)
688 {
689    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
690    {
691       /* TODO */
692    }
693    else
694    {
695       return RFAILED;
696    }
697    return ROK;
698 }
699
700 /**
701  * @brief function to pack DL Paging allocation message 
702  *        from MAC to SCH
703  *
704  * @details
705  *
706  *     Function : packSchMacDlPageAlloc 
707  *     
708  *     
709  *  @param[in]  Pst *pst, the post structure     
710  *  @param[in]  DlPageAlloc *dlPageAlloc
711  *  @return  S16
712  *      -# ROK
713  **/
714 uint8_t packSchMacDlPageAlloc(Pst *pst, DlPageAlloc *dlPageAlloc)
715 {
716    return ROK;
717 }
718
719 /**
720  * @brief function to pack Harq process release message 
721  *        from SCH to MAC
722  *
723  * @details
724  *
725  *     Function : packSchMacDlReleaseHarq 
726  *     
727  *     
728  *  @param[in]  Pst *pst, the post structure     
729  *  @param[in]  SchRlsHqInfo *rlsHqInfo
730  *  @return  S16
731  *      -# ROK
732  **/
733 uint8_t packSchMacDlReleaseHarq(Pst *pst, SchRlsHqInfo *rlsHqInfo)
734 {
735    return ROK;
736 }
737
738 /**********************************************************************
739   End of file
740  **********************************************************************/
741