view src/g23m-fad/tcpip/tcpip.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 90eb61ecd093
children
line wrap: on
line source

/* 
+------------------------------------------------------------------------------
|  File:       tcpip.h
+------------------------------------------------------------------------------
|  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 Entity TCPIP.
+----------------------------------------------------------------------------- 
*/ 

#ifndef TCPIP_H
#define TCPIP_H

/*==== INCLUDES =============================================================*/

/*==== CONSTS ===============================================================*/

#define TCPIP_MAX_DTI_LINKS 4   /* For phase one, this is one DTI link per
                                 * application plus one to the lower layer
                                 * (PPP or SNDCP. */

#define TCPIP_DTI_QUEUE_SIZE 5  /* Arbitrary value. */

#define TCPIP_DEFAULT_WINDOW 1  /* Default window size regarding payload data
                                 * between TCPIP and the application. As we do
                                 * not really do window-based flow control
                                 * yet, this value only means "send another
                                 * primitive". */

#ifdef VSI_CALLER
#undef VSI_CALLER
#endif /* VSI_CALLER */
#define VSI_CALLER       tcpip_handle,

#define hCommMMI         tcpip_hCommMMI  /* Communication handle */

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


/* Flow control status. */
typedef enum { TCPIP_FLOWCTL_XOFF = 0, TCPIP_FLOWCTL_XON } T_flowctl_status ;

/* Global entity data.
 * 
 */
typedef struct                  /* T_TCPIP_DATA */
{
  unsigned char version ;
  BOOL is_initialized ;         /* TCPIP/RNET has been initialized.  */
  DTI_HANDLE dti_handle ;       /* TCPIP's own DTI handle. */
  struct                        /* Data for the DTI link to the lower layer */
  {
    U32 link_id ;               /* DTI link identifier. */
    T_flowctl_status flowstat_ul ;
                                /* Flow control status to lower layer
                                 * (uplink). */
    T_flowctl_status flowstat_dl ;
                                /* Flow control status to IP (downlink). */
  }
  ll[1] ;                       /* Indexed by DTI channel number. */
  U32 config_dns_address ;      /* DNS server address, set by config
                                 * primitive, in network byte order. Overrides
                                 * the first DNS server address in
                                 * TCPIP_IFCONFIG_REQ. */
} T_TCPIP_DATA;




/*==== EXPORTS ===============================================================*/

#ifdef TCPIP_PEI_C

/* Entity data base */
T_TCPIP_DATA               tcpip_data_base;
T_TCPIP_DATA               *tcpip_data;

/* Communication handles */
T_HANDLE                 hCommMMI = VSI_ERROR;
T_HANDLE                 tcpip_handle;
T_HANDLE                 hCommTCPIP = VSI_ERROR ;

#else  /* TCPIP_PEI_C */

extern T_TCPIP_DATA      tcpip_data_base, *tcpip_data;
extern T_HANDLE          hCommMMI;
extern T_HANDLE          tcpip_handle;
extern T_HANDLE          hCommTCPIP ;

#endif /* TCPIP_PEI_C */

/*==== Some functions ========================================================*/

/** Shut down RNET and deallocate data. This defined as a separate function
 * because it will also be called by pei_exit().
 * 
 */
void tcpip_do_shutdown(void) ;


/*==== DTI-related functions =================================================*/

/** DTI callback function according to dti.h.
 * 
 */
void tcpip_dti_callback(U8 instance, U8 interfac, U8 channel, U8 reason,
                        T_DTI2_DATA_IND *dti_data_ind) ;


/** Confirm the result of a TCPIP_DTI_REQ. This function is called
 * from tcpip_dti.c, so it must not be static.
 * 
 * @param dti_conn    Indicates whether the DTI link is to be established or
 *                    disconnected
 * @param link_id     DTI link identifier
 */
void tcpip_dti_cnf(U8 dti_conn, U32 link_id) ;


/** Send the data buffer with the specified length to the lower layer. The
 * data buffer will be freed by the caller.
 * 
 * @param data        Pointer to the data.
 * @param length      Length of the data.
 */
void tcpip_dti_send_data_ll(U8 *data, U16 length) ;



/*==== Primitive handler functions ===========================================*/

/** Handle the primitive of the same name.
 * 
 * @param primdata    Pointer to primitive data (duh!).
 */
void tcpip_initialize_req(void *primdata) ;
void tcpip_shutdown_req(void *primdata) ;
void tcpip_ifconfig_req(void *primdata) ;
void tcpip_dti_req(void *primdata) ;
void tcpip_create_req(void *primdata) ;
void tcpip_close_req(void *primdata) ;
void tcpip_bind_req(void *primdata) ;
void tcpip_listen_req(void *primdata) ;
void tcpip_connect_req(void *primdata) ;
void tcpip_data_req(void *primdata) ;
void tcpip_data_res(void *primdata) ;
void tcpip_sockname_req(void *primdata) ;
void tcpip_peername_req(void *primdata) ;
void tcpip_hostinfo_req(void *primdata) ;
void tcpip_mtu_size_req(void *primdata) ;
void tcpip_internal_ind(void *primdata) ;

/** Send a message to self.
 * 
 * @param msg_p    pointer to message
 * @param msg_id   message identification
 */
void tcpip_send_internal_ind(U32 msg_p, U32 msg_id) ;


/* DTI primitive handlers.
 */
void tcpip_dti_ready_ind     (T_DTI2_READY_IND      *dti_ready_ind) ;
void tcpip_dti_data_req      (T_DTI2_DATA_REQ       *dti_data_req) ;
void tcpip_dti_data_ind      (T_DTI2_DATA_IND       *dti_data_ind) ;
void tcpip_dti_getdata_req   (T_DTI2_GETDATA_REQ    *dti_getdata_req) ;
#if defined(_SIMULATION_)       /* Used only for simulation test primitives. */
void tcpip_dti_data_test_ind (T_DTI2_DATA_TEST_IND  *dti_data_test_ind) ;
void tcpip_dti_data_test_req (T_DTI2_DATA_TEST_REQ  *dti_data_test_req) ;
#endif /* _SIMULATION_ */
void tcpip_dti_connect_req   (T_DTI2_CONNECT_REQ    *dti_connect_req) ;
void tcpip_dti_disconnect_ind(T_DTI2_DISCONNECT_IND *dti_disconnect_ind) ;
void tcpip_dti_connect_cnf   (T_DTI2_CONNECT_CNF    *dti_connect_cnf) ;
void tcpip_dti_connect_ind   (T_DTI2_CONNECT_IND    *dti_connect_ind) ;
void tcpip_dti_connect_res   (T_DTI2_CONNECT_RES    *dti_connect_res) ;
void tcpip_dti_disconnect_req(T_DTI2_DISCONNECT_REQ *dti_disconnect_req) ;



#endif /* !TCPIP_H */