yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2018 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | /***************************************************************************** |
| 36 | * |
| 37 | * Filename: |
| 38 | * --------- |
| 39 | * smic_struct.h |
| 40 | * |
| 41 | * Project: |
| 42 | * -------- |
| 43 | * VMOLY |
| 44 | * |
| 45 | * Description: |
| 46 | * ------------ |
| 47 | * |
| 48 | * Author: |
| 49 | * ------- |
| 50 | * ------- |
| 51 | ******************************************************************************/ |
| 52 | |
| 53 | #ifndef _SMIC_STRUCT_H_ |
| 54 | #define _SMIC_STRUCT_H_ |
| 55 | |
| 56 | |
| 57 | #include "kal_general_types.h" |
| 58 | #include "kal_public_defs.h" |
| 59 | #include "nas_sv_struct.h" |
| 60 | #include "irat_common_enums.h" |
| 61 | #include "irat_common_struct.h" |
| 62 | #include "ps_public_enum.h" |
| 63 | #include "ps_public_struct.h" |
| 64 | #include "l3_inc_local.h" |
| 65 | #include "tcm_eval_struct.h" |
| 66 | |
| 67 | /******************************************** |
| 68 | * MACROS * |
| 69 | ********************************************/ |
| 70 | #define SMIC_MAX_NUM_OF_5G_IE_IN_PCO 10 |
| 71 | |
| 72 | #define SMIC_5G_PCO_IE_S_NSSAI 0x001B |
| 73 | #define SMIC_5G_PCO_IE_QOS_RULES 0x001C |
| 74 | #define SMIC_5G_PCO_IE_SESSION_AMBR 0x001D |
| 75 | #define SMIC_5G_PCO_IE_PDUS_ADDR_LIFETIME 0x001E |
| 76 | #define SMIC_5G_PCO_IE_QOS_FLOW_DESCRIPTION 0x001F |
| 77 | #define SMIC_5G_PCO_IE_ETHERNET_FRAME_PAYLOAD_MTU 0x0020 |
| 78 | #define SMIC_5G_PCO_IE_UNSTRUCTURED_LINK_MTU 0x0021 |
| 79 | |
| 80 | #define SMIC_5G_PCO_IE_2_OCTET_QOS_RULES 0x0023 |
| 81 | #define SMIC_5G_PCO_IE_2_OCTET_QOS_FLOW_DESCRIPTION 0x0024 |
| 82 | |
| 83 | |
| 84 | |
| 85 | /******************************************** |
| 86 | * TYPE DEFINITIONS & ENUMS * |
| 87 | ********************************************/ |
| 88 | |
| 89 | typedef enum { |
| 90 | SMIC_4G_BEARER_TYPE_DEFAULT, |
| 91 | SMIC_4G_BEARER_TYPE_DEDICATED, |
| 92 | } smic_4g_bearer_type_enum; |
| 93 | |
| 94 | typedef enum { |
| 95 | SMIC_ACTIVE_SM_NONE, /* only exist in boot-up case */ |
| 96 | SMIC_ACTIVE_SM_23G, |
| 97 | SMIC_ACTIVE_SM_4G, |
| 98 | SMIC_ACTIVE_SM_5G, |
| 99 | SMIC_ACTIVE_SM_MAX, |
| 100 | } smic_active_sm_enum; |
| 101 | |
| 102 | typedef enum { |
| 103 | SMIC_CAMP_ON_AS_2G, |
| 104 | SMIC_CAMP_ON_AS_3G, |
| 105 | SMIC_CAMP_ON_AS_4G, |
| 106 | SMIC_CAMP_ON_AS_5G, |
| 107 | SMIC_CAMP_ON_AS_MAX, |
| 108 | } smic_camp_on_as_rat_enum; |
| 109 | |
| 110 | typedef enum { |
| 111 | SMIC_5G_SET_RESULT_OK, |
| 112 | SMIC_5G_SET_RESULT_OK_BUT_NEED_ERR_ACTION, |
| 113 | SMIC_5G_SET_RESULT_MAX, |
| 114 | } smic_5g_set_result_enum; |
| 115 | |
| 116 | |
| 117 | typedef enum { |
| 118 | SMIC_4G_SET_RESULT_OK, |
| 119 | SMIC_4G_SET_RESULT_ERROR_SEND_CAUSE_TO_NW, |
| 120 | SMIC_4G_SET_RESULT_INVALID_INPUT_ARG, |
| 121 | SMIC_4G_SET_RESULT_MAX, |
| 122 | } smic_4g_set_result_enum; |
| 123 | |
| 124 | |
| 125 | typedef enum { |
| 126 | SMIC_REQ_ACTION_NONE, /* boot-up case */ |
| 127 | SMIC_REQ_ACTION_FREE_CONTEXT, /* 3G5, 5G3 */ |
| 128 | SMIC_REQ_ACTION_DO_CONTEXT_TRANSFER, /* 3G4, 4G3, 4G5 with N26, 5G4 with N26 */ |
| 129 | SMIC_REQ_ACTION_FREE_CONTEXT_WITH_HANDOVER_CAUSE, /* 4G5 w/o N26, 5G4 w/o N26 */ |
| 130 | SMIC_REQ_ACTION_MAX, |
| 131 | } smic_req_action_enum; |
| 132 | |
| 133 | typedef struct { |
| 134 | kal_uint8 ebi; |
| 135 | kal_uint8 linked_ebi; |
| 136 | kal_uint8 mapped_psi; |
| 137 | } smic_esm_active_ebi_info_struct; |
| 138 | |
| 139 | typedef struct { |
| 140 | kal_uint8 num_of_active_ebi; |
| 141 | smic_esm_active_ebi_info_struct active_ebi[MAX_L4_PS_EBI_NUM]; |
| 142 | } smic_esm_peer_msg_precheck_info_struct; |
| 143 | |
| 144 | typedef struct { |
| 145 | kal_uint8 num_of_to_del_epsb_ebi; |
| 146 | kal_uint8 to_del_epsb_ebi[MAX_L4_PS_EBI_NUM]; |
| 147 | kal_bool need_sync_cause_to_nw; |
| 148 | ps_cause_enum cause; |
| 149 | } smic_return_error_struct; |
| 150 | |
| 151 | |
| 152 | typedef struct { |
| 153 | kal_bool is_always_on_pdu_session_req_present; |
| 154 | always_on_pdu_session_req_enum always_on_pdu_session_req; |
| 155 | |
| 156 | kal_bool rqos_support; |
| 157 | kal_bool mh6_support; |
| 158 | |
| 159 | } smic_5g_ue_requested_context_struct; |
| 160 | |
| 161 | typedef struct { |
| 162 | kal_bool is_pdu_address_present; |
| 163 | ip_addr_struct pdu_address; |
| 164 | kal_bool is_dnn_present; |
| 165 | apn_struct dnn; |
| 166 | kal_bool is_emergency; |
| 167 | kal_bool is_ims; |
| 168 | } smic_common_pdn_pdu_info_struct; |
| 169 | |
| 170 | typedef struct { |
| 171 | pdp_addr_type_enum selected_pdu_session_type; |
| 172 | |
| 173 | kal_bool is_s_nssai_present; |
| 174 | pdus_s_nssai_struct s_nssai; |
| 175 | |
| 176 | kal_bool is_session_ambr_present; |
| 177 | pdus_session_ambr_struct session_ambr; |
| 178 | |
| 179 | kal_bool is_rq_timer_value_in_sec_present; |
| 180 | kal_uint32 rq_timer_value_in_sec; |
| 181 | |
| 182 | kal_bool is_pdu_session_release_time_present; |
| 183 | kal_uint32 pdu_session_release_time; |
| 184 | |
| 185 | kal_bool is_always_on_pdu_session_ind_present; |
| 186 | always_on_pdu_session_ind_enum always_on_pdu_session_ind; |
| 187 | |
| 188 | pdus_qos_flow_struct qos_flow; |
| 189 | |
| 190 | kal_bool is_capability_updated_to_nw; |
| 191 | |
| 192 | } smic_5g_nw_applied_context_struct; |
| 193 | |
| 194 | typedef enum { |
| 195 | SMIC_PDUS_CTX_STATUS_NOT_EXIST, |
| 196 | SMIC_PDUS_CTX_STATUS_EXIST_BY_5G_ASSOCIATED, |
| 197 | SMIC_PDUS_CTX_STATUS_EXIST_BY_4G_PROVIDED, |
| 198 | SMIC_PDUS_CTX_STATUS_MAX, |
| 199 | } smic_pdus_ctx_status_enum; |
| 200 | |
| 201 | typedef struct { |
| 202 | /* maintained by VGSM owner */ |
| 203 | smic_pdus_ctx_status_enum pdus_ctx_status; |
| 204 | |
| 205 | smic_5g_ue_requested_context_struct ue_requested_info; |
| 206 | smic_5g_nw_applied_context_struct nw_applied_info; |
| 207 | |
| 208 | } smic_pdus_context_struct; |
| 209 | |
| 210 | |
| 211 | typedef struct { |
| 212 | /* maintained by ESM owner */ |
| 213 | |
| 214 | //----Meta Data ; Do not directly access these items ; Use methods provided by smic_epsb.c ------------- |
| 215 | kal_bool is_context_valid; // Whether this EPS Bearer is active. Only when EPS Bearer is active, is it's context valid |
| 216 | kal_uint8 ebi; // The index in epsb_context[MAX_L4_PS_EBI_NUM] array. |
| 217 | kal_bool is_alloc_by_esm; |
| 218 | kal_uint8 ps_idx; |
| 219 | // ------------------------- |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | kal_uint8 psi; // ID of PDU Session where this EPS bearer is established or its context is last modified. |
| 225 | |
| 226 | |
| 227 | irat_transfer_bearer_type_enum bearer_type; |
| 228 | |
| 229 | // Defined in TS 24.501 Mapped EPS Bearer Context IE |
| 230 | kal_bool is_apn_ambr_present; |
| 231 | eps_apn_ambr_struct apn_ambr; |
| 232 | |
| 233 | kal_bool is_eps_qos_present; |
| 234 | eps_qos_struct eps_qos; |
| 235 | |
| 236 | |
| 237 | |
| 238 | struct |
| 239 | { |
| 240 | // this parameter is critical to 23G. SM can just send MAP FAIL to ESM when this parameter is not present |
| 241 | kal_bool is_ug_qos_present; |
| 242 | // negotiated qos parameter used in 23G |
| 243 | qos_struct ug_qos; |
| 244 | |
| 245 | // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present |
| 246 | kal_bool is_llc_sapi_present; |
| 247 | kal_uint8 llc_sapi; |
| 248 | |
| 249 | // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present |
| 250 | kal_bool is_radio_priority_present; |
| 251 | kal_uint8 radio_priority; |
| 252 | |
| 253 | // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present |
| 254 | kal_bool is_pfi_present; |
| 255 | kal_uint8 pfi; |
| 256 | |
| 257 | // this parameter is critical to 23G. SM can just send MAP FAIL to ESM when this parameter is not present |
| 258 | kal_bool is_ti_present; |
| 259 | irat_ti_struct ti; |
| 260 | } legacy_ctxt; // 23G Param. |
| 261 | |
| 262 | |
| 263 | } smic_ebi_context_struct; |
| 264 | |
| 265 | /* SM/ESM */ |
| 266 | typedef struct { |
| 267 | LOCAL_PARA_HDR |
| 268 | irat_type_enum irat_type; |
| 269 | rat_type_enum source_rat; |
| 270 | rat_type_enum target_rat; |
| 271 | ho_from_lte_type_enum ir_ho_type; |
| 272 | } smic_active_sm_change_start_ind_struct; |
| 273 | |
| 274 | /* SM/ESM */ |
| 275 | typedef struct { |
| 276 | LOCAL_PARA_HDR |
| 277 | irat_type_enum irat_type; |
| 278 | irat_result_enum irat_result; |
| 279 | rat_type_enum source_rat; |
| 280 | rat_type_enum target_rat; |
| 281 | ho_from_lte_type_enum ir_ho_type; |
| 282 | smic_req_action_enum action; /* new for with/without N26 */ |
| 283 | } smic_active_sm_change_finish_ind_struct; |
| 284 | |
| 285 | /* ESM */ |
| 286 | typedef struct { |
| 287 | LOCAL_PARA_HDR |
| 288 | enasas_add_epsbearer_list_struct add_list; |
| 289 | } smic_esm_as_para_update_ntf_req_struct; |
| 290 | |
| 291 | typedef struct { |
| 292 | LOCAL_PARA_HDR |
| 293 | kal_bool is_active_rat_4g; |
| 294 | } smic_esm_active_rat_ind_struct; |
| 295 | |
| 296 | /* VGSM/RAT_TCM/RATDM */ |
| 297 | typedef struct { |
| 298 | LOCAL_PARA_HDR |
| 299 | smic_active_sm_enum source_sm; |
| 300 | smic_active_sm_enum target_sm; |
| 301 | smic_req_action_enum xsm_action; |
| 302 | smic_camp_on_as_rat_enum camp_on_as_rat; |
| 303 | } smic_active_sm_change_ind_struct; |
| 304 | |
| 305 | typedef struct { |
| 306 | kal_uint16 protocol_id; |
| 307 | kal_uint16 protocol_config_len; |
| 308 | kal_uint8 *protocol_config; |
| 309 | } smic_5g_config_option_struct; |
| 310 | |
| 311 | typedef struct { |
| 312 | smic_common_pdn_pdu_info_struct common_pdus_info; |
| 313 | smic_pdus_context_struct pdus_info; |
| 314 | } smic_get_vgsm_context_struct; |
| 315 | |
| 316 | /* ESM<>SMIC */ |
| 317 | typedef struct { |
| 318 | smic_common_pdn_pdu_info_struct common_pdus_info; |
| 319 | smic_5g_nw_applied_context_struct pdus_info; |
| 320 | } smic_vgsm_associated_ctx_struct; |
| 321 | |
| 322 | |
| 323 | typedef struct |
| 324 | { |
| 325 | bearer_ctxt_struct pdp_context; // Common struct to store 5G Mapped EPS Bearer / 4G EPS Bearer / 23G PDP Context |
| 326 | |
| 327 | // Additional Params. used for 4G<>5G |
| 328 | kal_uint8 psi; |
| 329 | // Only valid when this is a Default EPS Bearer in 4G or 5G |
| 330 | kal_bool is_apn_ambr_present; |
| 331 | eps_apn_ambr_struct apn_ambr; |
| 332 | |
| 333 | kal_bool is_ims_bearer; |
| 334 | |
| 335 | |
| 336 | } esm_smic_epsb_context_struct; |
| 337 | |
| 338 | typedef struct |
| 339 | { |
| 340 | |
| 341 | // NSAPI / EBI (range is 5~15) |
| 342 | kal_uint8 bearer_id; |
| 343 | |
| 344 | // 5G4 default/dedicated bearer would set this field. |
| 345 | apn_struct apn; |
| 346 | |
| 347 | // this parameter is critical to 23G. SM can just send MAP FAIL to ESM when this parameter is not present |
| 348 | kal_bool is_ug_qos_present; |
| 349 | // negotiated qos parameter used in 23G |
| 350 | qos_struct ug_qos; |
| 351 | |
| 352 | kal_bool is_eps_qos_present; |
| 353 | // When ESM transfer more than GPRS_MAX_PDP_SUPPORT contexts to SM, |
| 354 | // SM need to use eps_qos to decide which contexts need to be mapped failed and inform ESM to local release it. |
| 355 | eps_qos_struct eps_qos; |
| 356 | |
| 357 | bearer_service_type_enum bearer_service_type; |
| 358 | |
| 359 | }esm_smic_precheck_epsb_context_struct; |
| 360 | |
| 361 | |
| 362 | /******************************************** |
| 363 | * VARIABLES * |
| 364 | ********************************************/ |
| 365 | |
| 366 | /******************************************** |
| 367 | * FUNCTION DECLARATIONS * |
| 368 | ********************************************/ |
| 369 | |
| 370 | |
| 371 | #endif /* _SMIC_STRUCT_H_ */ |
| 372 | |
| 373 | |