Modify licenses
[scp/ocu/5gnr.git] / Include / sdapCore.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 #ifndef __SDAPCORE_H__
21 #define __SDAPCORE_H__
22
23 #include "vos_types.h"
24 #include "cuModuleInterface.h"
25 #include "upcContext.h"
26 #include "upcCommon.h"
27
28 #define UE_ACTIVITY_NOTIFY_LEVEL                1
29 #define PDU_SESS_ACTIVITY_NOTIFY_LEVEL  2
30 #define DRB_ACTIVITY_NOTIFY_LEVEL               3
31
32 typedef struct
33 {
34         UINT64 ueDataCount;
35 }UeActivityNotify_t;
36
37 typedef struct
38 {
39         UINT64 pduDataCount[256];
40 }PduSessActivityNotify_t;
41
42 typedef struct
43 {
44         UINT64 drbDataCount[33];
45 }DrbActivityNotify_t;
46
47 typedef struct
48 {
49         UINT64  ueE1apId;
50         UINT8   notifyLevel;    /*UE, PDU SESSION, DRB*/
51     union {
52         UeActivityNotify_t                      ueNotify;
53         PduSessActivityNotify_t         pduSessNotify;
54                 DrbActivityNotify_t             drbNotify;
55     }u;
56 }SdapActivityNotify_t;
57
58
59 /* 1、每个实体内的Session  ID、drbID、QosFlowId,都是连续的
60    2、Session和Qos相关的信息都是以ID作为下标保存的
61    3、DRB是以DRB ID - 1 保存的*/
62
63 /* 实体的配置结果和实体的保存原则是一致的 */
64
65 typedef struct
66 {
67         UINT64                          drbId;
68         UINT16                          QosNum;
69         UINT64                          Qfi[UPC_MAX_QOS_PARA_NUM];
70         UINT64                          failQosNum;
71         UINT64                          failQfi[UPC_MAX_QOS_PARA_NUM];
72         E1apCause_e                     cause[UPC_MAX_QOS_PARA_NUM];
73 }SdapDrbCfgRet_t;
74
75 typedef struct
76 {
77         UINT64                          sessId;
78         E1apCause_e                     sessFailCause;
79
80         /* Setup */
81         UINT16                          actDrbNum;
82         UINT8                           actDrbId[UPC_MAX_DRB_NUM];
83         SdapDrbCfgRet_t         actDrbCfg[UPC_MAX_DRB_NUM];
84         UINT16                          failDrbNum;
85         UINT64                          failDrbId[UPC_MAX_DRB_NUM];
86         E1apCause_e                     cause[UPC_MAX_DRB_NUM];
87
88         /* Modify */
89         UINT16                          modDrbNum;
90         UINT8                           modDrbId[UPC_MAX_DRB_NUM];
91         SdapDrbCfgRet_t         modDrbCfg[UPC_MAX_DRB_NUM];
92         UINT16                          failModDrbNum;
93         UINT64                          failModDrbId[UPC_MAX_DRB_NUM];
94         E1apCause_e                     modCause[UPC_MAX_DRB_NUM];
95 }sdapSessCfgRet_t;
96
97 typedef struct
98 {
99         UINT64                          drbId;
100         SdapCfg_t                       sdapCfg;
101         UINT8                           qfiNum;
102         INT64                           qfi[UPC_MAX_QOS_PARA_NUM];
103         QoSFlowQosItem_t        qosFlowInfo[UPC_MAX_QOS_PARA_NUM];
104 }SdapDrbCfg_t;
105
106 typedef struct
107 {
108         UINT64                          sessId;
109         UINT8                           drbNum;
110         UINT64                          drbId[UPC_MAX_DRB_NUM];
111         SdapDrbCfg_t            drbCfg[UPC_MAX_DRB_NUM];
112 }SdapInstance_t;
113
114 typedef struct
115 {
116         UINT64                          upE1apId;
117         UINT16                          sessNum;
118         UINT16                          sessId[UPC_MAX_SESSION_NUM];
119         SdapInstance_t          sdapInstance[UPC_MAX_SESSION_NUM];
120 }SdapGlobalDtat_t;
121
122 typedef struct
123 {
124         UINT8   QFI :6;
125         UINT8   RQI :1;
126         UINT8   RDI :1;
127 }sdapDlHeader_t;
128
129 typedef struct
130 {
131         UINT8   QFI  :6;
132         UINT8   R    :1;
133         UINT8   TYPE :1;
134 }sdapUlHeader_t;
135
136
137 #define SDAP_HEADER_LEN                 1
138
139 SdapGlobalDtat_t* sdapGetUeGlobalData(UINT64    upE1apId, UINT8 *flag);
140 INT32 sdapCreateInstance(UINT64 upE1apId, upcTempSessInfo_t *pSessTempInfo, sdapSessCfgRet_t *pCfgRet);
141 INT32 sdapModSetupInstance(UINT64       upE1apId, upcTempSessInfo_t *pSessTempInfo, sdapSessCfgRet_t *pCfgRet);
142 INT32 sdapModInstance(UINT64    upE1apId, upcTempSessInfo_t *pSessTempInfo, sdapSessCfgRet_t *pCfgRet);
143 INT32 sdapDeleteDrbInfo(SdapInstance_t *pSdapInstance, UINT8 drbId);
144 INT32 sdapDeleteDrbInfoOfInstance(UINT64 upE1apId, UINT8 sessId, UINT8 drbId);
145 INT32 sdapDeleteInstance(UINT64 upE1apId, UINT16 sessId);
146
147 #endif