2 /**************************************************************************************
3 * File Name : tpLinuxTag.h
5 * Description: add tag with validation system to the firmware image file to be uploaded
8 * Created : 16Sep07, Liang Qiming
9 **************************************************************************************/
11 #ifndef _TP_LINUX_TAG_H_
12 #define _TP_LINUX_TAG_H_
15 * File tag (head) structure all is in clear text
16 * except validationTokens (crc, md5, sha1, etc).
18 * Total: 128 unsigned chars
22 #define SIG_LEN_2 12 // Original second SIG = 20 is now devided into 14 for SIG_LEN_2 and 6 for CHIP_ID
25 #define BOARD_ID_LEN 16
28 * TAG for downloadable image (kernel plus file system)
29 * integer in the structure is stored in Network-Byte order (BIG-endian)
31 typedef struct _tplink_image_header_t {
32 unsigned long tagVersion;
33 char signiture_1[SIG_LEN]; // text line for company info
34 char signiture_2[SIG_LEN_2]; // additional info (can be version number)
35 char chipId[CHIP_ID_LEN]; // chip id
36 char boardId[BOARD_ID_LEN]; // board id
37 unsigned long productId; // product id
38 unsigned long productVer; // product version
39 unsigned long reserved1; // reserved for future
41 unsigned char imageValidationToken[TOKEN_LEN]; // image validation token - md5 checksum
42 unsigned char kernelValidationToken[TOKEN_LEN]; // kernel+tag validation token - md5 checksum
44 unsigned long kernelTextAddr; // text section address of kernel
45 unsigned long kernelEntryPoint; // entry point address of kernel
47 unsigned long totalImageLen; // the sum of kernelLen+rootfsLen+tagLen
49 unsigned long kernelAddress; // starting address (offset from the beginning of FILE_TAG) of kernel image
50 unsigned long kernelLen; // length of kernel image
52 unsigned long rootfsAddress; // starting address (offset) of filesystem image
53 unsigned long rootfsLen; // length of filesystem image
55 unsigned long bootloaderAddress; // starting address (offset) of boot loader image
56 unsigned long bootloaderLen; // length of boot loader image
58 } tplink_image_header_t;
60 #endif /* ifndef _TP_LINUX_TAG_H_ */