MAC Clean-up [Issue-ID: ODUHIGH-212]
[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 uint8_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 uint8_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    return RFAILED;
71 }
72
73
74 /*******************************************************************
75  *
76  * @brief Packs and Sends RACH Ind to MAC
77  *
78  * @details
79  *
80  *    Function : packRachInd
81  *
82  *    Functionality:
83  *         Packs and Sends RACH Ind to MAC
84  *
85  * @params[in] Post structure pointer
86  *             RACH indication
87  * @return ROK     - success
88  *         RFAILED - failure
89  *
90  * ****************************************************************/
91 uint8_t packRachInd(Pst *pst, RachInd *rachInd)
92 {
93    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
94    {
95       return ROK;
96    }
97    return RFAILED;
98 }
99
100 /*******************************************************************
101  *
102  * @brief Loose coupled packing of slot indication
103  *
104  * @details
105  *
106  *    Function : packLcSlotInd
107  *
108  *    Functionality:
109  *        Loose coupled packing of slot indication
110  *
111  * @params[in] Post structure
112  *             Slot indication info
113  * @return ROK     - success
114  *         RFAILED - failure
115  *
116  * ****************************************************************/
117 uint8_t packLcSlotInd (Pst *pst, SlotIndInfo *slotInd)
118 {
119    Buffer *mBuf = NULLP;
120    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
121    {
122       return RFAILED;
123    }
124
125    /* pack SFN and slot value */
126    CMCHKPK(SPkU16,slotInd->sfn, mBuf);
127    CMCHKPK(SPkU16,slotInd->slot, mBuf);
128
129    return SPstTsk(pst,mBuf);
130 }
131
132 /*******************************************************************
133  *
134  * @brief Light weight loose coupled packing of slot indication
135  *
136  * @details
137  *
138  *    Function : packLwlcSlotInd
139  *
140  *    Functionality:
141  *       Light weight loose coupled packing of slot indication
142  *
143  * @params[in] Post structure
144  *             Slot indication info 
145  * @return ROK     - success
146  *         RFAILED - failure
147  *
148  * ****************************************************************/
149 uint8_t packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd)
150 {
151    return ROK;
152 }
153
154 /*******************************************************************
155  *
156  * @brief Packs and Sends Stop Ind to MAC
157  *
158  * @details
159  *
160  *    Function : packStopInd
161  *
162  *    Functionality:
163  *         Packs and Sends Stop Ind to MAC
164  *
165  * @params[in] Post structure pointer
166  * @return ROK     - success
167  *         RFAILED - failure
168  *
169  * ****************************************************************/
170 uint8_t packStopInd(Pst *pst, uint16_t cellId)
171 {
172    if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
173    {
174       return ROK;
175    }
176    else
177    {
178       return RFAILED;
179    }
180 }
181
182 /**********************************************************************
183   End of file
184  **********************************************************************/