blob: 6653e8c9085105978814f5d105cc0ef8b0e6880a [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) 2016
*
* 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).
*
*****************************************************************************/
/*************************************************************
*
* This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc.
*
* Any unauthorized use inconsistent with the terms of such license is strictly prohibited.
*
* Copyright (c) 1999-2010 VIA Telecom, Inc. All rights reserved.
*
*************************************************************/
/****************************************************************************
*
* Filename: identity.h
*
* Purpose: Define externally available (global) mobile station identity
* elements.
*
****************************************************************************
*
* PVCS Header Information
*
* $Revision: 1.5 $
* $Author: hans $
*
* $Log: identity.h $
*
* 07 06 2017 sue.zhong
* [MOLY00259241] [6293][C2K]Replace with KAL data type
* Correct copyright file header
*
* 05 17 2017 peijun.zheng
* [MOLY00249027] [BIACNO][MT6763][New feature]C2K code release code modification
*
* C2k code release.
* Revision 1.5 2005/10/06 17:34:53 hans
* Merged the appropriate changes from the CBP4.05 CP SW baseline to address CR6049,CR7031,CR7032,CR7033,CR7034
* Revision 1.4 2005/03/18 10:24:52 bcolford
* CBP4.05 [4.21] to CBP6.1 [2.9.0] CP Software Merge.
* Revision 1.2 2004/08/13 10:03:29 agontar
* Removed T53 flag; added support for BC3; cleaned up logs
* Revision 1.3 2004/04/06 14:02:10 dstecker
* CBP6.1 release 1
* Revision 1.2 2004/03/25 12:09:34 fpeng
* Updated from 6.0 CP 2.5.0
* Revision 1.2 2003/08/28 11:18:15 bcolford
* Update for merge.
* Revision 1.11 2003/05/21 17:11:22 byang
* CR#570: Replace compiler flag with IS2000A with IS2000_REV_0.
* Revision 1.10 2002/12/04 14:43:55 hans
* CR1648: OP mode setting i retrieved direct from ms cap db.
* Revision 1.9 2002/09/30 15:15:26 mshaver
* Changes to support the single NAM data structure type
* definition PswIs95NamT, of type packed.
* Revision 1.8 2002/06/06 13:12:53 chinh
* Changed and Added Copyright
* Revision 1.7 2002/01/17 17:18:36 akayvan
* Implemented Slotted Mode mods.
* Revision 1.6 2001/11/20 12:26:30 mclee
* include pswnam.h
* Revision 1.5 2001/11/13 15:37:30 byang
* Add function prototype declaration for cpValidatePRev().
* Revision 1.4 2001/07/27 16:33:09 mclee
* Nam Consolidation fix port from 3.0 to 4.0
* Revision 1.3 2001/07/26 14:35:11 bcolford
* Add reference for Nam which is used throughout the AMPS
* PE software
* Revision 1.1 2001/01/17 10:58:50 plabarbe
* Initial revision
* Revision 1.4 2000/12/22 11:45:44 byang
* Consolidate IS2000 global variables into the global structure
* IS2000_NETWORK_PARAMETERS.
* Revision 1.3 2000/12/05 17:45:11 byang
* Idle mode - IS2000A Addendum modifications.
* Revision 1.2 2000/11/13 14:25:59 byang
* IS-2000A Idle Mode and LAC intergration - Initial Release.
* Revision 1.1 2000/10/24 21:11:17Z fpeng
* Initial revision
* Revision 1.3 2000/08/23 22:09:05Z RSATTARI
* Isotel release 2.8 plus LSI applicable IS-95B changes.
* Revision 1.14 2000/01/17 22:27:19 scotvold
* TC Backward Compatibility changes.
*
* Revision 1.13 1999/05/19 16:28:08 mhayduk
* Added support for setting and retrieving value for T53 MSD
* P_REV 3+ setting.
*
* Revision 1.12 1999/04/12 13:31:46 scotvold
* Added T53 HSPD support.
* Added 95B SCAM support.
* Added 95B GHDM support and consolidated with EHDM.
*
* Revision 1.11 1999/02/20 00:39:52 scotvold
* Added message encryption support.
*
* Revision 1.10 1999/02/08 22:53:10 scotvold
* Lint fixes.
*
* Revision 1.9 1999/01/09 00:33:45 scotvold
* Added SSDUpdateInProgress flag interface.
*
* Revision 1.8 1998/11/20 16:21:21 mhayduk
* Moved opmode definitions into header file.
*
* Revision 1.7 1998/11/02 22:06:40 scotvold
* Compile switch for OP_MODEs and P_REV_IN_USEs.
*
* Revision 1.6 1998/10/20 23:58:23 mhayduk
* Added T53 support.
*
* Revision 1.5 1998/07/31 16:08:50 scotvold
* Wrapped Call History Parameter.
*
* Revision 1.4 1998/06/08 21:48:25 scotvold
* Updated for Release 0.06.
*
* Revision 1.3 1998/03/30 23:26:03 mhayduk
* Release 0.03.
*
* Revision 1.1 1997/11/06 17:49:24 mhayduk
* Initial revision
*
*
****************************************************************************
****************************************************************************/
#ifndef _IDENTITY_H_
#define _IDENTITY_H_ 1
/*****************************************************************************
* Includes
****************************************************************************/
#include "pch_msg.h"
#include "channel.h"
#include "systime.h"
#include "pswapi.h"
/**********************************************************************
* Defines
**********************************************************************/
#define CP_HASH_CDMA_CH 0
#define CP_HASH_PAGE_CH 1
#define CP_HASH_PAGE_SLOT 2
#define CP_HASH_ACCESS_CH_PN 3
#define CP_HASH_BCCH 4
#define CP_HASH_FCCCH 5
#define CP_HASH_QPCH 6
#define CP_HASH_PI_R1 7
#define CP_HASH_PI_R2 8
/* Define table for mapping op modes by index - Table 7.7.2.3.2.15-3 */
#define CP_OP_MODE_CDMA_PCS 0
#define CP_OP_MODE_CDMA_CELLULAR 1
#define CP_OP_MODE_ANALOG 2
/* type of IMSI_O */
typedef enum
{
IMSI_O_TYPE_M = 0,
IMSI_O_TYPE_T = 1
} IMSI_O_TYPE;
#define MEID_SIZE 7
typedef struct
{
kal_uint16 type;
kal_uint8 meid[MEID_SIZE + 1];
kal_uint32 esn;
} MsidInUseT;
extern PswFTDParaT FTDPara;
static const kal_uint16 CP_INVALID_PN = 0xFFFF;
/**********************************************************************
* Global declarations associated with Mobile's identity and shared
* amongst files.
**********************************************************************/
/* NAM */
/* Consolidate PE and PSW NAM */
extern PswIs95NamT Nam; /* NAM data */
extern SecureDataStructT Sdata; /* Secure data */
extern MsidInUseT _msidInUse; /* MEID/Pseudo ESN or ESN used by CP */
/* IMSI */
extern IMSIType IMSI_O; /* operational IMSI */
extern kal_uint16 MCCs;
extern kal_uint8 IMSI_11_12s;
extern IMSI_O_TYPE IMSI_O_Type;
#ifdef MTK_DEV_C2K_IRAT
extern kal_uint16 MCC_1xOTA;
#endif /* MTK_DEV_C2K_IRAT */
/* System Parameters for control channels (globally viewed) */
extern SysBandChannelT CDMA_CHs; /* contains CDMABANDs and CDMACHs */
extern kal_uint16 PILOT_PNs;
extern kal_uint8 interCorrSrchCountThresh;
extern kal_uint8 interCorrectionCorrection;
extern kal_uint8 achSleepSearchCount;
/* Begin: added systerm identity parameters from IS-2000A */
typedef struct
{
/* Forward Common Control Channel Parameters */
kal_uint8 FCCCHs;
FccchRate FCCCH_RATEs;
kal_uint8 FCCCH_CODE_RATEs;
kal_uint8 FCCCH_CODE_CHANs;
kal_uint8 FCCCH_IDs;
kal_uint8 NUM_FCCCHs;
kal_uint8 FCCCH_CODE_CHAN[ CP_MAX_FCCCH_CODE_CHAN ];
/* SR1 Parameters */
kal_uint8 BCNs;
BcchRate BRATs;
kal_uint8 BCCH_CODE_RATEs;
kal_uint8 BCCHs;
kal_bool SR1_BCCH_SUPPORTEDs;
Sr1TdModes SR1_TD_MODEs;
Sr1TdPowerLevel SR1_TD_POWER_LEVELs;
BcchRate SR1_BRAT_TDs;
kal_uint8 SR1_CRAT_TDs;
BcchRate SR1_BRAT_NON_TDs;
kal_uint8 SR1_CRAT_NON_TDs;
kal_uint8 BCCH_CODE_CHAN_TDs;
kal_uint8 BCCH_CODE_CHAN_NON_TDs;
/* SR3 Parameters */
kal_bool SR3_INCLs;
kal_uint8 SR3_PRIMARY_PILOTs;
kal_uint8 SR3_PILOT_POWER1s;
kal_uint8 SR3_PILOT_POWER2s;
/* BCast Parameters */
kal_uint8 NUM_BCCH_BCASTs;
BcchBcast BCCH_BCAST[ MAX_NUM_BCCH_BCAST ];
/* Quick Paging Channel Parameters */
kal_bool QPCH_SUPPORTEDs;
kal_uint8 NUM_QPCHs;
kal_uint8 QPAGECHs;
kal_uint8 ASSIGNED_QPAGECHs;
QpchRate QPCH_RATEs;
QpchTransPwr QPCH_POWER_LEVEL_PAGEs;
kal_bool QPCH_CCI_SUPPORTEDs;
QpchTransPwr QPCH_POWER_LEVEL_CONFIGs;
kal_bool QPCH_BI_SUPPORTEDs;
QpchTransPwr QPCH_POWER_LEVEL_BCASTs;
/* Network Feature Parameters */
kal_bool CS_SUPPORTEDs;
kal_bool SDB_SUPPORTEDs;
} IS2000NetworkParameters;
extern IS2000NetworkParameters IS2000_NETWORK_PARAMETERS;
/* End: added systerm identity parameters from IS-2000A */
extern kal_uint8 P_REVs;
extern kal_uint8 MIN_P_REVs;
extern kal_uint8 P_REV_IN_USEs;
/* this group may only be local to eng_init.c */
extern kal_uint8 SERVSYSs;
/* Scratch Buffer */
extern kal_uint8 scratch_[];
/* Rx Msg Static Union */
extern RxMsg rxMsg_;
/**********************************************************************
* Prototypes of utilities used in setting/retrieving identity information.
**********************************************************************/
void initializeIdentity( void );
kal_bool retrieveRedirectionChannel( SysBandChannelT *channel);
kal_bool cpIsOpModeSupported(kal_uint8 opMode);
kal_uint32 divideIntegers(kal_uint32 div,kal_uint32 base,kal_uint32 upper,kal_uint32 *rem);
kal_uint16 hash(kal_uint16 range,kal_uint8 application);
void randomNumberSetSeed(kal_uint32 time);
kal_uint32 randomInteger(kal_uint32 range);
kal_uint16 TenBitsToDigital(kal_uint16 n);
kal_bool cpAccessPsistDelay(kal_uint8 psist, kal_uint8 psist_emg,kal_uint8 accolc,kal_bool secondTerm,
kal_uint8 typePsist,kal_bool *fail);
void cpInitializeCallHistoryParm (kal_uint8 count);
kal_uint8 cpGetCallHistoryParm (void);
void cpIncrementCallHistoryParm (void);
void setSSDUpdateInProgress (kal_bool ssdUpdateState);
kal_bool ssdUpdateInProgress (void);
kal_bool iAm95 (void);
kal_bool iAm95A (void);
kal_bool iAmTSB74 (void);
kal_bool iAmJSTD008 (void);
kal_bool iAmT53Stream (void);
kal_bool iAmT53Plus (void);
kal_bool cpValidatePRev( const kal_uint8 pRev );
#endif /* _IDENTITY_H_ */
/**Log information: \main\CBP80\cbp80_cshen_scbp10098\1 2012-07-26 06:27:57 GMT cshen
** cbp80_cshen_scbp10098**/