blob: 374947346eaa344e829400a042c8891bee2afd40 [file] [log] [blame]
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2018
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
#ifndef MRS_VGNAS_CAPABILITY_H
#define MRS_VGNAS_CAPABILITY_H
#include "mrs_as_irat_enums.h"
#include "l3_inc_enums_public.h"
#include "ps_public_enum.h"
/********************************************
* MACROS *
********************************************/
#define RAT_ANY 0xFF
#define OPTION_ANY 0XFF
/********************************************
* TYPE DEFINITIONS & ENUMS *
********************************************/
/**
* NVRAM_EF_N1_MODE_CAP_LID & NVRAM_EF_NR_CAP_LID
*/
typedef struct
{
kal_bool n1_mode; // 24.301 UE network capability IE: N1 mode supported (N1 mode)
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)
kal_uint8 ue_5gs_enc_algo; // UE security capability IE: 5GS encryption algorithm supported
kal_uint8 ue_5gs_int_algo; // UE security capability IE: 5GS integrity algorithm supported
} vgnas_capability_context_struct;
/********************************************
* VARIABLES *
********************************************/
/********************************************
* FUNCTION DECLARATIONS *
********************************************/
/**
* @brief Initializes MRS 5G NAS context
* @return void
*/
void mrs_vgnas_init_context_default_value(void);
/**
* @brief Initial procedure to set MRS 5G NAS context by data retrieved from NVRAM
* @return void
* @param[IN] nvram_file_id: NVRAM_EF_NR_CAP_LID, NVRAM_EF_N1_CAP_LID
* @param[IN] data: of nvram_file_id
* @param[IN] len: of data
*/
void mrs_vgnas_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8 *data, kal_uint16 len);
/**
* @brief A function that sets 5gc nas(n1 mode) supported
* @param[in] sim_index indicates the protocol which is selected
* @param[in] n1_mode is used for setting the configuration.
* @return KAL_TRUE if n1_mode set sucessfully.
*
* the n1 mode is used for ue network capability IE and defined in TS 24.301
*/
kal_bool mrs_vgnas_set_cap_5gc_nas_support(MRS_SIM_INDEX sim_index, kal_bool n1_mode);
/**
* @brief A function that gets 5gc nas(n1 mode) supported
* @param[in] sim_index indicates the protocol which is selected
* @param[in] rat_mode is used for checking if we could get the n1_mode configuration.
* @return KAL_TRUE if epc nas(n1_mode) is supported.
*
* the n1 mode is used for ue network capability IE and defined in TS 24.301
*/
kal_bool mrs_vgnas_get_cap_5gc_nas_support(MRS_SIM_INDEX sim_index, rat_enum rat_mode);
/**
* @brief Get ME's setting on HO attach supported
* @return KAL_TRUE: supported; KAL_FALSE: not supported
* @param[IN] sim_index: for which protocol
* @param[IN] rat_mode: current rat mode
*
* result is filtered by rat_mode, input rat_mode=RAT_ANY to by-pass filtering
*/
kal_bool mrs_vgnas_get_cap_ho_attach_support(MRS_SIM_INDEX sim_index, rat_enum rat_mode);
/**
* @brief Get ME's setting on 5GS encryption algorithms supported
* @return kal_uint8: bit map (bit 8 is 5G-EA0, bit 7 is 128-5G-EA1, ...
* bit 1 is 5G-EA7), each bit is either 0 for not supported or 1
* for supported
* @param[IN] sim_index: for which protocol
* @param[IN] option: current 5G architecture option
*
* 5G-EA is used for:
* UE security capability IE and defined in TS 24.501
*/
kal_uint8 mrs_vgnas_get_cap_5gs_encryption_algo_support(MRS_SIM_INDEX sim_index, vg_option_enum option);
/**
* @brief Get ME's setting on 5GS integrity algorithms supported
* @return kal_uint8: bit map (bit 8 is 5G-IA0, bit 7 is 128-5G-IA1, ...
* bit 1 is 5G-IA7), each bit is either 0 for not supported or 1
* for supported
* @param[IN] sim_index: for which protocol
* @param[IN] option: current 5G architecture option
*
* 5G-IA is used for:
* UE security capability IE and defined in TS 24.501
*/
kal_uint8 mrs_vgnas_get_cap_5gs_integrity_algo_support(MRS_SIM_INDEX sim_index, vg_option_enum option);
#endif /* MRS_VGNAS_CAPABILITY_H */