diff options
Diffstat (limited to 'source/LCM/include')
-rw-r--r-- | source/LCM/include/c_compiler.h | 127 | ||||
-rw-r--r-- | source/LCM/include/c_system.h | 34 | ||||
-rw-r--r-- | source/LCM/include/error_codes.h | 740 | ||||
-rwxr-xr-x | source/LCM/include/t_a2_protocol.h | 48 | ||||
-rw-r--r-- | source/LCM/include/t_basicdefinitions.h | 286 | ||||
-rw-r--r-- | source/LCM/include/t_bulk_protocol.h | 155 | ||||
-rw-r--r-- | source/LCM/include/t_command_protocol.h | 73 | ||||
-rw-r--r-- | source/LCM/include/t_communication_service.h | 344 | ||||
-rw-r--r-- | source/LCM/include/t_protrom_header.h | 63 | ||||
-rw-r--r-- | source/LCM/include/t_protrom_network.h | 98 | ||||
-rw-r--r-- | source/LCM/include/t_protrom_transport.h | 44 | ||||
-rw-r--r-- | source/LCM/include/t_queue.h | 45 | ||||
-rw-r--r-- | source/LCM/include/t_r15_header.h | 102 | ||||
-rw-r--r-- | source/LCM/include/t_r15_network_layer.h | 309 | ||||
-rw-r--r-- | source/LCM/include/t_security_algorithms.h | 44 | ||||
-rw-r--r-- | source/LCM/include/t_time_utilities.h | 43 |
16 files changed, 2555 insertions, 0 deletions
diff --git a/source/LCM/include/c_compiler.h b/source/LCM/include/c_compiler.h new file mode 100644 index 0000000..77cd673 --- /dev/null +++ b/source/LCM/include/c_compiler.h @@ -0,0 +1,127 @@ +/****************************************************************************** +* +* Copyright (C) ST-Ericsson SA 2011 +* License terms: 3-clause BSD license +* +******************************************************************************/ + +#ifndef _C_COMPILER_H +#define _C_COMPILER_H + +/************************************************************************* +* +* HEADER SPECIFICATION +* +* $Workfile: c_compiler.h $ +* +************************************************************************** +* +* DESCRIPTION: +* +* This file contains macros that determines current compiler +* +* +************************************************************************** +* +* REVISION HISTORY: +* +* $Log: \KIRND_FuncBlocks_Utilities_003\cnh1606432\dependencies\Utils\c_compiler.h $ + * + * Version: ...\cnh1606432\cnh1606432_r1\7 18 Nov 2009 10:18 (GMT) qsjomik + * Overwrite merge. + * Compiled with _INTERCEPTCALLBACKS pre-compiler directive. + * Stability, Multi-Dut and storing BufferVector updates. + * Updated for LCM R1B. + * R1A027. + * + * Version: ...\cnh160692_r1a_dev\3 12 Mar 2002 14:21 (GMT) QCSSTZI + * rename p_compiler to c_compiler. + * + * Version: ...\cnh160692_r1a_dev\2 10 Jan 2002 12:35 (GMT) QCSSTZI + * Updated to reflect R4A013 on the old module (cnh1010024) + * + * Version: ...\cnh1010024_r4a_dev\1 11 Sep 2001 07:34 (GMT) QCSPAAB + * Merge to Valentina (R4) + * + * Version: ...\cnh1010024\1 14 Nov 2000 15:30 (GMT) ECSJENE + * Merge to start new dev-branch for the Mia project. + * + * Version: ...\cnh1010024_r2a_dev\4 05 Oct 2000 06:25 (GMT) ECSSTMA + * Macro to remove non_banked directive. + * + * Version: ...\cnh1010024_r2a_dev\3 19 Sep 2000 12:38 (GMT) QCSLAIS + * Compiler warnings work around. + * + * Version: ...\cnh1010024_r2a_dev\2 22 May 2000 08:25 (GMT) ECSSTMA + * Accept LINT as being one among the compilers. + * + * Version: ...\cnh1010024_r2a_dev\1 16 May 2000 12:19 (GMT) QCSLAIS + * Created file compiler.h which determines current compiler and target +* +**************************************************************************/ + +#if defined(__IAR_SYSTEMS_ICC) || defined(__IAR_SYSTEMS_ICC__) +/* COMPILER IS FROM IAR */ +#if ((__TID__ >> 8) & 0x7f) == 23 +/* TARGET IS Z80 */ +#define COMPILER_IAR_Z80 +#elif ((__TID__ >> 8) & 0x7f) == 90 +/* TARGET IS AVR */ +#define COMPILER_IAR_AVR /* Preferred */ +#define COMPILER_AVR +#define AT90S +#elif ((__TID__ >> 8) & 0x7f) == 0x4f +/* TARGET IS ARM */ +#define COMPILER_IAR_ARM /* Preferred */ +#define COMPILER_ARM +#define ARM +#else +#error Unknown IAR compiler +#endif +#elif defined(_WIN32) +/* TARGET IS Win32 */ +#define COMPILER_MSDEV +#define __arm +#define __pcs +#define __no_init +#elif defined(__arm) +/* TARGET IS ARM */ +#define COMPILER_ARM_ARM /* Preferred */ +#define COMPILER_ARM +#define ARM +#elif defined(__IAR_SYSTEMS_ASM__) +#elif defined(_lint) +#elif defined(__GNUC__) +#define COMPILER_GNUC +#else +#error Unknown compiler +#endif + +/* + * Some compiler bug work arounds. + */ + +/* + * Avoid ARM compiler error when comparing NULL with a pointer + * by defining NULL as NULL pointer. + */ +#if defined(COMPILER_ARM_ARM) && !defined(NULL) +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +/* + * Some modules still use the unused banked prefix. + */ +#ifndef banked +#define banked +#endif + +#ifndef non_banked +#define non_banked +#endif + +#endif // _C_COMPILER_H diff --git a/source/LCM/include/c_system.h b/source/LCM/include/c_system.h new file mode 100644 index 0000000..0b058ec --- /dev/null +++ b/source/LCM/include/c_system.h @@ -0,0 +1,34 @@ +#ifndef INCLUSION_GUARD_C_SYSTEM_H +#define INCLUSION_GUARD_C_SYSTEM_H + +/************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license +************************************************************************** +* +* DESCRIPTION: +* +* System configuration include file. This file must be the first +* file included by every source (*.c) file in the system +* +*************************************************************************/ + +/************************************************************************* +* Includes +*************************************************************************/ + +#include "c_compiler.h" + +//#include "product.h" + +/************************************************************************* +* Types, constants and external variables +*************************************************************************/ + + + +#endif // INCLUSION_GUARD_C_SYSTEM_H + + + + diff --git a/source/LCM/include/error_codes.h b/source/LCM/include/error_codes.h new file mode 100644 index 0000000..e71d4b4 --- /dev/null +++ b/source/LCM/include/error_codes.h @@ -0,0 +1,740 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +/* NOTE: This is an automatically generated file. DO NOT EDIT! */ + +#ifndef _ERRORCODE_H +#define _ERRORCODE_H + + +/** + * @addtogroup ldr_LCM + * Error codes for internal loader commands. + * @{ + */ + +/************************************************************************* +* Includes +*************************************************************************/ +#include "t_basicdefinitions.h" + +#define A2_ERROR_CODES_OFFSET 5000 +/** + * Internal loader command error codes. Possible range 0x0000 - 0x0FFE (4094). + */ + + +/** + * Table for Error groups range + * + * General Fatal 0-50 + * General non-fatal 51-99 + * + * IO Fatal 100-150 + * IO non-fatal 151-199 + * + * Communication Fatal 200-250 + * Communication non-fatal 251-299 + * + * Signature Fatal 300-350 + * Signature non-fatal 351-399 + * + * Authentication Fatal 400-450 + * Authentication non-fatal 451-499 + * + * COPS General Fatal 500-550 + * COPS General non-fatal 551-599 + * + * System Fatal 600-650 + * System non-fatal 651-699 + * + * Flash Fatal 700-750 + * Flash non-fatal 751-799 + * + * Parameters Fatal 800-850 + * Parameters non-fatal 851-899 + * + * File management Fatal 900-950 + * File management non-fatal 951-999 + * + * Command Auditing and execution Fatal 1000-1050 + * Command Auditing and execution non-fatal 1051-1099 + * + * Emulation Fatal 1100-1150 + * Emulation non-fatal 1151-1199 + * + * Timers Fatal 1200-1250 + * Timers non-fatal 1251-1299 + * + * CABS Fatal 1300-1350 + * CABS non-fatal 1351-1399 + * + * GDFS Fatal 1400-1450 + * GDFS non-fatal 1451-1499 + * + * Antirollback Fatal 1500-1550 + * Antirollback non-fatal 1551-1599 + * + * Memory and Boot Fatal 1600-1650 + * Memory and Boot non-fatal 1651-1699 + * + * @todo this should be removed and error codes should be remaped. + * The same applies to Emulator errors. + * + * Job Handler Fatal 1700-1750 + * Job Handler non-fatal 1751-1799 + * + * Emulator Fatal 1800-1850 + * Emulator non-fatal 1851-1899 + * + * Loader utilities Fatal 1900-1950 + * Loader utilities non-fatal 1951-1999 + */ + + +typedef enum { + E_SUCCESS = 0, /**< Operation successful. */ + E_GENERAL_FATAL_ERROR = 1, /**< General Failure. */ + E_ALLOCATE_FAILED = 2, /**< Failed to allocate memory. */ + E_INVALID_INPUT_PARAMETERS = 51, /**< The expected value into the function was incorrect. */ + E_INVALID_CURRDATE_STRING_LENGTH = 52, /**< Indicate that the currdate string array variable has invalid length. */ + E_UNALIGNED_DATA = 53, /**< Indicate that a variable is not aligned. */ + E_VECTOR_CREATE_FAIL = 100, /**< Failed to create vector in IO Layer. */ + E_VECTOR_DESTROY_FAIL = 101, /**< Failed to destroy vector in IO Layer. */ + E_GENERAL_IO_ERROR = 151, /**< Unknown IO error. */ + E_IO_FAILED_TO_READ = 152, /**< IO failed to read from source. */ + E_IO_FAILED_TO_WRITE = 153, /**< IO failed to write to destination. */ + E_IO_FAILED_TO_CLOSE = 154, /**< IO failed to close media. */ + E_IO_FAILED_TO_OPEN = 155, /**< IO failed to open media. */ + E_IO_FAILED_TO_GET_LENGTH = 156, /**< IO failed to get length of media. */ + E_GENERAL_COMMUNICATION_ERROR = 200, /**< General communication error. */ + E_FAILED_TO_START_BULK_SESSION = 201, /**< Failed to start bulk session. */ + E_FAILED_TO_CLOSE_BULK_SESSION = 202, /**< Failed to initialize the transport layer. */ + E_FAILED_TO_FIND_CHUNK_DATA_BLOCK = 203, /**< Failed to find chunk data block. */ + E_FAILED_TO_INIT_COM_DEVICE = 204, /**< Failed to reinitialize communication device. */ + E_FAILED_TO_USE_COM_DEVICE = 205, /**< Failed to use communication device. */ + E_FAILED_TO_ALLOCATE_COMM_BUFFER = 206, /**< Failed to allocate communication buffer. */ + E_FAILED_TO_FLUSH_RXFIFO = 207, /**< Failed to flush RX FIFO. */ + E_RETRANSMITION_FAILED = 208, /**< Retransmission failed. After MAX_RESENDS attempt, failed to send packet. */ + E_COMMAND_NO_ERROR = 209, /**< */ + E_FAILED_TO_RELEASE_COMM_BUFFER = 210, /**< Failed to release communication buffer. */ + E_FAILED_TO_INTIALIZE_TIMER_FUNCTIONS = 211, /**< Failed to initialize timer functions. */ + E_FAILED_TO_INTIALIZE_QUEUE_FUNCTIONS = 212, /**< Failed to initialize queue functions. */ + E_INVALID_BULK_MODE = 251, /**< Invalid bulk mode. */ + E_FAILED_TO_FIND_COMM_BUFFER = 252, /**< Failed to find communication buffer. */ + E_INVALID_TYPE_OF_BUFFER = 253, /**< Invalid type of buffer. */ + E_COM_DEVICE_BUSY = 254, /**< */ + E_NOT_FOUND_ELEMENT_IN_RETRANSMISSION_LIST = 255, /**< The element in retransmission list is not found. */ + E_FAILED_READING_FROM_BULK = 256, /**< Failed to read from bulk. */ + E_FAILED_WRITING_TO_BULK = 257, /**< Failed to write to bulk. */ + E_FAILED_TO_GET_UART_DESCRIPTOR = 258, /**< Failed to get UART descriptor. */ + E_FAILED_TO_GET_USB_DESCRIPTOR = 259, /**< Failed to get USB descriptor. */ + E_INVALID_BULK_SESSION_ID = 260, /**< Invalid bulk session ID is used. */ + E_PREVIOUS_BULK_SESSION_IS_NOT_CLOSED = 261, /**< Previous bulk session not closed. */ + E_INVALID_BULK_PROTOCOL_STATE = 262, /**< Invalid bulk protocol state. */ + E_UNKNWON_PROPERTY = 351, /**< Unknown property id. */ + E_CYCLIC_GRAPH = 451, /**< Cyclic graph in services detected. */ + E_SERVICE_NOT_SUPPORTED = 452, /**< The service is not supported. */ + E_INCONSISTENCY_IN_SERVICES = 453, /**< Inconsistency in services is detected. */ + E_SERVICE_IN_USE = 454, /**< The service is in use and can't be stopped. */ + E_UNREGISTER_BDM_SERVICE_FAILED = 455, /**< Unregistering of Block Device Manager Service failed. */ + E_UNREGISTER_BAM_SERVICE_FAILED = 456, /**< Unregistering of Boot Area Manager Service failed. */ + E_UNREGISTER_COPS_SERVICE_FAILED = 457, /**< Unregistering of COPS Data Manager Service failed. */ + E_UNREGISTER_FS_SERVICE_FAILED = 458, /**< Unregistering of File System Manager Service failed. */ + E_UNREGISTER_FPD_SERVICE_FAILED = 459, /**< Unregistering of Flash Physical Driver Service failed. */ + E_UNREGISTER_GD_SERVICE_FAILED = 460, /**< Unregistering of Global Data Manager Service failed. */ + E_GENERAL_ZIP_ERROR = 551, /**< */ + E_ZIP_FAILED_TO_CREATE_CONTEXT = 552, /**< */ + E_ZIP_FAILED_TO_OPEN_FILE = 553, /**< */ + E_FILESYS_APP_INIT_FAILURE = 600, /**< */ + E_NO_FILESYSTEM_PROPERTY = 601, /**< */ + E_UNDEFINED_AUTHENTICATION_TYPE = 602, /**< */ + E_RTC_TIME_NOT_ACCURATE = 651, /**< */ + E_RTC_INTIALIZATION_FAILED = 652, /**< */ + E_DIFFERENT_FLASHLAYOUT = 751, /**< Different flashlayout. */ + E_EMPTY_FILE_IN_ARCHIVE = 752, /**< Archive contain empty file. */ + E_UNKNOWN_COMM_DEVICE = 753, /**< Unknown communication device was detected. */ + E_FLASH_APP_INTERNAL_ERROR = 754, /**< Internal during execution of flash commands. */ + E_DEVICE_NAME_TOO_LONG = 755, /**< Device name is too long. */ + E_FLASH_ARCHIVE_MISMATCH = 756, /**< Mismatch between archieve that is flashed and previosly flashed one. */ + E_UNSUPPORTED_FLASH_TYPE = 757, /**< Flash memory device type is not supported. */ + E_FPD_NOT_CONFIGURED = 758, /**< Flash physical driver is not configured. */ + E_INVALID_SIZE_IN_MEMCONF = 759, /**< MEMCONF boot record contain invalid TotalSize field. */ + E_ARCHIVE_TO_LARGE = 760, /**< Flash archive larger than available space in BDM. */ + E_PATH_NOT_EXISTS = 951, /**< Path not exist. */ + E_CLOSE_FILE = 952, /**< Failed to close a file in the file system. */ + E_INSUFFICENT_SPACE = 953, /**< Not enough memory space for desired operation. */ + E_REMOVE_FILE = 954, /**< Failed to remove a file from the file system. */ + E_RENAME_FILE = 955, /**< Failed to rename a file from the file system. */ + E_CREATE_DIR = 956, /**< Failed to create a new directory in the file system. */ + E_REMOVE_DIRECTORY = 957, /**< Failed to remove directory. */ + E_FREE_SPACE = 958, /**< No free space left. */ + E_ITEM_STAT = 959, /**< Failed to retrieve status data. */ + E_CLOSE_DIRECTORY = 960, /**< Failed to close a directory in the file system. */ + E_MOUNT_VOLUME = 961, /**< Failed to mount volume in the file system. */ + E_READ_DIRECTORY = 962, /**< Failed to read directory in the file system. */ + E_FS_IO = 963, /**< Input/output error. */ + E_FS_ARGUMENT_LIST_2BIG = 964, /**< Argument list too long. */ + E_FS_BAD_FILE_DESC = 965, /**< Bad file descriptor. */ + E_FS_ACCESS = 966, /**< Permission denied. */ + E_FS_BAD_ADDRESS = 967, /**< Bad address. */ + E_FS_FILE_EXIST = 968, /**< File exists. */ + E_FS_NOT_DIR = 969, /**< Not a directory. */ + E_FS_IS_DIR = 970, /**< Is a directory. */ + E_FS_FILE_TOO_LARGE = 971, /**< File too large. */ + E_FS_READ_ONLY_FS = 972, /**< Read-only file system. */ + E_FS_OPER_NOT_SUPP = 973, /**< Operation not supported. */ + E_FS_NAME_TOO_LONG = 974, /**< File name too long. */ + E_FS_OPERATION_CANCELED = 975, /**< Operation canceled. */ + E_FS_FAIL = 976, /**< Cannot start operation. */ + E_FS_INTERNAL = 977, /**< Internal error. */ + E_FS_NOT_MOUNTED = 978, /**< Volume not mounted. */ + E_FS_NOT_PERMITED = 979, /**< Operation not permitted. */ + E_FS_NO_SUCH_FILE_OR_DIR = 980, /**< No such file or directory. */ + E_FS_NOT_EXIST = 981, /**< Specified FS does not exist. */ + E_FS_UNKNOWN_ERROR = 982, /**< Error is unknown. */ + E_FAILED_WRITING_TO_FILE = 983, /**< Failed to write to file. */ + E_FAILED_READING_FROM_FILE = 984, /**< Failed to read from the specified file. */ + E_ACCESS_DENIED = 985, /**< The access permission attributes do not allow operation. */ + E_CANNOT_OPEN_FILE = 986, /**< Can not open the specified file. */ + E_FAILED_TO_STOP_FS = 987, /**< Can not stop file system. */ + E_FILE_NAME_TOO_LONG = 988, /**< File name is too long. */ + E_FAILED_TO_FIND_ELF_SECTION = 989, /**< Can not find elf section. */ + E_MAX_NUMBER_OF_MOUNTED_VOLUMES_EXCEEDED = 990, /**< Unable to mount volume due to exceeding the maximum number of allowed volumes. */ + E_NO_MOUNTED_DEVICES_ARE_FOUND = 991, /**< Information message that no mounted devices are found. */ + E_NOT_FREE_CMD_SPACE = 1000, /**< Index for new command is not founded in execution queue. */ + E_INVALID_INPUT_PARAMETER = 1001, /**< Invalid input parameter */ + E_UNSUPPORTED_CMD = 1002, /**< The loader does not support the requested command. */ + E_UNSUPPORTED_GROUP = 1003, /**< The loader does not support the requested group. */ + E_INVALID_COMMAND_SIZE = 1051, /**< */ + E_OVERLOAD_COMMAND_TABLE = 1052, /**< */ + E_COMMAND_ALREADY_REGISTERED = 1053, /**< */ + E_AUDITING_FAILED = 1054, /**< Command auditing failed. */ + E_NONEXIST_TIMER = 1251, /**< */ + E_FAILED_TO_SET_TIMER = 1252, /**< */ + E_TIMER_INIT_FAILED = 1253, /**< */ + E_TIMER_IRQ_CONF_FAILED = 1254, /**< */ + E_GD_INVALID_UNIT_SIZE = 1351, /**< GD/GDFS: Error in specifying unit size. */ + E_GD_LL_ILLEGAL_SIZE = 1352, /**< GD/GDFS: Size too large for the block. */ + E_GD_LL_WRITE_FAILED = 1353, /**< GD/GDFS: Write failed on FLASH device level. */ + E_GD_LL_ERASE_FAILED = 1354, /**< GD/GDFS: Erase failed on FLASH device level. */ + E_GD_LL_UNKNOWN_DEVICE = 1355, /**< GD/GDFS: FLASH device unknown. */ + E_GD_STARTUP_LOG_BLK_MISSING = 1356, /**< GD/GDFS: Logical block not found during start-up scan. */ + E_GD_STARTUP_DUPLICATE_LOG_BLK = 1357, /**< GD/GDFS: Duplicate instances of same logical block. */ + E_GD_ERASE_ILLEGAL_BLK_NR = 1358, /**< GD/GDFS: Attempt to erase non-existing physical block. */ + E_GD_FG_UNIT_NOT_FOUND = 1359, /**< GD/GDFS: Requested unit not found, probably never written or has been deleted. */ + E_GD_FG_UNIT_SIZE_MISMATCH = 1360, /**< GD/GDFS: Attempt to access a unit outside its beyond its end. */ + E_GD_FG_ILLEGAL_LOG_BLK_NR = 1361, /**< GD/GDFS: Attempt to access a logical block that does not exist. (Hardware, fatal). */ + E_GD_FG_ILLEGAL_PHYS_BLK_NR = 1362, /**< GD/GDFS: Attempt to access a physical block that does not exist (internal error). */ + E_GD_FG_BLK_FULL = 1363, /**< GD/GDFS: Attempted to write more data to a block than could be fitted into one FLASH block. */ + E_GD_FG_NO_BLK_FREE = 1364, /**< GD/GDFS: Internal error (no free blocks are available). */ + E_GD_FG_UNIT_CHECKSUM = 1365, /**< GD/GDFS: The checksum or a unit being read is wrong. */ + E_GD_FG_NOT_DIRECT_BLOCK = 1366, /**< GD/GDFS: Block is not direct. */ + E_GD_FG_NOT_FREE_BLOCK = 1367, /**< GD/GDFS: For some reason, a free block could not be properly erased. */ + E_GD_FG_ILLEGAL_SIZE = 1368, /**< GD/GDFS: The size of a unit being written exceeds the maximum limit of a unit. */ + E_GD_E_FG_FREE_AREA_DIRTY = 1369, /**< GD/GDFS: The startup check found non-FF bytes in unused range within a block. */ + E_GD_FG_SYNC_FAILED = 1370, /**< GD/GDFS: Failed to synchronize. */ + E_GD_NOT_OPEN = 1371, /**< GD/GDFS: Tried to access data although GD was in closed state. */ + E_GD_NOT_ALLOWED = 1372, /**< GD/GDFS: Operation not allowed in the current mode. */ + E_GD_ALREADY_OPEN = 1373, /**< GD/GDFS: Tried to open or format when GD was already opened. */ + E_GD_FRONKENSTIENS_PATTERN_MISMATCH = 1374, /**< GD/GDFS: The id mark of the GDVAR file does not match the data in the flash. Fatal and makes GD read only. */ + E_GD_ILLEGAL_ALIGNMENT = 1375, /**< GD/GDFS: Tried to erase at an address that was not aligned to a flash block boundary. Internal error. */ + E_GD_ILLEGAL_SIZE = 1376, /**< GD/GDFS: The operation may not be performed with the specified size. Tried to write a to large unit. */ + E_GD_ACCESS_DENIED = 1377, /**< GD/GDFS: Operation not allowed. Flash device protected. Possible wrong flash driver configuration. */ + E_GD_ILLEGAL_INDEX = 1378, /**< GD/GDFS: Illegal GD index. */ + E_GD_MEMORY_ALLOCATION_FAILED = 1379, /**< GD/GDFS: Fatal. Failed to allocate dynamic memory. */ + E_GD_MISSING_CONFIG = 1380, /**< GD/GDFS: Missing configuration parameter. */ + E_GD_ILLEGAL_CONFIG = 1381, /**< GD/GDFS: Illegal configuration. */ + E_GD_TRANSACTION_LOG_CORRUPT = 1382, /**< GD/GDFS: The transaction log used for tracking updates to GD contents is corrupt and prevents roll-back from working properly. */ + E_GD_NO_DATA_TO_READ = 1399, /**< GD: No data to read. */ + E_BDM_W_NO_MORE_GC_POSSIBLE = 1451, /**< BDM: No more garbage collection is possible. */ + E_BDM_UNIT_STARTED = 1452, /**< BDM: Unit has already been started. */ + E_BDM_UNIT_NOT_STARTED = 1453, /**< BDM: Unit has not yet been started. */ + E_BDM_NOT_CONFIGURED = 1454, /**< BDM: Has not been configured yet. */ + E_BDM_STARTUP_FAILED = 1455, /**< BDM: Startup failed. */ + E_BDM_SHUTDOWN_FAILED = 1456, /**< BDM: Shutdown failed. */ + E_BDM_WRITE_FAILED = 1457, /**< BDM: An error occurred while writing. */ + E_BDM_READ_FAILED = 1458, /**< BDM: An error occurred while reading */ + E_BDM_ERASE_FAILED = 1459, /**< BDM: An error occurred while erasing. */ + E_BDM_JUNK_FAILED = 1460, /**< BDM: An error occurred while junking. */ + E_BDM_GC_FAILED = 1461, /**< BDM: An error occurred while garbage collecting. */ + E_BDM_GET_INFO_FAILED = 1462, /**< BDM: An error occurred while retrieving info about a BDM unit. */ + E_BDM_WRITE_NOT_SUPPORTED = 1463, /**< BDM: Write not supported. */ + E_BDM_JUNK_NOT_SUPPORTED = 1464, /**< BDM: Junk not supported. */ + E_BDM_GC_NOT_SUPPORTED = 1465, /**< BDM: Garbage collection not supported. */ + E_BDM_SYNC_FAILED = 1466, /**< BDM: Synchronize failed. */ + E_BDM_NOT_SUPPORTED = 1467, /**< BDM: Function not supported. */ + E_BDM_PAUSED = 1468, /**< BDM: Paused. */ + E_BDM_NOT_PAUSED = 1469, /**< BDM: Not paused. */ + E_BDM_FINDING_BAM_BLOCKS = 1470, /**< BDM: BAM blocks not found. */ + E_BDM_BAD_PARAM = 1471, /**< BDM: Argument invalid or out of range. */ + E_BDM_FORMAT_FAILED = 1472, /**< BDM: Formatting failed. */ + E_BDM_INVALID_UNIT = 1473, /**< BDM: The unit number is out of range. */ + E_BDM_INVALID_CONFIG = 1474, /**< BDM: Some part of the configuration is invalid. */ + E_BDM_PRE_FLASH_FINISHED = 1475, /**< BDM: No more preflash blocks can be fetched. */ + E_BDM_PRE_FLASH_TERMINATE_FAILED = 1476, /**< BDM: Termination of preflash failed. */ + E_BDM_OUT_OF_MEM = 1477, /**< BDM: Could not allocate enough memory. */ + E_BDM_XSR_CRITICAL_ERROR = 1481, /**< BDM XSR: Critical error. */ + E_BDM_XSR_INVALID_PARAMS = 1482, /**< BDM XSR: Invalid parameters. */ + E_BDM_XSR_PARTITION_NOT_OPENED = 1483, /**< BDM XSR: Could not open partition. */ + E_BDM_XSR_UNFORMATTED_FLASH = 1484, /**< BDM XSR: Unformatted flash. */ + E_BDM_XSR_ALLOCATION_ERROR = 1485, /**< BDM XSR: Failed to allocate. */ + E_BDM_XSR_INVALID_PARTITION = 1486, /**< BDM XSR: Invalid partition. */ + E_BDM_XSR_READ_ERROR = 1487, /**< BDM XSR: An error occurred while reading. */ + E_BDM_XSR_WRITE_ERROR = 1488, /**< BDM XSR: An error occurred while writing. */ + E_BDM_XSR_ERASE_ERROR = 1489, /**< BDM XSR: An error occurred while erasing. */ + E_BDM_XSR_DEVICE_ERROR = 1490, /**< BDM XSR: Device error. */ + E_BDM_XSR_GOODBLOCK = 1491, /**< BDM XSR: Good block. */ + E_BDM_XSR_BADBLOCK = 1492, /**< BDM XSR: Bad block. */ + E_BAM_NOT_CONFIGURED = 1551, /**< BAM: Is not configured. */ + E_BAM_ERR_UNSUPPORTED_PAGE_SIZE = 1552, /**< BAM: Unsupported page size. */ + E_BAM_ERR_ERASING_BLOCK = 1553, /**< BAM: Erase block could not be properly erased. */ + E_BAM_ERR_OUT_OF_MEMORY = 1554, /**< BAM: Not enough free memory to serve request. */ + E_BAM_ERR_CHECKING_BADNESS = 1555, /**< BAM: There was a problem checking if a block was bad or not. */ + E_BAM_ERR_FINDING_BLOCK = 1556, /**< BAM: Reserved block could not be found. */ + E_BAM_ERR_READING_PAGE = 1557, /**< BAM: An error occurred while reading a page in a block. */ + E_BAM_ERR_MARKING_BLOCK_BAD = 1558, /**< BAM: A block went bad and BAM could not mark it as bad properly. */ + E_BAM_ERR_READING_OUTSIDE_BLOCK = 1559, /**< BAM: Read would result in a read beyond end of reserved block. */ + E_BAM_ERR_UNCORRECTABLE_ERROR = 1560, /**< BAM: An uncorrectable read error occurred while reading block. */ + E_BAM_ERR_WRITING_PAGE = 1561, /**< BAM: An error occurred while writing a page to a reserved block. */ + E_BAM_ERR_WRITING_BLOCK = 1562, /**< BAM: An error occurred while writing to a reserved block. */ + E_BAM_ERR_RESCUING_BLOCK = 1563, /**< BAM: There was a problem rescuing a block that went bad during the request. */ + E_BAM_ERR_CONFIG_MISSING = 1564, /**< BAM: No configuration was given. */ + E_BAM_ERR_ALREADY_STARTED = 1565, /**< BAM: Has already been started. */ + E_BAM_ERR_NOT_STARTED = 1566, /**< BAM: Has not been started yet. */ + E_BAM_ERR_UNSUPPORTED_OPERATION = 1567, /**< BAM: Requested operation is not supported. */ + E_BAM_ERR_CORRUPT_STATE = 1568, /**< BAM: Internal state has been corrupted. */ + E_BAM_ERR_UNSUPPORTED_MEDIA = 1569, /**< BAM: The configured media type is not supported. */ + E_BAM_ERR_UNSUPPORTED_REDUNDANT_AREA_SIZE = 1570, /**< BAM: Unsupported redundant area size. */ + E_BAM_ERR_READING_BLOCK = 1571, /**< BAM: Reading block failed. */ + E_BAM_ERR_SHUTTING_DOWN = 1572, /**< BAM: Shutting down failed. */ + E_BAM_ERR_UNINITIALIZING = 1573, /**< BAM: An error occurred with uninitializing. */ + E_BAM_ERR_INVALID_OFFSET = 1574, /**< BAM: Invalid offset. */ + E_BAM_ERR_INVALID_SIZE = 1575, /**< BAM: Invalid size. */ + E_BAM_ERR_RETRIEVING_INFO = 1576, /**< BAM: Retrieving info failed. */ + E_BAM_ERR_INVALID_CONFIG = 1577, /**< BAM: Invalid configuration. */ + E_BAM_ERR_ERASING_ALL_BLOCKS = 1578, /**< BAM: An error occurred while erasing all blocks. */ + E_BAM_ERR_BLOCK_MARKED_BAD = 1579, /**< BAM: Block was marked as bad while doing an operation. */ + E_BAM_ERR_VALIDATING_START_BLOCK = 1580, /**< BAM: Can not assure that start block configuration refers to a block boundary. */ + E_BAM_ERR_FAILED_TO_GET_MEMORYTECHNOLOGY = 1581, /**< BAM: Unable the query FAM about the memory technology used in the memory we are trying to initialize BAM on. */ + E_BAM_ERR_BLOCK_RESCUED = 1582, /**< BAM: Block rescue failed. */ + E_BAM_ERR_DETERMINING_BBM = 1583, /**< BAM: Failed to determine what BBM type configuration has been written to flash. */ + E_BAM_ERR_SET_ECC_LENGTH = 1584, /**< BAM: Failed to set the length to use with HW ECC acceleration. */ + E_BAM_ERR_INVALID_BBM_TYPE = 1585, /**< BAM: Invalid BBM type. */ + E_BAM_ERR_BOOT_BDM_CONFIG_FAILED = 1586, /**< BAM: Failed to configure boot block device management. */ + E_BAM_ERR_BOOT_BDM_STARTUP_FAILED = 1587, /**< BAM: Failed to startup boot block device management. */ + E_BAM_ERR_BOOT_BDM_INSTANCE_NOT_FOUND = 1588, /**< BAM: Boot block device management instance not found. */ + E_BAM_ERR_BOOT_BDM_BLOCKS_NOT_FOUND = 1589, /**< BAM: Boot block device management blocks not found. */ + E_BAM_ERR_BOOT_BDM_NOT_STARTED = 1590, /**< BAM: Boot block device management not started. Requested operation require BDM to be started. */ + E_BAM_ERR_UNIT_OUT_OF_RANGE = 1591, /**< BAM: Unit is out of range. */ + E_BAM_ERR_BDM_STARTUP_FAILED = 1592, /**< BAM: Block device management startup failed. */ + E_BAM_ERR_BLOCK_NOT_ERASED = 1593, /**< BAM: Block not erased. */ + E_BAM_ONLD_CRITICAL_ERROR = 1601, /**< BAM ONLD: Critical error. */ + E_BAM_ONLD_INVALID_PARAMS = 1602, /**< BAM ONLD: Invalid parameters. */ + E_BAM_ONLD_INITIALISATION_ERROR = 1603, /**< BAM ONLD: Initialisation error. */ + E_BAM_ONLD_READ_ERROR = 1604, /**< BAM ONLD: An error occurred while reading. */ + E_BAM_ONLD_WRITE_ERROR = 1605, /**< BAM ONLD: An error occurred while writing. */ + E_BAM_ONLD_ERASE_ERROR = 1606, /**< BAM ONLD: An error occurred while erasing. */ + E_BAM_ONLD_DEVICE_ERROR = 1607, /**< BAM ONLD: Device error. */ + E_BAM_ONLD_GOODBLOCK = 1608, /**< BAM ONLD: Good block. */ + E_BAM_ONLD_BADBLOCK = 1609, /**< BAM ONLD: Bad block. */ + E_COPS_MEMORY_ALLOC_FAILED = 1651, /**< COPS: Memory allocation failed. */ + E_COPS_DATA_TAMPERED = 1652, /**< COPS: Data is tempered. */ + E_COPS_IMEI_MISSMATCH = 1653, /**< COPS: IMEI missmatch. */ + E_COPS_OTP_LOCKED = 1654, /**< COPS: OTP is locked. */ + E_COPS_MAC_FUNCTION_LOCKED_DOWN = 1655, /**< COPS: Function for calculating MAC is locked down. */ + E_COPS_AUTHENTICATION_FAILED = 1656, /**< COPS: Authentication failed. */ + E_COPS_DATA_NOT_PRESENT = 1657, /**< COPS: Default Data is not present. */ + E_COPS_IMEI_UPDATE_NOT_ALLOWED = 1658, /**< COPS: IMEI update is not allowed. */ + E_COPS_LOCK_PERMANENTLY_DISABLED = 1659, /**< COPS: Locking of SIMLocks is disabled. */ + E_COPS_NO_ATTEMPTS_LEFT = 1660, /**< COPS: No more attempts for verification left. */ + E_COPS_INCORRECT_CONTROLKEY = 1661, /**< COPS: Control key is not correct. */ + E_COPS_TOO_SHORT_CONTROLKEY = 1662, /**< COPS: Control key is too short. */ + E_COPS_TOO_LONG_CONTROLKEY = 1663, /**< COPS: Control key is too long. */ + E_COPS_INVALID_CONTROLKEY = 1664, /**< COPS: Control key is not valid. */ + E_COPS_TIMER_RUNNING = 1665, /**< COPS: Timer is running. */ + E_COPS_SIM_ERROR = 1666, /**< COPS: SIM error. */ + E_COPS_LOCKING_FAILED = 1667, /**< COPS: Locking failed. */ + E_COPS_OTA_UNLOCK_IMEI_MISMATCH = 1668, /**< COPS: OTA unlock IMEI mismatch. */ + E_COPS_INCORRECT_IMSI = 1669, /**< COPS: Incorrect IMSI. */ + E_COPS_PARAMETER_ERROR = 1670, /**< COPS: Parameter error. */ + E_COPS_BUFFER_TOO_SMALL = 1671, /**< COPS: Memory buffer is too small. */ + E_COPS_FORBIDDEN_PARAMETER_ID = 1672, /**< COPS: Parameter is not allowed. */ + E_COPS_UNKNOWN_PARAMETER_ID = 1673, /**< COPS: Parameter can not be recognised. */ + E_COPS_ARGUMENT_ERROR = 1674, /**< COPS: Argument error! */ + E_COPS_VERIFY_FAILED = 1698, /**< COPS: Failed to verify internal data. */ + E_COPS_UNDEFINED_ERROR = 1699, /**< COPS: Undefined error. */ + E_PD_NAND_RESULT_BIT_ERROR_CORRECTED = 1751, /**< PD NAND: A bit error was detected and corrected. */ + E_PD_NAND_RESULT_UNCORRECTABLE_BIT_ERROR = 1752, /**< PD NAND: An uncorrectable bit error was detected. */ + E_PD_NAND_RESULT_BAD_PARAMETER = 1753, /**< PD NAND: The function could not perform the requested operation due to a bad parameter. */ + E_PD_NAND_RESULT_HW_ERROR = 1754, /**< PD NAND: A hardware error occurred. */ + E_PD_NAND_RESULT_INTERNAL_ERROR = 1755, /**< PD NAND: A module internal error has occurred. The module has reach an unexpected state or request. */ + E_PD_NAND_RESULT_BUSY = 1756, /**< PD NAND: Busy flag was returned. */ + E_PD_NAND_RESULT_READING_ERASED_PAGE = 1757, /**< PD NAND: Attempting to read erased page. */ + E_PD_NAND_RESULT_NUMBER_OF_ITEMS = 1758, /**< PD NAND: Number of valid states of this type. */ + E_PD_NAND_RESULT_UNDEFINED = 1759, /**< PD NAND: Represents an undefined value of this type. */ + E_GD_TA_BASE = 1851, /**< GD/TA: TA base. */ + E_GD_TA_UNKNOWN_PARTITION = 1852, /**< GD/TA: Unknown partition. */ + E_GD_TA_UNKNOWN_CONFIG = 1853, /**< GD/TA: Unknown configuration. */ + E_GD_TA_ILLOGICAL_CONFIGURATION = 1854, /**< GD/TA: Ilogical configuration. */ + E_GD_TA_UNKNOWN_MEMORY_TYPE = 1855, /**< GD/TA: Unknown memory type. */ + E_GD_TA_WRONG_PARAMETER = 1856, /**< GD/TA: Wrong parameter. */ + E_GD_TA_OUT_OF_MEMORY = 1857, /**< GD/TA: Out of memory. */ + E_GD_TA_INVALID_ADRESS = 1858, /**< GD/TA: Invalid adress. */ + E_GD_TA_UNUSED_ADRESS = 1859, /**< GD/TA: Unused adress. */ + E_GD_TA_UNIT_NOT_FOUND = 1860, /**< GD/TA: Unit not found. */ + E_GD_TA_NOT_IMPLEMENTED = 1861, /**< GD/TA: TA is not supported. */ + E_GD_TA_FAIL = 1862, /**< GD/TA: TA fail. */ + E_GD_UNKNOWN_UNIT_NAME = 1863, /**< GD: Unknown unit name. */ + E_GD_LAST = 1864, /**< GD: Last enumeration (last valid + 1). */ + E_FAILED_TO_STORE_IN_FIFO = 1900, /**< Failed to store data in FIFO. */ + E_FAILED_TO_SET_COMM_DEVICES = 1951, /**< Failed to set parameters of communications devices. */ + E_FAILED_TO_STORE_IN_STACK = 1952, /**< Failed to store in stack. */ + E_ZIP_PARSER_FILE_NOT_FOUND = 1954, /**< The requested file is not found in the specified Zip archive. */ + E_ELF_FILE_FORMAT = 1955, /**< The requested file is not an elf file. */ + E_ELF_OPEN_SECTION = 1956, /**< Can not open elf section. */ + E_NAME_TOO_LONG = 1957, /**< The name of parameter is too long. */ + E_BOOTRECORDS_MISMATCH = 1958, /**< Error in boot records. */ + E_BOOTRECORD_EMPTY = 1959, /**< Boot record is empty and operation cannot be executed. */ + E_INVALID_BOOTRECORD_IMAGE = 1960, /**< Boot record image is not valid. */ + E_BOOTRECORD_FULL = 1961, /**< Boot record has no space to accept new boot record. */ + E_BOOTRECORD_NOT_EXIST = 1962, /**< Boot record not exist. */ + E_BOOTRECORD_WRITE_FAILED = 1963, /**< Writing failed. */ + E_BOOTRECORD_UNALIGNED_DATA = 1964, /**< Boot record data is unaligned. */ + E_CONTENT_TYPE = 1965, /**< Content type to long. */ + E_DEVICE_TYPE = 1966, /**< Device type to long. */ + E_NUMBER_OF_TARGET_DEVICES = 1967, /**< Number of target devices to big. */ + E_DESCRIPTION_TOO_LONG = 1968, /**< Description field too long. */ + E_MODULE_NOT_FOUND = 2000, /**< Testing this module currently not supported in ADbg. */ + E_MODULE_LIST_EMPTY = 2001, /**< There isn't any module available for testing. */ + E_CASE_NOT_FOUND = 2002, /**< Specified case can not be found. */ + E_CASE_LIST_EMPTY = 2003, /**< There isn't any test cases in specified module. */ + E_INT_GROUP_NOT_FOUND = 2004, /**< Specified internal group can not be found. */ + E_INT_GROUP_LIST_EMPTY = 2005, /**< There isn't any internal group. */ + E_INT_FUNCTION_NOT_FOUND = 2006, /**< Specified interface function cannot be found. */ + E_INT_FUNCTION_LIST_EMPTY = 2007, /**< There isn't any interface function in interface group. */ + E_PRECONDITION_IS_ALREADY_SET = 2008, /**< Request for setting precondition that is already set. */ + E_PRECONDITION_IS_NOT_SET = 2009, /**< Request to recover condition that is not changed. */ + E_INIT_OTP_PD_FAILED = 2100, /**< */ + E_READING_OTP_FAILED = 2101, /**< */ + E_WRITTING_OTP_FAILED = 2102, /**< */ + E_INVALID_CID_VALUE = 2103, /**< */ + E_INIT_OTP_LD_FAILED = 2104, /**< */ + E_OTP_AREA_LOCKED = 2105, /**< */ + E_SEC_APP_PROPERTY_NOT_FOUND = 2251, /**< App property cannot be found. */ + E_SEC_APP_IMEI_NOT_CHANGABLE = 2252, /**< IMEI not changeable. */ + E_SEC_APP_OPERATION_DENIED = 2253, /**< Security operation denied. */ + E_SEC_APP_UNABLE_TO_READ_BS_PARAMETERS = 2254, /**< Incorrect Boot Stage Parameter vector. */ + E_SEC_APP_ROM_ERROR_CRITICAL = 2255, /**< Critical error in ROM has occurred. */ + E_SEC_APP_ROM_ERROR = 2256, /**< Unexpected ROM error. */ + E_SEC_APP_PATCH_EXISTS = 2257, /**< ROM Patch is already installed. */ + E_SEC_APP_PATCH_REINSTALLED = 2258, /**< ROM Patch in Flash is reinstalled. */ + E_SEC_APP_ROOTKEY_EXISTS = 2259, /**< ROM Patch is already installed. */ + E_SEC_APP_ROOTKEY_REINSTALLED = 2260, /**< Root Key is reinstalled. */ + E_TA_WRONG_PARTITION = 2351, /**< TA: Unknown partition. */ + E_TA_ILLOGICAL_CONFIGURATION = 2352, /**< TA: Configuration error. */ + E_TA_UNKNOWN_MEMORY_TYPE = 2353, /**< TA: Unsupported memory type. */ + E_TA_WRONG_PARAMETER = 2354, /**< TA: Wrong parameter. */ + E_TA_OUT_OF_MEMORY = 2355, /**< TA: No heap memory left. */ + E_TA_INVALID_ADRESS = 2356, /**< TA: Invalid address. */ + E_TA_UNUSED_ADRESS = 2357, /**< TA: Unused address. */ + E_TA_UNIT_NOT_FOUND = 2358, /**< TA: Unit was not found. */ + E_TA_WRONG_SIZE = 2359, /**< TA: Wrong size when reading unit. */ + E_TA_INSUFFICIANT_SPACE = 2360, /**< TA: Not enough space to flush the Trim Area. */ + E_TA_UNKNOWN_PARTITION = 2361, /**< TA: Unknown partition. */ + E_TA_FAIL = 2362, /**< TA: Fail. */ + E_TA_MEDIA_ERROR = 2460, /**< TA: Media error. */ + E_TA_NOT_CONFIGURED = 2461, /**< TA: Error occurs during configuration. */ + E_REQUEST_DENIED = 2500, /**< Request for change operation denied. */ + E_UNDEFINED_CHANGE_OPERATION = 2501, /**< Requested change operation is not supported. */ + E_PD_CFI_IN_PROGRESS = 2651, /**< PD CFI: The operation is in progress. Additional poll calls must be done. */ + E_PD_CFI_UNKNOWN_REQUEST = 2652, /**< PD CFI: Type not recognized. */ + E_PD_CFI_HARDWARE_ERROR = 2653, /**< PD CFI: Operation could not be completed because of a hardware malfunction. */ + E_PD_CFI_NOT_SUPPORTED = 2654, /**< PD CFI: The driver does not implement the requested function. */ + E_PD_CFI_PARAMETER_ERROR = 2655, /**< PD CFI: Invalid parameter value. */ + E_PD_CFI_PROTECTED = 2656, /**< PD CFI: The requested flash address is protected from the requested type of access. */ + E_PD_CFI_UNSUPPORTED_DEVICE = 2657, /**< PD CFI: Flash devices not supported by this driver. */ + E_PD_CFI_OPERATION_COMPLETE = 2658, /**< PD CFI: Requested operation was not suspended as it has completed. */ + E_LOADER_SEC_LIB_CHIP_ID_INVALID = 4000, /**< Invalid input parameters. */ + E_LOADER_SEC_LIB_INVALID_PARAMETER_TO_FUNC = 4096, /**< Invalid input parameters. */ + E_LOADER_SEC_LIB_FAILURE = 4120, /**< Failure. */ + E_LOADER_SEC_LIB_HASH_LIST_HASH_FAILURE = 4121, /**< hash list verification failed. */ + E_LOADER_SEC_LIB_HEADER_VERIFICATION_FAILURE = 4122, /**< Header verification failed. */ + E_LOADER_SEC_LIB_HEADER_VERIFIED = 4123, /**< Successful verification of the header */ + E_LOADER_SEC_LIB_VERIFY_FAILURE = 4124, /**< Unsuccessful verification. */ + E_LOADER_SEC_LIB_INIT_CALLED_TWICE = 4150, /**< The security library init function has been called 2 times. */ + E_LOADER_SEC_LIB_MEMORY_RELEASE_FAILED = 4180, /**< Memory release failed. */ + E_LOADER_SEC_LIB_MEMORY_ALLOCATION_FAILED = 4181, /**< Memory allocation failed. */ + E_LOADER_SEC_LIB_DATA_BLOCK_EXIST = 4182, /**< Data block exist in the linked list. */ + E_LOADER_SEC_LIB_DATA_BLOCK_DO_NOT_EXIST = 4183, /**< Data block do not exist in the linked list. */ + E_LOADER_SEC_LIB_INVALID_AUTHENTICATION_TYPE = 4184, /**< Invalid authentication type. */ + E_LOADER_SEC_LIB_EXCEEDED_NUMBER_OF_AUTHENTICATION = 4185, /**< Exceeded number of authentication. Loader will be shut downed. */ + E_LOADER_SEC_LIB_ESB_MAC_INIT_FAILED = 4186, /**< Initialization of ESB block for MAC calculation failed. */ + E_LOADER_SEC_LIB_ESB_MAC_UPDATE_FAILED = 4187, /**< MAC update with ESB block failed. */ + E_LOADER_SEC_LIB_ESB_MAC_FINAL_FAILED = 4188, /**< MAC finalize with ESB block failed. */ + E_LOADER_SEC_LIB_ESB_MAC_NOT_VERIFIED = 4189, /**< MAC verification with ESB block failed. */ + E_LOADER_SEC_LIB_ESB_DOWNLOCK_FAILED = 4190, /**< ESB downlock failed. */ + E_LOADER_SEC_LIB_CONTROL_KEY_VERIFICATION_FAILURE = 4191, /**< Control key verification failed. */ + E_LOADER_SEC_LIB_CA_CERTIFICATE_VERIFICATION_FAILURE = 4192, /**< CA certificate verification failed. */ + E_LOADER_SEC_LIB_X509_ERROR_IN_CERTIFICATE = 4193, /**< X509 certificate error. */ + E_LOADER_SEC_LIB_COPS_INIT_FAILED = 4194, /**< COPS initialization failed. */ + E_LOADER_SEC_LIB_COPS_PROTECT_DATA_INIT_FAILED = 4195, /**< COPS protect data initialization failed. */ + E_LOADER_SEC_LIB_COPS_DATA_READ_FAILED = 4196, /**< COPS data read failed. */ + E_LOADER_SEC_LIB_COPS_DATA_WRITE_FAILED = 4197, /**< COPS data write failed. */ + E_LOADER_SEC_LIB_READ_OTP_FAILED = 4198, /**< Reading OTP data failed. */ + E_LOADER_SEC_LIB_WRITE_OTP_FAILED = 4199, /**< Writing OTP data failed. */ + E_LOADER_SEC_LIB_LOCK_OTP_FAILED = 4200, /**< Locking OTP data failed. */ + E_LOADER_SEC_LIB_UNPACKING_IMEI_FAILED = 4201, /**< Unpacking IMEI data failed. */ + E_LOADER_SEC_LIB_PACKING_IMEI_FAILED = 4202, /**< Packing IMEI data failed. */ + E_LOADER_SEC_LIB_OTP_ALREADY_LOCKED = 4203, /**< OTP is already locked. */ + E_LOADER_SEC_LIB_INVALID_CID_VALUE = 4204, /**< CID value is out of range. */ + E_LOADER_SEC_LIB_OTP_LOCKBITS_MISSMATCH = 4205, /**< OTP lock bits have different values. */ + E_LOADER_SEC_LIB_WRITING_BOOTRECORD_FAILED = 4206, /**< Failed to write in boot records. */ + E_LOADER_SEC_LIB_UNSUPPORTED_NO_DEBUG_HW = 4207, /**< No debug hardware detected. */ + E_LOADER_SEC_LIB_CHANGE_OPERATION_NOT_SUPPORTED = 4208, /**< Requested change operation is not supported or not allowed. */ + E_LOADER_SEC_LIB_INVALID_CHANGE_OPERATION = 4209, /**< Invalid change operation. */ + E_LOADER_SEC_LIB_RWIMEI_NOT_ALLOWED = 4210, /**< Rewriteable IMEI is not allowed to change. */ + E_LOADER_SEC_LIB_REQUEST_DENIED = 4211, /**< Request for change operation is denied. */ + E_LOADER_SEC_LIB_BOOT_BLOCK_DO_NOT_EXIST = 4212, /**< Boot record do not exist. */ + E_LOADER_SEC_LIB_CORRUPTED_DOMAIN_DATA = 4213, /**< Corrupted or do not exist domain data in boot block. */ + E_LOADER_SEC_LIB_INVALID_DOMAIN = 4214, /**< Invalid domain. */ + E_FIFO_OVERFLOW = 4300, /**< */ + E_FIFO_UNDERFLOW = 4301, /**< */ + E_OBJECT_NULL = 4302, /**< */ + E_POINTER_NOT_NULL = 4303, /**< */ + E_UNRECOGNIZED_STATE = 4304, /**< */ + E_UNKNOWN_MANUFACTURER_ID = 4305, /**< */ + E_UNKNOWN_DEVICE_ID = 4306, /**< */ + E_INVALID_A01_FORMAT = 4308, /**< */ + E_A01_BUFFER_FULL = 4309, /**< */ + E_CONFIG_FILE_NOT_SPECIFIED = 4350, /**< */ + A2_E_SUCCESS = 5000, /**< Operation successful. */ + A2_E_PROP_NOT_SUPPORTED = 5001, /**< The property is not supported. */ + A2_E_PROP_READ_ONLY = 5002, /**< The property is read only. */ + A2_E_PROP_INVALID = 5003, /**< The property value is invalid. */ + A2_E_AUTH_DECLINED = 5004, /**< Authentication declined. The ME is automatically shut down after sending this. */ + A2_E_AUTH_UNSUPPORTED = 5005, /**< The authentication type is not supported. */ + A2_E_ALLOCATE_FAILED = 5006, /**< Failed to allocate memory. */ + A2_E_INVALID_TIME = 5007, /**< Invalid time specified. */ + A2_E_UNKNWON_PROPERTY = 5008, /**< Unknown property id. */ + A2_E_START_AAIF_FAILED = 5009, /**< Failed to start the AAIF in the loader on loader. */ + A2_E_UNSUPPORTED_CMD = 5010, /**< Unsupported command. */ + A2_E_POINTER_NOT_ALIGNED = 5011, /**< Pointer not aligned. */ + A2_E_ERROR_WRITING_BOOTRECORD = 5012, /**< Writing of the boot record failed. */ + A2_E_INVALID_CURRDATE_STRING_LENGTH = 5013, /**< String data length is invalid. */ + A2_E_NO_COMMAND_GROUPS_DEFINED = 5014, /**< Unknown command group. */ + A2_E_READ_OTP_FAILED = 5015, /**< Read OTP failed. */ + A2_E_COMMAND_IS_NOT_IMPLEMENTED = 5016, /**< Specified command is not implemented. */ + A2_E_FAILED_TO_GET_ASIC_COPS_SETTINGS = 5017, /**< Failed to get ASIC COPS setting. */ + A2_E_FAILED_TO_SET_PLAT_PROP = 5018, /**< Failed to set platform properties. */ + A2_E_MEMORY_FAILED = 5019, /**< Memory fail. */ + A2_E_JTAG_UNLOCK_FAILED = 5020, /**< JTAG unlock fail. */ + A2_E_AUTOCONFIGURE_FLASH = 5021, /**< */ + A2_E_E_GET_FIRST_FLASH_DEV = 5022, /**< */ + A2_E_E_FAILED_INIT_COPS_LIB = 5023, /**< Failed to initialize COPS library. */ + A2_E_OTP_SECURITY_ERROR = 5024, /**< OTP security error. */ + A2_E_I2C_BUS_SECURITY_ERROR = 5025, /**< I2C bus security error. */ + A2_E_GET_STATIC_DATA_FAILED = 5026, /**< Can't get static data. */ + A2_E_STORE_MAC_TO_BOOTIMAGE_FAILED = 5027, /**< Failed to store MAC in boot image. */ + A2_E_SEC_GENERAL_COPS_LIB_ERROR = 5028, /**< General COPS error. */ + A2_E_HASH_VERIFICATION_ERROR = 5029, /**< Hash verification failed. */ + A2_E_READ_FLASH_FAILED = 5030, /**< Failed to read hash. */ + A2_E_APP_HANDSHAKE_FAILED = 5031, /**< Processors handshake failed. */ + A2_E_BOOTIMAGE_MEMCONF_INVALID = 5032, /**< Invalid memconfig in boot image. */ + A2_E_BOOTIMAGE_SIGNATURE_FAILED = 5033, /**< Boot image signature failed. */ + A2_E_BOOTIMAGE_FAILED_TO_READ_IMAGE = 5034, /**< Failed to read image. */ + A2_E_BOOTIMAGE_FAILED_ALLOCATE_MEM = 5035, /**< Failed to allocate memory. */ + A2_E_BOOTIMAGE_INVALID_PARAM = 5036, /**< Boot image invalid parametars. */ + A2_E_BOOTIMAGE_INVALID_LENGTH = 5037, /**< Boot image has invalid length. */ + A2_E_BOOTIMAGE_MACED_HEADER_SIZE_ZERO = 5038, /**< Header size is zero. */ + A2_E_FLASH_RESULT_DEVICE_PROTECTED = 5039, /**< The flash device was protected. */ + A2_E_FLASH_RESULT_WRITE_SUSPENDED = 5040, /**< The last write process was suspended. */ + A2_E_FLASH_RESULT_VOLTAGE_RANGE_ERROR = 5041, /**< The voltage range is invalid. */ + A2_E_FLASH_RESULT_PROGRAM_ERROR = 5042, /**< Failed to write to the flash device. */ + A2_E_FLASH_RESULT_ERASE_ERROR = 5043, /**< Failed to erase a block in the flash device. */ + A2_E_FLASH_RESULT_ERASE_SUSPENDED = 5044, /**< The erase process was suspended. */ + A2_E_FLASH_RESULT_COMMAND_SEQUENCE_ERROR = 5045, /**< The sequence of the flash commands was invalid. */ + A2_E_FLASH_RESULT_OPERATION_NOT_SUPPORTED = 5046, /**< Operation was not supported in flashdriver. */ + A2_E_FLASH_RESULT_INVALID_PARAMETER = 5047, /**< Invalid in-parameter specified when reading/writing to flash. */ + A2_E_FLASH_RESULT_NO_FLASH_DEVICE = 5048, /**< No flash device was found on the physical address. */ + A2_E_FLASH_RESULT_CONFIGURATION_ERROR = 5049, /**< Configuration error of flash device. */ + A2_E_FLASH_RESULT_INVALID_STARTADDRESS = 5050, /**< Invalid start address of the parameter. */ + A2_E_FLASH_RESULT_INVALID_PHYSICAL_ADDRESS = 5051, /**< Invalid physical address of the parameter. */ + A2_E_FLASH_RESULT_INVALID_DATALENGTH = 5052, /**< The data length of the parameter is invalid. */ + A2_E_FLASH_RESULT_GETREGION_ERROR = 5053, /**< Invalid flash region specified. */ + A2_E_FLASH_RESULT_NULL_POINTER_BUF = 5054, /**< A buffer was NULL. */ + A2_E_FLASH_RESULT_NAND_READ_FAILED = 5055, /**< Failed to read from the NAND flash. */ + A2_E_FLASH_RESULT_NAND_PAGE_SIZE_UNSUPPORTED = 5056, /**< The nand page size is unsupported. */ + A2_E_FLASH_RESULT_WRITE_ERROR = 5057, /**< Failed to write to the flash device. */ + A2_E_FLASH_RESULT_READ_ID_ERROR = 5058, /**< Failed to read the device ID from the flash device. */ + A2_E_FLASH_RESULT_HARDWARE_ERROR = 5059, /**< Hardware error in the flash status. */ + A2_E_FLASH_RESULT_READ_FROM_FLASH = 5060, /**< Failed to read from the flash device. */ + A2_E_FLASH_RESULT_ADD_NEW_DEVICE = 5061, /**< Failed to add a new instance of a flash device. */ + A2_E_FLASH_RESULT_OTP_UNSUPPORTED_IN_FLASH = 5062, /**< OTP is not support in the current flash device. */ + A2_E_FLASH_RESULT_OTP_TOO_SMALL = 5063, /**< The OTP size is to small for the length requested. */ + A2_E_FLASH_RESULT_OTP_READ_FAILED = 5064, /**< Failed to read the OTP area in the flash device. */ + A2_E_FLASH_RESULT_INVALID_FLASH_TYPE = 5065, /**< The flash type is unknown. */ + A2_E_FLASH_RESULT_NAND_FLUSH_ERROR = 5066, /**< Failed to flush the NAND write buffer. */ + A2_E_FLASH_RESULT_NOR_FLUSH_ERROR = 5067, /**< Failed to flush the NOR write buffer. */ + A2_E_INVALID_LOL_STATE = 5068, /**< Invalid Loader on loader state. */ + A2_E_INVALID_STATUS_LOLSTATE = 5069, /**< Invalid loader on loader status. */ + A2_E_WRITE_STATIC_DATA = 5070, /**< Write static data failed. */ + A2_E_HEADER_NOT_VERIFIED_YET = 5071, /**< Header is still not verified. */ + A2_E_ALL_BLOCKS_VERIFIED_FAILED = 5072, /**< Blocks verification failed. */ + A2_E_HANDSHAKE_WITH_APP_SIDE = 5073, /**< Handshake with App side failed. */ + A2_E_READ_STATIC_DATA = 5074, /**< Failed to read static data. */ + A2_E_ENABLE_CLOCK_HARDWARE_FAILED = 5075, /**< Failed to enable clock hardware. */ + A2_E_ENABLE_BLOCK_HARDWARE_FAILED = 5076, /**< Failed to enable block hardware. */ + A2_E_NO_HEADER_TO_MAC_IN_BOOT = 5077, /**< Indicates that the loader did not find any header in the bootimage records that could be MAC'ed. */ + A2_E_MMU_SETUP = 5078, /**< MMU setup failed. */ + A2_E_INVALID_COMMAND_SIZE = 5079, /**< Invalid command size. */ + A2_E_HASH_LIST_LENGTH_INVALID = 5080, /**< Invalid hash list length. */ + A2_E_INVALID_INPUT_PARAMETERS = 5081, /**< Invalid input parameters. */ + A2_E_FAILED_SETUP_MSL_DRIVER = 5082, /**< MSL driver setup failed. */ + A2_E_REQUEST_DENIED = 5083, /**< Request denied. */ + A2_E_ASIC_FUSES_INVALID = 5084, /**< Fuses for the ASIC are invalid. */ + A2_E_STATIC_DATA_NOT_CHECKED = 5085, /**< Static data is not checked. */ + A2_E_COPS_DATA_MAN_INIT = 5086, /**< Failed to initialize the cops data man, this can be caused by an corrupt boot image. You probably just need to flash a platform software to get it work. */ + A2_E_UART_DRIVER_ERROR = 5087, /**< UART driver error. */ + A2_E_INVALID_DOMAIN_FOR_LOADER_TYPE = 5088, /**< Loader type is not compatible with this domain. */ + A2_E_FUNCTIONALITY_NOT_IN_PRODUCT = 5089, /**< Functionality not supported. */ + A2_E_DEFALT_DATA_NOT_FOUND = 5090, /**< Default data can not be found. */ + A2_E_FAILED_TO_MAC_HEADER = 5091, /**< Failed to send the header to access side to be MAC'ed, could be something wrong with the header. */ + A2_E_APP_PRELOADER_NOT_STARTED = 5092, /**< App preloader not started. */ + A2_E_INVALID_DEST_ADDRESS = 5093, /**< Invalid destination address. */ + A2_E_SYS_APP_INIT_FAILURE = 5094, /**< Failed to initialize the system application. */ + A2_E_FLASH_APP_INIT_FAILURE = 5095, /**< Failed to initialize the flash application. */ + A2_E_SIGNATURE_APP_INIT_FAILURE = 5096, /**< Failed to initialize the signature application. */ + A2_E_RESET_APP_INIT_FAILURE = 5097, /**< Failed to initialize the reset application. */ + A2_E_INT_SEC_APP_INIT_FAILURE = 5098, /**< Failed to initialize the internal security application. */ + A2_E_COPS_DATA_MAN_FORMAT = 5099, /**< COPS data man Format. */ + A2_E_COPS_DATA_MAN_WRITE = 5100, /**< COPS data man write. */ + A2_E_COPS_DATA_MAN_FLUSH = 5101, /**< Failed to Flush the memory into the security partition. */ + A2_E_COPS_DATA_MAN_GETBLOCKSIZE = 5102, /**< Failed to get the block size of a unit in the security partition. */ + A2_E_COPS_DATA_MAN_READBLOCK = 5103, /**< Failed to read an index from the security partition. */ + A2_E_INVALID_FLASH_VAR_LENGTH = 5104, /**< The bytes left to program should be less than a NAND page. */ + A2_E_BOOTIMAGE_TOO_BIG = 5105, /**< Boot image is too big. */ + A2_E_GDFS_APP_INIT_FAILURE = 5106, /**< App GD init failed. */ + A2_E_FILESYS_APP_INIT_FAILURE = 5107, /**< Failed to initialize the file system. */ + A2_E_INVALID_SOURCE_DEST_ADDRESS = 5108, /**< Invalid source or destination address. */ + A2_E_INVALID_RESPONSE_COMMAND = 5109, /**< Invalid Response command number on the internal security command group, was expecting command 0xFF. */ + A2_E_INVALID_RESP_TO_CMD = 5110, /**< The internal sec command response should have responded to another command. */ + A2_E_VERIFICATION_OF_WRITTEN_DATA_FAILED = 5111, /**< The data programmed into flash was not the same as the data received! */ + A2_E_INVALID_NAND_PADMUX_SETTING = 5112, /**< The PADMUX configuration has not been set. */ + A2_E_FLASH_DRIVER_FAILED_SET_BOOT_ADDR = 5113, /**< Failed to set the start boot address, this address are used to read the static data. */ + A2_E_FLASH_BOOT_IS_NOT_EMPTY = 5114, /**< if the static data was not found, the flash should be empty! */ + A2_E_BOOTIMAGE_PMC_NOT_NEEDED = 5115, /**< This error code informs that found boot container holds information that is not PMC protected. */ + A2_E_UNSUPPORTED_PMC = 5116, /**< The PMC ID is not supported. */ + A2_E_FSVN_VS_PMC = 5117, /**< The PMC ID is not coordinated with FSVN. */ + A2_E_WRONG_PMC_START_COUNT = 5118, /**< PMC start count to high or zero. */ + A2_E_UNSUITABLE_PMC_FOR_LOCATION = 5119, /**< Unsuitable PMC for the location. */ + A2_E_PMC_MISSING = 5120, /**< The PMC can not be found. */ + A2_E_VERSION_NOT_ACCEPTED = 5121, /**< FSVN is too low. */ + A2_E_PMC_OVERFLOWN = 5122, /**< All steps of the PMC are destroyed. */ + A2_E_PMC_ONCE_REQUIRED = 5123, /**< New version of once protected module attempted to be loaded without ARB flag set. */ + A2_E_PMC_BAD_N_OF_STEPS = 5124, /**< Unsuitable number of steps within PMC. */ + A2_E_UNIT_MISSING = 5125, /**< Dynamyc variable is missing. */ + A2_E_UNIT_TO_BIG = 5126, /**< Dynamyc variable found is to big. */ + A2_E_PARTMAN_READ_ERROR = 5127, /**< Error reading partition manger status. */ + A2_E_PARTMAN_INIT_ERROR = 5128, /**< Error initializing partition manger. */ + A2_E_BOOTIMAGE_INVALID_ALLIGNMENT = 5129, /**< Boot container size is not word alligned. */ + A2_E_BOOTIMAGE_INSUFFICIENT_CONTAINERS = 5130, /**< Not enough boot containers are allocated. */ + A2_E_BOOTIMAGE_INVALID_CONTAINER_TYPE = 5131, /**< Invalid boot container type. At this position other type of container is expected. */ + A2_E_DATA_LENGTH_IS_NOT_ALIGNED = 5132, /**< The data size must be aligned to 512 bytes when reading or writing pages to/from the NAND. */ + A2_E_LOADER_SWINIT_JTAG_UNLOCK_FAILED = 5133, /**< TEST JTAG EANBLENODEBUG. */ + A2_E_BOOTIMAGE_RECORD_NOT_FOUND = 5134, /**< Required record is not found in the boot containers. */ + A2_E_BUFFER_OVERFLOW = 5135, /**< Buffer overflow. */ + A2_E_BUFFER_NOT_ALLOCATED = 5136, /**< Buffer has not been allocated. */ + A2_E_WRONG_DATA_SIZE = 5137, /**< Size of data has an unexpected value. */ + A2_E_NO_STATIC_DATA_IN_BOOTIMAGE = 5138, /**< Static data in boot record is corrupted. */ + A2_E_NOT_ALLOWED_TO_FLASH = 5139, /**< Not allowed to flash this block. */ + A2_E_UNABLE_TO_CHANGE_MMU_SETTINGS = 5140, /**< Unable to change MMU settings. */ + A2_E_INVALID_HW_FOR_LOADER_SETTINGS = 5141, /**< Loader settings are not compatible with loader settings. */ + A2_E_CABS_START_FAILED = 5142, /**< */ + A2_E_CABS_READ_ERROR = 5143, /**< */ + A2_E_CABS_WRITE_ERROR = 5144, /**< */ + A2_E_ELF_DECODE_GENERAL_ERROR = 5145, /**< */ + A2_E_ELF_INVALID_PARAMETER = 5146, /**< */ + A2_E_PARTMAN_INIT_FAILED = 5147, /**< */ + A2_E_PARTMAN_WRITE_FAILED = 5148, /**< */ + A2_E_PARTMAN_READ_FAILED = 5149, /**< */ + A2_E_PARTMAN_ERASE_ERROR = 5150, /**< */ + A2_E_MBBS_CONFIG_ERROR = 5151, /**< */ + A2_E_MBBS_READ_ERROR = 5152, /**< */ + A2_E_MBBS_WRITE_ERROR = 5153, /**< */ + A2_E_MBBS_ERASE_ERROR = 5154, /**< */ + A2_E_FLASH_HW_CONFIG = 5155, /**< */ + A2_E_VSP_IS_NOT_ALLOWED = 5156, /**< Virtual security partition is not allowed in this configuration. */ + A2_E_VSP_WRITE_STATIC_DATA = 5157, /**< Failed to write static data to virtual security partition. */ + A2_E_VSP_READ_STATIC_DATA = 5158, /**< Failed to read static data from virtual security partition. */ + A2_E_VSP_NOT_FORMATED = 5159, /**< Virtual security partition is not initialized. */ + A2_E_VSP_UNSUPPORTED_UNIT_TYPE = 5160, /**< Unit type is out of range in virtual security partition. */ + A2_E_GET_DYNAMIC_DATA_FAILED = 5161, /**< Could not get the dynamic data from the security library. */ + A2_E_FLASH_RESULT_PARTITION_TABLE_FLASHED = 5162, /**< Partition table repaired!! Please load file again. */ + A2_E_FLASH_RESULT_PARTITION_TABLE_NOT_FLASHED = 5163, /**< Partition table is damaged! */ + A2_E_FLASH_RESULT_READ_FROM_PARTITION_TABLE = 5164, /**< Partition table is damaged. */ + A2_E_BOOTIMAGE_PARTITION_RECORD_NOT_FOUND = 5165, /**< Partition table record is not found in the boot containers. */ + A2_E_CORRUPT_STATIC_DATA_IN_BOOT_BLOCK = 5166, /**< Static data in boot block is corrupt. */ + A2_E_MBBS_BBM_TYPE_CONFLICT = 5167, /**< MBBS and BBM type conflict. */ + A2_E_EXECUTION_NOT_PERMITTED = 5168, /**< Execution of this command is not allowed in the current domain with current authentication state. */ + A2_E_EXECUTION_NOT_PERMITTED_WARNING = 5169, /**< Execution of this command is not allowed in the current domain with current authentication state. */ + A2_E_UNABLE_TO_INITIALIZE_LCD = 5171, /**< Error during initialization of LCD drivers. */ + A2_E_LCD_NOT_INITIALIZED = 5172, /**< LCD is not initialized. */ + A2_E_UNABLE_TO_DISPLAY_DATA_ON_LCD = 5173, /**< Unrecoverable error during BMP image is processed. */ + A2_E_NETWORK_BUFFER_CORRUPTED = 5174, /**< The network buffer area is corrupted. */ + A2_E_TOO_MENY_FRAGMENTS = 5200, /**< */ + A2_E_FAILED_TO_GET_APPLICATION = 5201, /**< */ + A2_E_SECURITY_LIBRARY_ERROR_BEGIN = 9096, /**< */ + A2_E_SECURITY_LIBRARY_ERROR_END = 9300, /**< */ + A2_E_UNSUPPORTED_PROPERTY = 5301, /**< Unsupported file system property. */ + A2_E_READ_ONLY = 5302, /**< The property is read only. */ + A2_E_INVALLID_PROPERTY_SPECIFIED = 5303, /**< The specified property value was invalid. */ + A2_E_ACCESS_DENIED = 5304, /**< The access permission attributes do not allow operation. */ + A2_E_FORMATTING_FS = 5305, /**< The file system is formatting. */ + A2_E_PATH_NOT_EXISTS = 5306, /**< The path does not exist. */ + A2_E_PATH_ALREADY_EXISTS = 5307, /**< The path already exists. */ + A2_E_PATH_READ_ONLY = 5308, /**< The path is read only. */ + A2_E_INSUFFICENT_SPACE = 5309, /**< Insufficient space. */ + A2_E_DIRECTORY_NOT_EMPTY = 5310, /**< The directory is not empty. */ + A2_E_INVALID_RESTRICTION_SPECIFIED = 5311, /**< Invalid access restrictions specified. */ + A2_E_NO_FILESYSTEM_PROPERTY = 5312, /**< No file system property. */ + A2_E_FILE_NOT_EXISTS = 5313, /**< The file does not exist. */ + A2_E_CHANGE_DIR = 5314, /**< Failed to change directory. */ + A2_E_CHMOD = 5315, /**< Failed to set new CH mod. */ + A2_E_GWD = 5316, /**< Failed to get the current directory. */ + A2_E_OPEN_FILE = 5317, /**< Failed to open a file in the file system. */ + A2_E_ITEM_STAT = 5318, /**< Failed to read the stat from file. */ + A2_E_LIST_VOL = 5319, /**< Failed to list volumes. */ + A2_E_FREE_SPACE = 5320, /**< No free space left. */ + A2_E_CLOSE_FILE = 5321, /**< Failed to close a file in the filesystem. */ + A2_E_CLOSE_DIRECTORY = 5322, /**< Failed to close the directory. */ + A2_E_REMOVE_FILE = 5323, /**< Failed to remove a file from the filesystem. */ + A2_E_RENAME_FILE = 5324, /**< Failed to rename a file in the filesystem. */ + A2_E_CREATE_DIR = 5325, /**< Failed to create a new directory in the filesystem. */ + A2_E_REMOVE_DIRECTORY = 5326, /**< Failed to remove a directory from the file system. */ + A2_E_WRITE_FILE = 5327, /**< Failed to write a file to the file system. */ + A2_E_INVALID_SFA_STATE = 5328, /**< The state of the SFA programming is incorrect. */ + A2_E_READ_FILE = 5329, /**< Failed to read a file from the file system. */ + A2_E_CORE_SUPERV = 61797, /**< */ + A2_E_MEM_ALLOC = 66166, /**< */ + A2_E_GDFS_UNSUPPORTED_PROPERTY = 5401, /**< Unsupported GDFS property. */ + A2_E_GDFS_READ_ONLY = 5402, /**< The GDFS property is read only. */ + A2_E_GDFS_PROPERTY_VALUE_INVALID = 5403, /**< The property value is invalid. */ + A2_E_GDFS_INVALID_START_PROPERTY = 5404, /**< Invalid start property. */ + A2_E_GDFS_NOT_STARTED = 5405, /**< GDFS has not been started yet. */ + A2_E_GDFS_FAILED_TO_FORMAT = 5406, /**< Failed to format the GDFS area. */ + A2_E_GDFS_NOT_FORMATTED = 5407, /**< GDFS is not formatted, as it should be. */ + A2_E_GDFS_INVALID_BLOCK_UNIT_SPECIFIED = 5408, /**< Invalid Block unit number. */ + A2_E_GDFS_NO_CONFIGURATION_FOUND = 5409, /**< Could not find any GDFS configuration from the platform software in flash. */ + A2_E_GDFS_CLOSE = 5410, /**< Failed to close the GDFS area. */ + A2_E_GDFS_OPEN = 5411, /**< Failed to open the GDFS area. */ + A2_E_GDFS_INVALID_UNIT_SIZE = 5412, /**< Invalid GDFS UNIT size(size=0). */ + A2_E_GDFS_WRITE_TO_UNIT_FAILED = 5413, /**< Failed to write to the specified unit. */ + A2_E_GDFS_FAILED_TO_READ_FROM_UNIT = 5414, /**< Failed to read from the specified unit. */ + A2_E_GDFS_EMPTY = 5415, /**< Failed read access on an empty GDFS. */ + A2_E_GENERAL_FATAL_ERROR = 70535, /**< */ + E_DUMMY_CODE = 80009 /**< */ +} ErrorCode_e; + +#endif /* _ERRORCODE_H */ diff --git a/source/LCM/include/t_a2_protocol.h b/source/LCM/include/t_a2_protocol.h new file mode 100755 index 0000000..23add7e --- /dev/null +++ b/source/LCM/include/t_a2_protocol.h @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_T_A2_PROTOCOL_H +#define INCLUSION_GUARD_T_A2_PROTOCOL_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup a2_family + * @{ + * @addtogroup a2_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_command_protocol.h" // only for Buffer_t + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +typedef enum { + A2_COMMAND, /**< Command type of the packet.*/ + A2_GENERAL_RESPONSE, /**< General response type of the packet.*/ + A2_CONTROL_MESSAGE, /**< Control message protocol packet. */ + A2_SPEEDFLASH_GR /**< Speedflash GR packet. */ +} A2_CommandType_t; + +/** + * Holds information for the command received from the transport layer. + */ +typedef struct A2_CommandData_s { + uint8 CommandNr; /**< Number of the command. */ + uint8 ApplicationNr; /**< Number of the application (command) group. */ + uint16 SessionNr; /**< Number of the session in which this command + was received. */ + uint8 DestAddress; /**< Destination address ACC = 0x01, APP = 0x02 */ + A2_CommandType_t Type; /**< Command type. */ + Buffer_t Payload; /**< Holds the data received with the command.*/ +} A2_CommandData_t; + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_T_A2_PROTOCOL_H diff --git a/source/LCM/include/t_basicdefinitions.h b/source/LCM/include/t_basicdefinitions.h new file mode 100644 index 0000000..4d5b0ee --- /dev/null +++ b/source/LCM/include/t_basicdefinitions.h @@ -0,0 +1,286 @@ +#ifndef INCLUSION_GUARD_T_BASICDEFINITIONS_H +#define INCLUSION_GUARD_T_BASICDEFINITIONS_H + +/****************************************************************************** + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license +******************************************************************************* +* +* $Workfile: t_basicdefinitions.h $ +* +******************************************************************************* +* +* DESCRIPTION: +* +* Portable types used for a consistent target platform. +* The name should make it totally clear as to what they are used for. +* +* For calculations: +* ----------------- +* sint8 - signed integer 8 bits +* uint8 - unsigned integer 8bits +* sint16 - signed integer 16 bits +* uint16 - unsigned integer 16 bits +* sint32 - signed integer 32 bits +* uint32 - unsigned integer 32 bits +* MAX and MIN values for all integer types are also supported. +* +* Unsigned integer types for other purposes than calculations: +* ------------------------------------------------------------ +* boolean - TRUE or FALSE +* +* Bitfield types to use in packed structs: +* ---------------------------------------- +* sbitfield - signed bitfield +* ubitfield - unsigned bitfield +* +* Bitmasks: +* --------- +* BIT_0 - unsigned integer of values 0x00000001 +* ... +* BIT_31 - unsigned integer of values 0x80000000 +* +* Enumeration: +* ------------ +* TYPEDEF_ENUM - This macro should be used to start the defenition of a enumerated type +* ENUM8(t) - uint8 enum +* ENUM16(t) - uint16 enum +* ENUM32(t) - uint32 enum +* SIGNED_ENUM8(t) - sint8 enum +* SIGNED_ENUM16(t) - sint16 enum +* SIGNED_ENUM32(t) - sint32 enum +* +******************************************************************************/ + +/******************** +* Include files +*********************/ + +#include "c_compiler.h" +#include <limits.h> + +/******************** +* Portable data types +*********************/ + +#if defined(COMPILER_IAR_ARM) && (__VER__ >= 300) +#define SINT64_SUPPORTED +#define UINT64_SUPPORTED +#define INT64_BASE_TYPE long long +#elif defined(COMPILER_ARM_ARM) +#define SINT64_SUPPORTED +#define UINT64_SUPPORTED +#define INT64_BASE_TYPE long long +#elif defined(_WIN32) +#define SINT64_SUPPORTED +#define UINT64_SUPPORTED +#define INT64_BASE_TYPE __int64 +#elif defined(__linux__) +#define SINT64_SUPPORTED +#define UINT64_SUPPORTED +#define INT64_BASE_TYPE long long +#else +#error "Unknown platform" +#endif + + +/** Type definition for a signed 8 bit data entity. */ +typedef signed char sint8; +/** Type definition for an unsigned 8 bit data entity. */ +typedef unsigned char uint8; +/** Type definition for a signed 16 bit data entity. */ +typedef signed short sint16; +/** Type definition for an unsigned 16 bit data entity. */ +typedef unsigned short uint16; +/** Type definition for a signed 32 bit data entity. */ +typedef signed int sint32; +/** Type definition for an unsigned 32 bit data entity. */ +#if defined(_WIN32) +typedef unsigned long uint32; +#else +typedef unsigned int uint32; +#endif + +/** + * Type definition for a signed 64 bit data entity. Only available if the switch + * SINT64_SUPPORTED is defined. + */ +#ifdef SINT64_SUPPORTED +typedef signed INT64_BASE_TYPE sint64; +#endif + +/** + * Type definition for an unsigned 64 bit data entity. Only available if the + * switch UINT64_SUPPORTED is defined. + */ +#ifdef UINT64_SUPPORTED +typedef unsigned INT64_BASE_TYPE uint64; +#endif + +/******************* +* MAX and MIN values +********************/ +/** Minimum value for an entity of type sint8 */ +#define MIN_SINT8 (SCHAR_MIN) +/** Maximum value for an entity of type sint8 */ +#define MAX_SINT8 (SCHAR_MAX) +/** Maximum value for an entity of type uint8 */ +#define MAX_UINT8 (UCHAR_MAX) +/** Minimum value for an entity of type sint16 */ +#define MIN_SINT16 (SHRT_MIN) +/** Maximum value for an entity of type sint16 */ +#define MAX_SINT16 (SHRT_MAX) +/** Maximum value for an entity of type uint16 */ +#define MAX_UINT16 (USHRT_MAX) +/** Minimum value for an entity of type sint32 */ +#define MIN_SINT32 (LONG_MIN) +/** Maximum value for an entity of type sint32 */ +#define MAX_SINT32 (LONG_MAX) +/** Maximum value for an entity of type uint32 */ +#define MAX_UINT32 (ULONG_MAX) + + +#ifdef SINT64_SUPPORTED +/** + * Minimum value for an entity of type sint64. Only available if the switch + * SINT64_SUPPORTED is defined. + */ +#define MIN_SINT64 (-0x8000000000000000) +/** + * Maximum value for an entity of type sint64. Only available if the switch + * SINT64_SUPPORTED is defined. + */ +#define MAX_SINT64 (0x7fffffffffffffff) +#endif + +#ifdef UINT64_SUPPORTED +/** + * Maximum value for an entity of type uint64. Only available if the switch + * UINT64_SUPPORTED is defined. + */ +#define MAX_UINT64 (0xffffffffffffffff) +#endif + +/******************** +* boolean: TRUE/FALSE +*********************/ +/** Type definition for a boolean/logical value */ +typedef uint8 boolean; + +#ifndef TRUE +/** Value representing the boolean/logical value false. */ +#define FALSE 0 +/** Value representing the boolean/logical value true. */ +#define TRUE (!FALSE) +#endif + +/****************************************** +* Portable bitfield definitions +*******************************************/ + +#if defined(COMPILER_IAR_AVR) || defined(COMPILER_IAR_ARM) || defined(_WIN32) || defined(COMPILER_ARM_ARM) || defined(COMPILER_GNUC) +/** Type definition to be used when implementing bit-fields that should hold + * signed values. + */ +typedef sint8 sbitfield; +/** Type definition to be used when implementing bit-fields that should hold + * unsigned values. + */ +typedef uint8 ubitfield; +#elif defined(_lint) +typedef signed int sbitfield; +typedef unsigned int ubitfield; +#else +#error Unknown preferred bitfield definition for this compiler +#endif + +/************************* +* Bit mask definitions +**************************/ + +/** +* This sections defines a set of masks implemented as scalar unsigned values +* that can be used to mask out bits of a scalar entity. The definitions are +* named BIT_0 through BIT_31 and each implements the unsigned value of two to +* the power of the value in the definitions name. E.g. BIT_0 implements the value of 1 while BIT_10 implements the value of 0x0400 (equals 1024 in decimal form). +*/ +#define BIT_0 0x0001U +#define BIT_1 0x0002U +#define BIT_2 0x0004U +#define BIT_3 0x0008U +#define BIT_4 0x0010U +#define BIT_5 0x0020U +#define BIT_6 0x0040U +#define BIT_7 0x0080U +#define BIT_8 0x0100U +#define BIT_9 0x0200U +#define BIT_10 0x0400U +#define BIT_11 0x0800U +#define BIT_12 0x1000U +#define BIT_13 0x2000U +#define BIT_14 0x4000U +#define BIT_15 0x8000U +#define BIT_16 0x00010000UL +#define BIT_17 0x00020000UL +#define BIT_18 0x00040000UL +#define BIT_19 0x00080000UL +#define BIT_20 0x00100000UL +#define BIT_21 0x00200000UL +#define BIT_22 0x00400000UL +#define BIT_23 0x00800000UL +#define BIT_24 0x01000000UL +#define BIT_25 0x02000000UL +#define BIT_26 0x04000000UL +#define BIT_27 0x08000000UL +#define BIT_28 0x10000000UL +#define BIT_29 0x20000000UL +#define BIT_30 0x40000000UL +#define BIT_31 0x80000000UL + +/***************************** +* Macro's for fixed size enums +* +* Example of use: +* +* TYPEDEF_ENUM { +* Def1, +* ..., +* Defn +* }ENUM8 (MyEnum_t); // Or ENUM16 or ENUM32 +* +******************************/ +/** This macro should be used to start the definition of an enumerated type. */ +#define TYPEDEF_ENUM enum +/** + * This macro should be used to finalize the definition of an enumerated type + * "t" compatible with the uint8 data type described in section 3.1.1. + */ +#define ENUM8(t) ;typedef uint8 t +/** + * This macro should be used to finalize the definition of an enumerated type + * "t" compatible with the uint16 data type described in section 3.1.1. + */ +#define ENUM16(t) ;typedef uint16 t +/** + * This macro should be used to finalize the definition of an enumerated type + * "t" compatible with the uint32 data type described in section 3.1.1. + */ +#define ENUM32(t) ;typedef uint32 t +/** + * This macro should be used to finalize the definition of an enumerated type + * "t" compatible with the sint8 data type described in section 3.1.1. + */ +#define SIGNED_ENUM8(t) ;typedef sint8 t +/** + * This macro should be used to finalize the definition of an enumerated type + * "t" compatible with the sint16 data type described in section 3.1.1. + */ +#define SIGNED_ENUM16(t) ;typedef sint16 t +/** + * This macro should be used to finalize the definition of an enumerated type + * "t" compatible with the sint32 data type described in section 3.1.1. + */ +#define SIGNED_ENUM32(t) ;typedef sint32 t + +#endif // INCLUSION_GUARD_T_BASICDEFINITIONS_H + diff --git a/source/LCM/include/t_bulk_protocol.h b/source/LCM/include/t_bulk_protocol.h new file mode 100644 index 0000000..fabc1a4 --- /dev/null +++ b/source/LCM/include/t_bulk_protocol.h @@ -0,0 +1,155 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_BULK_PROTOCOL_H_ +#define _T_BULK_PROTOCOL_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup bulk_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "t_r15_network_layer.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** Maximum bulk processes used in transport layer. */ +#define MAX_BULK_TL_PROCESSES 16 + +/** Mask for selecting the TYPE bits in type/flags field */ +#define MASK_BULK_COMMAND_SELECT (0x07) + +/** Defined bulk error in 32 bits format. */ +#define BULK_ERROR 0xffffffff +/** Defined bulk error in 64 bits format. */ +#define BULK_ERROR_64 0xffffffffffffffff + +/** Defined Callback functions used for bulk transfer in the LCM on PC side. */ +typedef void (*BulkCommandReqCallback_t)(void *Object_p, uint16 *Session_p, uint32 *ChunkSize_p, uint64 *Offset_p, uint32 *Length_p, boolean ACK_Read); +typedef void(*BulkDataReqCallback_t)(void *Object_p, uint16 *Session_p, uint32 *ChunkSize_p, uint64 *Offset_p, uint32 *Length_p, uint64 *TotalLength_p, uint32 *TransferedLength_p); +typedef void(*BulkDataEndOfDump_t)(void *Object_p); + + +/** Defined bulk commands. */ +typedef enum { + CMD_BULK_STATUS = 0x00, /**< Status packet type command. */ + CMD_BULK_READ = 0x01, /**< Read packet type command. */ + CMD_BULK_DATA = 0x02, /**< Data packet type command. */ + CMD_BULK_WRITE = 0x03 /**< Write packet type command. */ +} TL_BulkCmmands_t; + +/** Defined bulk session ID status. */ +typedef enum { + BULK_SESSION_INVALID = 0x00, /**< Received packet with invalid session ID.*/ + BULK_SESSION_NEW = 0x01, /**< Received packet with new session ID.*/ + BULK_SESSION_CURRENT = 0x02 /**< Received packet with current session ID.*/ +} TL_BulkSessionID_Status_t; + +/** States of bulk protocol. */ +TYPEDEF_ENUM { + BULK_IDLE_STATE = 0, /**< Idle state. */ + SEND_READ_REQUEST = 1, /**< Send read request command to PC. */ + WAIT_CHUNKS = 2, /**< Wait to receive all expected chunks. */ + SEND_BULK_ACK = 3, /**< Send bulk acknowledge to PC. */ + WAIT_BULK_ACK_TIMEOUT = 4, /**< Wait timeout for confirmation of bulk + ack command. */ + SEND_WRITE_REQUEST = 5, /**< Send write request command. */ + WAIT_READ_REQUEST = 6, /**< Wait read request from PC. */ + SENDING_CHUNKS = 7, /**< Send chunks to PC. */ + WAIT_BULK_ACK = 8, /**< Wait bulk acknowledge to PC. */ + WRITE_BULK_FINISH = 9, /**< Bulk acknowledge has been received, + finish the write bulk process. */ + WAIT_WRITE_REQUEST = 10 /**< Wait bulk request command. */ +} ENUM8(TL_BulkProtocolState_t); + +/** Defined bulk process states. */ +TYPEDEF_ENUM { + BULK_SESSION_IDLE = 0x00, /**< Bulk transfer is closed and ready + for starting. */ + BULK_SESSION_OPEN = 0x01, /**< Bulk transfer is opened. */ + BULK_SESSION_PROCESSING = 0x02, /**< Processing the bulk transfer. */ + BULK_SESSION_FINISHED = 0x04, /**< Bulk transfer is finished. */ +} ENUM8(TL_BulkSessionState_t); + +/** Bulk session Mode. */ +typedef enum { + BULK_RECEIVE = 1, /**< Receiving Mode. */ + BULK_SEND = 2, /**< Transmitting Mode. */ + BULK_RS = 3, /**< Receiving and transmitting Mode. */ +} TL_SessionMode_t; + +/** + * Status of received chunks in the current session. + */ +typedef enum { + /**< Chunks are being received in order in current session. */ + VECTOR_NOT_COMPLETE = 0, + /**< All chunks for the current session have been received. */ + VECTOR_COMPLETE = 1, + /**< Missing chunk(s) in the current session. */ + VECTOR_MISSING_CHUNK = 2, +} TL_BulkVectorStatus_t; + +/** + * Bulk Vector Entry parameters + */ +typedef struct { + PacketMeta_t *Buffer_p; /**< Pointer to reserved buffer meta info. */ + uint8 *Payload_p; /**< Pointer to payload data in reserved + buffer. */ + uint8 *Hash_p; /**< Pointer to calculated payload hash. */ +} TL_BulkVectorEntry_t; + +/** + * This type defines Bulk Vector parameters + */ +typedef struct { + /**< Bulk session status. */ + TL_BulkSessionState_t Status; + /**< Requested bulk process(Read or Write). */ + TL_SessionMode_t Mode; + /**< State of bulk protocol state machine. */ + TL_BulkProtocolState_t State; + /**< Current bulk session ID. */ + uint16 SessionId; + /**< Length of the file transfered with bulk transfer. */ + uint64 TotalLength; + /**< Length of payload data transfered with bulk transfer. */ + uint32 Length; + /**< Number of used buffers for bulk transfer. */ + uint32 Buffers; + /**< requested size of payload. */ + uint32 ChunkSize; + /**< Offset in the cuurent opened file.*/ + uint64 Offset; + /**< Length of payload data transfered with bulk transfer. */ + uint32 TransferedLength; + /**< Callback function pointer for bulk command handling.*/ + void *BulkCommandCallback_p; + /**< Callback function pointer for bulk data command handling.*/ + void *BulkDataCallback_p; + /**< Array with information for used buffers. */ + TL_BulkVectorEntry_t Entries[MAX_BULK_TL_PROCESSES]; +} TL_BulkVectorList_t; + +/** Structure for current bulk transfer handling. */ +typedef struct { + uint32 TimerKey; /**< Timer Id for current used timer. */ + TL_BulkVectorList_t *BulkVector_p; /**< Current used bulk vector for bulk + transfer.*/ +} BulkHandle_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*_T_BULK_PROTOCOL_H_*/ diff --git a/source/LCM/include/t_command_protocol.h b/source/LCM/include/t_command_protocol.h new file mode 100644 index 0000000..2ca51c6 --- /dev/null +++ b/source/LCM/include/t_command_protocol.h @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_COMMAND_PROTOCOL_H_ +#define _T_COMMAND_PROTOCOL_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup command_protocol + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "error_codes.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** + * The command type. COMMAND and GENERAL_RESPONSE can be used to + * indicate what type of commands to send. The _ACK command types are + * used internally to provide end-to-end reliability. + */ +typedef enum { + COMMAND_TYPE, /**< Command type of the packet.*/ + COMMAND_ACK, /**< Acknwoledge type of the packet.*/ + GENERAL_RESPONSE, /**< General response type of the packet.*/ + GENERAL_RESPONSE_ACK /**< General response acknwoledge type of the packet.*/ +} CommandType_t; + + +/** + * Used for storing input and output Payload data. + */ +typedef struct Buffer_s { + uint32 Size; /**< Size of the buffer in bytes.*/ + uint8 *Data_p; /**< Data buffer. */ +} Buffer_t; + +/** + * Used for storing the status of the general response send by the + * command and for storing the data that should be send with the + * general response. + */ +typedef struct Result_s { + ErrorCode_e Status; /**< Status send by the general response. */ + Buffer_t *Response_p; /**< Buffer holding data that should be + returned trough the general response */ +} Result_t; + +/** + * Holds information for the command received from the transport layer. + */ +typedef struct CommandData_s { + uint8 CommandNr; /**< Number of the command. */ + uint8 ApplicationNr;/**< Number of the application (command) group. */ + uint16 SessionNr; /**< Number of the session in which this command + was received.*/ + CommandType_t Type; /**< Command type. */ + Buffer_t Payload; /**< Holds the data received with the command.*/ +} CommandData_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*_T_COMMAND_PROTOCOL_H_*/ diff --git a/source/LCM/include/t_communication_service.h b/source/LCM/include/t_communication_service.h new file mode 100644 index 0000000..74e72a9 --- /dev/null +++ b/source/LCM/include/t_communication_service.h @@ -0,0 +1,344 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _INCLUSION_GUARD_T_COMMUNICATION_SERVICE_H_ +#define _INCLUSION_GUARD_T_COMMUNICATION_SERVICE_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "c_system.h" +#include "t_basicdefinitions.h" +#include "error_codes.h" +#include "t_security_algorithms.h" +#include "t_command_protocol.h" +#include "t_queue.h" +#include "t_time_utilities.h" + +#ifndef CFG_ENABLE_LOADER_TYPE +#ifdef WIN32 +#include <windows.h> +#endif +#endif + + +/******************************************************************************* + * Types, constants and external variables + ******************************************************************************/ +/* Defined protocol families */ +typedef enum { + R15_FAMILY = 0, /*< R15 protocol family. */ + A2_FAMILY = 1, /*< A2 protocol family. */ +#ifndef CFG_ENABLE_LOADER_TYPE + TI_FAMILY = 2, /*< TI protocol family. */ + PROTROM_FAMILY = 3, /*< PROTROM protocol family. */ + Z_FAMILY = 4 /*< Z protocol family. */ +#endif +} Family_t; + +typedef void (*CommunicationCallback_t)(const void *Data_p, const uint32 Length, void *Param_p); +typedef void (*HashCallback_t)(void *Data_p, const uint32 Length, uint8 *Hash_p, void *Param_p); +typedef boolean(*DeviceRead_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p); +typedef ErrorCode_e(*DeviceWrite_fn)(void *Data_p, uint32 Length, CommunicationCallback_t Callback_fn, void *Param_p); +typedef ErrorCode_e(*DeviceCancel_fn)(void *Param_p); +typedef void (*HashDeviceCancel_fn)(void *Object_p, void **Param_p); +typedef void (*DeviceCalculate_fn)(void *Object_p, HashType_e Type, void *Data_p, const uint32 Length, uint8 *Hash_p, HashCallback_t Callback_fn, void *Param_p); + +/** definition of Buffer interface functions */ +typedef ErrorCode_e(*BuffersInit_t)(void *Object_p); +typedef void *(*BufferAllocate_t)(void *Object_p, int BufferSize); +typedef ErrorCode_e(*BufferRelease_t)(void *Object_p, void *Buffer_p, int BufferSize); +typedef uint32(*BuffersAvailable_t)(void *Object_p, int BufferSize); +typedef void (*BuffersDeinit_t)(void *Object_p); + + +/** definition of Timer interface functions */ +typedef ErrorCode_e(*TimersInit_t)(void *Object_p, uint32 Timers); +typedef uint32(*TimerGet_t)(void *Object_p, Timer_t *Timer_p); +typedef ErrorCode_e(*TimerRelease_t)(void *Object_p, uint32 TimerKey); +typedef uint32(*ReadTime_t)(void *Object_p, uint32 TimerKey); +typedef uint32(*GetSystemTime_t)(void *Object_p); + +/** definition of Queue interface functions */ +typedef void (*FifoCreate_t)(void *Object_p, void **const Queue_pp, const uint32 MaxLength, void (*DestroyElement)(void *Element_p)); +typedef void (*FifoDestroy_t)(void *Object_p, void **const Queue_pp); +typedef ErrorCode_e(*FifoEnqueue_t)(void *Object_p, void *const Queue_p, void *const Value_p); +typedef void *(*FifoDequeue_t)(void *Object_p, void *const Queue_p); +typedef QueueCallback_fn(*Fifo_SetCallback_t)(void *Object_p, void *const Queue_p, + const QueueCallbackType_e Type, + const QueueCallback_fn Callback, + void *const Param_p); +typedef boolean(*Fifo_IsEmpty_t)(void *Object_p, const void *const Queue_p); +typedef boolean(*Fifo_IsMember_t)(void *Object_p, const void *const Queue_p, void *Value_p, boolean(*Match)(void *Value1_p, void *Value2_p)); +typedef int (*Fifo_GetNrOfElements_t)(void *Object_p, const void *const Queue_p); + +typedef void (*RFifoCreate_t)(void *Object_p, void **const Queue_pp, const uint32 MaxLength, void (*DestroyElement)(void *Element_p)); +typedef void (*RFifoDestroy_t)(void *Object_p, void **const Queue_pp); +typedef ErrorCode_e(*RFifoEnqueue_t)(void *Object_p, void *const Queue_p, void *const Value_p); +typedef void *(*RFifoDequeue_t)(void *Object_p, void *const Queue_p); +typedef QueueCallback_fn(*RFifo_SetCallback_t)(void *Object_p, void *const Queue_p, + const QueueCallbackType_e Type, + const QueueCallback_fn Callback, + void *const Param_p); +typedef boolean(*RFifo_IsEmpty_t)(void *Object_p, const void *const Queue_p); +typedef boolean(*RFifo_IsMember_t)(void *Object_p, const void *const Queue_p, void *Value_p, boolean(*Match)(void *Value1_p, void *Value2_p)); +typedef int (*RFifo_GetNrOfElements_t)(void *Object_p, const void *const Queue_p); + +typedef ErrorCode_e(*Do_CEH_Call_t)(void *Object_p, CommandData_t *CmdData_p); + + +/** Structure with pointers to buffer interface functions */ +typedef struct { + BuffersInit_t BuffersInit_Fn; /**< Pointer to function for Buffers + initialization. */ + BufferAllocate_t BufferAllocate_Fn; /**< Pointer to function for Buffer + allocation. */ + BufferRelease_t BufferRelease_Fn; /**< Pointer to function for Buffer + releasing.*/ + BuffersAvailable_t BuffersAvailable_Fn; /**< Pointer to function for check + for available buffers with + specified size of buffers. */ + BuffersDeinit_t BuffersDeinit_Fn; /**< Pointer to function for Buffers + de-initialization. */ + void *Object_p; /**< Pointer for instancing. It is + used in the PC application, but + in the loaders is always NULL */ +} BuffersInterface_t; + + +/** Structure with pointers to timer interface functions */ +typedef struct { + TimersInit_t TimersInit_Fn; /**< Pointer to function for Timers + initialization. */ + TimerGet_t TimerGet_Fn; /**< Pointer to function for creating and + starting timer. */ + TimerRelease_t TimerRelease_Fn; /**< Pointer to function for removing + defined timer. */ + ReadTime_t ReadTime_Fn; /**< Pointer to function for read time from + specified timer. */ + GetSystemTime_t GetSystemTime_Fn; /**< Pointer to function for read curent + sytem time. */ + void *Object_p; /**< Pointer for instancing. It is used in + the PC application, but in the loaders + is always NULL */ +} TimersInterface_t; + +/** Structure with pointers to queue interface functions */ +typedef struct { + FifoCreate_t FifoCreate_Fn; /**< Pointer to function + for Fifo creating.*/ + FifoDestroy_t FifoDestroy_Fn; /**< Pointer to function + for Fifo destroying.*/ + FifoEnqueue_t FifoEnqueue_Fn; /**< Pointer to function + for enqueue packet in + the fifo. */ + FifoDequeue_t FifoDequeue_Fn; /**< Pointer to function + for dequeue packet + from the fifo. */ + Fifo_SetCallback_t Fifo_SetCallback_Fn; /**< Pointer to function + for registers an event + listener for the + specified queue.*/ + Fifo_IsEmpty_t Fifo_IsEmpty_Fn; /**< Pointer to function + for check, is Fifo + empty.*/ + Fifo_IsMember_t Fifo_IsMember_Fn; /**< Pointer to function + for Checks if the + provided element is + member of the fifo*/ + Fifo_GetNrOfElements_t Fifo_GetNrOfElements_Fn; /**< Pointer to function + for reading the number + of elements in the + Fifo.*/ + + RFifoCreate_t RFifoCreate_Fn; /**< Pointer to function + for Fifo creating. + First all interrupts + are disabled, + function executed and + then all interrupt + enabled. */ + RFifoDestroy_t RFifoDestroy_Fn; /**< Pointer to function + for Fifo destroing. + First all interrupts + are disabled, + function executed and + then all interrupt + enabled. */ + RFifoEnqueue_t RFifoEnqueue_Fn; /**< Pointer to function + for enqueue packet in + the fifo. First all + interrupts are + disabled, function + executed and then all + interrupt enabled. */ + RFifoDequeue_t RFifoDequeue_Fn; /**< Pointer to function + for dequeue packet + from the fifo. First + all interrupts are + disabled, function + executed and then all + interrupt enabled. */ + RFifo_SetCallback_t RFifo_SetCallback_Fn; /**< Pointer to function + for setting two + callback functions + used by the FIFO. + First all interrupts + are disabled, + function executed and + then all interrupt + enabled. */ + RFifo_IsEmpty_t RFifo_IsEmpty_Fn; /**< Pointer to function + for for check, is Fifo + empty. First all + interrupts are + disabled, function + executed and then all + interrupt enabled. */ + RFifo_IsMember_t RFifo_IsMember_Fn; /**< Pointer to function + for checks if the + provided element is + member of the fifo. + First all interrupts + are disabled, + function executed and + then all interrupt + enabled. */ + RFifo_GetNrOfElements_t RFifo_GetNrOfElements_Fn; /**< Pointer to function + for reading the number + of elements in the + Fifo. First all + interrupts are + disabled, function + executed and then all + interrupt enabled. */ + void *Object_p; /**<Pointer for instancing. + It is used in the PC + application, but in the + loaders is always NULL.*/ +} QueueInterface_t; + +/** + * Interface structures for buffers, timers and queue. + * Structure contain all interface functions for buffers, timers and + * queue manipulating. + */ +typedef struct { + BuffersInterface_t *BufferFunctions_p; /**< Pointer to buffer interface + structure. */ + QueueInterface_t *QueueFunctions_p; /**< Pointer to queue interface + structure. */ + TimersInterface_t *TimerFunctions_p; /**< Pointer to timers interface + structure. */ +} FunctionInterface_t; + +/** + * Interface structure for communication device. + * Structure contain all functions for communication device manipulating. + */ +typedef struct { + DeviceRead_fn Read; /**< Pointer to function for read data from + communication device. */ + DeviceWrite_fn Write; /**< Pointer to function for write data thru the + communication device. */ + DeviceCancel_fn Cancel; /**< Pointer to function for caneling current + communcation with communiation device. */ + void *Context_p; /**< Pointer to Device description data. */ +} CommunicationDevice_t; + +/** + * Interface structure for HASH device. + * Structure contain all functions for HASH device manipulating. + */ +typedef struct { + DeviceCalculate_fn Calculate; /**< Pointer to function for calculation. */ + HashDeviceCancel_fn Cancel; /**< Pointer to function for cancel of + calculation. */ + void *Object_p; /**< Pointer for instancing. It is used in the + PC application, but in the loaders is + always NULL.*/ +} HashDevice_t; + +/** + * Holds information about a command that is placed (or will be placed) in + * the command execution queue. + */ +typedef struct ExecutionContext_s { + void *Command_p; /**< Pointer to command register structure + containing information for initialization + and execution of the command.*/ + void *LocalState_p; /**< If needed holds information internal to the + command, else it is NULL.*/ + boolean Running; /**< Indicates the state of the command that is + registered in the Command Execution Service.*/ + CommandData_t Received; /**< Holds data for the received command. */ + Result_t Result; /**< Pointer to structure that holds command + status and command data, including payload + or output data.*/ + uint32 Progress; /**< Command completed in percent. */ +} ExecutionContext_t; + + +/** Communication context.*/ +typedef struct { + void *Inbound_p; /**< Pointer to structure for + handling incomming + packets.*/ + void *Outbound_p; /**< Pointer to structure for + handling outgoing + packets.*/ + HashDevice_t *HashDevice_p; /**< Pointer to Hash device + descriptor. */ + CommunicationDevice_t *CommunicationDevice_p; /**< Pointer to Communication + device descriptor. */ + struct FamilyDescriptor_s *Family_p; /**< Pointer to interface + structure for protocol + family. */ + void *FamilyContext_p; /**< Pointer to current + protocol family context.*/ + uint8 *BackupCommBuffer_p; /**< Pointer to backup + buffer.*/ + uint32 BackupCommBufferSize; /**< Size of the backup + buffer.*/ + FunctionInterface_t *Functions_p; /**< Pointer to interface + functions for buffers, + timers and queue.*/ + Do_CEH_Call_t Do_CEH_Call_Fn; /**< Pointer to calback + function for handling + commands received thru + the LCM.*/ + void *Object_p; /**< Pointer for instancing. + It is used in the PC + application, but in the + loaders is always NULL.*/ + HashType_e CurrentFamilyHash; /**< Hashing algorithm that + is used by the family + which is active at the + moment. */ +} Communication_t; + +/** Structure for initialization and manipulation of protocol family */ +typedef struct FamilyDescriptor_s { + ErrorCode_e(*FamilyInit_fn)(Communication_t *Communication_p); + /**< Pointer to Interface function for protocol family initialization. */ + ErrorCode_e(*FamilyShutdown_fn)(Communication_t *Communication_p); + /**< Pointer to Interface function for protocol family de-initialization. */ + ErrorCode_e(*Process_fn)(Communication_t *Communication_p); + /**< Pointer to Pooling function in curren protocol family. */ + ErrorCode_e(*Send_fn)(Communication_t *Communication_p, void *InputData_p); + /**< Pointer to function for sending packets.*/ + ErrorCode_e(*SetProtocolTimeouts_fn)(Communication_t *Communication_p, void *TimeoutData_p); + /**< Pointer to function for setting communication timeouts for current protocol family. */ + ErrorCode_e(*GetProtocolTimeouts_fn)(Communication_t *Communication_p, void *TimeoutData_p); + /**< Pointer to function for getting communication timeouts from current protocol family. */ +} FamilyDescriptor_t; + +/** @} */ +#endif // _INCLUSION_GUARD_T_COMMUNICATION_SERVICE_H_ + diff --git a/source/LCM/include/t_protrom_header.h b/source/LCM/include/t_protrom_header.h new file mode 100644 index 0000000..63ae6ef --- /dev/null +++ b/source/LCM/include/t_protrom_header.h @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef T_PROTROM_HEADER_H_ +#define T_PROTROM_HEADER_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup protrom_family + * @{ + * @addtogroup ldr_protrom_header + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** Header pattern for the protrom protocol*/ +#define PROTROM_HEADER_PATTERN (0xAA) +/** Source address in the header*/ +#define PROTROM_SOURCE_ADDRESS (0xEE) +/** Destination address in the header*/ +#define PROTROM_DESTINATION_ADDRESS (0xEE) +/** The length of the header */ +#define PROTROM_HEADER_LENGTH 7 +/** Value of the reserved field */ +#define PROTROM_RESERVED_FIELD 0x00 +/** Offset of the header in the buffer */ +#define HEADER_OFFSET_IN_BUFFER 8 + +/** + * Header search results + */ +#define NO_PROTROM_HEADER_PATTERN (0x00) +#define PROTROM_HEADER_PATTERN_MATCH (0x01) +#define PROTROM_HEADER_PATTERN_CANDIDATE (0x02) + +/** Protocol types*/ +typedef enum { + PROTO_PROTROM = 0xFB, /**< PROTROM protocol identification number. */ +} Protrom_Protocol_t; + +/** Header for command and bulk protocol */ +typedef struct { + uint8 HeaderPattern; /**< Header pattern for marking header start.*/ + uint8 Protocol; /**< Protocol type. */ + uint8 SourceAddress; /**< Source address. */ + uint8 DestinationAddress; /**< Destionation address. */ + uint8 ReservedField; /**< Reserved field. */ + uint16 PayloadLength; /**< Payload length. */ +} Protrom_Header_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*T_PROTROM_HEADER_H_*/ diff --git a/source/LCM/include/t_protrom_network.h b/source/LCM/include/t_protrom_network.h new file mode 100644 index 0000000..c33deac --- /dev/null +++ b/source/LCM/include/t_protrom_network.h @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef T_PROTROM_NETWORK_H_ +#define T_PROTROM_NETWORK_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup protrom_family + * @{ + * @addtogroup ldr_protrom_network_layer + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_communication_service.h" +#include "t_protrom_header.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** PROTROM protocol ID */ +#define PROTROM_PROTOCOL (0xFB) +/** PROTROM CRC length */ +#define PROTROM_CRC_LENGTH (2) + +/** Defined state of the receiver */ +typedef enum { + PROTROM_RECEIVE_HEADER, /**< State for receiving Header.*/ + PROTROM_RECEIVE_PAYLOAD, /**< State for receiving Payload.*/ + PROTROM_RECEIVE_ERROR /**< State for error handling.*/ +} Protrom_InboundState_t; + +/** Defined state of the transmitter */ +typedef enum { + PROTROM_SEND_IDLE, /**< Transmiter idle state.*/ + PROTROM_SEND_PACKET, /**< Transmiter send packet. */ + PROTROM_SENDING_PACKET /**< Transmiter is in process sending packet.*/ +} Protrom_OutboundState_t; + +/** Structure for the packet meta data type. */ +typedef struct Protrom_Packet { + Protrom_Header_t Header; /**< PROTROM header structure. */ + uint8 *Buffer_p; /**< Temporary buffer for receiving data.*/ + uint16 CRC; /**< Calculated CRC of received packet. */ + Communication_t *Communication_p; /**< The communication over which this + packet has been/is to be transferred + over */ +} Protrom_Packet_t; + +/** Structure for handling incoming PROTROM packets.*/ +typedef struct { + /**< State of the state machine for handling incoming PROTROM packets. */ + Protrom_InboundState_t State; + /**< Number of requested data for receiving from communication device. */ + uint32 ReqData; + /**< Number of receivied data from communication device. */ + uint32 RecData; + /**< Number of receivied data from backup buffer used for switching the + * protocol family. */ + uint32 RecBackupData; + /**< Offset in the buffer for next data that should be received. */ + uint32 ReqBuffOffset; + /**< Temporary pointer to buffer for handling received data.*/ + uint8 *Target_p; + /**< Temporary buffer for receiving data. */ + uint8 Scratch[PROTROM_HEADER_LENGTH]; + /** Temporary structure for handling PROTROM packet.*/ + Protrom_Packet_t *Packet_p; +} Protrom_Inbound_t; + +/** Structure for handling outgoing PROTROM packets.*/ +typedef struct { + /**< State of the state machine for handling outgoing PROTROM packets. */ + Protrom_OutboundState_t State; + /** Temporary pointer for handling PROTROM packet.*/ + Protrom_Packet_t *Packet_p; + /**< Boolean value for controling re-entry in transmiter fucntion. */ + boolean InLoad; +} Protrom_Outbound_t; + + +/** PROTROM Network context */ +typedef struct { + /**< Structure for handling incoming PROTROM packets.*/ + Protrom_Inbound_t Inbound; + /**< Structure for handling outgoing PROTROM packets.*/ + Protrom_Outbound_t Outbound; +} Protrom_NetworkContext_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*T_NETWORK_LAYER_H_*/ diff --git a/source/LCM/include/t_protrom_transport.h b/source/LCM/include/t_protrom_transport.h new file mode 100644 index 0000000..20eef29 --- /dev/null +++ b/source/LCM/include/t_protrom_transport.h @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef INCLUSION_GUARD_T_PROTROM_TRANSPORT_H +#define INCLUSION_GUARD_T_PROTROM_TRANSPORT_H +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup protrom_family + * @{ + * @addtogroup ldr_protrom_transport_layer + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "t_protrom_network.h" + +/******************************************************************************* + * Types, constants and external variables + ******************************************************************************/ +/** Callback function type for the Protrom protocol handler. */ +typedef ErrorCode_e(* Protrom_Callback_fn)(void *Param_p, uint8 PDU, int PayloadLength, void *Payload_p, Communication_t *Communication_p); + +/** Structure for transfer input parameters in PROTROM protocol family */ +typedef struct { + Protrom_Header_t *Header_p; /**< Pointer to the PROTROM header structure.*/ + void *Payload_p; /**< Pointer to the payload data.*/ +} Protrom_SendData_LP_t; + +/** Protorm Transport context */ +typedef struct { + /**< Callback function pointer for PROTROM protocol handler. */ + Protrom_Callback_fn Callback; +} Protrom_TransportContext_t; + +/** @} */ +/** @} */ +/** @} */ +#endif // INCLUSION_GUARD_T_PROTROM_TRANSPORT_H + diff --git a/source/LCM/include/t_queue.h b/source/LCM/include/t_queue.h new file mode 100644 index 0000000..f6250b6 --- /dev/null +++ b/source/LCM/include/t_queue.h @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_QUEUE_H_ +#define _T_QUEUE_H_ + +/** + * @addtogroup ldr_utilities + * @{ + * @addtogroup queue + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** type of queue callback functions. */ +typedef enum { + QUEUE_EMPTY, + QUEUE_NONEMPTY +} QueueCallbackType_e; + +/** + * Typedef of callback function used for the queue. + * One callback function is used when the fifo is empty, + * and another when the fifo is nonempty. + * These function are set by calling Do_Fifo_SetCallback. + * + * @param [in] Queue_p pointer to a valid queue(One that is created using + * Do_Fifo_Create). + * @param [in] Param_p additional parameters to the function. + * @return None. + */ +typedef void (*QueueCallback_fn)(const void *const Queue_p, void *Param_p); + +/** @} */ +/** @} */ +#endif /*T_QUEUE_H_*/ diff --git a/source/LCM/include/t_r15_header.h b/source/LCM/include/t_r15_header.h new file mode 100644 index 0000000..55b717b --- /dev/null +++ b/source/LCM/include/t_r15_header.h @@ -0,0 +1,102 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_R15_HEADER_H_ +#define _T_R15_HEADER_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup ldr_r15_header + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" +#include "command_ids.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +#define ALIGN_SIZE 512 + +/** Length of the command packet header.*/ +#define TL_COMMAND_PACKET_HEADER_LENGTH 20 +/** Length of the bulk packet header.*/ +#define TL_BULK_PACKET_HEADER_LENGTH 36 +/** Length of the calculated sha256 hash. */ +#define SHA_256_HASH_LENGTH 32 +/** Header pattern for the loader protocol.*/ +#define HEADER_PATTERN (0xAA) +/** Extended header pattern of the loader protocol.*/ +#define HEADER_PATTERN_EXTENSION (0xEE) +/** The length of the header. */ +#define HEADER_LENGTH 16 +/** The length of the command extended header. */ +#define COMMAND_EXTENDED_HEADER_LENGTH 4 +/** The length of the bulk extended header. */ +#define BULK_EXTENDED_HEADER_LENGTH 20 +/** Offset of the header in the buffer. */ +#define HEADER_OFFSET_IN_BUFFER 8 + +#define ALIGNED_HEADER_LENGTH ALIGN_SIZE +#define ALIGNED_COMMAND_EXTENDED_HEADER_LENGTH ALIGN_SIZE +#define ALIGNED_BULK_EXTENDED_HEADER_LENGTH ALIGN_SIZE + +/** + * Header search results + */ +#define NO_HEADER_PATTERN (0x00) +#define HEADER_PATTERN_MATCH (0x01) +#define HEADER_PATTERN_CANDIDATE (0x02) + +/** Protocol types*/ +typedef enum { + PROTO_COMMAND = 0xBC, /**< R15 command protocol identification number. */ + PROTO_BULK = 0xBD /**< R15 bulk protocol identification number. */ +} R15_Protocol_t; + +/** Header for command and bulk protocol */ +typedef struct { + uint8 HeaderPattern; /**< Header pattern for marking header start.*/ + uint8 Protocol; /**< Protocol type. */ + uint16 HeaderPatternExtension; /**< Header pattern extension.*/ + uint8 Flags; /**< Flasgs for the header.*/ + uint8 ExtendedHeaderLength; /**< Extended header length.*/ + uint8 ExtendedHeaderChecksum; /**< Extended header checksum.*/ + uint32 PayloadLength; /**< Payload length. */ + uint32 PayloadChecksum; /**< Payload checksum. */ + uint8 HeaderChecksum; /**< Header checksum. */ +} R15_Header_t; + + +/** + * Extended header for command protocol + */ +typedef struct { + uint16 SessionState; /**< Session and state for command header */ + uint8 Command; /**< Specified command */ + GroupId_e CommandGroup; /**< Specified command group */ +} CommandExtendedHeader_t; + +/** + * Extended header for bulk protocol + */ +typedef struct { + uint16 Session; /**< Session for bulk header */ + uint8 TypeFlags; /**< Flags for data packet */ + uint8 AcksChunk; /**< Number of acknowledged chunks or chunk identifier */ + uint32 ChunkSize; /**< The maximum payload size of data packet */ + uint64 Offset; /**< Offset from where the reading and writing of data should begin*/ + uint32 Length; /**< How many bytes should be read/write */ +} BulkExtendedHeader_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*_T_R15_HEADER_H_*/ diff --git a/source/LCM/include/t_r15_network_layer.h b/source/LCM/include/t_r15_network_layer.h new file mode 100644 index 0000000..c99d073 --- /dev/null +++ b/source/LCM/include/t_r15_network_layer.h @@ -0,0 +1,309 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_R15_NETWORK_LAYER_H_ +#define _T_R15_NETWORK_LAYER_H_ +/** + * @addtogroup ldr_communication_serv + * @{ + * @addtogroup r15_family + * @{ + * @addtogroup ldr_r15_network_layer + * @{ + */ +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_communication_service.h" +#include "t_r15_header.h" +#include "t_time_utilities.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** PROTROM protocol ID*/ +#define PROTROM_PROTOCOL (0xFB) +/** COMMAND protocol ID*/ +#define COMMAND_PROTOCOL (0xBC) +/** BULK protocol ID*/ +#define BULK_PROTOCOL (0xBD) +/** State: Command packet */ +#define COMMAND_PACKAGE (0x0000) +/** State: Acknowledge packet */ +#define ACK_PACKAGE (0x0001) +/** State: General response */ +#define GENERAL_RESPONSE_PACKAGE (0x0002) +/** State: Acknowledge for general response */ +#define ACK_GENERAL_RESPONSE_PACKAGE (0x0003) +/** + * Maximum numbers of used process in transport layer + */ +#define MAX_SIZE_RETRANSMISSION_LIST 32 +/** Amount of resends of the same package (until it aborts) */ +#define MAX_RESENDS (0x03) + + +#ifndef CFG_ENABLE_LOADER_TYPE +/** Acknowledge packet time(mS) out value */ +#define ACK_TIMEOUT_IN_MS 10000 +/** Default time(mS) out for receiving bulk command */ +#define BULK_COMMAND_RECEIVING_TIMEOUT 10000 +/** Default time(mS) out for receiving bulk data. This value is set for UART on 115200kbps! */ +#define BULK_DATA_RECEIVING_TIMEOUT 120000 + +#else +/** Acknowledge packet time(mS) out value */ +#define ACK_TIMEOUT_IN_MS (1000) +/** Default time(mS) out for receiving bulk command */ +#define BULK_COMMAND_RECEIVING_TIMEOUT (1000) +/** Default time(mS) out for receiving bulk data. This value is set for UART on 115200kbps! */ +#define BULK_DATA_RECEIVING_TIMEOUT (120000) +#endif + +/** Number of pre-allocated buffers */ +#define COMMAND_BUFFER_COUNT 16 +/** Number of pre-allocated buffers */ +#define BULK_BUFFER_COUNT 16 + +/** Size of a buffer used for commands. */ +#define COMMAND_BUFFER_SIZE 0x00010000 + +/** Size of a buffer used for bulk transfer, + * must be biger than buffer for commands. */ +#define BULK_BUFFER_SIZE 0x00100000 + + +/** Mask for clearing the state bits in session/state field */ +#define MASK_CLR_STATE (0xFFFC) +/** Mask for selecting the state bits in session/state field */ +#define MASK_SELECT_STATE (0x0003) +/** Mask for selecting the session number in session/state field */ +#define MASK_SELECT_SESSION_NUMBER (0x3FFF) +/** Mask for selecting session bits */ +#define SESSION_MASK 0xFFFC + +/** + * Defines all posible types of buffers that can be created (allocated). + * + * It is used to specified the type of the buffer + * when allocating a new buffer. Also it is used when + * requesting the number of buffers to specify the buffer type. + */ +typedef enum { + UNDEFINED_BUFFER = 0, /** Buffer with no specified type.*/ + COMMAND_BUFFER = 1, /** Command buffer type, used for commands.*/ + BULK_BUFFER = 2 /** Bulk buffer type, used for bulk transfer.*/ +} BuffersType_t; + +/** The enum for buffer Flags values. */ +TYPEDEF_ENUM { + BUF_FREE = 0x00000000, /**< No buffer activity */ + BUF_ALLOCATED = 0x00000001, /**< The buffer is allocated. */ + BUF_TX_READY = 0x00000002, /**< The buffer is filled with data + and is ready to be sent. */ + BUF_TX_SENDING = 0x00000004, /**< The buffer is sending. */ + BUF_TX_SENT = 0x00000008, /**< The buffer is sent and wait ACK. */ + BUF_TX_DONE = 0x00000010, /**< The buffer has been sent and can + be deallocated. */ + BUF_TX_TIMEOUT = 0x00000020, /**< The timeout ocure when buffer is + sending. */ + BUF_RX_READY = 0x00000040, /**< The buffer is filled with + received data and is ready for + processing. */ + BUF_HDR_CRC_OK = 0x00000080, /**< Set to true if the CRC has been + calculated. */ + BUF_PAYLOAD_CRC_OK = 0x00000100, /**< Set to true if the CRC has been + calculated and is correct. */ + BUF_ACK_READY = 0x00000200, /**< Set the buffer ready for + acknowledge. */ + BUF_ACKNOWLEDGED = 0x00000400, /**< Set if the buffer is + acknowledged. */ + BUF_CRC_CALC_READY = 0x00000800, /**< Set if the buffer is ready for + payload CRC calculating */ + BUF_CRC_CALCULATING = 0x00001000, /**< Set if the calculating of + payload CRC is started */ + BUF_HEADER_CRC_CALCULATED = 0x00002000, /**< Set if the header CRC is + calculated */ + BUF_PAYLOAD_CRC_CALCULATED = 0x00004000, /**< Set if the payload CRC is + calculated */ +} ENUM32(PacketFlags_t); + +/** Flags Masks **/ +#define PACKET_ALLOCATION_STATE_MASK (BUF_FREE | BUF_ALLOCATED) +#define PACKET_TX_STATE_MASK (BUF_TX_READY | BUF_TX_SENDING | BUF_TX_SENT | BUF_TX_DONE | BUF_TX_TIMEOUT) +#define PACKET_RX_STATE_MASK (BUF_RX_READY | BUF_HDR_CRC_OK | BUF_PAYLOAD_CRC_OK | BUF_ACK_READY | BUF_ACKNOWLEDGED) +#define PACKET_CRC_STATE_MASK (BUF_CRC_CALC_READY | BUF_CRC_CALCULATING | BUF_PAYLOAD_CRC_CALCULATED | BUF_HEADER_CRC_CALCULATED) + +/** Macro for setting a packet state **/ +#define SET_PACKET_FLAGS(packet, mask, flags) \ + do \ + { \ + (packet)->Flags &= ~(mask); \ + (packet)->Flags |= (mask & flags); \ + } while (0) + +#define CHECK_PACKET_FLAGS(packet, flags) (((flags) == ((packet)->Flags & (flags))) ? TRUE : FALSE) + +/** Defined state of the receiver */ +typedef enum { + RECEIVE_HEADER, /**< State for receiving Header.*/ + RECEIVE_EXTENDED_HEADER, /**< State for receiving Extended Header.*/ + RECEIVE_PAYLOAD, /**< State for receiving Payload.*/ + RECEIVE_ERROR /**< State for error handling.*/ +} R15_InboundState_t; + +/** Defined state of the transmitter */ +typedef enum { + SEND_IDLE, /**< Transmiter idle state.*/ + SEND_HEADER, /**< Transmiter send header and extended header. */ + SENDING_HEADER, /**< Transmiter is in process sending the header and extended header. */ + SEND_PAYLOAD, /**< Transmiter send payload. */ + SENDING_PAYLOAD /**< Transmiter is in process sending payload.*/ +} R15_OutboundState_t; + +/** + * Command buffer used for sending and receiving commands. + */ +typedef struct { + uint32 Id; /**< The buffer ID. NOTE: Currently is + not used */ + uint32 Canary0; /**< A canary value. NOTE: Currently is + not used */ + uint8 Payload[COMMAND_BUFFER_SIZE]; /**< The buffer containing the raw packet + data. NOTE! The buffer includes all + the data that is sent + (header, data and CRC) */ + uint32 Canary1; /**< A canary value. NOTE: Currently is + not used */ +} CommandBuffer_t; + +/** Structure for the bulk buffer type. */ +typedef struct { + uint32 Id; /**< The buffer ID. NOTE: Currently is + not used */ + uint32 Canary0; /**< A canary value. NOTE: Currently is + not used */ + uint8 Payload[BULK_BUFFER_SIZE]; /**< The buffer containing the raw packet + data. NOTE! The buffer includes all + the data that is sent + (header, data and CRC) */ + uint32 Canary1; /**< A Canary value. NOTE: Currently is + not used */ +} BulkBuffer_t; + +typedef void (*PacketCallBack_t)(Communication_t *Communication_p, const void *Data_p); + +/** Structure for the packet meta data. */ +typedef struct PacketMeta { + PacketCallBack_t CallBack_p; /**< Cllback function used after + sending packet.*/ + uint32 Flags; /**< Field is a bit-field. Flags + for the Packet state. */ + int BufferSize; /**< Field contains a Size of the + corresponding buffer used in + the packet. */ + R15_Header_t Header; /**< Structure of the header. */ + uint32 Resend; /**< Resend counter. */ + Timer_t *Timer_p; /**< Timer data used for + sending/reciving packet. */ + uint8 *ExtendedHeader_p; /**< Pointer to the extended + header located in the packet. */ + uint8 *Payload_p; /**< Pointer to the payload data + located in the packet. */ + uint8 *Buffer_p; /**< Field contains a pointer to + the corresponding (type) + buffer. */ + uint32 Canary; /**< Field contains the master + Canary value. NOTE: Currently + is not used */ + Communication_t *Communication_p; /**< The communication over which + this packet has been/is to be + transferred over. */ + uint8 Hash[SHA_256_HASH_LENGTH]; /**< Field contain calculated hash + for payload. */ +} PacketMeta_t; + +/** Retransmission context. */ +typedef struct { + uint32 Timeout; /**< Defined timeout for retransmission. */ + uint32 TimerKey; /**< Timer identification number.*/ + uint32 Key; /**< Generated unique key, used for marking packet for + retransmission or removing from + retransmission list. */ + PacketMeta_t *Packet_p; /**< Pointer to the packet for retransmission. */ +} RetransmissionContext_t; + + +/** Structure for handling incoming R15 packets.*/ +typedef struct { + /**< State of the state machine for handling incoming R15 packets. */ + R15_InboundState_t State; + /**< Number of requested data for receiving from communication device. */ + uint32 ReqData; + /**< Number of receivied data from communication device. */ + uint32 RecData; + /**< Number of receivied data from backup buffer used for switching the + * protocol family. */ + uint32 RecBackupData; + /**< Offset in the buffer for next data that should be received. */ + uint32 ReqBuffOffset; + /**< Temporary pointer to buffer for handling received data.*/ + uint8 *Target_p; + /**< Temporary buffer for receiving data. */ + uint8 Scratch[ALIGNED_HEADER_LENGTH + ALIGNED_BULK_EXTENDED_HEADER_LENGTH]; + /** Temporary structure for handling R15 packet.*/ + R15_Header_t Header; + /** Poiter to meta data for allocated buffer for handling R15 packet.*/ + PacketMeta_t *Packet_p; + /** Error flag, purposed for error handling.*/ + ErrorCode_e LCM_Error; +} R15_Inbound_t; + + +/** Structure for handling outgoing R15 packets.*/ +typedef struct { + /**< State of the state machine for handling outgoing R15 packets. */ + R15_OutboundState_t State; + /** Temporary pointer for handling PROTROM packet.*/ + PacketMeta_t *Packet_p; + /**< Boolean value for controling re-entry in transmiter fucntion. */ + boolean InLoad; + /** Error flag, purposed for error handling.*/ + ErrorCode_e LCM_Error; +} R15_Outbound_t; + + +/** R15 Network context */ +typedef struct { + PacketMeta_t *MetaInfoList[COMMAND_BUFFER_COUNT+BULK_BUFFER_COUNT]; + /**< List of meta data for used packets. */ + RetransmissionContext_t *RetransmissionList[MAX_SIZE_RETRANSMISSION_LIST]; + /**< List of packet for retransmision */ + uint32 RetransmissionListCount; + /**< Counter for packets retransmision */ + R15_Inbound_t Inbound; + /**< Context for receiver. */ + R15_Outbound_t Outbound; + /**< Context for transmiter. */ +} R15_NetworkContext_t; + +/* + * XVSZOAN @TODO: + * + * This structure is only for UART Process File fix. + * When we start using ESB block for data verification + * structure should be deleted! + */ +typedef struct { + const uint8 *Data_Packet_p; + uint32 Packet_Size; + uint32 UART_Device; + boolean New_Packed_Arrived; +} DataBox_t; + +/** @} */ +/** @} */ +/** @} */ +#endif /*_T_R15_NETWORK_LAYER_H_*/ diff --git a/source/LCM/include/t_security_algorithms.h b/source/LCM/include/t_security_algorithms.h new file mode 100644 index 0000000..5bae6c1 --- /dev/null +++ b/source/LCM/include/t_security_algorithms.h @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_SECURITY_ALGORITHMS_H_ +#define _T_SECURITY_ALGORITHMS_H_ +/** + * \addtogroup ldr_security_algorithms + * @{ + */ + +/******************************************************************************* + * Includes + ******************************************************************************/ +#include "t_basicdefinitions.h" + +/******************************************************************************* + * Types, constants + ******************************************************************************/ +/** Defined value for HASH error. */ +#define HASH_ERROR 0xffffffff + +/** Length of SHA256 algorithm results */ +#define SHA256_LENGTH 32 + +/** Length of CRC16 algorithm results */ +#define CRC16_LENGTH 2 + +/** */ +#define MAX_NR_IN_QUEUE_TOKENS 16 + +/** */ +typedef void (*HashCallback_fn)(void *Data_p, uint32 Length, uint8 *Hash_p, void *Param_p); + +/** Type of hash algorithm */ +typedef enum { + HASH_SHA256 = 0x0001, /**< 4LSB SHA-256 algorithm */ + HASH_CRC16 = 0x0002, /**< CRC16 */ + HASH_SIMPLE_XOR = 0x0003, /**< 4LSB Simple XOR algorithm */ + HASH_NONE = 0x0004 /**< Communication is not hash secured */ +} HashType_e; + +/** @} */ +#endif /*_T_SECURITY_ALGORITHMS_H_*/ diff --git a/source/LCM/include/t_time_utilities.h b/source/LCM/include/t_time_utilities.h new file mode 100644 index 0000000..bcc8254 --- /dev/null +++ b/source/LCM/include/t_time_utilities.h @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ +#ifndef _T_TIME_UTILITIES_H_ +#define _T_TIME_UTILITIES_H_ +/** + * @addtogroup ldr_time_utilities + * @{ + */ + +/******************************************************************************* + * Types, constants + ******************************************************************************/ + +/** MAX defined timers */ +#define MAX_TIMERS 100 + +/** defined type of function pointer to the handle function */ +typedef void (*HandleFunction_t)(void *Param_p, void *Timer_p, void *Data_p); + +/** + * Structure of timer data + */ +typedef struct { + uint32 Time; /**< Requested for timer time.*/ + uint32 PeriodicalTime; /**< Requested periodical time for timer.*/ + HandleFunction_t HandleFunction_p; /**< Callback function*/ + void *Data_p; /**< Pointer to data. */ + void *Param_p; /**< Extra parameters. */ +} Timer_t; + +/** + * Header for buffer of timers + */ +typedef struct { + uint32 MaxTimers; + uint32 ActiveTimers; + Timer_t *Timers_p; +} TimerHeader_t; + +/** @} */ +#endif /*_T_TIME_UTILITIES_H_*/ |