view src/aci2/aci/psa_f.c @ 685:3fb7384e820d

tpudrv12.h: FCDEV3B goes back to being itself A while back we had the idea of a FreeCalypso modem family whereby our current fcdev3b target would some day morph into fcmodem, with multiple FC modem family products, potentially either triband or quadband, being firmware-compatible with each other and with our original FCDEV3B. But in light of the discovery of Tango modules that earlier idea is now being withdrawn: instead the already existing Tango hw is being adopted into our FreeCalypso family. Tango cannot be firmware-compatible with triband OM/FCDEV3B targets because the original quadband RFFE on Tango modules is wired in TI's original Leonardo arrangement. Because this Leonardo/Tango way is now becoming the official FreeCalypso way of driving quadband RFFEs thanks to the adoption of Tango into our FC family, our earlier idea of extending FIC's triband RFFE control signals with TSPACT5 no longer makes much sense - we will probably never produce any new hardware with that once-proposed arrangement. Therefore, that triband-or-quadband FCFAM provision is being removed from the code base, and FCDEV3B goes back to being treated the same way as CONFIG_TARGET_GTAMODEM for RFFE control purposes.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 24 Sep 2020 21:03:08 +0000
parents 93999a60b835
children
line wrap: on
line source

/* 
+-----------------------------------------------------------------------------
|  Project :  GSM-PS (6147)
|  Modul   :  PSA_F
+-----------------------------------------------------------------------------
|  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 :  This module defines global functions of the protocol
|             stack adapters.
+-----------------------------------------------------------------------------
*/

#ifndef PSA_F_C
#define PSA_F_C
#endif

#include "aci_all.h"

/*==== INCLUDES ===================================================*/
#include "aci_cmh.h"
#include "ati_cmd.h"
#include "aci_cmd.h"
#include "psa.h"
#include "aci.h"
#include "l4_tim.h"

#include "psa_cc.h"
#if defined FF_EOTD
#include "psa_lc.h"
#endif

#ifdef UART
#include "dti_conn_mng.h"
#endif

#ifdef GPRS
#include "gaci_cmh.h"
#include "psa_gmm.h"
#include "psa_sm.h"
#include "psa_gppp.h"
#include "ffs/ffs.h"
#include "ffs_coat.h"
#endif /* GPRS */

#include "aci_lst.h"

#ifdef UART
#include "dti.h"      /* functionality of the dti library */
#include "psa_uart.h"
#include "cmh_uart.h"
#endif

/*==== CONSTANTS ==================================================*/


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


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


/*==== VARIABLES ==================================================*/


/*==== FUNCTIONS ==================================================*/


/*
+-------------------------------------------------------------------+
| PROJECT : GSM-PS (6147)         MODULE  : CMH                     |
|                                 ROUTINE : psa_Init                |
+-------------------------------------------------------------------+

  PURPOSE : initialize the protocol stack adapters.

*/

GLOBAL void psa_Init ( void )
{

/*
 *-------------------------------------------------------------------
 * set default parms for protocol stack adapters
 *-------------------------------------------------------------------
 */

 /* --- psa init functions --- */
}

/*
+-------------------------------------------------------------------+
| PROJECT : GSM-PS (6147)         MODULE  : CMH                     |
|                                 ROUTINE : psa_IsVldOwnid          |
+-------------------------------------------------------------------+

  PURPOSE : check for a valid owner id.

*/

GLOBAL BOOL psa_IsVldOwnId ( T_OWN ownId )
{
  if( ownId > OWN_NONE AND ownId < OWN_MAX )

    return TRUE;

  return( FALSE );
}

/*
+--------------------------------------------------------------------+
| PROJECT: GSM-PS (6147)                MODULE:  ACI_CMD             |
| STATE  : code                         ROUTINE: psa_timeout         |
+--------------------------------------------------------------------+

  PURPOSE : A timeout has occured for a timer. The function returns
            TRUE, if it is a timer which is handled by PSA, else FALSE
            is returned to indicate that the timer has not been
            processed.

*/

GLOBAL UBYTE psa_timeout (USHORT index)
{
  TRACE_FUNCTION ("psa_timeout()");

  switch(index)
  {
  case(ACI_TDTMF):
    /* timeout dtmf timer */
    psaCC_DTMFTimeout();
    return(TRUE);

#ifdef UART
  case(ACI_IPR):
    /* timeout AT+IPR: change baud rate */
    timeout_PlusIPR();
    return(TRUE);
#endif
    
#if defined FF_EOTD
  case(ACI_LC_1):
  case(ACI_LC_2):
  case(ACI_LC_3):
  case(ACI_LC_4):
  case(ACI_LC_5):
    psaLC_posDataReq(index);
    return(TRUE);
#endif /* FF_EOTD */
  }

  /* the timeout is not for PSA */
  return FALSE;
}

#if defined (GPRS) AND defined (DTI)
/*
+-------------------------------------------------------------------+
| PROJECT : GSM-PS (6147)         MODULE  : CMH                     |
|                                 ROUTINE : psa_GPRSInit            |
+-------------------------------------------------------------------+

  PURPOSE : initialize the protocol stack adapters.

*/
#define FACTOR_T3314   1000
#define FACTOR_T3312  60000

GLOBAL void psa_GPRSInit ( void )
{
  T_FFS_GPRS_ACI ffsBuffer;

  T_FFS_SIZE size = FFS_fread("/GPRS/baspar_gprs", &ffsBuffer, sizeof(T_FFS_GPRS_ACI));
  
  if ( size NEQ sizeof(T_FFS_GPRS_ACI) )
  {
#   ifndef _SIMULATION_
    if ( size < 0 )
    {
      TRACE_EVENT_P1("FFS can not read \"/GPRS/baspar_gprs\" (%d)", size);
    }
    else
    {
      TRACE_EVENT_P2("FFS contains old file of \"/GPRS/baspar_gprs\": %dBytes long, but %dBytes expected",
                      size, sizeof(T_FFS_GPRS_ACI));
    }
#   endif /* NOT DEFINED _SIMULATION_ */

    ffsBuffer.max_cid               = 2;     /* not supported at this moment */
    ffsBuffer.auto_attach           = (UBYTE) CGAATT_ATTACH_MODE_MANUAL;/* 1 */
    ffsBuffer.auto_detach           = (UBYTE) CGAATT_DETACH_MODE_OFF;   /* 1 */
    ffsBuffer.default_mobile_class  = (UBYTE) GMMREG_CLASS_BG;          /* 4 */
    ffsBuffer.accm                  = 0;                               /*  3 */
    ffsBuffer.restart_timer         = PPP_RT_DEFAULT;                  /*  3 */
    ffsBuffer.max_configure         = PPP_MC_DEFAULT;                  /* 10 */
    ffsBuffer.max_terminate         = PPP_MT_DEFAULT;                  /*  2 */
    ffsBuffer.max_failure           = PPP_MF_DEFAULT;                  /*  5 */
  }

  psaGPPP_Init( ffsBuffer.accm, ffsBuffer.restart_timer,
                ffsBuffer.max_configure, ffsBuffer.max_terminate, ffsBuffer.max_failure );
  psaGMM_Init( ffsBuffer.auto_attach,ffsBuffer.auto_detach, ffsBuffer.default_mobile_class   );
  psaSM_Init();
}
#endif /* GPRS */

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