[Epic-ID: ODUHIGH-461][Task-ID: ODUHIGH-468]Unused files and functions removed/disabled
[o-du/l2.git] / src / 5gnrmac / lwr_mac_ex_ms.c
1 /*******************************************************************************\r
2 ################################################################################\r
3 #   Copyright (c) [2017-2019] [Radisys]                                        #\r
4 #                                                                              #\r
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #\r
6 #   you may not use this file except in compliance with the License.           #\r
7 #   You may obtain a copy of the License at                                    #\r
8 #                                                                              #\r
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #\r
10 #                                                                              #\r
11 #   Unless required by applicable law or agreed to in writing, software        #\r
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #\r
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
14 #   See the License for the specific language governing permissions and        #\r
15 #   limitations under the License.                                             #\r
16 ################################################################################\r
17 *******************************************************************************/\r
18 \r
19 /* This file is the entry point for Lower MAC */\r
20 \r
21 #include "common_def.h"\r
22 #include "mac_utils.h"\r
23 #include "lwr_mac_fsm.h"\r
24 #include "lwr_mac_phy.h"\r
25 #ifdef INTEL_FAPI\r
26 #include "nr5g_fapi_internal.h"\r
27 #include "fapi_vendor_extension.h"\r
28 #endif\r
29 #ifndef INTEL_WLS_MEM\r
30 #include "lwr_mac_phy_stub_inf.h"\r
31 #endif\r
32 \r
33 /**************************************************************************\r
34  * @brief Task Initiation callback function. \r
35  *\r
36  * @details\r
37  *\r
38  *     Function : lwrMacActvInit \r
39  *    \r
40  *     Functionality:\r
41  *             This function is supplied as one of parameters during Lower MAC's \r
42  *             task registration. SSI will invoke this function once, after\r
43  *             it creates and attaches this TAPA Task to a system task.\r
44  *     \r
45  * @param[in]  Ent entity, the entity ID of this task.     \r
46  * @param[in]  Inst inst, the instance ID of this task.\r
47  * @param[in]  Region region, the region ID registered for memory \r
48  *              usage of this task.\r
49  * @param[in]  Reason reason.\r
50  * @return ROK     - success\r
51  *         RFAILED - failure\r
52  ***************************************************************************/\r
53 uint8_t lwrMacActvInit(Ent entity, Inst inst, Region region, Reason reason)\r
54 {\r
55    return ROK;\r
56 }\r
57 \r
58 #ifdef CALL_FLOW_DEBUG_LOG\r
59 /**************************************************************************\r
60 * @brief function prints src, dest, msg info about all the msgs received \r
61 *\r
62 * @details\r
63 *\r
64 *     Function : callFlowlwrMacActvTsk \r
65 *\r
66 *     Functionality:\r
67 *          function prints src, dest, msg info about all the msgs received\r
68 *\r
69 * @param[in]  Pst *pst\r
70 *\r
71 * @return void \r
72 ***************************************************************************/\r
73 \r
74 void callFlowlwrMacActvTsk(Pst *pst)\r
75 {\r
76    char sourceTask[50];\r
77    char destTask[50]="ENTLWRMAC";\r
78    char message[100];\r
79 \r
80    switch(pst->srcEnt)\r
81    {\r
82       case ENTLWRMAC:\r
83          {\r
84             strcpy(sourceTask,"ENTLWRMAC");\r
85             switch(pst->event)\r
86             {\r
87 #ifdef INTEL_WLS_MEM\r
88                case EVT_START_WLS_RCVR:\r
89                   {\r
90                      strcpy(message,"EVT_START_WLS_RCVR");\r
91                      break;\r
92                   }\r
93 #endif\r
94                default:\r
95                   {\r
96                      strcpy(message,"Invalid Event");\r
97                      break;\r
98                   }\r
99             }\r
100             break;\r
101          }\r
102 \r
103 #ifndef INTEL_WLS_MEM\r
104       case ENTPHYSTUB:\r
105          {\r
106             strcpy(sourceTask,"PHY");\r
107             switch(pst->event)\r
108             {\r
109                case EVT_PHY_STUB_SLOT_IND:\r
110                   {\r
111                      strcpy(message,"EVT_PHY_STUB_SLOT_IND");\r
112                      break;\r
113                   }\r
114 \r
115                case EVT_PHY_STUB_STOP_IND:\r
116                  {\r
117                     strcpy(message,"EVT_PHY_STUB_STOP_IND");\r
118                     break;\r
119                  }\r
120                default:\r
121                   {\r
122                      strcpy(message,"Invalid Event");\r
123                      break;\r
124                   }\r
125             }\r
126             break;\r
127          }\r
128 #endif\r
129 \r
130       default:\r
131          {\r
132             strcpy(sourceTask,"Invalid Source Entity Id");\r
133          }\r
134    }\r
135    DU_LOG("\nCall Flow: %s -> %s : %s\n", sourceTask, destTask, message);\r
136 }\r
137 #endif\r
138 \r
139 /**************************************************************************\r
140  * @brief Task Activation callback function. \r
141  *\r
142  * @details\r
143  *\r
144  *      Function : lwrMacActvTsk \r
145  * \r
146  *      Functionality:\r
147  *           Primitives invoked by Lower MAC's users/providers through\r
148  *           a loosely coupled interface arrive here by means of \r
149  *           SSI's message handling. This API is registered with\r
150  *           SSI during the Task Registration of DU APP.\r
151  *     \r
152  * @param[in]  Pst     *pst, Post structure of the primitive.     \r
153  * @param[in]  Buffer *mBuf, Packed primitive parameters in the\r
154  *  buffer.\r
155  * @return ROK     - success\r
156  *         RFAILED - failure\r
157  *\r
158  ***************************************************************************/\r
159 uint8_t lwrMacActvTsk(Pst *pst, Buffer *mBuf)\r
160 {\r
161    uint8_t ret = ROK;\r
162 \r
163 #ifdef CALL_FLOW_DEBUG_LOG\r
164    callFlowlwrMacActvTsk(pst);\r
165 #endif\r
166    \r
167    switch(pst->srcEnt)\r
168    {\r
169       case ENTLWRMAC:\r
170          {\r
171             switch(pst->event)\r
172             {\r
173 #ifdef INTEL_WLS_MEM\r
174                case EVT_START_WLS_RCVR:\r
175                   {\r
176                      ODU_PUT_MSG_BUF(mBuf);\r
177 \r
178                      /* Allocate memory for intial UL transmission */\r
179                      LwrMacEnqueueWlsBlock();\r
180 \r
181                      /* Start thread to receive from L1 */\r
182                      DU_LOG("\nINFO  -->  LWR MAC: Starting WLS receiver thread");\r
183                      LwrMacRecvPhyMsg();\r
184                      break;\r
185                   }\r
186 #endif\r
187                default:\r
188                   {\r
189                      ODU_PUT_MSG_BUF(mBuf);\r
190                      DU_LOG("\nERROR  -->  LWR MAC: Invalid event %d received", pst->event);\r
191                      ret = RFAILED;\r
192                   }\r
193             }\r
194             break;\r
195          }\r
196 \r
197 #ifndef INTEL_WLS_MEM\r
198       case ENTPHYSTUB:\r
199          {\r
200             switch(pst->event)\r
201             {\r
202                case EVT_PHY_STUB_SLOT_IND:\r
203                   {\r
204                      fapi_slot_ind_t *slotIndMsg;\r
205 \r
206                      CMCHKUNPK(oduUnpackPointer, (PTR *)&slotIndMsg, mBuf);\r
207                      ODU_PUT_MSG_BUF(mBuf);\r
208 \r
209                      procPhyMessages(slotIndMsg->header.msg_id, sizeof(fapi_slot_ind_t), (void*)slotIndMsg);\r
210                      MAC_FREE_SHRABL_BUF(pst->region, pst->pool, slotIndMsg, sizeof(fapi_slot_ind_t));\r
211                      break;\r
212                   }\r
213 \r
214                case EVT_PHY_STUB_STOP_IND:\r
215                  {\r
216                     fapi_stop_ind_t *stopIndMsg;\r
217                     CMCHKUNPK(oduUnpackPointer, (PTR *)&stopIndMsg, mBuf);\r
218                     ODU_PUT_MSG_BUF(mBuf);\r
219 \r
220                     procPhyMessages(stopIndMsg->header.msg_id, sizeof(fapi_stop_ind_t), (void*)stopIndMsg);\r
221                     MAC_FREE_SHRABL_BUF(pst->region, pst->pool, stopIndMsg, sizeof(fapi_stop_ind_t));\r
222                     break;\r
223                  }\r
224                default:\r
225                   {\r
226                      DU_LOG("\nERROR  -->  LWR_MAC: Invalid event %d received from PHY STUB", pst->event);\r
227                   }\r
228             }\r
229             break;\r
230          }\r
231 #endif\r
232 \r
233       default:\r
234          {\r
235             ODU_PUT_MSG_BUF(mBuf);\r
236             DU_LOG("\nERROR  -->  LWR MAC: Message from invalid source entity %d", pst->srcEnt);\r
237             ret = RFAILED;\r
238          }\r
239    }\r
240    return ret;\r
241 }\r
242 \r
243 /**********************************************************************\r
244   End of file\r
245  **********************************************************************/\r