[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-447] PCCH Scheduling at SCH
[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 Modify UE Config Request from MAC to SCH
332  *
333  * @details
334  *
335  *    Function : packMacSchModUeConfigReq
336  *
337  *    Functionality:
338  *       Pack and Send Modify UE Config Request from MAC to SCH
339  *
340  * @params[in]
341  * @return ROK     - success
342  *         RFAILED - failure
343  *
344  * ****************************************************************/
345 uint8_t packMacSchModUeConfigReq(Pst *pst, SchUeCfg  *ueCfg)
346 {
347    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
348    {
349       /* TODO */
350    }
351    else
352    {
353       return RFAILED; 
354    }
355    return ROK;
356 }
357
358 /*******************************************************************
359  *
360  * @brief Pack and Send RACH resource Request from MAC to SCH
361  *
362  * @details
363  *
364  *    Function : packMacSchRachRsrcReq
365  *
366  *    Functionality:
367  *       Pack and Send RACH resouece Request from MAC to SCH
368  *
369  * @params[in] Post structure
370  *             RACH resource request
371  * @return ROK     - success
372  *         RFAILED - failure
373  *
374  * ****************************************************************/
375 uint8_t packMacSchRachRsrcReq(Pst *pst, SchRachRsrcReq *schRachRsrcReq)
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 Response from SCH to MAC
391  *
392  * @details
393  *
394  *    Function : packSchRachRsrcRsp
395  *
396  *    Functionality:
397  *       Pack and Send RACH resource Response from SCH to MAC
398  *
399  * @params[in] Post structure
400  *             RACH resource response
401  * @return ROK     - success
402  *         RFAILED - failure
403  *
404  * ****************************************************************/
405 uint8_t packSchRachRsrcRsp(Pst *pst, SchRachRsrcRsp *schRachRsrcRsp)
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 UE Delete Request from MAC to SCH
421 *
422 * @details
423 *
424 *    Function : packMacSchUeDeleteReq 
425 *
426 *    Functionality:
427 *       Pack and Send  UE Delete Request from MAC to SCH
428 *
429 * @params[in]
430 * @return ROK     - success
431 *         RFAILED - failure
432 *
433 * ****************************************************************/
434 uint8_t packMacSchUeDeleteReq(Pst *pst,  SchUeDelete *schUeDel)
435 {
436     if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
437     {
438        /* TODO */
439     }
440     else
441     {
442        return RFAILED;
443     }
444     return ROK;
445 }
446
447 /*******************************************************************
448 *
449 * @brief Packs and send UE delete response
450 *
451 * @details
452 *
453 *    Function : packSchUeDeleteRsp
454 *
455 *    Functionality:
456 *      Packs and send UE delete response
457 *
458 * @params[in] Post structure
459 *             UE delete response
460 * @return ROK     - success
461 *         RFAILED - failure
462 *
463 * ****************************************************************/
464
465 uint8_t packSchUeDeleteRsp(Pst *pst, SchUeDeleteRsp  *delRsp)
466 {
467    return ROK;
468 }
469
470 /*******************************************************************
471  *
472  * @brief Pack and Send Cell Delete Request from MAC to SCH
473  *
474  * @details
475  *
476  *    Function : packMacSchCellDeleteReq
477  *
478  *    Functionality:
479  *       Pack and Send  Cell Delete Request from MAC to SCH
480  *
481  * @params[in] Pst *pst,  SchCellDelete *schCellDelete
482  * @return ROK     - success
483  *         RFAILED - failure
484  *
485  * ****************************************************************/
486 uint8_t packMacSchCellDeleteReq(Pst *pst,  SchCellDelete *schCellDelete)
487 {
488    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
489    {
490       /* TODO */
491    }
492    else
493    {
494       return RFAILED;
495    }
496    return ROK;
497 }
498
499 /*******************************************************************
500  *
501  * @brief Packs and send CELL delete response
502  *
503  * @details
504  *
505  *    Function : packSchCellDeleteRsp
506  *
507  *    Functionality:
508  * * @params[in] Post structure, SchCellDeleteRsp schCellDeleteRsp
509  *
510  * @return ROK     - success
511  *         RFAILED - failure
512  *
513  *
514  * ****************************************************************/
515
516 uint8_t packSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp  *schCellDeleteRsp)
517 {
518    return ROK;
519 }
520
521 /*******************************************************************
522  *
523  * @brief Pack and Send Slice Cfg request from MAC to SCH
524  *
525  * @details
526  *
527  *    Function : packMacSchSliceCfgReq 
528  *
529  *    Functionality:
530  *       Pack and Send Slice Cfg request from MAC to SCH
531  *
532  * @params[in] Pst *pst, SchSliceCfgReq *cfgReq 
533  * @return ROK     - success
534  *         RFAILED - failure
535  *
536  * ****************************************************************/
537 uint8_t packMacSchSliceCfgReq(Pst *pst, SchSliceCfgReq *cfgReq)
538 {
539    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
540    {
541       /* TODO */
542    }
543    else
544    {
545       return RFAILED;
546    }
547    return ROK;
548 }
549
550 /**
551  * @brief function to pack slice cfg rsp from SCH to MAC
552  *
553  * @details
554  *
555  *     Function : packSchSliceCfgRsp 
556  *     
557  *     
558  *  @param[in]  Pst *pst, SchSliceCfgRsp *cfgRsp
559  *  @return  S16 - ROK
560  **/
561 uint8_t packSchSliceCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp)
562 {
563    return ROK;
564 }
565
566 /*******************************************************************
567  *
568  * @brief Pack and Send Slice ReCfg request from MAC to SCH
569  *
570  * @details
571  *
572  *    Function : packMacSchSliceReCfgReq 
573  *
574  *    Functionality:
575  *       Pack and Send Slice ReCfg request from MAC to SCH
576  *
577  * @params[in] Pst *pst, SchSliceCfgReq *cfgReq 
578  * @return ROK     - success
579  *         RFAILED - failure
580  *
581  * ****************************************************************/
582 uint8_t packMacSchSliceReCfgReq(Pst *pst, SchSliceCfgReq *cfgReq)
583 {
584    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
585    {
586       /* TODO */
587    }
588    else
589    {
590       return RFAILED;
591    }
592    return ROK;
593 }
594
595 /**
596  * @brief function to pack slice cfg rsp from SCH to MAC
597  *
598  * @details
599  *
600  *     Function : packSchSliceReCfgRsp 
601  *     
602  *     
603  *  @param[in]  Pst *pst, SchSliceCfgRsp *cfgRsp
604  *  @return  S16 - ROK
605  **/
606 uint8_t packSchSliceReCfgRsp(Pst *pst, SchSliceCfgRsp *cfgRsp)
607 {
608    return ROK;
609 }
610
611 /*******************************************************************
612  *
613  * @brief Pack and Send paging indication from MAC to SCH
614  *
615  * @details
616  *
617  *    Function : packMacSchPagingInd
618  *
619  *    Functionality:
620  *       Pack and Send paging indication from MAC to SCH
621  *
622  * @params[in] Pst *pst,  SchPageInd *pageInd
623  * @return ROK     - success
624  *         RFAILED - failure
625  *
626  * ****************************************************************/
627 uint8_t packMacSchPagingInd(Pst *pst,  SchPageInd *pageInd)
628 {
629    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LC))
630    {
631       /* TODO */
632    }
633    else
634    {
635       return RFAILED;
636    }
637    return ROK;
638 }
639
640 /**
641  * @brief function to pack DL Paging allocation message 
642  *        from MAC to SCH
643  *
644  * @details
645  *
646  *     Function : packSchMacDlPageAlloc 
647  *     
648  *     
649  *  @param[in]  Pst *pst, the post structure     
650  *  @param[in]  DlPageAlloc *dlPageAlloc
651  *  @return  S16
652  *      -# ROK
653  **/
654 uint8_t packSchMacDlPageAlloc(Pst *pst, DlPageAlloc *dlPageAlloc)
655 {
656    return ROK;
657 }
658 /**********************************************************************
659   End of file
660  **********************************************************************/
661