1 /*****************************************************************************
3 # Copyright 2004 Broadcom Corp. All Rights Reserved.
4 # This program is free software; you can distribute it and/or modify it
5 # under the terms of the GNU General Public License (Version 2) as
6 # published by the Free Software Foundation.
7 # This program is distributed in the hope it will be useful, but WITHOUT
8 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 # You should have received a copy of the GNU General Public License along
12 # with this program; if not, write to the Free Software Foundation, Inc.,
13 # 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
15 ******************************************************************************
17 // Filename: psidefs.h
18 // Author: Peter T. Tran
19 // Creation Date: 12/26/01
21 ******************************************************************************
23 // Define the PsiDefs functions.
25 *****************************************************************************/
30 /********************** Include Files ***************************************/
35 /********************** Global Constants ************************************/
36 #define PSI_MAGIC_LEN 16
37 #define PSI_HEADER_LEN (PSI_MAGIC_LEN + sizeof(UINT16))
38 #define PSI_VERSION_LEN 6
41 #define PSI_PRIORITY 20
42 #define PSI_STACK_SIZE 5000
43 #define PSI_PROFILE_NUM_MAX 1
44 #define PSI_PROFILE_NAME_LEN_MAX 16
46 // ratio of PSI buffer size in RAM and xml PSI size
47 // xml PSI is more compact. As data have variable size, no space is wasted
48 #define PSI_BUFFER_TO_XML_FACTOR 4
50 #define PSI_VALUE void*
51 #define PSI_HANDLE void*
54 #define PSI_PATH_DEFAULTCONFIG "/etc/default.cfg"
55 #define PSI_PATH_RUNTIMECONFIG "/var/backupsettings.cfg"
56 #define PSI_XML_PATH_FLASHCONFIG "/var/psi.xml"
57 #define PSI_XML_PATH_RUNTIMECONFIG "/var/psiRunning.xml"
58 #define PSI_XML_FLASH_CONFIG 1
59 #define PSI_XML_RUNNING_CONFIG 2
60 #define PSI_XML_ALL_CONFIG 3
61 #define PSI_NUMBER_OF_CHANGES "/var/psiNumChanges"
62 #define PSI_BUFF_SIZE 128
64 /********************** Global Enums ****************************************/
66 typedef enum _psiStatus {
70 PSI_STS_ERR_OBJECT_NOT_FOUND,
71 PSI_STS_ERR_APP_NOT_FOUND,
72 PSI_STS_ERR_OBJECT_EXIST,
73 PSI_STS_ERR_APP_EXIST,
74 PSI_STS_ERR_INVALID_LENGTH,
75 PSI_STS_ERR_INVALID_VALUE,
76 PSI_STS_ERR_INVALID_CRC,
77 PSI_STS_ERR_INVALID_MAGIC_VALUE,
78 PSI_STS_ERR_INVALID_PROFILE_NUM,
79 PSI_STS_ERR_PROFILE_NAME,
80 PSI_STS_ERR_PROFILE_TOO_LARGE,
81 PSI_STS_ERR_CONFIGFILE_UNKNOWN,
82 PSI_STS_ERR_CONFIGFILE_SIZE
83 #if defined(SUPPORT_PARTCONF)