[Task-ID: ODUHIGH-455] Changes to support new L1 20.11
[o-du/l2.git] / src / 5gnrmac / lwr_mac_phy.h
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 #ifndef _LWR_MAC_PHY_H_
19 #define _LWR_MAC_PHY_H_
20
21
22 typedef enum
23 {
24    MSG_OK,
25    MSG_INVALID_STATE,
26    MSG_INVALID_CONFIG,
27    SFN_OUT_OF_SYNC,
28    MSG_SLOT_ERR,
29    MSG_BCH_MISSING,
30    MSG_INVALID_SFN,
31    MSG_UL_DCI_ERR,
32    MSG_TX_ERR
33 }ErrorCode;
34
35 #ifdef INTEL_WLS_MEM
36 #define LWR_MAC_WLS_BUF_SIZE   32000      /* Size of WLS memory block */
37 #define EVT_START_WLS_RCVR     1
38
39 /* allocate static buffer from WLS memory */
40 #define WLS_MEM_ALLOC(_datPtr, _size)                        \
41 {                                                            \
42    uint8_t _ret;                                             \
43    _ret = SGetSBufWls(0, 0, (Data **)&_datPtr, _size);       \
44    if(_ret == ROK)                                           \
45       memset(_datPtr, 0, _size);                      \
46    else                                                      \
47       _datPtr = NULLP;                                       \
48 }                                                              
49
50 /* free a static buffer from WLS memory*/
51 #define WLS_MEM_FREE(_datPtr, _size)                         \
52    if(_datPtr)                                               \
53    {                                                         \
54       SPutSBufWls(0, 0, (Data *)_datPtr, _size);             \
55       _datPtr = NULLP;                                       \
56    }
57
58 typedef struct wlsBlockToFree
59 {
60    void     *ptr;
61    uint32_t size;
62 }WlsBlockToFree;
63
64 CmLListCp wlsBlockToFreeList[WLS_MEM_FREE_PRD];
65
66 void addWlsBlockToFree(void *msg, uint32_t msgLen, uint8_t idx);
67 void freeWlsBlockList(uint8_t idx);
68 void LwrMacEnqueueWlsBlock();
69 void LwrMacRecvPhyMsg();
70 void LwrMacStartWlsRcvr();
71 #endif /* INTEL_WLS_MEM */
72
73 uint8_t LwrMacSendToL1(void *msg);
74 #endif
75
76 /**********************************************************************
77   End of file
78  **********************************************************************/
79