4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Paresh Agarwal<paresh.agwl@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
24 /* Priority level for suspension of all updates */
25 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_ALL 4294967295 /* 0xFFFFFFFF */
27 /* Priority level for suspension of High priority updates */
28 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_HIGH 3221225472 /* 0xFFFFFFFF */
30 /* Priority level for suspension of all updates of dynamic data */
31 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_ALL_DYN 1610612735 /* 0x5FFFFFFF */
33 /* Priority level for suspension of Medium all updates */
34 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_MEDIUM 2147483648 /* 0x5FFFFFFF */
36 /* Priority level for suspension of Low updates of Medium */
37 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_LOW 1073741824 /* 0x5FFFFFFF */
39 /* Priority level for unsuspension of all updates */
40 #define UTA_FLASH_PLUGIN_PRIO_UNSUSPEND_ALL 0 /* 0x0 */
42 #define NVM_FUNCTION_ID_OFFSET 20
43 #define XDRV_INDICATION 0x04
45 #define XDRV_DISABLE "0"
46 #define XDRV_ENABLE "1"
47 #define XDRV_UNSUSPEND "0"
49 /* Identifies our group with the xdrv AT command set */
50 #define IUFP_GROUP "43"
51 #define IUFP_GROUP_ID 43
53 #define IUFP_REGISTER 0
54 #define IUFP_REGISTER_STR "0"
56 #define IUFP_SUSPEND 1
57 #define IUFP_SUSPEND_STR "1"
60 #define IUFP_FLUSH_STR "2"
62 #define IUFP_UPDATE_REQ 3
63 #define IUFP_UPDATE_REQ_STR "3"
65 #define IUFP_UPDATE_REQ_ACK 3
66 #define IUFP_UPDATE_REQ_ACK_STR "3"
69 #define IUFP_UPDATE_STR "4"
71 #define IUFP_UPDATE_ACK 4
72 #define IUFP_UPDATE_ACK_STR "4"
74 #define IUFP_NO_PENDING_UPDATE 5
75 #define IUFP_NO_PENDING_UPDATE_STR "5"
77 /* XDRV command was executed without any error */
78 #define XDRV_RESULT_OK 0
80 typedef enum uta_common_return_codes {
83 UTA_ERROR_OUT_OF_MEMORY = -2,
84 UTA_ERROR_INVALID_HANDLE = -3,
85 UTA_ERROR_OUT_OF_RANGE_PARAM = -4,
86 UTA_ERROR_INVALID_PARAM = -5,
87 UTA_ERROR_TOO_SMALL_BUF_PARAM = -6,
88 UTA_ERROR_NOT_SUPPORTED = -7,
89 UTA_ERROR_TIMEOUT = -8,
90 UTA_ERROR_WRONG_STATE = -9,
91 UTA_ERROR_BAD_FORMAT = -10,
92 UTA_ERROR_INSUFFICIENT_PERMISSIONS = -11,
93 UTA_ERROR_IO_ERROR = -12,
94 UTA_ERROR_OUT_OF_HANDLES = -13,
95 UTA_ERROR_OPERATION_PENDING = -14,
96 UTA_ERROR_SPECIFIC = -100
99 typedef enum nvm_error_numbers {
115 NVM_NO_PENDING_UPDATE,
121 int nvm_sum_4_bytes(const char *pos);
122 gboolean nvm_create_nvm_data();
123 nvm_error nvm_process_nv_update(const char *data);
125 #endif /* __NVM_H__ */