view src/condat2/com/include/ffs_pc_api.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

/********************************************************************************/
/*                                                                              */
/*    File Name:         ffs_pc_api.h                                           */
/*                                                                              */
/*    Purpose:           This header file contains the external constants and   */
/*                       prototypes related to the Flash File System.           */
/*                                                                              */
/*    Note:              None.                                                  */
/*                                                                              */
/*    Revision History:                                                         */
/*       02/27/02        Pascal Pompei                                          */
/*                          - Create.                                           */
/*                                                                              */
/* (C) Copyright 2002 by Texas Instruments Incorporated, All Rights Reserved.   */
/*                                                                              */
/********************************************************************************/
#ifndef _FFS_PC_API_
#define _FFS_PC_API_

#include <windows.h>

#ifdef __cplusplus
extern "C"
{
#endif


/******************************** FILE DESCRIPTOR *******************************/
/*                                                                              */
/* Define the file descriptor.                                                  */
typedef INT32  T_FFS_FD;

	
/*********************************** FILE SIZE **********************************/
/*                                                                              */
/* Define the file size.                                                        */
typedef INT32  T_FFS_SIZE;

	
/************************************ OFFSET ************************************/
/*                                                                              */
/* Define the offset.                                                           */
typedef UINT32  T_FFS_OFFSET;

/************************************* FLAGS ************************************/
/*                                                                              */
/* Define the modes used to open the file.                                      */
typedef UINT32  T_FFS_OPEN_FLAGS;

#define FFS_O_CREATE                                  (0x00000001)
#define FFS_O_APPEND                                  (0x00000002)
#define FFS_O_EXCL                                    (0x00000004)
#define FFS_O_TRUNC                                   (0x00000008)
#define FFS_O_RDONLY                                  (0x00000010)
#define FFS_O_WRONLY                                  (0x00000020)
#define FFS_O_RDWR                                    (FFS_O_RDONLY | FFS_O_WRONLY)

/* Define the starting point for the file pointer move.                         */
typedef UINT32  T_FFS_WHENCE;

#define FFS_SEEK_SET                                  (FILE_BEGIN)
#define FFS_SEEK_CUR                                  (FILE_CURRENT)
#define FFS_SEEK_END                                  (FILE_END)


/*********************************** META-DATA **********************************/
/*                                                                              */
/* Define object types.                                                         */
typedef enum 
{
	OT_FILE	= 0x00000001,
	OT_DIR,
	OT_LINK
} T_FFS_OBJECT_TYPE;

/* Define a structure used to gather information (meta-data) about an object.   */
typedef struct 
{
	T_FFS_OBJECT_TYPE  type;	/* Object type: file, folder, ...               */
	T_FFS_SIZE         size;	/* Size of data space occupied by object.       */
} T_FFS_STAT;


/*********************************** DIRECTORY **********************************/
/*                                                                              */
/* Define a structure used to gather information about a directory.             */
typedef struct 
{ 
	WIN32_FIND_DATA  find_data;
	HANDLE			 search_handle;
} T_FFS_DIR;

	
/***************************** INTERNAL ERROR CODES *****************************/
/*                                                                              */
/* Define the internal error codes.                                             */
typedef enum
{
	EFFS_OK           = 0,		/* OK.                                          */

    EFFS_NODEVICE     = -1,		/* Flash device unknown.                        */
    EFFS_CORRUPTED    = -2,		/* File system corrupted.                       */
    EFFS_NOPREFORMAT  = -3,		/* Flash File System not preformatted.          */
    EFFS_NOFORMAT     = -4,		/* Flash File System not formatted.             */
    EFFS_BADFORMAT    = -5,		/* Format not recognized.                       */
    EFFS_MAGIC        = -6,		/* Bad magic.                                   */
    EFFS_AGAIN        = -7,		/* Not ready, try again later on.               */
    EFFS_NOSYS        = -8,		/* Function not implemented.                    */
    EFFS_DRIVER       = -9,		/* Driver error.                                */

    EFFS_NOSPACE      = -10,	/* Out of file space (no free data space).      */
    EFFS_FSFULL       = -11,	/* File system full (no free inodes).           */
    EFFS_BADNAME      = -12,	/* Bad filename.                                */
    EFFS_NOTFOUND     = -13,	/* Not found.                                   */
    EFFS_EXISTS       = -14,	/* Object already exists.                       */
    EFFS_ACCESS       = -15,	/* File access permission violation.            */
    EFFS_NAMETOOLONG  = -16,	/* Filename too long.                           */
    EFFS_INVALID      = -17,	/* Invalid argument.                            */
    EFFS_DIRNOTEMPTY  = -18,	/* Directory not empty.                         */
    EFFS_NOTADIR      = -19,	/* Object is not a directory.                   */
    EFFS_SPARE        = -20,	/* Spare.                                       */

    EFFS_FILETOOBIG   = -21,	/* File too big.                                */
    EFFS_NOTAFILE     = -22,	/* Object is not a file.                        */
    EFFS_PATHTOODEEP  = -23,	/* Path too deep.                               */
    EFFS_NUMFD        = -24,	/* Maximum number of open files reached.        */
    EFFS_BADFD        = -25,	/* Bad file descriptor.                         */
    EFFS_BADOP        = -26,	/* Bad options.                                 */
    EFFS_LOCKED       = -27,	/* File locked by another file descriptor.      */

    EFFS_TOOBIG       = -30,	/* Too big (buffer overflow).                   */
    EFFS_MSGALLOC     = -31,	/* Message allocation failed.                   */
    EFFS_MSGSEND      = -32,	/* Message send failed.                         */

    EFFS_SIBLINGLOOP  = -40,	/* Directory sibling loop.                      */
    EFFS_NOBLOCKS     = -41,	/* No more blocks.                              */
    EFFS_DBR          = -42,	/* Data reclaim did not finish.                 */
} T_FFS_RET;


/*
 * Prototypes for functions provided by the FFS simulation on the PC
 */
T_FFS_FD ffs_open       (const char        *pathname_p,
                         T_FFS_OPEN_FLAGS  flags);
T_FFS_RET ffs_close     (T_FFS_FD  fd);
T_FFS_SIZE ffs_write    (T_FFS_FD    fd,
                         void        *buffer_p,
                         T_FFS_SIZE  size);
T_FFS_SIZE ffs_read     (T_FFS_FD    fd,
                         void        *buffer_p,
                         T_FFS_SIZE  size);
T_FFS_SIZE ffs_seek     (T_FFS_FD      fd,
                         T_FFS_SIZE    offset,
                         T_FFS_WHENCE  whence);
T_FFS_RET ffs_ftruncate (T_FFS_FD      fd,
                         T_FFS_OFFSET  length);
T_FFS_RET ffs_stat      (const char  *pathname_p,
                         T_FFS_STAT  *stat_p);
T_FFS_RET ffs_remove    (const char  *pathname_p);
T_FFS_RET ffs_mkdir     (const char  *pathname_p);
T_FFS_SIZE ffs_opendir  (const char  *pathname_p,
                         T_FFS_DIR   *dir_p);
T_FFS_SIZE ffs_readdir  (T_FFS_DIR   *dir_p,
                         char        *buffer_p,
                         T_FFS_SIZE  size);
T_FFS_RET ffs_rename    (const char  *old_pathname_p,
                         const char  *new_pathname_p);

T_FFS_SIZE ffs_file_read(const char *name, void *addr, T_FFS_SIZE size);

T_FFS_SIZE ffs_init (void);

#ifdef __cplusplus
}
#endif

#endif /* #ifndef _FFS_PC_API_ */