4 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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.
19 #ifndef __UA_TYPES_H__
20 #define __UA_TYPES_H__
24 #define MAX_FILE_PATH 512
27 * FOTA Adaptaion header
30 #define UA_PARTI_MAX 20 //currently supporting max 20 partitions
32 #define UI_OP_SCOUT_UPDATE 0
34 #define UI_OP_UPDATE 3
48 UA_MODE_SUPPLYIMFOM = 200
51 typedef struct _ua_update_data_t {
52 unsigned int exist_check;
53 unsigned int verify_check;
54 unsigned int update_check;
55 unsigned int weight; // the sum of weight should be 100
56 unsigned int weight_offset; // start offset
57 unsigned int data_size; // byte
58 char *ua_delta_path; // it will be allocated to copy delta file path, need to free memory
59 char *ua_temp_path; // it will be allocated to copy delta file path, need to free memory
62 typedef struct _ua_update_cfg_t {
63 unsigned int update_type;
66 int soure_img_size; //TOTA
72 typedef struct _ua_part_info_t {
74 char *ua_subject_name;
79 // User data structure
80 typedef struct _ua_data_t { // partition operations
81 ua_part_info_t *parti_info;
82 ua_update_cfg_t *update_cfg;
83 ua_update_data_t *update_data;
84 unsigned long ua_operation;
86 int (*ua_op_read_block)(void *, unsigned char *, unsigned long, unsigned long);
87 int (*ua_op_write_block)(void *, unsigned char *, unsigned long);
88 void (*ui_progress)(void *, unsigned long);
91 typedef struct _ua_delta_info_t {
92 char ua_patch_path[MAX_FILE_PATH];
93 char ua_patch_info[MAX_FILE_PATH];
94 char ua_delta_path[MAX_FILE_PATH];
95 char ua_attrib_path[MAX_FILE_PATH];
98 typedef struct _ua_dataSS_t { // partition operations
99 ua_part_info_t *parti_info;
100 ua_update_cfg_t *update_cfg;
101 ua_update_data_t *update_data;
102 ua_delta_info_t *update_delta;
103 unsigned long ua_operation;
104 void (*ui_progress)(void *, unsigned long);
105 int (*write_data_to_blkdev)(char *, int, int, char *);