kb_ota.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:4k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef  KB_OTA_H
  2. #define KB_OTA_H
  3. #include "Kb_porting.h"
  4. //----------------------------------------------------------------------------
  5. // Inner definition, for kb_ota.c
  6. //----------------------------------------------------------------------------
  7. //dynamic memory size needed for this module, about 80K
  8. #define DYNAMIC_MEMORY_SIZE (80*1024)
  9. //unset parameter
  10. #define UNSET_PARAM 0xffff
  11. //loader nvm address define
  12. #define _M_NVRAM_BASE_ADDRESS (0)
  13. #define _M_NVRAM_LOADER_ADDR        (_M_NVRAM_BASE_ADDRESS+512)
  14. //unused parameters
  15. #define DUMMY_PARAMETER 0xffffffff
  16. //#define OTA_TEST
  17. //#define OTA_TEST1
  18. #define OTA_SWITCH_OPEN
  19. //-----------------------------------------------------------------------------
  20. // external Data Struct Prototypes:
  21. //-----------------------------------------------------------------------------
  22. //
  23. //CAT, PMT, SDT, TDT State
  24. enum
  25. {
  26. E_RESET_STATE = 0,
  27. E_STOPPED_NODATA_STATE,
  28. E_STOPPED_WITH_DATA_STATE,
  29. E_IN_STARTING_STATE
  30. };
  31. //Irdeto BAT Struct //For Bug101
  32. typedef struct
  33. {
  34. UInt16 transport_stream_id;
  35. UInt16 original_network_id;
  36. UInt16 service_id;
  37. UInt8  linkage_type;
  38. UInt16  manufacturer_code;
  39. UInt8 control_byte_1;
  40. UInt16 major_hw_version;
  41. UInt16 minor_hw_version;
  42. UInt16 hw_batch_no;
  43. UInt16 major_sw_version;
  44. UInt16 minor_sw_version;
  45. UInt8 stb_type;
  46. UInt16 region_code_start;
  47. UInt16 region_code_end;
  48. UInt8 upgrage_type;
  49. UInt32 stb_sequence_start;
  50. UInt32 stb_sequence_end;
  51. UInt8 time;
  52. UInt8  control_byte_2;
  53. }TF_Linkage_Descriptor;
  54. //Irdeto BAT Struct //For Bug101
  55. typedef struct
  56. {
  57. UInt16  manufacturer_code;
  58. UInt8 major_hw_version;
  59. UInt8 minor_hw_version;
  60. UInt16 hw_batch_no;
  61. UInt8 major_sw_version;
  62. UInt8 minor_sw_version;
  63. }TF_STREAM_PARA;
  64. //loader 参数
  65. typedef struct _TFOtaDate
  66.      UInt16 year;
  67.      UInt8 month;
  68.      UInt8 day;
  69. }TFOtaDate;
  70. typedef struct _TFOtaTime
  71.      UInt8 hour;
  72.      UInt8 minute;
  73.      UInt8 second;
  74. }TFOtaTime;
  75. typedef struct _TFLoaderPara
  76. {
  77. UInt32 IMAGE_SIZE;        /*字节数*/
  78. UInt8     KB_MANUFACTURER_ID;       /*根据厂家分配*/
  79. UInt32   STB_SERIAL_NO;         /*机顶盒序列号*/
  80. UInt8     KB_HARDWARE_VERSION_NUMBER;
  81. UInt16   KB_HARDWARE_MAJOR_VERSION_NUMBER;
  82. UInt16   KB_HARDWARE_MINOR_VERSION_NUMBER;
  83. UInt16   KB_HARDWARE_BATCH_NO;
  84. UInt16   LOAD_SEQUENCE_NUMBER;     /* loader序列号*/  
  85. UInt16   KB_SOFTWARE_MAJOR_VERSION_NUMBER;     /*软件版本号*/
  86. UInt16   KB_SOFTWARE_MINOR_VERSION_NUMBER;
  87. UInt16 kB_REGION_CODE;   /* 区域号 */
  88. UInt8   kB_KeY_TYPE;
  89. TFOtaDate SIGN_DATE;  
  90. TFOtaTime SIGN_TIME;  
  91. TFOtaDate DLOAD_DATE;  
  92. TFOtaTime DLOAD_TIME;  
  93. UInt16 DLOAD_DUR;   
  94.  
  95. }TFLoaderPara;
  96. #define MAX_IRDETO_LINKAGES 100
  97. //CA Client Service Types
  98. enum
  99. {
  100. //From Application
  101. E_NEW_TS_ASSOCIATED,
  102. E_CURRENT_TS_DEASSOCIATED,
  103. E_NEW_SERVICE_REQUEST,
  104. E_STOP_CURRENT_SERVICE,
  105. E_RESET_STORED_INFORMATION,
  106.        E_FILTER_SETPU,
  107. E_NIT_FILTER_SETUP,
  108. E_PAT_FILTER_SETUP,
  109. //For Download service
  110. E_DOWNLOAD_CHECKING,
  111. E_DOWNLOAD_SEARCHING,
  112. E_PAT_REACH,
  113. E_DOWNLOAD_CONTROL_SECTION,
  114. //From HDMX
  115. E_CAT_REACH,
  116. E_SDT_REACH,
  117. E_PMT_REACH,
  118. E_TDT_REACH,
  119. E_BAT_REACH,
  120. E_NIT_REACH,
  121. E_DII_REACH,
  122. E_DSI_REACH,
  123. E_FE_LOCKED,
  124. E_REGISTER_ERROR_REQ,
  125. E_CRC_ERROR
  126. };
  127. enum
  128. {
  129. IRD_DL_NIT_FAIL,
  130. IRD_DL_SVC_FAIL,
  131. IRD_DL_CONN_FAIL,
  132. IRD_DL_NOT_PRESENT,
  133. IRD_DL_PARA1_NOT_EQUAL,
  134. IRD_DL_PARA2_NOT_EQUAL,
  135. IRD_DL_PRESENT
  136. };
  137. typedef enum {
  138.     SPY_STATUS_IN_STARTING = 0,
  139.     SPY_STATUS_STARTED,
  140.     SPY_STATUS_STOPPED,
  141.     SPY_STATUS_DUMMY
  142. } SPY_STATUS_t;  
  143. enum
  144. {
  145. OTA_FORCED,                     /*强制升级*/
  146. OTA_USER_CONFORMED, /*用户许可升级*/
  147. OTA_MANUL, /*手动升级*/
  148. OTA_INVALID
  149. };
  150. typedef  struct  _Ota_Hint_Message{
  151. char   ota_hint_message[50];
  152. int        flag;
  153. }Ota_Hint_Message;
  154. //-----------------------------------------------------------------------------
  155. // external Function Prototypes:
  156. //-----------------------------------------------------------------------------
  157. //
  158. #endif