4 * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 /* Priority level for suspension of all updates */
23 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_ALL 4294967295 /* 0xFFFFFFFF */
25 /* Priority level for suspension of High priority updates */
26 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_HIGH 3221225472 /* 0xFFFFFFFF */
28 /* Priority level for suspension of all updates of dynamic data */
29 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_ALL_DYN 1610612735 /* 0x5FFFFFFF */
31 /* Priority level for suspension of Medium all updates */
32 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_MEDIUM 2147483648 /* 0x5FFFFFFF */
34 /* Priority level for suspension of Low updates of Medium */
35 #define UTA_FLASH_PLUGIN_PRIO_SUSPEND_LOW 1073741824 /* 0x5FFFFFFF */
37 /* Priority level for unsuspension of all updates */
38 #define UTA_FLASH_PLUGIN_PRIO_UNSUSPEND_ALL 0 /* 0x0 */
40 #define NVM_FUNCTION_ID_OFFSET 20
41 #define XDRV_INDICATION 0x04
43 #define XDRV_DISABLE "0"
44 #define XDRV_ENABLE "1"
45 #define XDRV_UNSUSPEND "0"
47 /* Identifies our group with the xdrv AT command set */
48 #define IUFP_GROUP "43"
49 #define IUFP_GROUP_ID 43
51 #define IUFP_REGISTER 0
52 #define IUFP_REGISTER_STR "0"
54 #define IUFP_SUSPEND 1
55 #define IUFP_SUSPEND_STR "1"
58 #define IUFP_FLUSH_STR "2"
60 #define IUFP_UPDATE_REQ 3
61 #define IUFP_UPDATE_REQ_STR "3"
63 #define IUFP_UPDATE_REQ_ACK 3
64 #define IUFP_UPDATE_REQ_ACK_STR "3"
67 #define IUFP_UPDATE_STR "4"
69 #define IUFP_UPDATE_ACK 4
70 #define IUFP_UPDATE_ACK_STR "4"
72 #define IUFP_NO_PENDING_UPDATE 5
73 #define IUFP_NO_PENDING_UPDATE_STR "5"
75 /* XDRV command was executed without any error */
76 #define XDRV_RESULT_OK 0
78 typedef enum uta_common_return_codes {
81 UTA_ERROR_OUT_OF_MEMORY = -2,
82 UTA_ERROR_INVALID_HANDLE = -3,
83 UTA_ERROR_OUT_OF_RANGE_PARAM = -4,
84 UTA_ERROR_INVALID_PARAM = -5,
85 UTA_ERROR_TOO_SMALL_BUF_PARAM = -6,
86 UTA_ERROR_NOT_SUPPORTED = -7,
87 UTA_ERROR_TIMEOUT = -8,
88 UTA_ERROR_WRONG_STATE = -9,
89 UTA_ERROR_BAD_FORMAT = -10,
90 UTA_ERROR_INSUFFICIENT_PERMISSIONS = -11,
91 UTA_ERROR_IO_ERROR = -12,
92 UTA_ERROR_OUT_OF_HANDLES = -13,
93 UTA_ERROR_OPERATION_PENDING = -14,
94 UTA_ERROR_SPECIFIC = -100
97 typedef enum nvm_error_numbers {
113 NVM_NO_PENDING_UPDATE,
119 int nvm_sum_4_bytes(const char *pos);
120 gboolean nvm_create_nvm_data();
121 nvm_error nvm_process_nv_update(const char *data);
123 #endif /* __NVM_H__ */