CRC and Rx Data Indication
[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
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 == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC))
41    {
42       return ROK;
43    }
44    else
45    {
46       return RFAILED;
47    }
48 }
49
50 /*******************************************************************
51  *
52  * @brief Packs and Sends Rx Data Ind to MAC
53  *
54  * @details
55  *
56  *    Function : packRxDataInd
57  *
58  *    Functionality:
59  *      Packs and Sends Rx data Ind to MAC
60  *
61  * @params[in] Post structure pointer
62  *             Rx Data indication
63  * @return ROK     - success
64  *         RFAILED - failure
65  *
66  * ****************************************************************/
67 uint16_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd)
68 {
69    if((pst->selector == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC))
70    {
71       return ROK;
72    }
73    else
74    {
75       return RFAILED;
76    }
77 }
78
79
80 /*******************************************************************
81  *
82  * @brief Packs and Sends RACH Ind to MAC
83  *
84  * @details
85  *
86  *    Function : packRachInd
87  *
88  *    Functionality:
89  *         Packs and Sends RACH Ind to MAC
90  *
91  * @params[in] Post structure pointer
92  *             RACH indication
93  * @return ROK     - success
94  *         RFAILED - failure
95  *
96  * ****************************************************************/
97 uint16_t packRachInd(Pst *pst, RachInd *rachInd)
98 {
99    if((pst->selector == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC))
100    {
101       return ROK;
102    }
103    else
104    {
105       return RFAILED;
106    }
107 }
108  
109 /*******************************************************************
110  *
111  * @brief Loose coupled packing of slot indication
112  *
113  * @details
114  *
115  *    Function : packLcSlotInd
116  *
117  *    Functionality:
118  *        Loose coupled packing of slot indication
119  *
120  * @params[in] Post structure
121  *             Slot indication info
122  * @return ROK     - success
123  *         RFAILED - failure
124  *
125  * ****************************************************************/
126 S16 packLcSlotInd (Pst *pst, SlotIndInfo *slotInd)
127 {
128    Buffer *mBuf = NULLP;
129    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
130    {
131       RETVALUE(RFAILED);
132    }
133  
134    /* pack SFN and slot value */
135    CMCHKPK(SPkU16,slotInd->sfn, mBuf);
136    CMCHKPK(SPkU16,slotInd->slot, mBuf);
137  
138    RETVALUE(SPstTsk(pst,mBuf));
139 }
140  
141 /*******************************************************************
142  *
143  * @brief Light weight loose coupled packing of slot indication
144  *
145  * @details
146  *
147  *    Function : packLwlcSlotInd
148  *
149  *    Functionality:
150  *       Light weight loose coupled packing of slot indication
151  *
152  * @params[in] Post structure
153  *             Slot indication info 
154  * @return ROK     - success
155  *         RFAILED - failure
156  *
157  * ****************************************************************/
158 S16 packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd)
159 {
160    return ROK;
161 }
162
163 /**********************************************************************
164          End of file
165 **********************************************************************/