Modify licenses
[scp/ocu/5gnr.git] / Include / upcCommon.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2020 ICT/CAS.
4 *
5 *   Licensed under the O-RAN Software License, Version 1.0 (the "Software 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 *       https://www.o-ran.org/software
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
20
21 #ifndef __UPCCOMMON_H__
22 #define __UPCCOMMON_H__
23
24 #include "plat_syslog.h"
25 #include "cuCommon.h"
26 #include "upcContext.h"
27
28 #define CONCEPT(x)              1
29
30 extern UpInstance_t     s_UpcGlobalData;
31
32 #define UPC_MODULE_ID           s_UpcGlobalData.moduleId
33
34 #define upclog(level, content, arg...)  VOS_SysLog(UPC_MODULE_ID, level, __FILE__, __LINE__, "", content, ##arg);
35
36 #define UPC_MIN(x, y)  ((x) <= (y)? (x) : (y))
37
38 #define UPC_PRESENCE(bitmask,bit)     ((bit) == ((bit) & (bitmask)))
39
40 #define UPC_CHECK_NULL(prama) \
41 {\
42    if (NULL == prama)\
43    {\
44            upclog(LOG_ERR, "UPC NULL pointer\n");\
45            VOS_ASSERT(0);       \
46        return VOS_ERROR;\
47    }\
48 }
49
50 INT32 upcSendE1apMsg(void *pMsg, UINT64 msgLen);
51
52 extern INT32 vosAdpSendAsynMsg2ModuleEx(          CHAR src_moduleName[MODULE_NAME_LEN],
53                                            CHAR dst_moduleName[MODULE_NAME_LEN],
54                                            VOID *msgData,
55                                            LONG msgDataLen);
56 INT32 upcConstructAndSendOamUpActRsp(int actNum, int failNum, CellIdList_t      failCellList);
57 void upcResortDrbId(UpSessCb_t *pSessCb, UINT8 drbId);
58 INT32 upcCheckSessId(UpUeCb_t *pUeCb, UINT8     sessId);
59 UINT32 upcCheckDrbId(UpUeCb_t *pUeCb, UINT8     drbId);
60 void upcFreeTempInfo(upcTempInfo_t *pTempInfo);
61 void upcCauseConvertToInterfaceType(E1apCause_e srcCause, E1apCause_t *dstCause);
62 extern UINT32 cuAppGetCucommonParaNum();
63 INT32 upcSendUpOamMsg(void *pMsg, UINT64        msgLen);
64 INT32 upcGetBearerModFailureFlag(UINT16 bitMask, UINT8 setupFailFlag, UINT8 ModFailFlag);
65
66 #ifdef NR_CUUP
67 INT32 upcNotifyOmaUpConnectState(INT32 state);
68 #endif
69
70 #endif