4 * Copyright (c) 2017 - 2022 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 UI_OP_SCOUT_UPDATE 0
32 #define UI_OP_UPDATE 3
34 typedef struct _ua_update_data_t {
35 unsigned int weight; // the sum of weight should be 100
36 unsigned int weight_offset; // start offset
37 unsigned int data_size; // byte
38 char *ua_delta_path; // it will be allocated to copy delta file path, need to free memory
39 char *ua_temp_path; // it will be allocated to copy delta file path, need to free memory
40 char *ua_delta_folder;
43 typedef struct _ua_update_cfg_t {
46 int source_img_size; //TOTA
49 typedef struct _ua_part_info_t {
51 char *ua_subject_name;
54 // User data structure
55 typedef struct _ua_data_t { // partition operations
56 ua_part_info_t *parti_info;
57 ua_update_cfg_t *update_cfg;
58 ua_update_data_t *update_data;
59 unsigned long ua_operation;
61 int (*ua_op_read_block)(void *, unsigned char *, unsigned long, unsigned long);
62 int (*ua_op_write_block)(void *, unsigned char *, unsigned long);
63 void (*ui_progress)(void *, unsigned long);
66 typedef struct _ua_delta_info_t {
67 char ua_patch_path[MAX_FILE_PATH];
68 char ua_patch_info[MAX_FILE_PATH];
69 char ua_delta_path[MAX_FILE_PATH];
70 char ua_attrib_path[MAX_FILE_PATH];
73 typedef struct _ua_dataSS_t { // partition operations
74 ua_part_info_t *parti_info;
75 ua_update_cfg_t *update_cfg;
76 ua_update_data_t *update_data;
77 ua_delta_info_t *update_delta;
78 unsigned long ua_operation;
79 void (*ui_progress)(void *, unsigned long);
80 int (*write_data_to_blkdev)(char *, int, int, char *);
83 typedef unsigned int SS_UINT32;