Fix device_info for v1/v2.

Change-Id: I77c1da11f042bf2523d5768b18c18b9a0e1e0c6e
diff --git a/mbtk/mbtk_utils_linux/Makefile b/mbtk/mbtk_utils_linux/Makefile
index c2427bc..9e6c72b 100755
--- a/mbtk/mbtk_utils_linux/Makefile
+++ b/mbtk/mbtk_utils_linux/Makefile
@@ -5,8 +5,8 @@
 #DEFINE = -DMBTK_DEV_INFO_VERSION_2
 #endif
 
-INC_DIR += \
-		-I$(LOCAL_PATH)
+#INC_DIR += \
+#		-I$(LOCAL_PATH)
 
 CC=gcc
 
diff --git a/mbtk/mbtk_utils_linux/mbtk_device.h b/mbtk/mbtk_utils_linux/mbtk_device.h
new file mode 100755
index 0000000..d4e0c03
--- /dev/null
+++ b/mbtk/mbtk_utils_linux/mbtk_device.h
@@ -0,0 +1,155 @@
+/*
+* mbtk_device.h
+*
+* MBTK device_info partition data header.
+*
+* Author : lb
+* Date   : 2023/12/30 11:36:35
+*/
+#ifndef _MBTK_DEVICE_H
+#define _MBTK_DEVICE_H
+//#include "mbtk_type.h"
+
+#define MBTK_DEVICE_INFO_PARTITION_NAME "device_info"
+#define MBTK_DEVICE_INFO_PARTITION_TAG 0x87878787
+#define MBTK_DEVICE_INFO_CURR_VERSION 2
+
+// 78,147,482,134742231
+#define MBTK_BAND_ALL_GSM_DEFAULT 78             // GSM : ASR default.
+#define MBTK_BAND_ALL_WCDMA_DEFAULT 147          // WCDMA : ASR default.
+#define MBTK_BAND_ALL_TDLTE_DEFAULT 482          // TDD-LTE : ASR default.
+#define MBTK_BAND_ALL_FDDLTE_DEFAULT 134742231   // FDD-LTE : ASR default.
+#define MBTK_BAND_ALL_EXT_LTE_DEFAULT 0          // EXT-LTE
+#define MBTK_BAND_ALL_NR_3_DEFAULT 0
+#define MBTK_BAND_ALL_NR_2_DEFAULT 24576         // n78/n79
+#define MBTK_BAND_ALL_NR_1_DEFAULT 256           // n41
+#define MBTK_BAND_ALL_NR_0_DEFAULT 134217877     // n1/n3/n5/n8/n28
+
+#define MBTK_BAND_CN_GSM_DEFAULT 11             // GSM : B3/B8 (PGSM 900/DCS GSM 1800/EGSM 900)
+#define MBTK_BAND_CN_WCDMA_DEFAULT 145          // WCDMA : B1/B5/B8
+#define MBTK_BAND_CN_TDLTE_DEFAULT 482          // TDD-LTE : B34/B38/B39/B40/B41
+#define MBTK_BAND_CN_FDDLTE_DEFAULT 149         // FDD-LTE : B1/B3/B5/B8
+#define MBTK_BAND_CN_EXT_LTE_DEFAULT 0          // EXT-LTE
+#define MBTK_BAND_CN_NR_3_DEFAULT 0
+#define MBTK_BAND_CN_NR_2_DEFAULT 24576         // n78/n79
+#define MBTK_BAND_CN_NR_1_DEFAULT 384           // n40/n41
+#define MBTK_BAND_CN_NR_0_DEFAULT 134217877     // n1/n3/n5/n8/n28
+
+#define MBTK_BAND_EU_GSM_DEFAULT 11             // GSM : B3/B8 (PGSM 900/DCS GSM 1800/EGSM 900)
+#define MBTK_BAND_EU_WCDMA_DEFAULT 145          // WCDMA : B1/B5/B8
+#define MBTK_BAND_EU_TDLTE_DEFAULT 416          // TDD-LTE : B38/B40/B41
+#define MBTK_BAND_EU_FDDLTE_DEFAULT 134742229   // FDD-LTE : B1/B3/B5/B7/B8/B20/B28
+#define MBTK_BAND_EU_EXT_LTE_DEFAULT 0          // EXT-LTE
+#define MBTK_BAND_EU_NR_3_DEFAULT 0
+#define MBTK_BAND_EU_NR_2_DEFAULT 12352         // n71/n77/n78
+#define MBTK_BAND_EU_NR_1_DEFAULT 416           // n38/n40/n41
+#define MBTK_BAND_EU_NR_0_DEFAULT 134742229     // n1/n3/n5/n7/n8/n20/n28
+
+#define MBTK_BAND_SA_GSM_DEFAULT 79             // GSM : B2/B3/B5/B8(GSM 850/PGSM 900/EGSM 900/DCS GSM 1800/PCS GSM 1900)
+#define MBTK_BAND_SA_WCDMA_DEFAULT 155          // WCDMA : B1/B2/B4/B5/B8
+#define MBTK_BAND_SA_TDLTE_DEFAULT 128          // TDD-LTE : B40
+#define MBTK_BAND_SA_FDDLTE_DEFAULT 134217951  // FDD-LTE : B1/B2/B3/B4/B5/B7/B8/B28
+#define MBTK_BAND_SA_EXT_LTE_DEFAULT 2          // EXT-LTE : B66
+#define MBTK_BAND_SA_NR_3_DEFAULT MBTK_BAND_ALL_NR_3_DEFAULT
+#define MBTK_BAND_SA_NR_2_DEFAULT MBTK_BAND_ALL_NR_2_DEFAULT
+#define MBTK_BAND_SA_NR_1_DEFAULT MBTK_BAND_ALL_NR_1_DEFAULT
+#define MBTK_BAND_SA_NR_0_DEFAULT MBTK_BAND_ALL_NR_0_DEFAULT
+
+#define MBTK_DEVICE_INFO_ITEM_STR_BASIC "BASIC"
+#define MBTK_DEVICE_INFO_ITEM_STR_FOTA "FOTA"
+#define MBTK_DEVICE_INFO_ITEM_STR_MODEM "MODEM"
+#define MBTK_DEVICE_INFO_ITEM_STR_LOG "LOG"
+
+#define MBTK_DEVICE_INFO_ITEM_ADDR_BASIC    0x100   // Header is 0x100
+#define MBTK_DEVICE_INFO_ITEM_ADDR_FOTA     0x500   // Basic is 1k
+#define MBTK_DEVICE_INFO_ITEM_ADDR_MODEM    0x900   // Fota is 1k
+#define MBTK_DEVICE_INFO_ITEM_ADDR_LOG      0xD00   // Modem is 1k
+
+#define MBTK_NET_SUPPORT_2G (1)
+#define MBTK_NET_SUPPORT_3G (1<<1)
+#define MBTK_NET_SUPPORT_4G (1<<2)
+#define MBTK_NET_SUPPORT_5G (1<<3)
+
+typedef enum {
+    MBTK_DEVICE_INFO_ITEM_BASIC = 0,
+    MBTK_DEVICE_INFO_ITEM_FOTA,
+    MBTK_DEVICE_INFO_ITEM_MODEM,
+    MBTK_DEVICE_INFO_ITEM_LOG,
+
+    MBTK_DEVICE_INFO_ITEM_NUM
+} mbtk_device_info_item_enum;
+
+typedef struct {
+    mbtk_device_info_item_enum item;
+    uint32 addr;
+} mbtk_device_info_item_header_t;
+
+typedef struct {
+    uint32 tag;
+    uint32 version;             // Default : 0x01
+    uint32 item_count;
+    mbtk_device_info_item_header_t item_header[MBTK_DEVICE_INFO_ITEM_NUM];
+} mbtk_device_info_header_t;
+
+typedef enum {
+    MBTK_REBOOT_FLAG_NORMAL = 0,
+    MBTK_REBOOT_FLAG_DOWNLOAD,
+    MBTK_REBOOT_FLAG_POWER_OFF,  //Power off and restart
+    MBTK_REBOOT_FLAG_HARDWARE,   //Hardware restart
+    MBTK_REBOOT_FLAG_COMMAND,    //"reboot" "reboot -f" Command restart
+    MBTK_REBOOT_FLAG_ABNORMAL,   //Abnormal restart
+    MBTK_REBOOT_FLAG_UNKNOWN,    //unknown restart
+} mbtk_device_info_reboot_flag_enum;
+
+typedef struct {
+    uint8 name[16];
+    uint32 version;             // Default : 0x01
+    uint8 project[16];          // T108 / L508_X6
+    uint8 project_cust[16];     // T108_C1 / L508_X6_C1  (Refer to: Custom_Model in blf file.)
+    uint32 ab_support;          // 1 for ab
+    mbtk_device_info_reboot_flag_enum reboot_flag;
+    uint8 revision_out[48];     // L508_X6v01.01b04.00
+    uint8 revision_in[64];
+    uint8 build_time[64];
+    uint8 asr_baseline[64];
+} mbtk_device_info_basic_t;
+
+typedef struct {
+    uint8 name[16];
+    uint32 version;             // Default : 0x01
+    uint32 state;               //
+} mbtk_device_info_fota_t;
+
+typedef enum {
+    MBTK_MODEM_BAND_AREA_ALL,
+    MBTK_MODEM_BAND_AREA_CN,
+    MBTK_MODEM_BAND_AREA_EU,
+    MBTK_MODEM_BAND_AREA_SA
+} mbtk_modem_band_area_enum;
+
+typedef struct {
+    uint8 name[16];
+    uint32 version;             // Default : 0x01
+    mbtk_modem_band_area_enum band_area;
+    uint32 net_pref;    // Refor to : mbtk_net_pref_enum
+    uint32 net_support; // 1:GSM      2:WCDMA   4:LTE   8:NR
+    uint32 band_gsm;
+    uint32 band_wcdma;
+    uint32 band_tdlte;
+    uint32 band_fddlte;
+    uint32 band_lte_ext;
+    uint32 band_nr_3;
+    uint32 band_nr_2;
+    uint32 band_nr_1;
+    uint32 band_nr_0;
+} mbtk_device_info_modem_t;
+
+typedef struct {
+    uint8 name[16];
+    uint32 version;             // Default : 0x01
+    uint32 state;               //
+} mbtk_device_info_log_t;
+
+
+#endif /* _MBTK_DEVICE_H */
+
diff --git a/mbtk/mbtk_utils_linux/mbtk_type.h b/mbtk/mbtk_utils_linux/mbtk_type.h
new file mode 100755
index 0000000..c7fc885
--- /dev/null
+++ b/mbtk/mbtk_utils_linux/mbtk_type.h
@@ -0,0 +1,123 @@
+#ifndef MBTK_TYPE_INCLUDE
+#define MBTK_TYPE_INCLUDE
+#include <stdio.h>
+#include <stdbool.h>
+#include <sys/types.h>
+
+#ifndef MBTK_PLATFORM_LINUX
+#define MBTK_PLATFORM_LINUX
+#endif
+
+#ifndef MBTK_PLATFORM_QCOMM
+//#define MBTK_PLATFORM_QCOMM
+#endif
+
+#define MBTK_SUCCESS 0
+#define MBTK_FAILE (-1)
+
+#ifndef UNUSED
+#define UNUSED(param) ((void) param)
+#endif
+
+#ifndef UNUSEDPARAM
+#define UNUSEDPARAM(param) ((void) param)
+#endif
+
+#ifndef TRUE
+#define TRUE   1   /* Boolean true value. */
+#endif
+
+#ifndef true
+#define true   1   /* Boolean true value. */
+#endif
+
+#ifndef FALSE
+#define FALSE  0   /* Boolean false value. */
+#endif
+
+#ifndef false
+#define false  0   /* Boolean false value. */
+#endif
+
+
+#ifndef NULL
+#define NULL  0
+#endif
+
+
+#ifndef null
+#define null  0
+#endif
+
+/**
+ * Compiler-digit : 16
+ * char : 1     (%c)
+ * char* : 2
+ * short int : 2
+ * int : 2      (%d)
+ * unsigned int : 2  (%u)
+ * float : 4    (%f)
+ * double : 8   (%f)
+ * long : 4
+ * unsigned long : 4
+ * long long : 8
+ * unsigned long long : 8
+ *
+ *
+ * Compiler-digit : 32
+ * char : 1
+ * char* : 4
+ * short int : 2
+ * int : 4
+ * unsigned int : 4
+ * float : 4
+ * double : 8
+ * long : 4
+ * unsigned long : 4
+ * long long : 8
+ * unsigned long long : 8
+ *
+ *
+ * Compiler-digit : 64
+ * char : 1
+ * char* : 8
+ * short int : 2
+ * int : 4
+ * unsigned int : 4
+ * float : 4
+ * double : 8
+ * long : 8
+ * unsigned long : 8
+ * long long : 8
+ * unsigned long long : 8
+ */
+typedef unsigned char boolean; /* Boolean value type. */
+// typedef unsigned char bool; /* Boolean value type. */
+typedef unsigned long long uint64; /* Unsigned 64 bit value */
+typedef unsigned long long uint64_t; /* Unsigned 64 bit value */
+typedef unsigned int uint32; /* Unsigned 32 bit value */
+typedef unsigned int uint32_t; /* Unsigned 32 bit value */
+typedef unsigned short uint16; /* Unsigned 16 bit value */
+typedef unsigned short uint16_t;
+typedef unsigned char uint8; /* Unsigned 8  bit value */
+typedef unsigned char uint8_t;
+typedef signed long long int64; /* Signed 64 bit value */
+typedef signed long long sint64; /* Signed 64 bit value */
+typedef signed int int32; /* Signed 32 bit value */
+typedef signed int sint32; /* Signed 32 bit value */
+typedef signed short int16; /* Signed 16 bit value */
+typedef signed short sint16; /* Signed 16 bit value */
+typedef signed char int8; /* Signed 8  bit value */
+typedef signed char sint8; /* Signed 8  bit value */
+typedef unsigned char byte; /* byte type */
+
+
+typedef struct
+{
+    char *buffer;
+    int size;
+    int size_max;
+} mbtk_buffer_t;
+
+
+#endif /* MBTK_TYPE_INCLUDE */