/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*----------------------------------------------------------------------------
 *  $RCSfile: u_sb_cn_dvbc_eng.h $
 *  $Revision: #1 $
 *  $Date: 2015/06/01 $
 *  $Author: cheng.liu $
 *  
 *  @par Description:
 *  	contains exported definitions and delcarations of SB Cable-Ex engine.
 *----------------------------------------------------------------------------*/
 
#ifndef _U_SB_CN_DVBC_ENG_H_
#define _U_SB_CN_DVBC_ENG_H_

/*-----------------------------------------------------------------------------
                    include files
 ----------------------------------------------------------------------------*/
#include "u_tuner.h"

/*-----------------------------------------------------------------------------
                    macros, defines, typedefs, enums
 ----------------------------------------------------------------------------*/

#define CE_ENG_NAME                							"sb_ce" 				/** cable-ex builder's name */

#define CE_TSL_REC_ID_FREQ_STEP        						2000000/*6000000*/ 		/** 2MHz */


typedef UINT32 CE_OPERATOR_NAME_T;    						/** cable-ex engine operator */
#define CE_OPERATOR_NAME_CHINA_OTHERS                 		((CE_OPERATOR_NAME_T) 0)
#define CE_OPERATOR_NAME_CHINA_SNN_OTHERS					((CE_OPERATOR_NAME_T) 128)  								// just used for SNN
#define CE_OPERATOR_NAME_CHINA_SNN_OCN						((CE_OPERATOR_NAME_T) 129)									// just used for SNN
#define CE_OPERATOR_NAME_CHINA_BASE                			((CE_OPERATOR_NAME_T) 1000)   
#define CE_OPERATOR_NAME_CHINA_GUANGZHOU_SHENGWANG			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 1)
#define CE_OPERATOR_NAME_CHINA_GUANGZHOU_SHIWANG			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 2)
#define CE_OPERATOR_NAME_CHINA_HUNAN_GUANGDIAN				((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 3)
#define CE_OPERATOR_NAME_CHINA_CHANGSHA_GUOAN				((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 4)
#define CE_OPERATOR_NAME_CHINA_WUHAN_SHENGWANG				((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 5)
#define CE_OPERATOR_NAME_CHINA_WUHAN_SHIWANG      			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 6)
#define CE_OPERATOR_NAME_CHINA_XIAN_GUANGDIAN				((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 7)
#define CE_OPERATOR_NAME_CHINA_BEIJING_GEHUAYOUXIAN			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 8)
#define CE_OPERATOR_NAME_CHINA_QINGDAO_GUANGDIAN			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 9)
#define CE_OPERATOR_NAME_CHINA_HUBEI_HUANGSHI    			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 10)
#define CE_OPERATOR_NAME_CHINA_DALIAN_GUANGDIAN  			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 11)
#define CE_OPERATOR_NAME_CHINA_SHAOXING_GUANGDIAN  			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 12)
#define CE_OPERATOR_NAME_CHINA_NEIMENGGU_YOUXIAN  			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 13)
#define CE_OPERATOR_NAME_CHINA_EZHOU_YOUXIAN				((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 14)
#define CE_OPERATOR_NAME_CHINA_SHANGHAI  					((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 15)
#define CE_OPERATOR_NAME_CHINA_SANMING_YOUXIAN    			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 16)
#define CE_OPERATOR_NAME_CHINA_ZHANGJIAGANG  				((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 17)
#define CE_OPERATOR_NAME_CHINA_HANGZHOU_HUASHU				((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 18)
#define CE_OPERATOR_NAME_CHINA_CHONGQING_YOUXIAN			((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 19)
#define CE_OPERATOR_NAME_CHINA_KUNSHAN						((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 20)
#define CE_OPERATOR_NAME_CHINA_JIANGXI						((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 21)
#define CE_OPERATOR_NAME_CHINA_DAZHOU						((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 24)  	// Sichuan Dazhou
#define CE_OPERATOR_NAME_CHINA_NANTONG						((CE_OPERATOR_NAME_T) CE_OPERATOR_NAME_CHINA_BASE + 25) 	// JiangSu NanTong


/* Command to get the scan map and info */
/*------------------------------------------------------------------*/
/*! @enum CE_SCAN_MAPS_CMD_T
 *  @brief commend list of scan map
 *  @code
 *  typedef enum {
 *      CE_SCAN_MAPS_CMD_SET_FINE_TUNE_RANGE,
 *		CE_SCAN_MAPS_CMD_SET_TUNER_FREQ_LOWER_UPPER_BOUND,
 *      CE_SCAN_MAPS_CMD_GET_FIRST_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_LAST_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_NEXT_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_PREV_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_FIRST_PRIOR_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_LAST_PRIOR_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_NEXT_PRIOR_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_NUMBER_PRIOR_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_TUNER_PARA,
 *      CE_SCAN_MAPS_CMD_GET_TSL_ID_BY_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_DEFAULT_FREQ,
 *      CE_SCAN_MAPS_CMD_GET_DEFAULT_NETWORK_ID,
 *      CE_SCAN_MAPS_CMD_GET_DEFAULT_SYMBOL_RATE,
 *      CE_SCAN_MAPS_CMD_GET_DEFAULT_QAM,
 *      CE_SCAN_MAPS_CMD_GET_DEFAULT_TUNER_PARA,
 *      CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SORTING,
 *      CE_SCAN_MAPS_CMD_GET_CUSTOMIZED_SORTING,
 *      CE_SCAN_MAPS_CMD_IS_NON_LCN_COUNTRY,
 *      CE_SCAN_MAPS_CMD_DETERMINE_PRIVATE_DATA_SPECIFIER,
 *      CE_SCAN_MAPS_CMD_IS_SERVICE_REMOVAL_MUST_BE_CONFIRMED_COUNTRY,
 *      CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SCAN_MAP,
 *      CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SORTING_BY_NAME,
 *      CE_SCAN_MAPS_CMD_GET_CUSTOMIZED_SORTING_BY_NAME,
 *  }   CE_SCAN_MAPS_CMD_T;
 *  @endcode
 *  @li@c  CE_SCAN_MAPS_CMD_SET_FINE_TUNE_RANGE            		- it provides eng to set the range of finetune. UINT32. Hz
 *  @li@c  CE_SCAN_MAPS_CMD_SET_TUNER_FREQ_LOWER_UPPER_BOUND    - n.a.(deserted, to be deleted)
 *  @li@c  CE_SCAN_MAPS_CMD_GET_FIRST_FREQ                 		- to get the first frequency by country and operator. UINT32. Hz
 *  @li@c  CE_SCAN_MAPS_CMD_GET_LAST_FREQ                  		- to get the last frequency by country and operator. UINT32. Hz
 *  @li@c  CE_SCAN_MAPS_CMD_GET_NEXT_FREQ                  		- to get next frequency by country and operator. UINT32. Hz
 *  @li@c  CE_SCAN_MAPS_CMD_GET_PREV_FREQ                  		- to get previous frequency by country and operator. UINT32. Hz
 *  @li@c  CE_SCAN_MAPS_CMD_GET_FIRST_PRIOR_FREQ           		- to get the first "prior" frequency by country and operator, 
 *																  user can define some prior freq points to speed up the scan procedure. UINT32. Hz
 *  @li@c  CE_SCAN_MAPS_CMD_GET_LAST_PRIOR_FREQ            		- to get the last "prior" frequency by country and operator. UINT32. Hz
 *  @li@c  CE_SCAN_MAPS_CMD_GET_NEXT_PRIOR_FREQ            		- to get next "prior" frequency by country and operator.
 *  @li@c  CE_SCAN_MAPS_CMD_GET_NUMBER_PRIOR_FREQ          		- to get the total number of prior frequency points.
 *  @li@c  CE_SCAN_MAPS_CMD_GET_TUNER_PARA                 		- to get unknown tuner parameters by country, operator and frequency.  SB_CE_DLVR_INFO_T
 *  @li@c  CE_SCAN_MAPS_CMD_GET_TSL_ID_BY_FREQ             		- to get tsl_rec_id by frequency.
 *  @li@c  CE_SCAN_MAPS_CMD_GET_DEFAULT_FREQ               		- to get default home frequency for every country and operator
 *  @li@c  CE_SCAN_MAPS_CMD_GET_DEFAULT_NETWORK_ID         		- to get default home network id for every country and operator
 *  @li@c  CE_SCAN_MAPS_CMD_GET_DEFAULT_SYMBOL_RATE        		- to get default home symbol rate for every country and operator
 *  @li@c  CE_SCAN_MAPS_CMD_GET_DEFAULT_QAM                		- to get default QAM for every country and operator
 *  @li@c  CE_SCAN_MAPS_CMD_GET_DEFAULT_TUNER_PARA         		- to get unknown tuner parameters by default
 *  @li@c  CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SORTING          		- to check if it needs to apply customized sorting for this country
 *  @li@c  CE_SCAN_MAPS_CMD_GET_CUSTOMIZED_SORTING         		- to get the ranking with svc_id
 *  @li@c  CE_SCAN_MAPS_CMD_IS_NON_LCN_COUNTRY             		- to check if the country is a non-lcn country
 *  @li@c  CE_SCAN_MAPS_CMD_DETERMINE_PRIVATE_DATA_SPECIFIER  	- n.a.(deserted, to be deleted)
 *  @li@c  CE_SCAN_MAPS_CMD_IS_SERVICE_REMOVAL_MUST_BE_CONFIRMED_COUNTRY    
 *																- to check if the service removal has to be confirmed by user
 *  @li@c  CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SCAN_MAP         		- to check if there is any customized scan map for the country. 
 *  @li@c  CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SORTING_BY_NAME  		- to check if it needs to apply customized sorying by name for this country 
 *  @li@c  CE_SCAN_MAPS_CMD_GET_CUSTOMIZED_SORTING_BY_NAME 		- to get the ranking with service name.
 */
/*------------------------------------------------------------------*/
typedef enum {
    CE_SCAN_MAPS_CMD_SET_FINE_TUNE_RANGE,
    CE_SCAN_MAPS_CMD_SET_TUNER_FREQ_LOWER_UPPER_BOUND,	
    CE_SCAN_MAPS_CMD_GET_FIRST_FREQ,
    CE_SCAN_MAPS_CMD_GET_LAST_FREQ,
    CE_SCAN_MAPS_CMD_GET_NEXT_FREQ,
    CE_SCAN_MAPS_CMD_GET_PREV_FREQ,
    CE_SCAN_MAPS_CMD_GET_FIRST_PRIOR_FREQ,
    CE_SCAN_MAPS_CMD_GET_LAST_PRIOR_FREQ,
    CE_SCAN_MAPS_CMD_GET_NEXT_PRIOR_FREQ,
    CE_SCAN_MAPS_CMD_GET_NUMBER_PRIOR_FREQ,
    CE_SCAN_MAPS_CMD_GET_TUNER_PARA,
    CE_SCAN_MAPS_CMD_GET_TSL_ID_BY_FREQ,
    CE_SCAN_MAPS_CMD_GET_DEFAULT_FREQ,
    CE_SCAN_MAPS_CMD_GET_DEFAULT_NETWORK_ID,
    CE_SCAN_MAPS_CMD_GET_DEFAULT_SYMBOL_RATE,
    CE_SCAN_MAPS_CMD_GET_DEFAULT_QAM,
    CE_SCAN_MAPS_CMD_GET_DEFAULT_TUNER_PARA,
    CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SORTING,
    CE_SCAN_MAPS_CMD_GET_CUSTOMIZED_SORTING,
    CE_SCAN_MAPS_CMD_IS_NON_LCN_COUNTRY,
    CE_SCAN_MAPS_CMD_DETERMINE_PRIVATE_DATA_SPECIFIER,
    CE_SCAN_MAPS_CMD_IS_SERVICE_REMOVAL_MUST_BE_CONFIRMED_COUNTRY,
    CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SCAN_MAP,
    CE_SCAN_MAPS_CMD_IS_CUSTOMIZED_SORTING_BY_NAME,
    CE_SCAN_MAPS_CMD_GET_CUSTOMIZED_SORTING_BY_NAME,
    CE_SCAN_MAPS_CMD_IS_MULTIPLE_BANK_COUNTRY,
    CE_SCAN_MAPS_CMD_GET_RADIO_CH_NUM_OFFSET,
    CE_SCAN_MAPS_CMD_CHECK_SVC_TYPE,
    CE_SCAN_MAPS_CMD_GET_BAT_SORT_INFO,
    CE_SCAN_MAPS_CMD_GET_RF_CHANNEL_BY_FREQ,
} CE_SCAN_MAPS_CMD_T;


/*------------------------------------------------------------------*/
/*! @brief to acquire cusomized scan parameters
 *  @param [in] t_cmd                   - the acquire cmd type in CE_SCAN_MAPS_CMD_T
 *  @param [in] t_country_code      	- the selected country
 *  @param [in] t_operator_name     	- the selected operator 
 *  @param [in] pv_input                - the main input parameter 
 *  @param [in] pv_input2               - the additional input parameter (e.g. CE_SCAN_MAPS_CMD_GET_TUNER_PARA)
 *  @param [out] pv_output              - the desired result for different acquire cmd
 *  @param [out] pz_output_len          - the size of output object
 *  @note
 *  @see CE_SCAN_MAPS_CMD_T
 *  @return Return the error code
 *  @retval SBR_OK                                  - the routine was successful 
 *  @retval SBR_NOT_ENOUGH_SPACE        - the size of output object is not big enough
 *  @retval SBR_OUT_OF_RANGE     - the input parameter is out of range
 *  @retval SBR_NOT_FOUND     - the input country cannot be found
 *  @retval SBR_INV_ARG     - the commend is not supported
 */
/*------------------------------------------------------------------*/
typedef INT32 (*x_sb_cn_dvbc_scan_maps_fct) (CE_SCAN_MAPS_CMD_T   		t_cmd,
                                         	 ISO_3166_COUNT_T    		t_country_code,
                                         	 CE_OPERATOR_NAME_T    		t_operator_name,
                                         	 VOID*               		pv_input,
                                         	 VOID*               		pv_input2,
                                         	 VOID*               		pv_output,
                                         	 SIZE_T*             		pz_output_len);

typedef INT32 (*x_sb_cn_dvbc_scan_maps_fct_prv) (CE_SCAN_MAPS_CMD_T		t_cmd,
                                         		 ISO_3166_COUNT_T   	t_country_code,
                                         		 CE_OPERATOR_NAME_T 	t_operator_name,
                                         		 VOID*               	pv_input,
                                         		 VOID*               	pv_input2,
                                         		 VOID*               	pv_output,
                                         		 SIZE_T*             	pz_output_len,
                                         		 VOID*               	pv_nfy_tag);


typedef UINT32 	SB_CE_CONFIG_T;    /**< This data type contains different configuration flags for the scan process       */

#define SB_CE_CONFIG_IGNORE_ANALOG_CH_ON_SORTING       		(MAKE_BIT_MASK_32(0))   /**< To ignore the analog channels or not while sorting the DVB channels.
   																					   Note that to set this flag might cause the channel number collision between the digital and analog channels */
#define SB_CE_CONFIG_SUPPORT_MHEG5_SERVICES            		(MAKE_BIT_MASK_32(1))	/**< Install the MHEG-5 services as visible ones       */
#define SB_CE_CONFIG_START_CH_NUM_FOR_NON_LCN_CH       		(MAKE_BIT_MASK_32(2))   /**< To customize the the start of the channel numbers to be assigned to the non-LCN channels while LCN need be applied.       */
#define SB_CE_CONFIG_ALWAYS_APPLY_LCN                  		(MAKE_BIT_MASK_32(3))   /**<  To always apply the LCN. By default, the engine would allocate the services to 
																					   channel numbers starting from 1 if all of the services found at this time of scan
																					   are not attached to a LCN; and henceforth, all the LCN found is ignored. With 
																					   this flag set, the engine shall always allocate the non-LCN services to the 
																					   given (or default) start channel numbers for non-LCN services. For example, at
																					   a country where there is no LCN broadcasted, all the digital services are allocated
																					   to 800, 801, 802 ...; there will be no services at 1, 2, 3 ...       */
#define SB_CE_CONFIG_UPDATE_TO_TEMP_SVL                		(MAKE_BIT_MASK_32(4)) 	/**< To store the service records to the given temporary SVL       */
#define SB_CE_CONFIG_KEEP_DUPLICATE_CHANNELS           		(MAKE_BIT_MASK_32(5))   /**< Do not remove duplicate channels       */
#define SB_CE_CONFIG_SDT_NIT_TIMEOUT              			(MAKE_BIT_MASK_32(6))   /**< To customize the timeout value of loading SDT and NIT       */
#define SB_CE_CONFIG_RESERVE_CH_NUM_BEFORE_NON_LCN_CH		(MAKE_BIT_MASK_32(8))   /**< To reserve customizied number of channel numbers before allocating for the non-LCN channels       */
#define SB_CE_CONFIG_NOT_SUPPORT_HDTV                  		(MAKE_BIT_MASK_32(9))   /**< Do not support HDTV (H.264 & MPEG-2)       */
#define SB_CE_CONFIG_SIMPLE_SORT_FOR_NON_LCN_CH        		(MAKE_BIT_MASK_32(10))  /**< Sort the non-LCN channels by the simple rule -service type; Otherwise, sort them by (1) service type, (2) LCN, (3) service name, (4) service id       */
#define SB_CE_CONFIG_EX_QUICK_BUILD_SVL_BY_SDT        		(MAKE_BIT_MASK_32(11))  /**< when ex-quick mode, build service list by SDT not NIT       */
#define SB_CE_CONFIG_PRIOR_RF_SCAN_ENABLE             		(MAKE_BIT_MASK_32(12))  /**< when scan with scan map, app can turn on this flag to scan the prior RF which may speed up scan performance.*/
#define SB_CE_CONFIG_SCAN_WITHOUT_SCAN_MAP             		(MAKE_BIT_MASK_32(13))  /**< when full scan, app can forcely give up scan map and scan with tuner step linearly*/
#define SB_CE_CONFIG_TV_RADIO_SEPARATE                 		(MAKE_BIT_MASK_32(14))  /**< To support TV type and Raido type service in the its channel list in Nordig country, and the SB_CE_CONFIG_IGNORE_ANALOG_CH_ON_SORTING must be defined before used this config*/ 
#define SB_CE_CONFIG_QAM_SR_AUTO_DETECT                 	(MAKE_BIT_MASK_32(16))   
#define SB_CE_CONFIG_INSTALL_FREE_SERVICES_ONLY         	(MAKE_BIT_MASK_32(17))   
#define SB_CE_CONFIG_TRUST_NIT_IN_EX_QUICK_SCAN         	(MAKE_BIT_MASK_32(18))  
#define SB_CE_CONFIG_QUICK_SCAN_IGNORE_SVC_OUT_OF_NETWORK	(MAKE_BIT_MASK_32(19))


/*
 *  The structure SB_CE_INIT_DATA_T is used as the argument of the API x_sb_ce_eng_init()
 *  when initializing an SVL Builder with cable-ex engine.
 *
 *  t_eng_cfg_flag                  Contains the engine configuration flag. The options allowed
 *                                  are SB_CE_CONFIG_IGNORE_ANALOG_CH_ON_SORTING,
 *                                  SB_CE_CONFIG_START_CH_NUM_FOR_NON_LCN_CH,
 *                                  SB_CE_CONFIG_ALWAYS_APPLY_LCN,
 *                                  SB_CE_CONFIG_SDT_NIT_TIMEOUT,
 *                                  SB_CE_CONFIG_RESERVE_CH_NUM_BEFORE_NON_LCN_CH,
 *                                  SB_CE_CONFIG_NOT_SUPPORT_HDTV,
 *                                  SB_CE_CONFIG_SIMPLE_SORT_FOR_NON_LCN_CH.
 *
 *  ui2_start_ch_num_for_non_lcn    Contains the start channel number to be assigned to non-LCN
 *                                  channels when the SB_CE_CONFIG_START_CH_NUM_FOR_NON_LCN_CH 
 *                                  is set. For SB_CE_CONFIG_RESERVE_CH_NUM_BEFORE_NON_LCN_CH,
 *                                  it is the number of reserved channel numbers.
 *
 *  ui4_sdt_timeout_mseconds        Contains the timeout value for loading the SDT. A value less
 *                                  than 2 seconds is not allowed. This argument is used only 
 *                                  when the SB_CE_CONFIG_SDT_NIT_TIMEOUT is set.
 *
 *  ui4_nit_timeout_mseconds        Contains the timeout value for loading the NIT. A value less
 *                                  than 10 seconds is not allowed. This argument is used only 
 *                                  when the SB_CE_CONFIG_SDT_NIT_TIMEOUT is set.
 *
 *  pf_scan_map                     Contains the scan map callback function.
 */

/*------------------------------------------------------------------*/
/*! @struct SB_CE_INIT_DATA_T
 *  @brief The structure SB_CE_INIT_DATA_T is used as the argument of the API x_sb_ce_eng_init()
 *  when initializing an SVL Builder with cable-ex engine.
 *  @code
 *  typedef struct _SB_CE_INIT_DATA_T
 *  {
 *      SB_CE_CONFIG_T         	t_eng_cfg_flag;
 *      UINT16                  ui2_start_ch_num_for_non_lcn;
 *      UINT32                  ui4_sdt_timeout_mseconds;
 *      UINT32                  ui4_nit_timeout_mseconds;
 *      x_sb_cn_dvbc_scan_maps_fct  pf_scan_maps;
 *  } SB_CE_INIT_DATA_T;
 *  @endcode
 *  @li@c  t_eng_cfg_flag             		- Contains the engine configuration flag. The options allowed are the types in SB_CE_CONFIG_T
 *  @li@c  ui2_start_ch_num_for_non_lcn     - Contains the start channel number to be assigned to non-LCN
 *                                  			channels when the SB_CE_CONFIG_START_CH_NUM_FOR_NON_LCN_CH 
 *                                  			is set. For SB_CE_CONFIG_RESERVE_CH_NUM_BEFORE_NON_LCN_CH,
 *                                  			it is the number of reserved channel numbers.
 *  @li@c  ui4_sdt_timeout_mseconds         - Contains the timeout value for loading the SDT. A value less
 *                                  			than 2 seconds is not allowed. This argument is used only 
 *                                  			when the SB_CE_CONFIG_SDT_NIT_TIMEOUT is set.
 *  @li@c  ui4_nit_timeout_mseconds         - Contains the timeout value for loading the NIT. A value less
 *                                  			than 10 seconds is not allowed. This argument is used only 
 *                                  			when the SB_CE_CONFIG_SDT_NIT_TIMEOUT is set.
 *  @li@c  pf_scan_maps                     - Contains the scan map callback function.
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_INIT_DATA_T
{
    SB_CE_CONFIG_T         		t_eng_cfg_flag;
    UINT16                  	ui2_start_ch_num_for_non_lcn;
    UINT32                  	ui4_sdt_timeout_mseconds;
    UINT32                  	ui4_nit_timeout_mseconds;
    x_sb_cn_dvbc_scan_maps_fct  pf_scan_maps;
} SB_CE_INIT_DATA_T;


/*
 *  The structure SB_CE_OPEN_DATA_T is used as the argument
 *  pv_open_data of the API c_sb_open_builder()/x_sb_open_builder()
 *  when opening an SVL Builder with DVB-C engine.
 *
 *  ui4_svl_id                      The id of SVL to be loaded.
 *  ps_svl_name                     The name of SVL to be loaded.
 *  ps_file_name                    The file name from which the SVL/TSL
 *                                  will be loaded.
 *  b_use_orig                      A flag. When set to true, use the existed SVL,
 *                                  instead of reloading it.  When set to false,
 *                                  overwrite the SVL (if exists) by reloading.
 */
/*------------------------------------------------------------------*/
/*! @struct SB_CE_OPEN_DATA_T
 *  @brief The structure SB_CE_OPEN_DATA_T is used as the argument
 *  pv_open_data of the API c_sb_open_builder()/x_sb_open_builder()
 *  when opening an SVL Builder with DVB-C engine.
 *  @code
 *  typedef struct _SB_CE_OPEN_DATA_T
 *  {
 *      UINT16                  ui2_svl_id;
 *      CHAR*                   ps_svl_name;
 *      CHAR*                   ps_file_name;
 *      CHAR*                   ps_tuner_name;    
 *      BOOL                    b_use_orig;
 *  } SB_CE_OPEN_DATA_T;
 *  @endcode
 *  @li@c  ui2_svl_id                                        - The id of SVL to be loaded.
 *  @li@c  ps_svl_name                                       - The name of SVL to be loaded.
 *  @li@c  ps_file_name                                      - The file name from which the SVL/TSL
 *                                  will be loaded.
 *  @li@c  ps_tuner_name                                     - the name of tuner to be used.
 *  @li@c  b_use_orig                                        - A flag. When set to true, use the existed SVL,
 *                                  instead of reloading it.  When set to false,
 *                                  overwrite the SVL (if exists) by reloading.
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_OPEN_DATA_T
{
    UINT16                  ui2_svl_id;
    CHAR*                   ps_svl_name;
    CHAR*                   ps_file_name;
    CHAR*                   ps_tuner_name;    
    BOOL                    b_use_orig;
} SB_CE_OPEN_DATA_T;


/* DVB-C scan type */
/*------------------------------------------------------------------*/
/*! @enum SB_CE_SCAN_TYPE_T
 *  @brief DVB-C scan type
 *  @code
 *  typedef enum
 *  {
 *      SB_CE_SCAN_TYPE_UNKNOWN = 0,
 *      SB_CE_SCAN_TYPE_FULL_MODE,
 *      SB_CE_SCAN_TYPE_MANUAL_FREQ,  
 *      SB_CE_SCAN_TYPE_UPDATE,
 *      SB_CE_SCAN_TYPE_NUM 
 *  } SB_CE_SCAN_TYPE_T;
 *  @endcode
 *  @li@c  SB_CE_SCAN_TYPE_UNKNOWN                         - unknown scan type. should not assign with this value.
 *  @li@c  SB_CE_SCAN_TYPE_FULL_MODE                       - full scan. user can setup the scan range.
 *  @li@c  SB_CE_SCAN_TYPE_MANUAL_FREQ                     - manually scan with a signal frequency. manual scan doesn't support nit search
 *  @li@c  SB_CE_SCAN_TYPE_UPDATE                          - update scan with previously successful scan parameters.
 *  @li@c  SB_CE_SCAN_TYPE_NUM                             - total number of scan types
 */
/*------------------------------------------------------------------*/
typedef enum
{
    SB_CE_SCAN_TYPE_UNKNOWN = 0,
    SB_CE_SCAN_TYPE_FULL_MODE,
    SB_CE_SCAN_TYPE_MANUAL_FREQ,  /* manual scan doesn't support nit search*/
    SB_CE_SCAN_TYPE_UPDATE,
    SB_CE_SCAN_TYPE_NUM 			/* number of scan types */
} SB_CE_SCAN_TYPE_T;


/* DVB-C NIT search mode */
/*------------------------------------------------------------------*/
/*! @enum SB_CE_NIT_SEARCH_MODE_T
 *  @brief DVB-C NIT search mode
 *  @code
 *  typedef enum
 *  {
 *      SB_CE_NIT_SEARCH_MODE_OFF = 0,
 *      SB_CE_NIT_SEARCH_MODE_QUICK,
 *      SB_CE_NIT_SEARCH_MODE_EX_QUICK,
 *      SB_CE_NIT_SEARCH_MODE_NUM 
 *  } SB_CE_NIT_SEARCH_MODE_T;
 *  @endcode
 *  @li@c  SB_CE_NIT_SEARCH_MODE_OFF                       - NIT search off
 *  @li@c  SB_CE_NIT_SEARCH_MODE_QUICK                     - Quick scan
 *  @li@c  SB_CE_NIT_SEARCH_MODE_EX_QUICK                  - Extra quick scan
 *  @li@c  SB_CE_NIT_SEARCH_MODE_NUM                       - number of scan types
 */
/*------------------------------------------------------------------*/
typedef enum
{
    SB_CE_NIT_SEARCH_MODE_OFF = 0,
    SB_CE_NIT_SEARCH_MODE_QUICK,
    SB_CE_NIT_SEARCH_MODE_EX_QUICK,
    SB_CE_NIT_SEARCH_MODE_NUM 	/* number of nit search types */
} SB_CE_NIT_SEARCH_MODE_T;


#define SB_CE_SCAN_INFO_NW_ID_VALID   		(UINT16)    0x1    /**< bit mask to indicate nw_id valid           */
#define SB_CE_SCAN_INFO_BW_VALID            (UINT16)    0x2    /**< bit mask to indicate bandwidth valid       */
#define SB_CE_SCAN_INFO_MOD_VALID           (UINT16)    0x4    /**< bit mask to indicate modulation valid      */
#define SB_CE_SCAN_INFO_SYM_VALID           (UINT16)    0x8    /**< bit mask to indicate symbol rate valid     */
#define SB_CE_SCAN_INFO_START_FREQ_VALID	(UINT16)    0x10   /**< bit mask to indicate start frequency valid */
#define SB_CE_SCAN_INFO_END_FREQ_VALID      (UINT16)    0x20   /**< bit mask to inidicate end frequency valid  */

#define CE_NW_ID_VALID(mask) 		( mask & SB_CE_SCAN_INFO_NW_ID_VALID)    	 		/**< marco for checking nw_id valid */
#define CE_BW_VALID(mask)  			((mask & SB_CE_SCAN_INFO_BW_VALID)  	   >> 1)    /**< marco for checking BW valid    */
#define CE_MOD_VALID(mask) 			((mask & SB_CE_SCAN_INFO_MOD_VALID) 	   >> 2)    /**< marco for checking modulation valid  */
#define CE_SYM_VALID(mask)     		((mask & SB_CE_SCAN_INFO_SYM_VALID) 	   >> 3)    /**< marco for checking symbol rate valid */
#define CE_START_FREQ_VALID(mask)  	((mask & SB_CE_SCAN_INFO_START_FREQ_VALID) >> 4)    /**< marco for checking start frequency valid */
#define CE_END_FREQ_VALID(mask)    	((mask & SB_CE_SCAN_INFO_END_FREQ_VALID)   >> 5)    /**< marco for checking end frequency valid       */


#define SB_CE_PROGRESS_START              	0    	/**< progress when start scan      */
#define SB_CE_PROGRESS_PRIOR_SCAN_DONE		20    	/**< progress when prior scan done       */
#define SB_CE_PROGRESS_NIT_FOUND(e_nit_search_mode)	(UINT8)((e_nit_search_mode == SB_CE_NIT_SEARCH_MODE_EX_QUICK) ? 80 : 60) /**< progress number when NIT found      */
#define SB_CE_PROGRESS_FINISH            	100    	/**< progress when scan finnished       */


/*------------------------------------------------------------------*/
/*! @struct SB_CE_SCAN_INFO_T
 *  @brief DVB-C scan info
 *  @code
 *  typedef struct _SB_CE_SCAN_INFO_T{
 *      UINT16                  ui2_valid_mask;
 *      UINT16                  ui2_nw_id;
 *      TUNER_BANDWIDTH_T       e_bw;
 *      TUNER_MODULATION_T      e_mod;
 *      UINT32                  ui4_sym_rate;
 *      UINT32                  ui4_start_freq;
 *      UINT32                  ui4_end_freq;
 *  }   SB_CE_SCAN_INFO_T;
 *  @endcode
 *  @li@c  ui2_valid_mask                                    - the bit masks to indicate if the following parameters are valid or not
 *  @li@c  ui2_nw_id                                         - network id
 *  @li@c  e_bw                                              - bandwidth
 *  @li@c  e_mod                                             - modulation
 *  @li@c  ui4_sym_rate                                      - symbol rate
 *  @li@c  ui4_start_freq                                    - start frequency 
 *  @li@c  ui4_end_freq                                      - end frequency
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_SCAN_INFO_T{
    UINT16                  ui2_valid_mask;
    UINT16                  ui2_nw_id;
    TUNER_BANDWIDTH_T       e_bw;
    TUNER_MODULATION_T      e_mod;
    UINT32                  ui4_sym_rate;
    UINT32                  ui4_start_freq;
    UINT32                  ui4_end_freq;
} SB_CE_SCAN_INFO_T;


/* The structure SB_CE_DLVR_INFO_T is the basic information about
    front end transmission. */
/*------------------------------------------------------------------*/
/*! @struct SB_CE_DLVR_INFO_T
 *  @brief The structure SB_CE_DLVR_INFO_T is the basic information about
 *   front end transmission
 *  @code
 *  typedef struct _SB_CE_DLVR_INFO_T{
 *      UINT32                  ui4_freq;
 *      TUNER_MODULATION_T      e_mod;
 *      UINT32                  ui4_sym_rate;
 *  }SB_CE_DLVR_INFO_T;
 *  @endcode
 *  @li@c  ui4_freq                                          - frequency
 *  @li@c  e_mod                                             - modulation
 *  @li@c  ui4_sym_rate                                      - symbol rate
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_DLVR_INFO_T{
    UINT32                  ui4_freq;
    TUNER_MODULATION_T      e_mod;
    UINT32                  ui4_sym_rate;
} SB_CE_DLVR_INFO_T;


/* The structure SB_CE_DLVR_INFO_T is the basic information about
    front end transmission. */
/*------------------------------------------------------------------*/
/*! @struct SB_CE_TUNER_PARA_T
 *  @brief The structure SB_CE_TUNER_PARA_T is the basic information about
 *   front end transmission
 *  @code
 *  typedef struct _SB_CE_TUNER_PARA_T{
 *      SB_CE_DLVR_INFO_T    	t_dlvr_info;
 *      BOOL                  	b_auto_qam_enable;
 *      BOOL                   	b_auto_sr_enable;
 *  }SB_CE_TUNER_PARA_T;
 *  @endcode
 *  @li@c
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_TUNER_PARA_T{
    SB_CE_DLVR_INFO_T		t_dlvr_info;
    BOOL                	b_auto_qam_enable;
    BOOL                	b_auto_sr_enable;
} SB_CE_TUNER_PARA_T;


/* The structure SB_CE_SVC_UPDATE_NFY_DATA is used as the argument 
   of the service update notification function. */
/*------------------------------------------------------------------*/
/*! @struct SB_CE_SVC_UPDATE_NFY_DATA
 *  @brief The structure SB_CE_SVC_UPDATE_NFY_DATA is used as the argument 
 *  of the service update notification function.
 *  @code
 *  typedef struct _SB_CE_SVC_UPDATE_NFY_DATA
 *  {
 *      UINT16                  ui2_num_added_svc;
 *      UINT16                  ui2_num_deleted_svc;
 *  } SB_CE_SVC_UPDATE_NFY_DATA;
 *  @endcode
 *  @li@c  ui2_num_added_svc                                 - the number of added services
 *  @li@c  ui2_num_deleted_svc                               - the number of deleted services
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_SVC_UPDATE_NFY_DATA
{
    UINT16                  ui2_num_added_svc;
    UINT16                  ui2_num_deleted_svc;
} SB_CE_SVC_UPDATE_NFY_DATA;


/* The structure SB_CE_NW_CHANGE_NFY_DATA is used as the argument 
   of the network change notification function. */
/*------------------------------------------------------------------*/
/*! @struct SB_CE_NW_CHANGE_NFY_DATA
 *  @brief The structure SB_CE_NW_CHANGE_NFY_DATA is used as the argument 
 *  of the network change notification function.
 *  @code
 *  typedef struct _SB_CE_NW_CHANGE_NFY_DATA
 *  {
 *      SB_CE_NIT_SEARCH_MODE_T   e_nit_search_mode;
 *  } SB_CE_NW_CHANGE_NFY_DATA;
 *  @endcode
 *  @li@c  e_nit_search_mode                                 - NIT search mode: ex-quick, quick or off
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_NW_CHANGE_NFY_DATA
{
    SB_CE_NIT_SEARCH_MODE_T   e_nit_search_mode;
} SB_CE_NW_CHANGE_NFY_DATA;


/* The prototype of the service update notification function */
/*------------------------------------------------------------------*/
/*! @brief The prototype of the service update notification function
 *  @param [in] pt_nfy_data     - pointer to a structure which contains information of service update.
 *  @param [in] pv_nfy_tag      - a tag which was provided at the setup time.
 *  @param [out]
 *  @note
 *  @see
 *  @return VOID
 *  @retval      -
 */
/*------------------------------------------------------------------*/
typedef VOID (*x_sb_ce_svc_update_nfy_fct) (
        SB_CE_SVC_UPDATE_NFY_DATA* 	pt_nfy_data,
        VOID*                       pv_nfy_tag);


/* The prototype of the network modification notification function */
/*------------------------------------------------------------------*/
/*! @brief The prototype of the network modification notification function
 *  @param [in] pt_nfy_data     - pointer to a structure which contains information of network update
 *  @param [in] pv_nfy_tag       - a tag which was provide at the setup time
 *  @param [out]
 *  @note
 *  @see
 *  @return VOID
 *  @retval      -
 */
/*------------------------------------------------------------------*/
typedef VOID (*x_sb_ce_nw_change_nfy_fct) (VOID*	pv_nfy_tag);


typedef struct _SB_CE_MAIN_FREQ_T
{
    UINT32  	ui4_freq;
    UINT8  		ui1_nit_ver;
    UINT16  	ui2_ts_count;
} SB_CE_MAIN_FREQ_T;


typedef VOID (*x_sb_ce_main_freq_nfy_fct)	(SB_CE_MAIN_FREQ_T*		pt_main_freq,
											 VOID*          		pv_nfy_tag);


/*
 *  The structure SB_CE_SCAN_DATA_T is used as the argument 
 *  pv_scan_data of the API x_sb_start_scan() when scaning 
 *  a media.
 *
 *  pt_country_code                 Contains an ISO 3166 3-character country code.
 *
 *  e_scan_type                     Specifies the way to scan.
 *
 *  t_scan_info                     Contains the required scan information. 
 *
 *  t_eng_cfg_flag                  Contains the engine configuration flag. The option allowed is 
 *                                  SB_CE_CONFIG_UPDATE_TO_TEMP_SVL.
 *
 *  ui2_temp_svl_id                 Contains the id of the temporary SVL to be updated. This
 *                                  argument is used only when the SB_CE_CONFIG_UPDATE_TO_TEMP_SVL
 *                                  is set. This list must exist and be an empty one.
 *
 *  pf_svc_update_nfy               Contains the service update notification function.
 *
 *  pv_svc_update_nfy_tag           Contains the tag for the service update notification function.
 *
 */
/*------------------------------------------------------------------*/
/*! @struct SB_CE_SCAN_DATA_T
 *  @brief The structure SB_CE_SCAN_DATA_T is used as the argument 
 *  pv_scan_data of the API x_sb_start_scan() when scaning 
 *  a media.
 *  @code
 *  typedef struct _SB_CE_SCAN_DATA_T
 *  {
 *      ISO_3166_COUNT_T        		t_country_code;
 *      CE_OPERATOR_NAME_T         		t_operator_name;
 *      SB_CE_SCAN_TYPE_T      			e_scan_type;
 *      SB_CE_NIT_SEARCH_MODE_T   	e_nit_search_mode;
 *      SB_CE_SCAN_INFO_T      		t_scan_info;
 *      SB_CE_CONFIG_T         			t_eng_cfg_flag;
 *      UINT16                  		ui2_temp_svl_id;
 *      x_sb_ce_svc_update_nfy_fct 	pf_svc_update_nfy;
 *      VOID*                   		pv_svc_update_nfy_tag;
 *  } SB_CE_SCAN_DATA_T;
 *  @endcode
 *  @li@c  t_country_code                                    - Contains an ISO 3166 3-character country code.
 *  @li@c  t_operator_name                                   - Contains an Operation name 
 *  @li@c  e_scan_type                                       - Specifies the way to scan.
 *  @li@c  e_nit_search_mode                                 - Specifies the mode of NIT search
 *  @li@c  t_scan_info                                       - Contains the required scan information. 
 *  @li@c  t_eng_cfg_flag                                    - Contains the engine configuration flag.
 *  @li@c  ui2_temp_svl_id                                   - Contains the id of the temporary SVL to be updated. This
 *                                  argument is used only when the SB_CE_CONFIG_UPDATE_TO_TEMP_SVL
 *                                  is set. This list must exist and be an empty one.
 *  @li@c  pf_svc_update_nfy                                 - Contains the service update notification function.
 *  @li@c  pv_svc_update_nfy_tag                             - Contains the tag for the service update notification function.
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_SCAN_DATA_T
{
    ISO_3166_COUNT_T        		t_country_code;
    CE_OPERATOR_NAME_T         		t_operator_name;
    SB_CE_SCAN_TYPE_T      			e_scan_type;
    SB_CE_NIT_SEARCH_MODE_T   		e_nit_search_mode;
    SB_CE_SCAN_INFO_T      			t_scan_info;
    SB_CE_CONFIG_T         			t_eng_cfg_flag;
    UINT16                  		ui2_temp_svl_id;
    x_sb_ce_svc_update_nfy_fct 		pf_svc_update_nfy;
    VOID*                   		pv_svc_update_nfy_tag;
} SB_CE_SCAN_DATA_T;


/*------------------------------------------------------------------*/
/*! @struct SB_CE_TSL_REC_ID_FREQ_RANGE_T
 *  @brief the frequency range of certain TSL record ID
 *  @code
 *  typedef struct _SB_CE_TSL_REC_ID_FREQ_RANGE
 *  {
 *      UINT32                  ui4_freq_range_lbound;
 *      UINT32                  ui4_freq_range_ubound;
 *  } SB_CE_TSL_REC_ID_FREQ_RANGE_T;
 *  @endcode
 *  @li@c  ui4_freq_range_lbound                             - the lower bound of the range
 *  @li@c  ui4_freq_range_ubound                             - the upper bound of the range
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_TSL_REC_ID_FREQ_RANGE
{
    UINT32                  ui4_freq_range_lbound;
    UINT32                  ui4_freq_range_ubound;
} SB_CE_TSL_REC_ID_FREQ_RANGE_T;


/*------------------------------------------------------------------*/
/*! @struct SB_CE_ON_TS_SVC_ID_T
 *  @brief the triplet of DVB IDS, on_id, ts_id and service_id
 *  @code
 *  typedef struct _SB_CE_ON_TS_SVC_ID
 *  {
 *      UINT16                  ui2_on_id;
 *      UINT16                  ui2_ts_id;
 *      UINT16                  ui2_svc_id;
 *  } SB_CE_ON_TS_SVC_ID_T;
 *  @endcode
 *  @li@c  ui2_on_id                                         - original network ID
 *  @li@c  ui2_ts_id                                         - Transport stream ID
 *  @li@c  ui2_svc_id                                        - Service ID
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_ON_TS_SVC_ID
{
    UINT16                  ui2_on_id;
    UINT16                  ui2_ts_id;
    UINT16                  ui2_svc_id;
} SB_CE_ON_TS_SVC_ID_T;


/*------------------------------------------------------------------*/
/*! @struct SB_CE_NW_CHANGE_NFY_T
 *  @brief SB_CE_NW_CHANGE_NFY_T is used to setup a notification function with c_sb_set and keytype is SB_KEY_TYPE_NW_CHANGE_NFY
 *  @code
 *  typedef struct _SB_CE_NW_CHANGE_NFY_T {
 *      x_sb_ce_nw_change_nfy_fct  pf_nw_change_nfy;
 *      VOID*                   pv_nw_change_nfy_tag;
 *  } SB_CE_NW_CHANGE_NFY_T;
 *  @endcode
 *  @li@c  pf_nw_change_nfy                                  - the function pointer of network change notifcation
 *  @li@c  pv_nw_change_nfy_tag                              - the tag would be used when invoke the notification function.
 */
/*------------------------------------------------------------------*/
typedef struct _SB_CE_NW_CHANGE_NFY_T {
    x_sb_ce_nw_change_nfy_fct  	pf_nw_change_nfy;
    VOID*                   	pv_nw_change_nfy_tag;
} SB_CE_NW_CHANGE_NFY_T;


typedef struct _SB_CE_MAIN_FREQ_NFY_T {
    x_sb_ce_main_freq_nfy_fct  	pf_main_freq_nfy;
    VOID*                   	pv_main_freq_nfy_tag;
} SB_CE_MAIN_FREQ_NFY_T;


#define MAX_NUM_BAT_BQ			6
#define MAX_NUM_LOAD_BAT_FREQ  	2
typedef struct _SORT_T 
{
	CE_OPERATOR_NAME_T	t_operator_name;
    UINT32				aui4_load_bat_freq[MAX_NUM_LOAD_BAT_FREQ];
    UINT16				aui2_bq_id[MAX_NUM_BAT_BQ];
    BOOL				b_accept_svl_in_bat;	//TRUE: accept the svc in bat; FALSE: delete the svc in bat
} SORT_T;


#endif 


