view src/condat2/com/include/vdbapi.h @ 635:baa0a02bc676

niq32.c DTR handling restored for targets that have it TI's original TCS211 fw treated GPIO 3 as the DTR input (wired so on C-Sample and D-Sample boards, also compatible with Leonardo and FCDEV3B which have a fixed pull-down resistor on this GPIO line), and the code in niq32.c called UAF_DTRInterruptHandler() (implemented in uartfax.c) from the IQ_KeypadGPIOHandler() function. But on Openmoko's GTA02 with their official fw this GPIO is a floating input, all of the DTR handling code in uartfax.c including the interrupt logic is still there, but the hobbled TCS211-20070608 semi-src delivery which OM got from TI contained a change in niq32.c (which had been kept in FC until now) that removed the call to UAF_DTRInterruptHandler() as part of those not-quite-understood "CC test" hacks. The present change fixes this bug at a long last: if we are building fw for a target that has TI's "classic" DTR & DCD GPIO arrangement (dsample, fcmodem and gtm900), we bring back all of TI's original code in both uartfax.c and niq32.c, whereas if we are building fw for a target that does not use this classic GPIO arrangement, the code in niq32.c goes back to what we got from OM and all DTR & DCD code in uartfax.c is conditioned out. This change also removes the very last remaining bit of "CC test" bogosity from our FreeCalypso code base.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 19 Jan 2020 01:41:35 +0000
parents 93999a60b835
children
line wrap: on
line source

/* 
+----------------------------------------------------------------------------- 
|  Project :  GSM-PS (6147)
|  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 :  
+----------------------------------------------------------------------------- 
*/ 

#ifndef __VDBAPI_H__
#define __VDBAPI_H__

/*
 * @todo anpassen an routing information
 */

/*
 * Number of protocol stack entities witch concurrently uses the VDB
 */
#define VDB_MAX_ENTITIES     8

/*
 * Identifiers for the protocol stack entities. To use at
 * initialisation of the VDB (vdb_init()).
 */
#define VDB_MMI  7
#define VDB_SIM  6
#define VDB_SMS  5
#define VDB_SS   4
#define VDB_CC   3
#define VDB_MM   2
#define VDB_RR   1
#define VDB_DL   0


/*
 * Return codes for the state parameter of the vdb_read_req()
 */
#define VDB_ENTITY_VALID 1
#define VDB_ENTITY_EMPTY 2
#define VDB_ENTITY_UNDEF 0

/*
 * Definition to mark the assi parameter invalid
 * for the function vdb_update_req()
 */
#define VDB_INVALID_SSI  ((ULONG)-1L)

/*
 * definition of the VDB related part of the destination adress
 * fragment of the primitives used in the base station.
 */

typedef struct
{
  UBYTE vdb_id;
  ULONG vdb_handle;
  ULONG search_ssi;
  ULONG send_ssi;
} T_DEST_ADDR;


/* == PROTOTYPES OF THE FUNCTIONAL VDB IMPLEMENTATION ============ */

EXTERN BOOL vdb_reset      (void);

EXTERN BOOL vdb_init       (UBYTE          entity,
                            UBYTE          vdb_id);

EXTERN void vdb_read_req   (T_DEST_ADDR  * da,
                            UBYTE          entity,
                            void         **entry,
                            UBYTE        * state);

EXTERN void vdb_update_req (T_DEST_ADDR  * da,
                            UBYTE          entity,
                            void         * entry,
                            ULONG          assi);

EXTERN void vdb_free_req   (T_DEST_ADDR  * da,
                            UBYTE          entity);

EXTERN void vdb_unlock_req (T_DEST_ADDR  * da);

/* == MACRODEFINITION FOR THE VARIOUS REALISATIONS OF THE VDB == */

#ifdef VDB_AS_A_MODULE

#define VDB_READ_REQ(l,d,e,v,s)  void * v; UBYTE s; vdb_read_req (d,e,&v,&s)
#define VDB_NET_READ_REQ(l,p,e,v,s)  void * v; UBYTE s; NET_TO_DEST(p);\
                                     vdb_read_req (&dest_addr,e,&v,&s)
#define VDB_UNLOCK_REQ(d)        vdb_unlock_req (d);
#define VDB_UPDATE_REQ(d,e,v,a)  vdb_update_req (d,e,v,a)
#define VDB_FREE_REQ(d,e)        vdb_free_req (d,e);

#else
#ifdef VDB_AS_A_SERVER
/*
 * opcodes may be defined by server stub
 */
#define READ_REQ   1
#define UPDATE_REQ 2
#define FREE_REQ   3

#define VDB_READ_REQ(l,d,e,v,s)  void * v; UCHAR s; vdb (READ_REQ,d,e,&v,&s)
#define VDB_NET_READ_REQ(l,p,e,v,s)  void * v; UCHAR s; NET_TO_DEST(p);\
                                     vdb (READ_REQ,&dest_addr,e,&v,&s)
#define VDB_UNLOCK_REQ(d)        vdb (UNLOCK_REQ, d)
#define VDB_UPDATE_REQ(d,e,v,a)  vdb (UPDATE_REQ, d,e,v,a)
#define VDB_FREE_REQ(d,e)        vdb (FREE_REQ,   d,e)

#else
#ifdef VDB_AS_A_PROCESS
/*
 * Not defined yet
 */
#define VDB_READ_REQ(l,d,e,v,s)  void l(); send_vdb_read_req (l,d,e); }\
                                 void l(T_DEST_ADDR * d, void **v, UBYTE *s) {
#define VDB_NET_READ_REQ(l,p,e,v,s)  void l(); NET_TO_DEST(p);\
                                     send_vdb_read_req (l,&dest_addr,e); }\
                                     void l(T_DEST_ADDR * d, void **v, UBYTE *s) {
#define VDB_UNLOCK_REQ(d)        send_vdb_read_req (d)
#define VDB_UPDATE_REQ(d,e,v,a)  send_vdb_update_req (d,e,v,a)
#define VDB_FREE_REQ(d,e)        send_vdb_free_req (d,e)

#endif
#endif
#endif

#endif