view src/aci2/aci/psa_gmm.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 :  
|  Modul   :  
+----------------------------------------------------------------------------- 
|  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 protocol stack adapter
|             GPRS Mobility Management ( GMM ).
+----------------------------------------------------------------------------- 
*/ 

#ifdef GPRS

#ifndef PSA_GMM_H
#define PSA_GMM_H


/************************************************************************
**                       GMM PRIMITIVE TRACE                           **
************************************************************************/

#define GMM_PRIMITIVE_TRACES GMM_PRIMITIVE_TRACES
//#define GMM_PRIMITIVE_TRACES_ADVANCED GMM_PRIMITIVE_TRACES_ADVANCED

/************************************************************************
**       switching on of and mode over above mentioned defines         **
**       -----------------------------------------------------         **
**       advanced means: a short string output of the parameter        **
**                                                                     **
**       without advanced: only numbers                                **
************************************************************************/

#ifdef GMM_PRIMITIVE_TRACES_ADVANCED

#define PARAMETER_STRING_1 "%s: %s"
#define PARAMETER_STRING_2 "%s: %s %s"

extern char* dbg_attachType(UBYTE attach_type);
extern char* dbg_detachType(UBYTE detach_type);
extern char* dbg_mobileClass(UBYTE mobile_class);
extern char* dbg_searchRunning(UBYTE search_running)
extern char* dbg_cellState(UBYTE cell_state)

#else

# define PARAMETER_STRING_1 "%d"
# define PARAMETER_STRING_2 "%d %d"

# define  dbg_attachType
# define  dbg_detachType
# define  dbg_mobileClass
# define  dbg_searchRunning
# define  dbg_cellState

#endif /* GMM_PRIMITIVE_TRACES_ADVANCED */

#if defined GMM_PRIMITIVE_TRACES
#   define GMM_PRIM_TRACE_1(a,b)    TRACE_EVENT_P1(PARAMETER_STRING_1, b)
#   define GMM_PRIM_TRACE_2(a,b,c)  TRACE_EVENT_P2(PARAMETER_STRING_2, b, c)

#elif defined GMM_PRIMITIVE_TRACES_ADVANCED
#   define GMM_PRIM_TRACE_1(a,b)    TRACE_EVENT_P2(PARAMETER_STRING_1, a, b)
#   define GMM_PRIM_TRACE_2(a,b,c)  TRACE_EVENT_P3(PARAMETER_STRING_2, a, b, c)

#else
# define GMM_PRIM_TRACE_1(a,b)
# define GMM_PRIM_TRACE_2(a,b,c)
#endif  /* GMM_PRIMITIVE_TRACES || GMM_PRIMITIVE_TRACES_ADVANCED */

/************************************************************************
**                       GMM PRIMITIVE TRACE                           **
************************************************************************/


/*==== CONSTANTS ==================================================*/
#define INVLD_PLMN  (0xFF)          /* marks an invalid PLMN */
#define ATTACH_TYPE_DETACHED  0

typedef enum              /* PSA notification events */
{
  GMM_NTF_ATT_CNF = 0,    /* the attach was successful */
  GMM_NTF_ATT_REJ,        /* the attach has failed */
  GMM_NTF_DET_CNF,        /* the network confirmed the detach */
  GMM_NTF_DET_IND,        /* A network initiated detach */
  GMM_NTF_PLMN_IND,       /* indicate a PLMN list */
  GMM_NTF_SUSP_IND,       /*  */
  GMM_NTF_RES_IND,        /*  */
  GMM_NTF_INFO_IND,       /* transmit information */
  GMM_NTF_MAX              /* maximum MM notification event */

} T_GMM_NTF;  /* finished */

typedef enum              /* test parameter identifier */
{
  GMM_OFF = 0,            /* the  */
  GMM_DETACHED,           /* detached */
  GMM_ATTACHED,           /* attached */
  GMM_ATTACHING,          /* will be attached */
  GMM_DETACHING,          /* will be detached */
  GMM_SUSPENTED           /* suspented */

} T_GMM_ATTACH_STATE;

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

typedef struct GMMShrdParm
{
  /* state parameter */
  UBYTE   mobile_class;             /* 0: A       1: B      2: C           3: CG      4: CC */
  UBYTE   service_mode;

  /* set parameter */
  UBYTE   requested_mobile_class;   /* 0: A       1: B      2: C           3: CG      4: CC */

  /* answer parameter */
  UBYTE   gprs_status[MAX_PLMN_ID]; /* 0 - 2: which the PLMN supports */
  UBYTE   last_attach_type;
  UBYTE   current_attach_type;
  UBYTE   requested_attach_type;

  /* GPRS registration status parameters */
  T_CGREG_STAT    cgreg_stat;    /* +CGREG status */
  T_P_CGREG_STAT  p_cgreg_stat;  /* %CGREG status */
  USHORT          lac;           /* current cell coordinates */
  USHORT          cid;
  T_ACI_P_CREG_GPRS_IND gprs_indicator; /* %CREG gprs indicator */
} T_GMM_SHRD_PRM;

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

EXTERN void psaGMM_Init (UBYTE auto_attach, UBYTE auto_detach, UBYTE mobile_class );
EXTERN void psaGMM_NetworkRegistrationStatus ( ULONG prim, void* para);

EXTERN void psaGMM_Attach         ( UBYTE mobile_class, UBYTE attach_type, UBYTE service_mode );
EXTERN void psaGMM_Detach         ( UBYTE detach_type );
EXTERN void psaGMM_Net_Req        ( void );
EXTERN void psaGMM_Plmn_res       ( UBYTE mobile_class, UBYTE attach_type, T_plmn *plmn );
EXTERN void psaGMM_Plmn_mode_req  ( UBYTE net_selection_mode );
EXTERN void psaGMM_Config_req( UBYTE cipher_on, UBYTE tlli_handling );

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

#ifdef PSA_GMMF_C

GLOBAL T_GMM_SHRD_PRM gmmShrdPrm;

GLOBAL UBYTE                default_mobile_class  = GMMREG_CLASS_BG;
GLOBAL T_CGAATT_ATTACH_MODE automatic_attach_mode;
GLOBAL T_CGAATT_DETACH_MODE automatic_detach_mode;

#else

EXTERN T_GMM_SHRD_PRM gmmShrdPrm;

EXTERN UBYTE  default_mobile_class;
EXTERN T_CGAATT_ATTACH_MODE automatic_attach_mode;
EXTERN T_CGAATT_DETACH_MODE automatic_detach_mode;

#endif /* PSA_GMMF_C */

#endif /* PSA_GMM_H */

#endif  /* GPRS */
/*==== EOF =======================================================*/