flashtool_handle.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:24k
- /*******************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2003
- *
- ******************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * flashtool_handle.h
- *
- * Project:
- * --------
- * Flash Download/Readback/Format Library.
- *
- * Description:
- * ------------
- * The exported C interface APIs to deal with FlashTool handles.
- *
- * Author:
- * -------
- * Amos Hsu (mtk00539)
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision: 1.13 $
- * $Modtime: Oct 19 2005 11:01:14 $
- * $Log: //mtkvs01/vmdata/flash_tool/archives/BootRom/flashtool_handle.h-arc $
- *
- * Jan 31 2008 mtk01413
- * [STP100001630] [FlashTool] v3.0804.0 release
- * New features:
- * 1. USB Download for End User
- * Enhancements:
- * 1. [DA] Download Optimization with 921k on MT6225/MT6229/MT6230/MT6235/MT6238
- * 2. [DA] Provide two download methodology : Best Effort Erase (default) and Sequential Erase
- * 3. [DA] New CheckID algorithm for all SPANSION MCP series
- *
- * Dec 3 2007 mtk01413
- * [STP100001568] [FlashTool] v3.0748.0 release
- * New features:
- * 1. USB Download on MT6225/MT6226/MT6227 Series BB
- * 2. GPS Download
- * 3. MT6238, MT6235, TK6516 AP/MD DVT
- *
- * Aug 30 2007 mtk01413
- * [STP100001497] [FlashTool] v3.2.0 release
- *
- *
- * Mar 12 2007 mtk01413
- * [STP100001329] FlashTool v3.1.04 release
- * Enhancements:
- * 1. [FlashTool/BROM_DLL/DA] Auto-Format when enabling System_Drive_On_NAND
- * 2. [FlashTool] Show Parameter List View automatically when loading secure-on MAUI
- * 3. [FlashTool] Move "Paremeter"/ "File Management"/ "ROM Writer" under "Window" menu item
- * 4. [FlashTool] Show DA version and Build Date in help dialog
- *
- *
- * Jan 2 2007 mtk01413
- * [STP100001195] FlashTool v3.1.02 release
- * New features:
- * 1. [BROM_DLL/DA] Support FOTA(Firmware update Over The Air) download.
- * 2. [BROM_DLL/DA] Support MT6223 download.
- * 3. [BROM_DLL/DA] Support MT6268T download.
- * 4. [DA] Supports new NOR Flash device
- * [SPANSION] S29GL128NH
- * [SPANSION] S29GL128NL
- * [SPANSION] S29GL256NH
- * [SPANSION] S29GL256NL
- * [SPANSION] S29GL512NH
- * [SPANSION] S29GL512NL
- *
- * Enhancements:
- * 1. [DA] Support BBC(Blank Block Check) for NOR Flash Format.
- * 2. [BROM_DLL/DA] Support Retransmit mechanism for NAND Readback operation.
- * 3. [BROM_DLL] Enhance E-NFB Check.
- *
- *
- * Nov 2 2006 mtk01413
- * [STP100001195] FlashTool v3.1.02 release
- * New features:
- * 1. [BROM_DLL/DA] E-NFB (Enhanced NFB) Download.
- *
- *
- * Sep 27 2006 mtk00539
- * [STP100001145] FlashTool v3.1.01 release
- *
- *
- * Aug 16 2006 mtk00539
- * [STP100001057] FlashTool v3.1.00 release
- * Add new function DL_GetProjectId().
- *
- * Aug 14 2006 mtk00539
- * [STP100001057] FlashTool v3.1.00 release
- *
- *
- * Jun 12 2006 mtk01413
- * [STP100000922] FlashTool v2.9.1001 release
- * New features:
- * 1. [FlashTool/BROM_DLL] Support Multi-Load Autodetection Download.
- *
- *
- * May 24 2006 mtk01413
- * [STP100000879] FlashTool v2.8.1001 release
- * 1. [BROM_DLL][NEW] Support 6229 Download, add m_emi_gen_c in DRAM setting
- *
- * Feb 23 2006 mtk00539
- * [STP100000625] FlashTool v2.7.1016
- *
- *
- * Rev 1.13 Oct 19 2005 14:44:44 mtk00539
- * 1. [BROM_DLL&DA][New] New H/W devices detection architecture including NOR, NAND, SRAM and DRAM detection.
- * 2. [BROM_DLL&DA][New] DA partial download technic, that overcomes DA size exceeds MT6205B internal SRAM (32KB).
- * 3. [BROM_DLL&DA][New] Format verification option, each byte should be 0xFF after erasure.
- * 4. [BROM_DLL&DA][New] DA validation to ensure invalid binary could not be loaded.
- * 5. [BROM_DLL&DA][New] Support NFB download.
- * 6. [BROM_DLL&DA][New] Support NAND flash format with 3 method, NORMAL, FORCEDLY ERASE and MARK AS BAD BLOCK.
- * 7. [BROM_DLL&DA][New] Support NAND flash read back with 4 methods, PAGE+ECC, PAGE ONLY, SPARE ONLY and PAGE+SPARE.
- * Resolution for 140: [BROM_DLL v2.7.1008][New] Support NFB download and many new features.
- *
- * Rev 1.12 May 24 2005 19:54:24 mtk00539
- * 1. [BROM_DLL][New] Add DA_cmd::CMD_EnableWatchDog() to enable watchdog after download process.
- * 2. [BROM_DLL][New] Add DL_ResourceProjectIdComparisonSetting() API to enable/disable resource project id comparison.
- * 3. [BROM_DLL][New] Add callback function in Boot_META() series API to do extra process after BootROM start command passed.
- * 4. [BROM_DLL][BUG FIX] Fix com port error after using HyperTerminal.
- * 5. [BROM_DLL][BUG FIX] Fix m_boot_timeout takes no effect in BRom_AutoBoot::BRom_StartCmd().
- * 6. [BROM_DLL][Change Behavior] Stop download process while CALLBACK_BEFORE_PROCESS return non-zero value.
- * 7. [BROM_DLL][Change Behavior] Skip resource table size and content size checking for CustPack project.
- * Resolution for 115: [BROM_DLL v2.4.1012][New] Support new flash devices and bug fix.
- *
- * Rev 1.11 Nov 22 2004 14:27:54 mtk00539
- * 1. [BROM_DLL][BUG FIX] Add baudrate sync procedure for BootROM stage baudrate change for Prolific convertor.
- * 2. [BROM_DLL][BUG FIX] Fix ReadData() delay time too long problem in DA_cmd::CMD_ChangeUartSpeed() while target is running at 13MHz.
- * 3. [BROM_DLL][BUG FIX] DO NOT use while loop in reading BootROM ack in BRom_AutoBoot::BRom_StartCmd(), it will cause BootROM timeout.
- * 4. [BROM_DLL][Enhance] Extend the read timeout waiting time in DA_cmd::CMD_WriteData, because SHARP flash program time is slow.
- * 5. [BROM_DLL][Enhance] Add m_speedup_brom_baudrate flag to enable/disable speed-up baudrate in BootROM stage.
- * Resolution for 99: [BROM_DLL v2.4.1008][New] Support INTEL family flash Buffered-Program method.
- *
- * Rev 1.10 May 21 2004 15:44:40 mtk00539
- * 1. [brom.dll][New] add J2ME_ROM resource for w04.21 load.
- * 2. [brom.dll][New] add MT6217 BootROM.
- * 3. [brom.dll][New] add Brom_DownloadData API.
- * 4. [brom.dll][New] remove Brom_Verify relative APIs.
- * 5. [brom.dll][Enhance] move region overlap checking from Rom_Load() to IsReady() for more convenience.
- * Resolution for 70: [BROM_DLL v2.3.1003][New] add J2ME_ROM resource for w04.21 load.
- *
- * Rev 1.9 May 14 2004 17:01:28 mtk00539
- * 1. [brom.dll][BUG FIX] fix DA_cmd::CMD_WriteData() buffer overrun problem.
- * 2. [brom.dll][BUG FIX] remove DA_HANDLE & DL_HANDLE rwlock_writer_sentry for multi-thread download.
- * 3. [brom.dll][BUG FIX] fix download address remap problem for Multi-Bin download on MT6218B series projects.
- * 4. [brom.dll][Enhance] for the unknown bbchip_name just bypass ECO checking, don't stop process.
- * 5. [brom.dll][New] add FAT auto format mechanism, parse the embedded FAT range info from the end of the ROM file.
- * 6. [brom.dll][New] add DA auto selection mechanism, parse the embedded custom_bane info from the end of the DA file.
- * 7. [brom.dll][New] add _ByhCOM interface to let users to control com port handle.
- * 8. [brom.dll][New] add BootROM start command retry mechanism to prevent cable TX/RX cross over.
- * 9. [brom.dll][New] add MT6219_AV, MT6219_BV and MT6218B_FN support.
- * 10. [DA][New] add DA auto selection mechanism, append custom_name at the end of DA.
- * 11. [DA][New] add FAT auto format mechanism, report flash manufacture id and device code to PC side.
- * Resolution for 67: [BootRom v2.3.1001][New] add FAT auto format, DA auto selection mechanism and bug fix.
- *
- * Rev 1.8 Mar 29 2004 13:59:24 mtk00539
- * 1. [brom.dll][New] add baseband chip ECO revision checking flag for FlashDownload.
- * 2. [brom.dll][Enhance] replace port_no with unsigned int instead of COM_PORT_NO enum.
- * 3. [brom.dll][Enhance] add new member p_bbchip_name in FLASHTOOL_ARG to report target baseband chip name.
- * 4. [brom.dll][Enhance] enumerate com port from registry and also check whether if its property is PST_RS232.
- * 5. [brom.dll][Enhance] change com_sentry::Open() procedure to use SetCommConfig() like HyperTerminal.
- * Resolution for 64: [BootRom v2.2.1013][New] add baseband chip ECO revision checking flag for FlashDownload.
- *
- * Rev 1.7 Mar 15 2004 12:00:42 mtk00539
- * fix FTHND_UNKNOWN_BBCHIP_TYPE error code value
- * Resolution for 59: [BootRom v2.2.1011][Enhance] split get firmware version to external imported library.
- *
- * Rev 1.6 Mar 02 2004 00:19:06 mtk00539
- * 1. [brom.dll][Enhance] add resource and jump table consistency detection.
- * 2. [brom.dll][Enhance] read back target's jump table layout and compare before download.
- * 3. [brom.dll][Enhance] automatically load all the resource files.
- * 4. [brom.dll][Enhance] add target bbchip id detection.
- * 5. [brom.dll][Enhance] add ini module.
- * 6. [brom.dll][Enhance] add MT6219 support.
- * Resolution for 53: [BootRom v2.2.1007][Enhance] resource layout error detection.
- *
- * Rev 1.5 Feb 11 2004 17:52:16 mtk00539
- * [Enhance] support selectable download
- * Resolution for 51: [BootRom v2.2.1003][Enhance] selectable download.
- *
- * Rev 1.4 Feb 05 2004 14:13:54 mtk00539
- * supposupport multiple concatanated bin files download.
- * Resolution for 46: [BootRom v2.2.1001][New] support multiple concatanated bin files download.
- *
- * Rev 1.3 Oct 02 2003 00:51:46 mtk00539
- * Fix return code.
- * Resolution for 28: [BootRom v2.1.1001][New] See the reasons below.
- *
- * Rev 1.2 Oct 01 2003 23:34:06 mtk00539
- * Add packet length in DA_WRITE_CMD and DA_READ_CMD.
- * Resolution for 28: [BootRom v2.1.1001][New] See the reasons below.
- *
- * Rev 1.1 Sep 25 2003 13:57:54 mtk00539
- * brom.dll v2.1.1001, please see SCR(28) for more details.
- * Resolution for 28: [BootRom v2.1.1001][New] See the reasons below.
- *
- * Rev 1.0 Jun 30 2003 18:13:58 admin
- * Initial revision.
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- #ifndef _FLASHTOOL_HANDLE_H_
- #define _FLASHTOOL_HANDLE_H_
- #include "mtk_mcu.h"
- #include "mtk_status.h"
- #include "mtk_resource.h"
- #include "DOWNLOAD.H"
- #ifdef __cplusplus
- extern "C" {
- #endif
- //------------------------------------------------------------------------------
- // Boolean
- //------------------------------------------------------------------------------
- typedef enum {
- _FALSE = 0,
- _TRUE = 1
- } _BOOL;
- //------------------------------------------------------------------------------
- // prototype of remote file operation method callback
- //------------------------------------------------------------------------------
- typedef int (__stdcall *CALLBACK_REMOTE_GET_FILE_LEN)(const char *filepath, unsigned int * const p_file_length, void *user_arg);
- typedef int (__stdcall *CALLBACK_REMOTE_READ_FILE)(const char *filepath, unsigned char * const p_file_content, unsigned int file_length, void *user_arg);
- //------------------------------------------------------------------------------
- // prototype of remote file's signature operation method callback
- //------------------------------------------------------------------------------
- typedef int (__stdcall *CALLBACK_REMOTE_GET_SIG_LEN)(const char *filepath, unsigned int * const p_sig_length, void *user_arg);
- typedef int (__stdcall *CALLBACK_REMOTE_READ_SIG)(const char *filepath, unsigned char * const p_sig_content, unsigned int sig_length, void *user_arg);
- //------------------------------------------------------------------------------
- // prototype of customized file integrity check callback
- //------------------------------------------------------------------------------
- typedef int (__stdcall *CALLBACK_FILE_INTEGRITY_CHECK)(unsigned char * const p_file_content, unsigned int * const p_file_length, void *user_arg);
- //------------------------------------------------------------------------------
- // BL_HANDLE: Exported Functions
- //------------------------------------------------------------------------------
- typedef struct {
- _BOOL m_valid; // _TRUE -> dram setting is valid
- unsigned int m_emi_gen_a;
- unsigned int m_emi_gen_b;
- unsigned int m_emi_gen_c;
- unsigned int m_emi_gen_d;
- unsigned int m_emi_con_i;
- unsigned int m_emi_con_i_ext;
- unsigned int m_emi_con_j;
- unsigned int m_emi_con_k;
- unsigned int m_emi_con_l;
- unsigned int m_emi_con_m;
- unsigned int m_emi_con_n;
- } DRAM_SETTING;
- typedef struct {
- char m_version[5];
- char m_filepath[512];
- unsigned int m_filesize;
- unsigned int m_start_addr;
- unsigned int m_chksum_seed;
- unsigned int m_chksum;
- DRAM_SETTING m_dram_cfg;
- _BOOL m_enable; // _FALSE -> disbale
- // _TRUE -> enable
- } BL_INFO;
- //------------------------------------------------------------------------------
- // DL_HANDLE: Exported Functions
- //------------------------------------------------------------------------------
- typedef enum {
- ABSOLUTE_ADDR = 0,
- OFFSET_VALUE
- } REGION_ADDR_TYPE;
- typedef enum {
- NORMAL_ROM = 0x01,
- RESOURCE_BIN = 0x02,
- JUMPTABLE_BIN = 0x03,
- ENFB_BIN = 0x04,
- UA_BIN = 0x05,
- BL_BIN = 0x06,
- //
- UNKNOWN_BIN = 0xFFF
- } ROM_TYPE;
- typedef struct {
- char name[64];
- unsigned int region_addr;
- REGION_ADDR_TYPE addr_type; // ABSOLUTE_ADDR -> region_addr is absolute address
- // OFFSET_VALUE -> region_addr is offset value
- unsigned int begin_addr;
- unsigned int end_addr;
- char filepath[256];
- unsigned int filesize;
- unsigned short index;
- ROM_TYPE rom_type;
- _BOOL enable; // _FALSE -> disbale
- // _TRUE -> enable
- }ROM_INFO;
- typedef struct {
- unsigned int m_is_nfb:1;
- unsigned int m_security_supported:1;
- unsigned int m_cust_para_supported:1;
- unsigned int m_system_drive_on_nand:1;
- unsigned int m_fota_full:1;
- } DL_Config_T;
- typedef struct {
- DL_Config_T m_config;
- } DL_INFO;
- struct DL_HANDLE;
- typedef struct DL_HANDLE * DL_HANDLE_T;
- extern int __stdcall DL_Create(DL_HANDLE_T *p_dl_handle);
- extern int __stdcall DL_Destroy(DL_HANDLE_T *p_dl_handle);
- extern int __stdcall DL_LoadScatter(DL_HANDLE_T dl_handle, const char *scatter_filepath);
- extern int __stdcall DL_SetPacketLength(DL_HANDLE_T dl_handle, unsigned short length);
- extern int __stdcall DL_GetCount(DL_HANDLE_T dl_handle, unsigned short *p_rom_count);
- extern int __stdcall DL_GetInfo(DL_HANDLE_T dl_handle, DL_INFO *p_dl_info);
- extern int __stdcall DL_IsReady(DL_HANDLE_T dl_handle, ROM_INFO *p_rom_info, BL_INFO *p_bl_info, _BOOL check_if_updated);
- extern int __stdcall DL_GetJumpTableInfo(DL_HANDLE_T dl_handle, MTK_JumpTable *p_jmptbl_info);
- extern int __stdcall DL_GetProjectId(DL_HANDLE_T dl_handle, char *buf, unsigned int buf_len);
- extern int __stdcall DL_ResourceProjectIdComparisonSetting(DL_HANDLE_T dl_handle, _BOOL enable);
- extern int __stdcall DL_AutoLoadByScatRegionName(DL_HANDLE_T dl_handle, const char *full_filepath, unsigned char allow_rom_type);
- extern int __stdcall DL_GetBBChipType(DL_HANDLE_T dl_handle, BBCHIP_TYPE *p_bbchip);
- extern int __stdcall DL_GetBBChipName(DL_HANDLE_T dl_handle, char *buf, unsigned int buf_len);
- extern int __stdcall DL_GetCustomName(DL_HANDLE_T dl_handle, char *buf, unsigned int buf_len);
- extern int __stdcall DL_Rom_GetInfo(DL_HANDLE_T dl_handle, unsigned short index, ROM_INFO *p_rom_info);
- extern int __stdcall DL_Rom_GetInfoAll(DL_HANDLE_T dl_handle, ROM_INFO *p_rom_info, unsigned short max_rom_count);
- extern int __stdcall DL_Rom_GetResInfo(DL_HANDLE_T dl_handle, unsigned short index, MTK_Resource *p_res_info);
- extern int __stdcall DL_Rom_Load(DL_HANDLE_T dl_handle, unsigned short index, const char *rom_filepath);
- extern int __stdcall DL_Rom_Unload(DL_HANDLE_T dl_handle, unsigned short index);
- extern int __stdcall DL_Rom_UnloadAll(DL_HANDLE_T dl_handle);
- extern int __stdcall DL_Rom_SetEnableAttr(DL_HANDLE_T dl_handle, unsigned short index, _BOOL attr);
- extern int __stdcall DL_IsNFB(DL_HANDLE_T dl_handle, _BOOL *p_is_nfb);
- extern int __stdcall DL_SetCallback(DL_HANDLE_T dl_handle,
- CALLBACK_REMOTE_GET_FILE_LEN cb_remote_get_file_len,
- void * cb_remote_get_file_len_arg,
- CALLBACK_REMOTE_READ_FILE cb_remote_read_file,
- void * cb_remote_read_file_arg,
- CALLBACK_REMOTE_GET_SIG_LEN cb_remote_get_sig_len,
- void * cb_remote_get_sig_len_arg,
- CALLBACK_REMOTE_READ_SIG cb_remote_read_sig,
- void * cb_remote_read_sig_arg,
- CALLBACK_FILE_INTEGRITY_CHECK cb_file_integrity_check,
- void * cb_file_integrity_check_arg);
- // BL_HANDLE related
- extern int __stdcall DL_BL_IsReady(DL_HANDLE_T dl_handle, BL_INFO *p_bl_info, _BOOL check_if_updated);
- extern int __stdcall DL_BL_Load(DL_HANDLE_T dl_handle, const char *bl_filepath);
- extern int __stdcall DL_BL_GetInfo(DL_HANDLE_T dl_handle, BL_INFO *p_bl_info);
- extern int __stdcall DL_BL_SetEnableAttr(DL_HANDLE_T dl_handle, _BOOL attr);
- //------------------------------------------------------------------------------
- // DL_HANDLE_LIST: Exported Functions
- //------------------------------------------------------------------------------
- struct DL_HANDLE_LIST;
- typedef struct DL_HANDLE_LIST * DL_HANDLE_LIST_T;
- extern int __stdcall DL_CreateList(DL_HANDLE_LIST_T * dl_handle_list);
- extern int __stdcall DL_DestroyList(DL_HANDLE_LIST_T * dl_handle_list);
- extern int __stdcall DL_AddHandleToList(DL_HANDLE_LIST_T dl_handle_list, DL_HANDLE_T dl_handle);
- extern int __stdcall DL_DeleteHandleFromList(DL_HANDLE_LIST_T dl_handle_list, DL_HANDLE_T dl_handle);
- extern int __stdcall DL_GetHandleNumber(DL_HANDLE_LIST_T dl_handle_list, int * HandleNumber);
- extern int __stdcall DL_CheckHandleInList(DL_HANDLE_LIST_T dl_handle_list, DL_HANDLE_T dl_handle);
- extern int __stdcall DL_CheckHandleSameSWVersionInList(DL_HANDLE_LIST_T dl_handle_list, DL_HANDLE_T dl_handle);
- //------------------------------------------------------------------------------
- // DA_HANDLE: Exported Functions
- //------------------------------------------------------------------------------
- typedef struct {
- char filepath[256];
- unsigned int start_addr;
- unsigned char *buf;
- unsigned int buf_len;
- unsigned int main_prog_size;
- char version[13];
- char last_modified_date[256];
- }DA_INFO;
- struct DA_HANDLE;
- typedef struct DA_HANDLE * DA_HANDLE_T;
- extern int __stdcall DA_Create(DA_HANDLE_T *p_da_handle);
- extern int __stdcall DA_Destroy(DA_HANDLE_T *p_da_handle);
- extern int __stdcall DA_IsReady(DA_HANDLE_T da_handle, DA_INFO *p_da_info, _BOOL check_if_updated);
- extern int __stdcall DA_GetInfo(DA_HANDLE_T da_handle, DA_INFO *p_da_info);
- extern int __stdcall DA_SetDefaultStartAddr(DA_HANDLE_T da_handle, unsigned int da_start_addr);
- extern int __stdcall DA_Load(DA_HANDLE_T da_handle, const char *da_filepath, _BOOL bDA_Validation);
- extern int __stdcall DA_Unload(DA_HANDLE_T da_handle);
- extern int __stdcall DA_SetCallback(DL_HANDLE_T dl_handle,
- CALLBACK_REMOTE_GET_FILE_LEN cb_remote_get_file_len,
- void * cb_remote_get_file_len_arg,
- CALLBACK_REMOTE_READ_FILE cb_remote_read_file,
- void * cb_remote_read_file_arg,
- CALLBACK_REMOTE_GET_SIG_LEN cb_remote_get_sig_len,
- void * cb_remote_get_sig_len_arg,
- CALLBACK_REMOTE_READ_SIG cb_remote_read_sig,
- void * cb_remote_read_sig_arg,
- CALLBACK_FILE_INTEGRITY_CHECK cb_file_integrity_check,
- void * cb_file_integrity_check_arg);
- //------------------------------------------------------------------------------
- // RB_HANDLE: Exported Functions
- //------------------------------------------------------------------------------
- typedef struct {
- char filepath[256];
- unsigned int readback_addr;
- unsigned int readback_len;
- _BOOL enable; // _FALSE -> disbale
- // _TRUE -> enable
- unsigned short index;
- NUTL_ReadFlag_E m_read_flag;
- }RB_INFO;
- struct RB_HANDLE;
- typedef struct RB_HANDLE * RB_HANDLE_T;
- extern int __stdcall RB_Create(RB_HANDLE_T *p_rb_handle);
- extern int __stdcall RB_Destroy(RB_HANDLE_T *p_rb_handle);
- extern int __stdcall RB_SetPacketLength(RB_HANDLE_T rb_handle, unsigned short length);
- extern int __stdcall RB_GetCount(RB_HANDLE_T rb_handle, unsigned short *p_rb_count);
- extern int __stdcall RB_IsReady(RB_HANDLE_T rb_handle, RB_INFO *p_rb_info);
- extern int __stdcall RB_GetInfo(RB_HANDLE_T rb_handle, unsigned short index, RB_INFO *p_rb_info);
- extern int __stdcall RB_GetInfoAll(RB_HANDLE_T rb_handle, RB_INFO *p_rb_info, unsigned short max_rb_count);
- extern int __stdcall RB_Append(RB_HANDLE_T rb_handle, const char *rb_filepath, unsigned int rb_addr, unsigned int rb_len);
- extern int __stdcall RB_Append_ReadToBuf(RB_HANDLE_T rb_handle, unsigned int rb_addr, unsigned int rb_len, char *buf, unsigned int buf_len);
- extern int __stdcall RB_Delete(RB_HANDLE_T rb_handle, unsigned short index);
- extern int __stdcall RB_SetFilepath(RB_HANDLE_T rb_handle, unsigned short index, const char *rb_filepath);
- extern int __stdcall RB_SetReadbackFlag(RB_HANDLE_T rb_handle, unsigned short index, NUTL_ReadFlag_E flag);
- extern int __stdcall RB_SetReadbackAddr(RB_HANDLE_T rb_handle, unsigned short index, unsigned int rb_addr);
- extern int __stdcall RB_SetReadbackLength(RB_HANDLE_T rb_handle, unsigned short index, unsigned int rb_len);
- extern int __stdcall RB_ClearAll(RB_HANDLE_T rb_handle);
- extern int __stdcall RB_SetEnableAttr(RB_HANDLE_T rb_handle, unsigned short index, _BOOL attr);
- extern int __stdcall RB_EnableReadbackFAT(RB_HANDLE_T rb_handle, unsigned short index, _BOOL attr);
- //------------------------------------------------------------------------------
- // AUTH_HANDLE: Exported Functions
- //------------------------------------------------------------------------------
- typedef struct {
- unsigned int m_version;
- char m_filepath[512];
- unsigned char m_secure_custom_name[32];
- unsigned char m_description[512];
- } AUTH_INFO;
- struct AUTH_HANDLE;
- typedef struct AUTH_HANDLE * AUTH_HANDLE_T;
- extern int __stdcall AUTH_Create(AUTH_HANDLE_T *p_auth_handle);
- extern int __stdcall AUTH_Destroy(AUTH_HANDLE_T *p_auth_handle);
- extern int __stdcall AUTH_IsReady(AUTH_HANDLE_T auth_handle, AUTH_INFO *p_auth_info, _BOOL bCheckIfUpdated);
- extern int __stdcall AUTH_GetInfo(AUTH_HANDLE_T auth_handle, AUTH_INFO *p_auth_info);
- extern int __stdcall AUTH_Load(AUTH_HANDLE_T auth_handle, const char *auth_filepath);
- extern int __stdcall AUTH_Unload(AUTH_HANDLE_T auth_handle);
- extern int __stdcall AUTH_SetCallback(AUTH_HANDLE_T auth_handle,
- CALLBACK_REMOTE_GET_FILE_LEN cb_remote_get_file_len,
- void * cb_remote_get_file_len_arg,
- CALLBACK_REMOTE_READ_FILE cb_remote_read_file,
- void * cb_remote_read_file_arg,
- CALLBACK_REMOTE_GET_SIG_LEN cb_remote_get_sig_len,
- void * cb_remote_get_sig_len_arg,
- CALLBACK_REMOTE_READ_SIG cb_remote_read_sig,
- void * cb_remote_read_sig_arg,
- CALLBACK_FILE_INTEGRITY_CHECK cb_file_integrity_check,
- void * cb_file_integrity_check_arg);
- #ifdef __cplusplus
- }
- #endif
- #endif