Moving all common header file into common_def.h file
[o-du/l2.git] / src / 5gnrmac / lwr_mac_upr_inf.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18 #include "common_def.h"
19 #include "lwr_mac_upr_inf.h"
20
21 /*******************************************************************
22  *
23  * @brief Packs and Sends CRC Ind to MAC
24  *
25  * @details
26  *
27  *    Function : packCrcInd
28  *
29  *    Functionality:
30  *      Packs and Sends CRC Ind to MAC
31  *
32  * @params[in] Post structure pointer
33  *             CRC indication
34  * @return ROK     - success
35  *         RFAILED - failure
36  *
37  * ****************************************************************/
38 uint16_t packCrcInd(Pst *pst, CrcInd *crcInd)
39 {
40    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
41    {
42       return ROK;
43    }
44    return RFAILED;
45 }
46
47 /*******************************************************************
48  *
49  * @brief Packs and Sends Rx Data Ind to MAC
50  *
51  * @details
52  *
53  *    Function : packRxDataInd
54  *
55  *    Functionality:
56  *      Packs and Sends Rx data Ind to MAC
57  *
58  * @params[in] Post structure pointer
59  *             Rx Data indication
60  * @return ROK     - success
61  *         RFAILED - failure
62  *
63  * ****************************************************************/
64 uint16_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd)
65 {
66    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
67    {
68       return ROK;
69    }
70    else
71    {
72       return RFAILED;
73    }
74 }
75
76
77 /*******************************************************************
78  *
79  * @brief Packs and Sends RACH Ind to MAC
80  *
81  * @details
82  *
83  *    Function : packRachInd
84  *
85  *    Functionality:
86  *         Packs and Sends RACH Ind to MAC
87  *
88  * @params[in] Post structure pointer
89  *             RACH indication
90  * @return ROK     - success
91  *         RFAILED - failure
92  *
93  * ****************************************************************/
94 uint16_t packRachInd(Pst *pst, RachInd *rachInd)
95 {
96    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
97    {
98       return ROK;
99    }
100    return RFAILED;
101 }
102  
103 /*******************************************************************
104  *
105  * @brief Loose coupled packing of slot indication
106  *
107  * @details
108  *
109  *    Function : packLcSlotInd
110  *
111  *    Functionality:
112  *        Loose coupled packing of slot indication
113  *
114  * @params[in] Post structure
115  *             Slot indication info
116  * @return ROK     - success
117  *         RFAILED - failure
118  *
119  * ****************************************************************/
120 S16 packLcSlotInd (Pst *pst, SlotIndInfo *slotInd)
121 {
122    Buffer *mBuf = NULLP;
123    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
124    {
125       RETVALUE(RFAILED);
126    }
127  
128    /* pack SFN and slot value */
129    CMCHKPK(SPkU16,slotInd->sfn, mBuf);
130    CMCHKPK(SPkU16,slotInd->slot, mBuf);
131  
132    RETVALUE(SPstTsk(pst,mBuf));
133 }
134  
135 /*******************************************************************
136  *
137  * @brief Light weight loose coupled packing of slot indication
138  *
139  * @details
140  *
141  *    Function : packLwlcSlotInd
142  *
143  *    Functionality:
144  *       Light weight loose coupled packing of slot indication
145  *
146  * @params[in] Post structure
147  *             Slot indication info 
148  * @return ROK     - success
149  *         RFAILED - failure
150  *
151  * ****************************************************************/
152 S16 packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd)
153 {
154    return ROK;
155 }
156
157 /*******************************************************************
158  *
159  * @brief Packs and Sends Stop Ind to MAC
160  *
161  * @details
162  *
163  *    Function : packStopInd
164  *
165  *    Functionality:
166  *         Packs and Sends Stop Ind to MAC
167  *
168  * @params[in] Post structure pointer
169  * @return ROK     - success
170  *         RFAILED - failure
171  *
172  * ****************************************************************/
173 uint16_t packStopInd(Pst *pst)
174 {
175    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
176    {
177       return ROK;
178    }
179    else
180    {
181       return RFAILED;
182    }
183 }
184
185 /**********************************************************************
186          End of file
187 **********************************************************************/