Merge "Fixes for SSB transmission in Radio mode integration [Issue-ID: ODUHIGH-267]"
[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 "lwr_mac_fsm.h"\r
23 #include "lwr_mac_phy.h"\r
24 \r
25 /**************************************************************************\r
26  * @brief Task Initiation callback function. \r
27  *\r
28  * @details\r
29  *\r
30  *     Function : lwrMacActvInit \r
31  *    \r
32  *     Functionality:\r
33  *             This function is supplied as one of parameters during Lower MAC's \r
34  *             task registration. SSI will invoke this function once, after\r
35  *             it creates and attaches this TAPA Task to a system task.\r
36  *     \r
37  * @param[in]  Ent entity, the entity ID of this task.     \r
38  * @param[in]  Inst inst, the instance ID of this task.\r
39  * @param[in]  Region region, the region ID registered for memory \r
40  *              usage of this task.\r
41  * @param[in]  Reason reason.\r
42  * @return ROK     - success\r
43  *         RFAILED - failure\r
44  ***************************************************************************/\r
45 uint8_t lwrMacActvInit(Ent entity, Inst inst, Region region, Reason reason)\r
46 {\r
47    return ROK;\r
48 }\r
49 \r
50 /**************************************************************************\r
51  * @brief Task Activation callback function. \r
52  *\r
53  * @details\r
54  *\r
55  *      Function : lwrMacActvTsk \r
56  * \r
57  *      Functionality:\r
58  *           Primitives invoked by Lower MAC's users/providers through\r
59  *           a loosely coupled interface arrive here by means of \r
60  *           SSI's message handling. This API is registered with\r
61  *           SSI during the Task Registration of DU APP.\r
62  *     \r
63  * @param[in]  Pst     *pst, Post structure of the primitive.     \r
64  * @param[in]  Buffer *mBuf, Packed primitive parameters in the\r
65  *  buffer.\r
66  * @return ROK     - success\r
67  *         RFAILED - failure\r
68  *\r
69  ***************************************************************************/\r
70 uint8_t lwrMacActvTsk(Pst *pst, Buffer *mBuf)\r
71 {\r
72    uint8_t ret = ROK;\r
73 \r
74    switch(pst->srcEnt)\r
75    {\r
76       case ENTLWRMAC:\r
77          {\r
78             switch(pst->event)\r
79             {\r
80 #ifdef INTEL_WLS_MEM\r
81                case EVT_START_WLS_RCVR:\r
82                   {\r
83                      ODU_PUT_MSG_BUF(mBuf);\r
84 \r
85                      /* Allocate memory for intial UL transmission */\r
86                      LwrMacEnqueueWlsBlock();\r
87 \r
88                      /* Start thread to receive from L1 */\r
89                      DU_LOG("\nINFO  -->  LWR MAC: Starting WLS receiver thread");\r
90                      LwrMacRecvPhyMsg();\r
91                      break;\r
92                   }\r
93 #endif\r
94                default:\r
95                   {\r
96                      SPutMsg(mBuf);\r
97                      DU_LOG("\nERROR  -->  LWR MAC: Invalid event %d received", pst->event);\r
98                      ret = RFAILED;\r
99                   }\r
100             }\r
101             break;\r
102          }\r
103       default:\r
104          {\r
105             SPutMsg(mBuf);\r
106             DU_LOG("\nERROR  -->  LWR MAC: Message from invalid source entity %d", pst->srcEnt);\r
107             ret = RFAILED;\r
108          }\r
109    }\r
110    return ret;\r
111 }\r
112 \r
113 /**********************************************************************\r
114   End of file\r
115  **********************************************************************/\r