blob: 9f45d5fa1c98ed4a6b9abf2bca7ccb46c8504f2f [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) 2005
*
* 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_NRAS_CAPABILITY_H
#define MRS_NRAS_CAPABILITY_H
#include "irat_common_enums.h"
#include "mrs_as_enums.h"
#include "mrs_as_struct.h"
#include "mrs_common_capability.h"
#include "custom_nras_config.h"
/********************************************
* MACROS *
********************************************/
#define NRARFCN_INVALID 0xFFFFFFFF
#define NRFREQ_INVALID 0
/*
* MRS_NRAS_MAX_OVERLAPPING_BANDS value 8 follows the maximum length
* (maxNrofMultiBands) of IE MultiFrequencyBandListNR-SIB specified in
* TS 38.331.
*/
#define MRS_NRAS_MAX_OVERLAPPING_BANDS 8
#define MRS_NRAS_MIN_FR1_BAND (1)
#define MRS_NRAS_MAX_FR1_BAND (86)
#define MRS_NRAS_MIN_FR2_BAND (257)
#define MRS_NRAS_MAX_FR2_BAND (261)
#define MRS_NRAS_SEARCH_MAX_POWER_SCAN_RANGE_NUM 512
#define MRS_NRAS_SEARCH_MAX_DETECTED_CELL_NUM 256
#define MRS_NRAS_MAX_EUTRA_BAND_LIST_LENGTH 256
#define MRS_NRAS_GEMINI_STATUS_NUM 3
/********************************************
* TYPE DEFINITIONS & ENUMS *
********************************************/
typedef enum
{
NR_DUPLEX_FDD,
NR_DUPLEX_TDD,
NR_DUPLEX_SDL,
NR_DUPLEX_SUL,
NR_DUPLEX_INVALID
} nr_duplex_enum;
typedef enum {
NRAS_READ_NVRAM_CNF,
NRAS_BAND_SETTING_UPDATE,
NRAS_MAX_BAND_CAP_FOR_USER,
NRAS_INTERNAL_BAND_SETTING_UPDATE,
COMMON_EM_GET_AS_BAND_SETTING,
COMMON_EM_SET_AS_BAND_SETTING,
NRAS_BNAD_GET_CONTEXT_NVRAM,
NRAS_BNAD_GET_ENDC_CONTEXT_NVRAM,
NRAS_BAND_SET_CONTEXT_NVRAM,
NRAS_BAND_SET_ENDC_CONTEXT_NVRAM,
#ifdef __NVM_GLOBAL_CABC__
NRAS_BAND_SUPPORT_BY_PLMN,
#endif /* __NVM_GLOBAL_CABC__ */
NRAS_ENDC_NR_SUPPORTED_BAND_LIST_INITIAL,
NRAS_INTERNAL_ENDC_BAND_SETTING_UPDATE
} nras_band_print_func_enum;
typedef enum {
NRAS_FUNC_INPUT,
NRAS_RF_FILTER,
NRAS_BAND_READ_NR_BANDS_FROM_SCSI,
NRAS_BAND_READ_NR_ENDC_BANDS_FROM_SCSI,
NRAS_BAND_SET_NR_BANDS,
NRAS_BAND_SET_NR_ENDC_BANDS,
NRAS_BAND_SET_NR_BANDS_FROM_SCSI,
NRAS_BAND_SET_NR_ENDC_BANDS_FROM_SCSI,
NRAS_BAND_NVRAM_OUTPUT_NR_BANDS,
NRAS_BAND_NVRAM_OUTPUT_NR_ENDC_BANDS,
#ifdef __NVM_GLOBAL_CABC__
NRAS_SA_BAND_SUPPORT,
NRAS_ENDC_BAND_SUPPORT,
#endif /* __NVM_GLOBAL_CABC__ */
NRAS_RF_FILTER_ENDC_NR_FULL_CAP,
NRAS_RF_FILTER_ENDC_NR_DATA_SIM,
NRAS_RF_FILTER_ENDC_NR_NON_DATA_SIM
} nras_band_print_check_point_enum;
typedef enum {
NRAS_LOW_CARRIER_FREQ,
NRAS_MID_CARRIER_FREQ,
NRAS_HIGH_CARRIER_FREQ
} mrs_nras_carrier_freq_type_enum;
typedef enum {
MRS_NRAS_SEARCH_RESULT_NOT_FINISHED,
MRS_NRAS_SEARCH_RESULT_FINISHED
} mrs_nras_search_result_status_enum;
typedef enum {
NRAS_SFTD_MEAS_PSCELL,
NRAS_SFTD_MEAS_NR_CELL
} mrs_nras_sftd_meas_type_enum;
typedef enum {
MRS_NRAS_PLMN_MATCH_RESULT_NOT_FOUND, /* No SIB is found on this frequency */
MRS_NRAS_PLMN_MATCH_RESULT_NOT_MATCH, /* Exist SIB on this frequency, but PLMN doesn't match */
MRS_NRAS_PLMN_MATCH_RESULT_MATCH /* Exist SIB on this frequency and PLMN match exactly*/
} mrs_nras_plmn_match_result_enum;
typedef enum {
MRS_NRAS_QUICK_POWER_SEARCH_RESULT = 0,
MRS_NRAS_NORMAL_POWER_SEARCH_RESULT = 1,
MRS_NRAS_NORMAL_POWER_SEARCH_RESULT_MAX
} mrs_nras_power_scan_result_rssi_threshold_enum;
typedef enum
{
MRS_NR_BAND_DISABLE_BY_PLMN_STATE_NONE,
MRS_NR_BAND_DISABLE_BY_PLMN_STATE_ONE_OR_MORE,
MRS_NR_BAND_DISABLE_BY_PLMN_STATE_ALL,
MRS_NR_BAND_DISABLE_BY_PLMN_STATE_INVALID
} mrs_nr_band_disable_by_plmn_state_enum;
#ifdef __GEMINI__
typedef enum
{
MRS_NRAS_GEMINI_STATUS_DR_DSDS_SUPPORTED,
MRS_NRAS_GEMINI_STATUS_DSDA_SUPPORTED,
MRS_NRAS_GEMINI_STATUS_MULTI_SIM_INSERTED,
MRS_NRAS_GEMINI_STATUS_IS_DATA_SIM,
MRS_NRAS_GEMINI_STATUS_INVALID
} mrs_nras_gemini_query_option_enum;
#endif
typedef struct {
kal_uint8 nea_support; /*MSB: NEA0, 128-NEA1, 128-NEA2, 128-NEA3 */
kal_uint8 nia_support; /*MSB: NIA0, 128-NIA1, 128-NIA2, 128-NIA3 */
kal_uint8 nras_power_class;
kal_uint8 endc_support;
kal_uint8 nvram_nr_band[MRS_NR_BAND_BITMASK_SIZE];
kal_uint8 nvram_endc_nr_band[MRS_NR_BAND_BITMASK_SIZE];
#ifdef __NVM_GLOBAL_CABC__
//mrs_plmn_id_list saved_plmn_id_list;
//mrs_gemini_status_enum saved_gemini_status;
//kal_bool saved_sa_nr_band_valid;
//kal_uint8 saved_sa_nr_band_bitmask[MRS_NR_BAND_BITMASK_SIZE];
//kal_bool saved_endc_nr_band_valid;
//kal_uint8 saved_endc_nr_band_bitmask[MRS_NR_BAND_BITMASK_SIZE];
#endif /* __NVM_GLOBAL_CABC__ */
} nras_capability_context_struct;
typedef struct {
nr_duplex_enum nr_duplex;
kal_uint16 nr_band;
} nras_band_duplex_struct;
typedef struct
{
kal_uint32 begin;
kal_uint32 end;
} mrs_freq_range_struct;
typedef struct {
kal_uint16 band;
kal_uint32 ssb_arfcn;
kal_uint16 pci;
kal_uint8 subcarrier_spacing_ssb; // The original type is NR_SCS_TYPE_E, but MRS does not include NL1 header, so use U8
mrs_plmn_id_list plmn_list;
#if 1//defined(__SKIP_BW__)
mrs_freq_range_struct cell_arfcn_begin_end_points;
#endif /* __SKIP_BW__ */
} mrs_nras_search_cell_sib_result_entry_struct;
typedef struct {
kal_uint16 band;
kal_uint32 begin;
kal_uint32 end;
mrs_nr_scs_enum ssb_scs;
} mrs_nras_search_ccs_result_entry_struct;
typedef struct {
kal_uint32 continuous_carrier_search_result_num;
mrs_nras_search_ccs_result_entry_struct continuous_carrier_search_result[MRS_NRAS_SEARCH_MAX_POWER_SCAN_RANGE_NUM];
kal_uint32 cell_sib_result_num;
mrs_nras_search_cell_sib_result_entry_struct cell_sib_result[MRS_NRAS_SEARCH_MAX_DETECTED_CELL_NUM];
kal_uint32 non_cell_defining_ssb_range_num;
mrs_freq_range_struct non_cell_defining_ssb_range[MRS_NRAS_SEARCH_MAX_DETECTED_CELL_NUM];
kal_uint32 power_scan_result_num[MRS_NRAS_NORMAL_POWER_SEARCH_RESULT_MAX];
mrs_freq_range_struct power_scan_result[MRS_NRAS_NORMAL_POWER_SEARCH_RESULT_MAX][MRS_NRAS_SEARCH_MAX_POWER_SCAN_RANGE_NUM];
} mrs_nras_search_info_struct;
/*
* List implementing NR band support bitmask where LSB in the first one byte
* (index 0) of nr_band_list represents NR band 1.
*/
typedef struct {
kal_uint8 nr_band_list[MRS_NR_BAND_BITMASK_SIZE];
} mrs_nr_band_list_struct;
typedef struct
{
ca_bandwidth_class_eutra_enum ca_bandwidth_class_dl;
ca_bandwidth_class_eutra_enum ca_bandwidth_class_ul;
kal_uint16 eutra_band;
} nras_eutra_band_info_struct;
typedef struct
{
nras_eutra_band_info_struct
eutra_band_list[MRS_NRAS_MAX_EUTRA_BAND_LIST_LENGTH];
kal_uint16 eutra_band_list_length;
} nras_eutra_band_list_struct;
/********************************************
* VARIABLES *
********************************************/
/********************************************
* FUNCTION DECLARATIONS *
********************************************/
kal_uint8 mrs_nras_is_supported_dl_nrarfcn_on_any_band(kal_uint16 *band,
NRARFCN nr_dl_arfcn, MRS_SIM_INDEX sim_index);
kal_uint16 mrs_nras_supported_band_of_dl_nrarfcn_get(NRARFCN nr_dl_arfcn,
MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_is_supported_dl_nrarfcn(NRARFCN nr_dl_arfcn, kal_uint16 band,
MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_is_supported_dl_nrarfcn_partial_band(
const mrs_plmn_id *p_mrs_plmn_id,
NRARFCN nr_dl_arfcn, kal_uint16 band, MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_is_supported_ul_nrarfcn(NRARFCN nr_dl_arfcn, kal_uint16 band,
MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_is_supported_band(kal_uint16 nr_band, MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_is_supported_band_public(kal_uint16 nr_band,
MRS_SIM_INDEX sim_index,
kal_bool show_trace);
void mrs_nras_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8 *data, kal_uint16 len);
kal_uint8 mrs_nras_get_powerclass(MRS_SIM_INDEX sim_index, kal_uint16 nr_band);
kal_uint8 mrs_nras_get_powerclass_value(MRS_SIM_INDEX sim_index,
kal_uint16 nr_band);
kal_uint32 mrs_nras_dl_nrarfcn_phy_freq_get(NRARFCN dl_nrarfcn);
kal_uint32 mrs_nras_ul_nrarfcn_phy_freq_get(NRARFCN ul_nrarfcn);
void mrs_nras_dl_nrarfcn_duplex_type_get(NRARFCN dl_nrarfcn,
nras_band_duplex_struct *duplex_list, kal_uint8 *duplex_list_length);
void mrs_nras_ul_nrarfcn_duplex_type_get(NRARFCN ul_nrarfcn,
nras_band_duplex_struct *duplex_list, kal_uint8 *duplex_list_length);
kal_bool mrs_nras_is_specified_nr_band(kal_uint16 nr_band);
kal_bool mrs_nras_is_gscn_supported(
mrs_nras_carrier_freq_type_enum carrier_freq_type,
kal_uint16 freq_index, kal_int8 freq_offset);
kal_bool mrs_nras_is_endc_support(MRS_SIM_INDEX sim_index);
kal_uint32 mrs_nras_get_ue_nr_cap(MRS_SIM_INDEX sim_index,
const mrs_nras_octet_string_struct freqbandlist_ie,
const mrs_nras_octet_string_struct UE_CapabilityRequestFilterNR_ie,
const mrs_plmn_id_list *p_plmn_id_list,
kal_uint8 **pp_ue_nr_cap,
kal_bool eutra_nr_only,
mrs_gemini_status_enum gemini_status,
kal_bool is_restriction_size_valid,
kal_uint32 restriction_size,
kal_bool is_bc_list_set);
kal_uint32 mrs_nras_get_ue_mrdc_cap(MRS_SIM_INDEX sim_index,
const mrs_nras_octet_string_struct freqbandlist_ie,
const mrs_nras_octet_string_struct UE_CapabilityRequestFilterNR_ie,
const mrs_plmn_id_list *p_plmn_id_list,
kal_uint8 **pp_ue_mrdc_cap,
kal_bool eutra_nr_only,
mrs_gemini_status_enum gemini_status,
kal_bool is_restriction_size_valid,
kal_uint32 restriction_size,
kal_bool is_bc_list_set);
void mrs_nras_get_ue_nr_and_mrdc_cap(MRS_SIM_INDEX sim_index,
const mrs_nras_octet_string_struct freqbandlist_ie,
const mrs_nras_octet_string_struct UE_CapabilityRequestFilterNR_ie,
const mrs_plmn_id_list *p_plmn_id_list,
kal_uint8 **pp_ue_nr_cap,
kal_uint8 **pp_ue_mrdc_cap,
kal_bool eutra_nr_only,
mrs_gemini_status_enum gemini_status,
kal_uint16 *nr_cap_size,
kal_uint16 *mrdc_cap_size,
kal_bool is_restriction_size_valid,
kal_uint32 restriction_size,
kal_bool is_bc_list_set);
/**
* @brief Gets EUTRAN feature set IDs
* @param[in] freqbandlist_ie Encoded NR FreqBandList IE as specified in TS 38.331
* @param[in] p_plmn_id_list PLMN Id List is used for band filtering or customization
* @param[out] p_eutran_feature_sets Pointer to EUTRAN feature set IDs
* @param[in] sim_index SIM index
* @return N/A
*/
void mrs_nras_eutran_feature_set_ids_get(
const mrs_nras_octet_string_struct freqbandlist_ie,
const mrs_plmn_id_list *p_plmn_id_list,
mrs_nras_eutran_feature_set_ids_struct *p_eutran_feature_sets,
MRS_SIM_INDEX sim_index,
mrs_gemini_status_enum gemini_status,
kal_bool is_bc_list_set);
kal_uint16 mrs_nras_max_band_number_get(void);
nr_duplex_enum mrs_nras_band_duplex_get(kal_uint16 band);
kal_uint32 mrs_nras_max_ul_phy_freq_get(kal_uint16 band);
kal_uint32 mrs_nras_min_ul_phy_freq_get(kal_uint16 band);
kal_uint32 mrs_nras_max_dl_phy_freq_get(kal_uint16 band);
kal_uint32 mrs_nras_min_dl_phy_freq_get(kal_uint16 band);
kal_uint32 mrs_nras_all_rat_max_dl_phy_freq_get(kal_uint16 band);
kal_uint32 mrs_nras_all_rat_min_dl_phy_freq_get(kal_uint16 band);
NRARFCN mrs_nras_max_dl_nr_arfcn_get(kal_uint16 band);
NRARFCN mrs_nras_min_dl_nr_arfcn_get(kal_uint16 band);
NRARFCN mrs_nras_max_ul_nr_arfcn_get(kal_uint16 band);
NRARFCN mrs_nras_min_ul_nr_arfcn_get(kal_uint16 band);
NRARFCN mrs_nras_dl_phy_freq_nrarfcn_get(kal_uint32 dl_phy_freq);
#ifndef __NVM_GLOBAL_CABC__
kal_bool mrs_nras_nr_fdd_supported(MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_nr_tdd_supported(MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_nr_fr1_supported(MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_nr_fr2_supported(MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_endc_nr_fdd_supported(MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_endc_nr_tdd_supported(MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_endc_nr_fr1_supported(MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_endc_nr_fr2_supported(MRS_SIM_INDEX sim_index);
#else
kal_bool mrs_nras_nr_fdd_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
kal_bool mrs_nras_nr_tdd_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
kal_bool mrs_nras_nr_fr1_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
kal_bool mrs_nras_nr_fr2_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
kal_bool mrs_nras_endc_nr_fdd_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
kal_bool mrs_nras_endc_nr_tdd_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
kal_bool mrs_nras_endc_nr_fr1_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
kal_bool mrs_nras_endc_nr_fr2_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
#endif /* __NVM_GLOBAL_CABC__ */
void mrs_nras_clear_search_info(MRS_SIM_INDEX sim_index);
void mrs_nras_search_continuous_carrier_search_result_add(const MRS_SIM_INDEX sim_index, mrs_nras_search_ccs_result_entry_struct *input);
kal_uint32 mrs_nras_search_continuous_carrier_search_result_query(const MRS_SIM_INDEX sim_index, mrs_nras_search_ccs_result_entry_struct *p_list);
kal_uint32 mrs_nras_search_non_cell_defining_ssb_range_query(mrs_freq_range_struct *p_list);
void mrs_nras_search_cell_sib_result_add(const MRS_SIM_INDEX sim_index, const mrs_nras_search_cell_sib_result_entry_struct *input);
void mrs_nras_search_non_cell_defining_ssb_range_add(const MRS_SIM_INDEX sim_index, const mrs_freq_range_struct *input);
mrs_nras_plmn_match_result_enum mrs_nras_search_plmn_in_sib_of_freq(
const MRS_SIM_INDEX sim_index,
const kal_uint32 nrarfcn,
const plmn_id_struct *selected_plmn);
kal_uint32 mrs_nras_search_cell_bw_query(
const MRS_SIM_INDEX sim_index,
mrs_freq_range_struct *range_list);
void mrs_nras_search_power_scan_result_add(const MRS_SIM_INDEX sim_index,
const mrs_freq_range_struct *input,
kal_bool is_quick_search);
kal_uint32 mrs_nras_search_power_scan_result_query(const MRS_SIM_INDEX sim_index,
mrs_freq_range_struct *p_list,
kal_bool is_quick_search);
void mrs_nras_search_power_scan_result_remove(const MRS_SIM_INDEX sim_index,
const mrs_freq_range_struct *input,
kal_bool is_quick_search);
void mrs_nras_mrs_plmn_id_to_plmn_id(const mrs_plmn_id *src, plmn_id_struct *dst);
kal_bool mrs_nras_sftd_measurement_type_supported(
MRS_SIM_INDEX sim_index,
mrs_nras_sftd_meas_type_enum sftd_meas_type,
NRARFCN nr_arfcn);
/**
* @brief Function for reading the list of the NR bands supported by RF.
* @param[out] NR band list.
*/
void mrs_nras_max_band_cap_for_user(mrs_nr_band_list_struct *nr_band);
void mrs_nras_nr_band_rf_cap_for_user(mrs_nr_band_list_struct *nr_sa_band, mrs_nr_band_list_struct *nr_endc_band);
kal_bool mrs_nras_band_setting_update(MRS_SIM_INDEX sim_index,
kal_uint8 *p_nr_band, kal_bool with_duplex_mode);
kal_bool mrs_nras_endc_band_setting_update(MRS_SIM_INDEX sim_index,
mrs_gemini_status_enum *gemini_status, kal_uint8 *p_endc_nr_band);
void mrs_nras_print_band_bitmask(const kal_uint8* p_band_mask_byte,
nras_band_print_func_enum func_name,
nras_band_print_check_point_enum check_point);
void mrs_nras_get_context_nvram_nr_band(kal_uint8 *p_nr_band_mask, MRS_SIM_INDEX sim_index);
void mrs_nras_set_context_nvram_nr_band(kal_uint8 *p_nr_band_mask, MRS_SIM_INDEX sim_index);
void mrs_nras_get_context_nvram_endc_nr_band(kal_uint8 *p_endc_nr_band_mask, MRS_SIM_INDEX sim_index);
void mrs_nras_set_context_nvram_endc_nr_band(kal_uint8 *p_endc_nr_band_mask, MRS_SIM_INDEX sim_index);
/**
* @brief Function for retrieving NR band bit mask indicating the NR bands
* supported by the UE in EN-DC.
* @param[out] NR band bit mask with MAX_BYTE_NR_BAND_BITMASK bytes.
* @return -
*/
void mrs_nras_endc_nr_band_list_get(mrs_gemini_status_enum gemini_status,
MRS_SIM_INDEX sim_index,
kal_uint8 *nr_band);
/**
* @brief Function for checking if NR band given is supported ENDC NR band by UE.
* @param[in] gemini_status Gemini status.
* @param[in] SIM index
* @param[in] NR band
* @return KAL_TRUE if the NR band given in input is supported ENDC NR band by UE.
* @return KAL_FALSE if the NR band given in input is not supported ENDC NR band by UE.
*/
kal_bool mrs_nras_is_supported_endc_nr_band(mrs_gemini_status_enum gemini_status,
MRS_SIM_INDEX sim_index,
kal_uint16 nr_band);
/**
* @brief Function to get SA NR band bitmask is supported by PLMN.
* @param[in] SIM index
* @param[out] support band bitmask
* @param[in] PLMN id list
* @param[in] Trace print is shown or not
*/
void mrs_nras_sa_nr_band_bitmask_get_by_plmn(
MRS_SIM_INDEX sim_index,
kal_uint8 *p_nr_band_bitmask,
const mrs_plmn_id_list *p_plmn_id_list,
kal_bool show_trace);
/**
* @brief Function to get ENDC NR band bitmask is supported by PLMN.
* @param[in] gemini_status Gemini status.
* @param[in] SIM index
* @param[out] support band bitmask
* @param[in] PLMN id list
* @param[in] Trace print is shown or not
*/
void mrs_nras_endc_nr_band_bitmask_get_by_plmn(
mrs_gemini_status_enum gemini_status,
MRS_SIM_INDEX sim_index,
kal_uint8 *p_nr_band_bitmask,
const mrs_plmn_id_list *p_plmn_id_list,
kal_bool show_trace);
#ifdef __NVM_GLOBAL_CABC__
/**
* @brief check if SA NR band given is supported by PLMN.
* @param[in] NR band
* @param[in] SIM index
* @param[in] PLMN id list
* @param[in] Trace print is shown or not
* @return KAL_TRUE if the NR band given in input is supported by PLMN.
* @return KAL_FALSE if the NR band given in input is not supported by PLMN.
*/
kal_bool mrs_nras_is_supported_sa_nr_band_plmn(
kal_uint16 nr_band,
MRS_SIM_INDEX sim_index,
const mrs_plmn_id_list *p_plmn_id_list,
kal_bool show_trace);
/**
* @brief check if ENDC NR band given is supported by PLMN.
* @param[in] gemini status
* @param[in] NR band
* @param[in] SIM index
* @param[in] PLMN id list
* @param[in] Trace print is shown or not
* @return KAL_TRUE if the NR band given in input is supported by PLMN.
* @return KAL_FALSE if the NR band given in input is not supported by PLMN.
*/
kal_bool mrs_nras_is_supported_endc_nr_band_plmn(
mrs_gemini_status_enum gemini_status,
kal_uint16 nr_band,
MRS_SIM_INDEX sim_index,
const mrs_plmn_id_list *p_plmn_id_list,
kal_bool show_trace);
#endif /* __NVM_GLOBAL_CABC__ */
/**
* @brief Function for reading EUTRA band list from FreqBandList
* @param[in] Encoded FreqBandList IE as specified in TS 38.331
* @param[out] EUTRA band list
* @return N/A
*/
void mrs_nras_freq_band_list_eutra_bands_retrieve(
const mrs_nras_octet_string_struct freqbandlist_ie,
nras_eutra_band_list_struct *p_eutra_band_list);
void mrs_nras_set_radio_capability_for_ng_ran_changed(
MRS_SIM_INDEX sim_index, kal_bool value);
kal_bool mrs_nras_get_radio_capability_for_ng_ran_changed(
MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_band_setting_update_by_plmn(function_caller_id_enum caller_id,
MRS_SIM_INDEX sim_index, mrs_plmn_id_list* p_plmn, mrs_ehplmn_id_list* p_ehplmn);
mrs_nr_band_disable_by_plmn_state_enum mrs_nras_get_band_disable_by_plmn_state(MRS_SIM_INDEX sim_index);
function_caller_id_enum mrs_nras_get_band_disable_last_caller_id(MRS_SIM_INDEX sim_index);
/**
* @brief Checks if EN-DC band combination is supported with given LTE/NR bands.
* @param[in] sim_index SIM index
* @param[in] lte_band LTE band
* @param[in] p_nr_band Pointer to NR band, if NULL, any NR band is OK for EN-DC band combination check
* @param[in] p_plmn_id_list PLMN Id List is used for band filtering or customization
* @param[in] gemini_status Gemini status.
* @return TRUE if EN-DC band combination found, otherwise FALSE.
*/
kal_bool mrs_nras_is_endc_comb_supported_band(
kal_uint8 sim_index,
kal_uint16 lte_band,
kal_uint16* p_nr_band,
const mrs_plmn_id_list *p_plmn_id_list,
mrs_gemini_status_enum gemini_status);
/**
* @brief Function for reading Gemini status
* @param[in] SIM index
* @return Gemini status
*/
mrs_gemini_status_enum mrs_nras_get_gemini_status(MRS_SIM_INDEX sim_idx);
/* EN-DC equivalents for some API functions that check for band support */
kal_uint8 mrs_nras_is_supported_endc_dl_nrarfcn_on_any_band(kal_uint16 *band,
NRARFCN nr_dl_arfcn, MRS_SIM_INDEX sim_index);
kal_uint8 mrs_nras_is_supported_endc_and_nr_only_dl_nrarfcn_on_any_band(kal_uint16 *band,
NRARFCN nr_dl_arfcn, MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_is_supported_endc_dl_nrarfcn(NRARFCN nr_dl_arfcn, kal_uint16 band,
MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_is_supported_endc_dl_nrarfcn_partial_band(
const mrs_plmn_id *p_mrs_plmn_id, NRARFCN nr_dl_arfcn, kal_uint16 band,
MRS_SIM_INDEX sim_index);
kal_bool mrs_nras_is_supported_endc_ul_nrarfcn(NRARFCN nr_dl_arfcn, kal_uint16 band,
MRS_SIM_INDEX sim_index);
/**
* @brief Requests MRS to inform NL1 about possible need to modify NR band
* bandwidth according to the PLMN.
* @param[in] GEMINI status
* @param[in] PLMN ID
* @param[in] SIM index
* @return N/A
*/
void mrs_nras_modify_nr_bw(
mrs_gemini_status_enum gemini_status, mrs_plmn_id plmn_id,
MRS_SIM_INDEX sim_index);
/**
* @brief Checks if NL1_CAP is not building band combinations and can return the band combinations immediately when mrs_nras_is_endc_comb_supported_band is called
* @param[in] sim_index SIM index
* @return TRUE if NL1_CAP is ready and not building band combinations
*/
kal_bool mrs_nras_is_nl1_band_combination_ready(MRS_SIM_INDEX sim_index);
/**
* @brief When NL1_CAP start/finish building capability, it will update the status.
* @param[in] sim_index SIM index
* @param[in] nl1_cap_build_done NL1_CAP status
* @return N/A
*/
void mrs_nras_nl1_cap_status_update(MRS_SIM_INDEX sim_index, kal_bool nl1_cap_build_done);
kal_bool mrs_nras_is_matched_from_nr_partial_band_table(const mrs_plmn_id *p_mrs_plmn_id, MRS_SIM_INDEX sim_index, kal_uint16 band,
mrs_nras_partial_freq_range_list_struct *p_freq_range_list);
/**
* @brief Check whether UE supports extended band n77 in USA
* @param[in] p_plmn_id_list PLMN id list
* @param[in] sim_idx SIM index
* @return kal_bool If extended n77 in USA supported, KAL_TRUE will be returned
*/
kal_bool mrs_nras_extendedBand_n77_supported(const mrs_plmn_id_list* p_plmn_id_list, MRS_SIM_INDEX sim_idx);
#endif /* MRS_NRAS_CAPABILITY_H */