rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [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 | #ifndef MRS_VGNAS_CAPABILITY_H |
| 37 | #define MRS_VGNAS_CAPABILITY_H |
| 38 | |
| 39 | #include "mrs_as_irat_enums.h" |
| 40 | #include "l3_inc_enums_public.h" |
| 41 | #include "ps_public_enum.h" |
| 42 | |
| 43 | |
| 44 | /******************************************** |
| 45 | * MACROS * |
| 46 | ********************************************/ |
| 47 | |
| 48 | #define RAT_ANY 0xFF |
| 49 | #define OPTION_ANY 0XFF |
| 50 | |
| 51 | |
| 52 | /******************************************** |
| 53 | * TYPE DEFINITIONS & ENUMS * |
| 54 | ********************************************/ |
| 55 | |
| 56 | /** |
| 57 | * NVRAM_EF_N1_MODE_CAP_LID & NVRAM_EF_NR_CAP_LID |
| 58 | */ |
| 59 | typedef struct |
| 60 | { |
| 61 | kal_bool n1_mode; // 24.301 UE network capability IE: N1 mode supported (N1 mode) |
| 62 | kal_bool ho_attach; // 5GMM capability IE: attach request message containing PDN connectivity request with request type handover to transfer PDU session from N1 mode to S1 mode supported (HO attach) |
| 63 | kal_uint8 ue_5gs_enc_algo; // UE security capability IE: 5GS encryption algorithm supported |
| 64 | kal_uint8 ue_5gs_int_algo; // UE security capability IE: 5GS integrity algorithm supported |
| 65 | |
| 66 | } vgnas_capability_context_struct; |
| 67 | |
| 68 | |
| 69 | /******************************************** |
| 70 | * VARIABLES * |
| 71 | ********************************************/ |
| 72 | |
| 73 | |
| 74 | /******************************************** |
| 75 | * FUNCTION DECLARATIONS * |
| 76 | ********************************************/ |
| 77 | |
| 78 | /** |
| 79 | * @brief Initializes MRS 5G NAS context |
| 80 | * @return void |
| 81 | */ |
| 82 | void mrs_vgnas_init_context_default_value(void); |
| 83 | |
| 84 | /** |
| 85 | * @brief Initial procedure to set MRS 5G NAS context by data retrieved from NVRAM |
| 86 | * @return void |
| 87 | * @param[IN] nvram_file_id: NVRAM_EF_NR_CAP_LID, NVRAM_EF_N1_CAP_LID |
| 88 | * @param[IN] data: of nvram_file_id |
| 89 | * @param[IN] len: of data |
| 90 | */ |
| 91 | void mrs_vgnas_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8 *data, kal_uint16 len); |
| 92 | |
| 93 | /** |
| 94 | * @brief A function that sets 5gc nas(n1 mode) supported |
| 95 | * @param[in] sim_index indicates the protocol which is selected |
| 96 | * @param[in] n1_mode is used for setting the configuration. |
| 97 | * @return KAL_TRUE if n1_mode set sucessfully. |
| 98 | * |
| 99 | * the n1 mode is used for ue network capability IE and defined in TS 24.301 |
| 100 | */ |
| 101 | kal_bool mrs_vgnas_set_cap_5gc_nas_support(MRS_SIM_INDEX sim_index, kal_bool n1_mode); |
| 102 | |
| 103 | /** |
| 104 | * @brief A function that gets 5gc nas(n1 mode) supported |
| 105 | * @param[in] sim_index indicates the protocol which is selected |
| 106 | * @param[in] rat_mode is used for checking if we could get the n1_mode configuration. |
| 107 | * @return KAL_TRUE if epc nas(n1_mode) is supported. |
| 108 | * |
| 109 | * the n1 mode is used for ue network capability IE and defined in TS 24.301 |
| 110 | */ |
| 111 | kal_bool mrs_vgnas_get_cap_5gc_nas_support(MRS_SIM_INDEX sim_index, rat_enum rat_mode); |
| 112 | |
| 113 | /** |
| 114 | * @brief Get ME's setting on HO attach supported |
| 115 | * @return KAL_TRUE: supported; KAL_FALSE: not supported |
| 116 | * @param[IN] sim_index: for which protocol |
| 117 | * @param[IN] rat_mode: current rat mode |
| 118 | * |
| 119 | * result is filtered by rat_mode, input rat_mode=RAT_ANY to by-pass filtering |
| 120 | */ |
| 121 | kal_bool mrs_vgnas_get_cap_ho_attach_support(MRS_SIM_INDEX sim_index, rat_enum rat_mode); |
| 122 | |
| 123 | /** |
| 124 | * @brief Get ME's setting on 5GS encryption algorithms supported |
| 125 | * @return kal_uint8: bit map (bit 8 is 5G-EA0, bit 7 is 128-5G-EA1, ... |
| 126 | * bit 1 is 5G-EA7), each bit is either 0 for not supported or 1 |
| 127 | * for supported |
| 128 | * @param[IN] sim_index: for which protocol |
| 129 | * @param[IN] option: current 5G architecture option |
| 130 | * |
| 131 | * 5G-EA is used for: |
| 132 | * UE security capability IE and defined in TS 24.501 |
| 133 | */ |
| 134 | kal_uint8 mrs_vgnas_get_cap_5gs_encryption_algo_support(MRS_SIM_INDEX sim_index, vg_option_enum option); |
| 135 | |
| 136 | /** |
| 137 | * @brief Get ME's setting on 5GS integrity algorithms supported |
| 138 | * @return kal_uint8: bit map (bit 8 is 5G-IA0, bit 7 is 128-5G-IA1, ... |
| 139 | * bit 1 is 5G-IA7), each bit is either 0 for not supported or 1 |
| 140 | * for supported |
| 141 | * @param[IN] sim_index: for which protocol |
| 142 | * @param[IN] option: current 5G architecture option |
| 143 | * |
| 144 | * 5G-IA is used for: |
| 145 | * UE security capability IE and defined in TS 24.501 |
| 146 | */ |
| 147 | kal_uint8 mrs_vgnas_get_cap_5gs_integrity_algo_support(MRS_SIM_INDEX sim_index, vg_option_enum option); |
| 148 | |
| 149 | |
| 150 | #endif /* MRS_VGNAS_CAPABILITY_H */ |