view src/aci2/aci/cmh_sim.h @ 600:8f50b202e81f

board preprocessor conditionals: prep for more FC hw in the future This change eliminates the CONFIG_TARGET_FCDEV3B preprocessor symbol and all preprocessor conditionals throughout the code base that tested for it, replacing them with CONFIG_TARGET_FCFAM or CONFIG_TARGET_FCMODEM. These new symbols are specified as follows: CONFIG_TARGET_FCFAM is intended to cover all hardware designs created by Mother Mychaela under the FreeCalypso trademark. This family will include modem products (repackagings of the FCDEV3B, possibly with RFFE or even RF transceiver changes), and also my desired FreeCalypso handset product. CONFIG_TARGET_FCMODEM is intended to cover all FreeCalypso modem products (which will be firmware-compatible with the FCDEV3B if they use TI Rita transceiver, or will require a different fw build if we switch to one of Silabs Aero transceivers), but not the handset product. Right now this CONFIG_TARGET_FCMODEM preprocessor symbol is used to conditionalize everything dealing with MCSI. At the present moment the future of FC hardware evolution is still unknown: it is not known whether we will ever have any beyond-FCDEV3B hardware at all (contingent on uncertain funding), and if we do produce further FC hardware designs, it is not known whether they will retain the same FIC modem core (triband), if we are going to have a quadband design that still retains the classic Rita transceiver, or if we are going to switch to Silabs Aero II or some other transceiver. If we produce a quadband modem that still uses Rita, it will run exactly the same fw as the FCDEV3B thanks to the way we define TSPACT signals for the RF_FAM=12 && CONFIG_TARGET_FCFAM combination, and the current fcdev3b build target will be renamed to fcmodem. OTOH, if that putative quadband modem will be Aero-based, then it will require a different fw build target, the fcdev3b target will stay as it is, and the two targets will both define CONFIG_TARGET_FCFAM and CONFIG_TARGET_FCMODEM, but will have different RF_FAM numbers. But no matter which way we are going to evolve, it is not right to have conditionals on CONFIG_TARGET_FCDEV3B in places like ACI, and the present change clears the way for future evolution.
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 01 Apr 2019 01:05:24 +0000
parents 93999a60b835
children
line wrap: on
line source

/* 
+----------------------------------------------------------------------------- 
|  Project :  GSM-PS (6147)
|  Modul   :  CMH
+----------------------------------------------------------------------------- 
|  Copyright 2002 Texas Instruments Berlin, AG 
|                 All rights reserved. 
| 
|                 This file is confidential and a trade secret of Texas 
|                 Instruments Berlin, AG 
|                 The receipt of or possession of this file does not convey 
|                 any rights to reproduce or disclose its contents or to 
|                 manufacture, use, or sell anything it may describe, in 
|                 whole, or in part, without the specific written consent of 
|                 Texas Instruments Berlin, AG. 
+----------------------------------------------------------------------------- 
|  Purpose :  Definitions for the command handler of the 
|             Subscriber Identity Module ( SIM )
+----------------------------------------------------------------------------- 
*/ 

#ifndef CMH_SIM_H
#define CMH_SIM_H

/*==== CONSTANTS ==================================================*/
 
#define ACI_SIZE_EF_CCP          14
#define ACI_MIN_SIZE_EF_MSISDN   14
#define ACI_MIN_SIZE_EF_PLMN_SEL 24
#define ACI_LEN_PLMN_SEL_NTRY     3   /* length of an entry in bytes */
#define ACI_LEN_PLMN_SEL_FLD     MAX_PREF_PLMN /* Moved to SAP SIM to be consistent with MM */

 
#define ACI_LEN_LAN_NTRY          2   /* length of an entry in bytes */
#define ACI_MAX_LAN_NTRY          10   /* number of supported entries */
#define ACI_MIN_SIZE_EF_LAN       16
#define ACI_LEN_LAN_FLD (ACI_LEN_LAN_NTRY*ACI_MAX_LAN_NTRY)


#define ACI_LEN_LAN_LP_NTRY       1   /* length of an entry in bytes */
#define ACI_MAX_LAN_LP_NTRY       5   /* number of supported entries */
#define ACI_LEN_LAN_LP_FLD (ACI_LEN_LAN_LP_NTRY*ACI_MAX_LAN_LP_NTRY)

#define SIM_ALS_LOCK    (SIM_FDN_DISABLE+1) /* To distinguish between the different operations */
#define SIM_ALS_UNLOCK  (SIM_FDN_DISABLE+2) /* which require a CHV2 authentication */


typedef enum 
{
  EF_STAT_UNKNWN = 0,       /* status of EF unknown */
  EF_STAT_READ,             /* EF already read */
  EF_STAT_NOT_AVAIL         /* EF is not available */ 
} EF_STAT;

typedef enum
{
  CPOL_ACT_None = 0,        /* no action */
  CPOL_ACT_Write,           /* write entry */
  CPOL_ACT_Delete,          /* delete entry */
  CPOL_ACT_Read,            /* read entry */
  CPOL_ACT_Test             /* test number of entries */
} ACI_CPOL_ACT;
 
typedef enum
{
  CLAN_ACT_None = 0,        /* no action */
  CLAN_ACT_Write,           /* write entry */
  CLAN_ACT_Read             /* read entry */
} ACI_CLAN_ACT;

/*==== TYPES ======================================================*/

/*==== PROTOTYPES =================================================*/

EXTERN void            cmhSIM_SIMActivated       ( void );
EXTERN void            cmhSIM_PINVerified        ( void );
EXTERN void            cmhSIM_SIMSync            ( void );
EXTERN void            cmhSIM_SIMInserted        ( void );
EXTERN void            cmhSIM_SIMRemoved         ( void );
EXTERN void            cmhSIM_PINChanged         ( void );
EXTERN void            cmhSIM_PINEnabled         ( void );
EXTERN void            cmhSIM_PINDisabled        ( void );
EXTERN void            cmhSIM_CardUnblocked      ( void );
#ifdef FF_DUAL_SIM
EXTERN void            cmhSIM_SIMSelected        ( void );
#endif /*FF_DUAL_SIM*/
EXTERN void            cmhSIM_FillInPIN          ( CHAR*     PINStr,
                                                   CHAR*     PINFld, 
                                                   UBYTE     len      );
EXTERN void            cmhSIM_GetHomePLMN        ( SHORT*    mccBuf,
                                                   SHORT*    mncBuf   );
GLOBAL BOOL            cmhSIM_plmn_equal_sim     ( SHORT     bcch_mcc,
                                                   SHORT     bcch_mnc, 
                                                   SHORT     sim_mcc, 
                                                   SHORT     sim_mnc);
EXTERN BOOL            cmhSIM_plmn_is_hplmn      ( SHORT     bcch_mcc, 
                                                   SHORT     bcch_mnc);
EXTERN T_ACI_RETURN    cmhSIM_ReqMsisdn          ( T_ACI_CMD_SRC srcId,
                                                   UBYTE     record   );
EXTERN void            cmhSIM_CnfMsisdn          ( SHORT     table_id );
EXTERN T_ACI_RETURN    cmhSIM_ReqCcp             ( T_ACI_CMD_SRC srcId,
                                                   UBYTE     record   );
EXTERN void            cmhSIM_CnfCcp             ( SHORT     table_id );
EXTERN T_ACI_RETURN    cmhSIM_ReqPlmnSel         ( T_ACI_CMD_SRC srcId);
EXTERN void            cmhSIM_RdCnfPlmnSel       ( SHORT     table_id );
EXTERN void            cmhSIM_WrCnfPlmnSel       ( SHORT     table_id );
EXTERN T_ACI_CME_ERR   cmhSIM_GetCmeFromSim      ( USHORT    errCode  );
EXTERN SHORT           cmhSIM_FillPlmnSelList    ( UBYTE              index, 
                                                   T_ACI_CPOL_FRMT    frmt,
                                                   T_ACI_CPOL_OPDESC* operLst,
                                                   UBYTE              length,
                                                   UBYTE*             pData );

EXTERN T_ACI_RETURN     getSupLangFromPCM       ( T_ACI_LAN_SUP *lanlst, 
                                                  SHORT         *lastIdx  );

EXTERN BOOL           checkSuppLang             (T_ACI_LAN_SUP  *lanlst,
                                                  SHORT          lastIdx, 
                                                  T_ACI_LAN_SUP  *clng);

EXTERN BOOL           checkSuppLangInLP         ( T_ACI_LAN_SUP  *lanlst,
                                                  SHORT          lastIdx, 
                                                  T_ACI_LAN_SUP  *clng);
                                                   
EXTERN SHORT           cmhSIM_UsdPlmnSelNtry     ( UBYTE              length,
                                                   UBYTE*             pData  );
EXTERN void            cmhSIM_CmpctPlmnSel       ( UBYTE              length,
                                                   UBYTE*             pData );
EXTERN T_ACI_BS_SPEED  cmhSIM_GetUserRate        ( UBYTE  userRate );
EXTERN T_ACI_CNUM_ITC  cmhSIM_GetItc             ( UBYTE  itc      );
EXTERN T_ACI_CNUM_SERV cmhSIM_GetSrvFromSync     ( UBYTE  sync     );
EXTERN T_ACI_CNUM_SERV cmhSIM_GetSrvFromItc      ( UBYTE  itc      );
EXTERN void            cmhSIM_getMncMccFrmPLMNsel( const UBYTE* ntry, 
                                                         SHORT* mcc, 
                                                         SHORT* mnc );
EXTERN BOOL            cmhSIM_GetCodedPLMN       ( const CHAR *oper, 
                                                   T_ACI_CPOL_FRMT format, 
                                                   UBYTE *sim_plmn );
EXTERN T_ACI_RETURN    cmhSIM_WritePlmnSel       ( T_ACI_CMD_SRC srcId );
EXTERN T_ACI_RETURN    cmhSIM_DelPlmnSel         ( T_ACI_CMD_SRC srcId,
                                                   SHORT index,
                                                   T_ACI_CPOL_MOD mode );
EXTERN T_ACI_RETURN    cmhSIM_FndEmptyPlmnSel    ( T_ACI_CMD_SRC srcId,
                                                   UBYTE *plmn );
EXTERN T_ACI_RETURN    cmhSIM_UpdPlmnSel         ( T_ACI_CMD_SRC srcId,
                                                   SHORT index,
                                                   UBYTE *plmn,
                                                   T_ACI_CPOL_MOD mode );
EXTERN T_ACI_RETURN    cmhSIM_ChgPlmnSel         ( T_ACI_CMD_SRC srcId,
                                                   SHORT index,
                                                   SHORT index2 );
EXTERN void            cmhSIM_SIMResponseData    ( T_SIM_TRNS_RSP_PRM* rsp );

EXTERN T_ACI_RETURN    cmhSIM_ReqLanguage         ( T_ACI_CMD_SRC srcId);

EXTERN void            cmhSIM_RdCnfLangELP        ( SHORT     table_id );

EXTERN BOOL            cmhSIM_ReqLanguagePrf       (void);

EXTERN void            cmhSIM_RdCnfLangPrfELP      (SHORT     table_id);


EXTERN T_ACI_RETURN    cmhSIM_ReqLanguageLP         ( T_ACI_CMD_SRC srcId);
EXTERN void            cmhSIM_RdCnfLangLP           ( SHORT     table_id );

EXTERN BOOL            cmhSIM_ReqLanguagePrfLP      (void);
EXTERN void            cmhSIM_RdCnfLangPrfLP        (SHORT     table_id);

EXTERN BOOL            cmhSIM_AD_Update             ( int, T_SIM_FILE_UPDATE_IND *);
EXTERN BOOL            cmhSIM_CSP_Update             ( int, T_SIM_FILE_UPDATE_IND *);
EXTERN BOOL            cmhSIM_ONS_Update             ( int, T_SIM_FILE_UPDATE_IND *);
EXTERN void cmhSIM_Read_AD_cb(SHORT table_id);
EXTERN void cmhSIM_Read_AD_cb(SHORT table_id);
EXTERN T_opl_field* cmhSIM_GetOPL();
EXTERN void cmhSIM_GetSrvTab( UBYTE*  ptrSrvTab );
EXTERN void cmhSIM_Get_CSP_cb(SHORT table_id);
EXTERN void cmhSIM_Read_CSP_cb(SHORT table_id);
#ifdef SIM_PERS_OTA
EXTERN BOOL         cmhSIM_Register_Read_DCK     ( int, T_SIM_FILE_UPDATE_IND *);
EXTERN void cmhSIM_Read_DCK_cb(SHORT table_id);
EXTERN void cmhSIM_Read_DCK_init_cb(SHORT table_id);
#endif

/* EONS */
EXTERN BOOL cmhSIM_OpReadOplRcd( UBYTE rcd);
EXTERN void cmhSIM_OpReadOplRcdCb(SHORT table_id);
EXTERN BOOL cmhSIM_OpReadPnnRcd( UBYTE rcd);
EXTERN void cmhSIM_OpReadPnnRcdCb(SHORT table_id);
EXTERN BOOL cmhSIM_OpUpdate(int ref, T_SIM_FILE_UPDATE_IND*  fu);
EXTERN void cmhSIM_InitOperatorName();
EXTERN BOOL cmhSIM_StartOperatorName();
EXTERN BOOL cmhSIM_UpdateOperatorName(USHORT reqDataFld);

#ifdef DTI
EXTERN BOOL SIM_ENT_CSDconnect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
#endif
#if defined (GPRS) AND defined (DTI)
EXTERN BOOL SIM_SNDCP_connect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
EXTERN BOOL SIM_ENT_GPRSconnect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
#endif

/*==== EXPORT =====================================================*/

#ifdef CMH_SIMF_C

GLOBAL T_ENT_STAT     simEntStat;

GLOBAL T_ACI_CFUN_FUN CFUNfun         = CFUN_FUN_Minimum;

GLOBAL UBYTE          CNUMMaxRec      = 0;
GLOBAL T_ACI_CNUM_LST CNUMMsisdn;
GLOBAL UBYTE          CNUMMsisdnIdx   = 0;
GLOBAL UBYTE          CNUMLenEfMsisdn = 0;
GLOBAL UBYTE          EfPLMNselStat   = EF_STAT_UNKNWN;
GLOBAL UBYTE          CPOLSimEfDataLen;
GLOBAL UBYTE          CPOLSimEfData[ACI_LEN_PLMN_SEL_FLD];

GLOBAL UBYTE          CLANimEfDataLen;
GLOBAL UBYTE          CLANSimEfData[ACI_LEN_LAN_FLD];
GLOBAL UBYTE          CLANSimEfDataLP[ACI_LEN_LAN_LP_FLD];

#else

EXTERN T_ENT_STAT     simEntStat;

EXTERN T_ACI_CFUN_FUN CFUNfun;

EXTERN UBYTE          CNUMMaxRec;
EXTERN T_ACI_CNUM_LST CNUMMsisdn;
EXTERN UBYTE          CNUMMsisdnIdx;
EXTERN UBYTE          CNUMLenEfMsisdn;
EXTERN UBYTE          EfPLMNselStat;
EXTERN UBYTE          CPOLSimEfDataLen;
EXTERN UBYTE          CPOLSimEfData[];

EXTERN UBYTE          CLANimEfDataLen;
EXTERN UBYTE          CLANSimEfData[];
EXTERN UBYTE          CLANSimEfDataLP[];
#endif /* CMH_SIMF_C */

#endif /* CMH_SIM_H */

/*==== EOF =======================================================*/