1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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_
35 #ifdef ODU_MEMORY_DEBUG_LOG
36 #define WLS_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\
38 printf("\n%s=== %s +%d, %s, %lu, %p", \
39 _macro, _file, _line, _func, (uint64_t)_size, _datPtr); \
42 #define WLS_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr) \
48 #define LWR_MAC_WLS_BUF_SIZE 32000 /* Size of WLS memory block */
49 #define EVT_START_WLS_RCVR 1
51 /* allocate static buffer from WLS memory */
52 #define WLS_MEM_ALLOC(_datPtr, _size) \
55 _ret = SGetSBufWls(0, 0, (Data **)&_datPtr, _size); \
58 WLS_MEM_LOG("WLSMEM_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
59 memset(_datPtr, 0, _size); \
65 /* free a static buffer from WLS memory*/
66 #define WLS_MEM_FREE(_datPtr, _size) \
69 WLS_MEM_LOG("WLSMEM_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
70 SPutSBufWls(0, 0, (Data *)_datPtr, _size); \
74 typedef struct wlsBlockToFree
80 CmLListCp wlsBlockToFreeList[WLS_MEM_FREE_PRD];
82 void addWlsBlockToFree(void *msg, uint32_t msgLen, uint8_t idx);
83 void freeWlsBlockList(uint8_t idx);
84 void LwrMacEnqueueWlsBlock();
85 void LwrMacRecvPhyMsg();
86 void LwrMacStartWlsRcvr();
87 #endif /* INTEL_WLS_MEM */
89 uint8_t LwrMacSendToL1(void *msg);
92 /**********************************************************************
94 **********************************************************************/